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

Proof steps:
state_before: R : Type u
inst₁ inst₂ : AddMonoidWithOne R
h_add : HAdd.hAdd = HAdd.hAdd
h_one : One.one = One.one
⊢ inst₁ = inst₂
state_after: R : Type u
inst₁ inst₂ : AddMonoidWithOne R
h_add : HAdd.hAdd = HAdd.hAdd
h_one : One.one = One.one
h_monoid : toAddMonoid = toAddMonoid
⊢ inst₁ = inst₂
tactic: have h_monoid : inst₁.toAddMonoid = inst₂.toAddMonoid := by ext : 1; exact h_add
state_before: R : Type u
inst₁ inst₂ : AddMonoidWithOne R
h_add : HAdd.hAdd = HAdd.hAdd
h_one : One.one = One.one
h_monoid : toAddMonoid = toAddMonoid
h_zero' : AddMonoid.toZero = AddMonoid.toZero
⊢ inst₁ = inst₂
state_after: R : Type u
inst₁ inst₂ : AddMonoidWithOne R
h_add : HAdd.hAdd = HAdd.hAdd
h_one : One.one = One.one
h_monoid : toAddMonoid = toAddMonoid
h_zero' : AddMonoid.toZero = AddMonoid.toZero
h_one' : toOne = toOne
⊢ inst₁ = inst₂
tactic: have h_one' : inst₁.toOne = inst₂.toOne :=
    congrArg One.mk h_one
state_before: R : Type u
inst₁ inst₂ : AddMonoidWithOne R
h_add : HAdd.hAdd = HAdd.hAdd
h_one : One.one = One.one
h_monoid : toAddMonoid = toAddMonoid
h_zero' : AddMonoid.toZero = AddMonoid.toZero
h_one' : toOne = toOne
⊢ inst₁ = inst₂
state_after: R : Type u
inst₁ inst₂ : AddMonoidWithOne R
h_add : HAdd.hAdd = HAdd.hAdd
h_one : One.one = One.one
h_monoid : toAddMonoid = toAddMonoid
h_zero' : AddMonoid.toZero = AddMonoid.toZero
h_one' : toOne = toOne
h_natCast : NatCast.natCast = NatCast.natCast
⊢ inst₁ = inst₂
tactic: have h_natCast : inst₁.toNatCast.natCast = inst₂.toNatCast.natCast := by
    funext n; induction n with
    | zero     => rewrite [inst₁.natCast_zero, inst₂.natCast_zero]
                  exact congrArg (@Zero.zero R) h_zero'
    | succ n h => rw [inst₁.natCast_succ, inst₂.natCast_succ, h_add]
                  exact congrArg₂ _ h h_one
state_before: R : Type u
inst₁ inst₂ : AddMonoidWithOne R
h_add : HAdd.hAdd = HAdd.hAdd
h_one : One.one = One.one
h_monoid : toAddMonoid = toAddMonoid
h_zero' : AddMonoid.toZero = AddMonoid.toZero
h_one' : toOne = toOne
h_natCast : NatCast.natCast = NatCast.natCast
⊢ inst₁ = inst₂
state_after: case mk.mk
R : Type u
inst₂ : AddMonoidWithOne R
toAddMonoid✝ : AddMonoid R
toOne✝ : One R
natCast✝ : ℕ → R
natCast_zero✝ : NatCast.natCast 0 = 0
natCast_succ✝ : ∀ (n : ℕ), NatCast.natCast (n + 1) = NatCast.natCast n + 1
h_add : HAdd.hAdd = HAdd.hAdd
h_one : One.one = One.one
h_monoid : toAddMonoid = toAddMonoid
h_zero' : AddMonoid.toZero = AddMonoid.toZero
h_one' : toOne = toOne
h_natCast : NatCast.natCast = NatCast.natCast
⊢ mk natCast_zero✝ natCast_succ✝ = inst₂
tactic: rcases inst₁ with @⟨⟨⟩⟩
state_before: case mk.mk
R : Type u
inst₂ : AddMonoidWithOne R
toAddMonoid✝ : AddMonoid R
toOne✝ : One R
natCast✝ : ℕ → R
natCast_zero✝ : NatCast.natCast 0 = 0
natCast_succ✝ : ∀ (n : ℕ), NatCast.natCast (n + 1) = NatCast.natCast n + 1
h_add : HAdd.hAdd = HAdd.hAdd
h_one : One.one = One.one
h_monoid : toAddMonoid = toAddMonoid
h_zero' : AddMonoid.toZero = AddMonoid.toZero
h_one' : toOne = toOne
h_natCast : NatCast.natCast = NatCast.natCast
⊢ mk natCast_zero✝ natCast_succ✝ = inst₂
state_after: case mk.mk.mk.mk
R : Type u
toAddMonoid✝¹ : AddMonoid R
toOne✝¹ : One R
natCast✝¹ : ℕ → R
natCast_zero✝¹ : NatCast.natCast 0 = 0
natCast_succ✝¹ : ∀ (n : ℕ), NatCast.natCast (n + 1) = NatCast.natCast n + 1
toAddMonoid✝ : AddMonoid R
toOne✝ : One R
natCast✝ : ℕ → R
natCast_zero✝ : NatCast.natCast 0 = 0
natCast_succ✝ : ∀ (n : ℕ), NatCast.natCast (n + 1) = NatCast.natCast n + 1
h_add : HAdd.hAdd = HAdd.hAdd
h_one : One.one = One.one
h_monoid : toAddMonoid = toAddMonoid
h_zero' : AddMonoid.toZero = AddMonoid.toZero
h_one' : toOne = toOne
h_natCast : NatCast.natCast = NatCast.natCast
⊢ mk natCast_zero✝¹ natCast_succ✝¹ = mk natCast_zero✝ natCast_succ✝
tactic: rcases inst₂ with @⟨⟨⟩⟩
state_before: case mk.mk.mk.mk
R : Type u
toAddMonoid✝¹ : AddMonoid R
toOne✝¹ : One R
natCast✝¹ : ℕ → R
natCast_zero✝¹ : NatCast.natCast 0 = 0
natCast_succ✝¹ : ∀ (n : ℕ), NatCast.natCast (n + 1) = NatCast.natCast n + 1
toAddMonoid✝ : AddMonoid R
toOne✝ : One R
natCast✝ : ℕ → R
natCast_zero✝ : NatCast.natCast 0 = 0
natCast_succ✝ : ∀ (n : ℕ), NatCast.natCast (n + 1) = NatCast.natCast n + 1
h_add : HAdd.hAdd = HAdd.hAdd
h_one : One.one = One.one
h_monoid : toAddMonoid = toAddMonoid
h_zero' : AddMonoid.toZero = AddMonoid.toZero
h_one' : toOne = toOne
h_natCast : NatCast.natCast = NatCast.natCast
⊢ mk natCast_zero✝¹ natCast_succ✝¹ = mk natCast_zero✝ natCast_succ✝
state_after: no goals
tactic: congr