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