[GOAL]
n : ℕ
⊢ repr ↑n = ↑n
[PROOFSTEP]
cases n
[GOAL]
case zero
⊢ repr ↑Nat.zero = ↑Nat.zero
[PROOFSTEP]
simp
[GOAL]
case succ
n✝ : ℕ
⊢ repr ↑(Nat.succ n✝) = ↑(Nat.succ n✝)
[PROOFSTEP]
simp
[GOAL]
e : ONote
n : ℕ+
a : ONote
⊢ ω ^ repr e ≤ repr (oadd e n a)
[PROOFSTEP]
refine' le_trans _ (le_add_right _ _)
[GOAL]
e : ONote
n : ℕ+
a : ONote
⊢ ω ^ repr e ≤ ω ^ repr e * ↑↑n
[PROOFSTEP]
simpa using (Ordinal.mul_le_mul_iff_left <| opow_pos (repr e) omega_pos).2 (nat_cast_le.2 n.2)
[GOAL]
e : ONote
n : ℕ+
a : ONote
h : cmp (oadd e n a) 0 = Ordering.eq
⊢ oadd e n a = 0
[PROOFSTEP]
injection h
[GOAL]
e : ONote
n : ℕ+
a : ONote
h : cmp 0 (oadd e n a) = Ordering.eq
⊢ 0 = oadd e n a
[PROOFSTEP]
injection h
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h : cmp (oadd e₁ n₁ a₁) (oadd e₂ n₂ a₂) = Ordering.eq
⊢ oadd e₁ n₁ a₁ = oadd e₂ n₂ a₂
[PROOFSTEP]
revert h
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
⊢ cmp (oadd e₁ n₁ a₁) (oadd e₂ n₂ a₂) = Ordering.eq → oadd e₁ n₁ a₁ = oadd e₂ n₂ a₂
[PROOFSTEP]
simp only [cmp]
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
⊢ Ordering.orElse (cmp e₁ e₂) (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)) = Ordering.eq →
    oadd e₁ n₁ a₁ = oadd e₂ n₂ a₂
[PROOFSTEP]
cases h₁ : cmp e₁ e₂
[GOAL]
case lt
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₂ = Ordering.lt
⊢ Ordering.orElse Ordering.lt (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)) = Ordering.eq →
    oadd e₁ n₁ a₁ = oadd e₂ n₂ a₂
[PROOFSTEP]
intro h
[GOAL]
case eq
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₂ = Ordering.eq
⊢ Ordering.orElse Ordering.eq (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)) = Ordering.eq →
    oadd e₁ n₁ a₁ = oadd e₂ n₂ a₂
[PROOFSTEP]
intro h
[GOAL]
case gt
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₂ = Ordering.gt
⊢ Ordering.orElse Ordering.gt (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)) = Ordering.eq →
    oadd e₁ n₁ a₁ = oadd e₂ n₂ a₂
[PROOFSTEP]
intro h
[GOAL]
case lt
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₂ = Ordering.lt
h : Ordering.orElse Ordering.lt (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)) = Ordering.eq
⊢ oadd e₁ n₁ a₁ = oadd e₂ n₂ a₂
[PROOFSTEP]
try cases h
[GOAL]
case lt
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₂ = Ordering.lt
h : Ordering.orElse Ordering.lt (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)) = Ordering.eq
⊢ oadd e₁ n₁ a₁ = oadd e₂ n₂ a₂
[PROOFSTEP]
cases h
[GOAL]
case eq
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₂ = Ordering.eq
h : Ordering.orElse Ordering.eq (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)) = Ordering.eq
⊢ oadd e₁ n₁ a₁ = oadd e₂ n₂ a₂
[PROOFSTEP]
try cases h
[GOAL]
case eq
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₂ = Ordering.eq
h : Ordering.orElse Ordering.eq (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)) = Ordering.eq
⊢ oadd e₁ n₁ a₁ = oadd e₂ n₂ a₂
[PROOFSTEP]
cases h
[GOAL]
case gt
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₂ = Ordering.gt
h : Ordering.orElse Ordering.gt (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)) = Ordering.eq
⊢ oadd e₁ n₁ a₁ = oadd e₂ n₂ a₂
[PROOFSTEP]
try cases h
[GOAL]
case gt
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₂ = Ordering.gt
h : Ordering.orElse Ordering.gt (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)) = Ordering.eq
⊢ oadd e₁ n₁ a₁ = oadd e₂ n₂ a₂
[PROOFSTEP]
cases h
[GOAL]
case eq
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₂ = Ordering.eq
h : Ordering.orElse Ordering.eq (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)) = Ordering.eq
⊢ oadd e₁ n₁ a₁ = oadd e₂ n₂ a₂
[PROOFSTEP]
obtain rfl := eq_of_cmp_eq h₁
[GOAL]
case eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h : Ordering.orElse Ordering.eq (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)) = Ordering.eq
h₁ : cmp e₁ e₁ = Ordering.eq
⊢ oadd e₁ n₁ a₁ = oadd e₁ n₂ a₂
[PROOFSTEP]
revert h
[GOAL]
case eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₁ = Ordering.eq
⊢ Ordering.orElse Ordering.eq (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)) = Ordering.eq →
    oadd e₁ n₁ a₁ = oadd e₁ n₂ a₂
[PROOFSTEP]
cases h₂ : _root_.cmp (n₁ : ℕ) n₂
[GOAL]
case eq.lt
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₁ = Ordering.eq
h₂ : _root_.cmp ↑n₁ ↑n₂ = Ordering.lt
⊢ Ordering.orElse Ordering.eq (Ordering.orElse Ordering.lt (cmp a₁ a₂)) = Ordering.eq → oadd e₁ n₁ a₁ = oadd e₁ n₂ a₂
[PROOFSTEP]
intro h
[GOAL]
case eq.eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₁ = Ordering.eq
h₂ : _root_.cmp ↑n₁ ↑n₂ = Ordering.eq
⊢ Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₂)) = Ordering.eq → oadd e₁ n₁ a₁ = oadd e₁ n₂ a₂
[PROOFSTEP]
intro h
[GOAL]
case eq.gt
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₁ = Ordering.eq
h₂ : _root_.cmp ↑n₁ ↑n₂ = Ordering.gt
⊢ Ordering.orElse Ordering.eq (Ordering.orElse Ordering.gt (cmp a₁ a₂)) = Ordering.eq → oadd e₁ n₁ a₁ = oadd e₁ n₂ a₂
[PROOFSTEP]
intro h
[GOAL]
case eq.lt
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₁ = Ordering.eq
h₂ : _root_.cmp ↑n₁ ↑n₂ = Ordering.lt
h : Ordering.orElse Ordering.eq (Ordering.orElse Ordering.lt (cmp a₁ a₂)) = Ordering.eq
⊢ oadd e₁ n₁ a₁ = oadd e₁ n₂ a₂
[PROOFSTEP]
try cases h
[GOAL]
case eq.lt
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₁ = Ordering.eq
h₂ : _root_.cmp ↑n₁ ↑n₂ = Ordering.lt
h : Ordering.orElse Ordering.eq (Ordering.orElse Ordering.lt (cmp a₁ a₂)) = Ordering.eq
⊢ oadd e₁ n₁ a₁ = oadd e₁ n₂ a₂
[PROOFSTEP]
cases h
[GOAL]
case eq.eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₁ = Ordering.eq
h₂ : _root_.cmp ↑n₁ ↑n₂ = Ordering.eq
h : Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₂)) = Ordering.eq
⊢ oadd e₁ n₁ a₁ = oadd e₁ n₂ a₂
[PROOFSTEP]
try cases h
[GOAL]
case eq.eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₁ = Ordering.eq
h₂ : _root_.cmp ↑n₁ ↑n₂ = Ordering.eq
h : Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₂)) = Ordering.eq
⊢ oadd e₁ n₁ a₁ = oadd e₁ n₂ a₂
[PROOFSTEP]
cases h
[GOAL]
case eq.gt
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₁ = Ordering.eq
h₂ : _root_.cmp ↑n₁ ↑n₂ = Ordering.gt
h : Ordering.orElse Ordering.eq (Ordering.orElse Ordering.gt (cmp a₁ a₂)) = Ordering.eq
⊢ oadd e₁ n₁ a₁ = oadd e₁ n₂ a₂
[PROOFSTEP]
try cases h
[GOAL]
case eq.gt
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₁ = Ordering.eq
h₂ : _root_.cmp ↑n₁ ↑n₂ = Ordering.gt
h : Ordering.orElse Ordering.eq (Ordering.orElse Ordering.gt (cmp a₁ a₂)) = Ordering.eq
⊢ oadd e₁ n₁ a₁ = oadd e₁ n₂ a₂
[PROOFSTEP]
cases h
[GOAL]
case eq.eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : cmp e₁ e₁ = Ordering.eq
h₂ : _root_.cmp ↑n₁ ↑n₂ = Ordering.eq
h : Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₂)) = Ordering.eq
⊢ oadd e₁ n₁ a₁ = oadd e₁ n₂ a₂
[PROOFSTEP]
obtain rfl := eq_of_cmp_eq h
[GOAL]
case eq.eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
h₁ : cmp e₁ e₁ = Ordering.eq
h₂ : _root_.cmp ↑n₁ ↑n₂ = Ordering.eq
h : Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₁)) = Ordering.eq
⊢ oadd e₁ n₁ a₁ = oadd e₁ n₂ a₁
[PROOFSTEP]
rw [_root_.cmp, cmpUsing_eq_eq] at h₂
[GOAL]
case eq.eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
h₁ : cmp e₁ e₁ = Ordering.eq
h₂ : ¬↑n₁ < ↑n₂ ∧ ¬↑n₂ < ↑n₁
h : Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₁)) = Ordering.eq
⊢ oadd e₁ n₁ a₁ = oadd e₁ n₂ a₁
[PROOFSTEP]
obtain rfl := Subtype.eq (eq_of_incomp h₂)
[GOAL]
case eq.eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h₁ : cmp e₁ e₁ = Ordering.eq
h : Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₁)) = Ordering.eq
h₂ : ¬↑n₁ < ↑n₁ ∧ ¬↑n₁ < ↑n₁
⊢ oadd e₁ n₁ a₁ = oadd e₁ n₁ a₁
[PROOFSTEP]
simp
[GOAL]
⊢ 0 < 1
[PROOFSTEP]
simp only [lt_def, repr, repr_one, opow_zero, one_mul, add_zero, nat_cast_pos]
[GOAL]
e : ONote
n : ℕ+
a : ONote
b : Ordinal.{0}
h : NFBelow (ONote.oadd e n a) b
⊢ NF e
[PROOFSTEP]
cases' h with _ _ _ _ eb _ h₁ h₂ h₃
[GOAL]
case oadd'
e : ONote
n : ℕ+
a : ONote
b eb : Ordinal.{0}
h₁ : NFBelow e eb
h₂ : NFBelow a (repr e)
h₃ : repr e < b
⊢ NF e
[PROOFSTEP]
exact ⟨⟨_, h₁⟩⟩
[GOAL]
e : ONote
n : ℕ+
a : ONote
b : Ordinal.{0}
h : NFBelow (ONote.oadd e n a) b
⊢ NFBelow a (repr e)
[PROOFSTEP]
cases' h with _ _ _ _ eb _ h₁ h₂ h₃
[GOAL]
case oadd'
e : ONote
n : ℕ+
a : ONote
b eb : Ordinal.{0}
h₁ : NFBelow e eb
h₂ : NFBelow a (repr e)
h₃ : repr e < b
⊢ NFBelow a (repr e)
[PROOFSTEP]
exact h₂
[GOAL]
e : ONote
n : ℕ+
a : ONote
b : Ordinal.{0}
h : NFBelow (ONote.oadd e n a) b
⊢ repr e < b
[PROOFSTEP]
cases' h with _ _ _ _ eb _ h₁ h₂ h₃
[GOAL]
case oadd'
e : ONote
n : ℕ+
a : ONote
b eb : Ordinal.{0}
h₁ : NFBelow e eb
h₂ : NFBelow a (repr e)
h₃ : repr e < b
⊢ repr e < b
[PROOFSTEP]
exact h₃
[GOAL]
e : ONote
n : ℕ+
a : ONote
h : NF (ONote.oadd e n a)
e0 : e = 0
⊢ a = 0
[PROOFSTEP]
simpa [e0, NFBelow_zero] using h.snd'
[GOAL]
o : ONote
b : Ordinal.{0}
h : NFBelow o b
⊢ repr o < ω ^ b
[PROOFSTEP]
induction' h with _ e n a eb b h₁ h₂ h₃ _ IH
[GOAL]
case zero
o : ONote
b b✝ : Ordinal.{0}
⊢ repr 0 < ω ^ b✝
[PROOFSTEP]
exact opow_pos _ omega_pos
[GOAL]
case oadd'
o : ONote
b✝ : Ordinal.{0}
e : ONote
n : ℕ+
a : ONote
eb b : Ordinal.{0}
h₁ : NFBelow e eb
h₂ : NFBelow a (repr e)
h₃ : repr e < b
a_ih✝ : repr e < ω ^ eb
IH : repr a < ω ^ repr e
⊢ repr (ONote.oadd e n a) < ω ^ b
[PROOFSTEP]
rw [repr]
[GOAL]
case oadd'
o : ONote
b✝ : Ordinal.{0}
e : ONote
n : ℕ+
a : ONote
eb b : Ordinal.{0}
h₁ : NFBelow e eb
h₂ : NFBelow a (repr e)
h₃ : repr e < b
a_ih✝ : repr e < ω ^ eb
IH : repr a < ω ^ repr e
⊢ ω ^ repr e * ↑↑n + repr a < ω ^ b
[PROOFSTEP]
apply ((add_lt_add_iff_left _).2 IH).trans_le
[GOAL]
case oadd'
o : ONote
b✝ : Ordinal.{0}
e : ONote
n : ℕ+
a : ONote
eb b : Ordinal.{0}
h₁ : NFBelow e eb
h₂ : NFBelow a (repr e)
h₃ : repr e < b
a_ih✝ : repr e < ω ^ eb
IH : repr a < ω ^ repr e
⊢ ω ^ repr e * ↑↑n + ω ^ repr e ≤ ω ^ b
[PROOFSTEP]
rw [← mul_succ]
[GOAL]
case oadd'
o : ONote
b✝ : Ordinal.{0}
e : ONote
n : ℕ+
a : ONote
eb b : Ordinal.{0}
h₁ : NFBelow e eb
h₂ : NFBelow a (repr e)
h₃ : repr e < b
a_ih✝ : repr e < ω ^ eb
IH : repr a < ω ^ repr e
⊢ ω ^ repr e * succ ↑↑n ≤ ω ^ b
[PROOFSTEP]
apply (mul_le_mul_left' (succ_le_of_lt (nat_lt_omega _)) _).trans
[GOAL]
case oadd'
o : ONote
b✝ : Ordinal.{0}
e : ONote
n : ℕ+
a : ONote
eb b : Ordinal.{0}
h₁ : NFBelow e eb
h₂ : NFBelow a (repr e)
h₃ : repr e < b
a_ih✝ : repr e < ω ^ eb
IH : repr a < ω ^ repr e
⊢ ω ^ repr e * ω ≤ ω ^ b
[PROOFSTEP]
rw [← opow_succ]
[GOAL]
case oadd'
o : ONote
b✝ : Ordinal.{0}
e : ONote
n : ℕ+
a : ONote
eb b : Ordinal.{0}
h₁ : NFBelow e eb
h₂ : NFBelow a (repr e)
h₃ : repr e < b
a_ih✝ : repr e < ω ^ eb
IH : repr a < ω ^ repr e
⊢ ω ^ succ (repr e) ≤ ω ^ b
[PROOFSTEP]
exact opow_le_opow_right omega_pos (succ_le_of_lt h₃)
[GOAL]
o : ONote
b₁ b₂ : Ordinal.{0}
bb : b₁ ≤ b₂
h : NFBelow o b₁
⊢ NFBelow o b₂
[PROOFSTEP]
induction' h with _ e n a eb b h₁ h₂ h₃ _ _
[GOAL]
case zero
o : ONote
b₁ b₂ : Ordinal.{0}
bb✝ : b₁ ≤ b₂
b✝ : Ordinal.{0}
bb : b✝ ≤ b₂
⊢ NFBelow 0 b₂
[PROOFSTEP]
constructor
[GOAL]
case oadd'
o : ONote
b₁ b₂ : Ordinal.{0}
bb✝ : b₁ ≤ b₂
e : ONote
n : ℕ+
a : ONote
eb b : Ordinal.{0}
h₁ : NFBelow e eb
h₂ : NFBelow a (repr e)
h₃ : repr e < b
a_ih✝¹ : eb ≤ b₂ → NFBelow e b₂
a_ih✝ : repr e ≤ b₂ → NFBelow a b₂
bb : b ≤ b₂
⊢ NFBelow (ONote.oadd e n a) b₂
[PROOFSTEP]
constructor
[GOAL]
case oadd'.a
o : ONote
b₁ b₂ : Ordinal.{0}
bb✝ : b₁ ≤ b₂
e : ONote
n : ℕ+
a : ONote
eb b : Ordinal.{0}
h₁ : NFBelow e eb
h₂ : NFBelow a (repr e)
h₃ : repr e < b
a_ih✝¹ : eb ≤ b₂ → NFBelow e b₂
a_ih✝ : repr e ≤ b₂ → NFBelow a b₂
bb : b ≤ b₂
⊢ NFBelow e ?oadd'.eb
case oadd'.a
o : ONote
b₁ b₂ : Ordinal.{0}
bb✝ : b₁ ≤ b₂
e : ONote
n : ℕ+
a : ONote
eb b : Ordinal.{0}
h₁ : NFBelow e eb
h₂ : NFBelow a (repr e)
h₃ : repr e < b
a_ih✝¹ : eb ≤ b₂ → NFBelow e b₂
a_ih✝ : repr e ≤ b₂ → NFBelow a b₂
bb : b ≤ b₂
⊢ NFBelow a (repr e)
case oadd'.a
o : ONote
b₁ b₂ : Ordinal.{0}
bb✝ : b₁ ≤ b₂
e : ONote
n : ℕ+
a : ONote
eb b : Ordinal.{0}
h₁ : NFBelow e eb
h₂ : NFBelow a (repr e)
h₃ : repr e < b
a_ih✝¹ : eb ≤ b₂ → NFBelow e b₂
a_ih✝ : repr e ≤ b₂ → NFBelow a b₂
bb : b ≤ b₂
⊢ repr e < b₂
case oadd'.eb
o : ONote
b₁ b₂ : Ordinal.{0}
bb✝ : b₁ ≤ b₂
e : ONote
n : ℕ+
a : ONote
eb b : Ordinal.{0}
h₁ : NFBelow e eb
h₂ : NFBelow a (repr e)
h₃ : repr e < b
a_ih✝¹ : eb ≤ b₂ → NFBelow e b₂
a_ih✝ : repr e ≤ b₂ → NFBelow a b₂
bb : b ≤ b₂
⊢ Ordinal.{0}
[PROOFSTEP]
exacts [h₁, h₂, lt_of_lt_of_le h₃ bb]
[GOAL]
e : ONote
n : ℕ+
a : ONote
b : Ordinal.{0}
H : repr e < b
b' : Ordinal.{0}
h : NFBelow (ONote.oadd e n a) b'
⊢ NFBelow (ONote.oadd e n a) b
[PROOFSTEP]
cases' h with _ _ _ _ eb _ h₁ h₂ h₃
[GOAL]
case oadd'
e : ONote
n : ℕ+
a : ONote
b : Ordinal.{0}
H : repr e < b
b' eb : Ordinal.{0}
h₁ : NFBelow e eb
h₂ : NFBelow a (repr e)
h₃ : repr e < b'
⊢ NFBelow (ONote.oadd e n a) b
[PROOFSTEP]
exact NFBelow.oadd' h₁ h₂ H
[GOAL]
⊢ NF 1
[PROOFSTEP]
rw [← ofNat_one]
[GOAL]
⊢ NF ↑1
[PROOFSTEP]
infer_instance
[GOAL]
e o₁ o₂ : ONote
n₁ n₂ : ℕ+
h₁ : NF (oadd e n₁ o₁)
h : ↑n₁ < ↑n₂
⊢ oadd e n₁ o₁ < oadd e n₂ o₂
[PROOFSTEP]
simp [lt_def]
[GOAL]
e o₁ o₂ : ONote
n₁ n₂ : ℕ+
h₁ : NF (oadd e n₁ o₁)
h : ↑n₁ < ↑n₂
⊢ ω ^ repr e * ↑↑n₁ + repr o₁ < ω ^ repr e * ↑↑n₂ + repr o₂
[PROOFSTEP]
refine' lt_of_lt_of_le ((add_lt_add_iff_left _).2 h₁.snd'.repr_lt) (le_trans _ (le_add_right _ _))
[GOAL]
e o₁ o₂ : ONote
n₁ n₂ : ℕ+
h₁ : NF (oadd e n₁ o₁)
h : ↑n₁ < ↑n₂
⊢ ω ^ repr e * ↑↑n₁ + ω ^ repr e ≤ ω ^ repr e * ↑↑n₂
[PROOFSTEP]
rwa [← mul_succ, Ordinal.mul_le_mul_iff_left (opow_pos _ omega_pos), succ_le_iff, nat_cast_lt]
[GOAL]
e : ONote
n : ℕ+
a₁ a₂ : ONote
h : a₁ < a₂
⊢ oadd e n a₁ < oadd e n a₂
[PROOFSTEP]
rw [lt_def]
[GOAL]
e : ONote
n : ℕ+
a₁ a₂ : ONote
h : a₁ < a₂
⊢ repr (oadd e n a₁) < repr (oadd e n a₂)
[PROOFSTEP]
unfold repr
[GOAL]
e : ONote
n : ℕ+
a₁ a₂ : ONote
h : a₁ < a₂
⊢ ω ^ repr e * ↑↑n + repr a₁ < ω ^ repr e * ↑↑n + repr a₂
[PROOFSTEP]
exact @add_lt_add_left _ _ _ _ (repr a₁) _ h _
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
⊢ Ordering.Compares (cmp (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
[PROOFSTEP]
rw [cmp]
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
⊢ Ordering.Compares (Ordering.orElse (cmp e₁ e₂) (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
[PROOFSTEP]
have IHe := @cmp_compares _ _ h₁.fst h₂.fst
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
IHe : Ordering.Compares (cmp e₁ e₂) e₁ e₂
⊢ Ordering.Compares (Ordering.orElse (cmp e₁ e₂) (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
[PROOFSTEP]
simp [Ordering.Compares] at IHe
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
IHe :
  match cmp e₁ e₂, e₁, e₂ with
  | Ordering.lt, a, b => a < b
  | Ordering.eq, a, b => a = b
  | Ordering.gt, a, b => b < a
⊢ Ordering.Compares (Ordering.orElse (cmp e₁ e₂) (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
[PROOFSTEP]
revert IHe
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
⊢ (match cmp e₁ e₂, e₁, e₂ with
    | Ordering.lt, a, b => a < b
    | Ordering.eq, a, b => a = b
    | Ordering.gt, a, b => b < a) →
    Ordering.Compares (Ordering.orElse (cmp e₁ e₂) (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
      (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
[PROOFSTEP]
cases cmp e₁ e₂
[GOAL]
case lt
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
⊢ (match Ordering.lt, e₁, e₂ with
    | Ordering.lt, a, b => a < b
    | Ordering.eq, a, b => a = b
    | Ordering.gt, a, b => b < a) →
    Ordering.Compares (Ordering.orElse Ordering.lt (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
      (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
case eq
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
⊢ (match Ordering.eq, e₁, e₂ with
    | Ordering.lt, a, b => a < b
    | Ordering.eq, a, b => a = b
    | Ordering.gt, a, b => b < a) →
    Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
      (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
case gt
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
⊢ (match Ordering.gt, e₁, e₂ with
    | Ordering.lt, a, b => a < b
    | Ordering.eq, a, b => a = b
    | Ordering.gt, a, b => b < a) →
    Ordering.Compares (Ordering.orElse Ordering.gt (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
      (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
[PROOFSTEP]
case lt => intro IHe; exact oadd_lt_oadd_1 h₁ IHe
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
⊢ (match Ordering.lt, e₁, e₂ with
    | Ordering.lt, a, b => a < b
    | Ordering.eq, a, b => a = b
    | Ordering.gt, a, b => b < a) →
    Ordering.Compares (Ordering.orElse Ordering.lt (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
      (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
[PROOFSTEP]
case lt => intro IHe; exact oadd_lt_oadd_1 h₁ IHe
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
⊢ (match Ordering.lt, e₁, e₂ with
    | Ordering.lt, a, b => a < b
    | Ordering.eq, a, b => a = b
    | Ordering.gt, a, b => b < a) →
    Ordering.Compares (Ordering.orElse Ordering.lt (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
      (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
[PROOFSTEP]
intro IHe
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
IHe :
  match Ordering.lt, e₁, e₂ with
  | Ordering.lt, a, b => a < b
  | Ordering.eq, a, b => a = b
  | Ordering.gt, a, b => b < a
⊢ Ordering.Compares (Ordering.orElse Ordering.lt (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
[PROOFSTEP]
exact oadd_lt_oadd_1 h₁ IHe
[GOAL]
case eq
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
⊢ (match Ordering.eq, e₁, e₂ with
    | Ordering.lt, a, b => a < b
    | Ordering.eq, a, b => a = b
    | Ordering.gt, a, b => b < a) →
    Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
      (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
case gt
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
⊢ (match Ordering.gt, e₁, e₂ with
    | Ordering.lt, a, b => a < b
    | Ordering.eq, a, b => a = b
    | Ordering.gt, a, b => b < a) →
    Ordering.Compares (Ordering.orElse Ordering.gt (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
      (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
[PROOFSTEP]
case gt => intro IHe; exact oadd_lt_oadd_1 h₂ IHe
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
⊢ (match Ordering.gt, e₁, e₂ with
    | Ordering.lt, a, b => a < b
    | Ordering.eq, a, b => a = b
    | Ordering.gt, a, b => b < a) →
    Ordering.Compares (Ordering.orElse Ordering.gt (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
      (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
[PROOFSTEP]
case gt => intro IHe; exact oadd_lt_oadd_1 h₂ IHe
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
⊢ (match Ordering.gt, e₁, e₂ with
    | Ordering.lt, a, b => a < b
    | Ordering.eq, a, b => a = b
    | Ordering.gt, a, b => b < a) →
    Ordering.Compares (Ordering.orElse Ordering.gt (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
      (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
[PROOFSTEP]
intro IHe
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
IHe :
  match Ordering.gt, e₁, e₂ with
  | Ordering.lt, a, b => a < b
  | Ordering.eq, a, b => a = b
  | Ordering.gt, a, b => b < a
⊢ Ordering.Compares (Ordering.orElse Ordering.gt (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
[PROOFSTEP]
exact oadd_lt_oadd_1 h₂ IHe
[GOAL]
case eq
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
⊢ (match Ordering.eq, e₁, e₂ with
    | Ordering.lt, a, b => a < b
    | Ordering.eq, a, b => a = b
    | Ordering.gt, a, b => b < a) →
    Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
      (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
[PROOFSTEP]
case eq =>
  intro IHe; dsimp at IHe ; subst IHe
  unfold _root_.cmp; cases nh : cmpUsing (· < ·) (n₁ : ℕ) n₂ <;> rw [cmpUsing, ite_eq_iff, not_lt] at nh
  case lt =>
    cases' nh with nh nh
    · exact oadd_lt_oadd_2 h₁ nh.left
    · rw [ite_eq_iff] at nh ; cases' nh.right with nh nh <;> cases nh <;> contradiction
  case gt =>
    cases' nh with nh nh
    · cases nh; contradiction
    · cases' nh with _ nh
      rw [ite_eq_iff] at nh ; cases' nh with nh nh
      · exact oadd_lt_oadd_2 h₂ nh.left
      · cases nh; contradiction
  cases' nh with nh nh
  · cases nh; contradiction
  cases' nh with nhl nhr
  rw [ite_eq_iff] at nhr
  cases' nhr with nhr nhr
  · cases nhr; contradiction
  obtain rfl := Subtype.eq (eq_of_incomp ⟨(not_lt_of_ge nhl), nhr.left⟩)
  have IHa := @cmp_compares _ _ h₁.snd h₂.snd
  revert IHa; cases cmp a₁ a₂ <;> intro IHa <;> dsimp at IHa
  case lt => exact oadd_lt_oadd_3 IHa
  case gt => exact oadd_lt_oadd_3 IHa
  subst IHa; exact rfl
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
⊢ (match Ordering.eq, e₁, e₂ with
    | Ordering.lt, a, b => a < b
    | Ordering.eq, a, b => a = b
    | Ordering.gt, a, b => b < a) →
    Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
      (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
[PROOFSTEP]
case eq =>
  intro IHe; dsimp at IHe ; subst IHe
  unfold _root_.cmp; cases nh : cmpUsing (· < ·) (n₁ : ℕ) n₂ <;> rw [cmpUsing, ite_eq_iff, not_lt] at nh
  case lt =>
    cases' nh with nh nh
    · exact oadd_lt_oadd_2 h₁ nh.left
    · rw [ite_eq_iff] at nh ; cases' nh.right with nh nh <;> cases nh <;> contradiction
  case gt =>
    cases' nh with nh nh
    · cases nh; contradiction
    · cases' nh with _ nh
      rw [ite_eq_iff] at nh ; cases' nh with nh nh
      · exact oadd_lt_oadd_2 h₂ nh.left
      · cases nh; contradiction
  cases' nh with nh nh
  · cases nh; contradiction
  cases' nh with nhl nhr
  rw [ite_eq_iff] at nhr
  cases' nhr with nhr nhr
  · cases nhr; contradiction
  obtain rfl := Subtype.eq (eq_of_incomp ⟨(not_lt_of_ge nhl), nhr.left⟩)
  have IHa := @cmp_compares _ _ h₁.snd h₂.snd
  revert IHa; cases cmp a₁ a₂ <;> intro IHa <;> dsimp at IHa
  case lt => exact oadd_lt_oadd_3 IHa
  case gt => exact oadd_lt_oadd_3 IHa
  subst IHa; exact rfl
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
⊢ (match Ordering.eq, e₁, e₂ with
    | Ordering.lt, a, b => a < b
    | Ordering.eq, a, b => a = b
    | Ordering.gt, a, b => b < a) →
    Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
      (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
[PROOFSTEP]
intro IHe
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
IHe :
  match Ordering.eq, e₁, e₂ with
  | Ordering.lt, a, b => a < b
  | Ordering.eq, a, b => a = b
  | Ordering.gt, a, b => b < a
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
[PROOFSTEP]
dsimp at IHe
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h✝ : o₂ = oadd e₂ n₂ a₂
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h₂ : NF (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
IHe : e₁ = e₂
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₂ n₂ a₂) h✝)
[PROOFSTEP]
subst IHe
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse (_root_.cmp ↑n₁ ↑n₂) (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
unfold _root_.cmp
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
⊢ Ordering.Compares
    (Ordering.orElse Ordering.eq (Ordering.orElse (cmpUsing (fun x x_1 => x < x_1) ↑n₁ ↑n₂) (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
cases nh : cmpUsing (· < ·) (n₁ : ℕ) n₂
[GOAL]
case lt
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : cmpUsing (fun x x_1 => x < x_1) ↑n₁ ↑n₂ = Ordering.lt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.lt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
rw [cmpUsing, ite_eq_iff, not_lt] at nh
[GOAL]
case eq
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : cmpUsing (fun x x_1 => x < x_1) ↑n₁ ↑n₂ = Ordering.eq
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
rw [cmpUsing, ite_eq_iff, not_lt] at nh
[GOAL]
case gt
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : cmpUsing (fun x x_1 => x < x_1) ↑n₁ ↑n₂ = Ordering.gt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.gt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
rw [cmpUsing, ite_eq_iff, not_lt] at nh
[GOAL]
case lt
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : ↑n₁ < ↑n₂ ∧ Ordering.lt = Ordering.lt ∨ ↑n₂ ≤ ↑n₁ ∧ (if ↑n₂ < ↑n₁ then Ordering.gt else Ordering.eq) = Ordering.lt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.lt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
case eq
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : ↑n₁ < ↑n₂ ∧ Ordering.lt = Ordering.eq ∨ ↑n₂ ≤ ↑n₁ ∧ (if ↑n₂ < ↑n₁ then Ordering.gt else Ordering.eq) = Ordering.eq
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
case gt
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : ↑n₁ < ↑n₂ ∧ Ordering.lt = Ordering.gt ∨ ↑n₂ ≤ ↑n₁ ∧ (if ↑n₂ < ↑n₁ then Ordering.gt else Ordering.eq) = Ordering.gt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.gt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
case lt =>
  cases' nh with nh nh
  · exact oadd_lt_oadd_2 h₁ nh.left
  · rw [ite_eq_iff] at nh ; cases' nh.right with nh nh <;> cases nh <;> contradiction
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : ↑n₁ < ↑n₂ ∧ Ordering.lt = Ordering.lt ∨ ↑n₂ ≤ ↑n₁ ∧ (if ↑n₂ < ↑n₁ then Ordering.gt else Ordering.eq) = Ordering.lt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.lt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
case lt =>
  cases' nh with nh nh
  · exact oadd_lt_oadd_2 h₁ nh.left
  · rw [ite_eq_iff] at nh ; cases' nh.right with nh nh <;> cases nh <;> contradiction
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : ↑n₁ < ↑n₂ ∧ Ordering.lt = Ordering.lt ∨ ↑n₂ ≤ ↑n₁ ∧ (if ↑n₂ < ↑n₁ then Ordering.gt else Ordering.eq) = Ordering.lt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.lt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
cases' nh with nh nh
[GOAL]
case inl
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : ↑n₁ < ↑n₂ ∧ Ordering.lt = Ordering.lt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.lt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
exact oadd_lt_oadd_2 h₁ nh.left
[GOAL]
case inr
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : ↑n₂ ≤ ↑n₁ ∧ (if ↑n₂ < ↑n₁ then Ordering.gt else Ordering.eq) = Ordering.lt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.lt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
rw [ite_eq_iff] at nh
[GOAL]
case inr
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : ↑n₂ ≤ ↑n₁ ∧ (↑n₂ < ↑n₁ ∧ Ordering.gt = Ordering.lt ∨ ¬↑n₂ < ↑n₁ ∧ Ordering.eq = Ordering.lt)
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.lt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
cases' nh.right with nh nh
[GOAL]
case inr.inl
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh✝ : ↑n₂ ≤ ↑n₁ ∧ (↑n₂ < ↑n₁ ∧ Ordering.gt = Ordering.lt ∨ ¬↑n₂ < ↑n₁ ∧ Ordering.eq = Ordering.lt)
nh : ↑n₂ < ↑n₁ ∧ Ordering.gt = Ordering.lt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.lt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
cases nh
[GOAL]
case inr.inr
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh✝ : ↑n₂ ≤ ↑n₁ ∧ (↑n₂ < ↑n₁ ∧ Ordering.gt = Ordering.lt ∨ ¬↑n₂ < ↑n₁ ∧ Ordering.eq = Ordering.lt)
nh : ¬↑n₂ < ↑n₁ ∧ Ordering.eq = Ordering.lt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.lt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
cases nh
[GOAL]
case inr.inl.intro
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : ↑n₂ ≤ ↑n₁ ∧ (↑n₂ < ↑n₁ ∧ Ordering.gt = Ordering.lt ∨ ¬↑n₂ < ↑n₁ ∧ Ordering.eq = Ordering.lt)
left✝ : ↑n₂ < ↑n₁
right✝ : Ordering.gt = Ordering.lt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.lt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
contradiction
[GOAL]
case inr.inr.intro
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : ↑n₂ ≤ ↑n₁ ∧ (↑n₂ < ↑n₁ ∧ Ordering.gt = Ordering.lt ∨ ¬↑n₂ < ↑n₁ ∧ Ordering.eq = Ordering.lt)
left✝ : ¬↑n₂ < ↑n₁
right✝ : Ordering.eq = Ordering.lt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.lt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
contradiction
[GOAL]
case eq
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : ↑n₁ < ↑n₂ ∧ Ordering.lt = Ordering.eq ∨ ↑n₂ ≤ ↑n₁ ∧ (if ↑n₂ < ↑n₁ then Ordering.gt else Ordering.eq) = Ordering.eq
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
case gt
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : ↑n₁ < ↑n₂ ∧ Ordering.lt = Ordering.gt ∨ ↑n₂ ≤ ↑n₁ ∧ (if ↑n₂ < ↑n₁ then Ordering.gt else Ordering.eq) = Ordering.gt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.gt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
case gt =>
  cases' nh with nh nh
  · cases nh; contradiction
  · cases' nh with _ nh
    rw [ite_eq_iff] at nh ; cases' nh with nh nh
    · exact oadd_lt_oadd_2 h₂ nh.left
    · cases nh; contradiction
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : ↑n₁ < ↑n₂ ∧ Ordering.lt = Ordering.gt ∨ ↑n₂ ≤ ↑n₁ ∧ (if ↑n₂ < ↑n₁ then Ordering.gt else Ordering.eq) = Ordering.gt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.gt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
case gt =>
  cases' nh with nh nh
  · cases nh; contradiction
  · cases' nh with _ nh
    rw [ite_eq_iff] at nh ; cases' nh with nh nh
    · exact oadd_lt_oadd_2 h₂ nh.left
    · cases nh; contradiction
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : ↑n₁ < ↑n₂ ∧ Ordering.lt = Ordering.gt ∨ ↑n₂ ≤ ↑n₁ ∧ (if ↑n₂ < ↑n₁ then Ordering.gt else Ordering.eq) = Ordering.gt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.gt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
cases' nh with nh nh
[GOAL]
case inl
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : ↑n₁ < ↑n₂ ∧ Ordering.lt = Ordering.gt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.gt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
cases nh
[GOAL]
case inl.intro
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
left✝ : ↑n₁ < ↑n₂
right✝ : Ordering.lt = Ordering.gt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.gt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
contradiction
[GOAL]
case inr
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : ↑n₂ ≤ ↑n₁ ∧ (if ↑n₂ < ↑n₁ then Ordering.gt else Ordering.eq) = Ordering.gt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.gt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
cases' nh with _ nh
[GOAL]
case inr.intro
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
left✝ : ↑n₂ ≤ ↑n₁
nh : (if ↑n₂ < ↑n₁ then Ordering.gt else Ordering.eq) = Ordering.gt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.gt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
rw [ite_eq_iff] at nh
[GOAL]
case inr.intro
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
left✝ : ↑n₂ ≤ ↑n₁
nh : ↑n₂ < ↑n₁ ∧ Ordering.gt = Ordering.gt ∨ ¬↑n₂ < ↑n₁ ∧ Ordering.eq = Ordering.gt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.gt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
cases' nh with nh nh
[GOAL]
case inr.intro.inl
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
left✝ : ↑n₂ ≤ ↑n₁
nh : ↑n₂ < ↑n₁ ∧ Ordering.gt = Ordering.gt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.gt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
exact oadd_lt_oadd_2 h₂ nh.left
[GOAL]
case inr.intro.inr
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
left✝ : ↑n₂ ≤ ↑n₁
nh : ¬↑n₂ < ↑n₁ ∧ Ordering.eq = Ordering.gt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.gt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
cases nh
[GOAL]
case inr.intro.inr.intro
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
left✝¹ : ↑n₂ ≤ ↑n₁
left✝ : ¬↑n₂ < ↑n₁
right✝ : Ordering.eq = Ordering.gt
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.gt (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
contradiction
[GOAL]
case eq
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : ↑n₁ < ↑n₂ ∧ Ordering.lt = Ordering.eq ∨ ↑n₂ ≤ ↑n₁ ∧ (if ↑n₂ < ↑n₁ then Ordering.gt else Ordering.eq) = Ordering.eq
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
cases' nh with nh nh
[GOAL]
case eq.inl
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : ↑n₁ < ↑n₂ ∧ Ordering.lt = Ordering.eq
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
cases nh
[GOAL]
case eq.inl.intro
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
left✝ : ↑n₁ < ↑n₂
right✝ : Ordering.lt = Ordering.eq
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
contradiction
[GOAL]
case eq.inr
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nh : ↑n₂ ≤ ↑n₁ ∧ (if ↑n₂ < ↑n₁ then Ordering.gt else Ordering.eq) = Ordering.eq
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
cases' nh with nhl nhr
[GOAL]
case eq.inr.intro
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nhl : ↑n₂ ≤ ↑n₁
nhr : (if ↑n₂ < ↑n₁ then Ordering.gt else Ordering.eq) = Ordering.eq
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
rw [ite_eq_iff] at nhr
[GOAL]
case eq.inr.intro
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nhl : ↑n₂ ≤ ↑n₁
nhr : ↑n₂ < ↑n₁ ∧ Ordering.gt = Ordering.eq ∨ ¬↑n₂ < ↑n₁ ∧ Ordering.eq = Ordering.eq
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
cases' nhr with nhr nhr
[GOAL]
case eq.inr.intro.inl
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nhl : ↑n₂ ≤ ↑n₁
nhr : ↑n₂ < ↑n₁ ∧ Ordering.gt = Ordering.eq
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
cases nhr
[GOAL]
case eq.inr.intro.inl.intro
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nhl : ↑n₂ ≤ ↑n₁
left✝ : ↑n₂ < ↑n₁
right✝ : Ordering.gt = Ordering.eq
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
contradiction
[GOAL]
case eq.inr.intro.inr
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₂ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
nhl : ↑n₂ ≤ ↑n₁
nhr : ¬↑n₂ < ↑n₁ ∧ Ordering.eq = Ordering.eq
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₂ a₂) h✝)
[PROOFSTEP]
obtain rfl := Subtype.eq (eq_of_incomp ⟨(not_lt_of_ge nhl), nhr.left⟩)
[GOAL]
case eq.inr.intro.inr
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₁ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
[PROOFSTEP]
have IHa := @cmp_compares _ _ h₁.snd h₂.snd
[GOAL]
case eq.inr.intro.inr
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₁ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
IHa : Ordering.Compares (cmp a₁ a₂) a₁ a₂
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₂)))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
[PROOFSTEP]
revert IHa
[GOAL]
case eq.inr.intro.inr
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₁ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
⊢ Ordering.Compares (cmp a₁ a₂) a₁ a₂ →
    Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq (cmp a₁ a₂)))
      (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
[PROOFSTEP]
cases cmp a₁ a₂
[GOAL]
case eq.inr.intro.inr.lt
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₁ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
⊢ Ordering.Compares Ordering.lt a₁ a₂ →
    Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq Ordering.lt))
      (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
[PROOFSTEP]
intro IHa
[GOAL]
case eq.inr.intro.inr.eq
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₁ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
⊢ Ordering.Compares Ordering.eq a₁ a₂ →
    Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq Ordering.eq))
      (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
[PROOFSTEP]
intro IHa
[GOAL]
case eq.inr.intro.inr.gt
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₁ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
⊢ Ordering.Compares Ordering.gt a₁ a₂ →
    Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq Ordering.gt))
      (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
[PROOFSTEP]
intro IHa
[GOAL]
case eq.inr.intro.inr.lt
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₁ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
IHa : Ordering.Compares Ordering.lt a₁ a₂
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq Ordering.lt))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
[PROOFSTEP]
dsimp at IHa
[GOAL]
case eq.inr.intro.inr.eq
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₁ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
IHa : Ordering.Compares Ordering.eq a₁ a₂
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq Ordering.eq))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
[PROOFSTEP]
dsimp at IHa
[GOAL]
case eq.inr.intro.inr.gt
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₁ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
IHa : Ordering.Compares Ordering.gt a₁ a₂
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq Ordering.gt))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
[PROOFSTEP]
dsimp at IHa
[GOAL]
case eq.inr.intro.inr.lt
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₁ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
IHa : a₁ < a₂
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq Ordering.lt))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
case eq.inr.intro.inr.eq
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₁ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
IHa : a₁ = a₂
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq Ordering.eq))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
case eq.inr.intro.inr.gt
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₁ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
IHa : a₁ > a₂
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq Ordering.gt))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
[PROOFSTEP]
case lt => exact oadd_lt_oadd_3 IHa
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₁ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
IHa : a₁ < a₂
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq Ordering.lt))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
[PROOFSTEP]
case lt => exact oadd_lt_oadd_3 IHa
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₁ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
IHa : a₁ < a₂
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq Ordering.lt))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
[PROOFSTEP]
exact oadd_lt_oadd_3 IHa
[GOAL]
case eq.inr.intro.inr.eq
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₁ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
IHa : a₁ = a₂
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq Ordering.eq))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
case eq.inr.intro.inr.gt
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₁ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
IHa : a₁ > a₂
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq Ordering.gt))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
[PROOFSTEP]
case gt => exact oadd_lt_oadd_3 IHa
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₁ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
IHa : a₁ > a₂
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq Ordering.gt))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
[PROOFSTEP]
case gt => exact oadd_lt_oadd_3 IHa
[GOAL]
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₁ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
IHa : a₁ > a₂
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq Ordering.gt))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
[PROOFSTEP]
exact oadd_lt_oadd_3 IHa
[GOAL]
case eq.inr.intro.inr.eq
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ a₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
h✝ : o₂ = oadd e₁ n₁ a₂
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
IHa : a₁ = a₂
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq Ordering.eq))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₂) h✝)
[PROOFSTEP]
subst IHa
[GOAL]
case eq.inr.intro.inr.eq
o₁ e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h✝¹ : o₁ = oadd e₁ n₁ a₁
o₂ : ONote
h₁ : NF (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹)
nhl : ↑n₁ ≤ ↑n₁
nhr : ¬↑n₁ < ↑n₁ ∧ Ordering.eq = Ordering.eq
h✝ : o₂ = oadd e₁ n₁ a₁
h₂ : NF (namedPattern o₂ (oadd e₁ n₁ a₁) h✝)
⊢ Ordering.Compares (Ordering.orElse Ordering.eq (Ordering.orElse Ordering.eq Ordering.eq))
    (namedPattern o₁ (oadd e₁ n₁ a₁) h✝¹) (namedPattern o₂ (oadd e₁ n₁ a₁) h✝)
[PROOFSTEP]
exact rfl
[GOAL]
b : Ordinal.{0}
e : ONote
n : ℕ+
a : ONote
h : NF (ONote.oadd e n a)
d : ω ^ b ∣ repr (ONote.oadd e n a)
⊢ b ≤ repr e ∧ ω ^ b ∣ repr a
[PROOFSTEP]
have := mt repr_inj.1 (fun h => by injection h : ONote.oadd e n a ≠ 0)
[GOAL]
b : Ordinal.{0}
e : ONote
n : ℕ+
a : ONote
h✝ : NF (ONote.oadd e n a)
d : ω ^ b ∣ repr (ONote.oadd e n a)
h : ONote.oadd e n a = 0
⊢ False
[PROOFSTEP]
injection h
[GOAL]
b : Ordinal.{0}
e : ONote
n : ℕ+
a : ONote
h : NF (ONote.oadd e n a)
d : ω ^ b ∣ repr (ONote.oadd e n a)
this : ¬repr (ONote.oadd e n a) = repr 0
⊢ b ≤ repr e ∧ ω ^ b ∣ repr a
[PROOFSTEP]
have L := le_of_not_lt fun l => not_le_of_lt (h.below_of_lt l).repr_lt (le_of_dvd this d)
[GOAL]
b : Ordinal.{0}
e : ONote
n : ℕ+
a : ONote
h : NF (ONote.oadd e n a)
d : ω ^ b ∣ repr (ONote.oadd e n a)
this : ¬repr (ONote.oadd e n a) = repr 0
L : b ≤ repr e
⊢ b ≤ repr e ∧ ω ^ b ∣ repr a
[PROOFSTEP]
simp at d
[GOAL]
b : Ordinal.{0}
e : ONote
n : ℕ+
a : ONote
h : NF (ONote.oadd e n a)
d : ω ^ b ∣ ω ^ repr e * ↑↑n + repr a
this : ¬repr (ONote.oadd e n a) = repr 0
L : b ≤ repr e
⊢ b ≤ repr e ∧ ω ^ b ∣ repr a
[PROOFSTEP]
exact ⟨L, (dvd_add_iff <| (opow_dvd_opow _ L).mul_right _).1 d⟩
[GOAL]
e : ONote
n : ℕ+
a : ONote
h : NF (ONote.oadd e n a)
⊢ ω ∣ repr (ONote.oadd e n a) → repr e ≠ 0 ∧ ω ∣ repr a
[PROOFSTEP]
rw [← opow_one ω, ← one_le_iff_ne_zero]
[GOAL]
e : ONote
n : ℕ+
a : ONote
h : NF (ONote.oadd e n a)
⊢ ω ^ 1 ∣ repr (ONote.oadd e n a) → 1 ≤ repr e ∧ ω ^ 1 ∣ repr a
[PROOFSTEP]
exact h.of_dvd_omega_opow
[GOAL]
⊢ DecidableRel TopBelow
[PROOFSTEP]
intro b o
[GOAL]
b o : ONote
⊢ Decidable (TopBelow b o)
[PROOFSTEP]
cases o
[GOAL]
case zero
b : ONote
⊢ Decidable (TopBelow b zero)
[PROOFSTEP]
delta TopBelow
[GOAL]
case oadd
b a✝² : ONote
a✝¹ : ℕ+
a✝ : ONote
⊢ Decidable (TopBelow b (oadd a✝² a✝¹ a✝))
[PROOFSTEP]
delta TopBelow
[GOAL]
case zero
b : ONote
⊢ Decidable
    (match zero with
    | zero => True
    | oadd e a a_1 => cmp e b = Ordering.lt)
[PROOFSTEP]
infer_instance
[GOAL]
case oadd
b a✝² : ONote
a✝¹ : ℕ+
a✝ : ONote
⊢ Decidable
    (match oadd a✝² a✝¹ a✝ with
    | zero => True
    | oadd e a a_1 => cmp e b = Ordering.lt)
[PROOFSTEP]
infer_instance
[GOAL]
e : ONote
n : ℕ+
a : ONote
⊢ Decidable (NF (oadd e n a))
[PROOFSTEP]
have := decidableNF e
[GOAL]
e : ONote
n : ℕ+
a : ONote
this : Decidable (NF e)
⊢ Decidable (NF (oadd e n a))
[PROOFSTEP]
have := decidableNF a
[GOAL]
e : ONote
n : ℕ+
a : ONote
this✝ : Decidable (NF e)
this : Decidable (NF a)
⊢ Decidable (NF (oadd e n a))
[PROOFSTEP]
apply decidable_of_iff (NF e ∧ NF a ∧ TopBelow e a)
[GOAL]
case h
e : ONote
n : ℕ+
a : ONote
this✝ : Decidable (NF e)
this : Decidable (NF a)
⊢ NF e ∧ NF a ∧ TopBelow e a ↔ NF (oadd e n a)
[PROOFSTEP]
rw [← and_congr_right fun h => @nfBelow_iff_topBelow _ h _]
[GOAL]
case h
e : ONote
n : ℕ+
a : ONote
this✝ : Decidable (NF e)
this : Decidable (NF a)
⊢ NF e ∧ NFBelow a (repr e) ↔ NF (oadd e n a)
[PROOFSTEP]
exact ⟨fun ⟨h₁, h₂⟩ => NF.oadd h₁ n h₂, fun h => ⟨h.fst, h.snd'⟩⟩
[GOAL]
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
⊢ NFBelow (oadd e n a + o) b
[PROOFSTEP]
have h' := add_nfBelow (h₁.snd.mono <| le_of_lt h₁.lt) h₂
[GOAL]
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
h' : NFBelow (a + o) b
⊢ NFBelow (oadd e n a + o) b
[PROOFSTEP]
simp [oadd_add]
[GOAL]
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
h' : NFBelow (a + o) b
⊢ NFBelow (addAux e n (a + o)) b
[PROOFSTEP]
revert h'
[GOAL]
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
⊢ NFBelow (a + o) b → NFBelow (addAux e n (a + o)) b
[PROOFSTEP]
cases' a + o with e' n' a'
[GOAL]
case zero
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
⊢ NFBelow zero b → NFBelow (addAux e n zero) b
[PROOFSTEP]
intro h'
[GOAL]
case oadd
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
e' : ONote
n' : ℕ+
a' : ONote
⊢ NFBelow (oadd e' n' a') b → NFBelow (addAux e n (oadd e' n' a')) b
[PROOFSTEP]
intro h'
[GOAL]
case zero
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
h' : NFBelow zero b
⊢ NFBelow (addAux e n zero) b
[PROOFSTEP]
exact NFBelow.oadd h₁.fst NFBelow.zero h₁.lt
[GOAL]
case oadd
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
e' : ONote
n' : ℕ+
a' : ONote
h' : NFBelow (oadd e' n' a') b
⊢ NFBelow (addAux e n (oadd e' n' a')) b
[PROOFSTEP]
have : ((e.cmp e').Compares e e') := @cmp_compares _ _ h₁.fst h'.fst
[GOAL]
case oadd
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
e' : ONote
n' : ℕ+
a' : ONote
h' : NFBelow (oadd e' n' a') b
this : Ordering.Compares (cmp e e') e e'
⊢ NFBelow (addAux e n (oadd e' n' a')) b
[PROOFSTEP]
cases h : cmp e e'
[GOAL]
case oadd.lt
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
e' : ONote
n' : ℕ+
a' : ONote
h' : NFBelow (oadd e' n' a') b
this : Ordering.Compares (cmp e e') e e'
h : cmp e e' = Ordering.lt
⊢ NFBelow (addAux e n (oadd e' n' a')) b
[PROOFSTEP]
dsimp [addAux]
[GOAL]
case oadd.eq
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
e' : ONote
n' : ℕ+
a' : ONote
h' : NFBelow (oadd e' n' a') b
this : Ordering.Compares (cmp e e') e e'
h : cmp e e' = Ordering.eq
⊢ NFBelow (addAux e n (oadd e' n' a')) b
[PROOFSTEP]
dsimp [addAux]
[GOAL]
case oadd.gt
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
e' : ONote
n' : ℕ+
a' : ONote
h' : NFBelow (oadd e' n' a') b
this : Ordering.Compares (cmp e e') e e'
h : cmp e e' = Ordering.gt
⊢ NFBelow (addAux e n (oadd e' n' a')) b
[PROOFSTEP]
dsimp [addAux]
[GOAL]
case oadd.lt
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
e' : ONote
n' : ℕ+
a' : ONote
h' : NFBelow (oadd e' n' a') b
this : Ordering.Compares (cmp e e') e e'
h : cmp e e' = Ordering.lt
⊢ NFBelow
    (match cmp e e' with
    | Ordering.lt => oadd e' n' a'
    | Ordering.eq => oadd e (n + n') a'
    | Ordering.gt => oadd e n (oadd e' n' a'))
    b
[PROOFSTEP]
simp [h]
[GOAL]
case oadd.eq
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
e' : ONote
n' : ℕ+
a' : ONote
h' : NFBelow (oadd e' n' a') b
this : Ordering.Compares (cmp e e') e e'
h : cmp e e' = Ordering.eq
⊢ NFBelow
    (match cmp e e' with
    | Ordering.lt => oadd e' n' a'
    | Ordering.eq => oadd e (n + n') a'
    | Ordering.gt => oadd e n (oadd e' n' a'))
    b
[PROOFSTEP]
simp [h]
[GOAL]
case oadd.gt
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
e' : ONote
n' : ℕ+
a' : ONote
h' : NFBelow (oadd e' n' a') b
this : Ordering.Compares (cmp e e') e e'
h : cmp e e' = Ordering.gt
⊢ NFBelow
    (match cmp e e' with
    | Ordering.lt => oadd e' n' a'
    | Ordering.eq => oadd e (n + n') a'
    | Ordering.gt => oadd e n (oadd e' n' a'))
    b
[PROOFSTEP]
simp [h]
[GOAL]
case oadd.lt
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
e' : ONote
n' : ℕ+
a' : ONote
h' : NFBelow (oadd e' n' a') b
this : Ordering.Compares (cmp e e') e e'
h : cmp e e' = Ordering.lt
⊢ NFBelow (oadd e' n' a') b
[PROOFSTEP]
exact h'
[GOAL]
case oadd.eq
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
e' : ONote
n' : ℕ+
a' : ONote
h' : NFBelow (oadd e' n' a') b
this : Ordering.Compares (cmp e e') e e'
h : cmp e e' = Ordering.eq
⊢ NFBelow (oadd e (n + n') a') b
[PROOFSTEP]
simp [h] at this
[GOAL]
case oadd.eq
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
e' : ONote
n' : ℕ+
a' : ONote
h' : NFBelow (oadd e' n' a') b
h : cmp e e' = Ordering.eq
this : e = e'
⊢ NFBelow (oadd e (n + n') a') b
[PROOFSTEP]
subst e'
[GOAL]
case oadd.eq
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
n' : ℕ+
a' : ONote
h' : NFBelow (oadd e n' a') b
h : cmp e e = Ordering.eq
⊢ NFBelow (oadd e (n + n') a') b
[PROOFSTEP]
exact NFBelow.oadd h'.fst h'.snd h'.lt
[GOAL]
case oadd.gt
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
e' : ONote
n' : ℕ+
a' : ONote
h' : NFBelow (oadd e' n' a') b
this : Ordering.Compares (cmp e e') e e'
h : cmp e e' = Ordering.gt
⊢ NFBelow (oadd e n (oadd e' n' a')) b
[PROOFSTEP]
simp [h] at this
[GOAL]
case oadd.gt
b : Ordinal.{0}
e : ONote
n : ℕ+
a o : ONote
h₁ : NFBelow (oadd e n a) b
h₂ : NFBelow o b
e' : ONote
n' : ℕ+
a' : ONote
h' : NFBelow (oadd e' n' a') b
h : cmp e e' = Ordering.gt
this : e' < e
⊢ NFBelow (oadd e n (oadd e' n' a')) b
[PROOFSTEP]
exact NFBelow.oadd h₁.fst (NF.below_of_lt this ⟨⟨_, h'⟩⟩) h₁.lt
[GOAL]
o : ONote
x✝¹ : NF 0
x✝ : NF o
⊢ repr (0 + o) = repr 0 + repr o
[PROOFSTEP]
simp
[GOAL]
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
⊢ repr (oadd e n a + o) = repr (oadd e n a) + repr o
[PROOFSTEP]
haveI := h₁.snd
[GOAL]
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this : NF a
⊢ repr (oadd e n a + o) = repr (oadd e n a) + repr o
[PROOFSTEP]
have h' := repr_add a o
[GOAL]
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this : NF a
h' : repr (a + o) = repr a + repr o
⊢ repr (oadd e n a + o) = repr (oadd e n a) + repr o
[PROOFSTEP]
conv_lhs at h' => simp [HAdd.hAdd, Add.add]
[GOAL]
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this : NF a
h' : repr (a + o) = repr a + repr o
| repr (a + o)
[PROOFSTEP]
simp [HAdd.hAdd, Add.add]
[GOAL]
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this : NF a
h' : repr (a + o) = repr a + repr o
| repr (a + o)
[PROOFSTEP]
simp [HAdd.hAdd, Add.add]
[GOAL]
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this : NF a
h' : repr (a + o) = repr a + repr o
| repr (a + o)
[PROOFSTEP]
simp [HAdd.hAdd, Add.add]
[GOAL]
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this : NF a
h' : repr (add a o) = repr a + repr o
⊢ repr (oadd e n a + o) = repr (oadd e n a) + repr o
[PROOFSTEP]
have nf := ONote.add_nf a o
[GOAL]
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this : NF a
h' : repr (add a o) = repr a + repr o
nf : NF (a + o)
⊢ repr (oadd e n a + o) = repr (oadd e n a) + repr o
[PROOFSTEP]
conv at nf => simp [HAdd.hAdd, Add.add]
[GOAL]
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this : NF a
h' : repr (add a o) = repr a + repr o
nf : NF (a + o)
| NF (a + o)
[PROOFSTEP]
simp [HAdd.hAdd, Add.add]
[GOAL]
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this : NF a
h' : repr (add a o) = repr a + repr o
nf : NF (a + o)
| NF (a + o)
[PROOFSTEP]
simp [HAdd.hAdd, Add.add]
[GOAL]
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this : NF a
h' : repr (add a o) = repr a + repr o
nf : NF (a + o)
| NF (a + o)
[PROOFSTEP]
simp [HAdd.hAdd, Add.add]
[GOAL]
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this : NF a
h' : repr (add a o) = repr a + repr o
nf : NF (add a o)
⊢ repr (oadd e n a + o) = repr (oadd e n a) + repr o
[PROOFSTEP]
conv in _ + o => simp [HAdd.hAdd, Add.add]
[GOAL]
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this : NF a
h' : repr (add a o) = repr a + repr o
nf : NF (add a o)
| oadd e n a + o
[PROOFSTEP]
simp [HAdd.hAdd, Add.add]
[GOAL]
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this : NF a
h' : repr (add a o) = repr a + repr o
nf : NF (add a o)
| oadd e n a + o
[PROOFSTEP]
simp [HAdd.hAdd, Add.add]
[GOAL]
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this : NF a
h' : repr (add a o) = repr a + repr o
nf : NF (add a o)
| oadd e n a + o
[PROOFSTEP]
simp [HAdd.hAdd, Add.add]
[GOAL]
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this : NF a
h' : repr (add a o) = repr a + repr o
nf : NF (add a o)
⊢ repr (add (oadd e n a) o) = repr (oadd e n a) + repr o
[PROOFSTEP]
cases' h : add a o with e' n' a'
[GOAL]
case zero
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this : NF a
h' : repr (add a o) = repr a + repr o
nf : NF (add a o)
h : add a o = zero
⊢ repr (add (oadd e n a) o) = repr (oadd e n a) + repr o
[PROOFSTEP]
simp only [Add.add, add, addAux, h'.symm, h, add_assoc, repr] at nf h₁ ⊢
[GOAL]
case oadd
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this : NF a
h' : repr (add a o) = repr a + repr o
nf : NF (add a o)
e' : ONote
n' : ℕ+
a' : ONote
h : add a o = oadd e' n' a'
⊢ repr (add (oadd e n a) o) = repr (oadd e n a) + repr o
[PROOFSTEP]
simp only [Add.add, add, addAux, h'.symm, h, add_assoc, repr] at nf h₁ ⊢
[GOAL]
case oadd
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this : NF a
h' : repr (add a o) = repr a + repr o
e' : ONote
n' : ℕ+
a' : ONote
h : add a o = oadd e' n' a'
nf : NF (oadd e' n' a')
⊢ repr
      (match cmp e e' with
      | Ordering.lt => oadd e' n' a'
      | Ordering.eq => oadd e (n + n') a'
      | Ordering.gt => oadd e n (oadd e' n' a')) =
    ω ^ repr e * ↑↑n + (ω ^ repr e' * ↑↑n' + repr a')
[PROOFSTEP]
have := h₁.fst
[GOAL]
case oadd
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this✝ : NF a
h' : repr (add a o) = repr a + repr o
e' : ONote
n' : ℕ+
a' : ONote
h : add a o = oadd e' n' a'
nf : NF (oadd e' n' a')
this : NF e
⊢ repr
      (match cmp e e' with
      | Ordering.lt => oadd e' n' a'
      | Ordering.eq => oadd e (n + n') a'
      | Ordering.gt => oadd e n (oadd e' n' a')) =
    ω ^ repr e * ↑↑n + (ω ^ repr e' * ↑↑n' + repr a')
[PROOFSTEP]
haveI := nf.fst
[GOAL]
case oadd
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this✝¹ : NF a
h' : repr (add a o) = repr a + repr o
e' : ONote
n' : ℕ+
a' : ONote
h : add a o = oadd e' n' a'
nf : NF (oadd e' n' a')
this✝ : NF e
this : NF e'
⊢ repr
      (match cmp e e' with
      | Ordering.lt => oadd e' n' a'
      | Ordering.eq => oadd e (n + n') a'
      | Ordering.gt => oadd e n (oadd e' n' a')) =
    ω ^ repr e * ↑↑n + (ω ^ repr e' * ↑↑n' + repr a')
[PROOFSTEP]
have ee := cmp_compares e e'
[GOAL]
case oadd
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this✝¹ : NF a
h' : repr (add a o) = repr a + repr o
e' : ONote
n' : ℕ+
a' : ONote
h : add a o = oadd e' n' a'
nf : NF (oadd e' n' a')
this✝ : NF e
this : NF e'
ee : Ordering.Compares (cmp e e') e e'
⊢ repr
      (match cmp e e' with
      | Ordering.lt => oadd e' n' a'
      | Ordering.eq => oadd e (n + n') a'
      | Ordering.gt => oadd e n (oadd e' n' a')) =
    ω ^ repr e * ↑↑n + (ω ^ repr e' * ↑↑n' + repr a')
[PROOFSTEP]
cases he : cmp e e'
[GOAL]
case oadd.lt
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this✝¹ : NF a
h' : repr (add a o) = repr a + repr o
e' : ONote
n' : ℕ+
a' : ONote
h : add a o = oadd e' n' a'
nf : NF (oadd e' n' a')
this✝ : NF e
this : NF e'
ee : Ordering.Compares (cmp e e') e e'
he : cmp e e' = Ordering.lt
⊢ repr
      (match Ordering.lt with
      | Ordering.lt => oadd e' n' a'
      | Ordering.eq => oadd e (n + n') a'
      | Ordering.gt => oadd e n (oadd e' n' a')) =
    ω ^ repr e * ↑↑n + (ω ^ repr e' * ↑↑n' + repr a')
[PROOFSTEP]
simp [he] at ee ⊢
[GOAL]
case oadd.eq
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this✝¹ : NF a
h' : repr (add a o) = repr a + repr o
e' : ONote
n' : ℕ+
a' : ONote
h : add a o = oadd e' n' a'
nf : NF (oadd e' n' a')
this✝ : NF e
this : NF e'
ee : Ordering.Compares (cmp e e') e e'
he : cmp e e' = Ordering.eq
⊢ repr
      (match Ordering.eq with
      | Ordering.lt => oadd e' n' a'
      | Ordering.eq => oadd e (n + n') a'
      | Ordering.gt => oadd e n (oadd e' n' a')) =
    ω ^ repr e * ↑↑n + (ω ^ repr e' * ↑↑n' + repr a')
[PROOFSTEP]
simp [he] at ee ⊢
[GOAL]
case oadd.gt
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this✝¹ : NF a
h' : repr (add a o) = repr a + repr o
e' : ONote
n' : ℕ+
a' : ONote
h : add a o = oadd e' n' a'
nf : NF (oadd e' n' a')
this✝ : NF e
this : NF e'
ee : Ordering.Compares (cmp e e') e e'
he : cmp e e' = Ordering.gt
⊢ repr
      (match Ordering.gt with
      | Ordering.lt => oadd e' n' a'
      | Ordering.eq => oadd e (n + n') a'
      | Ordering.gt => oadd e n (oadd e' n' a')) =
    ω ^ repr e * ↑↑n + (ω ^ repr e' * ↑↑n' + repr a')
[PROOFSTEP]
simp [he] at ee ⊢
[GOAL]
case oadd.lt
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this✝¹ : NF a
h' : repr (add a o) = repr a + repr o
e' : ONote
n' : ℕ+
a' : ONote
h : add a o = oadd e' n' a'
nf : NF (oadd e' n' a')
this✝ : NF e
this : NF e'
he : cmp e e' = Ordering.lt
ee : e < e'
⊢ ω ^ repr e' * ↑↑n' + repr a' = ω ^ repr e * ↑↑n + (ω ^ repr e' * ↑↑n' + repr a')
[PROOFSTEP]
rw [← add_assoc, @add_absorp _ (repr e') (ω ^ repr e' * (n' : ℕ))]
[GOAL]
case oadd.lt.h₁
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this✝¹ : NF a
h' : repr (add a o) = repr a + repr o
e' : ONote
n' : ℕ+
a' : ONote
h : add a o = oadd e' n' a'
nf : NF (oadd e' n' a')
this✝ : NF e
this : NF e'
he : cmp e e' = Ordering.lt
ee : e < e'
⊢ ω ^ repr e * ↑↑n < ω ^ repr e'
[PROOFSTEP]
have := (h₁.below_of_lt ee).repr_lt
[GOAL]
case oadd.lt.h₁
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this✝² : NF a
h' : repr (add a o) = repr a + repr o
e' : ONote
n' : ℕ+
a' : ONote
h : add a o = oadd e' n' a'
nf : NF (oadd e' n' a')
this✝¹ : NF e
this✝ : NF e'
he : cmp e e' = Ordering.lt
ee : e < e'
this : repr (oadd e n a) < ω ^ repr e'
⊢ ω ^ repr e * ↑↑n < ω ^ repr e'
[PROOFSTEP]
unfold repr at this
[GOAL]
case oadd.lt.h₁
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this✝² : NF a
h' : repr (add a o) = repr a + repr o
e' : ONote
n' : ℕ+
a' : ONote
h : add a o = oadd e' n' a'
nf : NF (oadd e' n' a')
this✝¹ : NF e
this✝ : NF e'
he : cmp e e' = Ordering.lt
ee : e < e'
this :
  ω ^ repr e * ↑↑n + repr a <
    ω ^
      match e' with
      | zero => 0
      | oadd e n a => ω ^ repr e * ↑↑n + repr a
⊢ ω ^ repr e * ↑↑n < ω ^ repr e'
[PROOFSTEP]
cases he' : e'
[GOAL]
case oadd.lt.h₁.zero
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this✝² : NF a
h' : repr (add a o) = repr a + repr o
e' : ONote
n' : ℕ+
a' : ONote
h : add a o = oadd e' n' a'
nf : NF (oadd e' n' a')
this✝¹ : NF e
this✝ : NF e'
he : cmp e e' = Ordering.lt
ee : e < e'
this :
  ω ^ repr e * ↑↑n + repr a <
    ω ^
      match e' with
      | zero => 0
      | oadd e n a => ω ^ repr e * ↑↑n + repr a
he' : e' = zero
⊢ ω ^ repr e * ↑↑n < ω ^ repr zero
[PROOFSTEP]
simp [he'] at this ⊢
[GOAL]
case oadd.lt.h₁.oadd
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this✝² : NF a
h' : repr (add a o) = repr a + repr o
e' : ONote
n' : ℕ+
a' : ONote
h : add a o = oadd e' n' a'
nf : NF (oadd e' n' a')
this✝¹ : NF e
this✝ : NF e'
he : cmp e e' = Ordering.lt
ee : e < e'
this :
  ω ^ repr e * ↑↑n + repr a <
    ω ^
      match e' with
      | zero => 0
      | oadd e n a => ω ^ repr e * ↑↑n + repr a
a✝² : ONote
a✝¹ : ℕ+
a✝ : ONote
he' : e' = oadd a✝² a✝¹ a✝
⊢ ω ^ repr e * ↑↑n < ω ^ repr (oadd a✝² a✝¹ a✝)
[PROOFSTEP]
simp [he'] at this ⊢
[GOAL]
case oadd.lt.h₁.zero
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this✝² : NF a
h' : repr (add a o) = repr a + repr o
e' : ONote
n' : ℕ+
a' : ONote
h : add a o = oadd e' n' a'
nf : NF (oadd e' n' a')
this✝¹ : NF e
this✝ : NF e'
he : cmp e e' = Ordering.lt
ee : e < e'
he' : e' = zero
this : ω ^ repr e * ↑↑n + repr a < 1
⊢ ω ^ repr e * ↑↑n < 1
[PROOFSTEP]
exact lt_of_le_of_lt (le_add_right _ _) this
[GOAL]
case oadd.lt.h₁.oadd
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this✝² : NF a
h' : repr (add a o) = repr a + repr o
e' : ONote
n' : ℕ+
a' : ONote
h : add a o = oadd e' n' a'
nf : NF (oadd e' n' a')
this✝¹ : NF e
this✝ : NF e'
he : cmp e e' = Ordering.lt
ee : e < e'
a✝² : ONote
a✝¹ : ℕ+
a✝ : ONote
he' : e' = oadd a✝² a✝¹ a✝
this : ω ^ repr e * ↑↑n + repr a < ω ^ (ω ^ repr a✝² * ↑↑a✝¹ + repr a✝)
⊢ ω ^ repr e * ↑↑n < ω ^ (ω ^ repr a✝² * ↑↑a✝¹ + repr a✝)
[PROOFSTEP]
exact lt_of_le_of_lt (le_add_right _ _) this
[GOAL]
case oadd.lt.h₂
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this✝¹ : NF a
h' : repr (add a o) = repr a + repr o
e' : ONote
n' : ℕ+
a' : ONote
h : add a o = oadd e' n' a'
nf : NF (oadd e' n' a')
this✝ : NF e
this : NF e'
he : cmp e e' = Ordering.lt
ee : e < e'
⊢ ω ^ repr e' ≤ ω ^ repr e' * ↑↑n'
[PROOFSTEP]
simpa using (Ordinal.mul_le_mul_iff_left <| opow_pos (repr e') omega_pos).2 (nat_cast_le.2 n'.pos)
[GOAL]
case oadd.eq
e : ONote
n : ℕ+
a o : ONote
h₁ : NF (oadd e n a)
h₂ : NF o
this✝¹ : NF a
h' : repr (add a o) = repr a + repr o
e' : ONote
n' : ℕ+
a' : ONote
h : add a o = oadd e' n' a'
nf : NF (oadd e' n' a')
this✝ : NF e
this : NF e'
he : cmp e e' = Ordering.eq
ee : e = e'
⊢ ω ^ repr e * (↑↑n + ↑↑n') + repr a' = ω ^ repr e * ↑↑n + (ω ^ repr e' * ↑↑n' + repr a')
[PROOFSTEP]
rw [ee, ← add_assoc, ← mul_add, ← Nat.cast_add]
[GOAL]
o : ONote
b : Ordinal.{0}
x✝ : NFBelow 0 b
h₂ : NF o
⊢ NFBelow (0 - o) b
[PROOFSTEP]
cases o
[GOAL]
case zero
b : Ordinal.{0}
x✝ : NFBelow 0 b
h₂ : NF zero
⊢ NFBelow (0 - zero) b
[PROOFSTEP]
exact NFBelow.zero
[GOAL]
case oadd
b : Ordinal.{0}
x✝ : NFBelow 0 b
a✝² : ONote
a✝¹ : ℕ+
a✝ : ONote
h₂ : NF (oadd a✝² a✝¹ a✝)
⊢ NFBelow (0 - oadd a✝² a✝¹ a✝) b
[PROOFSTEP]
exact NFBelow.zero
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h₂ : NF (oadd e₂ n₂ a₂)
⊢ NFBelow (oadd e₁ n₁ a₁ - oadd e₂ n₂ a₂) b
[PROOFSTEP]
have h' := sub_nfBelow h₁.snd h₂.snd
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h₂ : NF (oadd e₂ n₂ a₂)
h' : NFBelow (a₁ - a₂) (repr e₁)
⊢ NFBelow (oadd e₁ n₁ a₁ - oadd e₂ n₂ a₂) b
[PROOFSTEP]
simp only [HSub.hSub, Sub.sub, sub] at h' ⊢
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h₂ : NF (oadd e₂ n₂ a₂)
h' : NFBelow (sub a₁ a₂) (repr e₁)
⊢ NFBelow
    (match cmp e₁ e₂ with
    | Ordering.lt => 0
    | Ordering.gt => oadd e₁ n₁ a₁
    | Ordering.eq =>
      match Nat.sub ↑n₁ ↑n₂ with
      | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
      | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁)
    b
[PROOFSTEP]
have := @cmp_compares _ _ h₁.fst h₂.fst
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h₂ : NF (oadd e₂ n₂ a₂)
h' : NFBelow (sub a₁ a₂) (repr e₁)
this : Ordering.Compares (cmp e₁ e₂) e₁ e₂
⊢ NFBelow
    (match cmp e₁ e₂ with
    | Ordering.lt => 0
    | Ordering.gt => oadd e₁ n₁ a₁
    | Ordering.eq =>
      match Nat.sub ↑n₁ ↑n₂ with
      | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
      | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁)
    b
[PROOFSTEP]
cases h : cmp e₁ e₂
[GOAL]
case lt
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h₂ : NF (oadd e₂ n₂ a₂)
h' : NFBelow (sub a₁ a₂) (repr e₁)
this : Ordering.Compares (cmp e₁ e₂) e₁ e₂
h : cmp e₁ e₂ = Ordering.lt
⊢ NFBelow
    (match Ordering.lt with
    | Ordering.lt => 0
    | Ordering.gt => oadd e₁ n₁ a₁
    | Ordering.eq =>
      match Nat.sub ↑n₁ ↑n₂ with
      | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
      | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁)
    b
[PROOFSTEP]
simp [sub]
[GOAL]
case eq
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h₂ : NF (oadd e₂ n₂ a₂)
h' : NFBelow (sub a₁ a₂) (repr e₁)
this : Ordering.Compares (cmp e₁ e₂) e₁ e₂
h : cmp e₁ e₂ = Ordering.eq
⊢ NFBelow
    (match Ordering.eq with
    | Ordering.lt => 0
    | Ordering.gt => oadd e₁ n₁ a₁
    | Ordering.eq =>
      match Nat.sub ↑n₁ ↑n₂ with
      | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
      | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁)
    b
[PROOFSTEP]
simp [sub]
[GOAL]
case gt
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h₂ : NF (oadd e₂ n₂ a₂)
h' : NFBelow (sub a₁ a₂) (repr e₁)
this : Ordering.Compares (cmp e₁ e₂) e₁ e₂
h : cmp e₁ e₂ = Ordering.gt
⊢ NFBelow
    (match Ordering.gt with
    | Ordering.lt => 0
    | Ordering.gt => oadd e₁ n₁ a₁
    | Ordering.eq =>
      match Nat.sub ↑n₁ ↑n₂ with
      | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
      | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁)
    b
[PROOFSTEP]
simp [sub]
[GOAL]
case lt
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h₂ : NF (oadd e₂ n₂ a₂)
h' : NFBelow (sub a₁ a₂) (repr e₁)
this : Ordering.Compares (cmp e₁ e₂) e₁ e₂
h : cmp e₁ e₂ = Ordering.lt
⊢ NFBelow 0 b
[PROOFSTEP]
apply NFBelow.zero
[GOAL]
case eq
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h₂ : NF (oadd e₂ n₂ a₂)
h' : NFBelow (sub a₁ a₂) (repr e₁)
this : Ordering.Compares (cmp e₁ e₂) e₁ e₂
h : cmp e₁ e₂ = Ordering.eq
⊢ NFBelow
    (match ↑n₁ - ↑n₂ with
    | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
    | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁)
    b
[PROOFSTEP]
simp only [h, Ordering.compares_eq] at this
[GOAL]
case eq
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h₂ : NF (oadd e₂ n₂ a₂)
h' : NFBelow (sub a₁ a₂) (repr e₁)
h : cmp e₁ e₂ = Ordering.eq
this : e₁ = e₂
⊢ NFBelow
    (match ↑n₁ - ↑n₂ with
    | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
    | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁)
    b
[PROOFSTEP]
subst e₂
[GOAL]
case eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h' : NFBelow (sub a₁ a₂) (repr e₁)
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
⊢ NFBelow
    (match ↑n₁ - ↑n₂ with
    | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
    | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁)
    b
[PROOFSTEP]
cases mn : (n₁ : ℕ) - n₂
[GOAL]
case eq.zero
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h' : NFBelow (sub a₁ a₂) (repr e₁)
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
mn : ↑n₁ - ↑n₂ = Nat.zero
⊢ NFBelow
    (match Nat.zero with
    | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
    | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁)
    b
[PROOFSTEP]
simp [sub]
[GOAL]
case eq.succ
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h' : NFBelow (sub a₁ a₂) (repr e₁)
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
n✝ : ℕ
mn : ↑n₁ - ↑n₂ = Nat.succ n✝
⊢ NFBelow
    (match Nat.succ n✝ with
    | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
    | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁)
    b
[PROOFSTEP]
simp [sub]
[GOAL]
case eq.zero
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h' : NFBelow (sub a₁ a₂) (repr e₁)
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
mn : ↑n₁ - ↑n₂ = Nat.zero
⊢ NFBelow (if n₁ = n₂ then sub a₁ a₂ else 0) b
[PROOFSTEP]
by_cases en : n₁ = n₂
[GOAL]
case pos
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h' : NFBelow (sub a₁ a₂) (repr e₁)
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
mn : ↑n₁ - ↑n₂ = Nat.zero
en : n₁ = n₂
⊢ NFBelow (if n₁ = n₂ then sub a₁ a₂ else 0) b
[PROOFSTEP]
simp [en]
[GOAL]
case neg
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h' : NFBelow (sub a₁ a₂) (repr e₁)
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
mn : ↑n₁ - ↑n₂ = Nat.zero
en : ¬n₁ = n₂
⊢ NFBelow (if n₁ = n₂ then sub a₁ a₂ else 0) b
[PROOFSTEP]
simp [en]
[GOAL]
case pos
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h' : NFBelow (sub a₁ a₂) (repr e₁)
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
mn : ↑n₁ - ↑n₂ = Nat.zero
en : n₁ = n₂
⊢ NFBelow (sub a₁ a₂) b
[PROOFSTEP]
exact h'.mono (le_of_lt h₁.lt)
[GOAL]
case neg
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h' : NFBelow (sub a₁ a₂) (repr e₁)
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
mn : ↑n₁ - ↑n₂ = Nat.zero
en : ¬n₁ = n₂
⊢ NFBelow 0 b
[PROOFSTEP]
exact NFBelow.zero
[GOAL]
case eq.succ
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h' : NFBelow (sub a₁ a₂) (repr e₁)
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
n✝ : ℕ
mn : ↑n₁ - ↑n₂ = Nat.succ n✝
⊢ NFBelow (oadd e₁ (Nat.succPNat n✝) a₁) b
[PROOFSTEP]
exact NFBelow.oadd h₁.fst h₁.snd h₁.lt
[GOAL]
case gt
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b
h₂ : NF (oadd e₂ n₂ a₂)
h' : NFBelow (sub a₁ a₂) (repr e₁)
this : Ordering.Compares (cmp e₁ e₂) e₁ e₂
h : cmp e₁ e₂ = Ordering.gt
⊢ NFBelow (oadd e₁ n₁ a₁) b
[PROOFSTEP]
exact h₁
[GOAL]
o : ONote
x✝ : NF 0
h₂ : NF o
⊢ repr (0 - o) = repr 0 - repr o
[PROOFSTEP]
cases o
[GOAL]
case zero
x✝ : NF 0
h₂ : NF zero
⊢ repr (0 - zero) = repr 0 - repr zero
[PROOFSTEP]
exact (Ordinal.zero_sub _).symm
[GOAL]
case oadd
x✝ : NF 0
a✝² : ONote
a✝¹ : ℕ+
a✝ : ONote
h₂ : NF (oadd a✝² a✝¹ a✝)
⊢ repr (0 - oadd a✝² a✝¹ a✝) = repr 0 - repr (oadd a✝² a✝¹ a✝)
[PROOFSTEP]
exact (Ordinal.zero_sub _).symm
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
⊢ repr (oadd e₁ n₁ a₁ - oadd e₂ n₂ a₂) = repr (oadd e₁ n₁ a₁) - repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
haveI := h₁.snd
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this : NF a₁
⊢ repr (oadd e₁ n₁ a₁ - oadd e₂ n₂ a₂) = repr (oadd e₁ n₁ a₁) - repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
haveI := h₂.snd
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
⊢ repr (oadd e₁ n₁ a₁ - oadd e₂ n₂ a₂) = repr (oadd e₁ n₁ a₁) - repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
have h' := repr_sub a₁ a₂
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (a₁ - a₂) = repr a₁ - repr a₂
⊢ repr (oadd e₁ n₁ a₁ - oadd e₂ n₂ a₂) = repr (oadd e₁ n₁ a₁) - repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
conv_lhs at h' => dsimp [HSub.hSub, Sub.sub, sub]
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (a₁ - a₂) = repr a₁ - repr a₂
| repr (a₁ - a₂)
[PROOFSTEP]
dsimp [HSub.hSub, Sub.sub, sub]
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (a₁ - a₂) = repr a₁ - repr a₂
| repr (a₁ - a₂)
[PROOFSTEP]
dsimp [HSub.hSub, Sub.sub, sub]
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (a₁ - a₂) = repr a₁ - repr a₂
| repr (a₁ - a₂)
[PROOFSTEP]
dsimp [HSub.hSub, Sub.sub, sub]
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
⊢ repr (oadd e₁ n₁ a₁ - oadd e₂ n₂ a₂) = repr (oadd e₁ n₁ a₁) - repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
conv_lhs => dsimp only [HSub.hSub, Sub.sub]; dsimp only [sub]
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
| repr (oadd e₁ n₁ a₁ - oadd e₂ n₂ a₂)
[PROOFSTEP]
dsimp only [HSub.hSub, Sub.sub]; dsimp only [sub]
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
| repr (oadd e₁ n₁ a₁ - oadd e₂ n₂ a₂)
[PROOFSTEP]
dsimp only [HSub.hSub, Sub.sub]; dsimp only [sub]
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
| repr (oadd e₁ n₁ a₁ - oadd e₂ n₂ a₂)
[PROOFSTEP]
dsimp only [HSub.hSub, Sub.sub]
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
| repr (sub (oadd e₁ n₁ a₁) (oadd e₂ n₂ a₂))
[PROOFSTEP]
dsimp only [sub]
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
⊢ repr
      (match cmp e₁ e₂ with
      | Ordering.lt => 0
      | Ordering.gt => oadd e₁ n₁ a₁
      | Ordering.eq =>
        match ↑n₁ - ↑n₂ with
        | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
        | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁) =
    repr (oadd e₁ n₁ a₁) - repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
have ee := @cmp_compares _ _ h₁.fst h₂.fst
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
ee : Ordering.Compares (cmp e₁ e₂) e₁ e₂
⊢ repr
      (match cmp e₁ e₂ with
      | Ordering.lt => 0
      | Ordering.gt => oadd e₁ n₁ a₁
      | Ordering.eq =>
        match ↑n₁ - ↑n₂ with
        | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
        | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁) =
    repr (oadd e₁ n₁ a₁) - repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
cases h : cmp e₁ e₂
[GOAL]
case lt
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
ee : Ordering.Compares (cmp e₁ e₂) e₁ e₂
h : cmp e₁ e₂ = Ordering.lt
⊢ repr
      (match Ordering.lt with
      | Ordering.lt => 0
      | Ordering.gt => oadd e₁ n₁ a₁
      | Ordering.eq =>
        match ↑n₁ - ↑n₂ with
        | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
        | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁) =
    repr (oadd e₁ n₁ a₁) - repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
simp only [h] at ee
[GOAL]
case eq
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
ee : Ordering.Compares (cmp e₁ e₂) e₁ e₂
h : cmp e₁ e₂ = Ordering.eq
⊢ repr
      (match Ordering.eq with
      | Ordering.lt => 0
      | Ordering.gt => oadd e₁ n₁ a₁
      | Ordering.eq =>
        match ↑n₁ - ↑n₂ with
        | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
        | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁) =
    repr (oadd e₁ n₁ a₁) - repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
simp only [h] at ee
[GOAL]
case gt
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
ee : Ordering.Compares (cmp e₁ e₂) e₁ e₂
h : cmp e₁ e₂ = Ordering.gt
⊢ repr
      (match Ordering.gt with
      | Ordering.lt => 0
      | Ordering.gt => oadd e₁ n₁ a₁
      | Ordering.eq =>
        match ↑n₁ - ↑n₂ with
        | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
        | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁) =
    repr (oadd e₁ n₁ a₁) - repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
simp only [h] at ee
[GOAL]
case lt
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
h : cmp e₁ e₂ = Ordering.lt
ee : Ordering.Compares Ordering.lt e₁ e₂
⊢ repr
      (match Ordering.lt with
      | Ordering.lt => 0
      | Ordering.gt => oadd e₁ n₁ a₁
      | Ordering.eq =>
        match ↑n₁ - ↑n₂ with
        | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
        | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁) =
    repr (oadd e₁ n₁ a₁) - repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
rw [Ordinal.sub_eq_zero_iff_le.2]
[GOAL]
case lt
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
h : cmp e₁ e₂ = Ordering.lt
ee : Ordering.Compares Ordering.lt e₁ e₂
⊢ repr
      (match Ordering.lt with
      | Ordering.lt => 0
      | Ordering.gt => oadd e₁ n₁ a₁
      | Ordering.eq =>
        match ↑n₁ - ↑n₂ with
        | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
        | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁) =
    0
[PROOFSTEP]
rfl
[GOAL]
case lt
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
h : cmp e₁ e₂ = Ordering.lt
ee : Ordering.Compares Ordering.lt e₁ e₂
⊢ repr (oadd e₁ n₁ a₁) ≤ repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
exact le_of_lt (oadd_lt_oadd_1 h₁ ee)
[GOAL]
case eq
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
h : cmp e₁ e₂ = Ordering.eq
ee : Ordering.Compares Ordering.eq e₁ e₂
⊢ repr
      (match Ordering.eq with
      | Ordering.lt => 0
      | Ordering.gt => oadd e₁ n₁ a₁
      | Ordering.eq =>
        match ↑n₁ - ↑n₂ with
        | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
        | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁) =
    repr (oadd e₁ n₁ a₁) - repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
change e₁ = e₂ at ee
[GOAL]
case eq
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
h : cmp e₁ e₂ = Ordering.eq
ee : e₁ = e₂
⊢ repr
      (match Ordering.eq with
      | Ordering.lt => 0
      | Ordering.gt => oadd e₁ n₁ a₁
      | Ordering.eq =>
        match ↑n₁ - ↑n₂ with
        | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
        | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁) =
    repr (oadd e₁ n₁ a₁) - repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
subst e₂
[GOAL]
case eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
⊢ repr
      (match Ordering.eq with
      | Ordering.lt => 0
      | Ordering.gt => oadd e₁ n₁ a₁
      | Ordering.eq =>
        match ↑n₁ - ↑n₂ with
        | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
        | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁) =
    repr (oadd e₁ n₁ a₁) - repr (oadd e₁ n₂ a₂)
[PROOFSTEP]
dsimp only
[GOAL]
case eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
⊢ repr
      (match ↑n₁ - ↑n₂ with
      | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
      | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁) =
    repr (oadd e₁ n₁ a₁) - repr (oadd e₁ n₂ a₂)
[PROOFSTEP]
cases mn : (n₁ : ℕ) - n₂
[GOAL]
case eq.zero
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
mn : ↑n₁ - ↑n₂ = Nat.zero
⊢ repr
      (match Nat.zero with
      | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
      | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁) =
    repr (oadd e₁ n₁ a₁) - repr (oadd e₁ n₂ a₂)
[PROOFSTEP]
dsimp only
[GOAL]
case eq.succ
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
n✝ : ℕ
mn : ↑n₁ - ↑n₂ = Nat.succ n✝
⊢ repr
      (match Nat.succ n✝ with
      | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
      | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁) =
    repr (oadd e₁ n₁ a₁) - repr (oadd e₁ n₂ a₂)
[PROOFSTEP]
dsimp only
[GOAL]
case eq.zero
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
mn : ↑n₁ - ↑n₂ = Nat.zero
⊢ repr (if n₁ = n₂ then sub a₁ a₂ else 0) = repr (oadd e₁ n₁ a₁) - repr (oadd e₁ n₂ a₂)
[PROOFSTEP]
by_cases en : n₁ = n₂
[GOAL]
case pos
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
mn : ↑n₁ - ↑n₂ = Nat.zero
en : n₁ = n₂
⊢ repr (if n₁ = n₂ then sub a₁ a₂ else 0) = repr (oadd e₁ n₁ a₁) - repr (oadd e₁ n₂ a₂)
[PROOFSTEP]
simpa [en]
[GOAL]
case neg
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
mn : ↑n₁ - ↑n₂ = Nat.zero
en : ¬n₁ = n₂
⊢ repr (if n₁ = n₂ then sub a₁ a₂ else 0) = repr (oadd e₁ n₁ a₁) - repr (oadd e₁ n₂ a₂)
[PROOFSTEP]
simp only [en, ite_false]
[GOAL]
case neg
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
mn : ↑n₁ - ↑n₂ = Nat.zero
en : ¬n₁ = n₂
⊢ repr 0 = repr (oadd e₁ n₁ a₁) - repr (oadd e₁ n₂ a₂)
[PROOFSTEP]
exact
  (Ordinal.sub_eq_zero_iff_le.2 <|
      le_of_lt <| oadd_lt_oadd_2 h₁ <| lt_of_le_of_ne (tsub_eq_zero_iff_le.1 mn) (mt PNat.eq en)).symm
[GOAL]
case eq.succ
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
n✝ : ℕ
mn : ↑n₁ - ↑n₂ = Nat.succ n✝
⊢ repr (oadd e₁ (Nat.succPNat n✝) a₁) = repr (oadd e₁ n₁ a₁) - repr (oadd e₁ n₂ a₂)
[PROOFSTEP]
simp [Nat.succPNat, -Nat.cast_succ]
[GOAL]
case eq.succ
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
n✝ : ℕ
mn : ↑n₁ - ↑n₂ = Nat.succ n✝
⊢ ω ^ repr e₁ * ↑(Nat.succ n✝) + repr a₁ = ω ^ repr e₁ * ↑↑n₁ + repr a₁ - (ω ^ repr e₁ * ↑↑n₂ + repr a₂)
[PROOFSTEP]
rw [(tsub_eq_iff_eq_add_of_le <| le_of_lt <| Nat.lt_of_sub_eq_succ mn).1 mn, add_comm, Nat.cast_add, mul_add, add_assoc,
  add_sub_add_cancel]
[GOAL]
case eq.succ
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
n✝ : ℕ
mn : ↑n₁ - ↑n₂ = Nat.succ n✝
⊢ ω ^ repr e₁ * ↑(Nat.succ n✝) + repr a₁ = ω ^ repr e₁ * ↑(Nat.succ n✝) + repr a₁ - repr a₂
[PROOFSTEP]
refine' (Ordinal.sub_eq_of_add_eq <| add_absorp h₂.snd'.repr_lt <| le_trans _ (le_add_right _ _)).symm
[GOAL]
case eq.succ
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
h₂ : NF (oadd e₁ n₂ a₂)
h : cmp e₁ e₁ = Ordering.eq
n✝ : ℕ
mn : ↑n₁ - ↑n₂ = Nat.succ n✝
⊢ ω ^ repr e₁ ≤ ω ^ repr e₁ * ↑(Nat.succ n✝)
[PROOFSTEP]
simpa using mul_le_mul_left' (nat_cast_le.2 <| Nat.succ_pos _) _
[GOAL]
case gt
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
this✝ : NF a₁
this : NF a₂
h' : repr (sub a₁ a₂) = repr a₁ - repr a₂
h : cmp e₁ e₂ = Ordering.gt
ee : Ordering.Compares Ordering.gt e₁ e₂
⊢ repr
      (match Ordering.gt with
      | Ordering.lt => 0
      | Ordering.gt => oadd e₁ n₁ a₁
      | Ordering.eq =>
        match ↑n₁ - ↑n₂ with
        | 0 => if n₁ = n₂ then sub a₁ a₂ else 0
        | Nat.succ k => oadd e₁ (Nat.succPNat k) a₁) =
    repr (oadd e₁ n₁ a₁) - repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
exact (Ordinal.sub_eq_of_add_eq <| add_absorp (h₂.below_of_lt ee).repr_lt <| omega_le_oadd _ _ _).symm
[GOAL]
o : ONote
⊢ 0 * o = 0
[PROOFSTEP]
cases o
[GOAL]
case zero
⊢ 0 * zero = 0
[PROOFSTEP]
rfl
[GOAL]
case oadd
a✝² : ONote
a✝¹ : ℕ+
a✝ : ONote
⊢ 0 * oadd a✝² a✝¹ a✝ = 0
[PROOFSTEP]
rfl
[GOAL]
o : ONote
⊢ o * 0 = 0
[PROOFSTEP]
cases o
[GOAL]
case zero
⊢ zero * 0 = 0
[PROOFSTEP]
rfl
[GOAL]
case oadd
a✝² : ONote
a✝¹ : ℕ+
a✝ : ONote
⊢ oadd a✝² a✝¹ a✝ * 0 = 0
[PROOFSTEP]
rfl
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
b₁ : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b₁
e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b₂ : Ordinal.{0}
h₂ : NFBelow (oadd e₂ n₂ a₂) b₂
⊢ NFBelow (oadd e₁ n₁ a₁ * oadd e₂ n₂ a₂) (repr e₁ + b₂)
[PROOFSTEP]
have IH := oadd_mul_nfBelow h₁ h₂.snd
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
b₁ : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b₁
e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b₂ : Ordinal.{0}
h₂ : NFBelow (oadd e₂ n₂ a₂) b₂
IH : NFBelow (oadd e₁ n₁ a₁ * a₂) (repr e₁ + repr e₂)
⊢ NFBelow (oadd e₁ n₁ a₁ * oadd e₂ n₂ a₂) (repr e₁ + b₂)
[PROOFSTEP]
by_cases e0 : e₂ = 0
[GOAL]
case pos
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
b₁ : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b₁
e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b₂ : Ordinal.{0}
h₂ : NFBelow (oadd e₂ n₂ a₂) b₂
IH : NFBelow (oadd e₁ n₁ a₁ * a₂) (repr e₁ + repr e₂)
e0 : e₂ = 0
⊢ NFBelow (oadd e₁ n₁ a₁ * oadd e₂ n₂ a₂) (repr e₁ + b₂)
[PROOFSTEP]
simp [e0, oadd_mul]
[GOAL]
case neg
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
b₁ : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b₁
e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b₂ : Ordinal.{0}
h₂ : NFBelow (oadd e₂ n₂ a₂) b₂
IH : NFBelow (oadd e₁ n₁ a₁ * a₂) (repr e₁ + repr e₂)
e0 : ¬e₂ = 0
⊢ NFBelow (oadd e₁ n₁ a₁ * oadd e₂ n₂ a₂) (repr e₁ + b₂)
[PROOFSTEP]
simp [e0, oadd_mul]
[GOAL]
case pos
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
b₁ : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b₁
e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b₂ : Ordinal.{0}
h₂ : NFBelow (oadd e₂ n₂ a₂) b₂
IH : NFBelow (oadd e₁ n₁ a₁ * a₂) (repr e₁ + repr e₂)
e0 : e₂ = 0
⊢ NFBelow (oadd e₁ (n₁ * n₂) a₁) (repr e₁ + b₂)
[PROOFSTEP]
apply NFBelow.oadd h₁.fst h₁.snd
[GOAL]
case pos
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
b₁ : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b₁
e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b₂ : Ordinal.{0}
h₂ : NFBelow (oadd e₂ n₂ a₂) b₂
IH : NFBelow (oadd e₁ n₁ a₁ * a₂) (repr e₁ + repr e₂)
e0 : e₂ = 0
⊢ repr e₁ < repr e₁ + b₂
[PROOFSTEP]
simpa using (add_lt_add_iff_left (repr e₁)).2 (lt_of_le_of_lt (Ordinal.zero_le _) h₂.lt)
[GOAL]
case neg
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
b₁ : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b₁
e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b₂ : Ordinal.{0}
h₂ : NFBelow (oadd e₂ n₂ a₂) b₂
IH : NFBelow (oadd e₁ n₁ a₁ * a₂) (repr e₁ + repr e₂)
e0 : ¬e₂ = 0
⊢ NFBelow (oadd (e₁ + e₂) n₂ (oadd e₁ n₁ a₁ * a₂)) (repr e₁ + b₂)
[PROOFSTEP]
haveI := h₁.fst
[GOAL]
case neg
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
b₁ : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b₁
e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b₂ : Ordinal.{0}
h₂ : NFBelow (oadd e₂ n₂ a₂) b₂
IH : NFBelow (oadd e₁ n₁ a₁ * a₂) (repr e₁ + repr e₂)
e0 : ¬e₂ = 0
this : NF e₁
⊢ NFBelow (oadd (e₁ + e₂) n₂ (oadd e₁ n₁ a₁ * a₂)) (repr e₁ + b₂)
[PROOFSTEP]
haveI := h₂.fst
[GOAL]
case neg
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
b₁ : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b₁
e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b₂ : Ordinal.{0}
h₂ : NFBelow (oadd e₂ n₂ a₂) b₂
IH : NFBelow (oadd e₁ n₁ a₁ * a₂) (repr e₁ + repr e₂)
e0 : ¬e₂ = 0
this✝ : NF e₁
this : NF e₂
⊢ NFBelow (oadd (e₁ + e₂) n₂ (oadd e₁ n₁ a₁ * a₂)) (repr e₁ + b₂)
[PROOFSTEP]
apply NFBelow.oadd
[GOAL]
case neg.a
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
b₁ : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b₁
e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b₂ : Ordinal.{0}
h₂ : NFBelow (oadd e₂ n₂ a₂) b₂
IH : NFBelow (oadd e₁ n₁ a₁ * a₂) (repr e₁ + repr e₂)
e0 : ¬e₂ = 0
this✝ : NF e₁
this : NF e₂
⊢ NF (e₁ + e₂)
case neg.a
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
b₁ : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b₁
e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b₂ : Ordinal.{0}
h₂ : NFBelow (oadd e₂ n₂ a₂) b₂
IH : NFBelow (oadd e₁ n₁ a₁ * a₂) (repr e₁ + repr e₂)
e0 : ¬e₂ = 0
this✝ : NF e₁
this : NF e₂
⊢ NFBelow (oadd e₁ n₁ a₁ * a₂) (repr (e₁ + e₂))
case neg.a
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
b₁ : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b₁
e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b₂ : Ordinal.{0}
h₂ : NFBelow (oadd e₂ n₂ a₂) b₂
IH : NFBelow (oadd e₁ n₁ a₁ * a₂) (repr e₁ + repr e₂)
e0 : ¬e₂ = 0
this✝ : NF e₁
this : NF e₂
⊢ repr (e₁ + e₂) < repr e₁ + b₂
[PROOFSTEP]
infer_instance
[GOAL]
case neg.a
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
b₁ : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b₁
e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b₂ : Ordinal.{0}
h₂ : NFBelow (oadd e₂ n₂ a₂) b₂
IH : NFBelow (oadd e₁ n₁ a₁ * a₂) (repr e₁ + repr e₂)
e0 : ¬e₂ = 0
this✝ : NF e₁
this : NF e₂
⊢ NFBelow (oadd e₁ n₁ a₁ * a₂) (repr (e₁ + e₂))
[PROOFSTEP]
rwa [repr_add]
[GOAL]
case neg.a
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
b₁ : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b₁
e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b₂ : Ordinal.{0}
h₂ : NFBelow (oadd e₂ n₂ a₂) b₂
IH : NFBelow (oadd e₁ n₁ a₁ * a₂) (repr e₁ + repr e₂)
e0 : ¬e₂ = 0
this✝ : NF e₁
this : NF e₂
⊢ repr (e₁ + e₂) < repr e₁ + b₂
[PROOFSTEP]
rw [repr_add, add_lt_add_iff_left]
[GOAL]
case neg.a
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
b₁ : Ordinal.{0}
h₁ : NFBelow (oadd e₁ n₁ a₁) b₁
e₂ : ONote
n₂ : ℕ+
a₂ : ONote
b₂ : Ordinal.{0}
h₂ : NFBelow (oadd e₂ n₂ a₂) b₂
IH : NFBelow (oadd e₁ n₁ a₁ * a₂) (repr e₁ + repr e₂)
e0 : ¬e₂ = 0
this✝ : NF e₁
this : NF e₂
⊢ repr e₂ < b₂
[PROOFSTEP]
exact h₂.lt
[GOAL]
o : ONote
x✝ : NF 0
h₂ : NF o
⊢ NF (0 * o)
[PROOFSTEP]
cases o
[GOAL]
case zero
x✝ : NF 0
h₂ : NF zero
⊢ NF (0 * zero)
[PROOFSTEP]
exact NF.zero
[GOAL]
case oadd
x✝ : NF 0
a✝² : ONote
a✝¹ : ℕ+
a✝ : ONote
h₂ : NF (oadd a✝² a✝¹ a✝)
⊢ NF (0 * oadd a✝² a✝¹ a✝)
[PROOFSTEP]
exact NF.zero
[GOAL]
o : ONote
x✝ : NF 0
h₂ : NF o
⊢ repr (0 * o) = repr 0 * repr o
[PROOFSTEP]
cases o
[GOAL]
case zero
x✝ : NF 0
h₂ : NF zero
⊢ repr (0 * zero) = repr 0 * repr zero
[PROOFSTEP]
exact (zero_mul _).symm
[GOAL]
case oadd
x✝ : NF 0
a✝² : ONote
a✝¹ : ℕ+
a✝ : ONote
h₂ : NF (oadd a✝² a✝¹ a✝)
⊢ repr (0 * oadd a✝² a✝¹ a✝) = repr 0 * repr (oadd a✝² a✝¹ a✝)
[PROOFSTEP]
exact (zero_mul _).symm
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
⊢ repr (oadd e₁ n₁ a₁ * oadd e₂ n₂ a₂) = repr (oadd e₁ n₁ a₁) * repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
have IH : repr (mul _ _) = _ := @repr_mul _ _ h₁ h₂.snd
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
⊢ repr (oadd e₁ n₁ a₁ * oadd e₂ n₂ a₂) = repr (oadd e₁ n₁ a₁) * repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
conv =>
  lhs
  simp [(· * ·)]
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
| repr (oadd e₁ n₁ a₁ * oadd e₂ n₂ a₂) = repr (oadd e₁ n₁ a₁) * repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
  lhs
  simp [(· * ·)]
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
| repr (oadd e₁ n₁ a₁ * oadd e₂ n₂ a₂) = repr (oadd e₁ n₁ a₁) * repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
  lhs
  simp [(· * ·)]
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
| repr (oadd e₁ n₁ a₁ * oadd e₂ n₂ a₂) = repr (oadd e₁ n₁ a₁) * repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
lhs
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
| repr (oadd e₁ n₁ a₁ * oadd e₂ n₂ a₂)
[PROOFSTEP]
simp [(· * ·)]
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
⊢ repr (Mul.mul (oadd e₁ n₁ a₁) (oadd e₂ n₂ a₂)) = repr (oadd e₁ n₁ a₁) * repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
have ao : repr a₁ + ω ^ repr e₁ * (n₁ : ℕ) = ω ^ repr e₁ * (n₁ : ℕ) :=
  by
  apply add_absorp h₁.snd'.repr_lt
  simpa using (Ordinal.mul_le_mul_iff_left <| opow_pos _ omega_pos).2 (nat_cast_le.2 n₁.2)
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
⊢ repr a₁ + ω ^ repr e₁ * ↑↑n₁ = ω ^ repr e₁ * ↑↑n₁
[PROOFSTEP]
apply add_absorp h₁.snd'.repr_lt
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
⊢ ω ^ repr e₁ ≤ ω ^ repr e₁ * ↑↑n₁
[PROOFSTEP]
simpa using (Ordinal.mul_le_mul_iff_left <| opow_pos _ omega_pos).2 (nat_cast_le.2 n₁.2)
[GOAL]
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
ao : repr a₁ + ω ^ repr e₁ * ↑↑n₁ = ω ^ repr e₁ * ↑↑n₁
⊢ repr (Mul.mul (oadd e₁ n₁ a₁) (oadd e₂ n₂ a₂)) = repr (oadd e₁ n₁ a₁) * repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
by_cases e0 : e₂ = 0
[GOAL]
case pos
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
ao : repr a₁ + ω ^ repr e₁ * ↑↑n₁ = ω ^ repr e₁ * ↑↑n₁
e0 : e₂ = 0
⊢ repr (Mul.mul (oadd e₁ n₁ a₁) (oadd e₂ n₂ a₂)) = repr (oadd e₁ n₁ a₁) * repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
simp [e0, mul]
[GOAL]
case neg
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
ao : repr a₁ + ω ^ repr e₁ * ↑↑n₁ = ω ^ repr e₁ * ↑↑n₁
e0 : ¬e₂ = 0
⊢ repr (Mul.mul (oadd e₁ n₁ a₁) (oadd e₂ n₂ a₂)) = repr (oadd e₁ n₁ a₁) * repr (oadd e₂ n₂ a₂)
[PROOFSTEP]
simp [e0, mul]
[GOAL]
case pos
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
ao : repr a₁ + ω ^ repr e₁ * ↑↑n₁ = ω ^ repr e₁ * ↑↑n₁
e0 : e₂ = 0
⊢ ω ^ repr e₁ * (↑↑n₁ * ↑↑n₂) + repr a₁ = (ω ^ repr e₁ * ↑↑n₁ + repr a₁) * (↑↑n₂ + repr a₂)
[PROOFSTEP]
cases' Nat.exists_eq_succ_of_ne_zero n₂.ne_zero with x xe
[GOAL]
case pos.intro
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
ao : repr a₁ + ω ^ repr e₁ * ↑↑n₁ = ω ^ repr e₁ * ↑↑n₁
e0 : e₂ = 0
x : ℕ
xe : ↑n₂ = Nat.succ x
⊢ ω ^ repr e₁ * (↑↑n₁ * ↑↑n₂) + repr a₁ = (ω ^ repr e₁ * ↑↑n₁ + repr a₁) * (↑↑n₂ + repr a₂)
[PROOFSTEP]
simp [h₂.zero_of_zero e0, xe, -Nat.cast_succ]
[GOAL]
case pos.intro
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
ao : repr a₁ + ω ^ repr e₁ * ↑↑n₁ = ω ^ repr e₁ * ↑↑n₁
e0 : e₂ = 0
x : ℕ
xe : ↑n₂ = Nat.succ x
⊢ ω ^ repr e₁ * (↑↑n₁ * ↑(Nat.succ x)) + repr a₁ = (ω ^ repr e₁ * ↑↑n₁ + repr a₁) * ↑(Nat.succ x)
[PROOFSTEP]
rw [nat_cast_succ x, add_mul_succ _ ao, mul_assoc]
[GOAL]
case neg
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
ao : repr a₁ + ω ^ repr e₁ * ↑↑n₁ = ω ^ repr e₁ * ↑↑n₁
e0 : ¬e₂ = 0
⊢ repr (Mul.mul (oadd e₁ n₁ a₁) (oadd e₂ n₂ a₂)) = (ω ^ repr e₁ * ↑↑n₁ + repr a₁) * (ω ^ repr e₂ * ↑↑n₂ + repr a₂)
[PROOFSTEP]
haveI := h₁.fst
[GOAL]
case neg
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
ao : repr a₁ + ω ^ repr e₁ * ↑↑n₁ = ω ^ repr e₁ * ↑↑n₁
e0 : ¬e₂ = 0
this : NF e₁
⊢ repr (Mul.mul (oadd e₁ n₁ a₁) (oadd e₂ n₂ a₂)) = (ω ^ repr e₁ * ↑↑n₁ + repr a₁) * (ω ^ repr e₂ * ↑↑n₂ + repr a₂)
[PROOFSTEP]
haveI := h₂.fst
[GOAL]
case neg
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
ao : repr a₁ + ω ^ repr e₁ * ↑↑n₁ = ω ^ repr e₁ * ↑↑n₁
e0 : ¬e₂ = 0
this✝ : NF e₁
this : NF e₂
⊢ repr (Mul.mul (oadd e₁ n₁ a₁) (oadd e₂ n₂ a₂)) = (ω ^ repr e₁ * ↑↑n₁ + repr a₁) * (ω ^ repr e₂ * ↑↑n₂ + repr a₂)
[PROOFSTEP]
simp [IH, Mul.mul, mul, e0, repr_add, opow_add, mul_add]
[GOAL]
case neg
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
ao : repr a₁ + ω ^ repr e₁ * ↑↑n₁ = ω ^ repr e₁ * ↑↑n₁
e0 : ¬e₂ = 0
this✝ : NF e₁
this : NF e₂
⊢ ω ^ repr e₁ * ω ^ repr e₂ * ↑↑n₂ + (ω ^ repr e₁ * ↑↑n₁ + repr a₁) * repr a₂ =
    (ω ^ repr e₁ * ↑↑n₁ + repr a₁) * (ω ^ repr e₂ * ↑↑n₂) + (ω ^ repr e₁ * ↑↑n₁ + repr a₁) * repr a₂
[PROOFSTEP]
rw [← mul_assoc]
[GOAL]
case neg
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
ao : repr a₁ + ω ^ repr e₁ * ↑↑n₁ = ω ^ repr e₁ * ↑↑n₁
e0 : ¬e₂ = 0
this✝ : NF e₁
this : NF e₂
⊢ ω ^ repr e₁ * ω ^ repr e₂ * ↑↑n₂ + (ω ^ repr e₁ * ↑↑n₁ + repr a₁) * repr a₂ =
    (ω ^ repr e₁ * ↑↑n₁ + repr a₁) * ω ^ repr e₂ * ↑↑n₂ + (ω ^ repr e₁ * ↑↑n₁ + repr a₁) * repr a₂
[PROOFSTEP]
congr 2
[GOAL]
case neg.e_a.e_a
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
ao : repr a₁ + ω ^ repr e₁ * ↑↑n₁ = ω ^ repr e₁ * ↑↑n₁
e0 : ¬e₂ = 0
this✝ : NF e₁
this : NF e₂
⊢ ω ^ repr e₁ * ω ^ repr e₂ = (ω ^ repr e₁ * ↑↑n₁ + repr a₁) * ω ^ repr e₂
[PROOFSTEP]
have := mt repr_inj.1 e0
[GOAL]
case neg.e_a.e_a
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
ao : repr a₁ + ω ^ repr e₁ * ↑↑n₁ = ω ^ repr e₁ * ↑↑n₁
e0 : ¬e₂ = 0
this✝¹ : NF e₁
this✝ : NF e₂
this : ¬repr e₂ = repr 0
⊢ ω ^ repr e₁ * ω ^ repr e₂ = (ω ^ repr e₁ * ↑↑n₁ + repr a₁) * ω ^ repr e₂
[PROOFSTEP]
rw [add_mul_limit ao (opow_isLimit_left omega_isLimit this), mul_assoc,
  mul_omega_dvd (nat_cast_pos.2 n₁.pos) (nat_lt_omega _)]
[GOAL]
case neg.e_a.e_a
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : NF (oadd e₁ n₁ a₁)
h₂ : NF (oadd e₂ n₂ a₂)
IH : repr (mul (oadd e₁ n₁ a₁) a₂) = repr (oadd e₁ n₁ a₁) * repr a₂
ao : repr a₁ + ω ^ repr e₁ * ↑↑n₁ = ω ^ repr e₁ * ↑↑n₁
e0 : ¬e₂ = 0
this✝¹ : NF e₁
this✝ : NF e₂
this : ¬repr e₂ = repr 0
⊢ ω ∣ ω ^ repr e₂
[PROOFSTEP]
simpa using opow_dvd_opow ω (one_le_iff_ne_zero.2 this)
[GOAL]
o' : ONote
m : ℕ
x✝ : NF 0
p : split' 0 = (o', m)
⊢ split 0 = (scale 1 o', m)
[PROOFSTEP]
injection p
[GOAL]
o' : ONote
m : ℕ
x✝ : NF 0
fst_eq✝ : 0 = o'
snd_eq✝ : 0 = m
⊢ split 0 = (scale 1 o', m)
[PROOFSTEP]
substs o' m
[GOAL]
x✝ : NF 0
⊢ split 0 = (scale 1 0, 0)
[PROOFSTEP]
rfl
[GOAL]
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
p : split' (oadd e n a) = (o', m)
⊢ split (oadd e n a) = (scale 1 o', m)
[PROOFSTEP]
by_cases e0 : e = 0
[GOAL]
case pos
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
p : split' (oadd e n a) = (o', m)
e0 : e = 0
⊢ split (oadd e n a) = (scale 1 o', m)
[PROOFSTEP]
simp [e0, split, split'] at p ⊢
[GOAL]
case neg
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
p : split' (oadd e n a) = (o', m)
e0 : ¬e = 0
⊢ split (oadd e n a) = (scale 1 o', m)
[PROOFSTEP]
simp [e0, split, split'] at p ⊢
[GOAL]
case pos
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : e = 0
p : 0 = o' ∧ ↑n = m
⊢ 0 = scale 1 o' ∧ ↑n = m
[PROOFSTEP]
rcases p with ⟨rfl, rfl⟩
[GOAL]
case pos.intro
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : e = 0
⊢ 0 = scale 1 0 ∧ ↑n = ↑n
[PROOFSTEP]
exact ⟨rfl, rfl⟩
[GOAL]
case neg
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
p : oadd (e - 1) n (split' a).fst = o' ∧ (split' a).snd = m
⊢ oadd e n (split a).fst = scale 1 o' ∧ (split a).snd = m
[PROOFSTEP]
revert p
[GOAL]
case neg
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
⊢ oadd (e - 1) n (split' a).fst = o' ∧ (split' a).snd = m → oadd e n (split a).fst = scale 1 o' ∧ (split a).snd = m
[PROOFSTEP]
cases' h' : split' a with a' m'
[GOAL]
case neg.mk
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
⊢ oadd (e - 1) n (a', m').fst = o' ∧ (a', m').snd = m → oadd e n (split a).fst = scale 1 o' ∧ (split a).snd = m
[PROOFSTEP]
haveI := h.fst
[GOAL]
case neg.mk
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this : NF e
⊢ oadd (e - 1) n (a', m').fst = o' ∧ (a', m').snd = m → oadd e n (split a).fst = scale 1 o' ∧ (split a).snd = m
[PROOFSTEP]
haveI := h.snd
[GOAL]
case neg.mk
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
⊢ oadd (e - 1) n (a', m').fst = o' ∧ (a', m').snd = m → oadd e n (split a).fst = scale 1 o' ∧ (split a).snd = m
[PROOFSTEP]
simp [split_eq_scale_split' h', split, split']
[GOAL]
case neg.mk
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
⊢ oadd (e - 1) n a' = o' → m' = m → oadd e n (scale 1 a') = scale 1 o' ∧ m' = m
[PROOFSTEP]
have : 1 + (e - 1) = e := by
  refine' repr_inj.1 _
  simp
  have := mt repr_inj.1 e0
  refine' Ordinal.add_sub_cancel_of_le _
  have := (one_le_iff_ne_zero.2 this)
  exact this
[GOAL]
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
⊢ 1 + (e - 1) = e
[PROOFSTEP]
refine' repr_inj.1 _
[GOAL]
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
⊢ repr (1 + (e - 1)) = repr e
[PROOFSTEP]
simp
[GOAL]
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
⊢ 1 + (repr e - 1) = repr e
[PROOFSTEP]
have := mt repr_inj.1 e0
[GOAL]
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
this : ¬repr e = repr 0
⊢ 1 + (repr e - 1) = repr e
[PROOFSTEP]
refine' Ordinal.add_sub_cancel_of_le _
[GOAL]
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
this : ¬repr e = repr 0
⊢ 1 ≤ repr e
[PROOFSTEP]
have := (one_le_iff_ne_zero.2 this)
[GOAL]
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝² : NF e
this✝¹ : NF a
this✝ : ¬repr e = repr 0
this : 1 ≤ repr e
⊢ 1 ≤ repr e
[PROOFSTEP]
exact this
[GOAL]
case neg.mk
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
this : 1 + (e - 1) = e
⊢ oadd (e - 1) n a' = o' → m' = m → oadd e n (scale 1 a') = scale 1 o' ∧ m' = m
[PROOFSTEP]
intros
[GOAL]
case neg.mk
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
this : 1 + (e - 1) = e
a✝¹ : oadd (e - 1) n a' = o'
a✝ : m' = m
⊢ oadd e n (scale 1 a') = scale 1 o' ∧ m' = m
[PROOFSTEP]
substs o' m
[GOAL]
case neg.mk
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
this : 1 + (e - 1) = e
⊢ oadd e n (scale 1 a') = scale 1 (oadd (e - 1) n a') ∧ m' = m'
[PROOFSTEP]
simp [scale, this]
[GOAL]
o' : ONote
m : ℕ
x✝ : NF 0
p : split' 0 = (o', m)
⊢ NF o' ∧ repr 0 = ω * repr o' + ↑m
[PROOFSTEP]
injection p
[GOAL]
o' : ONote
m : ℕ
x✝ : NF 0
fst_eq✝ : 0 = o'
snd_eq✝ : 0 = m
⊢ NF o' ∧ repr 0 = ω * repr o' + ↑m
[PROOFSTEP]
substs o' m
[GOAL]
x✝ : NF 0
⊢ NF 0 ∧ repr 0 = ω * repr 0 + ↑0
[PROOFSTEP]
simp [NF.zero]
[GOAL]
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
p : split' (oadd e n a) = (o', m)
⊢ NF o' ∧ repr (oadd e n a) = ω * repr o' + ↑m
[PROOFSTEP]
by_cases e0 : e = 0
[GOAL]
case pos
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
p : split' (oadd e n a) = (o', m)
e0 : e = 0
⊢ NF o' ∧ repr (oadd e n a) = ω * repr o' + ↑m
[PROOFSTEP]
simp [e0, split, split'] at p ⊢
[GOAL]
case neg
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
p : split' (oadd e n a) = (o', m)
e0 : ¬e = 0
⊢ NF o' ∧ repr (oadd e n a) = ω * repr o' + ↑m
[PROOFSTEP]
simp [e0, split, split'] at p ⊢
[GOAL]
case pos
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : e = 0
p : 0 = o' ∧ ↑n = m
⊢ NF o' ∧ ↑↑n + repr a = ω * repr o' + ↑m
[PROOFSTEP]
rcases p with ⟨rfl, rfl⟩
[GOAL]
case pos.intro
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : e = 0
⊢ NF 0 ∧ ↑↑n + repr a = ω * repr 0 + ↑↑n
[PROOFSTEP]
simp [h.zero_of_zero e0, NF.zero]
[GOAL]
case neg
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
p : oadd (e - 1) n (split' a).fst = o' ∧ (split' a).snd = m
⊢ NF o' ∧ ω ^ repr e * ↑↑n + repr a = ω * repr o' + ↑m
[PROOFSTEP]
revert p
[GOAL]
case neg
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
⊢ oadd (e - 1) n (split' a).fst = o' ∧ (split' a).snd = m → NF o' ∧ ω ^ repr e * ↑↑n + repr a = ω * repr o' + ↑m
[PROOFSTEP]
cases' h' : split' a with a' m'
[GOAL]
case neg.mk
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
⊢ oadd (e - 1) n (a', m').fst = o' ∧ (a', m').snd = m → NF o' ∧ ω ^ repr e * ↑↑n + repr a = ω * repr o' + ↑m
[PROOFSTEP]
haveI := h.fst
[GOAL]
case neg.mk
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this : NF e
⊢ oadd (e - 1) n (a', m').fst = o' ∧ (a', m').snd = m → NF o' ∧ ω ^ repr e * ↑↑n + repr a = ω * repr o' + ↑m
[PROOFSTEP]
haveI := h.snd
[GOAL]
case neg.mk
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
⊢ oadd (e - 1) n (a', m').fst = o' ∧ (a', m').snd = m → NF o' ∧ ω ^ repr e * ↑↑n + repr a = ω * repr o' + ↑m
[PROOFSTEP]
cases' nf_repr_split' h' with IH₁ IH₂
[GOAL]
case neg.mk.intro
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
⊢ oadd (e - 1) n (a', m').fst = o' ∧ (a', m').snd = m → NF o' ∧ ω ^ repr e * ↑↑n + repr a = ω * repr o' + ↑m
[PROOFSTEP]
simp [IH₂, split']
[GOAL]
case neg.mk.intro
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
⊢ oadd (e - 1) n a' = o' → m' = m → NF o' ∧ ω ^ repr e * ↑↑n + (ω * repr a' + ↑m') = ω * repr o' + ↑m
[PROOFSTEP]
intros
[GOAL]
case neg.mk.intro
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
a✝¹ : oadd (e - 1) n a' = o'
a✝ : m' = m
⊢ NF o' ∧ ω ^ repr e * ↑↑n + (ω * repr a' + ↑m') = ω * repr o' + ↑m
[PROOFSTEP]
substs o' m
[GOAL]
case neg.mk.intro
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
⊢ NF (oadd (e - 1) n a') ∧ ω ^ repr e * ↑↑n + (ω * repr a' + ↑m') = ω * repr (oadd (e - 1) n a') + ↑m'
[PROOFSTEP]
have : (ω : Ordinal.{0}) ^ repr e = ω ^ (1 : Ordinal.{0}) * ω ^ (repr e - 1) :=
  by
  have := mt repr_inj.1 e0
  rw [← opow_add, Ordinal.add_sub_cancel_of_le (one_le_iff_ne_zero.2 this)]
[GOAL]
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
⊢ ω ^ repr e = ω ^ 1 * ω ^ (repr e - 1)
[PROOFSTEP]
have := mt repr_inj.1 e0
[GOAL]
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
this : ¬repr e = repr 0
⊢ ω ^ repr e = ω ^ 1 * ω ^ (repr e - 1)
[PROOFSTEP]
rw [← opow_add, Ordinal.add_sub_cancel_of_le (one_le_iff_ne_zero.2 this)]
[GOAL]
case neg.mk.intro
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
this : ω ^ repr e = ω ^ 1 * ω ^ (repr e - 1)
⊢ NF (oadd (e - 1) n a') ∧ ω ^ repr e * ↑↑n + (ω * repr a' + ↑m') = ω * repr (oadd (e - 1) n a') + ↑m'
[PROOFSTEP]
refine' ⟨NF.oadd (by infer_instance) _ _, _⟩
[GOAL]
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
this : ω ^ repr e = ω ^ 1 * ω ^ (repr e - 1)
⊢ NF (e - 1)
[PROOFSTEP]
infer_instance
[GOAL]
case neg.mk.intro.refine'_1
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
this : ω ^ repr e = ω ^ 1 * ω ^ (repr e - 1)
⊢ NFBelow a' (repr (e - 1))
[PROOFSTEP]
simp at this ⊢
[GOAL]
case neg.mk.intro.refine'_1
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
this : ω ^ repr e = ω * ω ^ (repr e - 1)
⊢ NFBelow a' (repr e - 1)
[PROOFSTEP]
refine' IH₁.below_of_lt' ((Ordinal.mul_lt_mul_iff_left omega_pos).1 <| lt_of_le_of_lt (le_add_right _ m') _)
[GOAL]
case neg.mk.intro.refine'_1
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
this : ω ^ repr e = ω * ω ^ (repr e - 1)
⊢ ω * repr a' + ↑m' < ω * ω ^ (repr e - 1)
[PROOFSTEP]
rw [← this, ← IH₂]
[GOAL]
case neg.mk.intro.refine'_1
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
this : ω ^ repr e = ω * ω ^ (repr e - 1)
⊢ repr a < ω ^ repr e
[PROOFSTEP]
exact h.snd'.repr_lt
[GOAL]
case neg.mk.intro.refine'_2
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
this : ω ^ repr e = ω ^ 1 * ω ^ (repr e - 1)
⊢ ω ^ repr e * ↑↑n + (ω * repr a' + ↑m') = ω * repr (oadd (e - 1) n a') + ↑m'
[PROOFSTEP]
rw [this]
[GOAL]
case neg.mk.intro.refine'_2
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
this : ω ^ repr e = ω ^ 1 * ω ^ (repr e - 1)
⊢ ω ^ 1 * ω ^ (repr e - 1) * ↑↑n + (ω * repr a' + ↑m') = ω * repr (oadd (e - 1) n a') + ↑m'
[PROOFSTEP]
simp [mul_add, mul_assoc, add_assoc]
[GOAL]
x : ONote
inst✝ : NF x
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
⊢ scale x (oadd e n a) = oadd x 1 0 * oadd e n a
[PROOFSTEP]
simp [(· * ·)]
[GOAL]
x : ONote
inst✝ : NF x
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
⊢ scale x (oadd e n a) = Mul.mul (oadd x 1 0) (oadd e n a)
[PROOFSTEP]
simp [mul, scale]
[GOAL]
x : ONote
inst✝ : NF x
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
⊢ oadd (x + e) n (scale x a) = Mul.mul (oadd x 1 0) (oadd e n a)
[PROOFSTEP]
haveI := h.snd
[GOAL]
x : ONote
inst✝ : NF x
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
this : NF a
⊢ oadd (x + e) n (scale x a) = Mul.mul (oadd x 1 0) (oadd e n a)
[PROOFSTEP]
by_cases e0 : e = 0
[GOAL]
case pos
x : ONote
inst✝ : NF x
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
this : NF a
e0 : e = 0
⊢ oadd (x + e) n (scale x a) = Mul.mul (oadd x 1 0) (oadd e n a)
[PROOFSTEP]
simp_rw [scale_eq_mul]
[GOAL]
case pos
x : ONote
inst✝ : NF x
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
this : NF a
e0 : e = 0
⊢ oadd (x + e) n (oadd x 1 0 * a) = Mul.mul (oadd x 1 0) (oadd e n a)
[PROOFSTEP]
simp [Mul.mul, mul, scale_eq_mul, e0, h.zero_of_zero, show x + 0 = x from repr_inj.1 (by simp)]
[GOAL]
x : ONote
inst✝ : NF x
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
this : NF a
e0 : e = 0
⊢ repr (x + 0) = repr x
[PROOFSTEP]
simp
[GOAL]
case neg
x : ONote
inst✝ : NF x
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
this : NF a
e0 : ¬e = 0
⊢ oadd (x + e) n (scale x a) = Mul.mul (oadd x 1 0) (oadd e n a)
[PROOFSTEP]
simp [e0, Mul.mul, mul, scale_eq_mul, (· * ·)]
[GOAL]
x : ONote
inst✝¹ : NF x
o : ONote
inst✝ : NF o
⊢ NF (scale x o)
[PROOFSTEP]
rw [scale_eq_mul]
[GOAL]
x : ONote
inst✝¹ : NF x
o : ONote
inst✝ : NF o
⊢ NF (oadd x 1 0 * o)
[PROOFSTEP]
infer_instance
[GOAL]
x : ONote
inst✝¹ : NF x
o : ONote
inst✝ : NF o
⊢ repr (scale x o) = ω ^ repr x * repr o
[PROOFSTEP]
simp only [scale_eq_mul, repr_mul, repr, PNat.one_coe, Nat.cast_one, mul_one, add_zero]
[GOAL]
o o' : ONote
m : ℕ
inst✝ : NF o
h : split o = (o', m)
⊢ NF o' ∧ repr o = repr o' + ↑m
[PROOFSTEP]
cases' e : split' o with a n
[GOAL]
case mk
o o' : ONote
m : ℕ
inst✝ : NF o
h : split o = (o', m)
a : ONote
n : ℕ
e : split' o = (a, n)
⊢ NF o' ∧ repr o = repr o' + ↑m
[PROOFSTEP]
cases' nf_repr_split' e with s₁ s₂
[GOAL]
case mk.intro
o o' : ONote
m : ℕ
inst✝ : NF o
h : split o = (o', m)
a : ONote
n : ℕ
e : split' o = (a, n)
s₁ : NF a
s₂ : repr o = ω * repr a + ↑n
⊢ NF o' ∧ repr o = repr o' + ↑m
[PROOFSTEP]
skip
[GOAL]
case mk.intro
o o' : ONote
m : ℕ
inst✝ : NF o
h : split o = (o', m)
a : ONote
n : ℕ
e : split' o = (a, n)
s₁ : NF a
s₂ : repr o = ω * repr a + ↑n
⊢ NF o' ∧ repr o = repr o' + ↑m
[PROOFSTEP]
rw [split_eq_scale_split' e] at h
[GOAL]
case mk.intro
o o' : ONote
m : ℕ
inst✝ : NF o
a : ONote
n : ℕ
h : (scale 1 a, n) = (o', m)
e : split' o = (a, n)
s₁ : NF a
s₂ : repr o = ω * repr a + ↑n
⊢ NF o' ∧ repr o = repr o' + ↑m
[PROOFSTEP]
injection h
[GOAL]
case mk.intro
o o' : ONote
m : ℕ
inst✝ : NF o
a : ONote
n : ℕ
e : split' o = (a, n)
s₁ : NF a
s₂ : repr o = ω * repr a + ↑n
fst_eq✝ : scale 1 a = o'
snd_eq✝ : n = m
⊢ NF o' ∧ repr o = repr o' + ↑m
[PROOFSTEP]
substs o' n
[GOAL]
case mk.intro
o : ONote
m : ℕ
inst✝ : NF o
a : ONote
s₁ : NF a
e : split' o = (a, m)
s₂ : repr o = ω * repr a + ↑m
⊢ NF (scale 1 a) ∧ repr o = repr (scale 1 a) + ↑m
[PROOFSTEP]
simp [repr_scale, s₂.symm]
[GOAL]
case mk.intro
o : ONote
m : ℕ
inst✝ : NF o
a : ONote
s₁ : NF a
e : split' o = (a, m)
s₂ : repr o = ω * repr a + ↑m
⊢ NF (scale 1 a)
[PROOFSTEP]
infer_instance
[GOAL]
o o' : ONote
m : ℕ
inst✝ : NF o
h : split o = (o', m)
⊢ ω ∣ repr o'
[PROOFSTEP]
cases' e : split' o with a n
[GOAL]
case mk
o o' : ONote
m : ℕ
inst✝ : NF o
h : split o = (o', m)
a : ONote
n : ℕ
e : split' o = (a, n)
⊢ ω ∣ repr o'
[PROOFSTEP]
rw [split_eq_scale_split' e] at h
[GOAL]
case mk
o o' : ONote
m : ℕ
inst✝ : NF o
a : ONote
n : ℕ
h : (scale 1 a, n) = (o', m)
e : split' o = (a, n)
⊢ ω ∣ repr o'
[PROOFSTEP]
injection h
[GOAL]
case mk
o o' : ONote
m : ℕ
inst✝ : NF o
a : ONote
n : ℕ
e : split' o = (a, n)
fst_eq✝ : scale 1 a = o'
snd_eq✝ : n = m
⊢ ω ∣ repr o'
[PROOFSTEP]
subst o'
[GOAL]
case mk
o : ONote
m : ℕ
inst✝ : NF o
a : ONote
n : ℕ
e : split' o = (a, n)
snd_eq✝ : n = m
⊢ ω ∣ repr (scale 1 a)
[PROOFSTEP]
cases nf_repr_split' e
[GOAL]
case mk.intro
o : ONote
m : ℕ
inst✝ : NF o
a : ONote
n : ℕ
e : split' o = (a, n)
snd_eq✝ : n = m
left✝ : NF a
right✝ : repr o = ω * repr a + ↑n
⊢ ω ∣ repr (scale 1 a)
[PROOFSTEP]
skip
[GOAL]
case mk.intro
o : ONote
m : ℕ
inst✝ : NF o
a : ONote
n : ℕ
e : split' o = (a, n)
snd_eq✝ : n = m
left✝ : NF a
right✝ : repr o = ω * repr a + ↑n
⊢ ω ∣ repr (scale 1 a)
[PROOFSTEP]
simp
[GOAL]
o e : ONote
n : ℕ+
a : ONote
m : ℕ
inst✝ : NF o
h : split o = (oadd e n a, m)
⊢ repr a + ↑m < ω ^ repr e
[PROOFSTEP]
cases' nf_repr_split h with h₁ h₂
[GOAL]
case intro
o e : ONote
n : ℕ+
a : ONote
m : ℕ
inst✝ : NF o
h : split o = (oadd e n a, m)
h₁ : NF (oadd e n a)
h₂ : repr o = repr (oadd e n a) + ↑m
⊢ repr a + ↑m < ω ^ repr e
[PROOFSTEP]
cases' h₁.of_dvd_omega (split_dvd h) with e0 d
[GOAL]
case intro.intro
o e : ONote
n : ℕ+
a : ONote
m : ℕ
inst✝ : NF o
h : split o = (oadd e n a, m)
h₁ : NF (oadd e n a)
h₂ : repr o = repr (oadd e n a) + ↑m
e0 : repr e ≠ 0
d : ω ∣ repr a
⊢ repr a + ↑m < ω ^ repr e
[PROOFSTEP]
apply principal_add_omega_opow _ h₁.snd'.repr_lt (lt_of_lt_of_le (nat_lt_omega _) _)
[GOAL]
o e : ONote
n : ℕ+
a : ONote
m : ℕ
inst✝ : NF o
h : split o = (oadd e n a, m)
h₁ : NF (oadd e n a)
h₂ : repr o = repr (oadd e n a) + ↑m
e0 : repr e ≠ 0
d : ω ∣ repr a
⊢ ω ≤ ω ^ repr e
[PROOFSTEP]
simpa using opow_le_opow_right omega_pos (one_le_iff_ne_zero.2 e0)
[GOAL]
n : ℕ
o : ONote
⊢ mulNat o n = o * ↑n
[PROOFSTEP]
cases o
[GOAL]
case zero
n : ℕ
⊢ mulNat zero n = zero * ↑n
[PROOFSTEP]
cases n
[GOAL]
case oadd
n : ℕ
a✝² : ONote
a✝¹ : ℕ+
a✝ : ONote
⊢ mulNat (oadd a✝² a✝¹ a✝) n = oadd a✝² a✝¹ a✝ * ↑n
[PROOFSTEP]
cases n
[GOAL]
case zero.zero
⊢ mulNat zero Nat.zero = zero * ↑Nat.zero
[PROOFSTEP]
rfl
[GOAL]
case zero.succ
n✝ : ℕ
⊢ mulNat zero (Nat.succ n✝) = zero * ↑(Nat.succ n✝)
[PROOFSTEP]
rfl
[GOAL]
case oadd.zero
a✝² : ONote
a✝¹ : ℕ+
a✝ : ONote
⊢ mulNat (oadd a✝² a✝¹ a✝) Nat.zero = oadd a✝² a✝¹ a✝ * ↑Nat.zero
[PROOFSTEP]
rfl
[GOAL]
case oadd.succ
a✝² : ONote
a✝¹ : ℕ+
a✝ : ONote
n✝ : ℕ
⊢ mulNat (oadd a✝² a✝¹ a✝) (Nat.succ n✝) = oadd a✝² a✝¹ a✝ * ↑(Nat.succ n✝)
[PROOFSTEP]
rfl
[GOAL]
o : ONote
inst✝ : NF o
n : ℕ
⊢ NF (mulNat o n)
[PROOFSTEP]
simp
[GOAL]
o : ONote
inst✝ : NF o
n : ℕ
⊢ NF (o * ↑n)
[PROOFSTEP]
exact ONote.mul_nf o (ofNat n)
[GOAL]
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
⊢ ∀ (k m : ℕ), NF (opowAux e a0 a k m)
[PROOFSTEP]
intro k m
[GOAL]
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
k m : ℕ
⊢ NF (opowAux e a0 a k m)
[PROOFSTEP]
unfold opowAux
[GOAL]
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
k m : ℕ
⊢ NF
    (match k, m with
    | x, 0 => 0
    | 0, Nat.succ m => oadd e (Nat.succPNat m) 0
    | Nat.succ k, m => scale (e + mulNat a0 k) a + opowAux e a0 a k m)
[PROOFSTEP]
cases' m with m m
[GOAL]
case zero
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
k : ℕ
⊢ NF
    (match k, Nat.zero with
    | x, 0 => 0
    | 0, Nat.succ m => oadd e (Nat.succPNat m) 0
    | Nat.succ k, m => scale (e + mulNat a0 k) a + opowAux e a0 a k m)
[PROOFSTEP]
cases k
[GOAL]
case zero.zero
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
⊢ NF
    (match Nat.zero, Nat.zero with
    | x, 0 => 0
    | 0, Nat.succ m => oadd e (Nat.succPNat m) 0
    | Nat.succ k, m => scale (e + mulNat a0 k) a + opowAux e a0 a k m)
[PROOFSTEP]
exact NF.zero
[GOAL]
case zero.succ
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
n✝ : ℕ
⊢ NF
    (match Nat.succ n✝, Nat.zero with
    | x, 0 => 0
    | 0, Nat.succ m => oadd e (Nat.succPNat m) 0
    | Nat.succ k, m => scale (e + mulNat a0 k) a + opowAux e a0 a k m)
[PROOFSTEP]
exact NF.zero
[GOAL]
case succ
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
k m : ℕ
⊢ NF
    (match k, Nat.succ m with
    | x, 0 => 0
    | 0, Nat.succ m => oadd e (Nat.succPNat m) 0
    | Nat.succ k, m => scale (e + mulNat a0 k) a + opowAux e a0 a k m)
[PROOFSTEP]
cases' k with k k
[GOAL]
case succ.zero
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
m : ℕ
⊢ NF
    (match Nat.zero, Nat.succ m with
    | x, 0 => 0
    | 0, Nat.succ m => oadd e (Nat.succPNat m) 0
    | Nat.succ k, m => scale (e + mulNat a0 k) a + opowAux e a0 a k m)
[PROOFSTEP]
exact NF.oadd_zero _ _
[GOAL]
case succ.succ
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
m k : ℕ
⊢ NF
    (match Nat.succ k, Nat.succ m with
    | x, 0 => 0
    | 0, Nat.succ m => oadd e (Nat.succPNat m) 0
    | Nat.succ k, m => scale (e + mulNat a0 k) a + opowAux e a0 a k m)
[PROOFSTEP]
haveI := nf_opowAux e a0 a k
[GOAL]
case succ.succ
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
m k : ℕ
this : ∀ (m : ℕ), NF (opowAux e a0 a k m)
⊢ NF
    (match Nat.succ k, Nat.succ m with
    | x, 0 => 0
    | 0, Nat.succ m => oadd e (Nat.succPNat m) 0
    | Nat.succ k, m => scale (e + mulNat a0 k) a + opowAux e a0 a k m)
[PROOFSTEP]
simp only [Nat.succ_ne_zero m]
[GOAL]
case succ.succ
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
m k : ℕ
this : ∀ (m : ℕ), NF (opowAux e a0 a k m)
⊢ NF (scale (e + mulNat a0 k) a + opowAux e a0 a k (Nat.succ m))
[PROOFSTEP]
infer_instance
[GOAL]
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
⊢ NF (o₁ ^ o₂)
[PROOFSTEP]
cases' e₁ : split o₁ with a m
[GOAL]
case mk
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
a : ONote
m : ℕ
e₁ : split o₁ = (a, m)
⊢ NF (o₁ ^ o₂)
[PROOFSTEP]
have na := (nf_repr_split e₁).1
[GOAL]
case mk
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
a : ONote
m : ℕ
e₁ : split o₁ = (a, m)
na : NF a
⊢ NF (o₁ ^ o₂)
[PROOFSTEP]
cases' e₂ : split' o₂ with b' k
[GOAL]
case mk.mk
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
a : ONote
m : ℕ
e₁ : split o₁ = (a, m)
na : NF a
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
⊢ NF (o₁ ^ o₂)
[PROOFSTEP]
haveI := (nf_repr_split' e₂).1
[GOAL]
case mk.mk
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
a : ONote
m : ℕ
e₁ : split o₁ = (a, m)
na : NF a
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
⊢ NF (o₁ ^ o₂)
[PROOFSTEP]
cases' a with a0 n a'
[GOAL]
case mk.mk.zero
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
e₁ : split o₁ = (zero, m)
na : NF zero
⊢ NF (o₁ ^ o₂)
[PROOFSTEP]
cases' m with m
[GOAL]
case mk.mk.zero.zero
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
na : NF zero
e₁ : split o₁ = (zero, Nat.zero)
⊢ NF (o₁ ^ o₂)
[PROOFSTEP]
by_cases o₂ = 0
[GOAL]
case mk.mk.zero.zero
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
na : NF zero
e₁ : split o₁ = (zero, Nat.zero)
⊢ NF (o₁ ^ o₂)
[PROOFSTEP]
by_cases o₂ = 0
[GOAL]
case pos
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
na : NF zero
e₁ : split o₁ = (zero, Nat.zero)
h : o₂ = 0
⊢ NF (o₁ ^ o₂)
[PROOFSTEP]
simp [(· ^ ·), Pow.pow, pow, opow, opowAux2, *]
[GOAL]
case neg
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
na : NF zero
e₁ : split o₁ = (zero, Nat.zero)
h : ¬o₂ = 0
⊢ NF (o₁ ^ o₂)
[PROOFSTEP]
simp [(· ^ ·), Pow.pow, pow, opow, opowAux2, *]
[GOAL]
case mk.mk.zero.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
na : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
⊢ NF (o₁ ^ o₂)
[PROOFSTEP]
by_cases m = 0
[GOAL]
case mk.mk.zero.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
na : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
⊢ NF (o₁ ^ o₂)
[PROOFSTEP]
by_cases m = 0
[GOAL]
case pos
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
na : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
h : m = 0
⊢ NF (o₁ ^ o₂)
[PROOFSTEP]
simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *, zero_def]
[GOAL]
case neg
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
na : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
h : ¬m = 0
⊢ NF (o₁ ^ o₂)
[PROOFSTEP]
simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, mulNat_eq_mul, ofNat, *]
[GOAL]
case neg
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
na : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
h : ¬m = 0
⊢ NF (oadd b' (Monoid.npow k (Nat.succPNat m)) 0)
[PROOFSTEP]
infer_instance
[GOAL]
case mk.mk.oadd
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
na : NF (oadd a0 n a')
⊢ NF (o₁ ^ o₂)
[PROOFSTEP]
simp [(· ^ ·), Pow.pow, pow, opow, opowAux2, e₁, e₂, split_eq_scale_split' e₂]
[GOAL]
case mk.mk.oadd
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
na : NF (oadd a0 n a')
⊢ NF
    (match (scale 1 b', k) with
    | (b, 0) => oadd (a0 * b) 1 0
    | (b, Nat.succ k) => scale (a0 * b + a0 * ↑k) (oadd a0 n a') + opowAux (a0 * b) a0 (oadd a0 n a' * ↑m) k m)
[PROOFSTEP]
have := na.fst
[GOAL]
case mk.mk.oadd
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
na : NF (oadd a0 n a')
this : NF a0
⊢ NF
    (match (scale 1 b', k) with
    | (b, 0) => oadd (a0 * b) 1 0
    | (b, Nat.succ k) => scale (a0 * b + a0 * ↑k) (oadd a0 n a') + opowAux (a0 * b) a0 (oadd a0 n a' * ↑m) k m)
[PROOFSTEP]
cases' k with k
[GOAL]
case mk.mk.oadd.zero
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
na : NF (oadd a0 n a')
this : NF a0
e₂ : split' o₂ = (b', Nat.zero)
⊢ NF
    (match (scale 1 b', Nat.zero) with
    | (b, 0) => oadd (a0 * b) 1 0
    | (b, Nat.succ k) => scale (a0 * b + a0 * ↑k) (oadd a0 n a') + opowAux (a0 * b) a0 (oadd a0 n a' * ↑m) k m)
[PROOFSTEP]
simp
[GOAL]
case mk.mk.oadd.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
na : NF (oadd a0 n a')
this : NF a0
k : ℕ
e₂ : split' o₂ = (b', Nat.succ k)
⊢ NF
    (match (scale 1 b', Nat.succ k) with
    | (b, 0) => oadd (a0 * b) 1 0
    | (b, Nat.succ k) => scale (a0 * b + a0 * ↑k) (oadd a0 n a') + opowAux (a0 * b) a0 (oadd a0 n a' * ↑m) k m)
[PROOFSTEP]
simp
[GOAL]
case mk.mk.oadd.zero
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
na : NF (oadd a0 n a')
this : NF a0
e₂ : split' o₂ = (b', Nat.zero)
⊢ NF (oadd (a0 * scale 1 b') 1 0)
[PROOFSTEP]
infer_instance
[GOAL]
case mk.mk.oadd.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
na : NF (oadd a0 n a')
this : NF a0
k : ℕ
e₂ : split' o₂ = (b', Nat.succ k)
⊢ NF (scale (a0 * scale 1 b' + a0 * ↑k) (oadd a0 n a') + opowAux (a0 * scale 1 b') a0 (oadd a0 n a' * ↑m) k m)
[PROOFSTEP]
cases k
[GOAL]
case mk.mk.oadd.succ.zero
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
na : NF (oadd a0 n a')
this : NF a0
e₂ : split' o₂ = (b', Nat.succ Nat.zero)
⊢ NF
    (scale (a0 * scale 1 b' + a0 * ↑Nat.zero) (oadd a0 n a') +
      opowAux (a0 * scale 1 b') a0 (oadd a0 n a' * ↑m) Nat.zero m)
[PROOFSTEP]
cases m
[GOAL]
case mk.mk.oadd.succ.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
na : NF (oadd a0 n a')
this : NF a0
n✝ : ℕ
e₂ : split' o₂ = (b', Nat.succ (Nat.succ n✝))
⊢ NF
    (scale (a0 * scale 1 b' + a0 * ↑(Nat.succ n✝)) (oadd a0 n a') +
      opowAux (a0 * scale 1 b') a0 (oadd a0 n a' * ↑m) (Nat.succ n✝) m)
[PROOFSTEP]
cases m
[GOAL]
case mk.mk.oadd.succ.zero.zero
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
na : NF (oadd a0 n a')
this : NF a0
e₂ : split' o₂ = (b', Nat.succ Nat.zero)
e₁ : split o₁ = (oadd a0 n a', Nat.zero)
⊢ NF
    (scale (a0 * scale 1 b' + a0 * ↑Nat.zero) (oadd a0 n a') +
      opowAux (a0 * scale 1 b') a0 (oadd a0 n a' * ↑Nat.zero) Nat.zero Nat.zero)
[PROOFSTEP]
infer_instance
[GOAL]
case mk.mk.oadd.succ.zero.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
na : NF (oadd a0 n a')
this : NF a0
e₂ : split' o₂ = (b', Nat.succ Nat.zero)
n✝ : ℕ
e₁ : split o₁ = (oadd a0 n a', Nat.succ n✝)
⊢ NF
    (scale (a0 * scale 1 b' + a0 * ↑Nat.zero) (oadd a0 n a') +
      opowAux (a0 * scale 1 b') a0 (oadd a0 n a' * ↑(Nat.succ n✝)) Nat.zero (Nat.succ n✝))
[PROOFSTEP]
infer_instance
[GOAL]
case mk.mk.oadd.succ.succ.zero
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
na : NF (oadd a0 n a')
this : NF a0
n✝ : ℕ
e₂ : split' o₂ = (b', Nat.succ (Nat.succ n✝))
e₁ : split o₁ = (oadd a0 n a', Nat.zero)
⊢ NF
    (scale (a0 * scale 1 b' + a0 * ↑(Nat.succ n✝)) (oadd a0 n a') +
      opowAux (a0 * scale 1 b') a0 (oadd a0 n a' * ↑Nat.zero) (Nat.succ n✝) Nat.zero)
[PROOFSTEP]
infer_instance
[GOAL]
case mk.mk.oadd.succ.succ.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
na : NF (oadd a0 n a')
this : NF a0
n✝¹ : ℕ
e₂ : split' o₂ = (b', Nat.succ (Nat.succ n✝¹))
n✝ : ℕ
e₁ : split o₁ = (oadd a0 n a', Nat.succ n✝)
⊢ NF
    (scale (a0 * scale 1 b' + a0 * ↑(Nat.succ n✝¹)) (oadd a0 n a') +
      opowAux (a0 * scale 1 b') a0 (oadd a0 n a' * ↑(Nat.succ n✝)) (Nat.succ n✝¹) (Nat.succ n✝))
[PROOFSTEP]
infer_instance
[GOAL]
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
m : ℕ
⊢ repr (opowAux e a0 a 0 m) = ω ^ repr e * repr (opowAux 0 a0 a 0 m)
[PROOFSTEP]
cases m
[GOAL]
case zero
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
⊢ repr (opowAux e a0 a 0 Nat.zero) = ω ^ repr e * repr (opowAux 0 a0 a 0 Nat.zero)
[PROOFSTEP]
simp [opowAux]
[GOAL]
case succ
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
n✝ : ℕ
⊢ repr (opowAux e a0 a 0 (Nat.succ n✝)) = ω ^ repr e * repr (opowAux 0 a0 a 0 (Nat.succ n✝))
[PROOFSTEP]
simp [opowAux]
[GOAL]
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
k m : ℕ
⊢ repr (opowAux e a0 a (k + 1) m) = ω ^ repr e * repr (opowAux 0 a0 a (k + 1) m)
[PROOFSTEP]
by_cases h : m = 0
[GOAL]
case pos
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
k m : ℕ
h : m = 0
⊢ repr (opowAux e a0 a (k + 1) m) = ω ^ repr e * repr (opowAux 0 a0 a (k + 1) m)
[PROOFSTEP]
simp [h, opowAux, mul_add, opow_add, mul_assoc, scale_opowAux _ _ _ k]
[GOAL]
case neg
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
k m : ℕ
h : ¬m = 0
⊢ repr (opowAux e a0 a (k + 1) m) = ω ^ repr e * repr (opowAux 0 a0 a (k + 1) m)
[PROOFSTEP]
rw [opowAux]
[GOAL]
case neg
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
k m : ℕ
h : ¬m = 0
⊢ repr (scale (e + mulNat a0 k) a + opowAux e a0 a k m) = ω ^ repr e * repr (opowAux 0 a0 a (k + 1) m)
case neg.x_2 e a0 a : ONote inst✝² : NF e inst✝¹ : NF a0 inst✝ : NF a k m : ℕ h : ¬m = 0 ⊢ m = 0 → False
[PROOFSTEP]
swap
[GOAL]
case neg.x_2
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
k m : ℕ
h : ¬m = 0
⊢ m = 0 → False
case neg
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
k m : ℕ
h : ¬m = 0
⊢ repr (scale (e + mulNat a0 k) a + opowAux e a0 a k m) = ω ^ repr e * repr (opowAux 0 a0 a (k + 1) m)
[PROOFSTEP]
assumption
[GOAL]
case neg
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
k m : ℕ
h : ¬m = 0
⊢ repr (scale (e + mulNat a0 k) a + opowAux e a0 a k m) = ω ^ repr e * repr (opowAux 0 a0 a (k + 1) m)
[PROOFSTEP]
rw [opowAux]
[GOAL]
case neg
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
k m : ℕ
h : ¬m = 0
⊢ repr (scale (e + mulNat a0 k) a + opowAux e a0 a k m) =
    ω ^ repr e * repr (scale (0 + mulNat a0 k) a + opowAux 0 a0 a k m)
case neg.x_2 e a0 a : ONote inst✝² : NF e inst✝¹ : NF a0 inst✝ : NF a k m : ℕ h : ¬m = 0 ⊢ m = 0 → False
[PROOFSTEP]
swap
[GOAL]
case neg.x_2
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
k m : ℕ
h : ¬m = 0
⊢ m = 0 → False
case neg
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
k m : ℕ
h : ¬m = 0
⊢ repr (scale (e + mulNat a0 k) a + opowAux e a0 a k m) =
    ω ^ repr e * repr (scale (0 + mulNat a0 k) a + opowAux 0 a0 a k m)
[PROOFSTEP]
assumption
[GOAL]
case neg
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
k m : ℕ
h : ¬m = 0
⊢ repr (scale (e + mulNat a0 k) a + opowAux e a0 a k m) =
    ω ^ repr e * repr (scale (0 + mulNat a0 k) a + opowAux 0 a0 a k m)
[PROOFSTEP]
rw [repr_add, repr_scale, scale_opowAux _ _ _ k]
[GOAL]
case neg
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
k m : ℕ
h : ¬m = 0
⊢ ω ^ repr (e + mulNat a0 k) * repr a + ω ^ repr e * repr (opowAux 0 a0 a k m) =
    ω ^ repr e * repr (scale (0 + mulNat a0 k) a + opowAux 0 a0 a k m)
[PROOFSTEP]
simp only [repr_add, repr_scale, opow_add, mul_assoc, zero_add, mul_add]
[GOAL]
e a : ONote
Ne : NF e
Na : NF a
a' : Ordinal.{0}
e0 : repr e ≠ 0
h : a' < ω ^ repr e
aa : repr a = a'
n : ℕ+
⊢ (ω ^ repr e * ↑↑n + a') ^ ω = (ω ^ repr e) ^ ω
[PROOFSTEP]
subst aa
[GOAL]
e a : ONote
Ne : NF e
Na : NF a
e0 : repr e ≠ 0
n : ℕ+
h : repr a < ω ^ repr e
⊢ (ω ^ repr e * ↑↑n + repr a) ^ ω = (ω ^ repr e) ^ ω
[PROOFSTEP]
have No := Ne.oadd n (Na.below_of_lt' h)
[GOAL]
e a : ONote
Ne : NF e
Na : NF a
e0 : repr e ≠ 0
n : ℕ+
h : repr a < ω ^ repr e
No : NF (oadd e n a)
⊢ (ω ^ repr e * ↑↑n + repr a) ^ ω = (ω ^ repr e) ^ ω
[PROOFSTEP]
have := omega_le_oadd e n a
[GOAL]
e a : ONote
Ne : NF e
Na : NF a
e0 : repr e ≠ 0
n : ℕ+
h : repr a < ω ^ repr e
No : NF (oadd e n a)
this : ω ^ repr e ≤ repr (oadd e n a)
⊢ (ω ^ repr e * ↑↑n + repr a) ^ ω = (ω ^ repr e) ^ ω
[PROOFSTEP]
rw [repr] at this
[GOAL]
e a : ONote
Ne : NF e
Na : NF a
e0 : repr e ≠ 0
n : ℕ+
h : repr a < ω ^ repr e
No : NF (oadd e n a)
this : ω ^ repr e ≤ ω ^ repr e * ↑↑n + repr a
⊢ (ω ^ repr e * ↑↑n + repr a) ^ ω = (ω ^ repr e) ^ ω
[PROOFSTEP]
refine' le_antisymm _ (opow_le_opow_left _ this)
[GOAL]
e a : ONote
Ne : NF e
Na : NF a
e0 : repr e ≠ 0
n : ℕ+
h : repr a < ω ^ repr e
No : NF (oadd e n a)
this : ω ^ repr e ≤ ω ^ repr e * ↑↑n + repr a
⊢ (ω ^ repr e * ↑↑n + repr a) ^ ω ≤ (ω ^ repr e) ^ ω
[PROOFSTEP]
apply (opow_le_of_limit ((opow_pos _ omega_pos).trans_le this).ne' omega_isLimit).2
[GOAL]
e a : ONote
Ne : NF e
Na : NF a
e0 : repr e ≠ 0
n : ℕ+
h : repr a < ω ^ repr e
No : NF (oadd e n a)
this : ω ^ repr e ≤ ω ^ repr e * ↑↑n + repr a
⊢ ∀ (b' : Ordinal.{0}), b' < ω → (ω ^ repr e * ↑↑n + repr a) ^ b' ≤ (ω ^ repr e) ^ ω
[PROOFSTEP]
intro b l
[GOAL]
e a : ONote
Ne : NF e
Na : NF a
e0 : repr e ≠ 0
n : ℕ+
h : repr a < ω ^ repr e
No : NF (oadd e n a)
this : ω ^ repr e ≤ ω ^ repr e * ↑↑n + repr a
b : Ordinal.{0}
l : b < ω
⊢ (ω ^ repr e * ↑↑n + repr a) ^ b ≤ (ω ^ repr e) ^ ω
[PROOFSTEP]
have := (No.below_of_lt (lt_succ _)).repr_lt
[GOAL]
e a : ONote
Ne : NF e
Na : NF a
e0 : repr e ≠ 0
n : ℕ+
h : repr a < ω ^ repr e
No : NF (oadd e n a)
this✝ : ω ^ repr e ≤ ω ^ repr e * ↑↑n + repr a
b : Ordinal.{0}
l : b < ω
this : repr (oadd e n a) < ω ^ succ (repr e)
⊢ (ω ^ repr e * ↑↑n + repr a) ^ b ≤ (ω ^ repr e) ^ ω
[PROOFSTEP]
rw [repr] at this
[GOAL]
e a : ONote
Ne : NF e
Na : NF a
e0 : repr e ≠ 0
n : ℕ+
h : repr a < ω ^ repr e
No : NF (oadd e n a)
this✝ : ω ^ repr e ≤ ω ^ repr e * ↑↑n + repr a
b : Ordinal.{0}
l : b < ω
this : ω ^ repr e * ↑↑n + repr a < ω ^ succ (repr e)
⊢ (ω ^ repr e * ↑↑n + repr a) ^ b ≤ (ω ^ repr e) ^ ω
[PROOFSTEP]
apply (opow_le_opow_left b <| this.le).trans
[GOAL]
e a : ONote
Ne : NF e
Na : NF a
e0 : repr e ≠ 0
n : ℕ+
h : repr a < ω ^ repr e
No : NF (oadd e n a)
this✝ : ω ^ repr e ≤ ω ^ repr e * ↑↑n + repr a
b : Ordinal.{0}
l : b < ω
this : ω ^ repr e * ↑↑n + repr a < ω ^ succ (repr e)
⊢ (ω ^ succ (repr e)) ^ b ≤ (ω ^ repr e) ^ ω
[PROOFSTEP]
rw [← opow_mul, ← opow_mul]
[GOAL]
e a : ONote
Ne : NF e
Na : NF a
e0 : repr e ≠ 0
n : ℕ+
h : repr a < ω ^ repr e
No : NF (oadd e n a)
this✝ : ω ^ repr e ≤ ω ^ repr e * ↑↑n + repr a
b : Ordinal.{0}
l : b < ω
this : ω ^ repr e * ↑↑n + repr a < ω ^ succ (repr e)
⊢ ω ^ (succ (repr e) * b) ≤ ω ^ (repr e * ω)
[PROOFSTEP]
apply opow_le_opow_right omega_pos
[GOAL]
e a : ONote
Ne : NF e
Na : NF a
e0 : repr e ≠ 0
n : ℕ+
h : repr a < ω ^ repr e
No : NF (oadd e n a)
this✝ : ω ^ repr e ≤ ω ^ repr e * ↑↑n + repr a
b : Ordinal.{0}
l : b < ω
this : ω ^ repr e * ↑↑n + repr a < ω ^ succ (repr e)
⊢ succ (repr e) * b ≤ repr e * ω
[PROOFSTEP]
cases' le_or_lt ω (repr e) with h h
[GOAL]
case inl
e a : ONote
Ne : NF e
Na : NF a
e0 : repr e ≠ 0
n : ℕ+
h✝ : repr a < ω ^ repr e
No : NF (oadd e n a)
this✝ : ω ^ repr e ≤ ω ^ repr e * ↑↑n + repr a
b : Ordinal.{0}
l : b < ω
this : ω ^ repr e * ↑↑n + repr a < ω ^ succ (repr e)
h : ω ≤ repr e
⊢ succ (repr e) * b ≤ repr e * ω
[PROOFSTEP]
apply (mul_le_mul_left' (le_succ b) _).trans
[GOAL]
case inl
e a : ONote
Ne : NF e
Na : NF a
e0 : repr e ≠ 0
n : ℕ+
h✝ : repr a < ω ^ repr e
No : NF (oadd e n a)
this✝ : ω ^ repr e ≤ ω ^ repr e * ↑↑n + repr a
b : Ordinal.{0}
l : b < ω
this : ω ^ repr e * ↑↑n + repr a < ω ^ succ (repr e)
h : ω ≤ repr e
⊢ succ (repr e) * succ b ≤ repr e * ω
[PROOFSTEP]
rw [← add_one_eq_succ, add_mul_succ _ (one_add_of_omega_le h), add_one_eq_succ, succ_le_iff,
  Ordinal.mul_lt_mul_iff_left (Ordinal.pos_iff_ne_zero.2 e0)]
[GOAL]
case inl
e a : ONote
Ne : NF e
Na : NF a
e0 : repr e ≠ 0
n : ℕ+
h✝ : repr a < ω ^ repr e
No : NF (oadd e n a)
this✝ : ω ^ repr e ≤ ω ^ repr e * ↑↑n + repr a
b : Ordinal.{0}
l : b < ω
this : ω ^ repr e * ↑↑n + repr a < ω ^ succ (repr e)
h : ω ≤ repr e
⊢ succ b < ω
[PROOFSTEP]
exact omega_isLimit.2 _ l
[GOAL]
case inr
e a : ONote
Ne : NF e
Na : NF a
e0 : repr e ≠ 0
n : ℕ+
h✝ : repr a < ω ^ repr e
No : NF (oadd e n a)
this✝ : ω ^ repr e ≤ ω ^ repr e * ↑↑n + repr a
b : Ordinal.{0}
l : b < ω
this : ω ^ repr e * ↑↑n + repr a < ω ^ succ (repr e)
h : repr e < ω
⊢ succ (repr e) * b ≤ repr e * ω
[PROOFSTEP]
apply (principal_mul_omega (omega_isLimit.2 _ h) l).le.trans
[GOAL]
case inr
e a : ONote
Ne : NF e
Na : NF a
e0 : repr e ≠ 0
n : ℕ+
h✝ : repr a < ω ^ repr e
No : NF (oadd e n a)
this✝ : ω ^ repr e ≤ ω ^ repr e * ↑↑n + repr a
b : Ordinal.{0}
l : b < ω
this : ω ^ repr e * ↑↑n + repr a < ω ^ succ (repr e)
h : repr e < ω
⊢ ω ≤ repr e * ω
[PROOFSTEP]
simpa using mul_le_mul_right' (one_le_iff_ne_zero.2 e0) ω
[GOAL]
a0 a' : ONote
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' * ↑m) k m);
  (k ≠ 0 → R < (ω ^ repr a0) ^ succ ↑k) ∧
    (ω ^ repr a0) ^ ↑k * (ω ^ repr a0 * ↑↑n + repr a') + R = (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ succ ↑k
[PROOFSTEP]
intro R'
[GOAL]
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k : ℕ
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k m)
⊢ (k ≠ 0 → R' < (ω ^ repr a0) ^ succ ↑k) ∧
    (ω ^ repr a0) ^ ↑k * (ω ^ repr a0 * ↑↑n + repr a') + R' = (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ succ ↑k
[PROOFSTEP]
haveI No : NF (oadd a0 n a') := N0.oadd n (Na'.below_of_lt' <| lt_of_le_of_lt (le_add_right _ _) h)
[GOAL]
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k : ℕ
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k m)
No : NF (oadd a0 n a')
⊢ (k ≠ 0 → R' < (ω ^ repr a0) ^ succ ↑k) ∧
    (ω ^ repr a0) ^ ↑k * (ω ^ repr a0 * ↑↑n + repr a') + R' = (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ succ ↑k
[PROOFSTEP]
induction' k with k IH
[GOAL]
case zero
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k m)
No : NF (oadd a0 n a')
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) Nat.zero m)
⊢ (Nat.zero ≠ 0 → R' < (ω ^ repr a0) ^ succ ↑Nat.zero) ∧
    (ω ^ repr a0) ^ ↑Nat.zero * (ω ^ repr a0 * ↑↑n + repr a') + R' = (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ succ ↑Nat.zero
[PROOFSTEP]
cases m
[GOAL]
case zero.zero
a0 a' : ONote
N0 : NF a0
Na' : NF a'
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
n : ℕ+
k : ℕ
No : NF (oadd a0 n a')
h : repr a' + ↑Nat.zero < ω ^ repr a0
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) k Nat.zero)
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) Nat.zero Nat.zero)
⊢ (Nat.zero ≠ 0 → R' < (ω ^ repr a0) ^ succ ↑Nat.zero) ∧
    (ω ^ repr a0) ^ ↑Nat.zero * (ω ^ repr a0 * ↑↑n + repr a') + R' =
      (ω ^ repr a0 * ↑↑n + repr a' + ↑Nat.zero) ^ succ ↑Nat.zero
[PROOFSTEP]
simp [opowAux]
  -- rename R => R'
[GOAL]
case zero.succ
a0 a' : ONote
N0 : NF a0
Na' : NF a'
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
n : ℕ+
k : ℕ
No : NF (oadd a0 n a')
n✝ : ℕ
h : repr a' + ↑(Nat.succ n✝) < ω ^ repr a0
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ n✝)) k (Nat.succ n✝))
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ n✝)) Nat.zero (Nat.succ n✝))
⊢ (Nat.zero ≠ 0 → R' < (ω ^ repr a0) ^ succ ↑Nat.zero) ∧
    (ω ^ repr a0) ^ ↑Nat.zero * (ω ^ repr a0 * ↑↑n + repr a') + R' =
      (ω ^ repr a0 * ↑↑n + repr a' + ↑(Nat.succ n✝)) ^ succ ↑Nat.zero
[PROOFSTEP]
simp [opowAux]
  -- rename R => R'
[GOAL]
case succ
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
No : NF (oadd a0 n a')
k : ℕ
IH :
  let R' := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k m);
  (k ≠ 0 → R' < (ω ^ repr a0) ^ succ ↑k) ∧
    (ω ^ repr a0) ^ ↑k * (ω ^ repr a0 * ↑↑n + repr a') + R' = (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ succ ↑k
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) (Nat.succ k) m)
⊢ (Nat.succ k ≠ 0 → R' < (ω ^ repr a0) ^ succ ↑(Nat.succ k)) ∧
    (ω ^ repr a0) ^ ↑(Nat.succ k) * (ω ^ repr a0 * ↑↑n + repr a') + R' =
      (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ succ ↑(Nat.succ k)
[PROOFSTEP]
let R := repr (opowAux 0 a0 (oadd a0 n a' * ofNat m) k m)
[GOAL]
case succ
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
No : NF (oadd a0 n a')
k : ℕ
IH :
  let R' := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k m);
  (k ≠ 0 → R' < (ω ^ repr a0) ^ succ ↑k) ∧
    (ω ^ repr a0) ^ ↑k * (ω ^ repr a0 * ↑↑n + repr a') + R' = (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ succ ↑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)
⊢ (Nat.succ k ≠ 0 → R' < (ω ^ repr a0) ^ succ ↑(Nat.succ k)) ∧
    (ω ^ repr a0) ^ ↑(Nat.succ k) * (ω ^ repr a0 * ↑↑n + repr a') + R' =
      (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ succ ↑(Nat.succ k)
[PROOFSTEP]
let ω0 := ω ^ repr a0
[GOAL]
case succ
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
No : NF (oadd a0 n a')
k : ℕ
IH :
  let R' := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k m);
  (k ≠ 0 → R' < (ω ^ repr a0) ^ succ ↑k) ∧
    (ω ^ repr a0) ^ ↑k * (ω ^ repr a0 * ↑↑n + repr a') + R' = (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ succ ↑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
⊢ (Nat.succ k ≠ 0 → R' < (ω ^ repr a0) ^ succ ↑(Nat.succ k)) ∧
    (ω ^ repr a0) ^ ↑(Nat.succ k) * (ω ^ repr a0 * ↑↑n + repr a') + R' =
      (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ succ ↑(Nat.succ k)
[PROOFSTEP]
let α' := ω0 * n + repr a'
[GOAL]
case succ
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
No : NF (oadd a0 n a')
k : ℕ
IH :
  let R' := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k m);
  (k ≠ 0 → R' < (ω ^ repr a0) ^ succ ↑k) ∧
    (ω ^ repr a0) ^ ↑k * (ω ^ repr a0 * ↑↑n + repr a') + R' = (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ succ ↑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'
⊢ (Nat.succ k ≠ 0 → R' < (ω ^ repr a0) ^ succ ↑(Nat.succ k)) ∧
    (ω ^ repr a0) ^ ↑(Nat.succ k) * (ω ^ repr a0 * ↑↑n + repr a') + R' =
      (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ succ ↑(Nat.succ k)
[PROOFSTEP]
change (k ≠ 0 → R < (ω0 ^ succ ↑k)) ∧ (ω0 ^ k) * α' + R = (α' + m) ^ succ ↑k at IH
[GOAL]
case succ
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
⊢ (Nat.succ k ≠ 0 → R' < (ω ^ repr a0) ^ succ ↑(Nat.succ k)) ∧
    (ω ^ repr a0) ^ ↑(Nat.succ k) * (ω ^ repr a0 * ↑↑n + repr a') + R' =
      (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ succ ↑(Nat.succ k)
[PROOFSTEP]
have RR : R' = (ω0 ^ k) * (α' * 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]
[GOAL]
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
⊢ R' = ω0 ^ ↑k * (α' * ↑m) + R
[PROOFSTEP]
by_cases h : m = 0
[GOAL]
case pos
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h✝ : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
h : m = 0
⊢ R' = ω0 ^ ↑k * (α' * ↑m) + R
[PROOFSTEP]
simp only [h, ONote.ofNat, Nat.cast_zero, zero_add, ONote.repr, mul_zero, ONote.opowAux, add_zero]
[GOAL]
case neg
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h✝ : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
h : ¬m = 0
⊢ R' = ω0 ^ ↑k * (α' * ↑m) + R
[PROOFSTEP]
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]
[GOAL]
case succ
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
⊢ (Nat.succ k ≠ 0 → R' < (ω ^ repr a0) ^ succ ↑(Nat.succ k)) ∧
    (ω ^ repr a0) ^ ↑(Nat.succ k) * (ω ^ repr a0 * ↑↑n + repr a') + R' =
      (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ succ ↑(Nat.succ k)
[PROOFSTEP]
have α0 : 0 < α' := by simpa [lt_def, repr] using oadd_pos a0 n a'
[GOAL]
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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 < α'
[PROOFSTEP]
simpa [lt_def, repr] using oadd_pos a0 n a'
[GOAL]
case succ
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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 < α'
⊢ (Nat.succ k ≠ 0 → R' < (ω ^ repr a0) ^ succ ↑(Nat.succ k)) ∧
    (ω ^ repr a0) ^ ↑(Nat.succ k) * (ω ^ repr a0 * ↑↑n + repr a') + R' =
      (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ succ ↑(Nat.succ k)
[PROOFSTEP]
have ω00 : 0 < (ω0 ^ k) := opow_pos _ (opow_pos _ omega_pos)
[GOAL]
case succ
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
⊢ (Nat.succ k ≠ 0 → R' < (ω ^ repr a0) ^ succ ↑(Nat.succ k)) ∧
    (ω ^ repr a0) ^ ↑(Nat.succ k) * (ω ^ repr a0 * ↑↑n + repr a') + R' =
      (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ succ ↑(Nat.succ k)
[PROOFSTEP]
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
[GOAL]
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
⊢ R < ω ^ (repr a0 * succ ↑k)
[PROOFSTEP]
by_cases k0 : k = 0
[GOAL]
case pos
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
k0 : k = 0
⊢ R < ω ^ (repr a0 * succ ↑k)
[PROOFSTEP]
simp [k0]
[GOAL]
case pos
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
k0 : k = 0
⊢ repr (opowAux 0 a0 (oadd a0 n a' * ↑m) 0 m) < ω ^ repr a0
[PROOFSTEP]
refine' lt_of_lt_of_le _ (opow_le_opow_right omega_pos (one_le_iff_ne_zero.2 e0))
[GOAL]
case pos
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
k0 : k = 0
⊢ repr (opowAux 0 a0 (oadd a0 n a' * ↑m) 0 m) < ω ^ 1
[PROOFSTEP]
cases' m with m
[GOAL]
case pos.zero
a0 a' : ONote
N0 : NF a0
Na' : NF a'
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
n : ℕ+
k✝ : ℕ
No : NF (oadd a0 n a')
k : ℕ
ω0 : Ordinal.{0} := ω ^ repr a0
α' : Ordinal.{0} := ω0 * ↑↑n + repr a'
α0 : 0 < α'
ω00 : 0 < ω0 ^ ↑k
k0 : k = 0
h : repr a' + ↑Nat.zero < ω ^ repr a0
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) k✝ Nat.zero)
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) (Nat.succ k) Nat.zero)
R : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) k Nat.zero)
IH : (k ≠ 0 → R < ω0 ^ succ ↑k) ∧ ω0 ^ ↑k * α' + R = (α' + ↑Nat.zero) ^ succ ↑k
RR : R' = ω0 ^ ↑k * (α' * ↑Nat.zero) + R
⊢ repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) 0 Nat.zero) < ω ^ 1
[PROOFSTEP]
simp [opowAux, omega_pos]
[GOAL]
case pos.succ
a0 a' : ONote
N0 : NF a0
Na' : NF a'
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
n : ℕ+
k✝ : ℕ
No : NF (oadd a0 n a')
k : ℕ
ω0 : Ordinal.{0} := ω ^ repr a0
α' : Ordinal.{0} := ω0 * ↑↑n + repr a'
α0 : 0 < α'
ω00 : 0 < ω0 ^ ↑k
k0 : k = 0
m : ℕ
h : repr a' + ↑(Nat.succ m) < ω ^ repr a0
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ m)) k✝ (Nat.succ m))
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ m)) (Nat.succ k) (Nat.succ m))
R : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ m)) k (Nat.succ m))
IH : (k ≠ 0 → R < ω0 ^ succ ↑k) ∧ ω0 ^ ↑k * α' + R = (α' + ↑(Nat.succ m)) ^ succ ↑k
RR : R' = ω0 ^ ↑k * (α' * ↑(Nat.succ m)) + R
⊢ repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ m)) 0 (Nat.succ m)) < ω ^ 1
[PROOFSTEP]
simp [opowAux, omega_pos]
[GOAL]
case pos.succ
a0 a' : ONote
N0 : NF a0
Na' : NF a'
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
n : ℕ+
k✝ : ℕ
No : NF (oadd a0 n a')
k : ℕ
ω0 : Ordinal.{0} := ω ^ repr a0
α' : Ordinal.{0} := ω0 * ↑↑n + repr a'
α0 : 0 < α'
ω00 : 0 < ω0 ^ ↑k
k0 : k = 0
m : ℕ
h : repr a' + ↑(Nat.succ m) < ω ^ repr a0
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ m)) k✝ (Nat.succ m))
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ m)) (Nat.succ k) (Nat.succ m))
R : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ m)) k (Nat.succ m))
IH : (k ≠ 0 → R < ω0 ^ succ ↑k) ∧ ω0 ^ ↑k * α' + R = (α' + ↑(Nat.succ m)) ^ succ ↑k
RR : R' = ω0 ^ ↑k * (α' * ↑(Nat.succ m)) + R
⊢ succ ↑m < ω
[PROOFSTEP]
rw [← add_one_eq_succ, ← Nat.cast_succ]
[GOAL]
case pos.succ
a0 a' : ONote
N0 : NF a0
Na' : NF a'
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
n : ℕ+
k✝ : ℕ
No : NF (oadd a0 n a')
k : ℕ
ω0 : Ordinal.{0} := ω ^ repr a0
α' : Ordinal.{0} := ω0 * ↑↑n + repr a'
α0 : 0 < α'
ω00 : 0 < ω0 ^ ↑k
k0 : k = 0
m : ℕ
h : repr a' + ↑(Nat.succ m) < ω ^ repr a0
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ m)) k✝ (Nat.succ m))
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ m)) (Nat.succ k) (Nat.succ m))
R : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ m)) k (Nat.succ m))
IH : (k ≠ 0 → R < ω0 ^ succ ↑k) ∧ ω0 ^ ↑k * α' + R = (α' + ↑(Nat.succ m)) ^ succ ↑k
RR : R' = ω0 ^ ↑k * (α' * ↑(Nat.succ m)) + R
⊢ ↑(Nat.succ m) < ω
[PROOFSTEP]
apply nat_lt_omega
[GOAL]
case neg
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
k0 : ¬k = 0
⊢ R < ω ^ (repr a0 * succ ↑k)
[PROOFSTEP]
rw [opow_mul]
[GOAL]
case neg
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
k0 : ¬k = 0
⊢ R < (ω ^ repr a0) ^ succ ↑k
[PROOFSTEP]
exact IH.1 k0
[GOAL]
case succ
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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)
⊢ (Nat.succ k ≠ 0 → R' < (ω ^ repr a0) ^ succ ↑(Nat.succ k)) ∧
    (ω ^ repr a0) ^ ↑(Nat.succ k) * (ω ^ repr a0 * ↑↑n + repr a') + R' =
      (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ succ ↑(Nat.succ k)
[PROOFSTEP]
refine' ⟨fun _ => _, _⟩
[GOAL]
case succ.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 : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
⊢ R' < (ω ^ repr a0) ^ succ ↑(Nat.succ k)
[PROOFSTEP]
rw [RR, ← opow_mul _ _ (succ k.succ)]
[GOAL]
case succ.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 : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
⊢ ω0 ^ ↑k * (α' * ↑m) + R < ω ^ (repr a0 * succ ↑(Nat.succ k))
[PROOFSTEP]
have e0 := Ordinal.pos_iff_ne_zero.2 e0
[GOAL]
case succ.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 : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
⊢ ω0 ^ ↑k * (α' * ↑m) + R < ω ^ (repr a0 * succ ↑(Nat.succ k))
[PROOFSTEP]
have rr0 : 0 < repr a0 + repr a0 := lt_of_lt_of_le e0 (le_add_left _ _)
[GOAL]
case succ.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 : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
⊢ ω0 ^ ↑k * (α' * ↑m) + R < ω ^ (repr a0 * succ ↑(Nat.succ k))
[PROOFSTEP]
apply principal_add_omega_opow
[GOAL]
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 : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
⊢ ω0 ^ ↑k * (α' * ↑m) < ω ^ (repr a0 * succ ↑(Nat.succ k))
[PROOFSTEP]
simp [opow_mul, opow_add, mul_assoc]
[GOAL]
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 : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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) ^ ↑k * ((ω ^ repr a0 * ↑↑n + repr a') * ↑m) < (ω ^ repr a0) ^ ↑k * (ω ^ repr a0 * ω ^ repr a0)
[PROOFSTEP]
rw [Ordinal.mul_lt_mul_iff_left ω00, ← Ordinal.opow_add]
[GOAL]
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 : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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 * ↑↑n + repr a') * ↑m < ω ^ (repr a0 + repr a0)
[PROOFSTEP]
have : _ < ω ^ (repr a0 + repr a0) := (No.below_of_lt ?_).repr_lt
[GOAL]
case succ.refine'_1.a.refine_2
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0✝ : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
this : repr (oadd a0 n a') < ω ^ (repr a0 + repr a0)
⊢ (ω ^ repr a0 * ↑↑n + repr a') * ↑m < ω ^ (repr a0 + repr a0)
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 : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
[PROOFSTEP]
refine' mul_lt_omega_opow rr0 this (nat_lt_omega _)
[GOAL]
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 : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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
[PROOFSTEP]
simpa using (add_lt_add_iff_left (repr a0)).2 e0
[GOAL]
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 : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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))
[PROOFSTEP]
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))) _)
[GOAL]
case succ.refine'_2
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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)
⊢ (ω ^ repr a0) ^ ↑(Nat.succ k) * (ω ^ repr a0 * ↑↑n + repr a') + R' =
    (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ succ ↑(Nat.succ k)
[PROOFSTEP]
calc
  (ω0 ^ k.succ) * α' + R'
  _ = (ω0 ^ succ ↑k) * α' + ((ω0 ^ k) * α' * m + R) := by rw [nat_cast_succ, RR, ← mul_assoc]
  _ = ((ω0 ^ k) * α' + R) * α' + ((ω0 ^ k) * α' + R) * m := ?_
  _ = (α' + m) ^ succ ↑k.succ := by rw [← mul_add, nat_cast_succ, opow_succ, IH.2]
[GOAL]
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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)
⊢ ω0 ^ ↑(Nat.succ k) * α' + R' = ω0 ^ succ ↑k * α' + (ω0 ^ ↑k * α' * ↑m + R)
[PROOFSTEP]
rw [nat_cast_succ, RR, ← mul_assoc]
[GOAL]
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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)
⊢ (ω0 ^ ↑k * α' + R) * α' + (ω0 ^ ↑k * α' + R) * ↑m = (α' + ↑m) ^ succ ↑(Nat.succ k)
[PROOFSTEP]
rw [← mul_add, nat_cast_succ, opow_succ, IH.2]
[GOAL]
case succ.refine'_2
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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)
⊢ ω0 ^ succ ↑k * α' + (ω0 ^ ↑k * α' * ↑m + R) = (ω0 ^ ↑k * α' + R) * α' + (ω0 ^ ↑k * α' + R) * ↑m
[PROOFSTEP]
congr 1
[GOAL]
case succ.refine'_2.e_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 : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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)
⊢ ω0 ^ succ ↑k * α' = (ω0 ^ ↑k * α' + R) * α'
[PROOFSTEP]
have αd : ω ∣ α' := dvd_add (dvd_mul_of_dvd_left (by simpa using opow_dvd_opow ω (one_le_iff_ne_zero.2 e0)) _) d
[GOAL]
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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)
⊢ ω ∣ ω0
[PROOFSTEP]
simpa using opow_dvd_opow ω (one_le_iff_ne_zero.2 e0)
[GOAL]
case succ.refine'_2.e_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 : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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)
αd : ω ∣ α'
⊢ ω0 ^ succ ↑k * α' = (ω0 ^ ↑k * α' + R) * α'
[PROOFSTEP]
rw [mul_add (ω0 ^ k), add_assoc, ← mul_assoc, ← opow_succ, add_mul_limit _ (isLimit_iff_omega_dvd.2 ⟨ne_of_gt α0, αd⟩),
  mul_assoc, @mul_omega_dvd n (nat_cast_pos.2 n.pos) (nat_lt_omega _) _ αd]
[GOAL]
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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)
αd : ω ∣ α'
⊢ ω0 ^ ↑k * repr a' + R + ω0 ^ succ ↑k * ↑↑n = ω0 ^ succ ↑k * ↑↑n
[PROOFSTEP]
apply @add_absorp _ (repr a0 * succ ↑k)
[GOAL]
case h₁
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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)
αd : ω ∣ α'
⊢ ω0 ^ ↑k * repr a' + R < ω ^ (repr a0 * succ ↑k)
[PROOFSTEP]
refine' principal_add_omega_opow _ _ Rl
[GOAL]
case h₁
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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)
αd : ω ∣ α'
⊢ ω0 ^ ↑k * repr a' < ω ^ (repr a0 * succ ↑k)
[PROOFSTEP]
rw [opow_mul, opow_succ, Ordinal.mul_lt_mul_iff_left ω00]
[GOAL]
case h₁
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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)
αd : ω ∣ α'
⊢ repr a' < ω ^ repr a0
[PROOFSTEP]
exact No.snd'.repr_lt
[GOAL]
case h₂
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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)
αd : ω ∣ α'
⊢ ω ^ (repr a0 * succ ↑k) ≤ ω0 ^ succ ↑k * ↑↑n
[PROOFSTEP]
have := mul_le_mul_left' (one_le_iff_pos.2 <| nat_cast_pos.2 n.pos) (ω0 ^ succ k)
[GOAL]
case h₂
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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)
αd : ω ∣ α'
this : ω0 ^ ↑(succ k) * 1 ≤ ω0 ^ ↑(succ k) * ↑↑n
⊢ ω ^ (repr a0 * succ ↑k) ≤ ω0 ^ succ ↑k * ↑↑n
[PROOFSTEP]
rw [opow_mul]
[GOAL]
case h₂
a0 a' : ONote
N0 : NF a0
Na' : NF a'
m : ℕ
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
h : repr a' + ↑m < ω ^ repr a0
n : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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)
αd : ω ∣ α'
this : ω0 ^ ↑(succ k) * 1 ≤ ω0 ^ ↑(succ k) * ↑↑n
⊢ (ω ^ repr a0) ^ succ ↑k ≤ ω0 ^ succ ↑k * ↑↑n
[PROOFSTEP]
simpa [-opow_succ]
[GOAL]
case succ.refine'_2.e_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 : ℕ+
k✝ : ℕ
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k✝ m)
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)
⊢ ω0 ^ ↑k * α' * ↑m + R = (ω0 ^ ↑k * α' + R) * ↑m
[PROOFSTEP]
cases m
[GOAL]
case succ.refine'_2.e_a.zero
a0 a' : ONote
N0 : NF a0
Na' : NF a'
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
n : ℕ+
k✝ : ℕ
No : NF (oadd a0 n a')
k : ℕ
ω0 : Ordinal.{0} := ω ^ repr a0
α' : Ordinal.{0} := ω0 * ↑↑n + repr a'
α0 : 0 < α'
ω00 : 0 < ω0 ^ ↑k
h : repr a' + ↑Nat.zero < ω ^ repr a0
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) k✝ Nat.zero)
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) (Nat.succ k) Nat.zero)
R : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) k Nat.zero)
IH : (k ≠ 0 → R < ω0 ^ succ ↑k) ∧ ω0 ^ ↑k * α' + R = (α' + ↑Nat.zero) ^ succ ↑k
RR : R' = ω0 ^ ↑k * (α' * ↑Nat.zero) + R
Rl : R < ω ^ (repr a0 * succ ↑k)
⊢ ω0 ^ ↑k * α' * ↑Nat.zero + R = (ω0 ^ ↑k * α' + R) * ↑Nat.zero
[PROOFSTEP]
have : R = 0 := by cases k <;> simp [opowAux]
[GOAL]
a0 a' : ONote
N0 : NF a0
Na' : NF a'
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
n : ℕ+
k✝ : ℕ
No : NF (oadd a0 n a')
k : ℕ
ω0 : Ordinal.{0} := ω ^ repr a0
α' : Ordinal.{0} := ω0 * ↑↑n + repr a'
α0 : 0 < α'
ω00 : 0 < ω0 ^ ↑k
h : repr a' + ↑Nat.zero < ω ^ repr a0
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) k✝ Nat.zero)
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) (Nat.succ k) Nat.zero)
R : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) k Nat.zero)
IH : (k ≠ 0 → R < ω0 ^ succ ↑k) ∧ ω0 ^ ↑k * α' + R = (α' + ↑Nat.zero) ^ succ ↑k
RR : R' = ω0 ^ ↑k * (α' * ↑Nat.zero) + R
Rl : R < ω ^ (repr a0 * succ ↑k)
⊢ R = 0
[PROOFSTEP]
cases k
[GOAL]
case zero
a0 a' : ONote
N0 : NF a0
Na' : NF a'
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
n : ℕ+
k : ℕ
No : NF (oadd a0 n a')
ω0 : Ordinal.{0} := ω ^ repr a0
α' : Ordinal.{0} := ω0 * ↑↑n + repr a'
α0 : 0 < α'
h : repr a' + ↑Nat.zero < ω ^ repr a0
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) k Nat.zero)
ω00 : 0 < ω0 ^ ↑Nat.zero
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) (Nat.succ Nat.zero) Nat.zero)
R : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) Nat.zero Nat.zero)
IH : (Nat.zero ≠ 0 → R < ω0 ^ succ ↑Nat.zero) ∧ ω0 ^ ↑Nat.zero * α' + R = (α' + ↑Nat.zero) ^ succ ↑Nat.zero
RR : R' = ω0 ^ ↑Nat.zero * (α' * ↑Nat.zero) + R
Rl : R < ω ^ (repr a0 * succ ↑Nat.zero)
⊢ R = 0
[PROOFSTEP]
simp [opowAux]
[GOAL]
case succ
a0 a' : ONote
N0 : NF a0
Na' : NF a'
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
n : ℕ+
k : ℕ
No : NF (oadd a0 n a')
ω0 : Ordinal.{0} := ω ^ repr a0
α' : Ordinal.{0} := ω0 * ↑↑n + repr a'
α0 : 0 < α'
h : repr a' + ↑Nat.zero < ω ^ repr a0
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) k Nat.zero)
n✝ : ℕ
ω00 : 0 < ω0 ^ ↑(Nat.succ n✝)
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) (Nat.succ (Nat.succ n✝)) Nat.zero)
R : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) (Nat.succ n✝) Nat.zero)
IH :
  (Nat.succ n✝ ≠ 0 → R < ω0 ^ succ ↑(Nat.succ n✝)) ∧
    ω0 ^ ↑(Nat.succ n✝) * α' + R = (α' + ↑Nat.zero) ^ succ ↑(Nat.succ n✝)
RR : R' = ω0 ^ ↑(Nat.succ n✝) * (α' * ↑Nat.zero) + R
Rl : R < ω ^ (repr a0 * succ ↑(Nat.succ n✝))
⊢ R = 0
[PROOFSTEP]
simp [opowAux]
[GOAL]
case succ.refine'_2.e_a.zero
a0 a' : ONote
N0 : NF a0
Na' : NF a'
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
n : ℕ+
k✝ : ℕ
No : NF (oadd a0 n a')
k : ℕ
ω0 : Ordinal.{0} := ω ^ repr a0
α' : Ordinal.{0} := ω0 * ↑↑n + repr a'
α0 : 0 < α'
ω00 : 0 < ω0 ^ ↑k
h : repr a' + ↑Nat.zero < ω ^ repr a0
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) k✝ Nat.zero)
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) (Nat.succ k) Nat.zero)
R : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑Nat.zero) k Nat.zero)
IH : (k ≠ 0 → R < ω0 ^ succ ↑k) ∧ ω0 ^ ↑k * α' + R = (α' + ↑Nat.zero) ^ succ ↑k
RR : R' = ω0 ^ ↑k * (α' * ↑Nat.zero) + R
Rl : R < ω ^ (repr a0 * succ ↑k)
this : R = 0
⊢ ω0 ^ ↑k * α' * ↑Nat.zero + R = (ω0 ^ ↑k * α' + R) * ↑Nat.zero
[PROOFSTEP]
simp [this]
[GOAL]
case succ.refine'_2.e_a.succ
a0 a' : ONote
N0 : NF a0
Na' : NF a'
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
n : ℕ+
k✝ : ℕ
No : NF (oadd a0 n a')
k : ℕ
ω0 : Ordinal.{0} := ω ^ repr a0
α' : Ordinal.{0} := ω0 * ↑↑n + repr a'
α0 : 0 < α'
ω00 : 0 < ω0 ^ ↑k
n✝ : ℕ
h : repr a' + ↑(Nat.succ n✝) < ω ^ repr a0
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ n✝)) k✝ (Nat.succ n✝))
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ n✝)) (Nat.succ k) (Nat.succ n✝))
R : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ n✝)) k (Nat.succ n✝))
IH : (k ≠ 0 → R < ω0 ^ succ ↑k) ∧ ω0 ^ ↑k * α' + R = (α' + ↑(Nat.succ n✝)) ^ succ ↑k
RR : R' = ω0 ^ ↑k * (α' * ↑(Nat.succ n✝)) + R
Rl : R < ω ^ (repr a0 * succ ↑k)
⊢ ω0 ^ ↑k * α' * ↑(Nat.succ n✝) + R = (ω0 ^ ↑k * α' + R) * ↑(Nat.succ n✝)
[PROOFSTEP]
rw [nat_cast_succ, add_mul_succ]
[GOAL]
case succ.refine'_2.e_a.succ.ba
a0 a' : ONote
N0 : NF a0
Na' : NF a'
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
n : ℕ+
k✝ : ℕ
No : NF (oadd a0 n a')
k : ℕ
ω0 : Ordinal.{0} := ω ^ repr a0
α' : Ordinal.{0} := ω0 * ↑↑n + repr a'
α0 : 0 < α'
ω00 : 0 < ω0 ^ ↑k
n✝ : ℕ
h : repr a' + ↑(Nat.succ n✝) < ω ^ repr a0
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ n✝)) k✝ (Nat.succ n✝))
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ n✝)) (Nat.succ k) (Nat.succ n✝))
R : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ n✝)) k (Nat.succ n✝))
IH : (k ≠ 0 → R < ω0 ^ succ ↑k) ∧ ω0 ^ ↑k * α' + R = (α' + ↑(Nat.succ n✝)) ^ succ ↑k
RR : R' = ω0 ^ ↑k * (α' * ↑(Nat.succ n✝)) + R
Rl : R < ω ^ (repr a0 * succ ↑k)
⊢ R + ω0 ^ ↑k * α' = ω0 ^ ↑k * α'
[PROOFSTEP]
apply add_absorp Rl
[GOAL]
case succ.refine'_2.e_a.succ.ba
a0 a' : ONote
N0 : NF a0
Na' : NF a'
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
n : ℕ+
k✝ : ℕ
No : NF (oadd a0 n a')
k : ℕ
ω0 : Ordinal.{0} := ω ^ repr a0
α' : Ordinal.{0} := ω0 * ↑↑n + repr a'
α0 : 0 < α'
ω00 : 0 < ω0 ^ ↑k
n✝ : ℕ
h : repr a' + ↑(Nat.succ n✝) < ω ^ repr a0
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ n✝)) k✝ (Nat.succ n✝))
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ n✝)) (Nat.succ k) (Nat.succ n✝))
R : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ n✝)) k (Nat.succ n✝))
IH : (k ≠ 0 → R < ω0 ^ succ ↑k) ∧ ω0 ^ ↑k * α' + R = (α' + ↑(Nat.succ n✝)) ^ succ ↑k
RR : R' = ω0 ^ ↑k * (α' * ↑(Nat.succ n✝)) + R
Rl : R < ω ^ (repr a0 * succ ↑k)
⊢ ω ^ (repr a0 * succ ↑k) ≤ ω0 ^ ↑k * α'
[PROOFSTEP]
rw [opow_mul, opow_succ]
[GOAL]
case succ.refine'_2.e_a.succ.ba
a0 a' : ONote
N0 : NF a0
Na' : NF a'
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
n : ℕ+
k✝ : ℕ
No : NF (oadd a0 n a')
k : ℕ
ω0 : Ordinal.{0} := ω ^ repr a0
α' : Ordinal.{0} := ω0 * ↑↑n + repr a'
α0 : 0 < α'
ω00 : 0 < ω0 ^ ↑k
n✝ : ℕ
h : repr a' + ↑(Nat.succ n✝) < ω ^ repr a0
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ n✝)) k✝ (Nat.succ n✝))
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ n✝)) (Nat.succ k) (Nat.succ n✝))
R : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ n✝)) k (Nat.succ n✝))
IH : (k ≠ 0 → R < ω0 ^ succ ↑k) ∧ ω0 ^ ↑k * α' + R = (α' + ↑(Nat.succ n✝)) ^ succ ↑k
RR : R' = ω0 ^ ↑k * (α' * ↑(Nat.succ n✝)) + R
Rl : R < ω ^ (repr a0 * succ ↑k)
⊢ (ω ^ repr a0) ^ ↑k * ω ^ repr a0 ≤ ω0 ^ ↑k * α'
[PROOFSTEP]
apply mul_le_mul_left'
[GOAL]
case succ.refine'_2.e_a.succ.ba.bc
a0 a' : ONote
N0 : NF a0
Na' : NF a'
d : ω ∣ repr a'
e0 : repr a0 ≠ 0
n : ℕ+
k✝ : ℕ
No : NF (oadd a0 n a')
k : ℕ
ω0 : Ordinal.{0} := ω ^ repr a0
α' : Ordinal.{0} := ω0 * ↑↑n + repr a'
α0 : 0 < α'
ω00 : 0 < ω0 ^ ↑k
n✝ : ℕ
h : repr a' + ↑(Nat.succ n✝) < ω ^ repr a0
R'✝ : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ n✝)) k✝ (Nat.succ n✝))
R' : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ n✝)) (Nat.succ k) (Nat.succ n✝))
R : Ordinal.{0} := repr (opowAux 0 a0 (oadd a0 n a' * ↑(Nat.succ n✝)) k (Nat.succ n✝))
IH : (k ≠ 0 → R < ω0 ^ succ ↑k) ∧ ω0 ^ ↑k * α' + R = (α' + ↑(Nat.succ n✝)) ^ succ ↑k
RR : R' = ω0 ^ ↑k * (α' * ↑(Nat.succ n✝)) + R
Rl : R < ω ^ (repr a0 * succ ↑k)
⊢ ω ^ repr a0 ≤ α'
[PROOFSTEP]
simpa [repr] using omega_le_oadd a0 n a'
[GOAL]
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂
[PROOFSTEP]
cases' e₁ : split o₁ with a m
[GOAL]
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₂
[PROOFSTEP]
cases' nf_repr_split e₁ with N₁ r₁
[GOAL]
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₂
[PROOFSTEP]
cases' a with a0 n a'
[GOAL]
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₂
[PROOFSTEP]
cases' m with m
[GOAL]
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₂
[PROOFSTEP]
by_cases o₂ = 0
[GOAL]
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₂
[PROOFSTEP]
by_cases o₂ = 0
[GOAL]
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₂
[PROOFSTEP]
simp [opow_def, opowAux2, opow, e₁, h, r₁]
[GOAL]
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₂
[PROOFSTEP]
simp [opow_def, opowAux2, opow, e₁, h, r₁]
[GOAL]
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₂
[PROOFSTEP]
have := mt repr_inj.1 h
[GOAL]
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₂
[PROOFSTEP]
rw [zero_opow this]
[GOAL]
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₂
[PROOFSTEP]
cases' e₂ : split' o₂ with b' k
[GOAL]
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₂
[PROOFSTEP]
cases' nf_repr_split' e₂ with _ r₂
[GOAL]
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₂
[PROOFSTEP]
by_cases m = 0
[GOAL]
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₂
[PROOFSTEP]
by_cases m = 0
[GOAL]
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₂
[PROOFSTEP]
simp [opow_def, opow, e₁, h, r₁, e₂, r₂, -Nat.cast_succ, ← Nat.one_eq_succ_zero]
[GOAL]
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₂
[PROOFSTEP]
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]
[GOAL]
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)
[PROOFSTEP]
rw [opow_add, opow_mul, opow_omega, add_one_eq_succ]
[GOAL]
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 < ω
[PROOFSTEP]
congr
[GOAL]
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 < ω
[PROOFSTEP]
conv_lhs =>
  simp [HPow.hPow]
  simp [Pow.pow, opow, Ordinal.succ_ne_zero]
[GOAL]
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)
[PROOFSTEP]
  simp [HPow.hPow]
  simp [Pow.pow, opow, Ordinal.succ_ne_zero]
[GOAL]
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)
[PROOFSTEP]
  simp [HPow.hPow]
  simp [Pow.pow, opow, Ordinal.succ_ne_zero]
[GOAL]
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)
[PROOFSTEP]
simp [HPow.hPow]
[GOAL]
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)
[PROOFSTEP]
simp [Pow.pow, opow, Ordinal.succ_ne_zero]
[GOAL]
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
[PROOFSTEP]
simpa using nat_cast_lt.2 (Nat.succ_lt_succ <| pos_iff_ne_zero.2 h)
[GOAL]
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 < ω
[PROOFSTEP]
rw [← Nat.cast_succ, lt_omega]
[GOAL]
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
⊢ ∃ n, ↑(Nat.succ m) = ↑n
[PROOFSTEP]
exact ⟨_, rfl⟩
[GOAL]
case mk.intro.oadd
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂
[PROOFSTEP]
haveI := N₁.fst
[GOAL]
case mk.intro.oadd
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this : NF a0
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂
[PROOFSTEP]
haveI := N₁.snd
[GOAL]
case mk.intro.oadd
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this✝ : NF a0
this : NF a'
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂
[PROOFSTEP]
cases' N₁.of_dvd_omega (split_dvd e₁) with a00 ad
[GOAL]
case mk.intro.oadd.intro
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this✝ : NF a0
this : NF a'
a00 : repr a0 ≠ 0
ad : ω ∣ repr a'
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂
[PROOFSTEP]
have al := split_add_lt e₁
[GOAL]
case mk.intro.oadd.intro
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this✝ : NF a0
this : NF a'
a00 : repr a0 ≠ 0
ad : ω ∣ repr a'
al : repr a' + ↑m < ω ^ repr a0
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂
[PROOFSTEP]
have aa : repr (a' + ofNat m) = repr a' + m := by simp only [eq_self_iff_true, ONote.repr_ofNat, ONote.repr_add]
[GOAL]
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this✝ : NF a0
this : NF a'
a00 : repr a0 ≠ 0
ad : ω ∣ repr a'
al : repr a' + ↑m < ω ^ repr a0
⊢ repr (a' + ↑m) = repr a' + ↑m
[PROOFSTEP]
simp only [eq_self_iff_true, ONote.repr_ofNat, ONote.repr_add]
[GOAL]
case mk.intro.oadd.intro
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this✝ : NF a0
this : NF a'
a00 : repr a0 ≠ 0
ad : ω ∣ repr a'
al : repr a' + ↑m < ω ^ repr a0
aa : repr (a' + ↑m) = repr a' + ↑m
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂
[PROOFSTEP]
cases' e₂ : split' o₂ with b' k
[GOAL]
case mk.intro.oadd.intro.mk
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this✝ : NF a0
this : NF a'
a00 : repr a0 ≠ 0
ad : ω ∣ repr a'
al : repr a' + ↑m < ω ^ repr a0
aa : repr (a' + ↑m) = repr a' + ↑m
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
⊢ repr (o₁ ^ o₂) = repr o₁ ^ repr o₂
[PROOFSTEP]
cases' nf_repr_split' e₂ with _ r₂
[GOAL]
case mk.intro.oadd.intro.mk.intro
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this✝ : NF a0
this : NF a'
a00 : repr a0 ≠ 0
ad : ω ∣ repr a'
al : repr a' + ↑m < ω ^ repr a0
aa : repr (a' + ↑m) = repr a' + ↑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₂
[PROOFSTEP]
simp only [opow_def, opow, e₁, r₁, split_eq_scale_split' e₂, opowAux2, repr]
[GOAL]
case mk.intro.oadd.intro.mk.intro
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this✝ : NF a0
this : NF a'
a00 : repr a0 ≠ 0
ad : ω ∣ repr a'
al : repr a' + ↑m < ω ^ repr a0
aa : repr (a' + ↑m) = repr a' + ↑m
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
left✝ : NF b'
r₂ : repr o₂ = ω * repr b' + ↑k
⊢ repr
      (match (scale 1 b', k) with
      | (b, 0) => oadd (a0 * b) 1 0
      | (b, Nat.succ k) =>
        scale (a0 * b + mulNat a0 k) (oadd a0 n a') + opowAux (a0 * b) a0 (mulNat (oadd a0 n a') m) k m) =
    (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ repr o₂
[PROOFSTEP]
cases' k with k
[GOAL]
case mk.intro.oadd.intro.mk.intro.zero
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this✝ : NF a0
this : NF a'
a00 : repr a0 ≠ 0
ad : ω ∣ repr a'
al : repr a' + ↑m < ω ^ repr a0
aa : repr (a' + ↑m) = repr a' + ↑m
b' : ONote
left✝ : NF b'
e₂ : split' o₂ = (b', Nat.zero)
r₂ : repr o₂ = ω * repr b' + ↑Nat.zero
⊢ repr
      (match (scale 1 b', Nat.zero) with
      | (b, 0) => oadd (a0 * b) 1 0
      | (b, Nat.succ k) =>
        scale (a0 * b + mulNat a0 k) (oadd a0 n a') + opowAux (a0 * b) a0 (mulNat (oadd a0 n a') m) k m) =
    (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ repr o₂
[PROOFSTEP]
skip
[GOAL]
case mk.intro.oadd.intro.mk.intro.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this✝ : NF a0
this : NF a'
a00 : repr a0 ≠ 0
ad : ω ∣ repr a'
al : repr a' + ↑m < ω ^ repr a0
aa : repr (a' + ↑m) = repr a' + ↑m
b' : ONote
left✝ : NF b'
k : ℕ
e₂ : split' o₂ = (b', Nat.succ k)
r₂ : repr o₂ = ω * repr b' + ↑(Nat.succ k)
⊢ repr
      (match (scale 1 b', Nat.succ k) with
      | (b, 0) => oadd (a0 * b) 1 0
      | (b, Nat.succ k) =>
        scale (a0 * b + mulNat a0 k) (oadd a0 n a') + opowAux (a0 * b) a0 (mulNat (oadd a0 n a') m) k m) =
    (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ repr o₂
[PROOFSTEP]
skip
[GOAL]
case mk.intro.oadd.intro.mk.intro.zero
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this✝ : NF a0
this : NF a'
a00 : repr a0 ≠ 0
ad : ω ∣ repr a'
al : repr a' + ↑m < ω ^ repr a0
aa : repr (a' + ↑m) = repr a' + ↑m
b' : ONote
left✝ : NF b'
e₂ : split' o₂ = (b', Nat.zero)
r₂ : repr o₂ = ω * repr b' + ↑Nat.zero
⊢ repr
      (match (scale 1 b', Nat.zero) with
      | (b, 0) => oadd (a0 * b) 1 0
      | (b, Nat.succ k) =>
        scale (a0 * b + mulNat a0 k) (oadd a0 n a') + opowAux (a0 * b) a0 (mulNat (oadd a0 n a') m) k m) =
    (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ repr o₂
[PROOFSTEP]
simp [opow, r₂, opow_mul, repr_opow_aux₁ a00 al aa, add_assoc, split_eq_scale_split' e₂]
[GOAL]
case mk.intro.oadd.intro.mk.intro.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this✝ : NF a0
this : NF a'
a00 : repr a0 ≠ 0
ad : ω ∣ repr a'
al : repr a' + ↑m < ω ^ repr a0
aa : repr (a' + ↑m) = repr a' + ↑m
b' : ONote
left✝ : NF b'
k : ℕ
e₂ : split' o₂ = (b', Nat.succ k)
r₂ : repr o₂ = ω * repr b' + ↑(Nat.succ k)
⊢ repr
      (match (scale 1 b', Nat.succ k) with
      | (b, 0) => oadd (a0 * b) 1 0
      | (b, Nat.succ k) =>
        scale (a0 * b + mulNat a0 k) (oadd a0 n a') + opowAux (a0 * b) a0 (mulNat (oadd a0 n a') m) k m) =
    (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ repr o₂
[PROOFSTEP]
simp [opow, opowAux2, r₂, opow_add, opow_mul, mul_assoc, add_assoc, -repr]
[GOAL]
case mk.intro.oadd.intro.mk.intro.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this✝ : NF a0
this : NF a'
a00 : repr a0 ≠ 0
ad : ω ∣ repr a'
al : repr a' + ↑m < ω ^ repr a0
aa : repr (a' + ↑m) = repr a' + ↑m
b' : ONote
left✝ : NF b'
k : ℕ
e₂ : split' o₂ = (b', Nat.succ k)
r₂ : repr o₂ = ω * repr b' + ↑(Nat.succ k)
⊢ ((ω ^ repr a0) ^ ω ^ repr 1) ^ repr b' * ((ω ^ repr a0) ^ ↑k * repr (oadd a0 n a')) +
      repr (opowAux (a0 * scale 1 b') a0 (oadd a0 n a' * ↑m) k m) =
    ((ω ^ repr a0 * ↑↑n + (repr a' + ↑m)) ^ ω) ^ repr b' *
      ((ω ^ repr a0 * ↑↑n + (repr a' + ↑m)) ^ ↑k * (ω ^ repr a0 * ↑↑n + (repr a' + ↑m)))
[PROOFSTEP]
simp [repr]
[GOAL]
case mk.intro.oadd.intro.mk.intro.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this✝ : NF a0
this : NF a'
a00 : repr a0 ≠ 0
ad : ω ∣ repr a'
al : repr a' + ↑m < ω ^ repr a0
aa : repr (a' + ↑m) = repr a' + ↑m
b' : ONote
left✝ : NF b'
k : ℕ
e₂ : split' o₂ = (b', Nat.succ k)
r₂ : repr o₂ = ω * repr b' + ↑(Nat.succ k)
⊢ ((ω ^ repr a0) ^ ω) ^ repr b' * ((ω ^ repr a0) ^ ↑k * (ω ^ repr a0 * ↑↑n + repr a')) +
      repr (opowAux (a0 * scale 1 b') a0 (oadd a0 n a' * ↑m) k m) =
    ((ω ^ repr a0 * ↑↑n + (repr a' + ↑m)) ^ ω) ^ repr b' *
      ((ω ^ repr a0 * ↑↑n + (repr a' + ↑m)) ^ ↑k * (ω ^ repr a0 * ↑↑n + (repr a' + ↑m)))
[PROOFSTEP]
rw [repr_opow_aux₁ a00 al aa, scale_opowAux]
[GOAL]
case mk.intro.oadd.intro.mk.intro.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this✝ : NF a0
this : NF a'
a00 : repr a0 ≠ 0
ad : ω ∣ repr a'
al : repr a' + ↑m < ω ^ repr a0
aa : repr (a' + ↑m) = repr a' + ↑m
b' : ONote
left✝ : NF b'
k : ℕ
e₂ : split' o₂ = (b', Nat.succ k)
r₂ : repr o₂ = ω * repr b' + ↑(Nat.succ k)
⊢ ((ω ^ repr a0) ^ ω) ^ repr b' * ((ω ^ repr a0) ^ ↑k * (ω ^ repr a0 * ↑↑n + repr a')) +
      ω ^ repr (a0 * scale 1 b') * repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k m) =
    ((ω ^ repr a0) ^ ω) ^ repr b' * ((ω ^ repr a0 * ↑↑n + (repr a' + ↑m)) ^ ↑k * (ω ^ repr a0 * ↑↑n + (repr a' + ↑m)))
[PROOFSTEP]
simp [opow_mul]
[GOAL]
case mk.intro.oadd.intro.mk.intro.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this✝ : NF a0
this : NF a'
a00 : repr a0 ≠ 0
ad : ω ∣ repr a'
al : repr a' + ↑m < ω ^ repr a0
aa : repr (a' + ↑m) = repr a' + ↑m
b' : ONote
left✝ : NF b'
k : ℕ
e₂ : split' o₂ = (b', Nat.succ k)
r₂ : repr o₂ = ω * repr b' + ↑(Nat.succ k)
⊢ ((ω ^ repr a0) ^ ω) ^ repr b' * ((ω ^ repr a0) ^ ↑k * (ω ^ repr a0 * ↑↑n + repr a')) +
      ((ω ^ repr a0) ^ ω) ^ repr b' * repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k m) =
    ((ω ^ repr a0) ^ ω) ^ repr b' * ((ω ^ repr a0 * ↑↑n + (repr a' + ↑m)) ^ ↑k * (ω ^ repr a0 * ↑↑n + (repr a' + ↑m)))
[PROOFSTEP]
rw [← mul_add, ← add_assoc ((ω : Ordinal.{0}) ^ repr a0 * (n : ℕ))]
[GOAL]
case mk.intro.oadd.intro.mk.intro.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this✝ : NF a0
this : NF a'
a00 : repr a0 ≠ 0
ad : ω ∣ repr a'
al : repr a' + ↑m < ω ^ repr a0
aa : repr (a' + ↑m) = repr a' + ↑m
b' : ONote
left✝ : NF b'
k : ℕ
e₂ : split' o₂ = (b', Nat.succ k)
r₂ : repr o₂ = ω * repr b' + ↑(Nat.succ k)
⊢ ((ω ^ repr a0) ^ ω) ^ repr b' *
      ((ω ^ repr a0) ^ ↑k * (ω ^ repr a0 * ↑↑n + repr a') + repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k m)) =
    ((ω ^ repr a0) ^ ω) ^ repr b' * ((ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ ↑k * (ω ^ repr a0 * ↑↑n + repr a' + ↑m))
[PROOFSTEP]
congr 1
[GOAL]
case mk.intro.oadd.intro.mk.intro.succ.e_a
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this✝ : NF a0
this : NF a'
a00 : repr a0 ≠ 0
ad : ω ∣ repr a'
al : repr a' + ↑m < ω ^ repr a0
aa : repr (a' + ↑m) = repr a' + ↑m
b' : ONote
left✝ : NF b'
k : ℕ
e₂ : split' o₂ = (b', Nat.succ k)
r₂ : repr o₂ = ω * repr b' + ↑(Nat.succ k)
⊢ (ω ^ repr a0) ^ ↑k * (ω ^ repr a0 * ↑↑n + repr a') + repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k m) =
    (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ ↑k * (ω ^ repr a0 * ↑↑n + repr a' + ↑m)
[PROOFSTEP]
rw [← opow_succ]
[GOAL]
case mk.intro.oadd.intro.mk.intro.succ.e_a
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
N₁ : NF (oadd a0 n a')
r₁ : repr o₁ = repr (oadd a0 n a') + ↑m
this✝ : NF a0
this : NF a'
a00 : repr a0 ≠ 0
ad : ω ∣ repr a'
al : repr a' + ↑m < ω ^ repr a0
aa : repr (a' + ↑m) = repr a' + ↑m
b' : ONote
left✝ : NF b'
k : ℕ
e₂ : split' o₂ = (b', Nat.succ k)
r₂ : repr o₂ = ω * repr b' + ↑(Nat.succ k)
⊢ (ω ^ repr a0) ^ ↑k * (ω ^ repr a0 * ↑↑n + repr a') + repr (opowAux 0 a0 (oadd a0 n a' * ↑m) k m) =
    (ω ^ repr a0 * ↑↑n + repr a' + ↑m) ^ succ ↑k
[PROOFSTEP]
exact (repr_opow_aux₂ _ ad a00 al _ _).2
[GOAL]
α : Sort u_1
hα : Nonempty α
o : Ordinal.{u_2}
f : α → Ordinal.{u_2}
H : ∀ ⦃a : Ordinal.{u_2}⦄, a < o → ∃ i, a < f i
b a : Ordinal.{u_2}
h : a < b + o
⊢ ∃ i, a < b + f i
[PROOFSTEP]
cases' lt_or_le a b with h h'
[GOAL]
case inl
α : Sort u_1
hα : Nonempty α
o : Ordinal.{u_2}
f : α → Ordinal.{u_2}
H : ∀ ⦃a : Ordinal.{u_2}⦄, a < o → ∃ i, a < f i
b a : Ordinal.{u_2}
h✝ : a < b + o
h : a < b
⊢ ∃ i, a < b + f i
[PROOFSTEP]
obtain ⟨i⟩ := id hα
[GOAL]
case inl.intro
α : Sort u_1
hα : Nonempty α
o : Ordinal.{u_2}
f : α → Ordinal.{u_2}
H : ∀ ⦃a : Ordinal.{u_2}⦄, a < o → ∃ i, a < f i
b a : Ordinal.{u_2}
h✝ : a < b + o
h : a < b
i : α
⊢ ∃ i, a < b + f i
[PROOFSTEP]
exact ⟨i, h.trans_le (le_add_right _ _)⟩
[GOAL]
case inr
α : Sort u_1
hα : Nonempty α
o : Ordinal.{u_2}
f : α → Ordinal.{u_2}
H : ∀ ⦃a : Ordinal.{u_2}⦄, a < o → ∃ i, a < f i
b a : Ordinal.{u_2}
h : a < b + o
h' : b ≤ a
⊢ ∃ i, a < b + f i
[PROOFSTEP]
rw [← Ordinal.add_sub_cancel_of_le h', add_lt_add_iff_left] at h
[GOAL]
case inr
α : Sort u_1
hα : Nonempty α
o : Ordinal.{u_2}
f : α → Ordinal.{u_2}
H : ∀ ⦃a : Ordinal.{u_2}⦄, a < o → ∃ i, a < f i
b a : Ordinal.{u_2}
h : a - b < o
h' : b ≤ a
⊢ ∃ i, a < b + f i
[PROOFSTEP]
refine' (H h).imp fun i H => _
[GOAL]
case inr
α : Sort u_1
hα : Nonempty α
o : Ordinal.{u_2}
f : α → Ordinal.{u_2}
H✝ : ∀ ⦃a : Ordinal.{u_2}⦄, a < o → ∃ i, a < f i
b a : Ordinal.{u_2}
h : a - b < o
h' : b ≤ a
i : α
H : a - b < f i
⊢ a < b + f i
[PROOFSTEP]
rwa [← Ordinal.add_sub_cancel_of_le h', add_lt_add_iff_left]
[GOAL]
o a : Ordinal.{u_1}
h : a < o * ω
⊢ ∃ i, a < o * ↑i + o
[PROOFSTEP]
obtain ⟨i, hi, h'⟩ := (lt_mul_of_limit omega_isLimit).1 h
[GOAL]
case intro.intro
o a : Ordinal.{u_1}
h : a < o * ω
i : Ordinal.{u_1}
hi : i < ω
h' : a < o * i
⊢ ∃ i, a < o * ↑i + o
[PROOFSTEP]
obtain ⟨i, rfl⟩ := lt_omega.1 hi
[GOAL]
case intro.intro.intro
o a : Ordinal.{u_1}
h : a < o * ω
i : ℕ
hi : ↑i < ω
h' : a < o * ↑i
⊢ ∃ i, a < o * ↑i + o
[PROOFSTEP]
exact ⟨i, h'.trans_le (le_add_right _ _)⟩
[GOAL]
α : Sort u_1
o b : Ordinal.{u_2}
hb : 1 < b
ho : IsLimit o
f : α → Ordinal.{u_2}
H : ∀ ⦃a : Ordinal.{u_2}⦄, a < o → ∃ i, a < f i
a : Ordinal.{u_2}
h : a < b ^ o
⊢ ∃ i, a < b ^ f i
[PROOFSTEP]
obtain ⟨d, hd, h'⟩ := (lt_opow_of_limit (zero_lt_one.trans hb).ne' ho).1 h
[GOAL]
case intro.intro
α : Sort u_1
o b : Ordinal.{u_2}
hb : 1 < b
ho : IsLimit o
f : α → Ordinal.{u_2}
H : ∀ ⦃a : Ordinal.{u_2}⦄, a < o → ∃ i, a < f i
a : Ordinal.{u_2}
h : a < b ^ o
d : Ordinal.{u_2}
hd : d < o
h' : a < b ^ d
⊢ ∃ i, a < b ^ f i
[PROOFSTEP]
exact (H hd).imp fun i hi => h'.trans <| (opow_lt_opow_iff_right hb).2 hi
[GOAL]
o : ONote
⊢ FundamentalSequenceProp o (fundamentalSequence o)
[PROOFSTEP]
induction' o with a m b iha ihb
[GOAL]
case zero
⊢ FundamentalSequenceProp zero (fundamentalSequence zero)
[PROOFSTEP]
exact rfl
[GOAL]
case oadd
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : FundamentalSequenceProp b (fundamentalSequence b)
⊢ FundamentalSequenceProp (oadd a m b) (fundamentalSequence (oadd a m b))
[PROOFSTEP]
rw [fundamentalSequence]
[GOAL]
case oadd
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : FundamentalSequenceProp b (fundamentalSequence b)
⊢ FundamentalSequenceProp (oadd a m b)
    (match fundamentalSequence b with
    | Sum.inr f => Sum.inr fun i => oadd a m (f i)
    | Sum.inl (some b') => Sum.inl (some (oadd a m b'))
    | Sum.inl none =>
      match fundamentalSequence a, PNat.natPred m with
      | Sum.inl none, 0 => Sum.inl (some zero)
      | Sum.inl none, Nat.succ m => Sum.inl (some (oadd zero (Nat.succPNat m) zero))
      | Sum.inl (some a'), 0 => Sum.inr fun i => oadd a' (Nat.succPNat i) zero
      | Sum.inl (some a'), Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd a' (Nat.succPNat i) zero)
      | Sum.inr f, 0 => Sum.inr fun i => oadd (f i) 1 zero
      | Sum.inr f, Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd (f i) 1 zero))
[PROOFSTEP]
rcases e : b.fundamentalSequence with (⟨_ | b'⟩ | f)
[GOAL]
case oadd.inl.none
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : FundamentalSequenceProp b (fundamentalSequence b)
e : fundamentalSequence b = Sum.inl none
⊢ FundamentalSequenceProp (oadd a m b)
    (match Sum.inl none with
    | Sum.inr f => Sum.inr fun i => oadd a m (f i)
    | Sum.inl (some b') => Sum.inl (some (oadd a m b'))
    | Sum.inl none =>
      match fundamentalSequence a, PNat.natPred m with
      | Sum.inl none, 0 => Sum.inl (some zero)
      | Sum.inl none, Nat.succ m => Sum.inl (some (oadd zero (Nat.succPNat m) zero))
      | Sum.inl (some a'), 0 => Sum.inr fun i => oadd a' (Nat.succPNat i) zero
      | Sum.inl (some a'), Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd a' (Nat.succPNat i) zero)
      | Sum.inr f, 0 => Sum.inr fun i => oadd (f i) 1 zero
      | Sum.inr f, Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd (f i) 1 zero))
[PROOFSTEP]
simp only [FundamentalSequenceProp]
[GOAL]
case oadd.inl.some
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : FundamentalSequenceProp b (fundamentalSequence b)
b' : ONote
e : fundamentalSequence b = Sum.inl (some b')
⊢ FundamentalSequenceProp (oadd a m b)
    (match Sum.inl (some b') with
    | Sum.inr f => Sum.inr fun i => oadd a m (f i)
    | Sum.inl (some b') => Sum.inl (some (oadd a m b'))
    | Sum.inl none =>
      match fundamentalSequence a, PNat.natPred m with
      | Sum.inl none, 0 => Sum.inl (some zero)
      | Sum.inl none, Nat.succ m => Sum.inl (some (oadd zero (Nat.succPNat m) zero))
      | Sum.inl (some a'), 0 => Sum.inr fun i => oadd a' (Nat.succPNat i) zero
      | Sum.inl (some a'), Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd a' (Nat.succPNat i) zero)
      | Sum.inr f, 0 => Sum.inr fun i => oadd (f i) 1 zero
      | Sum.inr f, Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd (f i) 1 zero))
[PROOFSTEP]
simp only [FundamentalSequenceProp]
[GOAL]
case oadd.inr
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : FundamentalSequenceProp b (fundamentalSequence b)
f : ℕ → ONote
e : fundamentalSequence b = Sum.inr f
⊢ FundamentalSequenceProp (oadd a m b)
    (match Sum.inr f with
    | Sum.inr f => Sum.inr fun i => oadd a m (f i)
    | Sum.inl (some b') => Sum.inl (some (oadd a m b'))
    | Sum.inl none =>
      match fundamentalSequence a, PNat.natPred m with
      | Sum.inl none, 0 => Sum.inl (some zero)
      | Sum.inl none, Nat.succ m => Sum.inl (some (oadd zero (Nat.succPNat m) zero))
      | Sum.inl (some a'), 0 => Sum.inr fun i => oadd a' (Nat.succPNat i) zero
      | Sum.inl (some a'), Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd a' (Nat.succPNat i) zero)
      | Sum.inr f, 0 => Sum.inr fun i => oadd (f i) 1 zero
      | Sum.inr f, Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd (f i) 1 zero))
[PROOFSTEP]
simp only [FundamentalSequenceProp]
[GOAL]
case oadd.inl.none
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : FundamentalSequenceProp b (fundamentalSequence b)
e : fundamentalSequence b = Sum.inl none
⊢ FundamentalSequenceProp (oadd a m b)
    (match fundamentalSequence a, PNat.natPred m with
    | Sum.inl none, 0 => Sum.inl (some zero)
    | Sum.inl none, Nat.succ m => Sum.inl (some (oadd zero (Nat.succPNat m) zero))
    | Sum.inl (some a'), 0 => Sum.inr fun i => oadd a' (Nat.succPNat i) zero
    | Sum.inl (some a'), Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd a' (Nat.succPNat i) zero)
    | Sum.inr f, 0 => Sum.inr fun i => oadd (f i) 1 zero
    | Sum.inr f, Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd (f i) 1 zero))
[PROOFSTEP]
rw [e, FundamentalSequenceProp] at ihb
[GOAL]
case oadd.inl.some
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : FundamentalSequenceProp b (fundamentalSequence b)
b' : ONote
e : fundamentalSequence b = Sum.inl (some b')
⊢ repr (oadd a m b) = succ (repr (oadd a m b')) ∧ (NF (oadd a m b) → NF (oadd a m b'))
[PROOFSTEP]
rw [e, FundamentalSequenceProp] at ihb
[GOAL]
case oadd.inr
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : FundamentalSequenceProp b (fundamentalSequence b)
f : ℕ → ONote
e : fundamentalSequence b = Sum.inr f
⊢ IsLimit (repr (oadd a m b)) ∧
    (∀ (i : ℕ),
        oadd a m (f i) < oadd a m (f (i + 1)) ∧ oadd a m (f i) < oadd a m b ∧ (NF (oadd a m b) → NF (oadd a m (f i)))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a m b) → ∃ i, a_1 < repr (oadd a m (f i))
[PROOFSTEP]
rw [e, FundamentalSequenceProp] at ihb
[GOAL]
case oadd.inl.none
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : b = 0
e : fundamentalSequence b = Sum.inl none
⊢ FundamentalSequenceProp (oadd a m b)
    (match fundamentalSequence a, PNat.natPred m with
    | Sum.inl none, 0 => Sum.inl (some zero)
    | Sum.inl none, Nat.succ m => Sum.inl (some (oadd zero (Nat.succPNat m) zero))
    | Sum.inl (some a'), 0 => Sum.inr fun i => oadd a' (Nat.succPNat i) zero
    | Sum.inl (some a'), Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd a' (Nat.succPNat i) zero)
    | Sum.inr f, 0 => Sum.inr fun i => oadd (f i) 1 zero
    | Sum.inr f, Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd (f i) 1 zero))
[PROOFSTEP]
rcases e : a.fundamentalSequence with (⟨_ | a'⟩ | f)
[GOAL]
case oadd.inl.none.inl.none
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
⊢ FundamentalSequenceProp (oadd a m b)
    (match Sum.inl none, PNat.natPred m with
    | Sum.inl none, 0 => Sum.inl (some zero)
    | Sum.inl none, Nat.succ m => Sum.inl (some (oadd zero (Nat.succPNat m) zero))
    | Sum.inl (some a'), 0 => Sum.inr fun i => oadd a' (Nat.succPNat i) zero
    | Sum.inl (some a'), Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd a' (Nat.succPNat i) zero)
    | Sum.inr f, 0 => Sum.inr fun i => oadd (f i) 1 zero
    | Sum.inr f, Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd (f i) 1 zero))
[PROOFSTEP]
cases' e' : m.natPred with m'
[GOAL]
case oadd.inl.none.inl.some
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
e : fundamentalSequence a = Sum.inl (some a')
⊢ FundamentalSequenceProp (oadd a m b)
    (match Sum.inl (some a'), PNat.natPred m with
    | Sum.inl none, 0 => Sum.inl (some zero)
    | Sum.inl none, Nat.succ m => Sum.inl (some (oadd zero (Nat.succPNat m) zero))
    | Sum.inl (some a'), 0 => Sum.inr fun i => oadd a' (Nat.succPNat i) zero
    | Sum.inl (some a'), Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd a' (Nat.succPNat i) zero)
    | Sum.inr f, 0 => Sum.inr fun i => oadd (f i) 1 zero
    | Sum.inr f, Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd (f i) 1 zero))
[PROOFSTEP]
cases' e' : m.natPred with m'
[GOAL]
case oadd.inl.none.inr
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
e : fundamentalSequence a = Sum.inr f
⊢ FundamentalSequenceProp (oadd a m b)
    (match Sum.inr f, PNat.natPred m with
    | Sum.inl none, 0 => Sum.inl (some zero)
    | Sum.inl none, Nat.succ m => Sum.inl (some (oadd zero (Nat.succPNat m) zero))
    | Sum.inl (some a'), 0 => Sum.inr fun i => oadd a' (Nat.succPNat i) zero
    | Sum.inl (some a'), Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd a' (Nat.succPNat i) zero)
    | Sum.inr f, 0 => Sum.inr fun i => oadd (f i) 1 zero
    | Sum.inr f, Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd (f i) 1 zero))
[PROOFSTEP]
cases' e' : m.natPred with m'
[GOAL]
case oadd.inl.none.inl.none.zero
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
e' : PNat.natPred m = Nat.zero
⊢ FundamentalSequenceProp (oadd a m b)
    (match Sum.inl none, Nat.zero with
    | Sum.inl none, 0 => Sum.inl (some zero)
    | Sum.inl none, Nat.succ m => Sum.inl (some (oadd zero (Nat.succPNat m) zero))
    | Sum.inl (some a'), 0 => Sum.inr fun i => oadd a' (Nat.succPNat i) zero
    | Sum.inl (some a'), Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd a' (Nat.succPNat i) zero)
    | Sum.inr f, 0 => Sum.inr fun i => oadd (f i) 1 zero
    | Sum.inr f, Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd (f i) 1 zero))
[PROOFSTEP]
simp only [FundamentalSequenceProp]
[GOAL]
case oadd.inl.none.inl.none.succ
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ FundamentalSequenceProp (oadd a m b)
    (match Sum.inl none, Nat.succ m' with
    | Sum.inl none, 0 => Sum.inl (some zero)
    | Sum.inl none, Nat.succ m => Sum.inl (some (oadd zero (Nat.succPNat m) zero))
    | Sum.inl (some a'), 0 => Sum.inr fun i => oadd a' (Nat.succPNat i) zero
    | Sum.inl (some a'), Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd a' (Nat.succPNat i) zero)
    | Sum.inr f, 0 => Sum.inr fun i => oadd (f i) 1 zero
    | Sum.inr f, Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd (f i) 1 zero))
[PROOFSTEP]
simp only [FundamentalSequenceProp]
[GOAL]
case oadd.inl.none.inl.some.zero
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
e : fundamentalSequence a = Sum.inl (some a')
e' : PNat.natPred m = Nat.zero
⊢ FundamentalSequenceProp (oadd a m b)
    (match Sum.inl (some a'), Nat.zero with
    | Sum.inl none, 0 => Sum.inl (some zero)
    | Sum.inl none, Nat.succ m => Sum.inl (some (oadd zero (Nat.succPNat m) zero))
    | Sum.inl (some a'), 0 => Sum.inr fun i => oadd a' (Nat.succPNat i) zero
    | Sum.inl (some a'), Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd a' (Nat.succPNat i) zero)
    | Sum.inr f, 0 => Sum.inr fun i => oadd (f i) 1 zero
    | Sum.inr f, Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd (f i) 1 zero))
[PROOFSTEP]
simp only [FundamentalSequenceProp]
[GOAL]
case oadd.inl.none.inl.some.succ
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
e : fundamentalSequence a = Sum.inl (some a')
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ FundamentalSequenceProp (oadd a m b)
    (match Sum.inl (some a'), Nat.succ m' with
    | Sum.inl none, 0 => Sum.inl (some zero)
    | Sum.inl none, Nat.succ m => Sum.inl (some (oadd zero (Nat.succPNat m) zero))
    | Sum.inl (some a'), 0 => Sum.inr fun i => oadd a' (Nat.succPNat i) zero
    | Sum.inl (some a'), Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd a' (Nat.succPNat i) zero)
    | Sum.inr f, 0 => Sum.inr fun i => oadd (f i) 1 zero
    | Sum.inr f, Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd (f i) 1 zero))
[PROOFSTEP]
simp only [FundamentalSequenceProp]
[GOAL]
case oadd.inl.none.inr.zero
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
e : fundamentalSequence a = Sum.inr f
e' : PNat.natPred m = Nat.zero
⊢ FundamentalSequenceProp (oadd a m b)
    (match Sum.inr f, Nat.zero with
    | Sum.inl none, 0 => Sum.inl (some zero)
    | Sum.inl none, Nat.succ m => Sum.inl (some (oadd zero (Nat.succPNat m) zero))
    | Sum.inl (some a'), 0 => Sum.inr fun i => oadd a' (Nat.succPNat i) zero
    | Sum.inl (some a'), Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd a' (Nat.succPNat i) zero)
    | Sum.inr f, 0 => Sum.inr fun i => oadd (f i) 1 zero
    | Sum.inr f, Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd (f i) 1 zero))
[PROOFSTEP]
simp only [FundamentalSequenceProp]
[GOAL]
case oadd.inl.none.inr.succ
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
e : fundamentalSequence a = Sum.inr f
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ FundamentalSequenceProp (oadd a m b)
    (match Sum.inr f, Nat.succ m' with
    | Sum.inl none, 0 => Sum.inl (some zero)
    | Sum.inl none, Nat.succ m => Sum.inl (some (oadd zero (Nat.succPNat m) zero))
    | Sum.inl (some a'), 0 => Sum.inr fun i => oadd a' (Nat.succPNat i) zero
    | Sum.inl (some a'), Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd a' (Nat.succPNat i) zero)
    | Sum.inr f, 0 => Sum.inr fun i => oadd (f i) 1 zero
    | Sum.inr f, Nat.succ m => Sum.inr fun i => oadd a (Nat.succPNat m) (oadd (f i) 1 zero))
[PROOFSTEP]
simp only [FundamentalSequenceProp]
[GOAL]
case oadd.inl.none.inl.none.zero
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
e' : PNat.natPred m = Nat.zero
⊢ repr (oadd a m b) = succ (repr zero) ∧ (NF (oadd a m b) → True)
[PROOFSTEP]
rw [e, FundamentalSequenceProp] at iha
[GOAL]
case oadd.inl.none.inl.none.succ
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ repr (oadd a m b) = succ (repr (oadd zero (Nat.succPNat m') zero)) ∧
    (NF (oadd a m b) → NF (oadd zero (Nat.succPNat m') zero))
[PROOFSTEP]
rw [e, FundamentalSequenceProp] at iha
[GOAL]
case oadd.inl.none.inl.some.zero
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
e : fundamentalSequence a = Sum.inl (some a')
e' : PNat.natPred m = Nat.zero
⊢ IsLimit (repr (oadd a m b)) ∧
    (∀ (i : ℕ),
        oadd a' (Nat.succPNat i) zero < oadd a' (Nat.succPNat (i + 1)) zero ∧
          oadd a' (Nat.succPNat i) zero < oadd a m b ∧ (NF (oadd a m b) → NF (oadd a' (Nat.succPNat i) zero))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a m b) → ∃ i, a_1 < repr (oadd a' (Nat.succPNat i) zero)
[PROOFSTEP]
rw [e, FundamentalSequenceProp] at iha
[GOAL]
case oadd.inl.none.inl.some.succ
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
e : fundamentalSequence a = Sum.inl (some a')
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ IsLimit (repr (oadd a m b)) ∧
    (∀ (i : ℕ),
        oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero) <
            oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat (i + 1)) zero) ∧
          oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero) < oadd a m b ∧
            (NF (oadd a m b) → NF (oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero)))) ∧
      ∀ (a_1 : Ordinal.{0}),
        a_1 < repr (oadd a m b) → ∃ i, a_1 < repr (oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero))
[PROOFSTEP]
rw [e, FundamentalSequenceProp] at iha
[GOAL]
case oadd.inl.none.inr.zero
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
e : fundamentalSequence a = Sum.inr f
e' : PNat.natPred m = Nat.zero
⊢ IsLimit (repr (oadd a m b)) ∧
    (∀ (i : ℕ),
        oadd (f i) 1 zero < oadd (f (i + 1)) 1 zero ∧
          oadd (f i) 1 zero < oadd a m b ∧ (NF (oadd a m b) → NF (oadd (f i) 1 zero))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a m b) → ∃ i, a_1 < repr (oadd (f i) 1 zero)
[PROOFSTEP]
rw [e, FundamentalSequenceProp] at iha
[GOAL]
case oadd.inl.none.inr.succ
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
e : fundamentalSequence a = Sum.inr f
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ IsLimit (repr (oadd a m b)) ∧
    (∀ (i : ℕ),
        oadd a (Nat.succPNat m') (oadd (f i) 1 zero) < oadd a (Nat.succPNat m') (oadd (f (i + 1)) 1 zero) ∧
          oadd a (Nat.succPNat m') (oadd (f i) 1 zero) < oadd a m b ∧
            (NF (oadd a m b) → NF (oadd a (Nat.succPNat m') (oadd (f i) 1 zero)))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a m b) → ∃ i, a_1 < repr (oadd a (Nat.succPNat m') (oadd (f i) 1 zero))
[PROOFSTEP]
rw [e, FundamentalSequenceProp] at iha
[GOAL]
case oadd.inl.none.inl.none.zero
a : ONote
m : ℕ+
b : ONote
iha : a = 0
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
e' : PNat.natPred m = Nat.zero
⊢ repr (oadd a m b) = succ (repr zero) ∧ (NF (oadd a m b) → True)
[PROOFSTEP]
try rw [show m = 1 by have := PNat.natPred_add_one m; rw [e'] at this ; exact PNat.coe_inj.1 this.symm]
[GOAL]
case oadd.inl.none.inl.none.zero
a : ONote
m : ℕ+
b : ONote
iha : a = 0
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
e' : PNat.natPred m = Nat.zero
⊢ repr (oadd a m b) = succ (repr zero) ∧ (NF (oadd a m b) → True)
[PROOFSTEP]
rw [show m = 1 by have := PNat.natPred_add_one m; rw [e'] at this ; exact PNat.coe_inj.1 this.symm]
[GOAL]
a : ONote
m : ℕ+
b : ONote
iha : a = 0
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
e' : PNat.natPred m = Nat.zero
⊢ m = 1
[PROOFSTEP]
have := PNat.natPred_add_one m
[GOAL]
a : ONote
m : ℕ+
b : ONote
iha : a = 0
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
e' : PNat.natPred m = Nat.zero
this : PNat.natPred m + 1 = ↑m
⊢ m = 1
[PROOFSTEP]
rw [e'] at this
[GOAL]
a : ONote
m : ℕ+
b : ONote
iha : a = 0
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
e' : PNat.natPred m = Nat.zero
this : Nat.zero + 1 = ↑m
⊢ m = 1
[PROOFSTEP]
exact PNat.coe_inj.1 this.symm
[GOAL]
case oadd.inl.none.inl.none.succ
a : ONote
m : ℕ+
b : ONote
iha : a = 0
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ repr (oadd a m b) = succ (repr (oadd zero (Nat.succPNat m') zero)) ∧
    (NF (oadd a m b) → NF (oadd zero (Nat.succPNat m') zero))
[PROOFSTEP]
try rw [show m = 1 by have := PNat.natPred_add_one m; rw [e'] at this ; exact PNat.coe_inj.1 this.symm]
[GOAL]
case oadd.inl.none.inl.none.succ
a : ONote
m : ℕ+
b : ONote
iha : a = 0
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ repr (oadd a m b) = succ (repr (oadd zero (Nat.succPNat m') zero)) ∧
    (NF (oadd a m b) → NF (oadd zero (Nat.succPNat m') zero))
[PROOFSTEP]
rw [show m = 1 by have := PNat.natPred_add_one m; rw [e'] at this ; exact PNat.coe_inj.1 this.symm]
[GOAL]
a : ONote
m : ℕ+
b : ONote
iha : a = 0
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ m = 1
[PROOFSTEP]
have := PNat.natPred_add_one m
[GOAL]
a : ONote
m : ℕ+
b : ONote
iha : a = 0
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
this : PNat.natPred m + 1 = ↑m
⊢ m = 1
[PROOFSTEP]
rw [e'] at this
[GOAL]
a : ONote
m : ℕ+
b : ONote
iha : a = 0
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
this : Nat.succ m' + 1 = ↑m
⊢ m = 1
[PROOFSTEP]
exact PNat.coe_inj.1 this.symm
[GOAL]
case oadd.inl.none.inl.some.zero
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
e' : PNat.natPred m = Nat.zero
⊢ IsLimit (repr (oadd a m b)) ∧
    (∀ (i : ℕ),
        oadd a' (Nat.succPNat i) zero < oadd a' (Nat.succPNat (i + 1)) zero ∧
          oadd a' (Nat.succPNat i) zero < oadd a m b ∧ (NF (oadd a m b) → NF (oadd a' (Nat.succPNat i) zero))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a m b) → ∃ i, a_1 < repr (oadd a' (Nat.succPNat i) zero)
[PROOFSTEP]
try rw [show m = 1 by have := PNat.natPred_add_one m; rw [e'] at this ; exact PNat.coe_inj.1 this.symm]
[GOAL]
case oadd.inl.none.inl.some.zero
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
e' : PNat.natPred m = Nat.zero
⊢ IsLimit (repr (oadd a m b)) ∧
    (∀ (i : ℕ),
        oadd a' (Nat.succPNat i) zero < oadd a' (Nat.succPNat (i + 1)) zero ∧
          oadd a' (Nat.succPNat i) zero < oadd a m b ∧ (NF (oadd a m b) → NF (oadd a' (Nat.succPNat i) zero))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a m b) → ∃ i, a_1 < repr (oadd a' (Nat.succPNat i) zero)
[PROOFSTEP]
rw [show m = 1 by have := PNat.natPred_add_one m; rw [e'] at this ; exact PNat.coe_inj.1 this.symm]
[GOAL]
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
e' : PNat.natPred m = Nat.zero
⊢ m = 1
[PROOFSTEP]
have := PNat.natPred_add_one m
[GOAL]
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
e' : PNat.natPred m = Nat.zero
this : PNat.natPred m + 1 = ↑m
⊢ m = 1
[PROOFSTEP]
rw [e'] at this
[GOAL]
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
e' : PNat.natPred m = Nat.zero
this : Nat.zero + 1 = ↑m
⊢ m = 1
[PROOFSTEP]
exact PNat.coe_inj.1 this.symm
[GOAL]
case oadd.inl.none.inl.some.succ
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ IsLimit (repr (oadd a m b)) ∧
    (∀ (i : ℕ),
        oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero) <
            oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat (i + 1)) zero) ∧
          oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero) < oadd a m b ∧
            (NF (oadd a m b) → NF (oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero)))) ∧
      ∀ (a_1 : Ordinal.{0}),
        a_1 < repr (oadd a m b) → ∃ i, a_1 < repr (oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero))
[PROOFSTEP]
try rw [show m = 1 by have := PNat.natPred_add_one m; rw [e'] at this ; exact PNat.coe_inj.1 this.symm]
[GOAL]
case oadd.inl.none.inl.some.succ
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ IsLimit (repr (oadd a m b)) ∧
    (∀ (i : ℕ),
        oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero) <
            oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat (i + 1)) zero) ∧
          oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero) < oadd a m b ∧
            (NF (oadd a m b) → NF (oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero)))) ∧
      ∀ (a_1 : Ordinal.{0}),
        a_1 < repr (oadd a m b) → ∃ i, a_1 < repr (oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero))
[PROOFSTEP]
rw [show m = 1 by have := PNat.natPred_add_one m; rw [e'] at this ; exact PNat.coe_inj.1 this.symm]
[GOAL]
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ m = 1
[PROOFSTEP]
have := PNat.natPred_add_one m
[GOAL]
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
this : PNat.natPred m + 1 = ↑m
⊢ m = 1
[PROOFSTEP]
rw [e'] at this
[GOAL]
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
this : Nat.succ m' + 1 = ↑m
⊢ m = 1
[PROOFSTEP]
exact PNat.coe_inj.1 this.symm
[GOAL]
case oadd.inl.none.inr.zero
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
iha :
  IsLimit (repr a) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
e : fundamentalSequence a = Sum.inr f
e' : PNat.natPred m = Nat.zero
⊢ IsLimit (repr (oadd a m b)) ∧
    (∀ (i : ℕ),
        oadd (f i) 1 zero < oadd (f (i + 1)) 1 zero ∧
          oadd (f i) 1 zero < oadd a m b ∧ (NF (oadd a m b) → NF (oadd (f i) 1 zero))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a m b) → ∃ i, a_1 < repr (oadd (f i) 1 zero)
[PROOFSTEP]
try rw [show m = 1 by have := PNat.natPred_add_one m; rw [e'] at this ; exact PNat.coe_inj.1 this.symm]
[GOAL]
case oadd.inl.none.inr.zero
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
iha :
  IsLimit (repr a) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
e : fundamentalSequence a = Sum.inr f
e' : PNat.natPred m = Nat.zero
⊢ IsLimit (repr (oadd a m b)) ∧
    (∀ (i : ℕ),
        oadd (f i) 1 zero < oadd (f (i + 1)) 1 zero ∧
          oadd (f i) 1 zero < oadd a m b ∧ (NF (oadd a m b) → NF (oadd (f i) 1 zero))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a m b) → ∃ i, a_1 < repr (oadd (f i) 1 zero)
[PROOFSTEP]
rw [show m = 1 by have := PNat.natPred_add_one m; rw [e'] at this ; exact PNat.coe_inj.1 this.symm]
[GOAL]
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
iha :
  IsLimit (repr a) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
e : fundamentalSequence a = Sum.inr f
e' : PNat.natPred m = Nat.zero
⊢ m = 1
[PROOFSTEP]
have := PNat.natPred_add_one m
[GOAL]
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
iha :
  IsLimit (repr a) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
e : fundamentalSequence a = Sum.inr f
e' : PNat.natPred m = Nat.zero
this : PNat.natPred m + 1 = ↑m
⊢ m = 1
[PROOFSTEP]
rw [e'] at this
[GOAL]
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
iha :
  IsLimit (repr a) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
e : fundamentalSequence a = Sum.inr f
e' : PNat.natPred m = Nat.zero
this : Nat.zero + 1 = ↑m
⊢ m = 1
[PROOFSTEP]
exact PNat.coe_inj.1 this.symm
[GOAL]
case oadd.inl.none.inr.succ
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
iha :
  IsLimit (repr a) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
e : fundamentalSequence a = Sum.inr f
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ IsLimit (repr (oadd a m b)) ∧
    (∀ (i : ℕ),
        oadd a (Nat.succPNat m') (oadd (f i) 1 zero) < oadd a (Nat.succPNat m') (oadd (f (i + 1)) 1 zero) ∧
          oadd a (Nat.succPNat m') (oadd (f i) 1 zero) < oadd a m b ∧
            (NF (oadd a m b) → NF (oadd a (Nat.succPNat m') (oadd (f i) 1 zero)))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a m b) → ∃ i, a_1 < repr (oadd a (Nat.succPNat m') (oadd (f i) 1 zero))
[PROOFSTEP]
try rw [show m = 1 by have := PNat.natPred_add_one m; rw [e'] at this ; exact PNat.coe_inj.1 this.symm]
[GOAL]
case oadd.inl.none.inr.succ
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
iha :
  IsLimit (repr a) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
e : fundamentalSequence a = Sum.inr f
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ IsLimit (repr (oadd a m b)) ∧
    (∀ (i : ℕ),
        oadd a (Nat.succPNat m') (oadd (f i) 1 zero) < oadd a (Nat.succPNat m') (oadd (f (i + 1)) 1 zero) ∧
          oadd a (Nat.succPNat m') (oadd (f i) 1 zero) < oadd a m b ∧
            (NF (oadd a m b) → NF (oadd a (Nat.succPNat m') (oadd (f i) 1 zero)))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a m b) → ∃ i, a_1 < repr (oadd a (Nat.succPNat m') (oadd (f i) 1 zero))
[PROOFSTEP]
rw [show m = 1 by have := PNat.natPred_add_one m; rw [e'] at this ; exact PNat.coe_inj.1 this.symm]
[GOAL]
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
iha :
  IsLimit (repr a) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
e : fundamentalSequence a = Sum.inr f
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ m = 1
[PROOFSTEP]
have := PNat.natPred_add_one m
[GOAL]
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
iha :
  IsLimit (repr a) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
e : fundamentalSequence a = Sum.inr f
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
this : PNat.natPred m + 1 = ↑m
⊢ m = 1
[PROOFSTEP]
rw [e'] at this
[GOAL]
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
iha :
  IsLimit (repr a) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
e : fundamentalSequence a = Sum.inr f
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
this : Nat.succ m' + 1 = ↑m
⊢ m = 1
[PROOFSTEP]
exact PNat.coe_inj.1 this.symm
[GOAL]
case oadd.inl.none.inl.none.zero
a : ONote
m : ℕ+
b : ONote
iha : a = 0
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
e' : PNat.natPred m = Nat.zero
⊢ repr (oadd a 1 b) = succ (repr zero) ∧ (NF (oadd a 1 b) → True)
[PROOFSTEP]
try rw [show m = m'.succ.succPNat by rw [← e', ← PNat.coe_inj, Nat.succPNat_coe, ← Nat.add_one, PNat.natPred_add_one]]
[GOAL]
case oadd.inl.none.inl.none.zero
a : ONote
m : ℕ+
b : ONote
iha : a = 0
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
e' : PNat.natPred m = Nat.zero
⊢ repr (oadd a 1 b) = succ (repr zero) ∧ (NF (oadd a 1 b) → True)
[PROOFSTEP]
rw [show m = m'.succ.succPNat by rw [← e', ← PNat.coe_inj, Nat.succPNat_coe, ← Nat.add_one, PNat.natPred_add_one]]
[GOAL]
case oadd.inl.none.inl.none.succ
a : ONote
m : ℕ+
b : ONote
iha : a = 0
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ repr (oadd a m b) = succ (repr (oadd zero (Nat.succPNat m') zero)) ∧
    (NF (oadd a m b) → NF (oadd zero (Nat.succPNat m') zero))
[PROOFSTEP]
try rw [show m = m'.succ.succPNat by rw [← e', ← PNat.coe_inj, Nat.succPNat_coe, ← Nat.add_one, PNat.natPred_add_one]]
[GOAL]
case oadd.inl.none.inl.none.succ
a : ONote
m : ℕ+
b : ONote
iha : a = 0
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ repr (oadd a m b) = succ (repr (oadd zero (Nat.succPNat m') zero)) ∧
    (NF (oadd a m b) → NF (oadd zero (Nat.succPNat m') zero))
[PROOFSTEP]
rw [show m = m'.succ.succPNat by rw [← e', ← PNat.coe_inj, Nat.succPNat_coe, ← Nat.add_one, PNat.natPred_add_one]]
[GOAL]
a : ONote
m : ℕ+
b : ONote
iha : a = 0
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ m = Nat.succPNat (Nat.succ m')
[PROOFSTEP]
rw [← e', ← PNat.coe_inj, Nat.succPNat_coe, ← Nat.add_one, PNat.natPred_add_one]
[GOAL]
case oadd.inl.none.inl.some.zero
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
e' : PNat.natPred m = Nat.zero
⊢ IsLimit (repr (oadd a 1 b)) ∧
    (∀ (i : ℕ),
        oadd a' (Nat.succPNat i) zero < oadd a' (Nat.succPNat (i + 1)) zero ∧
          oadd a' (Nat.succPNat i) zero < oadd a 1 b ∧ (NF (oadd a 1 b) → NF (oadd a' (Nat.succPNat i) zero))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a 1 b) → ∃ i, a_1 < repr (oadd a' (Nat.succPNat i) zero)
[PROOFSTEP]
try rw [show m = m'.succ.succPNat by rw [← e', ← PNat.coe_inj, Nat.succPNat_coe, ← Nat.add_one, PNat.natPred_add_one]]
[GOAL]
case oadd.inl.none.inl.some.zero
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
e' : PNat.natPred m = Nat.zero
⊢ IsLimit (repr (oadd a 1 b)) ∧
    (∀ (i : ℕ),
        oadd a' (Nat.succPNat i) zero < oadd a' (Nat.succPNat (i + 1)) zero ∧
          oadd a' (Nat.succPNat i) zero < oadd a 1 b ∧ (NF (oadd a 1 b) → NF (oadd a' (Nat.succPNat i) zero))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a 1 b) → ∃ i, a_1 < repr (oadd a' (Nat.succPNat i) zero)
[PROOFSTEP]
rw [show m = m'.succ.succPNat by rw [← e', ← PNat.coe_inj, Nat.succPNat_coe, ← Nat.add_one, PNat.natPred_add_one]]
[GOAL]
case oadd.inl.none.inl.some.succ
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ IsLimit (repr (oadd a m b)) ∧
    (∀ (i : ℕ),
        oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero) <
            oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat (i + 1)) zero) ∧
          oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero) < oadd a m b ∧
            (NF (oadd a m b) → NF (oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero)))) ∧
      ∀ (a_1 : Ordinal.{0}),
        a_1 < repr (oadd a m b) → ∃ i, a_1 < repr (oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero))
[PROOFSTEP]
try rw [show m = m'.succ.succPNat by rw [← e', ← PNat.coe_inj, Nat.succPNat_coe, ← Nat.add_one, PNat.natPred_add_one]]
[GOAL]
case oadd.inl.none.inl.some.succ
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ IsLimit (repr (oadd a m b)) ∧
    (∀ (i : ℕ),
        oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero) <
            oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat (i + 1)) zero) ∧
          oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero) < oadd a m b ∧
            (NF (oadd a m b) → NF (oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero)))) ∧
      ∀ (a_1 : Ordinal.{0}),
        a_1 < repr (oadd a m b) → ∃ i, a_1 < repr (oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero))
[PROOFSTEP]
rw [show m = m'.succ.succPNat by rw [← e', ← PNat.coe_inj, Nat.succPNat_coe, ← Nat.add_one, PNat.natPred_add_one]]
[GOAL]
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ m = Nat.succPNat (Nat.succ m')
[PROOFSTEP]
rw [← e', ← PNat.coe_inj, Nat.succPNat_coe, ← Nat.add_one, PNat.natPred_add_one]
[GOAL]
case oadd.inl.none.inr.zero
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
iha :
  IsLimit (repr a) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
e : fundamentalSequence a = Sum.inr f
e' : PNat.natPred m = Nat.zero
⊢ IsLimit (repr (oadd a 1 b)) ∧
    (∀ (i : ℕ),
        oadd (f i) 1 zero < oadd (f (i + 1)) 1 zero ∧
          oadd (f i) 1 zero < oadd a 1 b ∧ (NF (oadd a 1 b) → NF (oadd (f i) 1 zero))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a 1 b) → ∃ i, a_1 < repr (oadd (f i) 1 zero)
[PROOFSTEP]
try rw [show m = m'.succ.succPNat by rw [← e', ← PNat.coe_inj, Nat.succPNat_coe, ← Nat.add_one, PNat.natPred_add_one]]
[GOAL]
case oadd.inl.none.inr.zero
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
iha :
  IsLimit (repr a) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
e : fundamentalSequence a = Sum.inr f
e' : PNat.natPred m = Nat.zero
⊢ IsLimit (repr (oadd a 1 b)) ∧
    (∀ (i : ℕ),
        oadd (f i) 1 zero < oadd (f (i + 1)) 1 zero ∧
          oadd (f i) 1 zero < oadd a 1 b ∧ (NF (oadd a 1 b) → NF (oadd (f i) 1 zero))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a 1 b) → ∃ i, a_1 < repr (oadd (f i) 1 zero)
[PROOFSTEP]
rw [show m = m'.succ.succPNat by rw [← e', ← PNat.coe_inj, Nat.succPNat_coe, ← Nat.add_one, PNat.natPred_add_one]]
[GOAL]
case oadd.inl.none.inr.succ
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
iha :
  IsLimit (repr a) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
e : fundamentalSequence a = Sum.inr f
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ IsLimit (repr (oadd a m b)) ∧
    (∀ (i : ℕ),
        oadd a (Nat.succPNat m') (oadd (f i) 1 zero) < oadd a (Nat.succPNat m') (oadd (f (i + 1)) 1 zero) ∧
          oadd a (Nat.succPNat m') (oadd (f i) 1 zero) < oadd a m b ∧
            (NF (oadd a m b) → NF (oadd a (Nat.succPNat m') (oadd (f i) 1 zero)))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a m b) → ∃ i, a_1 < repr (oadd a (Nat.succPNat m') (oadd (f i) 1 zero))
[PROOFSTEP]
try rw [show m = m'.succ.succPNat by rw [← e', ← PNat.coe_inj, Nat.succPNat_coe, ← Nat.add_one, PNat.natPred_add_one]]
[GOAL]
case oadd.inl.none.inr.succ
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
iha :
  IsLimit (repr a) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
e : fundamentalSequence a = Sum.inr f
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ IsLimit (repr (oadd a m b)) ∧
    (∀ (i : ℕ),
        oadd a (Nat.succPNat m') (oadd (f i) 1 zero) < oadd a (Nat.succPNat m') (oadd (f (i + 1)) 1 zero) ∧
          oadd a (Nat.succPNat m') (oadd (f i) 1 zero) < oadd a m b ∧
            (NF (oadd a m b) → NF (oadd a (Nat.succPNat m') (oadd (f i) 1 zero)))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a m b) → ∃ i, a_1 < repr (oadd a (Nat.succPNat m') (oadd (f i) 1 zero))
[PROOFSTEP]
rw [show m = m'.succ.succPNat by rw [← e', ← PNat.coe_inj, Nat.succPNat_coe, ← Nat.add_one, PNat.natPred_add_one]]
[GOAL]
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
iha :
  IsLimit (repr a) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
e : fundamentalSequence a = Sum.inr f
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ m = Nat.succPNat (Nat.succ m')
[PROOFSTEP]
rw [← e', ← PNat.coe_inj, Nat.succPNat_coe, ← Nat.add_one, PNat.natPred_add_one]
[GOAL]
case oadd.inl.none.inl.none.zero
a : ONote
m : ℕ+
b : ONote
iha : a = 0
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
e' : PNat.natPred m = Nat.zero
⊢ repr (oadd a 1 b) = succ (repr zero) ∧ (NF (oadd a 1 b) → True)
[PROOFSTEP]
simp only [repr, iha, ihb, opow_lt_opow_iff_right one_lt_omega, add_lt_add_iff_left, add_zero, eq_self_iff_true,
  lt_add_iff_pos_right, lt_def, mul_one, Nat.cast_zero, Nat.cast_succ, Nat.succPNat_coe, opow_succ, opow_zero,
  mul_add_one, PNat.one_coe, succ_zero, true_and_iff, _root_.zero_add, zero_def]
[GOAL]
case oadd.inl.none.inl.none.succ
a : ONote
m : ℕ+
b : ONote
iha : a = 0
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ repr (oadd a (Nat.succPNat (Nat.succ m')) b) = succ (repr (oadd zero (Nat.succPNat m') zero)) ∧
    (NF (oadd a (Nat.succPNat (Nat.succ m')) b) → NF (oadd zero (Nat.succPNat m') zero))
[PROOFSTEP]
simp only [repr, iha, ihb, opow_lt_opow_iff_right one_lt_omega, add_lt_add_iff_left, add_zero, eq_self_iff_true,
  lt_add_iff_pos_right, lt_def, mul_one, Nat.cast_zero, Nat.cast_succ, Nat.succPNat_coe, opow_succ, opow_zero,
  mul_add_one, PNat.one_coe, succ_zero, true_and_iff, _root_.zero_add, zero_def]
[GOAL]
case oadd.inl.none.inl.some.zero
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
e' : PNat.natPred m = Nat.zero
⊢ IsLimit (repr (oadd a 1 b)) ∧
    (∀ (i : ℕ),
        oadd a' (Nat.succPNat i) zero < oadd a' (Nat.succPNat (i + 1)) zero ∧
          oadd a' (Nat.succPNat i) zero < oadd a 1 b ∧ (NF (oadd a 1 b) → NF (oadd a' (Nat.succPNat i) zero))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a 1 b) → ∃ i, a_1 < repr (oadd a' (Nat.succPNat i) zero)
[PROOFSTEP]
simp only [repr, iha, ihb, opow_lt_opow_iff_right one_lt_omega, add_lt_add_iff_left, add_zero, eq_self_iff_true,
  lt_add_iff_pos_right, lt_def, mul_one, Nat.cast_zero, Nat.cast_succ, Nat.succPNat_coe, opow_succ, opow_zero,
  mul_add_one, PNat.one_coe, succ_zero, true_and_iff, _root_.zero_add, zero_def]
[GOAL]
case oadd.inl.none.inl.some.succ
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ IsLimit (repr (oadd a (Nat.succPNat (Nat.succ m')) b)) ∧
    (∀ (i : ℕ),
        oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero) <
            oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat (i + 1)) zero) ∧
          oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero) < oadd a (Nat.succPNat (Nat.succ m')) b ∧
            (NF (oadd a (Nat.succPNat (Nat.succ m')) b) →
              NF (oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero)))) ∧
      ∀ (a_1 : Ordinal.{0}),
        a_1 < repr (oadd a (Nat.succPNat (Nat.succ m')) b) →
          ∃ i, a_1 < repr (oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) zero))
[PROOFSTEP]
simp only [repr, iha, ihb, opow_lt_opow_iff_right one_lt_omega, add_lt_add_iff_left, add_zero, eq_self_iff_true,
  lt_add_iff_pos_right, lt_def, mul_one, Nat.cast_zero, Nat.cast_succ, Nat.succPNat_coe, opow_succ, opow_zero,
  mul_add_one, PNat.one_coe, succ_zero, true_and_iff, _root_.zero_add, zero_def]
[GOAL]
case oadd.inl.none.inr.zero
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
iha :
  IsLimit (repr a) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
e : fundamentalSequence a = Sum.inr f
e' : PNat.natPred m = Nat.zero
⊢ IsLimit (repr (oadd a 1 b)) ∧
    (∀ (i : ℕ),
        oadd (f i) 1 zero < oadd (f (i + 1)) 1 zero ∧
          oadd (f i) 1 zero < oadd a 1 b ∧ (NF (oadd a 1 b) → NF (oadd (f i) 1 zero))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a 1 b) → ∃ i, a_1 < repr (oadd (f i) 1 zero)
[PROOFSTEP]
simp only [repr, iha, ihb, opow_lt_opow_iff_right one_lt_omega, add_lt_add_iff_left, add_zero, eq_self_iff_true,
  lt_add_iff_pos_right, lt_def, mul_one, Nat.cast_zero, Nat.cast_succ, Nat.succPNat_coe, opow_succ, opow_zero,
  mul_add_one, PNat.one_coe, succ_zero, true_and_iff, _root_.zero_add, zero_def]
[GOAL]
case oadd.inl.none.inr.succ
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
iha :
  IsLimit (repr a) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
e : fundamentalSequence a = Sum.inr f
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ IsLimit (repr (oadd a (Nat.succPNat (Nat.succ m')) b)) ∧
    (∀ (i : ℕ),
        oadd a (Nat.succPNat m') (oadd (f i) 1 zero) < oadd a (Nat.succPNat m') (oadd (f (i + 1)) 1 zero) ∧
          oadd a (Nat.succPNat m') (oadd (f i) 1 zero) < oadd a (Nat.succPNat (Nat.succ m')) b ∧
            (NF (oadd a (Nat.succPNat (Nat.succ m')) b) → NF (oadd a (Nat.succPNat m') (oadd (f i) 1 zero)))) ∧
      ∀ (a_1 : Ordinal.{0}),
        a_1 < repr (oadd a (Nat.succPNat (Nat.succ m')) b) →
          ∃ i, a_1 < repr (oadd a (Nat.succPNat m') (oadd (f i) 1 zero))
[PROOFSTEP]
simp only [repr, iha, ihb, opow_lt_opow_iff_right one_lt_omega, add_lt_add_iff_left, add_zero, eq_self_iff_true,
  lt_add_iff_pos_right, lt_def, mul_one, Nat.cast_zero, Nat.cast_succ, Nat.succPNat_coe, opow_succ, opow_zero,
  mul_add_one, PNat.one_coe, succ_zero, true_and_iff, _root_.zero_add, zero_def]
[GOAL]
case oadd.inl.none.inl.none.succ
a : ONote
m : ℕ+
b : ONote
iha : a = 0
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
e : fundamentalSequence a = Sum.inl none
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ 1 * ↑m' + 1 + 1 = succ (1 * ↑m' + 1) ∧ (NF (oadd 0 (Nat.succPNat (Nat.succ m')) 0) → NF (oadd 0 (Nat.succPNat m') 0))
[PROOFSTEP]
exact ⟨rfl, inferInstance⟩
[GOAL]
case oadd.inl.none.inl.some.zero
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
e' : PNat.natPred m = Nat.zero
⊢ IsLimit (ω ^ repr a' * ω) ∧
    (∀ (i : ℕ),
        0 < ω ^ repr a' ∧
          ω ^ repr a' * ↑i + ω ^ repr a' < ω ^ repr a' * ω ∧ (NF (oadd a 1 0) → NF (oadd a' (Nat.succPNat i) 0))) ∧
      ∀ (a : Ordinal.{0}), a < ω ^ repr a' * ω → ∃ i, a < ω ^ repr a' * ↑i + ω ^ repr a'
[PROOFSTEP]
have := opow_pos (repr a') omega_pos
[GOAL]
case oadd.inl.none.inl.some.zero
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
e' : PNat.natPred m = Nat.zero
this : 0 < ω ^ repr a'
⊢ IsLimit (ω ^ repr a' * ω) ∧
    (∀ (i : ℕ),
        0 < ω ^ repr a' ∧
          ω ^ repr a' * ↑i + ω ^ repr a' < ω ^ repr a' * ω ∧ (NF (oadd a 1 0) → NF (oadd a' (Nat.succPNat i) 0))) ∧
      ∀ (a : Ordinal.{0}), a < ω ^ repr a' * ω → ∃ i, a < ω ^ repr a' * ↑i + ω ^ repr a'
[PROOFSTEP]
refine'
  ⟨mul_isLimit this omega_isLimit, fun i => ⟨this, _, fun H => @NF.oadd_zero _ _ (iha.2 H.fst)⟩, exists_lt_mul_omega'⟩
[GOAL]
case oadd.inl.none.inl.some.zero
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
e' : PNat.natPred m = Nat.zero
this : 0 < ω ^ repr a'
i : ℕ
⊢ ω ^ repr a' * ↑i + ω ^ repr a' < ω ^ repr a' * ω
[PROOFSTEP]
rw [← mul_succ, ← nat_cast_succ, Ordinal.mul_lt_mul_iff_left this]
[GOAL]
case oadd.inl.none.inl.some.zero
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
e' : PNat.natPred m = Nat.zero
this : 0 < ω ^ repr a'
i : ℕ
⊢ ↑(Nat.succ i) < ω
[PROOFSTEP]
apply nat_lt_omega
[GOAL]
case oadd.inl.none.inl.some.succ
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ IsLimit (ω ^ repr a' * ω * ↑m' + ω ^ repr a' * ω + ω ^ repr a' * ω) ∧
    (∀ (i : ℕ),
        0 < ω ^ repr a' ∧
          ω ^ repr a' * ↑i + ω ^ repr a' < ω ^ repr a' * ω ∧
            (NF (oadd a (Nat.succPNat (Nat.succ m')) 0) → NF (oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) 0)))) ∧
      ∀ (a : Ordinal.{0}),
        a < ω ^ repr a' * ω * ↑m' + ω ^ repr a' * ω + ω ^ repr a' * ω →
          ∃ i, a < ω ^ repr a' * ω * ↑m' + ω ^ repr a' * ω + (ω ^ repr a' * ↑i + ω ^ repr a')
[PROOFSTEP]
have := opow_pos (repr a') omega_pos
[GOAL]
case oadd.inl.none.inl.some.succ
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
this : 0 < ω ^ repr a'
⊢ IsLimit (ω ^ repr a' * ω * ↑m' + ω ^ repr a' * ω + ω ^ repr a' * ω) ∧
    (∀ (i : ℕ),
        0 < ω ^ repr a' ∧
          ω ^ repr a' * ↑i + ω ^ repr a' < ω ^ repr a' * ω ∧
            (NF (oadd a (Nat.succPNat (Nat.succ m')) 0) → NF (oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) 0)))) ∧
      ∀ (a : Ordinal.{0}),
        a < ω ^ repr a' * ω * ↑m' + ω ^ repr a' * ω + ω ^ repr a' * ω →
          ∃ i, a < ω ^ repr a' * ω * ↑m' + ω ^ repr a' * ω + (ω ^ repr a' * ↑i + ω ^ repr a')
[PROOFSTEP]
refine' ⟨add_isLimit _ (mul_isLimit this omega_isLimit), fun i => ⟨this, _, _⟩, exists_lt_add exists_lt_mul_omega'⟩
[GOAL]
case oadd.inl.none.inl.some.succ.refine'_1
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
this : 0 < ω ^ repr a'
i : ℕ
⊢ ω ^ repr a' * ↑i + ω ^ repr a' < ω ^ repr a' * ω
[PROOFSTEP]
rw [← mul_succ, ← nat_cast_succ, Ordinal.mul_lt_mul_iff_left this]
[GOAL]
case oadd.inl.none.inl.some.succ.refine'_1
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
this : 0 < ω ^ repr a'
i : ℕ
⊢ ↑(Nat.succ i) < ω
[PROOFSTEP]
apply nat_lt_omega
[GOAL]
case oadd.inl.none.inl.some.succ.refine'_2
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
this : 0 < ω ^ repr a'
i : ℕ
⊢ NF (oadd a (Nat.succPNat (Nat.succ m')) 0) → NF (oadd a (Nat.succPNat m') (oadd a' (Nat.succPNat i) 0))
[PROOFSTEP]
refine' fun H => H.fst.oadd _ (NF.below_of_lt' _ (@NF.oadd_zero _ _ (iha.2 H.fst)))
[GOAL]
case oadd.inl.none.inl.some.succ.refine'_2
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
this : 0 < ω ^ repr a'
i : ℕ
H : NF (oadd a (Nat.succPNat (Nat.succ m')) 0)
⊢ repr (oadd a' (Nat.succPNat i) 0) < ω ^ repr a
[PROOFSTEP]
rw [repr, ← zero_def, repr, add_zero, iha.1, opow_succ, Ordinal.mul_lt_mul_iff_left this]
[GOAL]
case oadd.inl.none.inl.some.succ.refine'_2
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
a' : ONote
iha : repr a = succ (repr a') ∧ (NF a → NF a')
e : fundamentalSequence a = Sum.inl (some a')
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
this : 0 < ω ^ repr a'
i : ℕ
H : NF (oadd a (Nat.succPNat (Nat.succ m')) 0)
⊢ ↑↑(Nat.succPNat i) < ω
[PROOFSTEP]
apply nat_lt_omega
[GOAL]
case oadd.inl.none.inr.zero
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
iha :
  IsLimit (repr a) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
e : fundamentalSequence a = Sum.inr f
e' : PNat.natPred m = Nat.zero
⊢ IsLimit (ω ^ repr a) ∧
    (∀ (i : ℕ), repr (f i) < repr (f (i + 1)) ∧ repr (f i) < repr a ∧ (NF (oadd a 1 0) → NF (oadd (f i) 1 0))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < ω ^ repr a → ∃ i, a_1 < ω ^ repr (f i)
[PROOFSTEP]
rcases iha with ⟨h1, h2, h3⟩
[GOAL]
case oadd.inl.none.inr.zero.intro.intro
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
e : fundamentalSequence a = Sum.inr f
e' : PNat.natPred m = Nat.zero
h1 : IsLimit (repr a)
h2 : ∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))
h3 : ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
⊢ IsLimit (ω ^ repr a) ∧
    (∀ (i : ℕ), repr (f i) < repr (f (i + 1)) ∧ repr (f i) < repr a ∧ (NF (oadd a 1 0) → NF (oadd (f i) 1 0))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < ω ^ repr a → ∃ i, a_1 < ω ^ repr (f i)
[PROOFSTEP]
refine' ⟨opow_isLimit one_lt_omega h1, fun i => _, exists_lt_omega_opow' one_lt_omega h1 h3⟩
[GOAL]
case oadd.inl.none.inr.zero.intro.intro
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
e : fundamentalSequence a = Sum.inr f
e' : PNat.natPred m = Nat.zero
h1 : IsLimit (repr a)
h2 : ∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))
h3 : ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
i : ℕ
⊢ repr (f i) < repr (f (i + 1)) ∧ repr (f i) < repr a ∧ (NF (oadd a 1 0) → NF (oadd (f i) 1 0))
[PROOFSTEP]
obtain ⟨h4, h5, h6⟩ := h2 i
[GOAL]
case oadd.inl.none.inr.zero.intro.intro.intro.intro
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
e : fundamentalSequence a = Sum.inr f
e' : PNat.natPred m = Nat.zero
h1 : IsLimit (repr a)
h2 : ∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))
h3 : ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
i : ℕ
h4 : f i < f (i + 1)
h5 : f i < a
h6 : NF a → NF (f i)
⊢ repr (f i) < repr (f (i + 1)) ∧ repr (f i) < repr a ∧ (NF (oadd a 1 0) → NF (oadd (f i) 1 0))
[PROOFSTEP]
exact ⟨h4, h5, fun H => @NF.oadd_zero _ _ (h6 H.fst)⟩
[GOAL]
case oadd.inl.none.inr.succ
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
iha :
  IsLimit (repr a) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
e : fundamentalSequence a = Sum.inr f
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
⊢ IsLimit (ω ^ repr a * ↑m' + ω ^ repr a + ω ^ repr a) ∧
    (∀ (i : ℕ),
        repr (f i) < repr (f (i + 1)) ∧
          repr (f i) < repr a ∧
            (NF (oadd a (Nat.succPNat (Nat.succ m')) 0) → NF (oadd a (Nat.succPNat m') (oadd (f i) 1 0)))) ∧
      ∀ (a_1 : Ordinal.{0}),
        a_1 < ω ^ repr a * ↑m' + ω ^ repr a + ω ^ repr a → ∃ i, a_1 < ω ^ repr a * ↑m' + ω ^ repr a + ω ^ repr (f i)
[PROOFSTEP]
rcases iha with ⟨h1, h2, h3⟩
[GOAL]
case oadd.inl.none.inr.succ.intro.intro
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
e : fundamentalSequence a = Sum.inr f
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
h1 : IsLimit (repr a)
h2 : ∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))
h3 : ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
⊢ IsLimit (ω ^ repr a * ↑m' + ω ^ repr a + ω ^ repr a) ∧
    (∀ (i : ℕ),
        repr (f i) < repr (f (i + 1)) ∧
          repr (f i) < repr a ∧
            (NF (oadd a (Nat.succPNat (Nat.succ m')) 0) → NF (oadd a (Nat.succPNat m') (oadd (f i) 1 0)))) ∧
      ∀ (a_1 : Ordinal.{0}),
        a_1 < ω ^ repr a * ↑m' + ω ^ repr a + ω ^ repr a → ∃ i, a_1 < ω ^ repr a * ↑m' + ω ^ repr a + ω ^ repr (f i)
[PROOFSTEP]
refine'
  ⟨add_isLimit _ (opow_isLimit one_lt_omega h1), fun i => _, exists_lt_add (exists_lt_omega_opow' one_lt_omega h1 h3)⟩
[GOAL]
case oadd.inl.none.inr.succ.intro.intro
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
e : fundamentalSequence a = Sum.inr f
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
h1 : IsLimit (repr a)
h2 : ∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))
h3 : ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
i : ℕ
⊢ repr (f i) < repr (f (i + 1)) ∧
    repr (f i) < repr a ∧ (NF (oadd a (Nat.succPNat (Nat.succ m')) 0) → NF (oadd a (Nat.succPNat m') (oadd (f i) 1 0)))
[PROOFSTEP]
obtain ⟨h4, h5, h6⟩ := h2 i
[GOAL]
case oadd.inl.none.inr.succ.intro.intro.intro.intro
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
e : fundamentalSequence a = Sum.inr f
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
h1 : IsLimit (repr a)
h2 : ∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))
h3 : ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
i : ℕ
h4 : f i < f (i + 1)
h5 : f i < a
h6 : NF a → NF (f i)
⊢ repr (f i) < repr (f (i + 1)) ∧
    repr (f i) < repr a ∧ (NF (oadd a (Nat.succPNat (Nat.succ m')) 0) → NF (oadd a (Nat.succPNat m') (oadd (f i) 1 0)))
[PROOFSTEP]
refine' ⟨h4, h5, fun H => H.fst.oadd _ (NF.below_of_lt' _ (@NF.oadd_zero _ _ (h6 H.fst)))⟩
[GOAL]
case oadd.inl.none.inr.succ.intro.intro.intro.intro
a : ONote
m : ℕ+
b : ONote
ihb : b = 0
e✝ : fundamentalSequence b = Sum.inl none
f : ℕ → ONote
e : fundamentalSequence a = Sum.inr f
m' : ℕ
e' : PNat.natPred m = Nat.succ m'
h1 : IsLimit (repr a)
h2 : ∀ (i : ℕ), f i < f (i + 1) ∧ f i < a ∧ (NF a → NF (f i))
h3 : ∀ (a_1 : Ordinal.{0}), a_1 < repr a → ∃ i, a_1 < repr (f i)
i : ℕ
h4 : f i < f (i + 1)
h5 : f i < a
h6 : NF a → NF (f i)
H : NF (oadd a (Nat.succPNat (Nat.succ m')) 0)
⊢ repr (oadd (f i) 1 0) < ω ^ repr a
[PROOFSTEP]
rwa [repr, ← zero_def, repr, add_zero, PNat.one_coe, Nat.cast_one, mul_one, opow_lt_opow_iff_right one_lt_omega]
[GOAL]
case oadd.inl.some
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
b' : ONote
ihb : repr b = succ (repr b') ∧ (NF b → NF b')
e : fundamentalSequence b = Sum.inl (some b')
⊢ repr (oadd a m b) = succ (repr (oadd a m b')) ∧ (NF (oadd a m b) → NF (oadd a m b'))
[PROOFSTEP]
refine' ⟨by rw [repr, ihb.1, add_succ, repr], fun H => H.fst.oadd _ (NF.below_of_lt' _ (ihb.2 H.snd))⟩
[GOAL]
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
b' : ONote
ihb : repr b = succ (repr b') ∧ (NF b → NF b')
e : fundamentalSequence b = Sum.inl (some b')
⊢ repr (oadd a m b) = succ (repr (oadd a m b'))
[PROOFSTEP]
rw [repr, ihb.1, add_succ, repr]
[GOAL]
case oadd.inl.some
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
b' : ONote
ihb : repr b = succ (repr b') ∧ (NF b → NF b')
e : fundamentalSequence b = Sum.inl (some b')
H : NF (oadd a m b)
⊢ repr b' < ω ^ repr a
[PROOFSTEP]
have := H.snd'.repr_lt
[GOAL]
case oadd.inl.some
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
b' : ONote
ihb : repr b = succ (repr b') ∧ (NF b → NF b')
e : fundamentalSequence b = Sum.inl (some b')
H : NF (oadd a m b)
this : repr b < ω ^ repr a
⊢ repr b' < ω ^ repr a
[PROOFSTEP]
rw [ihb.1] at this
[GOAL]
case oadd.inl.some
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
b' : ONote
ihb : repr b = succ (repr b') ∧ (NF b → NF b')
e : fundamentalSequence b = Sum.inl (some b')
H : NF (oadd a m b)
this : succ (repr b') < ω ^ repr a
⊢ repr b' < ω ^ repr a
[PROOFSTEP]
exact (lt_succ _).trans this
[GOAL]
case oadd.inr
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
f : ℕ → ONote
ihb :
  IsLimit (repr b) ∧
    (∀ (i : ℕ), f i < f (i + 1) ∧ f i < b ∧ (NF b → NF (f i))) ∧ ∀ (a : Ordinal.{0}), a < repr b → ∃ i, a < repr (f i)
e : fundamentalSequence b = Sum.inr f
⊢ IsLimit (repr (oadd a m b)) ∧
    (∀ (i : ℕ),
        oadd a m (f i) < oadd a m (f (i + 1)) ∧ oadd a m (f i) < oadd a m b ∧ (NF (oadd a m b) → NF (oadd a m (f i)))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a m b) → ∃ i, a_1 < repr (oadd a m (f i))
[PROOFSTEP]
rcases ihb with ⟨h1, h2, h3⟩
[GOAL]
case oadd.inr.intro.intro
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
f : ℕ → ONote
e : fundamentalSequence b = Sum.inr f
h1 : IsLimit (repr b)
h2 : ∀ (i : ℕ), f i < f (i + 1) ∧ f i < b ∧ (NF b → NF (f i))
h3 : ∀ (a : Ordinal.{0}), a < repr b → ∃ i, a < repr (f i)
⊢ IsLimit (repr (oadd a m b)) ∧
    (∀ (i : ℕ),
        oadd a m (f i) < oadd a m (f (i + 1)) ∧ oadd a m (f i) < oadd a m b ∧ (NF (oadd a m b) → NF (oadd a m (f i)))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < repr (oadd a m b) → ∃ i, a_1 < repr (oadd a m (f i))
[PROOFSTEP]
simp only [repr]
[GOAL]
case oadd.inr.intro.intro
a : ONote
m : ℕ+
b : ONote
iha : FundamentalSequenceProp a (fundamentalSequence a)
f : ℕ → ONote
e : fundamentalSequence b = Sum.inr f
h1 : IsLimit (repr b)
h2 : ∀ (i : ℕ), f i < f (i + 1) ∧ f i < b ∧ (NF b → NF (f i))
h3 : ∀ (a : Ordinal.{0}), a < repr b → ∃ i, a < repr (f i)
⊢ IsLimit (ω ^ repr a * ↑↑m + repr b) ∧
    (∀ (i : ℕ),
        oadd a m (f i) < oadd a m (f (i + 1)) ∧ oadd a m (f i) < oadd a m b ∧ (NF (oadd a m b) → NF (oadd a m (f i)))) ∧
      ∀ (a_1 : Ordinal.{0}), a_1 < ω ^ repr a * ↑↑m + repr b → ∃ i, a_1 < ω ^ repr a * ↑↑m + repr (f i)
[PROOFSTEP]
exact
  ⟨Ordinal.add_isLimit _ h1, fun i =>
    ⟨oadd_lt_oadd_3 (h2 i).1, oadd_lt_oadd_3 (h2 i).2.1, fun H =>
      H.fst.oadd _ (NF.below_of_lt' (lt_trans (h2 i).2.1 H.snd'.repr_lt) ((h2 i).2.2 H.snd))⟩,
    exists_lt_add h3⟩
[GOAL]
x✝ : ONote
o : ONote := x✝
a : ONote
h : FundamentalSequenceProp o (Sum.inl (some a))
⊢ a < o
[PROOFSTEP]
rw [lt_def, h.1]
[GOAL]
x✝ : ONote
o : ONote := x✝
a : ONote
h : FundamentalSequenceProp o (Sum.inl (some a))
⊢ repr a < succ (repr a)
[PROOFSTEP]
apply lt_succ
[GOAL]
o : ONote
x : Option ONote ⊕ (ℕ → ONote)
e : fundamentalSequence o = x
⊢ fastGrowing o =
    match (motive := (x : Option ONote ⊕ (ℕ → ONote)) → FundamentalSequenceProp o x → ℕ → ℕ) x,
      (_ : FundamentalSequenceProp o x) with
    | Sum.inl none, x => Nat.succ
    | Sum.inl (some a), x => fun i => (fastGrowing a)^[i] i
    | Sum.inr f, x => fun i => fastGrowing (f i) i
[PROOFSTEP]
subst x
[GOAL]
o : ONote
⊢ fastGrowing o =
    match (motive := (x : Option ONote ⊕ (ℕ → ONote)) → FundamentalSequenceProp o x → ℕ → ℕ) fundamentalSequence o,
      (_ : FundamentalSequenceProp o (fundamentalSequence o)) with
    | Sum.inl none, x => Nat.succ
    | Sum.inl (some a), x => fun i => (fastGrowing a)^[i] i
    | Sum.inr f, x => fun i => fastGrowing (f i) i
[PROOFSTEP]
rw [fastGrowing]
[GOAL]
o : ONote
h : fundamentalSequence o = Sum.inl none
⊢ fastGrowing o = Nat.succ
[PROOFSTEP]
rw [fastGrowing_def h]
[GOAL]
o a : ONote
h : fundamentalSequence o = Sum.inl (some a)
⊢ fastGrowing o = fun i => (fastGrowing a)^[i] i
[PROOFSTEP]
rw [fastGrowing_def h]
[GOAL]
o : ONote
f : ℕ → ONote
h : fundamentalSequence o = Sum.inr f
⊢ fastGrowing o = fun i => fastGrowing (f i) i
[PROOFSTEP]
rw [fastGrowing_def h]
[GOAL]
⊢ fastGrowing 1 = fun n => 2 * n
[PROOFSTEP]
rw [@fastGrowing_succ 1 0 rfl]
[GOAL]
⊢ (fun i => (fastGrowing 0)^[i] i) = fun n => 2 * n
[PROOFSTEP]
funext i
[GOAL]
case h
i : ℕ
⊢ (fastGrowing 0)^[i] i = 2 * i
[PROOFSTEP]
rw [two_mul, fastGrowing_zero]
[GOAL]
case h
i : ℕ
⊢ Nat.succ^[i] i = i + i
[PROOFSTEP]
suffices : ∀ a b, Nat.succ^[a] b = b + a
[GOAL]
case h
i : ℕ
this : ∀ (a b : ℕ), Nat.succ^[a] b = b + a
⊢ Nat.succ^[i] i = i + i
case this i : ℕ ⊢ ∀ (a b : ℕ), Nat.succ^[a] b = b + a
[PROOFSTEP]
exact this _ _
[GOAL]
case this
i : ℕ
⊢ ∀ (a b : ℕ), Nat.succ^[a] b = b + a
[PROOFSTEP]
intro a b
[GOAL]
case this
i a b : ℕ
⊢ Nat.succ^[a] b = b + a
[PROOFSTEP]
induction a
[GOAL]
case this.zero
i b : ℕ
⊢ Nat.succ^[Nat.zero] b = b + Nat.zero
[PROOFSTEP]
simp [*, Function.iterate_succ', Nat.add_succ, -Function.iterate_succ]
[GOAL]
case this.succ
i b n✝ : ℕ
n_ih✝ : Nat.succ^[n✝] b = b + n✝
⊢ Nat.succ^[Nat.succ n✝] b = b + Nat.succ n✝
[PROOFSTEP]
simp [*, Function.iterate_succ', Nat.add_succ, -Function.iterate_succ]
[GOAL]
⊢ fastGrowing 2 = fun n => 2 ^ n * n
[PROOFSTEP]
rw [@fastGrowing_succ 2 1 rfl]
[GOAL]
⊢ (fun i => (fastGrowing 1)^[i] i) = fun n => 2 ^ n * n
[PROOFSTEP]
funext i
[GOAL]
case h
i : ℕ
⊢ (fastGrowing 1)^[i] i = 2 ^ i * i
[PROOFSTEP]
rw [fastGrowing_one]
[GOAL]
case h
i : ℕ
⊢ (fun n => 2 * n)^[i] i = 2 ^ i * i
[PROOFSTEP]
suffices : ∀ a b, (fun n : ℕ => 2 * n)^[a] b = (2 ^ a) * b
[GOAL]
case h
i : ℕ
this : ∀ (a b : ℕ), (fun n => 2 * n)^[a] b = 2 ^ a * b
⊢ (fun n => 2 * n)^[i] i = 2 ^ i * i
case this i : ℕ ⊢ ∀ (a b : ℕ), (fun n => 2 * n)^[a] b = 2 ^ a * b
[PROOFSTEP]
exact this _ _
[GOAL]
case this
i : ℕ
⊢ ∀ (a b : ℕ), (fun n => 2 * n)^[a] b = 2 ^ a * b
[PROOFSTEP]
intro a b
[GOAL]
case this
i a b : ℕ
⊢ (fun n => 2 * n)^[a] b = 2 ^ a * b
[PROOFSTEP]
induction a
[GOAL]
case this.zero
i b : ℕ
⊢ (fun n => 2 * n)^[Nat.zero] b = 2 ^ Nat.zero * b
[PROOFSTEP]
simp [*, Function.iterate_succ', pow_succ, mul_assoc, -Function.iterate_succ]
[GOAL]
case this.succ
i b n✝ : ℕ
n_ih✝ : (fun n => 2 * n)^[n✝] b = 2 ^ n✝ * b
⊢ (fun n => 2 * n)^[Nat.succ n✝] b = 2 ^ Nat.succ n✝ * b
[PROOFSTEP]
simp [*, Function.iterate_succ', pow_succ, mul_assoc, -Function.iterate_succ]
[GOAL]
⊢ fastGrowingε₀ 0 = 1
[PROOFSTEP]
simp [fastGrowingε₀]
[GOAL]
⊢ fastGrowingε₀ 1 = 2
[PROOFSTEP]
simp [fastGrowingε₀, show oadd 0 1 0 = 1 from rfl]
[GOAL]
⊢ fastGrowingε₀ 2 = 2048
[PROOFSTEP]
simp [fastGrowingε₀, show oadd 0 1 0 = 1 from rfl, @fastGrowing_limit (oadd 1 1 0) _ rfl,
  show oadd 0 (2 : Nat).succPNat 0 = 3 from rfl, @fastGrowing_succ 3 2 rfl]
[GOAL]
⊢ DecidableEq NONote
[PROOFSTEP]
unfold NONote
[GOAL]
⊢ DecidableEq { o // ONote.NF o }
[PROOFSTEP]
infer_instance
[GOAL]
a : ONote
ha : ONote.NF a
b : ONote
hb : ONote.NF b
⊢ Ordering.Compares (cmp { val := a, property := ha } { val := b, property := hb }) { val := a, property := ha }
    { val := b, property := hb }
[PROOFSTEP]
dsimp [cmp]
[GOAL]
a : ONote
ha : ONote.NF a
b : ONote
hb : ONote.NF b
⊢ Ordering.Compares (ONote.cmp a b) { val := a, property := ha } { val := b, property := hb }
[PROOFSTEP]
have := ONote.cmp_compares a b
[GOAL]
a : ONote
ha : ONote.NF a
b : ONote
hb : ONote.NF b
this : Ordering.Compares (ONote.cmp a b) a b
⊢ Ordering.Compares (ONote.cmp a b) { val := a, property := ha } { val := b, property := hb }
[PROOFSTEP]
cases h : ONote.cmp a b
[GOAL]
case lt
a : ONote
ha : ONote.NF a
b : ONote
hb : ONote.NF b
this : Ordering.Compares (ONote.cmp a b) a b
h : ONote.cmp a b = Ordering.lt
⊢ Ordering.Compares Ordering.lt { val := a, property := ha } { val := b, property := hb }
[PROOFSTEP]
simp only [h] at this
[GOAL]
case eq
a : ONote
ha : ONote.NF a
b : ONote
hb : ONote.NF b
this : Ordering.Compares (ONote.cmp a b) a b
h : ONote.cmp a b = Ordering.eq
⊢ Ordering.Compares Ordering.eq { val := a, property := ha } { val := b, property := hb }
[PROOFSTEP]
simp only [h] at this
[GOAL]
case gt
a : ONote
ha : ONote.NF a
b : ONote
hb : ONote.NF b
this : Ordering.Compares (ONote.cmp a b) a b
h : ONote.cmp a b = Ordering.gt
⊢ Ordering.Compares Ordering.gt { val := a, property := ha } { val := b, property := hb }
[PROOFSTEP]
simp only [h] at this
[GOAL]
case lt
a : ONote
ha : ONote.NF a
b : ONote
hb : ONote.NF b
h : ONote.cmp a b = Ordering.lt
this : Ordering.Compares Ordering.lt a b
⊢ Ordering.Compares Ordering.lt { val := a, property := ha } { val := b, property := hb }
[PROOFSTEP]
try exact this
[GOAL]
case lt
a : ONote
ha : ONote.NF a
b : ONote
hb : ONote.NF b
h : ONote.cmp a b = Ordering.lt
this : Ordering.Compares Ordering.lt a b
⊢ Ordering.Compares Ordering.lt { val := a, property := ha } { val := b, property := hb }
[PROOFSTEP]
exact this
[GOAL]
case eq
a : ONote
ha : ONote.NF a
b : ONote
hb : ONote.NF b
h : ONote.cmp a b = Ordering.eq
this : Ordering.Compares Ordering.eq a b
⊢ Ordering.Compares Ordering.eq { val := a, property := ha } { val := b, property := hb }
[PROOFSTEP]
try exact this
[GOAL]
case eq
a : ONote
ha : ONote.NF a
b : ONote
hb : ONote.NF b
h : ONote.cmp a b = Ordering.eq
this : Ordering.Compares Ordering.eq a b
⊢ Ordering.Compares Ordering.eq { val := a, property := ha } { val := b, property := hb }
[PROOFSTEP]
exact this
[GOAL]
case gt
a : ONote
ha : ONote.NF a
b : ONote
hb : ONote.NF b
h : ONote.cmp a b = Ordering.gt
this : Ordering.Compares Ordering.gt a b
⊢ Ordering.Compares Ordering.gt { val := a, property := ha } { val := b, property := hb }
[PROOFSTEP]
try exact this
[GOAL]
case gt
a : ONote
ha : ONote.NF a
b : ONote
hb : ONote.NF b
h : ONote.cmp a b = Ordering.gt
this : Ordering.Compares Ordering.gt a b
⊢ Ordering.Compares Ordering.gt { val := a, property := ha } { val := b, property := hb }
[PROOFSTEP]
exact this
[GOAL]
case eq
a : ONote
ha : ONote.NF a
b : ONote
hb : ONote.NF b
h : ONote.cmp a b = Ordering.eq
this : Ordering.Compares Ordering.eq a b
⊢ Ordering.Compares Ordering.eq { val := a, property := ha } { val := b, property := hb }
[PROOFSTEP]
exact Subtype.mk_eq_mk.2 this
[GOAL]
C : NONote → Sort u_1
o : NONote
H0 : C 0
H1 : (e : NONote) → (n : ℕ+) → (a : NONote) → (h : below a e) → C e → C a → C (oadd e n a h)
⊢ C o
[PROOFSTEP]
cases' o with o h
[GOAL]
case mk
C : NONote → Sort u_1
H0 : C 0
H1 : (e : NONote) → (n : ℕ+) → (a : NONote) → (h : below a e) → C e → C a → C (oadd e n a h)
o : ONote
h : ONote.NF o
⊢ C { val := o, property := h }
[PROOFSTEP]
induction' o with e n a IHe IHa
[GOAL]
case mk.zero
C : NONote → Sort u_1
H0 : C 0
H1 : (e : NONote) → (n : ℕ+) → (a : NONote) → (h : below a e) → C e → C a → C (oadd e n a h)
o : ONote
h✝ : ONote.NF o
h : ONote.NF ONote.zero
⊢ C { val := ONote.zero, property := h }
[PROOFSTEP]
exact H0
[GOAL]
case mk.oadd
C : NONote → Sort u_1
H0 : C 0
H1 : (e : NONote) → (n : ℕ+) → (a : NONote) → (h : below a e) → C e → C a → C (oadd e n a h)
o : ONote
h✝ : ONote.NF o
e : ONote
n : ℕ+
a : ONote
IHe : (h : ONote.NF e) → C { val := e, property := h }
IHa : (h : ONote.NF a) → C { val := a, property := h }
h : ONote.NF (ONote.oadd e n a)
⊢ C { val := ONote.oadd e n a, property := h }
[PROOFSTEP]
exact H1 ⟨e, h.fst⟩ n ⟨a, h.snd⟩ h.snd' (IHe _) (IHa _)