src/HOL/ex/Tarski.thy
author blanchet
Tue, 16 Sep 2014 19:23:37 +0200
changeset 58352 37745650a3f4
parent 49756 28e37eab4e6f
child 58889 5b7a9633cfa8
permissions -rw-r--r--
register 'prod' and 'sum' as datatypes, to allow N2M through them
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
     1
(*  Title:      HOL/ex/Tarski.thy
40945
b8703f63bfb2 recoded latin1 as utf8;
wenzelm
parents: 31754
diff changeset
     2
    Author:     Florian Kammüller, Cambridge University Computer Laboratory
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
     3
*)
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
     4
13585
db4005b40cc6 Converted Fun to Isar style.
paulson
parents: 13383
diff changeset
     5
header {* The Full Theorem of Tarski *}
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
     6
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
     7
theory Tarski
41413
64cd30d6b0b8 explicit file specifications -- avoid secondary load path;
wenzelm
parents: 40945
diff changeset
     8
imports Main "~~/src/HOL/Library/FuncSet"
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
     9
begin
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    10
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
    11
text {*
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
    12
  Minimal version of lattice theory plus the full theorem of Tarski:
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
    13
  The fixedpoints of a complete lattice themselves form a complete
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
    14
  lattice.
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
    15
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
    16
  Illustrates first-class theories, using the Sigma representation of
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
    17
  structures.  Tidied and converted to Isar by lcp.
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
    18
*}
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
    19
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
    20
record 'a potype =
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    21
  pset  :: "'a set"
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    22
  order :: "('a * 'a) set"
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    23
19736
wenzelm
parents: 19316
diff changeset
    24
definition
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    25
  monotone :: "['a => 'a, 'a set, ('a *'a)set] => bool" where
19736
wenzelm
parents: 19316
diff changeset
    26
  "monotone f A r = (\<forall>x\<in>A. \<forall>y\<in>A. (x, y): r --> ((f x), (f y)) : r)"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    27
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    28
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    29
  least :: "['a => bool, 'a potype] => 'a" where
19736
wenzelm
parents: 19316
diff changeset
    30
  "least P po = (SOME x. x: pset po & P x &
wenzelm
parents: 19316
diff changeset
    31
                       (\<forall>y \<in> pset po. P y --> (x,y): order po))"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    32
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    33
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    34
  greatest :: "['a => bool, 'a potype] => 'a" where
19736
wenzelm
parents: 19316
diff changeset
    35
  "greatest P po = (SOME x. x: pset po & P x &
wenzelm
parents: 19316
diff changeset
    36
                          (\<forall>y \<in> pset po. P y --> (y,x): order po))"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    37
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    38
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    39
  lub  :: "['a set, 'a potype] => 'a" where
19736
wenzelm
parents: 19316
diff changeset
    40
  "lub S po = least (%x. \<forall>y\<in>S. (y,x): order po) po"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    41
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    42
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    43
  glb  :: "['a set, 'a potype] => 'a" where
19736
wenzelm
parents: 19316
diff changeset
    44
  "glb S po = greatest (%x. \<forall>y\<in>S. (x,y): order po) po"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    45
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    46
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    47
  isLub :: "['a set, 'a potype, 'a] => bool" where
19736
wenzelm
parents: 19316
diff changeset
    48
  "isLub S po = (%L. (L: pset po & (\<forall>y\<in>S. (y,L): order po) &
wenzelm
parents: 19316
diff changeset
    49
                   (\<forall>z\<in>pset po. (\<forall>y\<in>S. (y,z): order po) --> (L,z): order po)))"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    50
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    51
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    52
  isGlb :: "['a set, 'a potype, 'a] => bool" where
19736
wenzelm
parents: 19316
diff changeset
    53
  "isGlb S po = (%G. (G: pset po & (\<forall>y\<in>S. (G,y): order po) &
wenzelm
parents: 19316
diff changeset
    54
                 (\<forall>z \<in> pset po. (\<forall>y\<in>S. (z,y): order po) --> (z,G): order po)))"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    55
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    56
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    57
  "fix"    :: "[('a => 'a), 'a set] => 'a set" where
19736
wenzelm
parents: 19316
diff changeset
    58
  "fix f A  = {x. x: A & f x = x}"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    59
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    60
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    61
  interval :: "[('a*'a) set,'a, 'a ] => 'a set" where
19736
wenzelm
parents: 19316
diff changeset
    62
  "interval r a b = {x. (a,x): r & (x,b): r}"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    63
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    64
19736
wenzelm
parents: 19316
diff changeset
    65
definition
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    66
  Bot :: "'a potype => 'a" where
19736
wenzelm
parents: 19316
diff changeset
    67
  "Bot po = least (%x. True) po"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    68
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    69
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    70
  Top :: "'a potype => 'a" where
19736
wenzelm
parents: 19316
diff changeset
    71
  "Top po = greatest (%x. True) po"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    72
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    73
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    74
  PartialOrder :: "('a potype) set" where
30198
922f944f03b2 name changes
nipkow
parents: 29234
diff changeset
    75
  "PartialOrder = {P. refl_on (pset P) (order P) & antisym (order P) &
13585
db4005b40cc6 Converted Fun to Isar style.
paulson
parents: 13383
diff changeset
    76
                       trans (order P)}"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    77
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    78
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    79
  CompleteLattice :: "('a potype) set" where
19736
wenzelm
parents: 19316
diff changeset
    80
  "CompleteLattice = {cl. cl: PartialOrder &
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
    81
                        (\<forall>S. S \<subseteq> pset cl --> (\<exists>L. isLub S cl L)) &
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
    82
                        (\<forall>S. S \<subseteq> pset cl --> (\<exists>G. isGlb S cl G))}"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    83
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    84
definition
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
    85
  CLF_set :: "('a potype * ('a => 'a)) set" where
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
    86
  "CLF_set = (SIGMA cl: CompleteLattice.
19736
wenzelm
parents: 19316
diff changeset
    87
            {f. f: pset cl -> pset cl & monotone f (pset cl) (order cl)})"
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
    88
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    89
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    90
  induced :: "['a set, ('a * 'a) set] => ('a *'a)set" where
19736
wenzelm
parents: 19316
diff changeset
    91
  "induced A r = {(a,b). a : A & b: A & (a,b): r}"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    92
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
    93
19736
wenzelm
parents: 19316
diff changeset
    94
definition
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
    95
  sublattice :: "('a potype * 'a set)set" where
19736
wenzelm
parents: 19316
diff changeset
    96
  "sublattice =
wenzelm
parents: 19316
diff changeset
    97
      (SIGMA cl: CompleteLattice.
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
    98
          {S. S \<subseteq> pset cl &
19736
wenzelm
parents: 19316
diff changeset
    99
           (| pset = S, order = induced S (order cl) |): CompleteLattice})"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
   100
19736
wenzelm
parents: 19316
diff changeset
   101
abbreviation
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
   102
  sublat :: "['a set, 'a potype] => bool"  ("_ <<= _" [51,50]50) where
19736
wenzelm
parents: 19316
diff changeset
   103
  "S <<= cl == S : sublattice `` {cl}"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
   104
19736
wenzelm
parents: 19316
diff changeset
   105
definition
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21232
diff changeset
   106
  dual :: "'a potype => 'a potype" where
19736
wenzelm
parents: 19316
diff changeset
   107
  "dual po = (| pset = pset po, order = converse (order po) |)"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
   108
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   109
locale S =
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   110
  fixes cl :: "'a potype"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   111
    and A  :: "'a set"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   112
    and r  :: "('a * 'a) set"
13585
db4005b40cc6 Converted Fun to Isar style.
paulson
parents: 13383
diff changeset
   113
  defines A_def: "A == pset cl"
db4005b40cc6 Converted Fun to Isar style.
paulson
parents: 13383
diff changeset
   114
     and  r_def: "r == order cl"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
   115
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   116
locale PO = S +
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   117
  assumes cl_po:  "cl : PartialOrder"
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   118
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   119
locale CL = S +
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   120
  assumes cl_co:  "cl : CompleteLattice"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
   121
49756
28e37eab4e6f added some ad-hoc namespace prefixes to avoid duplicate facts;
wenzelm
parents: 46752
diff changeset
   122
sublocale CL < po: PO
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   123
apply (simp_all add: A_def r_def)
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   124
apply unfold_locales
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   125
using cl_co unfolding CompleteLattice_def by auto
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   126
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   127
locale CLF = S +
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   128
  fixes f :: "'a => 'a"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   129
    and P :: "'a set"
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   130
  assumes f_cl:  "(cl,f) : CLF_set" (*was the equivalent "f : CLF_set``{cl}"*)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   131
  defines P_def: "P == fix f A"
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
   132
49756
28e37eab4e6f added some ad-hoc namespace prefixes to avoid duplicate facts;
wenzelm
parents: 46752
diff changeset
   133
sublocale CLF < cl: CL
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   134
apply (simp_all add: A_def r_def)
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   135
apply unfold_locales
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   136
using f_cl unfolding CLF_set_def by auto
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
   137
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   138
locale Tarski = CLF +
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   139
  fixes Y     :: "'a set"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   140
    and intY1 :: "'a set"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   141
    and v     :: "'a"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   142
  assumes
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   143
    Y_ss: "Y \<subseteq> P"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   144
  defines
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   145
    intY1_def: "intY1 == interval r (lub Y cl) (Top cl)"
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   146
    and v_def: "v == glb {x. ((%x: intY1. f x) x, x): induced intY1 r &
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   147
                             x: intY1}
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   148
                      (| pset=intY1, order=induced intY1 r|)"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   149
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   150
14569
78b75a9eec01 Added ex/Exceptions.thy
nipkow
parents: 13585
diff changeset
   151
subsection {* Partial Order *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   152
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   153
lemma (in PO) dual:
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   154
  "PO (dual cl)"
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   155
apply unfold_locales
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   156
using cl_po
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   157
unfolding PartialOrder_def dual_def
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   158
by auto
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   159
30198
922f944f03b2 name changes
nipkow
parents: 29234
diff changeset
   160
lemma (in PO) PO_imp_refl_on [simp]: "refl_on A r"
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   161
apply (insert cl_po)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   162
apply (simp add: PartialOrder_def A_def r_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   163
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   164
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   165
lemma (in PO) PO_imp_sym [simp]: "antisym r"
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   166
apply (insert cl_po)
19316
c04b75d482c4 Slight simplification of proofs
paulson
parents: 18750
diff changeset
   167
apply (simp add: PartialOrder_def r_def)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   168
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   169
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   170
lemma (in PO) PO_imp_trans [simp]: "trans r"
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   171
apply (insert cl_po)
19316
c04b75d482c4 Slight simplification of proofs
paulson
parents: 18750
diff changeset
   172
apply (simp add: PartialOrder_def r_def)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   173
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   174
18705
0874fdca3748 strengthened some lemmas; simplified some proofs
paulson
parents: 17841
diff changeset
   175
lemma (in PO) reflE: "x \<in> A ==> (x, x) \<in> r"
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   176
apply (insert cl_po)
30198
922f944f03b2 name changes
nipkow
parents: 29234
diff changeset
   177
apply (simp add: PartialOrder_def refl_on_def A_def r_def)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   178
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   179
18705
0874fdca3748 strengthened some lemmas; simplified some proofs
paulson
parents: 17841
diff changeset
   180
lemma (in PO) antisymE: "[| (a, b) \<in> r; (b, a) \<in> r |] ==> a = b"
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   181
apply (insert cl_po)
19316
c04b75d482c4 Slight simplification of proofs
paulson
parents: 18750
diff changeset
   182
apply (simp add: PartialOrder_def antisym_def r_def)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   183
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   184
18705
0874fdca3748 strengthened some lemmas; simplified some proofs
paulson
parents: 17841
diff changeset
   185
lemma (in PO) transE: "[| (a, b) \<in> r; (b, c) \<in> r|] ==> (a,c) \<in> r"
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   186
apply (insert cl_po)
19316
c04b75d482c4 Slight simplification of proofs
paulson
parents: 18750
diff changeset
   187
apply (simp add: PartialOrder_def r_def)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   188
apply (unfold trans_def, fast)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   189
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   190
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   191
lemma (in PO) monotoneE:
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   192
     "[| monotone f A r;  x \<in> A; y \<in> A; (x, y) \<in> r |] ==> (f x, f y) \<in> r"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   193
by (simp add: monotone_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   194
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   195
lemma (in PO) po_subset_po:
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   196
     "S \<subseteq> A ==> (| pset = S, order = induced S r |) \<in> PartialOrder"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   197
apply (simp (no_asm) add: PartialOrder_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   198
apply auto
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   199
-- {* refl *}
30198
922f944f03b2 name changes
nipkow
parents: 29234
diff changeset
   200
apply (simp add: refl_on_def induced_def)
18705
0874fdca3748 strengthened some lemmas; simplified some proofs
paulson
parents: 17841
diff changeset
   201
apply (blast intro: reflE)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   202
-- {* antisym *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   203
apply (simp add: antisym_def induced_def)
18705
0874fdca3748 strengthened some lemmas; simplified some proofs
paulson
parents: 17841
diff changeset
   204
apply (blast intro: antisymE)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   205
-- {* trans *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   206
apply (simp add: trans_def induced_def)
18705
0874fdca3748 strengthened some lemmas; simplified some proofs
paulson
parents: 17841
diff changeset
   207
apply (blast intro: transE)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   208
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   209
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   210
lemma (in PO) indE: "[| (x, y) \<in> induced S r; S \<subseteq> A |] ==> (x, y) \<in> r"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   211
by (simp add: add: induced_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   212
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   213
lemma (in PO) indI: "[| (x, y) \<in> r; x \<in> S; y \<in> S |] ==> (x, y) \<in> induced S r"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   214
by (simp add: add: induced_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   215
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   216
lemma (in CL) CL_imp_ex_isLub: "S \<subseteq> A ==> \<exists>L. isLub S cl L"
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   217
apply (insert cl_co)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   218
apply (simp add: CompleteLattice_def A_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   219
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   220
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   221
declare (in CL) cl_co [simp]
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   222
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   223
lemma isLub_lub: "(\<exists>L. isLub S cl L) = isLub S cl (lub S cl)"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   224
by (simp add: lub_def least_def isLub_def some_eq_ex [symmetric])
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   225
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   226
lemma isGlb_glb: "(\<exists>G. isGlb S cl G) = isGlb S cl (glb S cl)"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   227
by (simp add: glb_def greatest_def isGlb_def some_eq_ex [symmetric])
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   228
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   229
lemma isGlb_dual_isLub: "isGlb S cl = isLub S (dual cl)"
46752
e9e7209eb375 more fundamental pred-to-set conversions, particularly by means of inductive_set; associated consolidation of some theorem names (c.f. NEWS)
haftmann
parents: 41413
diff changeset
   230
by (simp add: isLub_def isGlb_def dual_def converse_unfold)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   231
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   232
lemma isLub_dual_isGlb: "isLub S cl = isGlb S (dual cl)"
46752
e9e7209eb375 more fundamental pred-to-set conversions, particularly by means of inductive_set; associated consolidation of some theorem names (c.f. NEWS)
haftmann
parents: 41413
diff changeset
   233
by (simp add: isLub_def isGlb_def dual_def converse_unfold)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   234
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   235
lemma (in PO) dualPO: "dual cl \<in> PartialOrder"
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   236
apply (insert cl_po)
30198
922f944f03b2 name changes
nipkow
parents: 29234
diff changeset
   237
apply (simp add: PartialOrder_def dual_def refl_on_converse
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   238
                 trans_converse antisym_converse)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   239
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   240
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   241
lemma Rdual:
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   242
     "\<forall>S. (S \<subseteq> A -->( \<exists>L. isLub S (| pset = A, order = r|) L))
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   243
      ==> \<forall>S. (S \<subseteq> A --> (\<exists>G. isGlb S (| pset = A, order = r|) G))"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   244
apply safe
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   245
apply (rule_tac x = "lub {y. y \<in> A & (\<forall>k \<in> S. (y, k) \<in> r)}
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   246
                      (|pset = A, order = r|) " in exI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   247
apply (drule_tac x = "{y. y \<in> A & (\<forall>k \<in> S. (y,k) \<in> r) }" in spec)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   248
apply (drule mp, fast)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   249
apply (simp add: isLub_lub isGlb_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   250
apply (simp add: isLub_def, blast)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   251
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   252
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   253
lemma lub_dual_glb: "lub S cl = glb S (dual cl)"
46752
e9e7209eb375 more fundamental pred-to-set conversions, particularly by means of inductive_set; associated consolidation of some theorem names (c.f. NEWS)
haftmann
parents: 41413
diff changeset
   254
by (simp add: lub_def glb_def least_def greatest_def dual_def converse_unfold)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   255
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   256
lemma glb_dual_lub: "glb S cl = lub S (dual cl)"
46752
e9e7209eb375 more fundamental pred-to-set conversions, particularly by means of inductive_set; associated consolidation of some theorem names (c.f. NEWS)
haftmann
parents: 41413
diff changeset
   257
by (simp add: lub_def glb_def least_def greatest_def dual_def converse_unfold)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   258
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   259
lemma CL_subset_PO: "CompleteLattice \<subseteq> PartialOrder"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   260
by (simp add: PartialOrder_def CompleteLattice_def, fast)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   261
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   262
lemmas CL_imp_PO = CL_subset_PO [THEN subsetD]
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   263
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   264
(*declare CL_imp_PO [THEN PO.PO_imp_refl, simp]
21232
faacfd4392b5 fixed locale fact references;
wenzelm
parents: 19736
diff changeset
   265
declare CL_imp_PO [THEN PO.PO_imp_sym, simp]
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   266
declare CL_imp_PO [THEN PO.PO_imp_trans, simp]*)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   267
30198
922f944f03b2 name changes
nipkow
parents: 29234
diff changeset
   268
lemma (in CL) CO_refl_on: "refl_on A r"
922f944f03b2 name changes
nipkow
parents: 29234
diff changeset
   269
by (rule PO_imp_refl_on)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   270
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   271
lemma (in CL) CO_antisym: "antisym r"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   272
by (rule PO_imp_sym)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   273
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   274
lemma (in CL) CO_trans: "trans r"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   275
by (rule PO_imp_trans)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   276
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   277
lemma CompleteLatticeI:
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   278
     "[| po \<in> PartialOrder; (\<forall>S. S \<subseteq> pset po --> (\<exists>L. isLub S po L));
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   279
         (\<forall>S. S \<subseteq> pset po --> (\<exists>G. isGlb S po G))|]
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   280
      ==> po \<in> CompleteLattice"
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   281
apply (unfold CompleteLattice_def, blast)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   282
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   283
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   284
lemma (in CL) CL_dualCL: "dual cl \<in> CompleteLattice"
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   285
apply (insert cl_co)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   286
apply (simp add: CompleteLattice_def dual_def)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   287
apply (fold dual_def)
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   288
apply (simp add: isLub_dual_isGlb [symmetric] isGlb_dual_isLub [symmetric]
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   289
                 dualPO)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   290
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   291
13585
db4005b40cc6 Converted Fun to Isar style.
paulson
parents: 13383
diff changeset
   292
lemma (in PO) dualA_iff: "pset (dual cl) = pset cl"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   293
by (simp add: dual_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   294
13585
db4005b40cc6 Converted Fun to Isar style.
paulson
parents: 13383
diff changeset
   295
lemma (in PO) dualr_iff: "((x, y) \<in> (order(dual cl))) = ((y, x) \<in> order cl)"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   296
by (simp add: dual_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   297
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   298
lemma (in PO) monotone_dual:
13585
db4005b40cc6 Converted Fun to Isar style.
paulson
parents: 13383
diff changeset
   299
     "monotone f (pset cl) (order cl) 
db4005b40cc6 Converted Fun to Isar style.
paulson
parents: 13383
diff changeset
   300
     ==> monotone f (pset (dual cl)) (order(dual cl))"
db4005b40cc6 Converted Fun to Isar style.
paulson
parents: 13383
diff changeset
   301
by (simp add: monotone_def dualA_iff dualr_iff)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   302
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   303
lemma (in PO) interval_dual:
13585
db4005b40cc6 Converted Fun to Isar style.
paulson
parents: 13383
diff changeset
   304
     "[| x \<in> A; y \<in> A|] ==> interval r x y = interval (order(dual cl)) y x"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   305
apply (simp add: interval_def dualr_iff)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   306
apply (fold r_def, fast)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   307
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   308
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   309
lemma (in PO) trans:
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   310
  "(x, y) \<in> r \<Longrightarrow> (y, z) \<in> r \<Longrightarrow> (x, z) \<in> r"
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   311
using cl_po apply (auto simp add: PartialOrder_def r_def)
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   312
unfolding trans_def by blast 
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   313
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   314
lemma (in PO) interval_not_empty:
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   315
  "interval r a b \<noteq> {} ==> (a, b) \<in> r"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   316
apply (simp add: interval_def)
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   317
using trans by blast
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   318
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   319
lemma (in PO) interval_imp_mem: "x \<in> interval r a b ==> (a, x) \<in> r"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   320
by (simp add: interval_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   321
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   322
lemma (in PO) left_in_interval:
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   323
     "[| a \<in> A; b \<in> A; interval r a b \<noteq> {} |] ==> a \<in> interval r a b"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   324
apply (simp (no_asm_simp) add: interval_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   325
apply (simp add: PO_imp_trans interval_not_empty)
18705
0874fdca3748 strengthened some lemmas; simplified some proofs
paulson
parents: 17841
diff changeset
   326
apply (simp add: reflE)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   327
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   328
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   329
lemma (in PO) right_in_interval:
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   330
     "[| a \<in> A; b \<in> A; interval r a b \<noteq> {} |] ==> b \<in> interval r a b"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   331
apply (simp (no_asm_simp) add: interval_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   332
apply (simp add: PO_imp_trans interval_not_empty)
18705
0874fdca3748 strengthened some lemmas; simplified some proofs
paulson
parents: 17841
diff changeset
   333
apply (simp add: reflE)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   334
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   335
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   336
14569
78b75a9eec01 Added ex/Exceptions.thy
nipkow
parents: 13585
diff changeset
   337
subsection {* sublattice *}
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   338
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   339
lemma (in PO) sublattice_imp_CL:
18750
91a328803c6a fixed the <<= notation
paulson
parents: 18705
diff changeset
   340
     "S <<= cl  ==> (| pset = S, order = induced S r |) \<in> CompleteLattice"
19316
c04b75d482c4 Slight simplification of proofs
paulson
parents: 18750
diff changeset
   341
by (simp add: sublattice_def CompleteLattice_def r_def)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   342
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   343
lemma (in CL) sublatticeI:
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   344
     "[| S \<subseteq> A; (| pset = S, order = induced S r |) \<in> CompleteLattice |]
18750
91a328803c6a fixed the <<= notation
paulson
parents: 18705
diff changeset
   345
      ==> S <<= cl"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   346
by (simp add: sublattice_def A_def r_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   347
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   348
lemma (in CL) dual:
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   349
  "CL (dual cl)"
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   350
apply unfold_locales
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   351
using cl_co unfolding CompleteLattice_def
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   352
apply (simp add: dualPO isGlb_dual_isLub [symmetric] isLub_dual_isGlb [symmetric] dualA_iff)
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   353
done
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   354
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   355
14569
78b75a9eec01 Added ex/Exceptions.thy
nipkow
parents: 13585
diff changeset
   356
subsection {* lub *}
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   357
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   358
lemma (in CL) lub_unique: "[| S \<subseteq> A; isLub S cl x; isLub S cl L|] ==> x = L"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   359
apply (rule antisymE)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   360
apply (auto simp add: isLub_def r_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   361
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   362
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   363
lemma (in CL) lub_upper: "[|S \<subseteq> A; x \<in> S|] ==> (x, lub S cl) \<in> r"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   364
apply (rule CL_imp_ex_isLub [THEN exE], assumption)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   365
apply (unfold lub_def least_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   366
apply (rule some_equality [THEN ssubst])
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   367
  apply (simp add: isLub_def)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   368
 apply (simp add: lub_unique A_def isLub_def)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   369
apply (simp add: isLub_def r_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   370
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   371
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   372
lemma (in CL) lub_least:
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   373
     "[| S \<subseteq> A; L \<in> A; \<forall>x \<in> S. (x,L) \<in> r |] ==> (lub S cl, L) \<in> r"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   374
apply (rule CL_imp_ex_isLub [THEN exE], assumption)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   375
apply (unfold lub_def least_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   376
apply (rule_tac s=x in some_equality [THEN ssubst])
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   377
  apply (simp add: isLub_def)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   378
 apply (simp add: lub_unique A_def isLub_def)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   379
apply (simp add: isLub_def r_def A_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   380
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   381
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   382
lemma (in CL) lub_in_lattice: "S \<subseteq> A ==> lub S cl \<in> A"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   383
apply (rule CL_imp_ex_isLub [THEN exE], assumption)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   384
apply (unfold lub_def least_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   385
apply (subst some_equality)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   386
apply (simp add: isLub_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   387
prefer 2 apply (simp add: isLub_def A_def)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   388
apply (simp add: lub_unique A_def isLub_def)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   389
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   390
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   391
lemma (in CL) lubI:
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   392
     "[| S \<subseteq> A; L \<in> A; \<forall>x \<in> S. (x,L) \<in> r;
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   393
         \<forall>z \<in> A. (\<forall>y \<in> S. (y,z) \<in> r) --> (L,z) \<in> r |] ==> L = lub S cl"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   394
apply (rule lub_unique, assumption)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   395
apply (simp add: isLub_def A_def r_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   396
apply (unfold isLub_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   397
apply (rule conjI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   398
apply (fold A_def r_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   399
apply (rule lub_in_lattice, assumption)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   400
apply (simp add: lub_upper lub_least)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   401
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   402
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   403
lemma (in CL) lubIa: "[| S \<subseteq> A; isLub S cl L |] ==> L = lub S cl"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   404
by (simp add: lubI isLub_def A_def r_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   405
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   406
lemma (in CL) isLub_in_lattice: "isLub S cl L ==> L \<in> A"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   407
by (simp add: isLub_def  A_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   408
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   409
lemma (in CL) isLub_upper: "[|isLub S cl L; y \<in> S|] ==> (y, L) \<in> r"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   410
by (simp add: isLub_def r_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   411
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   412
lemma (in CL) isLub_least:
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   413
     "[| isLub S cl L; z \<in> A; \<forall>y \<in> S. (y, z) \<in> r|] ==> (L, z) \<in> r"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   414
by (simp add: isLub_def A_def r_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   415
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   416
lemma (in CL) isLubI:
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   417
     "[| L \<in> A; \<forall>y \<in> S. (y, L) \<in> r;
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   418
         (\<forall>z \<in> A. (\<forall>y \<in> S. (y, z):r) --> (L, z) \<in> r)|] ==> isLub S cl L"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   419
by (simp add: isLub_def A_def r_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   420
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   421
14569
78b75a9eec01 Added ex/Exceptions.thy
nipkow
parents: 13585
diff changeset
   422
subsection {* glb *}
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   423
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   424
lemma (in CL) glb_in_lattice: "S \<subseteq> A ==> glb S cl \<in> A"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   425
apply (subst glb_dual_lub)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   426
apply (simp add: A_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   427
apply (rule dualA_iff [THEN subst])
21232
faacfd4392b5 fixed locale fact references;
wenzelm
parents: 19736
diff changeset
   428
apply (rule CL.lub_in_lattice)
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   429
apply (rule dual)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   430
apply (simp add: dualA_iff)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   431
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   432
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   433
lemma (in CL) glb_lower: "[|S \<subseteq> A; x \<in> S|] ==> (glb S cl, x) \<in> r"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   434
apply (subst glb_dual_lub)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   435
apply (simp add: r_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   436
apply (rule dualr_iff [THEN subst])
21232
faacfd4392b5 fixed locale fact references;
wenzelm
parents: 19736
diff changeset
   437
apply (rule CL.lub_upper)
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   438
apply (rule dual)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   439
apply (simp add: dualA_iff A_def, assumption)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   440
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   441
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   442
text {*
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   443
  Reduce the sublattice property by using substructural properties;
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   444
  abandoned see @{text "Tarski_4.ML"}.
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   445
*}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   446
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   447
lemma (in CLF) [simp]:
13585
db4005b40cc6 Converted Fun to Isar style.
paulson
parents: 13383
diff changeset
   448
    "f: pset cl -> pset cl & monotone f (pset cl) (order cl)"
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   449
apply (insert f_cl)
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   450
apply (simp add: CLF_set_def)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   451
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   452
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   453
declare (in CLF) f_cl [simp]
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   454
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   455
13585
db4005b40cc6 Converted Fun to Isar style.
paulson
parents: 13383
diff changeset
   456
lemma (in CLF) f_in_funcset: "f \<in> A -> A"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   457
by (simp add: A_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   458
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   459
lemma (in CLF) monotone_f: "monotone f A r"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   460
by (simp add: A_def r_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   461
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   462
lemma (in CLF) CLF_dual: "(dual cl, f) \<in> CLF_set"
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   463
apply (simp add: CLF_set_def  CL_dualCL monotone_dual)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   464
apply (simp add: dualA_iff)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   465
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   466
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   467
lemma (in CLF) dual:
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   468
  "CLF (dual cl) f"
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   469
apply (rule CLF.intro)
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   470
apply (rule CLF_dual)
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   471
done
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   472
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   473
14569
78b75a9eec01 Added ex/Exceptions.thy
nipkow
parents: 13585
diff changeset
   474
subsection {* fixed points *}
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   475
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   476
lemma fix_subset: "fix f A \<subseteq> A"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   477
by (simp add: fix_def, fast)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   478
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   479
lemma fix_imp_eq: "x \<in> fix f A ==> f x = x"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   480
by (simp add: fix_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   481
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   482
lemma fixf_subset:
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   483
     "[| A \<subseteq> B; x \<in> fix (%y: A. f y) A |] ==> x \<in> fix f B"
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   484
by (simp add: fix_def, auto)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   485
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   486
14569
78b75a9eec01 Added ex/Exceptions.thy
nipkow
parents: 13585
diff changeset
   487
subsection {* lemmas for Tarski, lub *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   488
lemma (in CLF) lubH_le_flubH:
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   489
     "H = {x. (x, f x) \<in> r & x \<in> A} ==> (lub H cl, f (lub H cl)) \<in> r"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   490
apply (rule lub_least, fast)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   491
apply (rule f_in_funcset [THEN funcset_mem])
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   492
apply (rule lub_in_lattice, fast)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   493
-- {* @{text "\<forall>x:H. (x, f (lub H r)) \<in> r"} *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   494
apply (rule ballI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   495
apply (rule transE)
13585
db4005b40cc6 Converted Fun to Isar style.
paulson
parents: 13383
diff changeset
   496
-- {* instantiates @{text "(x, ???z) \<in> order cl to (x, f x)"}, *}
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   497
-- {* because of the def of @{text H} *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   498
apply fast
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   499
-- {* so it remains to show @{text "(f x, f (lub H cl)) \<in> r"} *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   500
apply (rule_tac f = "f" in monotoneE)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   501
apply (rule monotone_f, fast)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   502
apply (rule lub_in_lattice, fast)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   503
apply (rule lub_upper, fast)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   504
apply assumption
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   505
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   506
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   507
lemma (in CLF) flubH_le_lubH:
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   508
     "[|  H = {x. (x, f x) \<in> r & x \<in> A} |] ==> (f (lub H cl), lub H cl) \<in> r"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   509
apply (rule lub_upper, fast)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   510
apply (rule_tac t = "H" in ssubst, assumption)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   511
apply (rule CollectI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   512
apply (rule conjI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   513
apply (rule_tac [2] f_in_funcset [THEN funcset_mem])
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   514
apply (rule_tac [2] lub_in_lattice)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   515
prefer 2 apply fast
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   516
apply (rule_tac f = "f" in monotoneE)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   517
apply (rule monotone_f)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   518
  apply (blast intro: lub_in_lattice)
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   519
 apply (blast intro: lub_in_lattice f_in_funcset [THEN funcset_mem])
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   520
apply (simp add: lubH_le_flubH)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   521
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   522
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   523
lemma (in CLF) lubH_is_fixp:
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   524
     "H = {x. (x, f x) \<in> r & x \<in> A} ==> lub H cl \<in> fix f A"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   525
apply (simp add: fix_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   526
apply (rule conjI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   527
apply (rule lub_in_lattice, fast)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   528
apply (rule antisymE)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   529
apply (simp add: flubH_le_lubH)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   530
apply (simp add: lubH_le_flubH)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   531
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   532
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   533
lemma (in CLF) fix_in_H:
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   534
     "[| H = {x. (x, f x) \<in> r & x \<in> A};  x \<in> P |] ==> x \<in> H"
30198
922f944f03b2 name changes
nipkow
parents: 29234
diff changeset
   535
by (simp add: P_def fix_imp_eq [of _ f A] reflE CO_refl_on
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   536
                    fix_subset [of f A, THEN subsetD])
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   537
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   538
lemma (in CLF) fixf_le_lubH:
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   539
     "H = {x. (x, f x) \<in> r & x \<in> A} ==> \<forall>x \<in> fix f A. (x, lub H cl) \<in> r"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   540
apply (rule ballI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   541
apply (rule lub_upper, fast)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   542
apply (rule fix_in_H)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   543
apply (simp_all add: P_def)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   544
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   545
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   546
lemma (in CLF) lubH_least_fixf:
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   547
     "H = {x. (x, f x) \<in> r & x \<in> A}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   548
      ==> \<forall>L. (\<forall>y \<in> fix f A. (y,L) \<in> r) --> (lub H cl, L) \<in> r"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   549
apply (rule allI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   550
apply (rule impI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   551
apply (erule bspec)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   552
apply (rule lubH_is_fixp, assumption)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   553
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   554
14569
78b75a9eec01 Added ex/Exceptions.thy
nipkow
parents: 13585
diff changeset
   555
subsection {* Tarski fixpoint theorem 1, first part *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   556
lemma (in CLF) T_thm_1_lub: "lub P cl = lub {x. (x, f x) \<in> r & x \<in> A} cl"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   557
apply (rule sym)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   558
apply (simp add: P_def)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   559
apply (rule lubI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   560
apply (rule fix_subset)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   561
apply (rule lub_in_lattice, fast)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   562
apply (simp add: fixf_le_lubH)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   563
apply (simp add: lubH_least_fixf)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   564
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   565
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   566
lemma (in CLF) glbH_is_fixp: "H = {x. (f x, x) \<in> r & x \<in> A} ==> glb H cl \<in> P"
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   567
  -- {* Tarski for glb *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   568
apply (simp add: glb_dual_lub P_def A_def r_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   569
apply (rule dualA_iff [THEN subst])
21232
faacfd4392b5 fixed locale fact references;
wenzelm
parents: 19736
diff changeset
   570
apply (rule CLF.lubH_is_fixp)
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   571
apply (rule dual)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   572
apply (simp add: dualr_iff dualA_iff)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   573
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   574
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   575
lemma (in CLF) T_thm_1_glb: "glb P cl = glb {x. (f x, x) \<in> r & x \<in> A} cl"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   576
apply (simp add: glb_dual_lub P_def A_def r_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   577
apply (rule dualA_iff [THEN subst])
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   578
apply (simp add: CLF.T_thm_1_lub [of _ f, OF dual]
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   579
                 dualPO CL_dualCL CLF_dual dualr_iff)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   580
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   581
14569
78b75a9eec01 Added ex/Exceptions.thy
nipkow
parents: 13585
diff changeset
   582
subsection {* interval *}
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   583
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   584
lemma (in CLF) rel_imp_elem: "(x, y) \<in> r ==> x \<in> A"
30198
922f944f03b2 name changes
nipkow
parents: 29234
diff changeset
   585
apply (insert CO_refl_on)
922f944f03b2 name changes
nipkow
parents: 29234
diff changeset
   586
apply (simp add: refl_on_def, blast)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   587
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   588
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   589
lemma (in CLF) interval_subset: "[| a \<in> A; b \<in> A |] ==> interval r a b \<subseteq> A"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   590
apply (simp add: interval_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   591
apply (blast intro: rel_imp_elem)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   592
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   593
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   594
lemma (in CLF) intervalI:
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   595
     "[| (a, x) \<in> r; (x, b) \<in> r |] ==> x \<in> interval r a b"
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   596
by (simp add: interval_def)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   597
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   598
lemma (in CLF) interval_lemma1:
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   599
     "[| S \<subseteq> interval r a b; x \<in> S |] ==> (a, x) \<in> r"
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   600
by (unfold interval_def, fast)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   601
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   602
lemma (in CLF) interval_lemma2:
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   603
     "[| S \<subseteq> interval r a b; x \<in> S |] ==> (x, b) \<in> r"
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   604
by (unfold interval_def, fast)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   605
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   606
lemma (in CLF) a_less_lub:
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   607
     "[| S \<subseteq> A; S \<noteq> {};
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   608
         \<forall>x \<in> S. (a,x) \<in> r; \<forall>y \<in> S. (y, L) \<in> r |] ==> (a,L) \<in> r"
18705
0874fdca3748 strengthened some lemmas; simplified some proofs
paulson
parents: 17841
diff changeset
   609
by (blast intro: transE)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   610
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   611
lemma (in CLF) glb_less_b:
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   612
     "[| S \<subseteq> A; S \<noteq> {};
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   613
         \<forall>x \<in> S. (x,b) \<in> r; \<forall>y \<in> S. (G, y) \<in> r |] ==> (G,b) \<in> r"
18705
0874fdca3748 strengthened some lemmas; simplified some proofs
paulson
parents: 17841
diff changeset
   614
by (blast intro: transE)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   615
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   616
lemma (in CLF) S_intv_cl:
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   617
     "[| a \<in> A; b \<in> A; S \<subseteq> interval r a b |]==> S \<subseteq> A"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   618
by (simp add: subset_trans [OF _ interval_subset])
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   619
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   620
lemma (in CLF) L_in_interval:
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   621
     "[| a \<in> A; b \<in> A; S \<subseteq> interval r a b;
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   622
         S \<noteq> {}; isLub S cl L; interval r a b \<noteq> {} |] ==> L \<in> interval r a b"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   623
apply (rule intervalI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   624
apply (rule a_less_lub)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   625
prefer 2 apply assumption
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   626
apply (simp add: S_intv_cl)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   627
apply (rule ballI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   628
apply (simp add: interval_lemma1)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   629
apply (simp add: isLub_upper)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   630
-- {* @{text "(L, b) \<in> r"} *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   631
apply (simp add: isLub_least interval_lemma2)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   632
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   633
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   634
lemma (in CLF) G_in_interval:
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   635
     "[| a \<in> A; b \<in> A; interval r a b \<noteq> {}; S \<subseteq> interval r a b; isGlb S cl G;
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   636
         S \<noteq> {} |] ==> G \<in> interval r a b"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   637
apply (simp add: interval_dual)
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   638
apply (simp add: CLF.L_in_interval [of _ f, OF dual]
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   639
                 dualA_iff A_def isGlb_dual_isLub)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   640
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   641
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   642
lemma (in CLF) intervalPO:
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   643
     "[| a \<in> A; b \<in> A; interval r a b \<noteq> {} |]
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   644
      ==> (| pset = interval r a b, order = induced (interval r a b) r |)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   645
          \<in> PartialOrder"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   646
apply (rule po_subset_po)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   647
apply (simp add: interval_subset)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   648
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   649
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   650
lemma (in CLF) intv_CL_lub:
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   651
 "[| a \<in> A; b \<in> A; interval r a b \<noteq> {} |]
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   652
  ==> \<forall>S. S \<subseteq> interval r a b -->
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   653
          (\<exists>L. isLub S (| pset = interval r a b,
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   654
                          order = induced (interval r a b) r |)  L)"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   655
apply (intro strip)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   656
apply (frule S_intv_cl [THEN CL_imp_ex_isLub])
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   657
prefer 2 apply assumption
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   658
apply assumption
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   659
apply (erule exE)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   660
-- {* define the lub for the interval as *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   661
apply (rule_tac x = "if S = {} then a else L" in exI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   662
apply (simp (no_asm_simp) add: isLub_def split del: split_if)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   663
apply (intro impI conjI)
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   664
-- {* @{text "(if S = {} then a else L) \<in> interval r a b"} *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   665
apply (simp add: CL_imp_PO L_in_interval)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   666
apply (simp add: left_in_interval)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   667
-- {* lub prop 1 *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   668
apply (case_tac "S = {}")
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   669
-- {* @{text "S = {}, y \<in> S = False => everything"} *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   670
apply fast
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   671
-- {* @{text "S \<noteq> {}"} *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   672
apply simp
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   673
-- {* @{text "\<forall>y:S. (y, L) \<in> induced (interval r a b) r"} *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   674
apply (rule ballI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   675
apply (simp add: induced_def  L_in_interval)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   676
apply (rule conjI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   677
apply (rule subsetD)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   678
apply (simp add: S_intv_cl, assumption)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   679
apply (simp add: isLub_upper)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   680
-- {* @{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"} *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   681
apply (rule ballI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   682
apply (rule impI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   683
apply (case_tac "S = {}")
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   684
-- {* @{text "S = {}"} *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   685
apply simp
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   686
apply (simp add: induced_def  interval_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   687
apply (rule conjI)
18705
0874fdca3748 strengthened some lemmas; simplified some proofs
paulson
parents: 17841
diff changeset
   688
apply (rule reflE, assumption)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   689
apply (rule interval_not_empty)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   690
apply (simp add: interval_def)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   691
-- {* @{text "S \<noteq> {}"} *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   692
apply simp
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   693
apply (simp add: induced_def  L_in_interval)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   694
apply (rule isLub_least, assumption)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   695
apply (rule subsetD)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   696
prefer 2 apply assumption
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   697
apply (simp add: S_intv_cl, fast)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   698
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   699
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   700
lemmas (in CLF) intv_CL_glb = intv_CL_lub [THEN Rdual]
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   701
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   702
lemma (in CLF) interval_is_sublattice:
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   703
     "[| a \<in> A; b \<in> A; interval r a b \<noteq> {} |]
18750
91a328803c6a fixed the <<= notation
paulson
parents: 18705
diff changeset
   704
        ==> interval r a b <<= cl"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   705
apply (rule sublatticeI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   706
apply (simp add: interval_subset)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   707
apply (rule CompleteLatticeI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   708
apply (simp add: intervalPO)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   709
 apply (simp add: intv_CL_lub)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   710
apply (simp add: intv_CL_glb)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   711
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   712
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   713
lemmas (in CLF) interv_is_compl_latt =
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   714
    interval_is_sublattice [THEN sublattice_imp_CL]
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   715
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   716
14569
78b75a9eec01 Added ex/Exceptions.thy
nipkow
parents: 13585
diff changeset
   717
subsection {* Top and Bottom *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   718
lemma (in CLF) Top_dual_Bot: "Top cl = Bot (dual cl)"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   719
by (simp add: Top_def Bot_def least_def greatest_def dualA_iff dualr_iff)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   720
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   721
lemma (in CLF) Bot_dual_Top: "Bot cl = Top (dual cl)"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   722
by (simp add: Top_def Bot_def least_def greatest_def dualA_iff dualr_iff)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   723
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   724
lemma (in CLF) Bot_in_lattice: "Bot cl \<in> A"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   725
apply (simp add: Bot_def least_def)
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   726
apply (rule_tac a="glb A cl" in someI2)
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   727
apply (simp_all add: glb_in_lattice glb_lower 
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   728
                     r_def [symmetric] A_def [symmetric])
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   729
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   730
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   731
lemma (in CLF) Top_in_lattice: "Top cl \<in> A"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   732
apply (simp add: Top_dual_Bot A_def)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   733
apply (rule dualA_iff [THEN subst])
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   734
apply (rule CLF.Bot_in_lattice [OF dual])
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   735
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   736
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   737
lemma (in CLF) Top_prop: "x \<in> A ==> (x, Top cl) \<in> r"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   738
apply (simp add: Top_def greatest_def)
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   739
apply (rule_tac a="lub A cl" in someI2)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   740
apply (rule someI2)
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   741
apply (simp_all add: lub_in_lattice lub_upper 
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   742
                     r_def [symmetric] A_def [symmetric])
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   743
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   744
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   745
lemma (in CLF) Bot_prop: "x \<in> A ==> (Bot cl, x) \<in> r"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   746
apply (simp add: Bot_dual_Top r_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   747
apply (rule dualr_iff [THEN subst])
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   748
apply (rule CLF.Top_prop [OF dual])
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   749
apply (simp add: dualA_iff A_def)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   750
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   751
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   752
lemma (in CLF) Top_intv_not_empty: "x \<in> A  ==> interval r x (Top cl) \<noteq> {}"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   753
apply (rule notI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   754
apply (drule_tac a = "Top cl" in equals0D)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   755
apply (simp add: interval_def)
30198
922f944f03b2 name changes
nipkow
parents: 29234
diff changeset
   756
apply (simp add: refl_on_def Top_in_lattice Top_prop)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   757
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   758
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   759
lemma (in CLF) Bot_intv_not_empty: "x \<in> A ==> interval r (Bot cl) x \<noteq> {}"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   760
apply (simp add: Bot_dual_Top)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   761
apply (subst interval_dual)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   762
prefer 2 apply assumption
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   763
apply (simp add: A_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   764
apply (rule dualA_iff [THEN subst])
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   765
apply (rule CLF.Top_in_lattice [OF dual])
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   766
apply (rule CLF.Top_intv_not_empty [OF dual])
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   767
apply (simp add: dualA_iff A_def)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   768
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   769
14569
78b75a9eec01 Added ex/Exceptions.thy
nipkow
parents: 13585
diff changeset
   770
subsection {* fixed points form a partial order *}
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   771
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   772
lemma (in CLF) fixf_po: "(| pset = P, order = induced P r|) \<in> PartialOrder"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   773
by (simp add: P_def fix_subset po_subset_po)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   774
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   775
lemma (in Tarski) Y_subset_A: "Y \<subseteq> A"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   776
apply (rule subset_trans [OF _ fix_subset])
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   777
apply (rule Y_ss [simplified P_def])
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   778
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   779
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   780
lemma (in Tarski) lubY_in_A: "lub Y cl \<in> A"
18750
91a328803c6a fixed the <<= notation
paulson
parents: 18705
diff changeset
   781
  by (rule Y_subset_A [THEN lub_in_lattice])
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   782
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   783
lemma (in Tarski) lubY_le_flubY: "(lub Y cl, f (lub Y cl)) \<in> r"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   784
apply (rule lub_least)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   785
apply (rule Y_subset_A)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   786
apply (rule f_in_funcset [THEN funcset_mem])
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   787
apply (rule lubY_in_A)
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   788
-- {* @{text "Y \<subseteq> P ==> f x = x"} *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   789
apply (rule ballI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   790
apply (rule_tac t = "x" in fix_imp_eq [THEN subst])
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   791
apply (erule Y_ss [simplified P_def, THEN subsetD])
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   792
-- {* @{text "reduce (f x, f (lub Y cl)) \<in> r to (x, lub Y cl) \<in> r"} by monotonicity *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   793
apply (rule_tac f = "f" in monotoneE)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   794
apply (rule monotone_f)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   795
apply (simp add: Y_subset_A [THEN subsetD])
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   796
apply (rule lubY_in_A)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   797
apply (simp add: lub_upper Y_subset_A)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   798
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   799
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   800
lemma (in Tarski) intY1_subset: "intY1 \<subseteq> A"
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   801
apply (unfold intY1_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   802
apply (rule interval_subset)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   803
apply (rule lubY_in_A)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   804
apply (rule Top_in_lattice)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   805
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   806
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   807
lemmas (in Tarski) intY1_elem = intY1_subset [THEN subsetD]
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   808
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   809
lemma (in Tarski) intY1_f_closed: "x \<in> intY1 \<Longrightarrow> f x \<in> intY1"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   810
apply (simp add: intY1_def  interval_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   811
apply (rule conjI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   812
apply (rule transE)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   813
apply (rule lubY_le_flubY)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   814
-- {* @{text "(f (lub Y cl), f x) \<in> r"} *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   815
apply (rule_tac f=f in monotoneE)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   816
apply (rule monotone_f)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   817
apply (rule lubY_in_A)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   818
apply (simp add: intY1_def interval_def  intY1_elem)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   819
apply (simp add: intY1_def  interval_def)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   820
-- {* @{text "(f x, Top cl) \<in> r"} *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   821
apply (rule Top_prop)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   822
apply (rule f_in_funcset [THEN funcset_mem])
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   823
apply (simp add: intY1_def interval_def  intY1_elem)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   824
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   825
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   826
lemma (in Tarski) intY1_mono:
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   827
     "monotone (%x: intY1. f x) intY1 (induced intY1 r)"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   828
apply (auto simp add: monotone_def induced_def intY1_f_closed)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   829
apply (blast intro: intY1_elem monotone_f [THEN monotoneE])
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   830
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   831
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   832
lemma (in Tarski) intY1_is_cl:
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   833
    "(| pset = intY1, order = induced intY1 r |) \<in> CompleteLattice"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   834
apply (unfold intY1_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   835
apply (rule interv_is_compl_latt)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   836
apply (rule lubY_in_A)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   837
apply (rule Top_in_lattice)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   838
apply (rule Top_intv_not_empty)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   839
apply (rule lubY_in_A)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   840
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   841
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   842
lemma (in Tarski) v_in_P: "v \<in> P"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   843
apply (unfold P_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   844
apply (rule_tac A = "intY1" in fixf_subset)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   845
apply (rule intY1_subset)
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   846
unfolding v_def
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   847
apply (rule CLF.glbH_is_fixp [OF CLF.intro, unfolded CLF_set_def, of "\<lparr>pset = intY1, order = induced intY1 r\<rparr>", simplified])
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   848
apply auto
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   849
apply (rule intY1_is_cl)
31754
b5260f5272a4 tuned FuncSet
nipkow
parents: 30198
diff changeset
   850
apply (erule intY1_f_closed)
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   851
apply (rule intY1_mono)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   852
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   853
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   854
lemma (in Tarski) z_in_interval:
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   855
     "[| z \<in> P; \<forall>y\<in>Y. (y, z) \<in> induced P r |] ==> z \<in> intY1"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   856
apply (unfold intY1_def P_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   857
apply (rule intervalI)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   858
prefer 2
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   859
 apply (erule fix_subset [THEN subsetD, THEN Top_prop])
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   860
apply (rule lub_least)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   861
apply (rule Y_subset_A)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   862
apply (fast elim!: fix_subset [THEN subsetD])
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   863
apply (simp add: induced_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   864
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   865
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   866
lemma (in Tarski) f'z_in_int_rel: "[| z \<in> P; \<forall>y\<in>Y. (y, z) \<in> induced P r |]
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   867
      ==> ((%x: intY1. f x) z, z) \<in> induced intY1 r"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   868
apply (simp add: induced_def  intY1_f_closed z_in_interval P_def)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   869
apply (simp add: fix_imp_eq [of _ f A] fix_subset [of f A, THEN subsetD]
18705
0874fdca3748 strengthened some lemmas; simplified some proofs
paulson
parents: 17841
diff changeset
   870
                 reflE)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   871
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   872
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   873
lemma (in Tarski) tarski_full_lemma:
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   874
     "\<exists>L. isLub Y (| pset = P, order = induced P r |) L"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   875
apply (rule_tac x = "v" in exI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   876
apply (simp add: isLub_def)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   877
-- {* @{text "v \<in> P"} *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   878
apply (simp add: v_in_P)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   879
apply (rule conjI)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   880
-- {* @{text v} is lub *}
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   881
-- {* @{text "1. \<forall>y:Y. (y, v) \<in> induced P r"} *}
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   882
apply (rule ballI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   883
apply (simp add: induced_def subsetD v_in_P)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   884
apply (rule conjI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   885
apply (erule Y_ss [THEN subsetD])
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   886
apply (rule_tac b = "lub Y cl" in transE)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   887
apply (rule lub_upper)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   888
apply (rule Y_subset_A, assumption)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   889
apply (rule_tac b = "Top cl" in interval_imp_mem)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   890
apply (simp add: v_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   891
apply (fold intY1_def)
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   892
apply (rule CL.glb_in_lattice [OF CL.intro [OF intY1_is_cl], simplified])
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   893
apply auto
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   894
apply (rule indI)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   895
  prefer 3 apply assumption
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   896
 prefer 2 apply (simp add: v_in_P)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   897
apply (unfold v_def)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   898
apply (rule indE)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   899
apply (rule_tac [2] intY1_subset)
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   900
apply (rule CL.glb_lower [OF CL.intro [OF intY1_is_cl], simplified])
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   901
  apply (simp add: CL_imp_PO intY1_is_cl)
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   902
 apply force
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   903
apply (simp add: induced_def intY1_f_closed z_in_interval)
18705
0874fdca3748 strengthened some lemmas; simplified some proofs
paulson
parents: 17841
diff changeset
   904
apply (simp add: P_def fix_imp_eq [of _ f A] reflE
0874fdca3748 strengthened some lemmas; simplified some proofs
paulson
parents: 17841
diff changeset
   905
                 fix_subset [of f A, THEN subsetD])
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   906
done
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   907
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   908
lemma CompleteLatticeI_simp:
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   909
     "[| (| pset = A, order = r |) \<in> PartialOrder;
17841
b1f10b98430d tidying
paulson
parents: 16417
diff changeset
   910
         \<forall>S. S \<subseteq> A --> (\<exists>L. isLub S (| pset = A, order = r |)  L) |]
13115
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   911
    ==> (| pset = A, order = r |) \<in> CompleteLattice"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   912
by (simp add: CompleteLatticeI Rdual)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   913
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   914
theorem (in CLF) Tarski_full:
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   915
     "(| pset = P, order = induced P r|) \<in> CompleteLattice"
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   916
apply (rule CompleteLatticeI_simp)
0a6fbdedcde2 Tidied and converted to Isar by lcp
paulson
parents: 12459
diff changeset
   917
apply (rule fixf_po, clarify)
13383
041d78bf9403 adapted locales;
wenzelm
parents: 13115
diff changeset
   918
apply (simp add: P_def A_def r_def)
27681
8cedebf55539 dropped locale (open)
haftmann
parents: 22547
diff changeset
   919
apply (rule Tarski.tarski_full_lemma [OF Tarski.intro [OF _ Tarski_axioms.intro]])
28823
dcbef866c9e2 tuned unfold_locales invocation
haftmann
parents: 27681
diff changeset
   920
proof - show "CLF cl f" .. qed
7112
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
   921
b142788d79e8 back again, supposedly with correct perms;
wenzelm
parents:
diff changeset
   922
end