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