Derivatives of Formal Power Series #
This file formalizes the theory of derivatives of formal power series (FPS) from
AlgebraicCombinatorics/tex/FPS/Derivatives.tex.
Main Results #
The derivative of a formal power series f = ∑ fₙ xⁿ is defined as f' = ∑ n · fₙ · x^(n-1).
Mathlib already provides PowerSeries.derivative as a derivation on R⟦X⟧. We document
the correspondence with the textbook theorems and provide any additional results.
Derivative Rules (Theorem thm.fps.deriv.rules) #
- (a)
(f + g)' = f' + g'—derivative_add - (b) Summable families:
(∑ fᵢ)' = ∑ fᵢ'—derivative_sum,derivative_summableFPSSum - (c)
(c · f)' = c · f'—derivative_smul,derivative_C_mul - (d)
(f · g)' = f' · g + f · g'—derivative_mul(Leibniz rule) - (e)
(f / g)' = (f' · g - f · g') / g²—derivative_div(quotient rule) - (f)
(g^n)' = n · g^(n-1) · g'—derivative_pow'(power rule) - (g)
(f ∘ g)' = (f' ∘ g) · g'—derivative_comp(chain rule) - (h) If
f' = g', thenf - gis constant —derivative_eq_imp_diff_const
References #
- Mathlib:
Mathlib.RingTheory.PowerSeries.Derivative - Source:
AlgebraicCombinatorics/tex/FPS/Derivatives.tex
Definition of Derivative #
The derivative of a formal power series is already defined in Mathlib as
PowerSeries.derivative : Derivation R R⟦X⟧ R⟦X⟧.
For f = ∑ fₙ xⁿ, we have f' = ∑ (n+1) · f_{n+1} · xⁿ, or equivalently,
the n-th coefficient of f' is (n+1) · f_{n+1}.
This matches Definition def.fps.deriv from the source.
Definition def.fps.deriv #
For f = ∑ fₙ xⁿ, the textbook defines f' := ∑_{n>0} n · fₙ · x^{n-1}.
Reindexing with m = n-1 (so n = m+1), this becomes:
f' = ∑_{m≥0} (m+1) · f_{m+1} · x^m
This is exactly PowerSeries.derivativeFun from Mathlib, which defines:
derivativeFun f := mk (fun n => coeff (n + 1) f * (n + 1))
The derivative is then packaged as a Derivation R R⟦X⟧ R⟦X⟧.
Definition def.fps.deriv: The n-th coefficient of the derivative of f equals (n+1) times the (n+1)-th coefficient of f.
This is PowerSeries.coeff_derivative in Mathlib.
Definition def.fps.deriv: The derivative expressed in terms of mk.
For f = ∑ fₙ xⁿ, the textbook defines f' := ∑_{n>0} n · fₙ · x^{n-1}.
Reindexing gives f' = mk (fun m => (m+1) * f_{m+1}).
The derivative operation is exactly derivativeFun from Mathlib.
Alternative characterization: the coefficient of xⁿ in f' is (n+1) · f_{n+1}. This is the "shift and multiply" form of the derivative.
The derivative of X^(n+1) is (n+1) * X^n. This is a convenient form for induction.
Derivative of X^n for n > 0.
Theorem thm.fps.deriv.rules: Derivative Rules #
We document the correspondence between the textbook theorems and Mathlib.
Part (a): Additivity #
(f + g)' = f' + g'
This is automatic since derivative is a Derivation, hence an additive map.
Theorem thm.fps.deriv.rules (a): Derivative is additive.
Derivative of negation: (-f)' = -f'.
Derivative of subtraction: (f - g)' = f' - g'.
Part (b): Summable Families #
If (fᵢ)_{i ∈ I} is a summable family of FPSs, then (∑ fᵢ)' = ∑ fᵢ'.
We first state it for finite sums (which follows from additivity), then for infinite summable families (where summability means that for each coefficient index, only finitely many family members have nonzero coefficient).
Theorem thm.fps.deriv.rules (b) (finite version): Derivative commutes with finite sums.
If (fᵢ) is a summable family, then (fᵢ') is also summable.
Theorem thm.fps.deriv.rules (b) (infinite version): Derivative commutes with infinite summable sums.
If (fᵢ){i ∈ I} is a summable family of FPSs, then (fᵢ'){i ∈ I} is summable and (∑ fᵢ)' = ∑ fᵢ'.
Part (c): Scalar Multiplication #
(c · f)' = c · f'
This is automatic since derivative is an R-linear map.
Theorem thm.fps.deriv.rules (c): Derivative commutes with scalar multiplication.
Variant with C c * f instead of c • f.
Part (d): Leibniz Rule (Product Rule) #
(f · g)' = f' · g + f · g'
This is the defining property of a derivation.
Theorem thm.fps.deriv.rules (d): Leibniz rule for power series.
Part (e): Quotient Rule #
(f / g)' = (f' · g - f · g') / g² for invertible g.
In Mathlib, this is expressed using PowerSeries.derivative_inv' for fields,
or PowerSeries.derivative_inv for units.
Theorem thm.fps.deriv.rules (e): Quotient rule for power series.
Note: In Mathlib, this is stated as (f⁻¹)' = -f⁻¹² · f'.
The full quotient rule follows from combining this with Leibniz.
Theorem thm.fps.deriv.rules (f): Power rule for power series.
Part (g): Chain Rule #
(f ∘ g)' = (f' ∘ g) · g' when composition is defined.
In Mathlib, composition is PowerSeries.subst, and this is PowerSeries.derivative_subst.
The condition for substitution is that g has nilpotent constant term (which includes
the case when [x⁰]g = 0).
Theorem thm.fps.deriv.rules (g): Chain rule for power series.
This holds when g has nilpotent constant coefficient (in particular when [x⁰]g = 0).
Part (h): Uniqueness of Antiderivatives #
If f' = g' and K is a ℚ-algebra, then f - g is constant.
In Mathlib, this is PowerSeries.derivative.ext (with the converse direction:
if derivatives and constant terms match, then the series are equal).
Theorem thm.fps.deriv.rules (h): Two power series with equal derivatives differ by a constant.
Note: Mathlib states this as: if f' = g' and f₀ = g₀, then f = g.
We state the equivalent: if f' = g', then f - g has zero derivative,
hence is constant (all higher coefficients are zero).
Equivalent formulation: if two power series have equal derivatives and equal
constant terms, they are equal. This is PowerSeries.derivative.ext in Mathlib.
Additional Results #
Some useful consequences and special cases.
Derivative of zero is zero.
Derivative of a constant is zero.
Derivative of X is 1.
Derivative of 1 is 0.
The derivative of a polynomial viewed as a power series equals the polynomial derivative viewed as a power series.