author  paulson 
Fri, 04 Oct 2002 15:57:32 +0200  
changeset 13628  87482b5e3f2e 
parent 13615  449a70d88b38 
child 13634  99a593b49b04 
permissions  rwrr 
13505  1 
(* Title: ZF/Constructible/Wellorderings.thy 
2 
ID: $Id$ 

3 
Author: Lawrence C Paulson, Cambridge University Computer Laboratory 

4 
Copyright 2002 University of Cambridge 

5 
*) 

6 

13223  7 
header {*Relativized Wellorderings*} 
8 

9 
theory Wellorderings = Relative: 

10 

11 
text{*We define functions analogous to @{term ordermap} @{term ordertype} 

12 
but without using recursion. Instead, there is a direct appeal 

13 
to Replacement. This will be the basis for a version relativized 

14 
to some class @{text M}. The main result is Theorem I 7.6 in Kunen, 

15 
page 17.*} 

16 

17 

18 
subsection{*Wellorderings*} 

19 

20 
constdefs 

21 
irreflexive :: "[i=>o,i,i]=>o" 

13299  22 
"irreflexive(M,A,r) == \<forall>x[M]. x\<in>A > <x,x> \<notin> r" 
13223  23 

24 
transitive_rel :: "[i=>o,i,i]=>o" 

25 
"transitive_rel(M,A,r) == 

13299  26 
\<forall>x[M]. x\<in>A > (\<forall>y[M]. y\<in>A > (\<forall>z[M]. z\<in>A > 
13223  27 
<x,y>\<in>r > <y,z>\<in>r > <x,z>\<in>r))" 
28 

29 
linear_rel :: "[i=>o,i,i]=>o" 

30 
"linear_rel(M,A,r) == 

13299  31 
\<forall>x[M]. x\<in>A > (\<forall>y[M]. y\<in>A > <x,y>\<in>r  x=y  <y,x>\<in>r)" 
13223  32 

33 
wellfounded :: "[i=>o,i]=>o" 

34 
{*EVERY nonempty set has an @{text r}minimal element*} 

35 
"wellfounded(M,r) == 

13628
87482b5e3f2e
Various simplifications of the Constructible theories
paulson
parents:
13615
diff
changeset

36 
\<forall>x[M]. x\<noteq>0 > (\<exists>y[M]. y\<in>x & ~(\<exists>z[M]. z\<in>x & <z,y> \<in> r))" 
13223  37 
wellfounded_on :: "[i=>o,i,i]=>o" 
38 
{*every nonempty SUBSET OF @{text A} has an @{text r}minimal element*} 

39 
"wellfounded_on(M,A,r) == 

13628
87482b5e3f2e
Various simplifications of the Constructible theories
paulson
parents:
13615
diff
changeset

40 
\<forall>x[M]. x\<noteq>0 > x\<subseteq>A > (\<exists>y[M]. y\<in>x & ~(\<exists>z[M]. z\<in>x & <z,y> \<in> r))" 
13223  41 

42 
wellordered :: "[i=>o,i,i]=>o" 

13513  43 
{*linear and wellfounded on @{text A}*} 
13223  44 
"wellordered(M,A,r) == 
45 
transitive_rel(M,A,r) & linear_rel(M,A,r) & wellfounded_on(M,A,r)" 

46 

47 

48 
subsubsection {*Trivial absoluteness proofs*} 

49 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

50 
lemma (in M_basic) irreflexive_abs [simp]: 
13223  51 
"M(A) ==> irreflexive(M,A,r) <> irrefl(A,r)" 
52 
by (simp add: irreflexive_def irrefl_def) 

53 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

54 
lemma (in M_basic) transitive_rel_abs [simp]: 
13223  55 
"M(A) ==> transitive_rel(M,A,r) <> trans[A](r)" 
56 
by (simp add: transitive_rel_def trans_on_def) 

57 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

58 
lemma (in M_basic) linear_rel_abs [simp]: 
13223  59 
"M(A) ==> linear_rel(M,A,r) <> linear(A,r)" 
60 
by (simp add: linear_rel_def linear_def) 

61 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

62 
lemma (in M_basic) wellordered_is_trans_on: 
13223  63 
"[ wellordered(M,A,r); M(A) ] ==> trans[A](r)" 
13505  64 
by (auto simp add: wellordered_def) 
13223  65 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

66 
lemma (in M_basic) wellordered_is_linear: 
13223  67 
"[ wellordered(M,A,r); M(A) ] ==> linear(A,r)" 
13505  68 
by (auto simp add: wellordered_def) 
13223  69 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

70 
lemma (in M_basic) wellordered_is_wellfounded_on: 
13223  71 
"[ wellordered(M,A,r); M(A) ] ==> wellfounded_on(M,A,r)" 
13505  72 
by (auto simp add: wellordered_def) 
13223  73 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

74 
lemma (in M_basic) wellfounded_imp_wellfounded_on: 
13223  75 
"[ wellfounded(M,r); M(A) ] ==> wellfounded_on(M,A,r)" 
76 
by (auto simp add: wellfounded_def wellfounded_on_def) 

77 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

78 
lemma (in M_basic) wellfounded_on_subset_A: 
13269  79 
"[ wellfounded_on(M,A,r); B<=A ] ==> wellfounded_on(M,B,r)" 
80 
by (simp add: wellfounded_on_def, blast) 

81 

13223  82 

83 
subsubsection {*Wellfounded relations*} 

84 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

85 
lemma (in M_basic) wellfounded_on_iff_wellfounded: 
13223  86 
"wellfounded_on(M,A,r) <> wellfounded(M, r \<inter> A*A)" 
87 
apply (simp add: wellfounded_on_def wellfounded_def, safe) 

88 
apply blast 

13299  89 
apply (drule_tac x=x in rspec, assumption, blast) 
13223  90 
done 
91 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

92 
lemma (in M_basic) wellfounded_on_imp_wellfounded: 
13247  93 
"[wellfounded_on(M,A,r); r \<subseteq> A*A] ==> wellfounded(M,r)" 
94 
by (simp add: wellfounded_on_iff_wellfounded subset_Int_iff) 

95 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

96 
lemma (in M_basic) wellfounded_on_field_imp_wellfounded: 
13269  97 
"wellfounded_on(M, field(r), r) ==> wellfounded(M,r)" 
98 
by (simp add: wellfounded_def wellfounded_on_iff_wellfounded, fast) 

99 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

100 
lemma (in M_basic) wellfounded_iff_wellfounded_on_field: 
13269  101 
"M(r) ==> wellfounded(M,r) <> wellfounded_on(M, field(r), r)" 
102 
by (blast intro: wellfounded_imp_wellfounded_on 

103 
wellfounded_on_field_imp_wellfounded) 

104 

13251
74cb2af8811e
new treatment of wfrec, replacing wf[A](r) by wf(r)
paulson
parents:
13247
diff
changeset

105 
(*Consider the least z in domain(r) such that P(z) does not hold...*) 
13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

106 
lemma (in M_basic) wellfounded_induct: 
13251
74cb2af8811e
new treatment of wfrec, replacing wf[A](r) by wf(r)
paulson
parents:
13247
diff
changeset

107 
"[ wellfounded(M,r); M(a); M(r); separation(M, \<lambda>x. ~P(x)); 
74cb2af8811e
new treatment of wfrec, replacing wf[A](r) by wf(r)
paulson
parents:
13247
diff
changeset

108 
\<forall>x. M(x) & (\<forall>y. <y,x> \<in> r > P(y)) > P(x) ] 
74cb2af8811e
new treatment of wfrec, replacing wf[A](r) by wf(r)
paulson
parents:
13247
diff
changeset

109 
==> P(a)"; 
74cb2af8811e
new treatment of wfrec, replacing wf[A](r) by wf(r)
paulson
parents:
13247
diff
changeset

110 
apply (simp (no_asm_use) add: wellfounded_def) 
13299  111 
apply (drule_tac x="{z \<in> domain(r). ~P(z)}" in rspec) 
112 
apply (blast dest: transM)+ 

13251
74cb2af8811e
new treatment of wfrec, replacing wf[A](r) by wf(r)
paulson
parents:
13247
diff
changeset

113 
done 
74cb2af8811e
new treatment of wfrec, replacing wf[A](r) by wf(r)
paulson
parents:
13247
diff
changeset

114 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

115 
lemma (in M_basic) wellfounded_on_induct: 
13223  116 
"[ a\<in>A; wellfounded_on(M,A,r); M(A); 
117 
separation(M, \<lambda>x. x\<in>A > ~P(x)); 

118 
\<forall>x\<in>A. M(x) & (\<forall>y\<in>A. <y,x> \<in> r > P(y)) > P(x) ] 

119 
==> P(a)"; 

120 
apply (simp (no_asm_use) add: wellfounded_on_def) 

13299  121 
apply (drule_tac x="{z\<in>A. z\<in>A > ~P(z)}" in rspec) 
122 
apply (blast intro: transM)+ 

13223  123 
done 
124 

125 

126 
subsubsection {*Kunen's lemma IV 3.14, page 123*} 

127 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

128 
lemma (in M_basic) linear_imp_relativized: 
13223  129 
"linear(A,r) ==> linear_rel(M,A,r)" 
130 
by (simp add: linear_def linear_rel_def) 

131 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

132 
lemma (in M_basic) trans_on_imp_relativized: 
13223  133 
"trans[A](r) ==> transitive_rel(M,A,r)" 
134 
by (unfold transitive_rel_def trans_on_def, blast) 

135 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

136 
lemma (in M_basic) wf_on_imp_relativized: 
13223  137 
"wf[A](r) ==> wellfounded_on(M,A,r)" 
138 
apply (simp add: wellfounded_on_def wf_def wf_on_def, clarify) 

13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13306
diff
changeset

139 
apply (drule_tac x=x in spec, blast) 
13223  140 
done 
141 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

142 
lemma (in M_basic) wf_imp_relativized: 
13223  143 
"wf(r) ==> wellfounded(M,r)" 
144 
apply (simp add: wellfounded_def wf_def, clarify) 

13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13306
diff
changeset

145 
apply (drule_tac x=x in spec, blast) 
13223  146 
done 
147 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

148 
lemma (in M_basic) well_ord_imp_relativized: 
13223  149 
"well_ord(A,r) ==> wellordered(M,A,r)" 
150 
by (simp add: wellordered_def well_ord_def tot_ord_def part_ord_def 

151 
linear_imp_relativized trans_on_imp_relativized wf_on_imp_relativized) 

152 

153 

154 
subsection{* Relativized versions of orderisomorphisms and order types *} 

155 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

156 
lemma (in M_basic) order_isomorphism_abs [simp]: 
13223  157 
"[ M(A); M(B); M(f) ] 
158 
==> order_isomorphism(M,A,r,B,s,f) <> f \<in> ord_iso(A,r,B,s)" 

13352  159 
by (simp add: apply_closed order_isomorphism_def ord_iso_def) 
13223  160 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

161 
lemma (in M_basic) pred_set_abs [simp]: 
13223  162 
"[ M(r); M(B) ] ==> pred_set(M,A,x,r,B) <> B = Order.pred(A,x,r)" 
163 
apply (simp add: pred_set_def Order.pred_def) 

164 
apply (blast dest: transM) 

165 
done 

166 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

167 
lemma (in M_basic) pred_closed [intro,simp]: 
13223  168 
"[ M(A); M(r); M(x) ] ==> M(Order.pred(A,x,r))" 
169 
apply (simp add: Order.pred_def) 

13245  170 
apply (insert pred_separation [of r x], simp) 
13223  171 
done 
172 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

173 
lemma (in M_basic) membership_abs [simp]: 
13223  174 
"[ M(r); M(A) ] ==> membership(M,A,r) <> r = Memrel(A)" 
175 
apply (simp add: membership_def Memrel_def, safe) 

176 
apply (rule equalityI) 

177 
apply clarify 

178 
apply (frule transM, assumption) 

179 
apply blast 

180 
apply clarify 

181 
apply (subgoal_tac "M(<xb,ya>)", blast) 

182 
apply (blast dest: transM) 

183 
apply auto 

184 
done 

185 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

186 
lemma (in M_basic) M_Memrel_iff: 
13223  187 
"M(A) ==> 
13298  188 
Memrel(A) = {z \<in> A*A. \<exists>x[M]. \<exists>y[M]. z = \<langle>x,y\<rangle> & x \<in> y}" 
13223  189 
apply (simp add: Memrel_def) 
190 
apply (blast dest: transM) 

191 
done 

192 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

193 
lemma (in M_basic) Memrel_closed [intro,simp]: 
13223  194 
"M(A) ==> M(Memrel(A))" 
195 
apply (simp add: M_Memrel_iff) 

13245  196 
apply (insert Memrel_separation, simp) 
13223  197 
done 
198 

199 

200 
subsection {* Main results of Kunen, Chapter 1 section 6 *} 

201 

202 
text{*Subset properties proved outside the locale*} 

203 

204 
lemma linear_rel_subset: 

205 
"[ linear_rel(M,A,r); B<=A ] ==> linear_rel(M,B,r)" 

206 
by (unfold linear_rel_def, blast) 

207 

208 
lemma transitive_rel_subset: 

209 
"[ transitive_rel(M,A,r); B<=A ] ==> transitive_rel(M,B,r)" 

210 
by (unfold transitive_rel_def, blast) 

211 

212 
lemma wellfounded_on_subset: 

213 
"[ wellfounded_on(M,A,r); B<=A ] ==> wellfounded_on(M,B,r)" 

214 
by (unfold wellfounded_on_def subset_def, blast) 

215 

216 
lemma wellordered_subset: 

217 
"[ wellordered(M,A,r); B<=A ] ==> wellordered(M,B,r)" 

218 
apply (unfold wellordered_def) 

219 
apply (blast intro: linear_rel_subset transitive_rel_subset 

220 
wellfounded_on_subset) 

221 
done 

222 

223 
text{*Inductive argument for Kunen's Lemma 6.1, etc. 

224 
Simple proof from Halmos, page 72*} 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

225 
lemma (in M_basic) wellordered_iso_subset_lemma: 
13223  226 
"[ wellordered(M,A,r); f \<in> ord_iso(A,r, A',r); A'<= A; y \<in> A; 
227 
M(A); M(f); M(r) ] ==> ~ <f`y, y> \<in> r" 

228 
apply (unfold wellordered_def ord_iso_def) 

229 
apply (elim conjE CollectE) 

230 
apply (erule wellfounded_on_induct, assumption+) 

231 
apply (insert well_ord_iso_separation [of A f r]) 

13352  232 
apply (simp, clarify) 
13223  233 
apply (drule_tac a = x in bij_is_fun [THEN apply_type], assumption, blast) 
234 
done 

235 

236 

237 
text{*Kunen's Lemma 6.1: there's no orderisomorphism to an initial segment 

238 
of a wellordering*} 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

239 
lemma (in M_basic) wellordered_iso_predD: 
13223  240 
"[ wellordered(M,A,r); f \<in> ord_iso(A, r, Order.pred(A,x,r), r); 
241 
M(A); M(f); M(r) ] ==> x \<notin> A" 

242 
apply (rule notI) 

243 
apply (frule wellordered_iso_subset_lemma, assumption) 

244 
apply (auto elim: predE) 

245 
(*Now we know ~ (f`x < x) *) 

246 
apply (drule ord_iso_is_bij [THEN bij_is_fun, THEN apply_type], assumption) 

247 
(*Now we also know f`x \<in> pred(A,x,r); contradiction! *) 

248 
apply (simp add: Order.pred_def) 

249 
done 

250 

251 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

252 
lemma (in M_basic) wellordered_iso_pred_eq_lemma: 
13223  253 
"[ f \<in> \<langle>Order.pred(A,y,r), r\<rangle> \<cong> \<langle>Order.pred(A,x,r), r\<rangle>; 
254 
wellordered(M,A,r); x\<in>A; y\<in>A; M(A); M(f); M(r) ] ==> <x,y> \<notin> r" 

255 
apply (frule wellordered_is_trans_on, assumption) 

256 
apply (rule notI) 

257 
apply (drule_tac x2=y and x=x and r2=r in 

258 
wellordered_subset [OF _ pred_subset, THEN wellordered_iso_predD]) 

259 
apply (simp add: trans_pred_pred_eq) 

260 
apply (blast intro: predI dest: transM)+ 

261 
done 

262 

263 

264 
text{*Simple consequence of Lemma 6.1*} 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

265 
lemma (in M_basic) wellordered_iso_pred_eq: 
13223  266 
"[ wellordered(M,A,r); 
267 
f \<in> ord_iso(Order.pred(A,a,r), r, Order.pred(A,c,r), r); 

268 
M(A); M(f); M(r); a\<in>A; c\<in>A ] ==> a=c" 

269 
apply (frule wellordered_is_trans_on, assumption) 

270 
apply (frule wellordered_is_linear, assumption) 

271 
apply (erule_tac x=a and y=c in linearE, auto) 

272 
apply (drule ord_iso_sym) 

273 
(*two symmetric cases*) 

274 
apply (blast dest: wellordered_iso_pred_eq_lemma)+ 

275 
done 

276 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

277 
lemma (in M_basic) wellfounded_on_asym: 
13223  278 
"[ wellfounded_on(M,A,r); <a,x>\<in>r; a\<in>A; x\<in>A; M(A) ] ==> <x,a>\<notin>r" 
279 
apply (simp add: wellfounded_on_def) 

13299  280 
apply (drule_tac x="{x,a}" in rspec) 
281 
apply (blast dest: transM)+ 

13223  282 
done 
283 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

284 
lemma (in M_basic) wellordered_asym: 
13223  285 
"[ wellordered(M,A,r); <a,x>\<in>r; a\<in>A; x\<in>A; M(A) ] ==> <x,a>\<notin>r" 
286 
by (simp add: wellordered_def, blast dest: wellfounded_on_asym) 

287 

288 

13628
87482b5e3f2e
Various simplifications of the Constructible theories
paulson
parents:
13615
diff
changeset

289 
text{*Can't use @{text well_ord_iso_preserving} because it needs the 
87482b5e3f2e
Various simplifications of the Constructible theories
paulson
parents:
13615
diff
changeset

290 
strong premise @{term "well_ord(A,r)"}*} 
13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

291 
lemma (in M_basic) ord_iso_pred_imp_lt: 
13223  292 
"[ f \<in> ord_iso(Order.pred(A,x,r), r, i, Memrel(i)); 
13628
87482b5e3f2e
Various simplifications of the Constructible theories
paulson
parents:
13615
diff
changeset

293 
g \<in> ord_iso(Order.pred(A,y,r), r, j, Memrel(j)); 
87482b5e3f2e
Various simplifications of the Constructible theories
paulson
parents:
13615
diff
changeset

294 
wellordered(M,A,r); x \<in> A; y \<in> A; M(A); M(r); M(f); M(g); M(j); 
87482b5e3f2e
Various simplifications of the Constructible theories
paulson
parents:
13615
diff
changeset

295 
Ord(i); Ord(j); \<langle>x,y\<rangle> \<in> r ] 
13223  296 
==> i < j" 
297 
apply (frule wellordered_is_trans_on, assumption) 

298 
apply (frule_tac y=y in transM, assumption) 

299 
apply (rule_tac i=i and j=j in Ord_linear_lt, auto) 

300 
txt{*case @{term "i=j"} yields a contradiction*} 

301 
apply (rule_tac x1=x and A1="Order.pred(A,y,r)" in 

302 
wellordered_iso_predD [THEN notE]) 

303 
apply (blast intro: wellordered_subset [OF _ pred_subset]) 

304 
apply (simp add: trans_pred_pred_eq) 

305 
apply (blast intro: Ord_iso_implies_eq ord_iso_sym ord_iso_trans) 

306 
apply (simp_all add: pred_iff pred_closed converse_closed comp_closed) 

307 
txt{*case @{term "j<i"} also yields a contradiction*} 

308 
apply (frule restrict_ord_iso2, assumption+) 

309 
apply (frule ord_iso_sym [THEN ord_iso_is_bij, THEN bij_is_fun]) 

310 
apply (frule apply_type, blast intro: ltD) 

311 
{*thus @{term "converse(f)`j \<in> Order.pred(A,x,r)"}*} 

312 
apply (simp add: pred_iff) 

313 
apply (subgoal_tac 

13299  314 
"\<exists>h[M]. h \<in> ord_iso(Order.pred(A,y,r), r, 
13223  315 
Order.pred(A, converse(f)`j, r), r)") 
316 
apply (clarify, frule wellordered_iso_pred_eq, assumption+) 

317 
apply (blast dest: wellordered_asym) 

13299  318 
apply (intro rexI) 
319 
apply (blast intro: Ord_iso_implies_eq ord_iso_sym ord_iso_trans)+ 

13223  320 
done 
321 

322 

323 
lemma ord_iso_converse1: 

324 
"[ f: ord_iso(A,r,B,s); <b, f`a>: s; a:A; b:B ] 

325 
==> <converse(f) ` b, a> : r" 

326 
apply (frule ord_iso_converse, assumption+) 

327 
apply (blast intro: ord_iso_is_bij [THEN bij_is_fun, THEN apply_funtype]) 

328 
apply (simp add: left_inverse_bij [OF ord_iso_is_bij]) 

329 
done 

330 

331 

332 
subsection {* Order Types: A Direct Construction by Replacement*} 

333 

334 
text{*This follows Kunen's Theorem I 7.6, page 17.*} 

335 

336 
constdefs 

337 

338 
obase :: "[i=>o,i,i,i] => o" 

339 
{*the domain of @{text om}, eventually shown to equal @{text A}*} 

340 
"obase(M,A,r,z) == 

13293  341 
\<forall>a[M]. 
342 
a \<in> z <> 

13628
87482b5e3f2e
Various simplifications of the Constructible theories
paulson
parents:
13615
diff
changeset

343 
(a\<in>A & (\<exists>x[M]. \<exists>g[M]. Ord(x) & 
87482b5e3f2e
Various simplifications of the Constructible theories
paulson
parents:
13615
diff
changeset

344 
order_isomorphism(M,Order.pred(A,a,r),r,x,Memrel(x),g)))" 
13223  345 

346 

347 
omap :: "[i=>o,i,i,i] => o" 

348 
{*the function that maps wosets to order types*} 

349 
"omap(M,A,r,f) == 

13293  350 
\<forall>z[M]. 
351 
z \<in> f <> 

13299  352 
(\<exists>a[M]. a\<in>A & 
13306  353 
(\<exists>x[M]. \<exists>g[M]. \<exists>mx[M]. \<exists>par[M]. 
354 
ordinal(M,x) & pair(M,a,x,z) & membership(M,x,mx) & 

355 
pred_set(M,A,a,r,par) & order_isomorphism(M,par,r,x,mx,g)))" 

13223  356 

357 

358 
otype :: "[i=>o,i,i,i] => o" {*the order types themselves*} 

13299  359 
"otype(M,A,r,i) == \<exists>f[M]. omap(M,A,r,f) & is_range(M,f,i)" 
13223  360 

361 

362 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

363 
lemma (in M_basic) obase_iff: 
13223  364 
"[ M(A); M(r); M(z) ] 
365 
==> obase(M,A,r,z) <> 

13306  366 
z = {a\<in>A. \<exists>x[M]. \<exists>g[M]. Ord(x) & 
13223  367 
g \<in> ord_iso(Order.pred(A,a,r),r,x,Memrel(x))}" 
368 
apply (simp add: obase_def Memrel_closed pred_closed) 

369 
apply (rule iffI) 

370 
prefer 2 apply blast 

371 
apply (rule equalityI) 

13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13611
diff
changeset

372 
apply (clarify, frule transM, assumption, simp) 
13223  373 
apply (clarify, frule transM, assumption, force) 
374 
done 

375 

376 
text{*Can also be proved with the premise @{term "M(z)"} instead of 

377 
@{term "M(f)"}, but that version is less useful.*} 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

378 
lemma (in M_basic) omap_iff: 
13223  379 
"[ omap(M,A,r,f); M(A); M(r); M(f) ] 
380 
==> z \<in> f <> 

13306  381 
(\<exists>a\<in>A. \<exists>x[M]. \<exists>g[M]. z = <a,x> & Ord(x) & 
382 
g \<in> ord_iso(Order.pred(A,a,r),r,x,Memrel(x)))" 

13223  383 
apply (simp add: omap_def Memrel_closed pred_closed) 
13293  384 
apply (rule iffI) 
385 
apply (drule_tac [2] x=z in rspec) 

386 
apply (drule_tac x=z in rspec) 

387 
apply (blast dest: transM)+ 

13223  388 
done 
389 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

390 
lemma (in M_basic) omap_unique: 
13223  391 
"[ omap(M,A,r,f); omap(M,A,r,f'); M(A); M(r); M(f); M(f') ] ==> f' = f" 
392 
apply (rule equality_iffI) 

393 
apply (simp add: omap_iff) 

394 
done 

395 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

396 
lemma (in M_basic) omap_yields_Ord: 
13223  397 
"[ omap(M,A,r,f); \<langle>a,x\<rangle> \<in> f; M(a); M(x) ] ==> Ord(x)" 
13611  398 
by (simp add: omap_def) 
13223  399 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

400 
lemma (in M_basic) otype_iff: 
13223  401 
"[ otype(M,A,r,i); M(A); M(r); M(i) ] 
402 
==> x \<in> i <> 

13306  403 
(M(x) & Ord(x) & 
404 
(\<exists>a\<in>A. \<exists>g[M]. g \<in> ord_iso(Order.pred(A,a,r),r,x,Memrel(x))))" 

405 
apply (auto simp add: omap_iff otype_def) 

406 
apply (blast intro: transM) 

407 
apply (rule rangeI) 

13223  408 
apply (frule transM, assumption) 
409 
apply (simp add: omap_iff, blast) 

410 
done 

411 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

412 
lemma (in M_basic) otype_eq_range: 
13306  413 
"[ omap(M,A,r,f); otype(M,A,r,i); M(A); M(r); M(f); M(i) ] 
414 
==> i = range(f)" 

13223  415 
apply (auto simp add: otype_def omap_iff) 
416 
apply (blast dest: omap_unique) 

417 
done 

418 

419 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

420 
lemma (in M_basic) Ord_otype: 
13223  421 
"[ otype(M,A,r,i); trans[A](r); M(A); M(r); M(i) ] ==> Ord(i)" 
422 
apply (rule OrdI) 

423 
prefer 2 

424 
apply (simp add: Ord_def otype_def omap_def) 

425 
apply clarify 

426 
apply (frule pair_components_in_M, assumption) 

427 
apply blast 

428 
apply (auto simp add: Transset_def otype_iff) 

13306  429 
apply (blast intro: transM) 
430 
apply (blast intro: Ord_in_Ord) 

13223  431 
apply (rename_tac y a g) 
432 
apply (frule ord_iso_sym [THEN ord_iso_is_bij, THEN bij_is_fun, 

433 
THEN apply_funtype], assumption) 

434 
apply (rule_tac x="converse(g)`y" in bexI) 

435 
apply (frule_tac a="converse(g) ` y" in ord_iso_restrict_pred, assumption) 

436 
apply (safe elim!: predE) 

13306  437 
apply (blast intro: restrict_ord_iso ord_iso_sym ltI dest: transM) 
13223  438 
done 
439 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

440 
lemma (in M_basic) domain_omap: 
13223  441 
"[ omap(M,A,r,f); obase(M,A,r,B); M(A); M(r); M(B); M(f) ] 
442 
==> domain(f) = B" 

443 
apply (simp add: domain_closed obase_iff) 

444 
apply (rule equality_iffI) 

445 
apply (simp add: domain_iff omap_iff, blast) 

446 
done 

447 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

448 
lemma (in M_basic) omap_subset: 
13223  449 
"[ omap(M,A,r,f); obase(M,A,r,B); otype(M,A,r,i); 
450 
M(A); M(r); M(f); M(B); M(i) ] ==> f \<subseteq> B * i" 

13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13611
diff
changeset

451 
apply clarify 
13223  452 
apply (simp add: omap_iff obase_iff) 
453 
apply (force simp add: otype_iff) 

454 
done 

455 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

456 
lemma (in M_basic) omap_funtype: 
13223  457 
"[ omap(M,A,r,f); obase(M,A,r,B); otype(M,A,r,i); 
458 
M(A); M(r); M(f); M(B); M(i) ] ==> f \<in> B > i" 

459 
apply (simp add: domain_omap omap_subset Pi_iff function_def omap_iff) 

460 
apply (blast intro: Ord_iso_implies_eq ord_iso_sym ord_iso_trans) 

461 
done 

462 

463 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

464 
lemma (in M_basic) wellordered_omap_bij: 
13223  465 
"[ wellordered(M,A,r); omap(M,A,r,f); obase(M,A,r,B); otype(M,A,r,i); 
466 
M(A); M(r); M(f); M(B); M(i) ] ==> f \<in> bij(B,i)" 

467 
apply (insert omap_funtype [of A r f B i]) 

468 
apply (auto simp add: bij_def inj_def) 

469 
prefer 2 apply (blast intro: fun_is_surj dest: otype_eq_range) 

13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13306
diff
changeset

470 
apply (frule_tac a=w in apply_Pair, assumption) 
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13306
diff
changeset

471 
apply (frule_tac a=x in apply_Pair, assumption) 
13223  472 
apply (simp add: omap_iff) 
473 
apply (blast intro: wellordered_iso_pred_eq ord_iso_sym ord_iso_trans) 

474 
done 

475 

476 

477 
text{*This is not the final result: we must show @{term "oB(A,r) = A"}*} 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

478 
lemma (in M_basic) omap_ord_iso: 
13223  479 
"[ wellordered(M,A,r); omap(M,A,r,f); obase(M,A,r,B); otype(M,A,r,i); 
480 
M(A); M(r); M(f); M(B); M(i) ] ==> f \<in> ord_iso(B,r,i,Memrel(i))" 

481 
apply (rule ord_isoI) 

482 
apply (erule wellordered_omap_bij, assumption+) 

483 
apply (insert omap_funtype [of A r f B i], simp) 

13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13306
diff
changeset

484 
apply (frule_tac a=x in apply_Pair, assumption) 
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13306
diff
changeset

485 
apply (frule_tac a=y in apply_Pair, assumption) 
13223  486 
apply (auto simp add: omap_iff) 
487 
txt{*direction 1: assuming @{term "\<langle>x,y\<rangle> \<in> r"}*} 

488 
apply (blast intro: ltD ord_iso_pred_imp_lt) 

489 
txt{*direction 2: proving @{term "\<langle>x,y\<rangle> \<in> r"} using linearity of @{term r}*} 

490 
apply (rename_tac x y g ga) 

491 
apply (frule wellordered_is_linear, assumption, 

492 
erule_tac x=x and y=y in linearE, assumption+) 

493 
txt{*the case @{term "x=y"} leads to immediate contradiction*} 

494 
apply (blast elim: mem_irrefl) 

495 
txt{*the case @{term "\<langle>y,x\<rangle> \<in> r"}: handle like the opposite direction*} 

496 
apply (blast dest: ord_iso_pred_imp_lt ltD elim: mem_asym) 

497 
done 

498 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

499 
lemma (in M_basic) Ord_omap_image_pred: 
13223  500 
"[ wellordered(M,A,r); omap(M,A,r,f); obase(M,A,r,B); otype(M,A,r,i); 
501 
M(A); M(r); M(f); M(B); M(i); b \<in> A ] ==> Ord(f `` Order.pred(A,b,r))" 

502 
apply (frule wellordered_is_trans_on, assumption) 

503 
apply (rule OrdI) 

504 
prefer 2 apply (simp add: image_iff omap_iff Ord_def, blast) 

505 
txt{*Hard part is to show that the image is a transitive set.*} 

506 
apply (simp add: Transset_def, clarify) 

507 
apply (simp add: image_iff pred_iff apply_iff [OF omap_funtype [of A r f B i]]) 

508 
apply (rename_tac c j, clarify) 

509 
apply (frule omap_funtype [of A r f B, THEN apply_funtype], assumption+) 

510 
apply (subgoal_tac "j : i") 

511 
prefer 2 apply (blast intro: Ord_trans Ord_otype) 

512 
apply (subgoal_tac "converse(f) ` j : B") 

513 
prefer 2 

514 
apply (blast dest: wellordered_omap_bij [THEN bij_converse_bij, 

515 
THEN bij_is_fun, THEN apply_funtype]) 

516 
apply (rule_tac x="converse(f) ` j" in bexI) 

517 
apply (simp add: right_inverse_bij [OF wellordered_omap_bij]) 

518 
apply (intro predI conjI) 

519 
apply (erule_tac b=c in trans_onD) 

520 
apply (rule ord_iso_converse1 [OF omap_ord_iso [of A r f B i]]) 

521 
apply (auto simp add: obase_iff) 

522 
done 

523 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

524 
lemma (in M_basic) restrict_omap_ord_iso: 
13223  525 
"[ wellordered(M,A,r); omap(M,A,r,f); obase(M,A,r,B); otype(M,A,r,i); 
526 
D \<subseteq> B; M(A); M(r); M(f); M(B); M(i) ] 

527 
==> restrict(f,D) \<in> (\<langle>D,r\<rangle> \<cong> \<langle>f``D, Memrel(f``D)\<rangle>)" 

528 
apply (frule ord_iso_restrict_image [OF omap_ord_iso [of A r f B i]], 

529 
assumption+) 

530 
apply (drule ord_iso_sym [THEN subset_ord_iso_Memrel]) 

531 
apply (blast dest: subsetD [OF omap_subset]) 

532 
apply (drule ord_iso_sym, simp) 

533 
done 

534 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

535 
lemma (in M_basic) obase_equals: 
13223  536 
"[ wellordered(M,A,r); omap(M,A,r,f); obase(M,A,r,B); otype(M,A,r,i); 
537 
M(A); M(r); M(f); M(B); M(i) ] ==> B = A" 

538 
apply (rule equalityI, force simp add: obase_iff, clarify) 

539 
apply (subst obase_iff [of A r B, THEN iffD1], assumption+, simp) 

540 
apply (frule wellordered_is_wellfounded_on, assumption) 

541 
apply (erule wellfounded_on_induct, assumption+) 

13306  542 
apply (frule obase_equals_separation [of A r], assumption) 
543 
apply (simp, clarify) 

13223  544 
apply (rename_tac b) 
545 
apply (subgoal_tac "Order.pred(A,b,r) <= B") 

13306  546 
apply (blast intro!: restrict_omap_ord_iso Ord_omap_image_pred) 
547 
apply (force simp add: pred_iff obase_iff) 

13223  548 
done 
549 

550 

551 

552 
text{*Main result: @{term om} gives the orderisomorphism 

553 
@{term "\<langle>A,r\<rangle> \<cong> \<langle>i, Memrel(i)\<rangle>"} *} 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

554 
theorem (in M_basic) omap_ord_iso_otype: 
13223  555 
"[ wellordered(M,A,r); omap(M,A,r,f); obase(M,A,r,B); otype(M,A,r,i); 
556 
M(A); M(r); M(f); M(B); M(i) ] ==> f \<in> ord_iso(A, r, i, Memrel(i))" 

557 
apply (frule omap_ord_iso, assumption+) 

558 
apply (frule obase_equals, assumption+, blast) 

13293  559 
done 
13223  560 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

561 
lemma (in M_basic) obase_exists: 
13293  562 
"[ M(A); M(r) ] ==> \<exists>z[M]. obase(M,A,r,z)" 
13223  563 
apply (simp add: obase_def) 
564 
apply (insert obase_separation [of A r]) 

565 
apply (simp add: separation_def) 

566 
done 

567 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

568 
lemma (in M_basic) omap_exists: 
13293  569 
"[ M(A); M(r) ] ==> \<exists>z[M]. omap(M,A,r,z)" 
13223  570 
apply (insert obase_exists [of A r]) 
571 
apply (simp add: omap_def) 

572 
apply (insert omap_replacement [of A r]) 

573 
apply (simp add: strong_replacement_def, clarify) 

13299  574 
apply (drule_tac x=x in rspec, clarify) 
13223  575 
apply (simp add: Memrel_closed pred_closed obase_iff) 
576 
apply (erule impE) 

577 
apply (clarsimp simp add: univalent_def) 

578 
apply (blast intro: Ord_iso_implies_eq ord_iso_sym ord_iso_trans, clarify) 

13293  579 
apply (rule_tac x=Y in rexI) 
580 
apply (simp add: Memrel_closed pred_closed obase_iff, blast, assumption) 

13223  581 
done 
582 

13293  583 
declare rall_simps [simp] rex_simps [simp] 
584 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

585 
lemma (in M_basic) otype_exists: 
13299  586 
"[ wellordered(M,A,r); M(A); M(r) ] ==> \<exists>i[M]. otype(M,A,r,i)" 
13293  587 
apply (insert omap_exists [of A r]) 
588 
apply (simp add: otype_def, safe) 

13299  589 
apply (rule_tac x="range(x)" in rexI) 
590 
apply blast+ 

13223  591 
done 
592 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

593 
theorem (in M_basic) omap_ord_iso_otype': 
13223  594 
"[ wellordered(M,A,r); M(A); M(r) ] 
13299  595 
==> \<exists>f[M]. (\<exists>i[M]. Ord(i) & f \<in> ord_iso(A, r, i, Memrel(i)))" 
13223  596 
apply (insert obase_exists [of A r] omap_exists [of A r] otype_exists [of A r], simp, clarify) 
13299  597 
apply (rename_tac i) 
13223  598 
apply (subgoal_tac "Ord(i)", blast intro: omap_ord_iso_otype) 
599 
apply (rule Ord_otype) 

600 
apply (force simp add: otype_def range_closed) 

601 
apply (simp_all add: wellordered_is_trans_on) 

602 
done 

603 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

604 
lemma (in M_basic) ordertype_exists: 
13223  605 
"[ wellordered(M,A,r); M(A); M(r) ] 
13299  606 
==> \<exists>f[M]. (\<exists>i[M]. Ord(i) & f \<in> ord_iso(A, r, i, Memrel(i)))" 
13223  607 
apply (insert obase_exists [of A r] omap_exists [of A r] otype_exists [of A r], simp, clarify) 
13299  608 
apply (rename_tac i) 
13428  609 
apply (subgoal_tac "Ord(i)", blast intro: omap_ord_iso_otype') 
13223  610 
apply (rule Ord_otype) 
611 
apply (force simp add: otype_def range_closed) 

612 
apply (simp_all add: wellordered_is_trans_on) 

613 
done 

614 

615 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

616 
lemma (in M_basic) relativized_imp_well_ord: 
13223  617 
"[ wellordered(M,A,r); M(A); M(r) ] ==> well_ord(A,r)" 
618 
apply (insert ordertype_exists [of A r], simp) 

13505  619 
apply (blast intro: well_ord_ord_iso well_ord_Memrel) 
13223  620 
done 
621 

622 
subsection {*Kunen's theorem 5.4, poage 127*} 

623 

624 
text{*(a) The notion of Wellordering is absolute*} 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

625 
theorem (in M_basic) well_ord_abs [simp]: 
13223  626 
"[ M(A); M(r) ] ==> wellordered(M,A,r) <> well_ord(A,r)" 
627 
by (blast intro: well_ord_imp_relativized relativized_imp_well_ord) 

628 

629 

630 
text{*(b) Order types are absolute*} 

13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13513
diff
changeset

631 
lemma (in M_basic) 
13223  632 
"[ wellordered(M,A,r); f \<in> ord_iso(A, r, i, Memrel(i)); 
633 
M(A); M(r); M(f); M(i); Ord(i) ] ==> i = ordertype(A,r)" 

634 
by (blast intro: Ord_ordertype relativized_imp_well_ord ordertype_ord_iso 

635 
Ord_iso_implies_eq ord_iso_sym ord_iso_trans) 

636 

637 
end 