author | haftmann |
Thu, 26 Jun 2008 10:07:01 +0200 | |
changeset 27368 | 9f90ac19e32b |
parent 26806 | 40b411ec05aa |
child 27681 | 8cedebf55539 |
permissions | -rw-r--r-- |
23449 | 1 |
(* Title: HOL/MetisTest/Tarski.thy |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
||
5 |
Testing the metis method |
|
6 |
*) |
|
7 |
||
8 |
header {* The Full Theorem of Tarski *} |
|
9 |
||
27368 | 10 |
theory Tarski |
11 |
imports Main FuncSet |
|
12 |
begin |
|
23449 | 13 |
|
14 |
(*Many of these higher-order problems appear to be impossible using the |
|
15 |
current linkup. They often seem to need either higher-order unification |
|
16 |
or explicit reasoning about connectives such as conjunction. The numerous |
|
17 |
set comprehensions are to blame.*) |
|
18 |
||
19 |
||
20 |
record 'a potype = |
|
21 |
pset :: "'a set" |
|
22 |
order :: "('a * 'a) set" |
|
23 |
||
24 |
constdefs |
|
25 |
monotone :: "['a => 'a, 'a set, ('a *'a)set] => bool" |
|
26 |
"monotone f A r == \<forall>x\<in>A. \<forall>y\<in>A. (x, y): r --> ((f x), (f y)) : r" |
|
27 |
||
28 |
least :: "['a => bool, 'a potype] => 'a" |
|
29 |
"least P po == @ x. x: pset po & P x & |
|
30 |
(\<forall>y \<in> pset po. P y --> (x,y): order po)" |
|
31 |
||
32 |
greatest :: "['a => bool, 'a potype] => 'a" |
|
33 |
"greatest P po == @ x. x: pset po & P x & |
|
34 |
(\<forall>y \<in> pset po. P y --> (y,x): order po)" |
|
35 |
||
36 |
lub :: "['a set, 'a potype] => 'a" |
|
37 |
"lub S po == least (%x. \<forall>y\<in>S. (y,x): order po) po" |
|
38 |
||
39 |
glb :: "['a set, 'a potype] => 'a" |
|
40 |
"glb S po == greatest (%x. \<forall>y\<in>S. (x,y): order po) po" |
|
41 |
||
42 |
isLub :: "['a set, 'a potype, 'a] => bool" |
|
43 |
"isLub S po == %L. (L: pset po & (\<forall>y\<in>S. (y,L): order po) & |
|
44 |
(\<forall>z\<in>pset po. (\<forall>y\<in>S. (y,z): order po) --> (L,z): order po))" |
|
45 |
||
46 |
isGlb :: "['a set, 'a potype, 'a] => bool" |
|
47 |
"isGlb S po == %G. (G: pset po & (\<forall>y\<in>S. (G,y): order po) & |
|
48 |
(\<forall>z \<in> pset po. (\<forall>y\<in>S. (z,y): order po) --> (z,G): order po))" |
|
49 |
||
50 |
"fix" :: "[('a => 'a), 'a set] => 'a set" |
|
51 |
"fix f A == {x. x: A & f x = x}" |
|
52 |
||
53 |
interval :: "[('a*'a) set,'a, 'a ] => 'a set" |
|
54 |
"interval r a b == {x. (a,x): r & (x,b): r}" |
|
55 |
||
56 |
constdefs |
|
57 |
Bot :: "'a potype => 'a" |
|
58 |
"Bot po == least (%x. True) po" |
|
59 |
||
60 |
Top :: "'a potype => 'a" |
|
61 |
"Top po == greatest (%x. True) po" |
|
62 |
||
63 |
PartialOrder :: "('a potype) set" |
|
64 |
"PartialOrder == {P. refl (pset P) (order P) & antisym (order P) & |
|
65 |
trans (order P)}" |
|
66 |
||
67 |
CompleteLattice :: "('a potype) set" |
|
68 |
"CompleteLattice == {cl. cl: PartialOrder & |
|
69 |
(\<forall>S. S \<subseteq> pset cl --> (\<exists>L. isLub S cl L)) & |
|
70 |
(\<forall>S. S \<subseteq> pset cl --> (\<exists>G. isGlb S cl G))}" |
|
71 |
||
72 |
CLF :: "('a potype * ('a => 'a)) set" |
|
73 |
"CLF == SIGMA cl: CompleteLattice. |
|
74 |
{f. f: pset cl -> pset cl & monotone f (pset cl) (order cl)}" |
|
75 |
||
76 |
induced :: "['a set, ('a * 'a) set] => ('a *'a)set" |
|
77 |
"induced A r == {(a,b). a : A & b: A & (a,b): r}" |
|
78 |
||
79 |
constdefs |
|
80 |
sublattice :: "('a potype * 'a set)set" |
|
81 |
"sublattice == |
|
82 |
SIGMA cl: CompleteLattice. |
|
83 |
{S. S \<subseteq> pset cl & |
|
84 |
(| pset = S, order = induced S (order cl) |): CompleteLattice }" |
|
85 |
||
86 |
syntax |
|
87 |
"@SL" :: "['a set, 'a potype] => bool" ("_ <<= _" [51,50]50) |
|
88 |
||
89 |
translations |
|
90 |
"S <<= cl" == "S : sublattice `` {cl}" |
|
91 |
||
92 |
constdefs |
|
93 |
dual :: "'a potype => 'a potype" |
|
94 |
"dual po == (| pset = pset po, order = converse (order po) |)" |
|
95 |
||
96 |
locale (open) PO = |
|
97 |
fixes cl :: "'a potype" |
|
98 |
and A :: "'a set" |
|
99 |
and r :: "('a * 'a) set" |
|
100 |
assumes cl_po: "cl : PartialOrder" |
|
101 |
defines A_def: "A == pset cl" |
|
102 |
and r_def: "r == order cl" |
|
103 |
||
104 |
locale (open) CL = PO + |
|
105 |
assumes cl_co: "cl : CompleteLattice" |
|
106 |
||
107 |
locale (open) CLF = CL + |
|
108 |
fixes f :: "'a => 'a" |
|
109 |
and P :: "'a set" |
|
110 |
assumes f_cl: "(cl,f) : CLF" (*was the equivalent "f : CLF``{cl}"*) |
|
111 |
defines P_def: "P == fix f A" |
|
112 |
||
113 |
||
114 |
locale (open) Tarski = CLF + |
|
115 |
fixes Y :: "'a set" |
|
116 |
and intY1 :: "'a set" |
|
117 |
and v :: "'a" |
|
118 |
assumes |
|
119 |
Y_ss: "Y \<subseteq> P" |
|
120 |
defines |
|
121 |
intY1_def: "intY1 == interval r (lub Y cl) (Top cl)" |
|
122 |
and v_def: "v == glb {x. ((%x: intY1. f x) x, x): induced intY1 r & |
|
123 |
x: intY1} |
|
124 |
(| pset=intY1, order=induced intY1 r|)" |
|
125 |
||
126 |
||
127 |
subsection {* Partial Order *} |
|
128 |
||
129 |
lemma (in PO) PO_imp_refl: "refl A r" |
|
130 |
apply (insert cl_po) |
|
131 |
apply (simp add: PartialOrder_def A_def r_def) |
|
132 |
done |
|
133 |
||
134 |
lemma (in PO) PO_imp_sym: "antisym r" |
|
135 |
apply (insert cl_po) |
|
136 |
apply (simp add: PartialOrder_def r_def) |
|
137 |
done |
|
138 |
||
139 |
lemma (in PO) PO_imp_trans: "trans r" |
|
140 |
apply (insert cl_po) |
|
141 |
apply (simp add: PartialOrder_def r_def) |
|
142 |
done |
|
143 |
||
144 |
lemma (in PO) reflE: "x \<in> A ==> (x, x) \<in> r" |
|
145 |
apply (insert cl_po) |
|
146 |
apply (simp add: PartialOrder_def refl_def A_def r_def) |
|
147 |
done |
|
148 |
||
149 |
lemma (in PO) antisymE: "[| (a, b) \<in> r; (b, a) \<in> r |] ==> a = b" |
|
150 |
apply (insert cl_po) |
|
151 |
apply (simp add: PartialOrder_def antisym_def r_def) |
|
152 |
done |
|
153 |
||
154 |
lemma (in PO) transE: "[| (a, b) \<in> r; (b, c) \<in> r|] ==> (a,c) \<in> r" |
|
155 |
apply (insert cl_po) |
|
156 |
apply (simp add: PartialOrder_def r_def) |
|
157 |
apply (unfold trans_def, fast) |
|
158 |
done |
|
159 |
||
160 |
lemma (in PO) monotoneE: |
|
161 |
"[| monotone f A r; x \<in> A; y \<in> A; (x, y) \<in> r |] ==> (f x, f y) \<in> r" |
|
162 |
by (simp add: monotone_def) |
|
163 |
||
164 |
lemma (in PO) po_subset_po: |
|
165 |
"S \<subseteq> A ==> (| pset = S, order = induced S r |) \<in> PartialOrder" |
|
166 |
apply (simp (no_asm) add: PartialOrder_def) |
|
167 |
apply auto |
|
168 |
-- {* refl *} |
|
169 |
apply (simp add: refl_def induced_def) |
|
170 |
apply (blast intro: reflE) |
|
171 |
-- {* antisym *} |
|
172 |
apply (simp add: antisym_def induced_def) |
|
173 |
apply (blast intro: antisymE) |
|
174 |
-- {* trans *} |
|
175 |
apply (simp add: trans_def induced_def) |
|
176 |
apply (blast intro: transE) |
|
177 |
done |
|
178 |
||
179 |
lemma (in PO) indE: "[| (x, y) \<in> induced S r; S \<subseteq> A |] ==> (x, y) \<in> r" |
|
180 |
by (simp add: add: induced_def) |
|
181 |
||
182 |
lemma (in PO) indI: "[| (x, y) \<in> r; x \<in> S; y \<in> S |] ==> (x, y) \<in> induced S r" |
|
183 |
by (simp add: add: induced_def) |
|
184 |
||
185 |
lemma (in CL) CL_imp_ex_isLub: "S \<subseteq> A ==> \<exists>L. isLub S cl L" |
|
186 |
apply (insert cl_co) |
|
187 |
apply (simp add: CompleteLattice_def A_def) |
|
188 |
done |
|
189 |
||
190 |
declare (in CL) cl_co [simp] |
|
191 |
||
192 |
lemma isLub_lub: "(\<exists>L. isLub S cl L) = isLub S cl (lub S cl)" |
|
193 |
by (simp add: lub_def least_def isLub_def some_eq_ex [symmetric]) |
|
194 |
||
195 |
lemma isGlb_glb: "(\<exists>G. isGlb S cl G) = isGlb S cl (glb S cl)" |
|
196 |
by (simp add: glb_def greatest_def isGlb_def some_eq_ex [symmetric]) |
|
197 |
||
198 |
lemma isGlb_dual_isLub: "isGlb S cl = isLub S (dual cl)" |
|
199 |
by (simp add: isLub_def isGlb_def dual_def converse_def) |
|
200 |
||
201 |
lemma isLub_dual_isGlb: "isLub S cl = isGlb S (dual cl)" |
|
202 |
by (simp add: isLub_def isGlb_def dual_def converse_def) |
|
203 |
||
204 |
lemma (in PO) dualPO: "dual cl \<in> PartialOrder" |
|
205 |
apply (insert cl_po) |
|
206 |
apply (simp add: PartialOrder_def dual_def refl_converse |
|
207 |
trans_converse antisym_converse) |
|
208 |
done |
|
209 |
||
210 |
lemma Rdual: |
|
211 |
"\<forall>S. (S \<subseteq> A -->( \<exists>L. isLub S (| pset = A, order = r|) L)) |
|
212 |
==> \<forall>S. (S \<subseteq> A --> (\<exists>G. isGlb S (| pset = A, order = r|) G))" |
|
213 |
apply safe |
|
214 |
apply (rule_tac x = "lub {y. y \<in> A & (\<forall>k \<in> S. (y, k) \<in> r)} |
|
215 |
(|pset = A, order = r|) " in exI) |
|
216 |
apply (drule_tac x = "{y. y \<in> A & (\<forall>k \<in> S. (y,k) \<in> r) }" in spec) |
|
217 |
apply (drule mp, fast) |
|
218 |
apply (simp add: isLub_lub isGlb_def) |
|
219 |
apply (simp add: isLub_def, blast) |
|
220 |
done |
|
221 |
||
222 |
lemma lub_dual_glb: "lub S cl = glb S (dual cl)" |
|
223 |
by (simp add: lub_def glb_def least_def greatest_def dual_def converse_def) |
|
224 |
||
225 |
lemma glb_dual_lub: "glb S cl = lub S (dual cl)" |
|
226 |
by (simp add: lub_def glb_def least_def greatest_def dual_def converse_def) |
|
227 |
||
228 |
lemma CL_subset_PO: "CompleteLattice \<subseteq> PartialOrder" |
|
229 |
by (simp add: PartialOrder_def CompleteLattice_def, fast) |
|
230 |
||
231 |
lemmas CL_imp_PO = CL_subset_PO [THEN subsetD] |
|
232 |
||
233 |
declare CL_imp_PO [THEN PO.PO_imp_refl, simp] |
|
234 |
declare CL_imp_PO [THEN PO.PO_imp_sym, simp] |
|
235 |
declare CL_imp_PO [THEN PO.PO_imp_trans, simp] |
|
236 |
||
237 |
lemma (in CL) CO_refl: "refl A r" |
|
238 |
by (rule PO_imp_refl) |
|
239 |
||
240 |
lemma (in CL) CO_antisym: "antisym r" |
|
241 |
by (rule PO_imp_sym) |
|
242 |
||
243 |
lemma (in CL) CO_trans: "trans r" |
|
244 |
by (rule PO_imp_trans) |
|
245 |
||
246 |
lemma CompleteLatticeI: |
|
247 |
"[| po \<in> PartialOrder; (\<forall>S. S \<subseteq> pset po --> (\<exists>L. isLub S po L)); |
|
248 |
(\<forall>S. S \<subseteq> pset po --> (\<exists>G. isGlb S po G))|] |
|
249 |
==> po \<in> CompleteLattice" |
|
250 |
apply (unfold CompleteLattice_def, blast) |
|
251 |
done |
|
252 |
||
253 |
lemma (in CL) CL_dualCL: "dual cl \<in> CompleteLattice" |
|
254 |
apply (insert cl_co) |
|
255 |
apply (simp add: CompleteLattice_def dual_def) |
|
256 |
apply (fold dual_def) |
|
257 |
apply (simp add: isLub_dual_isGlb [symmetric] isGlb_dual_isLub [symmetric] |
|
258 |
dualPO) |
|
259 |
done |
|
260 |
||
261 |
lemma (in PO) dualA_iff: "pset (dual cl) = pset cl" |
|
262 |
by (simp add: dual_def) |
|
263 |
||
264 |
lemma (in PO) dualr_iff: "((x, y) \<in> (order(dual cl))) = ((y, x) \<in> order cl)" |
|
265 |
by (simp add: dual_def) |
|
266 |
||
267 |
lemma (in PO) monotone_dual: |
|
268 |
"monotone f (pset cl) (order cl) |
|
269 |
==> monotone f (pset (dual cl)) (order(dual cl))" |
|
270 |
by (simp add: monotone_def dualA_iff dualr_iff) |
|
271 |
||
272 |
lemma (in PO) interval_dual: |
|
273 |
"[| x \<in> A; y \<in> A|] ==> interval r x y = interval (order(dual cl)) y x" |
|
274 |
apply (simp add: interval_def dualr_iff) |
|
275 |
apply (fold r_def, fast) |
|
276 |
done |
|
277 |
||
278 |
lemma (in PO) interval_not_empty: |
|
279 |
"[| trans r; interval r a b \<noteq> {} |] ==> (a, b) \<in> r" |
|
280 |
apply (simp add: interval_def) |
|
281 |
apply (unfold trans_def, blast) |
|
282 |
done |
|
283 |
||
284 |
lemma (in PO) interval_imp_mem: "x \<in> interval r a b ==> (a, x) \<in> r" |
|
285 |
by (simp add: interval_def) |
|
286 |
||
287 |
lemma (in PO) left_in_interval: |
|
288 |
"[| a \<in> A; b \<in> A; interval r a b \<noteq> {} |] ==> a \<in> interval r a b" |
|
289 |
apply (simp (no_asm_simp) add: interval_def) |
|
290 |
apply (simp add: PO_imp_trans interval_not_empty) |
|
291 |
apply (simp add: reflE) |
|
292 |
done |
|
293 |
||
294 |
lemma (in PO) right_in_interval: |
|
295 |
"[| a \<in> A; b \<in> A; interval r a b \<noteq> {} |] ==> b \<in> interval r a b" |
|
296 |
apply (simp (no_asm_simp) add: interval_def) |
|
297 |
apply (simp add: PO_imp_trans interval_not_empty) |
|
298 |
apply (simp add: reflE) |
|
299 |
done |
|
300 |
||
301 |
||
302 |
subsection {* sublattice *} |
|
303 |
||
304 |
lemma (in PO) sublattice_imp_CL: |
|
305 |
"S <<= cl ==> (| pset = S, order = induced S r |) \<in> CompleteLattice" |
|
306 |
by (simp add: sublattice_def CompleteLattice_def A_def r_def) |
|
307 |
||
308 |
lemma (in CL) sublatticeI: |
|
309 |
"[| S \<subseteq> A; (| pset = S, order = induced S r |) \<in> CompleteLattice |] |
|
310 |
==> S <<= cl" |
|
311 |
by (simp add: sublattice_def A_def r_def) |
|
312 |
||
313 |
||
314 |
subsection {* lub *} |
|
315 |
||
316 |
lemma (in CL) lub_unique: "[| S \<subseteq> A; isLub S cl x; isLub S cl L|] ==> x = L" |
|
317 |
apply (rule antisymE) |
|
318 |
apply (auto simp add: isLub_def r_def) |
|
319 |
done |
|
320 |
||
321 |
lemma (in CL) lub_upper: "[|S \<subseteq> A; x \<in> S|] ==> (x, lub S cl) \<in> r" |
|
322 |
apply (rule CL_imp_ex_isLub [THEN exE], assumption) |
|
323 |
apply (unfold lub_def least_def) |
|
324 |
apply (rule some_equality [THEN ssubst]) |
|
325 |
apply (simp add: isLub_def) |
|
326 |
apply (simp add: lub_unique A_def isLub_def) |
|
327 |
apply (simp add: isLub_def r_def) |
|
328 |
done |
|
329 |
||
330 |
lemma (in CL) lub_least: |
|
331 |
"[| S \<subseteq> A; L \<in> A; \<forall>x \<in> S. (x,L) \<in> r |] ==> (lub S cl, L) \<in> r" |
|
332 |
apply (rule CL_imp_ex_isLub [THEN exE], assumption) |
|
333 |
apply (unfold lub_def least_def) |
|
334 |
apply (rule_tac s=x in some_equality [THEN ssubst]) |
|
335 |
apply (simp add: isLub_def) |
|
336 |
apply (simp add: lub_unique A_def isLub_def) |
|
337 |
apply (simp add: isLub_def r_def A_def) |
|
338 |
done |
|
339 |
||
340 |
lemma (in CL) lub_in_lattice: "S \<subseteq> A ==> lub S cl \<in> A" |
|
341 |
apply (rule CL_imp_ex_isLub [THEN exE], assumption) |
|
342 |
apply (unfold lub_def least_def) |
|
343 |
apply (subst some_equality) |
|
344 |
apply (simp add: isLub_def) |
|
345 |
prefer 2 apply (simp add: isLub_def A_def) |
|
346 |
apply (simp add: lub_unique A_def isLub_def) |
|
347 |
done |
|
348 |
||
349 |
lemma (in CL) lubI: |
|
350 |
"[| S \<subseteq> A; L \<in> A; \<forall>x \<in> S. (x,L) \<in> r; |
|
351 |
\<forall>z \<in> A. (\<forall>y \<in> S. (y,z) \<in> r) --> (L,z) \<in> r |] ==> L = lub S cl" |
|
352 |
apply (rule lub_unique, assumption) |
|
353 |
apply (simp add: isLub_def A_def r_def) |
|
354 |
apply (unfold isLub_def) |
|
355 |
apply (rule conjI) |
|
356 |
apply (fold A_def r_def) |
|
357 |
apply (rule lub_in_lattice, assumption) |
|
358 |
apply (simp add: lub_upper lub_least) |
|
359 |
done |
|
360 |
||
361 |
lemma (in CL) lubIa: "[| S \<subseteq> A; isLub S cl L |] ==> L = lub S cl" |
|
362 |
by (simp add: lubI isLub_def A_def r_def) |
|
363 |
||
364 |
lemma (in CL) isLub_in_lattice: "isLub S cl L ==> L \<in> A" |
|
365 |
by (simp add: isLub_def A_def) |
|
366 |
||
367 |
lemma (in CL) isLub_upper: "[|isLub S cl L; y \<in> S|] ==> (y, L) \<in> r" |
|
368 |
by (simp add: isLub_def r_def) |
|
369 |
||
370 |
lemma (in CL) isLub_least: |
|
371 |
"[| isLub S cl L; z \<in> A; \<forall>y \<in> S. (y, z) \<in> r|] ==> (L, z) \<in> r" |
|
372 |
by (simp add: isLub_def A_def r_def) |
|
373 |
||
374 |
lemma (in CL) isLubI: |
|
375 |
"[| L \<in> A; \<forall>y \<in> S. (y, L) \<in> r; |
|
376 |
(\<forall>z \<in> A. (\<forall>y \<in> S. (y, z):r) --> (L, z) \<in> r)|] ==> isLub S cl L" |
|
377 |
by (simp add: isLub_def A_def r_def) |
|
378 |
||
379 |
||
380 |
||
381 |
subsection {* glb *} |
|
382 |
||
383 |
lemma (in CL) glb_in_lattice: "S \<subseteq> A ==> glb S cl \<in> A" |
|
384 |
apply (subst glb_dual_lub) |
|
385 |
apply (simp add: A_def) |
|
386 |
apply (rule dualA_iff [THEN subst]) |
|
387 |
apply (rule CL.lub_in_lattice) |
|
388 |
apply (rule dualPO) |
|
389 |
apply (rule CL_dualCL) |
|
390 |
apply (simp add: dualA_iff) |
|
391 |
done |
|
392 |
||
393 |
lemma (in CL) glb_lower: "[|S \<subseteq> A; x \<in> S|] ==> (glb S cl, x) \<in> r" |
|
394 |
apply (subst glb_dual_lub) |
|
395 |
apply (simp add: r_def) |
|
396 |
apply (rule dualr_iff [THEN subst]) |
|
397 |
apply (rule CL.lub_upper) |
|
398 |
apply (rule dualPO) |
|
399 |
apply (rule CL_dualCL) |
|
400 |
apply (simp add: dualA_iff A_def, assumption) |
|
401 |
done |
|
402 |
||
403 |
text {* |
|
404 |
Reduce the sublattice property by using substructural properties; |
|
405 |
abandoned see @{text "Tarski_4.ML"}. |
|
406 |
*} |
|
407 |
||
408 |
declare (in CLF) f_cl [simp] |
|
409 |
||
410 |
(*never proved, 2007-01-22: Tarski__CLF_unnamed_lemma |
|
411 |
NOT PROVABLE because of the conjunction used in the definition: we don't |
|
412 |
allow reasoning with rules like conjE, which is essential here.*) |
|
26483 | 413 |
ML_command{*ResAtp.problem_name:="Tarski__CLF_unnamed_lemma"*} |
23449 | 414 |
lemma (in CLF) [simp]: |
415 |
"f: pset cl -> pset cl & monotone f (pset cl) (order cl)" |
|
416 |
apply (insert f_cl) |
|
417 |
apply (unfold CLF_def) |
|
418 |
apply (erule SigmaE2) |
|
419 |
apply (erule CollectE) |
|
420 |
apply assumption; |
|
421 |
done |
|
422 |
||
423 |
lemma (in CLF) f_in_funcset: "f \<in> A -> A" |
|
424 |
by (simp add: A_def) |
|
425 |
||
426 |
lemma (in CLF) monotone_f: "monotone f A r" |
|
427 |
by (simp add: A_def r_def) |
|
428 |
||
429 |
(*never proved, 2007-01-22*) |
|
26483 | 430 |
ML_command{*ResAtp.problem_name:="Tarski__CLF_CLF_dual"*} |
23449 | 431 |
declare (in CLF) CLF_def[simp] CL_dualCL[simp] monotone_dual[simp] dualA_iff[simp] |
432 |
lemma (in CLF) CLF_dual: "(dual cl, f) \<in> CLF" |
|
433 |
apply (simp del: dualA_iff) |
|
434 |
apply (simp) |
|
435 |
done |
|
436 |
declare (in CLF) CLF_def[simp del] CL_dualCL[simp del] monotone_dual[simp del] |
|
437 |
dualA_iff[simp del] |
|
438 |
||
439 |
||
440 |
subsection {* fixed points *} |
|
441 |
||
442 |
lemma fix_subset: "fix f A \<subseteq> A" |
|
443 |
by (simp add: fix_def, fast) |
|
444 |
||
445 |
lemma fix_imp_eq: "x \<in> fix f A ==> f x = x" |
|
446 |
by (simp add: fix_def) |
|
447 |
||
448 |
lemma fixf_subset: |
|
449 |
"[| A \<subseteq> B; x \<in> fix (%y: A. f y) A |] ==> x \<in> fix f B" |
|
450 |
by (simp add: fix_def, auto) |
|
451 |
||
452 |
||
453 |
subsection {* lemmas for Tarski, lub *} |
|
454 |
||
455 |
(*never proved, 2007-01-22*) |
|
456 |
ML{*ResAtp.problem_name:="Tarski__CLF_lubH_le_flubH"*} |
|
457 |
declare CL.lub_least[intro] CLF.f_in_funcset[intro] funcset_mem[intro] CL.lub_in_lattice[intro] PO.transE[intro] PO.monotoneE[intro] CLF.monotone_f[intro] CL.lub_upper[intro] |
|
458 |
lemma (in CLF) lubH_le_flubH: |
|
459 |
"H = {x. (x, f x) \<in> r & x \<in> A} ==> (lub H cl, f (lub H cl)) \<in> r" |
|
460 |
apply (rule lub_least, fast) |
|
461 |
apply (rule f_in_funcset [THEN funcset_mem]) |
|
462 |
apply (rule lub_in_lattice, fast) |
|
463 |
-- {* @{text "\<forall>x:H. (x, f (lub H r)) \<in> r"} *} |
|
464 |
apply (rule ballI) |
|
465 |
(*never proved, 2007-01-22*) |
|
26483 | 466 |
ML_command{*ResAtp.problem_name:="Tarski__CLF_lubH_le_flubH_simpler"*} |
23449 | 467 |
apply (rule transE) |
468 |
-- {* instantiates @{text "(x, ?z) \<in> order cl to (x, f x)"}, *} |
|
469 |
-- {* because of the def of @{text H} *} |
|
470 |
apply fast |
|
471 |
-- {* so it remains to show @{text "(f x, f (lub H cl)) \<in> r"} *} |
|
472 |
apply (rule_tac f = "f" in monotoneE) |
|
473 |
apply (rule monotone_f, fast) |
|
474 |
apply (rule lub_in_lattice, fast) |
|
475 |
apply (rule lub_upper, fast) |
|
476 |
apply assumption |
|
477 |
done |
|
478 |
declare CL.lub_least[rule del] CLF.f_in_funcset[rule del] |
|
479 |
funcset_mem[rule del] CL.lub_in_lattice[rule del] |
|
480 |
PO.transE[rule del] PO.monotoneE[rule del] |
|
481 |
CLF.monotone_f[rule del] CL.lub_upper[rule del] |
|
482 |
||
483 |
(*never proved, 2007-01-22*) |
|
484 |
ML{*ResAtp.problem_name:="Tarski__CLF_flubH_le_lubH"*} |
|
485 |
declare CLF.f_in_funcset[intro] funcset_mem[intro] CL.lub_in_lattice[intro] |
|
486 |
PO.monotoneE[intro] CLF.monotone_f[intro] CL.lub_upper[intro] |
|
487 |
CLF.lubH_le_flubH[simp] |
|
488 |
lemma (in CLF) flubH_le_lubH: |
|
489 |
"[| H = {x. (x, f x) \<in> r & x \<in> A} |] ==> (f (lub H cl), lub H cl) \<in> r" |
|
490 |
apply (rule lub_upper, fast) |
|
491 |
apply (rule_tac t = "H" in ssubst, assumption) |
|
492 |
apply (rule CollectI) |
|
493 |
apply (rule conjI) |
|
26483 | 494 |
ML_command{*ResAtp.problem_name:="Tarski__CLF_flubH_le_lubH_simpler"*} |
24827 | 495 |
(*??no longer terminates, with combinators |
496 |
apply (metis CO_refl lubH_le_flubH monotone_def monotone_f reflD1 reflD2) |
|
497 |
*) |
|
24855 | 498 |
apply (metis CO_refl lubH_le_flubH monotoneE [OF monotone_f] reflD1 reflD2) |
23449 | 499 |
apply (metis CO_refl lubH_le_flubH reflD2) |
500 |
done |
|
501 |
declare CLF.f_in_funcset[rule del] funcset_mem[rule del] |
|
502 |
CL.lub_in_lattice[rule del] PO.monotoneE[rule del] |
|
503 |
CLF.monotone_f[rule del] CL.lub_upper[rule del] |
|
504 |
CLF.lubH_le_flubH[simp del] |
|
505 |
||
506 |
||
507 |
(*never proved, 2007-01-22*) |
|
508 |
ML{*ResAtp.problem_name:="Tarski__CLF_lubH_is_fixp"*} |
|
509 |
(*Single-step version fails. The conjecture clauses refer to local abstraction |
|
510 |
functions (Frees), which prevents expand_defs_tac from removing those |
|
24827 | 511 |
"definitions" at the end of the proof. *) |
23449 | 512 |
lemma (in CLF) lubH_is_fixp: |
513 |
"H = {x. (x, f x) \<in> r & x \<in> A} ==> lub H cl \<in> fix f A" |
|
514 |
apply (simp add: fix_def) |
|
515 |
apply (rule conjI) |
|
24827 | 516 |
proof (neg_clausify) |
517 |
assume 0: "H = |
|
518 |
Collect |
|
519 |
(COMBS (COMBB op \<and> (COMBC (COMBB op \<in> (COMBS Pair f)) r)) (COMBC op \<in> A))" |
|
520 |
assume 1: "lub (Collect |
|
521 |
(COMBS (COMBB op \<and> (COMBC (COMBB op \<in> (COMBS Pair f)) r)) |
|
522 |
(COMBC op \<in> A))) |
|
523 |
cl |
|
524 |
\<notin> A" |
|
525 |
have 2: "lub H cl \<notin> A" |
|
526 |
by (metis 1 0) |
|
527 |
have 3: "(lub H cl, f (lub H cl)) \<in> r" |
|
528 |
by (metis lubH_le_flubH 0) |
|
529 |
have 4: "(f (lub H cl), lub H cl) \<in> r" |
|
530 |
by (metis flubH_le_lubH 0) |
|
531 |
have 5: "lub H cl = f (lub H cl) \<or> (lub H cl, f (lub H cl)) \<notin> r" |
|
532 |
by (metis antisymE 4) |
|
533 |
have 6: "lub H cl = f (lub H cl)" |
|
534 |
by (metis 5 3) |
|
535 |
have 7: "(lub H cl, lub H cl) \<in> r" |
|
536 |
by (metis 6 4) |
|
537 |
have 8: "\<And>X1. lub H cl \<in> X1 \<or> \<not> refl X1 r" |
|
538 |
by (metis 7 reflD2) |
|
23449 | 539 |
have 9: "\<not> refl A r" |
24827 | 540 |
by (metis 8 2) |
23449 | 541 |
show "False" |
24827 | 542 |
by (metis CO_refl 9); |
543 |
next --{*apparently the way to insert a second structured proof*} |
|
544 |
show "H = {x. (x, f x) \<in> r \<and> x \<in> A} \<Longrightarrow> |
|
545 |
f (lub {x. (x, f x) \<in> r \<and> x \<in> A} cl) = lub {x. (x, f x) \<in> r \<and> x \<in> A} cl" |
|
546 |
proof (neg_clausify) |
|
547 |
assume 0: "H = |
|
548 |
Collect |
|
549 |
(COMBS (COMBB op \<and> (COMBC (COMBB op \<in> (COMBS Pair f)) r)) (COMBC op \<in> A))" |
|
550 |
assume 1: "f (lub (Collect |
|
551 |
(COMBS (COMBB op \<and> (COMBC (COMBB op \<in> (COMBS Pair f)) r)) |
|
552 |
(COMBC op \<in> A))) |
|
553 |
cl) \<noteq> |
|
554 |
lub (Collect |
|
555 |
(COMBS (COMBB op \<and> (COMBC (COMBB op \<in> (COMBS Pair f)) r)) |
|
556 |
(COMBC op \<in> A))) |
|
557 |
cl" |
|
558 |
have 2: "f (lub H cl) \<noteq> |
|
559 |
lub (Collect |
|
560 |
(COMBS (COMBB op \<and> (COMBC (COMBB op \<in> (COMBS Pair f)) r)) |
|
561 |
(COMBC op \<in> A))) |
|
562 |
cl" |
|
563 |
by (metis 1 0) |
|
564 |
have 3: "f (lub H cl) \<noteq> lub H cl" |
|
565 |
by (metis 2 0) |
|
566 |
have 4: "(lub H cl, f (lub H cl)) \<in> r" |
|
567 |
by (metis lubH_le_flubH 0) |
|
568 |
have 5: "(f (lub H cl), lub H cl) \<in> r" |
|
569 |
by (metis flubH_le_lubH 0) |
|
570 |
have 6: "lub H cl = f (lub H cl) \<or> (lub H cl, f (lub H cl)) \<notin> r" |
|
571 |
by (metis antisymE 5) |
|
572 |
have 7: "lub H cl = f (lub H cl)" |
|
573 |
by (metis 6 4) |
|
574 |
show "False" |
|
575 |
by (metis 3 7) |
|
576 |
qed |
|
577 |
qed |
|
23449 | 578 |
|
25710
4cdf7de81e1b
Replaced refs by config params; finer critical section in mets method
paulson
parents:
24855
diff
changeset
|
579 |
lemma (in CLF) (*lubH_is_fixp:*) |
23449 | 580 |
"H = {x. (x, f x) \<in> r & x \<in> A} ==> lub H cl \<in> fix f A" |
581 |
apply (simp add: fix_def) |
|
582 |
apply (rule conjI) |
|
26483 | 583 |
ML_command{*ResAtp.problem_name:="Tarski__CLF_lubH_is_fixp_simpler"*} |
24855 | 584 |
apply (metis CO_refl lubH_le_flubH reflD1) |
23449 | 585 |
apply (metis antisymE flubH_le_lubH lubH_le_flubH) |
586 |
done |
|
587 |
||
588 |
lemma (in CLF) fix_in_H: |
|
589 |
"[| H = {x. (x, f x) \<in> r & x \<in> A}; x \<in> P |] ==> x \<in> H" |
|
590 |
by (simp add: P_def fix_imp_eq [of _ f A] reflE CO_refl |
|
591 |
fix_subset [of f A, THEN subsetD]) |
|
592 |
||
593 |
||
594 |
lemma (in CLF) fixf_le_lubH: |
|
595 |
"H = {x. (x, f x) \<in> r & x \<in> A} ==> \<forall>x \<in> fix f A. (x, lub H cl) \<in> r" |
|
596 |
apply (rule ballI) |
|
597 |
apply (rule lub_upper, fast) |
|
598 |
apply (rule fix_in_H) |
|
599 |
apply (simp_all add: P_def) |
|
600 |
done |
|
601 |
||
602 |
ML{*ResAtp.problem_name:="Tarski__CLF_lubH_least_fixf"*} |
|
603 |
lemma (in CLF) lubH_least_fixf: |
|
604 |
"H = {x. (x, f x) \<in> r & x \<in> A} |
|
605 |
==> \<forall>L. (\<forall>y \<in> fix f A. (y,L) \<in> r) --> (lub H cl, L) \<in> r" |
|
606 |
apply (metis P_def lubH_is_fixp) |
|
607 |
done |
|
608 |
||
609 |
subsection {* Tarski fixpoint theorem 1, first part *} |
|
610 |
ML{*ResAtp.problem_name:="Tarski__CLF_T_thm_1_lub"*} |
|
611 |
declare CL.lubI[intro] fix_subset[intro] CL.lub_in_lattice[intro] |
|
612 |
CLF.fixf_le_lubH[simp] CLF.lubH_least_fixf[simp] |
|
613 |
lemma (in CLF) T_thm_1_lub: "lub P cl = lub {x. (x, f x) \<in> r & x \<in> A} cl" |
|
614 |
(*sledgehammer;*) |
|
615 |
apply (rule sym) |
|
616 |
apply (simp add: P_def) |
|
617 |
apply (rule lubI) |
|
26483 | 618 |
ML_command{*ResAtp.problem_name:="Tarski__CLF_T_thm_1_lub_simpler"*} |
24855 | 619 |
apply (metis P_def fix_subset) |
24827 | 620 |
apply (metis Collect_conj_eq Collect_mem_eq Int_commute Int_lower1 lub_in_lattice vimage_def) |
621 |
(*??no longer terminates, with combinators |
|
622 |
apply (metis P_def fix_def fixf_le_lubH) |
|
623 |
apply (metis P_def fix_def lubH_least_fixf) |
|
624 |
*) |
|
625 |
apply (simp add: fixf_le_lubH) |
|
626 |
apply (simp add: lubH_least_fixf) |
|
23449 | 627 |
done |
628 |
declare CL.lubI[rule del] fix_subset[rule del] CL.lub_in_lattice[rule del] |
|
629 |
CLF.fixf_le_lubH[simp del] CLF.lubH_least_fixf[simp del] |
|
630 |
||
631 |
||
632 |
(*never proved, 2007-01-22*) |
|
633 |
ML{*ResAtp.problem_name:="Tarski__CLF_glbH_is_fixp"*} |
|
634 |
declare glb_dual_lub[simp] PO.dualA_iff[intro] CLF.lubH_is_fixp[intro] |
|
635 |
PO.dualPO[intro] CL.CL_dualCL[intro] PO.dualr_iff[simp] |
|
636 |
lemma (in CLF) glbH_is_fixp: "H = {x. (f x, x) \<in> r & x \<in> A} ==> glb H cl \<in> P" |
|
637 |
-- {* Tarski for glb *} |
|
638 |
(*sledgehammer;*) |
|
639 |
apply (simp add: glb_dual_lub P_def A_def r_def) |
|
640 |
apply (rule dualA_iff [THEN subst]) |
|
641 |
apply (rule CLF.lubH_is_fixp) |
|
642 |
apply (rule dualPO) |
|
643 |
apply (rule CL_dualCL) |
|
644 |
apply (rule CLF_dual) |
|
645 |
apply (simp add: dualr_iff dualA_iff) |
|
646 |
done |
|
647 |
declare glb_dual_lub[simp del] PO.dualA_iff[rule del] CLF.lubH_is_fixp[rule del] |
|
648 |
PO.dualPO[rule del] CL.CL_dualCL[rule del] PO.dualr_iff[simp del] |
|
649 |
||
650 |
||
651 |
(*never proved, 2007-01-22*) |
|
652 |
ML{*ResAtp.problem_name:="Tarski__T_thm_1_glb"*} (*ALL THEOREMS*) |
|
653 |
lemma (in CLF) T_thm_1_glb: "glb P cl = glb {x. (f x, x) \<in> r & x \<in> A} cl" |
|
654 |
(*sledgehammer;*) |
|
655 |
apply (simp add: glb_dual_lub P_def A_def r_def) |
|
656 |
apply (rule dualA_iff [THEN subst]) |
|
657 |
(*never proved, 2007-01-22*) |
|
26483 | 658 |
ML_command{*ResAtp.problem_name:="Tarski__T_thm_1_glb_simpler"*} (*ALL THEOREMS*) |
23449 | 659 |
(*sledgehammer;*) |
660 |
apply (simp add: CLF.T_thm_1_lub [of _ f, OF dualPO CL_dualCL] |
|
661 |
dualPO CL_dualCL CLF_dual dualr_iff) |
|
662 |
done |
|
663 |
||
664 |
subsection {* interval *} |
|
665 |
||
666 |
||
667 |
ML{*ResAtp.problem_name:="Tarski__rel_imp_elem"*} |
|
668 |
declare (in CLF) CO_refl[simp] refl_def [simp] |
|
669 |
lemma (in CLF) rel_imp_elem: "(x, y) \<in> r ==> x \<in> A" |
|
24827 | 670 |
by (metis CO_refl reflD1) |
23449 | 671 |
declare (in CLF) CO_refl[simp del] refl_def [simp del] |
672 |
||
673 |
ML{*ResAtp.problem_name:="Tarski__interval_subset"*} |
|
674 |
declare (in CLF) rel_imp_elem[intro] |
|
675 |
declare interval_def [simp] |
|
676 |
lemma (in CLF) interval_subset: "[| a \<in> A; b \<in> A |] ==> interval r a b \<subseteq> A" |
|
26806 | 677 |
by (metis CO_refl interval_imp_mem reflD reflD2 rel_imp_elem subset_eq) |
23449 | 678 |
declare (in CLF) rel_imp_elem[rule del] |
679 |
declare interval_def [simp del] |
|
680 |
||
681 |
||
682 |
lemma (in CLF) intervalI: |
|
683 |
"[| (a, x) \<in> r; (x, b) \<in> r |] ==> x \<in> interval r a b" |
|
684 |
by (simp add: interval_def) |
|
685 |
||
686 |
lemma (in CLF) interval_lemma1: |
|
687 |
"[| S \<subseteq> interval r a b; x \<in> S |] ==> (a, x) \<in> r" |
|
688 |
by (unfold interval_def, fast) |
|
689 |
||
690 |
lemma (in CLF) interval_lemma2: |
|
691 |
"[| S \<subseteq> interval r a b; x \<in> S |] ==> (x, b) \<in> r" |
|
692 |
by (unfold interval_def, fast) |
|
693 |
||
694 |
lemma (in CLF) a_less_lub: |
|
695 |
"[| S \<subseteq> A; S \<noteq> {}; |
|
696 |
\<forall>x \<in> S. (a,x) \<in> r; \<forall>y \<in> S. (y, L) \<in> r |] ==> (a,L) \<in> r" |
|
697 |
by (blast intro: transE) |
|
698 |
||
699 |
lemma (in CLF) glb_less_b: |
|
700 |
"[| S \<subseteq> A; S \<noteq> {}; |
|
701 |
\<forall>x \<in> S. (x,b) \<in> r; \<forall>y \<in> S. (G, y) \<in> r |] ==> (G,b) \<in> r" |
|
702 |
by (blast intro: transE) |
|
703 |
||
704 |
lemma (in CLF) S_intv_cl: |
|
705 |
"[| a \<in> A; b \<in> A; S \<subseteq> interval r a b |]==> S \<subseteq> A" |
|
706 |
by (simp add: subset_trans [OF _ interval_subset]) |
|
707 |
||
708 |
ML{*ResAtp.problem_name:="Tarski__L_in_interval"*} (*ALL THEOREMS*) |
|
709 |
lemma (in CLF) L_in_interval: |
|
710 |
"[| a \<in> A; b \<in> A; S \<subseteq> interval r a b; |
|
711 |
S \<noteq> {}; isLub S cl L; interval r a b \<noteq> {} |] ==> L \<in> interval r a b" |
|
712 |
(*WON'T TERMINATE |
|
713 |
apply (metis CO_trans intervalI interval_lemma1 interval_lemma2 isLub_least isLub_upper subset_empty subset_iff trans_def) |
|
714 |
*) |
|
715 |
apply (rule intervalI) |
|
716 |
apply (rule a_less_lub) |
|
717 |
prefer 2 apply assumption |
|
718 |
apply (simp add: S_intv_cl) |
|
719 |
apply (rule ballI) |
|
720 |
apply (simp add: interval_lemma1) |
|
721 |
apply (simp add: isLub_upper) |
|
722 |
-- {* @{text "(L, b) \<in> r"} *} |
|
723 |
apply (simp add: isLub_least interval_lemma2) |
|
724 |
done |
|
725 |
||
726 |
(*never proved, 2007-01-22*) |
|
727 |
ML{*ResAtp.problem_name:="Tarski__G_in_interval"*} (*ALL THEOREMS*) |
|
728 |
lemma (in CLF) G_in_interval: |
|
729 |
"[| a \<in> A; b \<in> A; interval r a b \<noteq> {}; S \<subseteq> interval r a b; isGlb S cl G; |
|
730 |
S \<noteq> {} |] ==> G \<in> interval r a b" |
|
731 |
apply (simp add: interval_dual) |
|
732 |
apply (simp add: CLF.L_in_interval [of _ f] |
|
733 |
dualA_iff A_def dualPO CL_dualCL CLF_dual isGlb_dual_isLub) |
|
734 |
done |
|
735 |
||
736 |
ML{*ResAtp.problem_name:="Tarski__intervalPO"*} (*ALL THEOREMS*) |
|
737 |
lemma (in CLF) intervalPO: |
|
738 |
"[| a \<in> A; b \<in> A; interval r a b \<noteq> {} |] |
|
739 |
==> (| pset = interval r a b, order = induced (interval r a b) r |) |
|
740 |
\<in> PartialOrder" |
|
741 |
proof (neg_clausify) |
|
742 |
assume 0: "a \<in> A" |
|
743 |
assume 1: "b \<in> A" |
|
744 |
assume 2: "\<lparr>pset = interval r a b, order = induced (interval r a b) r\<rparr> \<notin> PartialOrder" |
|
745 |
have 3: "\<not> interval r a b \<subseteq> A" |
|
746 |
by (metis 2 po_subset_po) |
|
747 |
have 4: "b \<notin> A \<or> a \<notin> A" |
|
748 |
by (metis 3 interval_subset) |
|
749 |
have 5: "a \<notin> A" |
|
750 |
by (metis 4 1) |
|
751 |
show "False" |
|
752 |
by (metis 5 0) |
|
753 |
qed |
|
754 |
||
755 |
lemma (in CLF) intv_CL_lub: |
|
756 |
"[| a \<in> A; b \<in> A; interval r a b \<noteq> {} |] |
|
757 |
==> \<forall>S. S \<subseteq> interval r a b --> |
|
758 |
(\<exists>L. isLub S (| pset = interval r a b, |
|
759 |
order = induced (interval r a b) r |) L)" |
|
760 |
apply (intro strip) |
|
761 |
apply (frule S_intv_cl [THEN CL_imp_ex_isLub]) |
|
762 |
prefer 2 apply assumption |
|
763 |
apply assumption |
|
764 |
apply (erule exE) |
|
765 |
-- {* define the lub for the interval as *} |
|
766 |
apply (rule_tac x = "if S = {} then a else L" in exI) |
|
767 |
apply (simp (no_asm_simp) add: isLub_def split del: split_if) |
|
768 |
apply (intro impI conjI) |
|
769 |
-- {* @{text "(if S = {} then a else L) \<in> interval r a b"} *} |
|
770 |
apply (simp add: CL_imp_PO L_in_interval) |
|
771 |
apply (simp add: left_in_interval) |
|
772 |
-- {* lub prop 1 *} |
|
773 |
apply (case_tac "S = {}") |
|
774 |
-- {* @{text "S = {}, y \<in> S = False => everything"} *} |
|
775 |
apply fast |
|
776 |
-- {* @{text "S \<noteq> {}"} *} |
|
777 |
apply simp |
|
778 |
-- {* @{text "\<forall>y:S. (y, L) \<in> induced (interval r a b) r"} *} |
|
779 |
apply (rule ballI) |
|
780 |
apply (simp add: induced_def L_in_interval) |
|
781 |
apply (rule conjI) |
|
782 |
apply (rule subsetD) |
|
783 |
apply (simp add: S_intv_cl, assumption) |
|
784 |
apply (simp add: isLub_upper) |
|
785 |
-- {* @{text "\<forall>z:interval r a b. (\<forall>y:S. (y, z) \<in> induced (interval r a b) r \<longrightarrow> (if S = {} then a else L, z) \<in> induced (interval r a b) r"} *} |
|
786 |
apply (rule ballI) |
|
787 |
apply (rule impI) |
|
788 |
apply (case_tac "S = {}") |
|
789 |
-- {* @{text "S = {}"} *} |
|
790 |
apply simp |
|
791 |
apply (simp add: induced_def interval_def) |
|
792 |
apply (rule conjI) |
|
793 |
apply (rule reflE, assumption) |
|
794 |
apply (rule interval_not_empty) |
|
795 |
apply (rule CO_trans) |
|
796 |
apply (simp add: interval_def) |
|
797 |
-- {* @{text "S \<noteq> {}"} *} |
|
798 |
apply simp |
|
799 |
apply (simp add: induced_def L_in_interval) |
|
800 |
apply (rule isLub_least, assumption) |
|
801 |
apply (rule subsetD) |
|
802 |
prefer 2 apply assumption |
|
803 |
apply (simp add: S_intv_cl, fast) |
|
804 |
done |
|
805 |
||
806 |
lemmas (in CLF) intv_CL_glb = intv_CL_lub [THEN Rdual] |
|
807 |
||
808 |
(*never proved, 2007-01-22*) |
|
809 |
ML{*ResAtp.problem_name:="Tarski__interval_is_sublattice"*} (*ALL THEOREMS*) |
|
810 |
lemma (in CLF) interval_is_sublattice: |
|
811 |
"[| a \<in> A; b \<in> A; interval r a b \<noteq> {} |] |
|
812 |
==> interval r a b <<= cl" |
|
813 |
(*sledgehammer *) |
|
814 |
apply (rule sublatticeI) |
|
815 |
apply (simp add: interval_subset) |
|
816 |
(*never proved, 2007-01-22*) |
|
26483 | 817 |
ML_command{*ResAtp.problem_name:="Tarski__interval_is_sublattice_simpler"*} |
23449 | 818 |
(*sledgehammer *) |
819 |
apply (rule CompleteLatticeI) |
|
820 |
apply (simp add: intervalPO) |
|
821 |
apply (simp add: intv_CL_lub) |
|
822 |
apply (simp add: intv_CL_glb) |
|
823 |
done |
|
824 |
||
825 |
lemmas (in CLF) interv_is_compl_latt = |
|
826 |
interval_is_sublattice [THEN sublattice_imp_CL] |
|
827 |
||
828 |
||
829 |
subsection {* Top and Bottom *} |
|
830 |
lemma (in CLF) Top_dual_Bot: "Top cl = Bot (dual cl)" |
|
831 |
by (simp add: Top_def Bot_def least_def greatest_def dualA_iff dualr_iff) |
|
832 |
||
833 |
lemma (in CLF) Bot_dual_Top: "Bot cl = Top (dual cl)" |
|
834 |
by (simp add: Top_def Bot_def least_def greatest_def dualA_iff dualr_iff) |
|
835 |
||
26483 | 836 |
ML_command{*ResAtp.problem_name:="Tarski__Bot_in_lattice"*} (*ALL THEOREMS*) |
23449 | 837 |
lemma (in CLF) Bot_in_lattice: "Bot cl \<in> A" |
838 |
(*sledgehammer; *) |
|
839 |
apply (simp add: Bot_def least_def) |
|
840 |
apply (rule_tac a="glb A cl" in someI2) |
|
841 |
apply (simp_all add: glb_in_lattice glb_lower |
|
842 |
r_def [symmetric] A_def [symmetric]) |
|
843 |
done |
|
844 |
||
845 |
(*first proved 2007-01-25 after relaxing relevance*) |
|
26483 | 846 |
ML_command{*ResAtp.problem_name:="Tarski__Top_in_lattice"*} (*ALL THEOREMS*) |
23449 | 847 |
lemma (in CLF) Top_in_lattice: "Top cl \<in> A" |
848 |
(*sledgehammer;*) |
|
849 |
apply (simp add: Top_dual_Bot A_def) |
|
850 |
(*first proved 2007-01-25 after relaxing relevance*) |
|
26483 | 851 |
ML_command{*ResAtp.problem_name:="Tarski__Top_in_lattice_simpler"*} (*ALL THEOREMS*) |
23449 | 852 |
(*sledgehammer*) |
853 |
apply (rule dualA_iff [THEN subst]) |
|
854 |
apply (blast intro!: CLF.Bot_in_lattice dualPO CL_dualCL CLF_dual) |
|
855 |
done |
|
856 |
||
857 |
lemma (in CLF) Top_prop: "x \<in> A ==> (x, Top cl) \<in> r" |
|
858 |
apply (simp add: Top_def greatest_def) |
|
859 |
apply (rule_tac a="lub A cl" in someI2) |
|
860 |
apply (rule someI2) |
|
861 |
apply (simp_all add: lub_in_lattice lub_upper |
|
862 |
r_def [symmetric] A_def [symmetric]) |
|
863 |
done |
|
864 |
||
865 |
(*never proved, 2007-01-22*) |
|
26483 | 866 |
ML_command{*ResAtp.problem_name:="Tarski__Bot_prop"*} (*ALL THEOREMS*) |
23449 | 867 |
lemma (in CLF) Bot_prop: "x \<in> A ==> (Bot cl, x) \<in> r" |
868 |
(*sledgehammer*) |
|
869 |
apply (simp add: Bot_dual_Top r_def) |
|
870 |
apply (rule dualr_iff [THEN subst]) |
|
871 |
apply (simp add: CLF.Top_prop [of _ f] |
|
872 |
dualA_iff A_def dualPO CL_dualCL CLF_dual) |
|
873 |
done |
|
874 |
||
26483 | 875 |
ML_command{*ResAtp.problem_name:="Tarski__Bot_in_lattice"*} (*ALL THEOREMS*) |
23449 | 876 |
lemma (in CLF) Top_intv_not_empty: "x \<in> A ==> interval r x (Top cl) \<noteq> {}" |
877 |
apply (metis Top_in_lattice Top_prop empty_iff intervalI reflE) |
|
878 |
done |
|
879 |
||
26483 | 880 |
ML_command{*ResAtp.problem_name:="Tarski__Bot_intv_not_empty"*} (*ALL THEOREMS*) |
23449 | 881 |
lemma (in CLF) Bot_intv_not_empty: "x \<in> A ==> interval r (Bot cl) x \<noteq> {}" |
882 |
apply (metis Bot_prop ex_in_conv intervalI reflE rel_imp_elem) |
|
883 |
done |
|
884 |
||
885 |
||
886 |
subsection {* fixed points form a partial order *} |
|
887 |
||
888 |
lemma (in CLF) fixf_po: "(| pset = P, order = induced P r|) \<in> PartialOrder" |
|
889 |
by (simp add: P_def fix_subset po_subset_po) |
|
890 |
||
891 |
(*first proved 2007-01-25 after relaxing relevance*) |
|
26483 | 892 |
ML_command{*ResAtp.problem_name:="Tarski__Y_subset_A"*} |
23449 | 893 |
declare (in Tarski) P_def[simp] Y_ss [simp] |
894 |
declare fix_subset [intro] subset_trans [intro] |
|
895 |
lemma (in Tarski) Y_subset_A: "Y \<subseteq> A" |
|
896 |
(*sledgehammer*) |
|
897 |
apply (rule subset_trans [OF _ fix_subset]) |
|
898 |
apply (rule Y_ss [simplified P_def]) |
|
899 |
done |
|
900 |
declare (in Tarski) P_def[simp del] Y_ss [simp del] |
|
901 |
declare fix_subset [rule del] subset_trans [rule del] |
|
902 |
||
903 |
||
904 |
lemma (in Tarski) lubY_in_A: "lub Y cl \<in> A" |
|
905 |
by (rule Y_subset_A [THEN lub_in_lattice]) |
|
906 |
||
907 |
(*never proved, 2007-01-22*) |
|
26483 | 908 |
ML_command{*ResAtp.problem_name:="Tarski__lubY_le_flubY"*} (*ALL THEOREMS*) |
23449 | 909 |
lemma (in Tarski) lubY_le_flubY: "(lub Y cl, f (lub Y cl)) \<in> r" |
910 |
(*sledgehammer*) |
|
911 |
apply (rule lub_least) |
|
912 |
apply (rule Y_subset_A) |
|
913 |
apply (rule f_in_funcset [THEN funcset_mem]) |
|
914 |
apply (rule lubY_in_A) |
|
915 |
-- {* @{text "Y \<subseteq> P ==> f x = x"} *} |
|
916 |
apply (rule ballI) |
|
26483 | 917 |
ML_command{*ResAtp.problem_name:="Tarski__lubY_le_flubY_simpler"*} (*ALL THEOREMS*) |
23449 | 918 |
(*sledgehammer *) |
919 |
apply (rule_tac t = "x" in fix_imp_eq [THEN subst]) |
|
920 |
apply (erule Y_ss [simplified P_def, THEN subsetD]) |
|
921 |
-- {* @{text "reduce (f x, f (lub Y cl)) \<in> r to (x, lub Y cl) \<in> r"} by monotonicity *} |
|
26483 | 922 |
ML_command{*ResAtp.problem_name:="Tarski__lubY_le_flubY_simplest"*} (*ALL THEOREMS*) |
23449 | 923 |
(*sledgehammer*) |
924 |
apply (rule_tac f = "f" in monotoneE) |
|
925 |
apply (rule monotone_f) |
|
926 |
apply (simp add: Y_subset_A [THEN subsetD]) |
|
927 |
apply (rule lubY_in_A) |
|
928 |
apply (simp add: lub_upper Y_subset_A) |
|
929 |
done |
|
930 |
||
931 |
(*first proved 2007-01-25 after relaxing relevance*) |
|
26483 | 932 |
ML_command{*ResAtp.problem_name:="Tarski__intY1_subset"*} (*ALL THEOREMS*) |
23449 | 933 |
lemma (in Tarski) intY1_subset: "intY1 \<subseteq> A" |
934 |
(*sledgehammer*) |
|
935 |
apply (unfold intY1_def) |
|
936 |
apply (rule interval_subset) |
|
937 |
apply (rule lubY_in_A) |
|
938 |
apply (rule Top_in_lattice) |
|
939 |
done |
|
940 |
||
941 |
lemmas (in Tarski) intY1_elem = intY1_subset [THEN subsetD] |
|
942 |
||
943 |
(*never proved, 2007-01-22*) |
|
26483 | 944 |
ML_command{*ResAtp.problem_name:="Tarski__intY1_f_closed"*} (*ALL THEOREMS*) |
23449 | 945 |
lemma (in Tarski) intY1_f_closed: "x \<in> intY1 \<Longrightarrow> f x \<in> intY1" |
946 |
(*sledgehammer*) |
|
947 |
apply (simp add: intY1_def interval_def) |
|
948 |
apply (rule conjI) |
|
949 |
apply (rule transE) |
|
950 |
apply (rule lubY_le_flubY) |
|
951 |
-- {* @{text "(f (lub Y cl), f x) \<in> r"} *} |
|
26483 | 952 |
ML_command{*ResAtp.problem_name:="Tarski__intY1_f_closed_simpler"*} (*ALL THEOREMS*) |
23449 | 953 |
(*sledgehammer [has been proved before now...]*) |
954 |
apply (rule_tac f=f in monotoneE) |
|
955 |
apply (rule monotone_f) |
|
956 |
apply (rule lubY_in_A) |
|
957 |
apply (simp add: intY1_def interval_def intY1_elem) |
|
958 |
apply (simp add: intY1_def interval_def) |
|
959 |
-- {* @{text "(f x, Top cl) \<in> r"} *} |
|
960 |
apply (rule Top_prop) |
|
961 |
apply (rule f_in_funcset [THEN funcset_mem]) |
|
962 |
apply (simp add: intY1_def interval_def intY1_elem) |
|
963 |
done |
|
964 |
||
26483 | 965 |
ML_command{*ResAtp.problem_name:="Tarski__intY1_func"*} (*ALL THEOREMS*) |
27368 | 966 |
lemma (in Tarski) intY1_func: "(%x: intY1. f x) \<in> intY1 -> intY1" |
967 |
apply (rule restrict_in_funcset) |
|
968 |
apply (metis intY1_f_closed restrict_in_funcset) |
|
969 |
done |
|
23449 | 970 |
|
26483 | 971 |
ML_command{*ResAtp.problem_name:="Tarski__intY1_mono"*} (*ALL THEOREMS*) |
24855 | 972 |
lemma (in Tarski) intY1_mono: |
23449 | 973 |
"monotone (%x: intY1. f x) intY1 (induced intY1 r)" |
974 |
(*sledgehammer *) |
|
975 |
apply (auto simp add: monotone_def induced_def intY1_f_closed) |
|
976 |
apply (blast intro: intY1_elem monotone_f [THEN monotoneE]) |
|
977 |
done |
|
978 |
||
979 |
(*proof requires relaxing relevance: 2007-01-25*) |
|
26483 | 980 |
ML_command{*ResAtp.problem_name:="Tarski__intY1_is_cl"*} (*ALL THEOREMS*) |
23449 | 981 |
lemma (in Tarski) intY1_is_cl: |
982 |
"(| pset = intY1, order = induced intY1 r |) \<in> CompleteLattice" |
|
983 |
(*sledgehammer*) |
|
984 |
apply (unfold intY1_def) |
|
985 |
apply (rule interv_is_compl_latt) |
|
986 |
apply (rule lubY_in_A) |
|
987 |
apply (rule Top_in_lattice) |
|
988 |
apply (rule Top_intv_not_empty) |
|
989 |
apply (rule lubY_in_A) |
|
990 |
done |
|
991 |
||
992 |
(*never proved, 2007-01-22*) |
|
26483 | 993 |
ML_command{*ResAtp.problem_name:="Tarski__v_in_P"*} (*ALL THEOREMS*) |
23449 | 994 |
lemma (in Tarski) v_in_P: "v \<in> P" |
995 |
(*sledgehammer*) |
|
996 |
apply (unfold P_def) |
|
997 |
apply (rule_tac A = "intY1" in fixf_subset) |
|
998 |
apply (rule intY1_subset) |
|
999 |
apply (simp add: CLF.glbH_is_fixp [OF _ intY1_is_cl, simplified] |
|
1000 |
v_def CL_imp_PO intY1_is_cl CLF_def intY1_func intY1_mono) |
|
1001 |
done |
|
1002 |
||
26483 | 1003 |
ML_command{*ResAtp.problem_name:="Tarski__z_in_interval"*} (*ALL THEOREMS*) |
23449 | 1004 |
lemma (in Tarski) z_in_interval: |
1005 |
"[| z \<in> P; \<forall>y\<in>Y. (y, z) \<in> induced P r |] ==> z \<in> intY1" |
|
1006 |
(*sledgehammer *) |
|
1007 |
apply (unfold intY1_def P_def) |
|
1008 |
apply (rule intervalI) |
|
1009 |
prefer 2 |
|
1010 |
apply (erule fix_subset [THEN subsetD, THEN Top_prop]) |
|
1011 |
apply (rule lub_least) |
|
1012 |
apply (rule Y_subset_A) |
|
1013 |
apply (fast elim!: fix_subset [THEN subsetD]) |
|
1014 |
apply (simp add: induced_def) |
|
1015 |
done |
|
1016 |
||
26483 | 1017 |
ML_command{*ResAtp.problem_name:="Tarski__fz_in_int_rel"*} (*ALL THEOREMS*) |
23449 | 1018 |
lemma (in Tarski) f'z_in_int_rel: "[| z \<in> P; \<forall>y\<in>Y. (y, z) \<in> induced P r |] |
1019 |
==> ((%x: intY1. f x) z, z) \<in> induced intY1 r" |
|
26806 | 1020 |
apply (metis P_def acc_def fix_imp_eq fix_subset indI reflE restrict_apply subset_eq z_in_interval) |
23449 | 1021 |
done |
1022 |
||
1023 |
(*never proved, 2007-01-22*) |
|
26483 | 1024 |
ML_command{*ResAtp.problem_name:="Tarski__tarski_full_lemma"*} (*ALL THEOREMS*) |
23449 | 1025 |
lemma (in Tarski) tarski_full_lemma: |
1026 |
"\<exists>L. isLub Y (| pset = P, order = induced P r |) L" |
|
1027 |
apply (rule_tac x = "v" in exI) |
|
1028 |
apply (simp add: isLub_def) |
|
1029 |
-- {* @{text "v \<in> P"} *} |
|
1030 |
apply (simp add: v_in_P) |
|
1031 |
apply (rule conjI) |
|
1032 |
(*sledgehammer*) |
|
1033 |
-- {* @{text v} is lub *} |
|
1034 |
-- {* @{text "1. \<forall>y:Y. (y, v) \<in> induced P r"} *} |
|
1035 |
apply (rule ballI) |
|
1036 |
apply (simp add: induced_def subsetD v_in_P) |
|
1037 |
apply (rule conjI) |
|
1038 |
apply (erule Y_ss [THEN subsetD]) |
|
1039 |
apply (rule_tac b = "lub Y cl" in transE) |
|
1040 |
apply (rule lub_upper) |
|
1041 |
apply (rule Y_subset_A, assumption) |
|
1042 |
apply (rule_tac b = "Top cl" in interval_imp_mem) |
|
1043 |
apply (simp add: v_def) |
|
1044 |
apply (fold intY1_def) |
|
1045 |
apply (rule CL.glb_in_lattice [OF _ intY1_is_cl, simplified]) |
|
1046 |
apply (simp add: CL_imp_PO intY1_is_cl, force) |
|
1047 |
-- {* @{text v} is LEAST ub *} |
|
1048 |
apply clarify |
|
1049 |
apply (rule indI) |
|
1050 |
prefer 3 apply assumption |
|
1051 |
prefer 2 apply (simp add: v_in_P) |
|
1052 |
apply (unfold v_def) |
|
1053 |
(*never proved, 2007-01-22*) |
|
26483 | 1054 |
ML_command{*ResAtp.problem_name:="Tarski__tarski_full_lemma_simpler"*} |
23449 | 1055 |
(*sledgehammer*) |
1056 |
apply (rule indE) |
|
1057 |
apply (rule_tac [2] intY1_subset) |
|
1058 |
(*never proved, 2007-01-22*) |
|
26483 | 1059 |
ML_command{*ResAtp.problem_name:="Tarski__tarski_full_lemma_simplest"*} |
23449 | 1060 |
(*sledgehammer*) |
1061 |
apply (rule CL.glb_lower [OF _ intY1_is_cl, simplified]) |
|
1062 |
apply (simp add: CL_imp_PO intY1_is_cl) |
|
1063 |
apply force |
|
1064 |
apply (simp add: induced_def intY1_f_closed z_in_interval) |
|
1065 |
apply (simp add: P_def fix_imp_eq [of _ f A] reflE |
|
1066 |
fix_subset [of f A, THEN subsetD]) |
|
1067 |
done |
|
1068 |
||
1069 |
lemma CompleteLatticeI_simp: |
|
1070 |
"[| (| pset = A, order = r |) \<in> PartialOrder; |
|
1071 |
\<forall>S. S \<subseteq> A --> (\<exists>L. isLub S (| pset = A, order = r |) L) |] |
|
1072 |
==> (| pset = A, order = r |) \<in> CompleteLattice" |
|
1073 |
by (simp add: CompleteLatticeI Rdual) |
|
1074 |
||
1075 |
||
1076 |
(*never proved, 2007-01-22*) |
|
26483 | 1077 |
ML_command{*ResAtp.problem_name:="Tarski__Tarski_full"*} |
23449 | 1078 |
declare (in CLF) fixf_po[intro] P_def [simp] A_def [simp] r_def [simp] |
1079 |
Tarski.tarski_full_lemma [intro] cl_po [intro] cl_co [intro] |
|
1080 |
CompleteLatticeI_simp [intro] |
|
1081 |
theorem (in CLF) Tarski_full: |
|
1082 |
"(| pset = P, order = induced P r|) \<in> CompleteLattice" |
|
1083 |
(*sledgehammer*) |
|
1084 |
apply (rule CompleteLatticeI_simp) |
|
1085 |
apply (rule fixf_po, clarify) |
|
1086 |
(*never proved, 2007-01-22*) |
|
26483 | 1087 |
ML_command{*ResAtp.problem_name:="Tarski__Tarski_full_simpler"*} |
23449 | 1088 |
(*sledgehammer*) |
1089 |
apply (simp add: P_def A_def r_def) |
|
1090 |
apply (blast intro!: Tarski.tarski_full_lemma cl_po cl_co f_cl) |
|
1091 |
done |
|
1092 |
declare (in CLF) fixf_po[rule del] P_def [simp del] A_def [simp del] r_def [simp del] |
|
1093 |
Tarski.tarski_full_lemma [rule del] cl_po [rule del] cl_co [rule del] |
|
1094 |
CompleteLatticeI_simp [rule del] |
|
1095 |
||
1096 |
||
1097 |
end |