| author | noschinl | 
| Sat, 25 May 2013 13:59:08 +0200 | |
| changeset 52139 | 40fe6b80b481 | 
| parent 51593 | d40aec502416 | 
| child 52152 | b561cdce6c4c | 
| permissions | -rw-r--r-- | 
| 21249 | 1 | (* Title: HOL/Lattices.thy | 
| 2 | Author: Tobias Nipkow | |
| 3 | *) | |
| 4 | ||
| 22454 | 5 | header {* Abstract lattices *}
 | 
| 21249 | 6 | |
| 7 | theory Lattices | |
| 35121 | 8 | imports Orderings Groups | 
| 21249 | 9 | begin | 
| 10 | ||
| 35301 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 11 | subsection {* Abstract semilattice *}
 | 
| 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 12 | |
| 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 13 | text {*
 | 
| 51487 | 14 | These locales provide a basic structure for interpretation into | 
| 35301 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 15 | bigger structures; extensions require careful thinking, otherwise | 
| 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 16 | undesired effects may occur due to interpretation. | 
| 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 17 | *} | 
| 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 18 | |
| 51487 | 19 | no_notation times (infixl "*" 70) | 
| 20 | no_notation Groups.one ("1")
 | |
| 21 | ||
| 35301 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 22 | locale semilattice = abel_semigroup + | 
| 51487 | 23 | assumes idem [simp]: "a * a = a" | 
| 35301 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 24 | begin | 
| 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 25 | |
| 51487 | 26 | lemma left_idem [simp]: "a * (a * b) = a * b" | 
| 50615 | 27 | by (simp add: assoc [symmetric]) | 
| 28 | ||
| 51487 | 29 | lemma right_idem [simp]: "(a * b) * b = a * b" | 
| 50615 | 30 | by (simp add: assoc) | 
| 35301 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 31 | |
| 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 32 | end | 
| 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 33 | |
| 51487 | 34 | locale semilattice_neutr = semilattice + comm_monoid | 
| 35301 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 35 | |
| 51487 | 36 | locale semilattice_order = semilattice + | 
| 37 | fixes less_eq :: "'a \<Rightarrow> 'a \<Rightarrow> bool" (infix "\<preceq>" 50) | |
| 38 | and less :: "'a \<Rightarrow> 'a \<Rightarrow> bool" (infix "\<prec>" 50) | |
| 39 | assumes order_iff: "a \<preceq> b \<longleftrightarrow> a = a * b" | |
| 40 | and semilattice_strict_iff_order: "a \<prec> b \<longleftrightarrow> a \<preceq> b \<and> a \<noteq> b" | |
| 41 | begin | |
| 42 | ||
| 43 | lemma orderI: | |
| 44 | "a = a * b \<Longrightarrow> a \<preceq> b" | |
| 45 | by (simp add: order_iff) | |
| 46 | ||
| 47 | lemma orderE: | |
| 48 | assumes "a \<preceq> b" | |
| 49 | obtains "a = a * b" | |
| 50 | using assms by (unfold order_iff) | |
| 51 | ||
| 52 | end | |
| 35301 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 53 | |
| 51487 | 54 | sublocale semilattice_order < ordering less_eq less | 
| 55 | proof | |
| 56 | fix a b | |
| 57 | show "a \<prec> b \<longleftrightarrow> a \<preceq> b \<and> a \<noteq> b" | |
| 58 | by (fact semilattice_strict_iff_order) | |
| 59 | next | |
| 60 | fix a | |
| 61 | show "a \<preceq> a" | |
| 62 | by (simp add: order_iff) | |
| 63 | next | |
| 64 | fix a b | |
| 65 | assume "a \<preceq> b" "b \<preceq> a" | |
| 66 | then have "a = a * b" "a * b = b" | |
| 67 | by (simp_all add: order_iff commute) | |
| 68 | then show "a = b" by simp | |
| 69 | next | |
| 70 | fix a b c | |
| 71 | assume "a \<preceq> b" "b \<preceq> c" | |
| 72 | then have "a = a * b" "b = b * c" | |
| 73 | by (simp_all add: order_iff commute) | |
| 74 | then have "a = a * (b * c)" | |
| 75 | by simp | |
| 76 | then have "a = (a * b) * c" | |
| 77 | by (simp add: assoc) | |
| 78 | with `a = a * b` [symmetric] have "a = a * c" by simp | |
| 79 | then show "a \<preceq> c" by (rule orderI) | |
| 80 | qed | |
| 35301 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 81 | |
| 51487 | 82 | context semilattice_order | 
| 35301 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 83 | begin | 
| 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 84 | |
| 51487 | 85 | lemma cobounded1 [simp]: | 
| 86 | "a * b \<preceq> a" | |
| 87 | by (simp add: order_iff commute) | |
| 88 | ||
| 89 | lemma cobounded2 [simp]: | |
| 90 | "a * b \<preceq> b" | |
| 91 | by (simp add: order_iff) | |
| 92 | ||
| 93 | lemma boundedI: | |
| 94 | assumes "a \<preceq> b" and "a \<preceq> c" | |
| 95 | shows "a \<preceq> b * c" | |
| 96 | proof (rule orderI) | |
| 97 | from assms obtain "a * b = a" and "a * c = a" by (auto elim!: orderE) | |
| 98 | then show "a = a * (b * c)" by (simp add: assoc [symmetric]) | |
| 99 | qed | |
| 100 | ||
| 101 | lemma boundedE: | |
| 102 | assumes "a \<preceq> b * c" | |
| 103 | obtains "a \<preceq> b" and "a \<preceq> c" | |
| 104 | using assms by (blast intro: trans cobounded1 cobounded2) | |
| 105 | ||
| 106 | lemma bounded_iff: | |
| 107 | "a \<preceq> b * c \<longleftrightarrow> a \<preceq> b \<and> a \<preceq> c" | |
| 108 | by (blast intro: boundedI elim: boundedE) | |
| 109 | ||
| 110 | lemma strict_boundedE: | |
| 111 | assumes "a \<prec> b * c" | |
| 112 | obtains "a \<prec> b" and "a \<prec> c" | |
| 113 | using assms by (auto simp add: commute strict_iff_order bounded_iff elim: orderE intro!: that)+ | |
| 114 | ||
| 115 | lemma coboundedI1: | |
| 116 | "a \<preceq> c \<Longrightarrow> a * b \<preceq> c" | |
| 117 | by (rule trans) auto | |
| 118 | ||
| 119 | lemma coboundedI2: | |
| 120 | "b \<preceq> c \<Longrightarrow> a * b \<preceq> c" | |
| 121 | by (rule trans) auto | |
| 122 | ||
| 123 | lemma mono: "a \<preceq> c \<Longrightarrow> b \<preceq> d \<Longrightarrow> a * b \<preceq> c * d" | |
| 124 | by (blast intro: boundedI coboundedI1 coboundedI2) | |
| 125 | ||
| 126 | lemma absorb1: "a \<preceq> b \<Longrightarrow> a * b = a" | |
| 127 | by (rule antisym) (auto simp add: refl bounded_iff) | |
| 128 | ||
| 129 | lemma absorb2: "b \<preceq> a \<Longrightarrow> a * b = b" | |
| 130 | by (rule antisym) (auto simp add: refl bounded_iff) | |
| 35301 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 131 | |
| 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 132 | end | 
| 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 133 | |
| 51487 | 134 | locale semilattice_neutr_order = semilattice_neutr + semilattice_order | 
| 135 | ||
| 136 | sublocale semilattice_neutr_order < ordering_top less_eq less 1 | |
| 137 | by default (simp add: order_iff) | |
| 138 | ||
| 139 | notation times (infixl "*" 70) | |
| 140 | notation Groups.one ("1")
 | |
| 141 | ||
| 35301 
90e42f9ba4d1
distributed theory Algebras to theories Groups and Lattices
 haftmann parents: 
35121diff
changeset | 142 | |
| 46691 | 143 | subsection {* Syntactic infimum and supremum operations *}
 | 
| 41082 | 144 | |
| 44845 | 145 | class inf = | 
| 146 | fixes inf :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "\<sqinter>" 70) | |
| 25206 | 147 | |
| 44845 | 148 | class sup = | 
| 149 | fixes sup :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "\<squnion>" 65) | |
| 150 | ||
| 46691 | 151 | |
| 152 | subsection {* Concrete lattices *}
 | |
| 153 | ||
| 154 | notation | |
| 155 | less_eq (infix "\<sqsubseteq>" 50) and | |
| 156 | less (infix "\<sqsubset>" 50) | |
| 157 | ||
| 44845 | 158 | class semilattice_inf = order + inf + | 
| 22737 | 159 | assumes inf_le1 [simp]: "x \<sqinter> y \<sqsubseteq> x" | 
| 160 | and inf_le2 [simp]: "x \<sqinter> y \<sqsubseteq> y" | |
| 21733 | 161 | and inf_greatest: "x \<sqsubseteq> y \<Longrightarrow> x \<sqsubseteq> z \<Longrightarrow> x \<sqsubseteq> y \<sqinter> z" | 
| 21249 | 162 | |
| 44845 | 163 | class semilattice_sup = order + sup + | 
| 22737 | 164 | assumes sup_ge1 [simp]: "x \<sqsubseteq> x \<squnion> y" | 
| 165 | and sup_ge2 [simp]: "y \<sqsubseteq> x \<squnion> y" | |
| 21733 | 166 | and sup_least: "y \<sqsubseteq> x \<Longrightarrow> z \<sqsubseteq> x \<Longrightarrow> y \<squnion> z \<sqsubseteq> x" | 
| 26014 | 167 | begin | 
| 168 | ||
| 169 | text {* Dual lattice *}
 | |
| 170 | ||
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 171 | lemma dual_semilattice: | 
| 44845 | 172 | "class.semilattice_inf sup greater_eq greater" | 
| 36635 
080b755377c0
locale predicates of classes carry a mandatory "class" prefix
 haftmann parents: 
36352diff
changeset | 173 | by (rule class.semilattice_inf.intro, rule dual_order) | 
| 27682 | 174 | (unfold_locales, simp_all add: sup_least) | 
| 26014 | 175 | |
| 176 | end | |
| 21249 | 177 | |
| 35028 
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
 haftmann parents: 
34973diff
changeset | 178 | class lattice = semilattice_inf + semilattice_sup | 
| 21249 | 179 | |
| 25382 | 180 | |
| 28562 | 181 | subsubsection {* Intro and elim rules*}
 | 
| 21733 | 182 | |
| 35028 
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
 haftmann parents: 
34973diff
changeset | 183 | context semilattice_inf | 
| 21733 | 184 | begin | 
| 21249 | 185 | |
| 32064 | 186 | lemma le_infI1: | 
| 187 | "a \<sqsubseteq> x \<Longrightarrow> a \<sqinter> b \<sqsubseteq> x" | |
| 188 | by (rule order_trans) auto | |
| 21249 | 189 | |
| 32064 | 190 | lemma le_infI2: | 
| 191 | "b \<sqsubseteq> x \<Longrightarrow> a \<sqinter> b \<sqsubseteq> x" | |
| 192 | by (rule order_trans) auto | |
| 21733 | 193 | |
| 32064 | 194 | lemma le_infI: "x \<sqsubseteq> a \<Longrightarrow> x \<sqsubseteq> b \<Longrightarrow> x \<sqsubseteq> a \<sqinter> b" | 
| 36008 | 195 | by (rule inf_greatest) (* FIXME: duplicate lemma *) | 
| 21249 | 196 | |
| 32064 | 197 | lemma le_infE: "x \<sqsubseteq> a \<sqinter> b \<Longrightarrow> (x \<sqsubseteq> a \<Longrightarrow> x \<sqsubseteq> b \<Longrightarrow> P) \<Longrightarrow> P" | 
| 36008 | 198 | by (blast intro: order_trans inf_le1 inf_le2) | 
| 21249 | 199 | |
| 21734 | 200 | lemma le_inf_iff [simp]: | 
| 32064 | 201 | "x \<sqsubseteq> y \<sqinter> z \<longleftrightarrow> x \<sqsubseteq> y \<and> x \<sqsubseteq> z" | 
| 202 | by (blast intro: le_infI elim: le_infE) | |
| 21733 | 203 | |
| 32064 | 204 | lemma le_iff_inf: | 
| 205 | "x \<sqsubseteq> y \<longleftrightarrow> x \<sqinter> y = x" | |
| 206 | by (auto intro: le_infI1 antisym dest: eq_iff [THEN iffD1]) | |
| 21249 | 207 | |
| 43753 | 208 | lemma inf_mono: "a \<sqsubseteq> c \<Longrightarrow> b \<sqsubseteq> d \<Longrightarrow> a \<sqinter> b \<sqsubseteq> c \<sqinter> d" | 
| 36008 | 209 | by (fast intro: inf_greatest le_infI1 le_infI2) | 
| 210 | ||
| 25206 | 211 | lemma mono_inf: | 
| 35028 
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
 haftmann parents: 
34973diff
changeset | 212 | fixes f :: "'a \<Rightarrow> 'b\<Colon>semilattice_inf" | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 213 | shows "mono f \<Longrightarrow> f (A \<sqinter> B) \<sqsubseteq> f A \<sqinter> f B" | 
| 25206 | 214 | by (auto simp add: mono_def intro: Lattices.inf_greatest) | 
| 21733 | 215 | |
| 25206 | 216 | end | 
| 21733 | 217 | |
| 35028 
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
 haftmann parents: 
34973diff
changeset | 218 | context semilattice_sup | 
| 21733 | 219 | begin | 
| 21249 | 220 | |
| 32064 | 221 | lemma le_supI1: | 
| 222 | "x \<sqsubseteq> a \<Longrightarrow> x \<sqsubseteq> a \<squnion> b" | |
| 25062 | 223 | by (rule order_trans) auto | 
| 21249 | 224 | |
| 32064 | 225 | lemma le_supI2: | 
| 226 | "x \<sqsubseteq> b \<Longrightarrow> x \<sqsubseteq> a \<squnion> b" | |
| 25062 | 227 | by (rule order_trans) auto | 
| 21733 | 228 | |
| 32064 | 229 | lemma le_supI: | 
| 230 | "a \<sqsubseteq> x \<Longrightarrow> b \<sqsubseteq> x \<Longrightarrow> a \<squnion> b \<sqsubseteq> x" | |
| 36008 | 231 | by (rule sup_least) (* FIXME: duplicate lemma *) | 
| 21249 | 232 | |
| 32064 | 233 | lemma le_supE: | 
| 234 | "a \<squnion> b \<sqsubseteq> x \<Longrightarrow> (a \<sqsubseteq> x \<Longrightarrow> b \<sqsubseteq> x \<Longrightarrow> P) \<Longrightarrow> P" | |
| 36008 | 235 | by (blast intro: order_trans sup_ge1 sup_ge2) | 
| 22422 
ee19cdb07528
stepping towards uniform lattice theory development in HOL
 haftmann parents: 
22384diff
changeset | 236 | |
| 32064 | 237 | lemma le_sup_iff [simp]: | 
| 238 | "x \<squnion> y \<sqsubseteq> z \<longleftrightarrow> x \<sqsubseteq> z \<and> y \<sqsubseteq> z" | |
| 239 | by (blast intro: le_supI elim: le_supE) | |
| 21733 | 240 | |
| 32064 | 241 | lemma le_iff_sup: | 
| 242 | "x \<sqsubseteq> y \<longleftrightarrow> x \<squnion> y = y" | |
| 243 | by (auto intro: le_supI2 antisym dest: eq_iff [THEN iffD1]) | |
| 21734 | 244 | |
| 43753 | 245 | lemma sup_mono: "a \<sqsubseteq> c \<Longrightarrow> b \<sqsubseteq> d \<Longrightarrow> a \<squnion> b \<sqsubseteq> c \<squnion> d" | 
| 36008 | 246 | by (fast intro: sup_least le_supI1 le_supI2) | 
| 247 | ||
| 25206 | 248 | lemma mono_sup: | 
| 35028 
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
 haftmann parents: 
34973diff
changeset | 249 | fixes f :: "'a \<Rightarrow> 'b\<Colon>semilattice_sup" | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 250 | shows "mono f \<Longrightarrow> f A \<squnion> f B \<sqsubseteq> f (A \<squnion> B)" | 
| 25206 | 251 | by (auto simp add: mono_def intro: Lattices.sup_least) | 
| 21733 | 252 | |
| 25206 | 253 | end | 
| 23878 | 254 | |
| 21733 | 255 | |
| 32064 | 256 | subsubsection {* Equational laws *}
 | 
| 21249 | 257 | |
| 35028 
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
 haftmann parents: 
34973diff
changeset | 258 | sublocale semilattice_inf < inf!: semilattice inf | 
| 34973 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 259 | proof | 
| 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 260 | fix a b c | 
| 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 261 | show "(a \<sqinter> b) \<sqinter> c = a \<sqinter> (b \<sqinter> c)" | 
| 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 262 | by (rule antisym) (auto intro: le_infI1 le_infI2) | 
| 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 263 | show "a \<sqinter> b = b \<sqinter> a" | 
| 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 264 | by (rule antisym) auto | 
| 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 265 | show "a \<sqinter> a = a" | 
| 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 266 | by (rule antisym) auto | 
| 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 267 | qed | 
| 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 268 | |
| 51487 | 269 | sublocale semilattice_sup < sup!: semilattice sup | 
| 270 | proof | |
| 271 | fix a b c | |
| 272 | show "(a \<squnion> b) \<squnion> c = a \<squnion> (b \<squnion> c)" | |
| 273 | by (rule antisym) (auto intro: le_supI1 le_supI2) | |
| 274 | show "a \<squnion> b = b \<squnion> a" | |
| 275 | by (rule antisym) auto | |
| 276 | show "a \<squnion> a = a" | |
| 277 | by (rule antisym) auto | |
| 278 | qed | |
| 279 | ||
| 280 | sublocale semilattice_inf < inf!: semilattice_order inf less_eq less | |
| 281 | by default (auto simp add: le_iff_inf less_le) | |
| 282 | ||
| 283 | sublocale semilattice_sup < sup!: semilattice_order sup greater_eq greater | |
| 284 | by default (auto simp add: le_iff_sup sup.commute less_le) | |
| 285 | ||
| 35028 
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
 haftmann parents: 
34973diff
changeset | 286 | context semilattice_inf | 
| 21733 | 287 | begin | 
| 288 | ||
| 34973 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 289 | 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: 
34209diff
changeset | 290 | by (fact inf.assoc) | 
| 21733 | 291 | |
| 34973 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 292 | lemma inf_commute: "(x \<sqinter> y) = (y \<sqinter> x)" | 
| 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 293 | by (fact inf.commute) | 
| 21733 | 294 | |
| 34973 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 295 | 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: 
34209diff
changeset | 296 | by (fact inf.left_commute) | 
| 21733 | 297 | |
| 44921 | 298 | lemma inf_idem: "x \<sqinter> x = x" | 
| 299 | by (fact inf.idem) (* already simp *) | |
| 34973 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 300 | |
| 50615 | 301 | lemma inf_left_idem: "x \<sqinter> (x \<sqinter> y) = x \<sqinter> y" | 
| 302 | by (fact inf.left_idem) (* already simp *) | |
| 303 | ||
| 304 | lemma inf_right_idem: "(x \<sqinter> y) \<sqinter> y = x \<sqinter> y" | |
| 305 | by (fact inf.right_idem) (* already simp *) | |
| 21733 | 306 | |
| 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: 
32568diff
changeset | 307 | lemma inf_absorb1: "x \<sqsubseteq> y \<Longrightarrow> x \<sqinter> y = x" | 
| 32064 | 308 | by (rule antisym) auto | 
| 21733 | 309 | |
| 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: 
32568diff
changeset | 310 | lemma inf_absorb2: "y \<sqsubseteq> x \<Longrightarrow> x \<sqinter> y = y" | 
| 32064 | 311 | by (rule antisym) auto | 
| 34973 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 312 | |
| 32064 | 313 | lemmas inf_aci = inf_commute inf_assoc inf_left_commute inf_left_idem | 
| 21733 | 314 | |
| 315 | end | |
| 316 | ||
| 35028 
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
 haftmann parents: 
34973diff
changeset | 317 | context semilattice_sup | 
| 21733 | 318 | begin | 
| 21249 | 319 | |
| 34973 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 320 | 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: 
34209diff
changeset | 321 | by (fact sup.assoc) | 
| 21733 | 322 | |
| 34973 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 323 | lemma sup_commute: "(x \<squnion> y) = (y \<squnion> x)" | 
| 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 324 | by (fact sup.commute) | 
| 21733 | 325 | |
| 34973 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 326 | 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: 
34209diff
changeset | 327 | by (fact sup.left_commute) | 
| 21733 | 328 | |
| 44921 | 329 | lemma sup_idem: "x \<squnion> x = x" | 
| 330 | by (fact sup.idem) (* already simp *) | |
| 34973 
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
 haftmann parents: 
34209diff
changeset | 331 | |
| 44918 | 332 | 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: 
34209diff
changeset | 333 | by (fact sup.left_idem) | 
| 21733 | 334 | |
| 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: 
32568diff
changeset | 335 | lemma sup_absorb1: "y \<sqsubseteq> x \<Longrightarrow> x \<squnion> y = x" | 
| 32064 | 336 | by (rule antisym) auto | 
| 21733 | 337 | |
| 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: 
32568diff
changeset | 338 | lemma sup_absorb2: "x \<sqsubseteq> y \<Longrightarrow> x \<squnion> y = y" | 
| 32064 | 339 | by (rule antisym) auto | 
| 21249 | 340 | |
| 32064 | 341 | lemmas sup_aci = sup_commute sup_assoc sup_left_commute sup_left_idem | 
| 21733 | 342 | |
| 343 | end | |
| 21249 | 344 | |
| 21733 | 345 | context lattice | 
| 346 | begin | |
| 347 | ||
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 348 | lemma dual_lattice: | 
| 44845 | 349 | "class.lattice sup (op \<ge>) (op >) inf" | 
| 36635 
080b755377c0
locale predicates of classes carry a mandatory "class" prefix
 haftmann parents: 
36352diff
changeset | 350 | 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: 
30729diff
changeset | 351 | (unfold_locales, auto) | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 352 | |
| 44918 | 353 | lemma inf_sup_absorb [simp]: "x \<sqinter> (x \<squnion> y) = x" | 
| 25102 
db3e412c4cb1
antisymmetry not a default intro rule any longer
 haftmann parents: 
25062diff
changeset | 354 | by (blast intro: antisym inf_le1 inf_greatest sup_ge1) | 
| 21733 | 355 | |
| 44918 | 356 | lemma sup_inf_absorb [simp]: "x \<squnion> (x \<sqinter> y) = x" | 
| 25102 
db3e412c4cb1
antisymmetry not a default intro rule any longer
 haftmann parents: 
25062diff
changeset | 357 | by (blast intro: antisym sup_ge1 sup_least inf_le1) | 
| 21733 | 358 | |
| 32064 | 359 | lemmas inf_sup_aci = inf_aci sup_aci | 
| 21734 | 360 | |
| 22454 | 361 | lemmas inf_sup_ord = inf_le1 inf_le2 sup_ge1 sup_ge2 | 
| 362 | ||
| 21734 | 363 | text{* Towards distributivity *}
 | 
| 21249 | 364 | |
| 21734 | 365 | lemma distrib_sup_le: "x \<squnion> (y \<sqinter> z) \<sqsubseteq> (x \<squnion> y) \<sqinter> (x \<squnion> z)" | 
| 32064 | 366 | by (auto intro: le_infI1 le_infI2 le_supI1 le_supI2) | 
| 21734 | 367 | |
| 368 | lemma distrib_inf_le: "(x \<sqinter> y) \<squnion> (x \<sqinter> z) \<sqsubseteq> x \<sqinter> (y \<squnion> z)" | |
| 32064 | 369 | by (auto intro: le_infI1 le_infI2 le_supI1 le_supI2) | 
| 21734 | 370 | |
| 371 | text{* If you have one of them, you have them all. *}
 | |
| 21249 | 372 | |
| 21733 | 373 | lemma distrib_imp1: | 
| 21249 | 374 | assumes D: "!!x y z. x \<sqinter> (y \<squnion> z) = (x \<sqinter> y) \<squnion> (x \<sqinter> z)" | 
| 375 | shows "x \<squnion> (y \<sqinter> z) = (x \<squnion> y) \<sqinter> (x \<squnion> z)" | |
| 376 | proof- | |
| 44918 | 377 | have "x \<squnion> (y \<sqinter> z) = (x \<squnion> (x \<sqinter> z)) \<squnion> (y \<sqinter> z)" by simp | 
| 378 | also have "\<dots> = x \<squnion> (z \<sqinter> (x \<squnion> y))" | |
| 379 | by (simp add: D inf_commute sup_assoc del: sup_inf_absorb) | |
| 21249 | 380 | also have "\<dots> = ((x \<squnion> y) \<sqinter> x) \<squnion> ((x \<squnion> y) \<sqinter> z)" | 
| 44919 | 381 | by(simp add: inf_commute) | 
| 21249 | 382 | also have "\<dots> = (x \<squnion> y) \<sqinter> (x \<squnion> z)" by(simp add:D) | 
| 383 | finally show ?thesis . | |
| 384 | qed | |
| 385 | ||
| 21733 | 386 | lemma distrib_imp2: | 
| 21249 | 387 | assumes D: "!!x y z. x \<squnion> (y \<sqinter> z) = (x \<squnion> y) \<sqinter> (x \<squnion> z)" | 
| 388 | shows "x \<sqinter> (y \<squnion> z) = (x \<sqinter> y) \<squnion> (x \<sqinter> z)" | |
| 389 | proof- | |
| 44918 | 390 | have "x \<sqinter> (y \<squnion> z) = (x \<sqinter> (x \<squnion> z)) \<sqinter> (y \<squnion> z)" by simp | 
| 391 | also have "\<dots> = x \<sqinter> (z \<squnion> (x \<sqinter> y))" | |
| 392 | by (simp add: D sup_commute inf_assoc del: inf_sup_absorb) | |
| 21249 | 393 | also have "\<dots> = ((x \<sqinter> y) \<squnion> x) \<sqinter> ((x \<sqinter> y) \<squnion> z)" | 
| 44919 | 394 | by(simp add: sup_commute) | 
| 21249 | 395 | also have "\<dots> = (x \<sqinter> y) \<squnion> (x \<sqinter> z)" by(simp add:D) | 
| 396 | finally show ?thesis . | |
| 397 | qed | |
| 398 | ||
| 21733 | 399 | end | 
| 21249 | 400 | |
| 32568 | 401 | subsubsection {* Strict order *}
 | 
| 402 | ||
| 35028 
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
 haftmann parents: 
34973diff
changeset | 403 | context semilattice_inf | 
| 32568 | 404 | begin | 
| 405 | ||
| 406 | lemma less_infI1: | |
| 407 | "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: 
32568diff
changeset | 408 | by (auto simp add: less_le inf_absorb1 intro: le_infI1) | 
| 32568 | 409 | |
| 410 | lemma less_infI2: | |
| 411 | "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: 
32568diff
changeset | 412 | by (auto simp add: less_le inf_absorb2 intro: le_infI2) | 
| 32568 | 413 | |
| 414 | end | |
| 415 | ||
| 35028 
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
 haftmann parents: 
34973diff
changeset | 416 | context semilattice_sup | 
| 32568 | 417 | begin | 
| 418 | ||
| 419 | lemma less_supI1: | |
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 420 | "x \<sqsubset> a \<Longrightarrow> x \<sqsubset> a \<squnion> b" | 
| 44921 | 421 | using dual_semilattice | 
| 422 | by (rule semilattice_inf.less_infI1) | |
| 32568 | 423 | |
| 424 | lemma less_supI2: | |
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 425 | "x \<sqsubset> b \<Longrightarrow> x \<sqsubset> a \<squnion> b" | 
| 44921 | 426 | using dual_semilattice | 
| 427 | by (rule semilattice_inf.less_infI2) | |
| 32568 | 428 | |
| 429 | end | |
| 430 | ||
| 21249 | 431 | |
| 24164 | 432 | subsection {* Distributive lattices *}
 | 
| 21249 | 433 | |
| 22454 | 434 | class distrib_lattice = lattice + | 
| 21249 | 435 | assumes sup_inf_distrib1: "x \<squnion> (y \<sqinter> z) = (x \<squnion> y) \<sqinter> (x \<squnion> z)" | 
| 436 | ||
| 21733 | 437 | context distrib_lattice | 
| 438 | begin | |
| 439 | ||
| 440 | lemma sup_inf_distrib2: | |
| 44921 | 441 | "(y \<sqinter> z) \<squnion> x = (y \<squnion> x) \<sqinter> (z \<squnion> x)" | 
| 442 | by (simp add: sup_commute sup_inf_distrib1) | |
| 21249 | 443 | |
| 21733 | 444 | lemma inf_sup_distrib1: | 
| 44921 | 445 | "x \<sqinter> (y \<squnion> z) = (x \<sqinter> y) \<squnion> (x \<sqinter> z)" | 
| 446 | by (rule distrib_imp2 [OF sup_inf_distrib1]) | |
| 21249 | 447 | |
| 21733 | 448 | lemma inf_sup_distrib2: | 
| 44921 | 449 | "(y \<squnion> z) \<sqinter> x = (y \<sqinter> x) \<squnion> (z \<sqinter> x)" | 
| 450 | by (simp add: inf_commute inf_sup_distrib1) | |
| 21249 | 451 | |
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 452 | lemma dual_distrib_lattice: | 
| 44845 | 453 | "class.distrib_lattice sup (op \<ge>) (op >) inf" | 
| 36635 
080b755377c0
locale predicates of classes carry a mandatory "class" prefix
 haftmann parents: 
36352diff
changeset | 454 | by (rule class.distrib_lattice.intro, rule dual_lattice) | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 455 | (unfold_locales, fact inf_sup_distrib1) | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 456 | |
| 36008 | 457 | lemmas sup_inf_distrib = | 
| 458 | sup_inf_distrib1 sup_inf_distrib2 | |
| 459 | ||
| 460 | lemmas inf_sup_distrib = | |
| 461 | inf_sup_distrib1 inf_sup_distrib2 | |
| 462 | ||
| 21733 | 463 | lemmas distrib = | 
| 21249 | 464 | sup_inf_distrib1 sup_inf_distrib2 inf_sup_distrib1 inf_sup_distrib2 | 
| 465 | ||
| 21733 | 466 | end | 
| 467 | ||
| 21249 | 468 | |
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 469 | subsection {* Bounded lattices and boolean algebras *}
 | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 470 | |
| 51487 | 471 | class bounded_semilattice_inf_top = semilattice_inf + top | 
| 472 | ||
| 473 | sublocale bounded_semilattice_inf_top < inf_top!: semilattice_neutr inf top | |
| 51546 
2e26df807dc7
more uniform style for interpretation and sublocale declarations
 haftmann parents: 
51540diff
changeset | 474 | + inf_top!: semilattice_neutr_order inf top less_eq less | 
| 51487 | 475 | proof | 
| 476 | fix x | |
| 477 | show "x \<sqinter> \<top> = x" | |
| 478 | by (rule inf_absorb1) simp | |
| 479 | qed | |
| 480 | ||
| 481 | class bounded_semilattice_sup_bot = semilattice_sup + bot | |
| 482 | ||
| 483 | sublocale bounded_semilattice_sup_bot < sup_bot!: semilattice_neutr sup bot | |
| 51546 
2e26df807dc7
more uniform style for interpretation and sublocale declarations
 haftmann parents: 
51540diff
changeset | 484 | + sup_bot!: semilattice_neutr_order sup bot greater_eq greater | 
| 51487 | 485 | proof | 
| 486 | fix x | |
| 487 | show "x \<squnion> \<bottom> = x" | |
| 488 | by (rule sup_absorb1) simp | |
| 489 | qed | |
| 490 | ||
| 36352 
f71978e47cd5
add bounded_lattice_bot and bounded_lattice_top type classes
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
36096diff
changeset | 491 | class bounded_lattice_bot = lattice + bot | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 492 | begin | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 493 | |
| 51487 | 494 | subclass bounded_semilattice_sup_bot .. | 
| 495 | ||
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 496 | lemma inf_bot_left [simp]: | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 497 | "\<bottom> \<sqinter> x = \<bottom>" | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 498 | by (rule inf_absorb1) simp | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 499 | |
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 500 | lemma inf_bot_right [simp]: | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 501 | "x \<sqinter> \<bottom> = \<bottom>" | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 502 | by (rule inf_absorb2) simp | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 503 | |
| 51487 | 504 | lemma sup_bot_left: | 
| 36352 
f71978e47cd5
add bounded_lattice_bot and bounded_lattice_top type classes
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
36096diff
changeset | 505 | "\<bottom> \<squnion> x = x" | 
| 51487 | 506 | 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: 
36096diff
changeset | 507 | |
| 51487 | 508 | lemma sup_bot_right: | 
| 36352 
f71978e47cd5
add bounded_lattice_bot and bounded_lattice_top type classes
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
36096diff
changeset | 509 | "x \<squnion> \<bottom> = x" | 
| 51487 | 510 | 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: 
36096diff
changeset | 511 | |
| 
f71978e47cd5
add bounded_lattice_bot and bounded_lattice_top type classes
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
36096diff
changeset | 512 | lemma sup_eq_bot_iff [simp]: | 
| 
f71978e47cd5
add bounded_lattice_bot and bounded_lattice_top type classes
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
36096diff
changeset | 513 | "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: 
36096diff
changeset | 514 | by (simp add: eq_iff) | 
| 
f71978e47cd5
add bounded_lattice_bot and bounded_lattice_top type classes
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
36096diff
changeset | 515 | |
| 51593 | 516 | lemma bot_eq_sup_iff [simp]: | 
| 517 | "\<bottom> = x \<squnion> y \<longleftrightarrow> x = \<bottom> \<and> y = \<bottom>" | |
| 518 | by (simp add: eq_iff) | |
| 519 | ||
| 36352 
f71978e47cd5
add bounded_lattice_bot and bounded_lattice_top type classes
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
36096diff
changeset | 520 | end | 
| 
f71978e47cd5
add bounded_lattice_bot and bounded_lattice_top type classes
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
36096diff
changeset | 521 | |
| 
f71978e47cd5
add bounded_lattice_bot and bounded_lattice_top type classes
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
36096diff
changeset | 522 | class bounded_lattice_top = lattice + top | 
| 
f71978e47cd5
add bounded_lattice_bot and bounded_lattice_top type classes
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
36096diff
changeset | 523 | begin | 
| 
f71978e47cd5
add bounded_lattice_bot and bounded_lattice_top type classes
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
36096diff
changeset | 524 | |
| 51487 | 525 | subclass bounded_semilattice_inf_top .. | 
| 526 | ||
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 527 | lemma sup_top_left [simp]: | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 528 | "\<top> \<squnion> x = \<top>" | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 529 | by (rule sup_absorb1) simp | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 530 | |
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 531 | lemma sup_top_right [simp]: | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 532 | "x \<squnion> \<top> = \<top>" | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 533 | by (rule sup_absorb2) simp | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 534 | |
| 51487 | 535 | lemma inf_top_left: | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 536 | "\<top> \<sqinter> x = x" | 
| 51487 | 537 | by (fact inf_top.left_neutral) | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 538 | |
| 51487 | 539 | lemma inf_top_right: | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 540 | "x \<sqinter> \<top> = x" | 
| 51487 | 541 | by (fact inf_top.right_neutral) | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 542 | |
| 36008 | 543 | lemma inf_eq_top_iff [simp]: | 
| 544 | "x \<sqinter> y = \<top> \<longleftrightarrow> x = \<top> \<and> y = \<top>" | |
| 545 | by (simp add: eq_iff) | |
| 32568 | 546 | |
| 36352 
f71978e47cd5
add bounded_lattice_bot and bounded_lattice_top type classes
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
36096diff
changeset | 547 | end | 
| 
f71978e47cd5
add bounded_lattice_bot and bounded_lattice_top type classes
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
36096diff
changeset | 548 | |
| 51487 | 549 | class bounded_lattice = lattice + bot + top | 
| 36352 
f71978e47cd5
add bounded_lattice_bot and bounded_lattice_top type classes
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
36096diff
changeset | 550 | begin | 
| 
f71978e47cd5
add bounded_lattice_bot and bounded_lattice_top type classes
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
36096diff
changeset | 551 | |
| 51487 | 552 | subclass bounded_lattice_bot .. | 
| 553 | subclass bounded_lattice_top .. | |
| 554 | ||
| 36352 
f71978e47cd5
add bounded_lattice_bot and bounded_lattice_top type classes
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
36096diff
changeset | 555 | lemma dual_bounded_lattice: | 
| 44845 | 556 | "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: 
36096diff
changeset | 557 | by unfold_locales (auto simp add: less_le_not_le) | 
| 32568 | 558 | |
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 559 | end | 
| 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 560 | |
| 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 561 | class boolean_algebra = distrib_lattice + bounded_lattice + minus + uminus + | 
| 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 562 | assumes inf_compl_bot: "x \<sqinter> - x = \<bottom>" | 
| 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 563 | and sup_compl_top: "x \<squnion> - x = \<top>" | 
| 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 564 | assumes diff_eq: "x - y = x \<sqinter> - y" | 
| 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 565 | begin | 
| 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 566 | |
| 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 567 | lemma dual_boolean_algebra: | 
| 44845 | 568 | "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: 
36352diff
changeset | 569 | 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: 
32781diff
changeset | 570 | (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: 
32781diff
changeset | 571 | |
| 44918 | 572 | lemma compl_inf_bot [simp]: | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 573 | "- x \<sqinter> x = \<bottom>" | 
| 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 574 | by (simp add: inf_commute inf_compl_bot) | 
| 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 575 | |
| 44918 | 576 | lemma compl_sup_top [simp]: | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 577 | "- x \<squnion> x = \<top>" | 
| 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 578 | by (simp add: sup_commute sup_compl_top) | 
| 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 579 | |
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 580 | lemma compl_unique: | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 581 | assumes "x \<sqinter> y = \<bottom>" | 
| 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 582 | and "x \<squnion> y = \<top>" | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 583 | shows "- x = y" | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 584 | proof - | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 585 | 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: 
30729diff
changeset | 586 | using inf_compl_bot assms(1) by simp | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 587 | 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: 
30729diff
changeset | 588 | by (simp add: inf_commute) | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 589 | then have "- x \<sqinter> (x \<squnion> y) = y \<sqinter> (x \<squnion> - x)" | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 590 | by (simp add: inf_sup_distrib1) | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 591 | then have "- x \<sqinter> \<top> = y \<sqinter> \<top>" | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 592 | using sup_compl_top assms(2) by simp | 
| 34209 | 593 | then show "- x = y" by simp | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 594 | qed | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 595 | |
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 596 | lemma double_compl [simp]: | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 597 | "- (- x) = x" | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 598 | using compl_inf_bot compl_sup_top by (rule compl_unique) | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 599 | |
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 600 | lemma compl_eq_compl_iff [simp]: | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 601 | "- x = - y \<longleftrightarrow> x = y" | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 602 | proof | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 603 | assume "- x = - y" | 
| 36008 | 604 | then have "- (- x) = - (- y)" by (rule arg_cong) | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 605 | then show "x = y" by simp | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 606 | next | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 607 | assume "x = y" | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 608 | then show "- x = - y" by simp | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 609 | qed | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 610 | |
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 611 | lemma compl_bot_eq [simp]: | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 612 | "- \<bottom> = \<top>" | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 613 | proof - | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 614 | from sup_compl_top have "\<bottom> \<squnion> - \<bottom> = \<top>" . | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 615 | then show ?thesis by simp | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 616 | qed | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 617 | |
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 618 | lemma compl_top_eq [simp]: | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 619 | "- \<top> = \<bottom>" | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 620 | proof - | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 621 | from inf_compl_bot have "\<top> \<sqinter> - \<top> = \<bottom>" . | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 622 | then show ?thesis by simp | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 623 | qed | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 624 | |
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 625 | lemma compl_inf [simp]: | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 626 | "- (x \<sqinter> y) = - x \<squnion> - y" | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 627 | proof (rule compl_unique) | 
| 36008 | 628 | have "(x \<sqinter> y) \<sqinter> (- x \<squnion> - y) = (y \<sqinter> (x \<sqinter> - x)) \<squnion> (x \<sqinter> (y \<sqinter> - y))" | 
| 629 | by (simp only: inf_sup_distrib inf_aci) | |
| 630 | then show "(x \<sqinter> y) \<sqinter> (- x \<squnion> - y) = \<bottom>" | |
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 631 | by (simp add: inf_compl_bot) | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 632 | next | 
| 36008 | 633 | have "(x \<sqinter> y) \<squnion> (- x \<squnion> - y) = (- y \<squnion> (x \<squnion> - x)) \<sqinter> (- x \<squnion> (y \<squnion> - y))" | 
| 634 | by (simp only: sup_inf_distrib sup_aci) | |
| 635 | then show "(x \<sqinter> y) \<squnion> (- x \<squnion> - y) = \<top>" | |
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 636 | by (simp add: sup_compl_top) | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 637 | qed | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 638 | |
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 639 | lemma compl_sup [simp]: | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 640 | "- (x \<squnion> y) = - x \<sqinter> - y" | 
| 44921 | 641 | using dual_boolean_algebra | 
| 642 | by (rule boolean_algebra.compl_inf) | |
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 643 | |
| 36008 | 644 | lemma compl_mono: | 
| 645 | "x \<sqsubseteq> y \<Longrightarrow> - y \<sqsubseteq> - x" | |
| 646 | proof - | |
| 647 | assume "x \<sqsubseteq> y" | |
| 648 | then have "x \<squnion> y = y" by (simp only: le_iff_sup) | |
| 649 | then have "- (x \<squnion> y) = - y" by simp | |
| 650 | then have "- x \<sqinter> - y = - y" by simp | |
| 651 | then have "- y \<sqinter> - x = - y" by (simp only: inf_commute) | |
| 652 | then show "- y \<sqsubseteq> - x" by (simp only: le_iff_inf) | |
| 653 | qed | |
| 654 | ||
| 44918 | 655 | lemma compl_le_compl_iff [simp]: | 
| 43753 | 656 | "- x \<sqsubseteq> - y \<longleftrightarrow> y \<sqsubseteq> x" | 
| 43873 | 657 | by (auto dest: compl_mono) | 
| 658 | ||
| 659 | lemma compl_le_swap1: | |
| 660 | assumes "y \<sqsubseteq> - x" shows "x \<sqsubseteq> -y" | |
| 661 | proof - | |
| 662 | from assms have "- (- x) \<sqsubseteq> - y" by (simp only: compl_le_compl_iff) | |
| 663 | then show ?thesis by simp | |
| 664 | qed | |
| 665 | ||
| 666 | lemma compl_le_swap2: | |
| 667 | assumes "- y \<sqsubseteq> x" shows "- x \<sqsubseteq> y" | |
| 668 | proof - | |
| 669 | from assms have "- x \<sqsubseteq> - (- y)" by (simp only: compl_le_compl_iff) | |
| 670 | then show ?thesis by simp | |
| 671 | qed | |
| 672 | ||
| 673 | lemma compl_less_compl_iff: (* TODO: declare [simp] ? *) | |
| 674 | "- x \<sqsubset> - y \<longleftrightarrow> y \<sqsubset> x" | |
| 44919 | 675 | by (auto simp add: less_le) | 
| 43873 | 676 | |
| 677 | lemma compl_less_swap1: | |
| 678 | assumes "y \<sqsubset> - x" shows "x \<sqsubset> - y" | |
| 679 | proof - | |
| 680 | from assms have "- (- x) \<sqsubset> - y" by (simp only: compl_less_compl_iff) | |
| 681 | then show ?thesis by simp | |
| 682 | qed | |
| 683 | ||
| 684 | lemma compl_less_swap2: | |
| 685 | assumes "- y \<sqsubset> x" shows "- x \<sqsubset> y" | |
| 686 | proof - | |
| 687 | from assms have "- x \<sqsubset> - (- y)" by (simp only: compl_less_compl_iff) | |
| 688 | then show ?thesis by simp | |
| 689 | qed | |
| 36008 | 690 | |
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 691 | end | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 692 | |
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 693 | |
| 51540 
eea5c4ca4a0e
explicit sublocale dependency for Min/Max yields more appropriate Min/Max prefix for a couple of facts
 haftmann parents: 
51489diff
changeset | 694 | subsection {* @{text "min/max"} as special case of lattice *}
 | 
| 
eea5c4ca4a0e
explicit sublocale dependency for Min/Max yields more appropriate Min/Max prefix for a couple of facts
 haftmann parents: 
51489diff
changeset | 695 | |
| 
eea5c4ca4a0e
explicit sublocale dependency for Min/Max yields more appropriate Min/Max prefix for a couple of facts
 haftmann parents: 
51489diff
changeset | 696 | sublocale linorder < min!: semilattice_order min less_eq less | 
| 
eea5c4ca4a0e
explicit sublocale dependency for Min/Max yields more appropriate Min/Max prefix for a couple of facts
 haftmann parents: 
51489diff
changeset | 697 | + max!: semilattice_order max greater_eq greater | 
| 
eea5c4ca4a0e
explicit sublocale dependency for Min/Max yields more appropriate Min/Max prefix for a couple of facts
 haftmann parents: 
51489diff
changeset | 698 | by default (auto simp add: min_def max_def) | 
| 
eea5c4ca4a0e
explicit sublocale dependency for Min/Max yields more appropriate Min/Max prefix for a couple of facts
 haftmann parents: 
51489diff
changeset | 699 | |
| 
eea5c4ca4a0e
explicit sublocale dependency for Min/Max yields more appropriate Min/Max prefix for a couple of facts
 haftmann parents: 
51489diff
changeset | 700 | lemma inf_min: "inf = (min \<Colon> 'a\<Colon>{semilattice_inf, linorder} \<Rightarrow> 'a \<Rightarrow> 'a)"
 | 
| 
eea5c4ca4a0e
explicit sublocale dependency for Min/Max yields more appropriate Min/Max prefix for a couple of facts
 haftmann parents: 
51489diff
changeset | 701 | 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: 
51489diff
changeset | 702 | |
| 
eea5c4ca4a0e
explicit sublocale dependency for Min/Max yields more appropriate Min/Max prefix for a couple of facts
 haftmann parents: 
51489diff
changeset | 703 | lemma sup_max: "sup = (max \<Colon> 'a\<Colon>{semilattice_sup, linorder} \<Rightarrow> 'a \<Rightarrow> 'a)"
 | 
| 
eea5c4ca4a0e
explicit sublocale dependency for Min/Max yields more appropriate Min/Max prefix for a couple of facts
 haftmann parents: 
51489diff
changeset | 704 | 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: 
51489diff
changeset | 705 | |
| 
eea5c4ca4a0e
explicit sublocale dependency for Min/Max yields more appropriate Min/Max prefix for a couple of facts
 haftmann parents: 
51489diff
changeset | 706 | |
| 22454 | 707 | subsection {* Uniqueness of inf and sup *}
 | 
| 708 | ||
| 35028 
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
 haftmann parents: 
34973diff
changeset | 709 | lemma (in semilattice_inf) inf_unique: | 
| 22454 | 710 | fixes f (infixl "\<triangle>" 70) | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 711 | 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: 
32781diff
changeset | 712 | and greatest: "\<And>x y z. x \<sqsubseteq> y \<Longrightarrow> x \<sqsubseteq> z \<Longrightarrow> x \<sqsubseteq> y \<triangle> z" | 
| 22737 | 713 | shows "x \<sqinter> y = x \<triangle> y" | 
| 22454 | 714 | proof (rule antisym) | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 715 | show "x \<triangle> y \<sqsubseteq> x \<sqinter> y" by (rule le_infI) (rule le1, rule le2) | 
| 22454 | 716 | next | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 717 | 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: 
32781diff
changeset | 718 | show "x \<sqinter> y \<sqsubseteq> x \<triangle> y" by (rule leI) simp_all | 
| 22454 | 719 | qed | 
| 720 | ||
| 35028 
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
 haftmann parents: 
34973diff
changeset | 721 | lemma (in semilattice_sup) sup_unique: | 
| 22454 | 722 | fixes f (infixl "\<nabla>" 70) | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 723 | 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: 
32781diff
changeset | 724 | and least: "\<And>x y z. y \<sqsubseteq> x \<Longrightarrow> z \<sqsubseteq> x \<Longrightarrow> y \<nabla> z \<sqsubseteq> x" | 
| 22737 | 725 | shows "x \<squnion> y = x \<nabla> y" | 
| 22454 | 726 | proof (rule antisym) | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 727 | show "x \<squnion> y \<sqsubseteq> x \<nabla> y" by (rule le_supI) (rule ge1, rule ge2) | 
| 22454 | 728 | next | 
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 729 | 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: 
32781diff
changeset | 730 | show "x \<nabla> y \<sqsubseteq> x \<squnion> y" by (rule leI) simp_all | 
| 22454 | 731 | qed | 
| 36008 | 732 | |
| 22454 | 733 | |
| 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: 
46557diff
changeset | 734 | subsection {* Lattice on @{typ bool} *}
 | 
| 22454 | 735 | |
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 736 | instantiation bool :: boolean_algebra | 
| 25510 | 737 | begin | 
| 738 | ||
| 739 | definition | |
| 41080 | 740 | bool_Compl_def [simp]: "uminus = Not" | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 741 | |
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 742 | definition | 
| 41080 | 743 | bool_diff_def [simp]: "A - B \<longleftrightarrow> A \<and> \<not> B" | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 744 | |
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 745 | definition | 
| 41080 | 746 | [simp]: "P \<sqinter> Q \<longleftrightarrow> P \<and> Q" | 
| 25510 | 747 | |
| 748 | definition | |
| 41080 | 749 | [simp]: "P \<squnion> Q \<longleftrightarrow> P \<or> Q" | 
| 25510 | 750 | |
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 751 | instance proof | 
| 41080 | 752 | qed auto | 
| 22454 | 753 | |
| 25510 | 754 | end | 
| 755 | ||
| 32781 | 756 | lemma sup_boolI1: | 
| 757 | "P \<Longrightarrow> P \<squnion> Q" | |
| 41080 | 758 | by simp | 
| 32781 | 759 | |
| 760 | lemma sup_boolI2: | |
| 761 | "Q \<Longrightarrow> P \<squnion> Q" | |
| 41080 | 762 | by simp | 
| 32781 | 763 | |
| 764 | lemma sup_boolE: | |
| 765 | "P \<squnion> Q \<Longrightarrow> (P \<Longrightarrow> R) \<Longrightarrow> (Q \<Longrightarrow> R) \<Longrightarrow> R" | |
| 41080 | 766 | by auto | 
| 32781 | 767 | |
| 23878 | 768 | |
| 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: 
46557diff
changeset | 769 | subsection {* Lattice on @{typ "_ \<Rightarrow> _"} *}
 | 
| 23878 | 770 | |
| 51387 | 771 | instantiation "fun" :: (type, semilattice_sup) semilattice_sup | 
| 25510 | 772 | begin | 
| 773 | ||
| 774 | definition | |
| 41080 | 775 | "f \<squnion> g = (\<lambda>x. f x \<squnion> g x)" | 
| 776 | ||
| 49769 | 777 | lemma sup_apply [simp, code]: | 
| 41080 | 778 | "(f \<squnion> g) x = f x \<squnion> g x" | 
| 779 | by (simp add: sup_fun_def) | |
| 25510 | 780 | |
| 32780 | 781 | instance proof | 
| 46884 | 782 | qed (simp_all add: le_fun_def) | 
| 23878 | 783 | |
| 25510 | 784 | end | 
| 23878 | 785 | |
| 51387 | 786 | instantiation "fun" :: (type, semilattice_inf) semilattice_inf | 
| 787 | begin | |
| 788 | ||
| 789 | definition | |
| 790 | "f \<sqinter> g = (\<lambda>x. f x \<sqinter> g x)" | |
| 791 | ||
| 792 | lemma inf_apply [simp, code]: | |
| 793 | "(f \<sqinter> g) x = f x \<sqinter> g x" | |
| 794 | by (simp add: inf_fun_def) | |
| 795 | ||
| 796 | instance proof | |
| 797 | qed (simp_all add: le_fun_def) | |
| 798 | ||
| 799 | end | |
| 800 | ||
| 801 | instance "fun" :: (type, lattice) lattice .. | |
| 802 | ||
| 41080 | 803 | instance "fun" :: (type, distrib_lattice) distrib_lattice proof | 
| 46884 | 804 | qed (rule ext, simp add: sup_inf_distrib1) | 
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 805 | |
| 34007 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 806 | instance "fun" :: (type, bounded_lattice) bounded_lattice .. | 
| 
aea892559fc5
tuned lattices theory fragements; generlized some lemmas from sets to lattices
 haftmann parents: 
32781diff
changeset | 807 | |
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 808 | instantiation "fun" :: (type, uminus) uminus | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 809 | begin | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 810 | |
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 811 | definition | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 812 | fun_Compl_def: "- A = (\<lambda>x. - A x)" | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 813 | |
| 49769 | 814 | lemma uminus_apply [simp, code]: | 
| 41080 | 815 | "(- A) x = - (A x)" | 
| 816 | by (simp add: fun_Compl_def) | |
| 817 | ||
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 818 | instance .. | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 819 | |
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 820 | end | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 821 | |
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 822 | instantiation "fun" :: (type, minus) minus | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 823 | begin | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 824 | |
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 825 | definition | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 826 | fun_diff_def: "A - B = (\<lambda>x. A x - B x)" | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 827 | |
| 49769 | 828 | lemma minus_apply [simp, code]: | 
| 41080 | 829 | "(A - B) x = A x - B x" | 
| 830 | by (simp add: fun_diff_def) | |
| 831 | ||
| 31991 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 832 | instance .. | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 833 | |
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 834 | end | 
| 
37390299214a
added boolean_algebra type class; tuned lattice duals
 haftmann parents: 
30729diff
changeset | 835 | |
| 41080 | 836 | instance "fun" :: (type, boolean_algebra) boolean_algebra proof | 
| 46884 | 837 | qed (rule ext, simp_all add: inf_compl_bot sup_compl_top diff_eq)+ | 
| 26794 | 838 | |
| 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: 
46557diff
changeset | 839 | |
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 840 | subsection {* Lattice on unary and binary predicates *}
 | 
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 841 | |
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 842 | 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: 
46557diff
changeset | 843 | 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: 
46557diff
changeset | 844 | |
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 845 | 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: 
46557diff
changeset | 846 | 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: 
46557diff
changeset | 847 | |
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 848 | 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: 
46557diff
changeset | 849 | 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: 
46557diff
changeset | 850 | |
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 851 | 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: 
46557diff
changeset | 852 | 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: 
46557diff
changeset | 853 | |
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 854 | lemma inf1D1: "(A \<sqinter> B) x \<Longrightarrow> A 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: 
46557diff
changeset | 855 | 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: 
46557diff
changeset | 856 | |
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 857 | lemma inf2D1: "(A \<sqinter> B) x y \<Longrightarrow> A 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: 
46557diff
changeset | 858 | 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: 
46557diff
changeset | 859 | |
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 860 | lemma inf1D2: "(A \<sqinter> B) x \<Longrightarrow> 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: 
46557diff
changeset | 861 | 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: 
46557diff
changeset | 862 | |
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 863 | lemma inf2D2: "(A \<sqinter> B) x y \<Longrightarrow> 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: 
46557diff
changeset | 864 | 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: 
46557diff
changeset | 865 | |
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 866 | 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: 
46557diff
changeset | 867 | 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: 
46557diff
changeset | 868 | |
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 869 | 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: 
46557diff
changeset | 870 | 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: 
46557diff
changeset | 871 | |
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 872 | 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: 
46557diff
changeset | 873 | 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: 
46557diff
changeset | 874 | |
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 875 | 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: 
46557diff
changeset | 876 | 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: 
46557diff
changeset | 877 | |
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 878 | 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: 
46557diff
changeset | 879 | 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: 
46557diff
changeset | 880 | |
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 881 | 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: 
46557diff
changeset | 882 | 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: 
46557diff
changeset | 883 | |
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 884 | text {*
 | 
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 885 |   \medskip Classical introduction rule: no commitment to @{text A} vs
 | 
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 886 |   @{text B}.
 | 
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 887 | *} | 
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 888 | |
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 889 | 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: 
46557diff
changeset | 890 | 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: 
46557diff
changeset | 891 | |
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 892 | 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: 
46557diff
changeset | 893 | 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: 
46557diff
changeset | 894 | |
| 
2c5c003cee35
moved lemmas for orderings and lattices on predicates to corresponding theories, retaining declaration order of classical rules; tuned headings; tuned syntax
 haftmann parents: 
46557diff
changeset | 895 | |
| 25062 | 896 | no_notation | 
| 46691 | 897 | less_eq (infix "\<sqsubseteq>" 50) and | 
| 898 | less (infix "\<sqsubset>" 50) | |
| 25062 | 899 | |
| 21249 | 900 | 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: 
46557diff
changeset | 901 |