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