1.3 Formal power series: definition and basic properties
1.3.1 Convention
Fix a commutative ring \(K\). (For example, \(K\) can be \(\mathbb {Z}\) or \(\mathbb {Q}\) or \(\mathbb {C}\).)
1.3.2 The definition of formal power series
A formal power series (or, short, FPS) in \(1\) indeterminate over \(K\) means a sequence \(\left(a_{0},a_{1},a_{2},\ldots \right) = \left(a_{n}\right)_{n\in \mathbb {N}} \in K^{\mathbb {N}}\) of elements of \(K\).
- AlgebraicCombinatorics.FPS.fpsEquivSeq = { toFun := fun (f : PowerSeries R) (n : ℕ) => (PowerSeries.coeff n) f, invFun := fun (a : ℕ → R) => PowerSeries.mk a, left_inv := ⋯, right_inv := ⋯ }
(a) The sum of two FPSs \(\mathbf{a}=\left( a_{0},a_{1},a_{2},\ldots \right)\) and \(\mathbf{b}=\left(b_{0},b_{1},b_{2},\ldots \right)\) is defined to be the FPS
It is denoted by \(\mathbf{a}+\mathbf{b}\).
(b) The difference of two FPSs \(\mathbf{a}=\left(a_{0},a_{1},a_{2},\ldots \right)\) and \(\mathbf{b}=\left(b_{0},b_{1},b_{2},\ldots \right)\) is defined to be the FPS
It is denoted by \(\mathbf{a}-\mathbf{b}\).
(c) If \(\lambda \in K\) and if \(\mathbf{a}=\left(a_{0},a_{1},a_{2},\ldots \right)\) is an FPS, then we define an FPS
(d) The product of two FPSs \(\mathbf{a}=\left(a_{0},a_{1},a_{2},\ldots \right)\) and \(\mathbf{b}=\left(b_{0},b_{1},b_{2},\ldots \right)\) is defined to be the FPS \(\left(c_{0},c_{1},c_{2},\ldots \right)\), where
This product is denoted by \(\mathbf{a}\cdot \mathbf{b}\) or just by \(\mathbf{ab}\).
(e) For each \(a\in K\), we define \(\underline{a}\) to be the FPS \(\left(a,0,0,0,\ldots \right)\). An FPS of the form \(\underline{a}\) for some \(a\in K\) (that is, an FPS \(\left(a_{0},a_{1},a_{2},\ldots \right)\) satisfying \(a_{1}=a_{2}=a_{3}=\cdots =0\)) is said to be constant.
(f) The set of all FPSs (in \(1\) indeterminate over \(K\)) is denoted \(K\left[\left[x\right]\right]\).
If \(n\in \mathbb {N}\), and if \(\mathbf{a}=\left( a_{0},a_{1},a_{2},\ldots \right) \in K\left[\left[x\right]\right]\) is an FPS, then we define an element \(\left[x^{n}\right]\mathbf{a}\in K\) by
This is called the coefficient of \(x^{n}\) in \(\mathbf{a}\), or the \(n\)-th coefficient of \(\mathbf{a}\), or the \(x^{n}\)-coefficient of \(\mathbf{a}\).
(a) The set \(K\left[\left[x\right]\right]\) is a commutative ring (with its operations \(+\), \(-\) and \(\cdot \) defined in Definition 1.74). Its zero and its unity are the FPSs \(\underline{0}=\left(0,0,0,\ldots \right)\) and \(\underline{1}=\left( 1,0,0,0,\ldots \right)\). This means, concretely, that the following facts hold:
Commutativity of addition: We have \(\mathbf{a}+\mathbf{b}=\mathbf{b}+\mathbf{a}\) for all \(\mathbf{a},\mathbf{b}\in K\left[\left[ x\right]\right]\).
Associativity of addition: We have \(\mathbf{a}+\left( \mathbf{b}+\mathbf{c}\right) =\left(\mathbf{a}+\mathbf{b}\right) +\mathbf{c}\) for all \(\mathbf{a},\mathbf{b},\mathbf{c}\in K\left[\left[ x\right]\right]\).
Neutrality of zero: We have \(\mathbf{a}+\underline{0}=\underline{0}+\mathbf{a}=\mathbf{a}\) for all \(\mathbf{a}\in K\left[\left[ x\right]\right]\).
Subtraction undoes addition: Let \(\mathbf{a},\mathbf{b},\mathbf{c}\in K\left[\left[x\right]\right]\). We have \(\mathbf{a}+\mathbf{b}=\mathbf{c}\) if and only if \(\mathbf{a}=\mathbf{c}-\mathbf{b}\).
Commutativity of multiplication: We have \(\mathbf{ab}=\mathbf{ba}\) for all \(\mathbf{a},\mathbf{b}\in K\left[\left[x\right] \right]\).
Associativity of multiplication: We have \(\mathbf{a}\left( \mathbf{bc}\right) =\left(\mathbf{ab}\right)\mathbf{c}\) for all \(\mathbf{a},\mathbf{b},\mathbf{c}\in K\left[\left[x\right]\right]\).
Distributivity: We have
\[ \mathbf{a}\left(\mathbf{b}+\mathbf{c}\right) =\mathbf{ab}+\mathbf{ac}\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \left(\mathbf{a}+\mathbf{b}\right)\mathbf{c}=\mathbf{ac}+\mathbf{bc} \]for all \(\mathbf{a},\mathbf{b},\mathbf{c}\in K\left[\left[x\right] \right]\).
Neutrality of one: We have \(\mathbf{a}\cdot \underline{1}=\underline{1}\cdot \mathbf{a}=\mathbf{a}\) for all \(\mathbf{a}\in K\left[ \left[x\right]\right]\).
Annihilation: We have \(\mathbf{a}\cdot \underline{0}=\underline{0}\cdot \mathbf{a}=\underline{0}\) for all \(\mathbf{a}\in K\left[ \left[x\right]\right]\).
(b) Furthermore, \(K\left[\left[x\right]\right]\) is a \(K\)-module (with its scaling being the map that sends each \(\left( \lambda ,\mathbf{a}\right) \in K\times K\left[\left[x\right]\right]\) to the FPS \(\lambda \mathbf{a}\) defined in Definition 1.74 (c)). Its zero vector is \(\underline{0}\). Concretely, this means that:
Associativity of scaling: We have \(\lambda \left( \mu \mathbf{a}\right) =\left( \lambda \mu \right) \mathbf{a}\) for all \(\lambda ,\mu \in K\) and \(\mathbf{a}\in K\left[\left[x\right]\right]\).
Left distributivity: We have \(\lambda \left( \mathbf{a}+\mathbf{b}\right) =\lambda \mathbf{a}+\lambda \mathbf{b}\) for all \(\lambda \in K\) and \(\mathbf{a},\mathbf{b}\in K\left[\left[x\right]\right]\).
Right distributivity: We have \(\left( \lambda +\mu \right) \mathbf{a}=\lambda \mathbf{a}+\mu \mathbf{a}\) for all \(\lambda ,\mu \in K\) and \(\mathbf{a}\in K\left[\left[x\right]\right]\).
Neutrality of one: We have \(1\mathbf{a}=\mathbf{a}\) for all \(\mathbf{a}\in K\left[\left[x\right]\right]\).
Left annihilation: We have \(0\mathbf{a}=\underline{0}\) for all \(\mathbf{a}\in K\left[\left[x\right]\right]\).
Right annihilation: We have \(\lambda \underline{0}=\underline{0}\) for all \(\lambda \in K\).
(c) We have \(\lambda \left(\mathbf{a}\cdot \mathbf{b}\right) =\left(\lambda \mathbf{a}\right)\cdot \mathbf{b}=\mathbf{a}\cdot \left( \lambda \mathbf{b}\right)\) for all \(\lambda \in K\) and \(\mathbf{a},\mathbf{b}\in K\left[\left[x\right]\right]\).
(d) Finally, we have \(\lambda \mathbf{a}=\underline{\lambda }\cdot \mathbf{a}\) for all \(\lambda \in K\) and \(\mathbf{a}\in K\left[\left[ x\right]\right]\).
Most parts of Theorem 1.76 are straightforward to verify. Let us check the associativity of multiplication.
Let \(\mathbf{a},\mathbf{b},\mathbf{c}\in K\left[\left[x\right]\right]\). We must prove that \(\mathbf{a}\left(\mathbf{bc}\right) = \left( \mathbf{ab}\right)\mathbf{c}\). Let \(n\in \mathbb {N}\). Consider the two equalities
and
The right hand sides are equal since
and \(n-j-i=n-i-j\). Thus \(\left[x^{n}\right]\left(\left(\mathbf{ab}\right)\mathbf{c}\right) =\left[x^{n}\right]\left(\mathbf{a}\left(\mathbf{bc}\right)\right)\) for each \(n\in \mathbb {N}\), which entails \(\left(\mathbf{ab}\right) \mathbf{c}=\mathbf{a}\left(\mathbf{bc}\right)\).
The remaining claims of Theorem 1.76 follow by similar (and easier) coefficient-wise verifications. In the Lean formalization, the commutative ring and module structures are provided by Mathlib’s existing instances on power series.
The product formula can be written as a sum over a range:
This rewrites the antidiagonal sum from Definition 1.74 as a range sum using the bijection \((i, n-i) \leftrightarrow i \in \{ 0, \ldots , n\} \).
1.3.3 Essentially finite sums and summable families
(a) A family \(\left(a_{i}\right)_{i\in I}\in K^{I}\) of elements of \(K\) is said to be essentially finite if all but finitely many \(i\in I\) satisfy \(a_{i}=0\) (in other words, if the set \(\left\{ i\in I\ \mid \ a_{i}\neq 0\right\} \) is finite).
(b) Let \(\left(a_{i}\right)_{i\in I}\in K^{I}\) be an essentially finite family of elements of \(K\). Then, the infinite sum \(\sum _{i\in I}a_{i}\) is defined to equal the finite sum \(\sum _{\substack{[i, \in , I, ;, \\ , a, _, {, i, }, \neq , 0]}}a_{i}\). Such an infinite sum is said to be essentially finite.
A (possibly infinite) family \(\left(\mathbf{a}_{i}\right)_{i\in I}\) of FPSs is said to be summable (or entrywise essentially finite) if
In this case, the sum \(\sum _{i\in I}\mathbf{a}_{i}\) is defined to be the FPS with
- AlgebraicCombinatorics.FPS.SummableFPS f = ∀ (n : ℕ), {i : ι | (PowerSeries.coeff n) (f i) ≠ 0}.Finite
- AlgebraicCombinatorics.FPS.summableFPSSum f _hf = PowerSeries.mk fun (n : ℕ) => ∑ᶠ (i : ι), (PowerSeries.coeff n) (f i)
Let \(\left(\mathbf{a}_{i}\right)_{i\in I}\) be a summable family of FPSs. Then, any subfamily of \(\left(\mathbf{a}_{i}\right)_{i\in I}\) is summable as well.
Let \(J\) be a subset of \(I\). We must prove that the subfamily \(\left(\mathbf{a}_{i}\right)_{i\in J}\) is summable.
Let \(n\in \mathbb {N}\). Then, all but finitely many \(i\in I\) satisfy \(\left[ x^{n}\right]\mathbf{a}_{i}=0\) (since the family \(\left(\mathbf{a}_{i}\right)_{i\in I}\) is summable). Hence, all but finitely many \(i\in J\) satisfy \(\left[x^{n}\right]\mathbf{a}_{i}=0\) (since \(J\) is a subset of \(I\)). Since we have proved this for each \(n\in \mathbb {N}\), we thus conclude that the family \(\left(\mathbf{a}_{i}\right)_{i\in J}\) is summable.
Sums of summable families of FPSs satisfy the usual rules for sums (such as the breaking-apart rule \(\sum _{i\in S}a_{s}=\sum _{i\in X}a_{s}+\sum _{i\in Y}a_{s}\) when a set \(S\) is the union of two disjoint sets \(X\) and \(Y\)). See [ 19s , Proposition 7.2.11 ] for details. Again, the only caveat is about interchange of summation signs: The equality
holds when the family \(\left(\mathbf{a}_{i,j}\right)_{\left(i,j\right) \in I\times J}\) is summable (i.e., when for each \(n\in \mathbb {N}\), all but finitely many pairs \(\left(i,j\right) \in I\times J\) satisfy \(\left[x^{n}\right]\mathbf{a}_{i,j}=0\)); it does not generally hold if we merely assume that the sums \(\sum _{i\in I}\ \ \sum _{j\in J}\mathbf{a}_{i,j}\) and \(\sum _{j\in J}\ \ \sum _{i\in I}\mathbf{a}_{i,j}\) are summable.
The proof is tedious (as there are many rules to check), but fairly straightforward (the idea is always to focus on a single coefficient, and then to reduce the infinite sums to finite sums). For example, consider the discrete Fubini rule, which says that
whenever \(\left(\mathbf{a}_{i,j}\right)_{\left(i,j\right) \in I\times J}\) is a summable family of FPSs. In order to prove this rule, we fix a summable family \(\left(\mathbf{a}_{i,j}\right)_{\left(i,j\right) \in I\times J}\) of FPSs. It is easy to see that the families \(\left( \mathbf{a}_{i,j}\right)_{j\in J}\) for all \(i\in I\) are summable as well, as are the families \(\left(\mathbf{a}_{i,j}\right)_{i\in I}\) for all \(j\in J\), and the families \(\left(\sum _{j\in J}\mathbf{a}_{i,j}\right)_{i\in I}\) and \(\left(\sum _{i\in I}\mathbf{a}_{i,j}\right)_{j\in J}\).
To verify the Fubini identity, it suffices to check that
for each \(n\in \mathbb {N}\). Fix \(n\in \mathbb {N}\); then, we have \(\left[ x^{n}\right]\left(\mathbf{a}_{i,j}\right) =0\) for all but finitely many \(\left(i,j\right) \in I\times J\) (since the family \(\left(\mathbf{a}_{i,j}\right)_{\left(i,j\right) \in I\times J}\) is summable). That is, the set of all pairs \(\left(i,j\right) \in I\times J\) satisfying \(\left[ x^{n}\right]\left(\mathbf{a}_{i,j}\right) \neq 0\) is finite. Hence, the set \(I^{\prime }\) of the first entries and the set \(J^{\prime }\) of the second entries of all these pairs are also finite. The three sums reduce to finite sums over \(I^{\prime }\times J^{\prime }\), which are equal by the usual Fubini rule for finite sums. See [ 19s , proof of Proposition 7.2.11 ] for more details.
1.3.4 The indeterminate \(x\) and powers
Let \(x\) denote the FPS \(\left(0,1,0,0,0,\ldots \right)\). In other words, let \(x\) denote the FPS with \(\left[x^{1}\right]x=1\) and \(\left[x^{i}\right]x=0\) for all \(i\neq 1\).
Let \(\mathbf{a}=\left(a_{0},a_{1},a_{2},\ldots \right)\) be an FPS. Then, \(x\cdot \mathbf{a}=\left(0,a_{0},a_{1},a_{2},\ldots \right)\).
If \(n\) is a positive integer, then
A similar argument for \(n=0\) yields \(\left[x^{0}\right]\left(x\cdot \mathbf{a}\right)=0\). Thus, for each \(n\in \mathbb {N}\),
In other words, \(x\cdot \mathbf{a}=\left(0,a_{0},a_{1},a_{2},\ldots \right)\).
We have
We induct on \(k\).
Induction base: We have \(x^{0}=\underline{1}=\left(1,0,0,0,0,\ldots \right) = \left(\underbrace{0,0,\ldots ,0}_{0\text{ times}},1,0,0,0,\ldots \right)\).
Induction step: Let \(m\in \mathbb {N}\). Assume that Proposition 1.84 holds for \(k=m\). We have \(x^{m}=\left(\underbrace{0,0,\ldots ,0}_{m\text{ times}},1,0,0,0,\ldots \right)\). Thus, Lemma 1.83 (applied to \(\mathbf{a}=x^{m}\)) yields
Since \(x\cdot x^{m}=x^{m+1}\), this completes the induction step.
Any FPS \(\left(a_{0},a_{1},a_{2},\ldots \right) \in K\left[\left[x\right]\right]\) satisfies
In particular, the right hand side here is well-defined, i.e., the family \(\left(a_{n}x^{n}\right)_{n\in \mathbb {N}}\) is summable.
By Proposition 1.84, we have
1.3.5 Helper lemmas from the formalization
Two FPSs \(f\) and \(g\) are equal if and only if \(\left[x^{n}\right]f = \left[x^{n}\right]g\) for all \(n\in \mathbb {N}\).
Immediate from the definition of FPS as a sequence.
For any \(\mathbf{a},\mathbf{b}\in K\left[\left[x\right]\right]\), we have \(\left[x^{0}\right]\left(\mathbf{ab}\right) = \left[x^{0}\right] \mathbf{a}\cdot \left[x^{0}\right]\mathbf{b}\). That is, the constant term of a product is the product of the constant terms.
Follows from the product formula with \(n=0\): \(\left[x^{0}\right](\mathbf{ab}) = \sum _{i=0}^{0} \left[x^{i}\right]\mathbf{a}\cdot \left[x^{0-i}\right]\mathbf{b} = \left[x^{0}\right]\mathbf{a}\cdot \left[x^{0}\right]\mathbf{b}\).
For any \(k\in \mathbb {N}\) and any FPS \(\mathbf{a}\),
That is, multiplication by \(x^{k}\) shifts coefficients by \(k\) positions.
By induction on \(k\), using Lemma 1.83 for the induction step.
If \(\left(\mathbf{a}_{i}\right)_{i\in I}\) and \(\left(\mathbf{b}_{i}\right)_{i\in I}\) are summable families of FPSs, then so is \(\left(\mathbf{a}_{i}+\mathbf{b}_{i}\right)_{i\in I}\).
For each \(n\in \mathbb {N}\), \(\{ i \mid \left[x^{n}\right](\mathbf{a}_{i}+\mathbf{b}_{i})\neq 0\} \subseteq \{ i \mid \left[x^{n}\right]\mathbf{a}_{i}\neq 0\} \cup \{ i \mid \left[x^{n}\right]\mathbf{b}_{i}\neq 0\} \), and the union of two finite sets is finite.
If \(\left(\mathbf{a}_{i}\right)_{i\in I}\) is a summable family of FPSs, then so is \(\left(-\mathbf{a}_{i}\right)_{i\in I}\).
For each \(n\), \(\left[x^{n}\right](-\mathbf{a}_{i})=-\left[x^{n}\right]\mathbf{a}_{i}\), so \(\{ i \mid \left[x^{n}\right](-\mathbf{a}_{i})\neq 0\} = \{ i \mid \left[x^{n}\right]\mathbf{a}_{i}\neq 0\} \).
The sum of two essentially finite families is essentially finite.
\(\{ i \mid a_{i}+b_{i}\neq 0\} \subseteq \{ i \mid a_{i}\neq 0\} \cup \{ i \mid b_{i}\neq 0\} \), and the union of two finite sets is finite.
The negation of an essentially finite family is essentially finite.
\(\{ i \mid -a_{i}\neq 0\} =\{ i \mid a_{i}\neq 0\} \).
The difference of two essentially finite families is essentially finite.
For an essentially finite family \((a_i)_{i\in I}\), the essentially finite sum \(\sum _{i\in I} a_i\) is defined as \(\sum _{i\in S} a_i\) where \(S = \{ i\in I \mid a_i \neq 0\} \).
- AlgebraicCombinatorics.FPS.essFinSum f hf = ∑ i ∈ Set.Finite.toFinset hf, f i
The essentially finite sum distributes over addition: if \((a_i)_{i\in I}\) and \((b_i)_{i\in I}\) are essentially finite families, then \(\sum _{i\in I}(a_i + b_i) = \sum _{i\in I} a_i + \sum _{i\in I} b_i\).
All three sums can be computed over the finite set \(S = \{ i \mid a_i\neq 0\} \cup \{ i \mid b_i\neq 0\} \), so this reduces to the finite sum identity \(\sum _{i\in S}(a_i+b_i)=\sum _{i\in S}a_i+\sum _{i\in S}b_i\).
For a scalar \(c\in K\) and an essentially finite family \((a_i)_{i\in I}\), \(\sum _{i\in I} c\, a_i = c\cdot \sum _{i\in I} a_i\).
The support of \((c\, a_i)\) is contained in the support of \((a_i)\), so this reduces to the finite identity \(\sum _{i\in S}c\, a_i = c\sum _{i\in S}a_i\).
If \(\left(\mathbf{a}_{i}\right)_{i\in I}\) and \(\left(\mathbf{b}_{i}\right)_{i\in I}\) are summable families of FPSs, then so is \(\left(\mathbf{a}_{i}-\mathbf{b}_{i}\right)_{i\in I}\).
If \((\mathbf{a}_i)_{i\in I}\) is a family of FPSs such that \(\{ i \mid \mathbf{a}_i \neq 0\} \) is finite, then the family is summable.
For each \(n\), \(\{ i \mid [x^n]\mathbf{a}_i \neq 0\} \subseteq \{ i \mid \mathbf{a}_i \neq 0\} \), which is finite by hypothesis.
For \(a\in K\) and \(k,n\in \mathbb {N}\), \([x^n](\underline{a}\cdot x^k) = \begin{cases} a & \text{if } n = k, \\ 0 & \text{otherwise.}\end{cases}\)
Follows from \([x^n]x^k = \delta _{n,k}\) (Proposition 1.84) and \([x^n](\underline{a}\cdot f) = a\cdot [x^n]f\).
Multiplying on the right by \(x\) also shifts coefficients: \([x^{n+1}](\mathbf{a}\cdot x) = [x^n]\mathbf{a}\).
By commutativity of multiplication, \(\mathbf{a}\cdot x = x\cdot \mathbf{a}\), so this follows from Lemma 1.83.
For any \(k\in \mathbb {N}\) and any FPS \(\mathbf{a}\), \([x^n](\mathbf{a}\cdot x^k) = \begin{cases} 0 & \text{if }n{\lt}k, \\[x^{n-k}]\mathbf{a} & \text{if }n\geq k.\end{cases}\)
By commutativity: \(\mathbf{a}\cdot x^k = x^k\cdot \mathbf{a}\), so this follows from Lemma 1.88.
1.3.6 Generating functions
The (ordinary) generating function of a sequence \((a_0, a_1, a_2, \ldots )\) is the FPS \((a_0, a_1, a_2, \ldots ) = \sum _{n\geq 0} a_n x^n\).
The \(n\)-th coefficient of the generating function of a sequence \((a_n)\) is \(a_n\).
Immediate from the definitions.
1.3.7 The Chu–Vandermonde identity
Let \(a,b\in \mathbb {N}\), and let \(n\in \mathbb {N}\). Then,
Multiply out the identity \(\left(1+x\right)^{a+b}=\left(1+x\right)^{a}\left(1+x\right)^{b}\) using the binomial formula and compare the coefficient of \(x^{n}\) on both sides. The left side gives \(\binom {a+b}{n}\), and the right side gives \(\sum _{k=0}^{n}\binom {a}{k}\binom {b}{n-k}\) by the product formula for FPSs.
The Vandermonde identity in range-sum form: for \(a, b, n \in \mathbb {N}\), \(\binom {a+b}{n} = \sum _{k=0}^{n}\binom {a}{k}\binom {b}{n-k}\).
Rewrites the antidiagonal sum from Proposition 1.104 as a range sum.
Let \(a,b\in \mathbb {C}\), and let \(n\in \mathbb {N}\). Then,
Fix \(n\in \mathbb {N}\) and \(b\in \mathbb {N}\). By Proposition 1.104, the equality
holds for each \(a\in \mathbb {N}\). However, both sides are polynomials in \(a\):
Two univariate polynomials that agree on all of \(\mathbb {N}\) (infinitely many points) must be identical. Hence the equality holds for all \(a\in \mathbb {C}\).
Now fix \(a\in \mathbb {C}\) and repeat the argument with \(b\) as the variable: both sides are polynomials in \(b\) that agree on \(\mathbb {N}\), hence they agree on \(\mathbb {C}\). (See [ 20f , proofs of Lemma 7.5.8 and Theorem 7.5.3 ] or [ 19s , § 2.17.3 ] for this proof in more detail. Alternatively, see [ Grinbe15 , § 3.3.2 and § 3.3.3 ] for two other proofs.)