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