diff --git a/Mathlib/LinearAlgebra/Dimension/Finite.lean b/Mathlib/LinearAlgebra/Dimension/Finite.lean index 0944ed66c2a313..6b161ad48fb70a 100644 --- a/Mathlib/LinearAlgebra/Dimension/Finite.lean +++ b/Mathlib/LinearAlgebra/Dimension/Finite.lean @@ -196,8 +196,9 @@ lemma exists_set_linearIndependent_of_lt_rank {n : Cardinal} (hn : n < Module.ra lemma exists_finset_linearIndependent_of_le_rank {n : ℕ} (hn : n ≤ Module.rank R M) : ∃ s : Finset M, s.card = n ∧ LinearIndepOn R id (s : Set M) := by rcases hn.eq_or_lt with h | h - · obtain ⟨⟨s, hs⟩, hs'⟩ := Cardinal.exists_eq_natCast_of_iSup_eq _ - (Cardinal.bddAbove_range _) _ (h.trans (Module.rank_def R M)).symm + · obtain ⟨⟨s, hs⟩, hs'⟩ := exists_eq_ciSup_of_not_isSuccLimit + (Cardinal.bddAbove_range _) (h.trans (Module.rank_def R M) ▸ not_isSuccLimit_natCast n) + rw [← Module.rank_def, ← h] at hs' have : Finite s := lt_aleph0_iff_finite.mp (hs' ▸ natCast_lt_aleph0) cases nonempty_fintype s refine ⟨s.toFinset, by simpa using hs', by simpa⟩ diff --git a/Mathlib/Order/SuccPred/CompleteLinearOrder.lean b/Mathlib/Order/SuccPred/CompleteLinearOrder.lean index d514475c7b9f9a..d33bcb679fd3c0 100644 --- a/Mathlib/Order/SuccPred/CompleteLinearOrder.lean +++ b/Mathlib/Order/SuccPred/CompleteLinearOrder.lean @@ -87,17 +87,32 @@ section ConditionallyCompleteLinearOrderBot variable [ConditionallyCompleteLinearOrderBot α] {f : ι → α} {s : Set α} {x : α} /-- See `csSup_mem_of_not_isSuccPrelimit` for the `ConditionallyCompleteLinearOrder` version. -/ -lemma csSup_mem_of_not_isSuccPrelimit' - (hbdd : BddAbove s) (hlim : ¬ IsSuccPrelimit (sSup s)) : sSup s ∈ s := by +lemma csSup_mem_of_not_isSuccPrelimit' (hlim : ¬ IsSuccPrelimit (sSup s)) : sSup s ∈ s := by obtain rfl | hs := s.eq_empty_or_nonempty · simp [isSuccPrelimit_bot] at hlim - · exact csSup_mem_of_not_isSuccPrelimit hs hbdd hlim + · apply csSup_mem_of_not_isSuccPrelimit hs _ hlim + contrapose! hlim + rw [csSup_of_not_bddAbove hlim, csSup_empty] + exact isSuccPrelimit_bot /-- See `exists_eq_ciSup_of_not_isSuccPrelimit` for the `ConditionallyCompleteLinearOrder` version. -/ -lemma exists_eq_ciSup_of_not_isSuccPrelimit' - (hf : BddAbove (range f)) (hf' : ¬ IsSuccPrelimit (⨆ i, f i)) : ∃ i, f i = ⨆ i, f i := - csSup_mem_of_not_isSuccPrelimit' hf hf' +lemma exists_eq_ciSup_of_not_isSuccPrelimit' (hf' : ¬ IsSuccPrelimit (⨆ i, f i)) : + ∃ i, f i = ⨆ i, f i := + csSup_mem_of_not_isSuccPrelimit' hf' + +lemma csSup_mem_of_not_isSuccLimit (hne : s.Nonempty) (hbbd : BddAbove s) + (hlim : ¬ IsSuccLimit (sSup s)) : sSup s ∈ s := by + rw [isSuccLimit_iff_of_orderBot, not_and_or, not_ne_iff] at hlim + refine hlim.elim (fun h ↦ ?_) csSup_mem_of_not_isSuccPrelimit' + obtain ⟨a, ha⟩ := hne + obtain rfl | ha' := eq_or_ne ⊥ a + · rwa [h] + · exact (h ▸ ha'.bot_lt'.trans_le <| le_csSup hbbd ha).false.elim + +lemma exists_eq_ciSup_of_not_isSuccLimit [Nonempty ι] (hbbd : BddAbove (range f)) + (hf : ¬ IsSuccLimit (⨆ i, f i)) : ∃ i, f i = ⨆ i, f i := + csSup_mem_of_not_isSuccLimit (Set.range_nonempty _) hbbd hf theorem Order.IsSuccPrelimit.sSup_Iio (h : IsSuccPrelimit x) : sSup (Iio x) = x := by obtain rfl | hx := eq_bot_or_bot_lt x @@ -117,7 +132,7 @@ theorem sSup_Iio_eq_self_iff_isSuccPrelimit : sSup (Iio x) = x ↔ IsSuccPrelimi refine ⟨fun h ↦ ?_, IsSuccPrelimit.sSup_Iio⟩ by_contra hx rw [← h] at hx - simpa [h] using csSup_mem_of_not_isSuccPrelimit' bddAbove_Iio hx + simpa [h] using csSup_mem_of_not_isSuccPrelimit' hx theorem iSup_Iio_eq_self_iff_isSuccPrelimit : ⨆ a : Iio x, a.1 = x ↔ IsSuccPrelimit x := by rw [← sSup_eq_iSup', sSup_Iio_eq_self_iff_isSuccPrelimit] diff --git a/Mathlib/SetTheory/Cardinal/Arithmetic.lean b/Mathlib/SetTheory/Cardinal/Arithmetic.lean index eece428bbd2cb0..ee8638574538e3 100644 --- a/Mathlib/SetTheory/Cardinal/Arithmetic.lean +++ b/Mathlib/SetTheory/Cardinal/Arithmetic.lean @@ -355,8 +355,7 @@ protected theorem ciSup_add (hf : BddAbove (range f)) (c : Cardinal.{v}) : refine le_antisymm ?_ (ciSup_le' this) have bdd : BddAbove (range (f · + c)) := ⟨_, forall_mem_range.mpr this⟩ obtain hs | hs := lt_or_ge (⨆ i, f i) ℵ₀ - · obtain ⟨i, hi⟩ := exists_eq_of_iSup_eq_of_not_isSuccLimit - f hf (not_isSuccLimit_of_lt_aleph0 hs) rfl + · obtain ⟨i, hi⟩ := exists_eq_ciSup_of_not_isSuccLimit hf (not_isSuccLimit_of_lt_aleph0 hs) exact hi ▸ le_ciSup bdd i rw [add_eq_max hs, max_le_iff] exact ⟨ciSup_mono bdd fun i ↦ self_le_add_right _ c, @@ -384,8 +383,7 @@ protected theorem ciSup_mul (c : Cardinal.{v}) : (⨆ i, f i) * c = ⨆ i, f i * refine le_antisymm ?_ (ciSup_le' this) have bdd : BddAbove (range (f · * c)) := ⟨_, forall_mem_range.mpr this⟩ obtain hs | hs := lt_or_ge (⨆ i, f i) ℵ₀ - · obtain ⟨i, hi⟩ := exists_eq_of_iSup_eq_of_not_isSuccLimit - f hf (not_isSuccLimit_of_lt_aleph0 hs) rfl + · obtain ⟨i, hi⟩ := exists_eq_ciSup_of_not_isSuccLimit hf (not_isSuccLimit_of_lt_aleph0 hs) exact hi ▸ le_ciSup bdd i rw [mul_eq_max_of_aleph0_le_left hs h0, max_le_iff] obtain ⟨i, hi⟩ := exists_lt_of_lt_ciSup' (one_lt_aleph0.trans_le hs) diff --git a/Mathlib/SetTheory/Cardinal/Basic.lean b/Mathlib/SetTheory/Cardinal/Basic.lean index b60366d643c303..472f88200824f5 100644 --- a/Mathlib/SetTheory/Cardinal/Basic.lean +++ b/Mathlib/SetTheory/Cardinal/Basic.lean @@ -399,9 +399,11 @@ theorem isStrongLimit_aleph0 : IsStrongLimit ℵ₀ := by theorem IsStrongLimit.aleph0_le {c} (H : IsStrongLimit c) : ℵ₀ ≤ c := aleph0_le_of_isSuccLimit H.isSuccLimit +@[deprecated exists_eq_ciSup_of_not_isSuccLimit (since := "2026-04-13")] lemma exists_eq_natCast_of_iSup_eq {ι : Type u} [Nonempty ι] (f : ι → Cardinal.{v}) - (hf : BddAbove (range f)) (n : ℕ) (h : ⨆ i, f i = n) : ∃ i, f i = n := - exists_eq_of_iSup_eq_of_not_isSuccLimit.{u, v} f hf (not_isSuccLimit_natCast n) h + (hf : BddAbove (range f)) (n : ℕ) (h : ⨆ i, f i = n) : ∃ i, f i = n := by + rw [← h] + exact exists_eq_ciSup_of_not_isSuccLimit hf (h ▸ not_isSuccLimit_natCast n) @[simp] theorem range_natCast : range ((↑) : ℕ → Cardinal) = Iio ℵ₀ := diff --git a/Mathlib/SetTheory/Cardinal/Order.lean b/Mathlib/SetTheory/Cardinal/Order.lean index 4c53f247b3c7b2..dcb15f24bf6de4 100644 --- a/Mathlib/SetTheory/Cardinal/Order.lean +++ b/Mathlib/SetTheory/Cardinal/Order.lean @@ -544,28 +544,21 @@ theorem exists_wellFoundedLT : ∃ (_ : LinearOrder α), WellFoundedLT α := by namespace Cardinal -/-! ### Bounds on suprema -/ - +@[deprecated exists_eq_ciSup_of_not_isSuccPrelimit' (since := "2026-04-13")] lemma exists_eq_of_iSup_eq_of_not_isSuccPrelimit {ι : Type u} (f : ι → Cardinal.{v}) (ω : Cardinal.{v}) (hω : ¬ IsSuccPrelimit ω) (h : ⨆ i : ι, f i = ω) : ∃ i, f i = ω := by subst h - suffices BddAbove (range f) from (isLUB_csSup' this).mem_of_not_isSuccPrelimit hω - contrapose hω with hf - rw [iSup, csSup_of_not_bddAbove hf, csSup_empty] - exact isSuccPrelimit_bot + exact exists_eq_ciSup_of_not_isSuccPrelimit' hω +@[deprecated exists_eq_ciSup_of_not_isSuccLimit (since := "2026-04-13")] lemma exists_eq_of_iSup_eq_of_not_isSuccLimit {ι : Type u} [hι : Nonempty ι] (f : ι → Cardinal.{v}) (hf : BddAbove (range f)) {c : Cardinal.{v}} (hc : ¬ IsSuccLimit c) (h : ⨆ i, f i = c) : ∃ i, f i = c := by - rw [Cardinal.isSuccLimit_iff] at hc - refine (not_and_or.mp hc).elim (fun e ↦ ⟨hι.some, ?_⟩) - (Cardinal.exists_eq_of_iSup_eq_of_not_isSuccPrelimit.{u, v} f c · h) - cases not_not.mp e - rw [← nonpos_iff_eq_zero] at h ⊢ - exact (le_ciSup hf _).trans h + subst h + exact exists_eq_ciSup_of_not_isSuccLimit hf hc /-! ### Indexed cardinal `prod` -/