Recursive construction of a compositional inverse (source code)

= Recursive construction of a compositional inverse
{title2=$f\circ g=g\circ f=T$}

Let $R$ be a commutative unital <ring> and $f(T)=a_1T+a_2T^2+\cdots$ with $a_1$ a <unit>. Set $g(T)=\sum_{n\ge1}b_nT^n$. The coefficient of $T$ in $f(g(T))$ gives $b_1=a_1^{-1}$. At every degree $n>1$, the coefficient is $a_1b_n$ plus an expression involving only $b_1,\ldots,b_{n-1}$; choose $b_n$ to cancel that expression. This gives a unique right <compositional inverse of a formal power series>.

Similarly, the coefficient of $T^n$ in $h(f(T))$ is $a_1^n h_n$ plus previously fixed terms, so the same recursion gives a left inverse $h$. Composition of zero-constant-term <formal power series> is associative, since every coefficient involves finitely many terms. Therefore $h=h\circ(f\circ g)=(h\circ f)\circ g=g$, proving $f\circ g=g\circ f=T$.