Theorem: Monoid.ext
File: Mathlib/Algebra/Group/Ext.lean

tactic: have : m₁.toMulOneClass = m₂.toMulOneClass := MulOneClass.ext h_mul
state_before: M : Type u
m₁ m₂ : Monoid M
h_mul : Mul.mul = Mul.mul
⊢ m₁ = m₂

tactic: let f : @MonoidHom M M m₁.toMulOneClass m₂.toMulOneClass :=
  @MonoidHom.mk _ _ (_) _ (@OneHom.mk _ _ (_) _ id h₁)
    (fun x y => congr_fun (congr_fun h_mul x) y)
state_before: M : Type u
m₁ m₂ : Monoid M
h_mul : Mul.mul = Mul.mul
this : toMulOneClass = toMulOneClass
h₁ : One.one = One.one
⊢ m₁ = m₂

tactic: have : m₁.npow = m₂.npow := by
  ext (n x)
  exact @MonoidHom.map_pow M M m₁ m₂ f x n
state_before: M : Type u
m₁ m₂ : Monoid M
h_mul : Mul.mul = Mul.mul
this : toMulOneClass = toMulOneClass
h₁ : One.one = One.one
f : M →* M := { toOneHom := { toFun := id, map_one' := h₁ }, map_mul' := (_ : ∀ (x y : M), Mul.mul x y = Mul.mul x y) }
⊢ m₁ = m₂

tactic: rcases m₁ with @⟨@⟨⟨_⟩⟩, ⟨_⟩⟩
state_before: M : Type u
m₁ m₂ : Monoid M
h_mul : Mul.mul = Mul.mul
this✝ : toMulOneClass = toMulOneClass
h₁ : One.one = One.one
f : M →* M := { toOneHom := { toFun := id, map_one' := h₁ }, map_mul' := (_ : ∀ (x y : M), Mul.mul x y = Mul.mul x y) }
this : npow = npow
⊢ m₁ = m₂

tactic: rcases m₂ with @⟨@⟨⟨_⟩⟩, ⟨_⟩⟩
state_before: case mk.mk.mk.mk
M : Type u
m₂ : Monoid M
npow✝ : ℕ → M → M
mul✝ : M → M → M
mul_assoc✝ : ∀ (a b c : M), a * b * c = a * (b * c)
npow_succ✝ : ∀ (n : ℕ) (x : M), npow✝ (n + 1) x = x * npow✝ n x
one✝ : M
npow_zero✝ : ∀ (x : M), npow✝ 0 x = 1
one_mul✝ : ∀ (a : M), 1 * a = a
mul_one✝ : ∀ (a : M), a * 1 = a
h_mul : Mul.mul = Mul.mul
this✝ : toMulOneClass = toMulOneClass
h₁ : One.one = One.one
f : M →* M := { toOneHom := { toFun := id, map_one' := h₁ }, map_mul' := (_ : ∀ (x y : M), Mul.mul x y = Mul.mul x y) }
this : npow = npow
⊢ mk one_mul✝ mul_one✝ npow✝ = m₂

tactic: congr
state_before: case mk.mk.mk.mk.mk.mk.mk.mk
M : Type u
npow✝¹ : ℕ → M → M
mul✝¹ : M → M → M
mul_assoc✝¹ : ∀ (a b c : M), a * b * c = a * (b * c)
npow_succ✝¹ : ∀ (n : ℕ) (x : M), npow✝¹ (n + 1) x = x * npow✝¹ n x
one✝¹ : M
npow_zero✝¹ : ∀ (x : M), npow✝¹ 0 x = 1
one_mul✝¹ : ∀ (a : M), 1 * a = a
mul_one✝¹ : ∀ (a : M), a * 1 = a
npow✝ : ℕ → M → M
mul✝ : M → M → M
mul_assoc✝ : ∀ (a b c : M), a * b * c = a * (b * c)
npow_succ✝ : ∀ (n : ℕ) (x : M), npow✝ (n + 1) x = x * npow✝ n x
one✝ : M
npow_zero✝ : ∀ (x : M), npow✝ 0 x = 1
one_mul✝ : ∀ (a : M), 1 * a = a
mul_one✝ : ∀ (a : M), a * 1 = a
h_mul : Mul.mul = Mul.mul
this✝ : toMulOneClass = toMulOneClass
h₁ : One.one = One.one
f : M →* M := { toOneHom := { toFun := id, map_one' := h₁ }, map_mul' := (_ : ∀ (x y : M), Mul.mul x y = Mul.mul x y) }
this : npow = npow
⊢ mk one_mul✝¹ mul_one✝¹ npow✝¹ = mk one_mul✝ mul_one✝ npow✝

tactic: ext (n x)
state_before: M : Type u
m₁ m₂ : Monoid M
h_mul : Mul.mul = Mul.mul
this : toMulOneClass = toMulOneClass
h₁ : One.one = One.one
f : M →* M := { toOneHom := { toFun := id, map_one' := h₁ }, map_mul' := (_ : ∀ (x y : M), Mul.mul x y = Mul.mul x y) }
⊢ npow = npow

tactic: exact @MonoidHom.map_pow M M m₁ m₂ f x n
state_before: case h.h
M : Type u
m₁ m₂ : Monoid M
h_mul : Mul.mul = Mul.mul
this : toMulOneClass = toMulOneClass
h₁ : One.one = One.one
f : M →* M := { toOneHom := { toFun := id, map_one' := h₁ }, map_mul' := (_ : ∀ (x y : M), Mul.mul x y = Mul.mul x y) }
n : ℕ
x : M
⊢ npow n x = npow n x