The derivative map on polynomials #
Main definitions #
Polynomial.derivative
: The formal derivative of polynomials, expressed as a linear map.Polynomial.derivativeFinsupp
: Iterated derivatives as a finite support function.
derivative p
is the formal derivative of the polynomial p
Equations
- Polynomial.derivative = { toFun := fun (p : Polynomial R) => p.sum fun (n : ℕ) (a : R) => Polynomial.C (a * ↑n) * Polynomial.X ^ (n - 1), map_add' := ⋯, map_smul' := ⋯ }
Instances For
@[simp]
theorem
Polynomial.iterate_derivative_zero
{R : Type u}
[Semiring R]
{k : ℕ}
:
(⇑Polynomial.derivative)^[k] 0 = 0
@[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
{R : Type u}
[Semiring R]
(a : R)
:
Polynomial.derivative (Polynomial.C a * Polynomial.X) = Polynomial.C a
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)
theorem
Polynomial.derivative_X_sq
{R : Type u}
[Semiring R]
:
Polynomial.derivative (Polynomial.X ^ 2) = Polynomial.C 2 * Polynomial.X
@[simp]
theorem
Polynomial.derivative_C
{R : Type u}
[Semiring R]
{a : R}
:
Polynomial.derivative (Polynomial.C a) = 0
theorem
Polynomial.derivative_of_natDegree_zero
{R : Type u}
[Semiring R]
{p : Polynomial R}
(hp : p.natDegree = 0)
:
Polynomial.derivative p = 0
@[simp]
@[simp]
@[simp]
theorem
Polynomial.derivative_X_add_C
{R : Type u}
[Semiring R]
(c : R)
:
Polynomial.derivative (Polynomial.X + Polynomial.C c) = 1
theorem
Polynomial.derivative_sum
{R : Type u}
{ι : Type y}
[Semiring R]
{s : Finset ι}
{f : ι → Polynomial R}
:
Polynomial.derivative (∑ b ∈ s, f b) = ∑ b ∈ s, Polynomial.derivative (f b)
theorem
Polynomial.iterate_derivative_sum
{R : Type u}
{ι : Type y}
[Semiring R]
(k : ℕ)
(s : Finset ι)
(f : ι → Polynomial R)
:
(⇑Polynomial.derivative)^[k] (∑ b ∈ s, f b) = ∑ b ∈ s, (⇑Polynomial.derivative)^[k] (f b)
theorem
Polynomial.derivative_smul
{R : Type u}
[Semiring R]
{S : Type u_1}
[Monoid S]
[DistribMulAction S R]
[IsScalarTower S R R]
(s : S)
(p : Polynomial R)
:
@[simp]
theorem
Polynomial.iterate_derivative_smul
{R : Type u}
[Semiring R]
{S : Type u_1}
[Monoid S]
[DistribMulAction S R]
[IsScalarTower S R R]
(s : S)
(p : Polynomial R)
(k : ℕ)
:
(⇑Polynomial.derivative)^[k] (s • p) = s • (⇑Polynomial.derivative)^[k] p
@[simp]
theorem
Polynomial.iterate_derivative_C_mul
{R : Type u}
[Semiring R]
(a : R)
(p : Polynomial R)
(k : ℕ)
:
(⇑Polynomial.derivative)^[k] (Polynomial.C a * p) = Polynomial.C a * (⇑Polynomial.derivative)^[k] p
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.natDegree_derivative_lt
{R : Type u}
[Semiring R]
{p : Polynomial R}
(hp : p.natDegree ≠ 0)
:
(Polynomial.derivative p).natDegree < p.natDegree
theorem
Polynomial.natDegree_iterate_derivative
{R : Type u}
[Semiring R]
(p : Polynomial R)
(k : ℕ)
:
((⇑Polynomial.derivative)^[k] p).natDegree ≤ p.natDegree - k
@[deprecated Polynomial.derivative_natCast (since := "2024-04-17")]
theorem
Polynomial.derivative_nat_cast
{R : Type u}
[Semiring R]
{n : ℕ}
:
Polynomial.derivative ↑n = 0
Alias of Polynomial.derivative_natCast
.
@[simp]
theorem
Polynomial.derivative_ofNat
{R : Type u}
[Semiring R]
(n : ℕ)
[n.AtLeastTwo]
:
Polynomial.derivative (OfNat.ofNat n) = 0
theorem
Polynomial.iterate_derivative_eq_zero
{R : Type u}
[Semiring R]
{p : Polynomial R}
{x : ℕ}
(hx : p.natDegree < x)
:
(⇑Polynomial.derivative)^[x] p = 0
@[simp]
theorem
Polynomial.iterate_derivative_C
{R : Type u}
{a : R}
[Semiring R]
{k : ℕ}
(h : 0 < k)
:
(⇑Polynomial.derivative)^[k] (Polynomial.C a) = 0
@[simp]
theorem
Polynomial.iterate_derivative_one
{R : Type u}
[Semiring R]
{k : ℕ}
(h : 0 < k)
:
(⇑Polynomial.derivative)^[k] 1 = 0
@[simp]
theorem
Polynomial.natDegree_eq_zero_of_derivative_eq_zero
{R : Type u}
[Semiring R]
[NoZeroSMulDivisors ℕ R]
{f : Polynomial R}
(h : Polynomial.derivative f = 0)
:
f.natDegree = 0
theorem
Polynomial.eq_C_of_derivative_eq_zero
{R : Type u}
[Semiring R]
[NoZeroSMulDivisors ℕ R]
{f : Polynomial R}
(h : Polynomial.derivative f = 0)
:
f = Polynomial.C (f.coeff 0)
@[simp]
@[simp]
theorem
Polynomial.derivative_map
{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
(p : Polynomial R)
(f : R →+* S)
:
Polynomial.derivative (Polynomial.map f p) = Polynomial.map f (Polynomial.derivative p)
@[simp]
theorem
Polynomial.iterate_derivative_map
{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
(p : Polynomial R)
(f : R →+* S)
(k : ℕ)
:
(⇑Polynomial.derivative)^[k] (Polynomial.map f p) = Polynomial.map f ((⇑Polynomial.derivative)^[k] p)
@[deprecated Polynomial.derivative_natCast_mul (since := "2024-04-17")]
Alias of Polynomial.derivative_natCast_mul
.
@[simp]
theorem
Polynomial.iterate_derivative_natCast_mul
{R : Type u}
[Semiring R]
{n k : ℕ}
{f : Polynomial R}
:
(⇑Polynomial.derivative)^[k] (↑n * f) = ↑n * (⇑Polynomial.derivative)^[k] f
@[deprecated Polynomial.iterate_derivative_natCast_mul (since := "2024-04-17")]
theorem
Polynomial.iterate_derivative_nat_cast_mul
{R : Type u}
[Semiring R]
{n k : ℕ}
{f : Polynomial R}
:
(⇑Polynomial.derivative)^[k] (↑n * f) = ↑n * (⇑Polynomial.derivative)^[k] f
theorem
Polynomial.mem_support_derivative
{R : Type u}
[Semiring R]
[NoZeroSMulDivisors ℕ R]
(p : Polynomial R)
(n : ℕ)
:
@[simp]
theorem
Polynomial.degree_derivative_eq
{R : Type u}
[Semiring R]
[NoZeroSMulDivisors ℕ R]
(p : Polynomial R)
(hp : 0 < p.natDegree)
:
theorem
Polynomial.coeff_iterate_derivative
{R : Type u}
[Semiring R]
{k : ℕ}
(p : Polynomial R)
(m : ℕ)
:
theorem
Polynomial.iterate_derivative_eq_sum
{R : Type u}
[Semiring R]
(p : Polynomial R)
(k : ℕ)
:
(⇑Polynomial.derivative)^[k] p = ∑ x ∈ ((⇑Polynomial.derivative)^[k] p).support,
Polynomial.C ((x + k).descFactorial k • p.coeff (x + k)) * Polynomial.X ^ x
theorem
Polynomial.iterate_derivative_eq_factorial_smul_sum
{R : Type u}
[Semiring R]
(p : Polynomial R)
(k : ℕ)
:
(⇑Polynomial.derivative)^[k] p = k.factorial • ∑ x ∈ ((⇑Polynomial.derivative)^[k] p).support, Polynomial.C ((x + k).choose k • p.coeff (x + k)) * Polynomial.X ^ x
theorem
Polynomial.iterate_derivative_mul
{R : Type u}
[Semiring R]
{n : ℕ}
(p q : Polynomial R)
:
(⇑Polynomial.derivative)^[n] (p * q) = ∑ k ∈ Finset.range n.succ, n.choose k • ((⇑Polynomial.derivative)^[n - k] p * (⇑Polynomial.derivative)^[k] q)
noncomputable def
Polynomial.derivativeFinsupp
{R : Type u}
[Semiring R]
:
Polynomial R →ₗ[R] ℕ →₀ Polynomial R
Iterated derivatives as a finite support function.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem
Polynomial.derivativeFinsupp_apply_toFun
{R : Type u}
[Semiring R]
(p : Polynomial R)
(x✝ : ℕ)
:
(Polynomial.derivativeFinsupp p) x✝ = (⇑Polynomial.derivative)^[x✝] p
@[simp]
theorem
Polynomial.support_derivativeFinsupp_subset_range
{R : Type u}
[Semiring R]
{p : Polynomial R}
{n : ℕ}
(h : p.natDegree < n)
:
(Polynomial.derivativeFinsupp p).support ⊆ Finset.range n
@[simp]
theorem
Polynomial.derivativeFinsupp_C
{R : Type u}
[Semiring R]
(r : R)
:
Polynomial.derivativeFinsupp (Polynomial.C r) = Finsupp.single 0 (Polynomial.C r)
@[simp]
theorem
Polynomial.derivativeFinsupp_one
{R : Type u}
[Semiring R]
:
Polynomial.derivativeFinsupp 1 = Finsupp.single 0 1
@[simp]
theorem
Polynomial.derivativeFinsupp_X
{R : Type u}
[Semiring R]
:
Polynomial.derivativeFinsupp Polynomial.X = Finsupp.single 0 Polynomial.X + Finsupp.single 1 1
theorem
Polynomial.derivativeFinsupp_map
{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
(p : Polynomial R)
(f : R →+* S)
:
Polynomial.derivativeFinsupp (Polynomial.map f p) = Finsupp.mapRange (fun (x : Polynomial R) => Polynomial.map f x) ⋯ (Polynomial.derivativeFinsupp p)
theorem
Polynomial.derivativeFinsupp_derivative
{R : Type u}
[Semiring R]
(p : Polynomial R)
:
Polynomial.derivativeFinsupp (Polynomial.derivative p) = Finsupp.comapDomain Nat.succ (Polynomial.derivativeFinsupp p) ⋯
theorem
Polynomial.pow_sub_one_dvd_derivative_of_pow_dvd
{R : Type u}
[CommSemiring R]
{p q : Polynomial R}
{n : ℕ}
(dvd : q ^ n ∣ p)
:
theorem
Polynomial.pow_sub_dvd_iterate_derivative_of_pow_dvd
{R : Type u}
[CommSemiring R]
{p q : Polynomial R}
{n : ℕ}
(m : ℕ)
(dvd : q ^ n ∣ p)
:
theorem
Polynomial.pow_sub_dvd_iterate_derivative_pow
{R : Type u}
[CommSemiring R]
(p : Polynomial R)
(n m : ℕ)
:
theorem
Polynomial.dvd_iterate_derivative_pow
{R : Type u}
[CommSemiring 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_natCast_mul
{R : Type u}
[CommSemiring R]
(n k : ℕ)
:
(⇑Polynomial.derivative)^[k] (Polynomial.X ^ n) = ↑(n.descFactorial k) * Polynomial.X ^ (n - k)
@[deprecated Polynomial.iterate_derivative_X_pow_eq_natCast_mul (since := "2024-04-17")]
theorem
Polynomial.iterate_derivative_X_pow_eq_nat_cast_mul
{R : Type u}
[CommSemiring R]
(n k : ℕ)
:
(⇑Polynomial.derivative)^[k] (Polynomial.X ^ n) = ↑(n.descFactorial k) * Polynomial.X ^ (n - k)
Alias of Polynomial.iterate_derivative_X_pow_eq_natCast_mul
.
theorem
Polynomial.iterate_derivative_X_pow_eq_C_mul
{R : Type u}
[CommSemiring R]
(n k : ℕ)
:
(⇑Polynomial.derivative)^[k] (Polynomial.X ^ n) = Polynomial.C ↑(n.descFactorial k) * Polynomial.X ^ (n - k)
theorem
Polynomial.iterate_derivative_X_pow_eq_smul
{R : Type u}
[CommSemiring R]
(n k : ℕ)
:
(⇑Polynomial.derivative)^[k] (Polynomial.X ^ n) = ↑(n.descFactorial k) • Polynomial.X ^ (n - k)
theorem
Polynomial.derivative_X_add_C_pow
{R : Type u}
[CommSemiring 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}
[CommSemiring 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}
[CommSemiring R]
(n k : ℕ)
(c : R)
:
(⇑Polynomial.derivative)^[k] ((Polynomial.X + Polynomial.C c) ^ n) = n.descFactorial k • (Polynomial.X + Polynomial.C c) ^ (n - k)
theorem
Polynomial.derivative_eval₂_C
{R : Type u}
[CommSemiring R]
(p q : Polynomial R)
:
Polynomial.derivative (Polynomial.eval₂ Polynomial.C q p) = Polynomial.eval₂ Polynomial.C q (Polynomial.derivative p) * Polynomial.derivative q
Chain rule for formal derivative of polynomials.
theorem
Polynomial.derivative_prod
{R : Type u}
{ι : Type y}
[CommSemiring R]
[DecidableEq ι]
{s : Multiset ι}
{f : ι → Polynomial R}
:
Polynomial.derivative (Multiset.map f s).prod = (Multiset.map (fun (i : ι) => (Multiset.map f (s.erase i)).prod * Polynomial.derivative (f i)) s).sum
@[simp]
theorem
Polynomial.iterate_derivative_neg
{R : Type u}
[Ring R]
{f : Polynomial R}
{k : ℕ}
:
(⇑Polynomial.derivative)^[k] (-f) = -(⇑Polynomial.derivative)^[k] f
@[simp]
theorem
Polynomial.derivative_X_sub_C
{R : Type u}
[Ring R]
(c : R)
:
Polynomial.derivative (Polynomial.X - Polynomial.C c) = 1
theorem
Polynomial.iterate_derivative_sub
{R : Type u}
[Ring R]
{k : ℕ}
{f g : Polynomial R}
:
(⇑Polynomial.derivative)^[k] (f - g) = (⇑Polynomial.derivative)^[k] f - (⇑Polynomial.derivative)^[k] g
@[deprecated Polynomial.derivative_intCast (since := "2024-04-17")]
Alias of Polynomial.derivative_intCast
.
@[deprecated Polynomial.derivative_intCast_mul (since := "2024-04-17")]
Alias of Polynomial.derivative_intCast_mul
.
@[simp]
theorem
Polynomial.iterate_derivative_intCast_mul
{R : Type u}
[Ring R]
{n : ℤ}
{k : ℕ}
{f : Polynomial R}
:
(⇑Polynomial.derivative)^[k] (↑n * f) = ↑n * (⇑Polynomial.derivative)^[k] f
@[deprecated Polynomial.iterate_derivative_intCast_mul (since := "2024-04-17")]
theorem
Polynomial.iterate_derivative_int_cast_mul
{R : Type u}
[Ring R]
{n : ℤ}
{k : ℕ}
{f : Polynomial R}
:
(⇑Polynomial.derivative)^[k] (↑n * f) = ↑n * (⇑Polynomial.derivative)^[k] f
theorem
Polynomial.derivative_comp_one_sub_X
{R : Type u}
[CommRing 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}
[CommRing 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}
[CommRing R]
[DecidableEq R]
{S : Multiset R}
{r : R}
(hr : r ∈ S)
:
Polynomial.eval r (Polynomial.derivative (Multiset.map (fun (a : R) => Polynomial.X - Polynomial.C a) S).prod) = (Multiset.map (fun (a : R) => r - a) (S.erase r)).prod
theorem
Polynomial.derivative_X_sub_C_pow
{R : Type u}
[CommRing 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}
[CommRing 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}
[CommRing R]
(n k : ℕ)
(c : R)
:
(⇑Polynomial.derivative)^[k] ((Polynomial.X - Polynomial.C c) ^ n) = n.descFactorial k • (Polynomial.X - Polynomial.C c) ^ (n - k)
theorem
Polynomial.iterate_derivative_X_sub_pow_self
{R : Type u}
[CommRing R]
(n : ℕ)
(c : R)
:
(⇑Polynomial.derivative)^[n] ((Polynomial.X - Polynomial.C c) ^ n) = ↑n.factorial
@[simp]
theorem
Polynomial.dvd_derivative_iff
{R : Type u}
[Semiring R]
[NoZeroDivisors R]
{P : Polynomial R}
:
theorem
Polynomial.derivative_pow_eq_zero
{R : Type u}
[CommSemiring R]
[NoZeroDivisors R]
{n : ℕ}
(chn : ↑n ≠ 0)
{a : Polynomial R}
: