Formalization Blueprint for “An Introduction to Algebraic Combinatorics” by Darij Grinberg

1.15 Limits of FPSs

1.15.1 Stabilization of scalars

Definition 1.444
#

Let \(\left( a_{i}\right) _{i\in \mathbb {N}}=\left( a_{0},a_{1},a_{2},\ldots \right) \in K^{\mathbb {N}}\) be a sequence of elements of \(K\). Let \(a\in K\).

We say that the sequence \(\left( a_{i}\right) _{i\in \mathbb {N}}\) stabilizes to \(a\) if there exists some \(N\in \mathbb {N}\) such that

\[ \text{all integers }i\geq N\text{ satisfy }a_{i}=a. \]

If \(a_{i}\) stabilizes to \(a\) as \(i\rightarrow \infty \), then we write \(\lim \limits _{i\rightarrow \infty }a_{i}=a\) and say that \(a\) is the limit (or eventual value) of \(\left( a_{i}\right) _{i\in \mathbb {N}}\). This is legitimate, since \(a\) is uniquely determined by the sequence \(\left( a_{i}\right) _{i\in \mathbb {N}}\).

def Seq.StabilizesTo {K : Type u_1} (a : K) (lim : K) :
Lemma 1.445

If \(\left( a_{i}\right)\) stabilizes to both \(\ell _{1}\) and \(\ell _{2}\), then \(\ell _{1}=\ell _{2}\).

theorem Seq.stabilizesTo_unique {K : Type u_1} {a : K} {lim₁ lim₂ : K} (h₁ : StabilizesTo a lim₁) (h₂ : StabilizesTo a lim₂) :
lim₁ = lim₂
Proof

Let \(N_{1}\) and \(N_{2}\) be as in the definition for \(\ell _{1}\) and \(\ell _{2}\) respectively. Then \(a_{\max (N_{1},N_{2})}=\ell _{1}\) and \(a_{\max (N_{1},N_{2})}=\ell _{2}\), so \(\ell _{1}=\ell _{2}\).

Lemma 1.446

Any constant sequence \(\left( c,c,c,\ldots \right) \in K^{\mathbb {N}}\) stabilizes to \(c\).

theorem Seq.stabilizesTo_const {K : Type u_1} (c : K) :
StabilizesTo (fun (x : ) => c) c
Proof

Take \(N=0\). Then all \(i\geq 0\) satisfy \(a_{i}=c\).

Lemma 1.447

If a sequence \((a_i)\) stabilizes to \(\ell \), and a sequence \((b_i)\) is eventually equal to \((a_i)\) (i.e., there exists \(N\) such that \(a_i = b_i\) for all \(i \geq N\)), then \((b_i)\) also stabilizes to \(\ell \).

theorem Seq.stabilizesTo_of_eventually_eq {K : Type u_1} {a b : K} {lim : K} (h : StabilizesTo a lim) (heq : ∃ (N : ), iN, a i = b i) :
Proof

Let \(N_1\) witness stabilization of \((a_i)\) to \(\ell \) and \(N_2\) witness the eventual equality. Then for all \(i \geq \max (N_1, N_2)\), we have \(b_i = a_i = \ell \).

Lemma 1.448

If \((a_i)\) stabilizes to \(\ell _a\) and \((b_i)\) stabilizes to \(\ell _b\), then \((a_i + b_i)\) stabilizes to \(\ell _a + \ell _b\).

theorem Seq.stabilizesTo_add {K : Type u_1} [Add K] {a b : K} {la lb : K} (ha : StabilizesTo a la) (hb : StabilizesTo b lb) :
StabilizesTo (fun (i : ) => a i + b i) (la + lb)
Proof

Let \(N_a\) and \(N_b\) witness the two stabilizations. For \(i \geq \max (N_a, N_b)\), we have \(a_i + b_i = \ell _a + \ell _b\).

Lemma 1.449

If \((a_i)\) stabilizes to \(\ell _a\) and \((b_i)\) stabilizes to \(\ell _b\), then \((a_i \cdot b_i)\) stabilizes to \(\ell _a \cdot \ell _b\).

theorem Seq.stabilizesTo_mul {K : Type u_1} [Mul K] {a b : K} {la lb : K} (ha : StabilizesTo a la) (hb : StabilizesTo b lb) :
StabilizesTo (fun (i : ) => a i * b i) (la * lb)
Proof

Let \(N_a\) and \(N_b\) witness the two stabilizations. For \(i \geq \max (N_a, N_b)\), we have \(a_i \cdot b_i = \ell _a \cdot \ell _b\).

Lemma 1.450

If \((a_i)\) stabilizes to \(\ell \), then \((-a_i)\) stabilizes to \(-\ell \).

theorem Seq.stabilizesTo_neg {K : Type u_1} [Neg K] {a : K} {la : K} (ha : StabilizesTo a la) :
StabilizesTo (fun (i : ) => -a i) (-la)
Proof

Let \(N\) witness the stabilization. For \(i \geq N\), we have \(-a_i = -\ell \).

Lemma 1.451

Let \(S\) be a finite set, and for each \(s \in S\), let \((a_{s,i})_{i \in \mathbb {N}}\) be a sequence stabilizing to \(\ell _s\). Then the sequence \(\left(\sum _{s \in S} a_{s,i}\right)_{i \in \mathbb {N}}\) stabilizes to \(\sum _{s \in S} \ell _s\).

theorem Seq.stabilizesTo_finset_sum {K : Type u_1} {ι : Type u_2} [AddCommMonoid K] [DecidableEq ι] (s : Finset ι) {a : ιK} {la : ιK} (h : is, StabilizesTo (a i) (la i)) :
StabilizesTo (fun (n : ) => is, a i n) (∑ is, la i)
Proof

By induction on \(|S|\), using Lemma 1.448 for the induction step.

Lemma 1.452

If \(s \in K\) satisfies \(s^k = 0\) for some \(k \in \mathbb {N}\) (i.e., \(s\) is nilpotent), then the sequence \((s^i)_{i \in \mathbb {N}}\) stabilizes to \(0\).

theorem Seq.stabilizesTo_pow_of_nilpotent {K : Type u_1} [MonoidWithZero K] {s : K} {k : } (hs : s ^ k = 0) :
StabilizesTo (fun (i : ) => s ^ i) 0
Proof

For \(i \geq k\), we have \(s^i = s^k \cdot s^{i-k} = 0 \cdot s^{i-k} = 0\).

1.15.2 Coefficientwise stabilization of FPSs

Definition 1.453
#

Let \(\left( f_{i}\right) _{i\in \mathbb {N}}\in K\left[ \left[ x\right] \right] ^{\mathbb {N}}\) be a sequence of FPSs over \(K\). Let \(f\in K\left[ \left[ x\right] \right] \) be an FPS.

We say that \(\left( f_{i}\right) _{i\in \mathbb {N}}\) coefficientwise stabilizes to \(f\) if for each \(n\in \mathbb {N}\),

\[ \text{the sequence }\left( \left[ x^{n}\right] f_{i}\right) _{i\in \mathbb {N}}\text{ stabilizes to }\left[ x^{n}\right] f. \]

If \(f_{i}\) coefficientwise stabilizes to \(f\) as \(i\rightarrow \infty \), then we write \(\lim \limits _{i\rightarrow \infty }f_{i}=f\) and say that \(f\) is the limit of \(\left( f_{i}\right) _{i\in \mathbb {N}}\). This is legitimate, because \(f\) is uniquely determined by the sequence \(\left( f_{i}\right) _{i\in \mathbb {N}}\).

Lemma 1.454

If a sequence \((f_i)\) of FPSs coefficientwise stabilizes to both \(\ell _1\) and \(\ell _2\), then \(\ell _1 = \ell _2\).

theorem PowerSeries.coeffStabilizesTo_unique {K : Type u_1} [CommRing K] {f : PowerSeries K} {lim₁ lim₂ : PowerSeries K} (h₁ : CoeffStabilizesTo f lim₁) (h₂ : CoeffStabilizesTo f lim₂) :
lim₁ = lim₂
Proof

By extensionality (Lemma 1.86): for each \(n\), the \(n\)-th coefficient of \(\ell _1\) equals that of \(\ell _2\) by Lemma 1.445.

Lemma 1.455

A constant sequence \((g, g, g, \ldots )\) of FPSs coefficientwise stabilizes to \(g\).

theorem PowerSeries.coeffStabilizesTo_const {K : Type u_1} [CommRing K] (g : PowerSeries K) :
CoeffStabilizesTo (fun (x : ) => g) g
Proof

For each \(n\), the sequence \(([x^n]g, [x^n]g, \ldots )\) is constant and stabilizes to \([x^n]g\) by Lemma 1.446.

Lemma 1.456

The sequence \((x^i)_{i \in \mathbb {N}}\) of FPSs coefficientwise stabilizes to \(0\).

Proof

For each \(n \in \mathbb {N}\), the sequence \(([x^n](x^i))_{i \in \mathbb {N}}\) consists of a single \(1\) (at \(i = n\)) and \(0\)s elsewhere. For \(i \geq n+1\), \([x^n](x^i) = 0\), so the sequence stabilizes to \(0 = [x^n]0\).

1.15.3 Some properties of limits

Helpers for \(x^n\)-equivalence and composition

Lemma 1.457

Let \(g \in K[[x]]\) with \([x^0]g = 0\). Then for any \(n, d \in \mathbb {N}\) with \(d {\gt} n\), we have \([x^n](g^d) = 0\). This follows from \(\operatorname {ord}(g) \geq 1\) implying \(\operatorname {ord}(g^d) \geq d {\gt} n\).

theorem PowerSeries.coeff_pow_eq_zero_of_constantCoeff_zero {K : Type u_1} [CommRing K] (g : PowerSeries K) (hg : constantCoeff g = 0) (n d : ) (hd : d > n) :
(coeff n) (g ^ d) = 0
Proof

Since \([x^0]g = 0\), we have \(\operatorname {ord}(g) \geq 1\), so \(\operatorname {ord}(g^d) \geq d {\gt} n\), and therefore \([x^n](g^d) = 0\).

Lemma 1.458

Let \(f, g \in K[[x]]\) with \([x^0]g = 0\). Then

\[ [x^n](f \circ g) = \sum _{d=0}^{n} [x^d]f \cdot [x^n](g^d). \]

In other words, only the first \(n+1\) coefficients of \(f\) contribute to \([x^n](f \circ g)\).

theorem PowerSeries.coeff_subst_eq_finite_sum {K : Type u_1} [CommRing K] (f g : PowerSeries K) (hg : constantCoeff g = 0) (n : ) :
(coeff n) (subst g f) = dFinset.range (n + 1), (coeff d) f (coeff n) (g ^ d)
Proof

For \(d {\gt} n\), we have \([x^n](g^d) = 0\) by Lemma 1.457, so those terms vanish from the infinite sum.

Lemma 1.459

The relation \(\overset {x^n}{\equiv }\) is compatible with taking inverses. If \(f \overset {x^n}{\equiv } g\) and \(u\) is a unit in \(K\) such that \([x^0]f = u = [x^0]g\), then \(f^{-1} \overset {x^n}{\equiv } g^{-1}\) (where \(f^{-1}\) denotes the inverse of \(f\) as an invertible FPS with constant term \(u\)).

theorem PowerSeries.xnEquiv_invOfUnit {K : Type u_1} [CommRing K] {n : } {f g : PowerSeries K} (u : Kˣ) (h : f ≡[x^n] g) :
Proof

By strong induction on the coefficient index \(k\). For \(k = 0\), both inverse coefficients equal \(u^{-1}\). For \(k {\gt} 0\), the recursive formula for inverse coefficients involves only lower-degree coefficients of the inverse (handled by the IH) and coefficients of \(f\), \(g\) that agree by \(x^n\)-equivalence.

Lemma 1.460

The relation \(\overset {x^n}{\equiv }\) is compatible with composition. If \(f_1 \overset {x^n}{\equiv } f_2\) and \(g_1 \overset {x^n}{\equiv } g_2\), with \([x^0]g_1 = [x^0]g_2 = 0\), then \(f_1 \circ g_1 \overset {x^n}{\equiv } f_2 \circ g_2\).

theorem PowerSeries.xnEquiv_subst {K : Type u_1} [CommRing K] {n : } {f₁ f₂ g₁ g₂ : PowerSeries K} (hf : f₁ ≡[x^n] f₂) (hg : g₁ ≡[x^n] g₂) (hg₁ : constantCoeff g₁ = 0) (hg₂ : constantCoeff g₂ = 0) :
subst g₁ f₁ ≡[x^n] subst g₂ f₂
Proof

By Lemma 1.458, \([x^m](f \circ g)\) depends only on the first \(m+1\) coefficients of \(f\) and on powers \(g^d\) for \(d \leq m\). Since \(f_1 \overset {x^n}{\equiv } f_2\) gives \([x^d]f_1 = [x^d]f_2\) for \(d \leq m \leq n\), and \(g_1 \overset {x^n}{\equiv } g_2\) implies \(g_1^d \overset {x^n}{\equiv } g_2^d\) (by compatibility of \(\overset {x^n}{\equiv }\) with powers), the result follows.

Theorem 1.461

Let \(\left( f_{i}\right) _{i\in \mathbb {N}}\in K\left[ \left[ x\right] \right] ^{\mathbb {N}}\) be a sequence of FPSs. Assume that for each \(n\in \mathbb {N}\), there exists some \(g_{n}\in K\) such that the sequence \(\left( \left[ x^{n}\right] f_{i}\right) _{i\in \mathbb {N}}\) stabilizes to \(g_{n}\). Then, the sequence \(\left( f_{i}\right) _{i\in \mathbb {N}}\) coefficientwise stabilizes to \(\sum _{n\in \mathbb {N}}g_{n}x^{n}\). (That is, \(\lim \limits _{i\rightarrow \infty }f_{i}=\sum _{n\in \mathbb {N}}g_{n}x^{n}\).)

theorem PowerSeries.coeffStabilizesTo_of_forall_coeff_stabilizes {K : Type u_1} [CommRing K] {f : PowerSeries K} {g : K} (h : ∀ (n : ), Seq.StabilizesTo (fun (i : ) => (coeff n) (f i)) (g n)) :
Proof

We need to show that for each \(n\), the sequence \(([x^n] f_i)\) stabilizes to \([x^n](\sum _{m \in \mathbb {N}} g_m x^m) = g_n\). But this is exactly the hypothesis applied to \(n\).

Lemma 1.462

Assume that \(\left( f_{i}\right) _{i\in \mathbb {N}}\) is a sequence of FPSs, and that \(f\) is an FPS such that \(\lim \limits _{i\rightarrow \infty }f_{i}=f\). Then, for each \(n\in \mathbb {N}\), there exists some integer \(N\in \mathbb {N}\) such that

\[ \text{all integers }i\geq N\text{ satisfy }f_{i}\overset {x^{n}}{\equiv }f. \]
theorem PowerSeries.exists_xnEquiv_of_coeffStabilizesTo {K : Type u_1} [CommRing K] {f : PowerSeries K} {lim : PowerSeries K} (h : CoeffStabilizesTo f lim) (n : ) :
∃ (N : ), iN, f i ≡[x^n] lim
Proof

Let \(n\in \mathbb {N}\). For each \(k\in \left\{ 0,1,\ldots ,n\right\} \), we pick an \(N_{k}\in \mathbb {N}\) such that all \(i\geq N_{k}\) satisfy \(\left[ x^{k}\right] f_{i}=\left[ x^{k}\right] f\) (such an \(N_{k}\) exists, since \(\lim \limits _{i\rightarrow \infty }f_{i}=f\)). Then, all integers \(i\geq \max \left\{ N_{0},N_{1},\ldots ,N_{n}\right\} \) satisfy \(f_{i}\overset {x^{n}}{\equiv }f\).

Proposition 1.463

Assume that \(\left( f_{i}\right) _{i\in \mathbb {N}}\) and \(\left( g_{i}\right) _{i\in \mathbb {N}}\) are two sequences of FPSs, and that \(f\) and \(g\) are two FPSs such that

\[ \lim \limits _{i\rightarrow \infty }f_{i}=f\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \lim \limits _{i\rightarrow \infty }g_{i}=g. \]

Then,

\[ \lim \limits _{i\rightarrow \infty }\left( f_{i}+g_{i}\right) =f+g\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \lim \limits _{i\rightarrow \infty }\left( f_{i}g_{i}\right) =fg. \]
theorem PowerSeries.coeffStabilizesTo_add {K : Type u_1} [CommRing K] {f g : PowerSeries K} {lf lg : PowerSeries K} (hf : CoeffStabilizesTo f lf) (hg : CoeffStabilizesTo g lg) :
CoeffStabilizesTo (fun (i : ) => f i + g i) (lf + lg)
theorem PowerSeries.coeffStabilizesTo_mul {K : Type u_1} [CommRing K] {f g : PowerSeries K} {lf lg : PowerSeries K} (hf : CoeffStabilizesTo f lf) (hg : CoeffStabilizesTo g lg) :
CoeffStabilizesTo (fun (i : ) => f i * g i) (lf * lg)
Proof

Let \(n\in \mathbb {N}\).

Addition. The \(n\)-th coefficient of \(f_i + g_i\) is \([x^n]f_i + [x^n]g_i\). Since \(([x^n]f_i)\) stabilizes to \([x^n]f\) and \(([x^n]g_i)\) stabilizes to \([x^n]g\), Lemma 1.448 shows that \(([x^n]f_i + [x^n]g_i)\) stabilizes to \([x^n]f + [x^n]g = [x^n](f+g)\).

Multiplication. The \(n\)-th coefficient of \(f_i g_i\) is \([x^n](f_i g_i) = \sum _{(a,b) \in \mathrm{antidiag}(n)} [x^a]f_i \cdot [x^b]g_i\). Each term \([x^a]f_i \cdot [x^b]g_i\) is a product of two stabilizing sequences (by Lemma 1.449), and a finite sum of stabilizing sequences stabilizes (by Lemma 1.451). Thus the sequence stabilizes to \(\sum _{(a,b)} [x^a]f \cdot [x^b]g = [x^n](fg)\).

Lemma 1.464

If \((f_i)\) coefficientwise stabilizes to \(f\), then \((-f_i)\) coefficientwise stabilizes to \(-f\).

theorem PowerSeries.coeffStabilizesTo_neg {K : Type u_1} [CommRing K] {f : PowerSeries K} {lf : PowerSeries K} (hf : CoeffStabilizesTo f lf) :
CoeffStabilizesTo (fun (i : ) => -f i) (-lf)
Proof

For each \(n\), \(([x^n](-f_i)) = (-[x^n]f_i)\) stabilizes to \(-[x^n]f = [x^n](-f)\) by Lemma 1.450.

Lemma 1.465

If \((f_i)\) coefficientwise stabilizes to \(f\) and \((g_i)\) coefficientwise stabilizes to \(g\), then \((f_i - g_i)\) coefficientwise stabilizes to \(f - g\).

theorem PowerSeries.coeffStabilizesTo_sub {K : Type u_1} [CommRing K] {f g : PowerSeries K} {lf lg : PowerSeries K} (hf : CoeffStabilizesTo f lf) (hg : CoeffStabilizesTo g lg) :
CoeffStabilizesTo (fun (i : ) => f i - g i) (lf - lg)
Proof

Write \(f_i - g_i = f_i + (-g_i)\) and apply Proposition 1.463 (addition) and Lemma 1.464.

Corollary 1.466

Let \(k\in \mathbb {N}\). For each \(i\in \left\{ 1,2,\ldots ,k\right\} \), let \(f_{i}\) be an FPS, and let \(\left( f_{i,n}\right) _{n\in \mathbb {N}}\) be a sequence of FPSs such that

\[ \lim \limits _{n\rightarrow \infty }\left( f_{i,n}\right) =f_{i} \]

(note that it is \(n\), not \(i\), that goes to \(\infty \) here!). Then,

\[ \lim \limits _{n\rightarrow \infty }\sum _{i=1}^{k}f_{i,n}=\sum _{i=1}^{k}f_{i}\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \lim \limits _{n\rightarrow \infty }\prod _{i=1}^{k}f_{i,n}=\prod _{i=1}^{k}f_{i}. \]
theorem PowerSeries.coeffStabilizesTo_finset_sum {K : Type u_1} [CommRing K] {ι : Type u_2} (s : Finset ι) {f : ιPowerSeries K} {lf : ιPowerSeries K} (h : is, CoeffStabilizesTo (f i) (lf i)) :
CoeffStabilizesTo (fun (n : ) => is, f i n) (∑ is, lf i)
theorem PowerSeries.coeffStabilizesTo_finset_prod {K : Type u_1} [CommRing K] {ι : Type u_2} (s : Finset ι) {f : ιPowerSeries K} {lf : ιPowerSeries K} (h : is, CoeffStabilizesTo (f i) (lf i)) :
CoeffStabilizesTo (fun (n : ) => is, f i n) (∏ is, lf i)
Proof

Follows by induction on \(k\), using Proposition 1.463.

Lemma 1.467

Assume that \((g_i)\) coefficientwise stabilizes to \(g\), and that each \(g_i\) is invertible (i.e., its constant coefficient is a unit). Then \(g\) is also invertible (i.e., the constant coefficient of \(g\) is a unit).

Proof

The \(0\)-th coefficient of \(g_i\) stabilizes to the \(0\)-th coefficient of \(g\). For sufficiently large \(i\), \([x^0]g_i = [x^0]g\). Since \([x^0]g_i\) is a unit, so is \([x^0]g\).

Proposition 1.468

Assume that \(\left( f_{i}\right) _{i\in \mathbb {N}}\) and \(\left( g_{i}\right) _{i\in \mathbb {N}}\) are two sequences of FPSs, and that \(f\) and \(g\) are two FPSs such that

\[ \lim \limits _{i\rightarrow \infty }f_{i}=f\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \lim \limits _{i\rightarrow \infty }g_{i}=g. \]

Assume that each FPS \(g_{i}\) is invertible. Then, \(g\) is also invertible, and we have

\[ \lim \limits _{i\rightarrow \infty }\frac{f_{i}}{g_{i}}=\frac{f}{g}. \]
theorem PowerSeries.coeffStabilizesTo_mul_inv {K : Type u_1} [CommRing K] {f g : PowerSeries K} {lf lg : PowerSeries K} (hf : CoeffStabilizesTo f lf) (hg : CoeffStabilizesTo g lg) (hunit : ∀ (i : ), IsUnit (constantCoeff (g i))) :
CoeffStabilizesTo (fun (i : ) => f i * (g i).invOfUnit .unit) (lf * lg.invOfUnit .unit)
Proof

The invertibility of \(g\) follows from Lemma 1.467. For the limit equality, we write \(f_i / g_i = f_i \cdot g_i^{-1}\) and show that the coefficients of \(g_i^{-1}\) stabilize to those of \(g^{-1}\).

The key step is showing that the inverse coefficients stabilize. This is done by strong induction on the coefficient index \(n\).

Base case (\(n = 0\)): The \(0\)-th coefficient of \(g_i^{-1}\) is \(([x^0]g_i)^{-1}\). Since \([x^0]g_i\) stabilizes to \([x^0]g\), the inverse stabilizes as well.

Induction step (\(n {\gt} 0\)): The \(n\)-th coefficient of \(g_i^{-1}\) is determined by the recursive formula

\[ [x^n](g_i^{-1}) = -([x^0]g_i)^{-1} \sum _{\substack{[(, a, ,, b, ), , \in , \mathrm , {, a, n, t, i, d, i, a, g, }, (, n, ), , \\ , , b, , {\lt}, , n]}} [x^a]g_i \cdot [x^b](g_i^{-1}). \]

By the induction hypothesis, each \([x^b](g_i^{-1})\) with \(b {\lt} n\) stabilizes. Combined with stabilization of \([x^a]g_i\) and \(([x^0]g_i)^{-1}\), the products and sums stabilize by Lemmas 1.449 and 1.451.

Once we know \(g_i^{-1}\) coefficientwise stabilizes to \(g^{-1}\), the result \(\lim f_i g_i^{-1} = f g^{-1}\) follows from Proposition 1.463 (multiplication).

Proposition 1.469

Assume that \(\left( f_{i}\right) _{i\in \mathbb {N}}\) and \(\left( g_{i}\right) _{i\in \mathbb {N}}\) are two sequences of FPSs, and that \(f\) and \(g\) are two FPSs such that

\[ \lim \limits _{i\rightarrow \infty }f_{i}=f\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \lim \limits _{i\rightarrow \infty }g_{i}=g. \]

Assume that \(\left[ x^{0}\right] g_{i}=0\) for each \(i\in \mathbb {N}\). Then, \(\left[ x^{0}\right] g=0\) and

\[ \lim \limits _{i\rightarrow \infty }\left( f_{i}\circ g_{i}\right) =f\circ g. \]
theorem PowerSeries.coeffStabilizesTo_subst {K : Type u_1} [CommRing K] {f g : PowerSeries K} {lf lg : PowerSeries K} (hf : CoeffStabilizesTo f lf) (hg : CoeffStabilizesTo g lg) (hconst : ∀ (i : ), constantCoeff (g i) = 0) :
CoeffStabilizesTo (fun (i : ) => subst (g i) (f i)) (subst lg lf)
Proof

First, \([x^0]g = 0\) since \([x^0]g_i = 0\) for all \(i\) and the \(0\)-th coefficient stabilizes.

For each \(n \in \mathbb {N}\), by Lemma 1.462 we can find \(N_f\) and \(N_g\) such that for \(i \geq \max (N_f, N_g)\), \(f_i \overset {x^n}{\equiv } f\) and \(g_i \overset {x^n}{\equiv } g\). By Proposition 1.338 (compatibility of \(x^n\)-equivalence with composition), \(f_i \circ g_i \overset {x^n}{\equiv } f \circ g\), so in particular \([x^n](f_i \circ g_i) = [x^n](f \circ g)\).

Proposition 1.470

Let \(\left( f_{n}\right) _{n\in \mathbb {N}}\) be a sequence of FPSs, and let \(f\) be an FPS such that

\[ \lim \limits _{i\rightarrow \infty }f_{i}=f. \]

Then,

\[ \lim \limits _{i\rightarrow \infty }f_{i}^{\prime }=f^{\prime }. \]
Proof

For each \(n\), \([x^n](f_i') = (n+1) \cdot [x^{n+1}]f_i\). Since \(([x^{n+1}]f_i)\) stabilizes to \([x^{n+1}]f\), multiplying by the constant \((n+1)\) preserves stabilization (by Lemma 1.449 with the constant sequence \((n+1)\)). Thus the sequence stabilizes to \((n+1) \cdot [x^{n+1}]f = [x^n](f')\).

1.15.4 Infinite sums and products

Definition 1.471
#

A family \((f_n)_{n \in \mathbb {N}}\) of FPSs is summable if for each \(n \in \mathbb {N}\), the set \(\{ i \in \mathbb {N} : [x^n] f_i \neq 0\} \) is finite.

Definition 1.472
#

The infinite sum of a summable family \((f_n)_{n \in \mathbb {N}}\) is the FPS \(\sum _{n \in \mathbb {N}} f_n\) whose \(n\)-th coefficient is \(\sum _{i \in S_n} [x^n] f_i\), where \(S_n = \{ i : [x^n] f_i \neq 0\} \).

noncomputable def PowerSeries.tsum' {K : Type u_1} [CommRing K] (f : PowerSeries K) (hf : IsSummable f) :
Definition 1.473
#

A family \((f_n)_{n \in \mathbb {N}}\) of FPSs is multipliable if (1) \([x^0]f_i = 1\) for all \(i\), and (2) for each \(n \in \mathbb {N}\), there exists \(N\) such that for all \(i \geq N\) and all \(k \leq n\), \([x^k]f_i = \delta _{k,0}\) (i.e., eventually all \(f_i\) are \(\equiv 1 \pmod{x^{n+1}}\)).

Definition 1.474
#

The infinite product of a multipliable family \((f_n)_{n \in \mathbb {N}}\) is the FPS \(\prod _{n \in \mathbb {N}} f_n\) whose \(n\)-th coefficient equals \([x^n](\prod _{j=0}^{N} f_j)\) for any sufficiently large \(N\).

noncomputable def PowerSeries.tprod' {K : Type u_1} [CommRing K] (f : PowerSeries K) (hf : IsMultipliable f) :
Theorem 1.475

Let \(\left( f_{n}\right) _{n\in \mathbb {N}}\) be a summable sequence of FPSs. Then,

\[ \lim \limits _{i\rightarrow \infty }\sum _{n=0}^{i}f_{n}=\sum _{n\in \mathbb {N}}f_{n}. \]

In other words, the infinite sum \(\sum _{n\in \mathbb {N}}f_{n}\) is the limit of the finite partial sums \(\sum _{n=0}^{i}f_{n}\).

theorem PowerSeries.coeffStabilizesTo_partial_sum {K : Type u_1} [CommRing K] {f : PowerSeries K} (hf : IsSummable f) :
CoeffStabilizesTo (fun (i : ) => jFinset.range (i + 1), f j) (tsum' f hf)
Proof

For each coefficient index \(n\), only finitely many \(f_j\) have nonzero \(n\)-th coefficient (by summability). Let \(S\) be the finite set of such indices, and let \(N\) be the maximum element of \(S\) (or \(0\) if \(S\) is empty). For \(i \geq N+1\), the partial sum \(\sum _{j=0}^{i} [x^n]f_j\) includes all nonzero contributors, so it equals the infinite sum \(\sum _{j \in \mathbb {N}} [x^n]f_j\). Hence the \(n\)-th coefficient stabilizes.

Theorem 1.476

Let \(\left( f_{n}\right) _{n\in \mathbb {N}}\) be a multipliable sequence of FPSs. Then,

\[ \lim \limits _{i\rightarrow \infty }\prod _{n=0}^{i}f_{n}=\prod _{n\in \mathbb {N}}f_{n}. \]

In other words, the infinite product \(\prod _{n\in \mathbb {N}}f_{n}\) is the limit of the finite partial products \(\prod _{n=0}^{i}f_{n}\).

theorem PowerSeries.coeffStabilizesTo_partial_prod {K : Type u_1} [CommRing K] {f : PowerSeries K} (hf : IsMultipliable f) :
CoeffStabilizesTo (fun (i : ) => jFinset.range (i + 1), f j) (tprod' f hf)
Proof

By the multipliability condition, for each \(n\) there exists \(N\) such that for all \(j \geq N\), \(f_j \equiv 1 \pmod{x^{n+1}}\) (i.e., \([x^k]f_j = \delta _{k,0}\) for \(k \leq n\)). Once \(i\) exceeds \(N\), multiplying the partial product by \(f_{i+1}\) does not change the first \(n+1\) coefficients, since \(f_{i+1}\) acts as \(1\) on those coefficients. Hence the \(n\)-th coefficient of the partial product stabilizes to the \(n\)-th coefficient of the infinite product.

Corollary 1.477

Each FPS is a limit of a sequence of polynomials. Indeed, if \(a=\sum _{n\in \mathbb {N}}a_{n}x^{n}\) (with \(a_{n}\in K\)), then

\[ a=\lim \limits _{i\rightarrow \infty }\sum _{n=0}^{i}a_{n}x^{n}. \]

More precisely, the sequence of truncations \((\operatorname {trunc}_{i+1}(a))_{i \in \mathbb {N}}\) coefficientwise stabilizes to \(a\).

theorem PowerSeries.coeffStabilizesTo_trunc {K : Type u_1} [CommRing K] (a : PowerSeries K) :
CoeffStabilizesTo (fun (i : ) => ((trunc (i + 1)) a)) a
Proof

For each \(n\), once \(i \geq n\), the truncation \(\operatorname {trunc}_{i+1}(a)\) has \([x^n](\operatorname {trunc}_{i+1}(a)) = [x^n]a\) (since \(n {\lt} i + 1\)).

Theorem 1.478

Let \(\left( f_{0},f_{1},f_{2},\ldots \right) \) be a sequence of FPSs such that \(\lim \limits _{i\rightarrow \infty }\sum _{n=0}^{i}f_{n}\) exists. Then, the family \(\left( f_{n}\right) _{n\in \mathbb {N}}\) is summable, and satisfies

\[ \sum _{n\in \mathbb {N}}f_{n}=\lim \limits _{i\rightarrow \infty }\sum _{n=0}^{i}f_{n}. \]
theorem PowerSeries.isSummable_of_coeffStabilizesTo_partial_sum {K : Type u_1} [CommRing K] {f : PowerSeries K} {lim : PowerSeries K} (h : CoeffStabilizesTo (fun (i : ) => jFinset.range (i + 1), f j) lim) :
theorem PowerSeries.tsum'_eq_of_coeffStabilizesTo_partial_sum {K : Type u_1} [CommRing K] {f : PowerSeries K} {lim : PowerSeries K} (h : CoeffStabilizesTo (fun (i : ) => jFinset.range (i + 1), f j) lim) :
tsum' f = lim
Proof

Summability. Fix a coefficient index \(n\). Let \(N\) be such that \([x^n](\sum _{j=0}^{i} f_j) = [x^n]\ell \) for all \(i \geq N\) (where \(\ell \) is the limit). Suppose for contradiction that \(i \geq N+1\) and \([x^n]f_i \neq 0\). Then

\[ [x^n]\ell = [x^n]\sum _{j=0}^{i} f_j = [x^n]\sum _{j=0}^{i-1} f_j + [x^n]f_i = [x^n]\ell + [x^n]f_i, \]

which gives \([x^n]f_i = 0\), a contradiction. So the set \(\{ i : [x^n]f_i \neq 0\} \subseteq \{ 0, 1, \ldots , N\} \) is finite.

Equality. Once summability is established, Theorem 1.475 gives \(\lim _{i \to \infty } \sum _{n=0}^{i} f_n = \sum _{n \in \mathbb {N}} f_n\). By uniqueness of limits, \(\sum _{n \in \mathbb {N}} f_n = \ell \).

Theorem 1.479

Let \(\left( f_{0},f_{1},f_{2},\ldots \right) \) be a sequence of FPSs such that \(\lim \limits _{i\rightarrow \infty }\prod _{n=0}^{i}f_{n}\) exists. Then, the family \(\left( f_{n}\right) _{n\in \mathbb {N}}\) is multipliable, and satisfies

\[ \prod _{n\in \mathbb {N}}f_{n}=\lim \limits _{i\rightarrow \infty }\prod _{n=0}^{i}f_{n}. \]
theorem PowerSeries.isMultipliable_of_coeffStabilizesTo_partial_prod {K : Type u_1} [CommRing K] {f : PowerSeries K} {lim : PowerSeries K} (h : CoeffStabilizesTo (fun (i : ) => jFinset.range (i + 1), f j) lim) (hconst : ∀ (i : ), constantCoeff (f i) = 1) :
theorem PowerSeries.tprod'_eq_of_coeffStabilizesTo_partial_prod {K : Type u_1} [CommRing K] {f : PowerSeries K} {lim : PowerSeries K} (h : CoeffStabilizesTo (fun (i : ) => jFinset.range (i + 1), f j) lim) (hconst : ∀ (i : ), constantCoeff (f i) = 1) :
tprod' f = lim
Proof

Multipliability. We first show that \([x^0]f_i = 1\) for all \(i\). Since the \(0\)-th coefficient of \(\prod _{j=0}^{i} f_j\) stabilizes to \([x^0]\ell \), and \([x^0](\prod _{j=0}^{i} f_j) = \prod _{j=0}^{i} [x^0]f_j\), the product of the constant coefficients stabilizes; this forces \([x^0]f_i = 1\) for all sufficiently large \(i\), and since the constant coefficients are units whose product stabilizes, we get \([x^0]f_i = 1\) for all \(i\).

Next, we need to show that for each \(n\), eventually \(f_i \equiv 1 \pmod{x^{n+1}}\) (i.e., \([x^k]f_i = \delta _{k,0}\) for all \(k \leq n\)).

We prove this by strong induction on \(k\): for \(0 {\lt} k \leq n\) and sufficiently large \(i\), \([x^k]f_i = 0\).

Let \(P_i = \prod _{j=0}^{i-1} f_j\) denote the partial product (so that the partial product up to \(i\) is \(P_i \cdot f_i\)). By hypothesis, the \(k\)-th coefficient of both \(P_{i+1} = P_i \cdot f_i\) and \(P_i\) eventually stabilizes to \([x^k]\ell \). Hence eventually \([x^k](P_i \cdot f_i) = [x^k]P_i\).

Expanding \([x^k](P_i \cdot f_i)\) via the convolution formula and using \([x^0]f_i = 1\), we get

\[ [x^k]P_i + \sum _{\substack{[(, a, ,, b, ), , \in , \mathrm , {, a, n, t, i, d, i, a, g, }, (, k, ), , \\ , , b, , \neq , 0, ,, , b, , \neq , k]}} [x^a]P_i \cdot [x^b]f_i + [x^0]P_i \cdot [x^k]f_i = [x^k]P_i. \]

Since \([x^0]P_i = 1\) (as a product of FPSs with constant term \(1\)), the last term equals \([x^k]f_i\). By the induction hypothesis, the middle sum vanishes (since \(0 {\lt} b {\lt} k\) and \([x^b]f_i = 0\) for large \(i\)). Thus \([x^k]f_i = 0\).

Note: the formalization adds \([x^0]f_i = 1\) as an explicit hypothesis rather than deriving it from the existence of the limit.

Equality. Once multipliability is established, Theorem 1.476 gives \(\lim \prod _{n=0}^{i} f_n = \prod _{n \in \mathbb {N}} f_n\), and uniqueness of limits gives the result.