Skip to content

Commit 227e3ba

Browse files
committed
chore: deprecate Ordinal.natCast_succNat.cast_add_one (#39643)
The eventual goal is to write `x + 1` instead of `succ x`.
1 parent fca9f6f commit 227e3ba

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

Mathlib/SetTheory/Cardinal/Aleph.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,7 @@ theorem isNormal_preBeth : Order.IsNormal preBeth := by
600600

601601
theorem preBeth_nat : ∀ n : ℕ, preBeth n = (2 ^ ·)^[n] (0 : ℕ)
602602
| 0 => by simp
603-
| n + 1 => by
604-
rw [natCast_succ, preBeth_succ, Function.iterate_succ_apply', preBeth_nat]
605-
simp
603+
| n + 1 => by simp [Function.iterate_succ_apply', preBeth_nat]
606604

607605
@[simp]
608606
theorem preBeth_one : preBeth 1 = 1 := by

Mathlib/SetTheory/Ordinal/Basic.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,8 +953,9 @@ protected theorem le_one_iff {a : Ordinal} : a ≤ 1 ↔ a = 0 ∨ a = 1 :=
953953
theorem card_succ (o : Ordinal) : card (succ o) = card o + 1 := by
954954
simp
955955

956+
@[deprecated Nat.cast_add_one (since := "2026-05-21")]
956957
theorem natCast_succ (n : ℕ) : ↑n.succ = succ (n : Ordinal) :=
957-
rfl
958+
n.cast_add_one
958959

959960
instance uniqueIioOne : Unique (Iio (1 : Ordinal)) where
960961
default := ⟨0, zero_lt_one' Ordinal⟩

Mathlib/SetTheory/Ordinal/Exponential.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,8 @@ theorem lt_omega0_opow {a b : Ordinal} (hb : b ≠ 0) :
490490
refine ⟨fun ha ↦ ⟨_, lt_log_of_lt_opow hb ha, ?_⟩,
491491
fun ⟨c, hc, n, hn⟩ ↦ hn.trans (omega0_opow_mul_nat_lt hc n)⟩
492492
obtain ⟨n, hn⟩ := lt_omega0.1 (div_opow_log_lt a one_lt_omega0)
493-
use n.succ
494-
rw [natCast_succ, ← hn]
493+
use n + 1
494+
rw [Nat.cast_add_one, ← hn]
495495
exact lt_mul_succ_div a (opow_ne_zero _ omega0_ne_zero)
496496

497497
theorem lt_omega0_opow_succ {a b : Ordinal} : a < ω ^ succ b ↔ ∃ n : ℕ, a < ω ^ b * n := by

Mathlib/SetTheory/Ordinal/Notation.lean

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ theorem repr_mul : ∀ (o₁ o₂) [NF o₁] [NF o₂], repr (o₁ * o₂) = rep
557557
· obtain ⟨x, xe⟩ := Nat.exists_eq_succ_of_ne_zero n₂.ne_zero
558558
simp only [Mul.mul, mul, e0, ↓reduceIte, repr, PNat.mul_coe, natCast_mul, opow_zero, one_mul]
559559
simp only [xe, h₂.zero_of_zero e0, repr, add_zero]
560-
rw [natCast_succ x, add_mul_succ _ ao, mul_assoc]
560+
rw [Nat.cast_add_one x, ← succ_eq_add_one, add_mul_succ _ ao, mul_assoc]
561561
· simp only [repr]
562562
haveI := h₁.fst
563563
haveI := h₂.fst
@@ -842,9 +842,10 @@ theorem repr_opow_aux₂ {a0 a'} [N0 : NF a0] [Na' : NF a'] (m : ℕ) (d : ω
842842
calc
843843
0 ^ (k.succ : Ordinal)) * α' + R'
844844
_ = (ω0 ^ succ (k : Ordinal)) * α' + ((ω0 ^ (k : Ordinal)) * α' * m + R) := by
845-
rw [natCast_succ, RR, ← mul_assoc]
845+
rw [Nat.cast_add_one, RR, ← mul_assoc, succ_eq_add_one]
846846
_ = ((ω0 ^ (k : Ordinal)) * α' + R) * α' + ((ω0 ^ (k : Ordinal)) * α' + R) * m := ?_
847-
_ = (α' + m) ^ succ (k.succ : Ordinal) := by rw [← mul_add, natCast_succ, opow_succ, IH.2]
847+
_ = (α' + m) ^ succ (k.succ : Ordinal) := by
848+
rw [← mul_add, opow_succ, Nat.cast_add_one, IH.2, succ_eq_add_one]
848849
congr 1
849850
· have αd : ω ∣ α' :=
850851
dvd_add (dvd_mul_of_dvd_left (by simpa using opow_dvd_opow ω (one_le_iff_ne_zero.2 e0)) _) d
@@ -865,7 +866,7 @@ theorem repr_opow_aux₂ {a0 a'} [N0 : NF a0] [Na' : NF a'] (m : ℕ) (d : ω
865866
· cases m
866867
· have : R = 0 := by cases k <;> simp [R, opowAux]
867868
simp [this]
868-
· rw [natCast_succ, add_mul_succ]
869+
· rw [Nat.cast_add_one, ← succ_eq_add_one, add_mul_succ]
869870
apply add_of_omega0_opow_le Rl
870871
rw [opow_mul, opow_succ]
871872
gcongr
@@ -1010,14 +1011,14 @@ theorem fundamentalSequence_has_prop (o) : FundamentalSequenceProp o (fundamenta
10101011
refine
10111012
⟨isSuccLimit_mul_right this isSuccLimit_omega0, fun i =>
10121013
⟨this, ?_, fun H => @NF.oadd_zero _ _ (iha.2 H.fst)⟩, exists_lt_mul_omega0'⟩
1013-
rw [← mul_succ, ← natCast_succ]
1014+
rw [← mul_add_one, ← Nat.cast_add_one]
10141015
gcongr
10151016
apply natCast_lt_omega0
10161017
· have := opow_pos (repr a') omega0_pos
10171018
refine
10181019
⟨isSuccLimit_add _ (isSuccLimit_mul_right this isSuccLimit_omega0), fun i => ⟨this, ?_, ?_⟩,
10191020
exists_lt_add exists_lt_mul_omega0'⟩
1020-
· rw [← mul_succ, ← natCast_succ]
1021+
· rw [← mul_add_one, ← Nat.cast_add_one]
10211022
gcongr
10221023
apply natCast_lt_omega0
10231024
· refine fun H => H.fst.oadd _ (NF.below_of_lt' ?_ (@NF.oadd_zero _ _ (iha.2 H.fst)))

0 commit comments

Comments
 (0)