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