Skip to content

Commit 49358d7

Browse files
committed
refactor: deprecate Ordinal.lsub (leanprover-community#37262)
In favor of simply writing `⨆ i, f i + 1`. See leanprover-community#17033.
1 parent 188fc54 commit 49358d7

3 files changed

Lines changed: 65 additions & 21 deletions

File tree

Mathlib/SetTheory/Cardinal/Cofinality.lean

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -502,10 +502,7 @@ theorem _root_.Cardinal.iSup_lt_of_lt_cof_ord {f : α → Cardinal.{u}} {a : Car
502502
rw [← ord_lt_ord, iSup_ord]
503503
apply Ordinal.iSup_lt_of_lt_cof <;> simpa
504504

505-
/-! ### Cofinality of suprema and least strict upper bounds -/
506-
507-
-- TODO: use `⨆ i, f i + 1` instead of `lsub`
508-
505+
set_option linter.deprecated false in
509506
/-- The set in the `lsub` characterization of `cof` is nonempty. -/
510507
@[deprecated "to build an increasing function with limit o, use the fundamental sequence API."
511508
(since := "2026-03-27")]
@@ -539,10 +536,12 @@ theorem exists_lsub_cof (o : Ordinal) :
539536
rw [cof_eq_sInf_lsub]
540537
exact csInf_mem (cof_lsub_def_nonempty o)
541538

539+
set_option linter.deprecated false in
542540
@[deprecated cof_iSup_add_one_le (since := "2026-03-22")]
543541
theorem cof_lsub_le {ι} (f : ι → Ordinal) : cof (lsub.{u, u} f) ≤ #ι :=
544542
cof_iSup_add_one_le f
545543

544+
set_option linter.deprecated false in
546545
@[deprecated cof_lift_iSup_add_one_le (since := "2026-03-22")]
547546
theorem cof_lsub_le_lift {ι} (f : ι → Ordinal) :
548547
cof (lsub.{u, v} f) ≤ Cardinal.lift.{v, u} #ι := by
@@ -560,13 +559,15 @@ theorem le_cof_iff_lsub {o : Ordinal} {a : Cardinal} :
560559
rw [← hb]
561560
exact H _ hf⟩
562561

562+
set_option linter.deprecated false in
563563
@[deprecated lift_iSup_add_one_lt_of_lt_cof (since := "2026-03-22")]
564564
theorem lsub_lt_ord_lift {ι} {f : ι → Ordinal} {c : Ordinal}
565565
(hι : Cardinal.lift.{v, u} #ι < c.cof)
566566
(hf : ∀ i, f i < c) : lsub.{u, v} f < c := by
567567
apply lift_iSup_add_one_lt_of_lt_cof _ hf
568568
rwa [Cardinal.lift_umax, c.lift_id']
569569

570+
set_option linter.deprecated false in
570571
@[deprecated iSup_add_one_lt_of_lt_cof (since := "2026-03-22")]
571572
theorem lsub_lt_ord {ι} {f : ι → Ordinal} {c : Ordinal} (hι : #ι < c.cof) :
572573
(∀ i, f i < c) → lsub.{u, u} f < c :=

Mathlib/SetTheory/Cardinal/Regular.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,14 @@ lemma isRegular_lift_iff {κ : Cardinal.{v}} :
151151
(Cardinal.lift.{u} κ).IsRegular ↔ κ.IsRegular :=
152152
fun ⟨h₁, h₂⟩ ↦ ⟨by simpa using h₁, by simpa [← lift_le.{u, v}]⟩, fun h ↦ h.lift⟩
153153

154+
set_option linter.deprecated false in
154155
@[deprecated lift_iSup_add_one_lt_of_lt_cof (since := "2026-03-22")]
155156
theorem lsub_lt_ord_lift_of_isRegular {ι} {f : ι → Ordinal} {c} (hc : IsRegular c)
156157
(hι : Cardinal.lift.{v, u} #ι < c) (hf : ∀ i, f i < c.ord) : Ordinal.lsub.{u, v} f < c.ord := by
157158
apply lift_iSup_add_one_lt_of_lt_cof _ hf
158159
rwa [lift_umax, c.ord.lift_id', hc.cof_ord]
159160

161+
set_option linter.deprecated false in
160162
@[deprecated iSup_add_one_lt_of_lt_cof (since := "2026-03-22")]
161163
theorem lsub_lt_ord_of_isRegular {ι} {f : ι → Ordinal} {c} (hc : IsRegular c) (hι : #ι < c) :
162164
(∀ i, f i < c.ord) → Ordinal.lsub f < c.ord :=

Mathlib/SetTheory/Ordinal/Family.lean

Lines changed: 58 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,7 @@ public import Mathlib.SetTheory.Ordinal.Arithmetic
1010
/-!
1111
# Arithmetic on families of ordinals
1212
13-
## Main definitions and results
14-
15-
* `sup`, `lsub`: the supremum / least strict upper bound of an indexed family of ordinals in
16-
`Type u`, as an ordinal in `Type u`.
17-
* `bsup`, `blsub`: the supremum / least strict upper bound of a set of ordinals indexed by ordinals
18-
less than a given ordinal `o`.
13+
This file proves basic results about the suprema of families of ordinals.
1914
2015
Various other basic arithmetic results are given in `Principal.lean` instead.
2116
-/
@@ -499,42 +494,58 @@ theorem iSup_Iio_eq_bsup {o} {f : ∀ a < o, Ordinal} : ⨆ a : Iio o, f a.1 a.2
499494

500495
end bsup
501496

502-
-- TODO: bring the lsub API in line with the sSup / iSup API, or deprecate it altogether.
503-
504497
section lsub
505498

506499
/-- The least strict upper bound of a family of ordinals. -/
500+
@[deprecated "write `⨆ i, f i + 1` instead." (since := "2026-03-27")]
507501
def lsub {ι : Type u} (f : ι → Ordinal.{max u v}) : Ordinal :=
508502
iSup (succ ∘ f)
509503

510-
@[simp]
504+
set_option linter.deprecated false in
505+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
511506
theorem iSup_eq_lsub {ι} (f : ι → Ordinal) : iSup (succ ∘ f) = lsub f :=
512507
rfl
513508

509+
set_option linter.deprecated false in
510+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
514511
theorem lsub_le_iff {ι} {f : ι → Ordinal} {a} : lsub f ≤ a ↔ ∀ i, f i < a :=
515512
Ordinal.iSup_add_one_le_iff
516513

514+
set_option linter.deprecated false in
515+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
517516
theorem lsub_le {ι} {f : ι → Ordinal} {a} : (∀ i, f i < a) → lsub f ≤ a :=
518517
lsub_le_iff.2
519518

519+
set_option linter.deprecated false in
520+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
520521
theorem lt_lsub {ι} (f : ι → Ordinal) (i) : f i < lsub f :=
521522
Ordinal.lt_iSup_add_one f i
522523

524+
set_option linter.deprecated false in
525+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
523526
theorem lt_lsub_iff {ι} {f : ι → Ordinal} {a} : a < lsub f ↔ ∃ i, a ≤ f i := by
524527
simpa only [not_forall, not_lt, not_le] using not_congr lsub_le_iff
525528

529+
set_option linter.deprecated false in
530+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
526531
theorem iSup_le_lsub {ι} (f : ι → Ordinal) : iSup f ≤ lsub f :=
527532
Ordinal.iSup_le fun i => (lt_lsub f i).le
528533

534+
set_option linter.deprecated false in
535+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
529536
theorem lsub_le_succ_iSup {ι} (f : ι → Ordinal) : lsub f ≤ succ (iSup f) :=
530537
lsub_le fun i => lt_succ_iff.2 (Ordinal.le_iSup f i)
531538

539+
set_option linter.deprecated false in
540+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
532541
theorem iSup_eq_lsub_or_succ_iSup_eq_lsub {ι} (f : ι → Ordinal) :
533542
iSup f = lsub f ∨ succ (iSup f) = lsub f := by
534543
rcases eq_or_lt_of_le (iSup_le_lsub f) with h | h
535544
· exact Or.inl h
536545
· exact Or.inr ((succ_le_of_lt h).antisymm (lsub_le_succ_iSup f))
537546

547+
set_option linter.deprecated false in
548+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
538549
theorem succ_iSup_le_lsub_iff {ι} (f : ι → Ordinal) :
539550
succ (iSup f) ≤ lsub f ↔ ∃ i, f i = iSup f := by
540551
refine ⟨fun h => ?_, ?_⟩
@@ -545,10 +556,14 @@ theorem succ_iSup_le_lsub_iff {ι} (f : ι → Ordinal) :
545556
rw [succ_le_iff, ← hf]
546557
exact lt_lsub _ _
547558

559+
set_option linter.deprecated false in
560+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
548561
theorem succ_iSup_eq_lsub_iff {ι} (f : ι → Ordinal) :
549562
succ (iSup f) = lsub f ↔ ∃ i, f i = iSup f :=
550563
(lsub_le_succ_iSup f).ge_iff_eq'.symm.trans (succ_iSup_le_lsub_iff f)
551564

565+
set_option linter.deprecated false in
566+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
552567
theorem iSup_eq_lsub_iff {ι} (f : ι → Ordinal) :
553568
iSup f = lsub f ↔ ∀ a < lsub f, succ a < lsub f := by
554569
refine ⟨fun h => ?_, fun hf => le_antisymm (iSup_le_lsub f) (lsub_le fun i => ?_)⟩
@@ -564,72 +579,92 @@ theorem iSup_eq_lsub_iff {ι} (f : ι → Ordinal) :
564579
rw [heq] at this
565580
exact this.false
566581

582+
set_option linter.deprecated false in
583+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
567584
theorem iSup_eq_lsub_iff_lt_iSup {ι} (f : ι → Ordinal) :
568585
iSup f = lsub f ↔ ∀ i, f i < iSup f :=
569586
fun h i => by
570587
rw [h]
571588
apply lt_lsub, fun h => le_antisymm (iSup_le_lsub f) (lsub_le h)⟩
572589

573-
@[simp]
590+
set_option linter.deprecated false in
591+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
574592
theorem lsub_empty {ι} [h : IsEmpty ι] (f : ι → Ordinal) : lsub f = 0 := by
575593
rw [← nonpos_iff_eq_zero, lsub_le_iff]
576594
exact h.elim
577595

596+
set_option linter.deprecated false in
597+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
578598
theorem lsub_pos {ι} [h : Nonempty ι] (f : ι → Ordinal) : 0 < lsub f :=
579599
h.elim fun i => (zero_le _).trans_lt (lt_lsub f i)
580600

581-
@[simp]
601+
set_option linter.deprecated false in
602+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
582603
theorem lsub_eq_zero_iff {ι} (f : ι → Ordinal) :
583604
lsub.{_, v} f = 0 ↔ IsEmpty ι := by
584605
refine ⟨fun h => ⟨fun i => ?_⟩, fun h => @lsub_empty _ h _⟩
585606
have := @lsub_pos.{_, v} _ ⟨i⟩ f
586607
rw [h] at this
587608
exact this.false
588609

589-
@[simp]
610+
set_option linter.deprecated false in
611+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
590612
theorem lsub_const {ι} [Nonempty ι] (o : Ordinal) : (lsub fun _ : ι => o) = succ o :=
591613
ciSup_const
592614

593-
@[simp]
615+
set_option linter.deprecated false in
616+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
594617
theorem lsub_unique {ι} [Unique ι] (f : ι → Ordinal) : lsub f = succ (f default) :=
595618
ciSup_unique
596619

620+
set_option linter.deprecated false in
621+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
597622
theorem lsub_le_of_range_subset {ι ι'} {f : ι → Ordinal} {g : ι' → Ordinal}
598623
(h : Set.range f ⊆ Set.range g) : lsub.{u, max v w} f ≤ lsub.{v, max u w} g :=
599624
csSup_le_csSup' (bddAbove_range.{v, max u w} _)
600625
(by convert Set.image_mono h <;> apply Set.range_comp)
601626

627+
set_option linter.deprecated false in
628+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
602629
theorem lsub_eq_of_range_eq {ι ι'} {f : ι → Ordinal} {g : ι' → Ordinal}
603630
(h : Set.range f = Set.range g) : lsub.{u, max v w} f = lsub.{v, max u w} g :=
604631
(lsub_le_of_range_subset.{u, v, w} h.le).antisymm (lsub_le_of_range_subset.{v, u, w} h.ge)
605632

606-
@[simp]
633+
set_option linter.deprecated false in
634+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
607635
theorem lsub_sum {α : Type u} {β : Type v} (f : α ⊕ β → Ordinal) :
608636
lsub.{max u v, w} f =
609637
max (lsub.{u, max v w} fun a => f (Sum.inl a)) (lsub.{v, max u w} fun b => f (Sum.inr b)) :=
610638
iSup_sum _
611639

640+
set_option linter.deprecated false in
641+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
612642
theorem lsub_notMem_range {ι} (f : ι → Ordinal) :
613643
lsub f ∉ Set.range f := fun ⟨i, h⟩ =>
614644
h.not_lt (lt_lsub f i)
615645

646+
set_option linter.deprecated false in
647+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
616648
theorem nonempty_compl_range {ι : Type u} (f : ι → Ordinal.{max u v}) : (Set.range f)ᶜ.Nonempty :=
617649
⟨_, lsub_notMem_range f⟩
618650

619-
@[simp]
651+
set_option linter.deprecated false in
652+
@[deprecated "lsub is deprecated" (since := "2026-03-27")]
620653
theorem lsub_typein (o : Ordinal) : lsub.{u, u} (typein (α := o.ToType) (· < ·)) = o :=
621654
(lsub_le.{u, u} typein_lt_self).antisymm
622655
(by
623656
by_contra! h
624657
have h := h.trans_eq (type_toType o).symm
625658
simpa [typein_enum] using lt_lsub.{u, u} (typein (· < ·)) (enum (· < ·) ⟨_, h⟩))
626659

660+
set_option linter.deprecated false in
661+
@[deprecated IsSuccPrelimit.sSup_Iio (since := "2026-03-27")]
627662
theorem iSup_typein_limit {o : Ordinal.{u}} (ho : ∀ a, a < o → succ a < o) :
628663
iSup (typein ((· < ·) : o.ToType → o.ToType → Prop)) = o := by
629664
rw [(iSup_eq_lsub_iff.{u, u} (typein (· < ·))).2] <;> rw [lsub_typein o]
630665
assumption
631666

632-
@[simp]
667+
@[deprecated csSup_Iic (since := "2026-03-27")]
633668
theorem iSup_typein_succ {o : Ordinal} :
634669
iSup (typein ((· < ·) : (succ o).ToType → (succ o).ToType → Prop)) = o := by
635670
rw [← csSup_Iic (a := o), iSup, PrincipalSeg.range_eq]
@@ -840,13 +875,18 @@ set_option linter.deprecated false in
840875
theorem blsub_id : ∀ o, (blsub.{u, u} o fun x _ => x) = o :=
841876
lsub_typein
842877

878+
set_option linter.deprecated false in
879+
@[deprecated IsSuccPrelimit.sSup_Iio (since := "2026-03-23")]
843880
theorem bsup_id_limit {o : Ordinal} : (∀ a < o, succ a < o) → (bsup.{u, u} o fun x _ => x) = o :=
844881
iSup_typein_limit
845882

846-
@[simp]
883+
set_option linter.deprecated false in
884+
@[deprecated csSup_Iic (since := "2026-03-23")]
847885
theorem bsup_id_add_one (o) : (bsup.{u, u} (o + 1) fun x _ => x) = o :=
848886
iSup_typein_succ
849887

888+
set_option linter.deprecated false in
889+
@[deprecated csSup_Iic (since := "2026-03-23")]
850890
theorem bsup_id_succ (o) : (bsup.{u, u} (succ o) fun x _ => x) = o :=
851891
iSup_typein_succ
852892

@@ -887,6 +927,7 @@ theorem blsub_comp {o o' : Ordinal.{max u v}} {f : ∀ a < o, Ordinal.{max u v w
887927
@bsup_comp.{u, v, w} o _ (fun a ha => succ (f a ha))
888928
(fun {_ _} _ _ h => succ_le_succ_iff.2 (hf _ _ h)) g hg
889929

930+
set_option linter.deprecated false in
890931
@[deprecated IsNormal.apply_of_isSuccLimit (since := "2026-03-23")]
891932
theorem IsNormal.bsup_eq {f : Ordinal.{u} → Ordinal.{max u v}} (H : IsNormal f) {o : Ordinal.{u}}
892933
(h : IsSuccLimit o) : (Ordinal.bsup.{_, v} o fun x _ => f x) = f o := by

0 commit comments

Comments
 (0)