Theorem: Polynomial.coeff_iterate_derivative
File: Mathlib/Algebra/Polynomial/Derivative.lean

tactic: induction k generalizing m with
| zero => simp
| succ k ih =>
    calc
      (derivative^[k + 1] p).coeff m
      _ = Nat.descFactorial (Nat.succ (m + k)) k • p.coeff (m + k.succ) * (m + 1) := by
        rw [Function.iterate_succ_apply', coeff_derivative, ih m.succ, Nat.succ_add, Nat.add_succ]
      _ = ((m + 1) * Nat.descFactorial (Nat.succ (m + k)) k) • p.coeff (m + k.succ) := by
        rw [← Nat.cast_add_one, ← nsmul_eq_mul', smul_smul]
      _ = Nat.descFactorial (m.succ + k) k.succ • p.coeff (m + k.succ) := by
        rw [← Nat.succ_add, Nat.descFactorial_succ, add_tsub_cancel_right]
      _ = Nat.descFactorial (m + k.succ) k.succ • p.coeff (m + k.succ) := by
        rw [Nat.succ_add_eq_add_succ]
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝ : Semiring R
k : ℕ
p : R[X]
m : ℕ
⊢ ((⇑derivative)^[k] p).coeff m = (m + k).descFactorial k • p.coeff (m + k)
state_after: no goals

tactic: simp
state_before: case zero
R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝ : Semiring R
p : R[X]
m : ℕ
⊢ ((⇑derivative)^[0] p).coeff m = (m + 0).descFactorial 0 • p.coeff (m + 0)
state_after: no goals

tactic: calc
  (derivative^[k + 1] p).coeff m
  _ = Nat.descFactorial (Nat.succ (m + k)) k • p.coeff (m + k.succ) * (m + 1) := by
    rw [Function.iterate_succ_apply', coeff_derivative, ih m.succ, Nat.succ_add, Nat.add_succ]
  _ = ((m + 1) * Nat.descFactorial (Nat.succ (m + k)) k) • p.coeff (m + k.succ) := by
    rw [← Nat.cast_add_one, ← nsmul_eq_mul', smul_smul]
  _ = Nat.descFactorial (m.succ + k) k.succ • p.coeff (m + k.succ) := by
    rw [← Nat.succ_add, Nat.descFactorial_succ, add_tsub_cancel_right]
  _ = Nat.descFactorial (m + k.succ) k.succ • p.coeff (m + k.succ) := by
    rw [Nat.succ_add_eq_add_succ]
state_before: case succ
R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝ : Semiring R
p : R[X]
k : ℕ
ih : ∀ (m : ℕ), ((⇑derivative)^[k] p).coeff m = (m + k).descFactorial k • p.coeff (m + k)
m : ℕ
⊢ ((⇑derivative)^[k + 1] p).coeff m = (m + (k + 1)).descFactorial (k + 1) • p.coeff (m + (k + 1))
state_after: no goals

tactic: rw [Function.iterate_succ_apply', coeff_derivative, ih m.succ, Nat.succ_add, Nat.add_succ]
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝ : Semiring R
p : R[X]
k : ℕ
ih : ∀ (m : ℕ), ((⇑derivative)^[k] p).coeff m = (m + k).descFactorial k • p.coeff (m + k)
m : ℕ
⊢ ((⇑derivative)^[k + 1] p).coeff m = (m + k).succ.descFactorial k • p.coeff (m + k.succ) * (↑m + 1)
state_after: no goals

tactic: rw [← Nat.cast_add_one, ← nsmul_eq_mul', smul_smul]
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝ : Semiring R
p : R[X]
k : ℕ
ih : ∀ (m : ℕ), ((⇑derivative)^[k] p).coeff m = (m + k).descFactorial k • p.coeff (m + k)
m : ℕ
⊢ (m + k).succ.descFactorial k • p.coeff (m + k.succ) * (↑m + 1) =
    ((m + 1) * (m + k).succ.descFactorial k) • p.coeff (m + k.succ)
state_after: no goals

tactic: rw [← Nat.succ_add, Nat.descFactorial_succ, add_tsub_cancel_right]
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝ : Semiring R
p : R[X]
k : ℕ
ih : ∀ (m : ℕ), ((⇑derivative)^[k] p).coeff m = (m + k).descFactorial k • p.coeff (m + k)
m : ℕ
⊢ ((m + 1) * (m + k).succ.descFactorial k) • p.coeff (m + k.succ) =
    (m.succ + k).descFactorial k.succ • p.coeff (m + k.succ)
state_after: no goals

tactic: rw [Nat.succ_add_eq_add_succ]
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝ : Semiring R
p : R[X]
k : ℕ
ih : ∀ (m : ℕ), ((⇑derivative)^[k] p).coeff m = (m + k).descFactorial k • p.coeff (m + k)
m : ℕ
⊢ (m.succ + k).descFactorial k.succ • p.coeff (m + k.succ) = (m + k.succ).descFactorial k.succ • p.coeff (m + k.succ)
state_after: no goals