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