Theorem: Polynomial.eval_divByMonic_eq_trailingCoeff_comp
File: Mathlib/Algebra/Polynomial/RingDivision.lean

tactic: obtain rfl | hp := eq_or_ne p 0
state_before: R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝ : CommRing R
p : R[X]
t : R
⊢ eval t (p /ₘ (X - C t) ^ rootMultiplicity t p) = (p.comp (X + C t)).trailingCoeff
state_after: case inl
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝ : CommRing R
t : R
⊢ eval t (0 /ₘ (X - C t) ^ rootMultiplicity t 0) = (comp 0 (X + C t)).trailingCoeff

case inr
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝ : CommRing R
p : R[X]
t : R
hp : p ≠ 0
⊢ eval t (p /ₘ (X - C t) ^ rootMultiplicity t p) = (p.comp (X + C t)).trailingCoeff

tactic: have mul_eq := p.pow_mul_divByMonic_rootMultiplicity_eq t
state_before: case inr
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝ : CommRing R
p : R[X]
t : R
hp : p ≠ 0
⊢ eval t (p /ₘ (X - C t) ^ rootMultiplicity t p) = (p.comp (X + C t)).trailingCoeff
state_after: case inr
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝ : CommRing R
p : R[X]
t : R
hp : p ≠ 0
mul_eq : (X - C t) ^ rootMultiplicity t p * (p /ₘ (X - C t) ^ rootMultiplicity t p) = p
⊢ eval t (p /ₘ (X - C t) ^ rootMultiplicity t p) = (p.comp (X + C t)).trailingCoeff

tactic: set m := p.rootMultiplicity t
state_before: case inr
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝ : CommRing R
p : R[X]
t : R
hp : p ≠ 0
mul_eq : (X - C t) ^ rootMultiplicity t p * (p /ₘ (X - C t) ^ rootMultiplicity t p) = p
⊢ eval t (p /ₘ (X - C t) ^ rootMultiplicity t p) = (p.comp (X + C t)).trailingCoeff
state_after: case inr
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝ : CommRing R
p : R[X]
t : R
hp : p ≠ 0
m : ℕ := rootMultiplicity t p
mul_eq : (X - C t) ^ m * (p /ₘ (X - C t) ^ m) = p
⊢ eval t (p /ₘ (X - C t) ^ m) = (p.comp (X + C t)).trailingCoeff

tactic: set g := p /ₘ (X - C t) ^ m
state_before: case inr
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝ : CommRing R
p : R[X]
t : R
hp : p ≠ 0
m : ℕ := rootMultiplicity t p
mul_eq : (X - C t) ^ m * (p /ₘ (X - C t) ^ m) = p
⊢ eval t (p /ₘ (X - C t) ^ m) = (p.comp (X + C t)).trailingCoeff
state_after: case inr
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝ : CommRing R
p : R[X]
t : R
hp : p ≠ 0
m : ℕ := rootMultiplicity t p
g : R[X] := p /ₘ (X - C t) ^ m
mul_eq : (X - C t) ^ m * g = p
⊢ eval t g = (p.comp (X + C t)).trailingCoeff

tactic: have : (g.comp (X + C t)).coeff 0 = g.eval t := by
  rw [coeff_zero_eq_eval_zero, eval_comp, eval_add, eval_X, eval_C, zero_add]
state_before: case inr
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝ : CommRing R
p : R[X]
t : R
hp : p ≠ 0
m : ℕ := rootMultiplicity t p
g : R[X] := p /ₘ (X - C t) ^ m
mul_eq : (X - C t) ^ m * g = p
⊢ eval t g = (p.comp (X + C t)).trailingCoeff
state_after: case inr
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝ : CommRing R
p : R[X]
t : R
hp : p ≠ 0
m : ℕ := rootMultiplicity t p
g : R[X] := p /ₘ (X - C t) ^ m
mul_eq : (X - C t) ^ m * g = p
this : (g.comp (X + C t)).coeff 0 = eval t g
⊢ eval t g = (p.comp (X + C t)).trailingCoeff

tactic: rw [zero_divByMonic, eval_zero, zero_comp, trailingCoeff_zero]
state_before: case inl
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝ : CommRing R
t : R
⊢ eval t (0 /ₘ (X - C t) ^ rootMultiplicity t 0) = (comp 0 (X + C t)).trailingCoeff
state_after: no goals

tactic: rw [coeff_zero_eq_eval_zero, eval_comp, eval_add, eval_X, eval_C, zero_add]
state_before: R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝ : CommRing R
p : R[X]
t : R
hp : p ≠ 0
m : ℕ := rootMultiplicity t p
g : R[X] := p /ₘ (X - C t) ^ m
mul_eq : (X - C t) ^ m * g = p
⊢ (g.comp (X + C t)).coeff 0 = eval t g
state_after: no goals