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