| author | nipkow |
| Thu, 29 Nov 2001 21:12:37 +0100 | |
| changeset 12332 | aea72a834c85 |
| parent 11451 | 8abfb4f7bd02 |
| child 12459 | 6978ab7cac64 |
| permissions | -rw-r--r-- |
| 7085 | 1 |
(* Title: HOL/ex/Tarski |
2 |
ID: $Id$ |
|
3 |
Author: Florian Kammueller, Cambridge University Computer Laboratory |
|
4 |
Copyright 1999 University of Cambridge |
|
5 |
||
6 |
Minimal version of lattice theory plus the full theorem of Tarski: |
|
7 |
The fixedpoints of a complete lattice themselves form a complete lattice. |
|
8 |
||
9 |
Illustrates first-class theories, using the Sigma representation of structures |
|
10 |
*) |
|
11 |
||
12 |
||
13 |
(* abbreviate commonly used tactic application *) |
|
14 |
||
15 |
fun afs thms = (asm_full_simp_tac (simpset() addsimps thms)); |
|
16 |
||
17 |
(* Partial Order *) |
|
18 |
Open_locale "PO"; |
|
19 |
||
20 |
val simp_PO = simplify (simpset() addsimps [PartialOrder_def]) (thm "cl_po"); |
|
21 |
Addsimps [simp_PO, thm "cl_po"]; |
|
22 |
||
23 |
val PO_simp = [thm "A_def", thm "r_def"]; |
|
24 |
||
25 |
Goal "refl A r"; |
|
26 |
by (simp_tac (simpset() addsimps PO_simp) 1); |
|
27 |
qed "PartialOrderE1"; |
|
28 |
||
29 |
Goal "antisym r"; |
|
30 |
by (simp_tac (simpset() addsimps PO_simp) 1); |
|
31 |
qed "PartialOrderE2"; |
|
32 |
||
33 |
Goal "trans r"; |
|
34 |
by (simp_tac (simpset() addsimps PO_simp) 1); |
|
35 |
qed "PartialOrderE3"; |
|
36 |
||
| 11395 | 37 |
Goal "[| refl A r; x \\<in> A|] ==> (x, x) \\<in> r"; |
| 7085 | 38 |
by (afs [refl_def] 1); |
39 |
qed "reflE"; |
|
40 |
(* Interesting: A and r don't get bound because the proof doesn't use |
|
41 |
locale rules |
|
| 11395 | 42 |
val reflE = "[| refl ?A ?r; ?x \\<in> ?A |] ==> (?x, ?x) \\<in> ?r" *) |
| 7085 | 43 |
|
| 11395 | 44 |
Goal "[| antisym r; (a, b) \\<in> r; (b, a) \\<in> r |] ==> a = b"; |
| 7085 | 45 |
by (afs [antisym_def] 1); |
46 |
qed "antisymE"; |
|
47 |
||
| 11395 | 48 |
Goalw [trans_def] "[| trans r; (a, b) \\<in> r; (b, c) \\<in> r|] ==> (a,c) \\<in> r"; |
| 7085 | 49 |
by (Fast_tac 1); |
50 |
qed "transE"; |
|
51 |
||
| 11395 | 52 |
Goal "[| monotone f A r; x \\<in> A; y \\<in> A; (x, y) \\<in> r |] ==> (f x, f y) \\<in> r"; |
| 7085 | 53 |
by (afs [monotone_def] 1); |
54 |
qed "monotoneE"; |
|
55 |
||
| 11395 | 56 |
Goal "S <= A ==> (| pset = S, order = induced S r |) \\<in> PartialOrder"; |
| 7085 | 57 |
by (simp_tac (simpset() addsimps [PartialOrder_def]) 1); |
| 11395 | 58 |
by Auto_tac; |
| 7085 | 59 |
(* refl *) |
60 |
by (afs [refl_def,induced_def] 1); |
|
| 11395 | 61 |
by (blast_tac (claset() addIs [PartialOrderE1 RS reflE]) 1); |
| 7085 | 62 |
(* antisym *) |
63 |
by (afs [antisym_def,induced_def] 1); |
|
| 11395 | 64 |
by (blast_tac (claset() addIs [PartialOrderE2 RS antisymE]) 1); |
| 7085 | 65 |
(* trans *) |
66 |
by (afs [trans_def,induced_def] 1); |
|
| 11395 | 67 |
by (blast_tac (claset() addIs [PartialOrderE3 RS transE]) 1); |
| 7085 | 68 |
qed "po_subset_po"; |
69 |
||
| 11395 | 70 |
Goal "[| (x, y) \\<in> induced S r; S <= A |] ==> (x, y) \\<in> r"; |
| 7085 | 71 |
by (afs [induced_def] 1); |
72 |
qed "indE"; |
|
73 |
||
| 11395 | 74 |
Goal "[| (x, y) \\<in> r; x \\<in> S; y \\<in> S |] ==> (x, y) \\<in> induced S r"; |
| 7085 | 75 |
by (afs [induced_def] 1); |
76 |
qed "indI"; |
|
77 |
||
78 |
(* with locales *) |
|
79 |
Open_locale "CL"; |
|
80 |
||
81 |
Delsimps [simp_PO, thm "cl_po"]; |
|
82 |
||
83 |
val simp_CL = simplify (simpset() addsimps [CompleteLattice_def]) |
|
84 |
(thm "cl_co"); |
|
85 |
Addsimps [simp_CL, thm "cl_co"]; |
|
86 |
||
|
11451
8abfb4f7bd02
partial restructuring to reduce dependence on Axiom of Choice
paulson
parents:
11395
diff
changeset
|
87 |
Goal "(EX L. islub S cl L) = islub S cl (lub S cl)"; |
|
8abfb4f7bd02
partial restructuring to reduce dependence on Axiom of Choice
paulson
parents:
11395
diff
changeset
|
88 |
by (simp_tac (simpset() addsimps [lub_def, least_def, islub_def, |
|
8abfb4f7bd02
partial restructuring to reduce dependence on Axiom of Choice
paulson
parents:
11395
diff
changeset
|
89 |
some_eq_ex RS sym]) 1); |
| 7085 | 90 |
qed "islub_lub"; |
91 |
||
|
11451
8abfb4f7bd02
partial restructuring to reduce dependence on Axiom of Choice
paulson
parents:
11395
diff
changeset
|
92 |
Goal "(EX G. isglb S cl G) = isglb S cl (glb S cl)"; |
|
8abfb4f7bd02
partial restructuring to reduce dependence on Axiom of Choice
paulson
parents:
11395
diff
changeset
|
93 |
by (simp_tac (simpset() addsimps [glb_def, greatest_def, isglb_def, |
|
8abfb4f7bd02
partial restructuring to reduce dependence on Axiom of Choice
paulson
parents:
11395
diff
changeset
|
94 |
some_eq_ex RS sym]) 1); |
| 7085 | 95 |
qed "isglb_glb"; |
96 |
||
97 |
Goal "isglb S cl = islub S (dual cl)"; |
|
98 |
by (afs [islub_def,isglb_def,dual_def,converse_def] 1); |
|
99 |
qed "isglb_dual_islub"; |
|
100 |
||
101 |
Goal "islub S cl = isglb S (dual cl)"; |
|
102 |
by (afs [islub_def,isglb_def,dual_def,converse_def] 1); |
|
103 |
qed "islub_dual_isglb"; |
|
104 |
||
| 11395 | 105 |
Goal "dual cl \\<in> PartialOrder"; |
| 7085 | 106 |
by (simp_tac (simpset() addsimps [PartialOrder_def, dual_def]) 1); |
107 |
by (afs [simp_PO,refl_converse,trans_converse,antisym_converse] 1); |
|
108 |
qed "dualPO"; |
|
109 |
||
| 11395 | 110 |
Goal "\\<forall>S. (S <= A -->( \\<exists>L. islub S (| pset = A, order = r|) L)) \ |
111 |
\ ==> \\<forall>S. (S <= A --> (\\<exists>G. isglb S (| pset = A, order = r|) G))"; |
|
| 7085 | 112 |
by (Step_tac 1); |
113 |
by (res_inst_tac |
|
| 11395 | 114 |
[("x"," lub {y. y \\<in> A & (\\<forall>k \\<in> S. (y, k) \\<in> r)}(|pset = A, order = r|)")]
|
| 7085 | 115 |
exI 1); |
| 11395 | 116 |
by (dres_inst_tac [("x","{y. y \\<in> A & (\\<forall>k \\<in> S. (y,k) \\<in> r)}")] spec 1);
|
| 7085 | 117 |
by (dtac mp 1); |
118 |
by (Fast_tac 1); |
|
119 |
by (afs [islub_lub, isglb_def] 1); |
|
120 |
by (afs [islub_def] 1); |
|
121 |
by (Blast_tac 1); |
|
122 |
qed "Rdual"; |
|
123 |
||
124 |
Goal "lub S cl = glb S (dual cl)"; |
|
125 |
by (afs [lub_def,glb_def,least_def,greatest_def,dual_def,converse_def] 1); |
|
126 |
qed "lub_dual_glb"; |
|
127 |
||
128 |
Goal "glb S cl = lub S (dual cl)"; |
|
129 |
by (afs [lub_def,glb_def,least_def,greatest_def,dual_def,converse_def] 1); |
|
130 |
qed "glb_dual_lub"; |
|
131 |
||
132 |
Goal "CompleteLattice <= PartialOrder"; |
|
133 |
by (simp_tac (simpset() addsimps [PartialOrder_def, CompleteLattice_def]) 1); |
|
134 |
by (Fast_tac 1); |
|
135 |
qed "CL_subset_PO"; |
|
136 |
||
137 |
val CompleteLatticeE1 = CL_subset_PO RS subsetD; |
|
138 |
||
| 11395 | 139 |
Goal "\\<forall>S. S <= A --> (\\<exists>L. islub S cl L)"; |
| 7085 | 140 |
by (simp_tac (simpset() addsimps PO_simp) 1); |
141 |
qed "CompleteLatticeE2"; |
|
142 |
||
| 11395 | 143 |
Goal "\\<forall>S. S <= A --> (\\<exists>G. isglb S cl G)"; |
| 7085 | 144 |
by (simp_tac (simpset() addsimps PO_simp) 1); |
145 |
qed "CompleteLatticeE3"; |
|
146 |
||
147 |
Addsimps [CompleteLatticeE1 RS (export simp_PO)]; |
|
148 |
||
149 |
Goal "refl A r"; |
|
150 |
by (simp_tac (simpset() addsimps PO_simp) 1); |
|
151 |
qed "CompleteLatticeE11"; |
|
152 |
||
153 |
Goal "antisym r"; |
|
154 |
by (simp_tac (simpset() addsimps PO_simp) 1); |
|
155 |
qed "CompleteLatticeE12"; |
|
156 |
||
157 |
Goal "trans r"; |
|
158 |
by (afs (PO_simp) 1); |
|
159 |
qed "CompleteLatticeE13"; |
|
160 |
||
| 11395 | 161 |
Goal "[| po \\<in> PartialOrder; (\\<forall>S. S <= po.<A> --> (\\<exists>L. islub S po L));\ |
162 |
\ (\\<forall>S. S <= po.<A> --> (\\<exists>G. isglb S po G))|] ==> po \\<in> CompleteLattice"; |
|
| 7085 | 163 |
by (afs [CompleteLattice_def] 1); |
164 |
qed "CompleteLatticeI"; |
|
165 |
||
| 11395 | 166 |
Goal "dual cl \\<in> CompleteLattice"; |
| 7085 | 167 |
by (simp_tac (simpset() addsimps [CompleteLattice_def,dual_def]) 1); |
168 |
by (fold_goals_tac [dual_def]); |
|
169 |
by (simp_tac (simpset() addsimps [islub_dual_isglb RS sym, |
|
170 |
isglb_dual_islub RS sym, |
|
171 |
export dualPO]) 1); |
|
172 |
qed "CL_dualCL"; |
|
173 |
||
174 |
Goal "(dual cl.<A>) = cl.<A>"; |
|
175 |
by (simp_tac (simpset() addsimps [dual_def]) 1); |
|
176 |
qed "dualA_iff"; |
|
177 |
||
| 11395 | 178 |
Goal "((x, y) \\<in> (dual cl.<r>)) = ((y, x) \\<in> cl.<r>)"; |
| 7085 | 179 |
by (simp_tac (simpset() addsimps [dual_def]) 1); |
180 |
qed "dualr_iff"; |
|
181 |
||
182 |
Goal "monotone f (cl.<A>) (cl.<r>) ==> monotone f (dual cl.<A>) (dual cl.<r>)"; |
|
183 |
by (afs [monotone_def,dualA_iff,dualr_iff] 1); |
|
184 |
qed "monotone_dual"; |
|
185 |
||
| 11395 | 186 |
Goal "[| x \\<in> A; y \\<in> A|] ==> interval r x y = interval (dual cl.<r>) y x"; |
| 7085 | 187 |
by (simp_tac (simpset() addsimps [interval_def,dualr_iff]) 1); |
188 |
by (fold_goals_tac [thm "r_def"]); |
|
189 |
by (Fast_tac 1); |
|
190 |
qed "interval_dual"; |
|
191 |
||
| 11395 | 192 |
Goal "[| trans r; interval r a b \\<noteq> {} |] ==> (a, b) \\<in> r";
|
| 7085 | 193 |
by (afs [interval_def] 1); |
194 |
by (rewtac trans_def); |
|
195 |
by (Blast_tac 1); |
|
196 |
qed "interval_not_empty"; |
|
197 |
||
| 11395 | 198 |
Goal "x \\<in> interval r a b ==> (a, x) \\<in> r"; |
| 7085 | 199 |
by (afs [interval_def] 1); |
200 |
qed "intervalE1"; |
|
201 |
||
| 11395 | 202 |
Goal "[| a \\<in> A; b \\<in> A; interval r a b \\<noteq> {} |] ==> a \\<in> interval r a b";
|
| 7085 | 203 |
by (simp_tac (simpset() addsimps [interval_def]) 1); |
204 |
by (afs [PartialOrderE3,interval_not_empty] 1); |
|
205 |
by (afs [PartialOrderE1 RS reflE] 1); |
|
206 |
qed "left_in_interval"; |
|
207 |
||
| 11395 | 208 |
Goal "[| a \\<in> A; b \\<in> A; interval r a b \\<noteq> {} |] ==> b \\<in> interval r a b";
|
| 7085 | 209 |
by (simp_tac (simpset() addsimps [interval_def]) 1); |
210 |
by (afs [PartialOrderE3,interval_not_empty] 1); |
|
211 |
by (afs [PartialOrderE1 RS reflE] 1); |
|
212 |
qed "right_in_interval"; |
|
213 |
||
| 11395 | 214 |
Goal "[| (| pset = A, order = r |) \\<in> PartialOrder;\ |
215 |
\ \\<forall>S. S <= A --> (\\<exists>L. islub S (| pset = A, order = r |) L) |] \ |
|
216 |
\ ==> (| pset = A, order = r |) \\<in> CompleteLattice"; |
|
| 7085 | 217 |
by (afs [CompleteLatticeI, Rdual] 1); |
218 |
qed "CompleteLatticeI_simp"; |
|
219 |
||
220 |
(* sublattice *) |
|
221 |
Goal "S <<= cl ==> S <= A"; |
|
222 |
by (afs [sublattice_def, CompleteLattice_def, thm "A_def"] 1); |
|
223 |
qed "sublatticeE1"; |
|
224 |
||
| 11395 | 225 |
Goal "S <<= cl ==> (| pset = S, order = induced S r |) \\<in> CompleteLattice"; |
| 7085 | 226 |
by (afs ([sublattice_def, CompleteLattice_def] @ PO_simp) 1); |
227 |
qed "sublatticeE2"; |
|
228 |
||
| 11395 | 229 |
Goal "[| S <= A; (| pset = S, order = induced S r |) \\<in> CompleteLattice |] ==> S <<= cl"; |
| 7085 | 230 |
by (afs ([sublattice_def] @ PO_simp) 1); |
231 |
qed "sublatticeI"; |
|
232 |
||
233 |
(* lub *) |
|
234 |
Goal "[| S <= A; islub S cl x; islub S cl L|] ==> x = L"; |
|
235 |
by (rtac antisymE 1); |
|
236 |
by (rtac CompleteLatticeE12 1); |
|
| 11395 | 237 |
by (auto_tac (claset(), simpset() addsimps [islub_def, thm "r_def"])); |
| 7085 | 238 |
qed "lub_unique"; |
239 |
||
| 11395 | 240 |
Goal "[| S <= A |] ==> \\<forall>x \\<in> S. (x,lub S cl) \\<in> r"; |
| 7085 | 241 |
by (rtac exE 1); |
242 |
by (rtac (CompleteLatticeE2 RS spec RS mp) 1); |
|
243 |
by (assume_tac 1); |
|
244 |
by (rewrite_goals_tac [lub_def,least_def]); |
|
| 9969 | 245 |
by (stac some_equality 1); |
| 7085 | 246 |
by (rtac conjI 1); |
247 |
by (afs [islub_def] 2); |
|
248 |
by (etac conjunct2 2); |
|
249 |
by (afs [islub_def] 1); |
|
250 |
by (rtac lub_unique 1); |
|
251 |
by (afs [thm "A_def"] 1); |
|
252 |
by (afs [islub_def] 1); |
|
253 |
by (assume_tac 1); |
|
254 |
by (afs [islub_def,thm "r_def"] 1); |
|
255 |
qed "lubE1"; |
|
256 |
||
| 11395 | 257 |
Goal "[| S <= A; L \\<in> A; \\<forall>x \\<in> S. (x,L) \\<in> r |] ==> (lub S cl, L) \\<in> r"; |
| 7085 | 258 |
by (rtac exE 1); |
259 |
by (rtac (CompleteLatticeE2 RS spec RS mp) 1); |
|
260 |
by (assume_tac 1); |
|
261 |
by (rewrite_goals_tac [lub_def,least_def]); |
|
| 9969 | 262 |
by (stac some_equality 1); |
| 7085 | 263 |
by (rtac conjI 1); |
264 |
by (afs [islub_def] 2); |
|
265 |
by (etac conjunct2 2); |
|
266 |
by (afs [islub_def] 1); |
|
267 |
by (rtac lub_unique 1); |
|
268 |
by (afs [thm "A_def"] 1); |
|
269 |
by (afs [islub_def] 1); |
|
270 |
by (assume_tac 1); |
|
271 |
by (afs [islub_def] 1); |
|
272 |
by (dtac conjunct2 1); |
|
273 |
by (dtac conjunct2 1); |
|
274 |
by (rotate_tac 3 1); |
|
275 |
by (dtac bspec 1); |
|
276 |
by (fold_goals_tac [thm "r_def"]); |
|
277 |
by (etac mp 2); |
|
278 |
by (afs [thm "A_def"] 1); |
|
279 |
by (assume_tac 1); |
|
280 |
qed "lubE2"; |
|
281 |
||
| 11395 | 282 |
Goal "[| S <= A |] ==> lub S cl \\<in> A"; |
| 7085 | 283 |
by (rtac exE 1); |
284 |
by (rtac (CompleteLatticeE2 RS spec RS mp) 1); |
|
285 |
by (assume_tac 1); |
|
286 |
by (rewrite_goals_tac [lub_def,least_def]); |
|
| 9969 | 287 |
by (stac some_equality 1); |
| 7085 | 288 |
by (afs [islub_def] 1); |
289 |
by (afs [islub_def, thm "A_def"] 2); |
|
290 |
by (rtac lub_unique 1); |
|
291 |
by (afs [thm "A_def"] 1); |
|
292 |
by (afs [islub_def] 1); |
|
293 |
by (assume_tac 1); |
|
294 |
qed "lub_in_lattice"; |
|
295 |
||
| 11395 | 296 |
Goal "[| S <= A; L \\<in> A; \\<forall>x \\<in> S. (x,L) \\<in> r;\ |
297 |
\ \\<forall>z \\<in> A. (\\<forall>y \\<in> S. (y,z) \\<in> r) --> (L,z) \\<in> r |] ==> L = lub S cl"; |
|
| 7085 | 298 |
by (rtac lub_unique 1); |
299 |
by (assume_tac 1); |
|
300 |
by (afs ([islub_def] @ PO_simp) 1); |
|
301 |
by (rewtac islub_def); |
|
302 |
by (rtac conjI 1); |
|
303 |
by (fold_goals_tac PO_simp); |
|
304 |
by (rtac lub_in_lattice 1); |
|
305 |
by (assume_tac 1); |
|
306 |
by (afs [lubE1, lubE2] 1); |
|
307 |
qed "lubI"; |
|
308 |
||
309 |
Goal "[| S <= A; islub S cl L |] ==> L = lub S cl"; |
|
310 |
by (afs ([lubI, islub_def] @ PO_simp) 1); |
|
311 |
qed "lubIa"; |
|
312 |
||
| 11395 | 313 |
Goal "islub S cl L ==> L \\<in> A"; |
| 7085 | 314 |
by (afs [islub_def, thm "A_def"] 1); |
315 |
qed "islub_in_lattice"; |
|
316 |
||
| 11395 | 317 |
Goal "islub S cl L ==> \\<forall>y \\<in> S. (y, L) \\<in> r"; |
| 7085 | 318 |
by (afs [islub_def, thm "r_def"] 1); |
319 |
qed "islubE1"; |
|
320 |
||
321 |
Goal "[| islub S cl L; \ |
|
| 11395 | 322 |
\ z \\<in> A; \\<forall>y \\<in> S. (y, z) \\<in> r|] ==> (L, z) \\<in> r"; |
| 7085 | 323 |
by (afs ([islub_def] @ PO_simp) 1); |
324 |
qed "islubE2"; |
|
325 |
||
| 11395 | 326 |
Goal "[| S <= A |] ==> \\<exists>L. islub S cl L"; |
| 7085 | 327 |
by (afs [thm "A_def"] 1); |
328 |
qed "islubE"; |
|
329 |
||
| 11395 | 330 |
Goal "[| L \\<in> A; \\<forall>y \\<in> S. (y, L) \\<in> r; \ |
331 |
\ (\\<forall>z \\<in> A. (\\<forall>y \\<in> S. (y, z):r) --> (L, z) \\<in> r)|] ==> islub S cl L"; |
|
| 7085 | 332 |
by (afs ([islub_def] @ PO_simp) 1); |
333 |
qed "islubI"; |
|
334 |
||
335 |
(* glb *) |
|
| 11395 | 336 |
Goal "S <= A ==> glb S cl \\<in> A"; |
| 7085 | 337 |
by (stac glb_dual_lub 1); |
338 |
by (afs [thm "A_def"] 1); |
|
339 |
by (rtac (dualA_iff RS subst) 1); |
|
340 |
by (rtac (export lub_in_lattice) 1); |
|
341 |
by (rtac CL_dualCL 1); |
|
342 |
by (afs [dualA_iff] 1); |
|
343 |
qed "glb_in_lattice"; |
|
344 |
||
| 11395 | 345 |
Goal "S <= A ==> \\<forall>x \\<in> S. (glb S cl, x) \\<in> r"; |
| 7085 | 346 |
by (stac glb_dual_lub 1); |
347 |
by (rtac ballI 1); |
|
348 |
by (afs [thm "r_def"] 1); |
|
349 |
by (rtac (dualr_iff RS subst) 1); |
|
350 |
by (rtac (export lubE1 RS bspec) 1); |
|
351 |
by (rtac CL_dualCL 1); |
|
352 |
by (afs [dualA_iff, thm "A_def"] 1); |
|
353 |
by (assume_tac 1); |
|
354 |
qed "glbE1"; |
|
355 |
||
| 11395 | 356 |
(* Reduce the sublattice property by using substructural properties\\<forall>*) |
| 7085 | 357 |
(* abandoned see Tarski_4.ML *) |
358 |
||
359 |
Open_locale "CLF"; |
|
360 |
||
361 |
val simp_CLF = simplify (simpset() addsimps [CLF_def]) (thm "f_cl"); |
|
362 |
Addsimps [simp_CLF, thm "f_cl"]; |
|
363 |
||
| 11395 | 364 |
Goal "f \\<in> A funcset A"; |
| 7085 | 365 |
by (simp_tac (simpset() addsimps [thm "A_def"]) 1); |
366 |
qed "CLF_E1"; |
|
367 |
||
368 |
Goal "monotone f A r"; |
|
369 |
by (simp_tac (simpset() addsimps PO_simp) 1); |
|
370 |
qed "CLF_E2"; |
|
371 |
||
| 11395 | 372 |
Goal "f \\<in> CLF `` {cl} ==> f \\<in> CLF `` {dual cl}";
|
| 7085 | 373 |
by (afs [CLF_def, CL_dualCL, monotone_dual] 1); |
374 |
by (afs [dualA_iff] 1); |
|
375 |
qed "CLF_dual"; |
|
376 |
||
377 |
(* fixed points *) |
|
378 |
Goal "P <= A"; |
|
379 |
by (simp_tac (simpset() addsimps [thm "P_def", fix_def]) 1); |
|
380 |
by (Fast_tac 1); |
|
381 |
qed "fixfE1"; |
|
382 |
||
| 11395 | 383 |
Goal "x \\<in> P ==> f x = x"; |
| 7085 | 384 |
by (afs [thm "P_def", fix_def] 1); |
385 |
qed "fixfE2"; |
|
386 |
||
| 11395 | 387 |
Goal "[| A <= B; x \\<in> fix (lam y: A. f y) A |] ==> x \\<in> fix f B"; |
| 7085 | 388 |
by (forward_tac [export fixfE2] 1); |
389 |
by (dtac ((export fixfE1) RS subsetD) 1); |
|
| 11395 | 390 |
by (asm_full_simp_tac (simpset() addsimps [fix_def, subsetD]) 1); |
| 7085 | 391 |
qed "fixf_subset"; |
392 |
||
393 |
(* lemmas for Tarski, lub *) |
|
| 11395 | 394 |
Goal "H = {x. (x, f x) \\<in> r & x \\<in> A} ==> (lub H cl, f (lub H cl)) \\<in> r";
|
| 7085 | 395 |
by (rtac lubE2 1); |
396 |
by (Fast_tac 1); |
|
397 |
by (rtac (CLF_E1 RS funcset_mem) 1); |
|
398 |
by (rtac lub_in_lattice 1); |
|
399 |
by (Fast_tac 1); |
|
| 11395 | 400 |
(* \\<forall>x:H. (x, f (lub H r)) \\<in> r *) |
| 7085 | 401 |
by (rtac ballI 1); |
402 |
by (rtac transE 1); |
|
403 |
by (rtac CompleteLatticeE13 1); |
|
| 11395 | 404 |
(* instantiates (x, ???z) \\<in> cl.<r> to (x, f x), because of the def of H *) |
| 7085 | 405 |
by (Fast_tac 1); |
| 11395 | 406 |
(* so it remains to show (f x, f (lub H cl)) \\<in> r *) |
| 7085 | 407 |
by (res_inst_tac [("f","f")] monotoneE 1);
|
408 |
by (rtac CLF_E2 1); |
|
409 |
by (Fast_tac 1); |
|
410 |
by (rtac lub_in_lattice 1); |
|
411 |
by (Fast_tac 1); |
|
412 |
by (rtac (lubE1 RS bspec) 1); |
|
413 |
by (Fast_tac 1); |
|
414 |
by (assume_tac 1); |
|
415 |
qed "lubH_le_flubH"; |
|
416 |
||
| 11395 | 417 |
Goal "[| H = {x. (x, f x) \\<in> r & x \\<in> A} |] ==> (f (lub H cl), lub H cl) \\<in> r";
|
| 7085 | 418 |
by (rtac (lubE1 RS bspec) 1); |
419 |
by (Fast_tac 1); |
|
420 |
by (res_inst_tac [("t","H")] ssubst 1);
|
|
421 |
by (assume_tac 1); |
|
422 |
by (rtac CollectI 1); |
|
423 |
by (rtac conjI 1); |
|
424 |
by (rtac (CLF_E1 RS funcset_mem) 2); |
|
425 |
by (rtac lub_in_lattice 2); |
|
426 |
by (Fast_tac 2); |
|
427 |
by (res_inst_tac [("f","f")] monotoneE 1);
|
|
428 |
by (rtac CLF_E2 1); |
|
429 |
by (afs [lubH_le_flubH] 3); |
|
430 |
by (rtac (CLF_E1 RS funcset_mem) 2); |
|
431 |
by (rtac lub_in_lattice 2); |
|
432 |
by (Fast_tac 2); |
|
433 |
by (rtac lub_in_lattice 1); |
|
434 |
by (Fast_tac 1); |
|
435 |
qed "flubH_le_lubH"; |
|
436 |
||
| 11395 | 437 |
Goal "H = {x. (x, f x) \\<in> r & x \\<in> A} ==> lub H cl \\<in> P";
|
| 7085 | 438 |
by (simp_tac (simpset() addsimps [thm "P_def", fix_def]) 1); |
439 |
by (rtac conjI 1); |
|
440 |
by (rtac lub_in_lattice 1); |
|
441 |
by (Fast_tac 1); |
|
442 |
by (rtac antisymE 1); |
|
443 |
by (rtac CompleteLatticeE12 1); |
|
444 |
by (afs [flubH_le_lubH] 1); |
|
445 |
by (afs [lubH_le_flubH] 1); |
|
446 |
qed "lubH_is_fixp"; |
|
447 |
||
| 11395 | 448 |
Goal "[| H = {x. (x, f x) \\<in> r & x \\<in> A}; x \\<in> P |] ==> x \\<in> H";
|
| 7085 | 449 |
by (etac ssubst 1); |
450 |
by (Simp_tac 1); |
|
451 |
by (rtac conjI 1); |
|
| 7499 | 452 |
by (ftac fixfE2 1); |
| 7085 | 453 |
by (etac ssubst 1); |
454 |
by (rtac reflE 1); |
|
455 |
by (rtac CompleteLatticeE11 1); |
|
456 |
by (etac (fixfE1 RS subsetD) 1); |
|
457 |
by (etac (fixfE1 RS subsetD) 1); |
|
458 |
qed "fix_in_H"; |
|
459 |
||
| 11395 | 460 |
Goal "H = {x. (x, f x) \\<in> r & x \\<in> A} ==> \\<forall>x \\<in> P. (x, lub H cl) \\<in> r";
|
| 7085 | 461 |
by (rtac ballI 1); |
462 |
by (rtac (lubE1 RS bspec) 1); |
|
463 |
by (Fast_tac 1); |
|
464 |
by (rtac fix_in_H 1); |
|
465 |
by (REPEAT (atac 1)); |
|
466 |
qed "fixf_le_lubH"; |
|
467 |
||
| 11395 | 468 |
Goal "H = {x. (x, f x) \\<in> r & x \\<in> A} ==> \\<forall>L. (\\<forall>y \\<in> P. (y,L) \\<in> r) --> (lub H cl, L) \\<in> r";
|
| 7085 | 469 |
by (rtac allI 1); |
470 |
by (rtac impI 1); |
|
471 |
by (etac bspec 1); |
|
472 |
by (rtac lubH_is_fixp 1); |
|
473 |
by (assume_tac 1); |
|
474 |
qed "lubH_least_fixf"; |
|
475 |
||
476 |
(* Tarski fixpoint theorem 1, first part *) |
|
| 11395 | 477 |
Goal "lub P cl = lub {x. (x, f x) \\<in> r & x \\<in> A} cl";
|
| 7085 | 478 |
by (rtac sym 1); |
479 |
by (rtac lubI 1); |
|
480 |
by (rtac fixfE1 1); |
|
481 |
by (rtac lub_in_lattice 1); |
|
482 |
by (Fast_tac 1); |
|
483 |
by (afs [fixf_le_lubH] 1); |
|
484 |
by (afs [lubH_least_fixf] 1); |
|
485 |
qed "T_thm_1_lub"; |
|
486 |
||
487 |
(* Tarski for glb *) |
|
| 11395 | 488 |
Goal "H = {x. (f x, x) \\<in> r & x \\<in> A} ==> glb H cl \\<in> P";
|
| 7085 | 489 |
by (full_simp_tac |
490 |
(simpset() addsimps [glb_dual_lub, thm "P_def"] @ PO_simp) 1); |
|
491 |
by (rtac (dualA_iff RS subst) 1); |
|
492 |
by (rtac (CL_dualCL RS (export lubH_is_fixp)) 1); |
|
493 |
by (rtac (thm "f_cl" RS CLF_dual) 1); |
|
494 |
by (afs [dualr_iff, dualA_iff] 1); |
|
495 |
qed "glbH_is_fixp"; |
|
496 |
||
| 11395 | 497 |
Goal "glb P cl = glb {x. (f x, x) \\<in> r & x \\<in> A} cl";
|
| 7085 | 498 |
by (simp_tac (simpset() addsimps [glb_dual_lub, thm "P_def"] @ PO_simp) 1); |
499 |
by (rtac (dualA_iff RS subst) 1); |
|
500 |
by (rtac (CL_dualCL RS (export T_thm_1_lub) RS ssubst) 1); |
|
501 |
by (rtac (thm "f_cl" RS CLF_dual) 1); |
|
502 |
by (afs [dualr_iff] 1); |
|
503 |
qed "T_thm_1_glb"; |
|
504 |
||
505 |
(* interval *) |
|
| 8703 | 506 |
Goal "refl A r ==> r <= A <*> A"; |
| 7085 | 507 |
by (afs [refl_def] 1); |
508 |
qed "reflE1"; |
|
509 |
||
| 11395 | 510 |
Goal "(x, y) \\<in> r ==> x \\<in> A"; |
| 7085 | 511 |
by (rtac SigmaD1 1); |
512 |
by (rtac (reflE1 RS subsetD) 1); |
|
513 |
by (rtac CompleteLatticeE11 1); |
|
514 |
by (assume_tac 1); |
|
515 |
qed "rel_imp_elem"; |
|
516 |
||
| 11395 | 517 |
Goal "[| a \\<in> A; b \\<in> A |] ==> interval r a b <= A"; |
| 7085 | 518 |
by (simp_tac (simpset() addsimps [interval_def]) 1); |
| 11395 | 519 |
by (blast_tac (claset() addIs [rel_imp_elem]) 1); |
| 7085 | 520 |
qed "interval_subset"; |
521 |
||
| 11395 | 522 |
Goal "[| (a, x) \\<in> r; (x, b) \\<in> r |] ==> x \\<in> interval r a b"; |
| 7085 | 523 |
by (afs [interval_def] 1); |
524 |
qed "intervalI"; |
|
525 |
||
| 11395 | 526 |
Goalw [interval_def] "[| S <= interval r a b; x \\<in> S |] ==> (a, x) \\<in> r"; |
| 7085 | 527 |
by (Fast_tac 1); |
528 |
qed "interval_lemma1"; |
|
529 |
||
| 11395 | 530 |
Goalw [interval_def] "[| S <= interval r a b; x \\<in> S |] ==> (x, b) \\<in> r"; |
| 7085 | 531 |
by (Fast_tac 1); |
532 |
qed "interval_lemma2"; |
|
533 |
||
| 11395 | 534 |
Goal "[| S <= A; S \\<noteq> {};\
|
535 |
\ \\<forall>x \\<in> S. (a,x) \\<in> r; \\<forall>y \\<in> S. (y, L) \\<in> r |] ==> (a,L) \\<in> r"; |
|
| 7085 | 536 |
by (blast_tac (claset() addIs [transE, PartialOrderE3]) 1); |
537 |
qed "a_less_lub"; |
|
538 |
||
| 11395 | 539 |
Goal "[| S <= A; S \\<noteq> {};\
|
540 |
\ \\<forall>x \\<in> S. (x,b) \\<in> r; \\<forall>y \\<in> S. (G, y) \\<in> r |] ==> (G,b) \\<in> r"; |
|
| 7085 | 541 |
by (blast_tac (claset() addIs [transE, PartialOrderE3]) 1); |
542 |
qed "glb_less_b"; |
|
543 |
||
| 11395 | 544 |
Goal "[| a \\<in> A; b \\<in> A; S <= interval r a b |]==> S <= A"; |
| 7085 | 545 |
by (afs [interval_subset RSN(2, subset_trans)] 1); |
546 |
qed "S_intv_cl"; |
|
547 |
||
| 11395 | 548 |
Goal "[| a \\<in> A; b \\<in> A; S <= interval r a b; \ |
549 |
\ S \\<noteq> {}; islub S cl L; interval r a b \\<noteq> {} |] ==> L \\<in> interval r a b";
|
|
| 7085 | 550 |
by (rtac intervalI 1); |
551 |
by (rtac a_less_lub 1); |
|
552 |
by (assume_tac 2); |
|
553 |
by (afs [S_intv_cl] 1); |
|
554 |
by (rtac ballI 1); |
|
555 |
by (afs [interval_lemma1] 1); |
|
556 |
by (afs [islubE1] 1); |
|
| 11395 | 557 |
(* (L, b) \\<in> r *) |
| 7085 | 558 |
by (rtac islubE2 1); |
559 |
by (assume_tac 1); |
|
560 |
by (assume_tac 1); |
|
561 |
by (rtac ballI 1); |
|
562 |
by (afs [interval_lemma2] 1); |
|
563 |
qed "L_in_interval"; |
|
564 |
||
| 11395 | 565 |
Goal "[| a \\<in> A; b \\<in> A; interval r a b \\<noteq> {}; S <= interval r a b; isglb S cl G; \
|
566 |
\ S \\<noteq> {} |] ==> G \\<in> interval r a b";
|
|
| 7085 | 567 |
by (afs [interval_dual] 1); |
568 |
by (rtac (export L_in_interval) 1); |
|
569 |
by (rtac dualPO 1); |
|
570 |
by (afs [dualA_iff, thm "A_def"] 1); |
|
571 |
by (afs [dualA_iff, thm "A_def"] 1); |
|
572 |
by (assume_tac 1); |
|
573 |
by (afs [isglb_dual_islub] 1); |
|
574 |
by (afs [isglb_dual_islub] 1); |
|
575 |
by (assume_tac 1); |
|
576 |
qed "G_in_interval"; |
|
577 |
||
| 11395 | 578 |
Goal "[| a \\<in> A; b \\<in> A; interval r a b \\<noteq> {} |]\
|
579 |
\ ==> (| pset = interval r a b, order = induced (interval r a b) r |) \\<in> PartialOrder"; |
|
| 7085 | 580 |
by (rtac po_subset_po 1); |
581 |
by (afs [interval_subset] 1); |
|
582 |
qed "intervalPO"; |
|
583 |
||
| 11395 | 584 |
Goal "[| a \\<in> A; b \\<in> A;\ |
585 |
\ interval r a b \\<noteq> {} |] ==> \\<forall>S. S <= interval r a b -->\
|
|
586 |
\ (\\<exists>L. islub S (| pset = interval r a b, order = induced (interval r a b) r |) L)"; |
|
| 7085 | 587 |
by (strip_tac 1); |
588 |
by (forward_tac [S_intv_cl RS islubE] 1); |
|
589 |
by (assume_tac 2); |
|
590 |
by (assume_tac 1); |
|
591 |
by (etac exE 1); |
|
| 11395 | 592 |
(* define the lub for the interval as *) |
| 7085 | 593 |
by (res_inst_tac [("x","if S = {} then a else L")] exI 1);
|
594 |
by (rtac (export islubI) 1); |
|
| 11395 | 595 |
(* (if S = {} then a else L) \\<in> interval r a b *)
|
| 7085 | 596 |
by (asm_full_simp_tac |
597 |
(simpset() addsimps [CompleteLatticeE1,L_in_interval]) 1); |
|
598 |
by (afs [left_in_interval] 1); |
|
599 |
(* lub prop 1 *) |
|
600 |
by (case_tac "S = {}" 1);
|
|
| 11395 | 601 |
(* S = {}, y \\<in> S = False => everything *)
|
| 7085 | 602 |
by (Fast_tac 1); |
| 11395 | 603 |
(* S \\<noteq> {} *)
|
| 7085 | 604 |
by (Asm_full_simp_tac 1); |
| 11395 | 605 |
(* \\<forall>y:S. (y, L) \\<in> induced (interval r a b) r *) |
| 7085 | 606 |
by (rtac ballI 1); |
607 |
by (afs [induced_def, L_in_interval] 1); |
|
608 |
by (rtac conjI 1); |
|
609 |
by (rtac subsetD 1); |
|
610 |
by (afs [S_intv_cl] 1); |
|
611 |
by (assume_tac 1); |
|
612 |
by (afs [islubE1] 1); |
|
| 11395 | 613 |
(* \\<forall>z:interval r a b. (\\<forall>y:S. (y, z) \\<in> induced (interval r a b) r --> |
614 |
(if S = {} then a else L, z) \\<in> induced (interval r a b) r *)
|
|
| 7085 | 615 |
by (rtac ballI 1); |
616 |
by (rtac impI 1); |
|
617 |
by (case_tac "S = {}" 1);
|
|
618 |
(* S = {} *)
|
|
619 |
by (Asm_full_simp_tac 1); |
|
620 |
by (afs [induced_def, interval_def] 1); |
|
621 |
by (rtac conjI 1); |
|
622 |
by (rtac reflE 1); |
|
623 |
by (rtac CompleteLatticeE11 1); |
|
624 |
by (assume_tac 1); |
|
625 |
by (rtac interval_not_empty 1); |
|
626 |
by (rtac CompleteLatticeE13 1); |
|
627 |
by (afs [interval_def] 1); |
|
| 11395 | 628 |
(* S \\<noteq> {} *)
|
| 7085 | 629 |
by (Asm_full_simp_tac 1); |
630 |
by (afs [induced_def, L_in_interval] 1); |
|
631 |
by (rtac islubE2 1); |
|
632 |
by (assume_tac 1); |
|
633 |
by (rtac subsetD 1); |
|
634 |
by (assume_tac 2); |
|
635 |
by (afs [S_intv_cl] 1); |
|
636 |
by (Fast_tac 1); |
|
637 |
qed "intv_CL_lub"; |
|
638 |
||
639 |
val intv_CL_glb = intv_CL_lub RS Rdual; |
|
640 |
||
| 11395 | 641 |
Goal "[| a \\<in> A; b \\<in> A; interval r a b \\<noteq> {} |]\
|
| 7085 | 642 |
\ ==> interval r a b <<= cl"; |
643 |
by (rtac sublatticeI 1); |
|
644 |
by (afs [interval_subset] 1); |
|
645 |
by (rtac CompleteLatticeI 1); |
|
646 |
by (afs [intervalPO] 1); |
|
647 |
by (afs [intv_CL_lub] 1); |
|
648 |
by (afs [intv_CL_glb] 1); |
|
649 |
qed "interval_is_sublattice"; |
|
650 |
||
651 |
val interv_is_compl_latt = interval_is_sublattice RS sublatticeE2; |
|
652 |
||
653 |
(* Top and Bottom *) |
|
654 |
Goal "Top cl = Bot (dual cl)"; |
|
655 |
by (afs [Top_def,Bot_def,least_def,greatest_def,dualA_iff, dualr_iff] 1); |
|
656 |
qed "Top_dual_Bot"; |
|
657 |
||
658 |
Goal "Bot cl = Top (dual cl)"; |
|
659 |
by (afs [Top_def,Bot_def,least_def,greatest_def,dualA_iff, dualr_iff] 1); |
|
660 |
qed "Bot_dual_Top"; |
|
661 |
||
| 11395 | 662 |
Goal "Bot cl \\<in> A"; |
| 7085 | 663 |
by (simp_tac (simpset() addsimps [Bot_def,least_def]) 1); |
| 9969 | 664 |
by (rtac someI2 1); |
| 7085 | 665 |
by (fold_goals_tac [thm "A_def"]); |
666 |
by (etac conjunct1 2); |
|
667 |
by (rtac conjI 1); |
|
668 |
by (rtac glb_in_lattice 1); |
|
669 |
by (rtac subset_refl 1); |
|
670 |
by (fold_goals_tac [thm "r_def"]); |
|
671 |
by (afs [glbE1] 1); |
|
672 |
qed "Bot_in_lattice"; |
|
673 |
||
| 11395 | 674 |
Goal "Top cl \\<in> A"; |
| 7085 | 675 |
by (simp_tac (simpset() addsimps [Top_dual_Bot, thm "A_def"]) 1); |
676 |
by (rtac (dualA_iff RS subst) 1); |
|
677 |
by (afs [export Bot_in_lattice,CL_dualCL] 1); |
|
678 |
qed "Top_in_lattice"; |
|
679 |
||
| 11395 | 680 |
Goal "x \\<in> A ==> (x, Top cl) \\<in> r"; |
| 7085 | 681 |
by (simp_tac (simpset() addsimps [Top_def,greatest_def]) 1); |
| 9969 | 682 |
by (rtac someI2 1); |
| 7085 | 683 |
by (fold_goals_tac [thm "r_def", thm "A_def"]); |
684 |
by (Fast_tac 2); |
|
685 |
by (rtac conjI 1); |
|
686 |
by (rtac lubE1 2); |
|
687 |
by (afs [lub_in_lattice] 1); |
|
688 |
by (rtac subset_refl 1); |
|
689 |
qed "Top_prop"; |
|
690 |
||
| 11395 | 691 |
Goal "x \\<in> A ==> (Bot cl, x) \\<in> r"; |
| 7085 | 692 |
by (simp_tac (simpset() addsimps [Bot_dual_Top, thm "r_def"]) 1); |
693 |
by (rtac (dualr_iff RS subst) 1); |
|
694 |
by (rtac (export Top_prop) 1); |
|
695 |
by (rtac CL_dualCL 1); |
|
696 |
by (afs [dualA_iff, thm "A_def"] 1); |
|
697 |
qed "Bot_prop"; |
|
698 |
||
| 11395 | 699 |
Goal "x \\<in> A ==> interval r x (Top cl) \\<noteq> {}";
|
| 7085 | 700 |
by (rtac notI 1); |
701 |
by (dres_inst_tac [("a","Top cl")] equals0D 1);
|
|
702 |
by (afs [interval_def] 1); |
|
703 |
by (afs [refl_def,Top_in_lattice,Top_prop] 1); |
|
704 |
qed "Top_intv_not_empty"; |
|
705 |
||
| 11395 | 706 |
Goal "x \\<in> A ==> interval r (Bot cl) x \\<noteq> {}";
|
| 7085 | 707 |
by (simp_tac (simpset() addsimps [Bot_dual_Top]) 1); |
708 |
by (stac interval_dual 1); |
|
709 |
by (assume_tac 2); |
|
710 |
by (afs [thm "A_def"] 1); |
|
711 |
by (rtac (dualA_iff RS subst) 1); |
|
712 |
by (rtac (export Top_in_lattice) 1); |
|
713 |
by (rtac CL_dualCL 1); |
|
714 |
by (afs [export Top_intv_not_empty,CL_dualCL,dualA_iff, thm "A_def"] 1); |
|
715 |
qed "Bot_intv_not_empty"; |
|
716 |
||
717 |
(* fixed points form a partial order *) |
|
| 11395 | 718 |
Goal "(| pset = P, order = induced P r|) \\<in> PartialOrder"; |
| 7085 | 719 |
by (rtac po_subset_po 1); |
720 |
by (rtac fixfE1 1); |
|
721 |
qed "fixf_po"; |
|
722 |
||
723 |
Open_locale "Tarski"; |
|
724 |
||
725 |
Goal "Y <= A"; |
|
726 |
by (rtac (fixfE1 RSN(2,subset_trans)) 1); |
|
727 |
by (rtac (thm "Y_ss") 1); |
|
728 |
qed "Y_subset_A"; |
|
729 |
||
| 11395 | 730 |
Goal "lub Y cl \\<in> A"; |
| 7085 | 731 |
by (afs [Y_subset_A RS lub_in_lattice] 1); |
732 |
qed "lubY_in_A"; |
|
733 |
||
| 11395 | 734 |
Goal "(lub Y cl, f (lub Y cl)) \\<in> r"; |
| 7085 | 735 |
by (rtac lubE2 1); |
736 |
by (rtac Y_subset_A 1); |
|
737 |
by (rtac (CLF_E1 RS funcset_mem) 1); |
|
738 |
by (rtac lubY_in_A 1); |
|
739 |
(* Y <= P ==> f x = x *) |
|
740 |
by (rtac ballI 1); |
|
741 |
by (res_inst_tac [("t","x")] (fixfE2 RS subst) 1);
|
|
742 |
by (etac (thm "Y_ss" RS subsetD) 1); |
|
| 11395 | 743 |
(* reduce (f x, f (lub Y cl)) \\<in> r to (x, lub Y cl) \\<in> r by monotonicity *) |
| 7085 | 744 |
by (res_inst_tac [("f","f")] monotoneE 1);
|
745 |
by (rtac CLF_E2 1); |
|
746 |
by (afs [Y_subset_A RS subsetD] 1); |
|
747 |
by (rtac lubY_in_A 1); |
|
748 |
by (afs [lubE1, Y_subset_A] 1); |
|
749 |
qed "lubY_le_flubY"; |
|
750 |
||
751 |
Goalw [thm "intY1_def"] "intY1 <= A"; |
|
752 |
by (rtac interval_subset 1); |
|
753 |
by (rtac lubY_in_A 1); |
|
754 |
by (rtac Top_in_lattice 1); |
|
755 |
qed "intY1_subset"; |
|
756 |
||
757 |
val intY1_elem = intY1_subset RS subsetD; |
|
758 |
||
| 11395 | 759 |
Goal "x \\<in> intY1 \\<Longrightarrow> f x \\<in> intY1"; |
| 7085 | 760 |
by (afs [thm "intY1_def", interval_def] 1); |
761 |
by (rtac conjI 1); |
|
762 |
by (rtac transE 1); |
|
763 |
by (rtac CompleteLatticeE13 1); |
|
764 |
by (rtac lubY_le_flubY 1); |
|
| 11395 | 765 |
(* (f (lub Y cl), f x) \\<in> r *) |
| 7085 | 766 |
by (res_inst_tac [("f","f")]monotoneE 1);
|
767 |
by (rtac CLF_E2 1); |
|
768 |
by (rtac lubY_in_A 1); |
|
769 |
by (afs [thm "intY1_def",interval_def, intY1_elem] 1); |
|
770 |
by (afs [thm "intY1_def", interval_def] 1); |
|
| 11395 | 771 |
(* (f x, Top cl) \\<in> r *) |
| 7085 | 772 |
by (rtac Top_prop 1); |
773 |
by (rtac (CLF_E1 RS funcset_mem) 1); |
|
774 |
by (afs [thm "intY1_def",interval_def, intY1_elem] 1); |
|
| 11395 | 775 |
qed "intY1_f_closed"; |
776 |
||
777 |
Goal "(lam x: intY1. f x) \\<in> intY1 funcset intY1"; |
|
778 |
by (rtac restrictI 1); |
|
779 |
by (etac intY1_f_closed 1); |
|
| 7085 | 780 |
qed "intY1_func"; |
781 |
||
782 |
Goal "monotone (lam x: intY1. f x) intY1 (induced intY1 r)"; |
|
| 11395 | 783 |
by (auto_tac (claset(), |
784 |
simpset() addsimps [monotone_def, induced_def, intY1_f_closed])); |
|
785 |
by (blast_tac (claset() addIs [intY1_elem, CLF_E2 RS monotoneE]) 1); |
|
| 7085 | 786 |
qed "intY1_mono"; |
787 |
||
788 |
Goalw [thm "intY1_def"] |
|
| 11395 | 789 |
"(| pset = intY1, order = induced intY1 r |) \\<in> CompleteLattice"; |
| 7085 | 790 |
by (rtac interv_is_compl_latt 1); |
791 |
by (rtac lubY_in_A 1); |
|
792 |
by (rtac Top_in_lattice 1); |
|
793 |
by (rtac Top_intv_not_empty 1); |
|
794 |
by (rtac lubY_in_A 1); |
|
795 |
qed "intY1_is_cl"; |
|
796 |
||
| 11395 | 797 |
Goalw [thm "P_def"] "v \\<in> P"; |
| 7085 | 798 |
by (res_inst_tac [("A","intY1")] fixf_subset 1);
|
799 |
by (rtac intY1_subset 1); |
|
800 |
by (rewrite_goals_tac [thm "v_def"]); |
|
801 |
by (rtac (simplify (simpset()) (intY1_is_cl RS export glbH_is_fixp)) 1); |
|
802 |
by (afs [CLF_def, intY1_is_cl, intY1_func, intY1_mono] 1); |
|
803 |
by (Simp_tac 1); |
|
804 |
qed "v_in_P"; |
|
805 |
||
806 |
Goalw [thm "intY1_def"] |
|
| 11395 | 807 |
"[| z \\<in> P; \\<forall>y\\<in>Y. (y, z) \\<in> induced P r |] ==> z \\<in> intY1"; |
| 7085 | 808 |
by (rtac intervalI 1); |
809 |
by (etac (fixfE1 RS subsetD RS Top_prop) 2); |
|
810 |
by (rtac lubE2 1); |
|
811 |
by (rtac Y_subset_A 1); |
|
812 |
by (fast_tac (claset() addSEs [fixfE1 RS subsetD]) 1); |
|
813 |
by (rtac ballI 1); |
|
814 |
by (dtac bspec 1); |
|
815 |
by (assume_tac 1); |
|
816 |
by (afs [induced_def] 1); |
|
817 |
qed "z_in_interval"; |
|
818 |
||
| 11395 | 819 |
Goal "[| z \\<in> P; \\<forall>y\\<in>Y. (y, z) \\<in> induced P r |]\ |
820 |
\ ==> ((lam x: intY1. f x) z, z) \\<in> induced intY1 r"; |
|
821 |
by (afs [induced_def, intY1_f_closed, z_in_interval] 1); |
|
822 |
by (afs [fixfE2, fixfE1 RS subsetD, CompleteLatticeE11 RS reflE] 1); |
|
| 7085 | 823 |
qed "f'z_in_int_rel"; |
824 |
||
| 11395 | 825 |
Goal "\\<exists>L. islub Y (| pset = P, order = induced P r |) L"; |
| 7085 | 826 |
by (res_inst_tac [("x","v")] exI 1);
|
827 |
by (simp_tac (simpset() addsimps [islub_def]) 1); |
|
| 11395 | 828 |
(* v \\<in> P *) |
| 7085 | 829 |
by (afs [v_in_P] 1); |
830 |
by (rtac conjI 1); |
|
831 |
(* v is lub *) |
|
| 11395 | 832 |
(* 1. \\<forall>y:Y. (y, v) \\<in> induced P r *) |
| 7085 | 833 |
by (rtac ballI 1); |
834 |
by (afs [induced_def, subsetD, v_in_P] 1); |
|
835 |
by (rtac conjI 1); |
|
836 |
by (etac (thm "Y_ss" RS subsetD) 1); |
|
837 |
by (res_inst_tac [("b","lub Y cl")] transE 1);
|
|
838 |
by (rtac CompleteLatticeE13 1); |
|
839 |
by (rtac (lubE1 RS bspec) 1); |
|
840 |
by (rtac Y_subset_A 1); |
|
841 |
by (assume_tac 1); |
|
842 |
by (res_inst_tac [("b","Top cl")] intervalE1 1);
|
|
843 |
by (afs [thm "v_def"] 1); |
|
844 |
by (fold_goals_tac [thm "intY1_def"]); |
|
845 |
by (rtac (simplify (simpset()) (intY1_is_cl RS export glb_in_lattice)) 1); |
|
| 11395 | 846 |
by (Force_tac 1); |
| 7085 | 847 |
(* v is LEAST ub *) |
848 |
by (Clarify_tac 1); |
|
849 |
by (rtac indI 1); |
|
850 |
by (afs [v_in_P] 2); |
|
851 |
by (assume_tac 2); |
|
852 |
by (rewrite_goals_tac [thm "v_def"]); |
|
853 |
by (rtac indE 1); |
|
854 |
by (rtac intY1_subset 2); |
|
855 |
by (rtac (simplify (simpset()) (intY1_is_cl RS export (glbE1 RS bspec))) 1); |
|
| 11395 | 856 |
by (Force_tac 1); |
857 |
by (afs [induced_def, intY1_f_closed, z_in_interval] 1); |
|
858 |
by (afs [fixfE2, fixfE1 RS subsetD, CompleteLatticeE11 RS reflE] 1); |
|
| 7085 | 859 |
qed "tarski_full_lemma"; |
860 |
val Tarski_full_lemma = Export tarski_full_lemma; |
|
861 |
||
862 |
Close_locale "Tarski"; |
|
863 |
||
| 11395 | 864 |
Goal "(| pset = P, order = induced P r|) \\<in> CompleteLattice"; |
| 7085 | 865 |
by (rtac CompleteLatticeI_simp 1); |
866 |
by (afs [fixf_po] 1); |
|
867 |
by (Clarify_tac 1); |
|
868 |
by (etac Tarski_full_lemma 1); |
|
869 |
qed "Tarski_full"; |
|
870 |
||
871 |
||
872 |
Close_locale "CLF"; |
|
873 |
Close_locale "CL"; |
|
874 |
Close_locale "PO"; |
|
875 |
||
876 |
||
877 |