author | paulson |
Thu, 15 Mar 2012 17:38:05 +0000 | |
changeset 46954 | d8b3412cdb99 |
parent 46821 | ff6b0c1087f2 |
child 46963 | 67da5904300a |
permissions | -rw-r--r-- |
1478 | 1 |
(* Title: ZF/Cardinal_AC.thy |
2 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
484 | 3 |
Copyright 1994 University of Cambridge |
4 |
||
13134 | 5 |
These results help justify infinite-branching datatypes |
484 | 6 |
*) |
7 |
||
13328 | 8 |
header{*Cardinal Arithmetic Using AC*} |
9 |
||
16417 | 10 |
theory Cardinal_AC imports CardinalArith Zorn begin |
13134 | 11 |
|
13356 | 12 |
subsection{*Strengthened Forms of Existing Theorems on Cardinals*} |
13134 | 13 |
|
46954 | 14 |
lemma cardinal_eqpoll: "|A| \<approx> A" |
13134 | 15 |
apply (rule AC_well_ord [THEN exE]) |
16 |
apply (erule well_ord_cardinal_eqpoll) |
|
17 |
done |
|
18 |
||
14046 | 19 |
text{*The theorem @{term "||A|| = |A|"} *} |
45602 | 20 |
lemmas cardinal_idem = cardinal_eqpoll [THEN cardinal_cong, simp] |
13134 | 21 |
|
46954 | 22 |
lemma cardinal_eqE: "|X| = |Y| ==> X \<approx> Y" |
13134 | 23 |
apply (rule AC_well_ord [THEN exE]) |
24 |
apply (rule AC_well_ord [THEN exE]) |
|
13269 | 25 |
apply (rule well_ord_cardinal_eqE, assumption+) |
13134 | 26 |
done |
27 |
||
46954 | 28 |
lemma cardinal_eqpoll_iff: "|X| = |Y| \<longleftrightarrow> X \<approx> Y" |
13269 | 29 |
by (blast intro: cardinal_cong cardinal_eqE) |
13134 | 30 |
|
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13356
diff
changeset
|
31 |
lemma cardinal_disjoint_Un: |
46820 | 32 |
"[| |A|=|B|; |C|=|D|; A \<inter> C = 0; B \<inter> D = 0 |] |
33 |
==> |A \<union> C| = |B \<union> D|" |
|
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13356
diff
changeset
|
34 |
by (simp add: cardinal_eqpoll_iff eqpoll_disjoint_Un) |
13134 | 35 |
|
46954 | 36 |
lemma lepoll_imp_Card_le: "A \<lesssim> B ==> |A| \<le> |B|" |
13134 | 37 |
apply (rule AC_well_ord [THEN exE]) |
13269 | 38 |
apply (erule well_ord_lepoll_imp_Card_le, assumption) |
13134 | 39 |
done |
40 |
||
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
46820
diff
changeset
|
41 |
lemma cadd_assoc: "(i \<oplus> j) \<oplus> k = i \<oplus> (j \<oplus> k)" |
13134 | 42 |
apply (rule AC_well_ord [THEN exE]) |
43 |
apply (rule AC_well_ord [THEN exE]) |
|
44 |
apply (rule AC_well_ord [THEN exE]) |
|
13269 | 45 |
apply (rule well_ord_cadd_assoc, assumption+) |
13134 | 46 |
done |
47 |
||
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
46820
diff
changeset
|
48 |
lemma cmult_assoc: "(i \<otimes> j) \<otimes> k = i \<otimes> (j \<otimes> k)" |
13134 | 49 |
apply (rule AC_well_ord [THEN exE]) |
50 |
apply (rule AC_well_ord [THEN exE]) |
|
51 |
apply (rule AC_well_ord [THEN exE]) |
|
13269 | 52 |
apply (rule well_ord_cmult_assoc, assumption+) |
13134 | 53 |
done |
54 |
||
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
46820
diff
changeset
|
55 |
lemma cadd_cmult_distrib: "(i \<oplus> j) \<otimes> k = (i \<otimes> k) \<oplus> (j \<otimes> k)" |
13134 | 56 |
apply (rule AC_well_ord [THEN exE]) |
57 |
apply (rule AC_well_ord [THEN exE]) |
|
58 |
apply (rule AC_well_ord [THEN exE]) |
|
13269 | 59 |
apply (rule well_ord_cadd_cmult_distrib, assumption+) |
13134 | 60 |
done |
61 |
||
46954 | 62 |
lemma InfCard_square_eq: "InfCard(|A|) ==> A*A \<approx> A" |
13134 | 63 |
apply (rule AC_well_ord [THEN exE]) |
13269 | 64 |
apply (erule well_ord_InfCard_square_eq, assumption) |
13134 | 65 |
done |
66 |
||
67 |
||
14046 | 68 |
subsection {*The relationship between cardinality and le-pollence*} |
13134 | 69 |
|
46954 | 70 |
lemma Card_le_imp_lepoll: |
71 |
assumes "|A| \<le> |B|" shows "A \<lesssim> B" |
|
72 |
proof - |
|
73 |
have "A \<approx> |A|" |
|
74 |
by (rule cardinal_eqpoll [THEN eqpoll_sym]) |
|
75 |
also have "... \<lesssim> |B|" |
|
76 |
by (rule le_imp_subset [THEN subset_imp_lepoll]) (rule assms) |
|
77 |
also have "... \<approx> B" |
|
78 |
by (rule cardinal_eqpoll) |
|
79 |
finally show ?thesis . |
|
80 |
qed |
|
13134 | 81 |
|
46954 | 82 |
lemma le_Card_iff: "Card(K) ==> |A| \<le> K \<longleftrightarrow> A \<lesssim> K" |
46820 | 83 |
apply (erule Card_cardinal_eq [THEN subst], rule iffI, |
13269 | 84 |
erule Card_le_imp_lepoll) |
46820 | 85 |
apply (erule lepoll_imp_Card_le) |
13134 | 86 |
done |
87 |
||
46954 | 88 |
lemma cardinal_0_iff_0 [simp]: "|A| = 0 \<longleftrightarrow> A = 0" |
46820 | 89 |
apply auto |
14046 | 90 |
apply (drule cardinal_0 [THEN ssubst]) |
91 |
apply (blast intro: eqpoll_0_iff [THEN iffD1] cardinal_eqpoll_iff [THEN iffD1]) |
|
92 |
done |
|
93 |
||
46954 | 94 |
lemma cardinal_lt_iff_lesspoll: |
95 |
assumes i: "Ord(i)" shows "i < |A| \<longleftrightarrow> i \<prec> A" |
|
96 |
proof |
|
97 |
assume "i < |A|" |
|
98 |
hence "i \<prec> |A|" |
|
99 |
by (blast intro: lt_Card_imp_lesspoll Card_cardinal) |
|
100 |
also have "... \<approx> A" |
|
101 |
by (rule cardinal_eqpoll) |
|
102 |
finally show "i \<prec> A" . |
|
103 |
next |
|
104 |
assume "i \<prec> A" |
|
105 |
also have "... \<approx> |A|" |
|
106 |
by (blast intro: cardinal_eqpoll eqpoll_sym) |
|
107 |
finally have "i \<prec> |A|" . |
|
108 |
thus "i < |A|" using i |
|
109 |
by (force intro: cardinal_lt_imp_lt lesspoll_cardinal_lt) |
|
110 |
qed |
|
14046 | 111 |
|
112 |
lemma cardinal_le_imp_lepoll: " i \<le> |A| ==> i \<lesssim> A" |
|
46954 | 113 |
by (blast intro: lt_Ord Card_le_imp_lepoll Ord_cardinal_le le_trans) |
14046 | 114 |
|
115 |
||
116 |
subsection{*Other Applications of AC*} |
|
117 |
||
46820 | 118 |
lemma surj_implies_inj: "f: surj(X,Y) ==> \<exists>g. g: inj(Y,X)" |
13134 | 119 |
apply (unfold surj_def) |
120 |
apply (erule CollectE) |
|
13784 | 121 |
apply (rule_tac A1 = Y and B1 = "%y. f-``{y}" in AC_Pi [THEN exE]) |
13134 | 122 |
apply (fast elim!: apply_Pair) |
46820 | 123 |
apply (blast dest: apply_type Pi_memberD |
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13356
diff
changeset
|
124 |
intro: apply_equality Pi_type f_imp_injective) |
13134 | 125 |
done |
126 |
||
127 |
(*Kunen's Lemma 10.20*) |
|
46820 | 128 |
lemma surj_implies_cardinal_le: "f: surj(X,Y) ==> |Y| \<le> |X|" |
13134 | 129 |
apply (rule lepoll_imp_Card_le) |
130 |
apply (erule surj_implies_inj [THEN exE]) |
|
131 |
apply (unfold lepoll_def) |
|
132 |
apply (erule exI) |
|
133 |
done |
|
134 |
||
135 |
(*Kunen's Lemma 10.21*) |
|
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13356
diff
changeset
|
136 |
lemma cardinal_UN_le: |
46820 | 137 |
"[| InfCard(K); \<forall>i\<in>K. |X(i)| \<le> K |] ==> |\<Union>i\<in>K. X(i)| \<le> K" |
13134 | 138 |
apply (simp add: InfCard_is_Card le_Card_iff) |
139 |
apply (rule lepoll_trans) |
|
140 |
prefer 2 |
|
141 |
apply (rule InfCard_square_eq [THEN eqpoll_imp_lepoll]) |
|
142 |
apply (simp add: InfCard_is_Card Card_cardinal_eq) |
|
143 |
apply (unfold lepoll_def) |
|
144 |
apply (frule InfCard_is_Card [THEN Card_is_Ord]) |
|
145 |
apply (erule AC_ball_Pi [THEN exE]) |
|
146 |
apply (rule exI) |
|
147 |
(*Lemma needed in both subgoals, for a fixed z*) |
|
46820 | 148 |
apply (subgoal_tac "\<forall>z\<in>(\<Union>i\<in>K. X (i)). z: X (LEAST i. z:X (i)) & |
149 |
(LEAST i. z:X (i)) \<in> K") |
|
13134 | 150 |
prefer 2 |
151 |
apply (fast intro!: Least_le [THEN lt_trans1, THEN ltD] ltI |
|
152 |
elim!: LeastI Ord_in_Ord) |
|
46820 | 153 |
apply (rule_tac c = "%z. <LEAST i. z:X (i), f ` (LEAST i. z:X (i)) ` z>" |
13134 | 154 |
and d = "%<i,j>. converse (f`i) ` j" in lam_injective) |
155 |
(*Instantiate the lemma proved above*) |
|
13269 | 156 |
by (blast intro: inj_is_fun [THEN apply_type] dest: apply_type, force) |
13134 | 157 |
|
158 |
||
159 |
(*The same again, using csucc*) |
|
160 |
lemma cardinal_UN_lt_csucc: |
|
46820 | 161 |
"[| InfCard(K); \<forall>i\<in>K. |X(i)| < csucc(K) |] |
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13356
diff
changeset
|
162 |
==> |\<Union>i\<in>K. X(i)| < csucc(K)" |
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13356
diff
changeset
|
163 |
by (simp add: Card_lt_csucc_iff cardinal_UN_le InfCard_is_Card Card_cardinal) |
13134 | 164 |
|
165 |
(*The same again, for a union of ordinals. In use, j(i) is a bit like rank(i), |
|
166 |
the least ordinal j such that i:Vfrom(A,j). *) |
|
167 |
lemma cardinal_UN_Ord_lt_csucc: |
|
46820 | 168 |
"[| InfCard(K); \<forall>i\<in>K. j(i) < csucc(K) |] |
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13356
diff
changeset
|
169 |
==> (\<Union>i\<in>K. j(i)) < csucc(K)" |
13269 | 170 |
apply (rule cardinal_UN_lt_csucc [THEN Card_lt_imp_lt], assumption) |
13134 | 171 |
apply (blast intro: Ord_cardinal_le [THEN lt_trans1] elim: ltE) |
172 |
apply (blast intro!: Ord_UN elim: ltE) |
|
173 |
apply (erule InfCard_is_Card [THEN Card_is_Ord, THEN Card_csucc]) |
|
174 |
done |
|
175 |
||
176 |
||
177 |
(** Main result for infinite-branching datatypes. As above, but the index |
|
178 |
set need not be a cardinal. Surprisingly complicated proof! |
|
179 |
**) |
|
180 |
||
46954 | 181 |
text{*Work backwards along the injection from @{term W} into @{term K}, given that @{term"W\<noteq>0"}.*} |
182 |
||
13134 | 183 |
lemma inj_UN_subset: |
46954 | 184 |
assumes f: "f \<in> inj(A,B)" and a: "a \<in> A" |
185 |
shows "(\<Union>x\<in>A. C(x)) \<subseteq> (\<Union>y\<in>B. C(if y \<in> range(f) then converse(f)`y else a))" |
|
186 |
proof (rule UN_least) |
|
187 |
fix x |
|
188 |
assume x: "x \<in> A" |
|
189 |
hence fx: "f ` x \<in> B" by (blast intro: f inj_is_fun [THEN apply_type]) |
|
190 |
have "C(x) \<subseteq> C(if f ` x \<in> range(f) then converse(f) ` (f ` x) else a)" |
|
191 |
using f x by (simp add: inj_is_fun [THEN apply_rangeI]) |
|
192 |
also have "... \<subseteq> (\<Union>y\<in>B. C(if y \<in> range(f) then converse(f) ` y else a))" |
|
193 |
by (rule UN_upper [OF fx]) |
|
194 |
finally show "C(x) \<subseteq> (\<Union>y\<in>B. C(if y \<in> range(f) then converse(f)`y else a))" . |
|
195 |
qed |
|
13134 | 196 |
|
197 |
(*Simpler to require |W|=K; we'd have a bijection; but the theorem would |
|
198 |
be weaker.*) |
|
199 |
lemma le_UN_Ord_lt_csucc: |
|
46820 | 200 |
"[| InfCard(K); |W| \<le> K; \<forall>w\<in>W. j(w) < csucc(K) |] |
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13356
diff
changeset
|
201 |
==> (\<Union>w\<in>W. j(w)) < csucc(K)" |
13134 | 202 |
apply (case_tac "W=0") |
203 |
(*solve the easy 0 case*) |
|
46820 | 204 |
apply (simp add: InfCard_is_Card Card_is_Ord [THEN Card_csucc] |
13134 | 205 |
Card_is_Ord Ord_0_lt_csucc) |
206 |
apply (simp add: InfCard_is_Card le_Card_iff lepoll_def) |
|
207 |
apply (safe intro!: equalityI) |
|
46820 | 208 |
apply (erule swap) |
13269 | 209 |
apply (rule lt_subset_trans [OF inj_UN_subset cardinal_UN_Ord_lt_csucc], assumption+) |
13134 | 210 |
apply (simp add: inj_converse_fun [THEN apply_type]) |
211 |
apply (blast intro!: Ord_UN elim: ltE) |
|
212 |
done |
|
213 |
||
214 |
end |