l3lab/ntp-mathlib huggingface dataset:
set_option linter.unusedVariables false in
theorem repr_opow_aux₂ {a0 a'} [N0 : NF a0] [Na' : NF a'] (m : ℕ) (d : ω ∣ repr a')
    (e0 : repr a0 ≠ 0) (h : repr a' + m < (ω ^ repr a0)) (n : ℕ+) (k : ℕ) :
    let R := repr (opowAux 0 a0 (oadd a0 n a' * ofNat m) k m)
    (k ≠ 0 → R < ((ω ^ repr a0) ^ succ (k : Ordinal))) ∧
      ((ω ^ repr a0) ^ (k : Ordinal)) * ((ω ^ repr a0) * (n : ℕ) + repr a') + R =
        ((ω ^ repr a0) * (n : ℕ) + repr a' + m) ^ succ (k : Ordinal) := by
  intro R'
  haveI No : NF (oadd a0 n a') :=
    N0.oadd n (Na'.below_of_lt' <| lt_of_le_of_lt (le_add_right _ _) h)
  induction' k with k IH
  · cases m <;> simp [opowAux]
  -- rename R => R'
  let R := repr (opowAux 0 a0 (oadd a0 n a' * ofNat m) k m)
  let ω0 := ω ^ repr a0
  let α' := ω0 * n + repr a'
  change (k ≠ 0 → R < (ω0 ^ succ (k : Ordinal))) ∧ (ω0 ^ (k : Ordinal)) * α' + R
    = (α' + m) ^ (succ ↑k : Ordinal) at IH
  have RR : R' = ω0 ^ (k : Ordinal) * (α' * m) + R := by
    by_cases h : m = 0
    · simp only [h, ONote.ofNat, Nat.cast_zero, zero_add, ONote.repr, mul_zero, ONote.opowAux,
        add_zero]
    · simp only [ONote.repr_scale, ONote.repr, ONote.mulNat_eq_mul, ONote.opowAux, ONote.repr_ofNat,
        ONote.repr_mul, ONote.repr_add, Ordinal.opow_mul, ONote.zero_add]
  have α0 : 0 < α' := by simpa [lt_def, repr] using oadd_pos a0 n a'
  have ω00 : 0 < ω0 ^ (k : Ordinal) := opow_pos _ (opow_pos _ omega_pos)
  have Rl : R < ω ^ (repr a0 * succ ↑k) := by
    by_cases k0 : k = 0
    · simp [k0]
      refine' lt_of_lt_of_le _ (opow_le_opow_right omega_pos (one_le_iff_ne_zero.2 e0))
      cases' m with m <;> simp [opowAux, omega_pos]
      rw [← add_one_eq_succ, ← Nat.cast_succ]
      apply nat_lt_omega
    · rw [opow_mul]
      exact IH.1 k0
  refine' ⟨fun _ => _, _⟩
  · rw [RR, ← opow_mul _ _ (succ k.succ)]
    have e0 := Ordinal.pos_iff_ne_zero.2 e0
    have rr0 : 0 < repr a0 + repr a0 := lt_of_lt_of_le e0 (le_add_left _ _)
    apply principal_add_omega_opow
    · simp [opow_mul, opow_add, mul_assoc]
      rw [Ordinal.mul_lt_mul_iff_left ω00, ← Ordinal.opow_add]
      have : _ < ω ^ (repr a0 + repr a0) := (No.below_of_lt ?_).repr_lt
      refine' mul_lt_omega_opow rr0 this (nat_lt_omega _)
      

Proof state:
case succ.refine'_1.a.refine_1
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0✝ : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
No : NF (oadd a0 n a')
k : ℕ
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) (Nat.succ k) m)
R : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k m)
ω0 : Ordinal.{0} := ω ^ repr a0
α' : Ordinal.{0} := ω0 * ↑↑n + repr a'
IH : (k ≠ 0 → R < ω0 ^ succ ↑k) ∧ ω0 ^ ↑k * α' + R = (α' + ↑m) ^ succ ↑k
RR : R' = ω0 ^ ↑k * (α' * ↑m) + R
α0 : 0 < α'
ω00 : 0 < ω0 ^ ↑k
Rl : R < ω ^ (repr a0 * succ ↑k)
x✝ : Nat.succ k ≠ 0
e0 : 0 < repr a0
rr0 : 0 < repr a0 + repr a0
⊢ repr a0 < repr a0 + repr a0

Next tactic:
simpa using (add_lt_add_iff_left (repr a0)).2 e0
set_option linter.unusedVariables false in
theorem repr_opow_aux₂ {a0 a'} [N0 : NF a0] [Na' : NF a'] (m : ℕ) (d : ω ∣ repr a')
    (e0 : repr a0 ≠ 0) (h : repr a' + m < (ω ^ repr a0)) (n : ℕ+) (k : ℕ) :
    let R := repr (opowAux 0 a0 (oadd a0 n a' * ofNat m) k m)
    (k ≠ 0 → R < ((ω ^ repr a0) ^ succ (k : Ordinal))) ∧
      ((ω ^ repr a0) ^ (k : Ordinal)) * ((ω ^ repr a0) * (n : ℕ) + repr a') + R =
        ((ω ^ repr a0) * (n : ℕ) + repr a' + m) ^ succ (k : Ordinal) := by
  intro R'
  haveI No : NF (oadd a0 n a') :=
    N0.oadd n (Na'.below_of_lt' <| lt_of_le_of_lt (le_add_right _ _) h)
  induction' k with k IH
  · cases m <;> simp [opowAux]
  -- rename R => R'
  let R := repr (opowAux 0 a0 (oadd a0 n a' * ofNat m) k m)
  let ω0 := ω ^ repr a0
  let α' := ω0 * n + repr a'
  change (k ≠ 0 → R < (ω0 ^ succ (k : Ordinal))) ∧ (ω0 ^ (k : Ordinal)) * α' + R
    = (α' + m) ^ (succ ↑k : Ordinal) at IH
  have RR : R' = ω0 ^ (k : Ordinal) * (α' * m) + R := by
    by_cases h : m = 0
    · simp only [h, ONote.ofNat, Nat.cast_zero, zero_add, ONote.repr, mul_zero, ONote.opowAux,
        add_zero]
    · simp only [ONote.repr_scale, ONote.repr, ONote.mulNat_eq_mul, ONote.opowAux, ONote.repr_ofNat,
        ONote.repr_mul, ONote.repr_add, Ordinal.opow_mul, ONote.zero_add]
  have α0 : 0 < α' := by simpa [lt_def, repr] using oadd_pos a0 n a'
  have ω00 : 0 < ω0 ^ (k : Ordinal) := opow_pos _ (opow_pos _ omega_pos)
  have Rl : R < ω ^ (repr a0 * succ ↑k) := by
    by_cases k0 : k = 0
    · simp [k0]
      refine' lt_of_lt_of_le _ (opow_le_opow_right omega_pos (one_le_iff_ne_zero.2 e0))
      cases' m with m <;> simp [opowAux, omega_pos]
      rw [← add_one_eq_succ, ← Nat.cast_succ]
      apply nat_lt_omega
    · rw [opow_mul]
      exact IH.1 k0
  refine' ⟨fun _ => _, _⟩
  · rw [RR, ← opow_mul _ _ (succ k.succ)]
    have e0 := Ordinal.pos_iff_ne_zero.2 e0
    have rr0 : 0 < repr a0 + repr a0 := lt_of_lt_of_le e0 (le_add_left _ _)
    apply principal_add_omega_opow
    · simp [opow_mul, opow_add, mul_assoc]
      rw [Ordinal.mul_lt_mul_iff_left ω00, ← Ordinal.opow_add]
      have : _ < ω ^ (repr a0 + repr a0) := (No.below_of_lt ?_).repr_lt
      refine' mul_lt_omega_opow rr0 this (nat_lt_omega _)
      simpa using (add_lt_add_iff_left (repr a0)).2 e0
    · 

Proof state:
case succ.refine'_1.a
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0✝ : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
No : NF (oadd a0 n a')
k : ℕ
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) (Nat.succ k) m)
R : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k m)
ω0 : Ordinal.{0} := ω ^ repr a0
α' : Ordinal.{0} := ω0 * ↑↑n + repr a'
IH : (k ≠ 0 → R < ω0 ^ succ ↑k) ∧ ω0 ^ ↑k * α' + R = (α' + ↑m) ^ succ ↑k
RR : R' = ω0 ^ ↑k * (α' * ↑m) + R
α0 : 0 < α'
ω00 : 0 < ω0 ^ ↑k
Rl : R < ω ^ (repr a0 * succ ↑k)
x✝ : Nat.succ k ≠ 0
e0 : 0 < repr a0
rr0 : 0 < repr a0 + repr a0
⊢ R < ω ^ (repr a0 * succ ↑(Nat.succ k))

Next tactic:
refine'
        lt_of_lt_of_le Rl
          (opow_le_opow_right omega_pos <|
            mul_le_mul_left' (succ_le_succ_iff.2 (nat_cast_le.2 (le_of_lt k.lt_succ_self))) _)
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  

Proof state:
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂

Next tactic:
cases' e₁ : split o₁ with a m
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  

Proof state:
case mk
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
a : ONote
m : ℕ
e₁ : split o₁ = (a, m)
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂

Next tactic:
cases' nf_repr_split e₁ with N₁ r₁
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  

Proof state:
case mk.intro
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
a : ONote
m : ℕ
e₁ : split o₁ = (a, m)
N₁ : NF a
r₁ : repr o₁ = repr a + ↑m
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂

Next tactic:
cases' a with a0 n a'
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  cases' a with a0 n a'
  · 

Proof state:
case mk.intro.zero
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
e₁ : split o₁ = (zero, m)
N₁ : NF zero
r₁ : repr o₁ = repr zero + ↑m
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂

Next tactic:
cases' m with m
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  cases' a with a0 n a'
  · cases' m with m
    · 

Proof state:
case mk.intro.zero.zero
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
e₁ : split o₁ = (zero, Nat.zero)
r₁ : repr o₁ = repr zero + ↑Nat.zero
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂

Next tactic:
by_cases h : o₂ = 0
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  cases' a with a0 n a'
  · cases' m with m
    · by_cases h : o₂ = 0 <;> 

Proof state:
case pos
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
e₁ : split o₁ = (zero, Nat.zero)
r₁ : repr o₁ = repr zero + ↑Nat.zero
h : o₂ = 0
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂

Next tactic:
simp [opow_def, opowAux2, opow, e₁, h, r₁]
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  cases' a with a0 n a'
  · cases' m with m
    · by_cases h : o₂ = 0 <;> 

Proof state:
case neg
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
e₁ : split o₁ = (zero, Nat.zero)
r₁ : repr o₁ = repr zero + ↑Nat.zero
h : ¬o₂ = 0
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂

Next tactic:
simp [opow_def, opowAux2, opow, e₁, h, r₁]
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  cases' a with a0 n a'
  · cases' m with m
    · by_cases h : o₂ = 0 <;> simp [opow_def, opowAux2, opow, e₁, h, r₁]
      

Proof state:
case neg
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
e₁ : split o₁ = (zero, Nat.zero)
r₁ : repr o₁ = repr zero + ↑Nat.zero
h : ¬o₂ = 0
⊢ 0 = 0 ^ repr o₂

Next tactic:
have := mt repr_inj.1 h
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  cases' a with a0 n a'
  · cases' m with m
    · by_cases h : o₂ = 0 <;> simp [opow_def, opowAux2, opow, e₁, h, r₁]
      have := mt repr_inj.1 h
      

Proof state:
case neg
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
e₁ : split o₁ = (zero, Nat.zero)
r₁ : repr o₁ = repr zero + ↑Nat.zero
h : ¬o₂ = 0
this : ¬repr o₂ = repr 0
⊢ 0 = 0 ^ repr o₂

Next tactic:
rw [zero_opow this]
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  cases' a with a0 n a'
  · cases' m with m
    · by_cases h : o₂ = 0 <;> simp [opow_def, opowAux2, opow, e₁, h, r₁]
      have := mt repr_inj.1 h
      rw [zero_opow this]
    · 

Proof state:
case mk.intro.zero.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
r₁ : repr o₁ = repr zero + ↑(Nat.succ m)
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂

Next tactic:
cases' e₂ : split' o₂ with b' k
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  cases' a with a0 n a'
  · cases' m with m
    · by_cases h : o₂ = 0 <;> simp [opow_def, opowAux2, opow, e₁, h, r₁]
      have := mt repr_inj.1 h
      rw [zero_opow this]
    · cases' e₂ : split' o₂ with b' k
      

Proof state:
case mk.intro.zero.succ.mk
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
r₁ : repr o₁ = repr zero + ↑(Nat.succ m)
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂

Next tactic:
cases' nf_repr_split' e₂ with _ r₂
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  cases' a with a0 n a'
  · cases' m with m
    · by_cases h : o₂ = 0 <;> simp [opow_def, opowAux2, opow, e₁, h, r₁]
      have := mt repr_inj.1 h
      rw [zero_opow this]
    · cases' e₂ : split' o₂ with b' k
      cases' nf_repr_split' e₂ with _ r₂
      

Proof state:
case mk.intro.zero.succ.mk.intro
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
r₁ : repr o₁ = repr zero + ↑(Nat.succ m)
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
left✝ : NF b'
r₂ : repr o₂ = ω * repr b' + ↑k
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂

Next tactic:
by_cases h : m = 0
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  cases' a with a0 n a'
  · cases' m with m
    · by_cases h : o₂ = 0 <;> simp [opow_def, opowAux2, opow, e₁, h, r₁]
      have := mt repr_inj.1 h
      rw [zero_opow this]
    · cases' e₂ : split' o₂ with b' k
      cases' nf_repr_split' e₂ with _ r₂
      by_cases h : m = 0
      · 

Proof state:
case pos
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
r₁ : repr o₁ = repr zero + ↑(Nat.succ m)
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
left✝ : NF b'
r₂ : repr o₂ = ω * repr b' + ↑k
h : m = 0
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂

Next tactic:
simp [opow_def, opow, e₁, h, r₁, e₂, r₂, -Nat.cast_succ, ← Nat.one_eq_succ_zero]
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  cases' a with a0 n a'
  · cases' m with m
    · by_cases h : o₂ = 0 <;> simp [opow_def, opowAux2, opow, e₁, h, r₁]
      have := mt repr_inj.1 h
      rw [zero_opow this]
    · cases' e₂ : split' o₂ with b' k
      cases' nf_repr_split' e₂ with _ r₂
      by_cases h : m = 0
      · simp [opow_def, opow, e₁, h, r₁, e₂, r₂, -Nat.cast_succ, ← Nat.one_eq_succ_zero]
      

Proof state:
case neg
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
r₁ : repr o₁ = repr zero + ↑(Nat.succ m)
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
left✝ : NF b'
r₂ : repr o₂ = ω * repr b' + ↑k
h : ¬m = 0
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂

Next tactic:
simp only [opow_def, opowAux2, opow, e₁, h, r₁, e₂, r₂, repr,
          opow_zero, Nat.succPNat_coe, Nat.cast_succ, Nat.cast_zero, _root_.zero_add, mul_one,
          add_zero, one_opow, npow_eq_pow]
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  cases' a with a0 n a'
  · cases' m with m
    · by_cases h : o₂ = 0 <;> simp [opow_def, opowAux2, opow, e₁, h, r₁]
      have := mt repr_inj.1 h
      rw [zero_opow this]
    · cases' e₂ : split' o₂ with b' k
      cases' nf_repr_split' e₂ with _ r₂
      by_cases h : m = 0
      · simp [opow_def, opow, e₁, h, r₁, e₂, r₂, -Nat.cast_succ, ← Nat.one_eq_succ_zero]
      simp only [opow_def, opowAux2, opow, e₁, h, r₁, e₂, r₂, repr,
          opow_zero, Nat.succPNat_coe, Nat.cast_succ, Nat.cast_zero, _root_.zero_add, mul_one,
          add_zero, one_opow, npow_eq_pow]
      

Proof state:
case neg
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
r₁ : repr o₁ = repr zero + ↑(Nat.succ m)
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
left✝ : NF b'
r₂ : repr o₂ = ω * repr b' + ↑k
h : ¬m = 0
⊢ ω ^ repr b' * ↑↑(Nat.succPNat m ^ k) = (↑m + 1) ^ (ω * repr b' + ↑k)

Next tactic:
rw [opow_add, opow_mul, opow_omega, add_one_eq_succ]
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  cases' a with a0 n a'
  · cases' m with m
    · by_cases h : o₂ = 0 <;> simp [opow_def, opowAux2, opow, e₁, h, r₁]
      have := mt repr_inj.1 h
      rw [zero_opow this]
    · cases' e₂ : split' o₂ with b' k
      cases' nf_repr_split' e₂ with _ r₂
      by_cases h : m = 0
      · simp [opow_def, opow, e₁, h, r₁, e₂, r₂, -Nat.cast_succ, ← Nat.one_eq_succ_zero]
      simp only [opow_def, opowAux2, opow, e₁, h, r₁, e₂, r₂, repr,
          opow_zero, Nat.succPNat_coe, Nat.cast_succ, Nat.cast_zero, _root_.zero_add, mul_one,
          add_zero, one_opow, npow_eq_pow]
      rw [opow_add, opow_mul, opow_omega, add_one_eq_succ]
      

Proof state:
case neg
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
r₁ : repr o₁ = repr zero + ↑(Nat.succ m)
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
left✝ : NF b'
r₂ : repr o₂ = ω * repr b' + ↑k
h : ¬m = 0
⊢ ω ^ repr b' * ↑↑(Nat.succPNat m ^ k) = ω ^ repr b' * succ ↑m ^ ↑k
case neg.a1
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
r₁ : repr o₁ = repr zero + ↑(Nat.succ m)
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
left✝ : NF b'
r₂ : repr o₂ = ω * repr b' + ↑k
h : ¬m = 0
⊢ 1 < ↑m + 1
case neg.h
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
r₁ : repr o₁ = repr zero + ↑(Nat.succ m)
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
left✝ : NF b'
r₂ : repr o₂ = ω * repr b' + ↑k
h : ¬m = 0
⊢ ↑m + 1 < ω

Next tactic:
congr
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  cases' a with a0 n a'
  · cases' m with m
    · by_cases h : o₂ = 0 <;> simp [opow_def, opowAux2, opow, e₁, h, r₁]
      have := mt repr_inj.1 h
      rw [zero_opow this]
    · cases' e₂ : split' o₂ with b' k
      cases' nf_repr_split' e₂ with _ r₂
      by_cases h : m = 0
      · simp [opow_def, opow, e₁, h, r₁, e₂, r₂, -Nat.cast_succ, ← Nat.one_eq_succ_zero]
      simp only [opow_def, opowAux2, opow, e₁, h, r₁, e₂, r₂, repr,
          opow_zero, Nat.succPNat_coe, Nat.cast_succ, Nat.cast_zero, _root_.zero_add, mul_one,
          add_zero, one_opow, npow_eq_pow]
      rw [opow_add, opow_mul, opow_omega, add_one_eq_succ]
      congr
      

Proof state:
case neg.e_a
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
r₁ : repr o₁ = repr zero + ↑(Nat.succ m)
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
left✝ : NF b'
r₂ : repr o₂ = ω * repr b' + ↑k
h : ¬m = 0
⊢ ↑↑(Nat.succPNat m ^ k) = succ ↑m ^ ↑k
case neg.a1
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
r₁ : repr o₁ = repr zero + ↑(Nat.succ m)
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
left✝ : NF b'
r₂ : repr o₂ = ω * repr b' + ↑k
h : ¬m = 0
⊢ 1 < ↑m + 1
case neg.h
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
r₁ : repr o₁ = repr zero + ↑(Nat.succ m)
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
left✝ : NF b'
r₂ : repr o₂ = ω * repr b' + ↑k
h : ¬m = 0
⊢ ↑m + 1 < ω

Next tactic:
conv_lhs =>
        simp only [(· ^ ·)]
        simp [Pow.pow, opow, Ordinal.succ_ne_zero]
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  cases' a with a0 n a'
  · cases' m with m
    · by_cases h : o₂ = 0 <;> simp [opow_def, opowAux2, opow, e₁, h, r₁]
      have := mt repr_inj.1 h
      rw [zero_opow this]
    · cases' e₂ : split' o₂ with b' k
      cases' nf_repr_split' e₂ with _ r₂
      by_cases h : m = 0
      · simp [opow_def, opow, e₁, h, r₁, e₂, r₂, -Nat.cast_succ, ← Nat.one_eq_succ_zero]
      simp only [opow_def, opowAux2, opow, e₁, h, r₁, e₂, r₂, repr,
          opow_zero, Nat.succPNat_coe, Nat.cast_succ, Nat.cast_zero, _root_.zero_add, mul_one,
          add_zero, one_opow, npow_eq_pow]
      rw [opow_add, opow_mul, opow_omega, add_one_eq_succ]
      congr
      conv_lhs =>
        

Proof state:
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
r₁ : repr o₁ = repr zero + ↑(Nat.succ m)
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
left✝ : NF b'
r₂ : repr o₂ = ω * repr b' + ↑k
h : ¬m = 0
| ↑↑(Nat.succPNat m ^ k)

Next tactic:
simp only [(· ^ ·)]
        simp [Pow.pow, opow, Ordinal.succ_ne_zero]
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  cases' a with a0 n a'
  · cases' m with m
    · by_cases h : o₂ = 0 <;> simp [opow_def, opowAux2, opow, e₁, h, r₁]
      have := mt repr_inj.1 h
      rw [zero_opow this]
    · cases' e₂ : split' o₂ with b' k
      cases' nf_repr_split' e₂ with _ r₂
      by_cases h : m = 0
      · simp [opow_def, opow, e₁, h, r₁, e₂, r₂, -Nat.cast_succ, ← Nat.one_eq_succ_zero]
      simp only [opow_def, opowAux2, opow, e₁, h, r₁, e₂, r₂, repr,
          opow_zero, Nat.succPNat_coe, Nat.cast_succ, Nat.cast_zero, _root_.zero_add, mul_one,
          add_zero, one_opow, npow_eq_pow]
      rw [opow_add, opow_mul, opow_omega, add_one_eq_succ]
      congr
      conv_lhs =>
        

Proof state:
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
r₁ : repr o₁ = repr zero + ↑(Nat.succ m)
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
left✝ : NF b'
r₂ : repr o₂ = ω * repr b' + ↑k
h : ¬m = 0
| ↑↑(Nat.succPNat m ^ k)

Next tactic:
simp only [(· ^ ·)]
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  cases' a with a0 n a'
  · cases' m with m
    · by_cases h : o₂ = 0 <;> simp [opow_def, opowAux2, opow, e₁, h, r₁]
      have := mt repr_inj.1 h
      rw [zero_opow this]
    · cases' e₂ : split' o₂ with b' k
      cases' nf_repr_split' e₂ with _ r₂
      by_cases h : m = 0
      · simp [opow_def, opow, e₁, h, r₁, e₂, r₂, -Nat.cast_succ, ← Nat.one_eq_succ_zero]
      simp only [opow_def, opowAux2, opow, e₁, h, r₁, e₂, r₂, repr,
          opow_zero, Nat.succPNat_coe, Nat.cast_succ, Nat.cast_zero, _root_.zero_add, mul_one,
          add_zero, one_opow, npow_eq_pow]
      rw [opow_add, opow_mul, opow_omega, add_one_eq_succ]
      congr
      conv_lhs =>
        simp only [(· ^ ·)]
        

Proof state:
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
r₁ : repr o₁ = repr zero + ↑(Nat.succ m)
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
left✝ : NF b'
r₂ : repr o₂ = ω * repr b' + ↑k
h : ¬m = 0
| ↑↑(Pow.pow (Nat.succPNat m) k)

Next tactic:
simp [Pow.pow, opow, Ordinal.succ_ne_zero]
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  cases' a with a0 n a'
  · cases' m with m
    · by_cases h : o₂ = 0 <;> simp [opow_def, opowAux2, opow, e₁, h, r₁]
      have := mt repr_inj.1 h
      rw [zero_opow this]
    · cases' e₂ : split' o₂ with b' k
      cases' nf_repr_split' e₂ with _ r₂
      by_cases h : m = 0
      · simp [opow_def, opow, e₁, h, r₁, e₂, r₂, -Nat.cast_succ, ← Nat.one_eq_succ_zero]
      simp only [opow_def, opowAux2, opow, e₁, h, r₁, e₂, r₂, repr,
          opow_zero, Nat.succPNat_coe, Nat.cast_succ, Nat.cast_zero, _root_.zero_add, mul_one,
          add_zero, one_opow, npow_eq_pow]
      rw [opow_add, opow_mul, opow_omega, add_one_eq_succ]
      congr
      conv_lhs =>
        simp only [(· ^ ·)]
        simp [Pow.pow, opow, Ordinal.succ_ne_zero]
      · 

Proof state:
case neg.a1
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
r₁ : repr o₁ = repr zero + ↑(Nat.succ m)
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
left✝ : NF b'
r₂ : repr o₂ = ω * repr b' + ↑k
h : ¬m = 0
⊢ 1 < ↑m + 1

Next tactic:
simpa using nat_cast_lt.2 (Nat.succ_lt_succ <| pos_iff_ne_zero.2 h)
theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by
  cases' e₁ : split o₁ with a m
  cases' nf_repr_split e₁ with N₁ r₁
  cases' a with a0 n a'
  · cases' m with m
    · by_cases h : o₂ = 0 <;> simp [opow_def, opowAux2, opow, e₁, h, r₁]
      have := mt repr_inj.1 h
      rw [zero_opow this]
    · cases' e₂ : split' o₂ with b' k
      cases' nf_repr_split' e₂ with _ r₂
      by_cases h : m = 0
      · simp [opow_def, opow, e₁, h, r₁, e₂, r₂, -Nat.cast_succ, ← Nat.one_eq_succ_zero]
      simp only [opow_def, opowAux2, opow, e₁, h, r₁, e₂, r₂, repr,
          opow_zero, Nat.succPNat_coe, Nat.cast_succ, Nat.cast_zero, _root_.zero_add, mul_one,
          add_zero, one_opow, npow_eq_pow]
      rw [opow_add, opow_mul, opow_omega, add_one_eq_succ]
      congr
      conv_lhs =>
        simp only [(· ^ ·)]
        simp [Pow.pow, opow, Ordinal.succ_ne_zero]
      · simpa using nat_cast_lt.2 (Nat.succ_lt_succ <| pos_iff_ne_zero.2 h)
      · 

Proof state:
case neg.h
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
N₁ : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
r₁ : repr o₁ = repr zero + ↑(Nat.succ m)
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
left✝ : NF b'
r₂ : repr o₂ = ω * repr b' + ↑k
h : ¬m = 0
⊢ ↑m + 1 < ω

Next tactic:
rw [← Nat.cast_succ, lt_omega]