(* Title: HOL/BNF_Composition.thy Author: Dmitriy Traytel, TU Muenchen Author: Jasmin Blanchette, TU Muenchen Author: Jan van Brügge, TU Muenchen Copyright 2012, 2013, 2014, 2022 Composition of bounded natural functors. *)
section‹Composition of Bounded Natural Functors›
theory BNF_Composition imports BNF_Def begin
lemma ssubst_mem: "[t = s; s ∈ X]==> t ∈ X" by simp
lemma empty_natural: "(λ_. {}) ∘ f = image g ∘ (λ_. {})" by (rule ext) simp
lemma Cinfinite_gt_empty: "Cinfinite r ==> |{}| by (simp add: cinfinite_def finite_ordLess_infinite card_of_ordIso_finite Field_card_of card_of_well_order_on emptyI card_order_on_well_order_on)
lemma Union_natural: "Union ∘ image (image f) = image f ∘ Union" by (rule ext) (auto simp only: comp_apply)
lemma in_Union_o_assoc: "x ∈ (Union ∘ gset ∘ gmap) A ==> x ∈ (Union ∘ (gset ∘ gmap)) A" by (unfold comp_assoc)
lemma regularCard_UNION_bound: assumes"Cinfinite r""regularCard r"and"|I| "∧i. i ∈ I ==> |A i| shows"|∪i∈I. A i| using assms cinfinite_def regularCard_stable stable_UNION by blast
lemma comp_single_set_bd_strict: assumes fbd: "Cinfinite fbd""regularCard fbd"and
gbd: "Cinfinite gbd""regularCard gbd"and
fset_bd: "∧x. |fset x| and
gset_bd: "∧x. |gset x| shows"|∪(fset ` gset x)| proof (cases "fbd ) case True thenhave"|fset x| for x using fset_bd ordLess_transitive by blast thenhave"|∪(fset ` gset x)| using regularCard_UNION_bound[OF gbd gset_bd] by blast thenhave"|∪ (fset ` gset x)| using ordLess_ordLeq_trans ordLeq_cprod2 gbd(1) fbd(1) cinfinite_not_czero by blast thenshow ?thesis using ordLess_ordIso_trans cprod_com by blast next case False have"Well_order fbd""Well_order gbd"using fbd(1) gbd(1) card_order_on_well_order_on by auto thenhave"gbd ≤o fbd"using not_ordLess_iff_ordLeq False by blast thenhave"|gset x| for x using gset_bd ordLess_ordLeq_trans by blast thenhave"|∪(fset ` gset x)| using regularCard_UNION_bound[OF fbd] fset_bd by blast thenshow ?thesis using ordLess_ordLeq_trans ordLeq_cprod2 gbd(1) fbd(1) cinfinite_not_czero by blast qed
lemma csum_dup: "cinfinite r ==> Card_order r ==> p +c p' =o r +c r ==> p +c p' =o r" apply (erule ordIso_transitive) apply (frule csum_absorb2') apply (erule ordLeq_refl) by simp
lemma cprod_dup: "cinfinite r ==> Card_order r ==> p *c p' =o r *c r ==> p *c p' =o r" apply (erule ordIso_transitive) apply (rule cprod_infinite) by simp
lemma Union_image_insert: "∪(f ` insert a B) = f a ∪∪(f ` B)" by simp
lemma Union_image_empty: "A ∪∪(f ` {}) = A" by simp
lemma image_o_collect: "collect ((λf. image g ∘ f) ` F) = image g ∘ collect F" by (rule ext) (auto simp add: collect_def)
lemma conj_subset_def: "A ⊆ {x. P x ∧ Q x} = (A ⊆ {x. P x} ∧ A ⊆ {x. Q x})" by blast
lemma UN_image_subset: "∪(f ` g x) ⊆ X = (g x ⊆ {x. f x ⊆ X})" by blast
lemma type_copy_map_id0: "M = id ==> Abs ∘ M ∘ Rep = id" using type_definition.Rep_inverse[OF type_copy] by auto
lemma type_copy_map_comp0: "M = M1 ∘ M2 ==> f ∘ M ∘ g = (f ∘ M1 ∘ Rep) ∘ (Abs ∘ M2∘ g)" using type_definition.Abs_inverse[OF type_copy UNIV_I] by auto
lemma type_copy_set_map0: "S ∘ M = image f ∘ S' ==> (S ∘ Rep) ∘ (Abs ∘ M ∘ g) = image f ∘ (S' ∘ g)" using type_definition.Abs_inverse[OF type_copy UNIV_I] by (auto simp: o_def fun_eq_iff)
lemma type_copy_wit: "x ∈ (S ∘ Rep) (Abs y) ==> x ∈ S y" using type_definition.Abs_inverse[OF type_copy UNIV_I] by auto
lemma type_copy_vimage2p_Grp_Rep: "vimage2p f Rep (Grp (Collect P) h) = Grp (Collect (λx. P (f x))) (Abs ∘ h ∘ f)" unfolding vimage2p_def Grp_def fun_eq_iff by (auto simp: type_definition.Abs_inverse[OF type_copy UNIV_I]
type_definition.Rep_inverse[OF type_copy] dest: sym)
lemma type_copy_vimage2p_Grp_Abs: "∧h. vimage2p g Abs (Grp (Collect P) h) = Grp (Collect (λx. P (g x))) (Rep ∘ h ∘g)" unfolding vimage2p_def Grp_def fun_eq_iff by (auto simp: type_definition.Abs_inverse[OF type_copy UNIV_I]
type_definition.Rep_inverse[OF type_copy] dest: sym)
lemma type_copy_ex_RepI: "(∃b. F b) = (∃b. F (Rep b))" proof safe fix b assume"F b" show"∃b'. F (Rep b')" proof (rule exI) from‹F b›show"F (Rep (Abs b))"using type_definition.Abs_inverse[OF type_copy] by auto qed qed blast
lemma vimage2p_relcompp_converse: "vimage2p f g (R-1-1 OO S) = (vimage2p Rep f R)-1-1 OO vimage2p Rep g S" unfolding vimage2p_def relcompp.simps conversep.simps fun_eq_iff image_def by (auto simp: type_copy_ex_RepI)
end
bnf DEADID: 'a
map: "id :: 'a ==> 'a"
bd: natLeq
rel: "(=) :: 'a ==> 'a ==> bool" by (auto simp add: natLeq_card_order natLeq_cinfinite regularCard_natLeq)
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.