src/HOL/Lattices.thy
author wenzelm
Fri, 01 Jan 2016 10:49:00 +0100
changeset 62020 5d208fd2507d
parent 61799 4cf66f21b764
child 63290 9ac558ab0906
permissions -rw-r--r--
isabelle update_cartouches -c -t;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
     1
(*  Title:      HOL/Lattices.thy
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
     2
    Author:     Tobias Nipkow
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
     3
*)
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
     4
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
     5
section \<open>Abstract lattices\<close>
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
     6
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
     7
theory Lattices
54555
e8c5e95d338b rationalize imports
blanchet
parents: 52729
diff changeset
     8
imports Groups
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
     9
begin
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
    10
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
    11
subsection \<open>Abstract semilattice\<close>
35301
90e42f9ba4d1 distributed theory Algebras to theories Groups and Lattices
haftmann
parents: 35121
diff changeset
    12
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
    13
text \<open>
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    14
  These locales provide a basic structure for interpretation into
35301
90e42f9ba4d1 distributed theory Algebras to theories Groups and Lattices
haftmann
parents: 35121
diff changeset
    15
  bigger structures;  extensions require careful thinking, otherwise
90e42f9ba4d1 distributed theory Algebras to theories Groups and Lattices
haftmann
parents: 35121
diff changeset
    16
  undesired effects may occur due to interpretation.
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
    17
\<close>
35301
90e42f9ba4d1 distributed theory Algebras to theories Groups and Lattices
haftmann
parents: 35121
diff changeset
    18
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    19
no_notation times (infixl "*" 70)
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    20
no_notation Groups.one ("1")
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    21
35301
90e42f9ba4d1 distributed theory Algebras to theories Groups and Lattices
haftmann
parents: 35121
diff changeset
    22
locale semilattice = abel_semigroup +
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    23
  assumes idem [simp]: "a * a = a"
35301
90e42f9ba4d1 distributed theory Algebras to theories Groups and Lattices
haftmann
parents: 35121
diff changeset
    24
begin
90e42f9ba4d1 distributed theory Algebras to theories Groups and Lattices
haftmann
parents: 35121
diff changeset
    25
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    26
lemma left_idem [simp]: "a * (a * b) = a * b"
50615
965d4c108584 added simp rule
nipkow
parents: 49769
diff changeset
    27
by (simp add: assoc [symmetric])
965d4c108584 added simp rule
nipkow
parents: 49769
diff changeset
    28
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    29
lemma right_idem [simp]: "(a * b) * b = a * b"
50615
965d4c108584 added simp rule
nipkow
parents: 49769
diff changeset
    30
by (simp add: assoc)
35301
90e42f9ba4d1 distributed theory Algebras to theories Groups and Lattices
haftmann
parents: 35121
diff changeset
    31
90e42f9ba4d1 distributed theory Algebras to theories Groups and Lattices
haftmann
parents: 35121
diff changeset
    32
end
90e42f9ba4d1 distributed theory Algebras to theories Groups and Lattices
haftmann
parents: 35121
diff changeset
    33
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    34
locale semilattice_neutr = semilattice + comm_monoid
35301
90e42f9ba4d1 distributed theory Algebras to theories Groups and Lattices
haftmann
parents: 35121
diff changeset
    35
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    36
locale semilattice_order = semilattice +
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    37
  fixes less_eq :: "'a \<Rightarrow> 'a \<Rightarrow> bool" (infix "\<preceq>" 50)
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    38
    and less :: "'a \<Rightarrow> 'a \<Rightarrow> bool" (infix "\<prec>" 50)
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    39
  assumes order_iff: "a \<preceq> b \<longleftrightarrow> a = a * b"
59545
12a6088ed195 explicit equivalence for strict order on lattices
haftmann
parents: 58889
diff changeset
    40
    and strict_order_iff: "a \<prec> b \<longleftrightarrow> a = a * b \<and> a \<noteq> b"
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    41
begin
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    42
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    43
lemma orderI:
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    44
  "a = a * b \<Longrightarrow> a \<preceq> b"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    45
  by (simp add: order_iff)
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    46
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    47
lemma orderE:
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    48
  assumes "a \<preceq> b"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    49
  obtains "a = a * b"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    50
  using assms by (unfold order_iff)
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    51
52152
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
    52
sublocale ordering less_eq less
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    53
proof
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    54
  fix a b
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    55
  show "a \<prec> b \<longleftrightarrow> a \<preceq> b \<and> a \<noteq> b"
59545
12a6088ed195 explicit equivalence for strict order on lattices
haftmann
parents: 58889
diff changeset
    56
    by (simp add: order_iff strict_order_iff)
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    57
next
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    58
  fix a
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    59
  show "a \<preceq> a"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    60
    by (simp add: order_iff)
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    61
next
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    62
  fix a b
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    63
  assume "a \<preceq> b" "b \<preceq> a"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    64
  then have "a = a * b" "a * b = b"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    65
    by (simp_all add: order_iff commute)
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    66
  then show "a = b" by simp
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    67
next
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    68
  fix a b c
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    69
  assume "a \<preceq> b" "b \<preceq> c"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    70
  then have "a = a * b" "b = b * c"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    71
    by (simp_all add: order_iff commute)
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    72
  then have "a = a * (b * c)"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    73
    by simp
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    74
  then have "a = (a * b) * c"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    75
    by (simp add: assoc)
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
    76
  with \<open>a = a * b\<close> [symmetric] have "a = a * c" by simp
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    77
  then show "a \<preceq> c" by (rule orderI)
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    78
qed
35301
90e42f9ba4d1 distributed theory Algebras to theories Groups and Lattices
haftmann
parents: 35121
diff changeset
    79
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    80
lemma cobounded1 [simp]:
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    81
  "a * b \<preceq> a"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    82
  by (simp add: order_iff commute)  
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    83
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    84
lemma cobounded2 [simp]:
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    85
  "a * b \<preceq> b"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    86
  by (simp add: order_iff)
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    87
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    88
lemma boundedI:
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    89
  assumes "a \<preceq> b" and "a \<preceq> c"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    90
  shows "a \<preceq> b * c"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    91
proof (rule orderI)
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    92
  from assms obtain "a * b = a" and "a * c = a" by (auto elim!: orderE)
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    93
  then show "a = a * (b * c)" by (simp add: assoc [symmetric])
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    94
qed
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    95
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    96
lemma boundedE:
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    97
  assumes "a \<preceq> b * c"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    98
  obtains "a \<preceq> b" and "a \<preceq> c"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
    99
  using assms by (blast intro: trans cobounded1 cobounded2)
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   100
54859
64ff7f16d5b7 prefer abstract simp rule
haftmann
parents: 54858
diff changeset
   101
lemma bounded_iff [simp]:
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   102
  "a \<preceq> b * c \<longleftrightarrow> a \<preceq> b \<and> a \<preceq> c"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   103
  by (blast intro: boundedI elim: boundedE)
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   104
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   105
lemma strict_boundedE:
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   106
  assumes "a \<prec> b * c"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   107
  obtains "a \<prec> b" and "a \<prec> c"
54859
64ff7f16d5b7 prefer abstract simp rule
haftmann
parents: 54858
diff changeset
   108
  using assms by (auto simp add: commute strict_iff_order elim: orderE intro!: that)+
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   109
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   110
lemma coboundedI1:
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   111
  "a \<preceq> c \<Longrightarrow> a * b \<preceq> c"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   112
  by (rule trans) auto
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   113
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   114
lemma coboundedI2:
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   115
  "b \<preceq> c \<Longrightarrow> a * b \<preceq> c"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   116
  by (rule trans) auto
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   117
54858
c1c334198504 more lemmas on abstract lattices
haftmann
parents: 54857
diff changeset
   118
lemma strict_coboundedI1:
c1c334198504 more lemmas on abstract lattices
haftmann
parents: 54857
diff changeset
   119
  "a \<prec> c \<Longrightarrow> a * b \<prec> c"
c1c334198504 more lemmas on abstract lattices
haftmann
parents: 54857
diff changeset
   120
  using irrefl
c1c334198504 more lemmas on abstract lattices
haftmann
parents: 54857
diff changeset
   121
    by (auto intro: not_eq_order_implies_strict coboundedI1 strict_implies_order elim: strict_boundedE)
c1c334198504 more lemmas on abstract lattices
haftmann
parents: 54857
diff changeset
   122
c1c334198504 more lemmas on abstract lattices
haftmann
parents: 54857
diff changeset
   123
lemma strict_coboundedI2:
c1c334198504 more lemmas on abstract lattices
haftmann
parents: 54857
diff changeset
   124
  "b \<prec> c \<Longrightarrow> a * b \<prec> c"
c1c334198504 more lemmas on abstract lattices
haftmann
parents: 54857
diff changeset
   125
  using strict_coboundedI1 [of b c a] by (simp add: commute)
c1c334198504 more lemmas on abstract lattices
haftmann
parents: 54857
diff changeset
   126
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   127
lemma mono: "a \<preceq> c \<Longrightarrow> b \<preceq> d \<Longrightarrow> a * b \<preceq> c * d"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   128
  by (blast intro: boundedI coboundedI1 coboundedI2)
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   129
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   130
lemma absorb1: "a \<preceq> b \<Longrightarrow> a * b = a"
54859
64ff7f16d5b7 prefer abstract simp rule
haftmann
parents: 54858
diff changeset
   131
  by (rule antisym) (auto simp add: refl)
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   132
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   133
lemma absorb2: "b \<preceq> a \<Longrightarrow> a * b = b"
54859
64ff7f16d5b7 prefer abstract simp rule
haftmann
parents: 54858
diff changeset
   134
  by (rule antisym) (auto simp add: refl)
54858
c1c334198504 more lemmas on abstract lattices
haftmann
parents: 54857
diff changeset
   135
c1c334198504 more lemmas on abstract lattices
haftmann
parents: 54857
diff changeset
   136
lemma absorb_iff1: "a \<preceq> b \<longleftrightarrow> a * b = a"
c1c334198504 more lemmas on abstract lattices
haftmann
parents: 54857
diff changeset
   137
  using order_iff by auto
c1c334198504 more lemmas on abstract lattices
haftmann
parents: 54857
diff changeset
   138
c1c334198504 more lemmas on abstract lattices
haftmann
parents: 54857
diff changeset
   139
lemma absorb_iff2: "b \<preceq> a \<longleftrightarrow> a * b = b"
c1c334198504 more lemmas on abstract lattices
haftmann
parents: 54857
diff changeset
   140
  using order_iff by (auto simp add: commute)
35301
90e42f9ba4d1 distributed theory Algebras to theories Groups and Lattices
haftmann
parents: 35121
diff changeset
   141
90e42f9ba4d1 distributed theory Algebras to theories Groups and Lattices
haftmann
parents: 35121
diff changeset
   142
end
90e42f9ba4d1 distributed theory Algebras to theories Groups and Lattices
haftmann
parents: 35121
diff changeset
   143
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   144
locale semilattice_neutr_order = semilattice_neutr + semilattice_order
52152
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   145
begin
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   146
52152
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   147
sublocale ordering_top less_eq less 1
61169
4de9ff3ea29a tuned proofs -- less legacy;
wenzelm
parents: 61076
diff changeset
   148
  by standard (simp add: order_iff)
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   149
52152
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   150
end
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   151
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   152
notation times (infixl "*" 70)
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   153
notation Groups.one ("1")
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   154
35301
90e42f9ba4d1 distributed theory Algebras to theories Groups and Lattices
haftmann
parents: 35121
diff changeset
   155
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
   156
subsection \<open>Syntactic infimum and supremum operations\<close>
41082
9ff94e7cc3b3 bot comes before top, inf before sup etc.
haftmann
parents: 41080
diff changeset
   157
44845
5e51075cbd97 added syntactic classes for "inf" and "sup"
krauss
parents: 44085
diff changeset
   158
class inf =
5e51075cbd97 added syntactic classes for "inf" and "sup"
krauss
parents: 44085
diff changeset
   159
  fixes inf :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "\<sqinter>" 70)
25206
9c84ec7217a9 localized monotonicity; tuned syntax
haftmann
parents: 25102
diff changeset
   160
44845
5e51075cbd97 added syntactic classes for "inf" and "sup"
krauss
parents: 44085
diff changeset
   161
class sup = 
5e51075cbd97 added syntactic classes for "inf" and "sup"
krauss
parents: 44085
diff changeset
   162
  fixes sup :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "\<squnion>" 65)
5e51075cbd97 added syntactic classes for "inf" and "sup"
krauss
parents: 44085
diff changeset
   163
46691
72d81e789106 tuned syntax declarations; tuned structure
haftmann
parents: 46689
diff changeset
   164
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
   165
subsection \<open>Concrete lattices\<close>
46691
72d81e789106 tuned syntax declarations; tuned structure
haftmann
parents: 46689
diff changeset
   166
72d81e789106 tuned syntax declarations; tuned structure
haftmann
parents: 46689
diff changeset
   167
notation
72d81e789106 tuned syntax declarations; tuned structure
haftmann
parents: 46689
diff changeset
   168
  less_eq  (infix "\<sqsubseteq>" 50) and
72d81e789106 tuned syntax declarations; tuned structure
haftmann
parents: 46689
diff changeset
   169
  less  (infix "\<sqsubset>" 50)
72d81e789106 tuned syntax declarations; tuned structure
haftmann
parents: 46689
diff changeset
   170
44845
5e51075cbd97 added syntactic classes for "inf" and "sup"
krauss
parents: 44085
diff changeset
   171
class semilattice_inf =  order + inf +
22737
haftmann
parents: 22548
diff changeset
   172
  assumes inf_le1 [simp]: "x \<sqinter> y \<sqsubseteq> x"
haftmann
parents: 22548
diff changeset
   173
  and inf_le2 [simp]: "x \<sqinter> y \<sqsubseteq> y"
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   174
  and inf_greatest: "x \<sqsubseteq> y \<Longrightarrow> x \<sqsubseteq> z \<Longrightarrow> x \<sqsubseteq> y \<sqinter> z"
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   175
44845
5e51075cbd97 added syntactic classes for "inf" and "sup"
krauss
parents: 44085
diff changeset
   176
class semilattice_sup = order + sup +
22737
haftmann
parents: 22548
diff changeset
   177
  assumes sup_ge1 [simp]: "x \<sqsubseteq> x \<squnion> y"
haftmann
parents: 22548
diff changeset
   178
  and sup_ge2 [simp]: "y \<sqsubseteq> x \<squnion> y"
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   179
  and sup_least: "y \<sqsubseteq> x \<Longrightarrow> z \<sqsubseteq> x \<Longrightarrow> y \<squnion> z \<sqsubseteq> x"
26014
00c2c3525bef dual orders and dual lattices
haftmann
parents: 25510
diff changeset
   180
begin
00c2c3525bef dual orders and dual lattices
haftmann
parents: 25510
diff changeset
   181
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
   182
text \<open>Dual lattice\<close>
26014
00c2c3525bef dual orders and dual lattices
haftmann
parents: 25510
diff changeset
   183
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   184
lemma dual_semilattice:
44845
5e51075cbd97 added syntactic classes for "inf" and "sup"
krauss
parents: 44085
diff changeset
   185
  "class.semilattice_inf sup greater_eq greater"
36635
080b755377c0 locale predicates of classes carry a mandatory "class" prefix
haftmann
parents: 36352
diff changeset
   186
by (rule class.semilattice_inf.intro, rule dual_order)
27682
25aceefd4786 added class preorder
haftmann
parents: 26794
diff changeset
   187
  (unfold_locales, simp_all add: sup_least)
26014
00c2c3525bef dual orders and dual lattices
haftmann
parents: 25510
diff changeset
   188
00c2c3525bef dual orders and dual lattices
haftmann
parents: 25510
diff changeset
   189
end
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   190
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 34973
diff changeset
   191
class lattice = semilattice_inf + semilattice_sup
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   192
25382
72cfe89f7b21 tuned specifications of 'notation';
wenzelm
parents: 25206
diff changeset
   193
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
   194
subsubsection \<open>Intro and elim rules\<close>
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   195
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 34973
diff changeset
   196
context semilattice_inf
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   197
begin
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   198
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   199
lemma le_infI1:
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   200
  "a \<sqsubseteq> x \<Longrightarrow> a \<sqinter> b \<sqsubseteq> x"
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   201
  by (rule order_trans) auto
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   202
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   203
lemma le_infI2:
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   204
  "b \<sqsubseteq> x \<Longrightarrow> a \<sqinter> b \<sqsubseteq> x"
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   205
  by (rule order_trans) auto
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   206
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   207
lemma le_infI: "x \<sqsubseteq> a \<Longrightarrow> x \<sqsubseteq> b \<Longrightarrow> x \<sqsubseteq> a \<sqinter> b"
54857
5c05f7c5f8ae tuning and augmentation of min/max lemmas;
haftmann
parents: 54555
diff changeset
   208
  by (fact inf_greatest) (* FIXME: duplicate lemma *)
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   209
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   210
lemma le_infE: "x \<sqsubseteq> a \<sqinter> b \<Longrightarrow> (x \<sqsubseteq> a \<Longrightarrow> x \<sqsubseteq> b \<Longrightarrow> P) \<Longrightarrow> P"
36008
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   211
  by (blast intro: order_trans inf_le1 inf_le2)
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   212
54859
64ff7f16d5b7 prefer abstract simp rule
haftmann
parents: 54858
diff changeset
   213
lemma le_inf_iff:
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   214
  "x \<sqsubseteq> y \<sqinter> z \<longleftrightarrow> x \<sqsubseteq> y \<and> x \<sqsubseteq> z"
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   215
  by (blast intro: le_infI elim: le_infE)
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   216
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   217
lemma le_iff_inf:
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   218
  "x \<sqsubseteq> y \<longleftrightarrow> x \<sqinter> y = x"
54859
64ff7f16d5b7 prefer abstract simp rule
haftmann
parents: 54858
diff changeset
   219
  by (auto intro: le_infI1 antisym dest: eq_iff [THEN iffD1] simp add: le_inf_iff)
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   220
43753
fe5e846c0839 tuned notation
haftmann
parents: 41082
diff changeset
   221
lemma inf_mono: "a \<sqsubseteq> c \<Longrightarrow> b \<sqsubseteq> d \<Longrightarrow> a \<sqinter> b \<sqsubseteq> c \<sqinter> d"
36008
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   222
  by (fast intro: inf_greatest le_infI1 le_infI2)
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   223
25206
9c84ec7217a9 localized monotonicity; tuned syntax
haftmann
parents: 25102
diff changeset
   224
lemma mono_inf:
61076
bdc1e2f0a86a eliminated \<Colon>;
wenzelm
parents: 60758
diff changeset
   225
  fixes f :: "'a \<Rightarrow> 'b::semilattice_inf"
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   226
  shows "mono f \<Longrightarrow> f (A \<sqinter> B) \<sqsubseteq> f A \<sqinter> f B"
25206
9c84ec7217a9 localized monotonicity; tuned syntax
haftmann
parents: 25102
diff changeset
   227
  by (auto simp add: mono_def intro: Lattices.inf_greatest)
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   228
25206
9c84ec7217a9 localized monotonicity; tuned syntax
haftmann
parents: 25102
diff changeset
   229
end
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   230
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 34973
diff changeset
   231
context semilattice_sup
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   232
begin
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   233
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   234
lemma le_supI1:
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   235
  "x \<sqsubseteq> a \<Longrightarrow> x \<sqsubseteq> a \<squnion> b"
25062
af5ef0d4d655 global class syntax
haftmann
parents: 24749
diff changeset
   236
  by (rule order_trans) auto
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   237
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   238
lemma le_supI2:
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   239
  "x \<sqsubseteq> b \<Longrightarrow> x \<sqsubseteq> a \<squnion> b"
25062
af5ef0d4d655 global class syntax
haftmann
parents: 24749
diff changeset
   240
  by (rule order_trans) auto 
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   241
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   242
lemma le_supI:
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   243
  "a \<sqsubseteq> x \<Longrightarrow> b \<sqsubseteq> x \<Longrightarrow> a \<squnion> b \<sqsubseteq> x"
54857
5c05f7c5f8ae tuning and augmentation of min/max lemmas;
haftmann
parents: 54555
diff changeset
   244
  by (fact sup_least) (* FIXME: duplicate lemma *)
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   245
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   246
lemma le_supE:
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   247
  "a \<squnion> b \<sqsubseteq> x \<Longrightarrow> (a \<sqsubseteq> x \<Longrightarrow> b \<sqsubseteq> x \<Longrightarrow> P) \<Longrightarrow> P"
36008
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   248
  by (blast intro: order_trans sup_ge1 sup_ge2)
22422
ee19cdb07528 stepping towards uniform lattice theory development in HOL
haftmann
parents: 22384
diff changeset
   249
54859
64ff7f16d5b7 prefer abstract simp rule
haftmann
parents: 54858
diff changeset
   250
lemma le_sup_iff:
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   251
  "x \<squnion> y \<sqsubseteq> z \<longleftrightarrow> x \<sqsubseteq> z \<and> y \<sqsubseteq> z"
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   252
  by (blast intro: le_supI elim: le_supE)
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   253
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   254
lemma le_iff_sup:
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   255
  "x \<sqsubseteq> y \<longleftrightarrow> x \<squnion> y = y"
54859
64ff7f16d5b7 prefer abstract simp rule
haftmann
parents: 54858
diff changeset
   256
  by (auto intro: le_supI2 antisym dest: eq_iff [THEN iffD1] simp add: le_sup_iff)
21734
283461c15fa7 renaming
nipkow
parents: 21733
diff changeset
   257
43753
fe5e846c0839 tuned notation
haftmann
parents: 41082
diff changeset
   258
lemma sup_mono: "a \<sqsubseteq> c \<Longrightarrow> b \<sqsubseteq> d \<Longrightarrow> a \<squnion> b \<sqsubseteq> c \<squnion> d"
36008
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   259
  by (fast intro: sup_least le_supI1 le_supI2)
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   260
25206
9c84ec7217a9 localized monotonicity; tuned syntax
haftmann
parents: 25102
diff changeset
   261
lemma mono_sup:
61076
bdc1e2f0a86a eliminated \<Colon>;
wenzelm
parents: 60758
diff changeset
   262
  fixes f :: "'a \<Rightarrow> 'b::semilattice_sup"
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   263
  shows "mono f \<Longrightarrow> f A \<squnion> f B \<sqsubseteq> f (A \<squnion> B)"
25206
9c84ec7217a9 localized monotonicity; tuned syntax
haftmann
parents: 25102
diff changeset
   264
  by (auto simp add: mono_def intro: Lattices.sup_least)
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   265
25206
9c84ec7217a9 localized monotonicity; tuned syntax
haftmann
parents: 25102
diff changeset
   266
end
23878
bd651ecd4b8a simplified HOL bootstrap
haftmann
parents: 23389
diff changeset
   267
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   268
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
   269
subsubsection \<open>Equational laws\<close>
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   270
52152
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   271
context semilattice_inf
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   272
begin
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   273
61605
1bf7b186542e qualifier is mandatory by default;
wenzelm
parents: 61169
diff changeset
   274
sublocale inf: semilattice inf
34973
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   275
proof
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   276
  fix a b c
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   277
  show "(a \<sqinter> b) \<sqinter> c = a \<sqinter> (b \<sqinter> c)"
54859
64ff7f16d5b7 prefer abstract simp rule
haftmann
parents: 54858
diff changeset
   278
    by (rule antisym) (auto intro: le_infI1 le_infI2 simp add: le_inf_iff)
34973
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   279
  show "a \<sqinter> b = b \<sqinter> a"
54859
64ff7f16d5b7 prefer abstract simp rule
haftmann
parents: 54858
diff changeset
   280
    by (rule antisym) (auto simp add: le_inf_iff)
34973
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   281
  show "a \<sqinter> a = a"
54859
64ff7f16d5b7 prefer abstract simp rule
haftmann
parents: 54858
diff changeset
   282
    by (rule antisym) (auto simp add: le_inf_iff)
34973
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   283
qed
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   284
61605
1bf7b186542e qualifier is mandatory by default;
wenzelm
parents: 61169
diff changeset
   285
sublocale inf: semilattice_order inf less_eq less
61169
4de9ff3ea29a tuned proofs -- less legacy;
wenzelm
parents: 61076
diff changeset
   286
  by standard (auto simp add: le_iff_inf less_le)
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   287
34973
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   288
lemma inf_assoc: "(x \<sqinter> y) \<sqinter> z = x \<sqinter> (y \<sqinter> z)"
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   289
  by (fact inf.assoc)
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   290
34973
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   291
lemma inf_commute: "(x \<sqinter> y) = (y \<sqinter> x)"
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   292
  by (fact inf.commute)
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   293
34973
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   294
lemma inf_left_commute: "x \<sqinter> (y \<sqinter> z) = y \<sqinter> (x \<sqinter> z)"
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   295
  by (fact inf.left_commute)
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   296
44921
58eef4843641 tuned proofs
huffman
parents: 44919
diff changeset
   297
lemma inf_idem: "x \<sqinter> x = x"
58eef4843641 tuned proofs
huffman
parents: 44919
diff changeset
   298
  by (fact inf.idem) (* already simp *)
34973
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   299
50615
965d4c108584 added simp rule
nipkow
parents: 49769
diff changeset
   300
lemma inf_left_idem: "x \<sqinter> (x \<sqinter> y) = x \<sqinter> y"
965d4c108584 added simp rule
nipkow
parents: 49769
diff changeset
   301
  by (fact inf.left_idem) (* already simp *)
965d4c108584 added simp rule
nipkow
parents: 49769
diff changeset
   302
965d4c108584 added simp rule
nipkow
parents: 49769
diff changeset
   303
lemma inf_right_idem: "(x \<sqinter> y) \<sqinter> y = x \<sqinter> y"
965d4c108584 added simp rule
nipkow
parents: 49769
diff changeset
   304
  by (fact inf.right_idem) (* already simp *)
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   305
32642
026e7c6a6d08 be more cautious wrt. simp rules: inf_absorb1, inf_absorb2, sup_absorb1, sup_absorb2 are no simp rules by default any longer
haftmann
parents: 32568
diff changeset
   306
lemma inf_absorb1: "x \<sqsubseteq> y \<Longrightarrow> x \<sqinter> y = x"
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   307
  by (rule antisym) auto
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   308
32642
026e7c6a6d08 be more cautious wrt. simp rules: inf_absorb1, inf_absorb2, sup_absorb1, sup_absorb2 are no simp rules by default any longer
haftmann
parents: 32568
diff changeset
   309
lemma inf_absorb2: "y \<sqsubseteq> x \<Longrightarrow> x \<sqinter> y = y"
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   310
  by (rule antisym) auto
34973
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   311
 
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   312
lemmas inf_aci = inf_commute inf_assoc inf_left_commute inf_left_idem
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   313
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   314
end
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   315
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 34973
diff changeset
   316
context semilattice_sup
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   317
begin
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   318
61605
1bf7b186542e qualifier is mandatory by default;
wenzelm
parents: 61169
diff changeset
   319
sublocale sup: semilattice sup
52152
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   320
proof
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   321
  fix a b c
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   322
  show "(a \<squnion> b) \<squnion> c = a \<squnion> (b \<squnion> c)"
54859
64ff7f16d5b7 prefer abstract simp rule
haftmann
parents: 54858
diff changeset
   323
    by (rule antisym) (auto intro: le_supI1 le_supI2 simp add: le_sup_iff)
52152
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   324
  show "a \<squnion> b = b \<squnion> a"
54859
64ff7f16d5b7 prefer abstract simp rule
haftmann
parents: 54858
diff changeset
   325
    by (rule antisym) (auto simp add: le_sup_iff)
52152
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   326
  show "a \<squnion> a = a"
54859
64ff7f16d5b7 prefer abstract simp rule
haftmann
parents: 54858
diff changeset
   327
    by (rule antisym) (auto simp add: le_sup_iff)
52152
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   328
qed
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   329
61605
1bf7b186542e qualifier is mandatory by default;
wenzelm
parents: 61169
diff changeset
   330
sublocale sup: semilattice_order sup greater_eq greater
61169
4de9ff3ea29a tuned proofs -- less legacy;
wenzelm
parents: 61076
diff changeset
   331
  by standard (auto simp add: le_iff_sup sup.commute less_le)
52152
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   332
34973
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   333
lemma sup_assoc: "(x \<squnion> y) \<squnion> z = x \<squnion> (y \<squnion> z)"
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   334
  by (fact sup.assoc)
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   335
34973
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   336
lemma sup_commute: "(x \<squnion> y) = (y \<squnion> x)"
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   337
  by (fact sup.commute)
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   338
34973
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   339
lemma sup_left_commute: "x \<squnion> (y \<squnion> z) = y \<squnion> (x \<squnion> z)"
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   340
  by (fact sup.left_commute)
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   341
44921
58eef4843641 tuned proofs
huffman
parents: 44919
diff changeset
   342
lemma sup_idem: "x \<squnion> x = x"
58eef4843641 tuned proofs
huffman
parents: 44919
diff changeset
   343
  by (fact sup.idem) (* already simp *)
34973
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   344
44918
6a80fbc4e72c tune simpset for Complete_Lattices
noschinl
parents: 44845
diff changeset
   345
lemma sup_left_idem [simp]: "x \<squnion> (x \<squnion> y) = x \<squnion> y"
34973
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 34209
diff changeset
   346
  by (fact sup.left_idem)
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   347
32642
026e7c6a6d08 be more cautious wrt. simp rules: inf_absorb1, inf_absorb2, sup_absorb1, sup_absorb2 are no simp rules by default any longer
haftmann
parents: 32568
diff changeset
   348
lemma sup_absorb1: "y \<sqsubseteq> x \<Longrightarrow> x \<squnion> y = x"
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   349
  by (rule antisym) auto
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   350
32642
026e7c6a6d08 be more cautious wrt. simp rules: inf_absorb1, inf_absorb2, sup_absorb1, sup_absorb2 are no simp rules by default any longer
haftmann
parents: 32568
diff changeset
   351
lemma sup_absorb2: "x \<sqsubseteq> y \<Longrightarrow> x \<squnion> y = y"
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   352
  by (rule antisym) auto
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   353
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   354
lemmas sup_aci = sup_commute sup_assoc sup_left_commute sup_left_idem
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   355
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   356
end
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   357
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   358
context lattice
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   359
begin
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   360
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   361
lemma dual_lattice:
44845
5e51075cbd97 added syntactic classes for "inf" and "sup"
krauss
parents: 44085
diff changeset
   362
  "class.lattice sup (op \<ge>) (op >) inf"
36635
080b755377c0 locale predicates of classes carry a mandatory "class" prefix
haftmann
parents: 36352
diff changeset
   363
  by (rule class.lattice.intro, rule dual_semilattice, rule class.semilattice_sup.intro, rule dual_order)
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   364
    (unfold_locales, auto)
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   365
44918
6a80fbc4e72c tune simpset for Complete_Lattices
noschinl
parents: 44845
diff changeset
   366
lemma inf_sup_absorb [simp]: "x \<sqinter> (x \<squnion> y) = x"
25102
db3e412c4cb1 antisymmetry not a default intro rule any longer
haftmann
parents: 25062
diff changeset
   367
  by (blast intro: antisym inf_le1 inf_greatest sup_ge1)
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   368
44918
6a80fbc4e72c tune simpset for Complete_Lattices
noschinl
parents: 44845
diff changeset
   369
lemma sup_inf_absorb [simp]: "x \<squnion> (x \<sqinter> y) = x"
25102
db3e412c4cb1 antisymmetry not a default intro rule any longer
haftmann
parents: 25062
diff changeset
   370
  by (blast intro: antisym sup_ge1 sup_least inf_le1)
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   371
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   372
lemmas inf_sup_aci = inf_aci sup_aci
21734
283461c15fa7 renaming
nipkow
parents: 21733
diff changeset
   373
22454
c3654ba76a09 integrated with LOrder.thy
haftmann
parents: 22422
diff changeset
   374
lemmas inf_sup_ord = inf_le1 inf_le2 sup_ge1 sup_ge2
c3654ba76a09 integrated with LOrder.thy
haftmann
parents: 22422
diff changeset
   375
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
   376
text\<open>Towards distributivity\<close>
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   377
21734
283461c15fa7 renaming
nipkow
parents: 21733
diff changeset
   378
lemma distrib_sup_le: "x \<squnion> (y \<sqinter> z) \<sqsubseteq> (x \<squnion> y) \<sqinter> (x \<squnion> z)"
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   379
  by (auto intro: le_infI1 le_infI2 le_supI1 le_supI2)
21734
283461c15fa7 renaming
nipkow
parents: 21733
diff changeset
   380
283461c15fa7 renaming
nipkow
parents: 21733
diff changeset
   381
lemma distrib_inf_le: "(x \<sqinter> y) \<squnion> (x \<sqinter> z) \<sqsubseteq> x \<sqinter> (y \<squnion> z)"
32064
53ca12ff305d refinement of lattice classes
haftmann
parents: 32063
diff changeset
   382
  by (auto intro: le_infI1 le_infI2 le_supI1 le_supI2)
21734
283461c15fa7 renaming
nipkow
parents: 21733
diff changeset
   383
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
   384
text\<open>If you have one of them, you have them all.\<close>
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   385
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   386
lemma distrib_imp1:
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   387
assumes D: "!!x y z. x \<sqinter> (y \<squnion> z) = (x \<sqinter> y) \<squnion> (x \<sqinter> z)"
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   388
shows "x \<squnion> (y \<sqinter> z) = (x \<squnion> y) \<sqinter> (x \<squnion> z)"
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   389
proof-
44918
6a80fbc4e72c tune simpset for Complete_Lattices
noschinl
parents: 44845
diff changeset
   390
  have "x \<squnion> (y \<sqinter> z) = (x \<squnion> (x \<sqinter> z)) \<squnion> (y \<sqinter> z)" by simp
6a80fbc4e72c tune simpset for Complete_Lattices
noschinl
parents: 44845
diff changeset
   391
  also have "\<dots> = x \<squnion> (z \<sqinter> (x \<squnion> y))"
6a80fbc4e72c tune simpset for Complete_Lattices
noschinl
parents: 44845
diff changeset
   392
    by (simp add: D inf_commute sup_assoc del: sup_inf_absorb)
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   393
  also have "\<dots> = ((x \<squnion> y) \<sqinter> x) \<squnion> ((x \<squnion> y) \<sqinter> z)"
44919
482f1807976e tune proofs
noschinl
parents: 44918
diff changeset
   394
    by(simp add: inf_commute)
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   395
  also have "\<dots> = (x \<squnion> y) \<sqinter> (x \<squnion> z)" by(simp add:D)
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   396
  finally show ?thesis .
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   397
qed
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   398
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   399
lemma distrib_imp2:
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   400
assumes D: "!!x y z. x \<squnion> (y \<sqinter> z) = (x \<squnion> y) \<sqinter> (x \<squnion> z)"
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   401
shows "x \<sqinter> (y \<squnion> z) = (x \<sqinter> y) \<squnion> (x \<sqinter> z)"
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   402
proof-
44918
6a80fbc4e72c tune simpset for Complete_Lattices
noschinl
parents: 44845
diff changeset
   403
  have "x \<sqinter> (y \<squnion> z) = (x \<sqinter> (x \<squnion> z)) \<sqinter> (y \<squnion> z)" by simp
6a80fbc4e72c tune simpset for Complete_Lattices
noschinl
parents: 44845
diff changeset
   404
  also have "\<dots> = x \<sqinter> (z \<squnion> (x \<sqinter> y))"
6a80fbc4e72c tune simpset for Complete_Lattices
noschinl
parents: 44845
diff changeset
   405
    by (simp add: D sup_commute inf_assoc del: inf_sup_absorb)
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   406
  also have "\<dots> = ((x \<sqinter> y) \<squnion> x) \<sqinter> ((x \<sqinter> y) \<squnion> z)"
44919
482f1807976e tune proofs
noschinl
parents: 44918
diff changeset
   407
    by(simp add: sup_commute)
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   408
  also have "\<dots> = (x \<sqinter> y) \<squnion> (x \<sqinter> z)" by(simp add:D)
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   409
  finally show ?thesis .
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   410
qed
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   411
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   412
end
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   413
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
   414
subsubsection \<open>Strict order\<close>
32568
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   415
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 34973
diff changeset
   416
context semilattice_inf
32568
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   417
begin
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   418
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   419
lemma less_infI1:
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   420
  "a \<sqsubset> x \<Longrightarrow> a \<sqinter> b \<sqsubset> x"
32642
026e7c6a6d08 be more cautious wrt. simp rules: inf_absorb1, inf_absorb2, sup_absorb1, sup_absorb2 are no simp rules by default any longer
haftmann
parents: 32568
diff changeset
   421
  by (auto simp add: less_le inf_absorb1 intro: le_infI1)
32568
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   422
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   423
lemma less_infI2:
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   424
  "b \<sqsubset> x \<Longrightarrow> a \<sqinter> b \<sqsubset> x"
32642
026e7c6a6d08 be more cautious wrt. simp rules: inf_absorb1, inf_absorb2, sup_absorb1, sup_absorb2 are no simp rules by default any longer
haftmann
parents: 32568
diff changeset
   425
  by (auto simp add: less_le inf_absorb2 intro: le_infI2)
32568
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   426
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   427
end
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   428
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 34973
diff changeset
   429
context semilattice_sup
32568
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   430
begin
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   431
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   432
lemma less_supI1:
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   433
  "x \<sqsubset> a \<Longrightarrow> x \<sqsubset> a \<squnion> b"
44921
58eef4843641 tuned proofs
huffman
parents: 44919
diff changeset
   434
  using dual_semilattice
58eef4843641 tuned proofs
huffman
parents: 44919
diff changeset
   435
  by (rule semilattice_inf.less_infI1)
32568
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   436
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   437
lemma less_supI2:
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   438
  "x \<sqsubset> b \<Longrightarrow> x \<sqsubset> a \<squnion> b"
44921
58eef4843641 tuned proofs
huffman
parents: 44919
diff changeset
   439
  using dual_semilattice
58eef4843641 tuned proofs
huffman
parents: 44919
diff changeset
   440
  by (rule semilattice_inf.less_infI2)
32568
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   441
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   442
end
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   443
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   444
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
   445
subsection \<open>Distributive lattices\<close>
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   446
22454
c3654ba76a09 integrated with LOrder.thy
haftmann
parents: 22422
diff changeset
   447
class distrib_lattice = lattice +
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   448
  assumes sup_inf_distrib1: "x \<squnion> (y \<sqinter> z) = (x \<squnion> y) \<sqinter> (x \<squnion> z)"
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   449
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   450
context distrib_lattice
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   451
begin
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   452
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   453
lemma sup_inf_distrib2:
44921
58eef4843641 tuned proofs
huffman
parents: 44919
diff changeset
   454
  "(y \<sqinter> z) \<squnion> x = (y \<squnion> x) \<sqinter> (z \<squnion> x)"
58eef4843641 tuned proofs
huffman
parents: 44919
diff changeset
   455
  by (simp add: sup_commute sup_inf_distrib1)
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   456
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   457
lemma inf_sup_distrib1:
44921
58eef4843641 tuned proofs
huffman
parents: 44919
diff changeset
   458
  "x \<sqinter> (y \<squnion> z) = (x \<sqinter> y) \<squnion> (x \<sqinter> z)"
58eef4843641 tuned proofs
huffman
parents: 44919
diff changeset
   459
  by (rule distrib_imp2 [OF sup_inf_distrib1])
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   460
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   461
lemma inf_sup_distrib2:
44921
58eef4843641 tuned proofs
huffman
parents: 44919
diff changeset
   462
  "(y \<squnion> z) \<sqinter> x = (y \<sqinter> x) \<squnion> (z \<sqinter> x)"
58eef4843641 tuned proofs
huffman
parents: 44919
diff changeset
   463
  by (simp add: inf_commute inf_sup_distrib1)
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   464
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   465
lemma dual_distrib_lattice:
44845
5e51075cbd97 added syntactic classes for "inf" and "sup"
krauss
parents: 44085
diff changeset
   466
  "class.distrib_lattice sup (op \<ge>) (op >) inf"
36635
080b755377c0 locale predicates of classes carry a mandatory "class" prefix
haftmann
parents: 36352
diff changeset
   467
  by (rule class.distrib_lattice.intro, rule dual_lattice)
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   468
    (unfold_locales, fact inf_sup_distrib1)
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   469
36008
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   470
lemmas sup_inf_distrib =
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   471
  sup_inf_distrib1 sup_inf_distrib2
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   472
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   473
lemmas inf_sup_distrib =
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   474
  inf_sup_distrib1 inf_sup_distrib2
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   475
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   476
lemmas distrib =
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   477
  sup_inf_distrib1 sup_inf_distrib2 inf_sup_distrib1 inf_sup_distrib2
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   478
21733
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   479
end
131dd2a27137 Modified lattice locale
nipkow
parents: 21619
diff changeset
   480
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
   481
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
   482
subsection \<open>Bounded lattices and boolean algebras\<close>
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   483
52729
412c9e0381a1 factored syntactic type classes for bot and top (by Alessandro Coglio)
haftmann
parents: 52152
diff changeset
   484
class bounded_semilattice_inf_top = semilattice_inf + order_top
52152
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   485
begin
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   486
61605
1bf7b186542e qualifier is mandatory by default;
wenzelm
parents: 61169
diff changeset
   487
sublocale inf_top: semilattice_neutr inf top
1bf7b186542e qualifier is mandatory by default;
wenzelm
parents: 61169
diff changeset
   488
  + inf_top: semilattice_neutr_order inf top less_eq less
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   489
proof
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   490
  fix x
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   491
  show "x \<sqinter> \<top> = x"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   492
    by (rule inf_absorb1) simp
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   493
qed
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   494
52152
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   495
end
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   496
52729
412c9e0381a1 factored syntactic type classes for bot and top (by Alessandro Coglio)
haftmann
parents: 52152
diff changeset
   497
class bounded_semilattice_sup_bot = semilattice_sup + order_bot
52152
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   498
begin
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   499
61605
1bf7b186542e qualifier is mandatory by default;
wenzelm
parents: 61169
diff changeset
   500
sublocale sup_bot: semilattice_neutr sup bot
1bf7b186542e qualifier is mandatory by default;
wenzelm
parents: 61169
diff changeset
   501
  + sup_bot: semilattice_neutr_order sup bot greater_eq greater
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   502
proof
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   503
  fix x
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   504
  show "x \<squnion> \<bottom> = x"
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   505
    by (rule sup_absorb1) simp
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   506
qed
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   507
52152
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   508
end
b561cdce6c4c examples for interpretation into target
haftmann
parents: 51593
diff changeset
   509
52729
412c9e0381a1 factored syntactic type classes for bot and top (by Alessandro Coglio)
haftmann
parents: 52152
diff changeset
   510
class bounded_lattice_bot = lattice + order_bot
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   511
begin
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   512
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   513
subclass bounded_semilattice_sup_bot ..
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   514
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   515
lemma inf_bot_left [simp]:
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   516
  "\<bottom> \<sqinter> x = \<bottom>"
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   517
  by (rule inf_absorb1) simp
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   518
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   519
lemma inf_bot_right [simp]:
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   520
  "x \<sqinter> \<bottom> = \<bottom>"
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   521
  by (rule inf_absorb2) simp
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   522
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   523
lemma sup_bot_left:
36352
f71978e47cd5 add bounded_lattice_bot and bounded_lattice_top type classes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 36096
diff changeset
   524
  "\<bottom> \<squnion> x = x"
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   525
  by (fact sup_bot.left_neutral)
36352
f71978e47cd5 add bounded_lattice_bot and bounded_lattice_top type classes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 36096
diff changeset
   526
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   527
lemma sup_bot_right:
36352
f71978e47cd5 add bounded_lattice_bot and bounded_lattice_top type classes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 36096
diff changeset
   528
  "x \<squnion> \<bottom> = x"
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   529
  by (fact sup_bot.right_neutral)
36352
f71978e47cd5 add bounded_lattice_bot and bounded_lattice_top type classes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 36096
diff changeset
   530
f71978e47cd5 add bounded_lattice_bot and bounded_lattice_top type classes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 36096
diff changeset
   531
lemma sup_eq_bot_iff [simp]:
f71978e47cd5 add bounded_lattice_bot and bounded_lattice_top type classes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 36096
diff changeset
   532
  "x \<squnion> y = \<bottom> \<longleftrightarrow> x = \<bottom> \<and> y = \<bottom>"
f71978e47cd5 add bounded_lattice_bot and bounded_lattice_top type classes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 36096
diff changeset
   533
  by (simp add: eq_iff)
f71978e47cd5 add bounded_lattice_bot and bounded_lattice_top type classes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 36096
diff changeset
   534
51593
d40aec502416 added lemma
nipkow
parents: 51546
diff changeset
   535
lemma bot_eq_sup_iff [simp]:
d40aec502416 added lemma
nipkow
parents: 51546
diff changeset
   536
  "\<bottom> = x \<squnion> y \<longleftrightarrow> x = \<bottom> \<and> y = \<bottom>"
d40aec502416 added lemma
nipkow
parents: 51546
diff changeset
   537
  by (simp add: eq_iff)
d40aec502416 added lemma
nipkow
parents: 51546
diff changeset
   538
36352
f71978e47cd5 add bounded_lattice_bot and bounded_lattice_top type classes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 36096
diff changeset
   539
end
f71978e47cd5 add bounded_lattice_bot and bounded_lattice_top type classes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 36096
diff changeset
   540
52729
412c9e0381a1 factored syntactic type classes for bot and top (by Alessandro Coglio)
haftmann
parents: 52152
diff changeset
   541
class bounded_lattice_top = lattice + order_top
36352
f71978e47cd5 add bounded_lattice_bot and bounded_lattice_top type classes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 36096
diff changeset
   542
begin
f71978e47cd5 add bounded_lattice_bot and bounded_lattice_top type classes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 36096
diff changeset
   543
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   544
subclass bounded_semilattice_inf_top ..
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   545
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   546
lemma sup_top_left [simp]:
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   547
  "\<top> \<squnion> x = \<top>"
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   548
  by (rule sup_absorb1) simp
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   549
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   550
lemma sup_top_right [simp]:
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   551
  "x \<squnion> \<top> = \<top>"
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   552
  by (rule sup_absorb2) simp
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   553
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   554
lemma inf_top_left:
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   555
  "\<top> \<sqinter> x = x"
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   556
  by (fact inf_top.left_neutral)
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   557
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   558
lemma inf_top_right:
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   559
  "x \<sqinter> \<top> = x"
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   560
  by (fact inf_top.right_neutral)
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   561
36008
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   562
lemma inf_eq_top_iff [simp]:
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   563
  "x \<sqinter> y = \<top> \<longleftrightarrow> x = \<top> \<and> y = \<top>"
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   564
  by (simp add: eq_iff)
32568
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   565
36352
f71978e47cd5 add bounded_lattice_bot and bounded_lattice_top type classes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 36096
diff changeset
   566
end
f71978e47cd5 add bounded_lattice_bot and bounded_lattice_top type classes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 36096
diff changeset
   567
52729
412c9e0381a1 factored syntactic type classes for bot and top (by Alessandro Coglio)
haftmann
parents: 52152
diff changeset
   568
class bounded_lattice = lattice + order_bot + order_top
36352
f71978e47cd5 add bounded_lattice_bot and bounded_lattice_top type classes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 36096
diff changeset
   569
begin
f71978e47cd5 add bounded_lattice_bot and bounded_lattice_top type classes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 36096
diff changeset
   570
51487
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   571
subclass bounded_lattice_bot ..
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   572
subclass bounded_lattice_top ..
f4bfdee99304 locales for abstract orders
haftmann
parents: 51387
diff changeset
   573
36352
f71978e47cd5 add bounded_lattice_bot and bounded_lattice_top type classes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 36096
diff changeset
   574
lemma dual_bounded_lattice:
44845
5e51075cbd97 added syntactic classes for "inf" and "sup"
krauss
parents: 44085
diff changeset
   575
  "class.bounded_lattice sup greater_eq greater inf \<top> \<bottom>"
36352
f71978e47cd5 add bounded_lattice_bot and bounded_lattice_top type classes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 36096
diff changeset
   576
  by unfold_locales (auto simp add: less_le_not_le)
32568
89518a3074e1 some lemmas about strict order in lattices
haftmann
parents: 32512
diff changeset
   577
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   578
end
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   579
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   580
class boolean_algebra = distrib_lattice + bounded_lattice + minus + uminus +
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   581
  assumes inf_compl_bot: "x \<sqinter> - x = \<bottom>"
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   582
    and sup_compl_top: "x \<squnion> - x = \<top>"
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   583
  assumes diff_eq: "x - y = x \<sqinter> - y"
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   584
begin
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   585
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   586
lemma dual_boolean_algebra:
44845
5e51075cbd97 added syntactic classes for "inf" and "sup"
krauss
parents: 44085
diff changeset
   587
  "class.boolean_algebra (\<lambda>x y. x \<squnion> - y) uminus sup greater_eq greater inf \<top> \<bottom>"
36635
080b755377c0 locale predicates of classes carry a mandatory "class" prefix
haftmann
parents: 36352
diff changeset
   588
  by (rule class.boolean_algebra.intro, rule dual_bounded_lattice, rule dual_distrib_lattice)
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   589
    (unfold_locales, auto simp add: inf_compl_bot sup_compl_top diff_eq)
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   590
44918
6a80fbc4e72c tune simpset for Complete_Lattices
noschinl
parents: 44845
diff changeset
   591
lemma compl_inf_bot [simp]:
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   592
  "- x \<sqinter> x = \<bottom>"
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   593
  by (simp add: inf_commute inf_compl_bot)
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   594
44918
6a80fbc4e72c tune simpset for Complete_Lattices
noschinl
parents: 44845
diff changeset
   595
lemma compl_sup_top [simp]:
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   596
  "- x \<squnion> x = \<top>"
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   597
  by (simp add: sup_commute sup_compl_top)
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   598
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   599
lemma compl_unique:
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   600
  assumes "x \<sqinter> y = \<bottom>"
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   601
    and "x \<squnion> y = \<top>"
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   602
  shows "- x = y"
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   603
proof -
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   604
  have "(x \<sqinter> - x) \<squnion> (- x \<sqinter> y) = (x \<sqinter> y) \<squnion> (- x \<sqinter> y)"
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   605
    using inf_compl_bot assms(1) by simp
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   606
  then have "(- x \<sqinter> x) \<squnion> (- x \<sqinter> y) = (y \<sqinter> x) \<squnion> (y \<sqinter> - x)"
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   607
    by (simp add: inf_commute)
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   608
  then have "- x \<sqinter> (x \<squnion> y) = y \<sqinter> (x \<squnion> - x)"
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   609
    by (simp add: inf_sup_distrib1)
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   610
  then have "- x \<sqinter> \<top> = y \<sqinter> \<top>"
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   611
    using sup_compl_top assms(2) by simp
34209
c7f621786035 killed a few warnings
krauss
parents: 34007
diff changeset
   612
  then show "- x = y" by simp
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   613
qed
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   614
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   615
lemma double_compl [simp]:
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   616
  "- (- x) = x"
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   617
  using compl_inf_bot compl_sup_top by (rule compl_unique)
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   618
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   619
lemma compl_eq_compl_iff [simp]:
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   620
  "- x = - y \<longleftrightarrow> x = y"
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   621
proof
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   622
  assume "- x = - y"
36008
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   623
  then have "- (- x) = - (- y)" by (rule arg_cong)
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   624
  then show "x = y" by simp
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   625
next
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   626
  assume "x = y"
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   627
  then show "- x = - y" by simp
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   628
qed
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   629
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   630
lemma compl_bot_eq [simp]:
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   631
  "- \<bottom> = \<top>"
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   632
proof -
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   633
  from sup_compl_top have "\<bottom> \<squnion> - \<bottom> = \<top>" .
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   634
  then show ?thesis by simp
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   635
qed
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   636
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   637
lemma compl_top_eq [simp]:
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   638
  "- \<top> = \<bottom>"
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   639
proof -
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   640
  from inf_compl_bot have "\<top> \<sqinter> - \<top> = \<bottom>" .
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   641
  then show ?thesis by simp
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   642
qed
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   643
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   644
lemma compl_inf [simp]:
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   645
  "- (x \<sqinter> y) = - x \<squnion> - y"
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   646
proof (rule compl_unique)
36008
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   647
  have "(x \<sqinter> y) \<sqinter> (- x \<squnion> - y) = (y \<sqinter> (x \<sqinter> - x)) \<squnion> (x \<sqinter> (y \<sqinter> - y))"
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   648
    by (simp only: inf_sup_distrib inf_aci)
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   649
  then show "(x \<sqinter> y) \<sqinter> (- x \<squnion> - y) = \<bottom>"
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   650
    by (simp add: inf_compl_bot)
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   651
next
36008
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   652
  have "(x \<sqinter> y) \<squnion> (- x \<squnion> - y) = (- y \<squnion> (x \<squnion> - x)) \<sqinter> (- x \<squnion> (y \<squnion> - y))"
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   653
    by (simp only: sup_inf_distrib sup_aci)
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   654
  then show "(x \<sqinter> y) \<squnion> (- x \<squnion> - y) = \<top>"
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   655
    by (simp add: sup_compl_top)
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   656
qed
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   657
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   658
lemma compl_sup [simp]:
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   659
  "- (x \<squnion> y) = - x \<sqinter> - y"
44921
58eef4843641 tuned proofs
huffman
parents: 44919
diff changeset
   660
  using dual_boolean_algebra
58eef4843641 tuned proofs
huffman
parents: 44919
diff changeset
   661
  by (rule boolean_algebra.compl_inf)
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   662
36008
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   663
lemma compl_mono:
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   664
  "x \<sqsubseteq> y \<Longrightarrow> - y \<sqsubseteq> - x"
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   665
proof -
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   666
  assume "x \<sqsubseteq> y"
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   667
  then have "x \<squnion> y = y" by (simp only: le_iff_sup)
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   668
  then have "- (x \<squnion> y) = - y" by simp
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   669
  then have "- x \<sqinter> - y = - y" by simp
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   670
  then have "- y \<sqinter> - x = - y" by (simp only: inf_commute)
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   671
  then show "- y \<sqsubseteq> - x" by (simp only: le_iff_inf)
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   672
qed
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   673
44918
6a80fbc4e72c tune simpset for Complete_Lattices
noschinl
parents: 44845
diff changeset
   674
lemma compl_le_compl_iff [simp]:
43753
fe5e846c0839 tuned notation
haftmann
parents: 41082
diff changeset
   675
  "- x \<sqsubseteq> - y \<longleftrightarrow> y \<sqsubseteq> x"
43873
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   676
  by (auto dest: compl_mono)
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   677
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   678
lemma compl_le_swap1:
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   679
  assumes "y \<sqsubseteq> - x" shows "x \<sqsubseteq> -y"
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   680
proof -
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   681
  from assms have "- (- x) \<sqsubseteq> - y" by (simp only: compl_le_compl_iff)
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   682
  then show ?thesis by simp
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   683
qed
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   684
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   685
lemma compl_le_swap2:
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   686
  assumes "- y \<sqsubseteq> x" shows "- x \<sqsubseteq> y"
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   687
proof -
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   688
  from assms have "- x \<sqsubseteq> - (- y)" by (simp only: compl_le_compl_iff)
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   689
  then show ?thesis by simp
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   690
qed
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   691
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   692
lemma compl_less_compl_iff: (* TODO: declare [simp] ? *)
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   693
  "- x \<sqsubset> - y \<longleftrightarrow> y \<sqsubset> x"
44919
482f1807976e tune proofs
noschinl
parents: 44918
diff changeset
   694
  by (auto simp add: less_le)
43873
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   695
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   696
lemma compl_less_swap1:
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   697
  assumes "y \<sqsubset> - x" shows "x \<sqsubset> - y"
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   698
proof -
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   699
  from assms have "- (- x) \<sqsubset> - y" by (simp only: compl_less_compl_iff)
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   700
  then show ?thesis by simp
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   701
qed
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   702
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   703
lemma compl_less_swap2:
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   704
  assumes "- y \<sqsubset> x" shows "- x \<sqsubset> y"
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   705
proof -
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   706
  from assms have "- x \<sqsubset> - (- y)" by (simp only: compl_less_compl_iff)
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   707
  then show ?thesis by simp
8a2f339641c1 more on complement
haftmann
parents: 43753
diff changeset
   708
qed
36008
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   709
61629
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   710
lemma sup_cancel_left1: "sup (sup x a) (sup (- x) b) = top"
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   711
by(simp add: inf_sup_aci sup_compl_top)
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   712
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   713
lemma sup_cancel_left2: "sup (sup (- x) a) (sup x b) = top"
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   714
by(simp add: inf_sup_aci sup_compl_top)
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   715
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   716
lemma inf_cancel_left1: "inf (inf x a) (inf (- x) b) = bot"
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   717
by(simp add: inf_sup_aci inf_compl_bot)
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   718
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   719
lemma inf_cancel_left2: "inf (inf (- x) a) (inf x b) = bot"
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   720
by(simp add: inf_sup_aci inf_compl_bot)
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   721
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   722
declare inf_compl_bot [simp] sup_compl_top [simp]
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   723
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   724
lemma sup_compl_top_left1 [simp]: "sup (- x) (sup x y) = top"
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   725
by(simp add: sup_assoc[symmetric])
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   726
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   727
lemma sup_compl_top_left2 [simp]: "sup x (sup (- x) y) = top"
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   728
using sup_compl_top_left1[of "- x" y] by simp
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   729
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   730
lemma inf_compl_bot_left1 [simp]: "inf (- x) (inf x y) = bot"
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   731
by(simp add: inf_assoc[symmetric])
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   732
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   733
lemma inf_compl_bot_left2 [simp]: "inf x (inf (- x) y) = bot"
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   734
using inf_compl_bot_left1[of "- x" y] by simp
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   735
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   736
lemma inf_compl_bot_right [simp]: "inf x (inf y (- x)) = bot"
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   737
by(subst inf_left_commute) simp
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   738
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   739
end
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   740
61629
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   741
ML_file "Tools/boolean_algebra_cancel.ML"
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   742
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   743
simproc_setup boolean_algebra_cancel_sup ("sup a b::'a::boolean_algebra") =
61799
4cf66f21b764 isabelle update_cartouches -c -t;
wenzelm
parents: 61629
diff changeset
   744
  \<open>fn phi => fn ss => try Boolean_Algebra_Cancel.cancel_sup_conv\<close>
61629
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   745
90f54d9e63f2 cancel complementary terms as arguments to sup/inf in boolean algebras
Andreas Lochbihler
parents: 61605
diff changeset
   746
simproc_setup boolean_algebra_cancel_inf ("inf a b::'a::boolean_algebra") =
61799
4cf66f21b764 isabelle update_cartouches -c -t;
wenzelm
parents: 61629
diff changeset
   747
  \<open>fn phi => fn ss => try Boolean_Algebra_Cancel.cancel_inf_conv\<close>
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   748
61799
4cf66f21b764 isabelle update_cartouches -c -t;
wenzelm
parents: 61629
diff changeset
   749
subsection \<open>\<open>min/max\<close> as special case of lattice\<close>
51540
eea5c4ca4a0e explicit sublocale dependency for Min/Max yields more appropriate Min/Max prefix for a couple of facts
haftmann
parents: 51489
diff changeset
   750
54861
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   751
context linorder
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   752
begin
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   753
61605
1bf7b186542e qualifier is mandatory by default;
wenzelm
parents: 61169
diff changeset
   754
sublocale min: semilattice_order min less_eq less
1bf7b186542e qualifier is mandatory by default;
wenzelm
parents: 61169
diff changeset
   755
  + max: semilattice_order max greater_eq greater
61169
4de9ff3ea29a tuned proofs -- less legacy;
wenzelm
parents: 61076
diff changeset
   756
  by standard (auto simp add: min_def max_def)
51540
eea5c4ca4a0e explicit sublocale dependency for Min/Max yields more appropriate Min/Max prefix for a couple of facts
haftmann
parents: 51489
diff changeset
   757
54861
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   758
lemma min_le_iff_disj:
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   759
  "min x y \<le> z \<longleftrightarrow> x \<le> z \<or> y \<le> z"
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   760
  unfolding min_def using linear by (auto intro: order_trans)
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   761
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   762
lemma le_max_iff_disj:
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   763
  "z \<le> max x y \<longleftrightarrow> z \<le> x \<or> z \<le> y"
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   764
  unfolding max_def using linear by (auto intro: order_trans)
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   765
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   766
lemma min_less_iff_disj:
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   767
  "min x y < z \<longleftrightarrow> x < z \<or> y < z"
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   768
  unfolding min_def le_less using less_linear by (auto intro: less_trans)
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   769
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   770
lemma less_max_iff_disj:
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   771
  "z < max x y \<longleftrightarrow> z < x \<or> z < y"
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   772
  unfolding max_def le_less using less_linear by (auto intro: less_trans)
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   773
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   774
lemma min_less_iff_conj [simp]:
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   775
  "z < min x y \<longleftrightarrow> z < x \<and> z < y"
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   776
  unfolding min_def le_less using less_linear by (auto intro: less_trans)
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   777
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   778
lemma max_less_iff_conj [simp]:
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   779
  "max x y < z \<longleftrightarrow> x < z \<and> y < z"
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   780
  unfolding max_def le_less using less_linear by (auto intro: less_trans)
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   781
54862
c65e5cbdbc97 explicit distributivity facts on min/max
haftmann
parents: 54861
diff changeset
   782
lemma min_max_distrib1:
c65e5cbdbc97 explicit distributivity facts on min/max
haftmann
parents: 54861
diff changeset
   783
  "min (max b c) a = max (min b a) (min c a)"
c65e5cbdbc97 explicit distributivity facts on min/max
haftmann
parents: 54861
diff changeset
   784
  by (auto simp add: min_def max_def not_le dest: le_less_trans less_trans intro: antisym)
c65e5cbdbc97 explicit distributivity facts on min/max
haftmann
parents: 54861
diff changeset
   785
c65e5cbdbc97 explicit distributivity facts on min/max
haftmann
parents: 54861
diff changeset
   786
lemma min_max_distrib2:
c65e5cbdbc97 explicit distributivity facts on min/max
haftmann
parents: 54861
diff changeset
   787
  "min a (max b c) = max (min a b) (min a c)"
c65e5cbdbc97 explicit distributivity facts on min/max
haftmann
parents: 54861
diff changeset
   788
  by (auto simp add: min_def max_def not_le dest: le_less_trans less_trans intro: antisym)
c65e5cbdbc97 explicit distributivity facts on min/max
haftmann
parents: 54861
diff changeset
   789
c65e5cbdbc97 explicit distributivity facts on min/max
haftmann
parents: 54861
diff changeset
   790
lemma max_min_distrib1:
c65e5cbdbc97 explicit distributivity facts on min/max
haftmann
parents: 54861
diff changeset
   791
  "max (min b c) a = min (max b a) (max c a)"
c65e5cbdbc97 explicit distributivity facts on min/max
haftmann
parents: 54861
diff changeset
   792
  by (auto simp add: min_def max_def not_le dest: le_less_trans less_trans intro: antisym)
c65e5cbdbc97 explicit distributivity facts on min/max
haftmann
parents: 54861
diff changeset
   793
c65e5cbdbc97 explicit distributivity facts on min/max
haftmann
parents: 54861
diff changeset
   794
lemma max_min_distrib2:
c65e5cbdbc97 explicit distributivity facts on min/max
haftmann
parents: 54861
diff changeset
   795
  "max a (min b c) = min (max a b) (max a c)"
c65e5cbdbc97 explicit distributivity facts on min/max
haftmann
parents: 54861
diff changeset
   796
  by (auto simp add: min_def max_def not_le dest: le_less_trans less_trans intro: antisym)
c65e5cbdbc97 explicit distributivity facts on min/max
haftmann
parents: 54861
diff changeset
   797
c65e5cbdbc97 explicit distributivity facts on min/max
haftmann
parents: 54861
diff changeset
   798
lemmas min_max_distribs = min_max_distrib1 min_max_distrib2 max_min_distrib1 max_min_distrib2
c65e5cbdbc97 explicit distributivity facts on min/max
haftmann
parents: 54861
diff changeset
   799
54861
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   800
lemma split_min [no_atp]:
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   801
  "P (min i j) \<longleftrightarrow> (i \<le> j \<longrightarrow> P i) \<and> (\<not> i \<le> j \<longrightarrow> P j)"
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   802
  by (simp add: min_def)
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   803
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   804
lemma split_max [no_atp]:
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   805
  "P (max i j) \<longleftrightarrow> (i \<le> j \<longrightarrow> P j) \<and> (\<not> i \<le> j \<longrightarrow> P i)"
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   806
  by (simp add: max_def)
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   807
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   808
lemma min_of_mono:
61076
bdc1e2f0a86a eliminated \<Colon>;
wenzelm
parents: 60758
diff changeset
   809
  fixes f :: "'a \<Rightarrow> 'b::linorder"
54861
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   810
  shows "mono f \<Longrightarrow> min (f m) (f n) = f (min m n)"
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   811
  by (auto simp: mono_def Orderings.min_def min_def intro: Orderings.antisym)
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   812
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   813
lemma max_of_mono:
61076
bdc1e2f0a86a eliminated \<Colon>;
wenzelm
parents: 60758
diff changeset
   814
  fixes f :: "'a \<Rightarrow> 'b::linorder"
54861
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   815
  shows "mono f \<Longrightarrow> max (f m) (f n) = f (max m n)"
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   816
  by (auto simp: mono_def Orderings.max_def max_def intro: Orderings.antisym)
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   817
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   818
end
00d551179872 postponed min/max lemmas until abstract lattice is available
haftmann
parents: 54859
diff changeset
   819
61076
bdc1e2f0a86a eliminated \<Colon>;
wenzelm
parents: 60758
diff changeset
   820
lemma inf_min: "inf = (min :: 'a::{semilattice_inf,linorder} \<Rightarrow> 'a \<Rightarrow> 'a)"
51540
eea5c4ca4a0e explicit sublocale dependency for Min/Max yields more appropriate Min/Max prefix for a couple of facts
haftmann
parents: 51489
diff changeset
   821
  by (auto intro: antisym simp add: min_def fun_eq_iff)
eea5c4ca4a0e explicit sublocale dependency for Min/Max yields more appropriate Min/Max prefix for a couple of facts
haftmann
parents: 51489
diff changeset
   822
61076
bdc1e2f0a86a eliminated \<Colon>;
wenzelm
parents: 60758
diff changeset
   823
lemma sup_max: "sup = (max :: 'a::{semilattice_sup,linorder} \<Rightarrow> 'a \<Rightarrow> 'a)"
51540
eea5c4ca4a0e explicit sublocale dependency for Min/Max yields more appropriate Min/Max prefix for a couple of facts
haftmann
parents: 51489
diff changeset
   824
  by (auto intro: antisym simp add: max_def fun_eq_iff)
eea5c4ca4a0e explicit sublocale dependency for Min/Max yields more appropriate Min/Max prefix for a couple of facts
haftmann
parents: 51489
diff changeset
   825
eea5c4ca4a0e explicit sublocale dependency for Min/Max yields more appropriate Min/Max prefix for a couple of facts
haftmann
parents: 51489
diff changeset
   826
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
   827
subsection \<open>Uniqueness of inf and sup\<close>
22454
c3654ba76a09 integrated with LOrder.thy
haftmann
parents: 22422
diff changeset
   828
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 34973
diff changeset
   829
lemma (in semilattice_inf) inf_unique:
22454
c3654ba76a09 integrated with LOrder.thy
haftmann
parents: 22422
diff changeset
   830
  fixes f (infixl "\<triangle>" 70)
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   831
  assumes le1: "\<And>x y. x \<triangle> y \<sqsubseteq> x" and le2: "\<And>x y. x \<triangle> y \<sqsubseteq> y"
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   832
  and greatest: "\<And>x y z. x \<sqsubseteq> y \<Longrightarrow> x \<sqsubseteq> z \<Longrightarrow> x \<sqsubseteq> y \<triangle> z"
22737
haftmann
parents: 22548
diff changeset
   833
  shows "x \<sqinter> y = x \<triangle> y"
22454
c3654ba76a09 integrated with LOrder.thy
haftmann
parents: 22422
diff changeset
   834
proof (rule antisym)
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   835
  show "x \<triangle> y \<sqsubseteq> x \<sqinter> y" by (rule le_infI) (rule le1, rule le2)
22454
c3654ba76a09 integrated with LOrder.thy
haftmann
parents: 22422
diff changeset
   836
next
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   837
  have leI: "\<And>x y z. x \<sqsubseteq> y \<Longrightarrow> x \<sqsubseteq> z \<Longrightarrow> x \<sqsubseteq> y \<triangle> z" by (blast intro: greatest)
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   838
  show "x \<sqinter> y \<sqsubseteq> x \<triangle> y" by (rule leI) simp_all
22454
c3654ba76a09 integrated with LOrder.thy
haftmann
parents: 22422
diff changeset
   839
qed
c3654ba76a09 integrated with LOrder.thy
haftmann
parents: 22422
diff changeset
   840
35028
108662d50512 more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents: 34973
diff changeset
   841
lemma (in semilattice_sup) sup_unique:
22454
c3654ba76a09 integrated with LOrder.thy
haftmann
parents: 22422
diff changeset
   842
  fixes f (infixl "\<nabla>" 70)
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   843
  assumes ge1 [simp]: "\<And>x y. x \<sqsubseteq> x \<nabla> y" and ge2: "\<And>x y. y \<sqsubseteq> x \<nabla> y"
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   844
  and least: "\<And>x y z. y \<sqsubseteq> x \<Longrightarrow> z \<sqsubseteq> x \<Longrightarrow> y \<nabla> z \<sqsubseteq> x"
22737
haftmann
parents: 22548
diff changeset
   845
  shows "x \<squnion> y = x \<nabla> y"
22454
c3654ba76a09 integrated with LOrder.thy
haftmann
parents: 22422
diff changeset
   846
proof (rule antisym)
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   847
  show "x \<squnion> y \<sqsubseteq> x \<nabla> y" by (rule le_supI) (rule ge1, rule ge2)
22454
c3654ba76a09 integrated with LOrder.thy
haftmann
parents: 22422
diff changeset
   848
next
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   849
  have leI: "\<And>x y z. x \<sqsubseteq> z \<Longrightarrow> y \<sqsubseteq> z \<Longrightarrow> x \<nabla> y \<sqsubseteq> z" by (blast intro: least)
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   850
  show "x \<nabla> y \<sqsubseteq> x \<squnion> y" by (rule leI) simp_all
22454
c3654ba76a09 integrated with LOrder.thy
haftmann
parents: 22422
diff changeset
   851
qed
36008
23dfa8678c7c add/change some lemmas about lattices
huffman
parents: 35724
diff changeset
   852
22454
c3654ba76a09 integrated with LOrder.thy
haftmann
parents: 22422
diff changeset
   853
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
   854
subsection \<open>Lattice on @{typ bool}\<close>
22454
c3654ba76a09 integrated with LOrder.thy
haftmann
parents: 22422
diff changeset
   855
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   856
instantiation bool :: boolean_algebra
25510
38c15efe603b adjustions to due to instance target
haftmann
parents: 25482
diff changeset
   857
begin
38c15efe603b adjustions to due to instance target
haftmann
parents: 25482
diff changeset
   858
38c15efe603b adjustions to due to instance target
haftmann
parents: 25482
diff changeset
   859
definition
41080
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   860
  bool_Compl_def [simp]: "uminus = Not"
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   861
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   862
definition
41080
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   863
  bool_diff_def [simp]: "A - B \<longleftrightarrow> A \<and> \<not> B"
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   864
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   865
definition
41080
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   866
  [simp]: "P \<sqinter> Q \<longleftrightarrow> P \<and> Q"
25510
38c15efe603b adjustions to due to instance target
haftmann
parents: 25482
diff changeset
   867
38c15efe603b adjustions to due to instance target
haftmann
parents: 25482
diff changeset
   868
definition
41080
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   869
  [simp]: "P \<squnion> Q \<longleftrightarrow> P \<or> Q"
25510
38c15efe603b adjustions to due to instance target
haftmann
parents: 25482
diff changeset
   870
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   871
instance proof
41080
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   872
qed auto
22454
c3654ba76a09 integrated with LOrder.thy
haftmann
parents: 22422
diff changeset
   873
25510
38c15efe603b adjustions to due to instance target
haftmann
parents: 25482
diff changeset
   874
end
38c15efe603b adjustions to due to instance target
haftmann
parents: 25482
diff changeset
   875
32781
19c01bd7f6ae moved lemmas about sup on bool to Lattices.thy
haftmann
parents: 32780
diff changeset
   876
lemma sup_boolI1:
19c01bd7f6ae moved lemmas about sup on bool to Lattices.thy
haftmann
parents: 32780
diff changeset
   877
  "P \<Longrightarrow> P \<squnion> Q"
41080
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   878
  by simp
32781
19c01bd7f6ae moved lemmas about sup on bool to Lattices.thy
haftmann
parents: 32780
diff changeset
   879
19c01bd7f6ae moved lemmas about sup on bool to Lattices.thy
haftmann
parents: 32780
diff changeset
   880
lemma sup_boolI2:
19c01bd7f6ae moved lemmas about sup on bool to Lattices.thy
haftmann
parents: 32780
diff changeset
   881
  "Q \<Longrightarrow> P \<squnion> Q"
41080
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   882
  by simp
32781
19c01bd7f6ae moved lemmas about sup on bool to Lattices.thy
haftmann
parents: 32780
diff changeset
   883
19c01bd7f6ae moved lemmas about sup on bool to Lattices.thy
haftmann
parents: 32780
diff changeset
   884
lemma sup_boolE:
19c01bd7f6ae moved lemmas about sup on bool to Lattices.thy
haftmann
parents: 32780
diff changeset
   885
  "P \<squnion> Q \<Longrightarrow> (P \<Longrightarrow> R) \<Longrightarrow> (Q \<Longrightarrow> R) \<Longrightarrow> R"
41080
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   886
  by auto
32781
19c01bd7f6ae moved lemmas about sup on bool to Lattices.thy
haftmann
parents: 32780
diff changeset
   887
23878
bd651ecd4b8a simplified HOL bootstrap
haftmann
parents: 23389
diff changeset
   888
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
   889
subsection \<open>Lattice on @{typ "_ \<Rightarrow> _"}\<close>
23878
bd651ecd4b8a simplified HOL bootstrap
haftmann
parents: 23389
diff changeset
   890
51387
dbc4a77488b2 stepwise instantiation is more modular
nipkow
parents: 50615
diff changeset
   891
instantiation "fun" :: (type, semilattice_sup) semilattice_sup
25510
38c15efe603b adjustions to due to instance target
haftmann
parents: 25482
diff changeset
   892
begin
38c15efe603b adjustions to due to instance target
haftmann
parents: 25482
diff changeset
   893
38c15efe603b adjustions to due to instance target
haftmann
parents: 25482
diff changeset
   894
definition
41080
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   895
  "f \<squnion> g = (\<lambda>x. f x \<squnion> g x)"
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   896
49769
c7c2152322f2 more explicit code equations
haftmann
parents: 46884
diff changeset
   897
lemma sup_apply [simp, code]:
41080
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   898
  "(f \<squnion> g) x = f x \<squnion> g x"
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   899
  by (simp add: sup_fun_def)
25510
38c15efe603b adjustions to due to instance target
haftmann
parents: 25482
diff changeset
   900
32780
be337ec31268 tuned proofs
haftmann
parents: 32642
diff changeset
   901
instance proof
46884
154dc6ec0041 tuned proofs
noschinl
parents: 46882
diff changeset
   902
qed (simp_all add: le_fun_def)
23878
bd651ecd4b8a simplified HOL bootstrap
haftmann
parents: 23389
diff changeset
   903
25510
38c15efe603b adjustions to due to instance target
haftmann
parents: 25482
diff changeset
   904
end
23878
bd651ecd4b8a simplified HOL bootstrap
haftmann
parents: 23389
diff changeset
   905
51387
dbc4a77488b2 stepwise instantiation is more modular
nipkow
parents: 50615
diff changeset
   906
instantiation "fun" :: (type, semilattice_inf) semilattice_inf
dbc4a77488b2 stepwise instantiation is more modular
nipkow
parents: 50615
diff changeset
   907
begin
dbc4a77488b2 stepwise instantiation is more modular
nipkow
parents: 50615
diff changeset
   908
dbc4a77488b2 stepwise instantiation is more modular
nipkow
parents: 50615
diff changeset
   909
definition
dbc4a77488b2 stepwise instantiation is more modular
nipkow
parents: 50615
diff changeset
   910
  "f \<sqinter> g = (\<lambda>x. f x \<sqinter> g x)"
dbc4a77488b2 stepwise instantiation is more modular
nipkow
parents: 50615
diff changeset
   911
dbc4a77488b2 stepwise instantiation is more modular
nipkow
parents: 50615
diff changeset
   912
lemma inf_apply [simp, code]:
dbc4a77488b2 stepwise instantiation is more modular
nipkow
parents: 50615
diff changeset
   913
  "(f \<sqinter> g) x = f x \<sqinter> g x"
dbc4a77488b2 stepwise instantiation is more modular
nipkow
parents: 50615
diff changeset
   914
  by (simp add: inf_fun_def)
dbc4a77488b2 stepwise instantiation is more modular
nipkow
parents: 50615
diff changeset
   915
dbc4a77488b2 stepwise instantiation is more modular
nipkow
parents: 50615
diff changeset
   916
instance proof
dbc4a77488b2 stepwise instantiation is more modular
nipkow
parents: 50615
diff changeset
   917
qed (simp_all add: le_fun_def)
dbc4a77488b2 stepwise instantiation is more modular
nipkow
parents: 50615
diff changeset
   918
dbc4a77488b2 stepwise instantiation is more modular
nipkow
parents: 50615
diff changeset
   919
end
dbc4a77488b2 stepwise instantiation is more modular
nipkow
parents: 50615
diff changeset
   920
dbc4a77488b2 stepwise instantiation is more modular
nipkow
parents: 50615
diff changeset
   921
instance "fun" :: (type, lattice) lattice ..
dbc4a77488b2 stepwise instantiation is more modular
nipkow
parents: 50615
diff changeset
   922
41080
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   923
instance "fun" :: (type, distrib_lattice) distrib_lattice proof
46884
154dc6ec0041 tuned proofs
noschinl
parents: 46882
diff changeset
   924
qed (rule ext, simp add: sup_inf_distrib1)
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   925
34007
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   926
instance "fun" :: (type, bounded_lattice) bounded_lattice ..
aea892559fc5 tuned lattices theory fragements; generlized some lemmas from sets to lattices
haftmann
parents: 32781
diff changeset
   927
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   928
instantiation "fun" :: (type, uminus) uminus
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   929
begin
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   930
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   931
definition
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   932
  fun_Compl_def: "- A = (\<lambda>x. - A x)"
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   933
49769
c7c2152322f2 more explicit code equations
haftmann
parents: 46884
diff changeset
   934
lemma uminus_apply [simp, code]:
41080
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   935
  "(- A) x = - (A x)"
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   936
  by (simp add: fun_Compl_def)
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   937
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   938
instance ..
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   939
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   940
end
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   941
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   942
instantiation "fun" :: (type, minus) minus
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   943
begin
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   944
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   945
definition
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   946
  fun_diff_def: "A - B = (\<lambda>x. A x - B x)"
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   947
49769
c7c2152322f2 more explicit code equations
haftmann
parents: 46884
diff changeset
   948
lemma minus_apply [simp, code]:
41080
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   949
  "(A - B) x = A x - B x"
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   950
  by (simp add: fun_diff_def)
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   951
31991
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   952
instance ..
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   953
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   954
end
37390299214a added boolean_algebra type class; tuned lattice duals
haftmann
parents: 30729
diff changeset
   955
41080
294956ff285b nice syntax for lattice INFI, SUPR;
haftmann
parents: 41075
diff changeset
   956
instance "fun" :: (type, boolean_algebra) boolean_algebra proof
46884
154dc6ec0041 tuned proofs
noschinl
parents: 46882
diff changeset
   957
qed (rule ext, simp_all add: inf_compl_bot sup_compl_top diff_eq)+
26794
354c3844dfde - Now imports Fun rather than Orderings
berghofe
parents: 26233
diff changeset
   958
46631
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   959
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
   960
subsection \<open>Lattice on unary and binary predicates\<close>
46631
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   961
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   962
lemma inf1I: "A x \<Longrightarrow> B x \<Longrightarrow> (A \<sqinter> B) x"
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   963
  by (simp add: inf_fun_def)
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   964
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   965
lemma inf2I: "A x y \<Longrightarrow> B x y \<Longrightarrow> (A \<sqinter> B) x y"
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   966
  by (simp add: inf_fun_def)
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   967
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   968
lemma inf1E: "(A \<sqinter> B) x \<Longrightarrow> (A x \<Longrightarrow> B x \<Longrightarrow> P) \<Longrightarrow> P"
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   969
  by (simp add: inf_fun_def)
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   970
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   971
lemma inf2E: "(A \<sqinter> B) x y \<Longrightarrow> (A x y \<Longrightarrow> B x y \<Longrightarrow> P) \<Longrightarrow> P"
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   972
  by (simp add: inf_fun_def)
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   973
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   974
lemma inf1D1: "(A \<sqinter> B) x \<Longrightarrow> A x"
54857
5c05f7c5f8ae tuning and augmentation of min/max lemmas;
haftmann
parents: 54555
diff changeset
   975
  by (rule inf1E)
46631
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   976
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   977
lemma inf2D1: "(A \<sqinter> B) x y \<Longrightarrow> A x y"
54857
5c05f7c5f8ae tuning and augmentation of min/max lemmas;
haftmann
parents: 54555
diff changeset
   978
  by (rule inf2E)
46631
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   979
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   980
lemma inf1D2: "(A \<sqinter> B) x \<Longrightarrow> B x"
54857
5c05f7c5f8ae tuning and augmentation of min/max lemmas;
haftmann
parents: 54555
diff changeset
   981
  by (rule inf1E)
46631
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   982
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   983
lemma inf2D2: "(A \<sqinter> B) x y \<Longrightarrow> B x y"
54857
5c05f7c5f8ae tuning and augmentation of min/max lemmas;
haftmann
parents: 54555
diff changeset
   984
  by (rule inf2E)
46631
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   985
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   986
lemma sup1I1: "A x \<Longrightarrow> (A \<squnion> B) x"
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   987
  by (simp add: sup_fun_def)
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   988
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   989
lemma sup2I1: "A x y \<Longrightarrow> (A \<squnion> B) x y"
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   990
  by (simp add: sup_fun_def)
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   991
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   992
lemma sup1I2: "B x \<Longrightarrow> (A \<squnion> B) x"
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   993
  by (simp add: sup_fun_def)
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   994
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   995
lemma sup2I2: "B x y \<Longrightarrow> (A \<squnion> B) x y"
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   996
  by (simp add: sup_fun_def)
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   997
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   998
lemma sup1E: "(A \<squnion> B) x \<Longrightarrow> (A x \<Longrightarrow> P) \<Longrightarrow> (B x \<Longrightarrow> P) \<Longrightarrow> P"
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
   999
  by (simp add: sup_fun_def) iprover
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
  1000
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
  1001
lemma sup2E: "(A \<squnion> B) x y \<Longrightarrow> (A x y \<Longrightarrow> P) \<Longrightarrow> (B x y \<Longrightarrow> P) \<Longrightarrow> P"
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
  1002
  by (simp add: sup_fun_def) iprover
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
  1003
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
  1004
text \<open>
61799
4cf66f21b764 isabelle update_cartouches -c -t;
wenzelm
parents: 61629
diff changeset
  1005
  \medskip Classical introduction rule: no commitment to \<open>A\<close> vs
4cf66f21b764 isabelle update_cartouches -c -t;
wenzelm
parents: 61629
diff changeset
  1006
  \<open>B\<close>.
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 59545
diff changeset
  1007
\<close>
46631
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
  1008
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
  1009
lemma sup1CI: "(\<not> B x \<Longrightarrow> A x) \<Longrightarrow> (A \<squnion> B) x"
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
  1010
  by (auto simp add: sup_fun_def)
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
  1011
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
  1012
lemma sup2CI: "(\<not> B x y \<Longrightarrow> A x y) \<Longrightarrow> (A \<squnion> B) x y"
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
  1013
  by (auto simp add: sup_fun_def)
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
  1014
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
  1015
25062
af5ef0d4d655 global class syntax
haftmann
parents: 24749
diff changeset
  1016
no_notation
46691
72d81e789106 tuned syntax declarations; tuned structure
haftmann
parents: 46689
diff changeset
  1017
  less_eq (infix "\<sqsubseteq>" 50) and
72d81e789106 tuned syntax declarations; tuned structure
haftmann
parents: 46689
diff changeset
  1018
  less (infix "\<sqsubset>" 50)
25062
af5ef0d4d655 global class syntax
haftmann
parents: 24749
diff changeset
  1019
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents:
diff changeset
  1020
end
46631
2c5c003cee35 moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
haftmann
parents: 46557
diff changeset
  1021