l3lab/ntp-mathlib huggingface dataset:
@[simp, norm_cast]
theorem nat_cast_div (m n : ℕ) : ((m / n : ℕ) : Ordinal) = m / n := by
  rcases eq_or_ne n 0 with (rfl | hn)
  · simp
  · have hn' := nat_cast_ne_zero.2 hn
    apply le_antisymm
    · rw [le_div hn', ← nat_cast_mul, nat_cast_le, mul_comm]
      

Proof state:
case inr.a
m n : ℕ
hn : n ≠ 0
hn' : ↑n ≠ 0
⊢ m / n * n ≤ m

Next tactic:
apply Nat.div_mul_le_self
@[simp, norm_cast]
theorem nat_cast_div (m n : ℕ) : ((m / n : ℕ) : Ordinal) = m / n := by
  rcases eq_or_ne n 0 with (rfl | hn)
  · simp
  · have hn' := nat_cast_ne_zero.2 hn
    apply le_antisymm
    · rw [le_div hn', ← nat_cast_mul, nat_cast_le, mul_comm]
      apply Nat.div_mul_le_self
    · 

Proof state:
case inr.a
m n : ℕ
hn : n ≠ 0
hn' : ↑n ≠ 0
⊢ ↑m / ↑n ≤ ↑(m / n)

Next tactic:
rw [div_le hn', ← add_one_eq_succ, ← Nat.cast_succ, ← nat_cast_mul, nat_cast_lt, mul_comm, ←
        Nat.div_lt_iff_lt_mul (Nat.pos_of_ne_zero hn)]
@[simp, norm_cast]
theorem nat_cast_div (m n : ℕ) : ((m / n : ℕ) : Ordinal) = m / n := by
  rcases eq_or_ne n 0 with (rfl | hn)
  · simp
  · have hn' := nat_cast_ne_zero.2 hn
    apply le_antisymm
    · rw [le_div hn', ← nat_cast_mul, nat_cast_le, mul_comm]
      apply Nat.div_mul_le_self
    · rw [div_le hn', ← add_one_eq_succ, ← Nat.cast_succ, ← nat_cast_mul, nat_cast_lt, mul_comm, ←
        Nat.div_lt_iff_lt_mul (Nat.pos_of_ne_zero hn)]
      

Proof state:
case inr.a
m n : ℕ
hn : n ≠ 0
hn' : ↑n ≠ 0
⊢ m / n < Nat.succ (m / n)

Next tactic:
apply Nat.lt_succ_self
@[simp, norm_cast]
theorem nat_cast_mod (m n : ℕ) : ((m % n : ℕ) : Ordinal) = m % n := by
  

Proof state:
m n : ℕ
⊢ ↑(m % n) = ↑m % ↑n

Next tactic:
rw [← add_left_cancel, div_add_mod, ← nat_cast_div, ← nat_cast_mul, ← Nat.cast_add,
    Nat.div_add_mod]
@[simp]
theorem lift_nat_cast : ∀ n : ℕ, lift.{u, v} n = n
  | 0 => by 

Proof state:
⊢ lift.{u, v} ↑0 = ↑0

Next tactic:
simp
@[simp]
theorem lift_nat_cast : ∀ n : ℕ, lift.{u, v} n = n
  | 0 => by simp
  | n + 1 => by 

Proof state:
n : ℕ
⊢ lift.{u, v} ↑(n + 1) = ↑(n + 1)

Next tactic:
simp [lift_nat_cast n]
@[simp]
theorem ord_aleph0 : ord.{u} ℵ₀ = ω :=
  le_antisymm (ord_le.2 <| le_rfl) <|
    le_of_forall_lt fun o h => by
      

Proof state:
o : Ordinal.{u}
h : o < ω
⊢ o < ord ℵ₀

Next tactic:
rcases Ordinal.lt_lift_iff.1 h with ⟨o, rfl, h'⟩
@[simp]
theorem ord_aleph0 : ord.{u} ℵ₀ = ω :=
  le_antisymm (ord_le.2 <| le_rfl) <|
    le_of_forall_lt fun o h => by
      rcases Ordinal.lt_lift_iff.1 h with ⟨o, rfl, h'⟩
      

Proof state:
case intro.intro
o : Ordinal.{0}
h' : o < type fun x x_1 => x < x_1
h : Ordinal.lift.{u, 0} o < ω
⊢ Ordinal.lift.{u, 0} o < ord ℵ₀

Next tactic:
rw [lt_ord, ← lift_card, lift_lt_aleph0, ← typein_enum (· < ·) h']
@[simp]
theorem ord_aleph0 : ord.{u} ℵ₀ = ω :=
  le_antisymm (ord_le.2 <| le_rfl) <|
    le_of_forall_lt fun o h => by
      rcases Ordinal.lt_lift_iff.1 h with ⟨o, rfl, h'⟩
      rw [lt_ord, ← lift_card, lift_lt_aleph0, ← typein_enum (· < ·) h']
      

Proof state:
case intro.intro
o : Ordinal.{0}
h' : o < type fun x x_1 => x < x_1
h : Ordinal.lift.{u, 0} o < ω
⊢ card (typein (fun x x_1 => x < x_1) (enum (fun x x_1 => x < x_1) o h')) < ℵ₀

Next tactic:
exact lt_aleph0_iff_fintype.2 ⟨Set.fintypeLTNat _⟩
@[simp]
theorem add_one_of_aleph0_le {c} (h : ℵ₀ ≤ c) : c + 1 = c := by
  

Proof state:
c : Cardinal.{u_1}
h : ℵ₀ ≤ c
⊢ c + 1 = c

Next tactic:
rw [add_comm, ← card_ord c, ← card_one, ← card_add, one_add_of_omega_le]
@[simp]
theorem add_one_of_aleph0_le {c} (h : ℵ₀ ≤ c) : c + 1 = c := by
  rw [add_comm, ← card_ord c, ← card_one, ← card_add, one_add_of_omega_le]
  

Proof state:
c : Cardinal.{u_1}
h : ℵ₀ ≤ c
⊢ ω ≤ ord c

Next tactic:
rwa [← ord_aleph0, ord_le_ord]
theorem lt_add_of_limit {a b c : Ordinal.{u}} (h : IsLimit c) :
    a < b + c ↔ ∃ c' < c, a < b + c' := by
  -- Porting note: `bex_def` is required.
  

Proof state:
a b c : Ordinal.{u}
h : IsLimit c
⊢ a < b + c ↔ ∃ c' < c, a < b + c'

Next tactic:
rw [← IsNormal.bsup_eq.{u, u} (add_isNormal b) h, lt_bsup, bex_def]
theorem lt_omega {o : Ordinal} : o < ω ↔ ∃ n : ℕ, o = n := by
  

Proof state:
o : Ordinal.{u_1}
⊢ o < ω ↔ ∃ n, o = ↑n

Next tactic:
simp_rw [← Cardinal.ord_aleph0, Cardinal.lt_ord, lt_aleph0, card_eq_nat]
theorem one_lt_omega : 1 < ω := by 

Proof state:
⊢ 1 < ω

Next tactic:
simpa only [Nat.cast_one] using nat_lt_omega 1
theorem omega_isLimit : IsLimit ω :=
  ⟨omega_ne_zero, fun o h => by
    

Proof state:
o : Ordinal.{u_1}
h : o < ω
⊢ succ o < ω

Next tactic:
let ⟨n, e⟩ := lt_omega.1 h
theorem omega_isLimit : IsLimit ω :=
  ⟨omega_ne_zero, fun o h => by
    let ⟨n, e⟩ := lt_omega.1 h
    

Proof state:
o : Ordinal.{u_1}
h : o < ω
n : ℕ
e : o = ↑n
⊢ succ o < ω

Next tactic:
rw [e]
theorem omega_isLimit : IsLimit ω :=
  ⟨omega_ne_zero, fun o h => by
    let ⟨n, e⟩ := lt_omega.1 h
    rw [e]; 

Proof state:
o : Ordinal.{u_1}
h : o < ω
n : ℕ
e : o = ↑n
⊢ succ ↑n < ω

Next tactic:
exact nat_lt_omega (n + 1)
theorem omega_le {o : Ordinal} : ω ≤ o ↔ ∀ n : ℕ, ↑n ≤ o :=
  ⟨fun h n => (nat_lt_omega _).le.trans h, fun H =>
    le_of_forall_lt fun a h => by
      

Proof state:
o : Ordinal.{u_1}
H : ∀ (n : ℕ), ↑n ≤ o
a : Ordinal.{u_1}
h : a < ω
⊢ a < o

Next tactic:
let ⟨n, e⟩ := lt_omega.1 h
theorem omega_le {o : Ordinal} : ω ≤ o ↔ ∀ n : ℕ, ↑n ≤ o :=
  ⟨fun h n => (nat_lt_omega _).le.trans h, fun H =>
    le_of_forall_lt fun a h => by
      let ⟨n, e⟩ := lt_omega.1 h
      

Proof state:
o : Ordinal.{u_1}
H : ∀ (n : ℕ), ↑n ≤ o
a : Ordinal.{u_1}
h : a < ω
n : ℕ
e : a = ↑n
⊢ a < o

Next tactic:
rw [e, ← succ_le_iff]
theorem omega_le {o : Ordinal} : ω ≤ o ↔ ∀ n : ℕ, ↑n ≤ o :=
  ⟨fun h n => (nat_lt_omega _).le.trans h, fun H =>
    le_of_forall_lt fun a h => by
      let ⟨n, e⟩ := lt_omega.1 h
      rw [e, ← succ_le_iff]; 

Proof state:
o : Ordinal.{u_1}
H : ∀ (n : ℕ), ↑n ≤ o
a : Ordinal.{u_1}
h : a < ω
n : ℕ
e : a = ↑n
⊢ succ ↑n ≤ o

Next tactic:
exact H (n + 1)
theorem isLimit_iff_omega_dvd {a : Ordinal} : IsLimit a ↔ a ≠ 0 ∧ ω ∣ a := by
  

Proof state:
a : Ordinal.{u_1}
⊢ IsLimit a ↔ a ≠ 0 ∧ ω ∣ a

Next tactic:
refine' ⟨fun l => ⟨l.1, ⟨a / ω, le_antisymm _ (mul_div_le _ _)⟩⟩, fun h => _⟩
theorem isLimit_iff_omega_dvd {a : Ordinal} : IsLimit a ↔ a ≠ 0 ∧ ω ∣ a := by
  refine' ⟨fun l => ⟨l.1, ⟨a / ω, le_antisymm _ (mul_div_le _ _)⟩⟩, fun h => _⟩
  · 

Proof state:
case refine'_1
a : Ordinal.{u_1}
l : IsLimit a
⊢ a ≤ ω * (a / ω)

Next tactic:
refine' (limit_le l).2 fun x hx => le_of_lt _
theorem isLimit_iff_omega_dvd {a : Ordinal} : IsLimit a ↔ a ≠ 0 ∧ ω ∣ a := by
  refine' ⟨fun l => ⟨l.1, ⟨a / ω, le_antisymm _ (mul_div_le _ _)⟩⟩, fun h => _⟩
  · refine' (limit_le l).2 fun x hx => le_of_lt _
    

Proof state:
case refine'_1
a : Ordinal.{u_1}
l : IsLimit a
x : Ordinal.{u_1}
hx : x < a
⊢ x < ω * (a / ω)

Next tactic:
rw [← div_lt omega_ne_zero, ← succ_le_iff, le_div omega_ne_zero, mul_succ,
      add_le_of_limit omega_isLimit]
theorem isLimit_iff_omega_dvd {a : Ordinal} : IsLimit a ↔ a ≠ 0 ∧ ω ∣ a := by
  refine' ⟨fun l => ⟨l.1, ⟨a / ω, le_antisymm _ (mul_div_le _ _)⟩⟩, fun h => _⟩
  · refine' (limit_le l).2 fun x hx => le_of_lt _
    rw [← div_lt omega_ne_zero, ← succ_le_iff, le_div omega_ne_zero, mul_succ,
      add_le_of_limit omega_isLimit]
    

Proof state:
case refine'_1
a : Ordinal.{u_1}
l : IsLimit a
x : Ordinal.{u_1}
hx : x < a
⊢ ∀ b' < ω, ω * (x / ω) + b' ≤ a

Next tactic:
intro b hb
theorem isLimit_iff_omega_dvd {a : Ordinal} : IsLimit a ↔ a ≠ 0 ∧ ω ∣ a := by
  refine' ⟨fun l => ⟨l.1, ⟨a / ω, le_antisymm _ (mul_div_le _ _)⟩⟩, fun h => _⟩
  · refine' (limit_le l).2 fun x hx => le_of_lt _
    rw [← div_lt omega_ne_zero, ← succ_le_iff, le_div omega_ne_zero, mul_succ,
      add_le_of_limit omega_isLimit]
    intro b hb
    

Proof state:
case refine'_1
a : Ordinal.{u_1}
l : IsLimit a
x : Ordinal.{u_1}
hx : x < a
b : Ordinal.{u_1}
hb : b < ω
⊢ ω * (x / ω) + b ≤ a

Next tactic:
rcases lt_omega.1 hb with ⟨n, rfl⟩
theorem isLimit_iff_omega_dvd {a : Ordinal} : IsLimit a ↔ a ≠ 0 ∧ ω ∣ a := by
  refine' ⟨fun l => ⟨l.1, ⟨a / ω, le_antisymm _ (mul_div_le _ _)⟩⟩, fun h => _⟩
  · refine' (limit_le l).2 fun x hx => le_of_lt _
    rw [← div_lt omega_ne_zero, ← succ_le_iff, le_div omega_ne_zero, mul_succ,
      add_le_of_limit omega_isLimit]
    intro b hb
    rcases lt_omega.1 hb with ⟨n, rfl⟩
    

Proof state:
case refine'_1.intro
a : Ordinal.{u_1}
l : IsLimit a
x : Ordinal.{u_1}
hx : x < a
n : ℕ
hb : ↑n < ω
⊢ ω * (x / ω) + ↑n ≤ a

Next tactic:
exact
      (add_le_add_right (mul_div_le _ _) _).trans
        (lt_sub.1 <| nat_lt_limit (sub_isLimit l hx) _).le
theorem isLimit_iff_omega_dvd {a : Ordinal} : IsLimit a ↔ a ≠ 0 ∧ ω ∣ a := by
  refine' ⟨fun l => ⟨l.1, ⟨a / ω, le_antisymm _ (mul_div_le _ _)⟩⟩, fun h => _⟩
  · refine' (limit_le l).2 fun x hx => le_of_lt _
    rw [← div_lt omega_ne_zero, ← succ_le_iff, le_div omega_ne_zero, mul_succ,
      add_le_of_limit omega_isLimit]
    intro b hb
    rcases lt_omega.1 hb with ⟨n, rfl⟩
    exact
      (add_le_add_right (mul_div_le _ _) _).trans
        (lt_sub.1 <| nat_lt_limit (sub_isLimit l hx) _).le
  · 

Proof state:
case refine'_2
a : Ordinal.{u_1}
h : a ≠ 0 ∧ ω ∣ a
⊢ IsLimit a

Next tactic:
rcases h with ⟨a0, b, rfl⟩
theorem isLimit_iff_omega_dvd {a : Ordinal} : IsLimit a ↔ a ≠ 0 ∧ ω ∣ a := by
  refine' ⟨fun l => ⟨l.1, ⟨a / ω, le_antisymm _ (mul_div_le _ _)⟩⟩, fun h => _⟩
  · refine' (limit_le l).2 fun x hx => le_of_lt _
    rw [← div_lt omega_ne_zero, ← succ_le_iff, le_div omega_ne_zero, mul_succ,
      add_le_of_limit omega_isLimit]
    intro b hb
    rcases lt_omega.1 hb with ⟨n, rfl⟩
    exact
      (add_le_add_right (mul_div_le _ _) _).trans
        (lt_sub.1 <| nat_lt_limit (sub_isLimit l hx) _).le
  · rcases h with ⟨a0, b, rfl⟩
    

Proof state:
case refine'_2.intro.intro
b : Ordinal.{u_1}
a0 : ω * b ≠ 0
⊢ IsLimit (ω * b)

Next tactic:
refine' mul_isLimit_left omega_isLimit (Ordinal.pos_iff_ne_zero.2 <| mt _ a0)
theorem isLimit_iff_omega_dvd {a : Ordinal} : IsLimit a ↔ a ≠ 0 ∧ ω ∣ a := by
  refine' ⟨fun l => ⟨l.1, ⟨a / ω, le_antisymm _ (mul_div_le _ _)⟩⟩, fun h => _⟩
  · refine' (limit_le l).2 fun x hx => le_of_lt _
    rw [← div_lt omega_ne_zero, ← succ_le_iff, le_div omega_ne_zero, mul_succ,
      add_le_of_limit omega_isLimit]
    intro b hb
    rcases lt_omega.1 hb with ⟨n, rfl⟩
    exact
      (add_le_add_right (mul_div_le _ _) _).trans
        (lt_sub.1 <| nat_lt_limit (sub_isLimit l hx) _).le
  · rcases h with ⟨a0, b, rfl⟩
    refine' mul_isLimit_left omega_isLimit (Ordinal.pos_iff_ne_zero.2 <| mt _ a0)
    

Proof state:
case refine'_2.intro.intro
b : Ordinal.{u_1}
a0 : ω * b ≠ 0
⊢ b = 0 → ω * b = 0

Next tactic:
intro e
theorem isLimit_iff_omega_dvd {a : Ordinal} : IsLimit a ↔ a ≠ 0 ∧ ω ∣ a := by
  refine' ⟨fun l => ⟨l.1, ⟨a / ω, le_antisymm _ (mul_div_le _ _)⟩⟩, fun h => _⟩
  · refine' (limit_le l).2 fun x hx => le_of_lt _
    rw [← div_lt omega_ne_zero, ← succ_le_iff, le_div omega_ne_zero, mul_succ,
      add_le_of_limit omega_isLimit]
    intro b hb
    rcases lt_omega.1 hb with ⟨n, rfl⟩
    exact
      (add_le_add_right (mul_div_le _ _) _).trans
        (lt_sub.1 <| nat_lt_limit (sub_isLimit l hx) _).le
  · rcases h with ⟨a0, b, rfl⟩
    refine' mul_isLimit_left omega_isLimit (Ordinal.pos_iff_ne_zero.2 <| mt _ a0)
    intro e
    

Proof state:
case refine'_2.intro.intro
b : Ordinal.{u_1}
a0 : ω * b ≠ 0
e : b = 0
⊢ ω * b = 0

Next tactic:
simp only [e, mul_zero]
theorem add_mul_limit_aux {a b c : Ordinal} (ba : b + a = a) (l : IsLimit c)
    (IH : ∀ c' < c, (a + b) * succ c' = a * succ c' + b) : (a + b) * c = a * c :=
  le_antisymm
    ((mul_le_of_limit l).2 fun c' h => by
      

Proof state:
a b c : Ordinal.{u_1}
ba : b + a = a
l : IsLimit c
IH : ∀ c' < c, (a + b) * succ c' = a * succ c' + b
c' : Ordinal.{u_1}
h : c' < c
⊢ (a + b) * c' ≤ a * c

Next tactic:
apply (mul_le_mul_left' (le_succ c') _).trans
theorem add_mul_limit_aux {a b c : Ordinal} (ba : b + a = a) (l : IsLimit c)
    (IH : ∀ c' < c, (a + b) * succ c' = a * succ c' + b) : (a + b) * c = a * c :=
  le_antisymm
    ((mul_le_of_limit l).2 fun c' h => by
      apply (mul_le_mul_left' (le_succ c') _).trans
      

Proof state:
a b c : Ordinal.{u_1}
ba : b + a = a
l : IsLimit c
IH : ∀ c' < c, (a + b) * succ c' = a * succ c' + b
c' : Ordinal.{u_1}
h : c' < c
⊢ (a + b) * succ c' ≤ a * c

Next tactic:
rw [IH _ h]
theorem add_mul_limit_aux {a b c : Ordinal} (ba : b + a = a) (l : IsLimit c)
    (IH : ∀ c' < c, (a + b) * succ c' = a * succ c' + b) : (a + b) * c = a * c :=
  le_antisymm
    ((mul_le_of_limit l).2 fun c' h => by
      apply (mul_le_mul_left' (le_succ c') _).trans
      rw [IH _ h]
      

Proof state:
a b c : Ordinal.{u_1}
ba : b + a = a
l : IsLimit c
IH : ∀ c' < c, (a + b) * succ c' = a * succ c' + b
c' : Ordinal.{u_1}
h : c' < c
⊢ a * succ c' + b ≤ a * c

Next tactic:
apply (add_le_add_left _ _).trans
theorem add_mul_limit_aux {a b c : Ordinal} (ba : b + a = a) (l : IsLimit c)
    (IH : ∀ c' < c, (a + b) * succ c' = a * succ c' + b) : (a + b) * c = a * c :=
  le_antisymm
    ((mul_le_of_limit l).2 fun c' h => by
      apply (mul_le_mul_left' (le_succ c') _).trans
      rw [IH _ h]
      apply (add_le_add_left _ _).trans
      · 

Proof state:
a b c : Ordinal.{u_1}
ba : b + a = a
l : IsLimit c
IH : ∀ c' < c, (a + b) * succ c' = a * succ c' + b
c' : Ordinal.{u_1}
h : c' < c
⊢ a * succ c' + ?m.435402 ≤ a * c

Next tactic:
rw [← mul_succ]
theorem add_mul_limit_aux {a b c : Ordinal} (ba : b + a = a) (l : IsLimit c)
    (IH : ∀ c' < c, (a + b) * succ c' = a * succ c' + b) : (a + b) * c = a * c :=
  le_antisymm
    ((mul_le_of_limit l).2 fun c' h => by
      apply (mul_le_mul_left' (le_succ c') _).trans
      rw [IH _ h]
      apply (add_le_add_left _ _).trans
      · rw [← mul_succ]
        

Proof state:
a b c : Ordinal.{u_1}
ba : b + a = a
l : IsLimit c
IH : ∀ c' < c, (a + b) * succ c' = a * succ c' + b
c' : Ordinal.{u_1}
h : c' < c
⊢ a * succ (succ c') ≤ a * c

Next tactic:
exact mul_le_mul_left' (succ_le_of_lt <| l.2 _ h) _
theorem add_mul_limit_aux {a b c : Ordinal} (ba : b + a = a) (l : IsLimit c)
    (IH : ∀ c' < c, (a + b) * succ c' = a * succ c' + b) : (a + b) * c = a * c :=
  le_antisymm
    ((mul_le_of_limit l).2 fun c' h => by
      apply (mul_le_mul_left' (le_succ c') _).trans
      rw [IH _ h]
      apply (add_le_add_left _ _).trans
      · rw [← mul_succ]
        exact mul_le_mul_left' (succ_le_of_lt <| l.2 _ h) _
      · 

Proof state:
a b c : Ordinal.{u_1}
ba : b + a = a
l : IsLimit c
IH : ∀ c' < c, (a + b) * succ c' = a * succ c' + b
c' : Ordinal.{u_1}
h : c' < c
⊢ b ≤ a

Next tactic:
rw [← ba]
theorem add_mul_limit_aux {a b c : Ordinal} (ba : b + a = a) (l : IsLimit c)
    (IH : ∀ c' < c, (a + b) * succ c' = a * succ c' + b) : (a + b) * c = a * c :=
  le_antisymm
    ((mul_le_of_limit l).2 fun c' h => by
      apply (mul_le_mul_left' (le_succ c') _).trans
      rw [IH _ h]
      apply (add_le_add_left _ _).trans
      · rw [← mul_succ]
        exact mul_le_mul_left' (succ_le_of_lt <| l.2 _ h) _
      · rw [← ba]
        

Proof state:
a b c : Ordinal.{u_1}
ba : b + a = a
l : IsLimit c
IH : ∀ c' < c, (a + b) * succ c' = a * succ c' + b
c' : Ordinal.{u_1}
h : c' < c
⊢ b ≤ b + a

Next tactic:
exact le_add_right _ _
theorem add_mul_succ {a b : Ordinal} (c) (ba : b + a = a) : (a + b) * succ c = a * succ c + b := by
  

Proof state:
a b c : Ordinal.{u_1}
ba : b + a = a
⊢ (a + b) * succ c = a * succ c + b

Next tactic:
induction c using limitRecOn with
  | H₁ => simp only [succ_zero, mul_one]
  | H₂ c IH =>
    rw [mul_succ, IH, ← add_assoc, add_assoc _ b, ba, ← mul_succ]
  | H₃ c l IH =>
    -- Porting note: Unused.
    -- have := add_mul_limit_aux ba l IH
    rw [mul_succ, add_mul_limit_aux ba l IH, mul_succ, add_assoc]
theorem add_mul_succ {a b : Ordinal} (c) (ba : b + a = a) : (a + b) * succ c = a * succ c + b := by
  induction c using limitRecOn with
  

Proof state:
case H₁
a b : Ordinal.{u_1}
ba : b + a = a
⊢ (a + b) * succ 0 = a * succ 0 + b

Next tactic:
| H₁ => simp only [succ_zero, mul_one]
theorem add_mul_succ {a b : Ordinal} (c) (ba : b + a = a) : (a + b) * succ c = a * succ c + b := by
  induction c using limitRecOn with
  | H₁ => 

Proof state:
case H₁
a b : Ordinal.{u_1}
ba : b + a = a
⊢ (a + b) * succ 0 = a * succ 0 + b

Next tactic:
simp only [succ_zero, mul_one]
theorem add_mul_succ {a b : Ordinal} (c) (ba : b + a = a) : (a + b) * succ c = a * succ c + b := by
  induction c using limitRecOn with
  | H₁ => simp only [succ_zero, mul_one]
  

Proof state:
case H₂
a b : Ordinal.{u_1}
ba : b + a = a
c : Ordinal.{u_1}
IH : (a + b) * succ c = a * succ c + b
⊢ (a + b) * succ (succ c) = a * succ (succ c) + b

Next tactic:
| H₂ c IH =>
    rw [mul_succ, IH, ← add_assoc, add_assoc _ b, ba, ← mul_succ]
theorem add_mul_succ {a b : Ordinal} (c) (ba : b + a = a) : (a + b) * succ c = a * succ c + b := by
  induction c using limitRecOn with
  | H₁ => simp only [succ_zero, mul_one]
  | H₂ c IH =>
    

Proof state:
case H₂
a b : Ordinal.{u_1}
ba : b + a = a
c : Ordinal.{u_1}
IH : (a + b) * succ c = a * succ c + b
⊢ (a + b) * succ (succ c) = a * succ (succ c) + b

Next tactic:
rw [mul_succ, IH, ← add_assoc, add_assoc _ b, ba, ← mul_succ]
theorem add_mul_succ {a b : Ordinal} (c) (ba : b + a = a) : (a + b) * succ c = a * succ c + b := by
  induction c using limitRecOn with
  | H₁ => simp only [succ_zero, mul_one]
  | H₂ c IH =>
    rw [mul_succ, IH, ← add_assoc, add_assoc _ b, ba, ← mul_succ]
  

Proof state:
case H₃
a b : Ordinal.{u_1}
ba : b + a = a
c : Ordinal.{u_1}
l : IsLimit c
IH : ∀ o' < c, (a + b) * succ o' = a * succ o' + b
⊢ (a + b) * succ c = a * succ c + b

Next tactic:
| H₃ c l IH =>
    -- Porting note: Unused.
    -- have := add_mul_limit_aux ba l IH
    rw [mul_succ, add_mul_limit_aux ba l IH, mul_succ, add_assoc]
theorem add_mul_succ {a b : Ordinal} (c) (ba : b + a = a) : (a + b) * succ c = a * succ c + b := by
  induction c using limitRecOn with
  | H₁ => simp only [succ_zero, mul_one]
  | H₂ c IH =>
    rw [mul_succ, IH, ← add_assoc, add_assoc _ b, ba, ← mul_succ]
  | H₃ c l IH =>
    -- Porting note: Unused.
    -- have := add_mul_limit_aux ba l IH
    

Proof state:
case H₃
a b : Ordinal.{u_1}
ba : b + a = a
c : Ordinal.{u_1}
l : IsLimit c
IH : ∀ o' < c, (a + b) * succ o' = a * succ o' + b
⊢ (a + b) * succ c = a * succ c + b

Next tactic:
rw [mul_succ, add_mul_limit_aux ba l IH, mul_succ, add_assoc]
theorem add_le_of_forall_add_lt {a b c : Ordinal} (hb : 0 < b) (h : ∀ d < b, a + d < c) :
    a + b ≤ c := by
  

Proof state:
a b c : Ordinal.{u_1}
hb : 0 < b
h : ∀ d < b, a + d < c
⊢ a + b ≤ c

Next tactic:
have H : a + (c - a) = c :=
    Ordinal.add_sub_cancel_of_le
      (by
        rw [← add_zero a]
        exact (h _ hb).le)
theorem add_le_of_forall_add_lt {a b c : Ordinal} (hb : 0 < b) (h : ∀ d < b, a + d < c) :
    a + b ≤ c := by
  have H : a + (c - a) = c :=
    Ordinal.add_sub_cancel_of_le
      (by
        

Proof state:
a b c : Ordinal.{u_1}
hb : 0 < b
h : ∀ d < b, a + d < c
⊢ a ≤ c

Next tactic:
rw [← add_zero a]
theorem add_le_of_forall_add_lt {a b c : Ordinal} (hb : 0 < b) (h : ∀ d < b, a + d < c) :
    a + b ≤ c := by
  have H : a + (c - a) = c :=
    Ordinal.add_sub_cancel_of_le
      (by
        rw [← add_zero a]
        

Proof state:
a b c : Ordinal.{u_1}
hb : 0 < b
h : ∀ d < b, a + d < c
⊢ a + 0 ≤ c

Next tactic:
exact (h _ hb).le
theorem add_le_of_forall_add_lt {a b c : Ordinal} (hb : 0 < b) (h : ∀ d < b, a + d < c) :
    a + b ≤ c := by
  have H : a + (c - a) = c :=
    Ordinal.add_sub_cancel_of_le
      (by
        rw [← add_zero a]
        exact (h _ hb).le)
  

Proof state:
a b c : Ordinal.{u_1}
hb : 0 < b
h : ∀ d < b, a + d < c
H : a + (c - a) = c
⊢ a + b ≤ c

Next tactic:
rw [← H]
theorem add_le_of_forall_add_lt {a b c : Ordinal} (hb : 0 < b) (h : ∀ d < b, a + d < c) :
    a + b ≤ c := by
  have H : a + (c - a) = c :=
    Ordinal.add_sub_cancel_of_le
      (by
        rw [← add_zero a]
        exact (h _ hb).le)
  rw [← H]
  

Proof state:
a b c : Ordinal.{u_1}
hb : 0 < b
h : ∀ d < b, a + d < c
H : a + (c - a) = c
⊢ a + b ≤ a + (c - a)

Next tactic:
apply add_le_add_left _ a
theorem add_le_of_forall_add_lt {a b c : Ordinal} (hb : 0 < b) (h : ∀ d < b, a + d < c) :
    a + b ≤ c := by
  have H : a + (c - a) = c :=
    Ordinal.add_sub_cancel_of_le
      (by
        rw [← add_zero a]
        exact (h _ hb).le)
  rw [← H]
  apply add_le_add_left _ a
  

Proof state:
a b c : Ordinal.{u_1}
hb : 0 < b
h : ∀ d < b, a + d < c
H : a + (c - a) = c
⊢ b ≤ c - a

Next tactic:
by_contra! hb
theorem add_le_of_forall_add_lt {a b c : Ordinal} (hb : 0 < b) (h : ∀ d < b, a + d < c) :
    a + b ≤ c := by
  have H : a + (c - a) = c :=
    Ordinal.add_sub_cancel_of_le
      (by
        rw [← add_zero a]
        exact (h _ hb).le)
  rw [← H]
  apply add_le_add_left _ a
  by_contra! hb
  

Proof state:
a b c : Ordinal.{u_1}
hb✝ : 0 < b
h : ∀ d < b, a + d < c
H : a + (c - a) = c
hb : c - a < b
⊢ False

Next tactic:
exact (h _ hb).ne H
theorem IsNormal.apply_omega {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f) :
    Ordinal.sup.{0, u} (f ∘ Nat.cast) = f ω := by 

Proof state:
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
⊢ Ordinal.sup (f ∘ Nat.cast) = f ω

Next tactic:
rw [← sup_nat_cast, IsNormal.sup.{0, u, u} hf]
@[simp]
theorem sup_mul_nat (o : Ordinal) : (sup fun n : ℕ => o * n) = o * ω := by
  

Proof state:
o : Ordinal.{u_1}
⊢ (sup fun n => o * ↑n) = o * ω

Next tactic:
rcases eq_zero_or_pos o with (rfl | ho)
@[simp]
theorem sup_mul_nat (o : Ordinal) : (sup fun n : ℕ => o * n) = o * ω := by
  rcases eq_zero_or_pos o with (rfl | ho)
  · 

Proof state:
case inl
⊢ (sup fun n => 0 * ↑n) = 0 * ω

Next tactic:
rw [zero_mul]
@[simp]
theorem sup_mul_nat (o : Ordinal) : (sup fun n : ℕ => o * n) = o * ω := by
  rcases eq_zero_or_pos o with (rfl | ho)
  · rw [zero_mul]
    

Proof state:
case inl
⊢ (sup fun n => 0 * ↑n) = 0

Next tactic:
exact sup_eq_zero_iff.2 fun n => zero_mul (n : Ordinal)
@[simp]
theorem sup_mul_nat (o : Ordinal) : (sup fun n : ℕ => o * n) = o * ω := by
  rcases eq_zero_or_pos o with (rfl | ho)
  · rw [zero_mul]
    exact sup_eq_zero_iff.2 fun n => zero_mul (n : Ordinal)
  · 

Proof state:
case inr
o : Ordinal.{u_1}
ho : 0 < o
⊢ (sup fun n => o * ↑n) = o * ω

Next tactic:
exact (mul_isNormal ho).apply_omega
theorem rank_eq (h : Acc r a) :
    h.rank = Ordinal.sup.{u, u} fun b : { b // r b a } => Order.succ (h.inv b.2).rank := by
  

Proof state:
α : Type u
r : α → α → Prop
a b : α
h : Acc r a
⊢ rank h = sup fun b => succ (rank (_ : Acc r ↑b))

Next tactic:
change (Acc.intro a fun _ => h.inv).rank = _
theorem rank_eq (h : Acc r a) :
    h.rank = Ordinal.sup.{u, u} fun b : { b // r b a } => Order.succ (h.inv b.2).rank := by
  change (Acc.intro a fun _ => h.inv).rank = _
  

Proof state:
α : Type u
r : α → α → Prop
a b : α
h : Acc r a
⊢ rank (_ : Acc (fun x => r x) a) = sup fun b => succ (rank (_ : Acc r ↑b))

Next tactic:
rfl
/-- if `r a b` then the rank of `a` is less than the rank of `b`. -/
theorem rank_lt_of_rel (hb : Acc r b) (h : r a b) : (hb.inv h).rank < hb.rank :=
  (Order.lt_succ _).trans_le <| by
    

Proof state:
α : Type u
r : α → α → Prop
a b : α
hb : Acc r b
h : r a b
⊢ succ (rank (_ : Acc r a)) ≤ rank hb

Next tactic:
rw [hb.rank_eq]
/-- if `r a b` then the rank of `a` is less than the rank of `b`. -/
theorem rank_lt_of_rel (hb : Acc r b) (h : r a b) : (hb.inv h).rank < hb.rank :=
  (Order.lt_succ _).trans_le <| by
    rw [hb.rank_eq]
    

Proof state:
α : Type u
r : α → α → Prop
a b : α
hb : Acc r b
h : r a b
⊢ succ (rank (_ : Acc r a)) ≤ sup fun b_1 => succ (rank (_ : Acc r ↑b_1))

Next tactic:
refine' le_trans _ (Ordinal.le_sup _ ⟨a, h⟩)
/-- if `r a b` then the rank of `a` is less than the rank of `b`. -/
theorem rank_lt_of_rel (hb : Acc r b) (h : r a b) : (hb.inv h).rank < hb.rank :=
  (Order.lt_succ _).trans_le <| by
    rw [hb.rank_eq]
    refine' le_trans _ (Ordinal.le_sup _ ⟨a, h⟩)
    

Proof state:
α : Type u
r : α → α → Prop
a b : α
hb : Acc r b
h : r a b
⊢ succ (rank (_ : Acc r a)) ≤ succ (rank (_ : Acc r ↑{ val := a, property := h }))

Next tactic:
rfl
theorem rank_eq :
    hwf.rank a = Ordinal.sup.{u, u} fun b : { b // r b a } => Order.succ <| hwf.rank b := by
  

Proof state:
α : Type u
r : α → α → Prop
a b : α
hwf : WellFounded r
⊢ rank hwf a = sup fun b => succ (rank hwf ↑b)

Next tactic:
rw [rank, Acc.rank_eq]