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

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
⊢ 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_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
⊢ 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_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
⊢ 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: rcases inst₁ with @⟨⟨⟩⟩
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: congr
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: ext : 1
state_before: R : Type u
inst₁ inst₂ : AddMonoidWithOne R
h_add : HAdd.hAdd = HAdd.hAdd
h_one : One.one = One.one
⊢ toAddMonoid = toAddMonoid
state_after: case h_mul
R : Type u
inst₁ inst₂ : AddMonoidWithOne R
h_add : HAdd.hAdd = HAdd.hAdd
h_one : One.one = One.one
⊢ HAdd.hAdd = HAdd.hAdd

tactic: exact h_add
state_before: case h_mul
R : Type u
inst₁ inst₂ : AddMonoidWithOne R
h_add : HAdd.hAdd = HAdd.hAdd
h_one : One.one = One.one
⊢ HAdd.hAdd = HAdd.hAdd
state_after: no goals

tactic: funext n
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
⊢ NatCast.natCast = NatCast.natCast
state_after: case h
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
n : ℕ
⊢ NatCast.natCast n = NatCast.natCast n

tactic: 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: case h
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
n : ℕ
⊢ NatCast.natCast n = NatCast.natCast n
state_after: no goals

tactic: rewrite [inst₁.natCast_zero, inst₂.natCast_zero]
state_before: case h.zero
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
⊢ NatCast.natCast 0 = NatCast.natCast 0
state_after: case h.zero
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
⊢ 0 = 0

tactic: exact congrArg (@Zero.zero R) h_zero'
state_before: case h.zero
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
⊢ 0 = 0
state_after: no goals

tactic: rw [inst₁.natCast_succ, inst₂.natCast_succ, h_add]
state_before: case h.succ
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
n : ℕ
h : NatCast.natCast n = NatCast.natCast n
⊢ NatCast.natCast (n + 1) = NatCast.natCast (n + 1)
state_after: case h.succ
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
n : ℕ
h : NatCast.natCast n = NatCast.natCast n
⊢ NatCast.natCast n + 1 = NatCast.natCast n + 1

tactic: exact congrArg₂ _ h h_one
state_before: case h.succ
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
n : ℕ
h : NatCast.natCast n = NatCast.natCast n
⊢ NatCast.natCast n + 1 = NatCast.natCast n + 1
state_after: no goals