Skip to content

Commit eda5b56

Browse files
committed
add results on indexed suprema
1 parent 595462b commit eda5b56

File tree

5 files changed

+318
-119
lines changed

5 files changed

+318
-119
lines changed

Mathlib/Order/CompleteLattice/Basic.lean

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ protected theorem Equiv.iSup_congr {g : ι' → α} (e : ι ≃ ι') (h : ∀ x,
225225
⨆ x, f x = ⨆ y, g y :=
226226
e.surjective.iSup_congr _ h
227227

228-
@[congr]
228+
@[to_dual (attr := congr)]
229229
theorem iSup_congr_Prop {p q : Prop} {f₁ : p → α} {f₂ : q → α} (pq : p ↔ q)
230230
(f : ∀ x, f₁ (pq.mpr x) = f₂ x) : iSup f₁ = iSup f₂ := by
231231
obtain rfl := propext pq
@@ -241,6 +241,7 @@ theorem iSup_plift_down (f : ι → α) : ⨆ i, f (PLift.down i) = ⨆ i, f i :
241241
theorem iSup_range' (g : β → α) (f : ι → β) : ⨆ b : range f, g b = ⨆ i, g (f i) := by
242242
rw [iSup, iSup, ← image_eq_range, ← range_comp']
243243

244+
@[to_dual]
244245
theorem sSup_image' {s : Set β} {f : β → α} : sSup (f '' s) = ⨆ a : s, f a := by
245246
rw [iSup, image_eq_range]
246247

@@ -283,11 +284,6 @@ protected theorem Equiv.iInf_congr {g : ι' → α} (e : ι ≃ ι') (h : ∀ x,
283284
⨅ x, f x = ⨅ y, g y :=
284285
@Equiv.iSup_congr αᵒᵈ _ _ _ _ _ e h
285286

286-
@[congr]
287-
theorem iInf_congr_Prop {p q : Prop} {f₁ : p → α} {f₂ : q → α} (pq : p ↔ q)
288-
(f : ∀ x, f₁ (pq.mpr x) = f₂ x) : iInf f₁ = iInf f₂ :=
289-
@iSup_congr_Prop αᵒᵈ _ p q f₁ f₂ pq f
290-
291287
theorem iInf_plift_up (f : PLift ι → α) : ⨅ i, f (PLift.up i) = ⨅ i, f i :=
292288
(PLift.up_surjective.iInf_congr _) fun _ => rfl
293289

@@ -297,9 +293,6 @@ theorem iInf_plift_down (f : ι → α) : ⨅ i, f (PLift.down i) = ⨅ i, f i :
297293
theorem iInf_range' (g : β → α) (f : ι → β) : ⨅ b : range f, g b = ⨅ i, g (f i) :=
298294
@iSup_range' αᵒᵈ _ _ _ _ _
299295

300-
theorem sInf_image' {s : Set β} {f : β → α} : sInf (f '' s) = ⨅ a : s, f a :=
301-
@sSup_image' αᵒᵈ _ _ _ _
302-
303296
end InfSet
304297

305298
section
@@ -1034,13 +1027,10 @@ end le
10341027
### `iSup` and `iInf` under `Type`
10351028
-/
10361029

1037-
1030+
@[to_dual iInf_of_isEmpty]
10381031
theorem iSup_of_empty' {α ι} [SupSet α] [IsEmpty ι] (f : ι → α) : iSup f = sSup (∅ : Set α) :=
10391032
congr_arg sSup (range_eq_empty f)
10401033

1041-
theorem iInf_of_isEmpty {α ι} [InfSet α] [IsEmpty ι] (f : ι → α) : iInf f = sInf (∅ : Set α) :=
1042-
congr_arg sInf (range_eq_empty f)
1043-
10441034
theorem iSup_of_empty [IsEmpty ι] (f : ι → α) : iSup f = ⊥ :=
10451035
(iSup_of_empty' f).trans sSup_empty
10461036

Mathlib/Order/ConditionallyCompleteLattice/Indexed.lean

Lines changed: 1 addition & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Authors: Sébastian Gouëzel
66
module
77

88
public import Mathlib.Order.ConditionallyCompleteLattice.Basic
9+
public import Mathlib.Order.ConditionallyCompletePartialOrder.Indexed
910

1011
/-!
1112
# Indexed sup / inf in conditionally complete lattices
@@ -181,68 +182,6 @@ lemma ciInf_le_ciSup [Nonempty ι] {f : ι → α} (hf : BddBelow (range f)) (hf
181182
⨅ i, f i ≤ ⨆ i, f i :=
182183
(ciInf_le hf (Classical.arbitrary _)).trans <| le_ciSup hf' (Classical.arbitrary _)
183184

184-
@[simp]
185-
theorem ciSup_const [hι : Nonempty ι] {a : α} : ⨆ _ : ι, a = a := by
186-
rw [iSup, range_const, csSup_singleton]
187-
188-
@[simp]
189-
theorem ciInf_const [Nonempty ι] {a : α} : ⨅ _ : ι, a = a :=
190-
ciSup_const (α := αᵒᵈ)
191-
192-
@[simp]
193-
theorem ciSup_unique [Unique ι] {s : ι → α} : ⨆ i, s i = s default := by
194-
have : ∀ i, s i = s default := fun i => congr_arg s (Unique.eq_default i)
195-
simp only [this, ciSup_const]
196-
197-
@[simp]
198-
theorem ciInf_unique [Unique ι] {s : ι → α} : ⨅ i, s i = s default :=
199-
ciSup_unique (α := αᵒᵈ)
200-
201-
theorem ciSup_subsingleton [Subsingleton ι] (i : ι) (s : ι → α) : ⨆ i, s i = s i :=
202-
@ciSup_unique α ι _ ⟨⟨i⟩, fun j => Subsingleton.elim j i⟩ _
203-
204-
theorem ciInf_subsingleton [Subsingleton ι] (i : ι) (s : ι → α) : ⨅ i, s i = s i :=
205-
@ciInf_unique α ι _ ⟨⟨i⟩, fun j => Subsingleton.elim j i⟩ _
206-
207-
theorem ciSup_pos {p : Prop} {f : p → α} (hp : p) : ⨆ h : p, f h = f hp := by
208-
simp [hp]
209-
210-
theorem ciInf_pos {p : Prop} {f : p → α} (hp : p) : ⨅ h : p, f h = f hp := by
211-
simp [hp]
212-
213-
lemma ciSup_neg {p : Prop} {f : p → α} (hp : ¬ p) :
214-
⨆ (h : p), f h = sSup (∅ : Set α) := by
215-
rw [iSup]
216-
congr
217-
rwa [range_eq_empty_iff, isEmpty_Prop]
218-
219-
lemma ciInf_neg {p : Prop} {f : p → α} (hp : ¬ p) :
220-
⨅ (h : p), f h = sInf (∅ : Set α) :=
221-
ciSup_neg (α := αᵒᵈ) hp
222-
223-
lemma ciSup_eq_ite {p : Prop} [Decidable p] {f : p → α} :
224-
(⨆ h : p, f h) = if h : p then f h else sSup (∅ : Set α) := by
225-
by_cases H : p <;> simp [ciSup_neg, H]
226-
227-
lemma ciInf_eq_ite {p : Prop} [Decidable p] {f : p → α} :
228-
(⨅ h : p, f h) = if h : p then f h else sInf (∅ : Set α) :=
229-
ciSup_eq_ite (α := αᵒᵈ)
230-
231-
theorem cbiSup_eq_of_forall {p : ι → Prop} {f : Subtype p → α} (hp : ∀ i, p i) :
232-
⨆ (i) (h : p i), f ⟨i, h⟩ = iSup f := by
233-
simp only [hp, ciSup_unique]
234-
simp only [iSup]
235-
congr
236-
apply Subset.antisymm
237-
· rintro - ⟨i, rfl⟩
238-
simp
239-
· rintro - ⟨i, rfl⟩
240-
simp
241-
242-
theorem cbiInf_eq_of_forall {p : ι → Prop} {f : Subtype p → α} (hp : ∀ i, p i) :
243-
⨅ (i) (h : p i), f ⟨i, h⟩ = iInf f :=
244-
cbiSup_eq_of_forall (α := αᵒᵈ) hp
245-
246185
/-- Introduction rule to prove that `b` is the supremum of `f`: it suffices to check that `b`
247186
is larger than `f i` for all `i`, and that this is not the case of any `w<b`.
248187
See `iSup_eq_of_forall_le_of_forall_lt_exists_gt` for a version in complete lattices. -/
@@ -258,24 +197,6 @@ theorem ciInf_eq_of_forall_ge_of_forall_gt_exists_lt [Nonempty ι] {f : ι →
258197
(h₂ : ∀ w, b < w → ∃ i, f i < w) : ⨅ i : ι, f i = b :=
259198
ciSup_eq_of_forall_le_of_forall_lt_exists_gt (α := αᵒᵈ) h₁ h₂
260199

261-
/-- **Nested intervals lemma**: if `f` is a monotone sequence, `g` is an antitone sequence, and
262-
`f n ≤ g n` for all `n`, then `⨆ n, f n` belongs to all the intervals `[f n, g n]`. -/
263-
theorem Monotone.ciSup_mem_iInter_Icc_of_antitone [SemilatticeSup β] {f g : β → α} (hf : Monotone f)
264-
(hg : Antitone g) (h : f ≤ g) : (⨆ n, f n) ∈ ⋂ n, Icc (f n) (g n) := by
265-
refine mem_iInter.2 fun n => ?_
266-
haveI : Nonempty β := ⟨n⟩
267-
have : ∀ m, f m ≤ g n := fun m => hf.forall_le_of_antitone hg h m n
268-
exact ⟨le_ciSup ⟨g <| n, forall_mem_range.2 this⟩ _, ciSup_le this⟩
269-
270-
/-- Nested intervals lemma: if `[f n, g n]` is an antitone sequence of nonempty
271-
closed intervals, then `⨆ n, f n` belongs to all the intervals `[f n, g n]`. -/
272-
theorem ciSup_mem_iInter_Icc_of_antitone_Icc [SemilatticeSup β] {f g : β → α}
273-
(h : Antitone fun n => Icc (f n) (g n)) (h' : ∀ n, f n ≤ g n) :
274-
(⨆ n, f n) ∈ ⋂ n, Icc (f n) (g n) :=
275-
Monotone.ciSup_mem_iInter_Icc_of_antitone
276-
(fun _ n hmn => ((Icc_subset_Icc_iff (h' n)).1 (h hmn)).1)
277-
(fun _ n hmn => ((Icc_subset_Icc_iff (h' n)).1 (h hmn)).2) h'
278-
279200
lemma Set.Iic_ciInf [Nonempty ι] {f : ι → α} (hf : BddBelow (range f)) :
280201
Iic (⨅ i, f i) = ⋂ i, Iic (f i) := by
281202
ext
@@ -285,22 +206,6 @@ lemma Set.Ici_ciSup [Nonempty ι] {f : ι → α} (hf : BddAbove (range f)) :
285206
Ici (⨆ i, f i) = ⋂ i, Ici (f i) :=
286207
Iic_ciInf (α := αᵒᵈ) hf
287208

288-
theorem ciSup_Iic [Preorder β] {f : β → α} (a : β) (hf : Monotone f) :
289-
⨆ x : Iic a, f x = f a := by
290-
have H : BddAbove (range fun x : Iic a ↦ f x) := ⟨f a, fun _ ↦ by aesop⟩
291-
apply (le_ciSup H (⟨a, le_refl a⟩ : Iic a)).antisymm'
292-
rw [ciSup_le_iff H]
293-
rintro ⟨a, h⟩
294-
exact hf h
295-
296-
theorem ciInf_Ici [Preorder β] {f : β → α} (a : β) (hf : Monotone f) :
297-
⨅ x : Ici a, f x = f a := by
298-
have H : BddBelow (range fun x : Ici a ↦ f x) := ⟨f a, fun _ ↦ by aesop⟩
299-
apply (ciInf_le H (⟨a, le_refl a⟩ : Ici a)).antisymm
300-
rw [le_ciInf_iff H]
301-
rintro ⟨a, h⟩
302-
exact hf h
303-
304209
theorem ciSup_subtype [Nonempty ι] {p : ι → Prop} [Nonempty (Subtype p)] {f : Subtype p → α}
305210
(hf : BddAbove (Set.range f)) (hf' : sSup ∅ ≤ iSup f) :
306211
iSup f = ⨆ (i) (h : p i), f ⟨i, h⟩ := by

0 commit comments

Comments
 (0)