Skip to content

Commit ef5710b

Browse files
committed
feat: generalize IsLUB.mem_of_not_isSuccPrelimit to LinearOrder (#20502)
1 parent 17ac720 commit ef5710b

File tree

3 files changed

+42
-15
lines changed

3 files changed

+42
-15
lines changed

Mathlib/Order/SuccPred/CompleteLinearOrder.lean

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,7 @@ lemma exists_eq_ciSup_of_not_isSuccPrelimit'
124124
@[deprecated exists_eq_ciSup_of_not_isSuccPrelimit' (since := "2024-09-05")]
125125
alias exists_eq_ciSup_of_not_isSuccLimit' := exists_eq_ciSup_of_not_isSuccPrelimit'
126126

127-
lemma IsLUB.mem_of_not_isSuccPrelimit (hs : IsLUB s x) (hx : ¬ IsSuccPrelimit x) : x ∈ s := by
128-
obtain rfl | hs' := s.eq_empty_or_nonempty
129-
· simp [show x = ⊥ by simpa using hs, isSuccPrelimit_bot] at hx
130-
· exact hs.mem_of_nonempty_of_not_isSuccPrelimit hs' hx
131-
132-
@[deprecated IsLUB.mem_of_not_isSuccPrelimit (since := "2024-09-05")]
133-
alias IsLUB.mem_of_not_isSuccLimit := IsLUB.mem_of_not_isSuccPrelimit
134-
127+
@[deprecated IsLUB.mem_of_not_isSuccPrelimit (since := "2025-01-05")]
135128
lemma IsLUB.exists_of_not_isSuccPrelimit (hf : IsLUB (range f) x) (hx : ¬ IsSuccPrelimit x) :
136129
∃ i, f i = x :=
137130
hf.mem_of_not_isSuccPrelimit hx
@@ -206,12 +199,7 @@ lemma exists_eq_iInf_of_not_isPredPrelimit (hf : ¬ IsPredPrelimit (⨅ i, f i))
206199
@[deprecated exists_eq_iInf_of_not_isPredPrelimit (since := "2024-09-05")]
207200
alias exists_eq_iInf_of_not_isPredLimit := exists_eq_iInf_of_not_isPredPrelimit
208201

209-
lemma IsGLB.mem_of_not_isPredPrelimit (hs : IsGLB s x) (hx : ¬ IsPredPrelimit x) : x ∈ s :=
210-
hs.sInf_eq ▸ sInf_mem_of_not_isPredPrelimit (hs.sInf_eq ▸ hx)
211-
212-
@[deprecated IsGLB.mem_of_not_isPredPrelimit (since := "2024-09-05")]
213-
alias IsGLB.mem_of_not_isPredLimit := IsGLB.mem_of_not_isPredPrelimit
214-
202+
@[deprecated IsGLB.mem_of_not_isPredLimit (since := "2025-01-05")]
215203
lemma IsGLB.exists_of_not_isPredPrelimit (hf : IsGLB (range f) x) (hx : ¬ IsPredPrelimit x) :
216204
∃ i, f i = x :=
217205
hf.mem_of_not_isPredPrelimit hx

Mathlib/Order/SuccPred/Limit.lean

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,29 @@ theorem IsSuccPrelimit.lt_iff_exists_lt (h : IsSuccPrelimit b) : a < b ↔ ∃ c
324324
theorem IsSuccLimit.lt_iff_exists_lt (h : IsSuccLimit b) : a < b ↔ ∃ c < b, a < c :=
325325
h.isSuccPrelimit.lt_iff_exists_lt
326326

327+
lemma _root_.IsLUB.isSuccPrelimit_of_not_mem {s : Set α} (hs : IsLUB s a) (ha : a ∉ s) :
328+
IsSuccPrelimit a := by
329+
intro b hb
330+
obtain ⟨c, hc, hbc, hca⟩ := hs.exists_between hb.lt
331+
obtain rfl := (hb.ge_of_gt hbc).antisymm hca
332+
contradiction
333+
334+
lemma _root_.IsLUB.mem_of_not_isSuccPrelimit {s : Set α} (hs : IsLUB s a) (ha : ¬IsSuccPrelimit a) :
335+
a ∈ s :=
336+
ha.imp_symm hs.isSuccPrelimit_of_not_mem
337+
338+
lemma _root_.IsLUB.isSuccLimit_of_not_mem {s : Set α} (hs : IsLUB s a) (hs' : s.Nonempty)
339+
(ha : a ∉ s) : IsSuccLimit a := by
340+
refine ⟨?_, hs.isSuccPrelimit_of_not_mem ha⟩
341+
obtain ⟨b, hb⟩ := hs'
342+
obtain rfl | hb := (hs.1 hb).eq_or_lt
343+
· contradiction
344+
· exact hb.not_isMin
345+
346+
lemma _root_.IsLUB.mem_of_not_isSuccLimit {s : Set α} (hs : IsLUB s a) (hs' : s.Nonempty)
347+
(ha : ¬IsSuccLimit a) : a ∈ s :=
348+
ha.imp_symm <| hs.isSuccLimit_of_not_mem hs'
349+
327350
theorem IsSuccPrelimit.isLUB_Iio (ha : IsSuccPrelimit a) : IsLUB (Iio a) a := by
328351
refine ⟨fun _ ↦ le_of_lt, fun b hb ↦ le_of_forall_lt fun c hc ↦ ?_⟩
329352
obtain ⟨d, hd, hd'⟩ := ha.lt_iff_exists_lt.1 hc
@@ -634,6 +657,22 @@ theorem IsPredPrelimit.lt_iff_exists_lt (h : IsPredPrelimit b) : b < a ↔ ∃ c
634657
theorem IsPredLimit.lt_iff_exists_lt (h : IsPredLimit b) : b < a ↔ ∃ c, b < c ∧ c < a :=
635658
h.dual.lt_iff_exists_lt
636659

660+
lemma _root_.IsGLB.isPredPrelimit_of_not_mem {s : Set α} (hs : IsGLB s a) (ha : a ∉ s) :
661+
IsPredPrelimit a := by
662+
simpa using (IsGLB.dual hs).isSuccPrelimit_of_not_mem ha
663+
664+
lemma _root_.IsGLB.mem_of_not_isPredPrelimit {s : Set α} (hs : IsGLB s a) (ha : ¬IsPredPrelimit a) :
665+
a ∈ s :=
666+
ha.imp_symm hs.isPredPrelimit_of_not_mem
667+
668+
lemma _root_.IsGLB.isPredLimit_of_not_mem {s : Set α} (hs : IsGLB s a) (hs' : s.Nonempty)
669+
(ha : a ∉ s) : IsPredLimit a := by
670+
simpa using (IsGLB.dual hs).isSuccLimit_of_not_mem hs' ha
671+
672+
lemma _root_.IsGLB.mem_of_not_isPredLimit {s : Set α} (hs : IsGLB s a) (hs' : s.Nonempty)
673+
(ha : ¬IsPredLimit a) : a ∈ s :=
674+
ha.imp_symm <| hs.isPredLimit_of_not_mem hs'
675+
637676
theorem IsPredPrelimit.isGLB_Ioi (ha : IsPredPrelimit a) : IsGLB (Ioi a) a :=
638677
ha.dual.isLUB_Iio
639678

Mathlib/SetTheory/Cardinal/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ lemma exists_eq_of_iSup_eq_of_not_isSuccPrelimit
10961096
(hω : ¬ IsSuccPrelimit ω)
10971097
(h : ⨆ i : ι, f i = ω) : ∃ i, f i = ω := by
10981098
subst h
1099-
refine (isLUB_csSup' ?_).exists_of_not_isSuccPrelimit
1099+
suffices BddAbove (range f) from (isLUB_csSup' this).mem_of_not_isSuccPrelimit
11001100
contrapose! hω with hf
11011101
rw [iSup, csSup_of_not_bddAbove hf, csSup_empty]
11021102
exact isSuccPrelimit_bot

0 commit comments

Comments
 (0)