src/HOL/BNF_Cardinal_Arithmetic.thy
author traytel
Mon, 27 Jun 2022 15:54:18 +0200
changeset 75624 22d1c5f2b9f4
parent 69276 3d954183b707
child 75625 0dd3ac5fdbaa
permissions -rw-r--r--
strict bounds for BNFs (by Jan van Brügge)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
55056
b5c94200d081 renamed '_FP' files to 'BNF_' files
blanchet
parents: 55055
diff changeset
     1
(*  Title:      HOL/BNF_Cardinal_Arithmetic.thy
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
     2
    Author:     Dmitriy Traytel, TU Muenchen
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
     3
    Copyright   2012
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
     4
55059
ef2e0fb783c6 tuned comments
blanchet
parents: 55056
diff changeset
     5
Cardinal arithmetic as needed by bounded natural functors.
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
     6
*)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
     7
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 58889
diff changeset
     8
section \<open>Cardinal Arithmetic as Needed by Bounded Natural Functors\<close>
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
     9
55056
b5c94200d081 renamed '_FP' files to 'BNF_' files
blanchet
parents: 55055
diff changeset
    10
theory BNF_Cardinal_Arithmetic
b5c94200d081 renamed '_FP' files to 'BNF_' files
blanchet
parents: 55055
diff changeset
    11
imports BNF_Cardinal_Order_Relation
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    12
begin
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    13
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    14
lemma dir_image: "\<lbrakk>\<And>x y. (f x = f y) = (x = y); Card_order r\<rbrakk> \<Longrightarrow> r =o dir_image r f"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    15
by (rule dir_image_ordIso) (auto simp add: inj_on_def card_order_on_def)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    16
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    17
lemma card_order_dir_image:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    18
  assumes bij: "bij f" and co: "card_order r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    19
  shows "card_order (dir_image r f)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    20
proof -
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    21
  from assms have "Field (dir_image r f) = UNIV"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    22
    using card_order_on_Card_order[of UNIV r] unfolding bij_def dir_image_Field by auto
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    23
  moreover from bij have "\<And>x y. (f x = f y) = (x = y)" unfolding bij_def inj_on_def by auto
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    24
  with co have "Card_order (dir_image r f)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    25
    using card_order_on_Card_order[of UNIV r] Card_order_ordIso2[OF _ dir_image] by blast
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    26
  ultimately show ?thesis by auto
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    27
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    28
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    29
lemma ordIso_refl: "Card_order r \<Longrightarrow> r =o r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    30
by (rule card_order_on_ordIso)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    31
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    32
lemma ordLeq_refl: "Card_order r \<Longrightarrow> r \<le>o r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    33
by (rule ordIso_imp_ordLeq, rule card_order_on_ordIso)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    34
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    35
lemma card_of_ordIso_subst: "A = B \<Longrightarrow> |A| =o |B|"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    36
by (simp only: ordIso_refl card_of_Card_order)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    37
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    38
lemma Field_card_order: "card_order r \<Longrightarrow> Field r = UNIV"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    39
using card_order_on_Card_order[of UNIV r] by simp
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    40
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    41
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 58889
diff changeset
    42
subsection \<open>Zero\<close>
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    43
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    44
definition czero where
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    45
  "czero = card_of {}"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    46
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    47
lemma czero_ordIso:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    48
  "czero =o czero"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    49
using card_of_empty_ordIso by (simp add: czero_def)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    50
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    51
lemma card_of_ordIso_czero_iff_empty:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    52
  "|A| =o (czero :: 'b rel) \<longleftrightarrow> A = ({} :: 'a set)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    53
unfolding czero_def by (rule iffI[OF card_of_empty2]) (auto simp: card_of_refl card_of_empty_ordIso)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    54
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    55
(* A "not czero" Cardinal predicate *)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    56
abbreviation Cnotzero where
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    57
  "Cnotzero (r :: 'a rel) \<equiv> \<not>(r =o (czero :: 'a rel)) \<and> Card_order r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    58
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    59
(*helper*)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    60
lemma Cnotzero_imp_not_empty: "Cnotzero r \<Longrightarrow> Field r \<noteq> {}"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
    61
  unfolding Card_order_iff_ordIso_card_of czero_def by force
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    62
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    63
lemma czeroI:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    64
  "\<lbrakk>Card_order r; Field r = {}\<rbrakk> \<Longrightarrow> r =o czero"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    65
using Cnotzero_imp_not_empty ordIso_transitive[OF _ czero_ordIso] by blast
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    66
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    67
lemma czeroE:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    68
  "r =o czero \<Longrightarrow> Field r = {}"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    69
unfolding czero_def
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    70
by (drule card_of_cong) (simp only: Field_card_of card_of_empty2)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    71
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    72
lemma Cnotzero_mono:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    73
  "\<lbrakk>Cnotzero r; Card_order q; r \<le>o q\<rbrakk> \<Longrightarrow> Cnotzero q"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    74
apply (rule ccontr)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    75
apply auto
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    76
apply (drule czeroE)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    77
apply (erule notE)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    78
apply (erule czeroI)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    79
apply (drule card_of_mono2)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    80
apply (simp only: card_of_empty3)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    81
done
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    82
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 58889
diff changeset
    83
subsection \<open>(In)finite cardinals\<close>
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    84
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    85
definition cinfinite where
54578
9387251b6a46 eliminated dependence of BNF on Infinite_Set by moving 3 theorems from the latter to Main
traytel
parents: 54482
diff changeset
    86
  "cinfinite r = (\<not> finite (Field r))"
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    87
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    88
abbreviation Cinfinite where
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    89
  "Cinfinite r \<equiv> cinfinite r \<and> Card_order r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    90
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    91
definition cfinite where
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    92
  "cfinite r = finite (Field r)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    93
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    94
abbreviation Cfinite where
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    95
  "Cfinite r \<equiv> cfinite r \<and> Card_order r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    96
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    97
lemma Cfinite_ordLess_Cinfinite: "\<lbrakk>Cfinite r; Cinfinite s\<rbrakk> \<Longrightarrow> r <o s"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
    98
  unfolding cfinite_def cinfinite_def
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
    99
  by (blast intro: finite_ordLess_infinite card_order_on_well_order_on)
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   100
54581
1502a1f707d9 eliminated dependence of Cardinals_FP on Set_Intervals, more precise imports
traytel
parents: 54578
diff changeset
   101
lemmas natLeq_card_order = natLeq_Card_order[unfolded Field_natLeq]
1502a1f707d9 eliminated dependence of Cardinals_FP on Set_Intervals, more precise imports
traytel
parents: 54578
diff changeset
   102
1502a1f707d9 eliminated dependence of Cardinals_FP on Set_Intervals, more precise imports
traytel
parents: 54578
diff changeset
   103
lemma natLeq_cinfinite: "cinfinite natLeq"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   104
unfolding cinfinite_def Field_natLeq by (rule infinite_UNIV_nat)
54581
1502a1f707d9 eliminated dependence of Cardinals_FP on Set_Intervals, more precise imports
traytel
parents: 54578
diff changeset
   105
75624
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   106
lemma natLeq_Cinfinite: "Cinfinite natLeq"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   107
  using natLeq_cinfinite natLeq_Card_order by simp
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   108
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   109
lemma natLeq_ordLeq_cinfinite:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   110
  assumes inf: "Cinfinite r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   111
  shows "natLeq \<le>o r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   112
proof -
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   113
  from inf have "natLeq \<le>o |Field r|" unfolding cinfinite_def
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   114
    using infinite_iff_natLeq_ordLeq by blast
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   115
  also from inf have "|Field r| =o r" by (simp add: card_of_unique ordIso_symmetric)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   116
  finally show ?thesis .
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   117
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   118
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   119
lemma cinfinite_not_czero: "cinfinite r \<Longrightarrow> \<not> (r =o (czero :: 'a rel))"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   120
unfolding cinfinite_def by (cases "Field r = {}") (auto dest: czeroE)
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   121
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   122
lemma Cinfinite_Cnotzero: "Cinfinite r \<Longrightarrow> Cnotzero r"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   123
by (rule conjI[OF cinfinite_not_czero]) simp_all
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   124
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   125
lemma Cinfinite_cong: "\<lbrakk>r1 =o r2; Cinfinite r1\<rbrakk> \<Longrightarrow> Cinfinite r2"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   126
using Card_order_ordIso2[of r1 r2] unfolding cinfinite_def ordIso_iff_ordLeq
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   127
by (auto dest: card_of_ordLeq_infinite[OF card_of_mono2])
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   128
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   129
lemma cinfinite_mono: "\<lbrakk>r1 \<le>o r2; cinfinite r1\<rbrakk> \<Longrightarrow> cinfinite r2"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   130
unfolding cinfinite_def by (auto dest: card_of_ordLeq_infinite[OF card_of_mono2])
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   131
75624
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   132
lemma regularCard_ordIso:
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   133
assumes  "k =o k'" and "Cinfinite k" and "regularCard k"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   134
shows "regularCard k'"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   135
proof-
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   136
  have "stable k" using assms cinfinite_def regularCard_stable by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   137
  hence "stable k'" using assms stable_ordIso1 ordIso_symmetric by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   138
  thus ?thesis using assms cinfinite_def stable_regularCard
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   139
    using Cinfinite_cong by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   140
qed
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   141
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   142
corollary card_of_UNION_ordLess_infinite_Field_regularCard:
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   143
assumes ST: "regularCard r" and INF: "Cinfinite r" and
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   144
        LEQ_I: "|I| <o r" and LEQ: "\<forall>i \<in> I. |A i| <o r"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   145
      shows "|\<Union>i \<in> I. A i| <o r"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   146
  using card_of_UNION_ordLess_infinite_Field regularCard_stable assms cinfinite_def by blast
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   147
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 58889
diff changeset
   148
subsection \<open>Binary sum\<close>
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   149
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   150
definition csum (infixr "+c" 65) where
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   151
  "r1 +c r2 \<equiv> |Field r1 <+> Field r2|"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   152
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   153
lemma Field_csum: "Field (r +c s) = Inl ` Field r \<union> Inr ` Field s"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   154
  unfolding csum_def Field_card_of by auto
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   155
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   156
lemma Card_order_csum:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   157
  "Card_order (r1 +c r2)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   158
unfolding csum_def by (simp add: card_of_Card_order)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   159
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   160
lemma csum_Cnotzero1:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   161
  "Cnotzero r1 \<Longrightarrow> Cnotzero (r1 +c r2)"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   162
unfolding csum_def using Cnotzero_imp_not_empty[of r1] Plus_eq_empty_conv[of "Field r1" "Field r2"]
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   163
   card_of_ordIso_czero_iff_empty[of "Field r1 <+> Field r2"] by (auto intro: card_of_Card_order)
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   164
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   165
lemma card_order_csum:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   166
  assumes "card_order r1" "card_order r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   167
  shows "card_order (r1 +c r2)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   168
proof -
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   169
  have "Field r1 = UNIV" "Field r2 = UNIV" using assms card_order_on_Card_order by auto
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   170
  thus ?thesis unfolding csum_def by (auto simp: card_of_card_order_on)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   171
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   172
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   173
lemma cinfinite_csum:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   174
  "cinfinite r1 \<or> cinfinite r2 \<Longrightarrow> cinfinite (r1 +c r2)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   175
unfolding cinfinite_def csum_def by (auto simp: Field_card_of)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   176
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   177
lemma Cinfinite_csum1:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   178
  "Cinfinite r1 \<Longrightarrow> Cinfinite (r1 +c r2)"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   179
unfolding cinfinite_def csum_def by (rule conjI[OF _ card_of_Card_order]) (auto simp: Field_card_of)
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   180
54480
57e781b711b5 no need for 3-way split with GFP for a handful of theorems
blanchet
parents: 54474
diff changeset
   181
lemma Cinfinite_csum:
57e781b711b5 no need for 3-way split with GFP for a handful of theorems
blanchet
parents: 54474
diff changeset
   182
  "Cinfinite r1 \<or> Cinfinite r2 \<Longrightarrow> Cinfinite (r1 +c r2)"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   183
unfolding cinfinite_def csum_def by (rule conjI[OF _ card_of_Card_order]) (auto simp: Field_card_of)
54480
57e781b711b5 no need for 3-way split with GFP for a handful of theorems
blanchet
parents: 54474
diff changeset
   184
55851
3d40cf74726c optimize cardinal bounds involving natLeq (omega)
blanchet
parents: 55811
diff changeset
   185
lemma Cinfinite_csum_weak:
54480
57e781b711b5 no need for 3-way split with GFP for a handful of theorems
blanchet
parents: 54474
diff changeset
   186
  "\<lbrakk>Cinfinite r1; Cinfinite r2\<rbrakk> \<Longrightarrow> Cinfinite (r1 +c r2)"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   187
by (erule Cinfinite_csum1)
54480
57e781b711b5 no need for 3-way split with GFP for a handful of theorems
blanchet
parents: 54474
diff changeset
   188
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   189
lemma csum_cong: "\<lbrakk>p1 =o r1; p2 =o r2\<rbrakk> \<Longrightarrow> p1 +c p2 =o r1 +c r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   190
by (simp only: csum_def ordIso_Plus_cong)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   191
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   192
lemma csum_cong1: "p1 =o r1 \<Longrightarrow> p1 +c q =o r1 +c q"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   193
by (simp only: csum_def ordIso_Plus_cong1)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   194
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   195
lemma csum_cong2: "p2 =o r2 \<Longrightarrow> q +c p2 =o q +c r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   196
by (simp only: csum_def ordIso_Plus_cong2)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   197
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   198
lemma csum_mono: "\<lbrakk>p1 \<le>o r1; p2 \<le>o r2\<rbrakk> \<Longrightarrow> p1 +c p2 \<le>o r1 +c r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   199
by (simp only: csum_def ordLeq_Plus_mono)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   200
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   201
lemma csum_mono1: "p1 \<le>o r1 \<Longrightarrow> p1 +c q \<le>o r1 +c q"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   202
by (simp only: csum_def ordLeq_Plus_mono1)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   203
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   204
lemma csum_mono2: "p2 \<le>o r2 \<Longrightarrow> q +c p2 \<le>o q +c r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   205
by (simp only: csum_def ordLeq_Plus_mono2)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   206
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   207
lemma ordLeq_csum1: "Card_order p1 \<Longrightarrow> p1 \<le>o p1 +c p2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   208
by (simp only: csum_def Card_order_Plus1)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   209
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   210
lemma ordLeq_csum2: "Card_order p2 \<Longrightarrow> p2 \<le>o p1 +c p2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   211
by (simp only: csum_def Card_order_Plus2)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   212
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   213
lemma csum_com: "p1 +c p2 =o p2 +c p1"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   214
by (simp only: csum_def card_of_Plus_commute)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   215
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   216
lemma csum_assoc: "(p1 +c p2) +c p3 =o p1 +c p2 +c p3"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   217
by (simp only: csum_def Field_card_of card_of_Plus_assoc)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   218
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   219
lemma Cfinite_csum: "\<lbrakk>Cfinite r; Cfinite s\<rbrakk> \<Longrightarrow> Cfinite (r +c s)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   220
  unfolding cfinite_def csum_def Field_card_of using card_of_card_order_on by simp
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   221
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   222
lemma csum_csum: "(r1 +c r2) +c (r3 +c r4) =o (r1 +c r3) +c (r2 +c r4)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   223
proof -
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   224
  have "(r1 +c r2) +c (r3 +c r4) =o r1 +c r2 +c (r3 +c r4)"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   225
    by (rule csum_assoc)
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   226
  also have "r1 +c r2 +c (r3 +c r4) =o r1 +c (r2 +c r3) +c r4"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   227
    by (intro csum_assoc csum_cong2 ordIso_symmetric)
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   228
  also have "r1 +c (r2 +c r3) +c r4 =o r1 +c (r3 +c r2) +c r4"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   229
    by (intro csum_com csum_cong1 csum_cong2)
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   230
  also have "r1 +c (r3 +c r2) +c r4 =o r1 +c r3 +c r2 +c r4"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   231
    by (intro csum_assoc csum_cong2 ordIso_symmetric)
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   232
  also have "r1 +c r3 +c r2 +c r4 =o (r1 +c r3) +c (r2 +c r4)"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   233
    by (intro csum_assoc ordIso_symmetric)
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   234
  finally show ?thesis .
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   235
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   236
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   237
lemma Plus_csum: "|A <+> B| =o |A| +c |B|"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   238
by (simp only: csum_def Field_card_of card_of_refl)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   239
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   240
lemma Un_csum: "|A \<union> B| \<le>o |A| +c |B|"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   241
using ordLeq_ordIso_trans[OF card_of_Un_Plus_ordLeq Plus_csum] by blast
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   242
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 58889
diff changeset
   243
subsection \<open>One\<close>
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   244
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   245
definition cone where
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   246
  "cone = card_of {()}"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   247
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   248
lemma Card_order_cone: "Card_order cone"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   249
unfolding cone_def by (rule card_of_Card_order)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   250
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   251
lemma Cfinite_cone: "Cfinite cone"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   252
  unfolding cfinite_def by (simp add: Card_order_cone)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   253
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   254
lemma cone_not_czero: "\<not> (cone =o czero)"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   255
unfolding czero_def cone_def ordIso_iff_ordLeq using card_of_empty3 empty_not_insert by blast
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   256
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   257
lemma cone_ordLeq_Cnotzero: "Cnotzero r \<Longrightarrow> cone \<le>o r"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   258
unfolding cone_def by (rule Card_order_singl_ordLeq) (auto intro: czeroI)
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   259
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   260
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 58889
diff changeset
   261
subsection \<open>Two\<close>
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   262
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   263
definition ctwo where
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   264
  "ctwo = |UNIV :: bool set|"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   265
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   266
lemma Card_order_ctwo: "Card_order ctwo"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   267
unfolding ctwo_def by (rule card_of_Card_order)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   268
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   269
lemma ctwo_not_czero: "\<not> (ctwo =o czero)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   270
using card_of_empty3[of "UNIV :: bool set"] ordIso_iff_ordLeq
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   271
unfolding czero_def ctwo_def using UNIV_not_empty by auto
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   272
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   273
lemma ctwo_Cnotzero: "Cnotzero ctwo"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   274
by (simp add: ctwo_not_czero Card_order_ctwo)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   275
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   276
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 58889
diff changeset
   277
subsection \<open>Family sum\<close>
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   278
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   279
definition Csum where
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   280
  "Csum r rs \<equiv> |SIGMA i : Field r. Field (rs i)|"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   281
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   282
(* Similar setup to the one for SIGMA from theory Big_Operators: *)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   283
syntax "_Csum" ::
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   284
  "pttrn => ('a * 'a) set => 'b * 'b set => (('a * 'b) * ('a * 'b)) set"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   285
  ("(3CSUM _:_. _)" [0, 51, 10] 10)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   286
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   287
translations
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   288
  "CSUM i:r. rs" == "CONST Csum r (%i. rs)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   289
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   290
lemma SIGMA_CSUM: "|SIGMA i : I. As i| = (CSUM i : |I|. |As i| )"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   291
by (auto simp: Csum_def Field_card_of)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   292
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   293
(* NB: Always, under the cardinal operator,
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   294
operations on sets are reduced automatically to operations on cardinals.
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   295
This should make cardinal reasoning more direct and natural.  *)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   296
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   297
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 58889
diff changeset
   298
subsection \<open>Product\<close>
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   299
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   300
definition cprod (infixr "*c" 80) where
61943
7fba644ed827 discontinued ASCII replacement syntax <*>;
wenzelm
parents: 60758
diff changeset
   301
  "r1 *c r2 = |Field r1 \<times> Field r2|"
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   302
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   303
lemma card_order_cprod:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   304
  assumes "card_order r1" "card_order r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   305
  shows "card_order (r1 *c r2)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   306
proof -
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   307
  have "Field r1 = UNIV" "Field r2 = UNIV" using assms card_order_on_Card_order by auto
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   308
  thus ?thesis by (auto simp: cprod_def card_of_card_order_on)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   309
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   310
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   311
lemma Card_order_cprod: "Card_order (r1 *c r2)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   312
by (simp only: cprod_def Field_card_of card_of_card_order_on)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   313
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   314
lemma cprod_mono1: "p1 \<le>o r1 \<Longrightarrow> p1 *c q \<le>o r1 *c q"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   315
by (simp only: cprod_def ordLeq_Times_mono1)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   316
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   317
lemma cprod_mono2: "p2 \<le>o r2 \<Longrightarrow> q *c p2 \<le>o q *c r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   318
by (simp only: cprod_def ordLeq_Times_mono2)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   319
55851
3d40cf74726c optimize cardinal bounds involving natLeq (omega)
blanchet
parents: 55811
diff changeset
   320
lemma cprod_mono: "\<lbrakk>p1 \<le>o r1; p2 \<le>o r2\<rbrakk> \<Longrightarrow> p1 *c p2 \<le>o r1 *c r2"
3d40cf74726c optimize cardinal bounds involving natLeq (omega)
blanchet
parents: 55811
diff changeset
   321
by (rule ordLeq_transitive[OF cprod_mono1 cprod_mono2])
3d40cf74726c optimize cardinal bounds involving natLeq (omega)
blanchet
parents: 55811
diff changeset
   322
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   323
lemma ordLeq_cprod2: "\<lbrakk>Cnotzero p1; Card_order p2\<rbrakk> \<Longrightarrow> p2 \<le>o p1 *c p2"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   324
unfolding cprod_def by (rule Card_order_Times2) (auto intro: czeroI)
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   325
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   326
lemma cinfinite_cprod: "\<lbrakk>cinfinite r1; cinfinite r2\<rbrakk> \<Longrightarrow> cinfinite (r1 *c r2)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   327
by (simp add: cinfinite_def cprod_def Field_card_of infinite_cartesian_product)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   328
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   329
lemma cinfinite_cprod2: "\<lbrakk>Cnotzero r1; Cinfinite r2\<rbrakk> \<Longrightarrow> cinfinite (r1 *c r2)"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   330
by (rule cinfinite_mono) (auto intro: ordLeq_cprod2)
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   331
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   332
lemma Cinfinite_cprod2: "\<lbrakk>Cnotzero r1; Cinfinite r2\<rbrakk> \<Longrightarrow> Cinfinite (r1 *c r2)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   333
by (blast intro: cinfinite_cprod2 Card_order_cprod)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   334
55851
3d40cf74726c optimize cardinal bounds involving natLeq (omega)
blanchet
parents: 55811
diff changeset
   335
lemma cprod_cong: "\<lbrakk>p1 =o r1; p2 =o r2\<rbrakk> \<Longrightarrow> p1 *c p2 =o r1 *c r2"
55866
a6fa341a6d66 life without 'metis'
blanchet
parents: 55851
diff changeset
   336
unfolding ordIso_iff_ordLeq by (blast intro: cprod_mono)
55851
3d40cf74726c optimize cardinal bounds involving natLeq (omega)
blanchet
parents: 55811
diff changeset
   337
3d40cf74726c optimize cardinal bounds involving natLeq (omega)
blanchet
parents: 55811
diff changeset
   338
lemma cprod_cong1: "\<lbrakk>p1 =o r1\<rbrakk> \<Longrightarrow> p1 *c p2 =o r1 *c p2"
55866
a6fa341a6d66 life without 'metis'
blanchet
parents: 55851
diff changeset
   339
unfolding ordIso_iff_ordLeq by (blast intro: cprod_mono1)
55851
3d40cf74726c optimize cardinal bounds involving natLeq (omega)
blanchet
parents: 55811
diff changeset
   340
3d40cf74726c optimize cardinal bounds involving natLeq (omega)
blanchet
parents: 55811
diff changeset
   341
lemma cprod_cong2: "p2 =o r2 \<Longrightarrow> q *c p2 =o q *c r2"
55866
a6fa341a6d66 life without 'metis'
blanchet
parents: 55851
diff changeset
   342
unfolding ordIso_iff_ordLeq by (blast intro: cprod_mono2)
55851
3d40cf74726c optimize cardinal bounds involving natLeq (omega)
blanchet
parents: 55811
diff changeset
   343
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   344
lemma cprod_com: "p1 *c p2 =o p2 *c p1"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   345
by (simp only: cprod_def card_of_Times_commute)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   346
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   347
lemma card_of_Csum_Times:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   348
  "\<forall>i \<in> I. |A i| \<le>o |B| \<Longrightarrow> (CSUM i : |I|. |A i| ) \<le>o |I| *c |B|"
56191
159b0c88b4a4 tuned proofs; removed duplicated facts
traytel
parents: 55866
diff changeset
   349
by (simp only: Csum_def cprod_def Field_card_of card_of_Sigma_mono1)
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   350
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   351
lemma card_of_Csum_Times':
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   352
  assumes "Card_order r" "\<forall>i \<in> I. |A i| \<le>o r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   353
  shows "(CSUM i : |I|. |A i| ) \<le>o |I| *c r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   354
proof -
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   355
  from assms(1) have *: "r =o |Field r|" by (simp add: card_of_unique)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   356
  with assms(2) have "\<forall>i \<in> I. |A i| \<le>o |Field r|" by (blast intro: ordLeq_ordIso_trans)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   357
  hence "(CSUM i : |I|. |A i| ) \<le>o |I| *c |Field r|" by (simp only: card_of_Csum_Times)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   358
  also from * have "|I| *c |Field r| \<le>o |I| *c r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   359
    by (simp only: Field_card_of card_of_refl cprod_def ordIso_imp_ordLeq)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   360
  finally show ?thesis .
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   361
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   362
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   363
lemma cprod_csum_distrib1: "r1 *c r2 +c r1 *c r3 =o r1 *c (r2 +c r3)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   364
unfolding csum_def cprod_def by (simp add: Field_card_of card_of_Times_Plus_distrib ordIso_symmetric)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   365
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   366
lemma csum_absorb2': "\<lbrakk>Card_order r2; r1 \<le>o r2; cinfinite r1 \<or> cinfinite r2\<rbrakk> \<Longrightarrow> r1 +c r2 =o r2"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   367
unfolding csum_def by (rule conjunct2[OF Card_order_Plus_infinite])
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   368
  (auto simp: cinfinite_def dest: cinfinite_mono)
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   369
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   370
lemma csum_absorb1':
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   371
  assumes card: "Card_order r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   372
  and r12: "r1 \<le>o r2" and cr12: "cinfinite r1 \<or> cinfinite r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   373
  shows "r2 +c r1 =o r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   374
by (rule ordIso_transitive, rule csum_com, rule csum_absorb2', (simp only: assms)+)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   375
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   376
lemma csum_absorb1: "\<lbrakk>Cinfinite r2; r1 \<le>o r2\<rbrakk> \<Longrightarrow> r2 +c r1 =o r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   377
by (rule csum_absorb1') auto
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   378
75624
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   379
lemma csum_absorb2: "\<lbrakk>Cinfinite r2 ; r1 \<le>o r2\<rbrakk> \<Longrightarrow> r1 +c r2 =o r2"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   380
  using ordIso_transitive csum_com csum_absorb1 by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   381
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   382
lemma regularCard_csum:
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   383
  assumes "Cinfinite r" "Cinfinite s" "regularCard r" "regularCard s"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   384
    shows "regularCard (r +c s)"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   385
proof (cases "r \<le>o s")
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   386
  case True
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   387
  then show ?thesis using regularCard_ordIso[of s] csum_absorb2'[THEN ordIso_symmetric] assms by auto
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   388
next
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   389
  case False
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   390
  have "Well_order s" "Well_order r" using assms card_order_on_well_order_on by auto
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   391
  then have "s \<le>o r" using not_ordLeq_iff_ordLess False ordLess_imp_ordLeq by auto
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   392
  then show ?thesis using regularCard_ordIso[of r] csum_absorb1'[THEN ordIso_symmetric] assms by auto
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   393
qed
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   394
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   395
lemma csum_mono_strict:
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   396
  assumes Card_order: "Card_order r" "Card_order q"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   397
  and Cinfinite: "Cinfinite r'" "Cinfinite q'"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   398
  and less: "r <o r'" "q <o q'"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   399
shows "r +c q <o r' +c q'"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   400
proof -
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   401
  have Well_order: "Well_order r" "Well_order q" "Well_order r'" "Well_order q'"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   402
    using card_order_on_well_order_on Card_order Cinfinite by auto
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   403
  show ?thesis
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   404
  proof (cases "Cinfinite r")
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   405
    case outer: True
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   406
    then show ?thesis
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   407
    proof (cases "Cinfinite q")
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   408
      case inner: True
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   409
      then show ?thesis
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   410
      proof (cases "r \<le>o q")
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   411
        case True
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   412
        then have "r +c q =o q" using csum_absorb2 inner by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   413
        then show ?thesis
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   414
          using ordIso_ordLess_trans ordLess_ordLeq_trans less Cinfinite ordLeq_csum2 by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   415
      next
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   416
        case False
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   417
        then have "q \<le>o r" using not_ordLeq_iff_ordLess Well_order ordLess_imp_ordLeq by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   418
        then have "r +c q =o r" using csum_absorb1 outer by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   419
        then show ?thesis
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   420
          using ordIso_ordLess_trans ordLess_ordLeq_trans less Cinfinite ordLeq_csum1 by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   421
      qed
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   422
    next
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   423
      case False
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   424
      then have "Cfinite q" using Card_order cinfinite_def cfinite_def by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   425
      then have "q \<le>o r" using finite_ordLess_infinite cfinite_def cinfinite_def outer
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   426
          Well_order ordLess_imp_ordLeq by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   427
      then have "r +c q =o r" by (rule csum_absorb1[OF outer])
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   428
      then show ?thesis using ordIso_ordLess_trans ordLess_ordLeq_trans less ordLeq_csum1 Cinfinite by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   429
    qed
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   430
  next
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   431
    case False
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   432
    then have outer: "Cfinite r" using Card_order cinfinite_def cfinite_def by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   433
    then show ?thesis
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   434
    proof (cases "Cinfinite q")
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   435
      case True
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   436
      then have "r \<le>o q" using finite_ordLess_infinite cinfinite_def cfinite_def outer Well_order
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   437
        ordLess_imp_ordLeq by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   438
      then have "r +c q =o q" by (rule csum_absorb2[OF True])
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   439
      then show ?thesis using ordIso_ordLess_trans ordLess_ordLeq_trans less ordLeq_csum2 Cinfinite by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   440
    next
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   441
      case False
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   442
      then have "Cfinite q" using Card_order cinfinite_def cfinite_def by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   443
      then have "Cfinite (r +c q)" using Cfinite_csum outer by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   444
      moreover have "Cinfinite (r' +c q')" using Cinfinite_csum1 Cinfinite by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   445
      ultimately show ?thesis using Cfinite_ordLess_Cinfinite by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   446
    qed
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   447
  qed
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   448
qed
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   449
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 58889
diff changeset
   450
subsection \<open>Exponentiation\<close>
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   451
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   452
definition cexp (infixr "^c" 90) where
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   453
  "r1 ^c r2 \<equiv> |Func (Field r2) (Field r1)|"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   454
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   455
lemma Card_order_cexp: "Card_order (r1 ^c r2)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   456
unfolding cexp_def by (rule card_of_Card_order)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   457
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   458
lemma cexp_mono':
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   459
  assumes 1: "p1 \<le>o r1" and 2: "p2 \<le>o r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   460
  and n: "Field p2 = {} \<Longrightarrow> Field r2 = {}"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   461
  shows "p1 ^c p2 \<le>o r1 ^c r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   462
proof(cases "Field p1 = {}")
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   463
  case True
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   464
  hence "Field p2 \<noteq> {} \<Longrightarrow> Func (Field p2) {} = {}" unfolding Func_is_emp by simp
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   465
  with True have "|Field |Func (Field p2) (Field p1)|| \<le>o cone"
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   466
    unfolding cone_def Field_card_of
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   467
    by (cases "Field p2 = {}", auto intro: surj_imp_ordLeq simp: Func_empty)
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   468
  hence "|Func (Field p2) (Field p1)| \<le>o cone" by (simp add: Field_card_of cexp_def)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   469
  hence "p1 ^c p2 \<le>o cone" unfolding cexp_def .
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   470
  thus ?thesis
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   471
  proof (cases "Field p2 = {}")
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   472
    case True
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   473
    with n have "Field r2 = {}" .
55604
42e4e8c2e8dc less flex-flex pairs
noschinl
parents: 55059
diff changeset
   474
    hence "cone \<le>o r1 ^c r2" unfolding cone_def cexp_def Func_def
42e4e8c2e8dc less flex-flex pairs
noschinl
parents: 55059
diff changeset
   475
      by (auto intro: card_of_ordLeqI[where f="\<lambda>_ _. undefined"])
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 58889
diff changeset
   476
    thus ?thesis using \<open>p1 ^c p2 \<le>o cone\<close> ordLeq_transitive by auto
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   477
  next
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   478
    case False with True have "|Field (p1 ^c p2)| =o czero"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   479
      unfolding card_of_ordIso_czero_iff_empty cexp_def Field_card_of Func_def by auto
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   480
    thus ?thesis unfolding cexp_def card_of_ordIso_czero_iff_empty Field_card_of
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   481
      by (simp add: card_of_empty)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   482
  qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   483
next
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   484
  case False
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   485
  have 1: "|Field p1| \<le>o |Field r1|" and 2: "|Field p2| \<le>o |Field r2|"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   486
    using 1 2 by (auto simp: card_of_mono2)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   487
  obtain f1 where f1: "f1 ` Field r1 = Field p1"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   488
    using 1 unfolding card_of_ordLeq2[OF False, symmetric] by auto
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   489
  obtain f2 where f2: "inj_on f2 (Field p2)" "f2 ` Field p2 \<subseteq> Field r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   490
    using 2 unfolding card_of_ordLeq[symmetric] by blast
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   491
  have 0: "Func_map (Field p2) f1 f2 ` (Field (r1 ^c r2)) = Field (p1 ^c p2)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   492
    unfolding cexp_def Field_card_of using Func_map_surj[OF f1 f2 n, symmetric] .
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   493
  have 00: "Field (p1 ^c p2) \<noteq> {}" unfolding cexp_def Field_card_of Func_is_emp
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   494
    using False by simp
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   495
  show ?thesis
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   496
    using 0 card_of_ordLeq2[OF 00] unfolding cexp_def Field_card_of by blast
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   497
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   498
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   499
lemma cexp_mono:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   500
  assumes 1: "p1 \<le>o r1" and 2: "p2 \<le>o r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   501
  and n: "p2 =o czero \<Longrightarrow> r2 =o czero" and card: "Card_order p2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   502
  shows "p1 ^c p2 \<le>o r1 ^c r2"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   503
  by (rule cexp_mono'[OF 1 2 czeroE[OF n[OF czeroI[OF card]]]])
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   504
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   505
lemma cexp_mono1:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   506
  assumes 1: "p1 \<le>o r1" and q: "Card_order q"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   507
  shows "p1 ^c q \<le>o r1 ^c q"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   508
using ordLeq_refl[OF q] by (rule cexp_mono[OF 1]) (auto simp: q)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   509
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   510
lemma cexp_mono2':
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   511
  assumes 2: "p2 \<le>o r2" and q: "Card_order q"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   512
  and n: "Field p2 = {} \<Longrightarrow> Field r2 = {}"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   513
  shows "q ^c p2 \<le>o q ^c r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   514
using ordLeq_refl[OF q] by (rule cexp_mono'[OF _ 2 n]) auto
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   515
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   516
lemma cexp_mono2:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   517
  assumes 2: "p2 \<le>o r2" and q: "Card_order q"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   518
  and n: "p2 =o czero \<Longrightarrow> r2 =o czero" and card: "Card_order p2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   519
  shows "q ^c p2 \<le>o q ^c r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   520
using ordLeq_refl[OF q] by (rule cexp_mono[OF _ 2 n card]) auto
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   521
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   522
lemma cexp_mono2_Cnotzero:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   523
  assumes "p2 \<le>o r2" "Card_order q" "Cnotzero p2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   524
  shows "q ^c p2 \<le>o q ^c r2"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   525
using assms(3) czeroI by (blast intro: cexp_mono2'[OF assms(1,2)])
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   526
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   527
lemma cexp_cong:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   528
  assumes 1: "p1 =o r1" and 2: "p2 =o r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   529
  and Cr: "Card_order r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   530
  and Cp: "Card_order p2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   531
  shows "p1 ^c p2 =o r1 ^c r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   532
proof -
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   533
  obtain f where "bij_betw f (Field p2) (Field r2)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   534
    using 2 card_of_ordIso[of "Field p2" "Field r2"] card_of_cong by auto
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   535
  hence 0: "Field p2 = {} \<longleftrightarrow> Field r2 = {}" unfolding bij_betw_def by auto
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   536
  have r: "p2 =o czero \<Longrightarrow> r2 =o czero"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   537
    and p: "r2 =o czero \<Longrightarrow> p2 =o czero"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   538
     using 0 Cr Cp czeroE czeroI by auto
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   539
  show ?thesis using 0 1 2 unfolding ordIso_iff_ordLeq
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   540
    using r p cexp_mono[OF _ _ _ Cp] cexp_mono[OF _ _ _ Cr] by blast
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   541
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   542
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   543
lemma cexp_cong1:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   544
  assumes 1: "p1 =o r1" and q: "Card_order q"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   545
  shows "p1 ^c q =o r1 ^c q"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   546
by (rule cexp_cong[OF 1 _ q q]) (rule ordIso_refl[OF q])
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   547
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   548
lemma cexp_cong2:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   549
  assumes 2: "p2 =o r2" and q: "Card_order q" and p: "Card_order p2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   550
  shows "q ^c p2 =o q ^c r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   551
by (rule cexp_cong[OF _ 2]) (auto simp only: ordIso_refl Card_order_ordIso2[OF p 2] q p)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   552
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   553
lemma cexp_cone:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   554
  assumes "Card_order r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   555
  shows "r ^c cone =o r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   556
proof -
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   557
  have "r ^c cone =o |Field r|"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   558
    unfolding cexp_def cone_def Field_card_of Func_empty
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   559
      card_of_ordIso[symmetric] bij_betw_def Func_def inj_on_def image_def
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   560
    by (rule exI[of _ "\<lambda>f. f ()"]) auto
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   561
  also have "|Field r| =o r" by (rule card_of_Field_ordIso[OF assms])
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   562
  finally show ?thesis .
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   563
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   564
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   565
lemma cexp_cprod:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   566
  assumes r1: "Card_order r1"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   567
  shows "(r1 ^c r2) ^c r3 =o r1 ^c (r2 *c r3)" (is "?L =o ?R")
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   568
proof -
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   569
  have "?L =o r1 ^c (r3 *c r2)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   570
    unfolding cprod_def cexp_def Field_card_of
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   571
    using card_of_Func_Times by(rule ordIso_symmetric)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   572
  also have "r1 ^c (r3 *c r2) =o ?R"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   573
    apply(rule cexp_cong2) using cprod_com r1 by (auto simp: Card_order_cprod)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   574
  finally show ?thesis .
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   575
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   576
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   577
lemma cprod_infinite1': "\<lbrakk>Cinfinite r; Cnotzero p; p \<le>o r\<rbrakk> \<Longrightarrow> r *c p =o r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   578
unfolding cinfinite_def cprod_def
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   579
by (rule Card_order_Times_infinite[THEN conjunct1]) (blast intro: czeroI)+
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   580
55851
3d40cf74726c optimize cardinal bounds involving natLeq (omega)
blanchet
parents: 55811
diff changeset
   581
lemma cprod_infinite: "Cinfinite r \<Longrightarrow> r *c r =o r"
3d40cf74726c optimize cardinal bounds involving natLeq (omega)
blanchet
parents: 55811
diff changeset
   582
using cprod_infinite1' Cinfinite_Cnotzero ordLeq_refl by blast
3d40cf74726c optimize cardinal bounds involving natLeq (omega)
blanchet
parents: 55811
diff changeset
   583
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   584
lemma cexp_cprod_ordLeq:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   585
  assumes r1: "Card_order r1" and r2: "Cinfinite r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   586
  and r3: "Cnotzero r3" "r3 \<le>o r2"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   587
  shows "(r1 ^c r2) ^c r3 =o r1 ^c r2" (is "?L =o ?R")
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   588
proof-
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   589
  have "?L =o r1 ^c (r2 *c r3)" using cexp_cprod[OF r1] .
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   590
  also have "r1 ^c (r2 *c r3) =o ?R"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   591
  apply(rule cexp_cong2)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   592
  apply(rule cprod_infinite1'[OF r2 r3]) using r1 r2 by (fastforce simp: Card_order_cprod)+
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   593
  finally show ?thesis .
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   594
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   595
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   596
lemma Cnotzero_UNIV: "Cnotzero |UNIV|"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   597
by (auto simp: card_of_Card_order card_of_ordIso_czero_iff_empty)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   598
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   599
lemma ordLess_ctwo_cexp:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   600
  assumes "Card_order r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   601
  shows "r <o ctwo ^c r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   602
proof -
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   603
  have "r <o |Pow (Field r)|" using assms by (rule Card_order_Pow)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   604
  also have "|Pow (Field r)| =o ctwo ^c r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   605
    unfolding ctwo_def cexp_def Field_card_of by (rule card_of_Pow_Func)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   606
  finally show ?thesis .
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   607
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   608
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   609
lemma ordLeq_cexp1:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   610
  assumes "Cnotzero r" "Card_order q"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   611
  shows "q \<le>o q ^c r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   612
proof (cases "q =o (czero :: 'a rel)")
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   613
  case True thus ?thesis by (simp only: card_of_empty cexp_def czero_def ordIso_ordLeq_trans)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   614
next
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   615
  case False
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   616
  thus ?thesis
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   617
    apply -
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   618
    apply (rule ordIso_ordLeq_trans)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   619
    apply (rule ordIso_symmetric)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   620
    apply (rule cexp_cone)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   621
    apply (rule assms(2))
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   622
    apply (rule cexp_mono2)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   623
    apply (rule cone_ordLeq_Cnotzero)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   624
    apply (rule assms(1))
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   625
    apply (rule assms(2))
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   626
    apply (rule notE)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   627
    apply (rule cone_not_czero)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   628
    apply assumption
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   629
    apply (rule Card_order_cone)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   630
  done
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   631
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   632
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   633
lemma ordLeq_cexp2:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   634
  assumes "ctwo \<le>o q" "Card_order r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   635
  shows "r \<le>o q ^c r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   636
proof (cases "r =o (czero :: 'a rel)")
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   637
  case True thus ?thesis by (simp only: card_of_empty cexp_def czero_def ordIso_ordLeq_trans)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   638
next
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   639
  case False thus ?thesis
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   640
    apply -
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   641
    apply (rule ordLess_imp_ordLeq)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   642
    apply (rule ordLess_ordLeq_trans)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   643
    apply (rule ordLess_ctwo_cexp)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   644
    apply (rule assms(2))
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   645
    apply (rule cexp_mono1)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   646
    apply (rule assms(1))
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   647
    apply (rule assms(2))
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   648
  done
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   649
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   650
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   651
lemma cinfinite_cexp: "\<lbrakk>ctwo \<le>o q; Cinfinite r\<rbrakk> \<Longrightarrow> cinfinite (q ^c r)"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   652
by (rule cinfinite_mono[OF ordLeq_cexp2]) simp_all
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   653
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   654
lemma Cinfinite_cexp:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   655
  "\<lbrakk>ctwo \<le>o q; Cinfinite r\<rbrakk> \<Longrightarrow> Cinfinite (q ^c r)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   656
by (simp add: cinfinite_cexp Card_order_cexp)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   657
75624
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   658
lemma card_order_cexp:
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   659
  assumes "card_order r1" "card_order r2"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   660
  shows "card_order (r1 ^c r2)"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   661
proof -
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   662
  have "Field r1 = UNIV" "Field r2 = UNIV" using assms card_order_on_Card_order by auto
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   663
  thus ?thesis unfolding cexp_def Func_def using card_of_card_order_on by simp
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   664
qed
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   665
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   666
lemma ctwo_ordLess_natLeq: "ctwo <o natLeq"
54581
1502a1f707d9 eliminated dependence of Cardinals_FP on Set_Intervals, more precise imports
traytel
parents: 54578
diff changeset
   667
unfolding ctwo_def using finite_UNIV natLeq_cinfinite natLeq_Card_order
1502a1f707d9 eliminated dependence of Cardinals_FP on Set_Intervals, more precise imports
traytel
parents: 54578
diff changeset
   668
by (intro Cfinite_ordLess_Cinfinite) (auto simp: cfinite_def card_of_Card_order)
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   669
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   670
lemma ctwo_ordLess_Cinfinite: "Cinfinite r \<Longrightarrow> ctwo <o r"
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   671
by (rule ordLess_ordLeq_trans[OF ctwo_ordLess_natLeq natLeq_ordLeq_cinfinite])
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   672
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   673
lemma ctwo_ordLeq_Cinfinite:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   674
  assumes "Cinfinite r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   675
  shows "ctwo \<le>o r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   676
by (rule ordLess_imp_ordLeq[OF ctwo_ordLess_Cinfinite[OF assms]])
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   677
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   678
lemma Un_Cinfinite_bound: "\<lbrakk>|A| \<le>o r; |B| \<le>o r; Cinfinite r\<rbrakk> \<Longrightarrow> |A \<union> B| \<le>o r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   679
by (auto simp add: cinfinite_def card_of_Un_ordLeq_infinite_Field)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   680
75624
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   681
lemma Un_Cinfinite_bound_strict: "\<lbrakk>|A| <o r; |B| <o r; Cinfinite r\<rbrakk> \<Longrightarrow> |A \<union> B| <o r"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   682
by (auto simp add: cinfinite_def card_of_Un_ordLess_infinite_Field)
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   683
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   684
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"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   685
by (auto simp add: card_of_UNION_ordLeq_infinite_Field cinfinite_def)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   686
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   687
lemma csum_cinfinite_bound:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   688
  assumes "p \<le>o r" "q \<le>o r" "Card_order p" "Card_order q" "Cinfinite r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   689
  shows "p +c q \<le>o r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   690
proof -
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   691
  from assms(1-4) have "|Field p| \<le>o r" "|Field q| \<le>o r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   692
    unfolding card_order_on_def using card_of_least ordLeq_transitive by blast+
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   693
  with assms show ?thesis unfolding cinfinite_def csum_def
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   694
    by (blast intro: card_of_Plus_ordLeq_infinite_Field)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   695
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   696
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   697
lemma cprod_cinfinite_bound:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   698
  assumes "p \<le>o r" "q \<le>o r" "Card_order p" "Card_order q" "Cinfinite r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   699
  shows "p *c q \<le>o r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   700
proof -
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   701
  from assms(1-4) have "|Field p| \<le>o r" "|Field q| \<le>o r"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   702
    unfolding card_order_on_def using card_of_least ordLeq_transitive by blast+
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   703
  with assms show ?thesis unfolding cinfinite_def cprod_def
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   704
    by (blast intro: card_of_Times_ordLeq_infinite_Field)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   705
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   706
75624
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   707
lemma cprod_infinite2': "\<lbrakk>Cnotzero r1; Cinfinite r2; r1 \<le>o r2\<rbrakk> \<Longrightarrow> r1 *c r2 =o r2"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   708
  unfolding ordIso_iff_ordLeq
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   709
  by (intro conjI cprod_cinfinite_bound ordLeq_cprod2 ordLeq_refl)
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   710
    (auto dest!: ordIso_imp_ordLeq not_ordLeq_ordLess simp: czero_def Card_order_empty)
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   711
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   712
lemma regularCard_cprod:
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   713
  assumes "Cinfinite r" "Cinfinite s" "regularCard r" "regularCard s"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   714
    shows "regularCard (r *c s)"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   715
proof (cases "r \<le>o s")
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   716
  case True
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   717
  show ?thesis
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   718
    apply (rule regularCard_ordIso[of s])
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   719
      apply (rule ordIso_symmetric[OF cprod_infinite2'])
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   720
    using assms True Cinfinite_Cnotzero by auto
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   721
next
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   722
  case False
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   723
  have "Well_order r" "Well_order s" using assms card_order_on_well_order_on by auto
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   724
  then have 1: "s \<le>o r" using not_ordLeq_iff_ordLess ordLess_imp_ordLeq False by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   725
  show ?thesis
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   726
    apply (rule regularCard_ordIso[of r])
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   727
      apply (rule ordIso_symmetric[OF cprod_infinite1'])
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   728
    using assms 1 Cinfinite_Cnotzero by auto
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   729
qed
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   730
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   731
lemma cprod_csum_cexp:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   732
  "r1 *c r2 \<le>o (r1 +c r2) ^c ctwo"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   733
unfolding cprod_def csum_def cexp_def ctwo_def Field_card_of
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   734
proof -
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   735
  let ?f = "\<lambda>(a, b). %x. if x then Inl a else Inr b"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   736
  have "inj_on ?f (Field r1 \<times> Field r2)" (is "inj_on _ ?LHS")
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   737
    by (auto simp: inj_on_def fun_eq_iff split: bool.split)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   738
  moreover
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   739
  have "?f ` ?LHS \<subseteq> Func (UNIV :: bool set) (Field r1 <+> Field r2)" (is "_ \<subseteq> ?RHS")
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   740
    by (auto simp: Func_def)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   741
  ultimately show "|?LHS| \<le>o |?RHS|" using card_of_ordLeq by blast
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   742
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   743
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   744
lemma Cfinite_cprod_Cinfinite: "\<lbrakk>Cfinite r; Cinfinite s\<rbrakk> \<Longrightarrow> r *c s \<le>o s"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   745
by (intro cprod_cinfinite_bound)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   746
  (auto intro: ordLeq_refl ordLess_imp_ordLeq[OF Cfinite_ordLess_Cinfinite])
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   747
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   748
lemma cprod_cexp: "(r *c s) ^c t =o r ^c t *c s ^c t"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   749
  unfolding cprod_def cexp_def Field_card_of by (rule Func_Times_Range)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   750
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   751
lemma cprod_cexp_csum_cexp_Cinfinite:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   752
  assumes t: "Cinfinite t"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   753
  shows "(r *c s) ^c t \<le>o (r +c s) ^c t"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   754
proof -
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   755
  have "(r *c s) ^c t \<le>o ((r +c s) ^c ctwo) ^c t"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   756
    by (rule cexp_mono1[OF cprod_csum_cexp conjunct2[OF t]])
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   757
  also have "((r +c s) ^c ctwo) ^c t =o (r +c s) ^c (ctwo *c t)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   758
    by (rule cexp_cprod[OF Card_order_csum])
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   759
  also have "(r +c s) ^c (ctwo *c t) =o (r +c s) ^c (t *c ctwo)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   760
    by (rule cexp_cong2[OF cprod_com Card_order_csum Card_order_cprod])
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   761
  also have "(r +c s) ^c (t *c ctwo) =o ((r +c s) ^c t) ^c ctwo"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   762
    by (rule ordIso_symmetric[OF cexp_cprod[OF Card_order_csum]])
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   763
  also have "((r +c s) ^c t) ^c ctwo =o (r +c s) ^c t"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   764
    by (rule cexp_cprod_ordLeq[OF Card_order_csum t ctwo_Cnotzero ctwo_ordLeq_Cinfinite[OF t]])
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   765
  finally show ?thesis .
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   766
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   767
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   768
lemma Cfinite_cexp_Cinfinite:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   769
  assumes s: "Cfinite s" and t: "Cinfinite t"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   770
  shows "s ^c t \<le>o ctwo ^c t"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   771
proof (cases "s \<le>o ctwo")
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   772
  case True thus ?thesis using t by (blast intro: cexp_mono1)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   773
next
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   774
  case False
55811
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   775
  hence "ctwo \<le>o s" using ordLeq_total[of s ctwo] Card_order_ctwo s
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   776
    by (auto intro: card_order_on_well_order_on)
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   777
  hence "Cnotzero s" using Cnotzero_mono[OF ctwo_Cnotzero] s by blast
aa1acc25126b load Metis a little later
traytel
parents: 55604
diff changeset
   778
  hence st: "Cnotzero (s *c t)" by (intro Cinfinite_Cnotzero[OF Cinfinite_cprod2]) (auto simp: t)
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   779
  have "s ^c t \<le>o (ctwo ^c s) ^c t"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   780
    using assms by (blast intro: cexp_mono1 ordLess_imp_ordLeq[OF ordLess_ctwo_cexp])
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   781
  also have "(ctwo ^c s) ^c t =o ctwo ^c (s *c t)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   782
    by (blast intro: Card_order_ctwo cexp_cprod)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   783
  also have "ctwo ^c (s *c t) \<le>o ctwo ^c t"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   784
    using assms st by (intro cexp_mono2_Cnotzero Cfinite_cprod_Cinfinite Card_order_ctwo)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   785
  finally show ?thesis .
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   786
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   787
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   788
lemma csum_Cfinite_cexp_Cinfinite:
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   789
  assumes r: "Card_order r" and s: "Cfinite s" and t: "Cinfinite t"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   790
  shows "(r +c s) ^c t \<le>o (r +c ctwo) ^c t"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   791
proof (cases "Cinfinite r")
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   792
  case True
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   793
  hence "r +c s =o r" by (intro csum_absorb1 ordLess_imp_ordLeq[OF Cfinite_ordLess_Cinfinite] s)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   794
  hence "(r +c s) ^c t =o r ^c t" using t by (blast intro: cexp_cong1)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   795
  also have "r ^c t \<le>o (r +c ctwo) ^c t" using t by (blast intro: cexp_mono1 ordLeq_csum1 r)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   796
  finally show ?thesis .
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   797
next
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   798
  case False
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   799
  with r have "Cfinite r" unfolding cinfinite_def cfinite_def by auto
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   800
  hence "Cfinite (r +c s)" by (intro Cfinite_csum s)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   801
  hence "(r +c s) ^c t \<le>o ctwo ^c t" by (intro Cfinite_cexp_Cinfinite t)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   802
  also have "ctwo ^c t \<le>o (r +c ctwo) ^c t" using t
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   803
    by (blast intro: cexp_mono1 ordLeq_csum2 Card_order_ctwo)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   804
  finally show ?thesis .
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   805
qed
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   806
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   807
(* cardSuc *)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   808
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   809
lemma Cinfinite_cardSuc: "Cinfinite r \<Longrightarrow> Cinfinite (cardSuc r)"
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   810
by (simp add: cinfinite_def cardSuc_Card_order cardSuc_finite)
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   811
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   812
lemma cardSuc_UNION_Cinfinite:
69276
3d954183b707 replaced some ancient ASCII syntax
haftmann
parents: 67613
diff changeset
   813
  assumes "Cinfinite r" "relChain (cardSuc r) As" "B \<le> (\<Union>i \<in> Field (cardSuc r). As i)" "|B| <=o r"
67613
ce654b0e6d69 more symbols;
wenzelm
parents: 61943
diff changeset
   814
  shows "\<exists>i \<in> Field (cardSuc r). B \<le> As i"
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   815
using cardSuc_UNION assms unfolding cinfinite_def by blast
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   816
75624
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   817
lemma Cinfinite_card_suc: "\<lbrakk> Cinfinite r ; card_order r \<rbrakk> \<Longrightarrow> Cinfinite (card_suc r)"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   818
  using Cinfinite_cong[OF cardSuc_ordIso_card_suc Cinfinite_cardSuc] .
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   819
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   820
lemma regularCard_cardSuc: "Cinfinite k \<Longrightarrow> regularCard (cardSuc k)"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   821
  by (rule infinite_cardSuc_regularCard) (auto simp: cinfinite_def)
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   822
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   823
lemma regular_card_suc: "card_order r \<Longrightarrow> Cinfinite r \<Longrightarrow> regularCard (card_suc r)"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   824
  using cardSuc_ordIso_card_suc Cinfinite_cardSuc regularCard_cardSuc regularCard_ordIso
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   825
  by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   826
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   827
(* card_suc (natLeq +c |UNIV| ) *)
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   828
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   829
lemma card_order_card_suc_natLeq_UNIV: "card_order (card_suc (natLeq +c |UNIV :: 'a set| ))"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   830
  using card_order_card_suc card_order_csum natLeq_card_order card_of_card_order_on by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   831
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   832
lemma cinfinite_card_suc_natLeq_UNIV: "cinfinite (card_suc (natLeq +c |UNIV :: 'a set| ))"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   833
  using Cinfinite_card_suc card_order_csum natLeq_card_order card_of_card_order_on natLeq_Cinfinite
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   834
      Cinfinite_csum1 by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   835
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   836
lemma regularCard_card_suc_natLeq_UNIV: "regularCard (card_suc (natLeq +c |UNIV :: 'a set| ))"
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   837
  using regular_card_suc card_order_csum natLeq_card_order card_of_card_order_on Cinfinite_csum1
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   838
      natLeq_Cinfinite by blast
22d1c5f2b9f4 strict bounds for BNFs (by Jan van Brügge)
traytel
parents: 69276
diff changeset
   839
54474
6d5941722fae split 'Cardinal_Arithmetic' 3-way
blanchet
parents:
diff changeset
   840
end