Theorem: Polynomial.ringHom_ext
File: Mathlib/Algebra/Polynomial/Monomial.lean

tactic: set f' := f.comp (toFinsuppIso R).symm.toRingHom with hf'
state_before: R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
⊢ f = g
state_after: R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
⊢ f = g

tactic: set g' := g.comp (toFinsuppIso R).symm.toRingHom with hg'
state_before: R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
⊢ f = g
state_after: R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
⊢ f = g

tactic: have B : f = f'.comp (toFinsuppIso R) := by
  rw [hf', RingHom.comp_assoc]
  ext x
  simp only [RingEquiv.toRingHom_eq_coe, RingEquiv.symm_apply_apply, Function.comp_apply,
    RingHom.coe_comp, RingEquiv.coe_toRingHom]
state_before: R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
A : f' = g'
⊢ f = g
state_after: R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
A : f' = g'
B : f = f'.comp ↑(toFinsuppIso R)
⊢ f = g

tactic: have C' : g = g'.comp (toFinsuppIso R) := by
  rw [hg', RingHom.comp_assoc]
  ext x
  simp only [RingEquiv.toRingHom_eq_coe, RingEquiv.symm_apply_apply, Function.comp_apply,
    RingHom.coe_comp, RingEquiv.coe_toRingHom]
state_before: R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
A : f' = g'
B : f = f'.comp ↑(toFinsuppIso R)
⊢ f = g
state_after: R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
A : f' = g'
B : f = f'.comp ↑(toFinsuppIso R)
C' : g = g'.comp ↑(toFinsuppIso R)
⊢ f = g

tactic: rw [B, C', A]
state_before: R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
A : f' = g'
B : f = f'.comp ↑(toFinsuppIso R)
C' : g = g'.comp ↑(toFinsuppIso R)
⊢ f = g
state_after: no goals

tactic: ext : 1
state_before: R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
⊢ f' = g'
state_after: case h₁
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
⊢ f'.comp AddMonoidAlgebra.singleZeroRingHom = g'.comp AddMonoidAlgebra.singleZeroRingHom

case h_of
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
⊢ (↑f').comp (AddMonoidAlgebra.of R ℕ) = (↑g').comp (AddMonoidAlgebra.of R ℕ)

tactic: ext
state_before: case h₁
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
⊢ f'.comp AddMonoidAlgebra.singleZeroRingHom = g'.comp AddMonoidAlgebra.singleZeroRingHom
state_after: case h₁.a
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
x✝ : R
⊢ (f'.comp AddMonoidAlgebra.singleZeroRingHom) x✝ = (g'.comp AddMonoidAlgebra.singleZeroRingHom) x✝

tactic: simp [f', g', h₁, RingEquiv.toRingHom_eq_coe]
state_before: case h₁.a
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
x✝ : R
⊢ (f'.comp AddMonoidAlgebra.singleZeroRingHom) x✝ = (g'.comp AddMonoidAlgebra.singleZeroRingHom) x✝
state_after: no goals

tactic: refine MonoidHom.ext_mnat ?_
state_before: case h_of
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
⊢ (↑f').comp (AddMonoidAlgebra.of R ℕ) = (↑g').comp (AddMonoidAlgebra.of R ℕ)
state_after: case h_of
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
⊢ ((↑f').comp (AddMonoidAlgebra.of R ℕ)) (Multiplicative.ofAdd 1) =
    ((↑g').comp (AddMonoidAlgebra.of R ℕ)) (Multiplicative.ofAdd 1)

tactic: simpa [RingEquiv.toRingHom_eq_coe] using h₂
state_before: case h_of
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
⊢ ((↑f').comp (AddMonoidAlgebra.of R ℕ)) (Multiplicative.ofAdd 1) =
    ((↑g').comp (AddMonoidAlgebra.of R ℕ)) (Multiplicative.ofAdd 1)
state_after: no goals

tactic: rw [hf', RingHom.comp_assoc]
state_before: R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
A : f' = g'
⊢ f = f'.comp ↑(toFinsuppIso R)
state_after: R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
A : f' = g'
⊢ f = f.comp ((toFinsuppIso R).symm.toRingHom.comp ↑(toFinsuppIso R))

tactic: ext x
state_before: R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
A : f' = g'
⊢ f = f.comp ((toFinsuppIso R).symm.toRingHom.comp ↑(toFinsuppIso R))
state_after: case a
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
A : f' = g'
x : R[X]
⊢ f x = (f.comp ((toFinsuppIso R).symm.toRingHom.comp ↑(toFinsuppIso R))) x

tactic: simp only [RingEquiv.toRingHom_eq_coe, RingEquiv.symm_apply_apply, Function.comp_apply,
  RingHom.coe_comp, RingEquiv.coe_toRingHom]
state_before: case a
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
A : f' = g'
x : R[X]
⊢ f x = (f.comp ((toFinsuppIso R).symm.toRingHom.comp ↑(toFinsuppIso R))) x
state_after: no goals

tactic: rw [hg', RingHom.comp_assoc]
state_before: R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
A : f' = g'
B : f = f'.comp ↑(toFinsuppIso R)
⊢ g = g'.comp ↑(toFinsuppIso R)
state_after: R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
A : f' = g'
B : f = f'.comp ↑(toFinsuppIso R)
⊢ g = g.comp ((toFinsuppIso R).symm.toRingHom.comp ↑(toFinsuppIso R))

tactic: ext x
state_before: R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
A : f' = g'
B : f = f'.comp ↑(toFinsuppIso R)
⊢ g = g.comp ((toFinsuppIso R).symm.toRingHom.comp ↑(toFinsuppIso R))
state_after: case a
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
A : f' = g'
B : f = f'.comp ↑(toFinsuppIso R)
x : R[X]
⊢ g x = (g.comp ((toFinsuppIso R).symm.toRingHom.comp ↑(toFinsuppIso R))) x

tactic: simp only [RingEquiv.toRingHom_eq_coe, RingEquiv.symm_apply_apply, Function.comp_apply,
  RingHom.coe_comp, RingEquiv.coe_toRingHom]
state_before: case a
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q r : R[X]
S : Type u_1
inst✝ : Semiring S
f g : R[X] →+* S
h₁ : ∀ (a : R), f (C a) = g (C a)
h₂ : f X = g X
f' : AddMonoidAlgebra R ℕ →+* S := f.comp (toFinsuppIso R).symm.toRingHom
hf' : f' = f.comp (toFinsuppIso R).symm.toRingHom
g' : AddMonoidAlgebra R ℕ →+* S := g.comp (toFinsuppIso R).symm.toRingHom
hg' : g' = g.comp (toFinsuppIso R).symm.toRingHom
A : f' = g'
B : f = f'.comp ↑(toFinsuppIso R)
x : R[X]
⊢ g x = (g.comp ((toFinsuppIso R).symm.toRingHom.comp ↑(toFinsuppIso R))) x
state_after: no goals