author  paulson 
Fri, 05 Jul 2002 18:33:50 +0200  
changeset 13306  6eebcddee32b 
parent 13299  3a932abf97e8 
child 13339  0f89104dd377 
permissions  rwrr 
13223  1 
header {*Relativized Wellorderings*} 
2 

3 
theory Wellorderings = Relative: 

4 

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

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

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

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

9 
page 17.*} 

10 

11 

12 
subsection{*Wellorderings*} 

13 

14 
constdefs 

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

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

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

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

13299  20 
\<forall>x[M]. x\<in>A > (\<forall>y[M]. y\<in>A > (\<forall>z[M]. z\<in>A > 
13223  21 
<x,y>\<in>r > <y,z>\<in>r > <x,z>\<in>r))" 
22 

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

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

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

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

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

29 
"wellfounded(M,r) == 

13299  30 
\<forall>x[M]. ~ empty(M,x) 
31 
> (\<exists>y[M]. y\<in>x & ~(\<exists>z[M]. z\<in>x & <z,y> \<in> r))" 

13223  32 
wellfounded_on :: "[i=>o,i,i]=>o" 
33 
{*every nonempty SUBSET OF @{text A} has an @{text r}minimal element*} 

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

13299  35 
\<forall>x[M]. ~ empty(M,x) > subset(M,x,A) 
36 
> (\<exists>y[M]. y\<in>x & ~(\<exists>z[M]. z\<in>x & <z,y> \<in> r))" 

13223  37 

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

39 
{*every nonempty subset of @{text A} has an @{text r}minimal element*} 

40 
"wellordered(M,A,r) == 

41 
transitive_rel(M,A,r) & linear_rel(M,A,r) & wellfounded_on(M,A,r)" 

42 

43 

44 
subsubsection {*Trivial absoluteness proofs*} 

45 

46 
lemma (in M_axioms) irreflexive_abs [simp]: 

47 
"M(A) ==> irreflexive(M,A,r) <> irrefl(A,r)" 

48 
by (simp add: irreflexive_def irrefl_def) 

49 

50 
lemma (in M_axioms) transitive_rel_abs [simp]: 

51 
"M(A) ==> transitive_rel(M,A,r) <> trans[A](r)" 

52 
by (simp add: transitive_rel_def trans_on_def) 

53 

54 
lemma (in M_axioms) linear_rel_abs [simp]: 

55 
"M(A) ==> linear_rel(M,A,r) <> linear(A,r)" 

56 
by (simp add: linear_rel_def linear_def) 

57 

58 
lemma (in M_axioms) wellordered_is_trans_on: 

59 
"[ wellordered(M,A,r); M(A) ] ==> trans[A](r)" 

60 
by (auto simp add: wellordered_def ) 

61 

62 
lemma (in M_axioms) wellordered_is_linear: 

63 
"[ wellordered(M,A,r); M(A) ] ==> linear(A,r)" 

64 
by (auto simp add: wellordered_def ) 

65 

66 
lemma (in M_axioms) wellordered_is_wellfounded_on: 

67 
"[ wellordered(M,A,r); M(A) ] ==> wellfounded_on(M,A,r)" 

68 
by (auto simp add: wellordered_def ) 

69 

70 
lemma (in M_axioms) wellfounded_imp_wellfounded_on: 

71 
"[ wellfounded(M,r); M(A) ] ==> wellfounded_on(M,A,r)" 

72 
by (auto simp add: wellfounded_def wellfounded_on_def) 

73 

13269  74 
lemma (in M_axioms) wellfounded_on_subset_A: 
75 
"[ wellfounded_on(M,A,r); B<=A ] ==> wellfounded_on(M,B,r)" 

76 
by (simp add: wellfounded_on_def, blast) 

77 

13223  78 

79 
subsubsection {*Wellfounded relations*} 

80 

81 
lemma (in M_axioms) wellfounded_on_iff_wellfounded: 

82 
"wellfounded_on(M,A,r) <> wellfounded(M, r \<inter> A*A)" 

83 
apply (simp add: wellfounded_on_def wellfounded_def, safe) 

84 
apply blast 

13299  85 
apply (drule_tac x=x in rspec, assumption, blast) 
13223  86 
done 
87 

13247  88 
lemma (in M_axioms) wellfounded_on_imp_wellfounded: 
89 
"[wellfounded_on(M,A,r); r \<subseteq> A*A] ==> wellfounded(M,r)" 

90 
by (simp add: wellfounded_on_iff_wellfounded subset_Int_iff) 

91 

13269  92 
lemma (in M_axioms) wellfounded_on_field_imp_wellfounded: 
93 
"wellfounded_on(M, field(r), r) ==> wellfounded(M,r)" 

94 
by (simp add: wellfounded_def wellfounded_on_iff_wellfounded, fast) 

95 

96 
lemma (in M_axioms) wellfounded_iff_wellfounded_on_field: 

97 
"M(r) ==> wellfounded(M,r) <> wellfounded_on(M, field(r), r)" 

98 
by (blast intro: wellfounded_imp_wellfounded_on 

99 
wellfounded_on_field_imp_wellfounded) 

100 

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

101 
(*Consider the least z in domain(r) such that P(z) does not hold...*) 
74cb2af8811e
new treatment of wfrec, replacing wf[A](r) by wf(r)
paulson
parents:
13247
diff
changeset

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

103 
"[ 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

104 
\<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

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

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

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

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

110 

13223  111 
lemma (in M_axioms) wellfounded_on_induct: 
112 
"[ a\<in>A; wellfounded_on(M,A,r); M(A); 

113 
separation(M, \<lambda>x. x\<in>A > ~P(x)); 

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

115 
==> P(a)"; 

116 
apply (simp (no_asm_use) add: wellfounded_on_def) 

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

13223  119 
done 
120 

121 
text{*The assumption @{term "r \<subseteq> A*A"} justifies strengthening the induction 

122 
hypothesis by removing the restriction to @{term A}.*} 

123 
lemma (in M_axioms) wellfounded_on_induct2: 

124 
"[ a\<in>A; wellfounded_on(M,A,r); M(A); r \<subseteq> A*A; 

125 
separation(M, \<lambda>x. x\<in>A > ~P(x)); 

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

127 
==> P(a)"; 

128 
by (rule wellfounded_on_induct, assumption+, blast) 

129 

130 

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

132 

133 
lemma (in M_axioms) linear_imp_relativized: 

134 
"linear(A,r) ==> linear_rel(M,A,r)" 

135 
by (simp add: linear_def linear_rel_def) 

136 

137 
lemma (in M_axioms) trans_on_imp_relativized: 

138 
"trans[A](r) ==> transitive_rel(M,A,r)" 

139 
by (unfold transitive_rel_def trans_on_def, blast) 

140 

141 
lemma (in M_axioms) wf_on_imp_relativized: 

142 
"wf[A](r) ==> wellfounded_on(M,A,r)" 

143 
apply (simp add: wellfounded_on_def wf_def wf_on_def, clarify) 

144 
apply (drule_tac x="x" in spec, blast) 

145 
done 

146 

147 
lemma (in M_axioms) wf_imp_relativized: 

148 
"wf(r) ==> wellfounded(M,r)" 

149 
apply (simp add: wellfounded_def wf_def, clarify) 

150 
apply (drule_tac x="x" in spec, blast) 

151 
done 

152 

153 
lemma (in M_axioms) well_ord_imp_relativized: 

154 
"well_ord(A,r) ==> wellordered(M,A,r)" 

155 
by (simp add: wellordered_def well_ord_def tot_ord_def part_ord_def 

156 
linear_imp_relativized trans_on_imp_relativized wf_on_imp_relativized) 

157 

158 

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

160 

161 
lemma (in M_axioms) order_isomorphism_abs [simp]: 

162 
"[ M(A); M(B); M(f) ] 

163 
==> order_isomorphism(M,A,r,B,s,f) <> f \<in> ord_iso(A,r,B,s)" 

164 
by (simp add: typed_apply_abs [OF bij_is_fun] apply_closed 

165 
order_isomorphism_def ord_iso_def) 

166 

167 

168 
lemma (in M_axioms) pred_set_abs [simp]: 

169 
"[ M(r); M(B) ] ==> pred_set(M,A,x,r,B) <> B = Order.pred(A,x,r)" 

170 
apply (simp add: pred_set_def Order.pred_def) 

171 
apply (blast dest: transM) 

172 
done 

173 

13245  174 
lemma (in M_axioms) pred_closed [intro,simp]: 
13223  175 
"[ M(A); M(r); M(x) ] ==> M(Order.pred(A,x,r))" 
176 
apply (simp add: Order.pred_def) 

13245  177 
apply (insert pred_separation [of r x], simp) 
13223  178 
done 
179 

180 
lemma (in M_axioms) membership_abs [simp]: 

181 
"[ M(r); M(A) ] ==> membership(M,A,r) <> r = Memrel(A)" 

182 
apply (simp add: membership_def Memrel_def, safe) 

183 
apply (rule equalityI) 

184 
apply clarify 

185 
apply (frule transM, assumption) 

186 
apply blast 

187 
apply clarify 

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

189 
apply (blast dest: transM) 

190 
apply auto 

191 
done 

192 

193 
lemma (in M_axioms) M_Memrel_iff: 

194 
"M(A) ==> 

13298  195 
Memrel(A) = {z \<in> A*A. \<exists>x[M]. \<exists>y[M]. z = \<langle>x,y\<rangle> & x \<in> y}" 
13223  196 
apply (simp add: Memrel_def) 
197 
apply (blast dest: transM) 

198 
done 

199 

13245  200 
lemma (in M_axioms) Memrel_closed [intro,simp]: 
13223  201 
"M(A) ==> M(Memrel(A))" 
202 
apply (simp add: M_Memrel_iff) 

13245  203 
apply (insert Memrel_separation, simp) 
13223  204 
done 
205 

206 

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

208 

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

210 

211 
lemma linear_rel_subset: 

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

213 
by (unfold linear_rel_def, blast) 

214 

215 
lemma transitive_rel_subset: 

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

217 
by (unfold transitive_rel_def, blast) 

218 

219 
lemma wellfounded_on_subset: 

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

221 
by (unfold wellfounded_on_def subset_def, blast) 

222 

223 
lemma wellordered_subset: 

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

225 
apply (unfold wellordered_def) 

226 
apply (blast intro: linear_rel_subset transitive_rel_subset 

227 
wellfounded_on_subset) 

228 
done 

229 

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

231 
Simple proof from Halmos, page 72*} 

232 
lemma (in M_axioms) wellordered_iso_subset_lemma: 

233 
"[ wellordered(M,A,r); f \<in> ord_iso(A,r, A',r); A'<= A; y \<in> A; 

234 
M(A); M(f); M(r) ] ==> ~ <f`y, y> \<in> r" 

235 
apply (unfold wellordered_def ord_iso_def) 

236 
apply (elim conjE CollectE) 

237 
apply (erule wellfounded_on_induct, assumption+) 

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

239 
apply (simp add: typed_apply_abs [OF bij_is_fun] apply_closed, clarify) 

240 
apply (drule_tac a = x in bij_is_fun [THEN apply_type], assumption, blast) 

241 
done 

242 

243 

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

245 
of a wellordering*} 

246 
lemma (in M_axioms) wellordered_iso_predD: 

247 
"[ wellordered(M,A,r); f \<in> ord_iso(A, r, Order.pred(A,x,r), r); 

248 
M(A); M(f); M(r) ] ==> x \<notin> A" 

249 
apply (rule notI) 

250 
apply (frule wellordered_iso_subset_lemma, assumption) 

251 
apply (auto elim: predE) 

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

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

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

255 
apply (simp add: Order.pred_def) 

256 
done 

257 

258 

259 
lemma (in M_axioms) wellordered_iso_pred_eq_lemma: 

260 
"[ f \<in> \<langle>Order.pred(A,y,r), r\<rangle> \<cong> \<langle>Order.pred(A,x,r), r\<rangle>; 

261 
wellordered(M,A,r); x\<in>A; y\<in>A; M(A); M(f); M(r) ] ==> <x,y> \<notin> r" 

262 
apply (frule wellordered_is_trans_on, assumption) 

263 
apply (rule notI) 

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

265 
wellordered_subset [OF _ pred_subset, THEN wellordered_iso_predD]) 

266 
apply (simp add: trans_pred_pred_eq) 

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

268 
done 

269 

270 

271 
text{*Simple consequence of Lemma 6.1*} 

272 
lemma (in M_axioms) wellordered_iso_pred_eq: 

273 
"[ wellordered(M,A,r); 

274 
f \<in> ord_iso(Order.pred(A,a,r), r, Order.pred(A,c,r), r); 

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

276 
apply (frule wellordered_is_trans_on, assumption) 

277 
apply (frule wellordered_is_linear, assumption) 

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

279 
apply (drule ord_iso_sym) 

280 
(*two symmetric cases*) 

281 
apply (blast dest: wellordered_iso_pred_eq_lemma)+ 

282 
done 

283 

284 
lemma (in M_axioms) wellfounded_on_asym: 

285 
"[ wellfounded_on(M,A,r); <a,x>\<in>r; a\<in>A; x\<in>A; M(A) ] ==> <x,a>\<notin>r" 

286 
apply (simp add: wellfounded_on_def) 

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

13223  289 
done 
290 

291 
lemma (in M_axioms) wellordered_asym: 

292 
"[ wellordered(M,A,r); <a,x>\<in>r; a\<in>A; x\<in>A; M(A) ] ==> <x,a>\<notin>r" 

293 
by (simp add: wellordered_def, blast dest: wellfounded_on_asym) 

294 

295 

296 
text{*Surely a shorter proof using lemmas in @{text Order}? 

13295  297 
Like @{text well_ord_iso_preserving}?*} 
13223  298 
lemma (in M_axioms) ord_iso_pred_imp_lt: 
299 
"[ f \<in> ord_iso(Order.pred(A,x,r), r, i, Memrel(i)); 

300 
g \<in> ord_iso(Order.pred(A,y,r), r, j, Memrel(j)); 

301 
wellordered(M,A,r); x \<in> A; y \<in> A; M(A); M(r); M(f); M(g); M(j); 

302 
Ord(i); Ord(j); \<langle>x,y\<rangle> \<in> r ] 

303 
==> i < j" 

304 
apply (frule wellordered_is_trans_on, assumption) 

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

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

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

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

309 
wellordered_iso_predD [THEN notE]) 

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

311 
apply (simp add: trans_pred_pred_eq) 

312 
apply (blast intro: Ord_iso_implies_eq ord_iso_sym ord_iso_trans) 

313 
apply (simp_all add: pred_iff pred_closed converse_closed comp_closed) 

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

315 
apply (frule restrict_ord_iso2, assumption+) 

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

317 
apply (frule apply_type, blast intro: ltD) 

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

319 
apply (simp add: pred_iff) 

320 
apply (subgoal_tac 

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

324 
apply (blast dest: wellordered_asym) 

13299  325 
apply (intro rexI) 
326 
apply (blast intro: Ord_iso_implies_eq ord_iso_sym ord_iso_trans)+ 

13223  327 
done 
328 

329 

330 
lemma ord_iso_converse1: 

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

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

333 
apply (frule ord_iso_converse, assumption+) 

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

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

336 
done 

337 

338 

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

340 

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

342 

343 
constdefs 

344 

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

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

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

13293  348 
\<forall>a[M]. 
349 
a \<in> z <> 

13306  350 
(a\<in>A & (\<exists>x[M]. \<exists>g[M]. \<exists>mx[M]. \<exists>par[M]. 
351 
ordinal(M,x) & membership(M,x,mx) & pred_set(M,A,a,r,par) & 

352 
order_isomorphism(M,par,r,x,mx,g)))" 

13223  353 

354 

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

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

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

13293  358 
\<forall>z[M]. 
359 
z \<in> f <> 

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

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

13223  364 

365 

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

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

369 

370 

371 
lemma (in M_axioms) obase_iff: 

372 
"[ M(A); M(r); M(z) ] 

373 
==> obase(M,A,r,z) <> 

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

377 
apply (rule iffI) 

378 
prefer 2 apply blast 

379 
apply (rule equalityI) 

380 
apply (clarify, frule transM, assumption, rotate_tac 1, simp) 

381 
apply (clarify, frule transM, assumption, force) 

382 
done 

383 

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

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

386 
lemma (in M_axioms) omap_iff: 

387 
"[ omap(M,A,r,f); M(A); M(r); M(f) ] 

388 
==> z \<in> f <> 

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

13223  391 
apply (rotate_tac 1) 
392 
apply (simp add: omap_def Memrel_closed pred_closed) 

13293  393 
apply (rule iffI) 
394 
apply (drule_tac [2] x=z in rspec) 

395 
apply (drule_tac x=z in rspec) 

396 
apply (blast dest: transM)+ 

13223  397 
done 
398 

399 
lemma (in M_axioms) omap_unique: 

400 
"[ omap(M,A,r,f); omap(M,A,r,f'); M(A); M(r); M(f); M(f') ] ==> f' = f" 

401 
apply (rule equality_iffI) 

402 
apply (simp add: omap_iff) 

403 
done 

404 

405 
lemma (in M_axioms) omap_yields_Ord: 

406 
"[ omap(M,A,r,f); \<langle>a,x\<rangle> \<in> f; M(a); M(x) ] ==> Ord(x)" 

407 
apply (simp add: omap_def, blast) 

408 
done 

409 

410 
lemma (in M_axioms) otype_iff: 

411 
"[ otype(M,A,r,i); M(A); M(r); M(i) ] 

412 
==> x \<in> i <> 

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

415 
apply (auto simp add: omap_iff otype_def) 

416 
apply (blast intro: transM) 

417 
apply (rule rangeI) 

13223  418 
apply (frule transM, assumption) 
419 
apply (simp add: omap_iff, blast) 

420 
done 

421 

422 
lemma (in M_axioms) otype_eq_range: 

13306  423 
"[ omap(M,A,r,f); otype(M,A,r,i); M(A); M(r); M(f); M(i) ] 
424 
==> i = range(f)" 

13223  425 
apply (auto simp add: otype_def omap_iff) 
426 
apply (blast dest: omap_unique) 

427 
done 

428 

429 

430 
lemma (in M_axioms) Ord_otype: 

431 
"[ otype(M,A,r,i); trans[A](r); M(A); M(r); M(i) ] ==> Ord(i)" 

432 
apply (rotate_tac 1) 

433 
apply (rule OrdI) 

434 
prefer 2 

435 
apply (simp add: Ord_def otype_def omap_def) 

436 
apply clarify 

437 
apply (frule pair_components_in_M, assumption) 

438 
apply blast 

439 
apply (auto simp add: Transset_def otype_iff) 

13306  440 
apply (blast intro: transM) 
441 
apply (blast intro: Ord_in_Ord) 

13223  442 
apply (rename_tac y a g) 
443 
apply (frule ord_iso_sym [THEN ord_iso_is_bij, THEN bij_is_fun, 

444 
THEN apply_funtype], assumption) 

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

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

447 
apply (safe elim!: predE) 

13306  448 
apply (blast intro: restrict_ord_iso ord_iso_sym ltI dest: transM) 
13223  449 
done 
450 

451 
lemma (in M_axioms) domain_omap: 

452 
"[ omap(M,A,r,f); obase(M,A,r,B); M(A); M(r); M(B); M(f) ] 

453 
==> domain(f) = B" 

454 
apply (rotate_tac 2) 

455 
apply (simp add: domain_closed obase_iff) 

456 
apply (rule equality_iffI) 

457 
apply (simp add: domain_iff omap_iff, blast) 

458 
done 

459 

460 
lemma (in M_axioms) omap_subset: 

461 
"[ omap(M,A,r,f); obase(M,A,r,B); otype(M,A,r,i); 

462 
M(A); M(r); M(f); M(B); M(i) ] ==> f \<subseteq> B * i" 

463 
apply (rotate_tac 3, clarify) 

464 
apply (simp add: omap_iff obase_iff) 

465 
apply (force simp add: otype_iff) 

466 
done 

467 

468 
lemma (in M_axioms) omap_funtype: 

469 
"[ omap(M,A,r,f); obase(M,A,r,B); otype(M,A,r,i); 

470 
M(A); M(r); M(f); M(B); M(i) ] ==> f \<in> B > i" 

471 
apply (rotate_tac 3) 

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

473 
apply (blast intro: Ord_iso_implies_eq ord_iso_sym ord_iso_trans) 

474 
done 

475 

476 

477 
lemma (in M_axioms) wellordered_omap_bij: 

478 
"[ wellordered(M,A,r); omap(M,A,r,f); obase(M,A,r,B); otype(M,A,r,i); 

479 
M(A); M(r); M(f); M(B); M(i) ] ==> f \<in> bij(B,i)" 

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

481 
apply (auto simp add: bij_def inj_def) 

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

483 
apply (frule_tac a="w" in apply_Pair, assumption) 

484 
apply (frule_tac a="x" in apply_Pair, assumption) 

485 
apply (simp add: omap_iff) 

486 
apply (blast intro: wellordered_iso_pred_eq ord_iso_sym ord_iso_trans) 

487 
done 

488 

489 

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

491 
lemma (in M_axioms) omap_ord_iso: 

492 
"[ wellordered(M,A,r); omap(M,A,r,f); obase(M,A,r,B); otype(M,A,r,i); 

493 
M(A); M(r); M(f); M(B); M(i) ] ==> f \<in> ord_iso(B,r,i,Memrel(i))" 

494 
apply (rule ord_isoI) 

495 
apply (erule wellordered_omap_bij, assumption+) 

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

497 
apply (frule_tac a="x" in apply_Pair, assumption) 

498 
apply (frule_tac a="y" in apply_Pair, assumption) 

499 
apply (auto simp add: omap_iff) 

500 
txt{*direction 1: assuming @{term "\<langle>x,y\<rangle> \<in> r"}*} 

501 
apply (blast intro: ltD ord_iso_pred_imp_lt) 

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

503 
apply (rename_tac x y g ga) 

504 
apply (frule wellordered_is_linear, assumption, 

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

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

507 
apply (blast elim: mem_irrefl) 

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

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

510 
done 

511 

512 
lemma (in M_axioms) Ord_omap_image_pred: 

513 
"[ wellordered(M,A,r); omap(M,A,r,f); obase(M,A,r,B); otype(M,A,r,i); 

514 
M(A); M(r); M(f); M(B); M(i); b \<in> A ] ==> Ord(f `` Order.pred(A,b,r))" 

515 
apply (frule wellordered_is_trans_on, assumption) 

516 
apply (rule OrdI) 

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

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

519 
apply (rotate_tac 3) 

520 
apply (simp add: Transset_def, clarify) 

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

522 
apply (rename_tac c j, clarify) 

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

524 
apply (subgoal_tac "j : i") 

525 
prefer 2 apply (blast intro: Ord_trans Ord_otype) 

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

527 
prefer 2 

528 
apply (blast dest: wellordered_omap_bij [THEN bij_converse_bij, 

529 
THEN bij_is_fun, THEN apply_funtype]) 

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

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

532 
apply (intro predI conjI) 

533 
apply (erule_tac b=c in trans_onD) 

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

535 
apply (auto simp add: obase_iff) 

536 
done 

537 

538 
lemma (in M_axioms) restrict_omap_ord_iso: 

539 
"[ wellordered(M,A,r); omap(M,A,r,f); obase(M,A,r,B); otype(M,A,r,i); 

540 
D \<subseteq> B; M(A); M(r); M(f); M(B); M(i) ] 

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

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

543 
assumption+) 

544 
apply (drule ord_iso_sym [THEN subset_ord_iso_Memrel]) 

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

546 
apply (drule ord_iso_sym, simp) 

547 
done 

548 

549 
lemma (in M_axioms) obase_equals: 

550 
"[ wellordered(M,A,r); omap(M,A,r,f); obase(M,A,r,B); otype(M,A,r,i); 

551 
M(A); M(r); M(f); M(B); M(i) ] ==> B = A" 

552 
apply (rotate_tac 4) 

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

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

555 
apply (frule wellordered_is_wellfounded_on, assumption) 

556 
apply (erule wellfounded_on_induct, assumption+) 

13306  557 
apply (frule obase_equals_separation [of A r], assumption) 
558 
apply (simp, clarify) 

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

13306  561 
apply (blast intro!: restrict_omap_ord_iso Ord_omap_image_pred) 
562 
apply (force simp add: pred_iff obase_iff) 

13223  563 
done 
564 

565 

566 

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

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

569 
theorem (in M_axioms) omap_ord_iso_otype: 

570 
"[ wellordered(M,A,r); omap(M,A,r,f); obase(M,A,r,B); otype(M,A,r,i); 

571 
M(A); M(r); M(f); M(B); M(i) ] ==> f \<in> ord_iso(A, r, i, Memrel(i))" 

572 
apply (frule omap_ord_iso, assumption+) 

573 
apply (frule obase_equals, assumption+, blast) 

13293  574 
done 
13223  575 

576 
lemma (in M_axioms) obase_exists: 

13293  577 
"[ M(A); M(r) ] ==> \<exists>z[M]. obase(M,A,r,z)" 
13223  578 
apply (simp add: obase_def) 
579 
apply (insert obase_separation [of A r]) 

580 
apply (simp add: separation_def) 

581 
done 

582 

583 
lemma (in M_axioms) omap_exists: 

13293  584 
"[ M(A); M(r) ] ==> \<exists>z[M]. omap(M,A,r,z)" 
13223  585 
apply (insert obase_exists [of A r]) 
586 
apply (simp add: omap_def) 

587 
apply (insert omap_replacement [of A r]) 

588 
apply (simp add: strong_replacement_def, clarify) 

13299  589 
apply (drule_tac x=x in rspec, clarify) 
13223  590 
apply (simp add: Memrel_closed pred_closed obase_iff) 
591 
apply (erule impE) 

592 
apply (clarsimp simp add: univalent_def) 

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

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

13223  596 
done 
597 

13293  598 
declare rall_simps [simp] rex_simps [simp] 
599 

13223  600 
lemma (in M_axioms) otype_exists: 
13299  601 
"[ wellordered(M,A,r); M(A); M(r) ] ==> \<exists>i[M]. otype(M,A,r,i)" 
13293  602 
apply (insert omap_exists [of A r]) 
603 
apply (simp add: otype_def, safe) 

13299  604 
apply (rule_tac x="range(x)" in rexI) 
605 
apply blast+ 

13223  606 
done 
607 

608 
theorem (in M_axioms) omap_ord_iso_otype: 

609 
"[ wellordered(M,A,r); M(A); M(r) ] 

13299  610 
==> \<exists>f[M]. (\<exists>i[M]. Ord(i) & f \<in> ord_iso(A, r, i, Memrel(i)))" 
13223  611 
apply (insert obase_exists [of A r] omap_exists [of A r] otype_exists [of A r], simp, clarify) 
13299  612 
apply (rename_tac i) 
13223  613 
apply (subgoal_tac "Ord(i)", blast intro: omap_ord_iso_otype) 
614 
apply (rule Ord_otype) 

615 
apply (force simp add: otype_def range_closed) 

616 
apply (simp_all add: wellordered_is_trans_on) 

617 
done 

618 

619 
lemma (in M_axioms) ordertype_exists: 

620 
"[ wellordered(M,A,r); M(A); M(r) ] 

13299  621 
==> \<exists>f[M]. (\<exists>i[M]. Ord(i) & f \<in> ord_iso(A, r, i, Memrel(i)))" 
13223  622 
apply (insert obase_exists [of A r] omap_exists [of A r] otype_exists [of A r], simp, clarify) 
13299  623 
apply (rename_tac i) 
13223  624 
apply (subgoal_tac "Ord(i)", blast intro: omap_ord_iso_otype) 
625 
apply (rule Ord_otype) 

626 
apply (force simp add: otype_def range_closed) 

627 
apply (simp_all add: wellordered_is_trans_on) 

628 
done 

629 

630 

631 
lemma (in M_axioms) relativized_imp_well_ord: 

632 
"[ wellordered(M,A,r); M(A); M(r) ] ==> well_ord(A,r)" 

633 
apply (insert ordertype_exists [of A r], simp) 

634 
apply (blast intro: well_ord_ord_iso well_ord_Memrel ) 

635 
done 

636 

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

638 

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

640 
theorem (in M_axioms) well_ord_abs [simp]: 

641 
"[ M(A); M(r) ] ==> wellordered(M,A,r) <> well_ord(A,r)" 

642 
by (blast intro: well_ord_imp_relativized relativized_imp_well_ord) 

643 

644 

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

646 
lemma (in M_axioms) 

647 
"[ wellordered(M,A,r); f \<in> ord_iso(A, r, i, Memrel(i)); 

648 
M(A); M(r); M(f); M(i); Ord(i) ] ==> i = ordertype(A,r)" 

649 
by (blast intro: Ord_ordertype relativized_imp_well_ord ordertype_ord_iso 

650 
Ord_iso_implies_eq ord_iso_sym ord_iso_trans) 

651 

652 
end 