Skip to content

Commit d6f4a82

Browse files
committed
refactor(SetTheory/Ordinal/Arithmetic): Ordinal.IsLimitOrder.IsSuccLimit (leanprover-community#26643)
This is part of a series of ordinal refactors which aim to replace definitions specific to `Ordinal` with more general concepts. See leanprover-community#17033 for more info.
1 parent 6625861 commit d6f4a82

File tree

20 files changed

+369
-268
lines changed

20 files changed

+369
-268
lines changed

Mathlib/MeasureTheory/MeasurableSpace/Card.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ theorem generateMeasurableRec_omega1 (s : Set (Set α)) :
112112
exact ⟨0, omega_pos 1, self_subset_generateMeasurableRec s 0 ht⟩
113113
· exact ⟨0, omega_pos 1, empty_mem_generateMeasurableRec s 0
114114
· rintro u - ⟨j, hj, hj'⟩
115-
exact ⟨_, (isLimit_omega 1).succ_lt hj,
115+
exact ⟨_, (isSuccLimit_omega 1).succ_lt hj,
116116
compl_mem_generateMeasurableRec (Order.lt_succ j) hj'⟩
117117
· intro f H
118118
choose I hI using fun n => (H n).1
@@ -139,7 +139,7 @@ theorem generateMeasurable_eq_rec (s : Set (Set α)) :
139139
| compl u _ IH =>
140140
rw [generateMeasurableRec_omega1, mem_iUnion₂] at IH
141141
obtain ⟨i, hi, hi'⟩ := IH
142-
exact generateMeasurableRec_mono _ ((isLimit_omega 1).succ_lt hi).le
142+
exact generateMeasurableRec_mono _ ((isSuccLimit_omega 1).succ_lt hi).le
143143
(compl_mem_generateMeasurableRec (Order.lt_succ i) hi')
144144
| iUnion f _ IH =>
145145
simp_rw [generateMeasurableRec_omega1, mem_iUnion₂, exists_prop] at IH

Mathlib/Order/SuccPred/Limit.lean

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ any others. They are so named since they can't be the successors of anything sma
1616
For some applications, it is desirable to exclude minimal elements from being successor limits, or
1717
maximal elements from being predecessor limits. As such, we also provide `Order.IsSuccLimit` and
1818
`Order.IsPredLimit`, which exclude these cases.
19-
20-
## TODO
21-
22-
The plan is to eventually replace `Ordinal.IsLimit` and `Cardinal.IsLimit` with the common
23-
predicate `Order.IsSuccLimit`.
2419
-/
2520

2621

Mathlib/SetTheory/Cardinal/Aleph.lean

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -324,17 +324,21 @@ theorem _root_.Ordinal.lift_preOmega (o : Ordinal.{u}) :
324324
Ordinal.lift.{v} (preOmega o) = preOmega (Ordinal.lift.{v} o) := by
325325
rw [← ord_preAleph, lift_ord, lift_preAleph, ord_preAleph]
326326

327-
theorem preAleph_le_of_isLimit {o : Ordinal} (l : o.IsLimit) {c} :
327+
theorem preAleph_le_of_isSuccPrelimit {o : Ordinal} (l : IsSuccPrelimit o) {c} :
328328
preAleph o ≤ c ↔ ∀ o' < o, preAleph o' ≤ c :=
329329
fun h o' h' => (preAleph_le_preAleph.2 <| h'.le).trans h, fun h => by
330-
rw [← preAleph.apply_symm_apply c, preAleph_le_preAleph, limit_le l]
330+
rw [← preAleph.apply_symm_apply c, preAleph_le_preAleph, l.le_iff_forall_le]
331331
intro x h'
332332
rw [← preAleph_le_preAleph, preAleph.apply_symm_apply]
333333
exact h _ h'⟩
334334

335-
theorem preAleph_limit {o : Ordinal} (ho : o.IsLimit) : preAleph o = ⨆ a : Iio o, preAleph a := by
335+
@[deprecated (since := "2025-07-08")]
336+
alias preAleph_le_of_isLimit := preAleph_le_of_isSuccPrelimit
337+
338+
theorem preAleph_limit {o : Ordinal} (ho : IsSuccPrelimit o) :
339+
preAleph o = ⨆ a : Iio o, preAleph a := by
336340
refine le_antisymm ?_ (ciSup_le' fun i => preAleph_le_preAleph.2 i.2.le)
337-
rw [preAleph_le_of_isLimit ho]
341+
rw [preAleph_le_of_isSuccPrelimit ho]
338342
exact fun a ha => le_ciSup (bddAbove_of_small _) (⟨a, ha⟩ : Iio o)
339343

340344
theorem preAleph_le_of_strictMono {f : Ordinal → Cardinal} (hf : StrictMono f) (o : Ordinal) :
@@ -394,12 +398,12 @@ theorem _root_.Ordinal.lift_omega (o : Ordinal.{u}) :
394398
Ordinal.lift.{v} (ω_ o) = ω_ (Ordinal.lift.{v} o) := by
395399
simp [omega_eq_preOmega]
396400

397-
theorem aleph_limit {o : Ordinal} (ho : o.IsLimit) : ℵ_ o = ⨆ a : Iio o, ℵ_ a := by
398-
rw [aleph_eq_preAleph, preAleph_limit (isLimit_add ω ho)]
401+
theorem aleph_limit {o : Ordinal} (ho : IsSuccLimit o) : ℵ_ o = ⨆ a : Iio o, ℵ_ a := by
402+
rw [aleph_eq_preAleph, preAleph_limit (isSuccLimit_add ω ho).isSuccPrelimit]
399403
apply le_antisymm <;>
400404
apply ciSup_mono' (bddAbove_of_small _) <;>
401405
intro i
402-
· refine ⟨⟨_, sub_lt_of_lt_add i.2 ho.pos⟩, ?_⟩
406+
· refine ⟨⟨_, sub_lt_of_lt_add i.2 ho.bot_lt⟩, ?_⟩
403407
simpa [aleph_eq_preAleph] using le_add_sub _ _
404408
· exact ⟨⟨_, add_lt_add_left i.2 ω⟩, le_rfl⟩
405409

@@ -418,9 +422,12 @@ theorem aleph_toNat (o : Ordinal) : toNat (ℵ_ o) = 0 :=
418422
theorem aleph_toENat (o : Ordinal) : toENat (ℵ_ o) = ⊤ :=
419423
(toENat_eq_top.2 (aleph0_le_aleph o))
420424

421-
theorem isLimit_omega (o : Ordinal) : Ordinal.IsLimit (ω_ o) := by
425+
theorem isSuccLimit_omega (o : Ordinal) : IsSuccLimit (ω_ o) := by
422426
rw [← ord_aleph]
423-
exact isLimit_ord (aleph0_le_aleph _)
427+
exact isSuccLimit_ord (aleph0_le_aleph _)
428+
429+
@[deprecated (since := "2025-07-08")]
430+
alias isLimit_omega := isSuccLimit_omega
424431

425432
@[simp]
426433
theorem range_aleph : range aleph = Set.Ici ℵ₀ := by
@@ -537,7 +544,7 @@ theorem preBeth_one : preBeth 1 = 1 := by
537544
@[simp]
538545
theorem preBeth_omega : preBeth ω = ℵ₀ := by
539546
apply le_antisymm
540-
· rw [preBeth_limit isLimit_omega0.isSuccPrelimit, ciSup_le_iff' (bddAbove_of_small _)]
547+
· rw [preBeth_limit isSuccLimit_omega0.isSuccPrelimit, ciSup_le_iff' (bddAbove_of_small _)]
541548
rintro ⟨a, ha⟩
542549
obtain ⟨n, rfl⟩ := lt_omega0.1 ha
543550
rw [preBeth_nat]
@@ -601,12 +608,12 @@ theorem beth_zero : ℶ_ 0 = ℵ₀ := by
601608
theorem beth_succ (o : Ordinal) : ℶ_ (succ o) = 2 ^ ℶ_ o := by
602609
simp [beth, add_succ]
603610

604-
theorem beth_limit {o : Ordinal} (ho : o.IsLimit) : ℶ_ o = ⨆ a : Iio o, ℶ_ a := by
605-
rw [beth_eq_preBeth, preBeth_limit (isLimit_add ω ho).isSuccPrelimit]
611+
theorem beth_limit {o : Ordinal} (ho : IsSuccLimit o) : ℶ_ o = ⨆ a : Iio o, ℶ_ a := by
612+
rw [beth_eq_preBeth, preBeth_limit (isSuccLimit_add ω ho).isSuccPrelimit]
606613
apply le_antisymm <;>
607614
apply ciSup_mono' (bddAbove_of_small _) <;>
608615
intro i
609-
· refine ⟨⟨_, sub_lt_of_lt_add i.2 ho.pos⟩, ?_⟩
616+
· refine ⟨⟨_, sub_lt_of_lt_add i.2 ho.bot_lt⟩, ?_⟩
610617
simpa [beth_eq_preBeth] using le_add_sub _ _
611618
· exact ⟨⟨_, add_lt_add_left i.2 ω⟩, le_rfl⟩
612619

@@ -635,7 +642,7 @@ theorem isStrongLimit_beth {o : Ordinal} (H : IsSuccPrelimit o) : IsStrongLimit
635642
have := power_le_power_left two_ne_zero ha.le
636643
rw [← beth_succ] at this
637644
exact this.trans_lt (beth_strictMono (H.succ_lt hi))
638-
· rw [isLimit_iff]
645+
· rw [isSuccLimit_iff]
639646
exact ⟨h, H⟩
640647

641648
end Cardinal

Mathlib/SetTheory/Cardinal/Arithmetic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ theorem mul_eq_self {c : Cardinal} (h : ℵ₀ ≤ c) : c * c = c := by
7979
· exact (mul_lt_aleph0 qo qo).trans_le ol
8080
· suffices (succ (typein LT.lt (g p))).card < #α from (IH _ this qo).trans_lt this
8181
rw [← lt_ord]
82-
apply (isLimit_ord ol).succ_lt
82+
apply (isSuccLimit_ord ol).succ_lt
8383
rw [e]
8484
apply typein_lt_type
8585

Mathlib/SetTheory/Cardinal/Cofinality.lean

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ theorem cof_cof (a : Ordinal.{u}) : cof (cof a).ord = cof a := by
529529
exact ord_injective (hf.trans hg).cof_eq.symm
530530

531531
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
532-
{a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
532+
{a o} (ha : IsSuccLimit a) {g} (hg : IsFundamentalSequence a o g) :
533533
IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
534534
refine ⟨?_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), ?_⟩
535535
· rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
@@ -555,12 +555,12 @@ protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u
555555
hg.2.2]
556556
exact IsNormal.blsub_eq.{u, u} hf ha
557557

558-
theorem IsNormal.cof_eq {f} (hf : IsNormal f) {a} (ha : IsLimit a) : cof (f a) = cof a :=
558+
theorem IsNormal.cof_eq {f} (hf : IsNormal f) {a} (ha : IsSuccLimit a) : cof (f a) = cof a :=
559559
let ⟨_, hg⟩ := exists_fundamental_sequence a
560560
ord_injective (hf.isFundamentalSequence ha hg).cof_eq
561561

562562
theorem IsNormal.cof_le {f} (hf : IsNormal f) (a) : cof a ≤ cof (f a) := by
563-
rcases zero_or_succ_or_limit a with (rfl | ⟨b, rfl⟩ | ha)
563+
rcases zero_or_succ_or_isSuccLimit a with (rfl | ⟨b, rfl⟩ | ha)
564564
· rw [cof_zero]
565565
exact zero_le _
566566
· rw [cof_succ, Cardinal.one_le_iff_ne_zero, cof_ne_zero, ← Ordinal.pos_iff_ne_zero]
@@ -569,27 +569,27 @@ theorem IsNormal.cof_le {f} (hf : IsNormal f) (a) : cof a ≤ cof (f a) := by
569569

570570
@[simp]
571571
theorem cof_add (a b : Ordinal) : b ≠ 0 → cof (a + b) = cof b := fun h => by
572-
rcases zero_or_succ_or_limit b with (rfl | ⟨c, rfl⟩ | hb)
572+
rcases zero_or_succ_or_isSuccLimit b with (rfl | ⟨c, rfl⟩ | hb)
573573
· contradiction
574574
· rw [add_succ, cof_succ, cof_succ]
575575
· exact (isNormal_add_right a).cof_eq hb
576576

577-
theorem aleph0_le_cof {o} : ℵ₀ ≤ cof o ↔ IsLimit o := by
578-
rcases zero_or_succ_or_limit o with (rfl | ⟨o, rfl⟩ | l)
579-
· simp [not_zero_isLimit, Cardinal.aleph0_ne_zero]
580-
· simp [not_succ_isLimit, Cardinal.one_lt_aleph0]
577+
theorem aleph0_le_cof {o} : ℵ₀ ≤ cof o ↔ IsSuccLimit o := by
578+
rcases zero_or_succ_or_isSuccLimit o with (rfl | ⟨o, rfl⟩ | l)
579+
· simp [Cardinal.aleph0_ne_zero]
580+
· simp [Cardinal.one_lt_aleph0]
581581
· simp only [l, iff_true]
582582
refine le_of_not_gt fun h => ?_
583583
obtain ⟨n, e⟩ := Cardinal.lt_aleph0.1 h
584584
have := cof_cof o
585585
rw [e, ord_nat] at this
586586
cases n
587-
· simp at e
588-
simp [e, not_zero_isLimit] at l
587+
· apply l.ne_bot
588+
simpa using e
589589
· rw [natCast_succ, cof_succ] at this
590590
rw [← this, cof_eq_one_iff_is_succ] at e
591591
rcases e with ⟨a, rfl⟩
592-
exact not_succ_isLimit _ l
592+
exact not_isSuccLimit_succ _ l
593593

594594
@[simp]
595595
theorem cof_preOmega {o : Ordinal} (ho : IsSuccPrelimit o) : (preOmega o).cof = o.cof := by
@@ -598,16 +598,16 @@ theorem cof_preOmega {o : Ordinal} (ho : IsSuccPrelimit o) : (preOmega o).cof =
598598
· exact isNormal_preOmega.cof_eq ⟨h, ho⟩
599599

600600
@[simp]
601-
theorem cof_omega {o : Ordinal} (ho : o.IsLimit) : (ω_ o).cof = o.cof :=
601+
theorem cof_omega {o : Ordinal} (ho : IsSuccLimit o) : (ω_ o).cof = o.cof :=
602602
isNormal_omega.cof_eq ho
603603

604604
@[simp]
605605
theorem cof_omega0 : cof ω = ℵ₀ :=
606-
(aleph0_le_cof.2 isLimit_omega0).antisymm' <| by
606+
(aleph0_le_cof.2 isSuccLimit_omega0).antisymm' <| by
607607
rw [← card_omega0]
608608
apply cof_le_card
609609

610-
theorem cof_eq' (r : α → α → Prop) [IsWellOrder α r] (h : IsLimit (type r)) :
610+
theorem cof_eq' (r : α → α → Prop) [IsWellOrder α r] (h : IsSuccLimit (type r)) :
611611
∃ S : Set α, (∀ a, ∃ b ∈ S, r a b) ∧ #S = cof (type r) :=
612612
let ⟨S, H, e⟩ := cof_eq r
613613
⟨S, fun a =>
@@ -675,7 +675,7 @@ theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, 2 ^ x < #α) {r : α
675675
· refine @mk_le_of_injective α _ (fun x => Subtype.mk {x} ?_) ?_
676676
· apply bounded_singleton
677677
rw [← hr]
678-
apply isLimit_ord ha
678+
apply isSuccLimit_ord ha
679679
· intro a b hab
680680
simpa [singleton_eq_singleton_iff] using hab
681681

@@ -694,7 +694,7 @@ theorem mk_subset_mk_lt_cof {α : Type*} (h : ∀ x < #α, 2 ^ x < #α) :
694694
exact lt_cof_type hs
695695
· refine @mk_le_of_injective α _ (fun x => Subtype.mk {x} ?_) ?_
696696
· rw [mk_singleton]
697-
exact one_lt_aleph0.trans_le (aleph0_le_cof.2 (isLimit_ord h'.aleph0_le))
697+
exact one_lt_aleph0.trans_le (aleph0_le_cof.2 (isSuccLimit_ord h'.aleph0_le))
698698
· intro a b hab
699699
simpa [singleton_eq_singleton_iff] using hab
700700

@@ -723,7 +723,7 @@ theorem unbounded_of_unbounded_iUnion {α β : Type u} (r : α → α → Prop)
723723
theorem lt_power_cof {c : Cardinal.{u}} : ℵ₀ ≤ c → c < c ^ c.ord.cof :=
724724
Cardinal.inductionOn c fun α h => by
725725
rcases ord_eq α with ⟨r, wo, re⟩
726-
have := isLimit_ord h
726+
have := isSuccLimit_ord h
727727
rw [re] at this ⊢
728728
rcases cof_eq' r this with ⟨S, H, Se⟩
729729
have := sum_lt_prod (fun a : S => #{ x // r x a }) (fun _ => #α) fun i => ?_

Mathlib/SetTheory/Cardinal/Ordinal.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ theorem card_opow_le_of_omega0_le_left {a : Ordinal} (ha : ω ≤ a) (b : Ordina
8888
cases omega0_pos.not_ge ha
8989
· rwa [aleph0_le_card]
9090
· intro b hb IH
91-
rw [(isNormal_opow (one_lt_omega0.trans_le ha)).apply_of_isLimit hb]
91+
rw [(isNormal_opow (one_lt_omega0.trans_le ha)).apply_of_isSuccLimit hb]
9292
apply (card_iSup_Iio_le_card_mul_iSup _).trans
9393
rw [Cardinal.lift_id, Cardinal.mul_eq_max_of_aleph0_le_right, max_comm]
9494
· apply max_le _ (le_max_right _ _)
9595
apply ciSup_le'
9696
intro c
9797
exact (IH c.1 c.2).trans (max_le_max_left _ (card_le_card c.2.le))
98-
· simpa using hb.pos.ne'
99-
· refine le_ciSup_of_le ?_ ⟨1, one_lt_omega0.trans_le <| omega0_le_of_isLimit hb⟩ ?_
98+
· simpa using hb.ne_bot
99+
· refine le_ciSup_of_le ?_ ⟨1, one_lt_omega0.trans_le <| omega0_le_of_isSuccLimit hb⟩ ?_
100100
· exact Cardinal.bddAbove_of_small _
101101
· simpa
102102

Mathlib/SetTheory/Cardinal/Regular.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ theorem IsRegular.ord_pos {c : Cardinal} (H : c.IsRegular) : 0 < c.ord := by
5656
rw [Cardinal.lt_ord, card_zero]
5757
exact H.pos
5858

59-
theorem isRegular_cof {o : Ordinal} (h : o.IsLimit) : IsRegular o.cof :=
59+
theorem isRegular_cof {o : Ordinal} (h : IsSuccLimit o) : IsRegular o.cof :=
6060
⟨aleph0_le_cof.2 h, (cof_cof o).ge⟩
6161

6262
/-- If `c` is a regular cardinal, then `c.ord.toType` has a least element. -/
@@ -76,7 +76,7 @@ theorem isRegular_succ {c : Cardinal.{u}} (h : ℵ₀ ≤ c) : IsRegular (succ c
7676
have αe := Cardinal.mk_out (succ c)
7777
set α := (succ c).out
7878
rcases ord_eq α with ⟨r, wo, re⟩
79-
have := isLimit_ord (h.trans (le_succ _))
79+
have := isSuccLimit_ord (h.trans (le_succ _))
8080
rw [← αe, re] at this ⊢
8181
rcases cof_eq' r this with ⟨S, H, Se⟩
8282
rw [← Se]
@@ -210,8 +210,8 @@ theorem derivFamily_lt_ord_lift {ι : Type u} {f : ι → Ordinal → Ordinal} {
210210
rw [derivFamily_succ]
211211
exact
212212
nfpFamily_lt_ord_lift hω (by rwa [hc.cof_eq]) hf
213-
((isLimit_ord hc.1).succ_lt (hb ((lt_succ b).trans hb')))
214-
| isLimit b hb H =>
213+
((isSuccLimit_ord hc.1).succ_lt (hb ((lt_succ b).trans hb')))
214+
| limit b hb H =>
215215
intro hb'
216216
-- TODO: generalize the universes of the lemmas in this file so we don't have to rely on bsup
217217
have : ⨆ a : Iio b, _ = _ :=

Mathlib/SetTheory/Game/Birthday.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ theorem small_setOf_birthday_lt (o : Ordinal) : Small.{u} {x : Game.{u} // birth
274274
induction o using Ordinal.induction with | h o IH =>
275275
let S := ⋃ a ∈ Set.Iio o, {x : Game.{u} | birthday x < a}
276276
let H : Small.{u} S := @small_biUnion _ _ _ _ _ IH
277-
obtain rfl | ⟨a, rfl⟩ | ho := zero_or_succ_or_limit o
277+
obtain rfl | ⟨a, rfl⟩ | ho := zero_or_succ_or_isSuccLimit o
278278
· simp_rw [Ordinal.not_lt_zero]
279279
exact small_empty
280280
· simp_rw [Order.lt_succ_iff, le_iff_lt_or_eq]
@@ -301,7 +301,7 @@ theorem small_setOf_birthday_lt (o : Ordinal) : Small.{u} {x : Game.{u} // birth
301301
exact (birthday_quot_le_pGameBirthday _).trans_lt (PGame.birthday_moveRight_lt i)
302302
· convert H
303303
change birthday _ < o ↔ ∃ a, _
304-
simpa using lt_limit ho
304+
simpa using ho.lt_iff_exists_lt
305305

306306
end Game
307307

0 commit comments

Comments
 (0)