Skip to content

Commit e3f86df

Browse files
committed
feat(Order/ConditionallyCompleteLattice/Indexed): conditional versions of iSup_exists/iSup_and
1 parent 9987a7e commit e3f86df

2 files changed

Lines changed: 29 additions & 3 deletions

File tree

Mathlib/Order/ConditionallyCompleteLattice/Indexed.lean

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ lemma ciInf_le_ciSup [Nonempty ι] {f : ι → α} (hf : BddBelow (range f)) (hf
213213
lemma ciSup_prod {f : β × γ → α} (hf : BddAbove (Set.range f)) :
214214
⨆ p, f p = ⨆ b, ⨆ c, f (b, c) := by
215215
rcases isEmpty_or_nonempty β
216-
· simp [iSup_of_empty']
216+
· simp
217217
rcases isEmpty_or_nonempty γ
218-
· simp [iSup_of_empty']
218+
· simp
219219
have h₁ : BddAbove (Set.range fun b ↦ ⨆ c, f (b, c)) := by
220220
rw [bddAbove_def] at hf ⊢
221221
obtain ⟨B, hB⟩ := hf
@@ -360,6 +360,24 @@ lemma ciInf_image {ι ι' : Type*} {s : Set ι} {f : ι → ι'} {g : ι' → α
360360
⨅ i ∈ (f '' s), g i = ⨅ x ∈ s, g (f x) :=
361361
ciSup_image (α := αᵒᵈ) hf hg'
362362

363+
theorem ciSup_exists_le {p : ι → Prop} {f : Exists p → α} : ⨆ ih, f ih ≤ ⨆ (i) (h), f ⟨i, h⟩ := by
364+
by_cases! h : Exists p
365+
· have : Nonempty <| Exists p := ⟨h⟩
366+
refine ciSup_le fun ⟨i, hi⟩ ↦ le_ciSup₂ (f := fun _ _ ↦ _) ⟨f ⟨i, hi⟩, ?_⟩ i hi
367+
rintro _ ⟨_, ⟨j, rfl⟩, ⟨hj, rfl⟩⟩
368+
rfl
369+
· cases isEmpty_or_nonempty ι <;>
370+
simp [h, ciSup_const]
371+
372+
theorem le_ciInf_exists {p : ι → Prop} {f : Exists p → α} : ⨅ (i) (h), f ⟨i, h⟩ ≤ ⨅ ih, f ih :=
373+
ciSup_exists_le (α := αᵒᵈ)
374+
375+
theorem ciSup_and {p q : Prop} {f : p ∧ q → α} : ⨆ ih, f ih = ⨆ (h₁) (h₂), f ⟨h₁, h₂⟩ := by
376+
by_cases hp : p <;> by_cases hq : q <;> simp [hp, hq]
377+
378+
theorem ciInf_and {p q : Prop} {f : p ∧ q → α} : ⨅ ih, f ih = ⨅ (h₁) (h₂), f ⟨h₁, h₂⟩ :=
379+
ciSup_and (α := αᵒᵈ)
380+
363381
end ConditionallyCompleteLattice
364382

365383
section ConditionallyCompleteLinearOrder
@@ -495,6 +513,10 @@ theorem ciSup_mono' {ι'} {f : ι → α} {g : ι' → α} (hg : BddAbove (range
495513
(h : ∀ i, ∃ i', f i ≤ g i') : iSup f ≤ iSup g :=
496514
ciSup_le' fun i => Exists.elim (h i) (le_ciSup_of_le hg)
497515

516+
theorem ciSup_exists {p : ι → Prop} {f : Exists p → α} : ⨆ ih, f ih = ⨆ (i) (h), f ⟨i, h⟩ := by
517+
refine le_antisymm ciSup_exists_le <| ciSup_le' fun i ↦ ciSup_le' fun hi ↦ ?_
518+
simp [show Exists p from ⟨i, hi⟩]
519+
498520
lemma ciSup_or' (p q : Prop) (f : p ∨ q → α) :
499521
⨆ (h : p ∨ q), f h = (⨆ h : p, f (.inl h)) ⊔ ⨆ h : q, f (.inr h) := by
500522
by_cases hp : p <;>

Mathlib/Order/ConditionallyCompletePartialOrder/Indexed.lean

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,14 @@ lemma ciSup_neg {p : Prop} {f : p → α} (hp : ¬ p) :
102102
congr
103103
rwa [range_eq_empty_iff, isEmpty_Prop]
104104

105+
@[to_dual (attr := simp)]
106+
theorem ciSup_empty [IsEmpty ι] {f : ι → α} : ⨆ h, f h = sSup (∅ : Set α) := by
107+
rw [iSup, Set.range_eq_empty]
108+
105109
@[to_dual]
106110
lemma ciSup_eq_ite {p : Prop} [Decidable p] {f : p → α} :
107111
(⨆ h : p, f h) = if h : p then f h else sSup (∅ : Set α) := by
108-
by_cases H : p <;> simp [ciSup_neg, H]
112+
by_cases H : p <;> simp [H]
109113

110114
@[to_dual]
111115
theorem cbiSup_eq_of_forall {p : ι → Prop} {f : Subtype p → α} (hp : ∀ i, p i) :

0 commit comments

Comments
 (0)