Constructing minimal periods of quadratic irrationalities in Zagier's reduction theory
CCONSTRUCTING MINIMAL PERIODS OF QUADRATICIRRATIONALITIES IN ZAGIER’S REDUCTION THEORY
BARRY R. SMITH
Department of Mathematical SciencesLebanon Valley College101 N. College Avenue, Annville, PA 17003
Abstract.
Dirichlet’s version of Gauss’s reduction theory for indefinite binaryquadratic forms includes a map from Gauss-reduced forms to strings of naturalnumbers. It attaches to a form the minimal period of the continued fraction of aquadratic irrationality associated with the form. When Zagier developed his ownreduction theory, parallel to Dirichlet’s, he omitted an analogue of this map. Wedefine a new map on Zagier-reduced forms that serves as this analogue. We alsodefine a map from the set of Gauss-reduced forms into the set of Zagier-reducedforms that gives a near-embedding of the structure of Gauss’s reduction theory intothat of Zagier’s. From this perspective, Zagier-reduction becomes a refinement ofGauss-reduction. Introduction
Dirichlet’s exposition [4] of Gauss’ reduction theory for indefinite binary quadraticforms is still the essence of the standard treatment. The core idea is to prove the maintheorems by translating reduction into the regular continued fraction expansion of aquadratic irrationality. In 1981, Zagier published an alternative reduction theory [15];his exposition is similar to Dirichlet’s, replacing regular continued fractions with neg-ative continued fractions, but it omits an important piece. This article fills in the gap.
Background:
A binary quadratic form is a polynomial Ax + Bxy + Cy , and we assumethroughout that the coefficients are rational integers. We will typically represent aform with the shorter notation ( A, B, C ) . Its discriminant is ∆ = B − AC , and wewill only consider indefinite forms – those with positive, nonsquare discriminant. Wecall gcd( A, B, C ) the content of the form. E-mail address : [email protected] . Key words and phrases. binary quadratic form; reduction theory; continued fraction.I wish to thank Keith Matthews for publishing tools for computing with binary quadratic formsat http://numbertheory.org . They were an invaluable resource during this project. a r X i v : . [ m a t h . N T ] O c t MINIMAL PERIODS IN ZAGIER’S REDUCTION THEORY
Definition 1.1.
An indefinite form ( A, B, C ) is G-reduced if AC < , B > | A + C | . It is
Z-reduced if A, B, C > , B > A + C. These are the reduced forms of Gauss and Zagier. This definition of G-reducedforms is not the most common one, but its equivalence with Gauss’s definition goesback at least to Frobenius [6]. We use the following notation: G = { ( A, B, C ) : (
A, B, C ) is G -reduced } ,G + = { ( A, B, C ) : (
A, B, C ) ∈ G and A > } ,Z = { ( A, B, C ) : (
A, B, C ) is Z -reduced } . We recall that every rational number αβ > can be expanded in two ways as afinite regular continued fraction αβ = q + 1 q + 1 . . . + 1 q l . with positive integer partial quotients q , . . . , q l . The numbers of quotients appearingin the two expansions have opposite parities: if q l > , then the second expansion haspartial quotients ( q , q , . . . , q l − , . We recall also that if ∆ is a positive, nonsquareinteger, then the Pellian equation | t − ∆ u | = 4 always has solutions in positiveintegers ( t, u ) . The fundamental solution is that with minimal u .We now define a map that is already in Dirichlet ([4], or see Section 83 of Vor-lesungen über Zahlentheorie ): Dirichlet’s Map.
Let S be the set of nonempty natural strings (i.e., finite sequencesof natural numbers). Define γ : G + → S as follows. Suppose f = ( A, B, C ) ∈ G + has discriminant ∆ . Let ( t, u ) be fundamen-tal solution of the Pellian equation | t − ∆ u | = 4 . Set z = t + Bu (an integer) andexpand the rational number zAu in a finite continued fraction, choosing between thetwo possible expansions by requiring the parity of the number of partial quotients tobe odd if t − ∆ u = − and even otherwise. Define γ ( f ) to be the resulting sequenceof partial quotients. Example . Let f = x + 3 xy − y ∈ G + , which has discriminant 17. The equation t − u = − is solvable with fundamental solution ( t, u ) = (8 , . We compute z = 7 and expand / in a continued fraction of odd length to obtain γ ( f ) = (3 , , . INIMAL PERIODS IN ZAGIER’S REDUCTION THEORY 3
We define now equivalence relations on the set of strings over an alphabet andon the set of indefinite forms. A combinatorial necklace over an alphabet Σ is anequivalence class of finite strings over Σ under cyclic permutation. The name arisesfrom the depiction, as in Figure 1, of the necklace represented by the string s · · · s k asa sequence of beads evenly spaced around a circle. We will consider natural necklaces , S S k S S k-2 … ...S k-1 … S S Figure 1.
The necklace of the string s · · · s k which have natural number beads, and binary necklaces , whose beads are 0’s and1’s. A nonempty string of length n is primitive if the cyclic group of order n actsfreely upon it. A primitive necklace is one whose associated strings are primitive.Equivalently, a primitive necklace is one with no nontrivial rotational symmetry inthe above depiction.A matrix (cid:2) α βγ δ (cid:3) in SL ( Z ) acts on a form f ( x, y ) as f ( x, y ) (cid:55)→ f ( αx + βy, γx + δy ) . Through this right-action, the set of binary quadratic forms is partitioned into equiv-alence classes. All forms in a class have the same content and discriminant. A form is primitive if it has relatively prime coefficients. A primitive class is one whose formsare all primitive.We use a subscript ‘ p ’ on a set of forms/strings to indicate the corresponding subsetof primitive forms/strings, e.g., p S denotes the set of all primitive natural strings.We denote with R G Gauss’s reduction operator on indefinite forms (see Section 4for the definition). The operator R G is a permutation of the set G , and R G ◦ R G restricts to an permutation of G + . If c is a class of forms of positive discriminant,then c ∩ G is nonempty and R G restricts to a permutation of c ∩ G .The map γ has many useful properties, including:(i) If ( A, B, C ) ∈ p G + has discriminant ∆ , then the quadratic irrationality B + √ ∆2 A has a purely periodic continued fraction and γ ( f ) is its minimal period.(1 (cid:48) ) γ restricts to a bijection γ : p G + → p S .(2) R G ◦ R G transports through γ to a cyclic permutation of the correspondingnatural strings. MINIMAL PERIODS IN ZAGIER’S REDUCTION THEORY
Property 1 was the inducement for introducing γ to the theory. Dirichlet workswith a slightly less general map than the one given above, but a proof of the propertyas we have stated it is already in Weber’s Lehrbuch der Algebra, Volume 1 (or see[7, proof of Theorem 2.2.9]). Property (cid:48) is an immediate consequence of Property 1.Property 2 shows that γ induces a well-defined map from classes of indefinite formsof positive discriminant to natural necklaces, and Property (cid:48) shows that this inducesa map from primitive classes to primitive necklaces. Summary of results:
The purpose of this article is to provide an analogue of γ forZagier-reduced forms, a map which we call σ . Actually, we define two maps: β : Z → S σ : Z → B , where S = the set of natural strings of length ≥ ,B = the set of binary strings with at least one 1 . Definition 1.2.
Suppose f = ( A, B, C ) ∈ Z has discriminant ∆ . Let ( t, u ) be thefundamental solution of the Pellian equation | t − ∆ u | = 4 . Set z = t + Bu (an integer)and expand the rational number zz − Au into a continued fraction, choosing between thetwo possible expansions by requiring the parity of the number of partial quotients tobe even if t − ∆ u = − and odd otherwise. Define β ( f ) to be the resulting sequenceof partial quotients. We call β ( f ) the bead sequence of f .The differences with Dirichlet’s map γ are that the input form f is Z-reducedinstead of G-reduced, the fraction expanded in a continued fraction has denominator z − Au instead of Au , and the parity of the number of quotients is switched. Theproof of Theorem 3.2 shows, as indicated above, that the image β ( Z ) is contained in S , i.e., no bead sequence has a single element.Before defining σ , a notational remark is in order. We will refer to natural stringsas “strings”, but we use the more common sequence notation ( q , . . . , q l ) . We will alsouse binary strings and write them with the standard juxtaposition notation q · · · q l .We define now a “stars-and-bars” map sb : S → B . Given ( q , . . . q l ) ∈ S , wearrange a sequence of n = q + · · · + q l stars in a row, then place l − bars in gapsbetween the stars so that the stars are divided into bunches of size q , . . . , q l as wemove left to right. Beginning with an empty string, we traverse the stars from left toright, examining the gaps between stars and appending at each empty gap and at each bar. The resulting binary string is sb(( q , . . . q l )) . Definition 1.3. If f ∈ Z , define σ ( f ) = sb( β ( f )) . Example . Let f = x + 5 xy + 2 y ∈ Z , which has discriminant . The equation t − u = − is solvable with fundamental solution ( t, u ) = (8 , . We compute INIMAL PERIODS IN ZAGIER’S REDUCTION THEORY 5 z = 9 and expand / into a continued fraction of even length to obtain the beadsequence β ( f ) = (1 , , , . The stars and bars are (cid:63) | (cid:63) (cid:63) (cid:63) | (cid:63) | (cid:63) and the resulting binary string is σ ( f ) = 10011 . The main results of this article are:
Theorems 2.1, 2.6, and 5.3,: which give the analogues for σ of, respectively,Properties 2, (cid:48) , and 1 of γ . Theorem 4.2,: which puts γ and σ in a commutative diagram that clarifiesthe link between Gauss- and Zagier- reduction. Theorem 4.4,: which describes how the reduction operators transport throughthe maps in the diagram.The analogue for σ of Property 1 states that that if f ∈ p Z , then σ ( f ) essentiallygives the minimal period of the Denjoy continued fraction [3, pp.11-12], [9] of aquadratic irrationality associated with f . Denjoy continued fractions are defined atthe beginning of Section 5.The analogue of Property 2 shows that Zagier-reduction translates through σ tocyclic permutation of the corresponding binary string. Thus, σ induces a map σ fromclasses of indefinite forms to binary necklaces, and the analogue of (cid:48) shows that thisrestricts to a map from primitive classes to primitive binary necklaces. The Z-caliber of a class is the number of Z-reduced forms in the class. Theorem 2.6 shows that σ is surjective, and Corollary 2.8 states that the number of beads in a primitive binarynecklace is the sum of the Zagier-calibers of the primitive classes in its preimage.Recently, Uludağ, Zeytin, and Durmuş (UZD) gave another construction of binarynecklaces attached to classes of indefinite forms [13] . With each class, they associatea graph called a çark . A çark is a quotient of a Conway topograph [2], formed in sucha way that the periodic river in the topograph becomes a cycle in the çark. We canassign an edge on the cycle to each Gauss-reduced form in the form class of the çark.Beginning at such an edge and traveling around the cycle, we encounter branchessplitting off to the right and left. Assigning a to branches in one direction and tobranches in the other, each class then gives rise to a binary necklace. These are notthe necklaces produced by σ .Indeed, UZD also construct a natural string by counting runs of consecutive branchesthat all split off in the same direction and recording a natural number for each count.Upon translating their construction into arithmetic, one sees that it begins the sameas Dirichlet’s map but expands z/Au in a negative continued fraction rather than aregular one. The rest of the UZD algorithm then amounts to performing the stan-dard conversion from a negative continued fraction expansion to its regular continuedfraction [12]. Ultimately, the UZD construction is a graphical version of Dirichlet’smap. MINIMAL PERIODS IN ZAGIER’S REDUCTION THEORY
To connect the maps γ , β and σ , we define a map µ : G → Z by(1.1) µ (( A, B, C )) = (cid:40) ( A, A + B, A + B + C ) , if A > A + B + C, B + 2
C, C ) , if C > .This sends forms to equivalent forms. Restricting µ to forms with A > gives aninjective map, as does restricting it to forms with C > , so the preimage of eachform in Z has size ≤ . On the other hand, there are infinitely many Z-reduced formsoutside the image of µ , such as (3 , , .Let η : S → S be the map that prepends ‘1’ to a string in S . Theorem 4.2 showsthat the following diagrams commute:(1.2) G + ZS S µγ βη G + ZS B µγ σ sb ◦ η The maps µ , η and sb are injections. Theorem 4.4 shows that Gauss-reductiontranslates through the map µ as a “multiple of a Zagier-reduction”. Through thesediagrams, then, Zagier’s theory is seen as a refinement of Gauss’s.A final note: the present article uses and extends results developed in [11]. Severalconjectures were made in that article – all of them are easy consequences of the resultsherein. 2. Stringing necklaces
In this section, we show that Zagier reduction transports through σ to cyclic per-mutation of the corresponding binary string and deduce some consequences.Zagier’s reduction algorithm [15] proceeds by iterating the operator that sends theform f = ( A, B, C ) with discriminant ∆ to the equivalent form f ( nx + y, − x ) , where n is the “reducing number”, defined using ceiling notation(2.1) n = (cid:38) B + √ ∆2 A (cid:39) . We denote the Zagier-reduction operator by R Z . Theorem. (Zagier, [15, §13] ) The orbit of an indefinite form under Zagier-reductionis eventually periodic. A form is Z-reduced if and only if its orbit is purely periodic,hence forms a cycle. There are finitely many Z-reduced forms of given discriminant,and each class of indefinite forms contains a unique cycle of Z-reduced forms.
Theorem 2.1.
Suppose that f is a Z-reduced form. The string σ ( R Z · f ) is obtainedfrom σ ( f ) by cycling as follows:(i) If σ ( f ) begins with a ‘0’, then the initial ‘0’ is removed from the front andappended to the back. INIMAL PERIODS IN ZAGIER’S REDUCTION THEORY 7 (ii) If σ ( f ) has just one initial ‘1’ and the succeeding characters are all ‘0’, thenthe initial ’1’ is removed from the front and appended to the back.(iii) If σ ( f ) begins with a ‘1’ and contains at least two ‘1’s, then the string iscycled so that the second ‘1’ is moved to the final position.Example . Recall from Example 2 in Section 1 that σ ((1 , , . Iterativelyapplying R Z to (1 , , gives the following cycle of forms with corresponding binarystrings (obtained by applying σ ): (1 , ,
2) (2 , ,
1) (4 , ,
2) (4 , ,
4) (2 , ,
4) (1 , , , . We delay proving Theorem 2.1 until the end of this section and turn first to under-standing its implications. Foremost, it shows that σ induces a map from classes ofindefinite forms to binary necklaces. Definition 2.2.
The length and weight of a binary necklace are the number ofbeads and the number of s in the necklace. If f is a Z-reduced form or c is a class ofindefinite forms, the length and weight of f or c are the length and weight of thecorresponding necklace.From the definition of σ , we have: Proposition 2.3.
The parity of the weight of a class of indefinite forms dependsonly on the discriminant of the class. A class c of discriminant ∆ has odd weight if t − ∆ u = − is solvable and even weight if it is not solvable. When the string σ ( f ) begins with a , Theorem 2.1 shows that reducing f willrotate the string in such a way that it “skips a 1”. That is, if we iteratively cycle σ ( f ) with the operation described in the theorem, the next to appear at the beginningof a string will be the third appearing in σ ( f ) . If σ ( f ) has odd weight, the strings σ ( R nZ · f ) for n = 1 , , . . . (the exponent denoting iteration) will eventually passthrough every cyclic permutation of σ ( f ) . But if it has even weight, we miss somepermutations. For such discriminants, the induced map from primitive form classesto primitive necklaces is two-to-one. To obtain a bijection, we must impose morestructure on the necklaces. Definition 2.4. An alternating string (resp. alternating necklace ) is a binarystring (resp. binary necklace) of even weight with ’s that come in two colors (we willuse green and blue). The ’s alternate colors as you move along the string or necklace.Two alternating strings represent the same alternating necklace only if they can becycled to have s and ’s coincide with matching colors. The binary necklace obtainedby ignoring the colors in an alternating necklace is the underlying necklace . Analternating necklace is primitive if the underlying necklace is primitive. MINIMAL PERIODS IN ZAGIER’S REDUCTION THEORY
We will use an overbar to denote forming equivalence classes, both of forms and ofstrings. Thus, ( A, B, C ) and f will both denote classes of forms, while and s are necklaces represented by the strings and s . Definition 2.5.
We denote by σ the map from classes of forms to necklaces definedas follows: σ ( c ) is the necklace σ ( f ) , where f is an arbitrary Z-reduced form in c . Therestriction of σ to classes of odd weight maps to the set of binary necklaces of oddweight. It maps classes of even weight to the set of alternating necklaces (making thearbitrary convention that when traversing the string σ ( f ) from the left, the first ‘1’encountered is colored ).The following result links the notions of primitivity for both form classes and neck-laces. Theorem 2.6. If f is a primitive Z-reduced form, then σ ( f ) is a primitive string,and σ restricts to a bijection σ : p Z ↔ p B . The induced map σ restricts to a bijection between the set of primitive classes of oddweight and the set of primitive binary necklaces of odd weight. It also restricts to abijection between the set of primitive classes of even weight and the set of primitivealternating necklaces of nonzero weight. This will be proved immediately following the proof of Theorem 5.3.
Definition 2.7. If c is a class of indefinite forms, then the Z-caliber of the class is | c ∩ Z | .From Theorems 2.1 and 2.6, we immediately obtain: Corollary 2.8. If s is a primitive binary necklace of odd weight and length l , then l = k Z ( c ) , where c is the unique class such that σ ( c ) = s . If the weight is even and c and c are the two classes whose images under σ have underlying necklace s , then l = k Z ( c ) + k Z ( c ) .Remark. If define the G -caliber of a class c to be | c ∩ G + | , then the analogous resultconnecting k G ( c ) with the length of the natural necklace γ ( c ) is well-known to expertsand follows immediately from Properties (cid:48) and 2 of γ .The remainder of this section is devoted to the proof of Theorem 2.1. Let T Z bethe endomorphism on the set of sequences of finite integers of length at least thatoperates as:(2.2) ( q , q , . . . , q l − , q l ) (cid:55)→ ( q − , q , . . . , q l − , q l + 1) , if q ≥ , ( q , q ) , if q = 1 and l = 2 , ( q , . . . , q l , q , q ) , if q = 1 and l > . INIMAL PERIODS IN ZAGIER’S REDUCTION THEORY 9
Lemma 2.9. If f is a Z-reduced form, then length( β ( f )) ≥ and β ( R Z ( f )) = T Z ◦ β ( f ) . Before we take up the proof of Lemma 2.9, let us note that Theorem 2.1 is animmediate consequence of it. Recall that σ = sb ◦ β , where sb is the “stars-and-bars”map. It is readily checked that applying T Z to β ( f ) = ( q , . . . , q l ) transports through sb to the operation described in Theorem 2.1, the three cases arising when q ≥ ,when q = 1 and l = 2 , and when q = 1 and l > respectively.We also make an observation that will be used frequently in what follows. Lemma 2.10.
Suppose f is Z-reduced of discriminant ∆ . If ( t, u ) is the fundamentalsolution of | t − ∆ u | = 4 , then β ( f ) = β ( uf ) , σ ( f ) = σ ( uf ) , and γ ( f ) = γ ( uf ) . This follows by examining the constructions of β and γ and observing that the fun-damental solution of the Pellian equation | x − ( u ∆) · y | = 4 is ( t, . Proof of Lemma 2.9.
We defer the proof that β ( f ) has length ≥ to the proof ofTheorem 3.2. We can reduce the other statement to the case where f has discriminant ∆ of the form k ± . Indeed, Lemma 2.10 shows β ( f ) = β ( uf ) with ( t, u ) thefundamental solution of | t − ∆ u | = 4 . Zagier’s reduction operation commutes withscalar multiplication, so if Lemma 2.9 holds for uf , then T Z ◦ β ( uf ) = β ( uR Z ( f )) .Then T Z ◦ β ( f ) = β ( R Z ( f )) and the reduction is complete. The lemma might nowbe proved directly using properties of continued fractions, but we will instead use aresult from an earlier work [11].Suppose the Z-reduced form f = Ax + Bxy + Cy has discriminant ∆ = k +( − s · , with s = 0 or . The Pellian equation | t − ∆ u | = 4 then has fundamentalsolution ( t, u ) = ( k, , so to compute β ( f ) we set z = k + B . We recall the definitionof β ( f ) and also define a modification ˜ β ( f ) : • β ( f ) is the sequence of length parity s obtained by expanding zz − A as a simplecontinued fraction. • ˜ β ( f ) is the sequence of length parity s obtained by expanding zA as a simplecontinued fraction.(We say a sequence has length parity s if its length has the same parity as s .)Let us say we pinch the left end of a finite sequence of positive integers by trans-forming it through the rule ( q , q , q , . . . q l ) (cid:55)→ (cid:40) (1 , q − , q , q , . . . , q l ) , if q ≥ , ( q + 1 , q , . . . , q l ) if q = 1 .We pinch the right end similarly. We also make the convention that the sequence‘ (1) ’ and the empty sequence are pinched by doing nothing.We knead a finite sequence of positive integers by(i) removing the leftmost entry, then(ii) pinching both ends of what remains, then (iii) placing the removed entry on the right end of the result.Theorem 2 of [11] shows that Zagier-reduction transports through the map ˜ β tokneading the corresponding sequence.We claim that pinching both ends of ˜ β ( f ) produces β ( f ) . Comparing the first fewsteps of the Euclidean algorithm with z and A and then with z and z − A quicklyreveals that one sequence of quotients is obtained from the other by pinching the leftend. Pinching just the left end switches the length parity of the sequence of quotients,so to compute β ( f ) from ˜ β ( f ) , we must change the parity again by switching to theother of the two simple continued fraction expansions of zz − A . Since switching betweenthe two continued fraction expansions is accomplished by pinching the right end ofthe sequence of quotients, the claim follows.To conclude, we must see that acting with T Z on a sequence ( q , . . . , q l ) with l ≥ has the same effect as performing the three steps(i) pinch both ends,(ii) knead the result, then(iii) pinch both ends again.There are several cases to consider. First, we assume q ≥ and q l = 1 . If l ≥ ,then depending on whether q = 2 or q ≥ , the above three steps look as follows: (2 , q , . . . , q l − , (cid:55)→ (1 , , q , . . . , q l − + 1) (cid:55)→ ( q + 1 , . . . , q l − , , (cid:55)→ (1 , q , . . . , q l − , q , . . . , q l − , (cid:55)→ (1 , q − , . . . , q l − + 1) (cid:55)→ (1 , q − , . . . , q l − , , (cid:55)→ ( q − , . . . , q l − , If l = 2 , then depending on whether q = 2 or q ≥ , the steps are instead (2 , (cid:55)→ (1 , (cid:55)→ (2 , (cid:55)→ (1 , q , (cid:55)→ (1 , q ) (cid:55)→ (1 , q − , , (cid:55)→ ( q − , If instead q ≥ and q l ≥ , we have in the cases q = 2 or q ≥ , q , . . . , q l ) (cid:55)→ (1 , , q , . . . , q l − , (cid:55)→ ( q + 1 , . . . , q l , (cid:55)→ (1 , q , . . . , q l + 1) , ( q , . . . , q l ) (cid:55)→ (1 , q − , . . . , q l − , (cid:55)→ (1 , q − , . . . , q l , (cid:55)→ ( q − , q , . . . , q l − , q l + 1) It remains to consider when q = 1 . First let us consider when l ≥ . If q = 1 and q l = 1 , then we have, depending on whether l = 4 or l ≥ , either of the following: (1 , q , , (cid:55)→ ( q + 1 , (cid:55)→ (2 , q + 1) (cid:55)→ (1 , , q , , q , , q . . . , q l − , (cid:55)→ ( q + 1 , , q . . . , q l − + 1) (cid:55)→ ( q + 1 . . . , q l − , , q + 1) (cid:55)→ (1 , q , . . . , q l − , , q , If instead q ≥ and q l = 1 , we have (1 , q , q , . . . , q l − , (cid:55)→ ( q + 1 , q , . . . , q l − + 1) (cid:55)→ (1 , q − , . . . , q l − , , q + 1) (cid:55)→ ( q , . . . , q l − , , q , INIMAL PERIODS IN ZAGIER’S REDUCTION THEORY 11 If q = 1 and q l ≥ , we have (1 , q , , q , . . . , q l ) (cid:55)→ ( q + 1 , , q , . . . , q l − , (cid:55)→ ( q + 1 , . . . , q l , q + 1) (cid:55)→ (1 , q , . . . , q l , q , Finally, if q ≥ and q l ≥ , we have (1 , q , q , . . . , q l ) (cid:55)→ ( q + 1 , q , . . . , q l − , (cid:55)→ (1 , q − , . . . , q l , q + 1) (cid:55)→ ( q , . . . , q l , q , When l = 3 , we have, when q = 1 or q ≥ respectively (1 , q , (cid:55)→ ( q + 2) (cid:55)→ ( q + 2) (cid:55)→ (1 , q , , q , q ) (cid:55)→ ( q + 1 , q − , (cid:55)→ (1 , q − , q + 1) (cid:55)→ ( q , q , And finally, when l = 2 , we have (1 , q ) (cid:55)→ ( q , (cid:55)→ (1 , q ) (cid:55)→ ( q , In every case, the net result is the operation T Z . (cid:3) Sections of β and σ Let us consider what it takes to invert the string map σ . The stars-and-bars map sb is invertible, so from a given binary string s , we can produce a unique bead sequence.The map β from Z-reduced forms to bead sequences is generally many-to-one, butwe can find a section using continuants. We introduce these now, as well as thefundamental identities that will be used heavily through the rest of the paper.Let [ q , . . . , q l ] and (cid:104) q , . . . , q l (cid:105) denote, respectively, the numerator and denomina-tor when the regular continued fraction with quotients ( q , . . . , q l ) is simplified to areduced fraction. Then(3.1) [ q , . . . , q l ] (cid:104) q , . . . , q l (cid:105) = q + 1 [ q ,...,q l ] (cid:104) q ,...,q l (cid:105) = q [ q , . . . , q l ] + (cid:104) q , . . . , q l (cid:105) [ q , . . . , q l ] Since [ q , . . . , q l ] and (cid:104) q , . . . , q l (cid:105) are relatively prime, the fraction on the right isreduced. Generally, then, (cid:104) q , . . . , q l (cid:105) = [ q , . . . , q l ] and [ q , . . . , q l ] and [ q , . . . , q l ] arecoprime. Definition 3.1. A continuant is a number attached to a natural string, denoted by [ q , . . . , q l ] and computed as the numerator when the regular continued fraction with partialquotients q . . . , q l is simplified to a reduced fraction. From (3.1), the correspondingdenominator is then [ q , . . . , q l ] . We will encounter identities that specialize to involvecontinuants of the form [ q s , q s − ] and [ q s , q s − ] . We make the convention that theformer equals and the latter equals . Equation (3.1) gives the recursion [ q , . . . , q l ] = q [ q , . . . , q l ] + [ q , . . . , q l ] for l ≥ .This recursion shows that q is the quotient and [ q , . . . , q l ] is the remainder whendividing [ q , . . . , q l ] by [ q , . . . , q l ] . Consequently, if α = [ q , . . . , q l ] and β = [ q , . . . , q l ] ,then α/β expands in a continued fraction with quotient sequence ( q , . . . , q l ) .From the above recursion, we find by induction the matrix identity(3.2) (cid:20) q
11 0 (cid:21) (cid:20) q
11 0 (cid:21) · · · (cid:20) q l
11 0 (cid:21) = (cid:20) [ q , . . . , q l ] [ q , . . . , q l − ][ q , . . . , q l ] [ q , . . . , q l − ] (cid:21) Transposing, we find(3.3) [ q l , . . . , q ] = [ q , . . . , q l ] , Taking determinants instead, we have(3.4) [ q , . . . , q l ] [ q , . . . , q l − ] − [ q , . . . , q l − ] [ q , . . . , q l ] = ( − l . From (3.3), we find there are two recursions:(3.5) [ q , . . . , q l ] = q [ q , . . . , q l ] + [ q , . . . , q l ] , [ q , . . . , q l ] = q l [ q , . . . , q l − ] + [ q , . . . , q l − ] , which have the useful consequences(3.6) [ q + q, q , . . . , q l ] = [ q , . . . , q l ] + q [ q , . . . , q l ] , [ q , . . . , q l − , q l + q ] = [ q , . . . , q l ] + q [ q , . . . , q l − ] , and(3.7) [1 , q , . . . , q l ] = [ q + 1 , . . . , q l ] , [ q , . . . , q l − ,
1] = [ q , . . . , q l − + 1] . We will find it useful to define a continuant with as an entry. We set [0] = 0 and(3.8) [0 , q , . . . , q l ] = [ q , . . . , q l ] , [ q , . . . , q l − ,
0] = [ q , . . . , q l − ] for l ≥ . Identities (3.2) through (3.7) then remain true with continuants having as an end entry.We now return to considering a section of β . Given a finite sequence of positiveintegers ( q , . . . , q l ) with l ≥ , we produce a form ( A, B, C ) by setting A = [ q − , q , . . . , q l ] C = [ q , . . . , q l − , q l − B = [ q , . . . , q l ] + [ q − , q , . . . , q l − , q l − , (A continuant with end entry equal to is defined as in (3.8).) Let us denote theform with these coefficients by(3.9) τ (( q , . . . , q l )) . Recall that S is the set of natural strings with length ≥ . Let ˜ Z be the set ofZ-reduced forms with discriminant of the form k ± . INIMAL PERIODS IN ZAGIER’S REDUCTION THEORY 13
Theorem 3.2.
The map τ : S → ˜ Z is a bijection, with inverse given by the restrictionof β to ˜ Z . In fact, the discriminant of τ (( q , . . . , q l )) is ([ q , . . . , q l ] − [ q − , q , . . . , q l − , q l − + ( − l · Corollary 3.3.
The map σ : Z → B is a surjection. The map τ ◦ sb − is a sectionof σ whose image is the set of forms in Z with discriminants of the form k ± .Proof. The following identity follows by using [1 , q − , . . . , q l − , in place of [ q , . . . , q l ] in (3.4) and then applying (3.7):(3.10) [ q , . . . , q l ] [ q − , q , . . . , q l − , q l − − [ q , . . . , q l − , q l −
1] [ q − , q , . . . , q l ] = ( − l . Using it, we compute the discriminant of τ (( q , . . . , q l )) to be ([ q , . . . , q l ] + [ q − , q , . . . , q l − , q l − − q − , q , . . . , q l ] [ q , . . . , q l − , q l − q , . . . , q l ] − [ q − , q , . . . , q l − , q l − + 4 · ( − l . Now suppose we have a sequence ( q , . . . , q l ) with l ≥ , and set τ (( q , . . . , q l )) =( A, B, C ) . The above discriminant is positive. This is immediate if l is even. Other-wise, l ≥ , and (3.6) gives [ q , . . . , q l ] − [ q − , q . . . , q l − , q l − > [ q , . . . , q l ] − [ q , . . . , q l − , q l − q , . . . , q l − ] ≥ . To check that ( A, B, C ) is Z-reduced, we note that A , C > . Using (3.6) again, B − A − C = [ q , . . . , q l ] + [ q − , q , . . . , q l − , q l − − [ q − , q , . . . , q l ] − [ q , . . . , q l − , q l − q , . . . , q l − ] − [ q − , q , . . . , q l − ] = [ q , . . . , q l − ] > . We may thus apply β to τ (( q , . . . , q l )) .Using the discriminant of τ (( q , . . . , q l )) found above, β ◦ τ (( q , . . . , q l )) is computedby expanding zz − A = [ q , . . . , q l ][ q , . . . , q l ] − [ q − , q , . . . , q l ] = [ q , . . . , q l ][ q , . . . , q l ] in a continued fraction of length parity l . Thus, β ◦ τ (( q , . . . , q l )) = ( q , . . . , q l ) .Suppose now that ( A, B, C ) is Z-reduced of discriminant ∆ = k + ( − s · with k > (using k = 1 and s = 0 when ( A, B, C ) = (1 , , ). The sequence β (( A, B, C )) is found by setting z = B + k and expanding zz − A as a continued fraction with quotients ( q , . . . , q l ) chosen so that l and s have the same parity. We suppose, for now, that l ≥ . We will see at the end of the proof that l = 1 cannot happen.We have(3.11) B − k AC + ∆ − k AC + ( − l , so z − A and z are coprime. It follows that z = [ q , . . . , q l ] and z − A = [ q , . . . , q l ] .Thus, A = [ q − , q , . . . , q l ] , and in particular, < A < z .We also have(3.12) k − ( B − A ) = ∆ − ( B − A ) − ( − l · A ( B − A − C ) − ( − l · ≥ . If the inequality is strict, then
A > B − k , and so from (3.11) we have Az > AC + ( − l and then z ≥ C . Were it true that z = C , we would have k = 2 C − B and k − (2 C − B ) = 4 C ( B − A − C ) − ( − l · . Then C = 1 and B + k = 2 , but this cannot happen since B ≥ in a Z-reduced form.Thus, C < z . Otherwise, when (3.12) is an equality, then A = 1 , B = C + 2 , and l iseven, so (3.11) shows k = C . Thus, z = C + 1 , and so < C < z .We obtain from (3.10) and (3.11) the congruences A [ q , . . . , q l − , q l − ≡ AC ≡ ( − l +1 (mod z ) . Since < C < z , we conclude C = [ q , . . . , q l − , q l − .Our expressions for A and C now show that τ ◦ β (( A, B, C )) has the form ( A, B (cid:48) , C ) with some middle coefficient B (cid:48) . From (3.10) and (3.11), we also find that B − k =[ q − , q , . . . , q l − , q l − , and hence k = z − B − k q , . . . , q l ] − [ q − , q , . . . , q l − , q l − . Our determination of the discriminant of τ (( q , . . . , q l )) then gives B (cid:48) − AC = k + 4 · ( − l = B − AC, so τ ◦ β (( A, B, C )) = (
A, B, C ) .Reworking the above argument assuming l = 1 , we find z = q , A = q − , then C = q − , and finally B − k = q − . Then B = 2 q − , contradicting B > A + C .It follows that β : ˜ Z → S is a bijection and τ is its inverse. (cid:3) Comparing Gauss- and Zagier-reduction
This section clarifies the simple relationship between the beading map β and Dirich-let’s map γ and justifies the statement that Zagier-reduction refines Gauss-reduction.Our presentation of Gauss-reduction is a modification of the usual algorithm, mov-ing through the cycle of reduced forms in the reverse direction. This puts the algo-rithm in a form parallel to Zagier’s algorithm, which is necessary for the statementof Theorem 4.4. We will only apply Gauss’s reduction algorithm to G-reduced forms.Recall that these forms were defined in Definition 1.1.So, suppose f = ( A, B, C ) is G-reduced. Compute δ such that | δ | = (cid:36) B + √ ∆2 | A | (cid:37) INIMAL PERIODS IN ZAGIER’S REDUCTION THEORY 15 with the sign of δ chosen so that δA > . Our version of Gauss’s reduction operatorsends f to the form f ( δx + y, − x ) . This switches the sign of A .Recall the definitions of S , S , B , G , G + , and Z from Section 1, and that G + isthe domain of γ . We also define G − = { ( A, B, C ) | ( A, B, C ) ∈ G, A < } . We also define maps • η + : S → S , which prepends a to s ∈ S , • η − : S → S , which appends a to s ∈ S , • R : S → S , defined so that ( q , . . . , q l ) R = ( q l , . . . , q ) , • T G : S → S , defined so that T G (( q , . . . , q l )) = ( q , . . . , q l , q ) , • T Z : S → S defined by (2.2). • µ : G → Z defined by (1.1), • ρ : G → G , defined so that ρ (( A, B, C )) = ( − A, B, − C ) , • R G : G → G , the Gauss-reduction operator, • R Z : Z → Z , the Zagier-reduction operator.We also define an operator R on the set of all binary quadratic forms by ( A, B, C ) R =( C, B, A ) . The reader should note from context whether R is being applied to a stringor to a form. Please note as well • R , ρ , and R G induce bijections G + → G − and G − → G + (which we denotealso with R , ρ , and R G ), • f and µ ( f ) are equivalent forms, • f and ρ ( f ) are equivalent if f is in a class of odd weight, but otherwise arein different classes, • f and f R are often not equivalent (in fact, they are in inverse classes in theclass group). Proposition 4.1. (i) If f ∈ G − , then γ ( f R ) = ( γ ◦ ρ ( f )) R .(ii) If f ∈ Z , then β (cid:0) f R (cid:1) = β ( f ) R .Proof. Let f = ( A, B, C ) ∈ G − have discriminant ∆ , and let ( t, u ) be the fundamentalsolution of | t − ∆ u | = 4 . If z = t + Bu , then γ ( f R ) = ( q , . . . , q l ) is the sequence ofpartial quotients when expanding z/Cu in a continued fraction. Since(4.1) t − Bu z = t − B u − l − ACu , we have Au · Cu ≡ ( − l (mod z ) and gcd( z, Cu ) = 1 , so also z = [ q , . . . , q l ] and Cu = [ q , . . . , q l ] . From (3.4), we then have Cu [ q , . . . , q l − ] = ( − l +1 (mod z ) , andit follows that(4.2) − Au ≡ [ q , . . . , q l − ] (mod z ) . We show now that − Au and [ q , . . . , q l − ] are both between and z . This is clearfor the latter, and − Au ≥ since f ∈ G − . Let us suppose that − Au > z . Then (4.1)implies t − Bu z − Cuz ≥ , so t ≥ ( B + 2 C ) u . Squaring both sides and simplifying, wededuce t − ∆ u ≥ Cu ( B + A + C ) . Since f ∈ G − , we know the right side is positive. Then t − ∆ u = 4 and we haveequality, so u = 1 , C = 1 , and B + A + C = 1 , so B = − A and t = 2 C − A . Then z = C − A , contradicting the assumption that − Au > z .We now know that − Au and [ q , . . . , q l − ] are both between and z . In light of(4.2), they are equal. From (3.3), − Au = [ q l − , . . . , and z = [ q l , . . . q ] . To compute γ ◦ ρ ( f ) , we expand z/ ( − Au ) in a continued fraction with quotient sequence of lengthparity l . Thus, γ ◦ ρ ( f ) = ( q l , . . . , q ) , and the proof of (i) is complete. We omit thedetails of the very similar argument for (ii). (cid:3) The next theorem gives the precise relationship between γ and the beading map β and is the key to connecting results about Z-reduced forms with results aboutG-reduced forms. Theorem 4.2.
The following diagrams commute (4.3) G + ZS S B µγ βη + sb G − ZS S B µγ ◦ ρ βη − sb The maps drawn with horizontal arrows are injections, and the ones drawn with ver-tical arrows are surjections ( sb is a bijection). Also, µ ( G + ) = β − ( η + ( S )) µ ( G − ) = β − ( η − ( S ) . A section of β is the map τ of (3.9) , while a section of γ is the map ξ (( q , . . . , q l )) =( A, B, C ) with A = [ q , . . . , q l ] B = [ q , q , . . . , q l ] − [ q , . . . , q l − ] C = − [ q , . . . , q l − ] The image of ξ is the set of forms in G + with discriminants of the form k ± , andthe form ( A, B, C ) given by the above formulas has discriminant ([ q , . . . , q l ] + [ q , . . . , q l − ]) + ( − l +1 · . Proof. If f has discriminant ∆ , then η + ◦ γ ( f ) = (1 , q , . . . , q l ) , where q , . . . , q l is thesequence of quotients in the regular continued fraction of z (cid:48) /Au , where t − ∆ u =( − l is the fundamental solution, and z (cid:48) = t + Bu . To compute β ◦ µ ( f ) , since µ ( f ) INIMAL PERIODS IN ZAGIER’S REDUCTION THEORY 17 also has discriminant ∆ , we set z = t +( B +2 A ) u , then expand zz − Au in a continuedfraction with quotient sequence of length parity l + 1 . As observed in the proof ofLemma 2.9, the quotient sequence of the expansion of zz − Au is obtained by pinchingboth ends of the quotient sequence of the expansion of zAu . Comparing z (cid:48) and z , wesee that zAu expands as a continued fraction with quotient sequence ( q + 1 , q , . . . , q l ) .Thus, β ◦ µ ( f ) is found by pinching both ends of ( q + 1 , q , . . . , q l ) , or it would beexcept that the length parity is wrong. Changing the length parity is accomplished byswitching between the two continued fraction expansions of zz − Au . Thus, β ◦ µ ( f ) =(1 , q , . . . , q l ) = η ◦ γ ( f ) and the diagram commutes.For the second diagram, if f ∈ G − , then f R ∈ G + and (1.1) shows µ ( f R ) = µ ( f ) R .Thus, from Proposition 4.1 ( β ◦ µ ( f )) R = β (cid:0) µ ( f ) R (cid:1) = β ◦ µ (cid:0) f R (cid:1) = η + ◦ γ ( f R ) = (cid:0) η − ◦ γ ◦ ρ ( f ) (cid:1) R , so β ◦ µ ( f ) = η − ◦ γ ◦ ρ ( f ) .It is easily verified that η + , and η − are injections and that restricting µ to G + or G − gives an injection. Theorem 3.2 states that β is a surjection with section τ .Let us now verify that that µ ( G + ) = β − ( η + ( S )) . The inclusion µ ( G + ) ⊂ β − ( η + ( S )) follows from the commutativity of the first diagram. Suppose s = q , . . . , q l is anonempty natural string and f = ( A, B, C ) is a Z-reduced form such that(4.4) β ( f ) = η + ( s ) = 1 , q , . . . , q l . Then f is in µ ( G + ) if and only if f ( x − y, y ) = ( A, B − A, A − B + C ) is G-reduced. Since f is Z-reduced, we have A ( A − B + C ) < . We must check also that B − A > | A − B + C | . Since C > , it suffices to show A − B + C < .Since f is Z-reduced, we have C − B < , so A − B + C < is immediateif A − B < . We may thus assume A − B ≥ . If f has discriminant ∆ and ( t, u ) is the fundamental solution of | t − ∆ u | = 4 , then β ( f ) is computed by setting z = t + Bu and expanding zz − Au in a continued fraction. From (4.4), the first quotientis , so either β ( f ) = (1 , or Au < z . If β ( f ) = (1 , , then f = (1 , , and A − B + C = − < . Otherwise, A − B < tu , and we have assumed the left side is nonnegative. Squaring both sides and using thedefinition of ( t, u ) , we find A − B + C < ± Au ≤ . But A − B + C = f (2 , − , and f cannot take the value since its discriminantis nonsquare. The desired inequaltiy A − B + C < follows, and we have shown β − ( η + ( S )) ⊂ µ ( G + ) . If instead β ( f ) = η − s = q . . . q l , then Proposition 4.1 shows β (cid:0) f R (cid:1) = η + (cid:0) s R (cid:1) .Since β − ( η + ( S )) = µ ( G + ) , we have f R = µ ( g ) for some g ∈ G + , so f = ( µ ( g )) R = µ ( g R ) , hence f ∈ µ ( G − ) . Thus, β − ( η − ( S )) = µ ( G − ) .We now check that ξ is a section of γ . If s = q . . . q l is in S , then τ ◦ η + ( s ) =( A (cid:48) , B (cid:48) , C (cid:48) ) with A (cid:48) = [ q , . . . , q l ] ,B (cid:48) = [ q + 1 , q , . . . , q l ] + [ q , . . . , q l − , q l − ,C (cid:48) = [ q + 1 , q , . . . , q l − , q l − . This is in β − ( η + ( S )) , so equals µ ( g ) for g = ( A (cid:48) , B (cid:48) − A (cid:48) , A (cid:48) − B (cid:48) + C (cid:48) ) ∈ G + . A fewapplications of (3.6) shows that g is the form ξ ( s ) in the theorem. Diagram chasingthen proves γ ◦ ξ ( s ) = s . This also shows that γ is a surjection.Theorem 3.2 shows that τ ◦ η + ( s ) has discriminant ([ q + 1 , q , . . . , q l ] − [ q , . . . , q l − + ( − l +1 · . But g = ξ ( s ) has the same discriminant, and the formula for the discriminant of ξ ( s ) in the theorem appears with a couple of applications of (3.6). This shows that ξ ( S ) iscontained in the set of forms in G + with discriminant of the form k ± . Conversely,if f is such a form, we have just shown ξ ◦ γ ( f ) is the unique form in g ∈ G + with µ ( g ) = τ ◦ η + ◦ γ ( f ) . But τ ◦ η + ◦ γ ( f ) = τ ◦ β ◦ µ ( f ) = µ ( f ) , so f = ξ ◦ γ ( f ) . (cid:3) Lemma 4.3. If f = ( A, B, C ) ∈ G + and γ ( f ) = ( q , . . . , q l ) , then R G ( f ) = f ( q x + y, − x ) . Proof.
Suppose f has discriminant ∆ and let ( t, u ) be the fundamental solution of | t − ∆ u | = 4 . Since R G commutes with scalar multiplication, Lemma 2.10 showsthat it suffices to prove the lemma when u = 1 and f has discriminant t ± .From Theorem 4.2, we have f = ξ (( q , . . . , q l )) , t = [ q , . . . , q l ] + [ q , . . . , q l − ] , and(4.5) A = [ q , . . . , q l ] , t + B q , . . . , q l ] , t − B q , . . . , q l − ] . We verify that(4.6) (2 q A − B ) < t + ( − l +1 · < (2( q + 1) A − B ) . When l = 1 , this reduces to q < q + 4 < q + 4 q + 4 , so let us assume that l ≥ .We readily check that q A − B = [ q , . . . , q l − ] − [ q , . . . , q l ] , and then q ( q A − B ) < [ q , ..., q l − ] < ( q + 1)( A ( q + 1) − B ) . Multiplying through by A = 4 [ q , . . . , q l ] and using (3.4), we obtain q A − q AB < t − B + ( − l +1 · < q + 1) A − q + 1) AB INIMAL PERIODS IN ZAGIER’S REDUCTION THEORY 19 and (4.6) follows. The discriminant of f is ∆ = t + ( − l +1 · , so since q A − B > ,we have q < B + √ ∆2 A < q + 1 , and the lemma follows. (cid:3) Theorem 4.4.
Suppose f ∈ G + with γ ( f ) = ( q , . . . , q l ) and g ∈ Z . Then γ ( ρ ◦ R G ( f )) = T G ( γ ( f )) , γ ( R G ( f )) = T G ( γ ( f )) , β ( R Z ( g )) = T Z ( β ( g )) ,µ ( R G ( f )) = R Z ( µ ( f )) , µ ( R G ( f )) = R q Z ( µ ( f )) . (An exponent on an operator indicates iteration.)Proof. Let f have discriminant ∆ and let ( t, u ) be the fundamental solution of | t − ∆ u | = 4 . Noting that R G and ρ commute with scalar multiplication, we findusing Lemma 2.10 that γ ( ρ ◦ R G ( uf )) = γ ( u ( ρ ◦ R G ( f ))) = γ ( ρ ◦ R G ( f )) and T G ( γ ( uf )) = T G ( γ ( f )) . Thus, in proving the first relation, we may assume with-out loss of generality that f has discriminant t ± and u = 1 .Suppose that f = ( A, B, C ) and γ ( f ) = ( q , . . . , q l ) . Theorem 4.2 shows that f = ξ (( q , . . . , q l )) , t = [ q , . . . , q l ] + [ q , . . . , q l − ] , and (4.5) again holds.From Lemma 4.3, we have ρ ◦ R G ( f ) = ( − q A + q B − C, q A − B, − A ) . Thisform has discriminant t ± , so we compute γ ( ρ ◦ R G ( f )) by setting z = t − B + 2 q A q , . . . , q l − ] + q [ q , . . . , q l ] = [ q , . . . , q l , q ] and expanding z/ ( − q A + q B − C ) in a continued fraction. This denominator equals − q [ q , . . . , q l ] + q [ q , . . . , q l ] − q [ q , . . . , q l − ] + [ q , . . . , q l − ]= q [ q , . . . , q l ] + [ q , . . . , q l − ] = [ q , . . . , q l , q ] . Thus, γ ( ρ ◦ R G ( f )) = ( q , . . . , q l , q ) = T G ( γ ( f )) . The relation γ ( R G ( f )) = T G ( γ ( f )) follows immediately from the first, noting that ρ and R G commute. The relation β ( R Z ( f )) = T Z ( β ( f )) is the content of Lemma 2.9.To check the final two relations, we can again reduce to when u = 1 and f hasdiscriminant t ± . Theorem 4.2 gives β ◦ µ ( R G ( f )) = η − ◦ γ ◦ ρ ( R G ( f )) , β ◦ µ (cid:0) R G ( f ) (cid:1) = η + ◦ γ (cid:0) R G ( f ) (cid:1) . The first two relations then give β ◦ µ ( R G ( f )) = η − ◦ T G ( γ ( f )) = ( q , . . . , q l , q , ,β ◦ µ (cid:0) R G ( f ) (cid:1) = η + ◦ T G ( γ ( f )) = (1 , q , . . . , q l , q , q ) . On the other hand, the third relation and Lemma 2.9 give β ( R Z ( µ ( f ))) = T Z ( β ◦ µ ( f )) = T Z ( η + ◦ γ ( f )) = ( q , . . . , q l , q , ,β ( R q Z ( µ ( f ))) = T q Z ( β ◦ µ ( f )) = T q Z ( η + ◦ γ ( f )) = T q Z ((1 , q , . . . , q l )) = (1 , q . . . , q l , q , q ) . The final two relations then follow from Theorem 3.2. (cid:3)
Corollary 4.5. If f and g are G-reduced forms such that µ ( f ) = µ ( g ) , then one of f and g is in G + and the other is in G − . If g ∈ G − , then f = R G ( g ) = g ( − x + y, − x ) . Conversely, if g ∈ G − and f = g ( − x + y, − x ) , then µ ( f ) = µ ( g ) .Proof. To verify the first statement, we examine (1.1) and observe that µ is injectivewhen restricted to either G + or G − . For the rest, we again reduce to the case when f and g have discriminants of the form t ± . So suppose g ∈ G − , f ∈ G + and µ ( f ) = µ ( g ) . We apply β and use Theorem 4.2 to obtain η + ◦ γ ( f ) = η − ◦ γ ◦ ρ ( g ) . There exists then a natural string s such that γ ◦ ρ ( g ) = 1 s and γ ( f ) = s , so γ ( f ) = T G ◦ γ ◦ ρ ( g ) = γ ◦ ρ ◦ R G ◦ ρ ( g ) = γ ( R G ( g )) . Theorem 4.2 shows that γ is a bijection when restricted to forms with discriminantsof the form t ± , so f = R G ( g ) . Let g (cid:48) = ρ ( g ) ∈ G + . Since γ ( g (cid:48) ) = 1 s , Lemma 4.3shows that ρ ◦ R G ( g ) = R G ( g (cid:48) ) = g (cid:48) ( x + y, − x ) , and R G ( g ) = g ( − x + y, − x ) follows.The converse is checked with a quick computation. (cid:3) Remarks.
1. The corollary can be proved directly. If f = ( A, B, C ) , A > and g = ( A (cid:48) , B (cid:48) , C (cid:48) ) , C (cid:48) > , then µ ( f ) = µ ( g ) leads to the relations A = A (cid:48) + B (cid:48) + C (cid:48) , B + 2 A = B (cid:48) + 2 C (cid:48) , and A + B + C = C (cid:48) . These readily imply C = A (cid:48) = − B + B (cid:48) , andfrom this, f = g ( − x + y, − x ) . It can then be shown that f = R G ( g ) .2. The corollary is visually evident from the Conway topograph of c once we learnhow to see G- and Z-reduced forms: G-reduced forms correspond to “riverbends” [14]and Z-reduced forms correspond to “positive confluences”, i.e., inlets to the river fromthe side with positive numbers. Every riverbend is adjacent to exactly one positiveconfluence, and µ maps the corresponding G-reduced form to the corresponding Z-reduced form. Pairs of forms that have the same image under µ correspond to adjacentriverbends, and being adjacent forces the conditions of the corollary.5. Constructing minimal periods with σ In this final section, we prove that σ produces minimal periods of Denjoy continuedfractions. Definition 5.1. A Denjoy continued fraction is an expression q + 1 q + 1 . . . INIMAL PERIODS IN ZAGIER’S REDUCTION THEORY 21 in which all quotients are or and such that the quotient sequence does not includetwo consecutive zeroes. If ξ > is an irrational number, then ξ expands uniquely ina Denjoy continued fraction as follows. Set ξ = ξ . For n ≥ , we define ξ n and q n recursively by setting q n = 0 if ξ n − < , q n = 1 if ξ n − > and ξ n = ξ n − − q n .The replacement rules. . . + 1 q n − + 11 + 10 = . . . + 1 q n − , and a + 10 + 1 b = a + b let us deal with convergents whose final quotient is or convert between Denjoy andregular continued fractions. If ξ > , then to convert the regular continued fraction of ξ into a Denjoy one, a process we call regular-to-Denjoy conversion , we simply replaceeach natural partial quotient q i by the string . . . containing q i − zeroes (andwe leave an initial quotient of 0 alone).From the criterion for periodicity of a regular continued fraction, we obtain: Theorem 5.2.
The sequence of quotients of the Denjoy continued fraction of anirrational number ξ > is eventually periodic if and only if ξ is a quadratic irrational.If the regular continued fraction is purely periodic, then so is the Denjoy one. Indeed,applying regular-to-Denjoy conversion to the minimal period of the regular continuedfraction gives the minimal period of the Denjoy one. We will also need to convert negative infinite continued fractions into regular ones( negative-to-regular conversion ). Let us write ( q , q , . . . ) and [ q , q , . . . ] to distinguishsequences of quotients of regular and negative continued fractions. Thus, an irrationalnumber ξ corresponds to [ q , q , . . . ] when ξ = q − q − . . . . The simple algorithm for converting between negative continued fractions and regularones is classical [12]. If [ q , q , . . . ] corresponds to an irrational number ξ > , then q i ≥ for all i . The corresponding regular continued fraction begins ( q − , . . . ) . Todetermine what follows the second term, we count the maximal string of ’s following q in [ q , q , . . . ] – say there are n of these ’s. The term q n +2 following this stringis ≥ , and we let m = q n +2 − . We then count the maximal string of ’s following q n +2 – say there are n of them. We then let m be less than the term q n + n +3 following this string of ’s. Continuing, we obtain sequences ( n i ) and ( m i ) , and ξ ’sregular continued fraction has quotient sequence ( q − , n , m , n , m , . . . ) . Theorem (Lagrange, Galois, Zagier [15]) . If g = ( A, B, C ) has discriminant ∆ and ξ = B + √ ∆2 A , then the following are equivalent: • g ∈ G + • ξ has purely periodic regular continued fraction expansion, • ξ > and − < ξ < ( ξ being the conjugate of ξ .Similarly, the following are equivalent • g ∈ Z • ξ has purely periodic negative continued fraction expansion, • ξ > and < ξ < .In the first case, we say ξ is G-reduced , and in the second we say it is
Z-reduced .Remark.
If we say ξ > is D-reduced if it has purely periodic Denjoy continuedfraction expansion. Theorem 5.3 below shows that if ξ is Z-reduced, then ξ − is D-reduced . The above result shows the set of G-reduced irrationalities is strictlycontained in the set of these ξ − . It is not hard to show that that the latter set isstrictly contained in the set of D-reduced irrationalities, with the remaining D-reducednumbers being those ξ satisfying ξ > and ξ < − . Theorem 5.3. If ( A, B, C ) ∈ Z has discriminant ∆ , then the quadratic irrationality ξ = B − A + √ ∆2 A has purely periodic Denjoy continued fraction, and the minimal period is obtainedfrom σ (( A, B, C )) by replacing each ‘0’ by ‘01’.Proof. From Zagier’s theorem above and the algorithm for negative-to-regular conver-sion, if ξ > , then B + √ ∆2 A > and ξ has a purely periodic regular continued fractionexpansion. Theorem 5.2 shows ξ has purely periodic Denjoy continued fraction.Now since ( A, B, C ) ∈ Z , then if ξ > , the theorem of Lagrange-Galois-Zagiershows that ξ is G -reduced, and it follows that ( A, B, C ) = µ ( g ) , where ξ is the G -reduced quadratic irrationality corresponding to g . Theorem 4.2 shows that β (( A, B, C )) =(1 , γ ( g )) . Let s be the binary string obtained when we replace each ‘0’ in σ (( A, B, C )) =sb(1 , γ ( g )) by ‘01’. It is then readily checked that applying regular-to-Denjoy conver-sion to the finite natural string γ ( g ) produces s . Property 1 of γ and Theorem 5.2then show that the theorem holds in this case.If < ξ < , then ( A, B, C ) (cid:54)∈ µ ( G + ) and β (( A, B, C )) = ( q , . . . , q l ) with q ≥ .This is equivalent to the reducing number of ( A, B, C ) being . With a look at theoperation (2.2), we see that while iterating the reduction operator, we will continueto have a reducing number through q − iterations, at which point we reach a formin µ ( G + ) , say µ ( h ) . Thus, γ ( h ) = ( q , . . . , q l − , q + q l − and ( A, B, C ) is carried to INIMAL PERIODS IN ZAGIER’S REDUCTION THEORY 23 h by operating by the matrix M = (cid:20) − (cid:21) q − (cid:20) −
10 1 (cid:21) = (cid:20) q q − − ( q − − ( q − (cid:21) . Now some algebra will show that /ξ − ( q − is the quadratic irrational correspondingto the form obtained from ( A, B, C ) by applying M , i.e., h . It follows that /ξ − ( q − is G -reduced and has purely periodic regular continued fraction expansion with min-imal period γ ( h ) = ( q , . . . , q l − , q + q l − . Thus, ξ has regular continued fraction (0 , q − , q , . . . , q l − , q + q l − . Converting using regular-to-Denjoy conversion, wesee that ξ has purely periodic Denjoy continued fraction expansion with minimalperiod (0 , q − , , (0 , q − , , (0 , q − , . . . , (0 , q l − , (in which (0 , a is shorthand for the a -fold self-concatenation of the string 01). Thisis also the sequence obtained from σ (( A, B, C )) = sb(( q , . . . , q l ) upon replacing each‘0’ by ‘01’, and the proof is complete. (cid:3) References [1] E. Barbeau,
Pell’s Equation , Springer-Verlag, 2003.[2] J. Conway,
The Sensual Quadratic Form , MAA, 1997.[3] A. Denjoy, Complément a la notice publiée en 1934 sur les travaux scientifiques de M. ArnaudDenjoy, Hermann, Paris 1942.[4] P. G. L. Dirichlet, Vereinfachung der Theorie der binären quadratischen Formen von positiverDeterminante,
Abh. K. Akad. Wiss. Berlin , 1854, 99–115.[5] L. Elsner and R. M. Redheffer, Remarks on band matrices,
Numer. Math. , 1967, 153–161.[6] G. Frobenius, Über die Reduktion der indefiniten binären quadratischen Formen, Sitz.-Ber. d.K. Pr. Akad. d. Wiss. Berlin , 1913, 202–211.[7] F. Halter-Koch,
Quadratic Irrationals: an Introduction to Classical Number Theory , CRC Press,2013.[8] G. H. Hardy and E. M. Wright,
An Introduction to the Theory of Numbers , 6th Edition, OxfordUniversity Press, 2008.[9] M. Iosifescu and C. Kraaikamp, On Denjoy’s canonical continued fraction expansion,
Osaka J.Math. , no.1, 2003, 235–244.[10] P. Rózsa, On periodic continuants, Linear Algebra Appl. no. 2, 1969, 267–274.[11] B. Smith, Reducing quadratic forms by kneading sequences, J. Int. Seq. , 2014, article 14.11.8.[12] M. Stern, Über die Eigenschaften der periodischen negativen Kettenbrüche, welche dieQuadratwurzel aus einer ganzen positiven Zahl darstellen, Abh. der K. Ges. der Wiss. zu Göt-tingen , 1864, 3–48.[13] A. Uludağ, A. Zeytin, M. Durmuş, Binary quadratic forms as dessins, preprint, 22 pages.[14] M. Weissman, Illustrated Theory of Numbers , American Mathematical Society, 2017.[15] D. Zagier,