author  wenzelm 
Thu, 16 Oct 1997 13:38:28 +0200  
changeset 3887  04f730731e43 
parent 3840  e0baea4d485a 
child 4091  771b1f6422a8 
permissions  rwrr 
1461  1 
(* Title: ZF/CardinalArith.ML 
437  2 
ID: $Id$ 
1461  3 
Author: Lawrence C Paulson, Cambridge University Computer Laboratory 
437  4 
Copyright 1994 University of Cambridge 
5 

6 
Cardinal arithmetic  WITHOUT the Axiom of Choice 

823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

7 

846  8 
Note: Could omit proving the algebraic laws for cardinal addition and 
823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

9 
multiplication. On finite cardinals these operations coincide with 
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

10 
addition and multiplication of natural numbers; on infinite cardinals they 
846  11 
coincide with union (maximum). Either way we get most laws for free. 
437  12 
*) 
13 

14 
open CardinalArith; 

15 

16 
(*** Cardinal addition ***) 

17 

18 
(** Cardinal addition is commutative **) 

19 

20 
goalw CardinalArith.thy [eqpoll_def] "A+B eqpoll B+A"; 

21 
by (rtac exI 1); 

22 
by (res_inst_tac [("c", "case(Inr, Inl)"), ("d", "case(Inr, Inl)")] 

23 
lam_bijective 1); 

2469  24 
by (safe_tac (!claset addSEs [sumE])); 
25 
by (ALLGOALS (Asm_simp_tac)); 

760  26 
qed "sum_commute_eqpoll"; 
437  27 

28 
goalw CardinalArith.thy [cadd_def] "i + j = j + i"; 

29 
by (rtac (sum_commute_eqpoll RS cardinal_cong) 1); 

760  30 
qed "cadd_commute"; 
437  31 

32 
(** Cardinal addition is associative **) 

33 

34 
goalw CardinalArith.thy [eqpoll_def] "(A+B)+C eqpoll A+(B+C)"; 

35 
by (rtac exI 1); 

1461  36 
by (rtac sum_assoc_bij 1); 
760  37 
qed "sum_assoc_eqpoll"; 
437  38 

39 
(*Unconditional version requires AC*) 

40 
goalw CardinalArith.thy [cadd_def] 

1461  41 
"!!i j k. [ well_ord(i,ri); well_ord(j,rj); well_ord(k,rk) ] ==> \ 
437  42 
\ (i + j) + k = i + (j + k)"; 
43 
by (rtac cardinal_cong 1); 

823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

44 
by (rtac ([well_ord_cardinal_eqpoll, eqpoll_refl] MRS sum_eqpoll_cong RS 
1461  45 
eqpoll_trans) 1); 
437  46 
by (rtac (sum_assoc_eqpoll RS eqpoll_trans) 2); 
823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

47 
by (rtac ([eqpoll_refl, well_ord_cardinal_eqpoll] MRS sum_eqpoll_cong RS 
1461  48 
eqpoll_sym) 2); 
484  49 
by (REPEAT (ares_tac [well_ord_radd] 1)); 
760  50 
qed "well_ord_cadd_assoc"; 
437  51 

52 
(** 0 is the identity for addition **) 

53 

54 
goalw CardinalArith.thy [eqpoll_def] "0+A eqpoll A"; 

55 
by (rtac exI 1); 

846  56 
by (rtac bij_0_sum 1); 
760  57 
qed "sum_0_eqpoll"; 
437  58 

484  59 
goalw CardinalArith.thy [cadd_def] "!!K. Card(K) ==> 0 + K = K"; 
2469  60 
by (asm_simp_tac (!simpset addsimps [sum_0_eqpoll RS cardinal_cong, 
1461  61 
Card_cardinal_eq]) 1); 
760  62 
qed "cadd_0"; 
437  63 

767  64 
(** Addition by another cardinal **) 
65 

66 
goalw CardinalArith.thy [lepoll_def, inj_def] "A lepoll A+B"; 

67 
by (res_inst_tac [("x", "lam x:A. Inl(x)")] exI 1); 

2469  68 
by (asm_simp_tac (!simpset addsimps [lam_type]) 1); 
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
767
diff
changeset

69 
qed "sum_lepoll_self"; 
767  70 

71 
(*Could probably weaken the premises to well_ord(K,r), or removing using AC*) 

72 
goalw CardinalArith.thy [cadd_def] 

73 
"!!K. [ Card(K); Ord(L) ] ==> K le (K + L)"; 

74 
by (rtac ([Card_cardinal_le, well_ord_lepoll_imp_Card_le] MRS le_trans) 1); 

75 
by (rtac sum_lepoll_self 3); 

76 
by (REPEAT (ares_tac [well_ord_radd, well_ord_Memrel, Card_is_Ord] 1)); 

782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
767
diff
changeset

77 
qed "cadd_le_self"; 
767  78 

79 
(** Monotonicity of addition **) 

80 

81 
goalw CardinalArith.thy [lepoll_def] 

82 
"!!A B C D. [ A lepoll C; B lepoll D ] ==> A + B lepoll C + D"; 

83 
by (REPEAT (etac exE 1)); 

84 
by (res_inst_tac [("x", "lam z:A+B. case(%w. Inl(f`w), %y. Inr(fa`y), z)")] 

85 
exI 1); 

86 
by (res_inst_tac 

87 
[("d", "case(%w. Inl(converse(f)`w), %y. Inr(converse(fa)`y))")] 

88 
lam_injective 1); 

846  89 
by (typechk_tac ([inj_is_fun, case_type, InlI, InrI] @ ZF_typechecks)); 
823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

90 
by (etac sumE 1); 
2469  91 
by (ALLGOALS (asm_simp_tac (!simpset addsimps [left_inverse]))); 
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
767
diff
changeset

92 
qed "sum_lepoll_mono"; 
767  93 

94 
goalw CardinalArith.thy [cadd_def] 

95 
"!!K. [ K' le K; L' le L ] ==> (K' + L') le (K + L)"; 

2469  96 
by (safe_tac (!claset addSDs [le_subset_iff RS iffD1])); 
823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

97 
by (rtac well_ord_lepoll_imp_Card_le 1); 
767  98 
by (REPEAT (ares_tac [sum_lepoll_mono, subset_imp_lepoll] 2)); 
99 
by (REPEAT (ares_tac [well_ord_radd, well_ord_Memrel] 1)); 

782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
767
diff
changeset

100 
qed "cadd_le_mono"; 
767  101 

437  102 
(** Addition of finite cardinals is "ordinary" addition **) 
103 

104 
goalw CardinalArith.thy [eqpoll_def] "succ(A)+B eqpoll succ(A+B)"; 

105 
by (rtac exI 1); 

3840  106 
by (res_inst_tac [("c", "%z. if(z=Inl(A),A+B,z)"), 
107 
("d", "%z. if(z=A+B,Inl(A),z)")] 

437  108 
lam_bijective 1); 
109 
by (ALLGOALS 

2469  110 
(asm_simp_tac (!simpset addsimps [succI2, mem_imp_not_eq] 
1461  111 
setloop eresolve_tac [sumE,succE]))); 
760  112 
qed "sum_succ_eqpoll"; 
437  113 

114 
(*Pulling the succ(...) outside the ... requires m, n: nat *) 

115 
(*Unconditional version requires AC*) 

116 
goalw CardinalArith.thy [cadd_def] 

117 
"!!m n. [ Ord(m); Ord(n) ] ==> succ(m) + n = succ(m + n)"; 

118 
by (rtac (sum_succ_eqpoll RS cardinal_cong RS trans) 1); 

119 
by (rtac (succ_eqpoll_cong RS cardinal_cong) 1); 

120 
by (rtac (well_ord_cardinal_eqpoll RS eqpoll_sym) 1); 

121 
by (REPEAT (ares_tac [well_ord_radd, well_ord_Memrel] 1)); 

760  122 
qed "cadd_succ_lemma"; 
437  123 

124 
val [mnat,nnat] = goal CardinalArith.thy 

125 
"[ m: nat; n: nat ] ==> m + n = m#+n"; 

126 
by (cut_facts_tac [nnat] 1); 

127 
by (nat_ind_tac "m" [mnat] 1); 

2469  128 
by (asm_simp_tac (!simpset addsimps [nat_into_Card RS cadd_0]) 1); 
129 
by (asm_simp_tac (!simpset addsimps [nat_into_Ord, cadd_succ_lemma, 

1461  130 
nat_into_Card RS Card_cardinal_eq]) 1); 
760  131 
qed "nat_cadd_eq_add"; 
437  132 

133 

134 
(*** Cardinal multiplication ***) 

135 

136 
(** Cardinal multiplication is commutative **) 

137 

138 
(*Easier to prove the two directions separately*) 

139 
goalw CardinalArith.thy [eqpoll_def] "A*B eqpoll B*A"; 

140 
by (rtac exI 1); 

1090
8ab69b3e396b
Changed some definitions and proofs to use patternmatching.
lcp
parents:
1075
diff
changeset

141 
by (res_inst_tac [("c", "%<x,y>.<y,x>"), ("d", "%<x,y>.<y,x>")] 
437  142 
lam_bijective 1); 
2469  143 
by (safe_tac (!claset)); 
144 
by (ALLGOALS (Asm_simp_tac)); 

760  145 
qed "prod_commute_eqpoll"; 
437  146 

147 
goalw CardinalArith.thy [cmult_def] "i * j = j * i"; 

148 
by (rtac (prod_commute_eqpoll RS cardinal_cong) 1); 

760  149 
qed "cmult_commute"; 
437  150 

151 
(** Cardinal multiplication is associative **) 

152 

153 
goalw CardinalArith.thy [eqpoll_def] "(A*B)*C eqpoll A*(B*C)"; 

154 
by (rtac exI 1); 

1461  155 
by (rtac prod_assoc_bij 1); 
760  156 
qed "prod_assoc_eqpoll"; 
437  157 

158 
(*Unconditional version requires AC*) 

159 
goalw CardinalArith.thy [cmult_def] 

1461  160 
"!!i j k. [ well_ord(i,ri); well_ord(j,rj); well_ord(k,rk) ] ==> \ 
437  161 
\ (i * j) * k = i * (j * k)"; 
162 
by (rtac cardinal_cong 1); 

823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

163 
by (rtac ([well_ord_cardinal_eqpoll, eqpoll_refl] MRS prod_eqpoll_cong RS 
1461  164 
eqpoll_trans) 1); 
437  165 
by (rtac (prod_assoc_eqpoll RS eqpoll_trans) 2); 
823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

166 
by (rtac ([eqpoll_refl, well_ord_cardinal_eqpoll] MRS prod_eqpoll_cong RS 
1461  167 
eqpoll_sym) 2); 
484  168 
by (REPEAT (ares_tac [well_ord_rmult] 1)); 
760  169 
qed "well_ord_cmult_assoc"; 
437  170 

171 
(** Cardinal multiplication distributes over addition **) 

172 

173 
goalw CardinalArith.thy [eqpoll_def] "(A+B)*C eqpoll (A*C)+(B*C)"; 

174 
by (rtac exI 1); 

1461  175 
by (rtac sum_prod_distrib_bij 1); 
760  176 
qed "sum_prod_distrib_eqpoll"; 
437  177 

846  178 
goalw CardinalArith.thy [cadd_def, cmult_def] 
1461  179 
"!!i j k. [ well_ord(i,ri); well_ord(j,rj); well_ord(k,rk) ] ==> \ 
846  180 
\ (i + j) * k = (i * k) + (j * k)"; 
181 
by (rtac cardinal_cong 1); 

182 
by (rtac ([well_ord_cardinal_eqpoll, eqpoll_refl] MRS prod_eqpoll_cong RS 

1461  183 
eqpoll_trans) 1); 
846  184 
by (rtac (sum_prod_distrib_eqpoll RS eqpoll_trans) 2); 
185 
by (rtac ([well_ord_cardinal_eqpoll, well_ord_cardinal_eqpoll] MRS sum_eqpoll_cong RS 

1461  186 
eqpoll_sym) 2); 
846  187 
by (REPEAT (ares_tac [well_ord_rmult, well_ord_radd] 1)); 
188 
qed "well_ord_cadd_cmult_distrib"; 

189 

437  190 
(** Multiplication by 0 yields 0 **) 
191 

192 
goalw CardinalArith.thy [eqpoll_def] "0*A eqpoll 0"; 

193 
by (rtac exI 1); 

194 
by (rtac lam_bijective 1); 

2469  195 
by (safe_tac (!claset)); 
760  196 
qed "prod_0_eqpoll"; 
437  197 

198 
goalw CardinalArith.thy [cmult_def] "0 * i = 0"; 

2469  199 
by (asm_simp_tac (!simpset addsimps [prod_0_eqpoll RS cardinal_cong, 
1461  200 
Card_0 RS Card_cardinal_eq]) 1); 
760  201 
qed "cmult_0"; 
437  202 

203 
(** 1 is the identity for multiplication **) 

204 

205 
goalw CardinalArith.thy [eqpoll_def] "{x}*A eqpoll A"; 

206 
by (rtac exI 1); 

846  207 
by (resolve_tac [singleton_prod_bij RS bij_converse_bij] 1); 
760  208 
qed "prod_singleton_eqpoll"; 
437  209 

484  210 
goalw CardinalArith.thy [cmult_def, succ_def] "!!K. Card(K) ==> 1 * K = K"; 
2469  211 
by (asm_simp_tac (!simpset addsimps [prod_singleton_eqpoll RS cardinal_cong, 
1461  212 
Card_cardinal_eq]) 1); 
760  213 
qed "cmult_1"; 
437  214 

767  215 
(*** Some inequalities for multiplication ***) 
216 

217 
goalw CardinalArith.thy [lepoll_def, inj_def] "A lepoll A*A"; 

218 
by (res_inst_tac [("x", "lam x:A. <x,x>")] exI 1); 

2469  219 
by (simp_tac (!simpset addsimps [lam_type]) 1); 
767  220 
qed "prod_square_lepoll"; 
221 

823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

222 
(*Could probably weaken the premise to well_ord(K,r), or remove using AC*) 
767  223 
goalw CardinalArith.thy [cmult_def] "!!K. Card(K) ==> K le K * K"; 
224 
by (rtac le_trans 1); 

225 
by (rtac well_ord_lepoll_imp_Card_le 2); 

226 
by (rtac prod_square_lepoll 3); 

227 
by (REPEAT (ares_tac [well_ord_rmult, well_ord_Memrel, Card_is_Ord] 2)); 

2469  228 
by (asm_simp_tac (!simpset addsimps [le_refl, Card_is_Ord, Card_cardinal_eq]) 1); 
767  229 
qed "cmult_square_le"; 
230 

231 
(** Multiplication by a nonzero cardinal **) 

232 

233 
goalw CardinalArith.thy [lepoll_def, inj_def] "!!b. b: B ==> A lepoll A*B"; 

234 
by (res_inst_tac [("x", "lam x:A. <x,b>")] exI 1); 

2469  235 
by (asm_simp_tac (!simpset addsimps [lam_type]) 1); 
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
767
diff
changeset

236 
qed "prod_lepoll_self"; 
767  237 

238 
(*Could probably weaken the premises to well_ord(K,r), or removing using AC*) 

239 
goalw CardinalArith.thy [cmult_def] 

240 
"!!K. [ Card(K); Ord(L); 0<L ] ==> K le (K * L)"; 

241 
by (rtac ([Card_cardinal_le, well_ord_lepoll_imp_Card_le] MRS le_trans) 1); 

242 
by (rtac prod_lepoll_self 3); 

243 
by (REPEAT (ares_tac [well_ord_rmult, well_ord_Memrel, Card_is_Ord, ltD] 1)); 

782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
767
diff
changeset

244 
qed "cmult_le_self"; 
767  245 

246 
(** Monotonicity of multiplication **) 

247 

248 
goalw CardinalArith.thy [lepoll_def] 

249 
"!!A B C D. [ A lepoll C; B lepoll D ] ==> A * B lepoll C * D"; 

250 
by (REPEAT (etac exE 1)); 

1090
8ab69b3e396b
Changed some definitions and proofs to use patternmatching.
lcp
parents:
1075
diff
changeset

251 
by (res_inst_tac [("x", "lam <w,y>:A*B. <f`w, fa`y>")] exI 1); 
8ab69b3e396b
Changed some definitions and proofs to use patternmatching.
lcp
parents:
1075
diff
changeset

252 
by (res_inst_tac [("d", "%<w,y>.<converse(f)`w, converse(fa)`y>")] 
1461  253 
lam_injective 1); 
767  254 
by (typechk_tac (inj_is_fun::ZF_typechecks)); 
823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

255 
by (etac SigmaE 1); 
2469  256 
by (asm_simp_tac (!simpset addsimps [left_inverse]) 1); 
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
767
diff
changeset

257 
qed "prod_lepoll_mono"; 
767  258 

259 
goalw CardinalArith.thy [cmult_def] 

260 
"!!K. [ K' le K; L' le L ] ==> (K' * L') le (K * L)"; 

2469  261 
by (safe_tac (!claset addSDs [le_subset_iff RS iffD1])); 
823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

262 
by (rtac well_ord_lepoll_imp_Card_le 1); 
767  263 
by (REPEAT (ares_tac [prod_lepoll_mono, subset_imp_lepoll] 2)); 
264 
by (REPEAT (ares_tac [well_ord_rmult, well_ord_Memrel] 1)); 

782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
767
diff
changeset

265 
qed "cmult_le_mono"; 
767  266 

267 
(*** Multiplication of finite cardinals is "ordinary" multiplication ***) 

437  268 

269 
goalw CardinalArith.thy [eqpoll_def] "succ(A)*B eqpoll B + A*B"; 

270 
by (rtac exI 1); 

1090
8ab69b3e396b
Changed some definitions and proofs to use patternmatching.
lcp
parents:
1075
diff
changeset

271 
by (res_inst_tac [("c", "%<x,y>. if(x=A, Inl(y), Inr(<x,y>))"), 
3840  272 
("d", "case(%y. <A,y>, %z. z)")] 
437  273 
lam_bijective 1); 
2469  274 
by (safe_tac (!claset addSEs [sumE])); 
437  275 
by (ALLGOALS 
2469  276 
(asm_simp_tac (!simpset addsimps [succI2, if_type, mem_imp_not_eq]))); 
760  277 
qed "prod_succ_eqpoll"; 
437  278 

279 
(*Unconditional version requires AC*) 

280 
goalw CardinalArith.thy [cmult_def, cadd_def] 

281 
"!!m n. [ Ord(m); Ord(n) ] ==> succ(m) * n = n + (m * n)"; 

282 
by (rtac (prod_succ_eqpoll RS cardinal_cong RS trans) 1); 

283 
by (rtac (cardinal_cong RS sym) 1); 

284 
by (rtac ([eqpoll_refl, well_ord_cardinal_eqpoll] MRS sum_eqpoll_cong) 1); 

285 
by (REPEAT (ares_tac [well_ord_rmult, well_ord_Memrel] 1)); 

760  286 
qed "cmult_succ_lemma"; 
437  287 

288 
val [mnat,nnat] = goal CardinalArith.thy 

289 
"[ m: nat; n: nat ] ==> m * n = m#*n"; 

290 
by (cut_facts_tac [nnat] 1); 

291 
by (nat_ind_tac "m" [mnat] 1); 

2469  292 
by (asm_simp_tac (!simpset addsimps [cmult_0]) 1); 
293 
by (asm_simp_tac (!simpset addsimps [nat_into_Ord, cmult_succ_lemma, 

1461  294 
nat_cadd_eq_add]) 1); 
760  295 
qed "nat_cmult_eq_mult"; 
437  296 

823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

297 
goal CardinalArith.thy "!!m n. Card(n) ==> 2 * n = n + n"; 
767  298 
by (asm_simp_tac 
2925  299 
(!simpset addsimps [Ord_0, Ord_succ, cmult_0, cmult_succ_lemma, 
300 
Card_is_Ord, 

301 
read_instantiate [("j","0")] cadd_commute, cadd_0]) 1); 

782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
767
diff
changeset

302 
qed "cmult_2"; 
767  303 

437  304 

305 
(*** Infinite Cardinals are Limit Ordinals ***) 

306 

571
0b03ce5b62f7
ZF/Cardinal: some results moved here from CardinalArith
lcp
parents:
523
diff
changeset

307 
(*This proof is modelled upon one assuming nat<=A, with injection 
0b03ce5b62f7
ZF/Cardinal: some results moved here from CardinalArith
lcp
parents:
523
diff
changeset

308 
lam z:cons(u,A). if(z=u, 0, if(z : nat, succ(z), z)) and inverse 
0b03ce5b62f7
ZF/Cardinal: some results moved here from CardinalArith
lcp
parents:
523
diff
changeset

309 
%y. if(y:nat, nat_case(u,%z.z,y), y). If f: inj(nat,A) then 
0b03ce5b62f7
ZF/Cardinal: some results moved here from CardinalArith
lcp
parents:
523
diff
changeset

310 
range(f) behaves like the natural numbers.*) 
516  311 
goalw CardinalArith.thy [lepoll_def] 
571
0b03ce5b62f7
ZF/Cardinal: some results moved here from CardinalArith
lcp
parents:
523
diff
changeset

312 
"!!i. nat lepoll A ==> cons(u,A) lepoll A"; 
0b03ce5b62f7
ZF/Cardinal: some results moved here from CardinalArith
lcp
parents:
523
diff
changeset

313 
by (etac exE 1); 
516  314 
by (res_inst_tac [("x", 
1461  315 
"lam z:cons(u,A). if(z=u, f`0, \ 
571
0b03ce5b62f7
ZF/Cardinal: some results moved here from CardinalArith
lcp
parents:
523
diff
changeset

316 
\ if(z: range(f), f`succ(converse(f)`z), z))")] exI 1); 
1461  317 
by (res_inst_tac [("d", "%y. if(y: range(f), \ 
3840  318 
\ nat_case(u, %z. f`z, converse(f)`y), y)")] 
516  319 
lam_injective 1); 
2925  320 
by (fast_tac (!claset addSIs [if_type, nat_succI, apply_type] 
321 
addIs [inj_is_fun, inj_converse_fun]) 1); 

516  322 
by (asm_simp_tac 
2469  323 
(!simpset addsimps [inj_is_fun RS apply_rangeI, 
1461  324 
inj_converse_fun RS apply_rangeI, 
325 
inj_converse_fun RS apply_funtype, 

326 
left_inverse, right_inverse, nat_0I, nat_succI, 

327 
nat_case_0, nat_case_succ] 

516  328 
setloop split_tac [expand_if]) 1); 
760  329 
qed "nat_cons_lepoll"; 
516  330 

571
0b03ce5b62f7
ZF/Cardinal: some results moved here from CardinalArith
lcp
parents:
523
diff
changeset

331 
goal CardinalArith.thy "!!i. nat lepoll A ==> cons(u,A) eqpoll A"; 
0b03ce5b62f7
ZF/Cardinal: some results moved here from CardinalArith
lcp
parents:
523
diff
changeset

332 
by (etac (nat_cons_lepoll RS eqpollI) 1); 
0b03ce5b62f7
ZF/Cardinal: some results moved here from CardinalArith
lcp
parents:
523
diff
changeset

333 
by (rtac (subset_consI RS subset_imp_lepoll) 1); 
760  334 
qed "nat_cons_eqpoll"; 
437  335 

571
0b03ce5b62f7
ZF/Cardinal: some results moved here from CardinalArith
lcp
parents:
523
diff
changeset

336 
(*Specialized version required below*) 
0b03ce5b62f7
ZF/Cardinal: some results moved here from CardinalArith
lcp
parents:
523
diff
changeset

337 
goalw CardinalArith.thy [succ_def] "!!i. nat <= A ==> succ(A) eqpoll A"; 
0b03ce5b62f7
ZF/Cardinal: some results moved here from CardinalArith
lcp
parents:
523
diff
changeset

338 
by (eresolve_tac [subset_imp_lepoll RS nat_cons_eqpoll] 1); 
760  339 
qed "nat_succ_eqpoll"; 
437  340 

488  341 
goalw CardinalArith.thy [InfCard_def] "InfCard(nat)"; 
2925  342 
by (blast_tac (!claset addIs [Card_nat, le_refl, Card_is_Ord]) 1); 
760  343 
qed "InfCard_nat"; 
488  344 

484  345 
goalw CardinalArith.thy [InfCard_def] "!!K. InfCard(K) ==> Card(K)"; 
437  346 
by (etac conjunct1 1); 
760  347 
qed "InfCard_is_Card"; 
437  348 

523  349 
goalw CardinalArith.thy [InfCard_def] 
350 
"!!K L. [ InfCard(K); Card(L) ] ==> InfCard(K Un L)"; 

2469  351 
by (asm_simp_tac (!simpset addsimps [Card_Un, Un_upper1_le RSN (2,le_trans), 
1461  352 
Card_is_Ord]) 1); 
760  353 
qed "InfCard_Un"; 
523  354 

437  355 
(*Kunen's Lemma 10.11*) 
484  356 
goalw CardinalArith.thy [InfCard_def] "!!K. InfCard(K) ==> Limit(K)"; 
437  357 
by (etac conjE 1); 
823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

358 
by (forward_tac [Card_is_Ord] 1); 
437  359 
by (rtac (ltI RS non_succ_LimitI) 1); 
360 
by (etac ([asm_rl, nat_0I] MRS (le_imp_subset RS subsetD)) 1); 

2469  361 
by (safe_tac (!claset addSDs [Limit_nat RS Limit_le_succD])); 
437  362 
by (rewtac Card_def); 
823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

363 
by (dtac trans 1); 
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

364 
by (etac (le_imp_subset RS nat_succ_eqpoll RS cardinal_cong) 1); 
3016  365 
by (etac (Ord_cardinal_le RS lt_trans2 RS lt_irrefl) 1); 
823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

366 
by (REPEAT (ares_tac [le_eqI, Ord_cardinal] 1)); 
760  367 
qed "InfCard_is_Limit"; 
437  368 

369 

370 
(*** An infinite cardinal equals its square (Kunen, Thm 10.12, page 29) ***) 

371 

372 
(*A general fact about ordermap*) 

373 
goalw Cardinal.thy [eqpoll_def] 

374 
"!!A. [ well_ord(A,r); x:A ] ==> ordermap(A,r)`x eqpoll pred(A,x,r)"; 

375 
by (rtac exI 1); 

2469  376 
by (asm_simp_tac (!simpset addsimps [ordermap_eq_image, well_ord_is_wf]) 1); 
467  377 
by (etac (ordermap_bij RS bij_is_inj RS restrict_bij RS bij_converse_bij) 1); 
437  378 
by (rtac pred_subset 1); 
760  379 
qed "ordermap_eqpoll_pred"; 
437  380 

381 
(** Establishing the wellordering **) 

382 

383 
goalw CardinalArith.thy [inj_def] 

1090
8ab69b3e396b
Changed some definitions and proofs to use patternmatching.
lcp
parents:
1075
diff
changeset

384 
"!!K. Ord(K) ==> (lam <x,y>:K*K. <x Un y, x, y>) : inj(K*K, K*K*K)"; 
2469  385 
by (fast_tac (!claset addss (!simpset) 
1461  386 
addIs [lam_type, Un_least_lt RS ltD, ltI]) 1); 
760  387 
qed "csquare_lam_inj"; 
437  388 

389 
goalw CardinalArith.thy [csquare_rel_def] 

484  390 
"!!K. Ord(K) ==> well_ord(K*K, csquare_rel(K))"; 
437  391 
by (rtac (csquare_lam_inj RS well_ord_rvimage) 1); 
392 
by (REPEAT (ares_tac [well_ord_rmult, well_ord_Memrel] 1)); 

760  393 
qed "well_ord_csquare"; 
437  394 

395 
(** Characterising initial segments of the wellordering **) 

396 

397 
goalw CardinalArith.thy [csquare_rel_def] 

484  398 
"!!K. [ x<K; y<K; z<K ] ==> \ 
399 
\ <<x,y>, <z,z>> : csquare_rel(K) > x le z & y le z"; 

437  400 
by (REPEAT (etac ltE 1)); 
2469  401 
by (asm_simp_tac (!simpset addsimps [rvimage_iff, rmult_iff, Memrel_iff, 
437  402 
Un_absorb, Un_least_mem_iff, ltD]) 1); 
2469  403 
by (safe_tac (!claset addSEs [mem_irrefl] 
437  404 
addSIs [Un_upper1_le, Un_upper2_le])); 
2469  405 
by (ALLGOALS (asm_simp_tac (!simpset addsimps [lt_def, succI2, Ord_succ]))); 
3736
39ee3d31cfbc
Much tidying including step_tac > clarify_tac or safe_tac; sometimes
paulson
parents:
3016
diff
changeset

406 
qed_spec_mp "csquareD"; 
437  407 

408 
goalw CardinalArith.thy [pred_def] 

484  409 
"!!K. z<K ==> pred(K*K, <z,z>, csquare_rel(K)) <= succ(z)*succ(z)"; 
2469  410 
by (safe_tac (claset_of"ZF" addSEs [SigmaE])); (*avoids using succCI,...*) 
437  411 
by (rtac (csquareD RS conjE) 1); 
412 
by (rewtac lt_def); 

413 
by (assume_tac 4); 

2925  414 
by (ALLGOALS Blast_tac); 
760  415 
qed "pred_csquare_subset"; 
437  416 

417 
goalw CardinalArith.thy [csquare_rel_def] 

823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

418 
"!!K. [ x<z; y<z; z<K ] ==> <<x,y>, <z,z>> : csquare_rel(K)"; 
484  419 
by (subgoals_tac ["x<K", "y<K"] 1); 
437  420 
by (REPEAT (eresolve_tac [asm_rl, lt_trans] 2)); 
421 
by (REPEAT (etac ltE 1)); 

2469  422 
by (asm_simp_tac (!simpset addsimps [rvimage_iff, rmult_iff, Memrel_iff, 
2493  423 
Un_absorb, Un_least_mem_iff, ltD]) 1); 
760  424 
qed "csquare_ltI"; 
437  425 

426 
(*Part of the traditional proof. UNUSED since it's harder to prove & apply *) 

427 
goalw CardinalArith.thy [csquare_rel_def] 

484  428 
"!!K. [ x le z; y le z; z<K ] ==> \ 
429 
\ <<x,y>, <z,z>> : csquare_rel(K)  x=z & y=z"; 

430 
by (subgoals_tac ["x<K", "y<K"] 1); 

437  431 
by (REPEAT (eresolve_tac [asm_rl, lt_trans1] 2)); 
432 
by (REPEAT (etac ltE 1)); 

2469  433 
by (asm_simp_tac (!simpset addsimps [rvimage_iff, rmult_iff, Memrel_iff, 
437  434 
Un_absorb, Un_least_mem_iff, ltD]) 1); 
435 
by (REPEAT_FIRST (etac succE)); 

436 
by (ALLGOALS 

2469  437 
(asm_simp_tac (!simpset addsimps [subset_Un_iff RS iff_sym, 
1461  438 
subset_Un_iff2 RS iff_sym, OrdmemD]))); 
760  439 
qed "csquare_or_eqI"; 
437  440 

441 
(** The cardinality of initial segments **) 

442 

443 
goal CardinalArith.thy 

846  444 
"!!K. [ Limit(K); x<K; y<K; z=succ(x Un y) ] ==> \ 
1461  445 
\ ordermap(K*K, csquare_rel(K)) ` <x,y> < \ 
484  446 
\ ordermap(K*K, csquare_rel(K)) ` <z,z>"; 
447 
by (subgoals_tac ["z<K", "well_ord(K*K, csquare_rel(K))"] 1); 

846  448 
by (etac (Limit_is_Ord RS well_ord_csquare) 2); 
2925  449 
by (blast_tac (!claset addSIs [Un_least_lt, Limit_has_succ]) 2); 
870  450 
by (rtac (csquare_ltI RS ordermap_mono RS ltI) 1); 
437  451 
by (etac well_ord_is_wf 4); 
452 
by (ALLGOALS 

2925  453 
(blast_tac (!claset addSIs [Un_upper1_le, Un_upper2_le, Ord_ordermap] 
437  454 
addSEs [ltE]))); 
870  455 
qed "ordermap_z_lt"; 
437  456 

484  457 
(*Kunen: "each <x,y>: K*K has no more than z*z predecessors..." (page 29) *) 
437  458 
goalw CardinalArith.thy [cmult_def] 
846  459 
"!!K. [ Limit(K); x<K; y<K; z=succ(x Un y) ] ==> \ 
484  460 
\  ordermap(K*K, csquare_rel(K)) ` <x,y>  le succ(z) * succ(z)"; 
767  461 
by (rtac (well_ord_rmult RS well_ord_lepoll_imp_Card_le) 1); 
437  462 
by (REPEAT (ares_tac [Ord_cardinal, well_ord_Memrel] 1)); 
484  463 
by (subgoals_tac ["z<K"] 1); 
2925  464 
by (blast_tac (!claset addSIs [Un_least_lt, Limit_has_succ]) 2); 
1609  465 
by (rtac (ordermap_z_lt RS leI RS le_imp_lepoll RS lepoll_trans) 1); 
437  466 
by (REPEAT_SOME assume_tac); 
467 
by (rtac (ordermap_eqpoll_pred RS eqpoll_imp_lepoll RS lepoll_trans) 1); 

846  468 
by (etac (Limit_is_Ord RS well_ord_csquare) 1); 
2925  469 
by (blast_tac (!claset addIs [ltD]) 1); 
437  470 
by (rtac (pred_csquare_subset RS subset_imp_lepoll RS lepoll_trans) 1 THEN 
471 
assume_tac 1); 

472 
by (REPEAT_FIRST (etac ltE)); 

473 
by (rtac (prod_eqpoll_cong RS eqpoll_sym RS eqpoll_imp_lepoll) 1); 

474 
by (REPEAT_FIRST (etac (Ord_succ RS Ord_cardinal_eqpoll))); 

760  475 
qed "ordermap_csquare_le"; 
437  476 

484  477 
(*Kunen: "... so the order type <= K" *) 
437  478 
goal CardinalArith.thy 
484  479 
"!!K. [ InfCard(K); ALL y:K. InfCard(y) > y * y = y ] ==> \ 
480 
\ ordertype(K*K, csquare_rel(K)) le K"; 

437  481 
by (forward_tac [InfCard_is_Card RS Card_is_Ord] 1); 
482 
by (rtac all_lt_imp_le 1); 

483 
by (assume_tac 1); 

484 
by (etac (well_ord_csquare RS Ord_ordertype) 1); 

485 
by (rtac Card_lt_imp_lt 1); 

486 
by (etac InfCard_is_Card 3); 

487 
by (etac ltE 2 THEN assume_tac 2); 

2469  488 
by (asm_full_simp_tac (!simpset addsimps [ordertype_unfold]) 1); 
489 
by (safe_tac (!claset addSEs [ltE])); 

437  490 
by (subgoals_tac ["Ord(xb)", "Ord(y)"] 1); 
491 
by (REPEAT (eresolve_tac [asm_rl, Ord_in_Ord] 2)); 

846  492 
by (rtac (InfCard_is_Limit RS ordermap_csquare_le RS lt_trans1) 1 THEN 
437  493 
REPEAT (ares_tac [refl] 1 ORELSE etac ltI 1)); 
494 
by (res_inst_tac [("i","xb Un y"), ("j","nat")] Ord_linear2 1 THEN 

495 
REPEAT (ares_tac [Ord_Un, Ord_nat] 1)); 

496 
(*the finite case: xb Un y < nat *) 

497 
by (res_inst_tac [("j", "nat")] lt_trans2 1); 

2469  498 
by (asm_full_simp_tac (!simpset addsimps [InfCard_def]) 2); 
437  499 
by (asm_full_simp_tac 
2469  500 
(!simpset addsimps [lt_def, nat_cmult_eq_mult, nat_succI, mult_type, 
1461  501 
nat_into_Card RS Card_cardinal_eq, Ord_nat]) 1); 
846  502 
(*case nat le (xb Un y) *) 
437  503 
by (asm_full_simp_tac 
2469  504 
(!simpset addsimps [le_imp_subset RS nat_succ_eqpoll RS cardinal_cong, 
1461  505 
le_succ_iff, InfCard_def, Card_cardinal, Un_least_lt, 
506 
Ord_Un, ltI, nat_le_cardinal, 

507 
Ord_cardinal_le RS lt_trans1 RS ltD]) 1); 

760  508 
qed "ordertype_csquare_le"; 
437  509 

510 
(*Main result: Kunen's Theorem 10.12*) 

484  511 
goal CardinalArith.thy "!!K. InfCard(K) ==> K * K = K"; 
437  512 
by (forward_tac [InfCard_is_Card RS Card_is_Ord] 1); 
513 
by (etac rev_mp 1); 

484  514 
by (trans_ind_tac "K" [] 1); 
437  515 
by (rtac impI 1); 
516 
by (rtac le_anti_sym 1); 

517 
by (etac (InfCard_is_Card RS cmult_square_le) 2); 

518 
by (rtac (ordertype_csquare_le RSN (2, le_trans)) 1); 

519 
by (assume_tac 2); 

520 
by (assume_tac 2); 

521 
by (asm_simp_tac 

2469  522 
(!simpset addsimps [cmult_def, Ord_cardinal_le, 
1461  523 
well_ord_csquare RS ordermap_bij RS 
524 
bij_imp_eqpoll RS cardinal_cong, 

437  525 
well_ord_csquare RS Ord_ordertype]) 1); 
760  526 
qed "InfCard_csquare_eq"; 
484  527 

767  528 
(*Corollary for arbitrary wellordered sets (all sets, assuming AC)*) 
484  529 
goal CardinalArith.thy 
530 
"!!A. [ well_ord(A,r); InfCard(A) ] ==> A*A eqpoll A"; 

531 
by (resolve_tac [prod_eqpoll_cong RS eqpoll_trans] 1); 

532 
by (REPEAT (etac (well_ord_cardinal_eqpoll RS eqpoll_sym) 1)); 

823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

533 
by (rtac well_ord_cardinal_eqE 1); 
484  534 
by (REPEAT (ares_tac [Ord_cardinal, well_ord_rmult, well_ord_Memrel] 1)); 
2469  535 
by (asm_simp_tac (!simpset addsimps [symmetric cmult_def, InfCard_csquare_eq]) 1); 
760  536 
qed "well_ord_InfCard_square_eq"; 
484  537 

767  538 
(** Toward's Kunen's Corollary 10.13 (1) **) 
539 

540 
goal CardinalArith.thy "!!K. [ InfCard(K); L le K; 0<L ] ==> K * L = K"; 

823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

541 
by (rtac le_anti_sym 1); 
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

542 
by (etac ltE 2 THEN 
767  543 
REPEAT (ares_tac [cmult_le_self, InfCard_is_Card] 2)); 
544 
by (forward_tac [InfCard_is_Card RS Card_is_Ord RS le_refl] 1); 

545 
by (resolve_tac [cmult_le_mono RS le_trans] 1 THEN REPEAT (assume_tac 1)); 

2469  546 
by (asm_simp_tac (!simpset addsimps [InfCard_csquare_eq]) 1); 
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
767
diff
changeset

547 
qed "InfCard_le_cmult_eq"; 
767  548 

549 
(*Corollary 10.13 (1), for cardinal multiplication*) 

550 
goal CardinalArith.thy 

551 
"!!K. [ InfCard(K); InfCard(L) ] ==> K * L = K Un L"; 

552 
by (res_inst_tac [("i","K"),("j","L")] Ord_linear_le 1); 

553 
by (typechk_tac [InfCard_is_Card, Card_is_Ord]); 

554 
by (resolve_tac [cmult_commute RS ssubst] 1); 

555 
by (resolve_tac [Un_commute RS ssubst] 1); 

556 
by (ALLGOALS 

557 
(asm_simp_tac 

2469  558 
(!simpset addsimps [InfCard_is_Limit RS Limit_has_0, InfCard_le_cmult_eq, 
1461  559 
subset_Un_iff2 RS iffD1, le_imp_subset]))); 
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
767
diff
changeset

560 
qed "InfCard_cmult_eq"; 
767  561 

562 
(*This proof appear to be the simplest!*) 

563 
goal CardinalArith.thy "!!K. InfCard(K) ==> K + K = K"; 

564 
by (asm_simp_tac 

2469  565 
(!simpset addsimps [cmult_2 RS sym, InfCard_is_Card, cmult_commute]) 1); 
823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

566 
by (rtac InfCard_le_cmult_eq 1); 
767  567 
by (typechk_tac [Ord_0, le_refl, leI]); 
568 
by (typechk_tac [InfCard_is_Limit, Limit_has_0, Limit_has_succ]); 

782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
767
diff
changeset

569 
qed "InfCard_cdouble_eq"; 
767  570 

571 
(*Corollary 10.13 (1), for cardinal addition*) 

572 
goal CardinalArith.thy "!!K. [ InfCard(K); L le K ] ==> K + L = K"; 

823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

573 
by (rtac le_anti_sym 1); 
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

574 
by (etac ltE 2 THEN 
767  575 
REPEAT (ares_tac [cadd_le_self, InfCard_is_Card] 2)); 
576 
by (forward_tac [InfCard_is_Card RS Card_is_Ord RS le_refl] 1); 

577 
by (resolve_tac [cadd_le_mono RS le_trans] 1 THEN REPEAT (assume_tac 1)); 

2469  578 
by (asm_simp_tac (!simpset addsimps [InfCard_cdouble_eq]) 1); 
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
767
diff
changeset

579 
qed "InfCard_le_cadd_eq"; 
767  580 

581 
goal CardinalArith.thy 

582 
"!!K. [ InfCard(K); InfCard(L) ] ==> K + L = K Un L"; 

583 
by (res_inst_tac [("i","K"),("j","L")] Ord_linear_le 1); 

584 
by (typechk_tac [InfCard_is_Card, Card_is_Ord]); 

585 
by (resolve_tac [cadd_commute RS ssubst] 1); 

586 
by (resolve_tac [Un_commute RS ssubst] 1); 

587 
by (ALLGOALS 

588 
(asm_simp_tac 

2469  589 
(!simpset addsimps [InfCard_le_cadd_eq, 
1461  590 
subset_Un_iff2 RS iffD1, le_imp_subset]))); 
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
767
diff
changeset

591 
qed "InfCard_cadd_eq"; 
767  592 

593 
(*The other part, Corollary 10.13 (2), refers to the cardinality of the set 

594 
of all ntuples of elements of K. A better version for the Isabelle theory 

595 
might be InfCard(K) ==> list(K) = K. 

596 
*) 

484  597 

598 
(*** For every cardinal number there exists a greater one 

599 
[Kunen's Theorem 10.16, which would be trivial using AC] ***) 

600 

601 
goalw CardinalArith.thy [jump_cardinal_def] "Ord(jump_cardinal(K))"; 

602 
by (rtac (Ord_is_Transset RSN (2,OrdI)) 1); 

2925  603 
by (blast_tac (!claset addSIs [Ord_ordertype]) 2); 
823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

604 
by (rewtac Transset_def); 
1075
848bf2e18dff
Modified proofs for new claset primitives. The problem is that they enforce
lcp
parents:
989
diff
changeset

605 
by (safe_tac subset_cs); 
2469  606 
by (asm_full_simp_tac (!simpset addsimps [ordertype_pred_unfold]) 1); 
607 
by (safe_tac (!claset)); 

823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

608 
by (rtac UN_I 1); 
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

609 
by (rtac ReplaceI 2); 
2925  610 
by (ALLGOALS (blast_tac (!claset addIs [well_ord_subset] addSEs [predE]))); 
760  611 
qed "Ord_jump_cardinal"; 
484  612 

613 
(*Allows selective unfolding. Less work than deriving intro/elim rules*) 

614 
goalw CardinalArith.thy [jump_cardinal_def] 

615 
"i : jump_cardinal(K) <> \ 

616 
\ (EX r X. r <= K*K & X <= K & well_ord(X,r) & i = ordertype(X,r))"; 

1461  617 
by (fast_tac subset_cs 1); (*It's vital to avoid reasoning about <=*) 
760  618 
qed "jump_cardinal_iff"; 
484  619 

620 
(*The easy part of Theorem 10.16: jump_cardinal(K) exceeds K*) 

621 
goal CardinalArith.thy "!!K. Ord(K) ==> K < jump_cardinal(K)"; 

622 
by (resolve_tac [Ord_jump_cardinal RSN (2,ltI)] 1); 

623 
by (resolve_tac [jump_cardinal_iff RS iffD2] 1); 

624 
by (REPEAT_FIRST (ares_tac [exI, conjI, well_ord_Memrel])); 

823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

625 
by (rtac subset_refl 2); 
2469  626 
by (asm_simp_tac (!simpset addsimps [Memrel_def, subset_iff]) 1); 
627 
by (asm_simp_tac (!simpset addsimps [ordertype_Memrel]) 1); 

760  628 
qed "K_lt_jump_cardinal"; 
484  629 

630 
(*The proof by contradiction: the bijection f yields a wellordering of X 

631 
whose ordertype is jump_cardinal(K). *) 

632 
goal CardinalArith.thy 

1461  633 
"!!K. [ well_ord(X,r); r <= K * K; X <= K; \ 
634 
\ f : bij(ordertype(X,r), jump_cardinal(K)) \ 

635 
\ ] ==> jump_cardinal(K) : jump_cardinal(K)"; 

484  636 
by (subgoal_tac "f O ordermap(X,r): bij(X, jump_cardinal(K))" 1); 
637 
by (REPEAT (ares_tac [comp_bij, ordermap_bij] 2)); 

638 
by (resolve_tac [jump_cardinal_iff RS iffD2] 1); 

639 
by (REPEAT_FIRST (resolve_tac [exI, conjI])); 

640 
by (rtac ([rvimage_type, Sigma_mono] MRS subset_trans) 1); 

641 
by (REPEAT (assume_tac 1)); 

642 
by (etac (bij_is_inj RS well_ord_rvimage) 1); 

643 
by (rtac (Ord_jump_cardinal RS well_ord_Memrel) 1); 

644 
by (asm_simp_tac 

2469  645 
(!simpset addsimps [well_ord_Memrel RSN (2, bij_ordertype_vimage), 
1461  646 
ordertype_Memrel, Ord_jump_cardinal]) 1); 
760  647 
qed "Card_jump_cardinal_lemma"; 
484  648 

649 
(*The hard part of Theorem 10.16: jump_cardinal(K) is itself a cardinal*) 

650 
goal CardinalArith.thy "Card(jump_cardinal(K))"; 

651 
by (rtac (Ord_jump_cardinal RS CardI) 1); 

823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

652 
by (rewtac eqpoll_def); 
2469  653 
by (safe_tac (!claset addSDs [ltD, jump_cardinal_iff RS iffD1])); 
484  654 
by (REPEAT (ares_tac [Card_jump_cardinal_lemma RS mem_irrefl] 1)); 
760  655 
qed "Card_jump_cardinal"; 
484  656 

657 
(*** Basic properties of successor cardinals ***) 

658 

659 
goalw CardinalArith.thy [csucc_def] 

660 
"!!K. Ord(K) ==> Card(csucc(K)) & K < csucc(K)"; 

661 
by (rtac LeastI 1); 

662 
by (REPEAT (ares_tac [conjI, Card_jump_cardinal, K_lt_jump_cardinal, 

1461  663 
Ord_jump_cardinal] 1)); 
760  664 
qed "csucc_basic"; 
484  665 

800
23f55b829ccb
Limit_csucc: moved to InfDatatype and proved explicitly in
lcp
parents:
782
diff
changeset

666 
bind_thm ("Card_csucc", csucc_basic RS conjunct1); 
484  667 

800
23f55b829ccb
Limit_csucc: moved to InfDatatype and proved explicitly in
lcp
parents:
782
diff
changeset

668 
bind_thm ("lt_csucc", csucc_basic RS conjunct2); 
484  669 

517  670 
goal CardinalArith.thy "!!K. Ord(K) ==> 0 < csucc(K)"; 
671 
by (resolve_tac [[Ord_0_le, lt_csucc] MRS lt_trans1] 1); 

672 
by (REPEAT (assume_tac 1)); 

760  673 
qed "Ord_0_lt_csucc"; 
517  674 

484  675 
goalw CardinalArith.thy [csucc_def] 
676 
"!!K L. [ Card(L); K<L ] ==> csucc(K) le L"; 

677 
by (rtac Least_le 1); 

678 
by (REPEAT (ares_tac [conjI, Card_is_Ord] 1)); 

760  679 
qed "csucc_le"; 
484  680 

681 
goal CardinalArith.thy 

682 
"!!K. [ Ord(i); Card(K) ] ==> i < csucc(K) <> i le K"; 

823
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

683 
by (rtac iffI 1); 
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

684 
by (rtac Card_lt_imp_lt 2); 
33dc37d46296
Changed succ(1) to 2 in cmult_2; Simplified proof of InfCard_is_Limit
lcp
parents:
800
diff
changeset

685 
by (etac lt_trans1 2); 
484  686 
by (REPEAT (ares_tac [lt_csucc, Card_csucc, Card_is_Ord] 2)); 
687 
by (resolve_tac [notI RS not_lt_imp_le] 1); 

688 
by (resolve_tac [Card_cardinal RS csucc_le RS lt_trans1 RS lt_irrefl] 1); 

689 
by (assume_tac 1); 

690 
by (resolve_tac [Ord_cardinal_le RS lt_trans1] 1); 

691 
by (REPEAT (ares_tac [Ord_cardinal] 1 

692 
ORELSE eresolve_tac [ltE, Card_is_Ord] 1)); 

760  693 
qed "lt_csucc_iff"; 
484  694 

695 
goal CardinalArith.thy 

696 
"!!K' K. [ Card(K'); Card(K) ] ==> K' < csucc(K) <> K' le K"; 

697 
by (asm_simp_tac 

2469  698 
(!simpset addsimps [lt_csucc_iff, Card_cardinal_eq, Card_is_Ord]) 1); 
760  699 
qed "Card_lt_csucc_iff"; 
488  700 

701 
goalw CardinalArith.thy [InfCard_def] 

702 
"!!K. InfCard(K) ==> InfCard(csucc(K))"; 

2469  703 
by (asm_simp_tac (!simpset addsimps [Card_csucc, Card_is_Ord, 
1461  704 
lt_csucc RS leI RSN (2,le_trans)]) 1); 
760  705 
qed "InfCard_csucc"; 
517  706 

1609  707 

708 
(*** Finite sets ***) 

709 

710 
goal CardinalArith.thy 

711 
"!!n. n: nat ==> ALL A. A eqpoll n > A : Fin(A)"; 

1622  712 
by (etac nat_induct 1); 
2469  713 
by (simp_tac (!simpset addsimps (eqpoll_0_iff::Fin.intrs)) 1); 
3736
39ee3d31cfbc
Much tidying including step_tac > clarify_tac or safe_tac; sometimes
paulson
parents:
3016
diff
changeset

714 
by (Clarify_tac 1); 
1609  715 
by (subgoal_tac "EX u. u:A" 1); 
1622  716 
by (etac exE 1); 
1609  717 
by (resolve_tac [Diff_sing_eqpoll RS revcut_rl] 1); 
718 
by (assume_tac 2); 

719 
by (assume_tac 1); 

720 
by (res_inst_tac [("b", "A")] (cons_Diff RS subst) 1); 

721 
by (assume_tac 1); 

722 
by (resolve_tac [Fin.consI] 1); 

2925  723 
by (Blast_tac 1); 
724 
by (blast_tac (!claset addIs [subset_consI RS Fin_mono RS subsetD]) 1); 

1609  725 
(*Now for the lemma assumed above*) 
1622  726 
by (rewtac eqpoll_def); 
2925  727 
by (blast_tac (!claset addIs [bij_converse_bij RS bij_is_fun RS apply_type]) 1); 
1609  728 
val lemma = result(); 
729 

730 
goalw CardinalArith.thy [Finite_def] "!!A. Finite(A) ==> A : Fin(A)"; 

2925  731 
by (blast_tac (!claset addIs [lemma RS spec RS mp]) 1); 
1609  732 
qed "Finite_into_Fin"; 
733 

734 
goal CardinalArith.thy "!!A. A : Fin(U) ==> Finite(A)"; 

2469  735 
by (fast_tac (!claset addSIs [Finite_0, Finite_cons] addEs [Fin.induct]) 1); 
1609  736 
qed "Fin_into_Finite"; 
737 

738 
goal CardinalArith.thy "Finite(A) <> A : Fin(A)"; 

2925  739 
by (blast_tac (!claset addIs [Finite_into_Fin, Fin_into_Finite]) 1); 
1609  740 
qed "Finite_Fin_iff"; 
741 

742 
goal CardinalArith.thy 

743 
"!!A. [ Finite(A); Finite(B) ] ==> Finite(A Un B)"; 

2925  744 
by (blast_tac (!claset addSIs [Fin_into_Finite, Fin_UnI] 
745 
addSDs [Finite_into_Fin] 

746 
addIs [Un_upper1 RS Fin_mono RS subsetD, 

747 
Un_upper2 RS Fin_mono RS subsetD]) 1); 

1609  748 
qed "Finite_Un"; 
749 

750 

751 
(** Removing elements from a finite set decreases its cardinality **) 

752 

753 
goal CardinalArith.thy 

754 
"!!A. A: Fin(U) ==> x~:A > ~ cons(x,A) lepoll A"; 

1622  755 
by (etac Fin_induct 1); 
2469  756 
by (simp_tac (!simpset addsimps [lepoll_0_iff]) 1); 
1609  757 
by (subgoal_tac "cons(x,cons(xa,y)) = cons(xa,cons(x,y))" 1); 
2469  758 
by (Asm_simp_tac 1); 
2925  759 
by (blast_tac (!claset addSDs [cons_lepoll_consD]) 1); 
760 
by (Blast_tac 1); 

1609  761 
qed "Fin_imp_not_cons_lepoll"; 
762 

763 
goal CardinalArith.thy 

764 
"!!a A. [ Finite(A); a~:A ] ==> cons(a,A) = succ(A)"; 

1622  765 
by (rewtac cardinal_def); 
766 
by (rtac Least_equality 1); 

1609  767 
by (fold_tac [cardinal_def]); 
2469  768 
by (simp_tac (!simpset addsimps [succ_def]) 1); 
2925  769 
by (blast_tac (!claset addIs [cons_eqpoll_cong, well_ord_cardinal_eqpoll] 
1609  770 
addSEs [mem_irrefl] 
771 
addSDs [Finite_imp_well_ord]) 1); 

2925  772 
by (blast_tac (!claset addIs [Ord_succ, Card_cardinal, Card_is_Ord]) 1); 
1622  773 
by (rtac notI 1); 
1609  774 
by (resolve_tac [Finite_into_Fin RS Fin_imp_not_cons_lepoll RS mp RS notE] 1); 
775 
by (assume_tac 1); 

776 
by (assume_tac 1); 

777 
by (eresolve_tac [eqpoll_sym RS eqpoll_imp_lepoll RS lepoll_trans] 1); 

778 
by (eresolve_tac [le_imp_lepoll RS lepoll_trans] 1); 

2925  779 
by (blast_tac (!claset addIs [well_ord_cardinal_eqpoll RS eqpoll_imp_lepoll] 
1609  780 
addSDs [Finite_imp_well_ord]) 1); 
781 
qed "Finite_imp_cardinal_cons"; 

782 

783 

1622  784 
goal CardinalArith.thy "!!a A. [ Finite(A); a:A ] ==> succ(A{a}) = A"; 
1609  785 
by (res_inst_tac [("b", "A")] (cons_Diff RS subst) 1); 
786 
by (assume_tac 1); 

2469  787 
by (asm_simp_tac (!simpset addsimps [Finite_imp_cardinal_cons, 
1622  788 
Diff_subset RS subset_Finite]) 1); 
2469  789 
by (asm_simp_tac (!simpset addsimps [cons_Diff]) 1); 
1622  790 
qed "Finite_imp_succ_cardinal_Diff"; 
791 

792 
goal CardinalArith.thy "!!a A. [ Finite(A); a:A ] ==> A{a} < A"; 

793 
by (rtac succ_leE 1); 

2469  794 
by (asm_simp_tac (!simpset addsimps [Finite_imp_succ_cardinal_Diff, 
1622  795 
Ord_cardinal RS le_refl]) 1); 
1609  796 
qed "Finite_imp_cardinal_Diff"; 
797 

798 

799 
(** Thanks to Krzysztof Grabczewski **) 

800 

3887  801 
val nat_implies_well_ord = 
802 
(transfer CardinalArith.thy nat_into_Ord) RS well_ord_Memrel; 

1609  803 

804 
goal CardinalArith.thy "!!m n. [ m:nat; n:nat ] ==> m + n eqpoll m #+ n"; 

805 
by (rtac eqpoll_trans 1); 

806 
by (eresolve_tac [nat_implies_well_ord RS ( 

807 
nat_implies_well_ord RSN (2, 

808 
well_ord_radd RS well_ord_cardinal_eqpoll)) RS eqpoll_sym] 1 

809 
THEN (assume_tac 1)); 

810 
by (eresolve_tac [nat_cadd_eq_add RS subst] 1 THEN (assume_tac 1)); 

2469  811 
by (asm_full_simp_tac (!simpset addsimps [cadd_def, eqpoll_refl]) 1); 
1609  812 
qed "nat_sum_eqpoll_sum"; 
813 

814 
goal Nat.thy "!!m. [ m le n; n:nat ] ==> m:nat"; 

2925  815 
by (blast_tac (!claset addSDs [nat_succI RS (Ord_nat RSN (2, OrdmemD))] 
1609  816 
addSEs [ltE]) 1); 
817 
qed "le_in_nat"; 

818 