author | wenzelm |
Fri, 09 Oct 2015 20:26:03 +0200 | |
changeset 61378 | 3e04c9ca001a |
parent 60770 | 240563fbf41d |
child 61394 | 6142b282b164 |
permissions | -rw-r--r-- |
1478 | 1 |
(* Title: ZF/Cardinal.thy |
2 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
435 | 3 |
Copyright 1994 University of Cambridge |
13328 | 4 |
*) |
13221 | 5 |
|
60770 | 6 |
section\<open>Cardinal Numbers Without the Axiom of Choice\<close> |
435 | 7 |
|
26056
6a0801279f4c
Made theory names in ZF disjoint from HOL theory names to allow loading both developments
krauss
parents:
24893
diff
changeset
|
8 |
theory Cardinal imports OrderType Finite Nat_ZF Sum begin |
13221 | 9 |
|
24893 | 10 |
definition |
435 | 11 |
(*least ordinal operator*) |
24893 | 12 |
Least :: "(i=>o) => i" (binder "LEAST " 10) where |
46820 | 13 |
"Least(P) == THE i. Ord(i) & P(i) & (\<forall>j. j<i \<longrightarrow> ~P(j))" |
435 | 14 |
|
24893 | 15 |
definition |
16 |
eqpoll :: "[i,i] => o" (infixl "eqpoll" 50) where |
|
46953 | 17 |
"A eqpoll B == \<exists>f. f \<in> bij(A,B)" |
435 | 18 |
|
24893 | 19 |
definition |
20 |
lepoll :: "[i,i] => o" (infixl "lepoll" 50) where |
|
46953 | 21 |
"A lepoll B == \<exists>f. f \<in> inj(A,B)" |
435 | 22 |
|
24893 | 23 |
definition |
24 |
lesspoll :: "[i,i] => o" (infixl "lesspoll" 50) where |
|
13221 | 25 |
"A lesspoll B == A lepoll B & ~(A eqpoll B)" |
832 | 26 |
|
24893 | 27 |
definition |
28 |
cardinal :: "i=>i" ("|_|") where |
|
46847 | 29 |
"|A| == (LEAST i. i eqpoll A)" |
435 | 30 |
|
24893 | 31 |
definition |
32 |
Finite :: "i=>o" where |
|
46820 | 33 |
"Finite(A) == \<exists>n\<in>nat. A eqpoll n" |
435 | 34 |
|
24893 | 35 |
definition |
36 |
Card :: "i=>o" where |
|
13221 | 37 |
"Card(i) == (i = |i|)" |
435 | 38 |
|
21524 | 39 |
notation (xsymbols) |
40 |
eqpoll (infixl "\<approx>" 50) and |
|
41 |
lepoll (infixl "\<lesssim>" 50) and |
|
42 |
lesspoll (infixl "\<prec>" 50) and |
|
43 |
Least (binder "\<mu>" 10) |
|
13221 | 44 |
|
14565 | 45 |
|
60770 | 46 |
subsection\<open>The Schroeder-Bernstein Theorem\<close> |
47 |
text\<open>See Davey and Priestly, page 106\<close> |
|
13221 | 48 |
|
49 |
(** Lemma: Banach's Decomposition Theorem **) |
|
50 |
||
51 |
lemma decomp_bnd_mono: "bnd_mono(X, %W. X - g``(Y - f``W))" |
|
52 |
by (rule bnd_monoI, blast+) |
|
53 |
||
54 |
lemma Banach_last_equation: |
|
46953 | 55 |
"g \<in> Y->X |
46820 | 56 |
==> g``(Y - f`` lfp(X, %W. X - g``(Y - f``W))) = |
57 |
X - lfp(X, %W. X - g``(Y - f``W))" |
|
59788 | 58 |
apply (rule_tac P = "%u. v = X-u" for v |
13221 | 59 |
in decomp_bnd_mono [THEN lfp_unfold, THEN ssubst]) |
60 |
apply (simp add: double_complement fun_is_rel [THEN image_subset]) |
|
61 |
done |
|
62 |
||
63 |
lemma decomposition: |
|
46953 | 64 |
"[| f \<in> X->Y; g \<in> Y->X |] ==> |
46820 | 65 |
\<exists>XA XB YA YB. (XA \<inter> XB = 0) & (XA \<union> XB = X) & |
66 |
(YA \<inter> YB = 0) & (YA \<union> YB = Y) & |
|
13221 | 67 |
f``XA=YA & g``YB=XB" |
68 |
apply (intro exI conjI) |
|
69 |
apply (rule_tac [6] Banach_last_equation) |
|
70 |
apply (rule_tac [5] refl) |
|
46820 | 71 |
apply (assumption | |
13221 | 72 |
rule Diff_disjoint Diff_partition fun_is_rel image_subset lfp_subset)+ |
73 |
done |
|
74 |
||
75 |
lemma schroeder_bernstein: |
|
46953 | 76 |
"[| f \<in> inj(X,Y); g \<in> inj(Y,X) |] ==> \<exists>h. h \<in> bij(X,Y)" |
46820 | 77 |
apply (insert decomposition [of f X Y g]) |
13221 | 78 |
apply (simp add: inj_is_fun) |
79 |
apply (blast intro!: restrict_bij bij_disjoint_Un intro: bij_converse_bij) |
|
46820 | 80 |
(* The instantiation of exI to @{term"restrict(f,XA) \<union> converse(restrict(g,YB))"} |
13221 | 81 |
is forced by the context!! *) |
82 |
done |
|
83 |
||
84 |
||
85 |
(** Equipollence is an equivalence relation **) |
|
86 |
||
46953 | 87 |
lemma bij_imp_eqpoll: "f \<in> bij(A,B) ==> A \<approx> B" |
13221 | 88 |
apply (unfold eqpoll_def) |
89 |
apply (erule exI) |
|
90 |
done |
|
91 |
||
92 |
(*A eqpoll A*) |
|
45602 | 93 |
lemmas eqpoll_refl = id_bij [THEN bij_imp_eqpoll, simp] |
13221 | 94 |
|
95 |
lemma eqpoll_sym: "X \<approx> Y ==> Y \<approx> X" |
|
96 |
apply (unfold eqpoll_def) |
|
97 |
apply (blast intro: bij_converse_bij) |
|
98 |
done |
|
99 |
||
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
100 |
lemma eqpoll_trans [trans]: |
13221 | 101 |
"[| X \<approx> Y; Y \<approx> Z |] ==> X \<approx> Z" |
102 |
apply (unfold eqpoll_def) |
|
103 |
apply (blast intro: comp_bij) |
|
104 |
done |
|
105 |
||
106 |
(** Le-pollence is a partial ordering **) |
|
107 |
||
108 |
lemma subset_imp_lepoll: "X<=Y ==> X \<lesssim> Y" |
|
109 |
apply (unfold lepoll_def) |
|
110 |
apply (rule exI) |
|
111 |
apply (erule id_subset_inj) |
|
112 |
done |
|
113 |
||
45602 | 114 |
lemmas lepoll_refl = subset_refl [THEN subset_imp_lepoll, simp] |
13221 | 115 |
|
45602 | 116 |
lemmas le_imp_lepoll = le_imp_subset [THEN subset_imp_lepoll] |
13221 | 117 |
|
118 |
lemma eqpoll_imp_lepoll: "X \<approx> Y ==> X \<lesssim> Y" |
|
119 |
by (unfold eqpoll_def bij_def lepoll_def, blast) |
|
120 |
||
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
121 |
lemma lepoll_trans [trans]: "[| X \<lesssim> Y; Y \<lesssim> Z |] ==> X \<lesssim> Z" |
13221 | 122 |
apply (unfold lepoll_def) |
123 |
apply (blast intro: comp_inj) |
|
124 |
done |
|
125 |
||
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
126 |
lemma eq_lepoll_trans [trans]: "[| X \<approx> Y; Y \<lesssim> Z |] ==> X \<lesssim> Z" |
46953 | 127 |
by (blast intro: eqpoll_imp_lepoll lepoll_trans) |
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
128 |
|
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
129 |
lemma lepoll_eq_trans [trans]: "[| X \<lesssim> Y; Y \<approx> Z |] ==> X \<lesssim> Z" |
46953 | 130 |
by (blast intro: eqpoll_imp_lepoll lepoll_trans) |
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
131 |
|
13221 | 132 |
(*Asymmetry law*) |
133 |
lemma eqpollI: "[| X \<lesssim> Y; Y \<lesssim> X |] ==> X \<approx> Y" |
|
134 |
apply (unfold lepoll_def eqpoll_def) |
|
135 |
apply (elim exE) |
|
136 |
apply (rule schroeder_bernstein, assumption+) |
|
137 |
done |
|
138 |
||
139 |
lemma eqpollE: |
|
140 |
"[| X \<approx> Y; [| X \<lesssim> Y; Y \<lesssim> X |] ==> P |] ==> P" |
|
46820 | 141 |
by (blast intro: eqpoll_imp_lepoll eqpoll_sym) |
13221 | 142 |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
46820
diff
changeset
|
143 |
lemma eqpoll_iff: "X \<approx> Y \<longleftrightarrow> X \<lesssim> Y & Y \<lesssim> X" |
13221 | 144 |
by (blast intro: eqpollI elim!: eqpollE) |
145 |
||
146 |
lemma lepoll_0_is_0: "A \<lesssim> 0 ==> A = 0" |
|
147 |
apply (unfold lepoll_def inj_def) |
|
148 |
apply (blast dest: apply_type) |
|
149 |
done |
|
150 |
||
46820 | 151 |
(*@{term"0 \<lesssim> Y"}*) |
45602 | 152 |
lemmas empty_lepollI = empty_subsetI [THEN subset_imp_lepoll] |
13221 | 153 |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
46820
diff
changeset
|
154 |
lemma lepoll_0_iff: "A \<lesssim> 0 \<longleftrightarrow> A=0" |
13221 | 155 |
by (blast intro: lepoll_0_is_0 lepoll_refl) |
156 |
||
46820 | 157 |
lemma Un_lepoll_Un: |
158 |
"[| A \<lesssim> B; C \<lesssim> D; B \<inter> D = 0 |] ==> A \<union> C \<lesssim> B \<union> D" |
|
13221 | 159 |
apply (unfold lepoll_def) |
160 |
apply (blast intro: inj_disjoint_Un) |
|
161 |
done |
|
162 |
||
163 |
(*A eqpoll 0 ==> A=0*) |
|
45602 | 164 |
lemmas eqpoll_0_is_0 = eqpoll_imp_lepoll [THEN lepoll_0_is_0] |
13221 | 165 |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
46820
diff
changeset
|
166 |
lemma eqpoll_0_iff: "A \<approx> 0 \<longleftrightarrow> A=0" |
13221 | 167 |
by (blast intro: eqpoll_0_is_0 eqpoll_refl) |
168 |
||
46820 | 169 |
lemma eqpoll_disjoint_Un: |
170 |
"[| A \<approx> B; C \<approx> D; A \<inter> C = 0; B \<inter> D = 0 |] |
|
171 |
==> A \<union> C \<approx> B \<union> D" |
|
13221 | 172 |
apply (unfold eqpoll_def) |
173 |
apply (blast intro: bij_disjoint_Un) |
|
174 |
done |
|
175 |
||
176 |
||
60770 | 177 |
subsection\<open>lesspoll: contributions by Krzysztof Grabczewski\<close> |
13221 | 178 |
|
179 |
lemma lesspoll_not_refl: "~ (i \<prec> i)" |
|
46820 | 180 |
by (simp add: lesspoll_def) |
13221 | 181 |
|
182 |
lemma lesspoll_irrefl [elim!]: "i \<prec> i ==> P" |
|
46820 | 183 |
by (simp add: lesspoll_def) |
13221 | 184 |
|
185 |
lemma lesspoll_imp_lepoll: "A \<prec> B ==> A \<lesssim> B" |
|
186 |
by (unfold lesspoll_def, blast) |
|
187 |
||
46820 | 188 |
lemma lepoll_well_ord: "[| A \<lesssim> B; well_ord(B,r) |] ==> \<exists>s. well_ord(A,s)" |
13221 | 189 |
apply (unfold lepoll_def) |
190 |
apply (blast intro: well_ord_rvimage) |
|
191 |
done |
|
192 |
||
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
46820
diff
changeset
|
193 |
lemma lepoll_iff_leqpoll: "A \<lesssim> B \<longleftrightarrow> A \<prec> B | A \<approx> B" |
13221 | 194 |
apply (unfold lesspoll_def) |
195 |
apply (blast intro!: eqpollI elim!: eqpollE) |
|
196 |
done |
|
197 |
||
46820 | 198 |
lemma inj_not_surj_succ: |
47042 | 199 |
assumes fi: "f \<in> inj(A, succ(m))" and fns: "f \<notin> surj(A, succ(m))" |
200 |
shows "\<exists>f. f \<in> inj(A,m)" |
|
201 |
proof - |
|
202 |
from fi [THEN inj_is_fun] fns |
|
203 |
obtain y where y: "y \<in> succ(m)" "\<And>x. x\<in>A \<Longrightarrow> f ` x \<noteq> y" |
|
204 |
by (auto simp add: surj_def) |
|
205 |
show ?thesis |
|
206 |
proof |
|
207 |
show "(\<lambda>z\<in>A. if f`z = m then y else f`z) \<in> inj(A, m)" using y fi |
|
208 |
by (simp add: inj_def) |
|
209 |
(auto intro!: if_type [THEN lam_type] intro: Pi_type dest: apply_funtype) |
|
210 |
qed |
|
211 |
qed |
|
13221 | 212 |
|
213 |
(** Variations on transitivity **) |
|
214 |
||
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
215 |
lemma lesspoll_trans [trans]: |
13221 | 216 |
"[| X \<prec> Y; Y \<prec> Z |] ==> X \<prec> Z" |
217 |
apply (unfold lesspoll_def) |
|
218 |
apply (blast elim!: eqpollE intro: eqpollI lepoll_trans) |
|
219 |
done |
|
220 |
||
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
221 |
lemma lesspoll_trans1 [trans]: |
13221 | 222 |
"[| X \<lesssim> Y; Y \<prec> Z |] ==> X \<prec> Z" |
223 |
apply (unfold lesspoll_def) |
|
224 |
apply (blast elim!: eqpollE intro: eqpollI lepoll_trans) |
|
225 |
done |
|
226 |
||
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
227 |
lemma lesspoll_trans2 [trans]: |
13221 | 228 |
"[| X \<prec> Y; Y \<lesssim> Z |] ==> X \<prec> Z" |
229 |
apply (unfold lesspoll_def) |
|
230 |
apply (blast elim!: eqpollE intro: eqpollI lepoll_trans) |
|
231 |
done |
|
232 |
||
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
233 |
lemma eq_lesspoll_trans [trans]: |
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
234 |
"[| X \<approx> Y; Y \<prec> Z |] ==> X \<prec> Z" |
46953 | 235 |
by (blast intro: eqpoll_imp_lepoll lesspoll_trans1) |
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
236 |
|
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
237 |
lemma lesspoll_eq_trans [trans]: |
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
238 |
"[| X \<prec> Y; Y \<approx> Z |] ==> X \<prec> Z" |
46953 | 239 |
by (blast intro: eqpoll_imp_lepoll lesspoll_trans2) |
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
240 |
|
13221 | 241 |
|
242 |
(** LEAST -- the least number operator [from HOL/Univ.ML] **) |
|
243 |
||
46820 | 244 |
lemma Least_equality: |
46847 | 245 |
"[| P(i); Ord(i); !!x. x<i ==> ~P(x) |] ==> (\<mu> x. P(x)) = i" |
46820 | 246 |
apply (unfold Least_def) |
13221 | 247 |
apply (rule the_equality, blast) |
248 |
apply (elim conjE) |
|
249 |
apply (erule Ord_linear_lt, assumption, blast+) |
|
250 |
done |
|
251 |
||
47016 | 252 |
lemma LeastI: |
253 |
assumes P: "P(i)" and i: "Ord(i)" shows "P(\<mu> x. P(x))" |
|
254 |
proof - |
|
255 |
{ from i have "P(i) \<Longrightarrow> P(\<mu> x. P(x))" |
|
256 |
proof (induct i rule: trans_induct) |
|
257 |
case (step i) |
|
258 |
show ?case |
|
259 |
proof (cases "P(\<mu> a. P(a))") |
|
260 |
case True thus ?thesis . |
|
261 |
next |
|
262 |
case False |
|
263 |
hence "\<And>x. x \<in> i \<Longrightarrow> ~P(x)" using step |
|
264 |
by blast |
|
47018 | 265 |
hence "(\<mu> a. P(a)) = i" using step |
266 |
by (blast intro: Least_equality ltD) |
|
267 |
thus ?thesis using step.prems |
|
47016 | 268 |
by simp |
269 |
qed |
|
270 |
qed |
|
271 |
} |
|
272 |
thus ?thesis using P . |
|
273 |
qed |
|
13221 | 274 |
|
60770 | 275 |
text\<open>The proof is almost identical to the one above!\<close> |
47018 | 276 |
lemma Least_le: |
277 |
assumes P: "P(i)" and i: "Ord(i)" shows "(\<mu> x. P(x)) \<le> i" |
|
278 |
proof - |
|
279 |
{ from i have "P(i) \<Longrightarrow> (\<mu> x. P(x)) \<le> i" |
|
280 |
proof (induct i rule: trans_induct) |
|
281 |
case (step i) |
|
282 |
show ?case |
|
283 |
proof (cases "(\<mu> a. P(a)) \<le> i") |
|
284 |
case True thus ?thesis . |
|
285 |
next |
|
286 |
case False |
|
287 |
hence "\<And>x. x \<in> i \<Longrightarrow> ~ (\<mu> a. P(a)) \<le> i" using step |
|
288 |
by blast |
|
289 |
hence "(\<mu> a. P(a)) = i" using step |
|
290 |
by (blast elim: ltE intro: ltI Least_equality lt_trans1) |
|
291 |
thus ?thesis using step |
|
292 |
by simp |
|
293 |
qed |
|
294 |
qed |
|
295 |
} |
|
296 |
thus ?thesis using P . |
|
297 |
qed |
|
13221 | 298 |
|
299 |
(*LEAST really is the smallest*) |
|
46847 | 300 |
lemma less_LeastE: "[| P(i); i < (\<mu> x. P(x)) |] ==> Q" |
13221 | 301 |
apply (rule Least_le [THEN [2] lt_trans2, THEN lt_irrefl], assumption+) |
46820 | 302 |
apply (simp add: lt_Ord) |
13221 | 303 |
done |
304 |
||
305 |
(*Easier to apply than LeastI: conclusion has only one occurrence of P*) |
|
306 |
lemma LeastI2: |
|
46847 | 307 |
"[| P(i); Ord(i); !!j. P(j) ==> Q(j) |] ==> Q(\<mu> j. P(j))" |
46820 | 308 |
by (blast intro: LeastI ) |
13221 | 309 |
|
310 |
(*If there is no such P then LEAST is vacuously 0*) |
|
46820 | 311 |
lemma Least_0: |
46847 | 312 |
"[| ~ (\<exists>i. Ord(i) & P(i)) |] ==> (\<mu> x. P(x)) = 0" |
13221 | 313 |
apply (unfold Least_def) |
314 |
apply (rule the_0, blast) |
|
315 |
done |
|
316 |
||
46847 | 317 |
lemma Ord_Least [intro,simp,TC]: "Ord(\<mu> x. P(x))" |
47042 | 318 |
proof (cases "\<exists>i. Ord(i) & P(i)") |
319 |
case True |
|
320 |
then obtain i where "P(i)" "Ord(i)" by auto |
|
321 |
hence " (\<mu> x. P(x)) \<le> i" by (rule Least_le) |
|
322 |
thus ?thesis |
|
323 |
by (elim ltE) |
|
324 |
next |
|
325 |
case False |
|
326 |
hence "(\<mu> x. P(x)) = 0" by (rule Least_0) |
|
327 |
thus ?thesis |
|
328 |
by auto |
|
329 |
qed |
|
13221 | 330 |
|
331 |
||
60770 | 332 |
subsection\<open>Basic Properties of Cardinals\<close> |
13221 | 333 |
|
334 |
(*Not needed for simplification, but helpful below*) |
|
46847 | 335 |
lemma Least_cong: "(!!y. P(y) \<longleftrightarrow> Q(y)) ==> (\<mu> x. P(x)) = (\<mu> x. Q(x))" |
13221 | 336 |
by simp |
337 |
||
46820 | 338 |
(*Need AC to get @{term"X \<lesssim> Y ==> |X| \<le> |Y|"}; see well_ord_lepoll_imp_Card_le |
13221 | 339 |
Converse also requires AC, but see well_ord_cardinal_eqE*) |
340 |
lemma cardinal_cong: "X \<approx> Y ==> |X| = |Y|" |
|
341 |
apply (unfold eqpoll_def cardinal_def) |
|
342 |
apply (rule Least_cong) |
|
343 |
apply (blast intro: comp_bij bij_converse_bij) |
|
344 |
done |
|
345 |
||
346 |
(*Under AC, the premise becomes trivial; one consequence is ||A|| = |A|*) |
|
46820 | 347 |
lemma well_ord_cardinal_eqpoll: |
47018 | 348 |
assumes r: "well_ord(A,r)" shows "|A| \<approx> A" |
349 |
proof (unfold cardinal_def) |
|
350 |
show "(\<mu> i. i \<approx> A) \<approx> A" |
|
351 |
by (best intro: LeastI Ord_ordertype ordermap_bij bij_converse_bij bij_imp_eqpoll r) |
|
352 |
qed |
|
13221 | 353 |
|
46820 | 354 |
(* @{term"Ord(A) ==> |A| \<approx> A"} *) |
13221 | 355 |
lemmas Ord_cardinal_eqpoll = well_ord_Memrel [THEN well_ord_cardinal_eqpoll] |
356 |
||
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
357 |
lemma Ord_cardinal_idem: "Ord(A) \<Longrightarrow> ||A|| = |A|" |
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
358 |
by (rule Ord_cardinal_eqpoll [THEN cardinal_cong]) |
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
359 |
|
13221 | 360 |
lemma well_ord_cardinal_eqE: |
46953 | 361 |
assumes woX: "well_ord(X,r)" and woY: "well_ord(Y,s)" and eq: "|X| = |Y|" |
46847 | 362 |
shows "X \<approx> Y" |
363 |
proof - |
|
46953 | 364 |
have "X \<approx> |X|" by (blast intro: well_ord_cardinal_eqpoll [OF woX] eqpoll_sym) |
46847 | 365 |
also have "... = |Y|" by (rule eq) |
46953 | 366 |
also have "... \<approx> Y" by (rule well_ord_cardinal_eqpoll [OF woY]) |
46847 | 367 |
finally show ?thesis . |
368 |
qed |
|
13221 | 369 |
|
370 |
lemma well_ord_cardinal_eqpoll_iff: |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
46820
diff
changeset
|
371 |
"[| well_ord(X,r); well_ord(Y,s) |] ==> |X| = |Y| \<longleftrightarrow> X \<approx> Y" |
13221 | 372 |
by (blast intro: cardinal_cong well_ord_cardinal_eqE) |
373 |
||
374 |
||
375 |
(** Observations from Kunen, page 28 **) |
|
376 |
||
46820 | 377 |
lemma Ord_cardinal_le: "Ord(i) ==> |i| \<le> i" |
13221 | 378 |
apply (unfold cardinal_def) |
379 |
apply (erule eqpoll_refl [THEN Least_le]) |
|
380 |
done |
|
381 |
||
382 |
lemma Card_cardinal_eq: "Card(K) ==> |K| = K" |
|
383 |
apply (unfold Card_def) |
|
384 |
apply (erule sym) |
|
385 |
done |
|
386 |
||
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
387 |
(* Could replace the @{term"~(j \<approx> i)"} by @{term"~(i \<preceq> j)"}. *) |
13221 | 388 |
lemma CardI: "[| Ord(i); !!j. j<i ==> ~(j \<approx> i) |] ==> Card(i)" |
46820 | 389 |
apply (unfold Card_def cardinal_def) |
13221 | 390 |
apply (subst Least_equality) |
47018 | 391 |
apply (blast intro: eqpoll_refl)+ |
13221 | 392 |
done |
393 |
||
394 |
lemma Card_is_Ord: "Card(i) ==> Ord(i)" |
|
395 |
apply (unfold Card_def cardinal_def) |
|
396 |
apply (erule ssubst) |
|
397 |
apply (rule Ord_Least) |
|
398 |
done |
|
399 |
||
46820 | 400 |
lemma Card_cardinal_le: "Card(K) ==> K \<le> |K|" |
13221 | 401 |
apply (simp (no_asm_simp) add: Card_is_Ord Card_cardinal_eq) |
402 |
done |
|
403 |
||
404 |
lemma Ord_cardinal [simp,intro!]: "Ord(|A|)" |
|
405 |
apply (unfold cardinal_def) |
|
406 |
apply (rule Ord_Least) |
|
407 |
done |
|
408 |
||
60770 | 409 |
text\<open>The cardinals are the initial ordinals.\<close> |
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
46820
diff
changeset
|
410 |
lemma Card_iff_initial: "Card(K) \<longleftrightarrow> Ord(K) & (\<forall>j. j<K \<longrightarrow> ~ j \<approx> K)" |
47018 | 411 |
proof - |
412 |
{ fix j |
|
413 |
assume K: "Card(K)" "j \<approx> K" |
|
414 |
assume "j < K" |
|
415 |
also have "... = (\<mu> i. i \<approx> K)" using K |
|
416 |
by (simp add: Card_def cardinal_def) |
|
417 |
finally have "j < (\<mu> i. i \<approx> K)" . |
|
418 |
hence "False" using K |
|
419 |
by (best dest: less_LeastE) |
|
420 |
} |
|
421 |
then show ?thesis |
|
47042 | 422 |
by (blast intro: CardI Card_is_Ord) |
47018 | 423 |
qed |
13221 | 424 |
|
425 |
lemma lt_Card_imp_lesspoll: "[| Card(a); i<a |] ==> i \<prec> a" |
|
426 |
apply (unfold lesspoll_def) |
|
427 |
apply (drule Card_iff_initial [THEN iffD1]) |
|
428 |
apply (blast intro!: leI [THEN le_imp_lepoll]) |
|
429 |
done |
|
430 |
||
431 |
lemma Card_0: "Card(0)" |
|
432 |
apply (rule Ord_0 [THEN CardI]) |
|
433 |
apply (blast elim!: ltE) |
|
434 |
done |
|
435 |
||
46820 | 436 |
lemma Card_Un: "[| Card(K); Card(L) |] ==> Card(K \<union> L)" |
13221 | 437 |
apply (rule Ord_linear_le [of K L]) |
438 |
apply (simp_all add: subset_Un_iff [THEN iffD1] Card_is_Ord le_imp_subset |
|
439 |
subset_Un_iff2 [THEN iffD1]) |
|
440 |
done |
|
441 |
||
442 |
(*Infinite unions of cardinals? See Devlin, Lemma 6.7, page 98*) |
|
443 |
||
47101 | 444 |
lemma Card_cardinal [iff]: "Card(|A|)" |
46847 | 445 |
proof (unfold cardinal_def) |
446 |
show "Card(\<mu> i. i \<approx> A)" |
|
447 |
proof (cases "\<exists>i. Ord (i) & i \<approx> A") |
|
60770 | 448 |
case False thus ?thesis --\<open>degenerate case\<close> |
46847 | 449 |
by (simp add: Least_0 Card_0) |
450 |
next |
|
60770 | 451 |
case True --\<open>real case: @{term A} is isomorphic to some ordinal\<close> |
46847 | 452 |
then obtain i where i: "Ord(i)" "i \<approx> A" by blast |
46953 | 453 |
show ?thesis |
46847 | 454 |
proof (rule CardI [OF Ord_Least], rule notI) |
455 |
fix j |
|
46953 | 456 |
assume j: "j < (\<mu> i. i \<approx> A)" |
46847 | 457 |
assume "j \<approx> (\<mu> i. i \<approx> A)" |
458 |
also have "... \<approx> A" using i by (auto intro: LeastI) |
|
459 |
finally have "j \<approx> A" . |
|
46953 | 460 |
thus False |
46847 | 461 |
by (rule less_LeastE [OF _ j]) |
462 |
qed |
|
463 |
qed |
|
464 |
qed |
|
13221 | 465 |
|
466 |
(*Kunen's Lemma 10.5*) |
|
46953 | 467 |
lemma cardinal_eq_lemma: |
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
468 |
assumes i:"|i| \<le> j" and j: "j \<le> i" shows "|j| = |i|" |
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
469 |
proof (rule eqpollI [THEN cardinal_cong]) |
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
470 |
show "j \<lesssim> i" by (rule le_imp_lepoll [OF j]) |
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
471 |
next |
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
472 |
have Oi: "Ord(i)" using j by (rule le_Ord2) |
46953 | 473 |
hence "i \<approx> |i|" |
474 |
by (blast intro: Ord_cardinal_eqpoll eqpoll_sym) |
|
475 |
also have "... \<lesssim> j" |
|
476 |
by (blast intro: le_imp_lepoll i) |
|
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
477 |
finally show "i \<lesssim> j" . |
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
478 |
qed |
13221 | 479 |
|
46953 | 480 |
lemma cardinal_mono: |
46877 | 481 |
assumes ij: "i \<le> j" shows "|i| \<le> |j|" |
47016 | 482 |
using Ord_cardinal [of i] Ord_cardinal [of j] |
483 |
proof (cases rule: Ord_linear_le) |
|
484 |
case le thus ?thesis . |
|
46877 | 485 |
next |
47016 | 486 |
case ge |
46877 | 487 |
have i: "Ord(i)" using ij |
46953 | 488 |
by (simp add: lt_Ord) |
489 |
have ci: "|i| \<le> j" |
|
490 |
by (blast intro: Ord_cardinal_le ij le_trans i) |
|
491 |
have "|i| = ||i||" |
|
492 |
by (auto simp add: Ord_cardinal_idem i) |
|
46877 | 493 |
also have "... = |j|" |
47016 | 494 |
by (rule cardinal_eq_lemma [OF ge ci]) |
46877 | 495 |
finally have "|i| = |j|" . |
496 |
thus ?thesis by simp |
|
497 |
qed |
|
13221 | 498 |
|
60770 | 499 |
text\<open>Since we have @{term"|succ(nat)| \<le> |nat|"}, the converse of @{text cardinal_mono} fails!\<close> |
13221 | 500 |
lemma cardinal_lt_imp_lt: "[| |i| < |j|; Ord(i); Ord(j) |] ==> i < j" |
501 |
apply (rule Ord_linear2 [of i j], assumption+) |
|
502 |
apply (erule lt_trans2 [THEN lt_irrefl]) |
|
503 |
apply (erule cardinal_mono) |
|
504 |
done |
|
505 |
||
506 |
lemma Card_lt_imp_lt: "[| |i| < K; Ord(i); Card(K) |] ==> i < K" |
|
46877 | 507 |
by (simp (no_asm_simp) add: cardinal_lt_imp_lt Card_is_Ord Card_cardinal_eq) |
13221 | 508 |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
46820
diff
changeset
|
509 |
lemma Card_lt_iff: "[| Ord(i); Card(K) |] ==> (|i| < K) \<longleftrightarrow> (i < K)" |
13221 | 510 |
by (blast intro: Card_lt_imp_lt Ord_cardinal_le [THEN lt_trans1]) |
511 |
||
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
46820
diff
changeset
|
512 |
lemma Card_le_iff: "[| Ord(i); Card(K) |] ==> (K \<le> |i|) \<longleftrightarrow> (K \<le> i)" |
13269 | 513 |
by (simp add: Card_lt_iff Card_is_Ord Ord_cardinal not_lt_iff_le [THEN iff_sym]) |
13221 | 514 |
|
515 |
(*Can use AC or finiteness to discharge first premise*) |
|
516 |
lemma well_ord_lepoll_imp_Card_le: |
|
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
517 |
assumes wB: "well_ord(B,r)" and AB: "A \<lesssim> B" |
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
518 |
shows "|A| \<le> |B|" |
47016 | 519 |
using Ord_cardinal [of A] Ord_cardinal [of B] |
520 |
proof (cases rule: Ord_linear_le) |
|
521 |
case le thus ?thesis . |
|
522 |
next |
|
523 |
case ge |
|
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
524 |
from lepoll_well_ord [OF AB wB] |
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
525 |
obtain s where s: "well_ord(A, s)" by blast |
46953 | 526 |
have "B \<approx> |B|" by (blast intro: wB eqpoll_sym well_ord_cardinal_eqpoll) |
47016 | 527 |
also have "... \<lesssim> |A|" by (rule le_imp_lepoll [OF ge]) |
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
528 |
also have "... \<approx> A" by (rule well_ord_cardinal_eqpoll [OF s]) |
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
529 |
finally have "B \<lesssim> A" . |
46953 | 530 |
hence "A \<approx> B" by (blast intro: eqpollI AB) |
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
531 |
hence "|A| = |B|" by (rule cardinal_cong) |
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
532 |
thus ?thesis by simp |
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
533 |
qed |
13221 | 534 |
|
46820 | 535 |
lemma lepoll_cardinal_le: "[| A \<lesssim> i; Ord(i) |] ==> |A| \<le> i" |
13221 | 536 |
apply (rule le_trans) |
537 |
apply (erule well_ord_Memrel [THEN well_ord_lepoll_imp_Card_le], assumption) |
|
538 |
apply (erule Ord_cardinal_le) |
|
539 |
done |
|
540 |
||
541 |
lemma lepoll_Ord_imp_eqpoll: "[| A \<lesssim> i; Ord(i) |] ==> |A| \<approx> A" |
|
542 |
by (blast intro: lepoll_cardinal_le well_ord_Memrel well_ord_cardinal_eqpoll dest!: lepoll_well_ord) |
|
543 |
||
14046 | 544 |
lemma lesspoll_imp_eqpoll: "[| A \<prec> i; Ord(i) |] ==> |A| \<approx> A" |
13221 | 545 |
apply (unfold lesspoll_def) |
546 |
apply (blast intro: lepoll_Ord_imp_eqpoll) |
|
547 |
done |
|
548 |
||
46820 | 549 |
lemma cardinal_subset_Ord: "[|A<=i; Ord(i)|] ==> |A| \<subseteq> i" |
14046 | 550 |
apply (drule subset_imp_lepoll [THEN lepoll_cardinal_le]) |
551 |
apply (auto simp add: lt_def) |
|
552 |
apply (blast intro: Ord_trans) |
|
553 |
done |
|
13221 | 554 |
|
60770 | 555 |
subsection\<open>The finite cardinals\<close> |
13221 | 556 |
|
46820 | 557 |
lemma cons_lepoll_consD: |
558 |
"[| cons(u,A) \<lesssim> cons(v,B); u\<notin>A; v\<notin>B |] ==> A \<lesssim> B" |
|
13221 | 559 |
apply (unfold lepoll_def inj_def, safe) |
46820 | 560 |
apply (rule_tac x = "\<lambda>x\<in>A. if f`x=v then f`u else f`x" in exI) |
13221 | 561 |
apply (rule CollectI) |
562 |
(*Proving it's in the function space A->B*) |
|
563 |
apply (rule if_type [THEN lam_type]) |
|
564 |
apply (blast dest: apply_funtype) |
|
565 |
apply (blast elim!: mem_irrefl dest: apply_funtype) |
|
566 |
(*Proving it's injective*) |
|
567 |
apply (simp (no_asm_simp)) |
|
568 |
apply blast |
|
569 |
done |
|
570 |
||
46820 | 571 |
lemma cons_eqpoll_consD: "[| cons(u,A) \<approx> cons(v,B); u\<notin>A; v\<notin>B |] ==> A \<approx> B" |
13221 | 572 |
apply (simp add: eqpoll_iff) |
573 |
apply (blast intro: cons_lepoll_consD) |
|
574 |
done |
|
575 |
||
576 |
(*Lemma suggested by Mike Fourman*) |
|
577 |
lemma succ_lepoll_succD: "succ(m) \<lesssim> succ(n) ==> m \<lesssim> n" |
|
578 |
apply (unfold succ_def) |
|
579 |
apply (erule cons_lepoll_consD) |
|
580 |
apply (rule mem_not_refl)+ |
|
581 |
done |
|
582 |
||
46877 | 583 |
|
46935 | 584 |
lemma nat_lepoll_imp_le: |
585 |
"m \<in> nat ==> n \<in> nat \<Longrightarrow> m \<lesssim> n \<Longrightarrow> m \<le> n" |
|
586 |
proof (induct m arbitrary: n rule: nat_induct) |
|
587 |
case 0 thus ?case by (blast intro!: nat_0_le) |
|
588 |
next |
|
589 |
case (succ m) |
|
60770 | 590 |
show ?case using \<open>n \<in> nat\<close> |
46935 | 591 |
proof (cases rule: natE) |
592 |
case 0 thus ?thesis using succ |
|
593 |
by (simp add: lepoll_def inj_def) |
|
594 |
next |
|
60770 | 595 |
case (succ n') thus ?thesis using succ.hyps \<open> succ(m) \<lesssim> n\<close> |
46935 | 596 |
by (blast intro!: succ_leI dest!: succ_lepoll_succD) |
597 |
qed |
|
598 |
qed |
|
13221 | 599 |
|
46953 | 600 |
lemma nat_eqpoll_iff: "[| m \<in> nat; n \<in> nat |] ==> m \<approx> n \<longleftrightarrow> m = n" |
13221 | 601 |
apply (rule iffI) |
602 |
apply (blast intro: nat_lepoll_imp_le le_anti_sym elim!: eqpollE) |
|
603 |
apply (simp add: eqpoll_refl) |
|
604 |
done |
|
605 |
||
606 |
(*The object of all this work: every natural number is a (finite) cardinal*) |
|
46820 | 607 |
lemma nat_into_Card: |
47042 | 608 |
assumes n: "n \<in> nat" shows "Card(n)" |
609 |
proof (unfold Card_def cardinal_def, rule sym) |
|
610 |
have "Ord(n)" using n by auto |
|
611 |
moreover |
|
612 |
{ fix i |
|
613 |
assume "i < n" "i \<approx> n" |
|
614 |
hence False using n |
|
615 |
by (auto simp add: lt_nat_in_nat [THEN nat_eqpoll_iff]) |
|
616 |
} |
|
617 |
ultimately show "(\<mu> i. i \<approx> n) = n" by (auto intro!: Least_equality) |
|
618 |
qed |
|
13221 | 619 |
|
620 |
lemmas cardinal_0 = nat_0I [THEN nat_into_Card, THEN Card_cardinal_eq, iff] |
|
621 |
lemmas cardinal_1 = nat_1I [THEN nat_into_Card, THEN Card_cardinal_eq, iff] |
|
622 |
||
623 |
||
624 |
(*Part of Kunen's Lemma 10.6*) |
|
46877 | 625 |
lemma succ_lepoll_natE: "[| succ(n) \<lesssim> n; n \<in> nat |] ==> P" |
13221 | 626 |
by (rule nat_lepoll_imp_le [THEN lt_irrefl], auto) |
627 |
||
46820 | 628 |
lemma nat_lepoll_imp_ex_eqpoll_n: |
13221 | 629 |
"[| n \<in> nat; nat \<lesssim> X |] ==> \<exists>Y. Y \<subseteq> X & n \<approx> Y" |
630 |
apply (unfold lepoll_def eqpoll_def) |
|
631 |
apply (fast del: subsetI subsetCE |
|
632 |
intro!: subset_SIs |
|
633 |
dest!: Ord_nat [THEN [2] OrdmemD, THEN [2] restrict_inj] |
|
46820 | 634 |
elim!: restrict_bij |
13221 | 635 |
inj_is_fun [THEN fun_is_rel, THEN image_subset]) |
636 |
done |
|
637 |
||
638 |
||
639 |
(** lepoll, \<prec> and natural numbers **) |
|
640 |
||
46877 | 641 |
lemma lepoll_succ: "i \<lesssim> succ(i)" |
642 |
by (blast intro: subset_imp_lepoll) |
|
643 |
||
46820 | 644 |
lemma lepoll_imp_lesspoll_succ: |
46877 | 645 |
assumes A: "A \<lesssim> m" and m: "m \<in> nat" |
646 |
shows "A \<prec> succ(m)" |
|
647 |
proof - |
|
46953 | 648 |
{ assume "A \<approx> succ(m)" |
46877 | 649 |
hence "succ(m) \<approx> A" by (rule eqpoll_sym) |
650 |
also have "... \<lesssim> m" by (rule A) |
|
651 |
finally have "succ(m) \<lesssim> m" . |
|
652 |
hence False by (rule succ_lepoll_natE) (rule m) } |
|
653 |
moreover have "A \<lesssim> succ(m)" by (blast intro: lepoll_trans A lepoll_succ) |
|
46953 | 654 |
ultimately show ?thesis by (auto simp add: lesspoll_def) |
46877 | 655 |
qed |
656 |
||
657 |
lemma lesspoll_succ_imp_lepoll: |
|
658 |
"[| A \<prec> succ(m); m \<in> nat |] ==> A \<lesssim> m" |
|
659 |
apply (unfold lesspoll_def lepoll_def eqpoll_def bij_def) |
|
660 |
apply (auto dest: inj_not_surj_succ) |
|
13221 | 661 |
done |
662 |
||
46877 | 663 |
lemma lesspoll_succ_iff: "m \<in> nat ==> A \<prec> succ(m) \<longleftrightarrow> A \<lesssim> m" |
13221 | 664 |
by (blast intro!: lepoll_imp_lesspoll_succ lesspoll_succ_imp_lepoll) |
665 |
||
46877 | 666 |
lemma lepoll_succ_disj: "[| A \<lesssim> succ(m); m \<in> nat |] ==> A \<lesssim> m | A \<approx> succ(m)" |
13221 | 667 |
apply (rule disjCI) |
668 |
apply (rule lesspoll_succ_imp_lepoll) |
|
669 |
prefer 2 apply assumption |
|
670 |
apply (simp (no_asm_simp) add: lesspoll_def) |
|
671 |
done |
|
672 |
||
673 |
lemma lesspoll_cardinal_lt: "[| A \<prec> i; Ord(i) |] ==> |A| < i" |
|
674 |
apply (unfold lesspoll_def, clarify) |
|
675 |
apply (frule lepoll_cardinal_le, assumption) |
|
676 |
apply (blast intro: well_ord_Memrel well_ord_cardinal_eqpoll [THEN eqpoll_sym] |
|
677 |
dest: lepoll_well_ord elim!: leE) |
|
678 |
done |
|
679 |
||
680 |
||
60770 | 681 |
subsection\<open>The first infinite cardinal: Omega, or nat\<close> |
13221 | 682 |
|
683 |
(*This implies Kunen's Lemma 10.6*) |
|
46877 | 684 |
lemma lt_not_lepoll: |
685 |
assumes n: "n<i" "n \<in> nat" shows "~ i \<lesssim> n" |
|
686 |
proof - |
|
687 |
{ assume i: "i \<lesssim> n" |
|
688 |
have "succ(n) \<lesssim> i" using n |
|
46953 | 689 |
by (elim ltE, blast intro: Ord_succ_subsetI [THEN subset_imp_lepoll]) |
46877 | 690 |
also have "... \<lesssim> n" by (rule i) |
691 |
finally have "succ(n) \<lesssim> n" . |
|
692 |
hence False by (rule succ_lepoll_natE) (rule n) } |
|
693 |
thus ?thesis by auto |
|
694 |
qed |
|
13221 | 695 |
|
60770 | 696 |
text\<open>A slightly weaker version of @{text nat_eqpoll_iff}\<close> |
46877 | 697 |
lemma Ord_nat_eqpoll_iff: |
698 |
assumes i: "Ord(i)" and n: "n \<in> nat" shows "i \<approx> n \<longleftrightarrow> i=n" |
|
47016 | 699 |
using i nat_into_Ord [OF n] |
700 |
proof (cases rule: Ord_linear_lt) |
|
701 |
case lt |
|
46877 | 702 |
hence "i \<in> nat" by (rule lt_nat_in_nat) (rule n) |
46953 | 703 |
thus ?thesis by (simp add: nat_eqpoll_iff n) |
46877 | 704 |
next |
47016 | 705 |
case eq |
46953 | 706 |
thus ?thesis by (simp add: eqpoll_refl) |
46877 | 707 |
next |
47016 | 708 |
case gt |
46953 | 709 |
hence "~ i \<lesssim> n" using n by (rule lt_not_lepoll) |
46877 | 710 |
hence "~ i \<approx> n" using n by (blast intro: eqpoll_imp_lepoll) |
60770 | 711 |
moreover have "i \<noteq> n" using \<open>n<i\<close> by auto |
46877 | 712 |
ultimately show ?thesis by blast |
713 |
qed |
|
13221 | 714 |
|
715 |
lemma Card_nat: "Card(nat)" |
|
46877 | 716 |
proof - |
717 |
{ fix i |
|
46953 | 718 |
assume i: "i < nat" "i \<approx> nat" |
719 |
hence "~ nat \<lesssim> i" |
|
720 |
by (simp add: lt_def lt_not_lepoll) |
|
721 |
hence False using i |
|
46877 | 722 |
by (simp add: eqpoll_iff) |
723 |
} |
|
46953 | 724 |
hence "(\<mu> i. i \<approx> nat) = nat" by (blast intro: Least_equality eqpoll_refl) |
46877 | 725 |
thus ?thesis |
46953 | 726 |
by (auto simp add: Card_def cardinal_def) |
46877 | 727 |
qed |
13221 | 728 |
|
729 |
(*Allows showing that |i| is a limit cardinal*) |
|
46820 | 730 |
lemma nat_le_cardinal: "nat \<le> i ==> nat \<le> |i|" |
13221 | 731 |
apply (rule Card_nat [THEN Card_cardinal_eq, THEN subst]) |
732 |
apply (erule cardinal_mono) |
|
733 |
done |
|
734 |
||
46841
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
735 |
lemma n_lesspoll_nat: "n \<in> nat ==> n \<prec> nat" |
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
736 |
by (blast intro: Ord_nat Card_nat ltI lt_Card_imp_lesspoll) |
49b91b716cbe
Structured and calculation-based proofs (with new trans rules!)
paulson
parents:
46821
diff
changeset
|
737 |
|
13221 | 738 |
|
60770 | 739 |
subsection\<open>Towards Cardinal Arithmetic\<close> |
13221 | 740 |
(** Congruence laws for successor, cardinal addition and multiplication **) |
741 |
||
742 |
(*Congruence law for cons under equipollence*) |
|
46820 | 743 |
lemma cons_lepoll_cong: |
744 |
"[| A \<lesssim> B; b \<notin> B |] ==> cons(a,A) \<lesssim> cons(b,B)" |
|
13221 | 745 |
apply (unfold lepoll_def, safe) |
46820 | 746 |
apply (rule_tac x = "\<lambda>y\<in>cons (a,A) . if y=a then b else f`y" in exI) |
46953 | 747 |
apply (rule_tac d = "%z. if z \<in> B then converse (f) `z else a" in lam_injective) |
46820 | 748 |
apply (safe elim!: consE') |
13221 | 749 |
apply simp_all |
46820 | 750 |
apply (blast intro: inj_is_fun [THEN apply_type])+ |
13221 | 751 |
done |
752 |
||
753 |
lemma cons_eqpoll_cong: |
|
46820 | 754 |
"[| A \<approx> B; a \<notin> A; b \<notin> B |] ==> cons(a,A) \<approx> cons(b,B)" |
13221 | 755 |
by (simp add: eqpoll_iff cons_lepoll_cong) |
756 |
||
757 |
lemma cons_lepoll_cons_iff: |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
46820
diff
changeset
|
758 |
"[| a \<notin> A; b \<notin> B |] ==> cons(a,A) \<lesssim> cons(b,B) \<longleftrightarrow> A \<lesssim> B" |
13221 | 759 |
by (blast intro: cons_lepoll_cong cons_lepoll_consD) |
760 |
||
761 |
lemma cons_eqpoll_cons_iff: |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
46820
diff
changeset
|
762 |
"[| a \<notin> A; b \<notin> B |] ==> cons(a,A) \<approx> cons(b,B) \<longleftrightarrow> A \<approx> B" |
13221 | 763 |
by (blast intro: cons_eqpoll_cong cons_eqpoll_consD) |
764 |
||
765 |
lemma singleton_eqpoll_1: "{a} \<approx> 1" |
|
766 |
apply (unfold succ_def) |
|
767 |
apply (blast intro!: eqpoll_refl [THEN cons_eqpoll_cong]) |
|
768 |
done |
|
769 |
||
770 |
lemma cardinal_singleton: "|{a}| = 1" |
|
771 |
apply (rule singleton_eqpoll_1 [THEN cardinal_cong, THEN trans]) |
|
772 |
apply (simp (no_asm) add: nat_into_Card [THEN Card_cardinal_eq]) |
|
773 |
done |
|
774 |
||
46820 | 775 |
lemma not_0_is_lepoll_1: "A \<noteq> 0 ==> 1 \<lesssim> A" |
13221 | 776 |
apply (erule not_emptyE) |
777 |
apply (rule_tac a = "cons (x, A-{x}) " in subst) |
|
778 |
apply (rule_tac [2] a = "cons(0,0)" and P= "%y. y \<lesssim> cons (x, A-{x})" in subst) |
|
779 |
prefer 3 apply (blast intro: cons_lepoll_cong subset_imp_lepoll, auto) |
|
780 |
done |
|
781 |
||
782 |
(*Congruence law for succ under equipollence*) |
|
783 |
lemma succ_eqpoll_cong: "A \<approx> B ==> succ(A) \<approx> succ(B)" |
|
784 |
apply (unfold succ_def) |
|
785 |
apply (simp add: cons_eqpoll_cong mem_not_refl) |
|
786 |
done |
|
787 |
||
788 |
(*Congruence law for + under equipollence*) |
|
789 |
lemma sum_eqpoll_cong: "[| A \<approx> C; B \<approx> D |] ==> A+B \<approx> C+D" |
|
790 |
apply (unfold eqpoll_def) |
|
791 |
apply (blast intro!: sum_bij) |
|
792 |
done |
|
793 |
||
794 |
(*Congruence law for * under equipollence*) |
|
46820 | 795 |
lemma prod_eqpoll_cong: |
13221 | 796 |
"[| A \<approx> C; B \<approx> D |] ==> A*B \<approx> C*D" |
797 |
apply (unfold eqpoll_def) |
|
798 |
apply (blast intro!: prod_bij) |
|
799 |
done |
|
800 |
||
46820 | 801 |
lemma inj_disjoint_eqpoll: |
46953 | 802 |
"[| f \<in> inj(A,B); A \<inter> B = 0 |] ==> A \<union> (B - range(f)) \<approx> B" |
13221 | 803 |
apply (unfold eqpoll_def) |
804 |
apply (rule exI) |
|
46953 | 805 |
apply (rule_tac c = "%x. if x \<in> A then f`x else x" |
806 |
and d = "%y. if y \<in> range (f) then converse (f) `y else y" |
|
13221 | 807 |
in lam_bijective) |
808 |
apply (blast intro!: if_type inj_is_fun [THEN apply_type]) |
|
809 |
apply (simp (no_asm_simp) add: inj_converse_fun [THEN apply_funtype]) |
|
46820 | 810 |
apply (safe elim!: UnE') |
13221 | 811 |
apply (simp_all add: inj_is_fun [THEN apply_rangeI]) |
46820 | 812 |
apply (blast intro: inj_converse_fun [THEN apply_type])+ |
13221 | 813 |
done |
814 |
||
815 |
||
60770 | 816 |
subsection\<open>Lemmas by Krzysztof Grabczewski\<close> |
13356 | 817 |
|
818 |
(*New proofs using cons_lepoll_cons. Could generalise from succ to cons.*) |
|
13221 | 819 |
|
60770 | 820 |
text\<open>If @{term A} has at most @{term"n+1"} elements and @{term"a \<in> A"} |
821 |
then @{term"A-{a}"} has at most @{term n}.\<close> |
|
46820 | 822 |
lemma Diff_sing_lepoll: |
46877 | 823 |
"[| a \<in> A; A \<lesssim> succ(n) |] ==> A - {a} \<lesssim> n" |
13221 | 824 |
apply (unfold succ_def) |
825 |
apply (rule cons_lepoll_consD) |
|
826 |
apply (rule_tac [3] mem_not_refl) |
|
827 |
apply (erule cons_Diff [THEN ssubst], safe) |
|
828 |
done |
|
829 |
||
60770 | 830 |
text\<open>If @{term A} has at least @{term"n+1"} elements then @{term"A-{a}"} has at least @{term n}.\<close> |
46820 | 831 |
lemma lepoll_Diff_sing: |
46877 | 832 |
assumes A: "succ(n) \<lesssim> A" shows "n \<lesssim> A - {a}" |
833 |
proof - |
|
834 |
have "cons(n,n) \<lesssim> A" using A |
|
835 |
by (unfold succ_def) |
|
46953 | 836 |
also have "... \<lesssim> cons(a, A-{a})" |
46877 | 837 |
by (blast intro: subset_imp_lepoll) |
838 |
finally have "cons(n,n) \<lesssim> cons(a, A-{a})" . |
|
839 |
thus ?thesis |
|
46953 | 840 |
by (blast intro: cons_lepoll_consD mem_irrefl) |
46877 | 841 |
qed |
13221 | 842 |
|
46877 | 843 |
lemma Diff_sing_eqpoll: "[| a \<in> A; A \<approx> succ(n) |] ==> A - {a} \<approx> n" |
46820 | 844 |
by (blast intro!: eqpollI |
845 |
elim!: eqpollE |
|
13221 | 846 |
intro: Diff_sing_lepoll lepoll_Diff_sing) |
847 |
||
46877 | 848 |
lemma lepoll_1_is_sing: "[| A \<lesssim> 1; a \<in> A |] ==> A = {a}" |
13221 | 849 |
apply (frule Diff_sing_lepoll, assumption) |
850 |
apply (drule lepoll_0_is_0) |
|
851 |
apply (blast elim: equalityE) |
|
852 |
done |
|
853 |
||
46820 | 854 |
lemma Un_lepoll_sum: "A \<union> B \<lesssim> A+B" |
13221 | 855 |
apply (unfold lepoll_def) |
46877 | 856 |
apply (rule_tac x = "\<lambda>x\<in>A \<union> B. if x\<in>A then Inl (x) else Inr (x)" in exI) |
857 |
apply (rule_tac d = "%z. snd (z)" in lam_injective) |
|
46820 | 858 |
apply force |
13221 | 859 |
apply (simp add: Inl_def Inr_def) |
860 |
done |
|
861 |
||
862 |
lemma well_ord_Un: |
|
46820 | 863 |
"[| well_ord(X,R); well_ord(Y,S) |] ==> \<exists>T. well_ord(X \<union> Y, T)" |
864 |
by (erule well_ord_radd [THEN Un_lepoll_sum [THEN lepoll_well_ord]], |
|
13221 | 865 |
assumption) |
866 |
||
867 |
(*Krzysztof Grabczewski*) |
|
46820 | 868 |
lemma disj_Un_eqpoll_sum: "A \<inter> B = 0 ==> A \<union> B \<approx> A + B" |
13221 | 869 |
apply (unfold eqpoll_def) |
46877 | 870 |
apply (rule_tac x = "\<lambda>a\<in>A \<union> B. if a \<in> A then Inl (a) else Inr (a)" in exI) |
871 |
apply (rule_tac d = "%z. case (%x. x, %x. x, z)" in lam_bijective) |
|
13221 | 872 |
apply auto |
873 |
done |
|
874 |
||
875 |
||
60770 | 876 |
subsection \<open>Finite and infinite sets\<close> |
13221 | 877 |
|
47018 | 878 |
lemma eqpoll_imp_Finite_iff: "A \<approx> B ==> Finite(A) \<longleftrightarrow> Finite(B)" |
879 |
apply (unfold Finite_def) |
|
880 |
apply (blast intro: eqpoll_trans eqpoll_sym) |
|
881 |
done |
|
882 |
||
13244 | 883 |
lemma Finite_0 [simp]: "Finite(0)" |
13221 | 884 |
apply (unfold Finite_def) |
885 |
apply (blast intro!: eqpoll_refl nat_0I) |
|
886 |
done |
|
887 |
||
47018 | 888 |
lemma Finite_cons: "Finite(x) ==> Finite(cons(y,x))" |
13221 | 889 |
apply (unfold Finite_def) |
47018 | 890 |
apply (case_tac "y \<in> x") |
891 |
apply (simp add: cons_absorb) |
|
892 |
apply (erule bexE) |
|
893 |
apply (rule bexI) |
|
894 |
apply (erule_tac [2] nat_succI) |
|
895 |
apply (simp (no_asm_simp) add: succ_def cons_eqpoll_cong mem_not_refl) |
|
896 |
done |
|
897 |
||
898 |
lemma Finite_succ: "Finite(x) ==> Finite(succ(x))" |
|
899 |
apply (unfold succ_def) |
|
900 |
apply (erule Finite_cons) |
|
13221 | 901 |
done |
902 |
||
47018 | 903 |
lemma lepoll_nat_imp_Finite: |
904 |
assumes A: "A \<lesssim> n" and n: "n \<in> nat" shows "Finite(A)" |
|
905 |
proof - |
|
906 |
have "A \<lesssim> n \<Longrightarrow> Finite(A)" using n |
|
907 |
proof (induct n) |
|
908 |
case 0 |
|
909 |
hence "A = 0" by (rule lepoll_0_is_0) |
|
910 |
thus ?case by simp |
|
911 |
next |
|
912 |
case (succ n) |
|
913 |
hence "A \<lesssim> n \<or> A \<approx> succ(n)" by (blast dest: lepoll_succ_disj) |
|
914 |
thus ?case using succ by (auto simp add: Finite_def) |
|
915 |
qed |
|
916 |
thus ?thesis using A . |
|
917 |
qed |
|
918 |
||
46820 | 919 |
lemma lesspoll_nat_is_Finite: |
13221 | 920 |
"A \<prec> nat ==> Finite(A)" |
921 |
apply (unfold Finite_def) |
|
46820 | 922 |
apply (blast dest: ltD lesspoll_cardinal_lt |
13221 | 923 |
lesspoll_imp_eqpoll [THEN eqpoll_sym]) |
924 |
done |
|
925 |
||
46820 | 926 |
lemma lepoll_Finite: |
46877 | 927 |
assumes Y: "Y \<lesssim> X" and X: "Finite(X)" shows "Finite(Y)" |
928 |
proof - |
|
46953 | 929 |
obtain n where n: "n \<in> nat" "X \<approx> n" using X |
930 |
by (auto simp add: Finite_def) |
|
46877 | 931 |
have "Y \<lesssim> X" by (rule Y) |
932 |
also have "... \<approx> n" by (rule n) |
|
933 |
finally have "Y \<lesssim> n" . |
|
934 |
thus ?thesis using n by (simp add: lepoll_nat_imp_Finite) |
|
935 |
qed |
|
13221 | 936 |
|
45602 | 937 |
lemmas subset_Finite = subset_imp_lepoll [THEN lepoll_Finite] |
13221 | 938 |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
46820
diff
changeset
|
939 |
lemma Finite_cons_iff [iff]: "Finite(cons(y,x)) \<longleftrightarrow> Finite(x)" |
13244 | 940 |
by (blast intro: Finite_cons subset_Finite) |
941 |
||
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
46820
diff
changeset
|
942 |
lemma Finite_succ_iff [iff]: "Finite(succ(x)) \<longleftrightarrow> Finite(x)" |
13244 | 943 |
by (simp add: succ_def) |
944 |
||
47018 | 945 |
lemma Finite_Int: "Finite(A) | Finite(B) ==> Finite(A \<inter> B)" |
946 |
by (blast intro: subset_Finite) |
|
947 |
||
948 |
lemmas Finite_Diff = Diff_subset [THEN subset_Finite] |
|
949 |
||
46820 | 950 |
lemma nat_le_infinite_Ord: |
951 |
"[| Ord(i); ~ Finite(i) |] ==> nat \<le> i" |
|
13221 | 952 |
apply (unfold Finite_def) |
953 |
apply (erule Ord_nat [THEN [2] Ord_linear2]) |
|
954 |
prefer 2 apply assumption |
|
955 |
apply (blast intro!: eqpoll_refl elim!: ltE) |
|
956 |
done |
|
957 |
||
46820 | 958 |
lemma Finite_imp_well_ord: |
959 |
"Finite(A) ==> \<exists>r. well_ord(A,r)" |
|
13221 | 960 |
apply (unfold Finite_def eqpoll_def) |
961 |
apply (blast intro: well_ord_rvimage bij_is_inj well_ord_Memrel nat_into_Ord) |
|
962 |
done |
|
963 |
||
13244 | 964 |
lemma succ_lepoll_imp_not_empty: "succ(x) \<lesssim> y ==> y \<noteq> 0" |
965 |
by (fast dest!: lepoll_0_is_0) |
|
966 |
||
967 |
lemma eqpoll_succ_imp_not_empty: "x \<approx> succ(n) ==> x \<noteq> 0" |
|
968 |
by (fast elim!: eqpoll_sym [THEN eqpoll_0_is_0, THEN succ_neq_0]) |
|
969 |
||
970 |
lemma Finite_Fin_lemma [rule_format]: |
|
46820 | 971 |
"n \<in> nat ==> \<forall>A. (A\<approx>n & A \<subseteq> X) \<longrightarrow> A \<in> Fin(X)" |
13244 | 972 |
apply (induct_tac n) |
973 |
apply (rule allI) |
|
974 |
apply (fast intro!: Fin.emptyI dest!: eqpoll_imp_lepoll [THEN lepoll_0_is_0]) |
|
975 |
apply (rule allI) |
|
976 |
apply (rule impI) |
|
977 |
apply (erule conjE) |
|
978 |
apply (rule eqpoll_succ_imp_not_empty [THEN not_emptyE], assumption) |
|
979 |
apply (frule Diff_sing_eqpoll, assumption) |
|
980 |
apply (erule allE) |
|
981 |
apply (erule impE, fast) |
|
982 |
apply (drule subsetD, assumption) |
|
983 |
apply (drule Fin.consI, assumption) |
|
984 |
apply (simp add: cons_Diff) |
|
985 |
done |
|
986 |
||
987 |
lemma Finite_Fin: "[| Finite(A); A \<subseteq> X |] ==> A \<in> Fin(X)" |
|
46820 | 988 |
by (unfold Finite_def, blast intro: Finite_Fin_lemma) |
13244 | 989 |
|
46953 | 990 |
lemma Fin_lemma [rule_format]: "n \<in> nat ==> \<forall>A. A \<approx> n \<longrightarrow> A \<in> Fin(A)" |
13244 | 991 |
apply (induct_tac n) |
992 |
apply (simp add: eqpoll_0_iff, clarify) |
|
46953 | 993 |
apply (subgoal_tac "\<exists>u. u \<in> A") |
13244 | 994 |
apply (erule exE) |
46471 | 995 |
apply (rule Diff_sing_eqpoll [elim_format]) |
13244 | 996 |
prefer 2 apply assumption |
997 |
apply assumption |
|
13784 | 998 |
apply (rule_tac b = A in cons_Diff [THEN subst], assumption) |
13244 | 999 |
apply (rule Fin.consI, blast) |
1000 |
apply (blast intro: subset_consI [THEN Fin_mono, THEN subsetD]) |
|
1001 |
(*Now for the lemma assumed above*) |
|
1002 |
apply (unfold eqpoll_def) |
|
1003 |
apply (blast intro: bij_converse_bij [THEN bij_is_fun, THEN apply_type]) |
|
1004 |
done |
|
1005 |
||
46820 | 1006 |
lemma Finite_into_Fin: "Finite(A) ==> A \<in> Fin(A)" |
13244 | 1007 |
apply (unfold Finite_def) |
1008 |
apply (blast intro: Fin_lemma) |
|
1009 |
done |
|
1010 |
||
46820 | 1011 |
lemma Fin_into_Finite: "A \<in> Fin(U) ==> Finite(A)" |
13244 | 1012 |
by (fast intro!: Finite_0 Finite_cons elim: Fin_induct) |
1013 |
||
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
46820
diff
changeset
|
1014 |
lemma Finite_Fin_iff: "Finite(A) \<longleftrightarrow> A \<in> Fin(A)" |
13244 | 1015 |
by (blast intro: Finite_into_Fin Fin_into_Finite) |
1016 |
||
46820 | 1017 |
lemma Finite_Un: "[| Finite(A); Finite(B) |] ==> Finite(A \<union> B)" |
1018 |
by (blast intro!: Fin_into_Finite Fin_UnI |
|
13244 | 1019 |
dest!: Finite_into_Fin |
46820 | 1020 |
intro: Un_upper1 [THEN Fin_mono, THEN subsetD] |
13244 | 1021 |
Un_upper2 [THEN Fin_mono, THEN subsetD]) |
1022 |
||
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
46820
diff
changeset
|
1023 |
lemma Finite_Un_iff [simp]: "Finite(A \<union> B) \<longleftrightarrow> (Finite(A) & Finite(B))" |
46820 | 1024 |
by (blast intro: subset_Finite Finite_Un) |
14883 | 1025 |
|
60770 | 1026 |
text\<open>The converse must hold too.\<close> |
46820 | 1027 |
lemma Finite_Union: "[| \<forall>y\<in>X. Finite(y); Finite(X) |] ==> Finite(\<Union>(X))" |
13244 | 1028 |
apply (simp add: Finite_Fin_iff) |
1029 |
apply (rule Fin_UnionI) |
|
1030 |
apply (erule Fin_induct, simp) |
|
1031 |
apply (blast intro: Fin.consI Fin_mono [THEN [2] rev_subsetD]) |
|
1032 |
done |
|
1033 |
||
1034 |
(* Induction principle for Finite(A), by Sidi Ehmety *) |
|
13524 | 1035 |
lemma Finite_induct [case_names 0 cons, induct set: Finite]: |
13244 | 1036 |
"[| Finite(A); P(0); |
46820 | 1037 |
!! x B. [| Finite(B); x \<notin> B; P(B) |] ==> P(cons(x, B)) |] |
13244 | 1038 |
==> P(A)" |
46820 | 1039 |
apply (erule Finite_into_Fin [THEN Fin_induct]) |
13244 | 1040 |
apply (blast intro: Fin_into_Finite)+ |
1041 |
done |
|
1042 |
||
1043 |
(*Sidi Ehmety. The contrapositive says ~Finite(A) ==> ~Finite(A-{a}) *) |
|
1044 |
lemma Diff_sing_Finite: "Finite(A - {a}) ==> Finite(A)" |
|
1045 |
apply (unfold Finite_def) |
|
46877 | 1046 |
apply (case_tac "a \<in> A") |
13244 | 1047 |
apply (subgoal_tac [2] "A-{a}=A", auto) |
1048 |
apply (rule_tac x = "succ (n) " in bexI) |
|
1049 |
apply (subgoal_tac "cons (a, A - {a}) = A & cons (n, n) = succ (n) ") |
|
13784 | 1050 |
apply (drule_tac a = a and b = n in cons_eqpoll_cong) |
13244 | 1051 |
apply (auto dest: mem_irrefl) |
1052 |
done |
|
1053 |
||
1054 |
(*Sidi Ehmety. And the contrapositive of this says |
|
1055 |
[| ~Finite(A); Finite(B) |] ==> ~Finite(A-B) *) |
|
46820 | 1056 |
lemma Diff_Finite [rule_format]: "Finite(B) ==> Finite(A-B) \<longrightarrow> Finite(A)" |
13244 | 1057 |
apply (erule Finite_induct, auto) |
46953 | 1058 |
apply (case_tac "x \<in> A") |
13244 | 1059 |
apply (subgoal_tac [2] "A-cons (x, B) = A - B") |
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13524
diff
changeset
|
1060 |
apply (subgoal_tac "A - cons (x, B) = (A - B) - {x}", simp) |
13244 | 1061 |
apply (drule Diff_sing_Finite, auto) |
1062 |
done |
|
1063 |
||
1064 |
lemma Finite_RepFun: "Finite(A) ==> Finite(RepFun(A,f))" |
|
1065 |
by (erule Finite_induct, simp_all) |
|
1066 |
||
1067 |
lemma Finite_RepFun_iff_lemma [rule_format]: |
|
46820 | 1068 |
"[|Finite(x); !!x y. f(x)=f(y) ==> x=y|] |
1069 |
==> \<forall>A. x = RepFun(A,f) \<longrightarrow> Finite(A)" |
|
13244 | 1070 |
apply (erule Finite_induct) |
46820 | 1071 |
apply clarify |
13244 | 1072 |
apply (case_tac "A=0", simp) |
46820 | 1073 |
apply (blast del: allE, clarify) |
1074 |
apply (subgoal_tac "\<exists>z\<in>A. x = f(z)") |
|
1075 |
prefer 2 apply (blast del: allE elim: equalityE, clarify) |
|
13244 | 1076 |
apply (subgoal_tac "B = {f(u) . u \<in> A - {z}}") |
46820 | 1077 |
apply (blast intro: Diff_sing_Finite) |
59788 | 1078 |
apply (thin_tac "\<forall>A. P(A) \<longrightarrow> Finite(A)" for P) |
46820 | 1079 |
apply (rule equalityI) |
1080 |
apply (blast intro: elim: equalityE) |
|
1081 |
apply (blast intro: elim: equalityCE) |
|
13244 | 1082 |
done |
1083 |
||
60770 | 1084 |
text\<open>I don't know why, but if the premise is expressed using meta-connectives |
1085 |
then the simplifier cannot prove it automatically in conditional rewriting.\<close> |
|
13244 | 1086 |
lemma Finite_RepFun_iff: |
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
46820
diff
changeset
|
1087 |
"(\<forall>x y. f(x)=f(y) \<longrightarrow> x=y) ==> Finite(RepFun(A,f)) \<longleftrightarrow> Finite(A)" |
46820 | 1088 |
by (blast intro: Finite_RepFun Finite_RepFun_iff_lemma [of _ f]) |
13244 | 1089 |
|
1090 |
lemma Finite_Pow: "Finite(A) ==> Finite(Pow(A))" |
|
46820 | 1091 |
apply (erule Finite_induct) |
1092 |
apply (simp_all add: Pow_insert Finite_Un Finite_RepFun) |
|
13244 | 1093 |
done |
1094 |
||
1095 |
lemma Finite_Pow_imp_Finite: "Finite(Pow(A)) ==> Finite(A)" |
|
1096 |
apply (subgoal_tac "Finite({{x} . x \<in> A})") |
|
46820 | 1097 |
apply (simp add: Finite_RepFun_iff ) |
1098 |
apply (blast intro: subset_Finite) |
|
13244 | 1099 |
done |
1100 |
||
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
46820
diff
changeset
|
1101 |
lemma Finite_Pow_iff [iff]: "Finite(Pow(A)) \<longleftrightarrow> Finite(A)" |
13244 | 1102 |
by (blast intro: Finite_Pow Finite_Pow_imp_Finite) |
1103 |
||
47101 | 1104 |
lemma Finite_cardinal_iff: |
1105 |
assumes i: "Ord(i)" shows "Finite(|i|) \<longleftrightarrow> Finite(i)" |
|
1106 |
by (auto simp add: Finite_def) (blast intro: eqpoll_trans eqpoll_sym Ord_cardinal_eqpoll [OF i])+ |
|
13244 | 1107 |
|
13221 | 1108 |
|
1109 |
(*Krzysztof Grabczewski's proof that the converse of a finite, well-ordered |
|
1110 |
set is well-ordered. Proofs simplified by lcp. *) |
|
1111 |
||
46877 | 1112 |
lemma nat_wf_on_converse_Memrel: "n \<in> nat ==> wf[n](converse(Memrel(n)))" |
47018 | 1113 |
proof (induct n rule: nat_induct) |
1114 |
case 0 thus ?case by (blast intro: wf_onI) |
|
1115 |
next |
|
1116 |
case (succ x) |
|
1117 |
hence wfx: "\<And>Z. Z = 0 \<or> (\<exists>z\<in>Z. \<forall>y. z \<in> y \<and> z \<in> x \<and> y \<in> x \<and> z \<in> x \<longrightarrow> y \<notin> Z)" |
|
60770 | 1118 |
by (simp add: wf_on_def wf_def) --\<open>not easy to erase the duplicate @{term"z \<in> x"}!\<close> |
47018 | 1119 |
show ?case |
1120 |
proof (rule wf_onI) |
|
1121 |
fix Z u |
|
1122 |
assume Z: "u \<in> Z" "\<forall>z\<in>Z. \<exists>y\<in>Z. \<langle>y, z\<rangle> \<in> converse(Memrel(succ(x)))" |
|
1123 |
show False |
|
1124 |
proof (cases "x \<in> Z") |
|
1125 |
case True thus False using Z |
|
1126 |
by (blast elim: mem_irrefl mem_asym) |
|
1127 |
next |
|
1128 |
case False thus False using wfx [of Z] Z |
|
1129 |
by blast |
|
1130 |
qed |
|
1131 |
qed |
|
1132 |
qed |
|
13221 | 1133 |
|
46877 | 1134 |
lemma nat_well_ord_converse_Memrel: "n \<in> nat ==> well_ord(n,converse(Memrel(n)))" |
13221 | 1135 |
apply (frule Ord_nat [THEN Ord_in_Ord, THEN well_ord_Memrel]) |
47018 | 1136 |
apply (simp add: well_ord_def tot_ord_converse nat_wf_on_converse_Memrel) |
13221 | 1137 |
done |
1138 |
||
1139 |
lemma well_ord_converse: |
|
46820 | 1140 |
"[|well_ord(A,r); |
13221 | 1141 |
well_ord(ordertype(A,r), converse(Memrel(ordertype(A, r)))) |] |
1142 |
==> well_ord(A,converse(r))" |
|
1143 |
apply (rule well_ord_Int_iff [THEN iffD1]) |
|
1144 |
apply (frule ordermap_bij [THEN bij_is_inj, THEN well_ord_rvimage], assumption) |
|
1145 |
apply (simp add: rvimage_converse converse_Int converse_prod |
|
1146 |
ordertype_ord_iso [THEN ord_iso_rvimage_eq]) |
|
1147 |
done |
|
1148 |
||
1149 |
lemma ordertype_eq_n: |
|
46953 | 1150 |
assumes r: "well_ord(A,r)" and A: "A \<approx> n" and n: "n \<in> nat" |
46877 | 1151 |
shows "ordertype(A,r) = n" |
1152 |
proof - |
|
46953 | 1153 |
have "ordertype(A,r) \<approx> A" |
1154 |
by (blast intro: bij_imp_eqpoll bij_converse_bij ordermap_bij r) |
|
46877 | 1155 |
also have "... \<approx> n" by (rule A) |
1156 |
finally have "ordertype(A,r) \<approx> n" . |
|
1157 |
thus ?thesis |
|
46953 | 1158 |
by (simp add: Ord_nat_eqpoll_iff Ord_ordertype n r) |
46877 | 1159 |
qed |
13221 | 1160 |
|
46820 | 1161 |
lemma Finite_well_ord_converse: |
13221 | 1162 |
"[| Finite(A); well_ord(A,r) |] ==> well_ord(A,converse(r))" |
1163 |
apply (unfold Finite_def) |
|
1164 |
apply (rule well_ord_converse, assumption) |
|
1165 |
apply (blast dest: ordertype_eq_n intro!: nat_well_ord_converse_Memrel) |
|
1166 |
done |
|
1167 |
||
46877 | 1168 |
lemma nat_into_Finite: "n \<in> nat ==> Finite(n)" |
47018 | 1169 |
by (auto simp add: Finite_def intro: eqpoll_refl) |
13221 | 1170 |
|
46877 | 1171 |
lemma nat_not_Finite: "~ Finite(nat)" |
1172 |
proof - |
|
1173 |
{ fix n |
|
1174 |
assume n: "n \<in> nat" "nat \<approx> n" |
|
46953 | 1175 |
have "n \<in> nat" by (rule n) |
46877 | 1176 |
also have "... = n" using n |
46953 | 1177 |
by (simp add: Ord_nat_eqpoll_iff Ord_nat) |
46877 | 1178 |
finally have "n \<in> n" . |
46953 | 1179 |
hence False |
1180 |
by (blast elim: mem_irrefl) |
|
46877 | 1181 |
} |
1182 |
thus ?thesis |
|
46953 | 1183 |
by (auto simp add: Finite_def) |
46877 | 1184 |
qed |
14076 | 1185 |
|
435 | 1186 |
end |