Theorem: Ring.ext
File: Mathlib/Algebra/Ring/Ext.lean

Proof steps:
state_before: R : Type u
inst₁ inst₂ : Ring R
h_add : HAdd.hAdd = HAdd.hAdd
h_mul : HMul.hMul = HMul.hMul
⊢ inst₁ = inst₂
state_after: R : Type u
inst₁ inst₂ : Ring R
h_add : HAdd.hAdd = HAdd.hAdd
h_mul : HMul.hMul = HMul.hMul
h₁ : toSemiring = toSemiring
⊢ inst₁ = inst₂
tactic: have h₁ : inst₁.toSemiring = inst₂.toSemiring := by
    ext : 1 <;> assumption
state_before: R : Type u
inst₁ inst₂ : Ring R
h_add : HAdd.hAdd = HAdd.hAdd
h_mul : HMul.hMul = HMul.hMul
h₁ : toSemiring = toSemiring
⊢ inst₁ = inst₂
state_after: R : Type u
inst₁ inst₂ : Ring R
h_add : HAdd.hAdd = HAdd.hAdd
h_mul : HMul.hMul = HMul.hMul
h₁ : toSemiring = toSemiring
h₂ : toNonAssocRing = toNonAssocRing
⊢ inst₁ = inst₂
tactic: have h₂ : inst₁.toNonAssocRing = inst₂.toNonAssocRing := by
    ext : 1 <;> assumption
state_before: R : Type u
inst₁ inst₂ : Ring R
h_add : HAdd.hAdd = HAdd.hAdd
h_mul : HMul.hMul = HMul.hMul
h₁ : toSemiring = toSemiring
h₂ : toNonAssocRing = toNonAssocRing
⊢ inst₁ = inst₂
state_after: R : Type u
inst₁ inst₂ : Ring R
h_add : HAdd.hAdd = HAdd.hAdd
h_mul : HMul.hMul = HMul.hMul
h₁ : toSemiring = toSemiring
h₂ : toNonAssocRing = toNonAssocRing
h₃ : AddGroup.toSubNegMonoid = AddGroup.toSubNegMonoid
⊢ inst₁ = inst₂
tactic: have h₃ : (inst₁.toAddCommGroup).toAddGroup.toSubNegMonoid
            = (inst₂.toAddCommGroup).toAddGroup.toSubNegMonoid :=
    congrArg (@AddGroup.toSubNegMonoid R) <| by ext : 1; exact h_add
state_before: R : Type u
inst₁ inst₂ : Ring R
h_add : HAdd.hAdd = HAdd.hAdd
h_mul : HMul.hMul = HMul.hMul
h₁ : toSemiring = toSemiring
h₂ : toNonAssocRing = toNonAssocRing
h₃ : AddGroup.toSubNegMonoid = AddGroup.toSubNegMonoid
⊢ inst₁ = inst₂
state_after: case mk
R : Type u
inst₂ : Ring R
toSemiring✝ : Semiring R
toNeg✝ : Neg R
toSub✝ : Sub R
sub_eq_add_neg✝ : ∀ (a b : R), a - b = a + -b
zsmul✝ : ℤ → R → R
zsmul_zero'✝ : ∀ (a : R), zsmul✝ 0 a = 0
zsmul_succ'✝ : ∀ (n : ℕ) (a : R), zsmul✝ (Int.ofNat n.succ) a = zsmul✝ (Int.ofNat n) a + a
zsmul_neg'✝ : ∀ (n : ℕ) (a : R), zsmul✝ (Int.negSucc n) a = -zsmul✝ (↑n.succ) a
add_left_neg✝ : ∀ (a : R), -a + a = 0
toIntCast✝ : IntCast R
intCast_ofNat✝ : ∀ (n : ℕ), IntCast.intCast ↑n = ↑n
intCast_negSucc✝ : ∀ (n : ℕ), IntCast.intCast (Int.negSucc n) = -↑(n + 1)
h_add : HAdd.hAdd = HAdd.hAdd
h_mul : HMul.hMul = HMul.hMul
h₁ : toSemiring = toSemiring
h₂ : toNonAssocRing = toNonAssocRing
h₃ : AddGroup.toSubNegMonoid = AddGroup.toSubNegMonoid
⊢ mk sub_eq_add_neg✝ zsmul✝ zsmul_zero'✝ zsmul_succ'✝ zsmul_neg'✝ add_left_neg✝ intCast_ofNat✝ intCast_negSucc✝ = inst₂
tactic: cases inst₁
state_before: case mk
R : Type u
inst₂ : Ring R
toSemiring✝ : Semiring R
toNeg✝ : Neg R
toSub✝ : Sub R
sub_eq_add_neg✝ : ∀ (a b : R), a - b = a + -b
zsmul✝ : ℤ → R → R
zsmul_zero'✝ : ∀ (a : R), zsmul✝ 0 a = 0
zsmul_succ'✝ : ∀ (n : ℕ) (a : R), zsmul✝ (Int.ofNat n.succ) a = zsmul✝ (Int.ofNat n) a + a
zsmul_neg'✝ : ∀ (n : ℕ) (a : R), zsmul✝ (Int.negSucc n) a = -zsmul✝ (↑n.succ) a
add_left_neg✝ : ∀ (a : R), -a + a = 0
toIntCast✝ : IntCast R
intCast_ofNat✝ : ∀ (n : ℕ), IntCast.intCast ↑n = ↑n
intCast_negSucc✝ : ∀ (n : ℕ), IntCast.intCast (Int.negSucc n) = -↑(n + 1)
h_add : HAdd.hAdd = HAdd.hAdd
h_mul : HMul.hMul = HMul.hMul
h₁ : toSemiring = toSemiring
h₂ : toNonAssocRing = toNonAssocRing
h₃ : AddGroup.toSubNegMonoid = AddGroup.toSubNegMonoid
⊢ mk sub_eq_add_neg✝ zsmul✝ zsmul_zero'✝ zsmul_succ'✝ zsmul_neg'✝ add_left_neg✝ intCast_ofNat✝ intCast_negSucc✝ = inst₂
state_after: case mk.mk
R : Type u
toSemiring✝¹ : Semiring R
toNeg✝¹ : Neg R
toSub✝¹ : Sub R
sub_eq_add_neg✝¹ : ∀ (a b : R), a - b = a + -b
zsmul✝¹ : ℤ → R → R
zsmul_zero'✝¹ : ∀ (a : R), zsmul✝¹ 0 a = 0
zsmul_succ'✝¹ : ∀ (n : ℕ) (a : R), zsmul✝¹ (Int.ofNat n.succ) a = zsmul✝¹ (Int.ofNat n) a + a
zsmul_neg'✝¹ : ∀ (n : ℕ) (a : R), zsmul✝¹ (Int.negSucc n) a = -zsmul✝¹ (↑n.succ) a
add_left_neg✝¹ : ∀ (a : R), -a + a = 0
toIntCast✝¹ : IntCast R
intCast_ofNat✝¹ : ∀ (n : ℕ), IntCast.intCast ↑n = ↑n
intCast_negSucc✝¹ : ∀ (n : ℕ), IntCast.intCast (Int.negSucc n) = -↑(n + 1)
toSemiring✝ : Semiring R
toNeg✝ : Neg R
toSub✝ : Sub R
sub_eq_add_neg✝ : ∀ (a b : R), a - b = a + -b
zsmul✝ : ℤ → R → R
zsmul_zero'✝ : ∀ (a : R), zsmul✝ 0 a = 0
zsmul_succ'✝ : ∀ (n : ℕ) (a : R), zsmul✝ (Int.ofNat n.succ) a = zsmul✝ (Int.ofNat n) a + a
zsmul_neg'✝ : ∀ (n : ℕ) (a : R), zsmul✝ (Int.negSucc n) a = -zsmul✝ (↑n.succ) a
add_left_neg✝ : ∀ (a : R), -a + a = 0
toIntCast✝ : IntCast R
intCast_ofNat✝ : ∀ (n : ℕ), IntCast.intCast ↑n = ↑n
intCast_negSucc✝ : ∀ (n : ℕ), IntCast.intCast (Int.negSucc n) = -↑(n + 1)
h_add : HAdd.hAdd = HAdd.hAdd
h_mul : HMul.hMul = HMul.hMul
h₁ : toSemiring = toSemiring
h₂ : toNonAssocRing = toNonAssocRing
h₃ : AddGroup.toSubNegMonoid = AddGroup.toSubNegMonoid
⊢ mk sub_eq_add_neg✝¹ zsmul✝¹ zsmul_zero'✝¹ zsmul_succ'✝¹ zsmul_neg'✝¹ add_left_neg✝¹ intCast_ofNat✝¹
      intCast_negSucc✝¹ =
    mk sub_eq_add_neg✝ zsmul✝ zsmul_zero'✝ zsmul_succ'✝ zsmul_neg'✝ add_left_neg✝ intCast_ofNat✝ intCast_negSucc✝
tactic: cases inst₂
state_before: case mk.mk
R : Type u
toSemiring✝¹ : Semiring R
toNeg✝¹ : Neg R
toSub✝¹ : Sub R
sub_eq_add_neg✝¹ : ∀ (a b : R), a - b = a + -b
zsmul✝¹ : ℤ → R → R
zsmul_zero'✝¹ : ∀ (a : R), zsmul✝¹ 0 a = 0
zsmul_succ'✝¹ : ∀ (n : ℕ) (a : R), zsmul✝¹ (Int.ofNat n.succ) a = zsmul✝¹ (Int.ofNat n) a + a
zsmul_neg'✝¹ : ∀ (n : ℕ) (a : R), zsmul✝¹ (Int.negSucc n) a = -zsmul✝¹ (↑n.succ) a
add_left_neg✝¹ : ∀ (a : R), -a + a = 0
toIntCast✝¹ : IntCast R
intCast_ofNat✝¹ : ∀ (n : ℕ), IntCast.intCast ↑n = ↑n
intCast_negSucc✝¹ : ∀ (n : ℕ), IntCast.intCast (Int.negSucc n) = -↑(n + 1)
toSemiring✝ : Semiring R
toNeg✝ : Neg R
toSub✝ : Sub R
sub_eq_add_neg✝ : ∀ (a b : R), a - b = a + -b
zsmul✝ : ℤ → R → R
zsmul_zero'✝ : ∀ (a : R), zsmul✝ 0 a = 0
zsmul_succ'✝ : ∀ (n : ℕ) (a : R), zsmul✝ (Int.ofNat n.succ) a = zsmul✝ (Int.ofNat n) a + a
zsmul_neg'✝ : ∀ (n : ℕ) (a : R), zsmul✝ (Int.negSucc n) a = -zsmul✝ (↑n.succ) a
add_left_neg✝ : ∀ (a : R), -a + a = 0
toIntCast✝ : IntCast R
intCast_ofNat✝ : ∀ (n : ℕ), IntCast.intCast ↑n = ↑n
intCast_negSucc✝ : ∀ (n : ℕ), IntCast.intCast (Int.negSucc n) = -↑(n + 1)
h_add : HAdd.hAdd = HAdd.hAdd
h_mul : HMul.hMul = HMul.hMul
h₁ : toSemiring = toSemiring
h₂ : toNonAssocRing = toNonAssocRing
h₃ : AddGroup.toSubNegMonoid = AddGroup.toSubNegMonoid
⊢ mk sub_eq_add_neg✝¹ zsmul✝¹ zsmul_zero'✝¹ zsmul_succ'✝¹ zsmul_neg'✝¹ add_left_neg✝¹ intCast_ofNat✝¹
      intCast_negSucc✝¹ =
    mk sub_eq_add_neg✝ zsmul✝ zsmul_zero'✝ zsmul_succ'✝ zsmul_neg'✝ add_left_neg✝ intCast_ofNat✝ intCast_negSucc✝
state_after: no goals
tactic: congr <;> solve | injection h₂ | injection h₃