Theorem: Polynomial.coeff_divByMonic_X_sub_C_rec
File: Mathlib/Algebra/Polynomial/Div.lean

tactic: nontriviality R
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a✝ b : R
n✝ : ℕ
inst✝ : Ring R
p✝ q p : R[X]
a : R
n : ℕ
⊢ (p /ₘ (X - C a)).coeff n = p.coeff (n + 1) + a * (p /ₘ (X - C a)).coeff (n + 1)
state_after: R : Type u
S : Type v
T : Type w
A : Type z
a✝¹ b : R
n✝ : ℕ
inst✝ : Ring R
p✝ q p : R[X]
a : R
n : ℕ
a✝ : Nontrivial R
⊢ (p /ₘ (X - C a)).coeff n = p.coeff (n + 1) + a * (p /ₘ (X - C a)).coeff (n + 1)

tactic: have := monic_X_sub_C a
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a✝¹ b : R
n✝ : ℕ
inst✝ : Ring R
p✝ q p : R[X]
a : R
n : ℕ
a✝ : Nontrivial R
⊢ (p /ₘ (X - C a)).coeff n = p.coeff (n + 1) + a * (p /ₘ (X - C a)).coeff (n + 1)
state_after: R : Type u
S : Type v
T : Type w
A : Type z
a✝¹ b : R
n✝ : ℕ
inst✝ : Ring R
p✝ q p : R[X]
a : R
n : ℕ
a✝ : Nontrivial R
this : (X - C a).Monic
⊢ (p /ₘ (X - C a)).coeff n = p.coeff (n + 1) + a * (p /ₘ (X - C a)).coeff (n + 1)

tactic: set q := p /ₘ (X - C a)
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a✝¹ b : R
n✝ : ℕ
inst✝ : Ring R
p✝ q p : R[X]
a : R
n : ℕ
a✝ : Nontrivial R
this : (X - C a).Monic
⊢ (p /ₘ (X - C a)).coeff n = p.coeff (n + 1) + a * (p /ₘ (X - C a)).coeff (n + 1)
state_after: R : Type u
S : Type v
T : Type w
A : Type z
a✝¹ b : R
n✝ : ℕ
inst✝ : Ring R
p✝ q✝ p : R[X]
a : R
n : ℕ
a✝ : Nontrivial R
this : (X - C a).Monic
q : R[X] := p /ₘ (X - C a)
⊢ q.coeff n = p.coeff (n + 1) + a * q.coeff (n + 1)

tactic: rw [← p.modByMonic_add_div this]
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a✝¹ b : R
n✝ : ℕ
inst✝ : Ring R
p✝ q✝ p : R[X]
a : R
n : ℕ
a✝ : Nontrivial R
this : (X - C a).Monic
q : R[X] := p /ₘ (X - C a)
⊢ q.coeff n = p.coeff (n + 1) + a * q.coeff (n + 1)
state_after: R : Type u
S : Type v
T : Type w
A : Type z
a✝¹ b : R
n✝ : ℕ
inst✝ : Ring R
p✝ q✝ p : R[X]
a : R
n : ℕ
a✝ : Nontrivial R
this : (X - C a).Monic
q : R[X] := p /ₘ (X - C a)
⊢ q.coeff n = (p %ₘ (X - C a) + (X - C a) * (p /ₘ (X - C a))).coeff (n + 1) + a * q.coeff (n + 1)

tactic: have : degree (p %ₘ (X - C a)) < ↑(n + 1) := degree_X_sub_C a ▸ p.degree_modByMonic_lt this
  |>.trans_le <| WithBot.coe_le_coe.mpr le_add_self
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a✝¹ b : R
n✝ : ℕ
inst✝ : Ring R
p✝ q✝ p : R[X]
a : R
n : ℕ
a✝ : Nontrivial R
this : (X - C a).Monic
q : R[X] := p /ₘ (X - C a)
⊢ q.coeff n = (p %ₘ (X - C a) + (X - C a) * (p /ₘ (X - C a))).coeff (n + 1) + a * q.coeff (n + 1)
state_after: R : Type u
S : Type v
T : Type w
A : Type z
a✝¹ b : R
n✝ : ℕ
inst✝ : Ring R
p✝ q✝ p : R[X]
a : R
n : ℕ
a✝ : Nontrivial R
this✝ : (X - C a).Monic
q : R[X] := p /ₘ (X - C a)
this : (p %ₘ (X - C a)).degree < ↑(n + 1)
⊢ q.coeff n = (p %ₘ (X - C a) + (X - C a) * (p /ₘ (X - C a))).coeff (n + 1) + a * q.coeff (n + 1)

tactic: simp [sub_mul, add_sub, coeff_eq_zero_of_degree_lt this]
state_before: R : Type u
S : Type v
T : Type w
A : Type z
a✝¹ b : R
n✝ : ℕ
inst✝ : Ring R
p✝ q✝ p : R[X]
a : R
n : ℕ
a✝ : Nontrivial R
this✝ : (X - C a).Monic
q : R[X] := p /ₘ (X - C a)
this : (p %ₘ (X - C a)).degree < ↑(n + 1)
⊢ q.coeff n = (p %ₘ (X - C a) + (X - C a) * (p /ₘ (X - C a))).coeff (n + 1) + a * q.coeff (n + 1)
state_after: no goals