src/ZF/CardinalArith.thy
author kleing
Wed Apr 14 14:13:05 2004 +0200 (2004-04-14)
changeset 14565 c6dc17aab88a
parent 13784 b9f6154427a4
child 14883 ca000a495448
permissions -rw-r--r--
use more symbols in HTML output
clasohm@1478
     1
(*  Title:      ZF/CardinalArith.thy
lcp@437
     2
    ID:         $Id$
clasohm@1478
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
lcp@437
     4
    Copyright   1994  University of Cambridge
lcp@437
     5
paulson@13328
     6
*)
paulson@13216
     7
paulson@13328
     8
header{*Cardinal Arithmetic Without the Axiom of Choice*}
lcp@437
     9
paulson@12667
    10
theory CardinalArith = Cardinal + OrderArith + ArithSimp + Finite:
lcp@467
    11
paulson@12667
    12
constdefs
lcp@437
    13
paulson@12667
    14
  InfCard       :: "i=>o"
paulson@12667
    15
    "InfCard(i) == Card(i) & nat le i"
lcp@437
    16
paulson@12667
    17
  cmult         :: "[i,i]=>i"       (infixl "|*|" 70)
paulson@12667
    18
    "i |*| j == |i*j|"
paulson@12667
    19
  
paulson@12667
    20
  cadd          :: "[i,i]=>i"       (infixl "|+|" 65)
paulson@12667
    21
    "i |+| j == |i+j|"
lcp@437
    22
paulson@12667
    23
  csquare_rel   :: "i=>i"
paulson@12667
    24
    "csquare_rel(K) ==   
paulson@12667
    25
	  rvimage(K*K,   
paulson@12667
    26
		  lam <x,y>:K*K. <x Un y, x, y>, 
paulson@12667
    27
		  rmult(K,Memrel(K), K*K, rmult(K,Memrel(K), K,Memrel(K))))"
lcp@437
    28
lcp@484
    29
  (*This def is more complex than Kunen's but it more easily proved to
lcp@484
    30
    be a cardinal*)
paulson@12667
    31
  jump_cardinal :: "i=>i"
paulson@12667
    32
    "jump_cardinal(K) ==   
paulson@13615
    33
         \<Union>X\<in>Pow(K). {z. r: Pow(K*K), well_ord(X,r) & z = ordertype(X,r)}"
paulson@12667
    34
  
lcp@484
    35
  (*needed because jump_cardinal(K) might not be the successor of K*)
paulson@12667
    36
  csucc         :: "i=>i"
paulson@12667
    37
    "csucc(K) == LEAST L. Card(L) & K<L"
lcp@484
    38
wenzelm@12114
    39
syntax (xsymbols)
paulson@12667
    40
  "op |+|"     :: "[i,i] => i"          (infixl "\<oplus>" 65)
paulson@12667
    41
  "op |*|"     :: "[i,i] => i"          (infixl "\<otimes>" 70)
kleing@14565
    42
syntax (HTML output)
kleing@14565
    43
  "op |+|"     :: "[i,i] => i"          (infixl "\<oplus>" 65)
kleing@14565
    44
  "op |*|"     :: "[i,i] => i"          (infixl "\<otimes>" 70)
paulson@12667
    45
paulson@12667
    46
paulson@12667
    47
lemma Card_Union [simp,intro,TC]: "(ALL x:A. Card(x)) ==> Card(Union(A))"
paulson@12667
    48
apply (rule CardI) 
paulson@12667
    49
 apply (simp add: Card_is_Ord) 
paulson@12667
    50
apply (clarify dest!: ltD)
paulson@12667
    51
apply (drule bspec, assumption) 
paulson@12667
    52
apply (frule lt_Card_imp_lesspoll, blast intro: ltI Card_is_Ord) 
paulson@12667
    53
apply (drule eqpoll_sym [THEN eqpoll_imp_lepoll])
paulson@12667
    54
apply (drule lesspoll_trans1, assumption) 
paulson@13216
    55
apply (subgoal_tac "B \<lesssim> \<Union>A")
paulson@12667
    56
 apply (drule lesspoll_trans1, assumption, blast) 
paulson@12667
    57
apply (blast intro: subset_imp_lepoll) 
paulson@12667
    58
done
paulson@12667
    59
paulson@12667
    60
lemma Card_UN:
paulson@13615
    61
     "(!!x. x:A ==> Card(K(x))) ==> Card(\<Union>x\<in>A. K(x))" 
paulson@12667
    62
by (blast intro: Card_Union) 
paulson@12667
    63
paulson@12667
    64
lemma Card_OUN [simp,intro,TC]:
paulson@13615
    65
     "(!!x. x:A ==> Card(K(x))) ==> Card(\<Union>x<A. K(x))"
paulson@12667
    66
by (simp add: OUnion_def Card_0) 
paulson@9654
    67
paulson@12776
    68
lemma n_lesspoll_nat: "n \<in> nat ==> n \<prec> nat"
paulson@12776
    69
apply (unfold lesspoll_def)
paulson@12776
    70
apply (rule conjI)
paulson@12776
    71
apply (erule OrdmemD [THEN subset_imp_lepoll], rule Ord_nat)
paulson@12776
    72
apply (rule notI)
paulson@12776
    73
apply (erule eqpollE)
paulson@12776
    74
apply (rule succ_lepoll_natE)
paulson@12776
    75
apply (blast intro: nat_succI [THEN OrdmemD, THEN subset_imp_lepoll] 
paulson@12820
    76
                    lepoll_trans, assumption) 
paulson@12776
    77
done
paulson@12776
    78
paulson@12776
    79
lemma in_Card_imp_lesspoll: "[| Card(K); b \<in> K |] ==> b \<prec> K"
paulson@12776
    80
apply (unfold lesspoll_def)
paulson@12776
    81
apply (simp add: Card_iff_initial)
paulson@12776
    82
apply (fast intro!: le_imp_lepoll ltI leI)
paulson@12776
    83
done
paulson@12776
    84
paulson@12776
    85
lemma lesspoll_lemma: 
paulson@12776
    86
        "[| ~ A \<prec> B; C \<prec> B |] ==> A - C \<noteq> 0"
paulson@12776
    87
apply (unfold lesspoll_def)
paulson@12776
    88
apply (fast dest!: Diff_eq_0_iff [THEN iffD1, THEN subset_imp_lepoll]
paulson@12776
    89
            intro!: eqpollI elim: notE 
paulson@12776
    90
            elim!: eqpollE lepoll_trans)
paulson@12776
    91
done
paulson@12776
    92
paulson@13216
    93
paulson@13356
    94
subsection{*Cardinal addition*}
paulson@13216
    95
paulson@13328
    96
text{*Note: Could omit proving the algebraic laws for cardinal addition and
paulson@13328
    97
multiplication.  On finite cardinals these operations coincide with
paulson@13328
    98
addition and multiplication of natural numbers; on infinite cardinals they
paulson@13328
    99
coincide with union (maximum).  Either way we get most laws for free.*}
paulson@13328
   100
paulson@13216
   101
(** Cardinal addition is commutative **)
paulson@13216
   102
paulson@13216
   103
lemma sum_commute_eqpoll: "A+B \<approx> B+A"
paulson@13216
   104
apply (unfold eqpoll_def)
paulson@13216
   105
apply (rule exI)
paulson@13216
   106
apply (rule_tac c = "case(Inr,Inl)" and d = "case(Inr,Inl)" in lam_bijective)
paulson@13216
   107
apply auto
paulson@13216
   108
done
paulson@13216
   109
paulson@13216
   110
lemma cadd_commute: "i |+| j = j |+| i"
paulson@13216
   111
apply (unfold cadd_def)
paulson@13216
   112
apply (rule sum_commute_eqpoll [THEN cardinal_cong])
paulson@13216
   113
done
paulson@13216
   114
paulson@13216
   115
(** Cardinal addition is associative **)
paulson@13216
   116
paulson@13216
   117
lemma sum_assoc_eqpoll: "(A+B)+C \<approx> A+(B+C)"
paulson@13216
   118
apply (unfold eqpoll_def)
paulson@13216
   119
apply (rule exI)
paulson@13216
   120
apply (rule sum_assoc_bij)
paulson@13216
   121
done
paulson@13216
   122
paulson@13216
   123
(*Unconditional version requires AC*)
paulson@13216
   124
lemma well_ord_cadd_assoc: 
paulson@13216
   125
    "[| well_ord(i,ri); well_ord(j,rj); well_ord(k,rk) |]
paulson@13216
   126
     ==> (i |+| j) |+| k = i |+| (j |+| k)"
paulson@13216
   127
apply (unfold cadd_def)
paulson@13216
   128
apply (rule cardinal_cong)
paulson@13216
   129
apply (rule eqpoll_trans)
paulson@13216
   130
 apply (rule sum_eqpoll_cong [OF well_ord_cardinal_eqpoll eqpoll_refl])
paulson@13221
   131
 apply (blast intro: well_ord_radd ) 
paulson@13216
   132
apply (rule sum_assoc_eqpoll [THEN eqpoll_trans])
paulson@13216
   133
apply (rule eqpoll_sym)
paulson@13216
   134
apply (rule sum_eqpoll_cong [OF eqpoll_refl well_ord_cardinal_eqpoll])
paulson@13221
   135
apply (blast intro: well_ord_radd ) 
paulson@13216
   136
done
paulson@13216
   137
paulson@13216
   138
(** 0 is the identity for addition **)
paulson@13216
   139
paulson@13216
   140
lemma sum_0_eqpoll: "0+A \<approx> A"
paulson@13216
   141
apply (unfold eqpoll_def)
paulson@13216
   142
apply (rule exI)
paulson@13216
   143
apply (rule bij_0_sum)
paulson@13216
   144
done
paulson@13216
   145
paulson@13216
   146
lemma cadd_0 [simp]: "Card(K) ==> 0 |+| K = K"
paulson@13216
   147
apply (unfold cadd_def)
paulson@13216
   148
apply (simp add: sum_0_eqpoll [THEN cardinal_cong] Card_cardinal_eq)
paulson@13216
   149
done
paulson@13216
   150
paulson@13216
   151
(** Addition by another cardinal **)
paulson@13216
   152
paulson@13216
   153
lemma sum_lepoll_self: "A \<lesssim> A+B"
paulson@13216
   154
apply (unfold lepoll_def inj_def)
paulson@13216
   155
apply (rule_tac x = "lam x:A. Inl (x) " in exI)
paulson@13221
   156
apply simp
paulson@13216
   157
done
paulson@13216
   158
paulson@13216
   159
(*Could probably weaken the premises to well_ord(K,r), or removing using AC*)
paulson@13216
   160
paulson@13216
   161
lemma cadd_le_self: 
paulson@13216
   162
    "[| Card(K);  Ord(L) |] ==> K le (K |+| L)"
paulson@13216
   163
apply (unfold cadd_def)
paulson@13221
   164
apply (rule le_trans [OF Card_cardinal_le well_ord_lepoll_imp_Card_le],
paulson@13221
   165
       assumption)
paulson@13216
   166
apply (rule_tac [2] sum_lepoll_self)
paulson@13216
   167
apply (blast intro: well_ord_radd well_ord_Memrel Card_is_Ord)
paulson@13216
   168
done
paulson@13216
   169
paulson@13216
   170
(** Monotonicity of addition **)
paulson@13216
   171
paulson@13216
   172
lemma sum_lepoll_mono: 
paulson@13221
   173
     "[| A \<lesssim> C;  B \<lesssim> D |] ==> A + B \<lesssim> C + D"
paulson@13216
   174
apply (unfold lepoll_def)
paulson@13221
   175
apply (elim exE)
paulson@13216
   176
apply (rule_tac x = "lam z:A+B. case (%w. Inl(f`w), %y. Inr(fa`y), z)" in exI)
paulson@13221
   177
apply (rule_tac d = "case (%w. Inl(converse(f) `w), %y. Inr(converse(fa) ` y))"
paulson@13216
   178
       in lam_injective)
paulson@13221
   179
apply (typecheck add: inj_is_fun, auto)
paulson@13216
   180
done
paulson@13216
   181
paulson@13216
   182
lemma cadd_le_mono:
paulson@13216
   183
    "[| K' le K;  L' le L |] ==> (K' |+| L') le (K |+| L)"
paulson@13216
   184
apply (unfold cadd_def)
paulson@13216
   185
apply (safe dest!: le_subset_iff [THEN iffD1])
paulson@13216
   186
apply (rule well_ord_lepoll_imp_Card_le)
paulson@13216
   187
apply (blast intro: well_ord_radd well_ord_Memrel)
paulson@13216
   188
apply (blast intro: sum_lepoll_mono subset_imp_lepoll)
paulson@13216
   189
done
paulson@13216
   190
paulson@13216
   191
(** Addition of finite cardinals is "ordinary" addition **)
paulson@13216
   192
paulson@13216
   193
lemma sum_succ_eqpoll: "succ(A)+B \<approx> succ(A+B)"
paulson@13216
   194
apply (unfold eqpoll_def)
paulson@13216
   195
apply (rule exI)
paulson@13216
   196
apply (rule_tac c = "%z. if z=Inl (A) then A+B else z" 
paulson@13216
   197
            and d = "%z. if z=A+B then Inl (A) else z" in lam_bijective)
paulson@13221
   198
   apply simp_all
paulson@13216
   199
apply (blast dest: sym [THEN eq_imp_not_mem] elim: mem_irrefl)+
paulson@13216
   200
done
paulson@13216
   201
paulson@13216
   202
(*Pulling the  succ(...)  outside the |...| requires m, n: nat  *)
paulson@13216
   203
(*Unconditional version requires AC*)
paulson@13216
   204
lemma cadd_succ_lemma:
paulson@13216
   205
    "[| Ord(m);  Ord(n) |] ==> succ(m) |+| n = |succ(m |+| n)|"
paulson@13216
   206
apply (unfold cadd_def)
paulson@13216
   207
apply (rule sum_succ_eqpoll [THEN cardinal_cong, THEN trans])
paulson@13216
   208
apply (rule succ_eqpoll_cong [THEN cardinal_cong])
paulson@13216
   209
apply (rule well_ord_cardinal_eqpoll [THEN eqpoll_sym])
paulson@13216
   210
apply (blast intro: well_ord_radd well_ord_Memrel)
paulson@13216
   211
done
paulson@13216
   212
paulson@13216
   213
lemma nat_cadd_eq_add: "[| m: nat;  n: nat |] ==> m |+| n = m#+n"
paulson@13244
   214
apply (induct_tac m)
paulson@13216
   215
apply (simp add: nat_into_Card [THEN cadd_0])
paulson@13216
   216
apply (simp add: cadd_succ_lemma nat_into_Card [THEN Card_cardinal_eq])
paulson@13216
   217
done
paulson@13216
   218
paulson@13216
   219
paulson@13356
   220
subsection{*Cardinal multiplication*}
paulson@13216
   221
paulson@13216
   222
(** Cardinal multiplication is commutative **)
paulson@13216
   223
paulson@13216
   224
(*Easier to prove the two directions separately*)
paulson@13216
   225
lemma prod_commute_eqpoll: "A*B \<approx> B*A"
paulson@13216
   226
apply (unfold eqpoll_def)
paulson@13216
   227
apply (rule exI)
paulson@13221
   228
apply (rule_tac c = "%<x,y>.<y,x>" and d = "%<x,y>.<y,x>" in lam_bijective, 
paulson@13221
   229
       auto) 
paulson@13216
   230
done
paulson@13216
   231
paulson@13216
   232
lemma cmult_commute: "i |*| j = j |*| i"
paulson@13216
   233
apply (unfold cmult_def)
paulson@13216
   234
apply (rule prod_commute_eqpoll [THEN cardinal_cong])
paulson@13216
   235
done
paulson@13216
   236
paulson@13216
   237
(** Cardinal multiplication is associative **)
paulson@13216
   238
paulson@13216
   239
lemma prod_assoc_eqpoll: "(A*B)*C \<approx> A*(B*C)"
paulson@13216
   240
apply (unfold eqpoll_def)
paulson@13216
   241
apply (rule exI)
paulson@13216
   242
apply (rule prod_assoc_bij)
paulson@13216
   243
done
paulson@13216
   244
paulson@13216
   245
(*Unconditional version requires AC*)
paulson@13216
   246
lemma well_ord_cmult_assoc:
paulson@13216
   247
    "[| well_ord(i,ri); well_ord(j,rj); well_ord(k,rk) |]
paulson@13216
   248
     ==> (i |*| j) |*| k = i |*| (j |*| k)"
paulson@13216
   249
apply (unfold cmult_def)
paulson@13216
   250
apply (rule cardinal_cong)
paulson@13221
   251
apply (rule eqpoll_trans) 
paulson@13216
   252
 apply (rule prod_eqpoll_cong [OF well_ord_cardinal_eqpoll eqpoll_refl])
paulson@13216
   253
 apply (blast intro: well_ord_rmult)
paulson@13216
   254
apply (rule prod_assoc_eqpoll [THEN eqpoll_trans])
paulson@13221
   255
apply (rule eqpoll_sym) 
paulson@13216
   256
apply (rule prod_eqpoll_cong [OF eqpoll_refl well_ord_cardinal_eqpoll])
paulson@13216
   257
apply (blast intro: well_ord_rmult)
paulson@13216
   258
done
paulson@13216
   259
paulson@13216
   260
(** Cardinal multiplication distributes over addition **)
paulson@13216
   261
paulson@13216
   262
lemma sum_prod_distrib_eqpoll: "(A+B)*C \<approx> (A*C)+(B*C)"
paulson@13216
   263
apply (unfold eqpoll_def)
paulson@13216
   264
apply (rule exI)
paulson@13216
   265
apply (rule sum_prod_distrib_bij)
paulson@13216
   266
done
paulson@13216
   267
paulson@13216
   268
lemma well_ord_cadd_cmult_distrib:
paulson@13216
   269
    "[| well_ord(i,ri); well_ord(j,rj); well_ord(k,rk) |]
paulson@13216
   270
     ==> (i |+| j) |*| k = (i |*| k) |+| (j |*| k)"
paulson@13216
   271
apply (unfold cadd_def cmult_def)
paulson@13216
   272
apply (rule cardinal_cong)
paulson@13221
   273
apply (rule eqpoll_trans) 
paulson@13216
   274
 apply (rule prod_eqpoll_cong [OF well_ord_cardinal_eqpoll eqpoll_refl])
paulson@13216
   275
apply (blast intro: well_ord_radd)
paulson@13216
   276
apply (rule sum_prod_distrib_eqpoll [THEN eqpoll_trans])
paulson@13221
   277
apply (rule eqpoll_sym) 
paulson@13216
   278
apply (rule sum_eqpoll_cong [OF well_ord_cardinal_eqpoll 
paulson@13216
   279
                                well_ord_cardinal_eqpoll])
paulson@13216
   280
apply (blast intro: well_ord_rmult)+
paulson@13216
   281
done
paulson@13216
   282
paulson@13216
   283
(** Multiplication by 0 yields 0 **)
paulson@13216
   284
paulson@13216
   285
lemma prod_0_eqpoll: "0*A \<approx> 0"
paulson@13216
   286
apply (unfold eqpoll_def)
paulson@13216
   287
apply (rule exI)
paulson@13221
   288
apply (rule lam_bijective, safe)
paulson@13216
   289
done
paulson@13216
   290
paulson@13216
   291
lemma cmult_0 [simp]: "0 |*| i = 0"
paulson@13221
   292
by (simp add: cmult_def prod_0_eqpoll [THEN cardinal_cong])
paulson@13216
   293
paulson@13216
   294
(** 1 is the identity for multiplication **)
paulson@13216
   295
paulson@13216
   296
lemma prod_singleton_eqpoll: "{x}*A \<approx> A"
paulson@13216
   297
apply (unfold eqpoll_def)
paulson@13216
   298
apply (rule exI)
paulson@13216
   299
apply (rule singleton_prod_bij [THEN bij_converse_bij])
paulson@13216
   300
done
paulson@13216
   301
paulson@13216
   302
lemma cmult_1 [simp]: "Card(K) ==> 1 |*| K = K"
paulson@13216
   303
apply (unfold cmult_def succ_def)
paulson@13216
   304
apply (simp add: prod_singleton_eqpoll [THEN cardinal_cong] Card_cardinal_eq)
paulson@13216
   305
done
paulson@13216
   306
paulson@13356
   307
subsection{*Some inequalities for multiplication*}
paulson@13216
   308
paulson@13216
   309
lemma prod_square_lepoll: "A \<lesssim> A*A"
paulson@13216
   310
apply (unfold lepoll_def inj_def)
paulson@13221
   311
apply (rule_tac x = "lam x:A. <x,x>" in exI, simp)
paulson@13216
   312
done
paulson@13216
   313
paulson@13216
   314
(*Could probably weaken the premise to well_ord(K,r), or remove using AC*)
paulson@13216
   315
lemma cmult_square_le: "Card(K) ==> K le K |*| K"
paulson@13216
   316
apply (unfold cmult_def)
paulson@13216
   317
apply (rule le_trans)
paulson@13216
   318
apply (rule_tac [2] well_ord_lepoll_imp_Card_le)
paulson@13216
   319
apply (rule_tac [3] prod_square_lepoll)
paulson@13221
   320
apply (simp add: le_refl Card_is_Ord Card_cardinal_eq)
paulson@13221
   321
apply (blast intro: well_ord_rmult well_ord_Memrel Card_is_Ord)
paulson@13216
   322
done
paulson@13216
   323
paulson@13216
   324
(** Multiplication by a non-zero cardinal **)
paulson@13216
   325
paulson@13216
   326
lemma prod_lepoll_self: "b: B ==> A \<lesssim> A*B"
paulson@13216
   327
apply (unfold lepoll_def inj_def)
paulson@13221
   328
apply (rule_tac x = "lam x:A. <x,b>" in exI, simp)
paulson@13216
   329
done
paulson@13216
   330
paulson@13216
   331
(*Could probably weaken the premises to well_ord(K,r), or removing using AC*)
paulson@13216
   332
lemma cmult_le_self:
paulson@13216
   333
    "[| Card(K);  Ord(L);  0<L |] ==> K le (K |*| L)"
paulson@13216
   334
apply (unfold cmult_def)
paulson@13216
   335
apply (rule le_trans [OF Card_cardinal_le well_ord_lepoll_imp_Card_le])
paulson@13221
   336
  apply assumption
paulson@13216
   337
 apply (blast intro: well_ord_rmult well_ord_Memrel Card_is_Ord)
paulson@13216
   338
apply (blast intro: prod_lepoll_self ltD)
paulson@13216
   339
done
paulson@13216
   340
paulson@13216
   341
(** Monotonicity of multiplication **)
paulson@13216
   342
paulson@13216
   343
lemma prod_lepoll_mono:
paulson@13216
   344
     "[| A \<lesssim> C;  B \<lesssim> D |] ==> A * B  \<lesssim>  C * D"
paulson@13216
   345
apply (unfold lepoll_def)
paulson@13221
   346
apply (elim exE)
paulson@13216
   347
apply (rule_tac x = "lam <w,y>:A*B. <f`w, fa`y>" in exI)
paulson@13216
   348
apply (rule_tac d = "%<w,y>. <converse (f) `w, converse (fa) `y>" 
paulson@13216
   349
       in lam_injective)
paulson@13221
   350
apply (typecheck add: inj_is_fun, auto)
paulson@13216
   351
done
paulson@13216
   352
paulson@13216
   353
lemma cmult_le_mono:
paulson@13216
   354
    "[| K' le K;  L' le L |] ==> (K' |*| L') le (K |*| L)"
paulson@13216
   355
apply (unfold cmult_def)
paulson@13216
   356
apply (safe dest!: le_subset_iff [THEN iffD1])
paulson@13216
   357
apply (rule well_ord_lepoll_imp_Card_le)
paulson@13216
   358
 apply (blast intro: well_ord_rmult well_ord_Memrel)
paulson@13216
   359
apply (blast intro: prod_lepoll_mono subset_imp_lepoll)
paulson@13216
   360
done
paulson@13216
   361
paulson@13356
   362
subsection{*Multiplication of finite cardinals is "ordinary" multiplication*}
paulson@13216
   363
paulson@13216
   364
lemma prod_succ_eqpoll: "succ(A)*B \<approx> B + A*B"
paulson@13216
   365
apply (unfold eqpoll_def)
paulson@13221
   366
apply (rule exI)
paulson@13216
   367
apply (rule_tac c = "%<x,y>. if x=A then Inl (y) else Inr (<x,y>)"
paulson@13216
   368
            and d = "case (%y. <A,y>, %z. z)" in lam_bijective)
paulson@13216
   369
apply safe
paulson@13216
   370
apply (simp_all add: succI2 if_type mem_imp_not_eq)
paulson@13216
   371
done
paulson@13216
   372
paulson@13216
   373
(*Unconditional version requires AC*)
paulson@13216
   374
lemma cmult_succ_lemma:
paulson@13216
   375
    "[| Ord(m);  Ord(n) |] ==> succ(m) |*| n = n |+| (m |*| n)"
paulson@13216
   376
apply (unfold cmult_def cadd_def)
paulson@13216
   377
apply (rule prod_succ_eqpoll [THEN cardinal_cong, THEN trans])
paulson@13216
   378
apply (rule cardinal_cong [symmetric])
paulson@13216
   379
apply (rule sum_eqpoll_cong [OF eqpoll_refl well_ord_cardinal_eqpoll])
paulson@13216
   380
apply (blast intro: well_ord_rmult well_ord_Memrel)
paulson@13216
   381
done
paulson@13216
   382
paulson@13216
   383
lemma nat_cmult_eq_mult: "[| m: nat;  n: nat |] ==> m |*| n = m#*n"
paulson@13244
   384
apply (induct_tac m)
paulson@13221
   385
apply (simp_all add: cmult_succ_lemma nat_cadd_eq_add)
paulson@13216
   386
done
paulson@13216
   387
paulson@13216
   388
lemma cmult_2: "Card(n) ==> 2 |*| n = n |+| n"
paulson@13221
   389
by (simp add: cmult_succ_lemma Card_is_Ord cadd_commute [of _ 0])
paulson@13216
   390
paulson@13216
   391
lemma sum_lepoll_prod: "2 \<lesssim> C ==> B+B \<lesssim> C*B"
paulson@13221
   392
apply (rule lepoll_trans) 
paulson@13216
   393
apply (rule sum_eq_2_times [THEN equalityD1, THEN subset_imp_lepoll]) 
paulson@13216
   394
apply (erule prod_lepoll_mono) 
paulson@13221
   395
apply (rule lepoll_refl) 
paulson@13216
   396
done
paulson@13216
   397
paulson@13216
   398
lemma lepoll_imp_sum_lepoll_prod: "[| A \<lesssim> B; 2 \<lesssim> A |] ==> A+B \<lesssim> A*B"
paulson@13221
   399
by (blast intro: sum_lepoll_mono sum_lepoll_prod lepoll_trans lepoll_refl)
paulson@13216
   400
paulson@13216
   401
paulson@13356
   402
subsection{*Infinite Cardinals are Limit Ordinals*}
paulson@13216
   403
paulson@13216
   404
(*This proof is modelled upon one assuming nat<=A, with injection
paulson@13216
   405
  lam z:cons(u,A). if z=u then 0 else if z : nat then succ(z) else z
paulson@13216
   406
  and inverse %y. if y:nat then nat_case(u, %z. z, y) else y.  \
paulson@13216
   407
  If f: inj(nat,A) then range(f) behaves like the natural numbers.*)
paulson@13216
   408
lemma nat_cons_lepoll: "nat \<lesssim> A ==> cons(u,A) \<lesssim> A"
paulson@13216
   409
apply (unfold lepoll_def)
paulson@13216
   410
apply (erule exE)
paulson@13216
   411
apply (rule_tac x = 
paulson@13216
   412
          "lam z:cons (u,A).
paulson@13216
   413
             if z=u then f`0 
paulson@13216
   414
             else if z: range (f) then f`succ (converse (f) `z) else z" 
paulson@13216
   415
       in exI)
paulson@13216
   416
apply (rule_tac d =
paulson@13216
   417
          "%y. if y: range(f) then nat_case (u, %z. f`z, converse(f) `y) 
paulson@13216
   418
                              else y" 
paulson@13216
   419
       in lam_injective)
paulson@13216
   420
apply (fast intro!: if_type apply_type intro: inj_is_fun inj_converse_fun)
paulson@13216
   421
apply (simp add: inj_is_fun [THEN apply_rangeI]
paulson@13216
   422
                 inj_converse_fun [THEN apply_rangeI]
paulson@13216
   423
                 inj_converse_fun [THEN apply_funtype])
paulson@13216
   424
done
paulson@13216
   425
paulson@13216
   426
lemma nat_cons_eqpoll: "nat \<lesssim> A ==> cons(u,A) \<approx> A"
paulson@13216
   427
apply (erule nat_cons_lepoll [THEN eqpollI])
paulson@13216
   428
apply (rule subset_consI [THEN subset_imp_lepoll])
paulson@13216
   429
done
paulson@13216
   430
paulson@13216
   431
(*Specialized version required below*)
paulson@13216
   432
lemma nat_succ_eqpoll: "nat <= A ==> succ(A) \<approx> A"
paulson@13216
   433
apply (unfold succ_def)
paulson@13216
   434
apply (erule subset_imp_lepoll [THEN nat_cons_eqpoll])
paulson@13216
   435
done
paulson@13216
   436
paulson@13216
   437
lemma InfCard_nat: "InfCard(nat)"
paulson@13216
   438
apply (unfold InfCard_def)
paulson@13216
   439
apply (blast intro: Card_nat le_refl Card_is_Ord)
paulson@13216
   440
done
paulson@13216
   441
paulson@13216
   442
lemma InfCard_is_Card: "InfCard(K) ==> Card(K)"
paulson@13216
   443
apply (unfold InfCard_def)
paulson@13216
   444
apply (erule conjunct1)
paulson@13216
   445
done
paulson@13216
   446
paulson@13216
   447
lemma InfCard_Un:
paulson@13216
   448
    "[| InfCard(K);  Card(L) |] ==> InfCard(K Un L)"
paulson@13216
   449
apply (unfold InfCard_def)
paulson@13216
   450
apply (simp add: Card_Un Un_upper1_le [THEN [2] le_trans]  Card_is_Ord)
paulson@13216
   451
done
paulson@13216
   452
paulson@13216
   453
(*Kunen's Lemma 10.11*)
paulson@13216
   454
lemma InfCard_is_Limit: "InfCard(K) ==> Limit(K)"
paulson@13216
   455
apply (unfold InfCard_def)
paulson@13216
   456
apply (erule conjE)
paulson@13216
   457
apply (frule Card_is_Ord)
paulson@13216
   458
apply (rule ltI [THEN non_succ_LimitI])
paulson@13216
   459
apply (erule le_imp_subset [THEN subsetD])
paulson@13216
   460
apply (safe dest!: Limit_nat [THEN Limit_le_succD])
paulson@13216
   461
apply (unfold Card_def)
paulson@13216
   462
apply (drule trans)
paulson@13216
   463
apply (erule le_imp_subset [THEN nat_succ_eqpoll, THEN cardinal_cong])
paulson@13216
   464
apply (erule Ord_cardinal_le [THEN lt_trans2, THEN lt_irrefl])
paulson@13221
   465
apply (rule le_eqI, assumption)
paulson@13216
   466
apply (rule Ord_cardinal)
paulson@13216
   467
done
paulson@13216
   468
paulson@13216
   469
paulson@13216
   470
(*** An infinite cardinal equals its square (Kunen, Thm 10.12, page 29) ***)
paulson@13216
   471
paulson@13216
   472
(*A general fact about ordermap*)
paulson@13216
   473
lemma ordermap_eqpoll_pred:
paulson@13269
   474
    "[| well_ord(A,r);  x:A |] ==> ordermap(A,r)`x \<approx> Order.pred(A,x,r)"
paulson@13216
   475
apply (unfold eqpoll_def)
paulson@13216
   476
apply (rule exI)
paulson@13221
   477
apply (simp add: ordermap_eq_image well_ord_is_wf)
paulson@13221
   478
apply (erule ordermap_bij [THEN bij_is_inj, THEN restrict_bij, 
paulson@13221
   479
                           THEN bij_converse_bij])
paulson@13216
   480
apply (rule pred_subset)
paulson@13216
   481
done
paulson@13216
   482
paulson@13216
   483
(** Establishing the well-ordering **)
paulson@13216
   484
paulson@13216
   485
lemma csquare_lam_inj:
paulson@13216
   486
     "Ord(K) ==> (lam <x,y>:K*K. <x Un y, x, y>) : inj(K*K, K*K*K)"
paulson@13216
   487
apply (unfold inj_def)
paulson@13216
   488
apply (force intro: lam_type Un_least_lt [THEN ltD] ltI)
paulson@13216
   489
done
paulson@13216
   490
paulson@13216
   491
lemma well_ord_csquare: "Ord(K) ==> well_ord(K*K, csquare_rel(K))"
paulson@13216
   492
apply (unfold csquare_rel_def)
paulson@13221
   493
apply (rule csquare_lam_inj [THEN well_ord_rvimage], assumption)
paulson@13216
   494
apply (blast intro: well_ord_rmult well_ord_Memrel)
paulson@13216
   495
done
paulson@13216
   496
paulson@13216
   497
(** Characterising initial segments of the well-ordering **)
paulson@13216
   498
paulson@13216
   499
lemma csquareD:
paulson@13216
   500
 "[| <<x,y>, <z,z>> : csquare_rel(K);  x<K;  y<K;  z<K |] ==> x le z & y le z"
paulson@13216
   501
apply (unfold csquare_rel_def)
paulson@13216
   502
apply (erule rev_mp)
paulson@13216
   503
apply (elim ltE)
paulson@13221
   504
apply (simp add: rvimage_iff Un_absorb Un_least_mem_iff ltD)
paulson@13216
   505
apply (safe elim!: mem_irrefl intro!: Un_upper1_le Un_upper2_le)
paulson@13221
   506
apply (simp_all add: lt_def succI2)
paulson@13216
   507
done
paulson@13216
   508
paulson@13216
   509
lemma pred_csquare_subset: 
paulson@13269
   510
    "z<K ==> Order.pred(K*K, <z,z>, csquare_rel(K)) <= succ(z)*succ(z)"
paulson@13216
   511
apply (unfold Order.pred_def)
paulson@13216
   512
apply (safe del: SigmaI succCI)
paulson@13216
   513
apply (erule csquareD [THEN conjE])
paulson@13221
   514
apply (unfold lt_def, auto) 
paulson@13216
   515
done
paulson@13216
   516
paulson@13216
   517
lemma csquare_ltI:
paulson@13216
   518
 "[| x<z;  y<z;  z<K |] ==>  <<x,y>, <z,z>> : csquare_rel(K)"
paulson@13216
   519
apply (unfold csquare_rel_def)
paulson@13216
   520
apply (subgoal_tac "x<K & y<K")
paulson@13216
   521
 prefer 2 apply (blast intro: lt_trans) 
paulson@13216
   522
apply (elim ltE)
paulson@13221
   523
apply (simp add: rvimage_iff Un_absorb Un_least_mem_iff ltD)
paulson@13216
   524
done
paulson@13216
   525
paulson@13216
   526
(*Part of the traditional proof.  UNUSED since it's harder to prove & apply *)
paulson@13216
   527
lemma csquare_or_eqI:
paulson@13216
   528
 "[| x le z;  y le z;  z<K |] ==> <<x,y>, <z,z>> : csquare_rel(K) | x=z & y=z"
paulson@13216
   529
apply (unfold csquare_rel_def)
paulson@13216
   530
apply (subgoal_tac "x<K & y<K")
paulson@13216
   531
 prefer 2 apply (blast intro: lt_trans1) 
paulson@13216
   532
apply (elim ltE)
paulson@13221
   533
apply (simp add: rvimage_iff Un_absorb Un_least_mem_iff ltD)
paulson@13216
   534
apply (elim succE)
paulson@13221
   535
apply (simp_all add: subset_Un_iff [THEN iff_sym] 
paulson@13221
   536
                     subset_Un_iff2 [THEN iff_sym] OrdmemD)
paulson@13216
   537
done
paulson@13216
   538
paulson@13216
   539
(** The cardinality of initial segments **)
paulson@13216
   540
paulson@13216
   541
lemma ordermap_z_lt:
paulson@13216
   542
      "[| Limit(K);  x<K;  y<K;  z=succ(x Un y) |] ==>
paulson@13216
   543
          ordermap(K*K, csquare_rel(K)) ` <x,y> <
paulson@13216
   544
          ordermap(K*K, csquare_rel(K)) ` <z,z>"
paulson@13216
   545
apply (subgoal_tac "z<K & well_ord (K*K, csquare_rel (K))")
paulson@13216
   546
prefer 2 apply (blast intro!: Un_least_lt Limit_has_succ
paulson@13221
   547
                              Limit_is_Ord [THEN well_ord_csquare], clarify) 
paulson@13216
   548
apply (rule csquare_ltI [THEN ordermap_mono, THEN ltI])
paulson@13216
   549
apply (erule_tac [4] well_ord_is_wf)
paulson@13216
   550
apply (blast intro!: Un_upper1_le Un_upper2_le Ord_ordermap elim!: ltE)+
paulson@13216
   551
done
paulson@13216
   552
paulson@13216
   553
(*Kunen: "each <x,y>: K*K has no more than z*z predecessors..." (page 29) *)
paulson@13216
   554
lemma ordermap_csquare_le:
paulson@13221
   555
  "[| Limit(K);  x<K;  y<K;  z=succ(x Un y) |]
paulson@13221
   556
   ==> | ordermap(K*K, csquare_rel(K)) ` <x,y> | le  |succ(z)| |*| |succ(z)|"
paulson@13216
   557
apply (unfold cmult_def)
paulson@13216
   558
apply (rule well_ord_rmult [THEN well_ord_lepoll_imp_Card_le])
paulson@13216
   559
apply (rule Ord_cardinal [THEN well_ord_Memrel])+
paulson@13216
   560
apply (subgoal_tac "z<K")
paulson@13216
   561
 prefer 2 apply (blast intro!: Un_least_lt Limit_has_succ)
paulson@13221
   562
apply (rule ordermap_z_lt [THEN leI, THEN le_imp_lepoll, THEN lepoll_trans], 
paulson@13221
   563
       assumption+)
paulson@13216
   564
apply (rule ordermap_eqpoll_pred [THEN eqpoll_imp_lepoll, THEN lepoll_trans])
paulson@13216
   565
apply (erule Limit_is_Ord [THEN well_ord_csquare])
paulson@13216
   566
apply (blast intro: ltD)
paulson@13216
   567
apply (rule pred_csquare_subset [THEN subset_imp_lepoll, THEN lepoll_trans],
paulson@13216
   568
            assumption)
paulson@13216
   569
apply (elim ltE)
paulson@13216
   570
apply (rule prod_eqpoll_cong [THEN eqpoll_sym, THEN eqpoll_imp_lepoll])
paulson@13216
   571
apply (erule Ord_succ [THEN Ord_cardinal_eqpoll])+
paulson@13216
   572
done
paulson@13216
   573
paulson@13216
   574
(*Kunen: "... so the order type <= K" *)
paulson@13216
   575
lemma ordertype_csquare_le:
paulson@13216
   576
     "[| InfCard(K);  ALL y:K. InfCard(y) --> y |*| y = y |] 
paulson@13216
   577
      ==> ordertype(K*K, csquare_rel(K)) le K"
paulson@13216
   578
apply (frule InfCard_is_Card [THEN Card_is_Ord])
paulson@13221
   579
apply (rule all_lt_imp_le, assumption)
paulson@13216
   580
apply (erule well_ord_csquare [THEN Ord_ordertype])
paulson@13216
   581
apply (rule Card_lt_imp_lt)
paulson@13216
   582
apply (erule_tac [3] InfCard_is_Card)
paulson@13216
   583
apply (erule_tac [2] ltE)
paulson@13216
   584
apply (simp add: ordertype_unfold)
paulson@13216
   585
apply (safe elim!: ltE)
paulson@13216
   586
apply (subgoal_tac "Ord (xa) & Ord (ya)")
paulson@13221
   587
 prefer 2 apply (blast intro: Ord_in_Ord, clarify)
paulson@13216
   588
(*??WHAT A MESS!*)  
paulson@13216
   589
apply (rule InfCard_is_Limit [THEN ordermap_csquare_le, THEN lt_trans1],
paulson@13216
   590
       (assumption | rule refl | erule ltI)+) 
paulson@13784
   591
apply (rule_tac i = "xa Un ya" and j = nat in Ord_linear2,
paulson@13216
   592
       simp_all add: Ord_Un Ord_nat)
paulson@13216
   593
prefer 2 (*case nat le (xa Un ya) *)
paulson@13216
   594
 apply (simp add: le_imp_subset [THEN nat_succ_eqpoll, THEN cardinal_cong] 
paulson@13216
   595
                  le_succ_iff InfCard_def Card_cardinal Un_least_lt Ord_Un
paulson@13216
   596
                ltI nat_le_cardinal Ord_cardinal_le [THEN lt_trans1, THEN ltD])
paulson@13216
   597
(*the finite case: xa Un ya < nat *)
paulson@13784
   598
apply (rule_tac j = nat in lt_trans2)
paulson@13216
   599
 apply (simp add: lt_def nat_cmult_eq_mult nat_succI mult_type
paulson@13216
   600
                  nat_into_Card [THEN Card_cardinal_eq]  Ord_nat)
paulson@13216
   601
apply (simp add: InfCard_def)
paulson@13216
   602
done
paulson@13216
   603
paulson@13216
   604
(*Main result: Kunen's Theorem 10.12*)
paulson@13216
   605
lemma InfCard_csquare_eq: "InfCard(K) ==> K |*| K = K"
paulson@13216
   606
apply (frule InfCard_is_Card [THEN Card_is_Ord])
paulson@13216
   607
apply (erule rev_mp)
paulson@13216
   608
apply (erule_tac i=K in trans_induct) 
paulson@13216
   609
apply (rule impI)
paulson@13216
   610
apply (rule le_anti_sym)
paulson@13216
   611
apply (erule_tac [2] InfCard_is_Card [THEN cmult_square_le])
paulson@13216
   612
apply (rule ordertype_csquare_le [THEN [2] le_trans])
paulson@13221
   613
apply (simp add: cmult_def Ord_cardinal_le   
paulson@13221
   614
                 well_ord_csquare [THEN Ord_ordertype]
paulson@13221
   615
                 well_ord_csquare [THEN ordermap_bij, THEN bij_imp_eqpoll, 
paulson@13221
   616
                                   THEN cardinal_cong], assumption+)
paulson@13216
   617
done
paulson@13216
   618
paulson@13216
   619
(*Corollary for arbitrary well-ordered sets (all sets, assuming AC)*)
paulson@13216
   620
lemma well_ord_InfCard_square_eq:
paulson@13216
   621
     "[| well_ord(A,r);  InfCard(|A|) |] ==> A*A \<approx> A"
paulson@13216
   622
apply (rule prod_eqpoll_cong [THEN eqpoll_trans])
paulson@13216
   623
apply (erule well_ord_cardinal_eqpoll [THEN eqpoll_sym])+
paulson@13216
   624
apply (rule well_ord_cardinal_eqE)
paulson@13221
   625
apply (blast intro: Ord_cardinal well_ord_rmult well_ord_Memrel, assumption)
paulson@13221
   626
apply (simp add: cmult_def [symmetric] InfCard_csquare_eq)
paulson@13216
   627
done
paulson@13216
   628
paulson@13356
   629
lemma InfCard_square_eqpoll: "InfCard(K) ==> K \<times> K \<approx> K"
paulson@13356
   630
apply (rule well_ord_InfCard_square_eq)  
paulson@13356
   631
 apply (erule InfCard_is_Card [THEN Card_is_Ord, THEN well_ord_Memrel]) 
paulson@13356
   632
apply (simp add: InfCard_is_Card [THEN Card_cardinal_eq]) 
paulson@13356
   633
done
paulson@13356
   634
paulson@13356
   635
lemma Inf_Card_is_InfCard: "[| ~Finite(i); Card(i) |] ==> InfCard(i)"
paulson@13356
   636
by (simp add: InfCard_def Card_is_Ord [THEN nat_le_infinite_Ord])
paulson@13356
   637
paulson@13216
   638
(** Toward's Kunen's Corollary 10.13 (1) **)
paulson@13216
   639
paulson@13216
   640
lemma InfCard_le_cmult_eq: "[| InfCard(K);  L le K;  0<L |] ==> K |*| L = K"
paulson@13216
   641
apply (rule le_anti_sym)
paulson@13216
   642
 prefer 2
paulson@13216
   643
 apply (erule ltE, blast intro: cmult_le_self InfCard_is_Card)
paulson@13216
   644
apply (frule InfCard_is_Card [THEN Card_is_Ord, THEN le_refl])
paulson@13216
   645
apply (rule cmult_le_mono [THEN le_trans], assumption+)
paulson@13216
   646
apply (simp add: InfCard_csquare_eq)
paulson@13216
   647
done
paulson@13216
   648
paulson@13216
   649
(*Corollary 10.13 (1), for cardinal multiplication*)
paulson@13216
   650
lemma InfCard_cmult_eq: "[| InfCard(K);  InfCard(L) |] ==> K |*| L = K Un L"
paulson@13784
   651
apply (rule_tac i = K and j = L in Ord_linear_le)
paulson@13216
   652
apply (typecheck add: InfCard_is_Card Card_is_Ord)
paulson@13216
   653
apply (rule cmult_commute [THEN ssubst])
paulson@13216
   654
apply (rule Un_commute [THEN ssubst])
paulson@13221
   655
apply (simp_all add: InfCard_is_Limit [THEN Limit_has_0] InfCard_le_cmult_eq 
paulson@13221
   656
                     subset_Un_iff2 [THEN iffD1] le_imp_subset)
paulson@13216
   657
done
paulson@13216
   658
paulson@13216
   659
lemma InfCard_cdouble_eq: "InfCard(K) ==> K |+| K = K"
paulson@13221
   660
apply (simp add: cmult_2 [symmetric] InfCard_is_Card cmult_commute)
paulson@13221
   661
apply (simp add: InfCard_le_cmult_eq InfCard_is_Limit Limit_has_0 Limit_has_succ)
paulson@13216
   662
done
paulson@13216
   663
paulson@13216
   664
(*Corollary 10.13 (1), for cardinal addition*)
paulson@13216
   665
lemma InfCard_le_cadd_eq: "[| InfCard(K);  L le K |] ==> K |+| L = K"
paulson@13216
   666
apply (rule le_anti_sym)
paulson@13216
   667
 prefer 2
paulson@13216
   668
 apply (erule ltE, blast intro: cadd_le_self InfCard_is_Card)
paulson@13216
   669
apply (frule InfCard_is_Card [THEN Card_is_Ord, THEN le_refl])
paulson@13216
   670
apply (rule cadd_le_mono [THEN le_trans], assumption+)
paulson@13216
   671
apply (simp add: InfCard_cdouble_eq)
paulson@13216
   672
done
paulson@13216
   673
paulson@13216
   674
lemma InfCard_cadd_eq: "[| InfCard(K);  InfCard(L) |] ==> K |+| L = K Un L"
paulson@13784
   675
apply (rule_tac i = K and j = L in Ord_linear_le)
paulson@13216
   676
apply (typecheck add: InfCard_is_Card Card_is_Ord)
paulson@13216
   677
apply (rule cadd_commute [THEN ssubst])
paulson@13216
   678
apply (rule Un_commute [THEN ssubst])
paulson@13221
   679
apply (simp_all add: InfCard_le_cadd_eq subset_Un_iff2 [THEN iffD1] le_imp_subset)
paulson@13216
   680
done
paulson@13216
   681
paulson@13216
   682
(*The other part, Corollary 10.13 (2), refers to the cardinality of the set
paulson@13216
   683
  of all n-tuples of elements of K.  A better version for the Isabelle theory
paulson@13216
   684
  might be  InfCard(K) ==> |list(K)| = K.
paulson@13216
   685
*)
paulson@13216
   686
paulson@13356
   687
subsection{*For Every Cardinal Number There Exists A Greater One}
paulson@13356
   688
paulson@13356
   689
text{*This result is Kunen's Theorem 10.16, which would be trivial using AC*}
paulson@13216
   690
paulson@13216
   691
lemma Ord_jump_cardinal: "Ord(jump_cardinal(K))"
paulson@13216
   692
apply (unfold jump_cardinal_def)
paulson@13216
   693
apply (rule Ord_is_Transset [THEN [2] OrdI])
paulson@13216
   694
 prefer 2 apply (blast intro!: Ord_ordertype)
paulson@13216
   695
apply (unfold Transset_def)
paulson@13216
   696
apply (safe del: subsetI)
paulson@13221
   697
apply (simp add: ordertype_pred_unfold, safe)
paulson@13216
   698
apply (rule UN_I)
paulson@13216
   699
apply (rule_tac [2] ReplaceI)
paulson@13216
   700
   prefer 4 apply (blast intro: well_ord_subset elim!: predE)+
paulson@13216
   701
done
paulson@13216
   702
paulson@13216
   703
(*Allows selective unfolding.  Less work than deriving intro/elim rules*)
paulson@13216
   704
lemma jump_cardinal_iff:
paulson@13216
   705
     "i : jump_cardinal(K) <->
paulson@13216
   706
      (EX r X. r <= K*K & X <= K & well_ord(X,r) & i = ordertype(X,r))"
paulson@13216
   707
apply (unfold jump_cardinal_def)
paulson@13216
   708
apply (blast del: subsetI) 
paulson@13216
   709
done
paulson@13216
   710
paulson@13216
   711
(*The easy part of Theorem 10.16: jump_cardinal(K) exceeds K*)
paulson@13216
   712
lemma K_lt_jump_cardinal: "Ord(K) ==> K < jump_cardinal(K)"
paulson@13216
   713
apply (rule Ord_jump_cardinal [THEN [2] ltI])
paulson@13216
   714
apply (rule jump_cardinal_iff [THEN iffD2])
paulson@13216
   715
apply (rule_tac x="Memrel(K)" in exI)
paulson@13216
   716
apply (rule_tac x=K in exI)  
paulson@13216
   717
apply (simp add: ordertype_Memrel well_ord_Memrel)
paulson@13216
   718
apply (simp add: Memrel_def subset_iff)
paulson@13216
   719
done
paulson@13216
   720
paulson@13216
   721
(*The proof by contradiction: the bijection f yields a wellordering of X
paulson@13216
   722
  whose ordertype is jump_cardinal(K).  *)
paulson@13216
   723
lemma Card_jump_cardinal_lemma:
paulson@13216
   724
     "[| well_ord(X,r);  r <= K * K;  X <= K;
paulson@13216
   725
         f : bij(ordertype(X,r), jump_cardinal(K)) |]
paulson@13216
   726
      ==> jump_cardinal(K) : jump_cardinal(K)"
paulson@13216
   727
apply (subgoal_tac "f O ordermap (X,r) : bij (X, jump_cardinal (K))")
paulson@13216
   728
 prefer 2 apply (blast intro: comp_bij ordermap_bij)
paulson@13216
   729
apply (rule jump_cardinal_iff [THEN iffD2])
paulson@13216
   730
apply (intro exI conjI)
paulson@13221
   731
apply (rule subset_trans [OF rvimage_type Sigma_mono], assumption+)
paulson@13216
   732
apply (erule bij_is_inj [THEN well_ord_rvimage])
paulson@13216
   733
apply (rule Ord_jump_cardinal [THEN well_ord_Memrel])
paulson@13216
   734
apply (simp add: well_ord_Memrel [THEN [2] bij_ordertype_vimage]
paulson@13216
   735
                 ordertype_Memrel Ord_jump_cardinal)
paulson@13216
   736
done
paulson@13216
   737
paulson@13216
   738
(*The hard part of Theorem 10.16: jump_cardinal(K) is itself a cardinal*)
paulson@13216
   739
lemma Card_jump_cardinal: "Card(jump_cardinal(K))"
paulson@13216
   740
apply (rule Ord_jump_cardinal [THEN CardI])
paulson@13216
   741
apply (unfold eqpoll_def)
paulson@13216
   742
apply (safe dest!: ltD jump_cardinal_iff [THEN iffD1])
paulson@13216
   743
apply (blast intro: Card_jump_cardinal_lemma [THEN mem_irrefl])
paulson@13216
   744
done
paulson@13216
   745
paulson@13356
   746
subsection{*Basic Properties of Successor Cardinals*}
paulson@13216
   747
paulson@13216
   748
lemma csucc_basic: "Ord(K) ==> Card(csucc(K)) & K < csucc(K)"
paulson@13216
   749
apply (unfold csucc_def)
paulson@13216
   750
apply (rule LeastI)
paulson@13216
   751
apply (blast intro: Card_jump_cardinal K_lt_jump_cardinal Ord_jump_cardinal)+
paulson@13216
   752
done
paulson@13216
   753
paulson@13216
   754
lemmas Card_csucc = csucc_basic [THEN conjunct1, standard]
paulson@13216
   755
paulson@13216
   756
lemmas lt_csucc = csucc_basic [THEN conjunct2, standard]
paulson@13216
   757
paulson@13216
   758
lemma Ord_0_lt_csucc: "Ord(K) ==> 0 < csucc(K)"
paulson@13221
   759
by (blast intro: Ord_0_le lt_csucc lt_trans1)
paulson@13216
   760
paulson@13216
   761
lemma csucc_le: "[| Card(L);  K<L |] ==> csucc(K) le L"
paulson@13216
   762
apply (unfold csucc_def)
paulson@13216
   763
apply (rule Least_le)
paulson@13216
   764
apply (blast intro: Card_is_Ord)+
paulson@13216
   765
done
paulson@13216
   766
paulson@13216
   767
lemma lt_csucc_iff: "[| Ord(i); Card(K) |] ==> i < csucc(K) <-> |i| le K"
paulson@13216
   768
apply (rule iffI)
paulson@13216
   769
apply (rule_tac [2] Card_lt_imp_lt)
paulson@13216
   770
apply (erule_tac [2] lt_trans1)
paulson@13216
   771
apply (simp_all add: lt_csucc Card_csucc Card_is_Ord)
paulson@13216
   772
apply (rule notI [THEN not_lt_imp_le])
paulson@13221
   773
apply (rule Card_cardinal [THEN csucc_le, THEN lt_trans1, THEN lt_irrefl], assumption)
paulson@13216
   774
apply (rule Ord_cardinal_le [THEN lt_trans1])
paulson@13216
   775
apply (simp_all add: Ord_cardinal Card_is_Ord) 
paulson@13216
   776
done
paulson@13216
   777
paulson@13216
   778
lemma Card_lt_csucc_iff:
paulson@13216
   779
     "[| Card(K'); Card(K) |] ==> K' < csucc(K) <-> K' le K"
paulson@13221
   780
by (simp add: lt_csucc_iff Card_cardinal_eq Card_is_Ord)
paulson@13216
   781
paulson@13216
   782
lemma InfCard_csucc: "InfCard(K) ==> InfCard(csucc(K))"
paulson@13216
   783
by (simp add: InfCard_def Card_csucc Card_is_Ord 
paulson@13216
   784
              lt_csucc [THEN leI, THEN [2] le_trans])
paulson@13216
   785
paulson@13216
   786
paulson@13216
   787
(** Removing elements from a finite set decreases its cardinality **)
paulson@13216
   788
paulson@13216
   789
lemma Fin_imp_not_cons_lepoll: "A: Fin(U) ==> x~:A --> ~ cons(x,A) \<lesssim> A"
paulson@13216
   790
apply (erule Fin_induct)
paulson@13221
   791
apply (simp add: lepoll_0_iff)
paulson@13216
   792
apply (subgoal_tac "cons (x,cons (xa,y)) = cons (xa,cons (x,y))")
paulson@13221
   793
apply simp
paulson@13221
   794
apply (blast dest!: cons_lepoll_consD, blast)
paulson@13216
   795
done
paulson@13216
   796
paulson@13221
   797
lemma Finite_imp_cardinal_cons:
paulson@13221
   798
     "[| Finite(A);  a~:A |] ==> |cons(a,A)| = succ(|A|)"
paulson@13216
   799
apply (unfold cardinal_def)
paulson@13216
   800
apply (rule Least_equality)
paulson@13216
   801
apply (fold cardinal_def)
paulson@13221
   802
apply (simp add: succ_def)
paulson@13216
   803
apply (blast intro: cons_eqpoll_cong well_ord_cardinal_eqpoll
paulson@13216
   804
             elim!: mem_irrefl  dest!: Finite_imp_well_ord)
paulson@13216
   805
apply (blast intro: Card_cardinal Card_is_Ord)
paulson@13216
   806
apply (rule notI)
paulson@13221
   807
apply (rule Finite_into_Fin [THEN Fin_imp_not_cons_lepoll, THEN mp, THEN notE],
paulson@13221
   808
       assumption, assumption)
paulson@13216
   809
apply (erule eqpoll_sym [THEN eqpoll_imp_lepoll, THEN lepoll_trans])
paulson@13216
   810
apply (erule le_imp_lepoll [THEN lepoll_trans])
paulson@13216
   811
apply (blast intro: well_ord_cardinal_eqpoll [THEN eqpoll_imp_lepoll]
paulson@13216
   812
             dest!: Finite_imp_well_ord)
paulson@13216
   813
done
paulson@13216
   814
paulson@13216
   815
paulson@13221
   816
lemma Finite_imp_succ_cardinal_Diff:
paulson@13221
   817
     "[| Finite(A);  a:A |] ==> succ(|A-{a}|) = |A|"
paulson@13784
   818
apply (rule_tac b = A in cons_Diff [THEN subst], assumption)
paulson@13221
   819
apply (simp add: Finite_imp_cardinal_cons Diff_subset [THEN subset_Finite])
paulson@13221
   820
apply (simp add: cons_Diff)
paulson@13216
   821
done
paulson@13216
   822
paulson@13216
   823
lemma Finite_imp_cardinal_Diff: "[| Finite(A);  a:A |] ==> |A-{a}| < |A|"
paulson@13216
   824
apply (rule succ_leE)
paulson@13221
   825
apply (simp add: Finite_imp_succ_cardinal_Diff)
paulson@13216
   826
done
paulson@13216
   827
paulson@13216
   828
paulson@13216
   829
(** Theorems by Krzysztof Grabczewski, proofs by lcp **)
paulson@13216
   830
paulson@13216
   831
lemmas nat_implies_well_ord = nat_into_Ord [THEN well_ord_Memrel, standard]
paulson@13216
   832
paulson@13216
   833
lemma nat_sum_eqpoll_sum: "[| m:nat; n:nat |] ==> m + n \<approx> m #+ n"
paulson@13216
   834
apply (rule eqpoll_trans)
paulson@13216
   835
apply (rule well_ord_radd [THEN well_ord_cardinal_eqpoll, THEN eqpoll_sym])
paulson@13216
   836
apply (erule nat_implies_well_ord)+
paulson@13221
   837
apply (simp add: nat_cadd_eq_add [symmetric] cadd_def eqpoll_refl)
paulson@13216
   838
done
paulson@13216
   839
paulson@13221
   840
lemma Ord_subset_natD [rule_format]: "Ord(i) ==> i <= nat --> i : nat | i=nat"
paulson@13221
   841
apply (erule trans_induct3, auto)
paulson@13216
   842
apply (blast dest!: nat_le_Limit [THEN le_imp_subset])
paulson@13216
   843
done
paulson@13216
   844
paulson@13216
   845
lemma Ord_nat_subset_into_Card: "[| Ord(i); i <= nat |] ==> Card(i)"
paulson@13221
   846
by (blast dest: Ord_subset_natD intro: Card_nat nat_into_Card)
paulson@13216
   847
paulson@13216
   848
lemma Finite_cardinal_in_nat [simp]: "Finite(A) ==> |A| : nat"
paulson@13216
   849
apply (erule Finite_induct)
paulson@13216
   850
apply (auto simp add: cardinal_0 Finite_imp_cardinal_cons)
paulson@13216
   851
done
paulson@13216
   852
paulson@13216
   853
lemma Finite_Diff_sing_eq_diff_1: "[| Finite(A); x:A |] ==> |A-{x}| = |A| #- 1"
paulson@13216
   854
apply (rule succ_inject)
paulson@13216
   855
apply (rule_tac b = "|A|" in trans)
paulson@13615
   856
 apply (simp add: Finite_imp_succ_cardinal_Diff)
paulson@13216
   857
apply (subgoal_tac "1 \<lesssim> A")
paulson@13221
   858
 prefer 2 apply (blast intro: not_0_is_lepoll_1)
paulson@13221
   859
apply (frule Finite_imp_well_ord, clarify)
paulson@13216
   860
apply (drule well_ord_lepoll_imp_Card_le)
paulson@13615
   861
 apply (auto simp add: cardinal_1)
paulson@13216
   862
apply (rule trans)
paulson@13615
   863
 apply (rule_tac [2] diff_succ)
paulson@13615
   864
  apply (auto simp add: Finite_cardinal_in_nat)
paulson@13216
   865
done
paulson@13216
   866
paulson@13221
   867
lemma cardinal_lt_imp_Diff_not_0 [rule_format]:
paulson@13221
   868
     "Finite(B) ==> ALL A. |B|<|A| --> A - B ~= 0"
paulson@13221
   869
apply (erule Finite_induct, auto)
paulson@13216
   870
apply (simp_all add: Finite_imp_cardinal_cons)
paulson@13221
   871
apply (case_tac "Finite (A)")
paulson@13221
   872
 apply (subgoal_tac [2] "Finite (cons (x, B))")
paulson@13221
   873
  apply (drule_tac [2] B = "cons (x, B) " in Diff_Finite)
paulson@13221
   874
   apply (auto simp add: Finite_0 Finite_cons)
paulson@13216
   875
apply (subgoal_tac "|B|<|A|")
paulson@13221
   876
 prefer 2 apply (blast intro: lt_trans Ord_cardinal)
paulson@13216
   877
apply (case_tac "x:A")
paulson@13221
   878
 apply (subgoal_tac [2] "A - cons (x, B) = A - B")
paulson@13221
   879
  apply auto
paulson@13216
   880
apply (subgoal_tac "|A| le |cons (x, B) |")
paulson@13221
   881
 prefer 2
paulson@13216
   882
 apply (blast dest: Finite_cons [THEN Finite_imp_well_ord] 
paulson@13216
   883
              intro: well_ord_lepoll_imp_Card_le subset_imp_lepoll)
paulson@13216
   884
apply (auto simp add: Finite_imp_cardinal_cons)
paulson@13216
   885
apply (auto dest!: Finite_cardinal_in_nat simp add: le_iff)
paulson@13216
   886
apply (blast intro: lt_trans)
paulson@13216
   887
done
paulson@13216
   888
paulson@13216
   889
paulson@13216
   890
ML{*
paulson@13216
   891
val InfCard_def = thm "InfCard_def"
paulson@13216
   892
val cmult_def = thm "cmult_def"
paulson@13216
   893
val cadd_def = thm "cadd_def"
paulson@13216
   894
val jump_cardinal_def = thm "jump_cardinal_def"
paulson@13216
   895
val csucc_def = thm "csucc_def"
paulson@13216
   896
paulson@13216
   897
val sum_commute_eqpoll = thm "sum_commute_eqpoll";
paulson@13216
   898
val cadd_commute = thm "cadd_commute";
paulson@13216
   899
val sum_assoc_eqpoll = thm "sum_assoc_eqpoll";
paulson@13216
   900
val well_ord_cadd_assoc = thm "well_ord_cadd_assoc";
paulson@13216
   901
val sum_0_eqpoll = thm "sum_0_eqpoll";
paulson@13216
   902
val cadd_0 = thm "cadd_0";
paulson@13216
   903
val sum_lepoll_self = thm "sum_lepoll_self";
paulson@13216
   904
val cadd_le_self = thm "cadd_le_self";
paulson@13216
   905
val sum_lepoll_mono = thm "sum_lepoll_mono";
paulson@13216
   906
val cadd_le_mono = thm "cadd_le_mono";
paulson@13216
   907
val eq_imp_not_mem = thm "eq_imp_not_mem";
paulson@13216
   908
val sum_succ_eqpoll = thm "sum_succ_eqpoll";
paulson@13216
   909
val nat_cadd_eq_add = thm "nat_cadd_eq_add";
paulson@13216
   910
val prod_commute_eqpoll = thm "prod_commute_eqpoll";
paulson@13216
   911
val cmult_commute = thm "cmult_commute";
paulson@13216
   912
val prod_assoc_eqpoll = thm "prod_assoc_eqpoll";
paulson@13216
   913
val well_ord_cmult_assoc = thm "well_ord_cmult_assoc";
paulson@13216
   914
val sum_prod_distrib_eqpoll = thm "sum_prod_distrib_eqpoll";
paulson@13216
   915
val well_ord_cadd_cmult_distrib = thm "well_ord_cadd_cmult_distrib";
paulson@13216
   916
val prod_0_eqpoll = thm "prod_0_eqpoll";
paulson@13216
   917
val cmult_0 = thm "cmult_0";
paulson@13216
   918
val prod_singleton_eqpoll = thm "prod_singleton_eqpoll";
paulson@13216
   919
val cmult_1 = thm "cmult_1";
paulson@13216
   920
val prod_lepoll_self = thm "prod_lepoll_self";
paulson@13216
   921
val cmult_le_self = thm "cmult_le_self";
paulson@13216
   922
val prod_lepoll_mono = thm "prod_lepoll_mono";
paulson@13216
   923
val cmult_le_mono = thm "cmult_le_mono";
paulson@13216
   924
val prod_succ_eqpoll = thm "prod_succ_eqpoll";
paulson@13216
   925
val nat_cmult_eq_mult = thm "nat_cmult_eq_mult";
paulson@13216
   926
val cmult_2 = thm "cmult_2";
paulson@13216
   927
val sum_lepoll_prod = thm "sum_lepoll_prod";
paulson@13216
   928
val lepoll_imp_sum_lepoll_prod = thm "lepoll_imp_sum_lepoll_prod";
paulson@13216
   929
val nat_cons_lepoll = thm "nat_cons_lepoll";
paulson@13216
   930
val nat_cons_eqpoll = thm "nat_cons_eqpoll";
paulson@13216
   931
val nat_succ_eqpoll = thm "nat_succ_eqpoll";
paulson@13216
   932
val InfCard_nat = thm "InfCard_nat";
paulson@13216
   933
val InfCard_is_Card = thm "InfCard_is_Card";
paulson@13216
   934
val InfCard_Un = thm "InfCard_Un";
paulson@13216
   935
val InfCard_is_Limit = thm "InfCard_is_Limit";
paulson@13216
   936
val ordermap_eqpoll_pred = thm "ordermap_eqpoll_pred";
paulson@13216
   937
val ordermap_z_lt = thm "ordermap_z_lt";
paulson@13216
   938
val InfCard_le_cmult_eq = thm "InfCard_le_cmult_eq";
paulson@13216
   939
val InfCard_cmult_eq = thm "InfCard_cmult_eq";
paulson@13216
   940
val InfCard_cdouble_eq = thm "InfCard_cdouble_eq";
paulson@13216
   941
val InfCard_le_cadd_eq = thm "InfCard_le_cadd_eq";
paulson@13216
   942
val InfCard_cadd_eq = thm "InfCard_cadd_eq";
paulson@13216
   943
val Ord_jump_cardinal = thm "Ord_jump_cardinal";
paulson@13216
   944
val jump_cardinal_iff = thm "jump_cardinal_iff";
paulson@13216
   945
val K_lt_jump_cardinal = thm "K_lt_jump_cardinal";
paulson@13216
   946
val Card_jump_cardinal = thm "Card_jump_cardinal";
paulson@13216
   947
val csucc_basic = thm "csucc_basic";
paulson@13216
   948
val Card_csucc = thm "Card_csucc";
paulson@13216
   949
val lt_csucc = thm "lt_csucc";
paulson@13216
   950
val Ord_0_lt_csucc = thm "Ord_0_lt_csucc";
paulson@13216
   951
val csucc_le = thm "csucc_le";
paulson@13216
   952
val lt_csucc_iff = thm "lt_csucc_iff";
paulson@13216
   953
val Card_lt_csucc_iff = thm "Card_lt_csucc_iff";
paulson@13216
   954
val InfCard_csucc = thm "InfCard_csucc";
paulson@13216
   955
val Finite_into_Fin = thm "Finite_into_Fin";
paulson@13216
   956
val Fin_into_Finite = thm "Fin_into_Finite";
paulson@13216
   957
val Finite_Fin_iff = thm "Finite_Fin_iff";
paulson@13216
   958
val Finite_Un = thm "Finite_Un";
paulson@13216
   959
val Finite_Union = thm "Finite_Union";
paulson@13216
   960
val Finite_induct = thm "Finite_induct";
paulson@13216
   961
val Fin_imp_not_cons_lepoll = thm "Fin_imp_not_cons_lepoll";
paulson@13216
   962
val Finite_imp_cardinal_cons = thm "Finite_imp_cardinal_cons";
paulson@13216
   963
val Finite_imp_succ_cardinal_Diff = thm "Finite_imp_succ_cardinal_Diff";
paulson@13216
   964
val Finite_imp_cardinal_Diff = thm "Finite_imp_cardinal_Diff";
paulson@13216
   965
val nat_implies_well_ord = thm "nat_implies_well_ord";
paulson@13216
   966
val nat_sum_eqpoll_sum = thm "nat_sum_eqpoll_sum";
paulson@13216
   967
val Diff_sing_Finite = thm "Diff_sing_Finite";
paulson@13216
   968
val Diff_Finite = thm "Diff_Finite";
paulson@13216
   969
val Ord_subset_natD = thm "Ord_subset_natD";
paulson@13216
   970
val Ord_nat_subset_into_Card = thm "Ord_nat_subset_into_Card";
paulson@13216
   971
val Finite_cardinal_in_nat = thm "Finite_cardinal_in_nat";
paulson@13216
   972
val Finite_Diff_sing_eq_diff_1 = thm "Finite_Diff_sing_eq_diff_1";
paulson@13216
   973
val cardinal_lt_imp_Diff_not_0 = thm "cardinal_lt_imp_Diff_not_0";
paulson@13216
   974
*}
paulson@13216
   975
lcp@437
   976
end