src/HOL/Lattice/CompleteLattice.thy
author nipkow
Tue Jan 09 15:32:27 2001 +0100 (2001-01-09)
changeset 10834 a7897aebbffc
parent 10309 a7f961fb62c6
child 11099 b301d1f72552
permissions -rw-r--r--
*** empty log message ***
wenzelm@10157
     1
(*  Title:      HOL/Lattice/CompleteLattice.thy
wenzelm@10157
     2
    ID:         $Id$
wenzelm@10157
     3
    Author:     Markus Wenzel, TU Muenchen
wenzelm@10157
     4
*)
wenzelm@10157
     5
wenzelm@10157
     6
header {* Complete lattices *}
wenzelm@10157
     7
wenzelm@10157
     8
theory CompleteLattice = Lattice:
wenzelm@10157
     9
wenzelm@10157
    10
subsection {* Complete lattice operations *}
wenzelm@10157
    11
wenzelm@10157
    12
text {*
wenzelm@10157
    13
  A \emph{complete lattice} is a partial order with general
wenzelm@10157
    14
  (infinitary) infimum of any set of elements.  General supremum
wenzelm@10157
    15
  exists as well, as a consequence of the connection of infinitary
wenzelm@10157
    16
  bounds (see \S\ref{sec:connect-bounds}).
wenzelm@10157
    17
*}
wenzelm@10157
    18
wenzelm@10157
    19
axclass complete_lattice < partial_order
wenzelm@10157
    20
  ex_Inf: "\<exists>inf. is_Inf A inf"
wenzelm@10157
    21
wenzelm@10157
    22
theorem ex_Sup: "\<exists>sup::'a::complete_lattice. is_Sup A sup"
wenzelm@10157
    23
proof -
wenzelm@10157
    24
  from ex_Inf obtain sup where "is_Inf {b. \<forall>a\<in>A. a \<sqsubseteq> b} sup" by blast
wenzelm@10157
    25
  hence "is_Sup A sup" by (rule Inf_Sup)
wenzelm@10157
    26
  thus ?thesis ..
wenzelm@10157
    27
qed
wenzelm@10157
    28
wenzelm@10157
    29
text {*
wenzelm@10157
    30
  The general @{text \<Sqinter>} (meet) and @{text \<Squnion>} (join) operations select
wenzelm@10157
    31
  such infimum and supremum elements.
wenzelm@10157
    32
*}
wenzelm@10157
    33
wenzelm@10157
    34
consts
wenzelm@10157
    35
  Meet :: "'a::complete_lattice set \<Rightarrow> 'a"
wenzelm@10157
    36
  Join :: "'a::complete_lattice set \<Rightarrow> 'a"
wenzelm@10157
    37
syntax (symbols)
wenzelm@10157
    38
  Meet :: "'a::complete_lattice set \<Rightarrow> 'a"    ("\<Sqinter>_" [90] 90)
wenzelm@10157
    39
  Join :: "'a::complete_lattice set \<Rightarrow> 'a"    ("\<Squnion>_" [90] 90)
wenzelm@10157
    40
defs
wenzelm@10157
    41
  Meet_def: "\<Sqinter>A \<equiv> SOME inf. is_Inf A inf"
wenzelm@10157
    42
  Join_def: "\<Squnion>A \<equiv> SOME sup. is_Sup A sup"
wenzelm@10157
    43
wenzelm@10157
    44
text {*
wenzelm@10157
    45
  Due to unique existence of bounds, the complete lattice operations
wenzelm@10157
    46
  may be exhibited as follows.
wenzelm@10157
    47
*}
wenzelm@10157
    48
wenzelm@10157
    49
lemma Meet_equality [elim?]: "is_Inf A inf \<Longrightarrow> \<Sqinter>A = inf"
wenzelm@10157
    50
proof (unfold Meet_def)
wenzelm@10157
    51
  assume "is_Inf A inf"
wenzelm@10157
    52
  thus "(SOME inf. is_Inf A inf) = inf"
wenzelm@10157
    53
    by (rule some_equality) (rule is_Inf_uniq)
wenzelm@10157
    54
qed
wenzelm@10157
    55
wenzelm@10157
    56
lemma MeetI [intro?]:
wenzelm@10157
    57
  "(\<And>a. a \<in> A \<Longrightarrow> inf \<sqsubseteq> a) \<Longrightarrow>
wenzelm@10157
    58
    (\<And>b. \<forall>a \<in> A. b \<sqsubseteq> a \<Longrightarrow> b \<sqsubseteq> inf) \<Longrightarrow>
wenzelm@10157
    59
    \<Sqinter>A = inf"
wenzelm@10157
    60
  by (rule Meet_equality, rule is_InfI) blast+
wenzelm@10157
    61
wenzelm@10157
    62
lemma Join_equality [elim?]: "is_Sup A sup \<Longrightarrow> \<Squnion>A = sup"
wenzelm@10157
    63
proof (unfold Join_def)
wenzelm@10157
    64
  assume "is_Sup A sup"
wenzelm@10157
    65
  thus "(SOME sup. is_Sup A sup) = sup"
wenzelm@10157
    66
    by (rule some_equality) (rule is_Sup_uniq)
wenzelm@10157
    67
qed
wenzelm@10157
    68
wenzelm@10157
    69
lemma JoinI [intro?]:
wenzelm@10157
    70
  "(\<And>a. a \<in> A \<Longrightarrow> a \<sqsubseteq> sup) \<Longrightarrow>
wenzelm@10157
    71
    (\<And>b. \<forall>a \<in> A. a \<sqsubseteq> b \<Longrightarrow> sup \<sqsubseteq> b) \<Longrightarrow>
wenzelm@10157
    72
    \<Squnion>A = sup"
wenzelm@10157
    73
  by (rule Join_equality, rule is_SupI) blast+
wenzelm@10157
    74
wenzelm@10157
    75
wenzelm@10157
    76
text {*
wenzelm@10157
    77
  \medskip The @{text \<Sqinter>} and @{text \<Squnion>} operations indeed determine
wenzelm@10157
    78
  bounds on a complete lattice structure.
wenzelm@10157
    79
*}
wenzelm@10157
    80
wenzelm@10157
    81
lemma is_Inf_Meet [intro?]: "is_Inf A (\<Sqinter>A)"
wenzelm@10157
    82
proof (unfold Meet_def)
wenzelm@10183
    83
  from ex_Inf
wenzelm@10183
    84
  show "is_Inf A (SOME inf. is_Inf A inf)" ..
wenzelm@10157
    85
qed
wenzelm@10157
    86
wenzelm@10157
    87
lemma Meet_greatest [intro?]: "(\<And>a. a \<in> A \<Longrightarrow> x \<sqsubseteq> a) \<Longrightarrow> x \<sqsubseteq> \<Sqinter>A"
wenzelm@10157
    88
  by (rule is_Inf_greatest, rule is_Inf_Meet) blast
wenzelm@10157
    89
wenzelm@10157
    90
lemma Meet_lower [intro?]: "a \<in> A \<Longrightarrow> \<Sqinter>A \<sqsubseteq> a"
wenzelm@10157
    91
  by (rule is_Inf_lower) (rule is_Inf_Meet)
wenzelm@10157
    92
wenzelm@10157
    93
wenzelm@10157
    94
lemma is_Sup_Join [intro?]: "is_Sup A (\<Squnion>A)"
wenzelm@10157
    95
proof (unfold Join_def)
wenzelm@10183
    96
  from ex_Sup
wenzelm@10183
    97
  show "is_Sup A (SOME sup. is_Sup A sup)" ..
wenzelm@10157
    98
qed
wenzelm@10157
    99
wenzelm@10157
   100
lemma Join_least [intro?]: "(\<And>a. a \<in> A \<Longrightarrow> a \<sqsubseteq> x) \<Longrightarrow> \<Squnion>A \<sqsubseteq> x"
wenzelm@10157
   101
  by (rule is_Sup_least, rule is_Sup_Join) blast
wenzelm@10157
   102
lemma Join_lower [intro?]: "a \<in> A \<Longrightarrow> a \<sqsubseteq> \<Squnion>A"
wenzelm@10157
   103
  by (rule is_Sup_upper) (rule is_Sup_Join)
wenzelm@10157
   104
wenzelm@10157
   105
wenzelm@10157
   106
subsection {* The Knaster-Tarski Theorem *}
wenzelm@10157
   107
wenzelm@10157
   108
text {*
wenzelm@10157
   109
  The Knaster-Tarski Theorem (in its simplest formulation) states that
wenzelm@10157
   110
  any monotone function on a complete lattice has a least fixed-point
wenzelm@10157
   111
  (see \cite[pages 93--94]{Davey-Priestley:1990} for example).  This
wenzelm@10157
   112
  is a consequence of the basic boundary properties of the complete
wenzelm@10157
   113
  lattice operations.
wenzelm@10157
   114
*}
wenzelm@10157
   115
wenzelm@10157
   116
theorem Knaster_Tarski:
wenzelm@10157
   117
  "(\<And>x y. x \<sqsubseteq> y \<Longrightarrow> f x \<sqsubseteq> f y) \<Longrightarrow> \<exists>a::'a::complete_lattice. f a = a"
wenzelm@10157
   118
proof
wenzelm@10157
   119
  assume mono: "\<And>x y. x \<sqsubseteq> y \<Longrightarrow> f x \<sqsubseteq> f y"
wenzelm@10157
   120
  let ?H = "{u. f u \<sqsubseteq> u}" let ?a = "\<Sqinter>?H"
wenzelm@10157
   121
  have ge: "f ?a \<sqsubseteq> ?a"
wenzelm@10157
   122
  proof
wenzelm@10157
   123
    fix x assume x: "x \<in> ?H"
wenzelm@10157
   124
    hence "?a \<sqsubseteq> x" ..
wenzelm@10157
   125
    hence "f ?a \<sqsubseteq> f x" by (rule mono)
wenzelm@10157
   126
    also from x have "... \<sqsubseteq> x" ..
wenzelm@10157
   127
    finally show "f ?a \<sqsubseteq> x" .
wenzelm@10157
   128
  qed
wenzelm@10157
   129
  also have "?a \<sqsubseteq> f ?a"
wenzelm@10157
   130
  proof
wenzelm@10157
   131
    from ge have "f (f ?a) \<sqsubseteq> f ?a" by (rule mono)
wenzelm@10157
   132
    thus "f ?a : ?H" ..
wenzelm@10157
   133
  qed
wenzelm@10157
   134
  finally show "f ?a = ?a" .
wenzelm@10157
   135
qed
wenzelm@10157
   136
wenzelm@10157
   137
wenzelm@10157
   138
subsection {* Bottom and top elements *}
wenzelm@10157
   139
wenzelm@10157
   140
text {*
wenzelm@10157
   141
  With general bounds available, complete lattices also have least and
wenzelm@10157
   142
  greatest elements.
wenzelm@10157
   143
*}
wenzelm@10157
   144
wenzelm@10157
   145
constdefs
wenzelm@10157
   146
  bottom :: "'a::complete_lattice"    ("\<bottom>")
wenzelm@10157
   147
  "\<bottom> \<equiv> \<Sqinter>UNIV"
wenzelm@10157
   148
  top :: "'a::complete_lattice"    ("\<top>")
wenzelm@10157
   149
  "\<top> \<equiv> \<Squnion>UNIV"
wenzelm@10157
   150
wenzelm@10157
   151
lemma bottom_least [intro?]: "\<bottom> \<sqsubseteq> x"
wenzelm@10157
   152
proof (unfold bottom_def)
wenzelm@10157
   153
  have "x \<in> UNIV" ..
wenzelm@10157
   154
  thus "\<Sqinter>UNIV \<sqsubseteq> x" ..
wenzelm@10157
   155
qed
wenzelm@10157
   156
wenzelm@10157
   157
lemma bottomI [intro?]: "(\<And>a. x \<sqsubseteq> a) \<Longrightarrow> \<bottom> = x"
wenzelm@10157
   158
proof (unfold bottom_def)
wenzelm@10157
   159
  assume "\<And>a. x \<sqsubseteq> a"
wenzelm@10157
   160
  show "\<Sqinter>UNIV = x"
wenzelm@10157
   161
  proof
wenzelm@10157
   162
    fix a show "x \<sqsubseteq> a" .
wenzelm@10157
   163
  next
wenzelm@10157
   164
    fix b :: "'a::complete_lattice"
wenzelm@10157
   165
    assume b: "\<forall>a \<in> UNIV. b \<sqsubseteq> a"
wenzelm@10157
   166
    have "x \<in> UNIV" ..
wenzelm@10157
   167
    with b show "b \<sqsubseteq> x" ..
wenzelm@10157
   168
  qed
wenzelm@10157
   169
qed
wenzelm@10157
   170
wenzelm@10157
   171
lemma top_greatest [intro?]: "x \<sqsubseteq> \<top>"
wenzelm@10157
   172
proof (unfold top_def)
wenzelm@10157
   173
  have "x \<in> UNIV" ..
wenzelm@10157
   174
  thus "x \<sqsubseteq> \<Squnion>UNIV" ..
wenzelm@10157
   175
qed
wenzelm@10157
   176
wenzelm@10157
   177
lemma topI [intro?]: "(\<And>a. a \<sqsubseteq> x) \<Longrightarrow> \<top> = x"
wenzelm@10157
   178
proof (unfold top_def)
wenzelm@10157
   179
  assume "\<And>a. a \<sqsubseteq> x"
wenzelm@10157
   180
  show "\<Squnion>UNIV = x"
wenzelm@10157
   181
  proof
wenzelm@10157
   182
    fix a show "a \<sqsubseteq> x" .
wenzelm@10157
   183
  next
wenzelm@10157
   184
    fix b :: "'a::complete_lattice"
wenzelm@10157
   185
    assume b: "\<forall>a \<in> UNIV. a \<sqsubseteq> b"
wenzelm@10157
   186
    have "x \<in> UNIV" ..
wenzelm@10157
   187
    with b show "x \<sqsubseteq> b" ..
wenzelm@10157
   188
  qed
wenzelm@10157
   189
qed
wenzelm@10157
   190
wenzelm@10157
   191
wenzelm@10157
   192
subsection {* Duality *}
wenzelm@10157
   193
wenzelm@10157
   194
text {*
wenzelm@10157
   195
  The class of complete lattices is closed under formation of dual
wenzelm@10157
   196
  structures.
wenzelm@10157
   197
*}
wenzelm@10157
   198
wenzelm@10157
   199
instance dual :: (complete_lattice) complete_lattice
wenzelm@10309
   200
proof
wenzelm@10157
   201
  fix A' :: "'a::complete_lattice dual set"
wenzelm@10157
   202
  show "\<exists>inf'. is_Inf A' inf'"
wenzelm@10157
   203
  proof -
nipkow@10834
   204
    have "\<exists>sup. is_Sup (undual ` A') sup" by (rule ex_Sup)
nipkow@10834
   205
    hence "\<exists>sup. is_Inf (dual ` undual ` A') (dual sup)" by (simp only: dual_Inf)
wenzelm@10157
   206
    thus ?thesis by (simp add: dual_ex [symmetric] image_compose [symmetric])
wenzelm@10157
   207
  qed
wenzelm@10157
   208
qed
wenzelm@10157
   209
wenzelm@10157
   210
text {*
wenzelm@10157
   211
  Apparently, the @{text \<Sqinter>} and @{text \<Squnion>} operations are dual to each
wenzelm@10157
   212
  other.
wenzelm@10157
   213
*}
wenzelm@10157
   214
nipkow@10834
   215
theorem dual_Meet [intro?]: "dual (\<Sqinter>A) = \<Squnion>(dual ` A)"
wenzelm@10157
   216
proof -
nipkow@10834
   217
  from is_Inf_Meet have "is_Sup (dual ` A) (dual (\<Sqinter>A))" ..
nipkow@10834
   218
  hence "\<Squnion>(dual ` A) = dual (\<Sqinter>A)" ..
wenzelm@10157
   219
  thus ?thesis ..
wenzelm@10157
   220
qed
wenzelm@10157
   221
nipkow@10834
   222
theorem dual_Join [intro?]: "dual (\<Squnion>A) = \<Sqinter>(dual ` A)"
wenzelm@10157
   223
proof -
nipkow@10834
   224
  from is_Sup_Join have "is_Inf (dual ` A) (dual (\<Squnion>A))" ..
nipkow@10834
   225
  hence "\<Sqinter>(dual ` A) = dual (\<Squnion>A)" ..
wenzelm@10157
   226
  thus ?thesis ..
wenzelm@10157
   227
qed
wenzelm@10157
   228
wenzelm@10157
   229
text {*
wenzelm@10157
   230
  Likewise are @{text \<bottom>} and @{text \<top>} duals of each other.
wenzelm@10157
   231
*}
wenzelm@10157
   232
wenzelm@10157
   233
theorem dual_bottom [intro?]: "dual \<bottom> = \<top>"
wenzelm@10157
   234
proof -
wenzelm@10157
   235
  have "\<top> = dual \<bottom>"
wenzelm@10157
   236
  proof
wenzelm@10157
   237
    fix a' have "\<bottom> \<sqsubseteq> undual a'" ..
wenzelm@10157
   238
    hence "dual (undual a') \<sqsubseteq> dual \<bottom>" ..
wenzelm@10157
   239
    thus "a' \<sqsubseteq> dual \<bottom>" by simp
wenzelm@10157
   240
  qed
wenzelm@10157
   241
  thus ?thesis ..
wenzelm@10157
   242
qed
wenzelm@10157
   243
wenzelm@10157
   244
theorem dual_top [intro?]: "dual \<top> = \<bottom>"
wenzelm@10157
   245
proof -
wenzelm@10157
   246
  have "\<bottom> = dual \<top>"
wenzelm@10157
   247
  proof
wenzelm@10157
   248
    fix a' have "undual a' \<sqsubseteq> \<top>" ..
wenzelm@10157
   249
    hence "dual \<top> \<sqsubseteq> dual (undual a')" ..
wenzelm@10157
   250
    thus "dual \<top> \<sqsubseteq> a'" by simp
wenzelm@10157
   251
  qed
wenzelm@10157
   252
  thus ?thesis ..
wenzelm@10157
   253
qed
wenzelm@10157
   254
wenzelm@10157
   255
wenzelm@10157
   256
subsection {* Complete lattices are lattices *}
wenzelm@10157
   257
wenzelm@10157
   258
text {*
wenzelm@10176
   259
  Complete lattices (with general bounds available) are indeed plain
wenzelm@10157
   260
  lattices as well.  This holds due to the connection of general
wenzelm@10157
   261
  versus binary bounds that has been formally established in
wenzelm@10157
   262
  \S\ref{sec:gen-bin-bounds}.
wenzelm@10157
   263
*}
wenzelm@10157
   264
wenzelm@10157
   265
lemma is_inf_binary: "is_inf x y (\<Sqinter>{x, y})"
wenzelm@10157
   266
proof -
wenzelm@10157
   267
  have "is_Inf {x, y} (\<Sqinter>{x, y})" ..
wenzelm@10157
   268
  thus ?thesis by (simp only: is_Inf_binary)
wenzelm@10157
   269
qed
wenzelm@10157
   270
wenzelm@10157
   271
lemma is_sup_binary: "is_sup x y (\<Squnion>{x, y})"
wenzelm@10157
   272
proof -
wenzelm@10157
   273
  have "is_Sup {x, y} (\<Squnion>{x, y})" ..
wenzelm@10157
   274
  thus ?thesis by (simp only: is_Sup_binary)
wenzelm@10157
   275
qed
wenzelm@10157
   276
wenzelm@10157
   277
instance complete_lattice < lattice
wenzelm@10309
   278
proof
wenzelm@10157
   279
  fix x y :: "'a::complete_lattice"
wenzelm@10157
   280
  from is_inf_binary show "\<exists>inf. is_inf x y inf" ..
wenzelm@10157
   281
  from is_sup_binary show "\<exists>sup. is_sup x y sup" ..
wenzelm@10157
   282
qed
wenzelm@10157
   283
wenzelm@10157
   284
theorem meet_binary: "x \<sqinter> y = \<Sqinter>{x, y}"
wenzelm@10157
   285
  by (rule meet_equality) (rule is_inf_binary)
wenzelm@10157
   286
wenzelm@10157
   287
theorem join_binary: "x \<squnion> y = \<Squnion>{x, y}"
wenzelm@10157
   288
  by (rule join_equality) (rule is_sup_binary)
wenzelm@10157
   289
wenzelm@10157
   290
wenzelm@10157
   291
subsection {* Complete lattices and set-theory operations *}
wenzelm@10157
   292
wenzelm@10157
   293
text {*
wenzelm@10157
   294
  The complete lattice operations are (anti) monotone wrt.\ set
wenzelm@10157
   295
  inclusion.
wenzelm@10157
   296
*}
wenzelm@10157
   297
wenzelm@10157
   298
theorem Meet_subset_antimono: "A \<subseteq> B \<Longrightarrow> \<Sqinter>B \<sqsubseteq> \<Sqinter>A"
wenzelm@10157
   299
proof (rule Meet_greatest)
wenzelm@10157
   300
  fix a assume "a \<in> A"
wenzelm@10157
   301
  also assume "A \<subseteq> B"
wenzelm@10157
   302
  finally have "a \<in> B" .
wenzelm@10157
   303
  thus "\<Sqinter>B \<sqsubseteq> a" ..
wenzelm@10157
   304
qed
wenzelm@10157
   305
wenzelm@10157
   306
theorem Join_subset_mono: "A \<subseteq> B \<Longrightarrow> \<Squnion>A \<sqsubseteq> \<Squnion>B"
wenzelm@10157
   307
proof -
wenzelm@10157
   308
  assume "A \<subseteq> B"
nipkow@10834
   309
  hence "dual ` A \<subseteq> dual ` B" by blast
nipkow@10834
   310
  hence "\<Sqinter>(dual ` B) \<sqsubseteq> \<Sqinter>(dual ` A)" by (rule Meet_subset_antimono)
wenzelm@10157
   311
  hence "dual (\<Squnion>B) \<sqsubseteq> dual (\<Squnion>A)" by (simp only: dual_Join)
wenzelm@10157
   312
  thus ?thesis by (simp only: dual_leq)
wenzelm@10157
   313
qed
wenzelm@10157
   314
wenzelm@10157
   315
text {*
wenzelm@10157
   316
  Bounds over unions of sets may be obtained separately.
wenzelm@10157
   317
*}
wenzelm@10157
   318
wenzelm@10157
   319
theorem Meet_Un: "\<Sqinter>(A \<union> B) = \<Sqinter>A \<sqinter> \<Sqinter>B"
wenzelm@10157
   320
proof
wenzelm@10157
   321
  fix a assume "a \<in> A \<union> B"
wenzelm@10157
   322
  thus "\<Sqinter>A \<sqinter> \<Sqinter>B \<sqsubseteq> a"
wenzelm@10157
   323
  proof
wenzelm@10157
   324
    assume a: "a \<in> A"
wenzelm@10157
   325
    have "\<Sqinter>A \<sqinter> \<Sqinter>B \<sqsubseteq> \<Sqinter>A" ..
wenzelm@10157
   326
    also from a have "\<dots> \<sqsubseteq> a" ..
wenzelm@10157
   327
    finally show ?thesis .
wenzelm@10157
   328
  next
wenzelm@10157
   329
    assume a: "a \<in> B"
wenzelm@10157
   330
    have "\<Sqinter>A \<sqinter> \<Sqinter>B \<sqsubseteq> \<Sqinter>B" ..
wenzelm@10157
   331
    also from a have "\<dots> \<sqsubseteq> a" ..
wenzelm@10157
   332
    finally show ?thesis .
wenzelm@10157
   333
  qed
wenzelm@10157
   334
next
wenzelm@10157
   335
  fix b assume b: "\<forall>a \<in> A \<union> B. b \<sqsubseteq> a"
wenzelm@10157
   336
  show "b \<sqsubseteq> \<Sqinter>A \<sqinter> \<Sqinter>B"
wenzelm@10157
   337
  proof
wenzelm@10157
   338
    show "b \<sqsubseteq> \<Sqinter>A"
wenzelm@10157
   339
    proof
wenzelm@10157
   340
      fix a assume "a \<in> A"
wenzelm@10157
   341
      hence "a \<in>  A \<union> B" ..
wenzelm@10157
   342
      with b show "b \<sqsubseteq> a" ..
wenzelm@10157
   343
    qed
wenzelm@10157
   344
    show "b \<sqsubseteq> \<Sqinter>B"
wenzelm@10157
   345
    proof
wenzelm@10157
   346
      fix a assume "a \<in> B"
wenzelm@10157
   347
      hence "a \<in>  A \<union> B" ..
wenzelm@10157
   348
      with b show "b \<sqsubseteq> a" ..
wenzelm@10157
   349
    qed
wenzelm@10157
   350
  qed
wenzelm@10157
   351
qed
wenzelm@10157
   352
wenzelm@10157
   353
theorem Join_Un: "\<Squnion>(A \<union> B) = \<Squnion>A \<squnion> \<Squnion>B"
wenzelm@10157
   354
proof -
nipkow@10834
   355
  have "dual (\<Squnion>(A \<union> B)) = \<Sqinter>(dual ` A \<union> dual ` B)"
wenzelm@10157
   356
    by (simp only: dual_Join image_Un)
nipkow@10834
   357
  also have "\<dots> = \<Sqinter>(dual ` A) \<sqinter> \<Sqinter>(dual ` B)"
wenzelm@10157
   358
    by (rule Meet_Un)
wenzelm@10157
   359
  also have "\<dots> = dual (\<Squnion>A \<squnion> \<Squnion>B)"
wenzelm@10157
   360
    by (simp only: dual_join dual_Join)
wenzelm@10157
   361
  finally show ?thesis ..
wenzelm@10157
   362
qed
wenzelm@10157
   363
wenzelm@10157
   364
text {*
wenzelm@10157
   365
  Bounds over singleton sets are trivial.
wenzelm@10157
   366
*}
wenzelm@10157
   367
wenzelm@10157
   368
theorem Meet_singleton: "\<Sqinter>{x} = x"
wenzelm@10157
   369
proof
wenzelm@10157
   370
  fix a assume "a \<in> {x}"
wenzelm@10157
   371
  hence "a = x" by simp
wenzelm@10157
   372
  thus "x \<sqsubseteq> a" by (simp only: leq_refl)
wenzelm@10157
   373
next
wenzelm@10157
   374
  fix b assume "\<forall>a \<in> {x}. b \<sqsubseteq> a"
wenzelm@10157
   375
  thus "b \<sqsubseteq> x" by simp
wenzelm@10157
   376
qed
wenzelm@10157
   377
wenzelm@10157
   378
theorem Join_singleton: "\<Squnion>{x} = x"
wenzelm@10157
   379
proof -
wenzelm@10157
   380
  have "dual (\<Squnion>{x}) = \<Sqinter>{dual x}" by (simp add: dual_Join)
wenzelm@10157
   381
  also have "\<dots> = dual x" by (rule Meet_singleton)
wenzelm@10157
   382
  finally show ?thesis ..
wenzelm@10157
   383
qed
wenzelm@10157
   384
wenzelm@10157
   385
text {*
wenzelm@10157
   386
  Bounds over the empty and universal set correspond to each other.
wenzelm@10157
   387
*}
wenzelm@10157
   388
wenzelm@10157
   389
theorem Meet_empty: "\<Sqinter>{} = \<Squnion>UNIV"
wenzelm@10157
   390
proof
wenzelm@10157
   391
  fix a :: "'a::complete_lattice"
wenzelm@10157
   392
  assume "a \<in> {}"
wenzelm@10157
   393
  hence False by simp
wenzelm@10157
   394
  thus "\<Squnion>UNIV \<sqsubseteq> a" ..
wenzelm@10157
   395
next
wenzelm@10157
   396
  fix b :: "'a::complete_lattice"
wenzelm@10157
   397
  have "b \<in> UNIV" ..
wenzelm@10157
   398
  thus "b \<sqsubseteq> \<Squnion>UNIV" ..
wenzelm@10157
   399
qed
wenzelm@10157
   400
wenzelm@10157
   401
theorem Join_empty: "\<Squnion>{} = \<Sqinter>UNIV"
wenzelm@10157
   402
proof -
wenzelm@10157
   403
  have "dual (\<Squnion>{}) = \<Sqinter>{}" by (simp add: dual_Join)
wenzelm@10157
   404
  also have "\<dots> = \<Squnion>UNIV" by (rule Meet_empty)
wenzelm@10157
   405
  also have "\<dots> = dual (\<Sqinter>UNIV)" by (simp add: dual_Meet)
wenzelm@10157
   406
  finally show ?thesis ..
wenzelm@10157
   407
qed
wenzelm@10157
   408
wenzelm@10157
   409
end