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