The derivative map on polynomials #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
Main definitions #
polynomial.derivative
: The formal derivative of polynomials, expressed as a linear map.
derivative p
is the formal derivative of the polynomial p
Equations
- polynomial.derivative = {to_fun := λ (p : polynomial R), p.sum (λ (n : ℕ) (a : R), ⇑polynomial.C (a * ↑n) * polynomial.X ^ (n - 1)), map_add' := _, map_smul' := _}
theorem
polynomial.derivative_apply
{R : Type u}
[semiring R]
(p : polynomial R) :
⇑polynomial.derivative p = p.sum (λ (n : ℕ) (a : R), ⇑polynomial.C (a * ↑n) * polynomial.X ^ (n - 1))
@[simp]
@[simp]
@[simp]
theorem
polynomial.derivative_monomial
{R : Type u}
[semiring R]
(a : R)
(n : ℕ) :
⇑polynomial.derivative (⇑(polynomial.monomial n) a) = ⇑(polynomial.monomial (n - 1)) (a * ↑n)
theorem
polynomial.derivative_C_mul_X_pow
{R : Type u}
[semiring R]
(a : R)
(n : ℕ) :
⇑polynomial.derivative (⇑polynomial.C a * polynomial.X ^ n) = ⇑polynomial.C (a * ↑n) * polynomial.X ^ (n - 1)
theorem
polynomial.derivative_C_mul_X_sq
{R : Type u}
[semiring R]
(a : R) :
⇑polynomial.derivative (⇑polynomial.C a * polynomial.X ^ 2) = ⇑polynomial.C (a * 2) * polynomial.X
@[simp]
theorem
polynomial.derivative_X_pow
{R : Type u}
[semiring R]
(n : ℕ) :
⇑polynomial.derivative (polynomial.X ^ n) = ⇑polynomial.C ↑n * polynomial.X ^ (n - 1)
@[simp]
@[simp]
theorem
polynomial.derivative_of_nat_degree_zero
{R : Type u}
[semiring R]
{p : polynomial R}
(hp : p.nat_degree = 0) :
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
polynomial.derivative_sum
{R : Type u}
{ι : Type y}
[semiring R]
{s : finset ι}
{f : ι → polynomial R} :
⇑polynomial.derivative (s.sum (λ (b : ι), f b)) = s.sum (λ (b : ι), ⇑polynomial.derivative (f b))
@[simp]
theorem
polynomial.derivative_smul
{R : Type u}
[semiring R]
{S : Type u_1}
[monoid S]
[distrib_mul_action S R]
[is_scalar_tower S R R]
(s : S)
(p : polynomial R) :
⇑polynomial.derivative (s • p) = s • ⇑polynomial.derivative p
@[simp]
theorem
polynomial.iterate_derivative_smul
{R : Type u}
[semiring R]
{S : Type u_1}
[monoid S]
[distrib_mul_action S R]
[is_scalar_tower S R R]
(s : S)
(p : polynomial R)
(k : ℕ) :
@[simp]
theorem
polynomial.iterate_derivative_C_mul
{R : Type u}
[semiring R]
(a : R)
(p : polynomial R)
(k : ℕ) :
theorem
polynomial.of_mem_support_derivative
{R : Type u}
[semiring R]
{p : polynomial R}
{n : ℕ}
(h : n ∈ (⇑polynomial.derivative p).support) :
theorem
polynomial.degree_derivative_lt
{R : Type u}
[semiring R]
{p : polynomial R}
(hp : p ≠ 0) :
(⇑polynomial.derivative p).degree < p.degree
theorem
polynomial.degree_derivative_le
{R : Type u}
[semiring R]
{p : polynomial R} :
(⇑polynomial.derivative p).degree ≤ p.degree
theorem
polynomial.nat_degree_derivative_lt
{R : Type u}
[semiring R]
{p : polynomial R}
(hp : p.nat_degree ≠ 0) :
theorem
polynomial.nat_degree_derivative_le
{R : Type u}
[semiring R]
(p : polynomial R) :
(⇑polynomial.derivative p).nat_degree ≤ p.nat_degree - 1
@[simp]
theorem
polynomial.iterate_derivative_eq_zero
{R : Type u}
[semiring R]
{p : polynomial R}
{x : ℕ}
(hx : p.nat_degree < x) :
@[simp]
@[simp]
theorem
polynomial.nat_degree_eq_zero_of_derivative_eq_zero
{R : Type u}
[semiring R]
[no_zero_smul_divisors ℕ R]
{f : polynomial R}
(h : ⇑polynomial.derivative f = 0) :
f.nat_degree = 0
theorem
polynomial.eq_C_of_derivative_eq_zero
{R : Type u}
[semiring R]
[no_zero_smul_divisors ℕ R]
{f : polynomial R}
(h : ⇑polynomial.derivative f = 0) :
f = ⇑polynomial.C (f.coeff 0)
@[simp]
theorem
polynomial.derivative_mul
{R : Type u}
[semiring R]
{f g : polynomial R} :
⇑polynomial.derivative (f * g) = ⇑polynomial.derivative f * g + f * ⇑polynomial.derivative g
@[simp]
theorem
polynomial.derivative_map
{R : Type u}
{S : Type v}
[semiring R]
[semiring S]
(p : polynomial R)
(f : R →+* S) :
@[simp]
theorem
polynomial.iterate_derivative_map
{R : Type u}
{S : Type v}
[semiring R]
[semiring S]
(p : polynomial R)
(f : R →+* S)
(k : ℕ) :
theorem
polynomial.derivative_nat_cast_mul
{R : Type u}
[semiring R]
{n : ℕ}
{f : polynomial R} :
⇑polynomial.derivative (↑n * f) = ↑n * ⇑polynomial.derivative f
@[simp]
theorem
polynomial.iterate_derivative_nat_cast_mul
{R : Type u}
[semiring R]
{n k : ℕ}
{f : polynomial R} :
theorem
polynomial.mem_support_derivative
{R : Type u}
[semiring R]
[no_zero_smul_divisors ℕ R]
(p : polynomial R)
(n : ℕ) :
@[simp]
theorem
polynomial.degree_derivative_eq
{R : Type u}
[semiring R]
[no_zero_smul_divisors ℕ R]
(p : polynomial R)
(hp : 0 < p.nat_degree) :
(⇑polynomial.derivative p).degree = ↑(p.nat_degree - 1)
theorem
polynomial.derivative_pow_succ
{R : Type u}
[comm_semiring R]
(p : polynomial R)
(n : ℕ) :
⇑polynomial.derivative (p ^ (n + 1)) = ⇑polynomial.C ↑(n + 1) * p ^ n * ⇑polynomial.derivative p
theorem
polynomial.derivative_pow
{R : Type u}
[comm_semiring R]
(p : polynomial R)
(n : ℕ) :
⇑polynomial.derivative (p ^ n) = ⇑polynomial.C ↑n * p ^ (n - 1) * ⇑polynomial.derivative p
theorem
polynomial.derivative_sq
{R : Type u}
[comm_semiring R]
(p : polynomial R) :
⇑polynomial.derivative (p ^ 2) = ⇑polynomial.C 2 * p * ⇑polynomial.derivative p
theorem
polynomial.dvd_iterate_derivative_pow
{R : Type u}
[comm_semiring R]
(f : polynomial R)
(n : ℕ)
{m : ℕ}
(c : R)
(hm : m ≠ 0) :
↑n ∣ polynomial.eval c (⇑polynomial.derivative^[m] (f ^ n))
theorem
polynomial.iterate_derivative_X_pow_eq_nat_cast_mul
{R : Type u}
[comm_semiring R]
(n k : ℕ) :
⇑polynomial.derivative^[k] (polynomial.X ^ n) = ↑(n.desc_factorial k) * polynomial.X ^ (n - k)
theorem
polynomial.iterate_derivative_X_pow_eq_C_mul
{R : Type u}
[comm_semiring R]
(n k : ℕ) :
⇑polynomial.derivative^[k] (polynomial.X ^ n) = ⇑polynomial.C ↑(n.desc_factorial k) * polynomial.X ^ (n - k)
theorem
polynomial.iterate_derivative_X_pow_eq_smul
{R : Type u}
[comm_semiring R]
(n k : ℕ) :
⇑polynomial.derivative^[k] (polynomial.X ^ n) = ↑(n.desc_factorial k) • polynomial.X ^ (n - k)
theorem
polynomial.derivative_X_add_C_pow
{R : Type u}
[comm_semiring R]
(c : R)
(m : ℕ) :
⇑polynomial.derivative ((polynomial.X + ⇑polynomial.C c) ^ m) = ⇑polynomial.C ↑m * (polynomial.X + ⇑polynomial.C c) ^ (m - 1)
theorem
polynomial.derivative_X_add_C_sq
{R : Type u}
[comm_semiring R]
(c : R) :
⇑polynomial.derivative ((polynomial.X + ⇑polynomial.C c) ^ 2) = ⇑polynomial.C 2 * (polynomial.X + ⇑polynomial.C c)
theorem
polynomial.iterate_derivative_X_add_pow
{R : Type u}
[comm_semiring R]
(n k : ℕ)
(c : R) :
⇑polynomial.derivative^[k] ((polynomial.X + ⇑polynomial.C c) ^ n) = ↑((finset.range k).prod (λ (i : ℕ), n - i)) * (polynomial.X + ⇑polynomial.C c) ^ (n - k)
theorem
polynomial.derivative_comp
{R : Type u}
[comm_semiring R]
(p q : polynomial R) :
⇑polynomial.derivative (p.comp q) = ⇑polynomial.derivative q * (⇑polynomial.derivative p).comp q
Chain rule for formal derivative of polynomials.
theorem
polynomial.derivative_prod
{R : Type u}
{ι : Type y}
[comm_semiring R]
{s : multiset ι}
{f : ι → polynomial R} :
⇑polynomial.derivative (multiset.map f s).prod = (multiset.map (λ (i : ι), (multiset.map f (s.erase i)).prod * ⇑polynomial.derivative (f i)) s).sum
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
polynomial.derivative_int_cast_mul
{R : Type u}
[ring R]
{n : ℤ}
{f : polynomial R} :
⇑polynomial.derivative (↑n * f) = ↑n * ⇑polynomial.derivative f
@[simp]
theorem
polynomial.iterate_derivative_int_cast_mul
{R : Type u}
[ring R]
{n : ℤ}
{k : ℕ}
{f : polynomial R} :
theorem
polynomial.derivative_comp_one_sub_X
{R : Type u}
[comm_ring R]
(p : polynomial R) :
⇑polynomial.derivative (p.comp (1 - polynomial.X)) = -(⇑polynomial.derivative p).comp (1 - polynomial.X)
@[simp]
theorem
polynomial.iterate_derivative_comp_one_sub_X
{R : Type u}
[comm_ring R]
(p : polynomial R)
(k : ℕ) :
⇑polynomial.derivative^[k] (p.comp (1 - polynomial.X)) = (-1) ^ k * (⇑polynomial.derivative^[k] p).comp (1 - polynomial.X)
theorem
polynomial.eval_multiset_prod_X_sub_C_derivative
{R : Type u}
[comm_ring R]
{S : multiset R}
{r : R}
(hr : r ∈ S) :
polynomial.eval r (⇑polynomial.derivative (multiset.map (λ (a : R), polynomial.X - ⇑polynomial.C a) S).prod) = (multiset.map (λ (a : R), r - a) (S.erase r)).prod
theorem
polynomial.derivative_X_sub_C_pow
{R : Type u}
[comm_ring R]
(c : R)
(m : ℕ) :
⇑polynomial.derivative ((polynomial.X - ⇑polynomial.C c) ^ m) = ⇑polynomial.C ↑m * (polynomial.X - ⇑polynomial.C c) ^ (m - 1)
theorem
polynomial.derivative_X_sub_C_sq
{R : Type u}
[comm_ring R]
(c : R) :
⇑polynomial.derivative ((polynomial.X - ⇑polynomial.C c) ^ 2) = ⇑polynomial.C 2 * (polynomial.X - ⇑polynomial.C c)
theorem
polynomial.iterate_derivative_X_sub_pow
{R : Type u}
[comm_ring R]
(n k : ℕ)
(c : R) :
⇑polynomial.derivative^[k] ((polynomial.X - ⇑polynomial.C c) ^ n) = ↑((finset.range k).prod (λ (i : ℕ), n - i)) * (polynomial.X - ⇑polynomial.C c) ^ (n - k)