@@ -259,9 +259,12 @@ lemma Set.Ici_ciSup [Nonempty ι] {f : ι → α} (hf : BddAbove (range f)) :
259259 Ici (⨆ i, f i) = ⋂ i, Ici (f i) :=
260260 Iic_ciInf (α := αᵒᵈ) hf
261261
262- theorem ciSup_subtype [Nonempty ι] {p : ι → Prop } [Nonempty (Subtype p)] {f : Subtype p → α}
262+ theorem ciSup_subtype {p : ι → Prop } {f : Subtype p → α}
263263 (hf : BddAbove (Set.range f)) (hf' : sSup ∅ ≤ iSup f) :
264264 iSup f = ⨆ (i) (h : p i), f ⟨i, h⟩ := by
265+ cases isEmpty_or_nonempty (Subtype p)
266+ · rw [iSup_of_empty', cbiSup_eq_of_forall_not fun i h ↦ isEmptyElim (⟨i, h⟩ : Subtype p)]
267+ have : Nonempty ι := (nonempty_subtype.mp ‹_›).nonempty
265268 classical
266269 refine le_antisymm (ciSup_le ?_) ?_
267270 · intro ⟨i, h⟩
@@ -277,49 +280,66 @@ theorem ciSup_subtype [Nonempty ι] {p : ι → Prop} [Nonempty (Subtype p)] {f
277280 · exact le_ciSup hf ?_
278281 · exact hf'
279282
280- theorem ciInf_subtype [Nonempty ι] {p : ι → Prop } [Nonempty (Subtype p)] {f : Subtype p → α}
283+ theorem ciInf_subtype {p : ι → Prop } {f : Subtype p → α}
281284 (hf : BddBelow (Set.range f)) (hf' : iInf f ≤ sInf ∅) :
282285 iInf f = ⨅ (i) (h : p i), f ⟨i, h⟩ :=
283286 ciSup_subtype (α := αᵒᵈ) hf hf'
284287
285- theorem ciSup_subtype' [Nonempty ι] {p : ι → Prop } [Nonempty (Subtype p)] {f : ∀ i, p i → α}
288+ theorem cbiSup_eq_ciSup_subtype {p : ι → Prop } {f : ∀ i, p i → α}
286289 (hf : BddAbove (Set.range (fun i : Subtype p ↦ f i i.prop)))
287290 (hf' : sSup ∅ ≤ ⨆ (i : Subtype p), f i i.prop) :
288291 ⨆ (i) (h), f i h = ⨆ x : Subtype p, f x x.property :=
289292 (ciSup_subtype (f := fun x => f x.val x.property) hf hf').symm
290293
291- theorem ciInf_subtype' [Nonempty ι] {p : ι → Prop } [Nonempty (Subtype p)] {f : ∀ i, p i → α}
294+ @ [deprecated (since := "2026-04-04" )] alias ciSup_subtype' := cbiSup_eq_ciSup_subtype
295+
296+ theorem cbiInf_eq_ciInf_subtype {p : ι → Prop } {f : ∀ i, p i → α}
292297 (hf : BddBelow (Set.range (fun i : Subtype p ↦ f i i.prop)))
293298 (hf' : ⨅ (i : Subtype p), f i i.prop ≤ sInf ∅) :
294299 ⨅ (i) (h), f i h = ⨅ x : Subtype p, f x x.property :=
295300 (ciInf_subtype (f := fun x => f x.val x.property) hf hf').symm
296301
297- theorem ciSup_subtype'' {ι} [Nonempty ι] {s : Set ι} (hs : s.Nonempty) {f : ι → α}
302+ @ [deprecated (since := "2026-04-04" )] alias ciInf_subtype' := cbiInf_eq_ciInf_subtype
303+
304+ theorem ciSup_subtype_fun {ι} {s : Set ι} {f : ι → α}
298305 (hf : BddAbove (Set.range fun i : s ↦ f i)) (hf' : sSup ∅ ≤ ⨆ i : s, f i) :
299306 ⨆ i : s, f i = ⨆ (t : ι) (_ : t ∈ s), f t :=
300- haveI : Nonempty s := Set.Nonempty.to_subtype hs
301307 ciSup_subtype hf hf'
302308
303- theorem ciInf_subtype'' {ι} [Nonempty ι] {s : Set ι} (hs : s.Nonempty) {f : ι → α}
309+ @ [deprecated (since := "2026-04-04" )] alias ciSup_subtype'' := ciSup_subtype_fun
310+
311+ theorem ciInf_subtype_fun {ι} {s : Set ι} {f : ι → α}
304312 (hf : BddBelow (Set.range fun i : s ↦ f i)) (hf' : ⨅ i : s, f i ≤ sInf ∅) :
305313 ⨅ i : s, f i = ⨅ (t : ι) (_ : t ∈ s), f t :=
306- haveI : Nonempty s := Set.Nonempty.to_subtype hs
307314 ciInf_subtype hf hf'
308315
309- theorem csSup_image [Nonempty β] {s : Set β} (hs : s.Nonempty) {f : β → α}
316+ @ [deprecated (since := "2026-04-04" )] alias ciInf_subtype'' := ciInf_subtype_fun
317+
318+ theorem csSup_image {s : Set β} {f : β → α}
310319 (hf : BddAbove (Set.range fun i : s ↦ f i)) (hf' : sSup ∅ ≤ ⨆ i : s, f i) :
311320 sSup (f '' s) = ⨆ a ∈ s, f a := by
312- rw [← ciSup_subtype'' hs hf hf', iSup, Set.image_eq_range]
321+ rw [← ciSup_subtype_fun hf hf', iSup, Set.image_eq_range]
313322
314- theorem csInf_image [Nonempty β] {s : Set β} (hs : s.Nonempty) {f : β → α}
323+ theorem csInf_image {s : Set β} {f : β → α}
315324 (hf : BddBelow (Set.range fun i : s ↦ f i)) (hf' : ⨅ i : s, f i ≤ sInf ∅) :
316325 sInf (f '' s) = ⨅ a ∈ s, f a :=
317- csSup_image (α := αᵒᵈ) hs hf hf'
326+ csSup_image (α := αᵒᵈ) hf hf'
327+
328+ theorem cbiSup_id {s : Set α} (hs : BddAbove s) (h : sSup ∅ ≤ sSup s) : ⨆ i ∈ s, i = sSup s := by
329+ rw [← csSup_image (Subtype.range_coe ▸ hs), Set.image_id']
330+ · convert h
331+ rw [← sSup_range, Subtype.range_coe]
318332
319- lemma ciSup_image {α ι ι' : Type *} [ConditionallyCompleteLattice α] [Nonempty ι] [Nonempty ι']
320- {s : Set ι} (hs : s.Nonempty) {f : ι → ι'} {g : ι' → α}
333+ theorem cbiInf_id {s : Set α} (hs : BddBelow s) (h : sInf s ≤ sInf ∅) : ⨅ i ∈ s, i = sInf s := by
334+ rw [← csInf_image (Subtype.range_coe ▸ hs), Set.image_id']
335+ · convert h
336+ rw [← sInf_range, Subtype.range_coe]
337+
338+ lemma ciSup_image {ι ι' : Type *} {s : Set ι} {f : ι → ι'} {g : ι' → α}
321339 (hf : BddAbove (Set.range fun i : s ↦ g (f i))) (hg' : sSup ∅ ≤ ⨆ i : s, g (f i)) :
322340 ⨆ i ∈ (f '' s), g i = ⨆ x ∈ s, g (f x) := by
341+ rcases s.eq_empty_or_nonempty with (rfl | hs)
342+ · rw [Set.image_empty, cbiSup_empty, cbiSup_empty]
323343 have hg : BddAbove (Set.range fun i : f '' s ↦ g i) := by
324344 simpa [bddAbove_def] using hf
325345 have hf' : sSup ∅ ≤ ⨆ i : f '' s, g i := by
@@ -333,13 +353,12 @@ lemma ciSup_image {α ι ι' : Type*} [ConditionallyCompleteLattice α] [Nonempt
333353 rw [← ht]
334354 refine le_ciSup_set ?_ t.prop
335355 simpa [bddAbove_def] using hf
336- rw [← csSup_image ( by simpa using hs) hg hf', ← csSup_image hs hf hg', ← Set.image_comp, comp_def]
356+ rw [← csSup_image hg hf', ← csSup_image hf hg', ← Set.image_comp, comp_def]
337357
338- lemma ciInf_image {α ι ι' : Type *} [ConditionallyCompleteLattice α] [Nonempty ι] [Nonempty ι']
339- {s : Set ι} (hs : s.Nonempty) {f : ι → ι'} {g : ι' → α}
358+ lemma ciInf_image {ι ι' : Type *} {s : Set ι} {f : ι → ι'} {g : ι' → α}
340359 (hf : BddBelow (Set.range fun i : s ↦ g (f i))) (hg' : ⨅ i : s, g (f i) ≤ sInf ∅) :
341360 ⨅ i ∈ (f '' s), g i = ⨅ x ∈ s, g (f x) :=
342- ciSup_image (α := αᵒᵈ) hs hf hg'
361+ ciSup_image (α := αᵒᵈ) hf hg'
343362
344363end ConditionallyCompleteLattice
345364
@@ -368,46 +387,32 @@ theorem ciInf_lt_iff [Nonempty ι] {f : ι → α} (hb : BddBelow (range f)) :
368387 iInf f < a ↔ ∃ i, f i < a := by
369388 simpa only [mem_range, exists_exists_eq_and] using csInf_lt_iff hb (range_nonempty _)
370389
390+ theorem cbiSup_of_not_bddAbove {p : ι → Prop } {f : ∀ i, p i → α}
391+ (h : ¬BddAbove (range fun i : Subtype p ↦ f i i.prop)) :
392+ ⨆ (i : ι), ⨆ (h : p i), f i h = sSup ∅ :=
393+ ciSup_of_not_bddAbove fun ⟨u, hu⟩ ↦ h ⟨u, fun _ ⟨x, hx⟩ ↦ hx ▸ hu ⟨x, ciSup_pos x.prop⟩⟩
394+
395+ theorem cbiInf_of_not_bddBelow {p : ι → Prop } {f : ∀ i, p i → α}
396+ (h : ¬BddBelow (range fun i : Subtype p ↦ f i i.prop)) :
397+ ⨅ (i : ι), ⨅ (h : p i), f i h = sInf ∅ :=
398+ ciInf_of_not_bddBelow fun ⟨u, hu⟩ ↦ h ⟨u, fun _ ⟨x, hx⟩ ↦ hx ▸ hu ⟨x, ciInf_pos x.prop⟩⟩
399+
371400theorem cbiSup_eq_of_not_forall {p : ι → Prop } {f : Subtype p → α} (hp : ¬ (∀ i, p i)) :
372401 ⨆ (i) (h : p i), f ⟨i, h⟩ = iSup f ⊔ sSup ∅ := by
373- classical
374- rcases not_forall.1 hp with ⟨i₀, hi₀⟩
375- have : Nonempty ι := ⟨i₀⟩
376- simp only [ciSup_eq_ite]
377- by_cases H : BddAbove (range f)
378- · have B : BddAbove (range fun i ↦ if h : p i then f ⟨i, h⟩ else sSup ∅) := by
379- rcases H with ⟨c, hc⟩
380- refine ⟨c ⊔ sSup ∅, ?_⟩
381- rintro - ⟨i, rfl⟩
382- by_cases hi : p i
383- · simp only [hi, dite_true, le_sup_iff, hc (mem_range_self _), true_or]
384- · simp only [hi, dite_false, le_sup_right]
385- apply le_antisymm
386- · apply ciSup_le (fun i ↦ ?_)
387- by_cases hi : p i
388- · simp only [hi, dite_true, le_sup_iff]
389- left
390- exact le_ciSup H _
391- · simp [hi]
392- · apply sup_le
393- · rcases isEmpty_or_nonempty (Subtype p) with hp | hp
394- · rw [iSup_of_empty']
395- convert le_ciSup B i₀
396- simp [hi₀]
397- · apply ciSup_le
398- rintro ⟨i, hi⟩
399- convert le_ciSup B i
400- simp [hi]
401- · convert le_ciSup B i₀
402- simp [hi₀]
403- · have : iSup f = sSup (∅ : Set α) := csSup_of_not_bddAbove H
404- simp only [this, le_refl, sup_of_le_left]
405- apply csSup_of_not_bddAbove
406- contrapose! H
407- apply H.mono
408- rintro - ⟨i, rfl⟩
409- convert mem_range_self i.1
410- simp [i.2 ]
402+ rcases le_or_gt (sSup ∅) (iSup f) with le|gt
403+ · rw [max_eq_left le]
404+ by_cases bdd : BddAbove (range f)
405+ · rw [← ciSup_subtype bdd le]
406+ · rw [ciSup_of_not_bddAbove bdd, cbiSup_of_not_bddAbove bdd]
407+ have ⟨i, hi⟩ := not_forall.mp hp
408+ have : Nonempty ι := ⟨i⟩
409+ have bdd : BddAbove (range f) := not_not.mp fun h ↦ gt.ne (ciSup_of_not_bddAbove h)
410+ rw [max_eq_right gt.le]
411+ refine ciSup_eq_of_forall_le_of_forall_lt_exists_gt (fun j ↦ ?_) ?_
412+ · by_cases hj : p j
413+ · exact ((ciSup_pos hj).trans_le (le_ciSup bdd ⟨j, hj⟩)).trans gt.le
414+ · exact (ciSup_neg hj).le
415+ · exact fun w hw ↦ ⟨i, hw.trans_eq (ciSup_neg hi).symm⟩
411416
412417theorem cbiInf_eq_of_not_forall {p : ι → Prop } {f : Subtype p → α} (hp : ¬ (∀ i, p i)) :
413418 ⨅ (i) (h : p i), f ⟨i, h⟩ = iInf f ⊓ sInf ∅ :=
0 commit comments