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