text‹ This section contains lemmas that are used in a module that supports the domain isomorphism package; the module contains proofs related to take functions and the finiteness predicate. ›
lemma deflation_abs_rep: fixes abs and rep and d assumes abs_iso: "∧x. rep⋅(abs⋅x) = x" assumes rep_iso: "∧y. abs⋅(rep⋅y) = y" shows"deflation d ==> deflation (abs oo d oo rep)" by (rule ep_pair.deflation_e_d_p) (simp add: ep_pair.intro assms)
lemma deflation_chain_min: assumes chain: "chain d" assumes defl: "∧n. deflation (d n)" shows"d m⋅(d n⋅x) = d (min m n)⋅x" proof (rule linorder_le_cases) assume"m ≤ n" with chain have"d m ⊑ d n"by (rule chain_mono) thenhave"d m⋅(d n⋅x) = d m⋅x" by (rule deflation_below_comp1 [OF defl defl]) moreoverfrom‹m ≤ n›have"min m n = m"by simp ultimatelyshow ?thesis by simp next assume"n ≤ m" with chain have"d n ⊑ d m"by (rule chain_mono) thenhave"d m⋅(d n⋅x) = d n⋅x" by (rule deflation_below_comp2 [OF defl defl]) moreoverfrom‹n ≤ m›have"min m n = n"by simp ultimatelyshow ?thesis by simp qed
lemma lub_ID_take_lemma: assumes"chain t"and"(⊔n. t n) = ID" assumes"∧n. t n⋅x = t n⋅y"shows"x = y" proof - have"(⊔n. t n⋅x) = (⊔n. t n⋅y)" using assms(3) by simp thenhave"(⊔n. t n)⋅x = (⊔n. t n)⋅y" using assms(1) by (simp add: lub_distribs) thenshow"x = y" using assms(2) by simp qed
lemma lub_ID_reach: assumes"chain t"and"(⊔n. t n) = ID" shows"(⊔n. t n⋅x) = x" using assms by (simp add: lub_distribs)
lemma lub_ID_take_induct: assumes"chain t"and"(⊔n. t n) = ID" assumes"adm P"and"∧n. P (t n⋅x)"shows"P x" proof - from‹chain t›have"chain (λn. t n⋅x)"by simp from‹adm P› this ‹∧n. P (t n⋅x)›have"P (⊔n. t n⋅x)"by (rule admD) with‹chain t›‹(⊔n. t n) = ID›show"P x"by (simp add: lub_distribs) qed
subsection‹Finiteness›
text‹ Let a ``decisive'' function be a deflation that maps every input to either itself or bottom. Then if a domain's take functions are all decisive, then all values in the domain are finite. ›
definition
decisive :: "('a::pcpo → 'a) ==> bool" where "decisive d ⟷ (∀x. d⋅x = x ∨ d⋅x = ⊥)"
lemma decisiveI: "(∧x. d⋅x = x ∨ d⋅x = ⊥) ==> decisive d" unfolding decisive_def by simp
lemma decisive_cases: assumes"decisive d"obtains"d⋅x = x" | "d⋅x = ⊥" using assms unfolding decisive_def by auto
lemma decisive_bottom: "decisive ⊥" unfolding decisive_def by simp
lemma decisive_ID: "decisive ID" unfolding decisive_def by simp
lemma decisive_ssum_map: assumes f: "decisive f" assumes g: "decisive g" shows"decisive (ssum_map⋅f⋅g)" apply (rule decisiveI)
subgoal for s apply (cases s, simp_all) apply (rule_tac x=x in decisive_cases [OF f], simp_all) apply (rule_tac x=y in decisive_cases [OF g], simp_all) done done
lemma decisive_sprod_map: assumes f: "decisive f" assumes g: "decisive g" shows"decisive (sprod_map⋅f⋅g)" apply (rule decisiveI)
subgoal for s apply (cases s, simp)
subgoal for x y apply (rule decisive_cases [OF f, where x = x], simp_all) apply (rule decisive_cases [OF g, where x = y], simp_all) done done done
lemma lub_ID_finite: assumes chain: "chain d" assumes lub: "(⊔n. d n) = ID" assumes decisive: "∧n. decisive (d n)" shows"∃n. d n⋅x = x" proof - have 1: "chain (λn. d n⋅x)"using chain by simp have 2: "(⊔n. d n⋅x) = x"using chain lub by (rule lub_ID_reach) have"∀n. d n⋅x = x ∨ d n⋅x = ⊥" using decisive unfolding decisive_def by simp hence"range (λn. d n⋅x) ⊆ {x, ⊥}" by auto hence"finite (range (λn. d n⋅x))" by (rule finite_subset, simp) with 1 have"finite_chain (λn. d n⋅x)" by (rule finite_range_imp_finch) thenhave"∃n. (⊔n. d n⋅x) = d n⋅x" unfolding finite_chain_def by (auto simp add: maxinch_is_thelub) with 2 show"∃n. d n⋅x = x"by (auto elim: sym) qed
lemma lub_ID_finite_take_induct: assumes"chain d"and"(⊔n. d n) = ID"and"∧n. decisive (d n)" shows"(∧n. P (d n⋅x)) ==> P x" using lub_ID_finite [OF assms] by metis
subsection‹Proofs about constructor functions›
text‹Lemmas for proving nchotomy rule:›
lemma ex_one_bottom_iff: "(∃x. P x ∧ x ≠⊥) = P ONE" by simp
lemma ex_up_bottom_iff: "(∃x. P x ∧ x ≠⊥) = (∃x. P (up⋅x))" by (safe, case_tac x, auto)
lemma ex_sprod_bottom_iff: "(∃y. P y ∧ y ≠⊥) = (∃x y. (P (:x, y:) ∧ x ≠⊥) ∧ y ≠⊥)" by (safe, case_tac y, auto)
lemma ex_sprod_up_bottom_iff: "(∃y. P y ∧ y ≠⊥) = (∃x y. P (:up⋅x, y:) ∧ y ≠⊥)" by (safe, case_tac y, simp, case_tac x, auto)
lemma ex_ssum_bottom_iff: "(∃x. P x ∧ x ≠⊥) = ((∃x. P (sinl⋅x) ∧ x ≠⊥) ∨ (∃x. P (sinr⋅x) ∧ x ≠⊥))" by (safe, case_tac x, auto)
lemma exh_start: "p = ⊥∨ (∃x. p = x ∧ x ≠⊥)" by auto
setup‹ fold Sign.add_const_constraint [(🍋‹defl›,
(🍋‹emb›, SOME 🍋‹'a::domain → udom›),
(🍋‹prj›, SOME 🍋‹udom → 'a::domain›),
(🍋‹liftdefl›, SOME 🍋‹'a::predomain itself ==> udom u defl›),
(🍋‹liftemb›, SOME 🍋‹'a::predomain u → udom u›),
(🍋‹liftprj›, SOME 🍋‹udom u → 'a::predomain u›)] ›
ML_file ‹Tools/domaindef.ML›
subsection‹Isomorphic deflations›
definition isodefl :: "('a::domain → 'a) ==> udom defl ==> bool" where"isodefl d t ⟷ cast⋅t = emb oo d oo prj"
definition isodefl' :: "('a::predomain → 'a) ==> udom u defl ==> bool" where"isodefl' d t ⟷ cast⋅t = liftemb oo u_map⋅d oo liftprj"
lemma isodeflI: "(∧x. cast⋅t⋅x = emb⋅(d⋅(prj⋅x))) ==> isodefl d t" unfolding isodefl_def by (simp add: cfun_eqI)
lemma cast_isodefl: "isodefl d t ==> cast⋅t = (Λ x. emb⋅(d⋅(prj⋅x)))" unfolding isodefl_def by (simp add: cfun_eqI)
lemma isodefl_strict: "isodefl d t ==> d⋅⊥ = ⊥" unfolding isodefl_def by (drule cfun_fun_cong [where x="⊥"], simp)
lemma isodefl_imp_deflation: fixes d :: "'a::domain → 'a" assumes"isodefl d t"shows"deflation d" proof note assms [unfolded isodefl_def, simp] fix x :: 'a show"d⋅(d⋅x) = d⋅x" using cast.idem [of t "emb⋅x"] by simp show"d⋅x ⊑ x" using cast.below [of t "emb⋅x"] by simp qed
lemma isodefl_ID_DEFL: "isodefl (ID :: 'a → 'a) DEFL('a::domain)" unfolding isodefl_def by (simp add: cast_DEFL)
lemma isodefl_LIFTDEFL: "isodefl' (ID :: 'a → 'a) LIFTDEFL('a::predomain)" unfolding isodefl'_defby (simp add: cast_liftdefl u_map_ID)
lemma isodefl_abs_rep: fixes abs and rep and d assumes DEFL: "DEFL('b::domain) = DEFL('a::domain)" assumes abs_def: "(abs :: 'a → 'b) ≡ prj oo emb" assumes rep_def: "(rep :: 'b → 'a) ≡ prj oo emb" shows"isodefl d t ==> isodefl (abs oo d oo rep) t" unfolding isodefl_def by (simp add: cfun_eq_iff assms prj_emb_prj emb_prj_emb)
lemma isodefl'_liftdefl_of: "isodefl d t ==> isodefl' d (liftdefl_of⋅t)" unfolding isodefl_def isodefl'_def by (simp add: cast_liftdefl_of u_map_oo liftemb_eq liftprj_eq)
named_theorems domain_defl_simps "theorems like DEFL('a t) = t_defl$DEFL('a)" and domain_isodefl "theorems like isodefl d t ==> isodefl (foo_map$d) (foo_defl$t)"
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.