l3lab/ntp-mathlib huggingface dataset:
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; exact oadd_lt_oadd_1 h₂ IHe
    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 <;> 

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

Next tactic:
cases nh
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; exact oadd_lt_oadd_1 h₂ IHe
    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 <;> 

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

Next tactic:
contradiction
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; exact oadd_lt_oadd_1 h₂ IHe
    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 <;> 

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

Next tactic:
contradiction
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; exact oadd_lt_oadd_1 h₂ IHe
    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
      

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

Next tactic:
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
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; exact oadd_lt_oadd_1 h₂ IHe
    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
      

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

Next tactic:
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
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; exact oadd_lt_oadd_1 h₂ IHe
    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 =>
        

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

Next tactic:
cases' nh with nh nh
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; exact oadd_lt_oadd_1 h₂ IHe
    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
        · 

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

Next tactic:
cases nh
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; exact oadd_lt_oadd_1 h₂ IHe
    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; 

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

Next tactic:
contradiction
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; exact oadd_lt_oadd_1 h₂ IHe
    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
        · 

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

Next tactic:
cases' nh with _ nh
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; exact oadd_lt_oadd_1 h₂ IHe
    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
          

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

Next tactic:
rw [ite_eq_iff] at nh
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; exact oadd_lt_oadd_1 h₂ IHe
    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; 

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

Next tactic:
cases' nh with nh nh
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; exact oadd_lt_oadd_1 h₂ IHe
    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
          · 

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

Next tactic:
exact oadd_lt_oadd_2 h₂ nh.left
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; exact oadd_lt_oadd_1 h₂ IHe
    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
          · 

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

Next tactic:
cases nh
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; exact oadd_lt_oadd_1 h₂ IHe
    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; 

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

Next tactic:
contradiction
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; exact oadd_lt_oadd_1 h₂ IHe
    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
      

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

Next tactic:
cases' nh with nh nh