src/HOL/Lattice/CompleteLattice.thy
author wenzelm
Thu May 24 17:25:53 2012 +0200 (2012-05-24)
changeset 47988 e4b69e10b990
parent 35317 d57da4abb47d
child 56154 f0a927235162
permissions -rw-r--r--
tuned proofs;
wenzelm@10157
     1
(*  Title:      HOL/Lattice/CompleteLattice.thy
wenzelm@10157
     2
    Author:     Markus Wenzel, TU Muenchen
wenzelm@10157
     3
*)
wenzelm@10157
     4
wenzelm@10157
     5
header {* Complete lattices *}
wenzelm@10157
     6
haftmann@16417
     7
theory CompleteLattice imports Lattice begin
wenzelm@10157
     8
wenzelm@10157
     9
subsection {* Complete lattice operations *}
wenzelm@10157
    10
wenzelm@10157
    11
text {*
wenzelm@10157
    12
  A \emph{complete lattice} is a partial order with general
wenzelm@10157
    13
  (infinitary) infimum of any set of elements.  General supremum
wenzelm@10157
    14
  exists as well, as a consequence of the connection of infinitary
wenzelm@10157
    15
  bounds (see \S\ref{sec:connect-bounds}).
wenzelm@10157
    16
*}
wenzelm@10157
    17
haftmann@35317
    18
class complete_lattice =
haftmann@35317
    19
  assumes ex_Inf: "\<exists>inf. is_Inf A inf"
wenzelm@10157
    20
wenzelm@10157
    21
theorem ex_Sup: "\<exists>sup::'a::complete_lattice. is_Sup A sup"
wenzelm@10157
    22
proof -
wenzelm@10157
    23
  from ex_Inf obtain sup where "is_Inf {b. \<forall>a\<in>A. a \<sqsubseteq> b} sup" by blast
wenzelm@23373
    24
  then have "is_Sup A sup" by (rule Inf_Sup)
wenzelm@23373
    25
  then show ?thesis ..
wenzelm@10157
    26
qed
wenzelm@10157
    27
wenzelm@10157
    28
text {*
wenzelm@10157
    29
  The general @{text \<Sqinter>} (meet) and @{text \<Squnion>} (join) operations select
wenzelm@10157
    30
  such infimum and supremum elements.
wenzelm@10157
    31
*}
wenzelm@10157
    32
wenzelm@19736
    33
definition
wenzelm@21404
    34
  Meet :: "'a::complete_lattice set \<Rightarrow> 'a" where
wenzelm@19736
    35
  "Meet A = (THE inf. is_Inf A inf)"
wenzelm@21404
    36
definition
wenzelm@21404
    37
  Join :: "'a::complete_lattice set \<Rightarrow> 'a" where
wenzelm@19736
    38
  "Join A = (THE sup. is_Sup A sup)"
wenzelm@19736
    39
wenzelm@21210
    40
notation (xsymbols)
wenzelm@21404
    41
  Meet  ("\<Sqinter>_" [90] 90) and
wenzelm@19736
    42
  Join  ("\<Squnion>_" [90] 90)
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@23373
    52
  then show "(THE inf. is_Inf A inf) = inf"
wenzelm@23373
    53
    by (rule the_equality) (rule is_Inf_uniq [OF _ `is_Inf A inf`])
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@23373
    65
  then show "(THE sup. is_Sup A sup) = sup"
wenzelm@23373
    66
    by (rule the_equality) (rule is_Sup_uniq [OF _ `is_Sup A sup`])
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@11441
    83
  from ex_Inf obtain inf where "is_Inf A inf" ..
wenzelm@23373
    84
  then show "is_Inf A (THE inf. is_Inf A inf)"
wenzelm@23373
    85
    by (rule theI) (rule is_Inf_uniq [OF _ `is_Inf A inf`])
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@23373
    98
  then show "is_Sup A (THE sup. is_Sup A sup)"
wenzelm@23373
    99
    by (rule theI) (rule is_Sup_uniq [OF _ `is_Sup A sup`])
wenzelm@10157
   100
qed
wenzelm@10157
   101
wenzelm@10157
   102
lemma Join_least [intro?]: "(\<And>a. a \<in> A \<Longrightarrow> a \<sqsubseteq> x) \<Longrightarrow> \<Squnion>A \<sqsubseteq> x"
wenzelm@10157
   103
  by (rule is_Sup_least, rule is_Sup_Join) blast
wenzelm@10157
   104
lemma Join_lower [intro?]: "a \<in> A \<Longrightarrow> a \<sqsubseteq> \<Squnion>A"
wenzelm@10157
   105
  by (rule is_Sup_upper) (rule is_Sup_Join)
wenzelm@10157
   106
wenzelm@10157
   107
wenzelm@10157
   108
subsection {* The Knaster-Tarski Theorem *}
wenzelm@10157
   109
wenzelm@10157
   110
text {*
wenzelm@10157
   111
  The Knaster-Tarski Theorem (in its simplest formulation) states that
wenzelm@10157
   112
  any monotone function on a complete lattice has a least fixed-point
wenzelm@10157
   113
  (see \cite[pages 93--94]{Davey-Priestley:1990} for example).  This
wenzelm@10157
   114
  is a consequence of the basic boundary properties of the complete
wenzelm@10157
   115
  lattice operations.
wenzelm@10157
   116
*}
wenzelm@10157
   117
wenzelm@10157
   118
theorem Knaster_Tarski:
wenzelm@25469
   119
  assumes mono: "\<And>x y. x \<sqsubseteq> y \<Longrightarrow> f x \<sqsubseteq> f y"
wenzelm@25474
   120
  obtains a :: "'a::complete_lattice" where
wenzelm@25474
   121
    "f a = a" and "\<And>a'. f a' = a' \<Longrightarrow> a \<sqsubseteq> a'"
wenzelm@25474
   122
proof
wenzelm@25469
   123
  let ?H = "{u. f u \<sqsubseteq> u}"
wenzelm@25469
   124
  let ?a = "\<Sqinter>?H"
wenzelm@25474
   125
  show "f ?a = ?a"
wenzelm@25469
   126
  proof -
wenzelm@25469
   127
    have ge: "f ?a \<sqsubseteq> ?a"
wenzelm@25469
   128
    proof
wenzelm@25469
   129
      fix x assume x: "x \<in> ?H"
wenzelm@25469
   130
      then have "?a \<sqsubseteq> x" ..
wenzelm@25469
   131
      then have "f ?a \<sqsubseteq> f x" by (rule mono)
wenzelm@25469
   132
      also from x have "... \<sqsubseteq> x" ..
wenzelm@25469
   133
      finally show "f ?a \<sqsubseteq> x" .
wenzelm@25469
   134
    qed
wenzelm@25469
   135
    also have "?a \<sqsubseteq> f ?a"
wenzelm@25469
   136
    proof
wenzelm@25469
   137
      from ge have "f (f ?a) \<sqsubseteq> f ?a" by (rule mono)
wenzelm@25469
   138
      then show "f ?a \<in> ?H" ..
wenzelm@25469
   139
    qed
wenzelm@25469
   140
    finally show ?thesis .
wenzelm@10157
   141
  qed
wenzelm@25474
   142
wenzelm@25474
   143
  fix a'
wenzelm@25474
   144
  assume "f a' = a'"
wenzelm@25474
   145
  then have "f a' \<sqsubseteq> a'" by (simp only: leq_refl)
wenzelm@25474
   146
  then have "a' \<in> ?H" ..
wenzelm@25474
   147
  then show "?a \<sqsubseteq> a'" ..
wenzelm@25469
   148
qed
wenzelm@25469
   149
wenzelm@25469
   150
theorem Knaster_Tarski_dual:
wenzelm@25469
   151
  assumes mono: "\<And>x y. x \<sqsubseteq> y \<Longrightarrow> f x \<sqsubseteq> f y"
wenzelm@25474
   152
  obtains a :: "'a::complete_lattice" where
wenzelm@25474
   153
    "f a = a" and "\<And>a'. f a' = a' \<Longrightarrow> a' \<sqsubseteq> a"
wenzelm@25474
   154
proof
wenzelm@25469
   155
  let ?H = "{u. u \<sqsubseteq> f u}"
wenzelm@25469
   156
  let ?a = "\<Squnion>?H"
wenzelm@25474
   157
  show "f ?a = ?a"
wenzelm@25469
   158
  proof -
wenzelm@25469
   159
    have le: "?a \<sqsubseteq> f ?a"
wenzelm@25469
   160
    proof
wenzelm@25469
   161
      fix x assume x: "x \<in> ?H"
wenzelm@25469
   162
      then have "x \<sqsubseteq> f x" ..
wenzelm@25469
   163
      also from x have "x \<sqsubseteq> ?a" ..
wenzelm@25469
   164
      then have "f x \<sqsubseteq> f ?a" by (rule mono)
wenzelm@25469
   165
      finally show "x \<sqsubseteq> f ?a" .
wenzelm@25469
   166
    qed
wenzelm@25469
   167
    have "f ?a \<sqsubseteq> ?a"
wenzelm@25469
   168
    proof
wenzelm@25469
   169
      from le have "f ?a \<sqsubseteq> f (f ?a)" by (rule mono)
wenzelm@25469
   170
      then show "f ?a \<in> ?H" ..
wenzelm@25469
   171
    qed
wenzelm@25469
   172
    from this and le show ?thesis by (rule leq_antisym)
wenzelm@10157
   173
  qed
wenzelm@25474
   174
wenzelm@25474
   175
  fix a'
wenzelm@25474
   176
  assume "f a' = a'"
wenzelm@25474
   177
  then have "a' \<sqsubseteq> f a'" by (simp only: leq_refl)
wenzelm@25474
   178
  then have "a' \<in> ?H" ..
wenzelm@25474
   179
  then show "a' \<sqsubseteq> ?a" ..
wenzelm@10157
   180
qed
wenzelm@10157
   181
wenzelm@10157
   182
wenzelm@10157
   183
subsection {* Bottom and top elements *}
wenzelm@10157
   184
wenzelm@10157
   185
text {*
wenzelm@10157
   186
  With general bounds available, complete lattices also have least and
wenzelm@10157
   187
  greatest elements.
wenzelm@10157
   188
*}
wenzelm@10157
   189
wenzelm@19736
   190
definition
wenzelm@25469
   191
  bottom :: "'a::complete_lattice"  ("\<bottom>") where
wenzelm@19736
   192
  "\<bottom> = \<Sqinter>UNIV"
wenzelm@25469
   193
wenzelm@21404
   194
definition
wenzelm@25469
   195
  top :: "'a::complete_lattice"  ("\<top>") where
wenzelm@19736
   196
  "\<top> = \<Squnion>UNIV"
wenzelm@10157
   197
wenzelm@10157
   198
lemma bottom_least [intro?]: "\<bottom> \<sqsubseteq> x"
wenzelm@10157
   199
proof (unfold bottom_def)
wenzelm@10157
   200
  have "x \<in> UNIV" ..
wenzelm@23373
   201
  then show "\<Sqinter>UNIV \<sqsubseteq> x" ..
wenzelm@10157
   202
qed
wenzelm@10157
   203
wenzelm@10157
   204
lemma bottomI [intro?]: "(\<And>a. x \<sqsubseteq> a) \<Longrightarrow> \<bottom> = x"
wenzelm@10157
   205
proof (unfold bottom_def)
wenzelm@10157
   206
  assume "\<And>a. x \<sqsubseteq> a"
wenzelm@10157
   207
  show "\<Sqinter>UNIV = x"
wenzelm@10157
   208
  proof
wenzelm@23373
   209
    fix a show "x \<sqsubseteq> a" by fact
wenzelm@10157
   210
  next
wenzelm@10157
   211
    fix b :: "'a::complete_lattice"
wenzelm@10157
   212
    assume b: "\<forall>a \<in> UNIV. b \<sqsubseteq> a"
wenzelm@10157
   213
    have "x \<in> UNIV" ..
wenzelm@10157
   214
    with b show "b \<sqsubseteq> x" ..
wenzelm@10157
   215
  qed
wenzelm@10157
   216
qed
wenzelm@10157
   217
wenzelm@10157
   218
lemma top_greatest [intro?]: "x \<sqsubseteq> \<top>"
wenzelm@10157
   219
proof (unfold top_def)
wenzelm@10157
   220
  have "x \<in> UNIV" ..
wenzelm@23373
   221
  then show "x \<sqsubseteq> \<Squnion>UNIV" ..
wenzelm@10157
   222
qed
wenzelm@10157
   223
wenzelm@10157
   224
lemma topI [intro?]: "(\<And>a. a \<sqsubseteq> x) \<Longrightarrow> \<top> = x"
wenzelm@10157
   225
proof (unfold top_def)
wenzelm@10157
   226
  assume "\<And>a. a \<sqsubseteq> x"
wenzelm@10157
   227
  show "\<Squnion>UNIV = x"
wenzelm@10157
   228
  proof
wenzelm@23373
   229
    fix a show "a \<sqsubseteq> x" by fact
wenzelm@10157
   230
  next
wenzelm@10157
   231
    fix b :: "'a::complete_lattice"
wenzelm@10157
   232
    assume b: "\<forall>a \<in> UNIV. a \<sqsubseteq> b"
wenzelm@10157
   233
    have "x \<in> UNIV" ..
wenzelm@10157
   234
    with b show "x \<sqsubseteq> b" ..
wenzelm@10157
   235
  qed
wenzelm@10157
   236
qed
wenzelm@10157
   237
wenzelm@10157
   238
wenzelm@10157
   239
subsection {* Duality *}
wenzelm@10157
   240
wenzelm@10157
   241
text {*
wenzelm@10157
   242
  The class of complete lattices is closed under formation of dual
wenzelm@10157
   243
  structures.
wenzelm@10157
   244
*}
wenzelm@10157
   245
wenzelm@10157
   246
instance dual :: (complete_lattice) complete_lattice
wenzelm@10309
   247
proof
wenzelm@10157
   248
  fix A' :: "'a::complete_lattice dual set"
wenzelm@10157
   249
  show "\<exists>inf'. is_Inf A' inf'"
wenzelm@10157
   250
  proof -
nipkow@10834
   251
    have "\<exists>sup. is_Sup (undual ` A') sup" by (rule ex_Sup)
wenzelm@23373
   252
    then have "\<exists>sup. is_Inf (dual ` undual ` A') (dual sup)" by (simp only: dual_Inf)
wenzelm@23373
   253
    then show ?thesis by (simp add: dual_ex [symmetric] image_compose [symmetric])
wenzelm@10157
   254
  qed
wenzelm@10157
   255
qed
wenzelm@10157
   256
wenzelm@10157
   257
text {*
wenzelm@10157
   258
  Apparently, the @{text \<Sqinter>} and @{text \<Squnion>} operations are dual to each
wenzelm@10157
   259
  other.
wenzelm@10157
   260
*}
wenzelm@10157
   261
nipkow@10834
   262
theorem dual_Meet [intro?]: "dual (\<Sqinter>A) = \<Squnion>(dual ` A)"
wenzelm@10157
   263
proof -
nipkow@10834
   264
  from is_Inf_Meet have "is_Sup (dual ` A) (dual (\<Sqinter>A))" ..
wenzelm@23373
   265
  then have "\<Squnion>(dual ` A) = dual (\<Sqinter>A)" ..
wenzelm@23373
   266
  then show ?thesis ..
wenzelm@10157
   267
qed
wenzelm@10157
   268
nipkow@10834
   269
theorem dual_Join [intro?]: "dual (\<Squnion>A) = \<Sqinter>(dual ` A)"
wenzelm@10157
   270
proof -
nipkow@10834
   271
  from is_Sup_Join have "is_Inf (dual ` A) (dual (\<Squnion>A))" ..
wenzelm@23373
   272
  then have "\<Sqinter>(dual ` A) = dual (\<Squnion>A)" ..
wenzelm@23373
   273
  then show ?thesis ..
wenzelm@10157
   274
qed
wenzelm@10157
   275
wenzelm@10157
   276
text {*
wenzelm@10157
   277
  Likewise are @{text \<bottom>} and @{text \<top>} duals of each other.
wenzelm@10157
   278
*}
wenzelm@10157
   279
wenzelm@10157
   280
theorem dual_bottom [intro?]: "dual \<bottom> = \<top>"
wenzelm@10157
   281
proof -
wenzelm@10157
   282
  have "\<top> = dual \<bottom>"
wenzelm@10157
   283
  proof
wenzelm@10157
   284
    fix a' have "\<bottom> \<sqsubseteq> undual a'" ..
wenzelm@23373
   285
    then have "dual (undual a') \<sqsubseteq> dual \<bottom>" ..
wenzelm@23373
   286
    then show "a' \<sqsubseteq> dual \<bottom>" by simp
wenzelm@10157
   287
  qed
wenzelm@23373
   288
  then show ?thesis ..
wenzelm@10157
   289
qed
wenzelm@10157
   290
wenzelm@10157
   291
theorem dual_top [intro?]: "dual \<top> = \<bottom>"
wenzelm@10157
   292
proof -
wenzelm@10157
   293
  have "\<bottom> = dual \<top>"
wenzelm@10157
   294
  proof
wenzelm@10157
   295
    fix a' have "undual a' \<sqsubseteq> \<top>" ..
wenzelm@23373
   296
    then have "dual \<top> \<sqsubseteq> dual (undual a')" ..
wenzelm@23373
   297
    then show "dual \<top> \<sqsubseteq> a'" by simp
wenzelm@10157
   298
  qed
wenzelm@23373
   299
  then show ?thesis ..
wenzelm@10157
   300
qed
wenzelm@10157
   301
wenzelm@10157
   302
wenzelm@10157
   303
subsection {* Complete lattices are lattices *}
wenzelm@10157
   304
wenzelm@10157
   305
text {*
wenzelm@10176
   306
  Complete lattices (with general bounds available) are indeed plain
wenzelm@10157
   307
  lattices as well.  This holds due to the connection of general
wenzelm@10157
   308
  versus binary bounds that has been formally established in
wenzelm@10157
   309
  \S\ref{sec:gen-bin-bounds}.
wenzelm@10157
   310
*}
wenzelm@10157
   311
wenzelm@10157
   312
lemma is_inf_binary: "is_inf x y (\<Sqinter>{x, y})"
wenzelm@10157
   313
proof -
wenzelm@10157
   314
  have "is_Inf {x, y} (\<Sqinter>{x, y})" ..
wenzelm@23373
   315
  then show ?thesis by (simp only: is_Inf_binary)
wenzelm@10157
   316
qed
wenzelm@10157
   317
wenzelm@10157
   318
lemma is_sup_binary: "is_sup x y (\<Squnion>{x, y})"
wenzelm@10157
   319
proof -
wenzelm@10157
   320
  have "is_Sup {x, y} (\<Squnion>{x, y})" ..
wenzelm@23373
   321
  then show ?thesis by (simp only: is_Sup_binary)
wenzelm@10157
   322
qed
wenzelm@10157
   323
wenzelm@11099
   324
instance complete_lattice \<subseteq> lattice
wenzelm@10309
   325
proof
wenzelm@10157
   326
  fix x y :: "'a::complete_lattice"
wenzelm@10157
   327
  from is_inf_binary show "\<exists>inf. is_inf x y inf" ..
wenzelm@10157
   328
  from is_sup_binary show "\<exists>sup. is_sup x y sup" ..
wenzelm@10157
   329
qed
wenzelm@10157
   330
wenzelm@10157
   331
theorem meet_binary: "x \<sqinter> y = \<Sqinter>{x, y}"
wenzelm@10157
   332
  by (rule meet_equality) (rule is_inf_binary)
wenzelm@10157
   333
wenzelm@10157
   334
theorem join_binary: "x \<squnion> y = \<Squnion>{x, y}"
wenzelm@10157
   335
  by (rule join_equality) (rule is_sup_binary)
wenzelm@10157
   336
wenzelm@10157
   337
wenzelm@10157
   338
subsection {* Complete lattices and set-theory operations *}
wenzelm@10157
   339
wenzelm@10157
   340
text {*
wenzelm@10157
   341
  The complete lattice operations are (anti) monotone wrt.\ set
wenzelm@10157
   342
  inclusion.
wenzelm@10157
   343
*}
wenzelm@10157
   344
wenzelm@10157
   345
theorem Meet_subset_antimono: "A \<subseteq> B \<Longrightarrow> \<Sqinter>B \<sqsubseteq> \<Sqinter>A"
wenzelm@10157
   346
proof (rule Meet_greatest)
wenzelm@10157
   347
  fix a assume "a \<in> A"
wenzelm@10157
   348
  also assume "A \<subseteq> B"
wenzelm@10157
   349
  finally have "a \<in> B" .
wenzelm@23373
   350
  then show "\<Sqinter>B \<sqsubseteq> a" ..
wenzelm@10157
   351
qed
wenzelm@10157
   352
wenzelm@10157
   353
theorem Join_subset_mono: "A \<subseteq> B \<Longrightarrow> \<Squnion>A \<sqsubseteq> \<Squnion>B"
wenzelm@10157
   354
proof -
wenzelm@10157
   355
  assume "A \<subseteq> B"
wenzelm@23373
   356
  then have "dual ` A \<subseteq> dual ` B" by blast
wenzelm@23373
   357
  then have "\<Sqinter>(dual ` B) \<sqsubseteq> \<Sqinter>(dual ` A)" by (rule Meet_subset_antimono)
wenzelm@23373
   358
  then have "dual (\<Squnion>B) \<sqsubseteq> dual (\<Squnion>A)" by (simp only: dual_Join)
wenzelm@23373
   359
  then show ?thesis by (simp only: dual_leq)
wenzelm@10157
   360
qed
wenzelm@10157
   361
wenzelm@10157
   362
text {*
wenzelm@10157
   363
  Bounds over unions of sets may be obtained separately.
wenzelm@10157
   364
*}
wenzelm@10157
   365
wenzelm@10157
   366
theorem Meet_Un: "\<Sqinter>(A \<union> B) = \<Sqinter>A \<sqinter> \<Sqinter>B"
wenzelm@10157
   367
proof
wenzelm@10157
   368
  fix a assume "a \<in> A \<union> B"
wenzelm@23373
   369
  then show "\<Sqinter>A \<sqinter> \<Sqinter>B \<sqsubseteq> a"
wenzelm@10157
   370
  proof
wenzelm@10157
   371
    assume a: "a \<in> A"
wenzelm@10157
   372
    have "\<Sqinter>A \<sqinter> \<Sqinter>B \<sqsubseteq> \<Sqinter>A" ..
wenzelm@10157
   373
    also from a have "\<dots> \<sqsubseteq> a" ..
wenzelm@10157
   374
    finally show ?thesis .
wenzelm@10157
   375
  next
wenzelm@10157
   376
    assume a: "a \<in> B"
wenzelm@10157
   377
    have "\<Sqinter>A \<sqinter> \<Sqinter>B \<sqsubseteq> \<Sqinter>B" ..
wenzelm@10157
   378
    also from a have "\<dots> \<sqsubseteq> a" ..
wenzelm@10157
   379
    finally show ?thesis .
wenzelm@10157
   380
  qed
wenzelm@10157
   381
next
wenzelm@10157
   382
  fix b assume b: "\<forall>a \<in> A \<union> B. b \<sqsubseteq> a"
wenzelm@10157
   383
  show "b \<sqsubseteq> \<Sqinter>A \<sqinter> \<Sqinter>B"
wenzelm@10157
   384
  proof
wenzelm@10157
   385
    show "b \<sqsubseteq> \<Sqinter>A"
wenzelm@10157
   386
    proof
wenzelm@10157
   387
      fix a assume "a \<in> A"
wenzelm@23373
   388
      then have "a \<in>  A \<union> B" ..
wenzelm@10157
   389
      with b show "b \<sqsubseteq> a" ..
wenzelm@10157
   390
    qed
wenzelm@10157
   391
    show "b \<sqsubseteq> \<Sqinter>B"
wenzelm@10157
   392
    proof
wenzelm@10157
   393
      fix a assume "a \<in> B"
wenzelm@23373
   394
      then have "a \<in>  A \<union> B" ..
wenzelm@10157
   395
      with b show "b \<sqsubseteq> a" ..
wenzelm@10157
   396
    qed
wenzelm@10157
   397
  qed
wenzelm@10157
   398
qed
wenzelm@10157
   399
wenzelm@10157
   400
theorem Join_Un: "\<Squnion>(A \<union> B) = \<Squnion>A \<squnion> \<Squnion>B"
wenzelm@10157
   401
proof -
nipkow@10834
   402
  have "dual (\<Squnion>(A \<union> B)) = \<Sqinter>(dual ` A \<union> dual ` B)"
wenzelm@10157
   403
    by (simp only: dual_Join image_Un)
nipkow@10834
   404
  also have "\<dots> = \<Sqinter>(dual ` A) \<sqinter> \<Sqinter>(dual ` B)"
wenzelm@10157
   405
    by (rule Meet_Un)
wenzelm@10157
   406
  also have "\<dots> = dual (\<Squnion>A \<squnion> \<Squnion>B)"
wenzelm@10157
   407
    by (simp only: dual_join dual_Join)
wenzelm@10157
   408
  finally show ?thesis ..
wenzelm@10157
   409
qed
wenzelm@10157
   410
wenzelm@10157
   411
text {*
wenzelm@10157
   412
  Bounds over singleton sets are trivial.
wenzelm@10157
   413
*}
wenzelm@10157
   414
wenzelm@10157
   415
theorem Meet_singleton: "\<Sqinter>{x} = x"
wenzelm@10157
   416
proof
wenzelm@10157
   417
  fix a assume "a \<in> {x}"
wenzelm@23373
   418
  then have "a = x" by simp
wenzelm@23373
   419
  then show "x \<sqsubseteq> a" by (simp only: leq_refl)
wenzelm@10157
   420
next
wenzelm@10157
   421
  fix b assume "\<forall>a \<in> {x}. b \<sqsubseteq> a"
wenzelm@23373
   422
  then show "b \<sqsubseteq> x" by simp
wenzelm@10157
   423
qed
wenzelm@10157
   424
wenzelm@10157
   425
theorem Join_singleton: "\<Squnion>{x} = x"
wenzelm@10157
   426
proof -
wenzelm@10157
   427
  have "dual (\<Squnion>{x}) = \<Sqinter>{dual x}" by (simp add: dual_Join)
wenzelm@10157
   428
  also have "\<dots> = dual x" by (rule Meet_singleton)
wenzelm@10157
   429
  finally show ?thesis ..
wenzelm@10157
   430
qed
wenzelm@10157
   431
wenzelm@10157
   432
text {*
wenzelm@10157
   433
  Bounds over the empty and universal set correspond to each other.
wenzelm@10157
   434
*}
wenzelm@10157
   435
wenzelm@10157
   436
theorem Meet_empty: "\<Sqinter>{} = \<Squnion>UNIV"
wenzelm@10157
   437
proof
wenzelm@10157
   438
  fix a :: "'a::complete_lattice"
wenzelm@10157
   439
  assume "a \<in> {}"
wenzelm@23373
   440
  then have False by simp
wenzelm@23373
   441
  then show "\<Squnion>UNIV \<sqsubseteq> a" ..
wenzelm@10157
   442
next
wenzelm@10157
   443
  fix b :: "'a::complete_lattice"
wenzelm@10157
   444
  have "b \<in> UNIV" ..
wenzelm@23373
   445
  then show "b \<sqsubseteq> \<Squnion>UNIV" ..
wenzelm@10157
   446
qed
wenzelm@10157
   447
wenzelm@10157
   448
theorem Join_empty: "\<Squnion>{} = \<Sqinter>UNIV"
wenzelm@10157
   449
proof -
wenzelm@10157
   450
  have "dual (\<Squnion>{}) = \<Sqinter>{}" by (simp add: dual_Join)
wenzelm@10157
   451
  also have "\<dots> = \<Squnion>UNIV" by (rule Meet_empty)
wenzelm@10157
   452
  also have "\<dots> = dual (\<Sqinter>UNIV)" by (simp add: dual_Meet)
wenzelm@10157
   453
  finally show ?thesis ..
wenzelm@10157
   454
qed
wenzelm@10157
   455
wenzelm@10157
   456
end