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

1.8 Exponentials and logarithms

Convention 1.210
#

Throughout this section (unless otherwise stated), we assume that \(K\) is not just a commutative ring, but actually a commutative \(\mathbb {Q}\)-algebra.

1.8.1 Definitions

Definition 1.211
#

Define three FPS \(\exp \), \(\overline{\log }\) and \(\overline{\exp }\) in \(K\left[\left[x\right]\right]\) by

\begin{align*} \exp & :=\sum _{n\in \mathbb {N}}\frac{1}{n!}x^{n},\\ \overline{\log } & :=\sum _{n\geq 1}\frac{\left(-1\right)^{n-1}}{n}x^{n},\\ \overline{\exp } & :=\exp -1=\sum _{n\geq 1}\frac{1}{n!}x^{n}. \end{align*}

(The last equality sign here follows from \(\exp =\sum _{n\in \mathbb {N}}\frac{1}{n!}x^{n}=\underbrace{\frac{1}{0!}}_{=1}\underbrace{x^{0}}_{=1} +\sum _{n\geq 1}\frac{1}{n!}x^{n}=1+\sum _{n\geq 1}\frac{1}{n!}x^{n}\).)

noncomputable def PowerSeries.logbar (K : Type u_1) [CommRing K] [Algebra K] :

1.8.2 Helpers for derivative computations

Lemma 1.212 The series \((1+x)^{-1}\)

Define the FPS

\[ \iota := \sum _{n \in \mathbb {N}} (-1)^n x^n. \]

This is the geometric series for \((1+x)^{-1}\); indeed, \(\iota \cdot (1+x) = 1\).

noncomputable def PowerSeries.invOnePlusX (K : Type u_1) [CommRing K] [Algebra K] :
Proof

Direct verification: the product is computed coefficient-wise and shown to equal \(1\).

Lemma 1.213 Derivative of \(\overline{\log }\)

We have \(\overline{\log }' = \iota = (1+x)^{-1}\).

Proof

By computing the derivative of \(\overline{\log } = \sum _{n \ge 1} \frac{(-1)^{n-1}}{n} x^n\) term-by-term: \(\overline{\log }' = \sum _{n \ge 1} (-1)^{n-1} x^{n-1} = \sum _{n \ge 0} (-1)^n x^n = \iota \).

Lemma 1.214 Derivative of \(\overline{\exp }\)

We have \(\overline{\exp }' = \exp \).

Proof

Since \(\overline{\exp } = \exp - 1\), we have \(\overline{\exp }' = \exp ' - 0 = \exp ' = \exp \), where the last equality is the standard fact \(\exp ' = \exp \).

Lemma 1.215 Substitution of \((1+x)^{-1}\)

Let \(g \in K[\! [x ]\! ]\) with \([x^0]g = 0\). Then \(\iota \circ g = (1+g)^{-1}\).

Proof

We have \((\iota \circ g) \cdot (1 + g) = (\iota \cdot (1+x)) \circ g = 1 \circ g = 1\). Since \([x^0](1+g) \ne 0\), this gives \(\iota \circ g = (1+g)^{-1}\).

1.8.3 The exponential and the logarithm are inverse

Proposition 1.216

Let \(g\in K\left[\left[x\right]\right]\) with \(\left[x^{0}\right]g=0\). Then:

(a) We have

\[ \left(\overline{\exp }\circ g\right)^{\prime }=\left(\exp \circ g\right) ^{\prime }=\left(\exp \circ g\right)\cdot g^{\prime }. \]

(b) We have

\[ \left(\overline{\log }\circ g\right)^{\prime }=\left(1+g\right) ^{-1}\cdot g^{\prime }. \]
theorem PowerSeries.derivative_exp_comp {K : Type u_1} [CommRing K] [Algebra K] {g : PowerSeries K} (hg : constantCoeff g = 0) :
(derivative K) (subst g (exp K)) = subst g (exp K) * (derivative K) g
theorem PowerSeries.derivative_expbar_comp {K : Type u_1} [CommRing K] [Algebra K] {g : PowerSeries K} (hg : constantCoeff g = 0) :
(derivative K) (subst g (expbar K)) = subst g (exp K) * (derivative K) g
theorem PowerSeries.derivative_logbar_comp {K : Type u_2} [Field K] [Algebra K] {g : PowerSeries K} (hg : constantCoeff g = 0) :
(derivative K) (subst g (logbar K)) = (1 + g)⁻¹ * (derivative K) g
Proof

(a) Let us first show that \(\overline{\exp }^{\prime }=\exp ^{\prime }=\exp \). Indeed, \(\overline{\exp }=\exp -1\), so that \(\exp =\overline{\exp }+1\) and therefore

\begin{align} \exp ^{\prime } & =\left(\overline{\exp }+1\right)^{\prime }=\overline{\exp }^{\prime }+\underbrace{1^{\prime }}_{=0} =\overline{\exp }^{\prime }. \label{pf.prop.fps.exp-log-der.a.1} \end{align}

Next, we recall that \(\exp =\sum _{n\in \mathbb {N}}\frac{1}{n!}x^{n}\). Hence, the definition of a derivative yields

\begin{align} \exp ^{\prime } & =\sum _{n\geq 1}\underbrace{n\cdot \frac{1}{n!}}_{\substack{[=, \dfrac , {, 1, }, {, \left , (, n, -, 1, \right , ), !, }, \\ , \text , {, (, s, i, n, c, e, , }, n, !, =, n, \cdot , \left , (, , n, -, 1, \right , ), !, \text , {, ), }]}}x^{n-1}=\sum _{n\geq 1}\frac{1}{\left(n-1\right) !}x^{n-1}=\sum _{n\in \mathbb {N}}\frac{1}{n!}x^{n}\nonumber \\ & \qquad \qquad \left(\text{here, we have substituted }n\text{ for }n-1\text{ in the sum}\right) \nonumber \\ & =\exp . \label{pf.prop.fps.exp-log-der.a.2} \end{align}

Comparing this with (26), we find

\begin{equation} \overline{\exp }^{\prime }=\exp . \label{pf.prop.fps.exp-log-der.a.3} \end{equation}
28

Now, we can apply the chain rule to \(f=\overline{\exp }\) (since \(\left[x^{0}\right]g=0\)), and thus obtain

\[ \left(\overline{\exp }\circ g\right)^{\prime }=\left(\underbrace{\overline{\exp }^{\prime }}_{=\exp }\circ \, g\right)\cdot g^{\prime }=\left(\exp \circ g\right)\cdot g^{\prime }. \]

The same computation (but with \(\overline{\exp }\) replaced by \(\exp \)) yields \(\left(\exp \circ g\right)^{\prime }=\left(\exp \circ g\right)\cdot g^{\prime }\). Combining these two formulas, we obtain \(\left(\overline{\exp }\circ g\right)^{\prime }=\left(\exp \circ g\right)^{\prime }=\left( \exp \circ g\right)\cdot g^{\prime }\). This proves part (a).

(b) We have \(\overline{\log }=\sum _{n\geq 1}\frac{\left(-1\right) ^{n-1}}{n}x^{n}\). Thus,

\begin{align*} \overline{\log }^{\prime } & =\left(\sum _{n\geq 1}\frac{\left(-1\right) ^{n-1}}{n}x^{n}\right)^{\prime } =\sum _{n\geq 1}\underbrace{\frac{\left(-1\right)^{n-1}}{n}n}_{=\left( -1\right)^{n-1}}\underbrace{x^{\prime }}_{=1}x^{n-1}=\sum _{n\geq 1}\left( -1\right)^{n-1}x^{n-1}=\sum _{n\in \mathbb {N}}\left(-1\right)^{n}x^{n} \end{align*}

(here, we have substituted \(n\) for \(n-1\) in the sum). On the other hand, \(\left(1+x\right)^{-1} =\sum _{n\in \mathbb {N}}\left(-1\right)^{n}x^{n}\). Comparing these two equalities, we find

\begin{equation} \overline{\log }^{\prime }=\left(1+x\right)^{-1}. \label{pf.prop.fps.exp-log-der.b.2} \end{equation}
29

Now, we can apply the chain rule to \(f=\overline{\log }\) (since \(\left[x^{0}\right]g=0\)), and thus obtain

\begin{equation} \left(\overline{\log }\circ g\right)^{\prime }=\left(\underbrace{\overline{\log }^{\prime }}_{=\left(1+x\right)^{-1}}\circ \, g\right)\cdot g^{\prime }=\left(\left(1+x\right)^{-1}\circ g\right)\cdot g^{\prime }. \label{pf.prop.fps.exp-log-der.b.3} \end{equation}
30

However, we claim that \(\left(1+x\right)^{-1}\circ g=\left(1+g\right) ^{-1}\). Indeed, \(\frac{1}{1+x}\circ g=\frac{1\circ g}{\left(1+x\right)\circ g}\) (since the FPS \(1+x\) is invertible), and \(1\circ \, g=\underline{1}\) and \(\left(1+x\right)\circ g=1+g\), so \(\left(1+x\right)^{-1}\circ g=\left(1+g\right)^{-1}\). Hence, (30) becomes

\[ \left(\overline{\log }\circ g\right)^{\prime }=\left(1+g\right)^{-1}\cdot g^{\prime }. \]

This proves part (b).

1.8.4 Helpers for Theorem 1.221

Lemma 1.217 ODE uniqueness: \(h' = (1+h) \cdot g\)

Let \(h_1, h_2, g \in K[\! [x ]\! ]\). If \(h_1' = (1 + h_1) \cdot g\) and \(h_2' = (1 + h_2) \cdot g\) and \([x^0] h_1 = [x^0] h_2\), then \(h_1 = h_2\).

theorem PowerSeries.eq_of_derivative_eq_mul_of_inv {K : Type u_1} [CommRing K] [Algebra K] {h₁ h₂ g : PowerSeries K} (hd₁ : (derivative K) h₁ = (1 + h₁) * g) (hd₂ : (derivative K) h₂ = (1 + h₂) * g) (hc : constantCoeff h₁ = constantCoeff h₂) :
h₁ = h₂
Proof

By strong induction on the coefficient index. The base case uses the matching constant terms. For the inductive step, the ODE relates \([x^{n+1}] h \cdot (n+1)\) to a convolution involving only lower coefficients; by the induction hypothesis, these coincide for \(h_1\) and \(h_2\), and one cancels \(n+1\) using the \(\mathbb {Q}\)-algebra structure.

Lemma 1.218 ODE uniqueness: \(h' = 1\)

Let \(h_1, h_2 \in K[\! [x ]\! ]\). If \(h_1' = 1\) and \(h_2' = 1\) and \([x^0] h_1 = [x^0] h_2\), then \(h_1 = h_2\).

theorem PowerSeries.eq_of_derivative_eq_one {K : Type u_1} [CommRing K] [Algebra K] {h₁ h₂ : PowerSeries K} (hd₁ : (derivative K) h₁ = 1) (hd₂ : (derivative K) h₂ = 1) (hc : constantCoeff h₁ = constantCoeff h₂) :
h₁ = h₂
Proof

As in Lemma 1.217, by strong induction on the coefficient index, cancelling \(n+1\) at each step.

Lemma 1.219 \(\iota \circ \overline{\exp }\) times \(\exp \)

We have \((\iota \circ \overline{\exp }) \cdot \exp = 1\).

Proof

We substitute \(\overline{\exp }\) into the identity \(\iota \cdot (1 + x) = 1\), noting that \((1 + x) \circ \overline{\exp } = 1 + \overline{\exp } = \exp \).

Lemma 1.220

Let \(f,g\in K\left[\left[x\right] \right]\) be two FPSs with \(\left[x^{0}\right]g=0\). Then, \(\left[ x^{0}\right]\left(f\circ g\right)=\left[x^{0}\right]f\).

Proof

Write \(f\) in the form \(f=\sum _{n\in \mathbb {N}}f_{n}x^{n}\) with \(f_{0},f_{1},f_{2},\ldots \in K\). Thus, \(f_{0}=\left[x^{0}\right]f\). Now, \(f\left[g\right]=\sum _{n\in \mathbb {N}}f_{n}g^{n}\). However, \(\left[x^{0}\right] \left(\sum _{n\in \mathbb {N}}f_{n}g^{n}\right)=f_{0}=\left[x^{0}\right] f\). In view of \(f\circ g=f\left[g\right]=\sum _{n\in \mathbb {N}}f_{n}g^{n}\), we can rewrite this as \(\left[x^{0}\right]\left(f\circ g\right) =\left[x^{0}\right]f\).

Theorem 1.221

We have

\[ \overline{\exp }\circ \overline{\log }=x\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \overline{\log }\circ \overline{\exp }=x. \]
Proof

Let us first prove that \(\overline{\log }\circ \overline{\exp }=x\).

The idea of this proof is to show that \(\overline{\log }\circ \overline{\exp }\) and \(x\) are two FPSs with the same constant term (namely, \(0\)) and with the same derivative. Once this is proved, they must be equal (since a FPS is determined by its constant term and its derivative over a \(\mathbb {Q}\)-algebra).

We have \(\left[x^{0}\right]\overline{\exp }=0\) (since \(\overline{\exp }=\sum _{n\geq 1}\frac{1}{n!}x^{n}\)). Hence, Lemma 1.220 (applied to \(f=\overline{\log }\) and \(g=\overline{\exp }\)) yields \(\left[x^{0}\right]\left(\overline{\log }\circ \overline{\exp }\right)=\left[x^{0}\right]\overline{\log }=0\) (since \(\overline{\log }=\sum _{n\geq 1}\frac{\left(-1\right)^{n-1}}{n}x^{n}\)). Now,

\begin{equation} \left[x^{0}\right]\left(\overline{\log }\circ \overline{\exp }-x\right) =\underbrace{\left[x^{0}\right]\left(\overline{\log }\circ \overline{\exp }\right)}_{=0}-\underbrace{\left[x^{0}\right]x}_{=0}=0. \label{pf.thm.fps.exp-log-inv.a.1} \end{equation}
31

However, \(\overline{\exp }=\exp -1\) and thus \(1+\overline{\exp }=\exp \). Now, Proposition 1.216 (b) (applied to \(g=\overline{\exp }\)) yields

\[ \left(\overline{\log }\circ \overline{\exp }\right)^{\prime }=\left( \underbrace{1+\overline{\exp }}_{=\exp }\right)^{-1}\cdot \underbrace{\overline{\exp }^{\prime }}_{=\exp }=\exp ^{-1}\cdot \exp =1=x^{\prime } \]

(where the underbrace uses (28), and \(x^{\prime }=1\)). Hence, \(\overline{\log }\circ \overline{\exp }-x\) is constant (since its derivative is \(0\)). In view of (31), this constant must be \(0\). Thus, \(\overline{\log }\circ \overline{\exp }=x\).

Now it remains to prove that \(\overline{\exp }\circ \overline{\log }=x\).

We shall first show that \(\exp \circ \overline{\log }=1+x\).

To wit: The FPS \(1+x\) is invertible. Applying the quotient rule to \(f=\exp \circ \, \overline{\log }\) and \(g=1+x\), we obtain

\[ \left(\frac{\exp \circ \, \overline{\log }}{1+x}\right)^{\prime } =\frac{\left(\exp \circ \, \overline{\log }\right)^{\prime }\cdot \left( 1+x\right)-\left(\exp \circ \, \overline{\log }\right)\cdot \left( 1+x\right)^{\prime }}{\left(1+x\right)^{2}}. \]

In view of

\[ \left(\exp \circ \, \overline{\log }\right)^{\prime } =\left(\exp \circ \, \overline{\log }\right)\cdot \underbrace{\overline{\log }^{\prime } }_{=\left(1+x\right)^{-1}} =\left(\exp \circ \, \overline{\log }\right)\cdot \left(1+x\right)^{-1} \]

(where we used (29)) and \(\left(1+x\right)^{\prime }=1\), we can rewrite this as

\begin{align*} \left(\frac{\exp \circ \, \overline{\log }}{1+x}\right)^{\prime } =\frac{\left(\exp \circ \, \overline{\log }\right)-\left(\exp \circ \, \overline{\log }\right)}{\left(1+x\right)^{2}}=0=0^{\prime }. \end{align*}

Thus, \(\frac{\exp \circ \, \overline{\log }}{1+x}\) is constant, say equal to \(\underline{a}\) for some \(a\in K\). Then \(\exp \circ \, \overline{\log }=a\left(1+x\right)\), so \(\left[x^{0}\right]\left(\exp \circ \, \overline{\log }\right)=a\). However, it is easy to see that \(\left[x^{0}\right]\left(\exp \circ \, \overline{\log }\right)=1\) (using Lemma 1.220). Comparing, we find \(a=1\). Thus, \(\exp \circ \, \overline{\log }=1+x\).

Now, \(\overline{\exp }=\exp -1=\exp +\, \underline{-1}\). Hence,

\begin{align*} \overline{\exp }\circ \overline{\log } =\underbrace{\exp \circ \, \overline{\log }}_{=1+x}+\underbrace{\underline{-1} \circ \overline{\log }}_{=\underline{-1}} =1+x+\underline{-1}=x. \end{align*}

This completes the proof.

1.8.5 The exponential and the logarithm of an FPS

Definition 1.222
#

(a) We let \(K\left[\left[x\right] \right]_{0}\) denote the set of all FPSs \(f\in K\left[\left[x\right] \right]\) with \(\left[x^{0}\right]f=0\).

(b) We let \(K\left[\left[x\right]\right]_{1}\) denote the set of all FPSs \(f\in K\left[\left[x\right]\right]\) with \(\left[ x^{0}\right]f=1\).

(c) We define two maps

\begin{align*} \operatorname {Exp}:K\left[\left[x\right]\right]_{0} & \rightarrow K\left[\left[x\right]\right]_{1},\\ g & \mapsto \exp \circ g \end{align*}

and

\begin{align*} \operatorname {Log}:K\left[\left[x\right]\right]_{1} & \rightarrow K\left[\left[x\right]\right]_{0},\\ f & \mapsto \overline{\log }\circ \left(f-1\right). \end{align*}

(These two maps are well-defined according to parts (c) and (d) of Lemma 1.223 below.)

Lemma 1.223

(a) For any \(f,g\in K\left[\left[ x\right]\right]_{0}\), we have \(f\circ g\in K\left[\left[x\right] \right]_{0}\).

(b) For any \(f\in K\left[\left[x\right]\right]_{1}\) and \(g\in K\left[\left[x\right]\right]_{0}\), we have \(f\circ g\in K\left[ \left[x\right]\right]_{1}\).

(c) For any \(g\in K\left[\left[x\right]\right]_{0}\), we have \(\exp \circ g\in K\left[\left[x\right]\right]_{1}\).

(d) For any \(f\in K\left[\left[x\right]\right]_{1}\), we have \(f-1\in K\left[\left[x\right]\right]_{0}\) and \(\overline{\log } \circ \left(f-1\right)\in K\left[\left[x\right]\right]_{0}\).

Proof

(a) Let \(f,g\in K\left[\left[x\right]\right]_{0}\). Then \(\left[ x^{0}\right]f=0\) and \(\left[x^{0}\right]g=0\). Hence, Lemma 1.220 yields \(\left[x^{0}\right]\left(f\circ g\right)=\left[x^{0}\right]f=0\). In other words, \(f\circ g\in K\left[ \left[x\right]\right]_{0}\).

(b) This is analogous to the proof of part (a).

(c) Let \(g\in K\left[\left[x\right]\right]_{0}\). From \(\exp =\sum _{n\in \mathbb {N}}\frac{1}{n!}x^{n}\), we obtain \(\left[ x^{0}\right]\exp =1\), so that \(\exp \in K\left[\left[ x\right]\right]_{1}\). Hence, part (b) (applied to \(f=\exp \)) yields \(\exp \circ g\in K\left[\left[ x\right]\right]_{1}\).

(d) Let \(f\in K\left[\left[x\right]\right]_{1}\). Thus, \(\left[x^{0}\right]f=1\). Now, \(\left[x^{0}\right]\left(f-1\right)=\left[x^{0}\right] f-\left[x^{0}\right]1=1-1=0\), so that \(f-1\in K\left[\left[x\right]\right]_{0}\). Furthermore, \(\left[x^{0}\right] \overline{\log }=0\) and thus \(\overline{\log }\in K\left[\left[ x\right]\right]_{0}\). Hence, part (a) (applied to \(\overline{\log }\) and \(f-1\) instead of \(f\) and \(g\)) yields \(\overline{\log }\circ \left(f-1\right)\in K\left[\left[x\right] \right]_{0}\).

Lemma 1.224

The maps \(\operatorname {Exp}\) and \(\operatorname {Log}\) are mutually inverse bijections between \(K\left[ \left[x\right]\right]_{0}\) and \(K\left[\left[x\right]\right]_{1}\).

Proof

First, we make a simple auxiliary observation: Each \(g\in K\left[\left[x\right]\right]_{0}\) satisfies

\begin{equation} \exp \circ g=\overline{\exp }\circ g+1. \label{pf.lem.fps.Exp-Log-maps-inv.1} \end{equation}
32

[Proof of (32): Recall that \(\overline{\exp }=\exp -1\), so that \(\exp =\overline{\exp }+\underline{1}\). Hence, \(\exp \circ g=\left(\overline{\exp }+\underline{1}\right)\circ g=\overline{\exp }\circ g+\underline{1}\circ g\). But \(\underline{1}\circ g=\underline{1}=1\). Hence, \(\exp \circ g=\overline{\exp }\circ g+1\).]

Now, let us show that \(\operatorname {Exp}\circ \operatorname {Log} =\operatorname {id}\). Indeed, we fix some \(f\in K\left[\left[x\right] \right]_{1}\). Then, \(f-1\in K\left[\left[x\right]\right]_{0}\) (by Lemma 1.223 (d)). By associativity of composition and Theorem 1.221, we get

\[ \overline{\exp }\circ \left(\overline{\log }\circ \left(f-1\right)\right) =\underbrace{\left(\overline{\exp }\circ \overline{\log }\right) }_{=x}\circ \left(f-1\right)=x\circ \left(f-1\right) =f-1. \]

Hence

\begin{align*} \left(\operatorname {Exp}\circ \operatorname {Log}\right)\left(f\right) & =\exp \circ \left(\operatorname {Log}f\right) \\ & =\overline{\exp }\circ \underbrace{\left(\operatorname {Log}f\right) }_{=\overline{\log }\circ \left(f-1\right)}+\, 1 \end{align*}

(by (32)), so

\begin{align*} \left(\operatorname {Exp}\circ \operatorname {Log}\right)\left(f\right) & =\underbrace{\overline{\exp }\circ \left(\overline{\log }\circ \left( f-1\right)\right)}_{=f-1}+\, 1 =\left(f-1\right)+1=f. \end{align*}

Using a similar argument (with \(\overline{\log }\circ \overline{\exp }=x\) from Theorem 1.221), we can show that \(\operatorname {Log}\circ \operatorname {Exp}=\operatorname {id}\). Combining, \(\operatorname {Exp}\) and \(\operatorname {Log}\) are mutually inverse bijections.

1.8.6 Helpers for the group structure

Lemma 1.225 \(f - 1 \in K[\! [x ]\! ]_0\) when \(f \in K[\! [x ]\! ]_1\)

If \(f \in K[\! [x ]\! ]_1\) (i.e., \([x^0]f = 1\)), then \(f - 1 \in K[\! [x ]\! ]_0\) (i.e., \([x^0](f-1) = 0\)).

Proof

\([x^0](f - 1) = [x^0]f - 1 = 1 - 1 = 0\).

Lemma 1.226 ODE uniqueness: \(h' = h \cdot g\)

Let \(h_1, h_2, g \in K[\! [x ]\! ]\). If \(h_1' = h_1 \cdot g\) and \(h_2' = h_2 \cdot g\) and \([x^0] h_1 = [x^0] h_2\), then \(h_1 = h_2\).

theorem PowerSeries.eq_of_derivative_eq_mul_self {K : Type u_2} [CommRing K] [Algebra K] {h₁ h₂ g : PowerSeries K} (hd₁ : (derivative K) h₁ = h₁ * g) (hd₂ : (derivative K) h₂ = h₂ * g) (hc : constantCoeff h₁ = constantCoeff h₂) :
h₁ = h₂
Proof

By strong induction on the coefficient index. The ODE gives \([x^{n+1}] h \cdot (n+1) = [x^n](h \cdot g)\); the right side is a convolution involving only coefficients of \(h\) of index \(\le n\), which agree by induction hypothesis. Cancelling \(n+1\) uses the \(\mathbb {Q}\)-algebra structure.

Lemma 1.227 \(\operatorname {Exp}(0) = 1\) and \(\operatorname {Log}(1) = 0\)

The map \(\operatorname {Exp}\) sends \(0 \in K[\! [x ]\! ]_0\) to \(1 \in K[\! [x ]\! ]_1\), and \(\operatorname {Log}\) sends \(1\) to \(0\).

theorem PowerSeries.Exp_zero {K : Type u_2} [CommRing K] [Algebra K] :
Exp 0, = 1,
theorem PowerSeries.Log_one {K : Type u_2} [CommRing K] [Algebra K] :
Log 1, = 0,
Proof

\(\operatorname {Exp}(0) = \exp \circ 0 = 1\) (since \([x^0]\exp = 1\) and substituting \(0\) picks out the constant term). \(\operatorname {Log}(1) = \overline{\log } \circ (1 - 1) = \overline{\log } \circ 0 = 0\) (since \([x^0]\overline{\log } = 0\)).

1.8.7 Addition to multiplication

Lemma 1.228

(a) For any \(f,g\in K\left[\left[ x\right]\right]_{0}\), we have

\[ \operatorname {Exp}\left(f+g\right)=\operatorname {Exp}f\cdot \operatorname {Exp}g. \]

(b) For any \(f,g\in K\left[\left[x\right]\right]_{1}\), we have

\[ \operatorname {Log}\left(fg\right)=\operatorname {Log} f+\operatorname {Log}g. \]
theorem PowerSeries.Exp_add {K : Type u_2} [CommRing K] [Algebra K] (f g : PowerSeries₀) :
Exp f + g, = (Exp f) * (Exp g),
theorem PowerSeries.Log_mul {K : Type u_2} [CommRing K] [Algebra K] (f g : PowerSeries₁) :
Log f * g, = (Log f) + (Log g),
Proof

(a) Let \(f,g\in K\left[\left[x\right]\right]_{0}\). Thus, \(\left[ x^{0}\right]f=0\) and \(\left[x^{0}\right]g=0\). By the definition of \(\operatorname {Exp}\), we have

\[ \operatorname {Exp}f=\exp \circ f=\sum _{n\in \mathbb {N} }\frac{1}{n!}f^{n}. \]

Similarly, \(\operatorname {Exp}g=\sum _{n\in \mathbb {N}}\frac{1}{n!}g^{n}\) and \(\operatorname {Exp}\left(f+g\right)=\sum _{n\in \mathbb {N}}\frac{1}{n!}\left(f+g\right)^{n}\).

Now, the latter equality becomes

\begin{align*} \operatorname {Exp}\left(f+g\right) & =\sum _{n\in \mathbb {N}}\frac{1}{n!}\sum \limits _{k=0} ^{n}\binom {n}{k}f^{k}g^{n-k} =\sum _{k\in \mathbb {N}}\ \ \sum \limits _{\ell \in \mathbb {N}}\frac{1}{k!\ell !}f^{k}g^{\ell }. \end{align*}

Comparing this with \(\operatorname {Exp}f\cdot \operatorname {Exp}g =\sum _{k\in \mathbb {N}}\ \ \sum _{\ell \in \mathbb {N}}\frac{1}{k!\ell !}f^{k}g^{\ell }\), we obtain \(\operatorname {Exp}\left(f+g\right)=\operatorname {Exp} f\cdot \operatorname {Exp}g\).

(In the Lean formalization, this is proved via ODE uniqueness: both sides satisfy the ODE \(h^{\prime } = h \cdot (f^{\prime } + g^{\prime })\) with the same initial condition.)

(b) This follows from part (a), since we know that \(\operatorname {Log}\) is inverse to \(\operatorname {Exp}\). Setting \(u=\operatorname {Log}f\) and \(v=\operatorname {Log}g\), part (a) gives \(\operatorname {Exp}\left(u+v\right)=\operatorname {Exp}u\cdot \operatorname {Exp}v\), and applying \(\operatorname {Log}\) (using Lemma 1.224) yields \(\operatorname {Log}\left(fg\right)=\operatorname {Log}f+\operatorname {Log}g\).

Proposition 1.229

(a) The subset \(K\left[\left[ x\right]\right]_{0}\) of \(K\left[\left[x\right]\right]\) is closed under addition and subtraction and contains \(0\), and thus forms a group \(\left(K\left[\left[x\right]\right]_{0},+,0\right)\).

(b) The subset \(K\left[\left[x\right]\right]_{1}\) of \(K\left[\left[x\right]\right]\) is closed under multiplication and division and contains \(1\), and thus forms a group \(\left(K\left[\left[ x\right]\right]_{1},\cdot ,1\right)\).

Proof

(a) It is clear that the set \(K\left[\left[x\right]\right]_{0}\) contains the FPS \(0\) (since \(\left[x^{0}\right]0=0\)). If \(f,g\in K\left[\left[x\right]\right]_{0}\), then \(\left[x^{0}\right]f=0\) and \(\left[x^{0}\right]g=0\), and therefore \(f+g\in K\left[\left[x\right]\right]_{0}\) (since \(\left[x^{0}\right]\left( f+g\right)=0+0=0\)) and \(f-g\in K\left[\left[x\right]\right] _{0}\) (by a similar argument).

(b) Any \(a\in K\left[\left[ x\right]\right]_{1}\) is invertible in \(K\left[\left[x\right]\right]\) (since \(\left[x^{0}\right]a=1\) is invertible in \(K\)). Next, \(K\left[\left[x\right]\right]_{1}\) is closed under multiplication: if \(f,g\in K\left[\left[x\right]\right]_{1}\), then \(\left[x^{0}\right]f=1\) and \(\left[x^{0}\right]g=1\), and therefore \(\left[x^{0}\right]\left( fg\right)=1\cdot 1=1\). Similarly, \(K\left[\left[x\right]\right]_{1}\) is closed under division.

Theorem 1.230

The maps

\[ \operatorname {Exp}:\left(K\left[\left[x\right]\right]_{0} ,+,0\right)\rightarrow \left(K\left[\left[x\right]\right]_{1} ,\cdot ,1\right) \]

and

\[ \operatorname {Log}:\left(K\left[\left[x\right]\right]_{1} ,\cdot ,1\right)\rightarrow \left(K\left[\left[x\right]\right] _{0},+,0\right) \]

are mutually inverse group isomorphisms.

theorem PowerSeries.Exp_Log_groupIso {K : Type u_2} [CommRing K] [Algebra K] :
(Function.LeftInverse Log Exp Function.RightInverse Log Exp) (∀ (f g : PowerSeries₀), Exp f + g, = (Exp f) * (Exp g), ) Exp 0, = 1,
Proof

Lemma 1.228 yields that these two maps are group homomorphisms. Lemma 1.224 shows that they are mutually inverse. Combining these results, we conclude that these two maps are mutually inverse group isomorphisms.

1.8.8 Helpers for the logarithmic derivative

Lemma 1.231 \(\iota = (1+x)^{-1}\)

Over a field (or \(\mathbb {Q}\)-algebra), \(\iota \) equals the formal inverse \((1 + x)^{-1}\) in \(K[\! [x ]\! ]\).

Proof

Both sides multiply with \((1+x)\) to give \(1\); since the constant coefficient of \(1+x\) is nonzero, the inverse is unique.

Lemma 1.232 Substitution of inverses

If \(a \cdot b = 1\) in \(K[\! [x ]\! ]\) and \(g\) has constant term \(0\), then \((a \circ g)^{-1} = b \circ g\).

theorem PowerSeries.subst_inv_of_mul_eq_one {R : Type u_2} [Field R] {g a b : PowerSeries R} (hg : HasSubst g) (hab : a * b = 1) :
(subst g a)⁻¹ = subst g b
Proof

Substitution is a ring homomorphism, so \((a \circ g) \cdot (b \circ g) = (a \cdot b) \circ g = 1 \circ g = 1\). Since \([x^0](a \circ g) \ne 0\), the inverse is unique.

1.8.9 The logarithmic derivative

Definition 1.233
#

In this definition, we do not use Convention 1.210; thus, \(K\) can be an arbitrary commutative ring. However, we set \(K\left[\left[x\right]\right]_{1}=\left\{ f\in K\left[\left[x\right]\right]\ \mid \ \left[x^{0}\right]f=1\right\} \).

For any FPS \(f\in K\left[\left[x\right]\right]_{1}\), we define the logarithmic derivative \(\operatorname {loder}f\in K\left[\left[ x\right]\right]\) to be the FPS \(\frac{f^{\prime }}{f}\). (This is well-defined, since \(f\) is easily seen to be invertible.)

noncomputable def PowerSeries.loder {R : Type u_2} [Field R] (f : PowerSeries R) :
Lemma 1.234 Invertibility of FPS with constant term \(1\)

If \([x^0]f = 1\), then \(f\) is a unit in \(K[\! [x ]\! ]\), i.e., \(f \cdot f^{-1} = 1\) and \(f^{-1} \cdot f = 1\). Moreover, \([x^0](f^{-1}) = 1\). More generally, \(f\) is a unit iff \([x^0]f\) is a unit in \(K\).

Proof

Since \([x^0]f\) is a unit, the invertibility criterion for power series gives the result (a power series is invertible if and only if its constant coefficient is invertible). The constant coefficient of \(f^{-1}\) is the inverse of \([x^0]f = 1\).

Lemma 1.235 \(\operatorname {loder}(1) = 0\)

\(\operatorname {loder}(1) = 0\).

theorem PowerSeries.loder_one {R : Type u_2} [Field R] :
loder 1 = 0
Proof

\(1' = 0\), so \(\operatorname {loder}(1) = 0 \cdot 1^{-1} = 0\).

Proposition 1.236

Let \(K\) be a commutative \(\mathbb {Q}\)-algebra. Let \(f\in K\left[\left[x\right]\right]_{1}\) be an FPS. Then, \(\operatorname {loder}f=\left(\operatorname {Log}f\right)^{\prime }\).

theorem PowerSeries.loder_eq_derivative_Log {R : Type u_2} [Field R] [Algebra R] {f : PowerSeries R} (hf : constantCoeff f = 1) :
f.loder = (derivative R) (subst (f - 1) (logbar R))
Proof

The definition of \(\operatorname {Log}\) yields \(\operatorname {Log}f=\overline{\log }\circ \left( f-1\right)\).

From \(f\in K\left[\left[x\right]\right]_{1}\), we obtain \(\left[ x^{0}\right]f=1\). Now, \(\left[x^{0}\right] \left(f-1\right)=\left[x^{0}\right]f-\left[x^{0}\right]1=0\). Hence, Proposition 1.216 (b) (applied to \(g=f-1\)) yields

\[ \left(\overline{\log }\circ \left(f-1\right)\right)^{\prime }=\left( \underbrace{1+\left(f-1\right)}_{=f}\right)^{-1}\cdot \left(f-1\right) ^{\prime }=f^{-1}\cdot \left(f-1\right)^{\prime }=\frac{\left(f-1\right) ^{\prime }}{f}. \]

In view of \(\operatorname {Log}f=\overline{\log }\circ \left(f-1\right)\), we can rewrite this as \(\left(\operatorname {Log}f\right)^{\prime }=\frac{\left(f-1\right) ^{\prime }}{f}\).

Since \(\left(f-1\right)^{\prime }=f^{\prime }\), we can rewrite this further as \(\left(\operatorname {Log}f\right)^{\prime }=\frac{f^{\prime }}{f}=\operatorname {loder}f\).

Proposition 1.237

Let \(f,g\in K\left[\left[x\right]\right] _{1}\) be two FPSs. Then, \(\operatorname {loder}\left(fg\right) =\operatorname {loder}f+\operatorname {loder}g\).

(Here, we do not use Convention 1.210; thus, \(K\) can be an arbitrary commutative ring.)

theorem PowerSeries.loder_mul {R : Type u_2} [Field R] {f g : PowerSeries R} (hf : constantCoeff f = 1) (hg : constantCoeff g = 1) :
(f * g).loder = f.loder + g.loder
Proof

The definition of a logarithmic derivative yields \(\operatorname {loder}f=\frac{f^{\prime }}{f}\) and \(\operatorname {loder}g=\frac{g^{\prime }}{g}\), but it also yields

\begin{align*} \operatorname {loder}\left(fg\right) & =\frac{\left(fg\right) ^{\prime }}{fg}=\frac{f^{\prime }g+fg^{\prime }}{fg} \qquad \text{(by the product rule)} =\underbrace{\frac{f^{\prime }}{f}}_{=\operatorname {loder}f} +\underbrace{\frac{g^{\prime }}{g}}_{=\operatorname {loder}g} =\operatorname {loder}f+\operatorname {loder}g. \end{align*}
Corollary 1.238

Let \(f_{1},f_{2},\ldots ,f_{k}\) be any \(k\) FPSs in \(K\left[\left[x\right]\right]_{1}\). Then,

\[ \operatorname {loder}\left(f_{1}f_{2}\cdots f_{k}\right) =\operatorname {loder}\left(f_{1}\right)+\operatorname {loder}\left( f_{2}\right)+\cdots +\operatorname {loder}\left(f_{k}\right). \]

(Here, we do not use Convention 1.210; thus, \(K\) can be an arbitrary commutative ring.)

theorem PowerSeries.loder_prod {R : Type u_2} [Field R] {ι : Type u_3} (s : Finset ι) (f : ιPowerSeries R) (hf : is, constantCoeff (f i) = 1) :
(∏ is, f i).loder = is, (f i).loder
Proof

Induct on \(k\). The base case (\(k=0\)) requires showing that \(\operatorname {loder}1=0\), which is easy to see from the definition of a logarithmic derivative (since \(1^{\prime }=0\)). The induction step follows easily from Proposition 1.237.

Corollary 1.239

Let \(f\) be any FPS in \(K\left[\left[x\right] \right]_{1}\). Then, \(\operatorname {loder}\left(f^{-1}\right) =-\operatorname {loder}f\).

(Here, we do not use Convention 1.210; thus, \(K\) can be an arbitrary commutative ring.)

theorem PowerSeries.loder_inv {R : Type u_2} [Field R] {f : PowerSeries R} (hf : constantCoeff f = 1) :
Proof

First of all, \(f\) is invertible. This shows that \(f^{-1}\) is well-defined.

Proposition 1.237 (applied to \(g=f^{-1}\)) yields \(\operatorname {loder}\left(ff^{-1}\right)=\operatorname {loder} f+\operatorname {loder}\left(f^{-1}\right)\). However, we also have \(\operatorname {loder}\left(\underbrace{ff^{-1}}_{=1}\right) =\operatorname {loder}1=0\) (since \(1^{\prime }=0\)). Comparing these two equalities, we obtain \(\operatorname {loder}f+\operatorname {loder}\left( f^{-1}\right)=0\). In other words, \(\operatorname {loder}\left( f^{-1}\right)=-\operatorname {loder}f\).

1.8.10 Summable and multipliable families

Definition 1.240 Summable and multipliable families

A family \((f_i)_{i \in I}\) of FPSs in \(K[\! [x ]\! ]_0\) is summable if for each coefficient index \(n\), only finitely many \([x^n](f_i)\) are nonzero.

A family \((f_i)_{i \in I}\) of FPSs in \(K[\! [x ]\! ]_1\) is multipliable if for each coefficient index \(n\), all but finitely many \(f_i\) satisfy \([x^k](f_i - 1) = 0\) for all \(1 \le k \le n\).

For summable families, the coefficient-wise sum \(\sum _{i \in I} f_i\) belongs to \(K[\! [x ]\! ]_0\). For multipliable families, the product \(\prod _{i \in I} f_i\) belongs to \(K[\! [x ]\! ]_1\).

def PowerSeries.SummableFPS₀ {K : Type u_2} [CommRing K] {I : Type u_3} (f : IPowerSeries₀) :
noncomputable def PowerSeries.summableFPS₀Sum {K : Type u_2} [CommRing K] {I : Type u_3} (f : IPowerSeries₀) (_hf : SummableFPS₀ f) :
noncomputable def PowerSeries.multipliableFPS₁Prod {K : Type u_2} [CommRing K] {I : Type u_3} (f : IPowerSeries₁) (hf : MultipliableFPS₁ f) :
Proof

For the sum: the constant coefficient of each \(f_i\) is \(0\), so the sum of constant coefficients is \(0\). For the product: the constant coefficient of \(\prod f_i\) is \(\prod [x^0](f_i) = \prod 1 = 1\).

1.8.11 Exp and Log for infinite products and sums

Lemma 1.241 Summability of \(\operatorname {Log}\)-images

If \((f_i)_{i \in I}\) is a multipliable family in \(K[\! [x ]\! ]_1\), then \((\operatorname {Log} f_i)_{i \in I}\) is a summable family in \(K[\! [x ]\! ]_0\) (meaning that for each coefficient index \(n\), only finitely many \([\operatorname {Log} f_i]_n\) are nonzero).

theorem PowerSeries.Log_summable_of_multipliable {K : Type u_2} [CommRing K] [Algebra K] {I : Type u_3} (f : IPowerSeries₁) (hf : MultipliableFPS₁ f) :
SummableFPS₀ fun (i : I) => Log (f i)
Proof

For each \(n\), let \(M\) be an \(x^n\)-approximator for the product family. If \(i \notin M\), then \([x^k](f_i) = 0\) for \(1 \le k \le n\) (by the approximator property). This forces \([(f_i - 1)]_k = 0\) for \(0 \le k \le n\), and a substitution argument shows \([\operatorname {Log} f_i]_n = 0\). Hence the set of \(i\) with nonzero \(n\)-th coefficient is contained in \(M\).

Proposition 1.242 \(\operatorname {Log}\) of infinite product

If \((f_i)_{i \in I}\) is a multipliable family in \(K[\! [x ]\! ]_1\), then

\[ \operatorname {Log}\Bigl(\prod _{i \in I} f_i\Bigr) = \sum _{i \in I} \operatorname {Log}(f_i), \]

where the right side is the coefficient-wise sum (which is well-defined by Lemma 1.241).

theorem PowerSeries.Log_tprod {K : Type u_2} [CommRing K] [Algebra K] {I : Type u_3} (f : IPowerSeries₁) (hf : MultipliableFPS₁ f) (hf_sum : SummableFPS₀ fun (i : I) => Log (f i) := ) :
Log (multipliableFPS₁Prod f hf) = summableFPS₀Sum (fun (i : I) => Log (f i)) hf_sum
Proof

For each \(n\), choose an \(x^n\)-approximator \(M\). By the finite version (\(\operatorname {Log}\) of a finite product equals the sum of \(\operatorname {Log}\)s, which follows from Lemma 1.228(b) by induction), we have \(\operatorname {Log}(\prod _{i \in M} f_i) = \sum _{i \in M} \operatorname {Log}(f_i)\). The \(n\)-th coefficient of the infinite product agrees with that of the finite product over \(M\), and the \(n\)-th coefficient of the sum is the finite sum over \(M\) (since \([\operatorname {Log} f_i]_n = 0\) for \(i \notin M\)). A coefficient comparison argument completes the proof.

Lemma 1.243 Multipliability of \(\operatorname {Exp}\)-images

If \((g_i)_{i \in I}\) is a summable family in \(K[\! [x ]\! ]_0\), then \((\operatorname {Exp} g_i)_{i \in I}\) is a multipliable family in \(K[\! [x ]\! ]_1\).

theorem PowerSeries.Exp_multipliable_of_summable {K : Type u_2} [CommRing K] [Algebra K] {I : Type u_3} (g : IPowerSeries₀) (hg : SummableFPS₀ g) :
MultipliableFPS₁ fun (i : I) => Exp (g i)
Proof

Since \(\operatorname {Exp}(g_i) = 1 + \overline{\exp } \circ g_i\), the family is of the form \((1 + h_i)\) where \(h_i = \overline{\exp } \circ g_i\). The key observation is that if \([x^k](g_i) = 0\) for all \(k \le n\), then \([x^n](\overline{\exp } \circ g_i) = 0\) as well (since \(\overline{\exp }\) has constant term \(0\), so the substitution preserves vanishing of low-order terms). The summability of \((g_i)\) then implies the multipliability of \((1 + h_i)\).

Proposition 1.244 \(\operatorname {Exp}\) of infinite sum

If \((g_i)_{i \in I}\) is a summable family in \(K[\! [x ]\! ]_0\), then

\[ \operatorname {Exp}\Bigl(\sum _{i \in I} g_i\Bigr) = \prod _{i \in I} \operatorname {Exp}(g_i). \]
theorem PowerSeries.Exp_sum {K : Type u_2} [CommRing K] [Algebra K] {I : Type u_3} (g : IPowerSeries₀) (hg : SummableFPS₀ g) (hg_mul : MultipliableFPS₁ fun (i : I) => Exp (g i) := ) :
Exp (summableFPS₀Sum g hg) = multipliableFPS₁Prod (fun (i : I) => Exp (g i)) hg_mul
Proof

Let \(f_i = \operatorname {Exp}(g_i)\). By Proposition 1.242, \(\operatorname {Log}(\prod f_i) = \sum \operatorname {Log}(f_i) = \sum g_i\) (using \(\operatorname {Log} \circ \operatorname {Exp} = \mathrm{id}\)). Applying \(\operatorname {Exp}\) to both sides and using \(\operatorname {Exp} \circ \operatorname {Log} = \mathrm{id}\) yields the result.