author | wenzelm |
Fri, 09 Oct 2020 12:01:35 +0200 | |
changeset 72408 | 2daa5f549687 |
parent 71417 | 89d05db6dd1f |
child 72797 | 402afc68f2f9 |
permissions | -rw-r--r-- |
13634 | 1 |
(* Title: ZF/Constructible/Rank.thy |
2 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
3 |
*) |
|
4 |
||
60770 | 5 |
section \<open>Absoluteness for Order Types, Rank Functions and Well-Founded |
6 |
Relations\<close> |
|
13634 | 7 |
|
16417 | 8 |
theory Rank imports WF_absolute begin |
13634 | 9 |
|
60770 | 10 |
subsection \<open>Order Types: A Direct Construction by Replacement\<close> |
13634 | 11 |
|
12 |
locale M_ordertype = M_basic + |
|
13 |
assumes well_ord_iso_separation: |
|
14 |
"[| M(A); M(f); M(r) |] |
|
46823 | 15 |
==> separation (M, \<lambda>x. x\<in>A \<longrightarrow> (\<exists>y[M]. (\<exists>p[M]. |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
16 |
fun_apply(M,f,x,y) & pair(M,y,x,p) & p \<in> r)))" |
13634 | 17 |
and obase_separation: |
67443
3abf6a722518
standardized towards new-style formal comments: isabelle update_comments;
wenzelm
parents:
67399
diff
changeset
|
18 |
\<comment> \<open>part of the order type formalization\<close> |
13634 | 19 |
"[| M(A); M(r) |] |
20 |
==> separation(M, \<lambda>a. \<exists>x[M]. \<exists>g[M]. \<exists>mx[M]. \<exists>par[M]. |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
21 |
ordinal(M,x) & membership(M,x,mx) & pred_set(M,A,a,r,par) & |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
22 |
order_isomorphism(M,par,r,x,mx,g))" |
13634 | 23 |
and obase_equals_separation: |
24 |
"[| M(A); M(r) |] |
|
46823 | 25 |
==> separation (M, \<lambda>x. x\<in>A \<longrightarrow> ~(\<exists>y[M]. \<exists>g[M]. |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
26 |
ordinal(M,y) & (\<exists>my[M]. \<exists>pxr[M]. |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
27 |
membership(M,y,my) & pred_set(M,A,x,r,pxr) & |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
28 |
order_isomorphism(M,pxr,r,y,my,g))))" |
13634 | 29 |
and omap_replacement: |
30 |
"[| M(A); M(r) |] |
|
31 |
==> strong_replacement(M, |
|
32 |
\<lambda>a z. \<exists>x[M]. \<exists>g[M]. \<exists>mx[M]. \<exists>par[M]. |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
33 |
ordinal(M,x) & pair(M,a,x,z) & membership(M,x,mx) & |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
34 |
pred_set(M,A,a,r,par) & order_isomorphism(M,par,r,x,mx,g))" |
13634 | 35 |
|
36 |
||
60770 | 37 |
text\<open>Inductive argument for Kunen's Lemma I 6.1, etc. |
38 |
Simple proof from Halmos, page 72\<close> |
|
13634 | 39 |
lemma (in M_ordertype) wellordered_iso_subset_lemma: |
40 |
"[| wellordered(M,A,r); f \<in> ord_iso(A,r, A',r); A'<= A; y \<in> A; |
|
41 |
M(A); M(f); M(r) |] ==> ~ <f`y, y> \<in> r" |
|
42 |
apply (unfold wellordered_def ord_iso_def) |
|
43 |
apply (elim conjE CollectE) |
|
44 |
apply (erule wellfounded_on_induct, assumption+) |
|
45 |
apply (insert well_ord_iso_separation [of A f r]) |
|
46 |
apply (simp, clarify) |
|
47 |
apply (drule_tac a = x in bij_is_fun [THEN apply_type], assumption, blast) |
|
48 |
done |
|
49 |
||
50 |
||
60770 | 51 |
text\<open>Kunen's Lemma I 6.1, page 14: |
52 |
there's no order-isomorphism to an initial segment of a well-ordering\<close> |
|
13634 | 53 |
lemma (in M_ordertype) wellordered_iso_predD: |
54 |
"[| wellordered(M,A,r); f \<in> ord_iso(A, r, Order.pred(A,x,r), r); |
|
55 |
M(A); M(f); M(r) |] ==> x \<notin> A" |
|
56 |
apply (rule notI) |
|
57 |
apply (frule wellordered_iso_subset_lemma, assumption) |
|
58 |
apply (auto elim: predE) |
|
59 |
(*Now we know ~ (f`x < x) *) |
|
60 |
apply (drule ord_iso_is_bij [THEN bij_is_fun, THEN apply_type], assumption) |
|
61 |
(*Now we also know f`x \<in> pred(A,x,r); contradiction! *) |
|
62 |
apply (simp add: Order.pred_def) |
|
63 |
done |
|
64 |
||
65 |
||
66 |
lemma (in M_ordertype) wellordered_iso_pred_eq_lemma: |
|
67 |
"[| f \<in> \<langle>Order.pred(A,y,r), r\<rangle> \<cong> \<langle>Order.pred(A,x,r), r\<rangle>; |
|
68 |
wellordered(M,A,r); x\<in>A; y\<in>A; M(A); M(f); M(r) |] ==> <x,y> \<notin> r" |
|
69 |
apply (frule wellordered_is_trans_on, assumption) |
|
70 |
apply (rule notI) |
|
71 |
apply (drule_tac x2=y and x=x and r2=r in |
|
72 |
wellordered_subset [OF _ pred_subset, THEN wellordered_iso_predD]) |
|
73 |
apply (simp add: trans_pred_pred_eq) |
|
74 |
apply (blast intro: predI dest: transM)+ |
|
75 |
done |
|
76 |
||
77 |
||
60770 | 78 |
text\<open>Simple consequence of Lemma 6.1\<close> |
13634 | 79 |
lemma (in M_ordertype) wellordered_iso_pred_eq: |
80 |
"[| wellordered(M,A,r); |
|
81 |
f \<in> ord_iso(Order.pred(A,a,r), r, Order.pred(A,c,r), r); |
|
82 |
M(A); M(f); M(r); a\<in>A; c\<in>A |] ==> a=c" |
|
83 |
apply (frule wellordered_is_trans_on, assumption) |
|
84 |
apply (frule wellordered_is_linear, assumption) |
|
85 |
apply (erule_tac x=a and y=c in linearE, auto) |
|
86 |
apply (drule ord_iso_sym) |
|
87 |
(*two symmetric cases*) |
|
88 |
apply (blast dest: wellordered_iso_pred_eq_lemma)+ |
|
89 |
done |
|
90 |
||
91 |
||
60770 | 92 |
text\<open>Following Kunen's Theorem I 7.6, page 17. Note that this material is |
93 |
not required elsewhere.\<close> |
|
13634 | 94 |
|
61798 | 95 |
text\<open>Can't use \<open>well_ord_iso_preserving\<close> because it needs the |
69593 | 96 |
strong premise \<^term>\<open>well_ord(A,r)\<close>\<close> |
13634 | 97 |
lemma (in M_ordertype) ord_iso_pred_imp_lt: |
98 |
"[| f \<in> ord_iso(Order.pred(A,x,r), r, i, Memrel(i)); |
|
99 |
g \<in> ord_iso(Order.pred(A,y,r), r, j, Memrel(j)); |
|
100 |
wellordered(M,A,r); x \<in> A; y \<in> A; M(A); M(r); M(f); M(g); M(j); |
|
101 |
Ord(i); Ord(j); \<langle>x,y\<rangle> \<in> r |] |
|
102 |
==> i < j" |
|
103 |
apply (frule wellordered_is_trans_on, assumption) |
|
104 |
apply (frule_tac y=y in transM, assumption) |
|
105 |
apply (rule_tac i=i and j=j in Ord_linear_lt, auto) |
|
69593 | 106 |
txt\<open>case \<^term>\<open>i=j\<close> yields a contradiction\<close> |
13634 | 107 |
apply (rule_tac x1=x and A1="Order.pred(A,y,r)" in |
108 |
wellordered_iso_predD [THEN notE]) |
|
109 |
apply (blast intro: wellordered_subset [OF _ pred_subset]) |
|
110 |
apply (simp add: trans_pred_pred_eq) |
|
111 |
apply (blast intro: Ord_iso_implies_eq ord_iso_sym ord_iso_trans) |
|
71417
89d05db6dd1f
Simplified, generalised version of Constructible due to E. Gunther, M. Pagano and P. Sánchez Terraf
paulson <lp15@cam.ac.uk>
parents:
69593
diff
changeset
|
112 |
apply (simp_all add: pred_iff) |
69593 | 113 |
txt\<open>case \<^term>\<open>j<i\<close> also yields a contradiction\<close> |
13634 | 114 |
apply (frule restrict_ord_iso2, assumption+) |
115 |
apply (frule ord_iso_sym [THEN ord_iso_is_bij, THEN bij_is_fun]) |
|
116 |
apply (frule apply_type, blast intro: ltD) |
|
69593 | 117 |
\<comment> \<open>thus \<^term>\<open>converse(f)`j \<in> Order.pred(A,x,r)\<close>\<close> |
13634 | 118 |
apply (simp add: pred_iff) |
119 |
apply (subgoal_tac |
|
120 |
"\<exists>h[M]. h \<in> ord_iso(Order.pred(A,y,r), r, |
|
121 |
Order.pred(A, converse(f)`j, r), r)") |
|
122 |
apply (clarify, frule wellordered_iso_pred_eq, assumption+) |
|
123 |
apply (blast dest: wellordered_asym) |
|
124 |
apply (intro rexI) |
|
125 |
apply (blast intro: Ord_iso_implies_eq ord_iso_sym ord_iso_trans)+ |
|
126 |
done |
|
127 |
||
128 |
||
129 |
lemma ord_iso_converse1: |
|
130 |
"[| f: ord_iso(A,r,B,s); <b, f`a>: s; a:A; b:B |] |
|
13721 | 131 |
==> <converse(f) ` b, a> \<in> r" |
13634 | 132 |
apply (frule ord_iso_converse, assumption+) |
133 |
apply (blast intro: ord_iso_is_bij [THEN bij_is_fun, THEN apply_funtype]) |
|
134 |
apply (simp add: left_inverse_bij [OF ord_iso_is_bij]) |
|
135 |
done |
|
136 |
||
137 |
||
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21233
diff
changeset
|
138 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21233
diff
changeset
|
139 |
obase :: "[i=>o,i,i] => i" where |
67443
3abf6a722518
standardized towards new-style formal comments: isabelle update_comments;
wenzelm
parents:
67399
diff
changeset
|
140 |
\<comment> \<open>the domain of \<open>om\<close>, eventually shown to equal \<open>A\<close>\<close> |
13634 | 141 |
"obase(M,A,r) == {a\<in>A. \<exists>x[M]. \<exists>g[M]. Ord(x) & |
142 |
g \<in> ord_iso(Order.pred(A,a,r),r,x,Memrel(x))}" |
|
143 |
||
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21233
diff
changeset
|
144 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21233
diff
changeset
|
145 |
omap :: "[i=>o,i,i,i] => o" where |
67443
3abf6a722518
standardized towards new-style formal comments: isabelle update_comments;
wenzelm
parents:
67399
diff
changeset
|
146 |
\<comment> \<open>the function that maps wosets to order types\<close> |
13634 | 147 |
"omap(M,A,r,f) == |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
148 |
\<forall>z[M]. |
46823 | 149 |
z \<in> f \<longleftrightarrow> (\<exists>a\<in>A. \<exists>x[M]. \<exists>g[M]. z = <a,x> & Ord(x) & |
13634 | 150 |
g \<in> ord_iso(Order.pred(A,a,r),r,x,Memrel(x)))" |
151 |
||
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21233
diff
changeset
|
152 |
definition |
67443
3abf6a722518
standardized towards new-style formal comments: isabelle update_comments;
wenzelm
parents:
67399
diff
changeset
|
153 |
otype :: "[i=>o,i,i,i] => o" where \<comment> \<open>the order types themselves\<close> |
13634 | 154 |
"otype(M,A,r,i) == \<exists>f[M]. omap(M,A,r,f) & is_range(M,f,i)" |
155 |
||
156 |
||
69593 | 157 |
text\<open>Can also be proved with the premise \<^term>\<open>M(z)\<close> instead of |
158 |
\<^term>\<open>M(f)\<close>, but that version is less useful. This lemma |
|
61798 | 159 |
is also more useful than the definition, \<open>omap_def\<close>.\<close> |
13634 | 160 |
lemma (in M_ordertype) omap_iff: |
161 |
"[| omap(M,A,r,f); M(A); M(f) |] |
|
46823 | 162 |
==> z \<in> f \<longleftrightarrow> |
13634 | 163 |
(\<exists>a\<in>A. \<exists>x[M]. \<exists>g[M]. z = <a,x> & Ord(x) & |
164 |
g \<in> ord_iso(Order.pred(A,a,r),r,x,Memrel(x)))" |
|
71417
89d05db6dd1f
Simplified, generalised version of Constructible due to E. Gunther, M. Pagano and P. Sánchez Terraf
paulson <lp15@cam.ac.uk>
parents:
69593
diff
changeset
|
165 |
apply (simp add: omap_def) |
13634 | 166 |
apply (rule iffI) |
167 |
apply (drule_tac [2] x=z in rspec) |
|
168 |
apply (drule_tac x=z in rspec) |
|
169 |
apply (blast dest: transM)+ |
|
170 |
done |
|
171 |
||
172 |
lemma (in M_ordertype) omap_unique: |
|
173 |
"[| omap(M,A,r,f); omap(M,A,r,f'); M(A); M(r); M(f); M(f') |] ==> f' = f" |
|
174 |
apply (rule equality_iffI) |
|
175 |
apply (simp add: omap_iff) |
|
176 |
done |
|
177 |
||
178 |
lemma (in M_ordertype) omap_yields_Ord: |
|
179 |
"[| omap(M,A,r,f); \<langle>a,x\<rangle> \<in> f; M(a); M(x) |] ==> Ord(x)" |
|
180 |
by (simp add: omap_def) |
|
181 |
||
182 |
lemma (in M_ordertype) otype_iff: |
|
183 |
"[| otype(M,A,r,i); M(A); M(r); M(i) |] |
|
46823 | 184 |
==> x \<in> i \<longleftrightarrow> |
13634 | 185 |
(M(x) & Ord(x) & |
186 |
(\<exists>a\<in>A. \<exists>g[M]. g \<in> ord_iso(Order.pred(A,a,r),r,x,Memrel(x))))" |
|
187 |
apply (auto simp add: omap_iff otype_def) |
|
188 |
apply (blast intro: transM) |
|
189 |
apply (rule rangeI) |
|
190 |
apply (frule transM, assumption) |
|
191 |
apply (simp add: omap_iff, blast) |
|
192 |
done |
|
193 |
||
194 |
lemma (in M_ordertype) otype_eq_range: |
|
195 |
"[| omap(M,A,r,f); otype(M,A,r,i); M(A); M(r); M(f); M(i) |] |
|
196 |
==> i = range(f)" |
|
197 |
apply (auto simp add: otype_def omap_iff) |
|
198 |
apply (blast dest: omap_unique) |
|
199 |
done |
|
200 |
||
201 |
||
202 |
lemma (in M_ordertype) Ord_otype: |
|
203 |
"[| otype(M,A,r,i); trans[A](r); M(A); M(r); M(i) |] ==> Ord(i)" |
|
204 |
apply (rule OrdI) |
|
205 |
prefer 2 |
|
206 |
apply (simp add: Ord_def otype_def omap_def) |
|
207 |
apply clarify |
|
208 |
apply (frule pair_components_in_M, assumption) |
|
209 |
apply blast |
|
210 |
apply (auto simp add: Transset_def otype_iff) |
|
211 |
apply (blast intro: transM) |
|
212 |
apply (blast intro: Ord_in_Ord) |
|
213 |
apply (rename_tac y a g) |
|
214 |
apply (frule ord_iso_sym [THEN ord_iso_is_bij, THEN bij_is_fun, |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
215 |
THEN apply_funtype], assumption) |
13634 | 216 |
apply (rule_tac x="converse(g)`y" in bexI) |
217 |
apply (frule_tac a="converse(g) ` y" in ord_iso_restrict_pred, assumption) |
|
218 |
apply (safe elim!: predE) |
|
219 |
apply (blast intro: restrict_ord_iso ord_iso_sym ltI dest: transM) |
|
220 |
done |
|
221 |
||
222 |
lemma (in M_ordertype) domain_omap: |
|
223 |
"[| omap(M,A,r,f); M(A); M(r); M(B); M(f) |] |
|
224 |
==> domain(f) = obase(M,A,r)" |
|
71417
89d05db6dd1f
Simplified, generalised version of Constructible due to E. Gunther, M. Pagano and P. Sánchez Terraf
paulson <lp15@cam.ac.uk>
parents:
69593
diff
changeset
|
225 |
apply (simp add: obase_def) |
13634 | 226 |
apply (rule equality_iffI) |
227 |
apply (simp add: domain_iff omap_iff, blast) |
|
228 |
done |
|
229 |
||
230 |
lemma (in M_ordertype) omap_subset: |
|
231 |
"[| omap(M,A,r,f); otype(M,A,r,i); |
|
232 |
M(A); M(r); M(f); M(B); M(i) |] ==> f \<subseteq> obase(M,A,r) * i" |
|
233 |
apply clarify |
|
234 |
apply (simp add: omap_iff obase_def) |
|
235 |
apply (force simp add: otype_iff) |
|
236 |
done |
|
237 |
||
238 |
lemma (in M_ordertype) omap_funtype: |
|
239 |
"[| omap(M,A,r,f); otype(M,A,r,i); |
|
240 |
M(A); M(r); M(f); M(i) |] ==> f \<in> obase(M,A,r) -> i" |
|
241 |
apply (simp add: domain_omap omap_subset Pi_iff function_def omap_iff) |
|
242 |
apply (blast intro: Ord_iso_implies_eq ord_iso_sym ord_iso_trans) |
|
243 |
done |
|
244 |
||
245 |
||
246 |
lemma (in M_ordertype) wellordered_omap_bij: |
|
247 |
"[| wellordered(M,A,r); omap(M,A,r,f); otype(M,A,r,i); |
|
248 |
M(A); M(r); M(f); M(i) |] ==> f \<in> bij(obase(M,A,r),i)" |
|
249 |
apply (insert omap_funtype [of A r f i]) |
|
250 |
apply (auto simp add: bij_def inj_def) |
|
251 |
prefer 2 apply (blast intro: fun_is_surj dest: otype_eq_range) |
|
252 |
apply (frule_tac a=w in apply_Pair, assumption) |
|
253 |
apply (frule_tac a=x in apply_Pair, assumption) |
|
254 |
apply (simp add: omap_iff) |
|
255 |
apply (blast intro: wellordered_iso_pred_eq ord_iso_sym ord_iso_trans) |
|
256 |
done |
|
257 |
||
258 |
||
69593 | 259 |
text\<open>This is not the final result: we must show \<^term>\<open>oB(A,r) = A\<close>\<close> |
13634 | 260 |
lemma (in M_ordertype) omap_ord_iso: |
261 |
"[| wellordered(M,A,r); omap(M,A,r,f); otype(M,A,r,i); |
|
262 |
M(A); M(r); M(f); M(i) |] ==> f \<in> ord_iso(obase(M,A,r),r,i,Memrel(i))" |
|
263 |
apply (rule ord_isoI) |
|
264 |
apply (erule wellordered_omap_bij, assumption+) |
|
265 |
apply (insert omap_funtype [of A r f i], simp) |
|
266 |
apply (frule_tac a=x in apply_Pair, assumption) |
|
267 |
apply (frule_tac a=y in apply_Pair, assumption) |
|
268 |
apply (auto simp add: omap_iff) |
|
69593 | 269 |
txt\<open>direction 1: assuming \<^term>\<open>\<langle>x,y\<rangle> \<in> r\<close>\<close> |
13634 | 270 |
apply (blast intro: ltD ord_iso_pred_imp_lt) |
69593 | 271 |
txt\<open>direction 2: proving \<^term>\<open>\<langle>x,y\<rangle> \<in> r\<close> using linearity of \<^term>\<open>r\<close>\<close> |
13634 | 272 |
apply (rename_tac x y g ga) |
273 |
apply (frule wellordered_is_linear, assumption, |
|
274 |
erule_tac x=x and y=y in linearE, assumption+) |
|
69593 | 275 |
txt\<open>the case \<^term>\<open>x=y\<close> leads to immediate contradiction\<close> |
13634 | 276 |
apply (blast elim: mem_irrefl) |
69593 | 277 |
txt\<open>the case \<^term>\<open>\<langle>y,x\<rangle> \<in> r\<close>: handle like the opposite direction\<close> |
13634 | 278 |
apply (blast dest: ord_iso_pred_imp_lt ltD elim: mem_asym) |
279 |
done |
|
280 |
||
281 |
lemma (in M_ordertype) Ord_omap_image_pred: |
|
282 |
"[| wellordered(M,A,r); omap(M,A,r,f); otype(M,A,r,i); |
|
283 |
M(A); M(r); M(f); M(i); b \<in> A |] ==> Ord(f `` Order.pred(A,b,r))" |
|
284 |
apply (frule wellordered_is_trans_on, assumption) |
|
285 |
apply (rule OrdI) |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
286 |
prefer 2 apply (simp add: image_iff omap_iff Ord_def, blast) |
60770 | 287 |
txt\<open>Hard part is to show that the image is a transitive set.\<close> |
13634 | 288 |
apply (simp add: Transset_def, clarify) |
289 |
apply (simp add: image_iff pred_iff apply_iff [OF omap_funtype [of A r f i]]) |
|
290 |
apply (rename_tac c j, clarify) |
|
291 |
apply (frule omap_funtype [of A r f, THEN apply_funtype], assumption+) |
|
13721 | 292 |
apply (subgoal_tac "j \<in> i") |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
293 |
prefer 2 apply (blast intro: Ord_trans Ord_otype) |
13721 | 294 |
apply (subgoal_tac "converse(f) ` j \<in> obase(M,A,r)") |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
295 |
prefer 2 |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
296 |
apply (blast dest: wellordered_omap_bij [THEN bij_converse_bij, |
13634 | 297 |
THEN bij_is_fun, THEN apply_funtype]) |
298 |
apply (rule_tac x="converse(f) ` j" in bexI) |
|
299 |
apply (simp add: right_inverse_bij [OF wellordered_omap_bij]) |
|
300 |
apply (intro predI conjI) |
|
301 |
apply (erule_tac b=c in trans_onD) |
|
302 |
apply (rule ord_iso_converse1 [OF omap_ord_iso [of A r f i]]) |
|
303 |
apply (auto simp add: obase_def) |
|
304 |
done |
|
305 |
||
306 |
lemma (in M_ordertype) restrict_omap_ord_iso: |
|
307 |
"[| wellordered(M,A,r); omap(M,A,r,f); otype(M,A,r,i); |
|
308 |
D \<subseteq> obase(M,A,r); M(A); M(r); M(f); M(i) |] |
|
309 |
==> restrict(f,D) \<in> (\<langle>D,r\<rangle> \<cong> \<langle>f``D, Memrel(f``D)\<rangle>)" |
|
310 |
apply (frule ord_iso_restrict_image [OF omap_ord_iso [of A r f i]], |
|
311 |
assumption+) |
|
312 |
apply (drule ord_iso_sym [THEN subset_ord_iso_Memrel]) |
|
313 |
apply (blast dest: subsetD [OF omap_subset]) |
|
314 |
apply (drule ord_iso_sym, simp) |
|
315 |
done |
|
316 |
||
317 |
lemma (in M_ordertype) obase_equals: |
|
318 |
"[| wellordered(M,A,r); omap(M,A,r,f); otype(M,A,r,i); |
|
319 |
M(A); M(r); M(f); M(i) |] ==> obase(M,A,r) = A" |
|
320 |
apply (rule equalityI, force simp add: obase_def, clarify) |
|
321 |
apply (unfold obase_def, simp) |
|
322 |
apply (frule wellordered_is_wellfounded_on, assumption) |
|
323 |
apply (erule wellfounded_on_induct, assumption+) |
|
324 |
apply (frule obase_equals_separation [of A r], assumption) |
|
325 |
apply (simp, clarify) |
|
326 |
apply (rename_tac b) |
|
46823 | 327 |
apply (subgoal_tac "Order.pred(A,b,r) \<subseteq> obase(M,A,r)") |
13634 | 328 |
apply (blast intro!: restrict_omap_ord_iso Ord_omap_image_pred) |
329 |
apply (force simp add: pred_iff obase_def) |
|
330 |
done |
|
331 |
||
332 |
||
333 |
||
69593 | 334 |
text\<open>Main result: \<^term>\<open>om\<close> gives the order-isomorphism |
335 |
\<^term>\<open>\<langle>A,r\<rangle> \<cong> \<langle>i, Memrel(i)\<rangle>\<close>\<close> |
|
13634 | 336 |
theorem (in M_ordertype) omap_ord_iso_otype: |
337 |
"[| wellordered(M,A,r); omap(M,A,r,f); otype(M,A,r,i); |
|
338 |
M(A); M(r); M(f); M(i) |] ==> f \<in> ord_iso(A, r, i, Memrel(i))" |
|
339 |
apply (frule omap_ord_iso, assumption+) |
|
340 |
apply (simp add: obase_equals) |
|
341 |
done |
|
342 |
||
343 |
lemma (in M_ordertype) obase_exists: |
|
344 |
"[| M(A); M(r) |] ==> M(obase(M,A,r))" |
|
345 |
apply (simp add: obase_def) |
|
346 |
apply (insert obase_separation [of A r]) |
|
347 |
apply (simp add: separation_def) |
|
348 |
done |
|
349 |
||
350 |
lemma (in M_ordertype) omap_exists: |
|
351 |
"[| M(A); M(r) |] ==> \<exists>z[M]. omap(M,A,r,z)" |
|
352 |
apply (simp add: omap_def) |
|
353 |
apply (insert omap_replacement [of A r]) |
|
354 |
apply (simp add: strong_replacement_def) |
|
355 |
apply (drule_tac x="obase(M,A,r)" in rspec) |
|
356 |
apply (simp add: obase_exists) |
|
71417
89d05db6dd1f
Simplified, generalised version of Constructible due to E. Gunther, M. Pagano and P. Sánchez Terraf
paulson <lp15@cam.ac.uk>
parents:
69593
diff
changeset
|
357 |
apply (simp add: obase_def) |
13634 | 358 |
apply (erule impE) |
359 |
apply (clarsimp simp add: univalent_def) |
|
360 |
apply (blast intro: Ord_iso_implies_eq ord_iso_sym ord_iso_trans, clarify) |
|
361 |
apply (rule_tac x=Y in rexI) |
|
71417
89d05db6dd1f
Simplified, generalised version of Constructible due to E. Gunther, M. Pagano and P. Sánchez Terraf
paulson <lp15@cam.ac.uk>
parents:
69593
diff
changeset
|
362 |
apply (simp add: obase_def, blast, assumption) |
13634 | 363 |
done |
364 |
||
365 |
lemma (in M_ordertype) otype_exists: |
|
366 |
"[| wellordered(M,A,r); M(A); M(r) |] ==> \<exists>i[M]. otype(M,A,r,i)" |
|
367 |
apply (insert omap_exists [of A r]) |
|
368 |
apply (simp add: otype_def, safe) |
|
369 |
apply (rule_tac x="range(x)" in rexI) |
|
370 |
apply blast+ |
|
371 |
done |
|
372 |
||
373 |
lemma (in M_ordertype) ordertype_exists: |
|
374 |
"[| wellordered(M,A,r); M(A); M(r) |] |
|
375 |
==> \<exists>f[M]. (\<exists>i[M]. Ord(i) & f \<in> ord_iso(A, r, i, Memrel(i)))" |
|
376 |
apply (insert obase_exists [of A r] omap_exists [of A r] otype_exists [of A r], simp, clarify) |
|
377 |
apply (rename_tac i) |
|
378 |
apply (subgoal_tac "Ord(i)", blast intro: omap_ord_iso_otype) |
|
379 |
apply (rule Ord_otype) |
|
71417
89d05db6dd1f
Simplified, generalised version of Constructible due to E. Gunther, M. Pagano and P. Sánchez Terraf
paulson <lp15@cam.ac.uk>
parents:
69593
diff
changeset
|
380 |
apply (force simp add: otype_def) |
13634 | 381 |
apply (simp_all add: wellordered_is_trans_on) |
382 |
done |
|
383 |
||
384 |
||
385 |
lemma (in M_ordertype) relativized_imp_well_ord: |
|
386 |
"[| wellordered(M,A,r); M(A); M(r) |] ==> well_ord(A,r)" |
|
387 |
apply (insert ordertype_exists [of A r], simp) |
|
388 |
apply (blast intro: well_ord_ord_iso well_ord_Memrel) |
|
389 |
done |
|
390 |
||
60770 | 391 |
subsection \<open>Kunen's theorem 5.4, page 127\<close> |
13634 | 392 |
|
60770 | 393 |
text\<open>(a) The notion of Wellordering is absolute\<close> |
13634 | 394 |
theorem (in M_ordertype) well_ord_abs [simp]: |
46823 | 395 |
"[| M(A); M(r) |] ==> wellordered(M,A,r) \<longleftrightarrow> well_ord(A,r)" |
13634 | 396 |
by (blast intro: well_ord_imp_relativized relativized_imp_well_ord) |
397 |
||
398 |
||
60770 | 399 |
text\<open>(b) Order types are absolute\<close> |
13634 | 400 |
theorem (in M_ordertype) |
401 |
"[| wellordered(M,A,r); f \<in> ord_iso(A, r, i, Memrel(i)); |
|
402 |
M(A); M(r); M(f); M(i); Ord(i) |] ==> i = ordertype(A,r)" |
|
403 |
by (blast intro: Ord_ordertype relativized_imp_well_ord ordertype_ord_iso |
|
404 |
Ord_iso_implies_eq ord_iso_sym ord_iso_trans) |
|
405 |
||
406 |
||
60770 | 407 |
subsection\<open>Ordinal Arithmetic: Two Examples of Recursion\<close> |
13634 | 408 |
|
60770 | 409 |
text\<open>Note: the remainder of this theory is not needed elsewhere.\<close> |
13634 | 410 |
|
60770 | 411 |
subsubsection\<open>Ordinal Addition\<close> |
13634 | 412 |
|
413 |
(*FIXME: update to use new techniques!!*) |
|
414 |
(*This expresses ordinal addition in the language of ZF. It also |
|
415 |
provides an abbreviation that can be used in the instance of strong |
|
416 |
replacement below. Here j is used to define the relation, namely |
|
417 |
Memrel(succ(j)), while x determines the domain of f.*) |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21233
diff
changeset
|
418 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21233
diff
changeset
|
419 |
is_oadd_fun :: "[i=>o,i,i,i,i] => o" where |
13634 | 420 |
"is_oadd_fun(M,i,j,x,f) == |
46823 | 421 |
(\<forall>sj msj. M(sj) \<longrightarrow> M(msj) \<longrightarrow> |
422 |
successor(M,j,sj) \<longrightarrow> membership(M,sj,msj) \<longrightarrow> |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
423 |
M_is_recfun(M, |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
424 |
%x g y. \<exists>gx[M]. image(M,g,x,gx) & union(M,i,gx,y), |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
425 |
msj, x, f))" |
13634 | 426 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21233
diff
changeset
|
427 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21233
diff
changeset
|
428 |
is_oadd :: "[i=>o,i,i,i] => o" where |
13634 | 429 |
"is_oadd(M,i,j,k) == |
430 |
(~ ordinal(M,i) & ~ ordinal(M,j) & k=0) | |
|
431 |
(~ ordinal(M,i) & ordinal(M,j) & k=j) | |
|
432 |
(ordinal(M,i) & ~ ordinal(M,j) & k=i) | |
|
433 |
(ordinal(M,i) & ordinal(M,j) & |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
434 |
(\<exists>f fj sj. M(f) & M(fj) & M(sj) & |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
435 |
successor(M,j,sj) & is_oadd_fun(M,i,sj,sj,f) & |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
436 |
fun_apply(M,f,j,fj) & fj = k))" |
13634 | 437 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21233
diff
changeset
|
438 |
definition |
13634 | 439 |
(*NEEDS RELATIVIZATION*) |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21233
diff
changeset
|
440 |
omult_eqns :: "[i,i,i,i] => o" where |
13634 | 441 |
"omult_eqns(i,x,g,z) == |
442 |
Ord(x) & |
|
46823 | 443 |
(x=0 \<longrightarrow> z=0) & |
444 |
(\<forall>j. x = succ(j) \<longrightarrow> z = g`j ++ i) & |
|
445 |
(Limit(x) \<longrightarrow> z = \<Union>(g``x))" |
|
13634 | 446 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21233
diff
changeset
|
447 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21233
diff
changeset
|
448 |
is_omult_fun :: "[i=>o,i,i,i] => o" where |
13634 | 449 |
"is_omult_fun(M,i,j,f) == |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
450 |
(\<exists>df. M(df) & is_function(M,f) & |
13634 | 451 |
is_domain(M,f,df) & subset(M, j, df)) & |
452 |
(\<forall>x\<in>j. omult_eqns(i,x,f,f`x))" |
|
453 |
||
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21233
diff
changeset
|
454 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21233
diff
changeset
|
455 |
is_omult :: "[i=>o,i,i,i] => o" where |
13634 | 456 |
"is_omult(M,i,j,k) == |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
457 |
\<exists>f fj sj. M(f) & M(fj) & M(sj) & |
13634 | 458 |
successor(M,j,sj) & is_omult_fun(M,i,sj,f) & |
459 |
fun_apply(M,f,j,fj) & fj = k" |
|
460 |
||
461 |
||
462 |
locale M_ord_arith = M_ordertype + |
|
463 |
assumes oadd_strong_replacement: |
|
464 |
"[| M(i); M(j) |] ==> |
|
465 |
strong_replacement(M, |
|
466 |
\<lambda>x z. \<exists>y[M]. pair(M,x,y,z) & |
|
467 |
(\<exists>f[M]. \<exists>fx[M]. is_oadd_fun(M,i,j,x,f) & |
|
46823 | 468 |
image(M,f,x,fx) & y = i \<union> fx))" |
13634 | 469 |
|
470 |
and omult_strong_replacement': |
|
471 |
"[| M(i); M(j) |] ==> |
|
472 |
strong_replacement(M, |
|
473 |
\<lambda>x z. \<exists>y[M]. z = <x,y> & |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
474 |
(\<exists>g[M]. is_recfun(Memrel(succ(j)),x,%x g. THE z. omult_eqns(i,x,g,z),g) & |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
475 |
y = (THE z. omult_eqns(i, x, g, z))))" |
13634 | 476 |
|
477 |
||
478 |
||
61798 | 479 |
text\<open>\<open>is_oadd_fun\<close>: Relating the pure "language of set theory" to Isabelle/ZF\<close> |
13634 | 480 |
lemma (in M_ord_arith) is_oadd_fun_iff: |
481 |
"[| a\<le>j; M(i); M(j); M(a); M(f) |] |
|
46823 | 482 |
==> is_oadd_fun(M,i,j,a,f) \<longleftrightarrow> |
483 |
f \<in> a \<rightarrow> range(f) & (\<forall>x. M(x) \<longrightarrow> x < a \<longrightarrow> f`x = i \<union> f``x)" |
|
13634 | 484 |
apply (frule lt_Ord) |
71417
89d05db6dd1f
Simplified, generalised version of Constructible due to E. Gunther, M. Pagano and P. Sánchez Terraf
paulson <lp15@cam.ac.uk>
parents:
69593
diff
changeset
|
485 |
apply (simp add: is_oadd_fun_def |
46823 | 486 |
relation2_def is_recfun_abs [of "%x g. i \<union> g``x"] |
71417
89d05db6dd1f
Simplified, generalised version of Constructible due to E. Gunther, M. Pagano and P. Sánchez Terraf
paulson <lp15@cam.ac.uk>
parents:
69593
diff
changeset
|
487 |
is_recfun_iff_equation |
13634 | 488 |
Ball_def lt_trans [OF ltI, of _ a] lt_Memrel) |
489 |
apply (simp add: lt_def) |
|
490 |
apply (blast dest: transM) |
|
491 |
done |
|
492 |
||
493 |
||
494 |
lemma (in M_ord_arith) oadd_strong_replacement': |
|
495 |
"[| M(i); M(j) |] ==> |
|
496 |
strong_replacement(M, |
|
497 |
\<lambda>x z. \<exists>y[M]. z = <x,y> & |
|
46823 | 498 |
(\<exists>g[M]. is_recfun(Memrel(succ(j)),x,%x g. i \<union> g``x,g) & |
499 |
y = i \<union> g``x))" |
|
13634 | 500 |
apply (insert oadd_strong_replacement [of i j]) |
501 |
apply (simp add: is_oadd_fun_def relation2_def |
|
46823 | 502 |
is_recfun_abs [of "%x g. i \<union> g``x"]) |
13634 | 503 |
done |
504 |
||
505 |
||
506 |
lemma (in M_ord_arith) exists_oadd: |
|
507 |
"[| Ord(j); M(i); M(j) |] |
|
46823 | 508 |
==> \<exists>f[M]. is_recfun(Memrel(succ(j)), j, %x g. i \<union> g``x, f)" |
13634 | 509 |
apply (rule wf_exists_is_recfun [OF wf_Memrel trans_Memrel]) |
510 |
apply (simp_all add: Memrel_type oadd_strong_replacement') |
|
511 |
done |
|
512 |
||
513 |
lemma (in M_ord_arith) exists_oadd_fun: |
|
514 |
"[| Ord(j); M(i); M(j) |] ==> \<exists>f[M]. is_oadd_fun(M,i,succ(j),succ(j),f)" |
|
515 |
apply (rule exists_oadd [THEN rexE]) |
|
516 |
apply (erule Ord_succ, assumption, simp) |
|
517 |
apply (rename_tac f) |
|
518 |
apply (frule is_recfun_type) |
|
519 |
apply (rule_tac x=f in rexI) |
|
520 |
apply (simp add: fun_is_function domain_of_fun lt_Memrel apply_recfun lt_def |
|
521 |
is_oadd_fun_iff Ord_trans [OF _ succI1], assumption) |
|
522 |
done |
|
523 |
||
524 |
lemma (in M_ord_arith) is_oadd_fun_apply: |
|
525 |
"[| x < j; M(i); M(j); M(f); is_oadd_fun(M,i,j,j,f) |] |
|
46823 | 526 |
==> f`x = i \<union> (\<Union>k\<in>x. {f ` k})" |
13634 | 527 |
apply (simp add: is_oadd_fun_iff lt_Ord2, clarify) |
528 |
apply (frule lt_closed, simp) |
|
529 |
apply (frule leI [THEN le_imp_subset]) |
|
530 |
apply (simp add: image_fun, blast) |
|
531 |
done |
|
532 |
||
533 |
lemma (in M_ord_arith) is_oadd_fun_iff_oadd [rule_format]: |
|
534 |
"[| is_oadd_fun(M,i,J,J,f); M(i); M(J); M(f); Ord(i); Ord(j) |] |
|
46823 | 535 |
==> j<J \<longrightarrow> f`j = i++j" |
13634 | 536 |
apply (erule_tac i=j in trans_induct, clarify) |
537 |
apply (subgoal_tac "\<forall>k\<in>x. k<J") |
|
538 |
apply (simp (no_asm_simp) add: is_oadd_def oadd_unfold is_oadd_fun_apply) |
|
539 |
apply (blast intro: lt_trans ltI lt_Ord) |
|
540 |
done |
|
541 |
||
542 |
lemma (in M_ord_arith) Ord_oadd_abs: |
|
46823 | 543 |
"[| M(i); M(j); M(k); Ord(i); Ord(j) |] ==> is_oadd(M,i,j,k) \<longleftrightarrow> k = i++j" |
13634 | 544 |
apply (simp add: is_oadd_def is_oadd_fun_iff_oadd) |
545 |
apply (frule exists_oadd_fun [of j i], blast+) |
|
546 |
done |
|
547 |
||
548 |
lemma (in M_ord_arith) oadd_abs: |
|
46823 | 549 |
"[| M(i); M(j); M(k) |] ==> is_oadd(M,i,j,k) \<longleftrightarrow> k = i++j" |
13634 | 550 |
apply (case_tac "Ord(i) & Ord(j)") |
551 |
apply (simp add: Ord_oadd_abs) |
|
552 |
apply (auto simp add: is_oadd_def oadd_eq_if_raw_oadd) |
|
553 |
done |
|
554 |
||
555 |
lemma (in M_ord_arith) oadd_closed [intro,simp]: |
|
556 |
"[| M(i); M(j) |] ==> M(i++j)" |
|
557 |
apply (simp add: oadd_eq_if_raw_oadd, clarify) |
|
558 |
apply (simp add: raw_oadd_eq_oadd) |
|
559 |
apply (frule exists_oadd_fun [of j i], auto) |
|
71417
89d05db6dd1f
Simplified, generalised version of Constructible due to E. Gunther, M. Pagano and P. Sánchez Terraf
paulson <lp15@cam.ac.uk>
parents:
69593
diff
changeset
|
560 |
apply (simp add: is_oadd_fun_iff_oadd [symmetric]) |
13634 | 561 |
done |
562 |
||
563 |
||
60770 | 564 |
subsubsection\<open>Ordinal Multiplication\<close> |
13634 | 565 |
|
566 |
lemma omult_eqns_unique: |
|
58860 | 567 |
"[| omult_eqns(i,x,g,z); omult_eqns(i,x,g,z') |] ==> z=z'" |
13634 | 568 |
apply (simp add: omult_eqns_def, clarify) |
569 |
apply (erule Ord_cases, simp_all) |
|
570 |
done |
|
571 |
||
46823 | 572 |
lemma omult_eqns_0: "omult_eqns(i,0,g,z) \<longleftrightarrow> z=0" |
13634 | 573 |
by (simp add: omult_eqns_def) |
574 |
||
575 |
lemma the_omult_eqns_0: "(THE z. omult_eqns(i,0,g,z)) = 0" |
|
576 |
by (simp add: omult_eqns_0) |
|
577 |
||
46823 | 578 |
lemma omult_eqns_succ: "omult_eqns(i,succ(j),g,z) \<longleftrightarrow> Ord(j) & z = g`j ++ i" |
13634 | 579 |
by (simp add: omult_eqns_def) |
580 |
||
581 |
lemma the_omult_eqns_succ: |
|
582 |
"Ord(j) ==> (THE z. omult_eqns(i,succ(j),g,z)) = g`j ++ i" |
|
583 |
by (simp add: omult_eqns_succ) |
|
584 |
||
585 |
lemma omult_eqns_Limit: |
|
46823 | 586 |
"Limit(x) ==> omult_eqns(i,x,g,z) \<longleftrightarrow> z = \<Union>(g``x)" |
13634 | 587 |
apply (simp add: omult_eqns_def) |
588 |
apply (blast intro: Limit_is_Ord) |
|
589 |
done |
|
590 |
||
591 |
lemma the_omult_eqns_Limit: |
|
592 |
"Limit(x) ==> (THE z. omult_eqns(i,x,g,z)) = \<Union>(g``x)" |
|
593 |
by (simp add: omult_eqns_Limit) |
|
594 |
||
595 |
lemma omult_eqns_Not: "~ Ord(x) ==> ~ omult_eqns(i,x,g,z)" |
|
596 |
by (simp add: omult_eqns_def) |
|
597 |
||
598 |
||
599 |
lemma (in M_ord_arith) the_omult_eqns_closed: |
|
600 |
"[| M(i); M(x); M(g); function(g) |] |
|
601 |
==> M(THE z. omult_eqns(i, x, g, z))" |
|
602 |
apply (case_tac "Ord(x)") |
|
67443
3abf6a722518
standardized towards new-style formal comments: isabelle update_comments;
wenzelm
parents:
67399
diff
changeset
|
603 |
prefer 2 apply (simp add: omult_eqns_Not) \<comment> \<open>trivial, non-Ord case\<close> |
13634 | 604 |
apply (erule Ord_cases) |
605 |
apply (simp add: omult_eqns_0) |
|
71417
89d05db6dd1f
Simplified, generalised version of Constructible due to E. Gunther, M. Pagano and P. Sánchez Terraf
paulson <lp15@cam.ac.uk>
parents:
69593
diff
changeset
|
606 |
apply (simp add: omult_eqns_succ) |
13634 | 607 |
apply (simp add: omult_eqns_Limit) |
608 |
done |
|
609 |
||
610 |
lemma (in M_ord_arith) exists_omult: |
|
611 |
"[| Ord(j); M(i); M(j) |] |
|
612 |
==> \<exists>f[M]. is_recfun(Memrel(succ(j)), j, %x g. THE z. omult_eqns(i,x,g,z), f)" |
|
613 |
apply (rule wf_exists_is_recfun [OF wf_Memrel trans_Memrel]) |
|
614 |
apply (simp_all add: Memrel_type omult_strong_replacement') |
|
615 |
apply (blast intro: the_omult_eqns_closed) |
|
616 |
done |
|
617 |
||
618 |
lemma (in M_ord_arith) exists_omult_fun: |
|
619 |
"[| Ord(j); M(i); M(j) |] ==> \<exists>f[M]. is_omult_fun(M,i,succ(j),f)" |
|
620 |
apply (rule exists_omult [THEN rexE]) |
|
621 |
apply (erule Ord_succ, assumption, simp) |
|
622 |
apply (rename_tac f) |
|
623 |
apply (frule is_recfun_type) |
|
624 |
apply (rule_tac x=f in rexI) |
|
625 |
apply (simp add: fun_is_function domain_of_fun lt_Memrel apply_recfun lt_def |
|
626 |
is_omult_fun_def Ord_trans [OF _ succI1]) |
|
627 |
apply (force dest: Ord_in_Ord' |
|
628 |
simp add: omult_eqns_def the_omult_eqns_0 the_omult_eqns_succ |
|
629 |
the_omult_eqns_Limit, assumption) |
|
630 |
done |
|
631 |
||
632 |
lemma (in M_ord_arith) is_omult_fun_apply_0: |
|
633 |
"[| 0 < j; is_omult_fun(M,i,j,f) |] ==> f`0 = 0" |
|
634 |
by (simp add: is_omult_fun_def omult_eqns_def lt_def ball_conj_distrib) |
|
635 |
||
636 |
lemma (in M_ord_arith) is_omult_fun_apply_succ: |
|
637 |
"[| succ(x) < j; is_omult_fun(M,i,j,f) |] ==> f`succ(x) = f`x ++ i" |
|
638 |
by (simp add: is_omult_fun_def omult_eqns_def lt_def, blast) |
|
639 |
||
640 |
lemma (in M_ord_arith) is_omult_fun_apply_Limit: |
|
641 |
"[| x < j; Limit(x); M(j); M(f); is_omult_fun(M,i,j,f) |] |
|
642 |
==> f ` x = (\<Union>y\<in>x. f`y)" |
|
71417
89d05db6dd1f
Simplified, generalised version of Constructible due to E. Gunther, M. Pagano and P. Sánchez Terraf
paulson <lp15@cam.ac.uk>
parents:
69593
diff
changeset
|
643 |
apply (simp add: is_omult_fun_def omult_eqns_def lt_def, clarify) |
13634 | 644 |
apply (drule subset_trans [OF OrdmemD], assumption+) |
645 |
apply (simp add: ball_conj_distrib omult_Limit image_function) |
|
646 |
done |
|
647 |
||
648 |
lemma (in M_ord_arith) is_omult_fun_eq_omult: |
|
649 |
"[| is_omult_fun(M,i,J,f); M(J); M(f); Ord(i); Ord(j) |] |
|
46823 | 650 |
==> j<J \<longrightarrow> f`j = i**j" |
13634 | 651 |
apply (erule_tac i=j in trans_induct3) |
652 |
apply (safe del: impCE) |
|
653 |
apply (simp add: is_omult_fun_apply_0) |
|
654 |
apply (subgoal_tac "x<J") |
|
655 |
apply (simp add: is_omult_fun_apply_succ omult_succ) |
|
656 |
apply (blast intro: lt_trans) |
|
657 |
apply (subgoal_tac "\<forall>k\<in>x. k<J") |
|
658 |
apply (simp add: is_omult_fun_apply_Limit omult_Limit) |
|
659 |
apply (blast intro: lt_trans ltI lt_Ord) |
|
660 |
done |
|
661 |
||
662 |
lemma (in M_ord_arith) omult_abs: |
|
46823 | 663 |
"[| M(i); M(j); M(k); Ord(i); Ord(j) |] ==> is_omult(M,i,j,k) \<longleftrightarrow> k = i**j" |
13634 | 664 |
apply (simp add: is_omult_def is_omult_fun_eq_omult) |
665 |
apply (frule exists_omult_fun [of j i], blast+) |
|
666 |
done |
|
667 |
||
668 |
||
669 |
||
60770 | 670 |
subsection \<open>Absoluteness of Well-Founded Relations\<close> |
13647 | 671 |
|
69593 | 672 |
text\<open>Relativized to \<^term>\<open>M\<close>: Every well-founded relation is a subset of some |
673 |
inverse image of an ordinal. Key step is the construction (in \<^term>\<open>M\<close>) of a |
|
60770 | 674 |
rank function.\<close> |
13647 | 675 |
|
13634 | 676 |
locale M_wfrank = M_trancl + |
677 |
assumes wfrank_separation: |
|
678 |
"M(r) ==> |
|
679 |
separation (M, \<lambda>x. |
|
46823 | 680 |
\<forall>rplus[M]. tran_closure(M,r,rplus) \<longrightarrow> |
13634 | 681 |
~ (\<exists>f[M]. M_is_recfun(M, %x f y. is_range(M,f,y), rplus, x, f)))" |
682 |
and wfrank_strong_replacement: |
|
683 |
"M(r) ==> |
|
684 |
strong_replacement(M, \<lambda>x z. |
|
46823 | 685 |
\<forall>rplus[M]. tran_closure(M,r,rplus) \<longrightarrow> |
13634 | 686 |
(\<exists>y[M]. \<exists>f[M]. pair(M,x,y,z) & |
687 |
M_is_recfun(M, %x f y. is_range(M,f,y), rplus, x, f) & |
|
688 |
is_range(M,f,y)))" |
|
689 |
and Ord_wfrank_separation: |
|
690 |
"M(r) ==> |
|
691 |
separation (M, \<lambda>x. |
|
46823 | 692 |
\<forall>rplus[M]. tran_closure(M,r,rplus) \<longrightarrow> |
13634 | 693 |
~ (\<forall>f[M]. \<forall>rangef[M]. |
46823 | 694 |
is_range(M,f,rangef) \<longrightarrow> |
695 |
M_is_recfun(M, \<lambda>x f y. is_range(M,f,y), rplus, x, f) \<longrightarrow> |
|
13634 | 696 |
ordinal(M,rangef)))" |
697 |
||
698 |
||
60770 | 699 |
text\<open>Proving that the relativized instances of Separation or Replacement |
700 |
agree with the "real" ones.\<close> |
|
13634 | 701 |
|
702 |
lemma (in M_wfrank) wfrank_separation': |
|
703 |
"M(r) ==> |
|
704 |
separation |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
705 |
(M, \<lambda>x. ~ (\<exists>f[M]. is_recfun(r^+, x, %x f. range(f), f)))" |
13634 | 706 |
apply (insert wfrank_separation [of r]) |
707 |
apply (simp add: relation2_def is_recfun_abs [of "%x. range"]) |
|
708 |
done |
|
709 |
||
710 |
lemma (in M_wfrank) wfrank_strong_replacement': |
|
711 |
"M(r) ==> |
|
712 |
strong_replacement(M, \<lambda>x z. \<exists>y[M]. \<exists>f[M]. |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
713 |
pair(M,x,y,z) & is_recfun(r^+, x, %x f. range(f), f) & |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
21404
diff
changeset
|
714 |
y = range(f))" |
13634 | 715 |
apply (insert wfrank_strong_replacement [of r]) |
716 |
apply (simp add: relation2_def is_recfun_abs [of "%x. range"]) |
|
717 |
done |
|
718 |
||
719 |
lemma (in M_wfrank) Ord_wfrank_separation': |
|
720 |
"M(r) ==> |
|
721 |
separation (M, \<lambda>x. |
|
46823 | 722 |
~ (\<forall>f[M]. is_recfun(r^+, x, \<lambda>x. range, f) \<longrightarrow> Ord(range(f))))" |
13634 | 723 |
apply (insert Ord_wfrank_separation [of r]) |
724 |
apply (simp add: relation2_def is_recfun_abs [of "%x. range"]) |
|
725 |
done |
|
726 |
||
60770 | 727 |
text\<open>This function, defined using replacement, is a rank function for |
728 |
well-founded relations within the class M.\<close> |
|
21233 | 729 |
definition |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21233
diff
changeset
|
730 |
wellfoundedrank :: "[i=>o,i,i] => i" where |
13634 | 731 |
"wellfoundedrank(M,r,A) == |
732 |
{p. x\<in>A, \<exists>y[M]. \<exists>f[M]. |
|
733 |
p = <x,y> & is_recfun(r^+, x, %x f. range(f), f) & |
|
734 |
y = range(f)}" |
|
735 |
||
736 |
lemma (in M_wfrank) exists_wfrank: |
|
737 |
"[| wellfounded(M,r); M(a); M(r) |] |
|
738 |
==> \<exists>f[M]. is_recfun(r^+, a, %x f. range(f), f)" |
|
739 |
apply (rule wellfounded_exists_is_recfun) |
|
740 |
apply (blast intro: wellfounded_trancl) |
|
741 |
apply (rule trans_trancl) |
|
742 |
apply (erule wfrank_separation') |
|
743 |
apply (erule wfrank_strong_replacement') |
|
744 |
apply (simp_all add: trancl_subset_times) |
|
745 |
done |
|
746 |
||
747 |
lemma (in M_wfrank) M_wellfoundedrank: |
|
748 |
"[| wellfounded(M,r); M(r); M(A) |] ==> M(wellfoundedrank(M,r,A))" |
|
749 |
apply (insert wfrank_strong_replacement' [of r]) |
|
750 |
apply (simp add: wellfoundedrank_def) |
|
751 |
apply (rule strong_replacement_closed) |
|
752 |
apply assumption+ |
|
753 |
apply (rule univalent_is_recfun) |
|
754 |
apply (blast intro: wellfounded_trancl) |
|
755 |
apply (rule trans_trancl) |
|
756 |
apply (simp add: trancl_subset_times) |
|
757 |
apply (blast dest: transM) |
|
758 |
done |
|
759 |
||
760 |
lemma (in M_wfrank) Ord_wfrank_range [rule_format]: |
|
761 |
"[| wellfounded(M,r); a\<in>A; M(r); M(A) |] |
|
46823 | 762 |
==> \<forall>f[M]. is_recfun(r^+, a, %x f. range(f), f) \<longrightarrow> Ord(range(f))" |
13634 | 763 |
apply (drule wellfounded_trancl, assumption) |
764 |
apply (rule wellfounded_induct, assumption, erule (1) transM) |
|
765 |
apply simp |
|
766 |
apply (blast intro: Ord_wfrank_separation', clarify) |
|
69593 | 767 |
txt\<open>The reasoning in both cases is that we get \<^term>\<open>y\<close> such that |
768 |
\<^term>\<open>\<langle>y, x\<rangle> \<in> r^+\<close>. We find that |
|
769 |
\<^term>\<open>f`y = restrict(f, r^+ -`` {y})\<close>.\<close> |
|
13634 | 770 |
apply (rule OrdI [OF _ Ord_is_Transset]) |
60770 | 771 |
txt\<open>An ordinal is a transitive set...\<close> |
13634 | 772 |
apply (simp add: Transset_def) |
773 |
apply clarify |
|
774 |
apply (frule apply_recfun2, assumption) |
|
775 |
apply (force simp add: restrict_iff) |
|
60770 | 776 |
txt\<open>...of ordinals. This second case requires the induction hyp.\<close> |
13634 | 777 |
apply clarify |
778 |
apply (rename_tac i y) |
|
779 |
apply (frule apply_recfun2, assumption) |
|
780 |
apply (frule is_recfun_imp_in_r, assumption) |
|
781 |
apply (frule is_recfun_restrict) |
|
782 |
(*simp_all won't work*) |
|
783 |
apply (simp add: trans_trancl trancl_subset_times)+ |
|
784 |
apply (drule spec [THEN mp], assumption) |
|
785 |
apply (subgoal_tac "M(restrict(f, r^+ -`` {y}))") |
|
786 |
apply (drule_tac x="restrict(f, r^+ -`` {y})" in rspec) |
|
787 |
apply assumption |
|
788 |
apply (simp add: function_apply_equality [OF _ is_recfun_imp_function]) |
|
789 |
apply (blast dest: pair_components_in_M) |
|
790 |
done |
|
791 |
||
792 |
lemma (in M_wfrank) Ord_range_wellfoundedrank: |
|
793 |
"[| wellfounded(M,r); r \<subseteq> A*A; M(r); M(A) |] |
|
794 |
==> Ord (range(wellfoundedrank(M,r,A)))" |
|
795 |
apply (frule wellfounded_trancl, assumption) |
|
796 |
apply (frule trancl_subset_times) |
|
797 |
apply (simp add: wellfoundedrank_def) |
|
798 |
apply (rule OrdI [OF _ Ord_is_Transset]) |
|
799 |
prefer 2 |
|
60770 | 800 |
txt\<open>by our previous result the range consists of ordinals.\<close> |
13634 | 801 |
apply (blast intro: Ord_wfrank_range) |
60770 | 802 |
txt\<open>We still must show that the range is a transitive set.\<close> |
13634 | 803 |
apply (simp add: Transset_def, clarify, simp) |
804 |
apply (rename_tac x i f u) |
|
805 |
apply (frule is_recfun_imp_in_r, assumption) |
|
806 |
apply (subgoal_tac "M(u) & M(i) & M(x)") |
|
807 |
prefer 2 apply (blast dest: transM, clarify) |
|
808 |
apply (rule_tac a=u in rangeI) |
|
809 |
apply (rule_tac x=u in ReplaceI) |
|
810 |
apply simp |
|
811 |
apply (rule_tac x="restrict(f, r^+ -`` {u})" in rexI) |
|
812 |
apply (blast intro: is_recfun_restrict trans_trancl dest: apply_recfun2) |
|
813 |
apply simp |
|
814 |
apply blast |
|
60770 | 815 |
txt\<open>Unicity requirement of Replacement\<close> |
13634 | 816 |
apply clarify |
817 |
apply (frule apply_recfun2, assumption) |
|
818 |
apply (simp add: trans_trancl is_recfun_cut) |
|
819 |
done |
|
820 |
||
821 |
lemma (in M_wfrank) function_wellfoundedrank: |
|
822 |
"[| wellfounded(M,r); M(r); M(A)|] |
|
823 |
==> function(wellfoundedrank(M,r,A))" |
|
824 |
apply (simp add: wellfoundedrank_def function_def, clarify) |
|
60770 | 825 |
txt\<open>Uniqueness: repeated below!\<close> |
13634 | 826 |
apply (drule is_recfun_functional, assumption) |
827 |
apply (blast intro: wellfounded_trancl) |
|
828 |
apply (simp_all add: trancl_subset_times trans_trancl) |
|
829 |
done |
|
830 |
||
831 |
lemma (in M_wfrank) domain_wellfoundedrank: |
|
832 |
"[| wellfounded(M,r); M(r); M(A)|] |
|
833 |
==> domain(wellfoundedrank(M,r,A)) = A" |
|
834 |
apply (simp add: wellfoundedrank_def function_def) |
|
835 |
apply (rule equalityI, auto) |
|
836 |
apply (frule transM, assumption) |
|
837 |
apply (frule_tac a=x in exists_wfrank, assumption+, clarify) |
|
838 |
apply (rule_tac b="range(f)" in domainI) |
|
839 |
apply (rule_tac x=x in ReplaceI) |
|
840 |
apply simp |
|
841 |
apply (rule_tac x=f in rexI, blast, simp_all) |
|
60770 | 842 |
txt\<open>Uniqueness (for Replacement): repeated above!\<close> |
13634 | 843 |
apply clarify |
844 |
apply (drule is_recfun_functional, assumption) |
|
845 |
apply (blast intro: wellfounded_trancl) |
|
846 |
apply (simp_all add: trancl_subset_times trans_trancl) |
|
847 |
done |
|
848 |
||
849 |
lemma (in M_wfrank) wellfoundedrank_type: |
|
850 |
"[| wellfounded(M,r); M(r); M(A)|] |
|
851 |
==> wellfoundedrank(M,r,A) \<in> A -> range(wellfoundedrank(M,r,A))" |
|
852 |
apply (frule function_wellfoundedrank [of r A], assumption+) |
|
853 |
apply (frule function_imp_Pi) |
|
854 |
apply (simp add: wellfoundedrank_def relation_def) |
|
855 |
apply blast |
|
856 |
apply (simp add: domain_wellfoundedrank) |
|
857 |
done |
|
858 |
||
859 |
lemma (in M_wfrank) Ord_wellfoundedrank: |
|
860 |
"[| wellfounded(M,r); a \<in> A; r \<subseteq> A*A; M(r); M(A) |] |
|
861 |
==> Ord(wellfoundedrank(M,r,A) ` a)" |
|
862 |
by (blast intro: apply_funtype [OF wellfoundedrank_type] |
|
863 |
Ord_in_Ord [OF Ord_range_wellfoundedrank]) |
|
864 |
||
865 |
lemma (in M_wfrank) wellfoundedrank_eq: |
|
866 |
"[| is_recfun(r^+, a, %x. range, f); |
|
867 |
wellfounded(M,r); a \<in> A; M(f); M(r); M(A)|] |
|
868 |
==> wellfoundedrank(M,r,A) ` a = range(f)" |
|
869 |
apply (rule apply_equality) |
|
870 |
prefer 2 apply (blast intro: wellfoundedrank_type) |
|
871 |
apply (simp add: wellfoundedrank_def) |
|
872 |
apply (rule ReplaceI) |
|
873 |
apply (rule_tac x="range(f)" in rexI) |
|
874 |
apply blast |
|
875 |
apply simp_all |
|
60770 | 876 |
txt\<open>Unicity requirement of Replacement\<close> |
13634 | 877 |
apply clarify |
878 |
apply (drule is_recfun_functional, assumption) |
|
879 |
apply (blast intro: wellfounded_trancl) |
|
880 |
apply (simp_all add: trancl_subset_times trans_trancl) |
|
881 |
done |
|
882 |
||
883 |
||
884 |
lemma (in M_wfrank) wellfoundedrank_lt: |
|
885 |
"[| <a,b> \<in> r; |
|
886 |
wellfounded(M,r); r \<subseteq> A*A; M(r); M(A)|] |
|
887 |
==> wellfoundedrank(M,r,A) ` a < wellfoundedrank(M,r,A) ` b" |
|
888 |
apply (frule wellfounded_trancl, assumption) |
|
889 |
apply (subgoal_tac "a\<in>A & b\<in>A") |
|
890 |
prefer 2 apply blast |
|
891 |
apply (simp add: lt_def Ord_wellfoundedrank, clarify) |
|
892 |
apply (frule exists_wfrank [of concl: _ b], erule (1) transM, assumption) |
|
893 |
apply clarify |
|
894 |
apply (rename_tac fb) |
|
895 |
apply (frule is_recfun_restrict [of concl: "r^+" a]) |
|
896 |
apply (rule trans_trancl, assumption) |
|
897 |
apply (simp_all add: r_into_trancl trancl_subset_times) |
|
61798 | 898 |
txt\<open>Still the same goal, but with new \<open>is_recfun\<close> assumptions.\<close> |
13634 | 899 |
apply (simp add: wellfoundedrank_eq) |
900 |
apply (frule_tac a=a in wellfoundedrank_eq, assumption+) |
|
901 |
apply (simp_all add: transM [of a]) |
|
60770 | 902 |
txt\<open>We have used equations for wellfoundedrank and now must use some |
61798 | 903 |
for \<open>is_recfun\<close>.\<close> |
13634 | 904 |
apply (rule_tac a=a in rangeI) |
905 |
apply (simp add: is_recfun_type [THEN apply_iff] vimage_singleton_iff |
|
71417
89d05db6dd1f
Simplified, generalised version of Constructible due to E. Gunther, M. Pagano and P. Sánchez Terraf
paulson <lp15@cam.ac.uk>
parents:
69593
diff
changeset
|
906 |
r_into_trancl apply_recfun) |
13634 | 907 |
done |
908 |
||
909 |
||
910 |
lemma (in M_wfrank) wellfounded_imp_subset_rvimage: |
|
911 |
"[|wellfounded(M,r); r \<subseteq> A*A; M(r); M(A)|] |
|
46823 | 912 |
==> \<exists>i f. Ord(i) & r \<subseteq> rvimage(A, f, Memrel(i))" |
13634 | 913 |
apply (rule_tac x="range(wellfoundedrank(M,r,A))" in exI) |
914 |
apply (rule_tac x="wellfoundedrank(M,r,A)" in exI) |
|
915 |
apply (simp add: Ord_range_wellfoundedrank, clarify) |
|
916 |
apply (frule subsetD, assumption, clarify) |
|
917 |
apply (simp add: rvimage_iff wellfoundedrank_lt [THEN ltD]) |
|
918 |
apply (blast intro: apply_rangeI wellfoundedrank_type) |
|
919 |
done |
|
920 |
||
921 |
lemma (in M_wfrank) wellfounded_imp_wf: |
|
922 |
"[|wellfounded(M,r); relation(r); M(r)|] ==> wf(r)" |
|
923 |
by (blast dest!: relation_field_times_field wellfounded_imp_subset_rvimage |
|
924 |
intro: wf_rvimage_Ord [THEN wf_subset]) |
|
925 |
||
926 |
lemma (in M_wfrank) wellfounded_on_imp_wf_on: |
|
927 |
"[|wellfounded_on(M,A,r); relation(r); M(r); M(A)|] ==> wf[A](r)" |
|
928 |
apply (simp add: wellfounded_on_iff_wellfounded wf_on_def) |
|
929 |
apply (rule wellfounded_imp_wf) |
|
930 |
apply (simp_all add: relation_def) |
|
931 |
done |
|
932 |
||
933 |
||
934 |
theorem (in M_wfrank) wf_abs: |
|
46823 | 935 |
"[|relation(r); M(r)|] ==> wellfounded(M,r) \<longleftrightarrow> wf(r)" |
13634 | 936 |
by (blast intro: wellfounded_imp_wf wf_imp_relativized) |
937 |
||
938 |
theorem (in M_wfrank) wf_on_abs: |
|
46823 | 939 |
"[|relation(r); M(r); M(A)|] ==> wellfounded_on(M,A,r) \<longleftrightarrow> wf[A](r)" |
13634 | 940 |
by (blast intro: wellfounded_on_imp_wf_on wf_on_imp_relativized) |
941 |
||
67399 | 942 |
end |