(* Title: Dual_Ordered_Lattice.thy Authors: Makarius; Peter Gammie; Brian Huffman; Florian Haftmann, TU Muenchen *)
section‹Type of dual ordered lattices›
theory Dual_Ordered_Lattice imports Main begin
text‹ The 🪙‹dual›of an ordered structure is an isomorphic copy of the underlying type, with the ‹≤›relation defined as the inverse of the original one. The class of lattices is closed under formation of dual structures. This means that for any theorem of lattice theory, the dualized statement holds as well; this important fact simplifies many proofs of lattice theory. ›
typedef 'a dual = "UNIV :: 'a set" morphisms undual dual ..
setup_lifting type_definition_dual
code_datatype dual
lemma dual_eqI: "x = y"if"undual x = undual y" using that by transfer assumption
lemma dual_eq_iff: "x = y ⟷ undual x = undual y" by transfer simp
lemma eq_dual_iff [iff]: "dual x = dual y ⟷ x = y" by transfer simp
lemma undual_dual [simp, code]: "undual (dual x) = x" by transfer rule
lemma dual_undual [simp]: "dual (undual x) = x" by transfer rule
lemma bij_dual: "bij dual" using inj_dual surj_dual by (rule bijI)
lemma bij_undual: "bij undual" using inj_undual surj_undual by (rule bijI)
instance dual :: (finite) finite proof from finite have"finite (range dual :: 'a dual set)" by (rule finite_imageI) thenshow"finite (UNIV :: 'a dual set)" by (simp add: surj_dual) qed
instantiation dual :: (equal) equal begin
lift_definition equal_dual :: "'a dual ==> 'a dual ==> bool" is HOL.equal .
instance by (standard; transfer) (simp add: equal)
context fixes f :: "'a::complete_lattice ==> 'a" and g :: "'a dual ==> 'a dual" assumes"mono f" defines"g ≡ dual ∘ f ∘ undual" begin
private lemma mono_dual: "mono g" proof fix x y :: "'a dual" assume"x ≤ y" thenhave"undual y ≤ undual x" by (simp add: dual_less_eq_iff) with‹mono f›have"f (undual y) ≤ f (undual x)" by (rule monoD) thenhave"(dual ∘ f ∘ undual) x ≤ (dual ∘ f ∘ undual) y" by simp thenshow"g x ≤ g y" by (simp add: g_def) qed
lemma lfp_dual_gfp: "lfp f = undual (gfp g)" (is"?lhs = ?rhs") proof (rule antisym) have"dual (undual (g (gfp g))) ≤ dual (f (undual (gfp g)))" by (simp add: g_def) with mono_dual have"f (undual (gfp g)) ≤ undual (gfp g)" by (simp add: gfp_unfold [where f = g, symmetric] dual_less_eq_iff) thenshow"?lhs ≤ ?rhs" by (rule lfp_lowerbound) from‹mono f›have"dual (lfp f) ≤ dual (undual (gfp g))" by (simp add: lfp_fixpoint gfp_upperbound g_def) thenshow"?rhs ≤ ?lhs" by (simp only: less_eq_dual_iff) qed
lemma gfp_dual_lfp: "gfp f = undual (lfp g)" proof - have"mono (λx. undual (undual x))" by (rule monoI) (simp add: dual_less_eq_iff) moreoverhave"mono (λa. dual (dual (f a)))" using‹mono f›by (auto intro: monoI dest: monoD) moreoverhave"gfp f = gfp (λx. undual (undual (dual (dual (f x)))))" by simp ultimatelyhave"undual (undual (gfp (λx. dual (dual (f (undual (undual x))))))) = gfp (λx. undual (undual (dual (dual (f x)))))" by (subst gfp_rolling [where g = "λx. undual (undual x)"]) simp_all thenhave"gfp f = undual (undual (gfp (λx. dual (dual (f (undual (undual x)))))))" by simp alsohave"… = undual (undual (gfp (dual ∘ g ∘ undual)))" by (simp add: comp_def g_def) alsohave"… = undual (lfp g)" using mono_dual by (simp only: Dual_Ordered_Lattice.lfp_dual_gfp) finallyshow ?thesis . qed
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.