# Continued Fractions and Hyperelliptic Curves

I recently read a charming little paper: Quasi-elliptic integrals and periodic continued fractions, by van der Poorten and Tran. Most of us who have taken a number theory course of some kind learned how to solve Pell’s equation: $x^2 - D y^2 =1$ where $D$ is a nonsquare positive integer. The usual method is to compute the continued fraction
$\displaystyle{\sqrt{D} = a_0 + \frac{1}{a_1 + \frac{1}{a_2 + \frac{1}{\cdots}}}}$.
One then defines the convergents of $\sqrt{D}$ by
$\displaystyle{x_0/y_0 = a_0}$
$\displaystyle{x_1/y_1 = a_0 + \frac{1}{a_1}}$
$\displaystyle{x_2/y_2 = a_0 + \frac{1}{a_1+\frac{1}{a_2}}}$ etcetera.

Then $x_i^2 - D y_i^2$ tends to be very small and, if you compute long enough, for some $i$ you will have $x_i^2 - D y_i^2=1$.

What van der Poorten and Tran do is to ask what happens if $D$ is not an integer, but a polynomial $D(t) = t^{2g+2} + d_{2g+1} t^{2g+1} + \cdots + d_1 t + d_0$. Before I get into details, I want to tell you about something gorgeous that I won’t explain at all. Using the methods in their paper, van der Poorten and Trap can discover identities like
$\displaystyle{ \int \frac{3 x dx}{\sqrt{x^4+2x}} = \log \left( x^3+1+x \sqrt{x^4+2x} \right)}.$
Isn’t that pretty?

It turns out that the continued fraction algorithm for $\sqrt{D(t)}$ is actually much prettier than for integers. Everything should be understood in terms of the curve $C$ cut out by $y^2 = D(t)$. This is a curve of genus $g$, with two points at infinity. (One of these points is the limit of $(t, \sqrt{D(t)})$ and the other is the limit of $(t, -\sqrt{D(t)})$.) I’ll call these two points $\infty_{+}$ and $\infty_{-}$. The theory is controlled by the line bundles $\mathcal{O}(k \infty_+ + \ell \infty_-)$. In particular, there are nontrivial solutions to $x(t)^2 - D(t) y(t)^2 =1$ if and only if the continued fraction is periodic, if and only if $\mathcal{O}(k \infty_+) = \mathcal{O}(k \infty_-)$ for some $a >0$.

Below the fold, I’ll explain what is meant by the continued fraction algorithm for an algebraic function, and tell you some of the other nice results from the paper.

Given any power series $Y(t) = Y_k t^k + Y_{k-1} t^{k-1} + \cdots$ in $t^{-1}$, we define the continued fraction of $Y(t)$.

Define $[Y(t)] := \sum_{i=0}^k Y_i t^i$. Set $a_0 = [Y]$ and define $F_1$ by $Y = a_0 + 1/F_1$. Then set $a_1 = [F_1]$ and $F_1 = a_1 + 1/F_2$. Continuing in this way, we get a sequence $a_i$ of polynomials, a sequence $F_i$ of power series, and a continued fraction
$\displaystyle{Y = a_0 + \frac{1}{a_1+\frac{1}{a_2+\frac{1}{\cdots}}}}$.
We can also define the convergents $x_i/y_i$ as before; they do converge to $Y$ in the sense that each ratio $x_i/y_i$ agrees with $Y$ to a higher order than the ratio does.

In particular, suppose that $D(t)$ is a polynomial of the form $t^{2g+2} + d_{2g+1} t^{2g+1} + \cdots + d_1 t + d_0$.
Then $\sqrt{D(t)}$ is a power series in $t^{-1}$:
$\displaystyle{\sqrt{D(t)}} = t^{g+1} + (1/2) d_{2g+1} t^g + \cdots.$
So we can define the continued fraction of $\sqrt{D(t)}$.
We keep the notations $a_i(t)$, $F_i(t)$, $x_i(t)$ and $y_i(t)$ from above.

I’ll explain just one key idea from the paper. Let’s think about the zeroes and poles of $F_i(t)$. Since $a_i(t)$ is a polynomial in $t$, its only poles are at $\infty_{\pm}$, and it has a pole of the same order at both $\infty$‘s. So, other than $\infty_{\pm}$, the function $F_i(t) - a_i(t)$ has the same poles as $F_i$. Then $F_{i+1} = 1/(F_i - a_i)$ has zeroes at the poles of $F_i - a_i$.

That’s what happens away from $\infty_{\pm}$. Suppose that $F_i(t)$ has a pole of order $p > 0$ at $\infty_{+}$, and a zero of order $q > 0$ at $\infty_{-}$. Then $a_i(t)$ has a pole of order $p$ at both $\infty$‘s. The difference $F_i(t) - a_i(t)$ has a zero of order $\geq 1$ at $\infty_{+}$ and a pole of order $p$ at $\infty_{-}$. So $F_{i+1}$ has a pole of order $\geq 1$ at $\infty_{+}$ and a zero of order $p$ at $\infty_{-}$.

Summing up the last two paragraphs, let the poles of $F_i$ be $P + p \infty_{+}$ and let the zeroes be $Q + q \infty_{-}$. Then the poles of $F_{i+1}$ are $R+r \infty_{+}$, for some $R$ and some $r \geq 1$ and the zeroes are $P + p \infty_{-}$. (Here $P$, $Q$ and $R$ are supported away from $\infty_{\pm}$.) In other words, there is a sequence of positive integers $p_i$ and a sequence of divisors $P_i$ such that the poles of $F_i$ are $P_i + p_i \infty_{+}$ while the zeroes are $P_{i-1} + p_{i-1} \infty_{-}$.

Note that $p_i$ is the degree of $a_i$. Note also that $P_i + p_i \infty_{+} \equiv P_{i-1} + p_{i-i} \infty_{-}$ in the Picard group, so
$P_i \equiv P_0 + p_0 \infty_{-} + \sum p_j (\infty_{-} - \infty_{+}) - p_{i} \infty_{+}$.

It’s not too hard to work out what happens if the coefficients of $D(t)$ are chosen generically. The first $a_0$ has degree $g+1$ and all the other $p_i$ are $1$. A bit of effort checks that $P_1$ has degree $g$ (exercise!), so all of $P_i$ have degree $g$ and, in fact, $P_i \equiv (g+i) \infty_{-} - i \infty_{+}$ in the Picard group. You may remember that a generic divisor of degree $g$ has a unique effective representative in PIcard; $P_i$ is that unique representative. So, we have just found an explicit way to write down an arithmetic progression in $Pic^g(C)$, where $C$ is a hyperelliptic curve.

Of course, the fun comes in the nongeneric case. In that case, the $p_i$ can skip around. It’s really fun when $\infty_{+} - \infty_{-}$ is torsion in the Picard group or, in other words, when there is a unit $x(t) + y(t) \sqrt{D(t)}$ in the coordinate ring of $C$. Then, eventually, the sequence in Picard will repeat. It turns out, when this happens, the corresponding approximation $x_i(t)/y_i(t)$ gives your unit!

There are plenty of other ideas in the paper. What is the analogue of the result that the $x_i/y_i$ are the best approximations to $\sqrt{D}$? The $F_i$ are all of the form $(A_i + \sqrt{D})/B_i$: how do we relate the polynomials $A_i$ and $B_i$ to the divisors $P_i$? And how did I come up with that integral above? All this and more, so read the paper!

## 4 thoughts on “Continued Fractions and Hyperelliptic Curves”

1. Daniel says:

I don’t understand what is meant by

[Y(t)] :=\sum_{i=0}^k Y_k t_k

Are some of those k’s perhaps supposed to be i’s or something?

2. I assume he means that you take all the terms from the power series where t has a non-negative exponent.

3. I’m pretty sure Kenny’s right, so I corrected the post moving the subscript to a superscript. David if I did this wrong please change it back.

4. Thanks for the fix, but you missed the other typo: the summation variable is $i$, not $k$. Fixed now.

Kenny’s English summary is completely correct.