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