File: Mathlib/Algebra/Polynomial/Derivative.lean

full_name: Polynomial.derivative
code: /-- `derivative p` is the formal derivative of the polynomial `p` -/
def derivative : R[X] →ₗ[R] R[X] 
goal: R[X] →ₗ[R] R[X]

full_name: Polynomial.derivative_apply
code: theorem derivative_apply (p : R[X]) : derivative p = p.sum fun n a => C (a * n) * X ^ (n - 1) 
goal: Polynomial.derivative p = p.sum fun n a => Polynomial.C (a * ↑n) * Polynomial.X ^ (n - 1)

full_name: Polynomial.coeff_derivative
code: theorem coeff_derivative (p : R[X]) (n : ℕ) :
    coeff (derivative p) n = coeff p (n + 1) * (n + 1) 
goal: (Polynomial.derivative p).coeff n = p.coeff (n + 1) * (↑n + 1)

full_name: Polynomial.derivative_zero
code: theorem derivative_zero : derivative (0 : R[X]) = 0 
goal: Polynomial.derivative 0 = 0

full_name: Polynomial.iterate_derivative_zero
code: theorem iterate_derivative_zero {k : ℕ} : derivative^[k] (0 : R[X]) = 0 
goal: (⇑Polynomial.derivative)^[k] 0 = 0

full_name: Polynomial.derivative_monomial
code: @[simp]
theorem derivative_monomial (a : R) (n : ℕ) :
    derivative (monomial n a) = monomial (n - 1) (a * n) 
goal: Polynomial.derivative ((Polynomial.monomial n) a) = (Polynomial.monomial (n - 1)) (a * ↑n)

full_name: Polynomial.derivative_C_mul_X
code: theorem derivative_C_mul_X (a : R) : derivative (C a * X) = C a 
goal: Polynomial.derivative (Polynomial.C a * Polynomial.X) = Polynomial.C a

full_name: Polynomial.derivative_C_mul_X_pow
code: theorem derivative_C_mul_X_pow (a : R) (n : ℕ) :
    derivative (C a * X ^ n) = C (a * n) * X ^ (n - 1) 
goal: Polynomial.derivative (Polynomial.C a * Polynomial.X ^ n) = Polynomial.C (a * ↑n) * Polynomial.X ^ (n - 1)

full_name: Polynomial.derivative_C_mul_X_sq
code: theorem derivative_C_mul_X_sq (a : R) : derivative (C a * X ^ 2) = C (a * 2) * X 
goal: Polynomial.derivative (Polynomial.C a * Polynomial.X ^ 2) = Polynomial.C (a * 2) * Polynomial.X

full_name: Polynomial.derivative_X_pow
code: @[simp]
theorem derivative_X_pow (n : ℕ) : derivative (X ^ n : R[X]) = C (n : R) * X ^ (n - 1) 
goal: Polynomial.derivative (Polynomial.X ^ n) = Polynomial.C ↑n * Polynomial.X ^ (n - 1)

full_name: Polynomial.derivative_X_sq
code: theorem derivative_X_sq : derivative (X ^ 2 : R[X]) = C 2 * X 
goal: Polynomial.derivative (Polynomial.X ^ 2) = Polynomial.C 2 * Polynomial.X

full_name: Polynomial.derivative_C
code: @[simp]
theorem derivative_C {a : R} : derivative (C a) = 0 
goal: Polynomial.derivative (Polynomial.C a) = 0

full_name: Polynomial.derivative_of_natDegree_zero
code: theorem derivative_of_natDegree_zero {p : R[X]} (hp : p.natDegree = 0) : derivative p = 0 
goal: Polynomial.derivative p = 0

full_name: Polynomial.derivative_X
code: @[simp]
theorem derivative_X : derivative (X : R[X]) = 1 
goal: Polynomial.derivative Polynomial.X = 1

full_name: Polynomial.derivative_one
code: @[simp]
theorem derivative_one : derivative (1 : R[X]) = 0 
goal: Polynomial.derivative 1 = 0

full_name: Polynomial.derivative_add
code: theorem derivative_add {f g : R[X]} : derivative (f + g) = derivative f + derivative g 
goal: Polynomial.derivative (f + g) = Polynomial.derivative f + Polynomial.derivative g

full_name: Polynomial.derivative_X_add_C
code: theorem derivative_X_add_C (c : R) : derivative (X + C c) = 1 
goal: Polynomial.derivative (Polynomial.X + Polynomial.C c) = 1

full_name: Polynomial.derivative_sum
code: theorem derivative_sum {s : Finset ι} {f : ι → R[X]} :
    derivative (∑ b ∈ s, f b) = ∑ b ∈ s, derivative (f b) 
goal: Polynomial.derivative (∑ b ∈ s, f b) = ∑ b ∈ s, Polynomial.derivative (f b)

full_name: Polynomial.derivative_smul
code: theorem derivative_smul {S : Type*} [Monoid S] [DistribMulAction S R] [IsScalarTower S R R] (s : S)
    (p : R[X]) : derivative (s • p) = s • derivative p 
goal: Polynomial.derivative (s • p) = s • Polynomial.derivative p

full_name: Polynomial.iterate_derivative_smul
code: @[simp]
theorem iterate_derivative_smul {S : Type*} [Monoid S] [DistribMulAction S R] [IsScalarTower S R R]
    (s : S) (p : R[X]) (k : ℕ) : derivative^[k] (s • p) = s • derivative^[k] p 
goal: (⇑Polynomial.derivative)^[k] (s • p) = s • (⇑Polynomial.derivative)^[k] p

full_name: Polynomial.iterate_derivative_C_mul
code: @[simp]
theorem iterate_derivative_C_mul (a : R) (p : R[X]) (k : ℕ) :
    derivative^[k] (C a * p) = C a * derivative^[k] p 
goal: (⇑Polynomial.derivative)^[k] (Polynomial.C a * p) = Polynomial.C a * (⇑Polynomial.derivative)^[k] p

full_name: Polynomial.of_mem_support_derivative
code: theorem of_mem_support_derivative {p : R[X]} {n : ℕ} (h : n ∈ p.derivative.support) :
    n + 1 ∈ p.support 
goal: n + 1 ∈ p.support

full_name: Polynomial.degree_derivative_lt
code: theorem degree_derivative_lt {p : R[X]} (hp : p ≠ 0) : p.derivative.degree < p.degree 
goal: (Polynomial.derivative p).degree < p.degree

full_name: Polynomial.degree_derivative_le
code: theorem degree_derivative_le {p : R[X]} : p.derivative.degree ≤ p.degree 
goal: (Polynomial.derivative p).degree ≤ p.degree

full_name: Polynomial.natDegree_derivative_lt
code: theorem natDegree_derivative_lt {p : R[X]} (hp : p.natDegree ≠ 0) :
    p.derivative.natDegree < p.natDegree 
goal: (Polynomial.derivative p).natDegree < p.natDegree

full_name: Polynomial.natDegree_derivative_le
code: theorem natDegree_derivative_le (p : R[X]) : p.derivative.natDegree ≤ p.natDegree - 1 
goal: (Polynomial.derivative p).natDegree ≤ p.natDegree - 1

full_name: Polynomial.natDegree_iterate_derivative
code: theorem natDegree_iterate_derivative (p : R[X]) (k : ℕ) :
    (derivative^[k] p).natDegree ≤ p.natDegree - k 
goal: ((⇑Polynomial.derivative)^[k] p).natDegree ≤ p.natDegree - k

full_name: Polynomial.derivative_natCast
code: @[simp]
theorem derivative_natCast {n : ℕ} : derivative (n : R[X]) = 0 
goal: Polynomial.derivative ↑n = 0

full_name: Polynomial.derivative_ofNat
code: @[simp]
theorem derivative_ofNat (n : ℕ) [n.AtLeastTwo] :
    derivative (no_index (OfNat.ofNat n) : R[X]) = 0 
goal: Polynomial.derivative (OfNat.ofNat n) = 0

full_name: Polynomial.iterate_derivative_eq_zero
code: theorem iterate_derivative_eq_zero {p : R[X]} {x : ℕ} (hx : p.natDegree < x) :
    Polynomial.derivative^[x] p = 0 
goal: (⇑Polynomial.derivative)^[x] p = 0

full_name: Polynomial.iterate_derivative_C
code: @[simp]
theorem iterate_derivative_C {k} (h : 0 < k) : derivative^[k] (C a : R[X]) = 0 
goal: (⇑Polynomial.derivative)^[k] (Polynomial.C a) = 0

full_name: Polynomial.iterate_derivative_one
code: @[simp]
theorem iterate_derivative_one {k} (h : 0 < k) : derivative^[k] (1 : R[X]) = 0 
goal: (⇑Polynomial.derivative)^[k] 1 = 0

full_name: Polynomial.iterate_derivative_X
code: @[simp]
theorem iterate_derivative_X {k} (h : 1 < k) : derivative^[k] (X : R[X]) = 0 
goal: (⇑Polynomial.derivative)^[k] Polynomial.X = 0

full_name: Polynomial.natDegree_eq_zero_of_derivative_eq_zero
code: theorem natDegree_eq_zero_of_derivative_eq_zero [NoZeroSMulDivisors ℕ R] {f : R[X]}
    (h : derivative f = 0) : f.natDegree = 0 
goal: f.natDegree = 0

full_name: Polynomial.eq_C_of_derivative_eq_zero
code: theorem eq_C_of_derivative_eq_zero [NoZeroSMulDivisors ℕ R] {f : R[X]} (h : derivative f = 0) :
    f = C (f.coeff 0) 
goal: f = Polynomial.C (f.coeff 0)

full_name: Polynomial.derivative_mul
code: @[simp]
theorem derivative_mul {f g : R[X]} : derivative (f * g) = derivative f * g + f * derivative g 
goal: Polynomial.derivative (f * g) = Polynomial.derivative f * g + f * Polynomial.derivative g

full_name: Polynomial.derivative_eval
code: theorem derivative_eval (p : R[X]) (x : R) :
    p.derivative.eval x = p.sum fun n a => a * n * x ^ (n - 1) 
goal: Polynomial.eval x (Polynomial.derivative p) = p.sum fun n a => a * ↑n * x ^ (n - 1)

full_name: Polynomial.derivative_map
code: @[simp]
theorem derivative_map [Semiring S] (p : R[X]) (f : R →+* S) :
    derivative (p.map f) = p.derivative.map f 
goal: Polynomial.derivative (Polynomial.map f p) = Polynomial.map f (Polynomial.derivative p)

full_name: Polynomial.iterate_derivative_map
code: @[simp]
theorem iterate_derivative_map [Semiring S] (p : R[X]) (f : R →+* S) (k : ℕ) :
    Polynomial.derivative^[k] (p.map f) = (Polynomial.derivative^[k] p).map f 
goal: (⇑Polynomial.derivative)^[k] (Polynomial.map f p) = Polynomial.map f ((⇑Polynomial.derivative)^[k] p)

full_name: Polynomial.derivative_natCast_mul
code: theorem derivative_natCast_mul {n : ℕ} {f : R[X]} :
    derivative ((n : R[X]) * f) = n * derivative f 
goal: Polynomial.derivative (↑n * f) = ↑n * Polynomial.derivative f

full_name: Polynomial.iterate_derivative_natCast_mul
code: @[simp]
theorem iterate_derivative_natCast_mul {n k : ℕ} {f : R[X]} :
    derivative^[k] ((n : R[X]) * f) = n * derivative^[k] f 
goal: (⇑Polynomial.derivative)^[k] (↑n * f) = ↑n * (⇑Polynomial.derivative)^[k] f

full_name: Polynomial.mem_support_derivative
code: theorem mem_support_derivative [NoZeroSMulDivisors ℕ R] (p : R[X]) (n : ℕ) :
    n ∈ (derivative p).support ↔ n + 1 ∈ p.support 
goal: n ∈ (Polynomial.derivative p).support ↔ n + 1 ∈ p.support

full_name: Polynomial.degree_derivative_eq
code: @[simp]
theorem degree_derivative_eq [NoZeroSMulDivisors ℕ R] (p : R[X]) (hp : 0 < natDegree p) :
    degree (derivative p) = (natDegree p - 1 : ℕ) 
goal: (Polynomial.derivative p).degree = ↑(p.natDegree - 1)

full_name: Polynomial.coeff_iterate_derivative
code: theorem coeff_iterate_derivative {k} (p : R[X]) (m : ℕ) :
    (derivative^[k] p).coeff m = (m + k).descFactorial k • p.coeff (m + k) 
goal: ((⇑Polynomial.derivative)^[k] p).coeff m = (m + k).descFactorial k • p.coeff (m + k)

full_name: Polynomial.iterate_derivative_mul
code: theorem iterate_derivative_mul {n} (p q : R[X]) :
    derivative^[n] (p * q) =
      ∑ k ∈ range n.succ, (n.choose k • (derivative^[n - k] p * derivative^[k] q)) 
goal: (⇑Polynomial.derivative)^[n] (p * q) =
  ∑ k ∈ Finset.range n.succ, n.choose k • ((⇑Polynomial.derivative)^[n - k] p * (⇑Polynomial.derivative)^[k] q)

full_name: Polynomial.derivative_pow_succ
code: theorem derivative_pow_succ (p : R[X]) (n : ℕ) :
    derivative (p ^ (n + 1)) = C (n + 1 : R) * p ^ n * derivative p 
goal: Polynomial.derivative (p ^ (n + 1)) = Polynomial.C (↑n + 1) * p ^ n * Polynomial.derivative p

full_name: Polynomial.derivative_pow
code: theorem derivative_pow (p : R[X]) (n : ℕ) :
    derivative (p ^ n) = C (n : R) * p ^ (n - 1) * derivative p 
goal: Polynomial.derivative (p ^ n) = Polynomial.C ↑n * p ^ (n - 1) * Polynomial.derivative p

full_name: Polynomial.derivative_sq
code: theorem derivative_sq (p : R[X]) : derivative (p ^ 2) = C 2 * p * derivative p 
goal: Polynomial.derivative (p ^ 2) = Polynomial.C 2 * p * Polynomial.derivative p

full_name: Polynomial.pow_sub_one_dvd_derivative_of_pow_dvd
code: theorem pow_sub_one_dvd_derivative_of_pow_dvd {p q : R[X]} {n : ℕ}
    (dvd : q ^ n ∣ p) : q ^ (n - 1) ∣ derivative p 
goal: q ^ (n - 1) ∣ Polynomial.derivative p

full_name: Polynomial.pow_sub_dvd_iterate_derivative_of_pow_dvd
code: theorem pow_sub_dvd_iterate_derivative_of_pow_dvd {p q : R[X]} {n : ℕ} (m : ℕ)
    (dvd : q ^ n ∣ p) : q ^ (n - m) ∣ derivative^[m] p 
goal: q ^ (n - m) ∣ (⇑Polynomial.derivative)^[m] p

full_name: Polynomial.pow_sub_dvd_iterate_derivative_pow
code: theorem pow_sub_dvd_iterate_derivative_pow (p : R[X]) (n m : ℕ) :
    p ^ (n - m) ∣ derivative^[m] (p ^ n) 
goal: p ^ (n - m) ∣ (⇑Polynomial.derivative)^[m] (p ^ n)

full_name: Polynomial.dvd_iterate_derivative_pow
code: theorem dvd_iterate_derivative_pow (f : R[X]) (n : ℕ) {m : ℕ} (c : R) (hm : m ≠ 0) :
    (n : R) ∣ eval c (derivative^[m] (f ^ n)) 
goal: ↑n ∣ Polynomial.eval c ((⇑Polynomial.derivative)^[m] (f ^ n))

full_name: Polynomial.iterate_derivative_X_pow_eq_natCast_mul
code: theorem iterate_derivative_X_pow_eq_natCast_mul (n k : ℕ) :
    derivative^[k] (X ^ n : R[X]) = ↑(Nat.descFactorial n k : R[X]) * X ^ (n - k) 
goal: (⇑Polynomial.derivative)^[k] (Polynomial.X ^ n) = ↑(n.descFactorial k) * Polynomial.X ^ (n - k)

full_name: Polynomial.iterate_derivative_X_pow_eq_C_mul
code: theorem iterate_derivative_X_pow_eq_C_mul (n k : ℕ) :
    derivative^[k] (X ^ n : R[X]) = C (Nat.descFactorial n k : R) * X ^ (n - k) 
goal: (⇑Polynomial.derivative)^[k] (Polynomial.X ^ n) = Polynomial.C ↑(n.descFactorial k) * Polynomial.X ^ (n - k)

full_name: Polynomial.iterate_derivative_X_pow_eq_smul
code: theorem iterate_derivative_X_pow_eq_smul (n : ℕ) (k : ℕ) :
    derivative^[k] (X ^ n : R[X]) = (Nat.descFactorial n k : R) • X ^ (n - k) 
goal: (⇑Polynomial.derivative)^[k] (Polynomial.X ^ n) = ↑(n.descFactorial k) • Polynomial.X ^ (n - k)

full_name: Polynomial.derivative_X_add_C_pow
code: theorem derivative_X_add_C_pow (c : R) (m : ℕ) :
    derivative ((X + C c) ^ m) = C (m : R) * (X + C c) ^ (m - 1) 
goal: Polynomial.derivative ((Polynomial.X + Polynomial.C c) ^ m) =
  Polynomial.C ↑m * (Polynomial.X + Polynomial.C c) ^ (m - 1)

full_name: Polynomial.derivative_X_add_C_sq
code: theorem derivative_X_add_C_sq (c : R) : derivative ((X + C c) ^ 2) = C 2 * (X + C c) 
goal: Polynomial.derivative ((Polynomial.X + Polynomial.C c) ^ 2) = Polynomial.C 2 * (Polynomial.X + Polynomial.C c)

full_name: Polynomial.iterate_derivative_X_add_pow
code: theorem iterate_derivative_X_add_pow (n k : ℕ) (c : R) :
    derivative^[k] ((X + C c) ^ n) = Nat.descFactorial n k • (X + C c) ^ (n - k) 
goal: (⇑Polynomial.derivative)^[k] ((Polynomial.X + Polynomial.C c) ^ n) =
  n.descFactorial k • (Polynomial.X + Polynomial.C c) ^ (n - k)

full_name: Polynomial.derivative_comp
code: theorem derivative_comp (p q : R[X]) :
    derivative (p.comp q) = derivative q * p.derivative.comp q 
goal: Polynomial.derivative (p.comp q) = Polynomial.derivative q * (Polynomial.derivative p).comp q

full_name: Polynomial.derivative_eval₂_C
code: /-- Chain rule for formal derivative of polynomials. -/
theorem derivative_eval₂_C (p q : R[X]) :
    derivative (p.eval₂ C q) = p.derivative.eval₂ C q * derivative q 
goal: Polynomial.derivative (Polynomial.eval₂ Polynomial.C q p) =
  Polynomial.eval₂ Polynomial.C q (Polynomial.derivative p) * Polynomial.derivative q

full_name: Polynomial.derivative_prod
code: theorem derivative_prod [DecidableEq ι] {s : Multiset ι} {f : ι → R[X]} :
    derivative (Multiset.map f s).prod =
      (Multiset.map (fun i => (Multiset.map f (s.erase i)).prod * derivative (f i)) s).sum 
goal: Polynomial.derivative (Multiset.map f s).prod =
  (Multiset.map (fun i => (Multiset.map f (s.erase i)).prod * Polynomial.derivative (f i)) s).sum

full_name: Polynomial.derivative_neg
code: theorem derivative_neg (f : R[X]) : derivative (-f) = -derivative f 
goal: Polynomial.derivative (-f) = -Polynomial.derivative f

full_name: Polynomial.iterate_derivative_neg
code: theorem iterate_derivative_neg {f : R[X]} {k : ℕ} : derivative^[k] (-f) = -derivative^[k] f 
goal: (⇑Polynomial.derivative)^[k] (-f) = -(⇑Polynomial.derivative)^[k] f

full_name: Polynomial.derivative_sub
code: theorem derivative_sub {f g : R[X]} : derivative (f - g) = derivative f - derivative g 
goal: Polynomial.derivative (f - g) = Polynomial.derivative f - Polynomial.derivative g

full_name: Polynomial.derivative_X_sub_C
code: theorem derivative_X_sub_C (c : R) : derivative (X - C c) = 1 
goal: Polynomial.derivative (Polynomial.X - Polynomial.C c) = 1

full_name: Polynomial.iterate_derivative_sub
code: theorem iterate_derivative_sub {k : ℕ} {f g : R[X]} :
    derivative^[k] (f - g) = derivative^[k] f - derivative^[k] g 
goal: (⇑Polynomial.derivative)^[k] (f - g) = (⇑Polynomial.derivative)^[k] f - (⇑Polynomial.derivative)^[k] g

full_name: Polynomial.derivative_intCast
code: @[simp]
theorem derivative_intCast {n : ℤ} : derivative (n : R[X]) = 0 
goal: Polynomial.derivative ↑n = 0

full_name: Polynomial.derivative_intCast_mul
code: theorem derivative_intCast_mul {n : ℤ} {f : R[X]} : derivative ((n : R[X]) * f) =
    n * derivative f 
goal: Polynomial.derivative (↑n * f) = ↑n * Polynomial.derivative f

full_name: Polynomial.iterate_derivative_intCast_mul
code: @[simp]
theorem iterate_derivative_intCast_mul {n : ℤ} {k : ℕ} {f : R[X]} :
    derivative^[k] ((n : R[X]) * f) = n * derivative^[k] f 
goal: (⇑Polynomial.derivative)^[k] (↑n * f) = ↑n * (⇑Polynomial.derivative)^[k] f

full_name: Polynomial.derivative_comp_one_sub_X
code: theorem derivative_comp_one_sub_X (p : R[X]) :
    derivative (p.comp (1 - X)) = -p.derivative.comp (1 - X) 
goal: Polynomial.derivative (p.comp (1 - Polynomial.X)) = -(Polynomial.derivative p).comp (1 - Polynomial.X)

full_name: Polynomial.iterate_derivative_comp_one_sub_X
code: @[simp]
theorem iterate_derivative_comp_one_sub_X (p : R[X]) (k : ℕ) :
    derivative^[k] (p.comp (1 - X)) = (-1) ^ k * (derivative^[k] p).comp (1 - X) 
goal: (⇑Polynomial.derivative)^[k] (p.comp (1 - Polynomial.X)) =
  (-1) ^ k * ((⇑Polynomial.derivative)^[k] p).comp (1 - Polynomial.X)

full_name: Polynomial.eval_multiset_prod_X_sub_C_derivative
code: theorem eval_multiset_prod_X_sub_C_derivative [DecidableEq R]
    {S : Multiset R} {r : R} (hr : r ∈ S) :
    eval r (derivative (Multiset.map (fun a => X - C a) S).prod) =
      (Multiset.map (fun a => r - a) (S.erase r)).prod 
goal: Polynomial.eval r (Polynomial.derivative (Multiset.map (fun a => Polynomial.X - Polynomial.C a) S).prod) =
  (Multiset.map (fun a => r - a) (S.erase r)).prod

full_name: Polynomial.derivative_X_sub_C_pow
code: theorem derivative_X_sub_C_pow (c : R) (m : ℕ) :
    derivative ((X - C c) ^ m) = C (m : R) * (X - C c) ^ (m - 1) 
goal: Polynomial.derivative ((Polynomial.X - Polynomial.C c) ^ m) =
  Polynomial.C ↑m * (Polynomial.X - Polynomial.C c) ^ (m - 1)

full_name: Polynomial.derivative_X_sub_C_sq
code: theorem derivative_X_sub_C_sq (c : R) : derivative ((X - C c) ^ 2) = C 2 * (X - C c) 
goal: Polynomial.derivative ((Polynomial.X - Polynomial.C c) ^ 2) = Polynomial.C 2 * (Polynomial.X - Polynomial.C c)

full_name: Polynomial.iterate_derivative_X_sub_pow
code: theorem iterate_derivative_X_sub_pow (n k : ℕ) (c : R) :
    derivative^[k] ((X - C c) ^ n) = n.descFactorial k • (X - C c) ^ (n - k) 
goal: (⇑Polynomial.derivative)^[k] ((Polynomial.X - Polynomial.C c) ^ n) =
  n.descFactorial k • (Polynomial.X - Polynomial.C c) ^ (n - k)

full_name: Polynomial.iterate_derivative_X_sub_pow_self
code: theorem iterate_derivative_X_sub_pow_self (n : ℕ) (c : R) :
    derivative^[n] ((X - C c) ^ n) = n.factorial 
goal: (⇑Polynomial.derivative)^[n] ((Polynomial.X - Polynomial.C c) ^ n) = ↑n.factorial