Formal Power Series: Definition and Basic Properties #
This file formalizes the definition of formal power series (FPS) and their basic operations, following Section "The definition of formal power series" (subsec.gf.defs.fps) of the source.
Main definitions #
fpsEquivSeq(Definition def.fps.fps): The equivalence between formal power seriesR⟦X⟧and sequencesℕ → R. This formalizes that an FPS is a sequence (a₀, a₁, a₂, ...).We use Mathlib's
PowerSeries Rwhich represents formal power series over a ringR. This is defined asMvPowerSeries Unit R, i.e., sequencesℕ → R.PowerSeries.coeff n fextracts the n-th coefficient of a power series f. This corresponds to[x^n] fin the source notation.PowerSeries.mkconstructs a power series from a sequence of coefficients.PowerSeries.Xis the indeterminate x = (0, 1, 0, 0, ...).PowerSeries.Cembeds constants into power series as (a, 0, 0, ...).
Main results #
PowerSeriesforms a commutative ring (Theorem thm.fps.ring (a))PowerSeriesis a module over the base ring (Theorem thm.fps.ring (b))- Scaling by λ equals multiplication by C λ (Theorem thm.fps.ring (d))
- Coefficient extraction is additive and compatible with multiplication
- Multiplication by x shifts coefficients: X * (a₀, a₁, ...) = (0, a₀, a₁, ...) (Lemma lem.fps.xa)
x^khas the form (0, 0, ..., 0, 1, 0, 0, ...) with k zeros (Proposition prop.fps.xk)- Any FPS can be written as ∑ aₙ xⁿ (Corollary cor.fps.sumakxk)
References #
- Source: FPSDefinition.tex, subsec.gf.defs.fps
Implementation notes #
Mathlib already provides PowerSeries R with all the ring structure and basic operations.
This file provides additional lemmas and connects Mathlib's API to the textbook presentation.
For summable families of FPS, we use Mathlib's topological structure on power series
(PowerSeries.WithPiTopology), where a family is summable when for each coefficient index,
all but finitely many terms have that coefficient equal to zero.
Definition of FPS (Definition def.fps.fps) #
Definition def.fps.fps: A formal power series (FPS) in one indeterminate over K is a sequence (a₀, a₁, a₂, ...) = (aₙ)_{n ∈ ℕ} ∈ K^ℕ of elements of K.
In Mathlib, this is represented by PowerSeries R (notation: R⟦X⟧).
The type PowerSeries R is defined as MvPowerSeries Unit R, which is
definitionally (Unit →₀ ℕ) → R. Since Unit →₀ ℕ is equivalent to ℕ,
this is essentially ℕ → R.
The constructor PowerSeries.mk : (ℕ → R) → R⟦X⟧ builds an FPS from a sequence.
The extractor PowerSeries.coeff n : R⟦X⟧ → R retrieves the n-th coefficient.
Definition def.fps.fps: The equivalence between formal power series R⟦X⟧
and sequences ℕ → R.
This formalizes Definition def.fps.fps from the source: a formal power series is a sequence (a₀, a₁, a₂, ...) of elements of R.
The forward direction extracts coefficients, the inverse constructs the FPS.
Equations
- AlgebraicCombinatorics.FPS.fpsEquivSeq = { toFun := fun (f : PowerSeries R) (n : ℕ) => (PowerSeries.coeff n) f, invFun := fun (a : ℕ → R) => PowerSeries.mk a, left_inv := ⋯, right_inv := ⋯ }
Instances For
The FPS (a₀, a₁, a₂, ...) is constructed from a sequence using PowerSeries.mk.
This is the inverse of coefficient extraction.
Extracting coefficients from an FPS gives back the original sequence (Definition def.fps.fps).
Any FPS equals the FPS constructed from its coefficient sequence (Definition def.fps.fps). This shows that every FPS is determined by its coefficients.
Two FPS are equal iff they have the same coefficients (Definition def.fps.fps). This is the extensionality principle for FPS.
The zero FPS is (0, 0, 0, ...)
Operations on FPS (Definition def.fps.ops) #
(a) Sum: (a₀ + b₀, a₁ + b₁, ...) (b) Difference: (a₀ - b₀, a₁ - b₁, ...) (c) Scalar multiplication: λa = (λa₀, λa₁, ...) (d) Product: c_n = ∑{i=0}^n a_i b{n-i} (e) Constants: a̲ = (a, 0, 0, ...)
(a) Sum of FPS is componentwise (eq. pf.thm.fps.ring.xn(a+b)=) Label: pf.thm.fps.ring.xn(a+b)=
(b) Difference of FPS is componentwise (eq. pf.thm.fps.ring.xn(a-b)=) Label: pf.thm.fps.ring.xn(a-b)=
Negation of FPS is componentwise (eq. pf.thm.fps.ring.xn(-a)=) Label: pf.thm.fps.ring.xn(-a)=
(c) Scalar multiplication (eq. pf.thm.fps.ring.xn(la)=) Label: pf.thm.fps.ring.xn(la)=
(d) Product of FPS uses convolution (eq. pf.thm.fps.ring.xn(ab)=2) Label: pf.thm.fps.ring.xn(ab)=2
Alternative form of product formula (eq. pf.thm.fps.ring.xn(ab)=3) Label: pf.thm.fps.ring.xn(ab)=3
(e) Constant FPS: C a = (a, 0, 0, ...)
The constant term of a product is the product of constant terms (eq. pf.thm.fps.ring.x0(ab)=) Label: pf.thm.fps.ring.x0(ab)=
Ring Structure (Theorem thm.fps.ring) #
Theorem thm.fps.ring states that R⟦X⟧ is: (a) A commutative ring with zero = (0,0,...) and one = (1,0,0,...) (b) An R-module (c) Scaling commutes with multiplication: λ(fg) = (λf)g = f(λg) (d) Scaling equals multiplication by constant: λf = (C λ) * f
Note: Mathlib already provides these structures on PowerSeries R:
CommRing R⟦X⟧instance exists inMathlib.RingTheory.PowerSeries.BasicModule R R⟦X⟧instance exists via the algebra structure
(c) Scaling commutes with multiplication (Theorem thm.fps.ring (c))
(d) Scaling equals multiplication by constant (Theorem thm.fps.ring (d))
Coefficient Extraction (Definition def.fps.coeff) #
[x^n] f denotes the n-th coefficient of f.
In Mathlib this is PowerSeries.coeff n f.
The Indeterminate x (Definition def.fps.x) #
x = (0, 1, 0, 0, ...) is the FPS with [x^1] x = 1 and [x^i] x = 0 for i ≠ 1.
x = (0, 1, 0, 0, ...) (Definition def.fps.x)
Multiplication by x (Lemma lem.fps.xa) #
Multiplying by x shifts the sequence: x * (a₀, a₁, a₂, ...) = (0, a₀, a₁, a₂, ...)
Lemma lem.fps.xa states: If f = (a₀, a₁, a₂, ...), then X * f = (0, a₀, a₁, a₂, ...). This is equivalent to:
Multiplying by x shifts coefficients: x^{n+1} = [x^n]f (Lemma lem.fps.xa)
Multiplying by x on the right shifts coefficients: x^{n+1} = [x^n]f
The constant term of X * f is 0 (Lemma lem.fps.xa, case n = 0)
The constant term of f * X is 0
Complete characterization of multiplication by X (Lemma lem.fps.xa, unified form)
If f = (a₀, a₁, a₂, ...), then X * f = (0, a₀, a₁, a₂, ...) This is equivalent to: x^n = if n = 0 then 0 else [x^{n-1}]f
Complete characterization of multiplication by X on the right (Lemma lem.fps.xa, variant)
If f = (a₀, a₁, a₂, ...), then f * X = (0, a₀, a₁, a₂, ...) This is equivalent to: x^n = if n = 0 then 0 else [x^{n-1}]f
X * f equals f with all coefficients shifted by one position (Lemma lem.fps.xa, equality form)
This directly expresses: X * (a₀, a₁, a₂, ...) = (0, a₀, a₁, a₂, ...)
f * X equals f with all coefficients shifted by one position (Lemma lem.fps.xa, equality form)
X^k * f shifts f by k positions (generalization of Lemma lem.fps.xa)
If f = (a₀, a₁, a₂, ...), then X^k * f = (0, ..., 0, a₀, a₁, a₂, ...) with k leading zeros.
f * X^k shifts f by k positions (generalization of Lemma lem.fps.xa)
Powers of x (Proposition prop.fps.xk) #
x^k = (0, 0, ..., 0, 1, 0, 0, ...) with k zeros before the 1.
x^k has 1 in position k and 0 elsewhere (Proposition prop.fps.xk)
FPS as Infinite Sum (Corollary cor.fps.sumakxk) #
Any FPS (a₀, a₁, a₂, ...) can be written as ∑_{n ∈ ℕ} aₙ x^n. This requires the notion of summable families of FPS.
The family (aₙ x^n)_{n ∈ ℕ} represents the FPS with coefficients (aₙ). This is essentially saying PowerSeries.mk a = ∑ a n * X^n (Corollary cor.fps.sumakxk)
aₙ x^n has coefficient aₙ in position n and 0 elsewhere
Summable Families of FPS (Definition def.fps.summable) #
A family (fᵢ)_{i ∈ I} of FPS is summable (or entrywise essentially finite) if for each n ∈ ℕ, all but finitely many i ∈ I satisfy [x^n] fᵢ = 0.
In this case, the sum ∑{i ∈ I} fᵢ is defined as the FPS with [x^n](∑{i ∈ I} fᵢ) = ∑_{i ∈ I} [x^n] fᵢ (an essentially finite sum).
In Mathlib, this is captured by the topology on power series where
convergence means eventual stability of each coefficient.
See PowerSeries.WithPiTopology for details.
A family of FPS is summable if for each coefficient index n, all but finitely many family members have that coefficient equal to zero. (Definition def.fps.summable)
Equations
- AlgebraicCombinatorics.FPS.SummableFPS f = ∀ (n : ℕ), {i : ι | (PowerSeries.coeff n) (f i) ≠ 0}.Finite
Instances For
The sum of a summable family of FPS. (Definition def.fps.summable, eq. eq.def.fps.summable.sum)
For a summable family (fᵢ){i ∈ I}, the sum ∑{i ∈ I} fᵢ is the FPS whose n-th coefficient is ∑_{i ∈ I} [x^n] fᵢ (an essentially finite sum).
Equations
- AlgebraicCombinatorics.FPS.summableFPSSum f _hf = PowerSeries.mk fun (n : ℕ) => ∑ᶠ (i : ι), (PowerSeries.coeff n) (f i)
Instances For
The n-th coefficient of a summable sum is the sum of n-th coefficients. (eq. eq.def.fps.summable.sum)
The sum of the coefficients is finite (since the family is summable).
Any subfamily of a summable family of FPS is summable. (Proposition prop.fps.summable.sub)
A finite family of FPS is always summable.
The zero family is summable.
A singleton family is summable.
Sum of two summable families is summable.
Negation of a summable family is summable.
Subtraction of two summable families is summable.
Scalar multiple of a summable family is summable.
The family (C(aₙ) * X^n){n ∈ ℕ} is summable for any sequence (aₙ). This is the canonical example showing that any FPS can be written as an infinite sum ∑{n ∈ ℕ} aₙ x^n.
Essentially Finite Sums (Definition def.infsum.essfin) #
A family (aᵢ)_{i ∈ I} of ring elements is essentially finite if all but finitely many i satisfy aᵢ = 0.
Note: This is equivalent to (Function.support f).Finite in Mathlib.
Part (a): Definition of essentially finite families #
A family (aᵢ)_{i ∈ I} ∈ K^I of elements of K is essentially finite if all but finitely many i ∈ I satisfy aᵢ = 0 (in other words, if the set {i ∈ I | aᵢ ≠ 0} is finite).
Part (b): Sum of essentially finite families #
Let (aᵢ){i ∈ I} ∈ K^I be an essentially finite family of elements of K. Then, the infinite sum ∑{i ∈ I} aᵢ is defined to equal the finite sum ∑_{i ∈ I, aᵢ ≠ 0} aᵢ. Such an infinite sum is said to be essentially finite.
A family is essentially finite if its support is finite. (Definition def.infsum.essfin (a))
This is an alias for the canonical EssentiallyFinite defined in
FPS/InfiniteProducts2.lean. Both definitions are definitionally equal:
{i | f i ≠ 0}.Finite = (Function.support f).Finite by definition.
For the full API (including _root_.EssentiallyFinite.add, _root_.EssentiallyFinite.neg,
_root_.EssentiallyFinite.toFinsupp, etc.), see FPS/InfiniteProducts2.lean.
Instances For
EssentiallyFinite is equivalent to having finite support.
Any subfamily of an essentially finite family is essentially finite.
(Delegates to _root_.EssentiallyFinite.subfamily)
Any finite family is essentially finite.
(Delegates to _root_.EssentiallyFinite.of_finite)
A family indexed by a finite type is essentially finite.
(Delegates to _root_.EssentiallyFinite.of_fintype)
The constant zero family is essentially finite.
(Delegates to _root_.EssentiallyFinite.zero)
Sum of two essentially finite families is essentially finite.
(Delegates to _root_.EssentiallyFinite.add)
Negation of an essentially finite family is essentially finite.
(Delegates to _root_.EssentiallyFinite.neg)
Subtraction of two essentially finite families is essentially finite.
(Delegates to _root_.EssentiallyFinite.sub)
Scalar multiple of an essentially finite family is essentially finite.
Note: Uses _root_.EssentiallyFinite.const_mul with NoZeroDivisors assumption.
Sum of an essentially finite family (Definition def.infsum.essfin (b)) #
For an essentially finite family (aᵢ){i ∈ I}, the infinite sum ∑{i ∈ I} aᵢ is defined to equal the finite sum ∑_{i ∈ I, aᵢ ≠ 0} aᵢ.
We connect this to Mathlib's Finsupp.sum infrastructure.
The sum of an essentially finite family, defined as the finite sum over non-zero elements. (Definition def.infsum.essfin (b))
Equations
- AlgebraicCombinatorics.FPS.essFinSum f hf = ∑ i ∈ Set.Finite.toFinset hf, f i
Instances For
The essentially finite sum equals the Finset sum over the support
If a family has finite support contained in a finset S, the essentially finite sum equals the sum over S
The essentially finite sum of a zero family is zero
The essentially finite sum of a family that is zero everywhere is zero
The essentially finite sum can be computed using any finset containing the support
The essentially finite sum of a single nonzero element
Connection to Finsupp: an essentially finite family can be converted to a Finsupp
Equations
Instances For
The essentially finite sum equals the Finsupp sum
Additivity: the essentially finite sum of a sum is the sum of essentially finite sums
Scalar multiplication: c * (∑ aᵢ) = ∑ (c * aᵢ)
Rules for Summable Sums (Proposition prop.fps.summable-sums-rule) #
Sums of summable families of FPS satisfy the usual rules for sums:
- Breaking-apart rule: if S = X ∪ Y (disjoint), then ∑{i ∈ S} fᵢ = ∑{i ∈ X} fᵢ + ∑_{i ∈ Y} fᵢ
- Fubini rule: ∑{i ∈ I} ∑{j ∈ J} fᵢⱼ = ∑{(i,j) ∈ I×J} fᵢⱼ = ∑{j ∈ J} ∑{i ∈ I} fᵢⱼ (when the family (fᵢⱼ){(i,j) ∈ I×J} is summable)
These properties follow from the corresponding properties of essentially finite sums applied coefficient-wise.
The Fubini rule for summable FPS families: interchange of summation is valid when the family indexed by the product is summable. (Proposition prop.fps.summable-sums-rule, discrete Fubini rule)
Note: The actual sum computation requires Mathlib's topological sum machinery. This theorem states that the summability condition on the product implies summability of the iterated sums.
Generating Functions #
The (ordinary) generating function of a sequence (a₀, a₁, a₂, ...) is the FPS (a₀, a₁, a₂, ...) = a₀ + a₁x + a₂x² + ...
The generating function of a sequence is just the FPS with those coefficients
Equations
Instances For
The generating function of the zero sequence is 0
The generating function of a sum is the sum of generating functions
The generating function of a negation is the negation of the generating function
The generating function of a scalar multiple is the scalar multiple of the generating function
Subtraction of generating functions
Vandermonde / Chu-Vandermonde Identity #
For Natural Numbers (Proposition prop.binom.vandermonde.NN) #
For a, b, n ∈ ℕ: C(a+b, n) = ∑_{k=0}^n C(a,k) C(b, n-k)
Vandermonde's identity for natural numbers (Proposition prop.binom.vandermonde.NN) Label: eq.prop.binom.vandermonde.NN.eq
For Complex Numbers (Theorem thm.binom.vandermonde.CC) #
The Chu-Vandermonde identity extends to all complex numbers (or any binomial ring). For a, b ∈ ℂ and n ∈ ℕ: C(a+b, n) = ∑_{k=0}^n C(a,k) C(b, n-k)
The proof uses the polynomial identity trick: both sides are polynomials in a and b that agree on ℕ × ℕ, hence they agree everywhere.
Chu-Vandermonde identity for binomial rings (Theorem thm.binom.vandermonde.CC) Label: eq.prop.binom.vandermonde.CC.eq
This generalizes Vandermonde's identity from natural numbers to any binomial ring (including ℚ, ℝ, ℂ, and polynomial rings).