Quelle BNF_Cardinal_Arithmetic.thy
Sprache: Isabelle
(* Title: HOL/BNF_Cardinal_Arithmetic.thy Author: Dmitriy Traytel, TU Muenchen Copyright 2012
Cardinal arithmetic as needed by bounded natural functors.
*)
section \<open>Cardinal Arithmetic as Needed by Bounded Natural Functors\<close>
theory BNF_Cardinal_Arithmetic imports BNF_Cardinal_Order_Relation begin
lemma dir_image: "\\x y. (f x = f y) = (x = y); Card_order r\ \ r =o dir_image r f" by (rule dir_image_ordIso) (auto simp add: inj_on_def card_order_on_def)
lemma card_order_dir_image: assumes bij: "bij f"and co: "card_order r" shows"card_order (dir_image r f)" proof - have"Field (dir_image r f) = UNIV" using assms card_order_on_Card_order[of UNIV r] unfolding bij_def dir_image_Field by auto moreoverfrom bij have"\x y. (f x = f y) = (x = y)" unfolding bij_def inj_on_def by auto with co have"Card_order (dir_image r f)" using card_order_on_Card_order Card_order_ordIso2[OF _ dir_image] by blast ultimatelyshow ?thesis by auto qed
lemma ordIso_refl: "Card_order r \ r =o r" by (rule card_order_on_ordIso)
lemma ordLeq_refl: "Card_order r \ r \o r" by (rule ordIso_imp_ordLeq, rule card_order_on_ordIso)
lemma card_of_ordIso_subst: "A = B \ |A| =o |B|" by (simp only: ordIso_refl card_of_Card_order)
lemma Field_card_order: "card_order r \ Field r = UNIV" using card_order_on_Card_order[of UNIV r] by simp
subsection \<open>Zero\<close>
definition czero where "czero = card_of {}"
lemma czero_ordIso: "czero =o czero" using card_of_empty_ordIso by (simp add: czero_def)
lemma card_of_ordIso_czero_iff_empty: "|A| =o (czero :: 'b rel) \ A = ({} :: 'a set)" unfolding czero_def by (rule iffI[OF card_of_empty2]) (auto simp: card_of_refl card_of_empty_ordIso)
(* A "not czero" Cardinal predicate *) abbreviation Cnotzero where "Cnotzero (r :: 'a rel) \ \(r =o (czero :: 'a rel)) \ Card_order r"
(*helper*) lemma Cnotzero_imp_not_empty: "Cnotzero r \ Field r \ {}" unfolding Card_order_iff_ordIso_card_of czero_def by force
lemma czeroI: "\Card_order r; Field r = {}\ \ r =o czero" using Cnotzero_imp_not_empty ordIso_transitive[OF _ czero_ordIso] by blast
lemma czeroE: "r =o czero \ Field r = {}" unfolding czero_def by (drule card_of_cong) (simp only: Field_card_of card_of_empty2)
lemma Cnotzero_mono: "\Cnotzero r; Card_order q; r \o q\ \ Cnotzero q" by (force intro: czeroI dest: card_of_mono2 card_of_empty3 czeroE)
subsection \<open>(In)finite cardinals\<close>
definition cinfinite where "cinfinite r \ (\ finite (Field r))"
abbreviation Cinfinite where "Cinfinite r \ cinfinite r \ Card_order r"
definition cfinite where "cfinite r = finite (Field r)"
abbreviation Cfinite where "Cfinite r \ cfinite r \ Card_order r"
lemma Cfinite_ordLess_Cinfinite: "\Cfinite r; Cinfinite s\ \ r unfolding cfinite_def cinfinite_def by (blast intro: finite_ordLess_infinite card_order_on_well_order_on)
lemma regularCard_ordIso: assumes"k =o k'"and"Cinfinite k"and"regularCard k" shows"regularCard k'"
proof- have"stable k"using assms cinfinite_def regularCard_stable by blast hence"stable k'"using assms stable_ordIso1 ordIso_symmetric by blast thus ?thesis using assms cinfinite_def stable_regularCard Cinfinite_cong by blast qed
corollary card_of_UNION_ordLess_infinite_Field_regularCard: assumes"regularCard r"and"Cinfinite r"and"|I| and"\i \ I. |A i| shows"|\i \ I. A i| using card_of_UNION_ordLess_infinite_Field regularCard_stable assms cinfinite_def by blast
lemma Un_csum: "|A \ B| \o |A| +c |B|" using ordLeq_ordIso_trans[OF card_of_Un_Plus_ordLeq Plus_csum] by blast
subsection \<open>One\<close>
definition cone where "cone = card_of {()}"
lemma Card_order_cone: "Card_order cone" unfolding cone_def by (rule card_of_Card_order)
lemma Cfinite_cone: "Cfinite cone" unfolding cfinite_def by (simp add: Card_order_cone)
lemma cone_not_czero: "\ (cone =o czero)" unfolding czero_def cone_def ordIso_iff_ordLeq using card_of_empty3 empty_not_insert by blast
lemma cone_ordLeq_Cnotzero: "Cnotzero r \ cone \o r" unfolding cone_def by (rule Card_order_singl_ordLeq) (auto intro: czeroI)
subsection \<open>Two\<close>
definition ctwo where "ctwo = |UNIV :: bool set|"
lemma Card_order_ctwo: "Card_order ctwo" unfolding ctwo_def by (rule card_of_Card_order)
lemma ctwo_not_czero: "\ (ctwo =o czero)" using card_of_empty3[of "UNIV :: bool set"] ordIso_iff_ordLeq unfolding czero_def ctwo_def using UNIV_not_empty by auto
lemma ctwo_Cnotzero: "Cnotzero ctwo" by (simp add: ctwo_not_czero Card_order_ctwo)
subsection \<open>Family sum\<close>
definition Csum where "Csum r rs \ |SIGMA i : Field r. Field (rs i)|"
(* Similar setup to the one for SIGMA from theory Big_Operators: *) syntax"_Csum" :: "pttrn => ('a * 'a) set => 'b * 'b set => (('a * 'b) * ('a * 'b)) set"
(\<open>(\<open>indent=3 notation=\<open>binder CSUM\<close>\<close>CSUM _:_. _)\<close> [0, 51, 10] 10)
syntax_consts "_Csum" == Csum
translations "CSUM i:r. rs" == "CONST Csum r (%i. rs)"
lemma SIGMA_CSUM: "|SIGMA i : I. As i| = (CSUM i : |I|. |As i| )" by (auto simp: Csum_def Field_card_of)
(* NB: Always, under the cardinal operator, operations on sets are reduced automatically to operations on cardinals.
This should make cardinal reasoning more direct and natural. *)
subsection \<open>Product\<close>
definition cprod (infixr\<open>*c\<close> 80) where "r1 *c r2 = |Field r1 \ Field r2|"
lemma card_order_cprod: assumes"card_order r1""card_order r2" shows"card_order (r1 *c r2)" proof - have"Field r1 = UNIV""Field r2 = UNIV" using assms card_order_on_Card_order by auto thus ?thesis by (auto simp: cprod_def card_of_card_order_on) qed
lemma csum_absorb1': assumes card: "Card_order r2" and r12: "r1 \o r2" and cr12: "cinfinite r1 \ cinfinite r2" shows"r2 +c r1 =o r2" proof - have"r1 +c r2 =o r2" by (simp add: csum_absorb2' assms) thenshow ?thesis by (blast intro: ordIso_transitive csum_com) qed
lemma csum_absorb1: "\Cinfinite r2; r1 \o r2\ \ r2 +c r1 =o r2" by (rule csum_absorb1') auto
lemma csum_absorb2: "\Cinfinite r2 ; r1 \o r2\ \ r1 +c r2 =o r2" using ordIso_transitive csum_com csum_absorb1 by blast
lemma regularCard_csum: assumes"Cinfinite r""Cinfinite s""regularCard r""regularCard s" shows"regularCard (r +c s)" proof (cases "r \o s") case True thenshow ?thesis using regularCard_ordIso[of s] csum_absorb2'[THEN ordIso_symmetric] assms by auto next case False have"Well_order s""Well_order r"using assms card_order_on_well_order_on by auto thenhave"s \o r" using not_ordLeq_iff_ordLess False ordLess_imp_ordLeq by auto thenshow ?thesis using regularCard_ordIso[of r] csum_absorb1'[THEN ordIso_symmetric] assms by auto qed
lemma csum_mono_strict: assumes Card_order: "Card_order r""Card_order q" and Cinfinite: "Cinfinite r'""Cinfinite q'" and less: "r "q shows"r +c q proof - have Well_order: "Well_order r""Well_order q""Well_order r'""Well_order q'" using card_order_on_well_order_on Card_order Cinfinite by auto show ?thesis proof (cases "Cinfinite r") case outer: True thenshow ?thesis proof (cases "Cinfinite q") case inner: True thenshow ?thesis proof (cases "r \o q") case True thenhave"r +c q =o q"using csum_absorb2 inner by blast thenshow ?thesis using ordIso_ordLess_trans ordLess_ordLeq_trans less Cinfinite ordLeq_csum2 by blast next case False thenhave"q \o r" using not_ordLeq_iff_ordLess Well_order ordLess_imp_ordLeq by blast thenhave"r +c q =o r"using csum_absorb1 outer by blast thenshow ?thesis using ordIso_ordLess_trans ordLess_ordLeq_trans less Cinfinite ordLeq_csum1 by blast qed next case False thenhave"Cfinite q"using Card_order cinfinite_def cfinite_def by blast thenhave"q \o r" using finite_ordLess_infinite cfinite_def cinfinite_def outer
Well_order ordLess_imp_ordLeq by blast thenhave"r +c q =o r"by (rule csum_absorb1[OF outer]) thenshow ?thesis using ordIso_ordLess_trans ordLess_ordLeq_trans less ordLeq_csum1 Cinfinite by blast qed next case False thenhave outer: "Cfinite r"using Card_order cinfinite_def cfinite_def by blast thenshow ?thesis proof (cases "Cinfinite q") case True thenhave"r \o q" using finite_ordLess_infinite cinfinite_def cfinite_def outer Well_order
ordLess_imp_ordLeq by blast thenhave"r +c q =o q"by (rule csum_absorb2[OF True]) thenshow ?thesis using ordIso_ordLess_trans ordLess_ordLeq_trans less ordLeq_csum2 Cinfinite by blast next case False thenhave"Cfinite q"using Card_order cinfinite_def cfinite_def by blast thenhave"Cfinite (r +c q)"using Cfinite_csum outer by blast moreoverhave"Cinfinite (r' +c q')"using Cinfinite_csum1 Cinfinite by blast ultimatelyshow ?thesis using Cfinite_ordLess_Cinfinite by blast qed qed qed
lemma cexp_cong: assumes 1: "p1 =o r1"and 2: "p2 =o r2" and Cr: "Card_order r2" and Cp: "Card_order p2" shows"p1 ^c p2 =o r1 ^c r2" proof - obtain f where"bij_betw f (Field p2) (Field r2)" using 2 card_of_ordIso[of "Field p2""Field r2"] card_of_cong by auto hence 0: "Field p2 = {} \ Field r2 = {}" unfolding bij_betw_def by auto have r: "p2 =o czero \ r2 =o czero" and p: "r2 =o czero \ p2 =o czero" using 0 Cr Cp czeroE czeroI by auto show ?thesis using 0 1 2 unfolding ordIso_iff_ordLeq using r p cexp_mono[OF _ _ _ Cp] cexp_mono[OF _ _ _ Cr] by blast qed
lemma regularCard_cprod: assumes"Cinfinite r""Cinfinite s""regularCard r""regularCard s" shows"regularCard (r *c s)" proof (cases "r \o s") case True with assms Cinfinite_Cnotzero show ?thesis by (force intro: regularCard_ordIso ordIso_symmetric[OF cprod_infinite2']) next case False have"Well_order r""Well_order s"using assms card_order_on_well_order_on by auto thenhave"s \o r" using not_ordLeq_iff_ordLess ordLess_imp_ordLeq False by blast with assms Cinfinite_Cnotzero show ?thesis by (force intro: regularCard_ordIso ordIso_symmetric[OF cprod_infinite1']) qed
lemma cprod_csum_cexp: "r1 *c r2 \o (r1 +c r2) ^c ctwo" unfolding cprod_def csum_def cexp_def ctwo_def Field_card_of proof - let ?f = "\(a, b). %x. if x then Inl a else Inr b" have"inj_on ?f (Field r1 \ Field r2)" (is "inj_on _ ?LHS") by (auto simp: inj_on_def fun_eq_iff split: bool.split) moreover have"?f ` ?LHS \ Func (UNIV :: bool set) (Field r1 <+> Field r2)" (is "_ \ ?RHS") by (auto simp: Func_def) ultimatelyshow"|?LHS| \o |?RHS|" using card_of_ordLeq by blast qed
lemma Cfinite_cprod_Cinfinite: "\Cfinite r; Cinfinite s\ \ r *c s \o s" by (intro cprod_cinfinite_bound)
(auto intro: ordLeq_refl ordLess_imp_ordLeq[OF Cfinite_ordLess_Cinfinite])
lemma cprod_cexp: "(r *c s) ^c t =o r ^c t *c s ^c t" unfolding cprod_def cexp_def Field_card_of by (rule Func_Times_Range)
lemma Cfinite_cexp_Cinfinite: assumes s: "Cfinite s"and t: "Cinfinite t" shows"s ^c t \o ctwo ^c t" proof (cases "s \o ctwo") case True thus ?thesis using t by (blast intro: cexp_mono1) next case False hence"ctwo \o s" using ordLeq_total[of s ctwo] Card_order_ctwo s by (auto intro: card_order_on_well_order_on) hence"Cnotzero s"using Cnotzero_mono[OF ctwo_Cnotzero] s by blast hence st: "Cnotzero (s *c t)"by (intro Cinfinite_Cnotzero[OF Cinfinite_cprod2]) (auto simp: t) have"s ^c t \o (ctwo ^c s) ^c t" using assms by (blast intro: cexp_mono1 ordLess_imp_ordLeq[OF ordLess_ctwo_cexp]) alsohave"(ctwo ^c s) ^c t =o ctwo ^c (s *c t)" by (blast intro: Card_order_ctwo cexp_cprod) alsohave"ctwo ^c (s *c t) \o ctwo ^c t" using assms st by (intro cexp_mono2_Cnotzero Cfinite_cprod_Cinfinite Card_order_ctwo) finallyshow ?thesis . qed
lemma csum_Cfinite_cexp_Cinfinite: assumes r: "Card_order r"and s: "Cfinite s"and t: "Cinfinite t" shows"(r +c s) ^c t \o (r +c ctwo) ^c t" proof (cases "Cinfinite r") case True hence"r +c s =o r"by (intro csum_absorb1 ordLess_imp_ordLeq[OF Cfinite_ordLess_Cinfinite] s) hence"(r +c s) ^c t =o r ^c t"using t by (blast intro: cexp_cong1) alsohave"r ^c t \o (r +c ctwo) ^c t" using t by (blast intro: cexp_mono1 ordLeq_csum1 r) finallyshow ?thesis . next case False with r have"Cfinite r"unfolding cinfinite_def cfinite_def by auto hence"Cfinite (r +c s)"by (intro Cfinite_csum s) hence"(r +c s) ^c t \o ctwo ^c t" by (intro Cfinite_cexp_Cinfinite t) alsohave"ctwo ^c t \o (r +c ctwo) ^c t" using t by (blast intro: cexp_mono1 ordLeq_csum2 Card_order_ctwo) finallyshow ?thesis . qed
(* cardSuc *)
lemma Cinfinite_cardSuc: "Cinfinite r \ Cinfinite (cardSuc r)" by (simp add: cinfinite_def cardSuc_Card_order cardSuc_finite)
lemma cardSuc_UNION_Cinfinite: assumes"Cinfinite r""relChain (cardSuc r) As""B \ (\i \ Field (cardSuc r). As i)" "|B| <=o r" shows"\i \ Field (cardSuc r). B \ As i" using cardSuc_UNION assms unfolding cinfinite_def by blast
lemma Cinfinite_card_suc: "\ Cinfinite r ; card_order r \ \ Cinfinite (card_suc r)" using Cinfinite_cong[OF cardSuc_ordIso_card_suc Cinfinite_cardSuc] .
lemma card_suc_least: "\card_order r; Card_order s; r \ card_suc r \o s" by (rule ordIso_ordLeq_trans[OF ordIso_symmetric[OF cardSuc_ordIso_card_suc]])
(auto intro!: cardSuc_least simp: card_order_on_Card_order)
lemma regularCard_cardSuc: "Cinfinite k \ regularCard (cardSuc k)" by (rule infinite_cardSuc_regularCard) (auto simp: cinfinite_def)
lemma regularCard_card_suc: "card_order r \ Cinfinite r \ regularCard (card_suc r)" using cardSuc_ordIso_card_suc Cinfinite_cardSuc regularCard_cardSuc regularCard_ordIso by blast
end
¤ Dauer der Verarbeitung: 0.17 Sekunden
(vorverarbeitet)
¤
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 ist noch experimentell.