From polynomial continued fractions to Mobius transformations
When writing a simple continued fraction expansion, there are several notations used throughout the literature, but probably the most visual one is just:
\( \frac{1}{a_1+\frac{1}{a_2+\frac{1}{a_3+\frac{1}{a_4+\ddots}}}} \).
By definition, this is the limit of the convergents defined by
\(\frac{p_n}{q_n} = \frac{1}{a_1 + \frac{1}{a_2 + \frac{1}{a_3 + \frac{1}{a_4 + \frac{1}{\ddots+\frac{1}{a_n}}}}}}\).
This leads to the interesting question of how do we move from the \(n\)-th convergent to the next? To study this question, let us first try to decompose the n-length expansion above to a composition of \(n\) steps.
Recall that the Mobius transformation, is an action of a \(2\times 2\) matrix on scalars defined by
\(\begin{pmatrix}a & b\\c & d\end{pmatrix}\left(z\right):=\frac{az+b}{cz+d}.\)
This is an actual action, namely given any two matrices \(M_1,M_2\) we have that \((M_1 \cdot M_2)(z) = M_1(M_2(z)).\)
Moreover, the scalar matrices act as the identity, since
\(\begin{pmatrix}d & 0\\0 & d\end{pmatrix}\left(z\right):=\frac{dz+0}{0z+d}=z,\)
thus defining an action of the invertible matrices modulo the scalars, namely the group \(\mathrm{PGL}_2(\mathbb{R}) := \mathrm{GL}_2(\mathbb{R}) / scalars\).
An interesting special case of this action is
\(\begin{pmatrix}0 & 1\\1 & a\end{pmatrix}\left(z\right):=\frac{1}{a+z}\).
This is non other than a single step in the continued fraction expansion, and in particualr we have
\(\frac{p_n}{q_n} = \begin{pmatrix}0 & 1\\1 & a_1\end{pmatrix} \begin{pmatrix}0 & 1\\1 & a_2\end{pmatrix} \cdots \begin{pmatrix}0 & 1\\1 & a_n\end{pmatrix}(0) \).
In other words, we can study continued fractions by studying \(2\times 2\) matrix multiplication, which most of us know much better.
The recurrence of a continued fraction step
Let us now fix a simple continued fraction (namely the coefficients \(a_n\)) and write \(M_n = \begin{pmatrix}0 & 1\\1 & a_n\end{pmatrix}\). By our Mobius transformation definition, we have that
\( \begin{pmatrix}a & b\\c & d\end{pmatrix}(0)=\frac{b}{d} \),
and therefore
\( \begin{pmatrix}p_n\\q_n\end{pmatrix} = M_1 \cdot M_2 \cdots M_n \begin{pmatrix}0\\1\end{pmatrix} ,\)
meaning the \(p_n,q_n\) is the right column of \(\prod_1^n M_k\).
What about the left column? Fortunately, this is also easy to compute, since
\( M_1 \cdots M_n \begin{pmatrix}1\\0\end{pmatrix} = M_1 \cdots M_{n-1} \begin{pmatrix}0 & 1 \\1 & a_n\end{pmatrix} \begin{pmatrix}1\\0\end{pmatrix} = M_1 \cdots M_{n-1} \begin{pmatrix}0\\1\end{pmatrix} = \begin{pmatrix}p_{n-1}\\q_{n-1}\end{pmatrix}\).
To put everything together, we obtain \(\prod_1^n M_k = \begin{pmatrix}p_{n-1} & p_n \\q_{n-1} & q_n\end{pmatrix}\). We can now get an interesting recurrence helping us to compute the convergents:
\( \begin{pmatrix}p_{n} & p_{n+1} \\q_n & q_{n+1}\end{pmatrix} = \prod_1^{n+1}M_k = \prod_1^n M_k \cdot \begin{pmatrix}0 & 1 \\1 & a_{n+1} \end{pmatrix} = \begin{pmatrix}p_{n-1} & p_n \\q_{n-1} & q_n\end{pmatrix} \cdot \begin{pmatrix}0 & 1 \\1 & a_{n+1} \end{pmatrix} = \begin{pmatrix}p_n & p_{n-1} +a_{n+1} p_n \\q_n & q_{n-1}+a_{n+1}q_n\end{pmatrix}\).
In other words, this matrix recurrence is equivalent to the recurrence
\(p_{n+1} = p_{n-1} +a_{n+1} p_n\; ;\; p_0 = 0\; , \; p_1 = 1\)
\(q_{n+1} = q_{n-1} +a_{n+1} q_n\; ;\; q_0 = 1\; , \; q_1 = a_1\).
Fortunately, everything still works for other types continued fractions. In particular in our polynomial continued fractions we have \( M_n = \begin{pmatrix}0 & b(n) \\1 & a(n) \end{pmatrix} \) where both \( a,b\in\mathbb{Z}[x] \), and we get a similar recurrence
\(p_{n+1} = b(n+1) p_{n-1} +a(n+1) p_n\; ;\; p_0 = 0\; , \; p_1 = b(1)\)
\(q_{n+1} = b(n+1) q_{n-1} +a(n+1) q_n\; ;\; q_0 = 1\; , \; q_1 = a(1)\).
It is interesting to note that the matrix above is the companion matrix in the \(2\times 2\) case, corresponding to the polynomial \( t^2 – a(n)t – b(n) \). In general, looking for roots for such polynomial, we look for \( \lambda_1, \lambda_2 \) such that \( \lambda_1 \cdot \lambda_2 = -b(n) \) and \( \lambda_1 + \lambda_2 = a(n) \). However, in our context the \(n\) index keeps increasing, and with this in mind, it is suddenly not too surprising that in the Euler family of continued fractions we have the construction:
\( b(n) = -h_1(n) h_2(n) \;\; ; \;\; a(n) = h_1(n) + h_2(n+1) \)