Theorem: ONote.eq_of_cmp_eq
File: Mathlib/SetTheory/Ordinal/Notation.lean

tactic: injection h
state_before: e : ONote
n : ℕ+
a : ONote
h : (e.oadd n a).cmp 0 = Ordering.eq
⊢ e.oadd n a = 0
state_after: no goals

tactic: injection h
state_before: e : ONote
n : ℕ+
a : ONote
h : cmp 0 (e.oadd n a) = Ordering.eq
⊢ 0 = e.oadd n a
state_after: no goals

tactic: revert h
state_before: e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h : (e₁.oadd n₁ a₁).cmp (e₂.oadd n₂ a₂) = Ordering.eq
⊢ e₁.oadd n₁ a₁ = e₂.oadd n₂ a₂
state_after: e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
⊢ (e₁.oadd n₁ a₁).cmp (e₂.oadd n₂ a₂) = Ordering.eq → e₁.oadd n₁ a₁ = e₂.oadd n₂ a₂

tactic: simp only [cmp]
state_before: e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
⊢ (e₁.oadd n₁ a₁).cmp (e₂.oadd n₂ a₂) = Ordering.eq → e₁.oadd n₁ a₁ = e₂.oadd n₂ a₂
state_after: e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
⊢ (e₁.cmp e₂).orElse ((_root_.cmp ↑n₁ ↑n₂).orElse (a₁.cmp a₂)) = Ordering.eq → e₁.oadd n₁ a₁ = e₂.oadd n₂ a₂

tactic: cases h₁ : cmp e₁ e₂ <;> intro h <;> try cases h
state_before: e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
⊢ (e₁.cmp e₂).orElse ((_root_.cmp ↑n₁ ↑n₂).orElse (a₁.cmp a₂)) = Ordering.eq → e₁.oadd n₁ a₁ = e₂.oadd n₂ a₂
state_after: case eq
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : e₁.cmp e₂ = Ordering.eq
h : Ordering.eq.orElse ((_root_.cmp ↑n₁ ↑n₂).orElse (a₁.cmp a₂)) = Ordering.eq
⊢ e₁.oadd n₁ a₁ = e₂.oadd n₂ a₂

tactic: obtain rfl := eq_of_cmp_eq h₁
state_before: case eq
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : e₁.cmp e₂ = Ordering.eq
h : Ordering.eq.orElse ((_root_.cmp ↑n₁ ↑n₂).orElse (a₁.cmp a₂)) = Ordering.eq
⊢ e₁.oadd n₁ a₁ = e₂.oadd n₂ a₂
state_after: case eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h : Ordering.eq.orElse ((_root_.cmp ↑n₁ ↑n₂).orElse (a₁.cmp a₂)) = Ordering.eq
h₁ : e₁.cmp e₁ = Ordering.eq
⊢ e₁.oadd n₁ a₁ = e₁.oadd n₂ a₂

tactic: revert h
state_before: case eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h : Ordering.eq.orElse ((_root_.cmp ↑n₁ ↑n₂).orElse (a₁.cmp a₂)) = Ordering.eq
h₁ : e₁.cmp e₁ = Ordering.eq
⊢ e₁.oadd n₁ a₁ = e₁.oadd n₂ a₂
state_after: case eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : e₁.cmp e₁ = Ordering.eq
⊢ Ordering.eq.orElse ((_root_.cmp ↑n₁ ↑n₂).orElse (a₁.cmp a₂)) = Ordering.eq → e₁.oadd n₁ a₁ = e₁.oadd n₂ a₂

tactic: cases h₂ : _root_.cmp (n₁ : ℕ) n₂ <;> intro h <;> try cases h
state_before: case eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : e₁.cmp e₁ = Ordering.eq
⊢ Ordering.eq.orElse ((_root_.cmp ↑n₁ ↑n₂).orElse (a₁.cmp a₂)) = Ordering.eq → e₁.oadd n₁ a₁ = e₁.oadd n₂ a₂
state_after: case eq.eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : e₁.cmp e₁ = Ordering.eq
h₂ : _root_.cmp ↑n₁ ↑n₂ = Ordering.eq
h : Ordering.eq.orElse (Ordering.eq.orElse (a₁.cmp a₂)) = Ordering.eq
⊢ e₁.oadd n₁ a₁ = e₁.oadd n₂ a₂

tactic: obtain rfl := eq_of_cmp_eq h
state_before: case eq.eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : e₁.cmp e₁ = Ordering.eq
h₂ : _root_.cmp ↑n₁ ↑n₂ = Ordering.eq
h : Ordering.eq.orElse (Ordering.eq.orElse (a₁.cmp a₂)) = Ordering.eq
⊢ e₁.oadd n₁ a₁ = e₁.oadd n₂ a₂
state_after: case eq.eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
h₁ : e₁.cmp e₁ = Ordering.eq
h₂ : _root_.cmp ↑n₁ ↑n₂ = Ordering.eq
h : Ordering.eq.orElse (Ordering.eq.orElse (a₁.cmp a₁)) = Ordering.eq
⊢ e₁.oadd n₁ a₁ = e₁.oadd n₂ a₁

tactic: rw [_root_.cmp, cmpUsing_eq_eq] at h₂
state_before: case eq.eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
h₁ : e₁.cmp e₁ = Ordering.eq
h₂ : _root_.cmp ↑n₁ ↑n₂ = Ordering.eq
h : Ordering.eq.orElse (Ordering.eq.orElse (a₁.cmp a₁)) = Ordering.eq
⊢ e₁.oadd n₁ a₁ = e₁.oadd n₂ a₁
state_after: case eq.eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
h₁ : e₁.cmp e₁ = Ordering.eq
h₂ : ¬↑n₁ < ↑n₂ ∧ ¬↑n₂ < ↑n₁
h : Ordering.eq.orElse (Ordering.eq.orElse (a₁.cmp a₁)) = Ordering.eq
⊢ e₁.oadd n₁ a₁ = e₁.oadd n₂ a₁

tactic: obtain rfl := Subtype.eq (eq_of_incomp h₂)
state_before: case eq.eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
h₁ : e₁.cmp e₁ = Ordering.eq
h₂ : ¬↑n₁ < ↑n₂ ∧ ¬↑n₂ < ↑n₁
h : Ordering.eq.orElse (Ordering.eq.orElse (a₁.cmp a₁)) = Ordering.eq
⊢ e₁.oadd n₁ a₁ = e₁.oadd n₂ a₁
state_after: case eq.eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h₁ : e₁.cmp e₁ = Ordering.eq
h : Ordering.eq.orElse (Ordering.eq.orElse (a₁.cmp a₁)) = Ordering.eq
h₂ : ¬↑n₁ < ↑n₁ ∧ ¬↑n₁ < ↑n₁
⊢ e₁.oadd n₁ a₁ = e₁.oadd n₁ a₁

tactic: simp
state_before: case eq.eq
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
h₁ : e₁.cmp e₁ = Ordering.eq
h : Ordering.eq.orElse (Ordering.eq.orElse (a₁.cmp a₁)) = Ordering.eq
h₂ : ¬↑n₁ < ↑n₁ ∧ ¬↑n₁ < ↑n₁
⊢ e₁.oadd n₁ a₁ = e₁.oadd n₁ a₁
state_after: no goals

tactic: cases h
state_before: case gt
e₁ : ONote
n₁ : ℕ+
a₁ e₂ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : e₁.cmp e₂ = Ordering.gt
h : Ordering.gt.orElse ((_root_.cmp ↑n₁ ↑n₂).orElse (a₁.cmp a₂)) = Ordering.eq
⊢ e₁.oadd n₁ a₁ = e₂.oadd n₂ a₂
state_after: no goals

tactic: cases h
state_before: case eq.gt
e₁ : ONote
n₁ : ℕ+
a₁ : ONote
n₂ : ℕ+
a₂ : ONote
h₁ : e₁.cmp e₁ = Ordering.eq
h₂ : _root_.cmp ↑n₁ ↑n₂ = Ordering.gt
h : Ordering.eq.orElse (Ordering.gt.orElse (a₁.cmp a₂)) = Ordering.eq
⊢ e₁.oadd n₁ a₁ = e₁.oadd n₂ a₂
state_after: no goals