src/ZF/Cardinal.ML
author lcp
Tue, 26 Jul 1994 13:21:20 +0200
changeset 484 70b789956bd3
parent 467 92868dab2939
child 522 e1de521e012a
permissions -rw-r--r--
Axiom of choice, cardinality results, etc.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     1
(*  Title: 	ZF/Cardinal.ML
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     2
    ID:         $Id$
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     3
    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     4
    Copyright   1994  University of Cambridge
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     5
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     6
Cardinals in Zermelo-Fraenkel Set Theory 
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     7
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     8
This theory does NOT assume the Axiom of Choice
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     9
*)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    10
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    11
open Cardinal;
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    12
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    13
(*** The Schroeder-Bernstein Theorem -- see Davey & Priestly, page 106 ***)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    14
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    15
(** Lemma: Banach's Decomposition Theorem **)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    16
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    17
goal Cardinal.thy "bnd_mono(X, %W. X - g``(Y - f``W))";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    18
by (rtac bnd_monoI 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    19
by (REPEAT (ares_tac [Diff_subset, subset_refl, Diff_mono, image_mono] 1));
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    20
val decomp_bnd_mono = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    21
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    22
val [gfun] = goal Cardinal.thy
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    23
    "g: Y->X ==>   					\
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    24
\    g``(Y - f`` lfp(X, %W. X - g``(Y - f``W))) = 	\
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    25
\    X - lfp(X, %W. X - g``(Y - f``W)) ";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    26
by (res_inst_tac [("P", "%u. ?v = X-u")] 
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    27
     (decomp_bnd_mono RS lfp_Tarski RS ssubst) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    28
by (simp_tac (ZF_ss addsimps [subset_refl, double_complement,
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    29
			     gfun RS fun_is_rel RS image_subset]) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    30
val Banach_last_equation = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    31
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    32
val prems = goal Cardinal.thy
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    33
    "[| f: X->Y;  g: Y->X |] ==>   \
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    34
\    EX XA XB YA YB. (XA Int XB = 0) & (XA Un XB = X) &    \
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    35
\                    (YA Int YB = 0) & (YA Un YB = Y) &    \
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    36
\                    f``XA=YA & g``YB=XB";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    37
by (REPEAT 
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    38
    (FIRSTGOAL
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    39
     (resolve_tac [refl, exI, conjI, Diff_disjoint, Diff_partition])));
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    40
by (rtac Banach_last_equation 3);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    41
by (REPEAT (resolve_tac (prems@[fun_is_rel, image_subset, lfp_subset]) 1));
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    42
val decomposition = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    43
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    44
val prems = goal Cardinal.thy
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    45
    "[| f: inj(X,Y);  g: inj(Y,X) |] ==> EX h. h: bij(X,Y)";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    46
by (cut_facts_tac prems 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    47
by (cut_facts_tac [(prems RL [inj_is_fun]) MRS decomposition] 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    48
by (fast_tac (ZF_cs addSIs [restrict_bij,bij_disjoint_Un]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    49
                    addIs [bij_converse_bij]) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    50
(* The instantiation of exI to "restrict(f,XA) Un converse(restrict(g,YB))"
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    51
   is forced by the context!! *)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    52
val schroeder_bernstein = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    53
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    54
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    55
(** Equipollence is an equivalence relation **)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    56
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    57
goalw Cardinal.thy [eqpoll_def] "X eqpoll X";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    58
by (rtac exI 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    59
by (rtac id_bij 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    60
val eqpoll_refl = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    61
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    62
goalw Cardinal.thy [eqpoll_def] "!!X Y. X eqpoll Y ==> Y eqpoll X";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    63
by (fast_tac (ZF_cs addIs [bij_converse_bij]) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    64
val eqpoll_sym = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    65
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    66
goalw Cardinal.thy [eqpoll_def]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    67
    "!!X Y. [| X eqpoll Y;  Y eqpoll Z |] ==> X eqpoll Z";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    68
by (fast_tac (ZF_cs addIs [comp_bij]) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    69
val eqpoll_trans = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    70
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    71
(** Le-pollence is a partial ordering **)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    72
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    73
goalw Cardinal.thy [lepoll_def] "!!X Y. X<=Y ==> X lepoll Y";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    74
by (rtac exI 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    75
by (etac id_subset_inj 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    76
val subset_imp_lepoll = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    77
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    78
val lepoll_refl = subset_refl RS subset_imp_lepoll;
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    79
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    80
goalw Cardinal.thy [eqpoll_def, bij_def, lepoll_def]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    81
    "!!X Y. X eqpoll Y ==> X lepoll Y";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    82
by (fast_tac ZF_cs 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    83
val eqpoll_imp_lepoll = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    84
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    85
goalw Cardinal.thy [lepoll_def]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    86
    "!!X Y. [| X lepoll Y;  Y lepoll Z |] ==> X lepoll Z";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    87
by (fast_tac (ZF_cs addIs [comp_inj]) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    88
val lepoll_trans = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    89
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    90
(*Asymmetry law*)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    91
goalw Cardinal.thy [lepoll_def,eqpoll_def]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    92
    "!!X Y. [| X lepoll Y;  Y lepoll X |] ==> X eqpoll Y";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    93
by (REPEAT (etac exE 1));
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    94
by (rtac schroeder_bernstein 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    95
by (REPEAT (assume_tac 1));
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    96
val eqpollI = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    97
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    98
val [major,minor] = goal Cardinal.thy
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    99
    "[| X eqpoll Y; [| X lepoll Y; Y lepoll X |] ==> P |] ==> P";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   100
by (rtac minor 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   101
by (REPEAT (resolve_tac [major, eqpoll_imp_lepoll, eqpoll_sym] 1));
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   102
val eqpollE = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   103
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   104
goal Cardinal.thy "X eqpoll Y <-> X lepoll Y & Y lepoll X";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   105
by (fast_tac (ZF_cs addIs [eqpollI] addSEs [eqpollE]) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   106
val eqpoll_iff = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   107
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   108
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   109
(** LEAST -- the least number operator [from HOL/Univ.ML] **)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   110
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   111
val [premP,premOrd,premNot] = goalw Cardinal.thy [Least_def]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   112
    "[| P(i);  Ord(i);  !!x. x<i ==> ~P(x) |] ==> (LEAST x.P(x)) = i";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   113
by (rtac the_equality 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   114
by (fast_tac (ZF_cs addSIs [premP,premOrd,premNot]) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   115
by (REPEAT (etac conjE 1));
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   116
by (etac (premOrd RS Ord_linear_lt) 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   117
by (ALLGOALS (fast_tac (ZF_cs addSIs [premP] addSDs [premNot])));
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   118
val Least_equality = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   119
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   120
goal Cardinal.thy "!!i. [| P(i);  Ord(i) |] ==> P(LEAST x.P(x))";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   121
by (etac rev_mp 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   122
by (trans_ind_tac "i" [] 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   123
by (rtac impI 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   124
by (rtac classical 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   125
by (EVERY1 [rtac (Least_equality RS ssubst), assume_tac, assume_tac]);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   126
by (assume_tac 2);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   127
by (fast_tac (ZF_cs addSEs [ltE]) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   128
val LeastI = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   129
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   130
(*Proof is almost identical to the one above!*)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   131
goal Cardinal.thy "!!i. [| P(i);  Ord(i) |] ==> (LEAST x.P(x)) le i";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   132
by (etac rev_mp 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   133
by (trans_ind_tac "i" [] 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   134
by (rtac impI 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   135
by (rtac classical 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   136
by (EVERY1 [rtac (Least_equality RS ssubst), assume_tac, assume_tac]);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   137
by (etac le_refl 2);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   138
by (fast_tac (ZF_cs addEs [ltE, lt_trans1] addIs [leI, ltI]) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   139
val Least_le = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   140
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   141
(*LEAST really is the smallest*)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   142
goal Cardinal.thy "!!i. [| P(i);  i < (LEAST x.P(x)) |] ==> Q";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   143
by (rtac (Least_le RSN (2,lt_trans2) RS lt_irrefl) 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   144
by (REPEAT (eresolve_tac [asm_rl, ltE] 1));
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   145
val less_LeastE = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   146
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   147
(*If there is no such P then LEAST is vacuously 0*)
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   148
goalw Cardinal.thy [Least_def]
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   149
    "!!P. [| ~ (EX i. Ord(i) & P(i)) |] ==> (LEAST x.P(x)) = 0";
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   150
by (rtac the_0 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   151
by (fast_tac ZF_cs 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   152
val Least_0 = result();
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   153
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   154
goal Cardinal.thy "Ord(LEAST x.P(x))";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   155
by (excluded_middle_tac "EX i. Ord(i) & P(i)" 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   156
by (safe_tac ZF_cs);
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   157
by (rtac (Least_le RS ltE) 2);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   158
by (REPEAT_SOME assume_tac);
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   159
by (etac (Least_0 RS ssubst) 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   160
by (rtac Ord_0 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   161
val Ord_Least = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   162
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   163
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   164
(** Basic properties of cardinals **)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   165
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   166
(*Not needed for simplification, but helpful below*)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   167
val prems = goal Cardinal.thy
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   168
    "[| !!y. P(y) <-> Q(y) |] ==> (LEAST x.P(x)) = (LEAST x.Q(x))";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   169
by (simp_tac (FOL_ss addsimps prems) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   170
val Least_cong = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   171
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   172
(*Need AC to prove   X lepoll Y ==> |X| le |Y| ; see well_ord_lepoll_imp_le  *)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   173
goalw Cardinal.thy [eqpoll_def,cardinal_def] "!!X Y. X eqpoll Y ==> |X| = |Y|";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   174
by (rtac Least_cong 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   175
by (fast_tac (ZF_cs addEs [comp_bij,bij_converse_bij]) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   176
val cardinal_cong = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   177
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   178
(*Under AC, the premise becomes trivial; one consequence is ||A|| = |A|*)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   179
goalw Cardinal.thy [eqpoll_def, cardinal_def]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   180
    "!!A. well_ord(A,r) ==> |A| eqpoll A";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   181
by (rtac LeastI 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   182
by (etac Ord_ordertype 2);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   183
by (rtac exI 1);
467
92868dab2939 new cardinal arithmetic developments
lcp
parents: 437
diff changeset
   184
by (etac (ordermap_bij RS bij_converse_bij) 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   185
val well_ord_cardinal_eqpoll = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   186
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   187
val Ord_cardinal_eqpoll = well_ord_Memrel RS well_ord_cardinal_eqpoll 
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   188
                          |> standard;
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   189
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   190
goal Cardinal.thy
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   191
    "!!X Y. [| well_ord(X,r);  well_ord(Y,s);  |X| = |Y| |] ==> X eqpoll Y";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   192
by (rtac (eqpoll_sym RS eqpoll_trans) 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   193
by (etac well_ord_cardinal_eqpoll 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   194
by (asm_simp_tac (ZF_ss addsimps [well_ord_cardinal_eqpoll]) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   195
val well_ord_cardinal_eqE = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   196
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   197
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   198
(** Observations from Kunen, page 28 **)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   199
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   200
goalw Cardinal.thy [cardinal_def] "!!i. Ord(i) ==> |i| le i";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   201
by (etac (eqpoll_refl RS Least_le) 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   202
val Ord_cardinal_le = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   203
484
70b789956bd3 Axiom of choice, cardinality results, etc.
lcp
parents: 467
diff changeset
   204
goalw Cardinal.thy [Card_def] "!!K. Card(K) ==> |K| = K";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   205
by (etac sym 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   206
val Card_cardinal_eq = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   207
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   208
val prems = goalw Cardinal.thy [Card_def,cardinal_def]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   209
    "[| Ord(i);  !!j. j<i ==> ~(j eqpoll i) |] ==> Card(i)";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   210
by (rtac (Least_equality RS ssubst) 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   211
by (REPEAT (ares_tac ([refl,eqpoll_refl]@prems) 1));
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   212
val CardI = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   213
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   214
goalw Cardinal.thy [Card_def, cardinal_def] "!!i. Card(i) ==> Ord(i)";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   215
by (etac ssubst 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   216
by (rtac Ord_Least 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   217
val Card_is_Ord = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   218
484
70b789956bd3 Axiom of choice, cardinality results, etc.
lcp
parents: 467
diff changeset
   219
goalw Cardinal.thy [cardinal_def] "Ord(|A|)";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   220
by (rtac Ord_Least 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   221
val Ord_cardinal = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   222
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   223
goal Cardinal.thy "Card(0)";
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   224
by (rtac (Ord_0 RS CardI) 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   225
by (fast_tac (ZF_cs addSEs [ltE]) 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   226
val Card_0 = result();
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   227
484
70b789956bd3 Axiom of choice, cardinality results, etc.
lcp
parents: 467
diff changeset
   228
goalw Cardinal.thy [cardinal_def] "Card(|A|)";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   229
by (excluded_middle_tac "EX i. Ord(i) & i eqpoll A" 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   230
by (etac (Least_0 RS ssubst) 1 THEN rtac Card_0 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   231
by (rtac (Ord_Least RS CardI) 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   232
by (safe_tac ZF_cs);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   233
by (rtac less_LeastE 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   234
by (assume_tac 2);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   235
by (etac eqpoll_trans 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   236
by (REPEAT (ares_tac [LeastI] 1));
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   237
val Card_cardinal = result();
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   238
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   239
(*Kunen's Lemma 10.5*)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   240
goal Cardinal.thy "!!i j. [| |i| le j;  j le i |] ==> |j| = |i|";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   241
by (rtac (eqpollI RS cardinal_cong) 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   242
by (etac (le_imp_subset RS subset_imp_lepoll) 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   243
by (rtac lepoll_trans 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   244
by (etac (le_imp_subset RS subset_imp_lepoll) 2);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   245
by (rtac (eqpoll_sym RS eqpoll_imp_lepoll) 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   246
by (rtac Ord_cardinal_eqpoll 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   247
by (REPEAT (eresolve_tac [ltE, Ord_succD] 1));
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   248
val cardinal_eq_lemma = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   249
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   250
goal Cardinal.thy "!!i j. i le j ==> |i| le |j|";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   251
by (res_inst_tac [("i","|i|"),("j","|j|")] Ord_linear_le 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   252
by (REPEAT_FIRST (ares_tac [Ord_cardinal, le_eqI]));
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   253
by (rtac cardinal_eq_lemma 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   254
by (assume_tac 2);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   255
by (etac le_trans 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   256
by (etac ltE 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   257
by (etac Ord_cardinal_le 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   258
val cardinal_mono = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   259
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   260
(*Since we have |succ(nat)| le |nat|, the converse of cardinal_mono fails!*)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   261
goal Cardinal.thy "!!i j. [| |i| < |j|;  Ord(i);  Ord(j) |] ==> i < j";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   262
by (rtac Ord_linear2 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   263
by (REPEAT_SOME assume_tac);
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   264
by (etac (lt_trans2 RS lt_irrefl) 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   265
by (etac cardinal_mono 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   266
val cardinal_lt_imp_lt = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   267
484
70b789956bd3 Axiom of choice, cardinality results, etc.
lcp
parents: 467
diff changeset
   268
goal Cardinal.thy "!!i j. [| |i| < K;  Ord(i);  Card(K) |] ==> i < K";
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   269
by (asm_simp_tac (ZF_ss addsimps 
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   270
		  [cardinal_lt_imp_lt, Card_is_Ord, Card_cardinal_eq]) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   271
val Card_lt_imp_lt = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   272
484
70b789956bd3 Axiom of choice, cardinality results, etc.
lcp
parents: 467
diff changeset
   273
goal Cardinal.thy "!!i j. [| Ord(i);  Card(K) |] ==> (|i| < K) <-> (i < K)";
70b789956bd3 Axiom of choice, cardinality results, etc.
lcp
parents: 467
diff changeset
   274
by (fast_tac (ZF_cs addEs [Card_lt_imp_lt, Ord_cardinal_le RS lt_trans1]) 1);
70b789956bd3 Axiom of choice, cardinality results, etc.
lcp
parents: 467
diff changeset
   275
val Card_lt_iff = result();
70b789956bd3 Axiom of choice, cardinality results, etc.
lcp
parents: 467
diff changeset
   276
70b789956bd3 Axiom of choice, cardinality results, etc.
lcp
parents: 467
diff changeset
   277
goal Cardinal.thy "!!i j. [| Ord(i);  Card(K) |] ==> (K le |i|) <-> (K le i)";
70b789956bd3 Axiom of choice, cardinality results, etc.
lcp
parents: 467
diff changeset
   278
by (asm_simp_tac (ZF_ss addsimps 
70b789956bd3 Axiom of choice, cardinality results, etc.
lcp
parents: 467
diff changeset
   279
		  [Card_lt_iff, Card_is_Ord, Ord_cardinal, 
70b789956bd3 Axiom of choice, cardinality results, etc.
lcp
parents: 467
diff changeset
   280
		   not_lt_iff_le RS iff_sym]) 1);
70b789956bd3 Axiom of choice, cardinality results, etc.
lcp
parents: 467
diff changeset
   281
val Card_le_iff = result();
70b789956bd3 Axiom of choice, cardinality results, etc.
lcp
parents: 467
diff changeset
   282
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   283
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   284
(** The swap operator [NOT USED] **)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   285
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   286
goalw Cardinal.thy [swap_def]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   287
    "!!A. [| x:A;  y:A |] ==> swap(A,x,y) : A->A";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   288
by (REPEAT (ares_tac [lam_type,if_type] 1));
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   289
val swap_type = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   290
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   291
goalw Cardinal.thy [swap_def]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   292
    "!!A. [| x:A;  y:A;  z:A |] ==> swap(A,x,y)`(swap(A,x,y)`z) = z";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   293
by (asm_simp_tac (ZF_ss setloop split_tac [expand_if]) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   294
val swap_swap_identity = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   295
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   296
goal Cardinal.thy "!!A. [| x:A;  y:A |] ==> swap(A,x,y) : bij(A,A)";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   297
by (rtac nilpotent_imp_bijective 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   298
by (REPEAT (ares_tac [swap_type, comp_eq_id_iff RS iffD2,
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   299
		      ballI, swap_swap_identity] 1));
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   300
val swap_bij = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   301
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   302
(*** The finite cardinals ***)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   303
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   304
(*Lemma suggested by Mike Fourman*)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   305
val [prem] = goalw Cardinal.thy [inj_def]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   306
 "f: inj(succ(m), succ(n)) ==> (lam x:m. if(f`x=n, f`m, f`x)) : inj(m,n)";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   307
by (rtac CollectI 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   308
(*Proving it's in the function space m->n*)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   309
by (cut_facts_tac [prem] 1);
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   310
by (rtac (if_type RS lam_type) 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   311
by (fast_tac (ZF_cs addSEs [mem_irrefl] addEs [apply_funtype RS succE]) 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   312
by (fast_tac (ZF_cs addSEs [mem_irrefl] addEs [apply_funtype RS succE]) 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   313
(*Proving it's injective*)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   314
by (asm_simp_tac (ZF_ss setloop split_tac [expand_if]) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   315
(*Adding  prem  earlier would cause the simplifier to loop*)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   316
by (cut_facts_tac [prem] 1);
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   317
by (fast_tac (ZF_cs addSEs [mem_irrefl]) 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   318
val inj_succ_succD = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   319
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   320
val [prem] = goalw Cardinal.thy [lepoll_def]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   321
    "m:nat ==> ALL n: nat. m lepoll n --> m le n";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   322
by (nat_ind_tac "m" [prem] 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   323
by (fast_tac (ZF_cs addSIs [nat_0_le]) 1);
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   324
by (rtac ballI 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   325
by (eres_inst_tac [("n","n")] natE 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   326
by (asm_simp_tac (ZF_ss addsimps [inj_def, succI1 RS Pi_empty2]) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   327
by (fast_tac (ZF_cs addSIs [succ_leI] addSDs [inj_succ_succD]) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   328
val nat_lepoll_imp_le_lemma = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   329
val nat_lepoll_imp_le = nat_lepoll_imp_le_lemma RS bspec RS mp |> standard;
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   330
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   331
goal Cardinal.thy
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   332
    "!!m n. [| m:nat; n: nat |] ==> m eqpoll n <-> m = n";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   333
by (rtac iffI 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   334
by (asm_simp_tac (ZF_ss addsimps [eqpoll_refl]) 2);
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   335
by (fast_tac (ZF_cs addIs [nat_lepoll_imp_le, le_anti_sym] 
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   336
                    addSEs [eqpollE]) 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   337
val nat_eqpoll_iff = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   338
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   339
goalw Cardinal.thy [Card_def,cardinal_def]
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   340
    "!!n. n: nat ==> Card(n)";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   341
by (rtac (Least_equality RS ssubst) 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   342
by (REPEAT_FIRST (ares_tac [eqpoll_refl, nat_into_Ord, refl]));
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   343
by (asm_simp_tac (ZF_ss addsimps [lt_nat_in_nat RS nat_eqpoll_iff]) 1);
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   344
by (fast_tac (ZF_cs addSEs [lt_irrefl]) 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   345
val nat_into_Card = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   346
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   347
(*Part of Kunen's Lemma 10.6*)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   348
goal Cardinal.thy "!!n. [| succ(n) lepoll n;  n:nat |] ==> P";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   349
by (rtac (nat_lepoll_imp_le RS lt_irrefl) 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   350
by (REPEAT (ares_tac [nat_succI] 1));
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   351
val succ_lepoll_natE = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   352
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   353
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   354
(*** The first infinite cardinal: Omega, or nat ***)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   355
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   356
(*This implies Kunen's Lemma 10.6*)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   357
goal Cardinal.thy "!!n. [| n<i;  n:nat |] ==> ~ i lepoll n";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   358
by (rtac notI 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   359
by (rtac succ_lepoll_natE 1 THEN assume_tac 2);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   360
by (rtac lepoll_trans 1 THEN assume_tac 2);
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   361
by (etac ltE 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   362
by (REPEAT (ares_tac [Ord_succ_subsetI RS subset_imp_lepoll] 1));
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   363
val lt_not_lepoll = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   364
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   365
goal Cardinal.thy "!!i n. [| Ord(i);  n:nat |] ==> i eqpoll n <-> i=n";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   366
by (rtac iffI 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   367
by (asm_simp_tac (ZF_ss addsimps [eqpoll_refl]) 2);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   368
by (rtac Ord_linear_lt 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   369
by (REPEAT_SOME (eresolve_tac [asm_rl, nat_into_Ord]));
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   370
by (etac (lt_nat_in_nat RS nat_eqpoll_iff RS iffD1) 1 THEN
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   371
    REPEAT (assume_tac 1));
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   372
by (rtac (lt_not_lepoll RS notE) 1 THEN (REPEAT (assume_tac 1)));
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   373
by (etac eqpoll_imp_lepoll 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   374
val Ord_nat_eqpoll_iff = result();
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   375
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   376
goalw Cardinal.thy [Card_def,cardinal_def] "Card(nat)";
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   377
by (rtac (Least_equality RS ssubst) 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   378
by (REPEAT_FIRST (ares_tac [eqpoll_refl, Ord_nat, refl]));
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   379
by (etac ltE 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   380
by (asm_simp_tac (ZF_ss addsimps [eqpoll_iff, lt_not_lepoll, ltI]) 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   381
val Card_nat = result();
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   382
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   383
(*Allows showing that |i| is a limit cardinal*)
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   384
goal Cardinal.thy  "!!i. nat le i ==> nat le |i|";
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   385
by (rtac (Card_nat RS Card_cardinal_eq RS subst) 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   386
by (etac cardinal_mono 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   387
val nat_le_cardinal = result();
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   388