Conway river and Arnold sail

We establish a simple relation between two geometric constructions in number theory: the Conway river of a real indefinite binary quadratic form and the Arnold sail of the corresponding pair of lines.


Introduction
In 1895 Felix Klein proposed the following geometric representation of continued fractions [6]. For an irrational real number ω consider the ray y = ωx on the plane with the integer lattice. Let us quote Klein himself [7]: Imagine pegs or needles affixed at all the integral points, and wrap a tightly drawn string about the sets of pegs to the right and to the left of the ω-ray, then the vertices of the two convex strong-polygons which bound our two point sets will be precisely the points (p ν , q ν ) whose coordinates are the numerators and denominators of the successive convergents to ω, the left polygon having the even convergents, the right one the odd. This gives a new and, one may well say, an extremely graphic definition of a continued fraction. Many years later V.I. Arnold [1] revitalised this point of view, mainly with an emphasis on multi-dimensional generalisations. In particular, for a polyhedral cone he introduced the notion of the sail as the boundary of the convex hull of the integer points inside it. In dimension 2 the sail of the angle formed by the ω-ray and x-axis is precisely Klein's construction of the continued fraction expansion of ω (see Figure 1).
This line was developed in more detail by Karpenkov [4] who, importantly for us, introduced the lattice length sine (LLS) sequence of positive integers (a i ), i ∈ Z of the sail and proved a remarkable edge-angle duality between the sails of the adjacent angles (see Figure 1). He also linked this with the theory of indefinite binary quadratic forms. Indeed, the zero set of such a form is a pair of lines, forming 4 angles with 4 sails, which are either isomorphic or dual to each other (see Figure 2). 1

Figure 2. Arnold and the sails for a pair of lines
On the other hand, in the 1990s John H. Conway proposed the notion of the topograph of a binary quadratic form Q as a graphical way to visualise the values of Q on a planar binary tree [2] (see section 3 below). For indefinite quadratic forms he introduced the notion of the river, which is a path on the topograph separating positive and negative values of Q (see Figure 3).
The main result of this paper is the following simple relation between the Conway river and the corresponding Arnold sail. Theorem 1. Let Q(x, y) be a real indefinite binary quadratic form and consider the Arnold sail of the pair of lines given by Q(x, y) = 0, assuming that the origin is the only integer point on them.
Then the corresponding LLS sequence (a i ), i ∈ Z coincides with the sequence of the left-and right-turns of the Conway river on the topograph of Q. This determines the river uniquely up to the action of the group P GL(2, Z) on the topograph and a change of direction.  For example, for Q = x 2 −2xy −2y 2 one can check that the corresponding LLS sequence is periodic, equal to . . . 2, 1, 2, 1, 2, 1, . . . , which is exactly the sequence of left-right turns . . . LLRLLRLLR . . . of the (properly oriented) Conway river in Figure 3.
The proof is simple and essentially follows from Karpenkov's results [4] combined with our analysis of the Conway river [10].

Arnold sail and the LLS sequence of the angles
We follow here Karpenkov [4] (see, in particular, Chapters 2 and 4). Let A, B, C be three distinct integer lattice points on the plane and ∠ABC be the corresponding angle. Define the integer length ll(AB) of the segment AB as the number of integer points in the interior of AB plus one, and the integer area lS( ABC) of the triangle ABC as the index of the sublattice generated by the integer vectors AB and BC in the integer lattice.
The integer sine of the angle ∠ABC is defined as One can check that it is a positive integer and depends only on the angle, and not on the choice of B and C.
Consider now a pair of lines given by y = αx and y = βx and one of the angles ∠AOB formed by them. Let us assume that α and β are irrational, so that the origin O is the only integer point on them, and consider the convex hull of the integer points inside ∠AOB (excluding O). Its boundary is an infinite broken line called the Arnold sail of the angle ∠AOB.
Let (A i ), i ∈ Z be the sequence of vertices of this sail. Karpenkov [4] introduced the following key notion of the LLS (lattice length sine) sequence (a i ), i ∈ Z of the angle ∠AOB as Karpenkov proved that the LLS sequence determines the angle uniquely up to an integer affine transformation. Note that the sequence is defined up to a shift of indices and depends on the orientation of the sail.
When the angle is formed by the x-axis and ω-ray the corresponding LLS sequence is semi-infinite and gives precisely the continued fraction representation of ω (see Figure 1): Let us look at the sail of the angle formed by the ω-ray and y-axis. Let B 0 B 1 B 2 . . . be the sequence of vertices of the corresponding sail. Then we have Karpenkov's edge-angle duality [4]: This explains why we do not need to consider the second sail to extract the full continued fraction expansion. Note that the coordinates of A i = (p 2i , q 2i ) and B i = (p 2i−1 , q 2i−1 ) are the corresponding denominators and numerators of the continued fraction convergents for ω (see Klein [7] and Figure 1).
For general lines given by y = αx and y = βx the corresponding (infinite in both directions) LLS sequence can be considered as a joint continued fraction expansion of the numbers α and β and is related to the rational approximation of the arrangement of these two lines (or, equivalently to the corresponding quadratic form Q = (y − αx)(y − βx), see Chapter 10 in [4]).

Topograph of binary quadratic form and Conway river
We follow here the original approach of Conway from his book [2], see also Hatcher [3] and [10].
Conway proposed the following nice way to visualise the values of a binary quadratic form Q(x, y) = ax 2 + hxy + by 2 , (x, y) ∈ Z 2 .
He considered the case when all the coefficients a, b, h are integer, but his construction works for real coefficients as well.
Conway introduced the notions of the lax vector as a pair (±v), v ∈ Z 2 , and of the superbase of the integer lattice Z 2 as a triple of lax vectors (±e 1 , ±e 2 , ±e 3 ) such that (e 1 , e 2 ) is a basis of the lattice and e 1 + e 2 + e 3 = 0.
It is easy to see that every basis can be included in exactly two superbases, which we can represent using the binary tree embedded in the plane (see Figure 4). The lax vectors live in the complement to the tree (we show only one representative of them), while the superbases correspond to the vertices. Note that all primitive lattice vectors, i.e. those which are not multiples of any other lattice vectors, appear on this tree.
By taking the values of the form Q on the vectors of the superbase tree, we get what Conway called the topograph of Q. The idea is to get the values of Q on all primitive lattice vectors in this way.  One can construct the topograph of Q starting from this triple using the arithmetic progression rule (known in geometry as the parallelogram rule): We also need to construct the Farey tree by replacing v = (p, q) on the superbase tree by the corresponding fraction p q (so that addition of vectors corresponds to taking the Farey mediant of fractions).
Using the Farey tree, we can label any semi-infinite path γ on the tree by a real number ξ such that the limit of the Farey fractions along γ ξ is ξ.
The path γ ξ is actually a geometric way to represent the continued fraction expansion of ξ = [a 0 , a 1 , a 2 , a 3 . . .]: it has a 0 left-turns on the tree, followed by a 1 right-turns, followed by a 2 left-turns, etc (see e.g. Hatcher [3] and Figure 5, showing the half-tree with the "golden" Fibonacci path corresponding to the golden ratio ξ = [1, 1, 1 . . . ]). Let us assume now that the form Q is indefinite and does not represent zero, meaning that Q(x, y) = 0 for all (x, y) ∈ Z 2 \ (0, 0).
In this case the same arguments as in the integer case [2,3] show that on the topograph of Q positive and negative values are separated by an infinite path which we call the Conway river. In [10] we explained for the integer case how the Conway river is related to the continued fraction expansion of the roots α,ᾱ of the quadratic equation Q(x, 1) = 0 (see Figure 6). Note that in the general case of binary quadratic forms with real coefficients, we do not have periodicity of the river anymore.

Proof of the theorem
Consider an indefinite quadratic form Q(x, y) = ax 2 + hxy + by 2 and factorise it as a product of linear forms with irrational α, β, assuming without loss of generality that α > 0 and β < 0.
Let P = A 0 be a corner of the Arnold sail of the corresponding pair of lines y = αx and y = βx. Choose a new basis in the lattice with e 1 = OA 0 and e 2 being a primitive vector along the edge A 0 A 1 of the Arnold sail. From Klein's construction it follows that this indeed a basis.
In the new coordinate system the corresponding α > 1 and 0 > β > −1, and we have the situation shown in Figure 7 justified by the following lemma (see also Markov [9] and Definition 1.1 in [5]). Lemma 1. The LLS sequence of the Arnold sail of a pair of lines y = αx and y = βx with α > 1 and 0 > β > −1 is . . . , b 4 , b 3 , b 2 , b 1 , a 0 , a 1 , a 2 , a 3 , . . . , where a i and b j are given by the continued fraction expansions The proof follows directly from Klein's construction and Karpenkov's results [4], Ch. 3 and 7 (see in particular, Prop. 7.5). Let us now look at the corresponding Conway river. Since αβ < 0 this means that Q(1, 0) = bαβ and Q(0, 1) = b have different signs, so our initial position is already on the Conway river.
We know that the Conway river is the unique path on the Farey tree connecting the points α and β on the boundary, and thus is the union of two paths γ α and γ β . Combining this with the description of the Farey paths in terms of continued fractions (see [10] and above), we conclude that the sequence (7) determines the sequence of the river's left and right turns. Now let's prove that this determines the river uniquely modulo the action of P GL(2, Z), which is the symmetry group of the binary tree embedded in the plane. Indeed, we have a well-known isomorphism (see e.g. [2]) This allows us to define the action of P SL(2, Z) on the tree with generators of Z 2 and Z 3 acting as rotations by π about the edge centre and by 2π/3 about the vertex. The element diag (−1, 1) ∈ GL(2, Z) acts by the natural reflection and changes the orientation.
Using this action one can transform any directed edge to any other. After that the sequence of left-and right-turns determines the river uniquely. The left-right symmetry corresponds to the reflection. This proves our theorem.

Concluding remarks
Arnold sails can be defined in a much more general situation, in particular, for cubic binary forms and multidimensional simplicial cones. This is related to the theory of multidimensional continued fractions, also going back to Klein (see Karpenkov [4] for the details). It is an interesting question as to whether there is an analogue of the Conway topograph here.
Another interesting question is to study the growth of values of the real binary quadratic forms along the paths on the Conway topograph, similar to the integer case considered in [10]. Note that in the real case the values of the form along the Conway river may approach zero (see e.g. [8]), so the situation here is more subtle.