--- a/src/HOL/BNF_Cardinal_Arithmetic.thy Fri Jan 13 22:47:40 2023 +0000
+++ b/src/HOL/BNF_Cardinal_Arithmetic.thy Sat Jan 14 16:53:54 2023 +0000
@@ -8,35 +8,37 @@
section \<open>Cardinal Arithmetic as Needed by Bounded Natural Functors\<close>
theory BNF_Cardinal_Arithmetic
-imports BNF_Cardinal_Order_Relation
+ imports BNF_Cardinal_Order_Relation
begin
lemma dir_image: "\<lbrakk>\<And>x y. (f x = f y) = (x = y); Card_order r\<rbrakk> \<Longrightarrow> r =o dir_image r f"
-by (rule dir_image_ordIso) (auto simp add: inj_on_def card_order_on_def)
+ 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 -
- from assms have "Field (dir_image r f) = UNIV"
- using card_order_on_Card_order[of UNIV r] unfolding bij_def dir_image_Field by auto
- moreover from bij have "\<And>x y. (f x = f y) = (x = y)" unfolding bij_def inj_on_def by auto
+ 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
+ moreover from bij have "\<And>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[of UNIV r] Card_order_ordIso2[OF _ dir_image] by blast
+ using card_order_on_Card_order Card_order_ordIso2[OF _ dir_image] by blast
ultimately show ?thesis by auto
qed
lemma ordIso_refl: "Card_order r \<Longrightarrow> r =o r"
-by (rule card_order_on_ordIso)
+ by (rule card_order_on_ordIso)
lemma ordLeq_refl: "Card_order r \<Longrightarrow> r \<le>o r"
-by (rule ordIso_imp_ordLeq, rule card_order_on_ordIso)
+ by (rule ordIso_imp_ordLeq, rule card_order_on_ordIso)
lemma card_of_ordIso_subst: "A = B \<Longrightarrow> |A| =o |B|"
-by (simp only: ordIso_refl card_of_Card_order)
+ by (simp only: ordIso_refl card_of_Card_order)
lemma Field_card_order: "card_order r \<Longrightarrow> Field r = UNIV"
-using card_order_on_Card_order[of UNIV r] by simp
+ using card_order_on_Card_order[of UNIV r] by simp
subsection \<open>Zero\<close>
@@ -44,13 +46,12 @@
definition czero where
"czero = card_of {}"
-lemma czero_ordIso:
- "czero =o czero"
-using card_of_empty_ordIso by (simp add: czero_def)
+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) \<longleftrightarrow> A = ({} :: 'a set)"
-unfolding czero_def by (rule iffI[OF card_of_empty2]) (auto simp: card_of_refl card_of_empty_ordIso)
+ 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
@@ -62,28 +63,21 @@
lemma czeroI:
"\<lbrakk>Card_order r; Field r = {}\<rbrakk> \<Longrightarrow> r =o czero"
-using Cnotzero_imp_not_empty ordIso_transitive[OF _ czero_ordIso] by blast
+ using Cnotzero_imp_not_empty ordIso_transitive[OF _ czero_ordIso] by blast
lemma czeroE:
"r =o czero \<Longrightarrow> Field r = {}"
-unfolding czero_def
-by (drule card_of_cong) (simp only: Field_card_of card_of_empty2)
+ unfolding czero_def
+ by (drule card_of_cong) (simp only: Field_card_of card_of_empty2)
lemma Cnotzero_mono:
"\<lbrakk>Cnotzero r; Card_order q; r \<le>o q\<rbrakk> \<Longrightarrow> Cnotzero q"
-apply (rule ccontr)
-apply auto
-apply (drule czeroE)
-apply (erule notE)
-apply (erule czeroI)
-apply (drule card_of_mono2)
-apply (simp only: card_of_empty3)
-done
+ by (force intro: czeroI dest: card_of_mono2 card_of_empty3 czeroE)
subsection \<open>(In)finite cardinals\<close>
definition cinfinite where
- "cinfinite r = (\<not> finite (Field r))"
+ "cinfinite r \<equiv> (\<not> finite (Field r))"
abbreviation Cinfinite where
"Cinfinite r \<equiv> cinfinite r \<and> Card_order r"
@@ -101,7 +95,7 @@
lemmas natLeq_card_order = natLeq_Card_order[unfolded Field_natLeq]
lemma natLeq_cinfinite: "cinfinite natLeq"
-unfolding cinfinite_def Field_natLeq by (rule infinite_UNIV_nat)
+ unfolding cinfinite_def Field_natLeq by (rule infinite_UNIV_nat)
lemma natLeq_Cinfinite: "Cinfinite natLeq"
using natLeq_cinfinite natLeq_Card_order by simp
@@ -117,50 +111,46 @@
qed
lemma cinfinite_not_czero: "cinfinite r \<Longrightarrow> \<not> (r =o (czero :: 'a rel))"
-unfolding cinfinite_def by (cases "Field r = {}") (auto dest: czeroE)
+ unfolding cinfinite_def by (cases "Field r = {}") (auto dest: czeroE)
lemma Cinfinite_Cnotzero: "Cinfinite r \<Longrightarrow> Cnotzero r"
-by (rule conjI[OF cinfinite_not_czero]) simp_all
+ using cinfinite_not_czero by auto
lemma Cinfinite_cong: "\<lbrakk>r1 =o r2; Cinfinite r1\<rbrakk> \<Longrightarrow> Cinfinite r2"
-using Card_order_ordIso2[of r1 r2] unfolding cinfinite_def ordIso_iff_ordLeq
-by (auto dest: card_of_ordLeq_infinite[OF card_of_mono2])
+ using Card_order_ordIso2[of r1 r2] unfolding cinfinite_def ordIso_iff_ordLeq
+ by (auto dest: card_of_ordLeq_infinite[OF card_of_mono2])
lemma cinfinite_mono: "\<lbrakk>r1 \<le>o r2; cinfinite r1\<rbrakk> \<Longrightarrow> cinfinite r2"
-unfolding cinfinite_def by (auto dest: card_of_ordLeq_infinite[OF card_of_mono2])
+ unfolding cinfinite_def by (auto dest: card_of_ordLeq_infinite[OF card_of_mono2])
lemma regularCard_ordIso:
-assumes "k =o k'" and "Cinfinite k" and "regularCard k"
-shows "regularCard k'"
+ 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
- using Cinfinite_cong by blast
+ thus ?thesis using assms cinfinite_def stable_regularCard Cinfinite_cong by blast
qed
corollary card_of_UNION_ordLess_infinite_Field_regularCard:
-assumes ST: "regularCard r" and INF: "Cinfinite r" and
- LEQ_I: "|I| <o r" and LEQ: "\<forall>i \<in> I. |A i| <o r"
- shows "|\<Union>i \<in> I. A i| <o r"
+ assumes "regularCard r" and "Cinfinite r" and "|I| <o r" and "\<forall>i \<in> I. |A i| <o r"
+ shows "|\<Union>i \<in> I. A i| <o r"
using card_of_UNION_ordLess_infinite_Field regularCard_stable assms cinfinite_def by blast
subsection \<open>Binary sum\<close>
-definition csum (infixr "+c" 65) where
- "r1 +c r2 \<equiv> |Field r1 <+> Field r2|"
+definition csum (infixr "+c" 65)
+ where "r1 +c r2 \<equiv> |Field r1 <+> Field r2|"
lemma Field_csum: "Field (r +c s) = Inl ` Field r \<union> Inr ` Field s"
unfolding csum_def Field_card_of by auto
-lemma Card_order_csum:
- "Card_order (r1 +c r2)"
-unfolding csum_def by (simp add: card_of_Card_order)
+lemma Card_order_csum: "Card_order (r1 +c r2)"
+ unfolding csum_def by (simp add: card_of_Card_order)
-lemma csum_Cnotzero1:
- "Cnotzero r1 \<Longrightarrow> Cnotzero (r1 +c r2)"
-unfolding csum_def using Cnotzero_imp_not_empty[of r1] Plus_eq_empty_conv[of "Field r1" "Field r2"]
- card_of_ordIso_czero_iff_empty[of "Field r1 <+> Field r2"] by (auto intro: card_of_Card_order)
+lemma csum_Cnotzero1: "Cnotzero r1 \<Longrightarrow> Cnotzero (r1 +c r2)"
+ using Cnotzero_imp_not_empty
+ by (auto intro: card_of_Card_order simp: csum_def card_of_ordIso_czero_iff_empty)
lemma card_order_csum:
assumes "card_order r1" "card_order r2"
@@ -172,49 +162,45 @@
lemma cinfinite_csum:
"cinfinite r1 \<or> cinfinite r2 \<Longrightarrow> cinfinite (r1 +c r2)"
-unfolding cinfinite_def csum_def by (auto simp: Field_card_of)
-
-lemma Cinfinite_csum1:
- "Cinfinite r1 \<Longrightarrow> Cinfinite (r1 +c r2)"
-unfolding cinfinite_def csum_def by (rule conjI[OF _ card_of_Card_order]) (auto simp: Field_card_of)
+ unfolding cinfinite_def csum_def by (auto simp: Field_card_of)
lemma Cinfinite_csum:
"Cinfinite r1 \<or> Cinfinite r2 \<Longrightarrow> Cinfinite (r1 +c r2)"
-unfolding cinfinite_def csum_def by (rule conjI[OF _ card_of_Card_order]) (auto simp: Field_card_of)
+ using card_of_Card_order
+ by (auto simp: cinfinite_def csum_def Field_card_of)
-lemma Cinfinite_csum_weak:
- "\<lbrakk>Cinfinite r1; Cinfinite r2\<rbrakk> \<Longrightarrow> Cinfinite (r1 +c r2)"
-by (erule Cinfinite_csum1)
+lemma Cinfinite_csum1: "Cinfinite r1 \<Longrightarrow> Cinfinite (r1 +c r2)"
+ by (blast intro!: Cinfinite_csum elim: )
lemma csum_cong: "\<lbrakk>p1 =o r1; p2 =o r2\<rbrakk> \<Longrightarrow> p1 +c p2 =o r1 +c r2"
-by (simp only: csum_def ordIso_Plus_cong)
+ by (simp only: csum_def ordIso_Plus_cong)
lemma csum_cong1: "p1 =o r1 \<Longrightarrow> p1 +c q =o r1 +c q"
-by (simp only: csum_def ordIso_Plus_cong1)
+ by (simp only: csum_def ordIso_Plus_cong1)
lemma csum_cong2: "p2 =o r2 \<Longrightarrow> q +c p2 =o q +c r2"
-by (simp only: csum_def ordIso_Plus_cong2)
+ by (simp only: csum_def ordIso_Plus_cong2)
lemma csum_mono: "\<lbrakk>p1 \<le>o r1; p2 \<le>o r2\<rbrakk> \<Longrightarrow> p1 +c p2 \<le>o r1 +c r2"
-by (simp only: csum_def ordLeq_Plus_mono)
+ by (simp only: csum_def ordLeq_Plus_mono)
lemma csum_mono1: "p1 \<le>o r1 \<Longrightarrow> p1 +c q \<le>o r1 +c q"
-by (simp only: csum_def ordLeq_Plus_mono1)
+ by (simp only: csum_def ordLeq_Plus_mono1)
lemma csum_mono2: "p2 \<le>o r2 \<Longrightarrow> q +c p2 \<le>o q +c r2"
-by (simp only: csum_def ordLeq_Plus_mono2)
+ by (simp only: csum_def ordLeq_Plus_mono2)
lemma ordLeq_csum1: "Card_order p1 \<Longrightarrow> p1 \<le>o p1 +c p2"
-by (simp only: csum_def Card_order_Plus1)
+ by (simp only: csum_def Card_order_Plus1)
lemma ordLeq_csum2: "Card_order p2 \<Longrightarrow> p2 \<le>o p1 +c p2"
-by (simp only: csum_def Card_order_Plus2)
+ by (simp only: csum_def Card_order_Plus2)
lemma csum_com: "p1 +c p2 =o p2 +c p1"
-by (simp only: csum_def card_of_Plus_commute)
+ by (simp only: csum_def card_of_Plus_commute)
lemma csum_assoc: "(p1 +c p2) +c p3 =o p1 +c p2 +c p3"
-by (simp only: csum_def Field_card_of card_of_Plus_assoc)
+ by (simp only: csum_def Field_card_of card_of_Plus_assoc)
lemma Cfinite_csum: "\<lbrakk>Cfinite r; Cfinite s\<rbrakk> \<Longrightarrow> Cfinite (r +c s)"
unfolding cfinite_def csum_def Field_card_of using card_of_card_order_on by simp
@@ -235,10 +221,10 @@
qed
lemma Plus_csum: "|A <+> B| =o |A| +c |B|"
-by (simp only: csum_def Field_card_of card_of_refl)
+ by (simp only: csum_def Field_card_of card_of_refl)
lemma Un_csum: "|A \<union> B| \<le>o |A| +c |B|"
-using ordLeq_ordIso_trans[OF card_of_Un_Plus_ordLeq Plus_csum] by blast
+ using ordLeq_ordIso_trans[OF card_of_Un_Plus_ordLeq Plus_csum] by blast
subsection \<open>One\<close>
@@ -246,16 +232,17 @@
"cone = card_of {()}"
lemma Card_order_cone: "Card_order cone"
-unfolding cone_def by (rule card_of_Card_order)
+ 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: "\<not> (cone =o czero)"
-unfolding czero_def cone_def ordIso_iff_ordLeq using card_of_empty3 empty_not_insert by blast
+ unfolding czero_def cone_def ordIso_iff_ordLeq
+ using card_of_empty3 empty_not_insert by blast
lemma cone_ordLeq_Cnotzero: "Cnotzero r \<Longrightarrow> cone \<le>o r"
-unfolding cone_def by (rule Card_order_singl_ordLeq) (auto intro: czeroI)
+ unfolding cone_def by (rule Card_order_singl_ordLeq) (auto intro: czeroI)
subsection \<open>Two\<close>
@@ -264,14 +251,14 @@
"ctwo = |UNIV :: bool set|"
lemma Card_order_ctwo: "Card_order ctwo"
-unfolding ctwo_def by (rule card_of_Card_order)
+ unfolding ctwo_def by (rule card_of_Card_order)
lemma ctwo_not_czero: "\<not> (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
+ 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)
+ by (simp add: ctwo_not_czero Card_order_ctwo)
subsection \<open>Family sum\<close>
@@ -288,7 +275,7 @@
"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)
+ by (auto simp: Csum_def Field_card_of)
(* NB: Always, under the cardinal operator,
operations on sets are reduced automatically to operations on cardinals.
@@ -304,49 +291,50 @@
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
+ 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 Card_order_cprod: "Card_order (r1 *c r2)"
-by (simp only: cprod_def Field_card_of card_of_card_order_on)
+ by (simp only: cprod_def Field_card_of card_of_card_order_on)
lemma cprod_mono1: "p1 \<le>o r1 \<Longrightarrow> p1 *c q \<le>o r1 *c q"
-by (simp only: cprod_def ordLeq_Times_mono1)
+ by (simp only: cprod_def ordLeq_Times_mono1)
lemma cprod_mono2: "p2 \<le>o r2 \<Longrightarrow> q *c p2 \<le>o q *c r2"
-by (simp only: cprod_def ordLeq_Times_mono2)
+ by (simp only: cprod_def ordLeq_Times_mono2)
lemma cprod_mono: "\<lbrakk>p1 \<le>o r1; p2 \<le>o r2\<rbrakk> \<Longrightarrow> p1 *c p2 \<le>o r1 *c r2"
-by (rule ordLeq_transitive[OF cprod_mono1 cprod_mono2])
+ by (rule ordLeq_transitive[OF cprod_mono1 cprod_mono2])
lemma ordLeq_cprod2: "\<lbrakk>Cnotzero p1; Card_order p2\<rbrakk> \<Longrightarrow> p2 \<le>o p1 *c p2"
-unfolding cprod_def by (rule Card_order_Times2) (auto intro: czeroI)
+ unfolding cprod_def by (rule Card_order_Times2) (auto intro: czeroI)
lemma cinfinite_cprod: "\<lbrakk>cinfinite r1; cinfinite r2\<rbrakk> \<Longrightarrow> cinfinite (r1 *c r2)"
-by (simp add: cinfinite_def cprod_def Field_card_of infinite_cartesian_product)
+ by (simp add: cinfinite_def cprod_def Field_card_of infinite_cartesian_product)
lemma cinfinite_cprod2: "\<lbrakk>Cnotzero r1; Cinfinite r2\<rbrakk> \<Longrightarrow> cinfinite (r1 *c r2)"
-by (rule cinfinite_mono) (auto intro: ordLeq_cprod2)
+ by (rule cinfinite_mono) (auto intro: ordLeq_cprod2)
lemma Cinfinite_cprod2: "\<lbrakk>Cnotzero r1; Cinfinite r2\<rbrakk> \<Longrightarrow> Cinfinite (r1 *c r2)"
-by (blast intro: cinfinite_cprod2 Card_order_cprod)
+ by (blast intro: cinfinite_cprod2 Card_order_cprod)
lemma cprod_cong: "\<lbrakk>p1 =o r1; p2 =o r2\<rbrakk> \<Longrightarrow> p1 *c p2 =o r1 *c r2"
-unfolding ordIso_iff_ordLeq by (blast intro: cprod_mono)
+ unfolding ordIso_iff_ordLeq by (blast intro: cprod_mono)
lemma cprod_cong1: "\<lbrakk>p1 =o r1\<rbrakk> \<Longrightarrow> p1 *c p2 =o r1 *c p2"
-unfolding ordIso_iff_ordLeq by (blast intro: cprod_mono1)
+ unfolding ordIso_iff_ordLeq by (blast intro: cprod_mono1)
lemma cprod_cong2: "p2 =o r2 \<Longrightarrow> q *c p2 =o q *c r2"
-unfolding ordIso_iff_ordLeq by (blast intro: cprod_mono2)
+ unfolding ordIso_iff_ordLeq by (blast intro: cprod_mono2)
lemma cprod_com: "p1 *c p2 =o p2 *c p1"
-by (simp only: cprod_def card_of_Times_commute)
+ by (simp only: cprod_def card_of_Times_commute)
lemma card_of_Csum_Times:
"\<forall>i \<in> I. |A i| \<le>o |B| \<Longrightarrow> (CSUM i : |I|. |A i| ) \<le>o |I| *c |B|"
-by (simp only: Csum_def cprod_def Field_card_of card_of_Sigma_mono1)
+ by (simp only: Csum_def cprod_def Field_card_of card_of_Sigma_mono1)
lemma card_of_Csum_Times':
assumes "Card_order r" "\<forall>i \<in> I. |A i| \<le>o r"
@@ -361,27 +349,33 @@
qed
lemma cprod_csum_distrib1: "r1 *c r2 +c r1 *c r3 =o r1 *c (r2 +c r3)"
-unfolding csum_def cprod_def by (simp add: Field_card_of card_of_Times_Plus_distrib ordIso_symmetric)
+ unfolding csum_def cprod_def by (simp add: Field_card_of card_of_Times_Plus_distrib ordIso_symmetric)
lemma csum_absorb2': "\<lbrakk>Card_order r2; r1 \<le>o r2; cinfinite r1 \<or> cinfinite r2\<rbrakk> \<Longrightarrow> r1 +c r2 =o r2"
-unfolding csum_def by (rule conjunct2[OF Card_order_Plus_infinite])
- (auto simp: cinfinite_def dest: cinfinite_mono)
+ unfolding csum_def
+ using Card_order_Plus_infinite
+ by (fastforce simp: cinfinite_def dest: cinfinite_mono)
lemma csum_absorb1':
assumes card: "Card_order r2"
- and r12: "r1 \<le>o r2" and cr12: "cinfinite r1 \<or> cinfinite r2"
+ and r12: "r1 \<le>o r2" and cr12: "cinfinite r1 \<or> cinfinite r2"
shows "r2 +c r1 =o r2"
-by (rule ordIso_transitive, rule csum_com, rule csum_absorb2', (simp only: assms)+)
+proof -
+ have "r1 +c r2 =o r2"
+ by (simp add: csum_absorb2' assms)
+ then show ?thesis
+ by (blast intro: ordIso_transitive csum_com)
+qed
lemma csum_absorb1: "\<lbrakk>Cinfinite r2; r1 \<le>o r2\<rbrakk> \<Longrightarrow> r2 +c r1 =o r2"
-by (rule csum_absorb1') auto
+ by (rule csum_absorb1') auto
lemma csum_absorb2: "\<lbrakk>Cinfinite r2 ; r1 \<le>o r2\<rbrakk> \<Longrightarrow> 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)"
+ shows "regularCard (r +c s)"
proof (cases "r \<le>o s")
case True
then show ?thesis using regularCard_ordIso[of s] csum_absorb2'[THEN ordIso_symmetric] assms by auto
@@ -394,9 +388,9 @@
lemma csum_mono_strict:
assumes Card_order: "Card_order r" "Card_order q"
- and Cinfinite: "Cinfinite r'" "Cinfinite q'"
- and less: "r <o r'" "q <o q'"
-shows "r +c q <o r' +c q'"
+ and Cinfinite: "Cinfinite r'" "Cinfinite q'"
+ and less: "r <o r'" "q <o q'"
+ shows "r +c q <o 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
@@ -434,7 +428,7 @@
proof (cases "Cinfinite q")
case True
then have "r \<le>o q" using finite_ordLess_infinite cinfinite_def cfinite_def outer Well_order
- ordLess_imp_ordLeq by blast
+ ordLess_imp_ordLeq by blast
then have "r +c q =o q" by (rule csum_absorb2[OF True])
then show ?thesis using ordIso_ordLess_trans ordLess_ordLeq_trans less ordLeq_csum2 Cinfinite by blast
next
@@ -453,11 +447,11 @@
"r1 ^c r2 \<equiv> |Func (Field r2) (Field r1)|"
lemma Card_order_cexp: "Card_order (r1 ^c r2)"
-unfolding cexp_def by (rule card_of_Card_order)
+ unfolding cexp_def by (rule card_of_Card_order)
lemma cexp_mono':
assumes 1: "p1 \<le>o r1" and 2: "p2 \<le>o r2"
- and n: "Field p2 = {} \<Longrightarrow> Field r2 = {}"
+ and n: "Field p2 = {} \<Longrightarrow> Field r2 = {}"
shows "p1 ^c p2 \<le>o r1 ^c r2"
proof(cases "Field p1 = {}")
case True
@@ -498,36 +492,36 @@
lemma cexp_mono:
assumes 1: "p1 \<le>o r1" and 2: "p2 \<le>o r2"
- and n: "p2 =o czero \<Longrightarrow> r2 =o czero" and card: "Card_order p2"
+ and n: "p2 =o czero \<Longrightarrow> r2 =o czero" and card: "Card_order p2"
shows "p1 ^c p2 \<le>o r1 ^c r2"
by (rule cexp_mono'[OF 1 2 czeroE[OF n[OF czeroI[OF card]]]])
lemma cexp_mono1:
assumes 1: "p1 \<le>o r1" and q: "Card_order q"
shows "p1 ^c q \<le>o r1 ^c q"
-using ordLeq_refl[OF q] by (rule cexp_mono[OF 1]) (auto simp: q)
+ using ordLeq_refl[OF q] by (rule cexp_mono[OF 1]) (auto simp: q)
lemma cexp_mono2':
assumes 2: "p2 \<le>o r2" and q: "Card_order q"
- and n: "Field p2 = {} \<Longrightarrow> Field r2 = {}"
+ and n: "Field p2 = {} \<Longrightarrow> Field r2 = {}"
shows "q ^c p2 \<le>o q ^c r2"
-using ordLeq_refl[OF q] by (rule cexp_mono'[OF _ 2 n]) auto
+ using ordLeq_refl[OF q] by (rule cexp_mono'[OF _ 2 n]) auto
lemma cexp_mono2:
assumes 2: "p2 \<le>o r2" and q: "Card_order q"
- and n: "p2 =o czero \<Longrightarrow> r2 =o czero" and card: "Card_order p2"
+ and n: "p2 =o czero \<Longrightarrow> r2 =o czero" and card: "Card_order p2"
shows "q ^c p2 \<le>o q ^c r2"
-using ordLeq_refl[OF q] by (rule cexp_mono[OF _ 2 n card]) auto
+ using ordLeq_refl[OF q] by (rule cexp_mono[OF _ 2 n card]) auto
lemma cexp_mono2_Cnotzero:
assumes "p2 \<le>o r2" "Card_order q" "Cnotzero p2"
shows "q ^c p2 \<le>o q ^c r2"
-using assms(3) czeroI by (blast intro: cexp_mono2'[OF assms(1,2)])
+ using assms(3) czeroI by (blast intro: cexp_mono2'[OF assms(1,2)])
lemma cexp_cong:
assumes 1: "p1 =o r1" and 2: "p2 =o r2"
- and Cr: "Card_order r2"
- and Cp: "Card_order p2"
+ 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)"
@@ -535,7 +529,7 @@
hence 0: "Field p2 = {} \<longleftrightarrow> Field r2 = {}" unfolding bij_betw_def by auto
have r: "p2 =o czero \<Longrightarrow> r2 =o czero"
and p: "r2 =o czero \<Longrightarrow> p2 =o czero"
- using 0 Cr Cp czeroE czeroI by auto
+ 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
@@ -543,12 +537,12 @@
lemma cexp_cong1:
assumes 1: "p1 =o r1" and q: "Card_order q"
shows "p1 ^c q =o r1 ^c q"
-by (rule cexp_cong[OF 1 _ q q]) (rule ordIso_refl[OF q])
+ by (rule cexp_cong[OF 1 _ q q]) (rule ordIso_refl[OF q])
lemma cexp_cong2:
assumes 2: "p2 =o r2" and q: "Card_order q" and p: "Card_order p2"
shows "q ^c p2 =o q ^c r2"
-by (rule cexp_cong[OF _ 2]) (auto simp only: ordIso_refl Card_order_ordIso2[OF p 2] q p)
+ by (rule cexp_cong[OF _ 2]) (auto simp only: ordIso_refl Card_order_ordIso2[OF p 2] q p)
lemma cexp_cone:
assumes "Card_order r"
@@ -570,31 +564,30 @@
unfolding cprod_def cexp_def Field_card_of
using card_of_Func_Times by(rule ordIso_symmetric)
also have "r1 ^c (r3 *c r2) =o ?R"
- apply(rule cexp_cong2) using cprod_com r1 by (auto simp: Card_order_cprod)
+ using cprod_com r1 by (intro cexp_cong2, auto simp: Card_order_cprod)
finally show ?thesis .
qed
lemma cprod_infinite1': "\<lbrakk>Cinfinite r; Cnotzero p; p \<le>o r\<rbrakk> \<Longrightarrow> r *c p =o r"
-unfolding cinfinite_def cprod_def
-by (rule Card_order_Times_infinite[THEN conjunct1]) (blast intro: czeroI)+
+ unfolding cinfinite_def cprod_def
+ by (rule Card_order_Times_infinite[THEN conjunct1]) (blast intro: czeroI)+
lemma cprod_infinite: "Cinfinite r \<Longrightarrow> r *c r =o r"
-using cprod_infinite1' Cinfinite_Cnotzero ordLeq_refl by blast
+ using cprod_infinite1' Cinfinite_Cnotzero ordLeq_refl by blast
lemma cexp_cprod_ordLeq:
assumes r1: "Card_order r1" and r2: "Cinfinite r2"
- and r3: "Cnotzero r3" "r3 \<le>o r2"
+ and r3: "Cnotzero r3" "r3 \<le>o r2"
shows "(r1 ^c r2) ^c r3 =o r1 ^c r2" (is "?L =o ?R")
proof-
have "?L =o r1 ^c (r2 *c r3)" using cexp_cprod[OF r1] .
also have "r1 ^c (r2 *c r3) =o ?R"
- apply(rule cexp_cong2)
- apply(rule cprod_infinite1'[OF r2 r3]) using r1 r2 by (fastforce simp: Card_order_cprod)+
+ using assms by (fastforce simp: Card_order_cprod intro: cprod_infinite1' cexp_cong2)
finally show ?thesis .
qed
lemma Cnotzero_UNIV: "Cnotzero |UNIV|"
-by (auto simp: card_of_Card_order card_of_ordIso_czero_iff_empty)
+ by (auto simp: card_of_Card_order card_of_ordIso_czero_iff_empty)
lemma ordLess_ctwo_cexp:
assumes "Card_order r"
@@ -613,21 +606,12 @@
case True thus ?thesis by (simp only: card_of_empty cexp_def czero_def ordIso_ordLeq_trans)
next
case False
- thus ?thesis
- apply -
- apply (rule ordIso_ordLeq_trans)
- apply (rule ordIso_symmetric)
- apply (rule cexp_cone)
- apply (rule assms(2))
- apply (rule cexp_mono2)
- apply (rule cone_ordLeq_Cnotzero)
- apply (rule assms(1))
- apply (rule assms(2))
- apply (rule notE)
- apply (rule cone_not_czero)
- apply assumption
- apply (rule Card_order_cone)
- done
+ have "q =o q ^c cone"
+ by (blast intro: assms ordIso_symmetric cexp_cone)
+ also have "q ^c cone \<le>o q ^c r"
+ using assms
+ by (intro cexp_mono2) (simp_all add: cone_ordLeq_Cnotzero cone_not_czero Card_order_cone)
+ finally show ?thesis .
qed
lemma ordLeq_cexp2:
@@ -636,24 +620,20 @@
proof (cases "r =o (czero :: 'a rel)")
case True thus ?thesis by (simp only: card_of_empty cexp_def czero_def ordIso_ordLeq_trans)
next
- case False thus ?thesis
- apply -
- apply (rule ordLess_imp_ordLeq)
- apply (rule ordLess_ordLeq_trans)
- apply (rule ordLess_ctwo_cexp)
- apply (rule assms(2))
- apply (rule cexp_mono1)
- apply (rule assms(1))
- apply (rule assms(2))
- done
+ case False
+ have "r <o ctwo ^c r"
+ by (blast intro: assms ordLess_ctwo_cexp)
+ also have "ctwo ^c r \<le>o q ^c r"
+ by (blast intro: assms cexp_mono1)
+ finally show ?thesis by (rule ordLess_imp_ordLeq)
qed
lemma cinfinite_cexp: "\<lbrakk>ctwo \<le>o q; Cinfinite r\<rbrakk> \<Longrightarrow> cinfinite (q ^c r)"
-by (rule cinfinite_mono[OF ordLeq_cexp2]) simp_all
+ by (rule cinfinite_mono[OF ordLeq_cexp2]) simp_all
lemma Cinfinite_cexp:
"\<lbrakk>ctwo \<le>o q; Cinfinite r\<rbrakk> \<Longrightarrow> Cinfinite (q ^c r)"
-by (simp add: cinfinite_cexp Card_order_cexp)
+ by (simp add: cinfinite_cexp Card_order_cexp)
lemma card_order_cexp:
assumes "card_order r1" "card_order r2"
@@ -664,32 +644,32 @@
qed
lemma ctwo_ordLess_natLeq: "ctwo <o natLeq"
-unfolding ctwo_def using finite_UNIV natLeq_cinfinite natLeq_Card_order
-by (intro Cfinite_ordLess_Cinfinite) (auto simp: cfinite_def card_of_Card_order)
+ unfolding ctwo_def using finite_UNIV natLeq_cinfinite natLeq_Card_order
+ by (intro Cfinite_ordLess_Cinfinite) (auto simp: cfinite_def card_of_Card_order)
lemma ctwo_ordLess_Cinfinite: "Cinfinite r \<Longrightarrow> ctwo <o r"
-by (rule ordLess_ordLeq_trans[OF ctwo_ordLess_natLeq natLeq_ordLeq_cinfinite])
+ by (rule ordLess_ordLeq_trans[OF ctwo_ordLess_natLeq natLeq_ordLeq_cinfinite])
lemma ctwo_ordLeq_Cinfinite:
assumes "Cinfinite r"
shows "ctwo \<le>o r"
-by (rule ordLess_imp_ordLeq[OF ctwo_ordLess_Cinfinite[OF assms]])
+ by (rule ordLess_imp_ordLeq[OF ctwo_ordLess_Cinfinite[OF assms]])
lemma Un_Cinfinite_bound: "\<lbrakk>|A| \<le>o r; |B| \<le>o r; Cinfinite r\<rbrakk> \<Longrightarrow> |A \<union> B| \<le>o r"
-by (auto simp add: cinfinite_def card_of_Un_ordLeq_infinite_Field)
+ by (auto simp add: cinfinite_def card_of_Un_ordLeq_infinite_Field)
lemma Un_Cinfinite_bound_strict: "\<lbrakk>|A| <o r; |B| <o r; Cinfinite r\<rbrakk> \<Longrightarrow> |A \<union> B| <o r"
-by (auto simp add: cinfinite_def card_of_Un_ordLess_infinite_Field)
+ by (auto simp add: cinfinite_def card_of_Un_ordLess_infinite_Field)
lemma UNION_Cinfinite_bound: "\<lbrakk>|I| \<le>o r; \<forall>i \<in> I. |A i| \<le>o r; Cinfinite r\<rbrakk> \<Longrightarrow> |\<Union>i \<in> I. A i| \<le>o r"
-by (auto simp add: card_of_UNION_ordLeq_infinite_Field cinfinite_def)
+ by (auto simp add: card_of_UNION_ordLeq_infinite_Field cinfinite_def)
lemma csum_cinfinite_bound:
assumes "p \<le>o r" "q \<le>o r" "Card_order p" "Card_order q" "Cinfinite r"
shows "p +c q \<le>o r"
proof -
- from assms(1-4) have "|Field p| \<le>o r" "|Field q| \<le>o r"
- unfolding card_order_on_def using card_of_least ordLeq_transitive by blast+
+ have "|Field p| \<le>o r" "|Field q| \<le>o r"
+ using assms card_of_least ordLeq_transitive unfolding card_order_on_def by blast+
with assms show ?thesis unfolding cinfinite_def csum_def
by (blast intro: card_of_Plus_ordLeq_infinite_Field)
qed
@@ -711,26 +691,22 @@
lemma regularCard_cprod:
assumes "Cinfinite r" "Cinfinite s" "regularCard r" "regularCard s"
- shows "regularCard (r *c s)"
+ shows "regularCard (r *c s)"
proof (cases "r \<le>o s")
case True
- show ?thesis
- apply (rule regularCard_ordIso[of s])
- apply (rule ordIso_symmetric[OF cprod_infinite2'])
- using assms True Cinfinite_Cnotzero by auto
+ 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
- then have 1: "s \<le>o r" using not_ordLeq_iff_ordLess ordLess_imp_ordLeq False by blast
- show ?thesis
- apply (rule regularCard_ordIso[of r])
- apply (rule ordIso_symmetric[OF cprod_infinite1'])
- using assms 1 Cinfinite_Cnotzero by auto
+ then have "s \<le>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 \<le>o (r1 +c r2) ^c ctwo"
-unfolding cprod_def csum_def cexp_def ctwo_def Field_card_of
+ unfolding cprod_def csum_def cexp_def ctwo_def Field_card_of
proof -
let ?f = "\<lambda>(a, b). %x. if x then Inl a else Inr b"
have "inj_on ?f (Field r1 \<times> Field r2)" (is "inj_on _ ?LHS")
@@ -742,8 +718,8 @@
qed
lemma Cfinite_cprod_Cinfinite: "\<lbrakk>Cfinite r; Cinfinite s\<rbrakk> \<Longrightarrow> r *c s \<le>o s"
-by (intro cprod_cinfinite_bound)
- (auto intro: ordLeq_refl ordLess_imp_ordLeq[OF Cfinite_ordLess_Cinfinite])
+ 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)
@@ -807,12 +783,12 @@
(* cardSuc *)
lemma Cinfinite_cardSuc: "Cinfinite r \<Longrightarrow> Cinfinite (cardSuc r)"
-by (simp add: cinfinite_def cardSuc_Card_order cardSuc_finite)
+ by (simp add: cinfinite_def cardSuc_Card_order cardSuc_finite)
lemma cardSuc_UNION_Cinfinite:
assumes "Cinfinite r" "relChain (cardSuc r) As" "B \<le> (\<Union>i \<in> Field (cardSuc r). As i)" "|B| <=o r"
shows "\<exists>i \<in> Field (cardSuc r). B \<le> As i"
-using cardSuc_UNION assms unfolding cinfinite_def by blast
+ using cardSuc_UNION assms unfolding cinfinite_def by blast
lemma Cinfinite_card_suc: "\<lbrakk> Cinfinite r ; card_order r \<rbrakk> \<Longrightarrow> Cinfinite (card_suc r)"
using Cinfinite_cong[OF cardSuc_ordIso_card_suc Cinfinite_cardSuc] .