l3lab/ntp-mathlib huggingface dataset:
theorem NFBelow.fst {e n a b} (h : NFBelow (ONote.oadd e n a) b) : NF e := by
  (cases' h with _ _ _ _ eb _ h₁ h₂ h₃; 

Proof state:
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

Next tactic:
exact ⟨⟨_, h₁⟩⟩
theorem NFBelow.snd {e n a b} (h : NFBelow (ONote.oadd e n a) b) : NFBelow a (repr e) := by
  (

Proof state:
e : ONote
n : ℕ+
a : ONote
b : Ordinal.{0}
h : NFBelow (ONote.oadd e n a) b
⊢ NFBelow a (repr e)

Next tactic:
cases' h with _ _ _ _ eb _ h₁ h₂ h₃
theorem NFBelow.snd {e n a b} (h : NFBelow (ONote.oadd e n a) b) : NFBelow a (repr e) := by
  (cases' h with _ _ _ _ eb _ h₁ h₂ h₃; 

Proof state:
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)

Next tactic:
exact h₂
theorem NFBelow.lt {e n a b} (h : NFBelow (ONote.oadd e n a) b) : repr e < b := by
  (

Proof state:
e : ONote
n : ℕ+
a : ONote
b : Ordinal.{0}
h : NFBelow (ONote.oadd e n a) b
⊢ repr e < b

Next tactic:
cases' h with _ _ _ _ eb _ h₁ h₂ h₃
theorem NFBelow.lt {e n a b} (h : NFBelow (ONote.oadd e n a) b) : repr e < b := by
  (cases' h with _ _ _ _ eb _ h₁ h₂ h₃; 

Proof state:
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

Next tactic:
exact h₃
theorem NF.zero_of_zero {e n a} (h : NF (ONote.oadd e n a)) (e0 : e = 0) : a = 0 := by
  

Proof state:
e : ONote
n : ℕ+
a : ONote
h : NF (ONote.oadd e n a)
e0 : e = 0
⊢ a = 0

Next tactic:
simpa [e0, NFBelow_zero] using h.snd'
theorem NFBelow.repr_lt {o b} (h : NFBelow o b) : repr o < ω ^ b := by
  

Proof state:
o : ONote
b : Ordinal.{0}
h : NFBelow o b
⊢ repr o < ω ^ b

Next tactic:
induction' h with _ e n a eb b h₁ h₂ h₃ _ IH
theorem NFBelow.repr_lt {o b} (h : NFBelow o b) : repr o < ω ^ b := by
  induction' h with _ e n a eb b h₁ h₂ h₃ _ IH
  · 

Proof state:
case zero
o : ONote
b b✝ : Ordinal.{0}
⊢ repr 0 < ω ^ b✝

Next tactic:
exact opow_pos _ omega_pos
theorem NFBelow.repr_lt {o b} (h : NFBelow o b) : repr o < ω ^ b := by
  induction' h with _ e n a eb b h₁ h₂ h₃ _ IH
  · exact opow_pos _ omega_pos
  · 

Proof state:
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

Next tactic:
rw [repr]
theorem NFBelow.repr_lt {o b} (h : NFBelow o b) : repr o < ω ^ b := by
  induction' h with _ e n a eb b h₁ h₂ h₃ _ IH
  · exact opow_pos _ omega_pos
  · rw [repr]
    

Proof state:
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

Next tactic:
apply ((add_lt_add_iff_left _).2 IH).trans_le
theorem NFBelow.repr_lt {o b} (h : NFBelow o b) : repr o < ω ^ b := by
  induction' h with _ e n a eb b h₁ h₂ h₃ _ IH
  · exact opow_pos _ omega_pos
  · rw [repr]
    apply ((add_lt_add_iff_left _).2 IH).trans_le
    

Proof state:
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

Next tactic:
rw [← mul_succ]
theorem NFBelow.repr_lt {o b} (h : NFBelow o b) : repr o < ω ^ b := by
  induction' h with _ e n a eb b h₁ h₂ h₃ _ IH
  · exact opow_pos _ omega_pos
  · rw [repr]
    apply ((add_lt_add_iff_left _).2 IH).trans_le
    rw [← mul_succ]
    

Proof state:
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

Next tactic:
apply (mul_le_mul_left' (succ_le_of_lt (nat_lt_omega _)) _).trans
theorem NFBelow.repr_lt {o b} (h : NFBelow o b) : repr o < ω ^ b := by
  induction' h with _ e n a eb b h₁ h₂ h₃ _ IH
  · exact opow_pos _ omega_pos
  · rw [repr]
    apply ((add_lt_add_iff_left _).2 IH).trans_le
    rw [← mul_succ]
    apply (mul_le_mul_left' (succ_le_of_lt (nat_lt_omega _)) _).trans
    

Proof state:
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

Next tactic:
rw [← opow_succ]
theorem NFBelow.repr_lt {o b} (h : NFBelow o b) : repr o < ω ^ b := by
  induction' h with _ e n a eb b h₁ h₂ h₃ _ IH
  · exact opow_pos _ omega_pos
  · rw [repr]
    apply ((add_lt_add_iff_left _).2 IH).trans_le
    rw [← mul_succ]
    apply (mul_le_mul_left' (succ_le_of_lt (nat_lt_omega _)) _).trans
    rw [← opow_succ]
    

Proof state:
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

Next tactic:
exact opow_le_opow_right omega_pos (succ_le_of_lt h₃)
theorem NFBelow.mono {o b₁ b₂} (bb : b₁ ≤ b₂) (h : NFBelow o b₁) : NFBelow o b₂ := by
  

Proof state:
o : ONote
b₁ b₂ : Ordinal.{0}
bb : b₁ ≤ b₂
h : NFBelow o b₁
⊢ NFBelow o b₂

Next tactic:
induction' h with _ e n a eb b h₁ h₂ h₃ _ _
theorem NFBelow.mono {o b₁ b₂} (bb : b₁ ≤ b₂) (h : NFBelow o b₁) : NFBelow o b₂ := by
  induction' h with _ e n a eb b h₁ h₂ h₃ _ _ <;> 

Proof state:
case zero
o : ONote
b₁ b₂ b✝ : Ordinal.{0}
bb : b✝ ≤ b₂
⊢ NFBelow 0 b₂

Next tactic:
constructor
theorem NFBelow.mono {o b₁ b₂} (bb : b₁ ≤ b₂) (h : NFBelow o b₁) : NFBelow o b₂ := by
  induction' h with _ e n a eb b h₁ h₂ h₃ _ _ <;> 

Proof state:
case oadd'
o : ONote
b₁ 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✝¹ : eb ≤ b₂ → NFBelow e b₂
a_ih✝ : repr e ≤ b₂ → NFBelow a b₂
bb : b ≤ b₂
⊢ NFBelow (ONote.oadd e n a) b₂

Next tactic:
constructor
theorem NFBelow.mono {o b₁ b₂} (bb : b₁ ≤ b₂) (h : NFBelow o b₁) : NFBelow o b₂ := by
  induction' h with _ e n a eb b h₁ h₂ h₃ _ _ <;> constructor
  

Proof state:
case oadd'.a
o : ONote
b₁ 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✝¹ : 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}
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}
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}
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}

Next tactic:
exacts[h₁, h₂, lt_of_lt_of_le h₃ bb]
theorem NF.below_of_lt {e n a b} (H : repr e < b) :
    NF (ONote.oadd e n a) → NFBelow (ONote.oadd e n a) b
  | ⟨⟨b', h⟩⟩ => by (

Proof state:
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

Next tactic:
cases' h with _ _ _ _ eb _ h₁ h₂ h₃
theorem NF.below_of_lt {e n a b} (H : repr e < b) :
    NF (ONote.oadd e n a) → NFBelow (ONote.oadd e n a) b
  | ⟨⟨b', h⟩⟩ => by (cases' h with _ _ _ _ eb _ h₁ h₂ h₃; 

Proof state:
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

Next tactic:
exact NFBelow.oadd' h₁ h₂ H
instance nf_one : NF 1 := by (

Proof state:
⊢ NF 1

Next tactic:
rw [← ofNat_one]
instance nf_one : NF 1 := by (rw [← ofNat_one]; 

Proof state:
⊢ NF ↑1

Next tactic:
infer_instance
theorem oadd_lt_oadd_2 {e o₁ o₂ : ONote} {n₁ n₂ : ℕ+} (h₁ : NF (oadd e n₁ o₁)) (h : (n₁ : ℕ) < n₂) :
    oadd e n₁ o₁ < oadd e n₂ o₂ := by
  

Proof state:
e o₁ o₂ : ONote
n₁ n₂ : ℕ+
h₁ : NF (oadd e n₁ o₁)
h : ↑n₁ < ↑n₂
⊢ oadd e n₁ o₁ < oadd e n₂ o₂

Next tactic:
simp only [lt_def, repr]
theorem oadd_lt_oadd_2 {e o₁ o₂ : ONote} {n₁ n₂ : ℕ+} (h₁ : NF (oadd e n₁ o₁)) (h : (n₁ : ℕ) < n₂) :
    oadd e n₁ o₁ < oadd e n₂ o₂ := by
  simp only [lt_def, repr]
  

Proof state:
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₂

Next tactic:
refine' lt_of_lt_of_le ((add_lt_add_iff_left _).2 h₁.snd'.repr_lt) (le_trans _ (le_add_right _ _))
theorem oadd_lt_oadd_2 {e o₁ o₂ : ONote} {n₁ n₂ : ℕ+} (h₁ : NF (oadd e n₁ o₁)) (h : (n₁ : ℕ) < n₂) :
    oadd e n₁ o₁ < oadd e n₂ o₂ := by
  simp only [lt_def, repr]
  refine' lt_of_lt_of_le ((add_lt_add_iff_left _).2 h₁.snd'.repr_lt) (le_trans _ (le_add_right _ _))
  

Proof state:
e o₁ o₂ : ONote
n₁ n₂ : ℕ+
h₁ : NF (oadd e n₁ o₁)
h : ↑n₁ < ↑n₂
⊢ ω ^ repr e * ↑↑n₁ + ω ^ repr e ≤ ω ^ repr e * ↑↑n₂

Next tactic:
rwa [← mul_succ,Ordinal.mul_le_mul_iff_left (opow_pos _ omega_pos), succ_le_iff, nat_cast_lt]
theorem oadd_lt_oadd_3 {e n a₁ a₂} (h : a₁ < a₂) : oadd e n a₁ < oadd e n a₂ := by
  

Proof state:
e : ONote
n : ℕ+
a₁ a₂ : ONote
h : a₁ < a₂
⊢ oadd e n a₁ < oadd e n a₂

Next tactic:
rw [lt_def]
theorem oadd_lt_oadd_3 {e n a₁ a₂} (h : a₁ < a₂) : oadd e n a₁ < oadd e n a₂ := by
  rw [lt_def]; 

Proof state:
e : ONote
n : ℕ+
a₁ a₂ : ONote
h : a₁ < a₂
⊢ repr (oadd e n a₁) < repr (oadd e n a₂)

Next tactic:
unfold repr
theorem oadd_lt_oadd_3 {e n a₁ a₂} (h : a₁ < a₂) : oadd e n a₁ < oadd e n a₂ := by
  rw [lt_def]; unfold repr
  

Proof state:
e : ONote
n : ℕ+
a₁ a₂ : ONote
h : a₁ < a₂
⊢ ω ^ repr e * ↑↑n + repr a₁ < ω ^ repr e * ↑↑n + repr a₂

Next tactic:
exact @add_lt_add_left _ _ _ _ (repr a₁) _ h _
theorem cmp_compares : ∀ (a b : ONote) [NF a] [NF b], (cmp a b).Compares a b
  | 0, 0, _, _ => rfl
  | oadd e n a, 0, _, _ => oadd_pos _ _ _
  | 0, oadd e n a, _, _ => oadd_pos _ _ _
  | o₁@(oadd e₁ n₁ a₁), o₂@(oadd e₂ n₂ a₂), h₁, h₂ => by -- TODO: golf
    

Proof state:
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✝)

Next tactic:
rw [cmp]
theorem cmp_compares : ∀ (a b : ONote) [NF a] [NF b], (cmp a b).Compares a b
  | 0, 0, _, _ => rfl
  | oadd e n a, 0, _, _ => oadd_pos _ _ _
  | 0, oadd e n a, _, _ => oadd_pos _ _ _
  | o₁@(oadd e₁ n₁ a₁), o₂@(oadd e₂ n₂ a₂), h₁, h₂ => by -- TODO: golf
    rw [cmp]
    

Proof state:
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✝)

Next tactic:
have IHe := @cmp_compares _ _ h₁.fst h₂.fst
theorem cmp_compares : ∀ (a b : ONote) [NF a] [NF b], (cmp a b).Compares a b
  | 0, 0, _, _ => rfl
  | oadd e n a, 0, _, _ => oadd_pos _ _ _
  | 0, oadd e n a, _, _ => oadd_pos _ _ _
  | o₁@(oadd e₁ n₁ a₁), o₂@(oadd e₂ n₂ a₂), h₁, h₂ => by -- TODO: golf
    rw [cmp]
    have IHe := @cmp_compares _ _ h₁.fst h₂.fst
    

Proof state:
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✝)

Next tactic:
simp only [Ordering.Compares, gt_iff_lt] at IHe
theorem cmp_compares : ∀ (a b : ONote) [NF a] [NF b], (cmp a b).Compares a b
  | 0, 0, _, _ => rfl
  | oadd e n a, 0, _, _ => oadd_pos _ _ _
  | 0, oadd e n a, _, _ => oadd_pos _ _ _
  | o₁@(oadd e₁ n₁ a₁), o₂@(oadd e₂ n₂ a₂), h₁, h₂ => by -- TODO: golf
    rw [cmp]
    have IHe := @cmp_compares _ _ h₁.fst h₂.fst
    simp only [Ordering.Compares, gt_iff_lt] at IHe; 

Proof state:
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✝)

Next tactic:
revert IHe
theorem cmp_compares : ∀ (a b : ONote) [NF a] [NF b], (cmp a b).Compares a b
  | 0, 0, _, _ => rfl
  | oadd e n a, 0, _, _ => oadd_pos _ _ _
  | 0, oadd e n a, _, _ => oadd_pos _ _ _
  | o₁@(oadd e₁ n₁ a₁), o₂@(oadd e₂ n₂ a₂), h₁, h₂ => by -- TODO: golf
    rw [cmp]
    have IHe := @cmp_compares _ _ h₁.fst h₂.fst
    simp only [Ordering.Compares, gt_iff_lt] at IHe; revert IHe
    

Proof state:
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✝)

Next tactic:
cases cmp e₁ e₂
theorem cmp_compares : ∀ (a b : ONote) [NF a] [NF b], (cmp a b).Compares a b
  | 0, 0, _, _ => rfl
  | oadd e n a, 0, _, _ => oadd_pos _ _ _
  | 0, oadd e n a, _, _ => oadd_pos _ _ _
  | o₁@(oadd e₁ n₁ a₁), o₂@(oadd e₂ n₂ a₂), h₁, h₂ => by -- TODO: golf
    rw [cmp]
    have IHe := @cmp_compares _ _ h₁.fst h₂.fst
    simp only [Ordering.Compares, gt_iff_lt] at IHe; revert IHe
    cases cmp e₁ e₂
    

Proof state:
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✝)

Next tactic:
case lt => intro IHe; exact oadd_lt_oadd_1 h₁ IHe
theorem cmp_compares : ∀ (a b : ONote) [NF a] [NF b], (cmp a b).Compares a b
  | 0, 0, _, _ => rfl
  | oadd e n a, 0, _, _ => oadd_pos _ _ _
  | 0, oadd e n a, _, _ => oadd_pos _ _ _
  | o₁@(oadd e₁ n₁ a₁), o₂@(oadd e₂ n₂ a₂), h₁, h₂ => by -- TODO: golf
    rw [cmp]
    have IHe := @cmp_compares _ _ h₁.fst h₂.fst
    simp only [Ordering.Compares, gt_iff_lt] at IHe; revert IHe
    cases cmp e₁ e₂
    

Proof state:
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✝)

Next tactic:
case lt => intro IHe; exact oadd_lt_oadd_1 h₁ IHe
theorem cmp_compares : ∀ (a b : ONote) [NF a] [NF b], (cmp a b).Compares a b
  | 0, 0, _, _ => rfl
  | oadd e n a, 0, _, _ => oadd_pos _ _ _
  | 0, oadd e n a, _, _ => oadd_pos _ _ _
  | o₁@(oadd e₁ n₁ a₁), o₂@(oadd e₂ n₂ a₂), h₁, h₂ => by -- TODO: golf
    rw [cmp]
    have IHe := @cmp_compares _ _ h₁.fst h₂.fst
    simp only [Ordering.Compares, gt_iff_lt] at IHe; revert IHe
    cases cmp e₁ e₂
    case lt => 

Proof state:
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✝)

Next tactic:
intro IHe
theorem cmp_compares : ∀ (a b : ONote) [NF a] [NF b], (cmp a b).Compares a b
  | 0, 0, _, _ => rfl
  | oadd e n a, 0, _, _ => oadd_pos _ _ _
  | 0, oadd e n a, _, _ => oadd_pos _ _ _
  | o₁@(oadd e₁ n₁ a₁), o₂@(oadd e₂ n₂ a₂), h₁, h₂ => by -- TODO: golf
    rw [cmp]
    have IHe := @cmp_compares _ _ h₁.fst h₂.fst
    simp only [Ordering.Compares, gt_iff_lt] at IHe; revert IHe
    cases cmp e₁ e₂
    case lt => intro IHe; 

Proof state:
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✝)

Next tactic:
exact oadd_lt_oadd_1 h₁ IHe
theorem cmp_compares : ∀ (a b : ONote) [NF a] [NF b], (cmp a b).Compares a b
  | 0, 0, _, _ => rfl
  | oadd e n a, 0, _, _ => oadd_pos _ _ _
  | 0, oadd e n a, _, _ => oadd_pos _ _ _
  | o₁@(oadd e₁ n₁ a₁), o₂@(oadd e₂ n₂ a₂), h₁, h₂ => by -- TODO: golf
    rw [cmp]
    have IHe := @cmp_compares _ _ h₁.fst h₂.fst
    simp only [Ordering.Compares, gt_iff_lt] at IHe; revert IHe
    cases cmp e₁ e₂
    case lt => intro IHe; exact oadd_lt_oadd_1 h₁ IHe
    

Proof state:
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✝)

Next tactic:
case gt => intro IHe; exact oadd_lt_oadd_1 h₂ IHe
theorem cmp_compares : ∀ (a b : ONote) [NF a] [NF b], (cmp a b).Compares a b
  | 0, 0, _, _ => rfl
  | oadd e n a, 0, _, _ => oadd_pos _ _ _
  | 0, oadd e n a, _, _ => oadd_pos _ _ _
  | o₁@(oadd e₁ n₁ a₁), o₂@(oadd e₂ n₂ a₂), h₁, h₂ => by -- TODO: golf
    rw [cmp]
    have IHe := @cmp_compares _ _ h₁.fst h₂.fst
    simp only [Ordering.Compares, gt_iff_lt] at IHe; revert IHe
    cases cmp e₁ e₂
    case lt => intro IHe; exact oadd_lt_oadd_1 h₁ IHe
    

Proof state:
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✝)

Next tactic:
case gt => intro IHe; exact oadd_lt_oadd_1 h₂ IHe
theorem cmp_compares : ∀ (a b : ONote) [NF a] [NF b], (cmp a b).Compares a b
  | 0, 0, _, _ => rfl
  | oadd e n a, 0, _, _ => oadd_pos _ _ _
  | 0, oadd e n a, _, _ => oadd_pos _ _ _
  | o₁@(oadd e₁ n₁ a₁), o₂@(oadd e₂ n₂ a₂), h₁, h₂ => by -- TODO: golf
    rw [cmp]
    have IHe := @cmp_compares _ _ h₁.fst h₂.fst
    simp only [Ordering.Compares, gt_iff_lt] at IHe; revert IHe
    cases cmp e₁ e₂
    case lt => intro IHe; exact oadd_lt_oadd_1 h₁ IHe
    case gt => 

Proof state:
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✝)

Next tactic:
intro IHe
theorem cmp_compares : ∀ (a b : ONote) [NF a] [NF b], (cmp a b).Compares a b
  | 0, 0, _, _ => rfl
  | oadd e n a, 0, _, _ => oadd_pos _ _ _
  | 0, oadd e n a, _, _ => oadd_pos _ _ _
  | o₁@(oadd e₁ n₁ a₁), o₂@(oadd e₂ n₂ a₂), h₁, h₂ => by -- TODO: golf
    rw [cmp]
    have IHe := @cmp_compares _ _ h₁.fst h₂.fst
    simp only [Ordering.Compares, gt_iff_lt] at IHe; revert IHe
    cases cmp e₁ e₂
    case lt => intro IHe; exact oadd_lt_oadd_1 h₁ IHe
    case gt => intro IHe; 

Proof state:
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✝)

Next tactic:
exact oadd_lt_oadd_1 h₂ IHe