@@ -3,6 +3,7 @@ Copyright (c) 2022 Heather Macbeth. All rights reserved.
3
3
Released under Apache 2.0 license as described in the file LICENSE.
4
4
Authors: Heather Macbeth
5
5
-/
6
+ import Mathlib.Order.CompactlyGenerated
6
7
import Mathlib.Order.ConditionallyCompleteLattice.Basic
7
8
import Mathlib.Order.LatticeIntervals
8
9
import Mathlib.Data.Set.Intervals.OrdConnected
@@ -27,7 +28,7 @@ open Classical
27
28
28
29
open Set
29
30
30
- variable {α : Type *} (s : Set α)
31
+ variable {ι : Sort *} { α : Type *} (s : Set α)
31
32
32
33
section SupSet
33
34
@@ -231,13 +232,94 @@ lemma Set.Icc.coe_sInf [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b
231
232
congrArg Subtype.val (dif_neg hS.ne_empty)
232
233
233
234
lemma Set.Icc.coe_iSup [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b)
234
- {ι : Sort *} [Nonempty ι] {S : ι → Set.Icc a b} : letI := Set.Icc.completeLattice h
235
+ [Nonempty ι] {S : ι → Set.Icc a b} : letI := Set.Icc.completeLattice h
235
236
↑(iSup S) = (⨆ i, S i : α) :=
236
237
(Set.Icc.coe_sSup h (range_nonempty S)).trans (congrArg sSup (range_comp Subtype.val S).symm)
237
238
238
239
lemma Set.Icc.coe_iInf [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b)
239
- {ι : Sort *} [Nonempty ι] {S : ι → Set.Icc a b} : letI := Set.Icc.completeLattice h
240
+ [Nonempty ι] {S : ι → Set.Icc a b} : letI := Set.Icc.completeLattice h
240
241
↑(iInf S) = (⨅ i, S i : α) :=
241
242
(Set.Icc.coe_sInf h (range_nonempty S)).trans (congrArg sInf (range_comp Subtype.val S).symm)
242
243
243
244
end Icc
245
+
246
+ namespace Set.Iic
247
+
248
+ variable [CompleteLattice α] {a : α}
249
+
250
+ instance instCompleteLattice : CompleteLattice (Iic a) where
251
+ sSup S := ⟨sSup ((↑) '' S), by simpa using fun b hb _ ↦ hb⟩
252
+ sInf S := ⟨a ⊓ sInf ((↑) '' S), by simp⟩
253
+ le_sSup S b hb := le_sSup <| mem_image_of_mem Subtype.val hb
254
+ sSup_le S b hb := sSup_le <| fun c' ⟨c, hc, hc'⟩ ↦ hc' ▸ hb c hc
255
+ sInf_le S b hb := inf_le_of_right_le <| sInf_le <| mem_image_of_mem Subtype.val hb
256
+ le_sInf S b hb := le_inf_iff.mpr ⟨b.property, le_sInf fun d' ⟨d, hd, hd'⟩ ↦ hd' ▸ hb d hd⟩
257
+ le_top := by simp
258
+ bot_le := by simp
259
+
260
+ variable (S : Set <| Iic a) (f : ι → Iic a) (p : ι → Prop )
261
+
262
+ @[simp] theorem coe_sSup : (↑(sSup S) : α) = sSup ((↑) '' S) := rfl
263
+
264
+ @[simp] theorem coe_iSup : (↑(⨆ i, f i) : α) = ⨆ i, (f i : α) := by
265
+ rw [iSup, coe_sSup]; congr; ext; simp
266
+
267
+ theorem coe_biSup : (↑(⨆ i, ⨆ (_ : p i), f i) : α) = ⨆ i, ⨆ (_ : p i), (f i : α) := by simp
268
+
269
+ @[simp] theorem coe_sInf : (↑(sInf S) : α) = a ⊓ sInf ((↑) '' S) := rfl
270
+
271
+ @[simp] theorem coe_iInf : (↑(⨅ i, f i) : α) = a ⊓ ⨅ i, (f i : α) := by
272
+ rw [iInf, coe_sInf]; congr; ext; simp
273
+
274
+ theorem coe_biInf : (↑(⨅ i, ⨅ (_ : p i), f i) : α) = a ⊓ ⨅ i, ⨅ (_ : p i), (f i : α) := by
275
+ cases isEmpty_or_nonempty ι
276
+ · simp
277
+ · simp_rw [coe_iInf, ← inf_iInf, ← inf_assoc, inf_idem]
278
+
279
+ theorem isCompactElement {b : Iic a} (h : CompleteLattice.IsCompactElement (b : α)) :
280
+ CompleteLattice.IsCompactElement b := by
281
+ simp only [CompleteLattice.isCompactElement_iff, Finset.sup_eq_iSup] at h ⊢
282
+ intro ι s hb
283
+ replace hb : (b : α) ≤ iSup ((↑) ∘ s) := le_trans hb <| (coe_iSup s) ▸ le_refl _
284
+ obtain ⟨t, ht⟩ := h ι ((↑) ∘ s) hb
285
+ exact ⟨t, (by simpa using ht : (b : α) ≤ _)⟩
286
+
287
+ instance instIsCompactlyGenerated [IsCompactlyGenerated α] : IsCompactlyGenerated (Iic a) := by
288
+ refine ⟨fun ⟨x, (hx : x ≤ a)⟩ ↦ ?_⟩
289
+ obtain ⟨s, hs, rfl⟩ := IsCompactlyGenerated.exists_sSup_eq x
290
+ rw [sSup_le_iff] at hx
291
+ let f : s → Iic a := fun y ↦ ⟨y, hx _ y.property⟩
292
+ refine ⟨range f, ?_, ?_⟩
293
+ · rintro - ⟨⟨y, hy⟩, hy', rfl⟩
294
+ exact isCompactElement (hs _ hy)
295
+ · rw [Subtype.ext_iff]
296
+ change sSup (((↑) : Iic a → α) '' (range f)) = sSup s
297
+ congr
298
+ ext b
299
+ simpa using hx b
300
+
301
+ end Set.Iic
302
+
303
+ theorem complementedLattice_of_complementedLattice_Iic
304
+ [CompleteLattice α] [IsModularLattice α] [IsCompactlyGenerated α]
305
+ {ι : Type *} {s : Set ι} {f : ι → α}
306
+ (h : ∀ i ∈ s, ComplementedLattice <| Iic (f i))
307
+ (h' : ⨆ i ∈ s, f i = ⊤) :
308
+ ComplementedLattice α := by
309
+ apply complementedLattice_of_sSup_atoms_eq_top
310
+ have : ∀ i ∈ s, ∃ t : Set α, f i = sSup t ∧ ∀ a ∈ t, IsAtom a := fun i hi ↦ by
311
+ replace h := complementedLattice_iff_isAtomistic.mp (h i hi)
312
+ obtain ⟨u, hu, hu'⟩ := eq_sSup_atoms (⊤ : Iic (f i))
313
+ refine ⟨(↑) '' u, ?_, ?_⟩
314
+ · replace hu : f i = ↑(sSup u) := Subtype.ext_iff.mp hu
315
+ simp_rw [hu, Iic.coe_sSup]
316
+ · rintro b ⟨⟨a, ha'⟩, ha, rfl⟩
317
+ exact IsAtom.of_isAtom_coe_Iic (hu' _ ha)
318
+ choose t ht ht' using this
319
+ let u : Set α := ⋃ i, ⋃ hi : i ∈ s, t i hi
320
+ have hu₁ : u ⊆ {a | IsAtom a} := by
321
+ rintro a ⟨-, ⟨i, rfl⟩, ⟨-, ⟨hi, rfl⟩, ha : a ∈ t i hi⟩⟩
322
+ exact ht' i hi a ha
323
+ have hu₂ : sSup u = ⨆ i ∈ s, f i := by simp_rw [sSup_iUnion, biSup_congr' ht]
324
+ rw [eq_top_iff, ← h', ← hu₂]
325
+ exact sSup_le_sSup hu₁
0 commit comments