| author | wenzelm | 
| Fri, 29 Oct 2010 11:49:56 +0200 | |
| changeset 40255 | 9ffbc25e1606 | 
| parent 38991 | 0e2798f30087 | 
| child 41141 | ad923cdd4a5d | 
| 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.*) | |
| 38991 | 412 | declare [[ sledgehammer_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*) | |
| 38991 | 429 | declare [[ sledgehammer_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*) | |
| 38991 | 457 | declare [[ sledgehammer_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*) | |
| 38991 | 467 | using [[ sledgehammer_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*) | |
| 38991 | 485 | declare [[ sledgehammer_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) | |
| 38991 | 495 | using [[ sledgehammer_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*) | |
| 38991 | 509 | declare [[ sledgehammer_problem_prefix = "Tarski__CLF_lubH_is_fixp" ]] | 
| 37622 | 510 | (* Single-step version fails. The conjecture clauses refer to local abstraction | 
| 511 | functions (Frees). *) | |
| 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) | |
| 36554 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 516 | proof - | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 517 |   assume A1: "H = {x. (x, f x) \<in> r \<and> x \<in> A}"
 | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 518 | have F1: "\<forall>x\<^isub>2. (\<lambda>R. R \<in> x\<^isub>2) = x\<^isub>2" by (metis Collect_def Collect_mem_eq) | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 519 | have F2: "\<forall>x\<^isub>1 x\<^isub>2. (\<lambda>R. x\<^isub>2 (x\<^isub>1 R)) = x\<^isub>1 -` x\<^isub>2" | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 520 | by (metis Collect_def vimage_Collect_eq) | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 521 | have F3: "\<forall>x\<^isub>2 x\<^isub>1. (\<lambda>R. x\<^isub>1 R \<in> x\<^isub>2) = x\<^isub>1 -` x\<^isub>2" | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 522 | by (metis Collect_def vimage_def) | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 523 | have F4: "\<forall>x\<^isub>3 x\<^isub>1. (\<lambda>R. x\<^isub>1 R \<and> x\<^isub>3 R) = x\<^isub>1 \<inter> x\<^isub>3" | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 524 | by (metis Collect_def Collect_conj_eq) | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 525 | have F5: "(\<lambda>R. (R, f R) \<in> r \<and> R \<in> A) = H" using A1 by (metis Collect_def) | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 526 | have F6: "\<forall>x\<^isub>1\<subseteq>A. glb x\<^isub>1 (dual cl) \<in> A" by (metis lub_dual_glb lub_in_lattice) | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 527 | have F7: "\<forall>x\<^isub>2 x\<^isub>1. (\<lambda>R. x\<^isub>1 R \<in> x\<^isub>2) = (\<lambda>R. x\<^isub>2 (x\<^isub>1 R))" by (metis F2 F3) | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 528 | have "(\<lambda>R. (R, f R) \<in> r \<and> A R) = H" by (metis F1 F5) | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 529 | hence "A \<inter> (\<lambda>R. r (R, f R)) = H" by (metis F4 F7 Int_commute) | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 530 | hence "H \<subseteq> A" by (metis Int_lower1) | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 531 | hence "H \<subseteq> A" by metis | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 532 | hence "glb H (dual cl) \<in> A" using F6 by metis | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 533 | hence "glb (\<lambda>R. (R, f R) \<in> r \<and> R \<in> A) (dual cl) \<in> A" using F5 by metis | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 534 | hence "lub (\<lambda>R. (R, f R) \<in> r \<and> R \<in> A) cl \<in> A" by (metis lub_dual_glb) | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 535 |   thus "lub {x. (x, f x) \<in> r \<and> x \<in> A} cl \<in> A" by (metis Collect_def)
 | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 536 | next | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 537 |   assume A1: "H = {x. (x, f x) \<in> r \<and> x \<in> A}"
 | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 538 | have F1: "\<forall>v. (\<lambda>R. R \<in> v) = v" by (metis Collect_mem_eq Collect_def) | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 539 | have F2: "\<forall>w u. (\<lambda>R. u R \<and> w R) = u \<inter> w" | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 540 | by (metis Collect_conj_eq Collect_def) | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 541 | have F3: "\<forall>x v. (\<lambda>R. v R \<in> x) = v -` x" by (metis vimage_def Collect_def) | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 542 | hence F4: "A \<inter> (\<lambda>R. (R, f R)) -` r = H" using A1 by auto | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 543 | hence F5: "(f (lub H cl), lub H cl) \<in> r" | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 544 | by (metis F1 F3 F2 Int_commute flubH_le_lubH Collect_def) | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 545 | have F6: "(lub H cl, f (lub H cl)) \<in> r" | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 546 | by (metis F1 F3 F2 F4 Int_commute lubH_le_flubH Collect_def) | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 547 | have "(lub H cl, f (lub H cl)) \<in> r \<longrightarrow> f (lub H cl) = lub H cl" | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 548 | using F5 by (metis antisymE) | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 549 | hence "f (lub H cl) = lub H cl" using F6 by metis | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 550 |   thus "H = {x. (x, f x) \<in> r \<and> x \<in> A}
 | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 551 |         \<Longrightarrow> f (lub {x. (x, f x) \<in> r \<and> x \<in> A} cl) =
 | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 552 |            lub {x. (x, f x) \<in> r \<and> x \<in> A} cl"
 | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 553 | by (metis F4 F2 F3 F1 Collect_def Int_commute) | 
| 24827 | 554 | qed | 
| 23449 | 555 | |
| 25710 
4cdf7de81e1b
Replaced refs by config params; finer critical section in mets method
 paulson parents: 
24855diff
changeset | 556 | lemma (in CLF) (*lubH_is_fixp:*) | 
| 23449 | 557 |      "H = {x. (x, f x) \<in> r & x \<in> A} ==> lub H cl \<in> fix f A"
 | 
| 558 | apply (simp add: fix_def) | |
| 559 | apply (rule conjI) | |
| 38991 | 560 | using [[ sledgehammer_problem_prefix = "Tarski__CLF_lubH_is_fixp_simpler" ]] | 
| 30198 | 561 | apply (metis CO_refl_on lubH_le_flubH refl_onD1) | 
| 23449 | 562 | apply (metis antisymE flubH_le_lubH lubH_le_flubH) | 
| 563 | done | |
| 564 | ||
| 565 | lemma (in CLF) fix_in_H: | |
| 566 |      "[| H = {x. (x, f x) \<in> r & x \<in> A};  x \<in> P |] ==> x \<in> H"
 | |
| 30198 | 567 | by (simp add: P_def fix_imp_eq [of _ f A] reflE CO_refl_on | 
| 23449 | 568 | fix_subset [of f A, THEN subsetD]) | 
| 569 | ||
| 570 | ||
| 571 | lemma (in CLF) fixf_le_lubH: | |
| 572 |      "H = {x. (x, f x) \<in> r & x \<in> A} ==> \<forall>x \<in> fix f A. (x, lub H cl) \<in> r"
 | |
| 573 | apply (rule ballI) | |
| 574 | apply (rule lub_upper, fast) | |
| 575 | apply (rule fix_in_H) | |
| 576 | apply (simp_all add: P_def) | |
| 577 | done | |
| 578 | ||
| 38991 | 579 | declare [[ sledgehammer_problem_prefix = "Tarski__CLF_lubH_least_fixf" ]] | 
| 23449 | 580 | lemma (in CLF) lubH_least_fixf: | 
| 581 |      "H = {x. (x, f x) \<in> r & x \<in> A}
 | |
| 582 | ==> \<forall>L. (\<forall>y \<in> fix f A. (y,L) \<in> r) --> (lub H cl, L) \<in> r" | |
| 583 | apply (metis P_def lubH_is_fixp) | |
| 584 | done | |
| 585 | ||
| 586 | subsection {* Tarski fixpoint theorem 1, first part *}
 | |
| 38991 | 587 | declare [[ sledgehammer_problem_prefix = "Tarski__CLF_T_thm_1_lub" ]] | 
| 23449 | 588 | declare CL.lubI[intro] fix_subset[intro] CL.lub_in_lattice[intro] | 
| 589 | CLF.fixf_le_lubH[simp] CLF.lubH_least_fixf[simp] | |
| 590 | lemma (in CLF) T_thm_1_lub: "lub P cl = lub {x. (x, f x) \<in> r & x \<in> A} cl"
 | |
| 591 | (*sledgehammer;*) | |
| 592 | apply (rule sym) | |
| 593 | apply (simp add: P_def) | |
| 594 | apply (rule lubI) | |
| 38991 | 595 | using [[ sledgehammer_problem_prefix = "Tarski__CLF_T_thm_1_lub_simpler" ]] | 
| 24855 | 596 | apply (metis P_def fix_subset) | 
| 24827 | 597 | apply (metis Collect_conj_eq Collect_mem_eq Int_commute Int_lower1 lub_in_lattice vimage_def) | 
| 598 | (*??no longer terminates, with combinators | |
| 599 | apply (metis P_def fix_def fixf_le_lubH) | |
| 600 | apply (metis P_def fix_def lubH_least_fixf) | |
| 601 | *) | |
| 602 | apply (simp add: fixf_le_lubH) | |
| 603 | apply (simp add: lubH_least_fixf) | |
| 23449 | 604 | done | 
| 605 | declare CL.lubI[rule del] fix_subset[rule del] CL.lub_in_lattice[rule del] | |
| 606 | CLF.fixf_le_lubH[simp del] CLF.lubH_least_fixf[simp del] | |
| 607 | ||
| 608 | ||
| 609 | (*never proved, 2007-01-22*) | |
| 38991 | 610 | declare [[ sledgehammer_problem_prefix = "Tarski__CLF_glbH_is_fixp" ]] | 
| 23449 | 611 | declare glb_dual_lub[simp] PO.dualA_iff[intro] CLF.lubH_is_fixp[intro] | 
| 612 | PO.dualPO[intro] CL.CL_dualCL[intro] PO.dualr_iff[simp] | |
| 613 | lemma (in CLF) glbH_is_fixp: "H = {x. (f x, x) \<in> r & x \<in> A} ==> glb H cl \<in> P"
 | |
| 614 |   -- {* Tarski for glb *}
 | |
| 615 | (*sledgehammer;*) | |
| 616 | apply (simp add: glb_dual_lub P_def A_def r_def) | |
| 617 | apply (rule dualA_iff [THEN subst]) | |
| 618 | apply (rule CLF.lubH_is_fixp) | |
| 27681 | 619 | apply (rule CLF.intro) | 
| 620 | apply (rule CL.intro) | |
| 621 | apply (rule PO.intro) | |
| 23449 | 622 | apply (rule dualPO) | 
| 27681 | 623 | apply (rule CL_axioms.intro) | 
| 23449 | 624 | apply (rule CL_dualCL) | 
| 27681 | 625 | apply (rule CLF_axioms.intro) | 
| 23449 | 626 | apply (rule CLF_dual) | 
| 627 | apply (simp add: dualr_iff dualA_iff) | |
| 628 | done | |
| 629 | declare glb_dual_lub[simp del] PO.dualA_iff[rule del] CLF.lubH_is_fixp[rule del] | |
| 630 | PO.dualPO[rule del] CL.CL_dualCL[rule del] PO.dualr_iff[simp del] | |
| 631 | ||
| 632 | ||
| 633 | (*never proved, 2007-01-22*) | |
| 38991 | 634 | declare [[ sledgehammer_problem_prefix = "Tarski__T_thm_1_glb" ]] (*ALL THEOREMS*) | 
| 23449 | 635 | lemma (in CLF) T_thm_1_glb: "glb P cl = glb {x. (f x, x) \<in> r & x \<in> A} cl"
 | 
| 636 | (*sledgehammer;*) | |
| 637 | apply (simp add: glb_dual_lub P_def A_def r_def) | |
| 638 | apply (rule dualA_iff [THEN subst]) | |
| 639 | (*never proved, 2007-01-22*) | |
| 38991 | 640 | using [[ sledgehammer_problem_prefix = "Tarski__T_thm_1_glb_simpler" ]] (*ALL THEOREMS*) | 
| 23449 | 641 | (*sledgehammer;*) | 
| 27681 | 642 | 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, | 
| 643 | OF dualPO CL_dualCL] dualPO CL_dualCL CLF_dual dualr_iff) | |
| 23449 | 644 | done | 
| 645 | ||
| 646 | subsection {* interval *}
 | |
| 647 | ||
| 648 | ||
| 38991 | 649 | declare [[ sledgehammer_problem_prefix = "Tarski__rel_imp_elem" ]] | 
| 30198 | 650 | declare (in CLF) CO_refl_on[simp] refl_on_def [simp] | 
| 23449 | 651 | lemma (in CLF) rel_imp_elem: "(x, y) \<in> r ==> x \<in> A" | 
| 30198 | 652 | by (metis CO_refl_on refl_onD1) | 
| 653 | declare (in CLF) CO_refl_on[simp del] refl_on_def [simp del] | |
| 23449 | 654 | |
| 38991 | 655 | declare [[ sledgehammer_problem_prefix = "Tarski__interval_subset" ]] | 
| 23449 | 656 | declare (in CLF) rel_imp_elem[intro] | 
| 657 | declare interval_def [simp] | |
| 658 | lemma (in CLF) interval_subset: "[| a \<in> A; b \<in> A |] ==> interval r a b \<subseteq> A" | |
| 30198 | 659 | by (metis CO_refl_on interval_imp_mem refl_onD refl_onD2 rel_imp_elem subset_eq) | 
| 23449 | 660 | declare (in CLF) rel_imp_elem[rule del] | 
| 661 | declare interval_def [simp del] | |
| 662 | ||
| 663 | ||
| 664 | lemma (in CLF) intervalI: | |
| 665 | "[| (a, x) \<in> r; (x, b) \<in> r |] ==> x \<in> interval r a b" | |
| 666 | by (simp add: interval_def) | |
| 667 | ||
| 668 | lemma (in CLF) interval_lemma1: | |
| 669 | "[| S \<subseteq> interval r a b; x \<in> S |] ==> (a, x) \<in> r" | |
| 670 | by (unfold interval_def, fast) | |
| 671 | ||
| 672 | lemma (in CLF) interval_lemma2: | |
| 673 | "[| S \<subseteq> interval r a b; x \<in> S |] ==> (x, b) \<in> r" | |
| 674 | by (unfold interval_def, fast) | |
| 675 | ||
| 676 | lemma (in CLF) a_less_lub: | |
| 677 |      "[| S \<subseteq> A; S \<noteq> {};
 | |
| 678 | \<forall>x \<in> S. (a,x) \<in> r; \<forall>y \<in> S. (y, L) \<in> r |] ==> (a,L) \<in> r" | |
| 679 | by (blast intro: transE) | |
| 680 | ||
| 681 | lemma (in CLF) glb_less_b: | |
| 682 |      "[| S \<subseteq> A; S \<noteq> {};
 | |
| 683 | \<forall>x \<in> S. (x,b) \<in> r; \<forall>y \<in> S. (G, y) \<in> r |] ==> (G,b) \<in> r" | |
| 684 | by (blast intro: transE) | |
| 685 | ||
| 686 | lemma (in CLF) S_intv_cl: | |
| 687 | "[| a \<in> A; b \<in> A; S \<subseteq> interval r a b |]==> S \<subseteq> A" | |
| 688 | by (simp add: subset_trans [OF _ interval_subset]) | |
| 689 | ||
| 38991 | 690 | declare [[ sledgehammer_problem_prefix = "Tarski__L_in_interval" ]] (*ALL THEOREMS*) | 
| 23449 | 691 | lemma (in CLF) L_in_interval: | 
| 692 | "[| a \<in> A; b \<in> A; S \<subseteq> interval r a b; | |
| 693 |          S \<noteq> {}; isLub S cl L; interval r a b \<noteq> {} |] ==> L \<in> interval r a b" 
 | |
| 694 | (*WON'T TERMINATE | |
| 695 | apply (metis CO_trans intervalI interval_lemma1 interval_lemma2 isLub_least isLub_upper subset_empty subset_iff trans_def) | |
| 696 | *) | |
| 697 | apply (rule intervalI) | |
| 698 | apply (rule a_less_lub) | |
| 699 | prefer 2 apply assumption | |
| 700 | apply (simp add: S_intv_cl) | |
| 701 | apply (rule ballI) | |
| 702 | apply (simp add: interval_lemma1) | |
| 703 | apply (simp add: isLub_upper) | |
| 704 | -- {* @{text "(L, b) \<in> r"} *}
 | |
| 705 | apply (simp add: isLub_least interval_lemma2) | |
| 706 | done | |
| 707 | ||
| 708 | (*never proved, 2007-01-22*) | |
| 38991 | 709 | declare [[ sledgehammer_problem_prefix = "Tarski__G_in_interval" ]] (*ALL THEOREMS*) | 
| 23449 | 710 | lemma (in CLF) G_in_interval: | 
| 711 |      "[| a \<in> A; b \<in> A; interval r a b \<noteq> {}; S \<subseteq> interval r a b; isGlb S cl G;
 | |
| 712 |          S \<noteq> {} |] ==> G \<in> interval r a b"
 | |
| 713 | apply (simp add: interval_dual) | |
| 27681 | 714 | 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 | 715 | dualA_iff A_def dualPO CL_dualCL CLF_dual isGlb_dual_isLub) | 
| 716 | done | |
| 717 | ||
| 38991 | 718 | declare [[ sledgehammer_problem_prefix = "Tarski__intervalPO" ]] (*ALL THEOREMS*) | 
| 23449 | 719 | lemma (in CLF) intervalPO: | 
| 720 |      "[| a \<in> A; b \<in> A; interval r a b \<noteq> {} |]
 | |
| 721 | ==> (| pset = interval r a b, order = induced (interval r a b) r |) | |
| 722 | \<in> PartialOrder" | |
| 36554 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 723 | proof - | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 724 | assume A1: "a \<in> A" | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 725 | assume "b \<in> A" | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 726 | hence "\<forall>u. u \<in> A \<longrightarrow> interval r u b \<subseteq> A" by (metis interval_subset) | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 727 | hence "interval r a b \<subseteq> A" using A1 by metis | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 728 | hence "interval r a b \<subseteq> A" by metis | 
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 729 | thus ?thesis by (metis po_subset_po) | 
| 23449 | 730 | qed | 
| 731 | ||
| 732 | lemma (in CLF) intv_CL_lub: | |
| 733 |  "[| a \<in> A; b \<in> A; interval r a b \<noteq> {} |]
 | |
| 734 | ==> \<forall>S. S \<subseteq> interval r a b --> | |
| 735 | (\<exists>L. isLub S (| pset = interval r a b, | |
| 736 | order = induced (interval r a b) r |) L)" | |
| 737 | apply (intro strip) | |
| 738 | apply (frule S_intv_cl [THEN CL_imp_ex_isLub]) | |
| 739 | prefer 2 apply assumption | |
| 740 | apply assumption | |
| 741 | apply (erule exE) | |
| 742 | -- {* define the lub for the interval as *}
 | |
| 743 | apply (rule_tac x = "if S = {} then a else L" in exI)
 | |
| 744 | apply (simp (no_asm_simp) add: isLub_def split del: split_if) | |
| 745 | apply (intro impI conjI) | |
| 746 | -- {* @{text "(if S = {} then a else L) \<in> interval r a b"} *}
 | |
| 747 | apply (simp add: CL_imp_PO L_in_interval) | |
| 748 | apply (simp add: left_in_interval) | |
| 749 | -- {* lub prop 1 *}
 | |
| 750 | apply (case_tac "S = {}")
 | |
| 751 | -- {* @{text "S = {}, y \<in> S = False => everything"} *}
 | |
| 752 | apply fast | |
| 753 | -- {* @{text "S \<noteq> {}"} *}
 | |
| 754 | apply simp | |
| 755 | -- {* @{text "\<forall>y:S. (y, L) \<in> induced (interval r a b) r"} *}
 | |
| 756 | apply (rule ballI) | |
| 757 | apply (simp add: induced_def L_in_interval) | |
| 758 | apply (rule conjI) | |
| 759 | apply (rule subsetD) | |
| 760 | apply (simp add: S_intv_cl, assumption) | |
| 761 | apply (simp add: isLub_upper) | |
| 762 | -- {* @{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"} *}
 | |
| 763 | apply (rule ballI) | |
| 764 | apply (rule impI) | |
| 765 | apply (case_tac "S = {}")
 | |
| 766 | -- {* @{text "S = {}"} *}
 | |
| 767 | apply simp | |
| 768 | apply (simp add: induced_def interval_def) | |
| 769 | apply (rule conjI) | |
| 770 | apply (rule reflE, assumption) | |
| 771 | apply (rule interval_not_empty) | |
| 772 | apply (rule CO_trans) | |
| 773 | apply (simp add: interval_def) | |
| 774 | -- {* @{text "S \<noteq> {}"} *}
 | |
| 775 | apply simp | |
| 776 | apply (simp add: induced_def L_in_interval) | |
| 777 | apply (rule isLub_least, assumption) | |
| 778 | apply (rule subsetD) | |
| 779 | prefer 2 apply assumption | |
| 780 | apply (simp add: S_intv_cl, fast) | |
| 781 | done | |
| 782 | ||
| 783 | lemmas (in CLF) intv_CL_glb = intv_CL_lub [THEN Rdual] | |
| 784 | ||
| 785 | (*never proved, 2007-01-22*) | |
| 38991 | 786 | declare [[ sledgehammer_problem_prefix = "Tarski__interval_is_sublattice" ]] (*ALL THEOREMS*) | 
| 23449 | 787 | lemma (in CLF) interval_is_sublattice: | 
| 788 |      "[| a \<in> A; b \<in> A; interval r a b \<noteq> {} |]
 | |
| 789 | ==> interval r a b <<= cl" | |
| 790 | (*sledgehammer *) | |
| 791 | apply (rule sublatticeI) | |
| 792 | apply (simp add: interval_subset) | |
| 793 | (*never proved, 2007-01-22*) | |
| 38991 | 794 | using [[ sledgehammer_problem_prefix = "Tarski__interval_is_sublattice_simpler" ]] | 
| 23449 | 795 | (*sledgehammer *) | 
| 796 | apply (rule CompleteLatticeI) | |
| 797 | apply (simp add: intervalPO) | |
| 798 | apply (simp add: intv_CL_lub) | |
| 799 | apply (simp add: intv_CL_glb) | |
| 800 | done | |
| 801 | ||
| 802 | lemmas (in CLF) interv_is_compl_latt = | |
| 803 | interval_is_sublattice [THEN sublattice_imp_CL] | |
| 804 | ||
| 805 | ||
| 806 | subsection {* Top and Bottom *}
 | |
| 807 | lemma (in CLF) Top_dual_Bot: "Top cl = Bot (dual cl)" | |
| 808 | by (simp add: Top_def Bot_def least_def greatest_def dualA_iff dualr_iff) | |
| 809 | ||
| 810 | lemma (in CLF) Bot_dual_Top: "Bot cl = Top (dual cl)" | |
| 811 | by (simp add: Top_def Bot_def least_def greatest_def dualA_iff dualr_iff) | |
| 812 | ||
| 38991 | 813 | declare [[ sledgehammer_problem_prefix = "Tarski__Bot_in_lattice" ]] (*ALL THEOREMS*) | 
| 23449 | 814 | lemma (in CLF) Bot_in_lattice: "Bot cl \<in> A" | 
| 815 | (*sledgehammer; *) | |
| 816 | apply (simp add: Bot_def least_def) | |
| 817 | apply (rule_tac a="glb A cl" in someI2) | |
| 818 | apply (simp_all add: glb_in_lattice glb_lower | |
| 819 | r_def [symmetric] A_def [symmetric]) | |
| 820 | done | |
| 821 | ||
| 822 | (*first proved 2007-01-25 after relaxing relevance*) | |
| 38991 | 823 | declare [[ sledgehammer_problem_prefix = "Tarski__Top_in_lattice" ]] (*ALL THEOREMS*) | 
| 23449 | 824 | lemma (in CLF) Top_in_lattice: "Top cl \<in> A" | 
| 825 | (*sledgehammer;*) | |
| 826 | apply (simp add: Top_dual_Bot A_def) | |
| 827 | (*first proved 2007-01-25 after relaxing relevance*) | |
| 38991 | 828 | using [[ sledgehammer_problem_prefix = "Tarski__Top_in_lattice_simpler" ]] (*ALL THEOREMS*) | 
| 23449 | 829 | (*sledgehammer*) | 
| 830 | apply (rule dualA_iff [THEN subst]) | |
| 27681 | 831 | 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 | 832 | done | 
| 833 | ||
| 834 | lemma (in CLF) Top_prop: "x \<in> A ==> (x, Top cl) \<in> r" | |
| 835 | apply (simp add: Top_def greatest_def) | |
| 836 | apply (rule_tac a="lub A cl" in someI2) | |
| 837 | apply (rule someI2) | |
| 838 | apply (simp_all add: lub_in_lattice lub_upper | |
| 839 | r_def [symmetric] A_def [symmetric]) | |
| 840 | done | |
| 841 | ||
| 842 | (*never proved, 2007-01-22*) | |
| 38991 | 843 | declare [[ sledgehammer_problem_prefix = "Tarski__Bot_prop" ]] (*ALL THEOREMS*) | 
| 23449 | 844 | lemma (in CLF) Bot_prop: "x \<in> A ==> (Bot cl, x) \<in> r" | 
| 845 | (*sledgehammer*) | |
| 846 | apply (simp add: Bot_dual_Top r_def) | |
| 847 | apply (rule dualr_iff [THEN subst]) | |
| 27681 | 848 | apply (simp add: CLF.Top_prop [of _ f, OF CLF.intro, OF CL.intro CLF_axioms.intro, OF PO.intro CL_axioms.intro] | 
| 23449 | 849 | dualA_iff A_def dualPO CL_dualCL CLF_dual) | 
| 850 | done | |
| 851 | ||
| 38991 | 852 | declare [[ sledgehammer_problem_prefix = "Tarski__Bot_in_lattice" ]] (*ALL THEOREMS*) | 
| 23449 | 853 | lemma (in CLF) Top_intv_not_empty: "x \<in> A  ==> interval r x (Top cl) \<noteq> {}" 
 | 
| 854 | apply (metis Top_in_lattice Top_prop empty_iff intervalI reflE) | |
| 855 | done | |
| 856 | ||
| 38991 | 857 | declare [[ sledgehammer_problem_prefix = "Tarski__Bot_intv_not_empty" ]] (*ALL THEOREMS*) | 
| 23449 | 858 | lemma (in CLF) Bot_intv_not_empty: "x \<in> A ==> interval r (Bot cl) x \<noteq> {}" 
 | 
| 859 | apply (metis Bot_prop ex_in_conv intervalI reflE rel_imp_elem) | |
| 860 | done | |
| 861 | ||
| 862 | ||
| 863 | subsection {* fixed points form a partial order *}
 | |
| 864 | ||
| 865 | lemma (in CLF) fixf_po: "(| pset = P, order = induced P r|) \<in> PartialOrder" | |
| 866 | by (simp add: P_def fix_subset po_subset_po) | |
| 867 | ||
| 868 | (*first proved 2007-01-25 after relaxing relevance*) | |
| 38991 | 869 | declare [[ sledgehammer_problem_prefix = "Tarski__Y_subset_A" ]] | 
| 23449 | 870 | declare (in Tarski) P_def[simp] Y_ss [simp] | 
| 871 | declare fix_subset [intro] subset_trans [intro] | |
| 872 | lemma (in Tarski) Y_subset_A: "Y \<subseteq> A" | |
| 873 | (*sledgehammer*) | |
| 874 | apply (rule subset_trans [OF _ fix_subset]) | |
| 875 | apply (rule Y_ss [simplified P_def]) | |
| 876 | done | |
| 877 | declare (in Tarski) P_def[simp del] Y_ss [simp del] | |
| 878 | declare fix_subset [rule del] subset_trans [rule del] | |
| 879 | ||
| 880 | ||
| 881 | lemma (in Tarski) lubY_in_A: "lub Y cl \<in> A" | |
| 882 | by (rule Y_subset_A [THEN lub_in_lattice]) | |
| 883 | ||
| 884 | (*never proved, 2007-01-22*) | |
| 38991 | 885 | declare [[ sledgehammer_problem_prefix = "Tarski__lubY_le_flubY" ]] (*ALL THEOREMS*) | 
| 23449 | 886 | lemma (in Tarski) lubY_le_flubY: "(lub Y cl, f (lub Y cl)) \<in> r" | 
| 887 | (*sledgehammer*) | |
| 888 | apply (rule lub_least) | |
| 889 | apply (rule Y_subset_A) | |
| 890 | apply (rule f_in_funcset [THEN funcset_mem]) | |
| 891 | apply (rule lubY_in_A) | |
| 892 | -- {* @{text "Y \<subseteq> P ==> f x = x"} *}
 | |
| 893 | apply (rule ballI) | |
| 38991 | 894 | using [[ sledgehammer_problem_prefix = "Tarski__lubY_le_flubY_simpler" ]] (*ALL THEOREMS*) | 
| 23449 | 895 | (*sledgehammer *) | 
| 896 | apply (rule_tac t = "x" in fix_imp_eq [THEN subst]) | |
| 897 | apply (erule Y_ss [simplified P_def, THEN subsetD]) | |
| 898 | -- {* @{text "reduce (f x, f (lub Y cl)) \<in> r to (x, lub Y cl) \<in> r"} by monotonicity *}
 | |
| 38991 | 899 | using [[ sledgehammer_problem_prefix = "Tarski__lubY_le_flubY_simplest" ]] (*ALL THEOREMS*) | 
| 23449 | 900 | (*sledgehammer*) | 
| 901 | apply (rule_tac f = "f" in monotoneE) | |
| 902 | apply (rule monotone_f) | |
| 903 | apply (simp add: Y_subset_A [THEN subsetD]) | |
| 904 | apply (rule lubY_in_A) | |
| 905 | apply (simp add: lub_upper Y_subset_A) | |
| 906 | done | |
| 907 | ||
| 908 | (*first proved 2007-01-25 after relaxing relevance*) | |
| 38991 | 909 | declare [[ sledgehammer_problem_prefix = "Tarski__intY1_subset" ]] (*ALL THEOREMS*) | 
| 23449 | 910 | lemma (in Tarski) intY1_subset: "intY1 \<subseteq> A" | 
| 911 | (*sledgehammer*) | |
| 912 | apply (unfold intY1_def) | |
| 913 | apply (rule interval_subset) | |
| 914 | apply (rule lubY_in_A) | |
| 915 | apply (rule Top_in_lattice) | |
| 916 | done | |
| 917 | ||
| 918 | lemmas (in Tarski) intY1_elem = intY1_subset [THEN subsetD] | |
| 919 | ||
| 920 | (*never proved, 2007-01-22*) | |
| 38991 | 921 | declare [[ sledgehammer_problem_prefix = "Tarski__intY1_f_closed" ]] (*ALL THEOREMS*) | 
| 23449 | 922 | lemma (in Tarski) intY1_f_closed: "x \<in> intY1 \<Longrightarrow> f x \<in> intY1" | 
| 923 | (*sledgehammer*) | |
| 924 | apply (simp add: intY1_def interval_def) | |
| 925 | apply (rule conjI) | |
| 926 | apply (rule transE) | |
| 927 | apply (rule lubY_le_flubY) | |
| 928 | -- {* @{text "(f (lub Y cl), f x) \<in> r"} *}
 | |
| 38991 | 929 | using [[ sledgehammer_problem_prefix = "Tarski__intY1_f_closed_simpler" ]] (*ALL THEOREMS*) | 
| 23449 | 930 | (*sledgehammer [has been proved before now...]*) | 
| 931 | apply (rule_tac f=f in monotoneE) | |
| 932 | apply (rule monotone_f) | |
| 933 | apply (rule lubY_in_A) | |
| 934 | apply (simp add: intY1_def interval_def intY1_elem) | |
| 935 | apply (simp add: intY1_def interval_def) | |
| 936 | -- {* @{text "(f x, Top cl) \<in> r"} *} 
 | |
| 937 | apply (rule Top_prop) | |
| 938 | apply (rule f_in_funcset [THEN funcset_mem]) | |
| 939 | apply (simp add: intY1_def interval_def intY1_elem) | |
| 940 | done | |
| 941 | ||
| 38991 | 942 | declare [[ sledgehammer_problem_prefix = "Tarski__intY1_func" ]] (*ALL THEOREMS*) | 
| 27368 | 943 | lemma (in Tarski) intY1_func: "(%x: intY1. f x) \<in> intY1 -> intY1" | 
| 944 | apply (rule restrict_in_funcset) | |
| 945 | apply (metis intY1_f_closed restrict_in_funcset) | |
| 946 | done | |
| 23449 | 947 | |
| 38991 | 948 | declare [[ sledgehammer_problem_prefix = "Tarski__intY1_mono" ]] (*ALL THEOREMS*) | 
| 24855 | 949 | lemma (in Tarski) intY1_mono: | 
| 23449 | 950 | "monotone (%x: intY1. f x) intY1 (induced intY1 r)" | 
| 951 | (*sledgehammer *) | |
| 952 | apply (auto simp add: monotone_def induced_def intY1_f_closed) | |
| 953 | apply (blast intro: intY1_elem monotone_f [THEN monotoneE]) | |
| 954 | done | |
| 955 | ||
| 956 | (*proof requires relaxing relevance: 2007-01-25*) | |
| 38991 | 957 | declare [[ sledgehammer_problem_prefix = "Tarski__intY1_is_cl" ]] (*ALL THEOREMS*) | 
| 23449 | 958 | lemma (in Tarski) intY1_is_cl: | 
| 959 | "(| pset = intY1, order = induced intY1 r |) \<in> CompleteLattice" | |
| 960 | (*sledgehammer*) | |
| 961 | apply (unfold intY1_def) | |
| 962 | apply (rule interv_is_compl_latt) | |
| 963 | apply (rule lubY_in_A) | |
| 964 | apply (rule Top_in_lattice) | |
| 965 | apply (rule Top_intv_not_empty) | |
| 966 | apply (rule lubY_in_A) | |
| 967 | done | |
| 968 | ||
| 969 | (*never proved, 2007-01-22*) | |
| 38991 | 970 | declare [[ sledgehammer_problem_prefix = "Tarski__v_in_P" ]] (*ALL THEOREMS*) | 
| 23449 | 971 | lemma (in Tarski) v_in_P: "v \<in> P" | 
| 972 | (*sledgehammer*) | |
| 973 | apply (unfold P_def) | |
| 974 | apply (rule_tac A = "intY1" in fixf_subset) | |
| 975 | apply (rule intY1_subset) | |
| 27681 | 976 | 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] | 
| 977 | v_def CL_imp_PO intY1_is_cl CLF_set_def intY1_func intY1_mono) | |
| 23449 | 978 | done | 
| 979 | ||
| 38991 | 980 | declare [[ sledgehammer_problem_prefix = "Tarski__z_in_interval" ]] (*ALL THEOREMS*) | 
| 23449 | 981 | lemma (in Tarski) z_in_interval: | 
| 982 | "[| z \<in> P; \<forall>y\<in>Y. (y, z) \<in> induced P r |] ==> z \<in> intY1" | |
| 983 | (*sledgehammer *) | |
| 984 | apply (unfold intY1_def P_def) | |
| 985 | apply (rule intervalI) | |
| 986 | prefer 2 | |
| 987 | apply (erule fix_subset [THEN subsetD, THEN Top_prop]) | |
| 988 | apply (rule lub_least) | |
| 989 | apply (rule Y_subset_A) | |
| 990 | apply (fast elim!: fix_subset [THEN subsetD]) | |
| 991 | apply (simp add: induced_def) | |
| 992 | done | |
| 993 | ||
| 38991 | 994 | declare [[ sledgehammer_problem_prefix = "Tarski__fz_in_int_rel" ]] (*ALL THEOREMS*) | 
| 23449 | 995 | lemma (in Tarski) f'z_in_int_rel: "[| z \<in> P; \<forall>y\<in>Y. (y, z) \<in> induced P r |] | 
| 996 | ==> ((%x: intY1. f x) z, z) \<in> induced intY1 r" | |
| 26806 | 997 | apply (metis P_def acc_def fix_imp_eq fix_subset indI reflE restrict_apply subset_eq z_in_interval) | 
| 23449 | 998 | done | 
| 999 | ||
| 1000 | (*never proved, 2007-01-22*) | |
| 38991 | 1001 | declare [[ sledgehammer_problem_prefix = "Tarski__tarski_full_lemma" ]] (*ALL THEOREMS*) | 
| 23449 | 1002 | lemma (in Tarski) tarski_full_lemma: | 
| 1003 | "\<exists>L. isLub Y (| pset = P, order = induced P r |) L" | |
| 1004 | apply (rule_tac x = "v" in exI) | |
| 1005 | apply (simp add: isLub_def) | |
| 1006 | -- {* @{text "v \<in> P"} *}
 | |
| 1007 | apply (simp add: v_in_P) | |
| 1008 | apply (rule conjI) | |
| 1009 | (*sledgehammer*) | |
| 1010 | -- {* @{text v} is lub *}
 | |
| 1011 | -- {* @{text "1. \<forall>y:Y. (y, v) \<in> induced P r"} *}
 | |
| 1012 | apply (rule ballI) | |
| 1013 | apply (simp add: induced_def subsetD v_in_P) | |
| 1014 | apply (rule conjI) | |
| 1015 | apply (erule Y_ss [THEN subsetD]) | |
| 1016 | apply (rule_tac b = "lub Y cl" in transE) | |
| 1017 | apply (rule lub_upper) | |
| 1018 | apply (rule Y_subset_A, assumption) | |
| 1019 | apply (rule_tac b = "Top cl" in interval_imp_mem) | |
| 1020 | apply (simp add: v_def) | |
| 1021 | apply (fold intY1_def) | |
| 27681 | 1022 | apply (rule CL.glb_in_lattice [OF CL.intro, OF PO.intro CL_axioms.intro, OF _ intY1_is_cl, simplified]) | 
| 23449 | 1023 | apply (simp add: CL_imp_PO intY1_is_cl, force) | 
| 1024 | -- {* @{text v} is LEAST ub *}
 | |
| 1025 | apply clarify | |
| 1026 | apply (rule indI) | |
| 1027 | prefer 3 apply assumption | |
| 1028 | prefer 2 apply (simp add: v_in_P) | |
| 1029 | apply (unfold v_def) | |
| 1030 | (*never proved, 2007-01-22*) | |
| 38991 | 1031 | using [[ sledgehammer_problem_prefix = "Tarski__tarski_full_lemma_simpler" ]] | 
| 23449 | 1032 | (*sledgehammer*) | 
| 1033 | apply (rule indE) | |
| 1034 | apply (rule_tac [2] intY1_subset) | |
| 1035 | (*never proved, 2007-01-22*) | |
| 38991 | 1036 | using [[ sledgehammer_problem_prefix = "Tarski__tarski_full_lemma_simplest" ]] | 
| 23449 | 1037 | (*sledgehammer*) | 
| 27681 | 1038 | apply (rule CL.glb_lower [OF CL.intro, OF PO.intro CL_axioms.intro, OF _ intY1_is_cl, simplified]) | 
| 23449 | 1039 | apply (simp add: CL_imp_PO intY1_is_cl) | 
| 1040 | apply force | |
| 1041 | apply (simp add: induced_def intY1_f_closed z_in_interval) | |
| 1042 | apply (simp add: P_def fix_imp_eq [of _ f A] reflE | |
| 1043 | fix_subset [of f A, THEN subsetD]) | |
| 1044 | done | |
| 1045 | ||
| 1046 | lemma CompleteLatticeI_simp: | |
| 1047 | "[| (| pset = A, order = r |) \<in> PartialOrder; | |
| 1048 | \<forall>S. S \<subseteq> A --> (\<exists>L. isLub S (| pset = A, order = r |) L) |] | |
| 1049 | ==> (| pset = A, order = r |) \<in> CompleteLattice" | |
| 1050 | by (simp add: CompleteLatticeI Rdual) | |
| 1051 | ||
| 1052 | ||
| 1053 | (*never proved, 2007-01-22*) | |
| 38991 | 1054 | declare [[ sledgehammer_problem_prefix = "Tarski__Tarski_full" ]] | 
| 23449 | 1055 | declare (in CLF) fixf_po[intro] P_def [simp] A_def [simp] r_def [simp] | 
| 1056 | Tarski.tarski_full_lemma [intro] cl_po [intro] cl_co [intro] | |
| 1057 | CompleteLatticeI_simp [intro] | |
| 1058 | theorem (in CLF) Tarski_full: | |
| 1059 | "(| pset = P, order = induced P r|) \<in> CompleteLattice" | |
| 1060 | (*sledgehammer*) | |
| 1061 | apply (rule CompleteLatticeI_simp) | |
| 1062 | apply (rule fixf_po, clarify) | |
| 1063 | (*never proved, 2007-01-22*) | |
| 38991 | 1064 | using [[ sledgehammer_problem_prefix = "Tarski__Tarski_full_simpler" ]] | 
| 23449 | 1065 | (*sledgehammer*) | 
| 1066 | apply (simp add: P_def A_def r_def) | |
| 27681 | 1067 | apply (blast intro!: Tarski.tarski_full_lemma [OF Tarski.intro, OF CLF.intro Tarski_axioms.intro, | 
| 1068 | OF CL.intro CLF_axioms.intro, OF PO.intro CL_axioms.intro] cl_po cl_co f_cl) | |
| 23449 | 1069 | done | 
| 36554 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 1070 | |
| 
2673979cb54d
more neg_clausify proofs that get replaced by direct proofs
 blanchet parents: 
35416diff
changeset | 1071 | declare (in CLF) fixf_po [rule del] P_def [simp del] A_def [simp del] r_def [simp del] | 
| 23449 | 1072 | Tarski.tarski_full_lemma [rule del] cl_po [rule del] cl_co [rule del] | 
| 1073 | CompleteLatticeI_simp [rule del] | |
| 1074 | ||
| 1075 | end |