@@ -4,8 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
4
4
Author: Aaron Anderson.
5
5
-/
6
6
7
- import order.bounded_lattice
7
+ import order.complete_boolean_algebra
8
8
import order.order_dual
9
+ import order.lattice_intervals
10
+ import order.rel_iso
11
+ import data.fintype.basic
9
12
10
13
/-!
11
14
# Atoms, Coatoms, and Simple Lattices
@@ -14,9 +17,25 @@ This module defines atoms, which are minimal non-`⊥` elements in bounded latti
14
17
which are lattices with only two elements, and related ideas.
15
18
16
19
## Main definitions
20
+
21
+ ### Atoms and Coatoms
17
22
* `is_atom a` indicates that the only element below `a` is `⊥`.
18
23
* `is_coatom a` indicates that the only element above `a` is `⊤`.
24
+
25
+ ### Simple Lattices
19
26
* `is_simple_lattice` indicates that a bounded lattice has only two elements, `⊥` and `⊤`.
27
+ * `is_simple_lattice.bounded_distrib_lattice`
28
+ * Given an instance of `is_simple_lattice`, we provide the following definitions. These are not
29
+ made global instances as they contain data :
30
+ * `is_simple_lattice.boolean_algebra`
31
+ * `is_simple_lattice.complete_lattice`
32
+ * `is_simple_lattice.complete_boolean_algebra`
33
+
34
+ ## Main results
35
+ * `is_atom_iff_is_coatom_dual` and `is_coatom_iff_is_atom_dual` express the (definitional) duality
36
+ of `is_atom` and `is_coatom`.
37
+ * `is_simple_lattice_iff_is_atom_top` and `is_simple_lattice_iff_is_coatom_bot` express the
38
+ connection between atoms, coatoms, and simple lattices
20
39
21
40
-/
22
41
@@ -108,6 +127,113 @@ is_simple_lattice_iff_is_simple_lattice_order_dual.1 (by apply_instance)
108
127
109
128
end is_simple_lattice
110
129
130
+ namespace is_simple_lattice
131
+
132
+ variables [bounded_lattice α] [is_simple_lattice α]
133
+
134
+ /-- A simple `bounded_lattice` is also distributive. -/
135
+ @[priority 100 ]
136
+ instance : bounded_distrib_lattice α :=
137
+ { le_sup_inf := λ x y z, by { rcases eq_bot_or_eq_top x with rfl | rfl; simp },
138
+ .. (infer_instance : bounded_lattice α) }
139
+
140
+ section decidable_eq
141
+ variable [decidable_eq α]
142
+
143
+ /-- Every simple lattice is order-isomorphic to `bool`. -/
144
+ def order_iso_bool : α ≃o bool :=
145
+ { to_fun := λ x, x = ⊤,
146
+ inv_fun := λ x, cond x ⊤ ⊥,
147
+ left_inv := λ x, by { rcases (eq_bot_or_eq_top x) with rfl | rfl; simp [bot_ne_top] },
148
+ right_inv := λ x, by { cases x; simp [bot_ne_top] },
149
+ map_rel_iff' := λ a b, begin
150
+ rcases (eq_bot_or_eq_top a) with rfl | rfl,
151
+ { simp [bot_ne_top] },
152
+ { rcases (eq_bot_or_eq_top b) with rfl | rfl,
153
+ { simp [bot_ne_top.symm, bot_ne_top, bool.ff_lt_tt] },
154
+ { simp [bot_ne_top] } }
155
+ end }
156
+
157
+ @[priority 200 ]
158
+ instance : fintype α := fintype.of_equiv bool (order_iso_bool.to_equiv).symm
159
+
160
+ /-- A simple `bounded_lattice` is also a `boolean_algebra`. -/
161
+ protected def boolean_algebra : boolean_algebra α :=
162
+ { compl := λ x, if x = ⊥ then ⊤ else ⊥,
163
+ sdiff := λ x y, if x = ⊤ ∧ y = ⊥ then ⊤ else ⊥,
164
+ sdiff_eq := λ x y, by { rcases eq_bot_or_eq_top x with rfl | rfl; simp [bot_ne_top] },
165
+ inf_compl_le_bot := λ x, by { rcases eq_bot_or_eq_top x with rfl | rfl; simp },
166
+ top_le_sup_compl := λ x, by { rcases eq_bot_or_eq_top x with rfl | rfl; simp },
167
+ .. is_simple_lattice.bounded_distrib_lattice }
168
+
169
+ end decidable_eq
170
+
171
+ open_locale classical
172
+
173
+ /-- A simple `bounded_lattice` is also complete. -/
174
+ protected noncomputable def complete_lattice : complete_lattice α :=
175
+ { Sup := λ s, if ⊤ ∈ s then ⊤ else ⊥,
176
+ Inf := λ s, if ⊥ ∈ s then ⊥ else ⊤,
177
+ le_Sup := λ s x h, by { rcases eq_bot_or_eq_top x with rfl | rfl,
178
+ { exact bot_le },
179
+ { rw if_pos h } },
180
+ Sup_le := λ s x h, by { rcases eq_bot_or_eq_top x with rfl | rfl,
181
+ { rw if_neg,
182
+ intro con,
183
+ exact bot_ne_top (eq_top_iff.2 (h ⊤ con)) },
184
+ { exact le_top } },
185
+ Inf_le := λ s x h, by { rcases eq_bot_or_eq_top x with rfl | rfl,
186
+ { rw if_pos h },
187
+ { exact le_top } },
188
+ le_Inf := λ s x h, by { rcases eq_bot_or_eq_top x with rfl | rfl,
189
+ { exact bot_le },
190
+ { rw if_neg,
191
+ intro con,
192
+ exact top_ne_bot (eq_bot_iff.2 (h ⊥ con)) } },
193
+ .. (infer_instance : bounded_lattice α) }
194
+
195
+ /-- A simple `bounded_lattice` is also a `complete_boolean_algebra`. -/
196
+ protected noncomputable def complete_boolean_algebra : complete_boolean_algebra α :=
197
+ { infi_sup_le_sup_Inf := λ x s, by { rcases eq_bot_or_eq_top x with rfl | rfl,
198
+ { simp only [bot_sup_eq, ← Inf_eq_infi], apply le_refl },
199
+ { simp only [top_sup_eq, le_top] }, },
200
+ inf_Sup_le_supr_inf := λ x s, by { rcases eq_bot_or_eq_top x with rfl | rfl,
201
+ { simp only [bot_inf_eq, bot_le] },
202
+ { simp only [top_inf_eq, ← Sup_eq_supr], apply le_refl } },
203
+ .. is_simple_lattice.complete_lattice,
204
+ .. is_simple_lattice.boolean_algebra }
205
+
206
+ end is_simple_lattice
207
+
208
+ namespace fintype
209
+ namespace is_simple_lattice
210
+ variables [bounded_lattice α] [is_simple_lattice α] [decidable_eq α]
211
+
212
+ lemma univ : (finset.univ : finset α) = {⊤, ⊥} :=
213
+ begin
214
+ change finset.map _ (finset.univ : finset bool) = _,
215
+ rw fintype.univ_bool,
216
+ simp only [finset.map_insert, function.embedding.coe_fn_mk, finset.map_singleton],
217
+ refl,
218
+ end
219
+
220
+ lemma card : fintype.card α = 2 :=
221
+ (fintype.of_equiv_card _).trans fintype.card_bool
222
+
223
+ end is_simple_lattice
224
+ end fintype
225
+
226
+ namespace bool
227
+
228
+ instance : is_simple_lattice bool :=
229
+ ⟨λ a, begin
230
+ rw [← finset.mem_singleton, or.comm, ← finset.mem_insert,
231
+ top_eq_tt, bot_eq_ff, ← fintype.univ_bool],
232
+ apply finset.mem_univ,
233
+ end ⟩
234
+
235
+ end bool
236
+
111
237
theorem is_simple_lattice_iff_is_atom_top [bounded_lattice α] :
112
238
is_simple_lattice α ↔ is_atom (⊤ : α) :=
113
239
⟨λ h, @is_atom_top _ _ h, λ h, {
@@ -116,4 +242,46 @@ theorem is_simple_lattice_iff_is_atom_top [bounded_lattice α] :
116
242
117
243
theorem is_simple_lattice_iff_is_coatom_bot [bounded_lattice α] :
118
244
is_simple_lattice α ↔ is_coatom (⊥ : α) :=
119
- iff.trans is_simple_lattice_iff_is_simple_lattice_order_dual is_simple_lattice_iff_is_atom_top
245
+ is_simple_lattice_iff_is_simple_lattice_order_dual.trans is_simple_lattice_iff_is_atom_top
246
+
247
+ namespace set
248
+
249
+ theorem is_simple_lattice_Iic_iff_is_atom [bounded_lattice α] {a : α} :
250
+ is_simple_lattice (Iic a) ↔ is_atom a :=
251
+ is_simple_lattice_iff_is_atom_top.trans $ and_congr (not_congr subtype.mk_eq_mk)
252
+ ⟨λ h b ab, subtype.mk_eq_mk.1 (h ⟨b, le_of_lt ab⟩ ab),
253
+ λ h ⟨b, hab⟩ hbotb, subtype.mk_eq_mk.2 (h b (subtype.mk_lt_mk.1 hbotb))⟩
254
+
255
+ theorem is_simple_lattice_Ici_iff_is_coatom [bounded_lattice α] {a : α} :
256
+ is_simple_lattice (Ici a) ↔ is_coatom a :=
257
+ is_simple_lattice_iff_is_coatom_bot.trans $ and_congr (not_congr subtype.mk_eq_mk)
258
+ ⟨λ h b ab, subtype.mk_eq_mk.1 (h ⟨b, le_of_lt ab⟩ ab),
259
+ λ h ⟨b, hab⟩ hbotb, subtype.mk_eq_mk.2 (h b (subtype.mk_lt_mk.1 hbotb))⟩
260
+
261
+ end set
262
+
263
+ namespace order_iso
264
+
265
+ variables [bounded_lattice α] {β : Type *} [bounded_lattice β] (f : α ≃o β)
266
+ include f
267
+
268
+ @[simp] lemma is_atom_iff (a : α) : is_atom (f a) ↔ is_atom a :=
269
+ and_congr (not_congr ⟨λ h, f.injective (f.map_bot.symm ▸ h), λ h, f.map_bot ▸ (congr rfl h)⟩)
270
+ ⟨λ h b hb, f.injective ((h (f b) ((f : α ↪o β).lt_iff_lt.2 hb)).trans f.map_bot.symm),
271
+ λ h b hb, f.symm.injective begin
272
+ rw f.symm.map_bot,
273
+ apply h,
274
+ rw [← f.symm_apply_apply a],
275
+ exact (f.symm : β ↪o α).lt_iff_lt.2 hb,
276
+ end ⟩
277
+
278
+ @[simp] lemma is_coatom_iff (a : α) : is_coatom (f a) ↔ is_coatom a := f.dual.is_atom_iff a
279
+
280
+ lemma is_simple_lattice_iff (f : α ≃o β) : is_simple_lattice α ↔ is_simple_lattice β :=
281
+ by rw [is_simple_lattice_iff_is_atom_top, is_simple_lattice_iff_is_atom_top,
282
+ ← f.is_atom_iff ⊤, f.map_top]
283
+
284
+ lemma is_simple_lattice [h : is_simple_lattice β] (f : α ≃o β) : is_simple_lattice α :=
285
+ f.is_simple_lattice_iff.mpr h
286
+
287
+ end order_iso
0 commit comments