Friezes and Continued Fractions Evgeny Smirnov Abstract . We explore basic properties of number friezes, due to Conway and Coxeter, and their relations to decompositions of rational numbers into continued fractions, Farey sequences, and the modular group acting on the hyperbolic plane. These are notes from a mini-course for undergraduate students given at the 19th Summer School “Modern Mathematics”, Dubna, Russia, July 18–29, 2019. Faust. Das Pentagramma macht dir Pein? Ey sage mir, du Sohn der Hölle, Wenn das dich bannt, wie kamst du denn herein? Wie ward ein solcher Geist betrogen? Mephistopheles. Beschaut es recht! es ist nicht gut gezogen; Der eine Winkel, der nach außen zu, Ist, wie du siehst, ein wenig offen. Faust. Das hat der Zufall gut getroffen! Und mein Gefangner wärst denn du? Das ist von ohngefähr gelungen! (J. W. von Goethe. Faust) Faust: The pentagram prohibits thee? Why, tell me now, thou Son of Hades, If that prevents, how cam’st thou in to me? Could such a spirit be so cheated? Mephistopheles: Inspect the thing: the drawing’s not completed. The outer angle, you may see, Is open left — the lines don’t fit it. Faust: Well, — Chance, this time, has fairly hit it! And thus, thou’rt prisoner to me? It seems the business has succeeded. (Translated by Bayard Taylor) Introduction Friezes are tables filled with positive numbers according to certain simple rules. They were first defined in the 1970s in works by H. S. M. Coxeter and John Conway. Despite the simplicity of their definition, friezes possess many surprising properties. They are connected with numerous other mathematical concepts including polygon triangulations, Catalan and Fibonacci numbers, continued fractions, Farey sequences… Moreover, it turns out that friezes (though not called by this name at the time) were already considered in works by Carl Friedrich Gauss and John Napier. In the 2000s, the interest in friezes among mathematicians grew significantly due to the emergence of cluster algebra theory, introduced by Andrei Zelevinsky and Sergei Fomin. It turns out that friezes appear in connection with quiver representations, Grassmannians, elliptic functions, generalized associahedra, and many other topics from modern mathematics. In these notes, we begin with classical questions about friezes considered by Coxeter and Conway. The first three chapters are devoted to this. In Chapter 1, we present basic definitions, make several observations about friezes (which will be proved later), and discuss the early history of the subject: how friezes appeared in works by Gauss and his predecessors. In Chapter 2 we explore the phenomenon of integrality of friezes. We show that the elements of a frieze are computed as integer-coefficient polynomials, known as continuants, from the elements of the initial row. In Chapter 3, we continue studying friezes and derive relations between elements in their rows and diagonals. The main result of Chapter 4 is the classification of all integer friezes. As we will show, integer friezes of order n are in bijection with triangulations of a convex n -gon; moreover, all elements of the frieze can be reconstructed from this triangulation using a simple algorithm. Chapters 5 and 6 are devoted to expansions of rational numbers into two types of continued fractions: “ordinary” or positive, and negative (where the integer part is taken with excess rather than deficit). We formulate properties of continued fractions in terms of 2\times 2 matrices and in Chapter 6 establish connections between the two types of expansions. We also show that the continued fraction expansion of a rational number corresponds to a triangulation of a polygon of a special form. It turns out that various characteristics of this continued fraction can be reconstructed from the triangulation: convergents, length of the continued fraction, etc. Thus continued fractions turn out to be connected with friezes: each rational number determines an integer frieze with the same triangulation. In Chapters 7 and 8, we study the relation of these topics to the action of the modular group \mathop{\mathrm{PSL}}_{2}({\mathbb{Z}}) on the hyperbolic plane. Namely, any triangulation of the described form can be obtained as a subgraph in the so-called Farey graph: an infinite graph whose vertices are rational points on the absolute of the hyperbolic plane, and the edges correspond to lines connecting points p/q and r/s such that ps-qr=\pm 1 . This graph is preserved by the modular group \mathop{\mathrm{PSL}}_{2}({\mathbb{Z}}) . We describe a construction that assigns to each rational number (or the corresponding polygon triangulation) an element of the modular group with an explicit expression in terms of its standard generators. Finally, we examine how triangulations of polygons and their generalizations, 3D-dissections, are connected to relations on the generators of the modular group. The dependency diagram of chapters looks as follows: \textstyle{1\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{2\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{3\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{4\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{7\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{8} \textstyle{5\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{6\ignorespaces\ignorespaces\ignorespaces\ignorespaces} Readers more interested in continued fractions may skip the first four chapters and start with Chapters 5 and 6, that are almost independent of the previous part. These notes are based on a mini-course of three lectures I gave at the 19th Summer School “Modern Mathematics” in Dubna in July 2019. I decided to speak about friezes after attending the talks by Valentin Ovsienko and Sophie Morier-Genoud at the Summer School “Representation Theory of Lie Groups, Mathematical Physics and Combinatorics” (Reims, France) in June of the same year. I also used materials from my mini-course on continued fractions and their connection with the modular group, given at the online school “Combinatorics and Algorithms” in February 2021. I am grateful to the organizers and participants of these schools. Needless to say, these notes make no claim to completeness in covering the literature on friezes; for this I recommend the reader to turn to surveys and specialized articles on the subject. For example, one might start with a wonderful survey by Sophie Morier-Genoud [ 5 ] . Moreover, a collection of references on friezes and their connections with other areas of mathematics can be found on the homepage of Anna Felikson: http://www.maths.dur.ac.uk/users/anna.felikson/Projects/frieze/frieze-res.html I am grateful to the colleagues who read preliminary versions of these notes and provided feedback: Anna Felikson, Victor Kleptsyn, Grigory Merzon, Valentin Ovsienko, Sergei Tabachnikov, and others. I received particularly valuable feedback from Alexei Ustinov; from him I also learned about representing continuants using Morse codes. Finally, I want to thank my wife Svetlana Bochaver for her constant support and encouragement; without her, this text would likely never have been completed. On April 11, 2020, as I was finishing the initial version of these notes, John Horton Conway, one of the most remarkable and extraordinary mathematicians of our time, passed away at the age of 83. I dedicate this text to his memory. 1. Friezes 1.1. Definition and first properties Consider the following simple arithmetic game. We start with a row of 1 ’s, going infinitely in both directions. Then we take a finite sequence of several nonnegative integers, not containing two subsequent 1 ’s, extend it periodically in both directions, and write it under the first row with a half-step shift, so that the numbers would be arranged in a checkerboard pattern. These are the first two rows of our table. Let us fill the subsequent rows of the table, starting from the third one, in such a way that the numbers in these rows satisfy the unimodularity condition : for any four numbers at the vertices of a unit diamond (1.1) \begin{array}[]{ccc}&b&\\ a&&d\\ &c\end{array} we have ad-bc=1 . The game is terminated if at some step we get a row consisting only of 1 ’s; in this case the table is said to be a frieze . Here is an example. Let us write in the second row of the table the following sequence: (2,1,4,2,1,3,2) , extended to both directions periodically. Then at each position at the third row we will have the product of the numbers above it minus one. This means that the third row will consist of repeating sequences (1,3,7,1,2,5,3) . It is clear that all the subsequent rows also have the same period as the second row, namely, 7. Computing this table further, we get the following: \begin{array}[]{ccccccccccccccccccccc}\dots&1&&1&&1&&1&&1&&1&&1&&1&&1&\dots\\ &\dots&2&&1&&4&&2&&1&&3&&2&&2&&1&\dots\\ \dots&3&&1&&3&&7&&1&&2&&5&&3&&1&\dots\\ &\dots&1&&2&&5&&3&&1&&3&&7&&1&&3&\dots\\ \dots&2&&1&&3&&2&&2&&1&&4&&2&&2&\dots\\ &\dots&1&&1&&1&&1&&1&&1&&1&&1&&1&\dots\\ \end{array} We see that the sixth row contains only of 1 ’s. According to the unimodality condition, the row below it would consist only of zeroes; we will not write it here. Sometimes it will also be convenient to suppose that there is an “invisible” row of zeroes above the first line; then the rows number zero, one and two will also satisfy the unimodality condition. It is obvious that a frieze is determined by its second row. Further we will write something like “frieze with the second row (2,1,4,2,1,3,2) ” (this is the frieze from the previous example), providing the period of the second row. But if we put arbitrary nonnegative integers numbers into the second row, most probably we will not get a frieze. For example, take the second row consisting only of 2 ’s. Then all the elements of the third row will be equal to \frac{2\cdot 2-1}{2}=3 , the elements in the fourth row equal \frac{3\cdot 3-1}{2}=4 , and so on; the n -th row will consist of n ’s. So the entries in the rows of this table will be always increasing and thus will never become equal to 1. Sometimes we will abuse our convention and refer to such infinite tables satisfying the unimodulality condition as to infinite friezes . Looking at the previous example, we can notice some interesting properties of friezes. In particular, all elements of both finite and infinite friezes turn out to be integers. This is completely non-obvious: the unimodularity condition for the diamond ( 1.1 ) implies that c=(ad-1)/b , meaning that to calculate the elements of the next row, one must use division; yet its result is for some reason always an integer. In the next chapter, we will find out why this is the case. Now let us return to “finite” friezes, that is, those that end with a row of ones. From the construction, it is clear that if the second row of the frieze is periodic with period n , then all other rows will have the same property. However, the frieze from the given example additionally possesses glide symmetry: if we flip it upside down and shift it sideways by three and a half positions, it will coincide with the original. In Chapter 3 , we will show that this is a general property: a frieze with n-1 rows always possesses glide symmetry of order n/2 and, consequently, is periodic with period n . Furthermore, one can consider friezes whose second row contains not necessarily integers, but arbitrary positive numbers. It turns out that the previous properties will also hold for them: the presence of glide symmetry and the connection between the number of rows and the period of the frieze. However, we will mainly be interested in integer friezes. A note on terminology. In architecture, a frieze is a decorative ornament in the form of a horizontal band. In mathematics, this word has one more meaning: friezes are figures on a plane that repeat in only one direction, i.e., they are mapped onto themselves by a parallel translation. The theory of discrete transformation groups studies frieze groups (also known as wallpaper groups ), which describe the possible types of symmetries of such patterns. It turns out there are only seven such groups; interestingly, Conway 1 1 1 John Horton Conway (1937–2020) was a prolific British mathematician active in many areas, including group theory (Conway groups, the moonshine conjecture), knot theory (Conway polynomial), combinatorial game theory (surreal numbers), and more. He was widely known as a popularizer of mathematics, particularly as the creator of the “Game of Life”. and Coxeter 2 2 2 Harold Scott MacDonald (Donald) Coxeter (1907–2003) was a British-born Canadian geometer, sometimes considered one of the greatest geometers of the 20th century. He was the author of numerous works on regular polytopes, discrete groups, and more. , the authors of the concept of a numerical frieze, also studied these groups. However, wallpaper groups are not directly related to numerical friezes, and we will not consider them in these notes. Those wishing to learn more about this can refer to, for example, the Wikipedia article: https://en.wikipedia.org/wiki/Frieze_group . 1.2. Friezes with two and three rows Let us examine the structure of friezes with small number of rows. A two-line frieze is unique by definition: it consists only of 1 ’s. \begin{array}[]{ccccccccccccccccccccc}\dots&1&&1&&1&&1&&1&&1&&1&&1&&1&\dots\\ &\dots&1&&1&&1&&1&&1&&1&&1&&1&&1&\dots\\ \end{array} Next, a frieze with three rows is of the following form: \begin{array}[]{ccccccccccccccccccccc}\dots&1&&1&&1&&1&&1&\dots\\ &\dots&a_{1}&&a_{2}&&a_{3}&&a_{4}&&\dots\\ \dots&1&&1&&1&&1&&1&\dots\\ \end{array} The unimodularity condition is equivalent to saying that the product of any two elements in the middle row equals 2. Therefore the numbers in this row are alternating: \begin{array}[]{ccccccccccccccccccccc}\dots&1&&1&&1&&1&&1&\dots\\ &\dots&a_{1}&&a_{2}&&a_{1}&&a_{2}&&\dots\\ \dots&1&&1&&1&&1&&1&\dots\\ \end{array}, with a_{1}a_{2}=2 . In particular, there are two integer three-row friezes: one corresponding to a_{1}=2 and a_{2}=1 , and the other to a_{1}=1 and a_{2}=2 . These friezes differ only by a shift, but we will treat them as different ones. And if a_{1}=a_{2} , we get the following non-integer frieze: \begin{array}[]{ccccccccccccccccccccc}\dots&1&&1&&1&&1&&1&\dots\\ &\dots&\sqrt{2}&&\sqrt{2}&&\sqrt{2}&&\sqrt{2}&&\dots\\ \dots&1&&1&&1&&1&&1&\dots\\ \end{array} Remark 1.1 . Note that three-row friezes are periodic with period 2, not 4 (and the period of the last frieze is just 1). This is related to the glide symmetry: if a three-row frieze is flipped upside down and shifted by half a period, that is, by two, it should coincide with the initial one. 1.3. Four-row friezes It is more convenient to construct such friezes from the diagonal rather than from the top row. Consider a frieze of the form: \begin{array}[]{ccccccccccccccccccccc}\dots&1&&1&&1&&1&\dots\\ &\dots&x&&z&&v&&t&\dots\\ &&\dots&y&&u&&w&\dots\\ &\dots&1&&1&&1&&1&\dots\\ \end{array} Let us express all its values consequently in terms of x and y . We get: z=\frac{1+y}{x};\qquad u=\frac{1+z}{y}=\frac{1+x+y}{xy};\qquad v=\frac{1+u}{z}=\frac{1+x+y+xy}{xy}\cdot\frac{x}{1+y}=\frac{1+x}{y}; w=\frac{1+v}{u}=\frac{1+x+y}{y}\cdot\frac{xy}{1+x+y}=x;\qquad t=\frac{1+w}{v}=(1+x)\cdot\frac{y}{1+x}=y. We obtain x and y again, but on a different diagonal. We see that this frieze again turns out to be periodic with period 5 and possesses glide symmetry. Exercise 1.2 . List all integer friezes of order 5. How many are there? Remark 1.3 . If we consider the elements of a frieze as rational functions of variables x and y , then the denominator of these rational functions always turns out to be a monomial. In other words, the frieze elements are not just rational functions, but Laurent polynomials : polynomials where negative integer powers of variables are also allowed. Since we often divide by non-monomials, we can note that “mysteriously” the division always turns out to be exact, though now in the ring of Laurent polynomials. This observation, known as the Laurent phenomenon , has far-reaching generalizations in cluster algebra theory. Exercise 1.4 . Express the elements of a frieze with five rows through the values on the diagonal. Will the Laurent phenomenon hold in this case? Exercise 1.5 . Consider a frieze with four rows with x=y=\tau . Show that \tau=\frac{1+\sqrt{5}}{2} , and find the remaining elements of this frieze. The last frieze can be obtained from a regular pentagon as follows. B C D E A Figure 1.1. Regular pentagon Consider a regular pentagon with all sides equal to 1 (Fig. 1.1 ). Denote its diagonal by \tau . Ptolemy’s theorem 3 3 3 Claudius Ptolemy (c. 100 – c. 170 AD) was an ancient Greek mathematician, astronomer, astrologer, geographer, and music theorist. In his famous astronomical treatise the Almagest , he proposed a geocentric model of the universe, in which the motion of celestial bodies is represented as a combination of uniform circular motions. He compiled a table of chords corresponding to angles in whole degrees and introduced the division of degrees into minutes and seconds. from plane geometry states that for an inscribed quadrilateral ABCD , the equality AB\cdot CD+AD\cdot BC=AC\cdot BD holds. We can write Ptolemy’s theorem for an isosceles trapezoid ABCD : in it AB=BC=CD=1 , and AD=AC=BD=\tau . We get the equation 1\cdot\tau+1\cdot 1=\tau\cdot\tau,\qquad\text{i.e.}\qquad\tau^{2}-\tau-1=0. The positive root of this equation is exactly \frac{1+\sqrt{5}}{2} ; this is the famous golden ratio . Exercise 1.6 . Consider a regular n -gon with side length 1 and repeatedly apply Ptolemy’s theorem to it. What frieze will we obtain? What are the elements in its k -th row? 1.4. Pentagramma mirificum Friezes of order 5 first appeared in connection with spherical trigonometry in the works of Nathaniel Torporley 4 4 4 Nathaniel Tarporley, also Torporley (1564–1632). English mathematician, astronomer and astrologer. He worked for some time in France as a secretary of François Viète. and John Napier 5 5 5 John Napier (1550–1617). Scottish mathematician, physisist and astronomer, inventor of logarithms and the decimal point. . They were further developed in the works of Carl Friedrich Gauss 6 6 6 Carl Friedrich Gauss (1777–1855) was a German mathematician, physicist, and astronomer. He is credited with fundamental results in algebra, geometry, number theory, analytical mechanics, and the theory of magnetism. He was called Princeps Mathematicorum , the Prince of Mathematicians. The monument to Gauss in his native Braunschweig is adorned with a 17-pointed star, as Gauss was the first to describe the construction of a regular 17-sided polygon using a compass and straightedge. . Their appearance is related to the following problem in spherical geometry. Consider a five-pointed star on the unit sphere where all angles are right angles (see Fig. 1.2 ). In particular, this means that point A^{\prime} is one of the poles for the great circle CD , while B^{\prime} is a pole for the great circle DE , etc. Figure 1.2. Pentagramma mirificum. Right: illustration from Napier’s work, 1614. Denote the squares of tangents of the side lengths of pentagon A^{\prime}B^{\prime}C^{\prime}D^{\prime}E^{\prime} by \alpha,\dots,\epsilon : \alpha=\tan^{2}B^{\prime}E^{\prime},\quad\beta=\tan^{2}E^{\prime}C^{\prime},\quad\gamma=\tan^{2}A^{\prime}C^{\prime},\quad\delta=\tan^{2}A^{\prime}D^{\prime},\quad\epsilon=\tan^{2}D^{\prime}B^{\prime}. It turns out that these five quantities are related by the following equations, which allow obtaining the other three from any two of them: (1.2) 1+\alpha=\gamma\delta;\qquad 1+\beta=\delta\epsilon;\qquad 1+\gamma=\epsilon\alpha;\qquad 1+\delta=\alpha\beta;\qquad 1+\epsilon=\beta\gamma. Exercise 1.7 (optional, for spherical geometry enthusiasts) . Verify these formulas. Thus, these quantities are elements of the following order 5 frieze: \begin{array}[]{ccccccccccccccccccccc}\dots&1&&1&&1&&1&&1&&1&\dots\\ &\dots&\alpha&&\beta&&\gamma&&\delta&&\epsilon&\dots\\ &&\dots&\delta&&\epsilon&&\alpha&&\beta&&\gamma&\dots\\ &\dots&1&&1&&1&&1&&1&&1&\dots\\ \end{array} Exercise 1.8 . Using relations ( 1.2 ), prove the following equality (also due to Gauss): \alpha\beta\gamma\delta\epsilon=3+\alpha+\beta+\gamma+\delta+\epsilon=\sqrt{(1+\alpha)(1+\beta)(1+\gamma)(1+\delta)(1+\epsilon)}. Gauss referred to this equality as to schöne Gleichung , “a beautiful equation”. In more modern terms, we can say that friezes describe the moduli space \mathcal{M}_{0,5} of five points on a projective line {\mathbb{P}}^{1} . Specifically, consider five distinct points z_{1},\dots,z_{5} on {\mathbb{P}}^{1} , up to the action of \mathop{\mathrm{PGL}}(2) . For any four of them we can write their cross-ratio. Let u_{1}=[z_{1}:z_{2}:z_{3}:z_{4}]=\frac{(z_{3}-z_{1})(z_{4}-z_{2})}{(z_{3}-z_{2})(z_{4}-z_{1})},\hskip 9.24994ptu_{2}=[z_{2}:z_{3}:z_{4}:z_{5}],\hskip 9.24994pt\dots and so on. Thus we obtain five cross-ratios u_{1},\dots,u_{5} . It can be shown that they satisfy relations similar to ( 1.2 ). Therefore, such quintuples (and, consequently, friezes with four rows) parameterize five points on {\mathbb{P}}^{1} up to a projective coordinate change. The details are left as an exercise for the interested reader. 2. Continuants 2.1. Recurrence relation Now let us consider friezes with arbitrarily many rows. Our immediate goal is to obtain an expression for elements of the third and subsequent rows of a frieze in terms of elements of the second row. Consider a frieze with second row \dots,a_{1},a_{2},a_{3},\dots . Clearly, each element of the third row can be expressed through two elements of the second row that are directly above it (left and right). Furthermore, each element of the fourth row can be found by the unimodularity rule through three elements of the second row above it, and so on. Let us denote elements of the third row by a_{12},a_{23},\dots , the fourth row by a_{13} , a_{24} , etc., as shown below: \begin{array}[]{ccccccccccccccccccccc}\dots&1&&1&&1&&1&&1&\dots\\ &\dots&a_{1}&&a_{2}&&a_{3}&&a_{4}&\dots\\ &&\dots&a_{12}&&a_{23}&&a_{34}&\dots\\ &&&\dots&a_{13}&&a_{24}&\dots\\ &&&&\dots&a_{14}&\dots\\ \end{array} It is easy to express elements of the third row: a_{12}=a_{1}a_{2}-1,\qquad a_{23}=a_{2}a_{3}-1. From them we can express elements of the fourth row: a_{13}=\frac{a_{12}a_{23}-1}{a_{2}}=a_{1}a_{2}a_{3}-a_{1}-a_{3}, the fifth row: a_{14}=\frac{a_{13}a_{24}-1}{a_{23}}=\dots=a_{1}a_{2}a_{3}a_{4}-a_{1}a_{2}-a_{1}a_{4}-a_{3}a_{4}+1, the sixth row: a_{15}=a_{1}a_{2}a_{3}a_{4}a_{5}-a_{1}a_{2}a_{3}-a_{1}a_{2}a_{5}-a_{1}a_{4}a_{5}-a_{3}a_{4}a_{5}+a_{1}+a_{3}+a_{5}, and so on (do these calculations yourself!). Looking carefully at these expressions, we can notice a pattern they follow. 2.2. Morse codes Consider n points in a row, labeled by variables a_{1},\dots,a_{n} . Now connect some pairs of adjacent points with the condition that each point can be connected to at most one neighbor. We obtain a “Morse code” of dots and dashes: a configuration like the following one. \stackrel{{\scriptstyle a_{1}}}{{\circ}}-\stackrel{{\scriptstyle a_{2}}}{{\circ}}\quad\stackrel{{\scriptstyle a_{3}}}{{\circ}}\quad\stackrel{{\scriptstyle a_{4}}}{{\circ}}\quad\stackrel{{\scriptstyle a_{5}}}{{\circ}}-\stackrel{{\scriptstyle a_{6}}}{{\circ}}\quad\stackrel{{\scriptstyle a_{7}}}{{\circ}} To such a configuration we can associate a monomial: the product of variables corresponding to dots , taken with a “ + ” or “ - ” sign depending on the parity of the number of dashes . We will call this monomial the weight of the Morse code M and denote it by w(M) . Thus, the configuration in the previous figure corresponds to the expression w(M)=(-1)^{2}a_{3}a_{4}a_{7}=a_{3}a_{4}a_{7} . Example 2.1 . All Morse codes and their corresponding monomials for n from 1 to 5 are shown in Table 1 . n=1 \circ a_{1} n=2 {\circ}\quad{\circ} a_{1}a_{2} {\circ}-{\circ} -1 n=3 {\circ}\quad{\circ}\quad{\circ} a_{1}a_{2}a_{3} {\circ}\quad{\circ}-{\circ} -a_{1} {\circ}-{\circ}\quad{\circ} -a_{3} n=4 \circ\quad\circ\quad\circ\quad\circ a_{1}a_{2}a_{3}a_{4} \circ\quad\circ\quad\circ-\circ -a_{1}a_{2} \circ\quad\circ-\circ\quad\circ -a_{1}a_{4} \circ-\circ\quad\circ\quad\circ -a_{3}a_{4} \circ-\circ\quad\circ-\circ 1 n=5 \circ\quad\circ\quad\circ\quad\circ\quad\circ a_{1}a_{2}a_{3}a_{4}a_{5} \circ\quad\circ\quad\circ\quad\circ-\circ -a_{1}a_{2}a_{3} \circ\quad\circ\quad\circ-\circ\quad\circ -a_{1}a_{2}a_{5} \circ\quad\circ-\circ\quad\circ\quad\circ -a_{1}a_{4}a_{5} \circ-\circ\quad\circ\quad\circ\quad\circ -a_{3}a_{4}a_{5} \circ\quad\circ-\circ\quad\circ-\circ a_{1} \circ-\circ\quad\circ\quad\circ-\circ a_{3} \circ-\circ\quad\circ-\circ\quad\circ a_{5} Table 1. Morse codes for n\leq 5 Definition 2.2 . The continuant V_{n}(a_{1},\dots,a_{n}) of order n is defined as the sum of monomials corresponding to all possible Morse codes on n vertices. Remark 2.3 . We set the zero order continuant (that does not depend upon any arguments) to be V_{0}=1 . Moreover, it is sometimes convenient to consider V_{n}=0 when n is negative. Table 1 allows us to compute continuants of orders up to 5. We see that we get exactly the same expressions as for the frieze elements computed in the previous section. We will soon prove this claim, but first let us establish some more properties of continuants. We start with a recurrence relation. Proposition 2.4 . Continuants satisfy the recurrence relation (2.1) V_{n}(a_{1},\dots,a_{n})=a_{n}V_{n-1}(a_{1},\dots,a_{n-1})-V_{n-2}(a_{1},\dots,a_{n-2}) with the initial condition V_{0}=1 , V_{1}=a_{1} . Proof. Take any Morse code on n vertices. Look at its last vertex. There are two possibilities. Either it corresponds to a dot, in which case this configuration M corresponds to a Morse code M^{\prime} on vertices 1,\dots,{n-1} ; here w(M)=a_{n}w(M^{\prime}) , since in code M the last vertex is counted while in configuration M^{\prime} it is not. Or, conversely, the last vertex is connected to the penultimate one by a dash; in this case we remove these two vertices and denote the resulting Morse code on vertices 1,\dots,n-2 by M^{\prime\prime} . Then the weights of codes M and M^{\prime\prime} will differ by sign: w(M)=-w(M^{\prime\prime}) . Thus, all codes starting with a dot will contribute a_{n}V_{n-1}(a_{1},\dots,a_{n-1}) to the continuant V_{n}(a_{1},\dots,a_{n}) , while those starting with a dash will contribute -V_{n-2}(a_{1},\dots,a_{n-2}) . This gives us the desired relation ( 2.1 ). ∎ We leave further properties of continuants as exercises for the reader. Exercise 2.5 . Prove the following identities: (1) V_{n}(a_{1},\dots,a_{n})=V_{n}(a_{n},\dots,a_{1}) ; (2) V_{n}(a_{1},\dots,a_{n-1},0)=-V_{n-2}(a_{1},\dots,a_{n-2}) ; (3) V_{n}(a_{1},\dots,a_{n})=a_{1}V_{n-1}(a_{2},\dots,a_{n})-V_{n-2}(a_{3},\dots,a_{n}) . 2.3. Unimodularity relation for continuants Theorem 2.6 . For any a_{1},\dots,a_{n+1} , the following relation holds: (2.2) V_{n}(a_{1},\dots,a_{n})V_{n}(a_{2},\dots,a_{n+1})=V_{n-1}(a_{2},\dots,a_{n})V_{n+1}(a_{1},\dots,a_{n+1})+1. We provide two proofs of this theorem: an algebraic and a combinatorial one. Algebraic proof. We prove the theorem by induction on n . The base case for n=1 is obvious. To prove the induction step, write the required relation for n and rewrite all terms involving a_{n+1} using relation ( 2.1 ): V_{n+1}(a_{1},\dots,a_{n+1})=a_{n+1}V_{n}(a_{1},\dots,a_{n})-V_{n-1}(a_{1},\dots,a_{n-1}); V_{n}(a_{2},\dots,a_{n+1})=a_{n+1}V_{n-1}(a_{2},\dots,a_{n})-V_{n-2}(a_{2},\dots,a_{n-1}). Then the equality becomes: V_{n}(a_{1},\dots,a_{n})(a_{n+1}V_{n-1}(a_{2},\dots,a_{n})-V_{n-2}(a_{2},\dots,a_{n-1}))=\\ =V_{n-1}(a_{2},\dots,a_{n})(a_{n+1}V_{n}(a_{1},\dots,a_{n})-V_{n-1}(a_{1},\dots,a_{n-1}))+1. Both sides of the equality contain the term a_{n+1}V_{n-1}(a_{2},\dots,a_{n})V_{n}(a_{1},\dots,a_{n}) ; canceling it out, we obtain: -V_{n}(a_{1},\dots,a_{n})V_{n-2}(a_{2},\dots,a_{n-1})=-V_{n-1}(a_{1},\dots,a_{n-1}))V_{n-1}(a_{2},\dots,a_{n})+1, which holds by the induction hypothesis. The theorem is proved. ∎ Combinatorial proof. Consider each continuant in the left-hand side of ( 2.2 ) as a sum of monomials corresponding to Morse codes on the sets \{1,\dots,n\} and \{2,\dots,n+1\} , respectively. We represent these Morse codes on a single diagram, using dashed lines for the first code and solid lines for the second, as shown below. Thus, dashed lines may appear in all positions except the last one, while solid lines may appear in all positions except the first one. Therefore, the left-hand side of ( 2.2 ) equals the sum of monomials obtained from all possible pairs of Morse codes under these conditions. \textstyle{\circ\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\circ\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\circ\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\circ} \textstyle{\circ} \textstyle{\circ\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\circ} \textstyle{\circ\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\circ} Figure 2.1. A pair of Morse codes Do the same for the product of continuants on the right-hand side of ( 2.2 ): each product of monomials from V_{n-1}(a_{2},\dots,a_{n}) and V_{n+1}(a_{1},\dots,a_{n+1}) can be interpreted as a pair of Morse codes on \{1,\dots,n+1\} , where the first code (dashed lines) cannot have lines in the first and last positions, while the second (solid lines) has no such restrictions. Consider any configuration (M_{1},M_{2}) , where M_{1} and M_{2} are Morse codes on \{1,\dots,n\} and \{2,\dots,n+1\} , respectively. It corresponds to the monomial w(M_{1})w(M_{2}) from the left-hand side of ( 2.2 ). From it, construct a new configuration (M_{1}^{\prime},M_{2}^{\prime}) , where M_{1}^{\prime} is a Morse code on \{1,\dots,n+1\} and M_{2}^{\prime} is a code on \{2,\dots,n\} . If there is no (dashed) line between 1 and 2 in M_{1} , then M_{1} can be viewed as a code on vertices 2,\dots,n . Meanwhile, the solid-line code M_{2} can be viewed as a code on vertices 1,\dots,n+1 with no line in the first position. In this case, set (M_{1}^{\prime},M_{2}^{\prime})=(M_{1},M_{2}) . Now suppose vertices 1 and 2 are connected by a dashed line in M_{1} . Since M_{2} includes vertices starting from the 2nd, there is no solid line between vertices 1 and 2. Construct (M_{1}^{\prime},M_{2}^{\prime}) from (M_{1},M_{2}) as follows: consider the longest path starting from vertex 1 and consisting of alternating dashed and solid lines. Replace each dashed line with a solid one and each solid line with a dashed one. This yields a new pair (M_{1}^{\prime},M_{2}^{\prime}) , where the first position has a solid line and no dashed line. This pair has the same weight as (M_{1},M_{2}) . Figure 2.2 shows the pair of codes obtained by this operation from those in Figure 2.1 . \textstyle{\circ\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\circ\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\circ\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\circ} \textstyle{\circ} \textstyle{\circ\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\circ} \textstyle{\circ\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\circ} Figure 2.2. Result of applying the involution to the pair of Morse codes The pair (M_{1}^{\prime},M_{2}^{\prime}) will “almost always” correspond to a monomial from the right-hand side. Moreover, this procedure can “almost always” be reversed: from “almost” every (M_{1}^{\prime},M_{2}^{\prime}) , we can uniquely reconstruct (M_{1},M_{2}) , with equal weights. It remains to clarify what does “almost always” mean. We distinguish between the two cases: when n is even and when it is odd. If n is even, the only configuration (M_{1},M_{2}) for which this procedure fails (i.e., no corresponding right-hand monomial exists) is: \textstyle{\circ\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\circ\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\circ\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\circ\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\circ\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\circ} Here, all vertices are connected by alternating dashed and solid lines, with both first and last lines dashed (the number of vertices is even, so the number of lines between them is odd), and the weight of (M_{1},M_{2}) is (-1)^{n-1}=-1 . Thus, the product from the left-hand side of ( 2.2 ) is less by 1 than the product from the right-hand side. If n is odd, each (M_{1},M_{2}) has a unique image (M_{1}^{\prime},M_{2}^{\prime}) , and exactly one right-hand configuration has no preimage: \textstyle{\circ\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\circ\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\circ\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\circ\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\circ} In this case, the product in the right-hand side of ( 2.2 ) is again greater by 1 than the product from the left-hand side. ∎ 2.4. Integer friezes The results of the previous section immediately yield the following theorem. Theorem 2.7 . An element a_{1n} in the (n+1) -th row of a frieze having numbers a_{1},\dots,a_{n} in the second row above it is equal to the continuant V_{n}(a_{1},\dots,a_{n}) . This theorem explains the aforementioned “integrality phenomenon”: all elements of a frieze with an integer second row (a_{1},a_{2},\dots) turn out to be integers, even though their computation would seemingly require division. Corollary 2.8 . A frieze whose second row elements are positive integers is entirely integer-valued. Indeed, a continuant is a polynomial in a_{1},a_{2},\dots with integer coefficients. 2.5. Euler’s identity The theorem from the previous section admits a generalization known as Euler’s identity 7 7 7 Leonhard Euler (1707–1783) was a Swiss, Prussian, and Russian mathematician. He authored more than 800 works across a vast range of fields, including mathematics, mechanics, physics, astronomy, and other sciences. He is considered one of the greatest mathematicians in history. for continuants . Theorem 2.9 . For any m,\ell,n , the following identity holds: V_{m+n}(a_{1},\dots,a_{m+n})V_{\ell}(a_{m+1},\dots,a_{m+l})-V_{m+\ell}(a_{1},\dots,a_{m+\ell})V_{n}(a_{m+1},\dots,a_{m+n})+\\ +V_{m-1}(a_{1},\dots,a_{m-1})V_{n-\ell-1}(a_{m+\ell+2},\dots,a_{m+n})=0. When m=1 and n=\ell-1 , this precisely gives the unimodularity relation for continuants. We will not use Euler’s identity further and present it here without proof. It can be proved using double induction on two of its three parameters (this is left to the reader as an optional exercise). A short and elegant proof of this identity, due to A. Ustinov, can be found in his paper [ 10 ] . In the remaining part of this chapter we discuss the connection between continuants and determinants and explain alternative methods for obtaining the results mentioned above. Readers may skip this part without loss of continuity. 2.6. Determinantal Expression for Continuants Continuants admit another useful expression: an n -th order continuant can be represented as the determinant of a tridiagonal matrix of the same order. Proposition 2.10 . Continuants admit the following determinant expression: (2.3) V_{n}(a_{1},\dots,a_{n})=\begin{vmatrix}a_{1}&1&0&\dots&0&0\\ 1&a_{2}&1&\dots&0&0\\ 0&1&a_{3}&\dots&0&0\\ \vdots&\vdots&\vdots&&\vdots&\vdots\\ 0&0&0&\dots&a_{n-1}&1\\ 0&0&0&\dots&1&a_{n}\\ \end{vmatrix}. Proof. We prove this equality by induction. The base cases for n=0 and n=1 are obvious. Expanding the determinant in the right-hand side of ( 2.3 ) along the last row yields exactly the recurrence relation ( 2.1 ). ∎ This representation of continuants also leads to the unimodularity condition. For this, we need a matrix identity known as the Lewis Carroll identity 8 8 8 Lewis Carroll is a penname of Charles Lutwidge Dodgson (1832–1898), English mathematician, writer and photographer, author of “Alice’s Adventures in Wonderland” and “Through the Looking-Glass”. The identity bearing his name was used in his 1865 work, though it had appeared earlier in works by Desnanot and Jacobi. Pierre Desnanot (1777–1857) was a French high school teacher and inspector. He authored textbooks on arithmetic, as well as works on the application of mathematics to mechanical problems. He headed the Clermont-Ferrand school district. . Let A=(a_{ij}) be an arbitrary n\times n matrix. Denote its determinant by M ; furthermore, let M_{i_{1},\dots,i_{k}}^{j_{1},\dots,j_{k}} denote its (n-k) -th order minor obtained by deleting rows i_{1},\dots,i_{k} and columns j_{1},\dots,j_{k} . The Lewis Carroll identity establishes a relation between M and minors of orders n-1 and n-2 : Theorem 2.11 (The Lewis Carroll identity) . The following equality holds: (2.4) M\cdot M_{1,n}^{1,n}=M_{1}^{1}\cdot M_{n}^{n}-M_{n}^{1}\cdot M_{1}^{n}. We omit the proof here; the reader may devise it themself or look up in the literature. Note the combinatorial proof by D. Zeilberger 9 9 9 Doron Zeilberger (b. 1950) is an Israeli–American mathematician specializing in combinatorics and the theory of hypergeometric series. In 1995, he proved the famous alternating sign matrix conjecture by Mills, Robbins, and Rumsey. He has written a number of papers “in collaboration” with Shalosh B. Ekhad, his computer. [ 11 ] ; it is conceptually similar to the proof of Theorem 2.6 given above. 2.7. Computing continuants Let us compute the determinant M=V_{n}(a_{1},\dots,a_{n}) using the Lewis Carroll identity ( 2.4 ). A remarkable property of continuants is that the minors appearing in this identity are either ones or lower-order continuants: M_{1}^{1}=V_{n-1}(a_{2},\dots,a_{n});\hskip 18.49988ptM_{n}^{n}=V_{n-1}(a_{1},\dots,a_{n-1});\hskip 18.49988ptM_{1,n}^{1,n}=V_{n-2}(a_{2},\dots,a_{n-1}); while M_{1}^{n} and M_{n}^{1} are equal to 1 as the determinants of upper- and lower-triangular matrices with ones on the diagonal, respectively. Thus, the Lewis Carroll identity can be rewritten as follows: V_{n}(a_{1},\dots,a_{n})\cdot V_{n-2}(a_{2},\dots,a_{n-1})=V_{n-1}(a_{1},\dots,a_{n-1})\cdot V_{n-1}(a_{2},\dots,a_{n})-1. In other words, 1=V_{n}(a_{1},\dots,a_{n})\cdot V_{n-2}(a_{2},\dots,a_{n-1})-V_{n-1}(a_{1},\dots,a_{n-1})\cdot V_{n-1}(a_{2},\dots,a_{n})=\\ =\begin{vmatrix}V_{n-1}(a_{1},\dots,a_{n-1})&V_{n-2}(a_{2},\dots,a_{n-1})\\ V_{n}(a_{1},\dots,a_{n})&V_{n-1}(a_{2},\dots,a_{n})\end{vmatrix}. This is exactly the unimodularity condition. Thus we obtain another proof of Theorem 2.6 . 3. Relations between frieze elements 3.1. Relations between the second row and the Diagonal Like in the previous chapter, we start with a frieze of the form: \begin{array}[]{ccccccccccccccccccccc}\dots&1&&1&&1&&1&&1&\dots\\ &\dots&a_{1}&&a_{2}&&a_{3}&&a_{4}&\dots\\ &&\dots&a_{12}&&a_{23}&&a_{34}&\dots\\ &&&\dots&a_{13}&&a_{24}&\dots\\ &&&&\dots&a_{14}&\dots\\ &&&&&\dots&a_{15}&\dots\end{array} We would like to establish relations between the elements of its second row a_{1},a_{2},\dots and the diagonal elements 1,a_{1},a_{12},a_{13},\dots (we will further refer to this diagonal as to the first one). We already know the relation expressing a_{1k} through a_{1},\dots,a_{k} : this is the continuant. However, continuants satisfy the recurrence relation given in Proposition 2.4 . This allows us to find the diagonal elements of the frieze one by one if its second row is known. Theorem 3.1 . The diagonal and top row elements of a frieze satisfy the relation: a_{1,k}=a_{k}a_{1,k-1}-a_{1,k-2}. Remark 3.2 . Sometimes it is said that the frieze diagonal a_{1},a_{12},a_{13},\dots is a solution to the Sturm–Liouville difference equation : V_{k}=a_{k}V_{k-1}-V_{k-2}, where a_{1},a_{2},\dots are coefficients and V_{1},V_{2},\dots are unknowns. Furthermore, the previous theorem can be reformulated in the following way, expressing the second row elements through the diagonal elements. Theorem 3.3 . For k\geq 2 , the following equalities hold: a_{k}=\frac{a_{1,k-2}+a_{1k}}{a_{1,k-1}}. Note that here we never used the fact that our frieze is finite, i.e., that it ends with a row of 1 ’s. So all this remains valid for infinite “friezes” (see Sec. 1.1 ) with an arbitrary second row. 3.2. Symmetries of finite friezes Now suppose our frieze is finite : there exists an n such that for all i , the equalities a_{i,n+i-2}=1 and a_{i,n+i-1}=0 hold. In other words, the (n-1) -th row consists entirely of ones, and the n -th row consists entirely of zeroes. Let us write Theorem 3.1 for the element a_{1n}=0 : 0=a_{1n}=a_{n}a_{1,n-1}-a_{1,n-2}=a_{n}-a_{1,n-2} (recall that a_{1,n-1}=1 since the (n-1) -th row consists entirely of ones), from which we obtain: a_{1,n-2}=a_{n}. But the same relation holds for any diagonal, not just the first one. This gives us a set of equalities: a_{k,n-3+k}=a_{n+k-1}. Thus, the second row of the frieze coincides with the penultimate row, shifted right by n/2 positions. In this case, the frieze has the form: (3.1) \begin{array}[]{ccccccccccccccccccccc}\dots&1&&1&&1&&1&&1&&1&&\dots\\ &\dots&a_{1}&&a_{2}&&a_{3}&&a_{4}&&\dots&&a_{n-1}&&a_{n}&&\dots\\ &&\dots&a_{12}&&\dots&&&&&&\dots\\ &&&\dots&a_{13}&&\dots&&&&\dots\\ &&&&\dots&\dots&&\dots&&\dots\\ &&&&&\dots&a_{n}&&a_{n+1}&&a_{n+2}&&\dots\\ &&&&\dots&1&&1&&1&&\dots\end{array} From this we obtain the following result. Theorem 3.4 . A frieze with n-1 rows possesses a glide symmetry: its k -th row shifted by n/2 positions coincides with the (n-k) -th row. Proof. From the unimodularity condition, it follows that the frieze can be constructed not only from the second row downward but also from the penultimate row upward, with the same result. ∎ Corollary 3.5 . A frieze with n-1 rows is periodic with period n . Proof. Shifting the frieze by n is the same as applying two glide symmetries with shift n/2 . ∎ Definition 3.6 . A frieze consisting of n-1 rows is said to have order n . According to Corollary 3.5 , any frieze of order n is periodic with the period length equal to n ; however, this length is not necessarily minimal (see Remark 1.1 on p. 1.1 ). Exercise 3.7 . What identities on continuants are equivalent to the symmetry of the frieze? 3.3. Infinite extension of finite friezes By definition, a frieze of order n terminates with a row of ones and a row of zeros. That is, for the elements of its (say, first) diagonal, the following equalities hold: a_{1,n-1}=1,\qquad a_{1,n}=0. But what happens if we extend this sequence further? Using the equality from Theorem 3.1 , we can define a_{1,i} for i>n . We see that a_{1,n+1}=a_{n}a_{1,n}-a_{1,n-1}=a_{n}\cdot 0-1=-1. Extending this diagonal further, we get a_{1,n+2}=a_{n+1}a_{1,n+1}-a_{1,n}=-a_{n+1}=-a_{1} (here we used the periodicity of the second row with period n ). We find that the (n+1) -th and (n+2) -th diagonal elements differ from the first and second only by sign! It is easy to see that this pattern continues: a_{1,n+k}=-a_{1,k} for k\leq n . Thus, each frieze diagonal can be extended downward, and the next n elements will differ from the first n by multiplication by -1 . Of course, this holds for any other diagonal as well. Similarly, we can say that for arbitrary k we have a_{i,rn+k}=(-1)^{r}a_{ik}. Thus, we can extend our frieze below the row of zeros. Clearly, this extension will satisfy the unimodularity rule. The possibility to extend friezes downward will be useful in the next section. 3.4. Transition to adjacent diagonals In this section, we will examine how elements of three adjacent frieze diagonals are related. It turns out that knowing two of them allows us to recover the third one through a simple matrix transformation. As before, we consider the frieze: \begin{array}[]{ccccccccccccccccccccc}\dots&1&&1&&1&&1&&1&&\dots\\ &\dots&a_{1}&&a_{2}&&a_{3}&&a_{4}&&\dots\\ &&\dots&a_{12}&&a_{23}&&a_{34}&&\dots\\ &&&\dots&a_{13}&&a_{24}&&a_{35}&&\dots\\ &&&&\dots&a_{14}&&\ddots&&\ddots\\ &&&&&&\ddots&&\ddots&&\ddots\\ &&&&&&\dots&a_{1,n-2}&&a_{2,n-1}&&a_{3,n}&&\dots\\ &&&&&&&\dots&1&&1&&1&&\dots\end{array} To simplify the notation, we formally set a_{kk}:=a_{k} . Theorem 3.8 . For any k , the following equality holds: \begin{pmatrix}a_{1}&-1\\ 1&0\end{pmatrix}\begin{pmatrix}a_{2k}\\ a_{3k}\end{pmatrix}=\begin{pmatrix}a_{1k}\\ a_{2k}\end{pmatrix}. Informally, applying such a matrix shifts the frieze diagonal running from southwest to northeast one position downward. Proof. We prove this equality by induction on k . For the base case, take k=2 : \begin{pmatrix}a_{1}&-1\\ 1&0\end{pmatrix}\begin{pmatrix}a_{2}\\ 1\end{pmatrix}=\begin{pmatrix}a_{1}a_{2}-1\\ a_{2}\end{pmatrix}=\begin{pmatrix}a_{12}\\ a_{2}\end{pmatrix}. Note that we could also take k=1 as the base case, assuming the frieze is extended upward with zeros; this would give the correct equality \begin{pmatrix}a_{1}&-1\\ 1&0\end{pmatrix}\begin{pmatrix}1\\ 0\end{pmatrix}=\begin{pmatrix}a_{1}\\ 1\end{pmatrix} . To prove the inductive step, write the recurrence relations for the diagonal elements: \displaystyle a_{1,k+1} \displaystyle= \displaystyle a_{k+1}a_{1,k}-a_{1,k-1}, \displaystyle a_{2,k+1} \displaystyle= \displaystyle a_{k+1}a_{2,k}-a_{2,k-1}, \displaystyle a_{3,k+1} \displaystyle= \displaystyle a_{k+1}a_{3,k}-a_{3,k-1}. Note that all these equalities contain the same coefficient a_{k+1} . Furthermore, the induction hypothesis states that \displaystyle a_{1,k} \displaystyle= \displaystyle a_{1}a_{2,k}-a_{3,k}, \displaystyle a_{1,k-1} \displaystyle= \displaystyle a_{1}a_{2,k-1}-a_{3,k-1}. From this it follows that a_{1,k+1}=a_{1}a_{2,k+1}-a_{3,k+1}, as required. ∎ Exercise 3.9 . Derive these equalities from Proposition 2.10 by expanding the continuant determinant along the first row. Here we only used recurrence relations for diagonal elements, so these matrix equalities will also hold for elements of the frieze extended downward according to the rule from the previous section. From this we obtain a corollary that will be useful later when studying the connection between friezes and continued fractions. Let I=\begin{pmatrix}1&0\\ 0&1\end{pmatrix} be the 2\times 2 identity matrix. Corollary 3.10 . Let a_{1},\dots,a_{n} be the second row of a frieze of order n . Then the following matrix equality holds: \begin{pmatrix}a_{1}&-1\\ 1&0\end{pmatrix}\begin{pmatrix}a_{2}&-1\\ 1&0\end{pmatrix}\dots\begin{pmatrix}a_{n}&-1\\ 1&0\end{pmatrix}=-I. Proof. This follows from Theorem 3.8 and the periodicity of the frieze. Indeed, shifting the frieze diagonal by n positions yields the same diagonal but with a minus sign. Hence the composition of matrices on the left side of the equality acts as multiplication by minus identity. ∎ 4. Integer friezes and triangulations 4.1. The quiddity of an integer frieze In this chapter, we will describe all friezes consisting only of integer elements. We will call the second row (a_{1},\dots,a_{n}) of an order n frieze its quiddity . Obviously, it cannot contain two consecutive 1’s: this would contradict unimodularity. However, it turns out that at least one 1 must necessarily appear in this row. Proposition 4.1 . The second row of an integer frieze must contain at least one entry equal to 1. Proof. Suppose this is not the case, and there exists a frieze with all elements in the second row differ from 1: a_{k}\geq 2 . Denote the elements of its first diagonal by v_{k}=a_{1k} . Then for them we have the inequality v_{k}=a_{k}v_{k-1}-v_{k-2}\geq 2v_{k-1}-v_{k-2}, which implies that v_{k}-v_{k-1}\geq v_{k-1}-v_{k-2}. But this holds for all k . Therefore, v_{k}-v_{k-1}\geq v_{k-1}-v_{k-2}\geq\dots\geq v_{2}-v_{1}=a_{2}-1\geq 1, meaning that the sequence v_{k} is strictly increasing. This contradicts the assumption that at some point, due to the finite number of rows in the frieze, it must take the values 1 and 0. This statement can also be proved geometrically. Suppose we found a frieze with all a_{k}\geq 2 . Consider the cone x\geq y\geq 0 generated by vectors \begin{pmatrix}1\\ 0\end{pmatrix} and \begin{pmatrix}1\\ 1\end{pmatrix} . A matrix of the form \begin{pmatrix}a_{k}&-1\\ 1&0\end{pmatrix} transforms these vectors into \begin{pmatrix}a_{k}\\ 1\end{pmatrix} and \begin{pmatrix}a_{k}-1\\ 1\end{pmatrix} respectively. For a_{k}\geq 2 , both these vectors lie in the interior of the cone x\geq y\geq 0 . Therefore, the composition of such matrices \begin{pmatrix}a_{1}&-1\\ 1&0\end{pmatrix}\dots\begin{pmatrix}a_{n}&-1\\ 1&0\end{pmatrix} also maps this cone into its proper subset. But this contradicts Corollary 3.10 , which states that this composition equals -I . ∎ The following lemma allows us to construct a new frieze of order n+1 from a given integer frieze of order n . Lemma 4.2 (The van Gogh lemma) . Let (a_{1},\dots,a_{n}) be the quiddity of an integer order n frieze, and let 1\leq k\leq n . Then: (1) The tuple (b_{1},\dots,b_{n+1})=(a_{1},\dots,a_{k-1}+1,1,a_{k}+1,a_{k+1},\dots,a_{n}) is the quiddity of an integer order n+1 frieze; (2) If 1,v_{1},v_{2},\dots,v_{n-2} is the first diagonal of the original frieze starting with element v_{1}=a_{1} , then the corresponding diagonal of the new frieze has the form 1,v_{1},v_{2},\dots,v_{k-1},v_{k-1}+v_{k},v_{k},\dots,v_{n-2}. Proof. We begin with part (2). Let us write down the first diagonal of the new frieze: denote it by 1,w_{1},\dots,w_{n-1} . Clearly, for i\leq k-2 , the diagonals of these two friezes coincide: w_{i}=v_{i} . At the (k-1) -th position of the new frieze we will have w_{k-1}=(a_{k-1}+1)v_{k-2}-v_{k-3}=v_{k-1}+v_{k-2}. Next, w_{k}=w_{k-1}-w_{k-2}=v_{k-1}+v_{k-2}-v_{k-2}=v_{k-1}. The next diagonal element will be w_{k+1}=(a_{k}+1)w_{k}-w_{k-1}=(a_{k}+1)v_{k-1}-v_{k-1}-v_{k-2}=a_{k}v_{k-1}-v_{k-2}=v_{k}. For all j>k+1 , the equality w_{j}=v_{j-1} holds. In particular, the (n-2) -th and (n-1) -th terms of this sequence are equal to 1 and 0 respectively, meaning the frieze terminates, and the diagonal contains n positive elements. The same argument applies to any other diagonal. Thus, such an insertion yields an integer frieze of order one greater. Part (1) is also proved. ∎ Remark 4.3 . This construction is obviously reversible: if a sequence (\dots,b_{k-1},1,b_{k+1},\dots) is the quiddity of an integer frieze, then (\dots,b_{k-1}-1,b_{k+1}-1,\dots) will be the quiddity of a frieze of order one less (note that due to the absence of consecutive 1’s, both numbers b_{k-1}-1 and b_{k+1}-1 are positive). 4.2. Friezes and triangulations Consider a convex n -gon with numbered vertices. Its triangulation is its partition into triangles using diagonals that do not intersect except at vertices. Remark 4.4 . The number of triangulations of an n -gon is called the (n-2) -th Catalan number (this is one of their numerous equivalent definitions). For them, the formula C(n)=\frac{1}{n-1}\binom{2n-4}{n-2} holds (see, for instance, [ 9 ] ). Consider an arbitrary triangulation of an n -gon. We can associate to it a tuple of numbers (c_{1},\dots,c_{n}) , where c_{i} is the number of triangles incident to the i -th vertex. We will call such a tuple the quiddity of the triangulation . The triangulation is uniquely determined by its quiddity (why?). Theorem 4.5 (J. Conway, H. S. M. Coxeter) . The tuple (c_{1},\dots,c_{n}) constructed from a triangulation of an n -gon is the quiddity of an integer frieze of order n ; this mapping establishes a bijection between triangulations of an n -gon and integer friezes of order n . Proof. We will prove this theorem by induction on n . The base case n=3 is obvious: there is only one triangulation of a triangle and only one order 3 frieze with quiddity (1,1,1) . (Those not convinced by this argument may start with n=4 ). Consider a triangulation of an n -gon. Choose a vertex belonging to only one triangle. Such a vertex exists by the pigeonhole principle: if n exterior sides belong to n-2 triangles of the triangulation, then there must be at least one triangle (in fact, at least two) to which two exterior sides belong. We will call such a triangle an “ear”. Let the vertex belonging to only one triangle have number k , and let vertices k-1 and k+1 belong to b_{k-1} and b_{k+1} triangles respectively. Thus, the quiddity of this triangulation has the form (\dots,b_{k-1},1,b_{k+1},\dots) . Remove the triangle adjacent to the k -th vertex from this triangulation to obtain a triangulation of an (n-1) -gon with quiddity (\dots,b_{k-1}-1,b_{k+1}-1,\dots) . By the induction hypothesis, this triangulation determines a frieze with the same quiddity. But by Lemma 4.2 , then the tuple (\dots,b_{k-1},1,b_{k+1},\dots) also determines an integer frieze. The bijectivity of this correspondence follows from Remark 4.3 : from the quiddity of each frieze of order n , we can remove a 1, reducing the problem to a frieze of order one less. ∎ 4.3. Reconstructing friezes from triangulations Our next goal is to describe the combinatorial meaning of frieze elements obtained from a given triangulation. The Conway–Coxeter theorem states that each element of the frieze’s second row is the number of triangles incident to the corresponding vertex of the triangulation. But how can we reconstruct the remaining frieze elements? Consider an integer frieze, written with the notation of ( 3.1 ) on p. 3.1 : its second row is (a_{1},a_{2},\dots,a_{n}) , and the elements of the diagonal starting at a_{1} are denoted by v_{0}=1,v_{1},v_{2},\dots,v_{n-2} , i.e., v_{1}=a_{1} . It is also convenient to set v_{-1}=0 . Consider a triangulation of an n -gon whose vertices are numbered from 0 to n-1 , with quiddity (a_{1},\dots,a_{n}) . We can reconstruct (v_{0},v_{1},v_{2},\dots) using the following algorithm: • write the numbers 0 and 1 in vertices 0 and 1 respectively; • then place numerical labels in all other vertices of the polygon according to the following rule: for each triangle where two vertices already have numbers a and b , write a+b in its third vertex. Repeat this procedure until all vertices are filled. Exercise 4.6 . Show that all vertices connected to vertex 0 by a diagonal or side will have 1 written in them. Proposition 4.7 . The label obtained by this algorithm in the i -th vertex is equal to the diagonal element v_{i-1} of the frieze. Proof. To this triangulation of the n -gon we can associate its dual graph with n-2 vertices: its vertices correspond to triangles in the triangulation, with two vertices connected by an edge if the corresponding triangles share a side. Such a graph is a tree, with all vertex degrees at most three. The leaves (degree 1 vertices) of this tree correspond to the “ears” of the triangulation. Figure 4.1. A triangulation and its corresponding tree Next, writing numbers in triangle vertices according to our algorithm can be viewed as visiting the vertices of the corresponding tree: in the first step of the algorithm, we take the triangle containing vertices 0 and 1 , and write a number in its third vertex (for the first step, this number will be 1 ). Having done this, we mark the tree vertex corresponding to this triangle as visited. At each subsequent step, we consider some vertex adjacent to already visited ones; it corresponds to a triangle where two vertices already have some numbers. Writing their sum in the triangle’s third vertex, we mark the tree vertex corresponding to this triangle as visited. We prove our proposition by induction on n . The base case n=3 is obvious: we obtain a triangle with 0 , 1 , and 1 written in its vertices. It corresponds to the unique order 3 frieze. Inductive step: suppose our proposition is proved for all possible triangulations of an n -gon, and we want to prove it for an (n+1) -gon. Consider the last step of the algorithm; in its course, we must visit some pendant vertex of the triangulation tree, i.e., add an “ear” to the triangulation of the n -gon. Let this n -gon have quiddity (a_{1},\dots,a_{n}) , and the “ear” at the last step is attached to side (k-1,k) . By the induction hypothesis, the resulting set of labels (v_{0},\dots,v_{n-1}) in the vertices lie on the diagonal of the frieze with quiddity (a_{1},\dots,a_{n}) . Next, at the last step, a vertex with label v_{k-1}+v_{k} is be added between vertices k-1 and k . The triangulation of the (n+1) -gon then has quiddity (\dots,a_{k-1}+1,1,a_{k}+1,\dots) , which agrees with the result of Lemma 4.2 about frieze elements. The proposition is proved. ∎ Exercise 4.8 . Consider a triangulation of an n -gon where all diagonals form a zigzag, as in Fig. 4.2 (in other words, all elements of this triangulation’s quiddity are at most 3). Prove that all elements of the corresponding frieze will be Fibonacci numbers. Figure 4.2. A zigzag triangulation Exercise 4.9 . Consider a triangulation containing a vertex where at least 4 triangles meet. Prove that the corresponding frieze contains the number 4. 4.4. Admissible paths Another method for computing frieze elements, presented in [ 1 ] , is based on counting so-called admissible paths. Definition 4.10 . An admissible path from vertex i-1 to vertex j+1 is an ordered sequence of distinct triangles \tau_{i},\dots,\tau_{j} , where triangle \tau_{\ell} is incident to vertex \ell . Proposition 4.11 . The frieze element a_{ij} equals the number of admissible paths from i-1 to j+1 . We will not prove this proposition; readers may try to reconstruct the proof themselves or read it in [ 1 ] . Remark 4.12 . Note that by definition, a path from vertex (i-1) to vertex (i+1) consists of one triangle passing through vertex i . Then the number of admissible paths between these vertices is simply a_{i} . Furthermore, the path from vertex (i-1) to vertex i is unique: it consists of zero triangles, so all elements of the frieze’s first row equal 1 . Example 4.13 . Consider the following triangulation of a heptagon. Let \alpha,\beta,\gamma,\delta,\varepsilon be the triangles in it. List all admissible paths (\tau_{1},\tau_{2}) between vertices 7 and 3 . These paths are as follows: (\varepsilon,\beta),\quad(\varepsilon,\alpha),\quad(\delta,\beta),\quad(\delta,\alpha),\quad(\gamma,\beta),\quad(\gamma,\alpha),\quad(\beta,\alpha). This gives a_{12}=7 . (Note that in this example a_{1}=4 , a_{2}=2 ). Exercise 4.14 (non-trivial) . a) Show that an admissible path as a sequence is uniquely determined by its set of triangles. b) Verify that the complement to a path from vertex i to vertex j determines a path from vertex j to vertex i . For instance, in the above example if (\tau_{1},\tau_{2}) is an admissible path from 7 to 3 , then \{\alpha,\beta,\gamma,\delta,\epsilon\}\setminus\{\tau_{1},\tau_{2}\} determines an admissible path from 3 to 7 . Derive from this statement another proof of the glide symmetry of friezes. Remark 4.15 . Most results from this section can be found in two papers by J. Conway and H. S. M. Coxeter [ 2 ] , [ 3 ] . These papers, published in two consecutive issues of the educational journal The Mathematical Gazette , are structured as problem sets: the first article presents a series of statements about friezes as a sequence of about thirty problems, while the second provides their solutions or sufficiently detailed hints. 5. Continued fractions In the next chapters, we will see how continuants, polygon triangulations, and friezes arise in connection with the classical problem of expanding a number into a continued fraction. 5.1. Convergents Let p/q>1 be an irreducible fraction. It can be expanded into a continued fraction as follows: take the integer part of p/q by dividing p by q with remainder. Let a_{1} be the quotient and r the remainder; then \frac{p}{q}=a_{1}+\frac{r}{q}. The fraction q/r , reciprocal to r/q , will now be greater than 1, so we can again extract its integer part, invert the fractional part, and so on. At each step, the denominators of the fractions decrease, so the process will eventually terminate (at some point the next fraction will be an integer). Thus we obtain the representation \frac{p}{q}=a_{1}+\cfrac{1}{a_{2}+\cfrac{1}{a_{3}+\cfrac{1}{\dots+\cfrac{1}{a_{n}}}}}. For brevity, we will denote the right-hand side by [a_{1},a_{2},a_{3}\dots,a_{n}] . This representation is almost unique; the only ambiguity is that the last number can be represented either as a_{n} or as (a_{n}-1)+\dfrac{1}{1} . We will get rid of this ambiguity by requiring that the expansion of a rational number into a continued fraction must always have an even number of components. Example 5.1 . The expansion of 7/5 into a continued fraction is: \frac{7}{5}=1+\cfrac{1}{2+\cfrac{1}{1+\cfrac{1}{1}}}=[1,2,1,1]. Suppose we are given the continued fraction expansion of a number: p/q=[a_{1},\dots,a_{n}] . We can consider not the entire expansion, but only the part formed by its first i terms: p_{i}/q_{i}=[a_{1},\dots,a_{i}] . The result is called the i -th convergent to p/q . For example, the convergents to 7/5 from the previous example are 1 , 3/2 , and 4/3 . By the way, note that the procedure of expanding a number into a continued fraction is exactly the Euclidean algorithm applied to the numerator and denominator of the original fraction. 5.2. Matrices of continued fractions Consider a rational number written as an irreducible fraction p/q>1 . When we expand it into a continued fraction, at each step we extract its integer part (denoted by a_{1} ) and invert the fractional part, thereby obtaining a new irreducible fraction p^{\prime}/q^{\prime} . Let us see how these numbers are related: \frac{p}{q}=a_{1}+\frac{1}{p^{\prime}/q^{\prime}};\qquad\frac{p}{q}=\frac{a_{1}p^{\prime}+q^{\prime}}{p_{1}}. From this we can write the equalities \displaystyle p \displaystyle= \displaystyle a_{1}p^{\prime}+q^{\prime}; \displaystyle q \displaystyle= \displaystyle p^{\prime}. Note that here we used the irreducibility of the fractions p/q and p^{\prime}/q^{\prime} . Thus, the numbers p and q are obtained from p^{\prime} and q^{\prime} by a linear transformation given by the following matrix: \begin{pmatrix}p\\ q\end{pmatrix}=\begin{pmatrix}a_{1}&1\\ 1&0\end{pmatrix}\begin{pmatrix}p^{\prime}\\ q^{\prime}\end{pmatrix}. We can repeat the same procedure by extracting the integer part a_{2} from the fraction p^{\prime}/q^{\prime} ; we obtain a new fraction p^{\prime\prime}/q^{\prime\prime} , which gives us the equality \begin{pmatrix}p\\ q\end{pmatrix}=\begin{pmatrix}a_{1}&1\\ 1&0\end{pmatrix}\begin{pmatrix}a_{2}&1\\ 1&0\end{pmatrix}\begin{pmatrix}p^{\prime\prime}\\ q^{\prime\prime}\end{pmatrix}. This process terminates when the next fraction p^{(n-1)}/q^{(n-1)} becomes an integer a_{n} , which is equivalent to p^{(n-1)}=a_{n} and q^{(n-1)}=1 . We obtain the equality \begin{pmatrix}p\\ q\end{pmatrix}=\begin{pmatrix}a_{1}&1\\ 1&0\end{pmatrix}\dots\begin{pmatrix}a_{n-1}&1\\ 1&0\end{pmatrix}\begin{pmatrix}a_{n}\\ 1\end{pmatrix}. We can also “extract the fractional part” from the integer a_{n} , obtaining the “fraction” p^{(n)}/q^{(n)}=1/0 . Of course, the rational number 1/0 does not exist, but at the matrix level everything works fine: \begin{pmatrix}p\\ q\end{pmatrix}=\begin{pmatrix}a_{1}&1\\ 1&0\end{pmatrix}\dots\begin{pmatrix}a_{n-1}&1\\ 1&0\end{pmatrix}\begin{pmatrix}a_{n}&1\\ 1&0\end{pmatrix}\begin{pmatrix}1\\ 0\end{pmatrix}. What happens if we apply the same product of matrices not to the vector \begin{pmatrix}1\\ 0\end{pmatrix} , but to the other basis vector \begin{pmatrix}0\\ 1\end{pmatrix} ? We obtain the equality \begin{pmatrix}r\\ s\end{pmatrix}=\begin{pmatrix}a_{1}&1\\ 1&0\end{pmatrix}\dots\begin{pmatrix}a_{n-1}&1\\ 1&0\end{pmatrix}\begin{pmatrix}a_{n}&1\\ 1&0\end{pmatrix}\begin{pmatrix}0\\ 1\end{pmatrix}=\begin{pmatrix}a_{1}&1\\ 1&0\end{pmatrix}\dots\begin{pmatrix}a_{n-1}&1\\ 1&0\end{pmatrix}\begin{pmatrix}1\\ 0\end{pmatrix}. We have represented the vector with components r and s as a product of matrices of the form \begin{pmatrix}a_{i}&1\\ 1&0\end{pmatrix} , but for the tuple (a_{1},\dots,a_{n-1}) rather than (a_{1},\dots,a_{n}) . It follows that r/s equals the last convergent p_{n-1}/q_{n-1} to p/q : p/q=[a_{1},\dots,a_{n}];\qquad r/s=[a_{1},\dots,a_{n-1}]. Definition 5.2 . The continued fraction matrix for the number p/q=[a_{1},\dots,a_{n}] , p/q>1 , is the matrix M^{+}(a_{1},\dots,a_{n})=\begin{pmatrix}a_{1}&1\\ 1&0\end{pmatrix}\dots\begin{pmatrix}a_{n}&1\\ 1&0\end{pmatrix}. We obtain the following proposition. Proposition 5.3 . Let M^{+}(a_{1},\dots,a_{2m}) be the continued fraction matrix for p/q , and let r/s=p_{2m-1}/q_{2m-1} be the last convergent to p/q . Then M^{+}(a_{1},\dots,a_{2m})=\begin{pmatrix}p&r\\ q&s\end{pmatrix}. The same can be said for any pair of adjacent convergents, not necessarily the last. Corollary 5.4 . Let p_{i-1}/q_{i-1} and p_{i}/q_{i} be the (i-1) -th and i -th convergents to p/q=[a_{1},\dots,a_{n}] , respectively. Then (5.1) \begin{pmatrix}p_{i}&p_{i-1}\\ q_{i}&q_{i-1}\end{pmatrix}=\begin{pmatrix}a_{1}&1\\ 1&0\end{pmatrix}\dots\begin{pmatrix}a_{i}&1\\ 1&0\end{pmatrix}. From this statement, the following properties of convergents immediately follow. Proposition 5.5 . The numerators and denominators of the convergents p_{i}/q_{i}=[a_{1},\dots,a_{i}] to p/q=[a_{1},\dots,a_{n}] satisfy the following equalities: (1) p_{i}q_{i-1}-p_{i-1}q_{i}=(-1)^{i} ; (2) p_{i} and q_{i} are coprime; (3) For p_{i} and q_{i} , the recurrence relations p_{k}=a_{i}p_{i-1}+p_{i-2} and q_{i}=a_{i}q_{i-1}+q_{i-2} hold, with initial conditions p_{0}=1 , p_{1}=a_{1} , q_{0}=0 , q_{1}=1 ; (4) The sequences of numerators and denominators of the convergents are increasing: p_{i-1}1 , is the matrix M(c_{1},\dots,c_{k})=\begin{pmatrix}c_{1}&-1\\ 1&0\end{pmatrix}\dots\begin{pmatrix}c_{k}&-1\\ 1&0\end{pmatrix}. Remark 5.11 . One of the advantages of working with matrices is that the matrices M(c_{1},\dots,c_{k}) turn out to be more “universal” than continued fractions: they are defined for any sequence of coefficients, whereas for continued fractions this is not the case, since some denominators may become zero. As an example, consider the following “continued fraction”: [[3,1,2,1]]=3-\cfrac{1}{1-\cfrac{1}{2-\cfrac{1}{1}}}. It does not correspond to any rational number, while the matrix M(3,1,2,1) is well-defined (compute it!). Proposition 5.12 . Let M(c_{1},\dots,c_{k}) be the negative continued fraction matrix for p/q , and let \tilde{r}/\tilde{s}=\tilde{p}_{k-1}/\tilde{q}_{k-1} be the last negative convergent to p/q . Then M(c_{1},\dots,c_{k})=\begin{pmatrix}p&-\tilde{r}\\ q&-\tilde{s}\end{pmatrix}. From this, the expression for the matrices of convergents immediately follows. Corollary 5.13 . Let \tilde{p}_{i-1}/\tilde{q}_{i-1} and \tilde{p}_{i}/\tilde{q}_{i} be the (i-1) -th and i -th negative convergents to p/q=[[c_{1},\dots,c_{k}]] , respectively. Then (5.2) \begin{pmatrix}\tilde{p}_{i}&\tilde{p}_{i-1}\\ \tilde{q}_{i}&\tilde{q}_{i-1}\end{pmatrix}=\begin{pmatrix}c_{1}&-1\\ 1&0\end{pmatrix}\dots\begin{pmatrix}c_{i}&-1\\ 1&0\end{pmatrix}. Thus, for negative convergents, there is an analog of Proposition 5.5 . Proposition 5.14 . The numerators and denominators of the negative convergents \tilde{p}_{i}/\tilde{q}_{i}=[[c_{1},\dots,c_{i}]] to p/q=[[c_{1},\dots,c_{k}]] satisfy the following equalities: (1) \tilde{p}_{i}\tilde{q}_{i-1}-\tilde{p}_{i-1}\tilde{q}_{i}=1 ; (2) \tilde{p}_{i} and \tilde{q}_{i} are coprime; (3) For \tilde{p}_{i} and \tilde{q}_{i} , the recurrence relations \tilde{p}_{i}=c_{i}\tilde{p}_{i-1}-\tilde{p}_{i-2} and \tilde{q}_{i}=c_{i}\tilde{q}_{i-1}-\tilde{q}_{i-2} hold, with initial conditions \tilde{p}_{0}=1 , \tilde{p}_{1}=c_{1} , \tilde{q}_{0}=0 , \tilde{q}_{1}=1 ; (4) The sequences of numerators and denominators of the negative convergents are increasing: \tilde{p}_{i-1}<\tilde{p}_{i} and \tilde{q}_{i-1}<\tilde{q}_{i} for any i . Proof. These statements are proved similarly to the positive case. Moreover, the situation here is even simpler: matrices of the form \begin{pmatrix}c&-1\\ 1&0\end{pmatrix} always have determinant 1. The only slight difference is in the proof of part (4). This statement will again follow from the recurrence relation (3). We prove it by induction. The base case is obvious. Induction hypothesis: suppose we know that \tilde{p}_{i-1}>\tilde{p}_{i-2} . Write the expression for \tilde{p}_{i} and use the inequality c_{i}\geq 2 . Then we have \tilde{p}_{i}=c_{i}\tilde{p}_{i-1}-\tilde{p}_{i-2}\geq 2\tilde{p}_{i-1}-\tilde{p}_{i-2}=\tilde{p}_{i-1}+(\tilde{p}_{i-1}-\tilde{p}_{i-2})\geq\tilde{p}_{i-1}, as required. Similarly for \tilde{q}_{i} . ∎ Here we see the connection between continued fraction expansions and friezes: the numerators and denominators of convergents transform according to the same recurrence rules as the elements of friezes. For example, they are obtained as ratios of continuants. Proposition 5.15 . Let p/q=[[c_{1},\dots,c_{k}]] be the expansion of a rational number into a negative continued fraction. Then the i -th convergent \tilde{p}_{i}/\tilde{q}_{i}=[[c_{1},\dots,c_{i}]] to p/q equals the ratio of continuants \frac{\tilde{p}_{i}}{\tilde{q}_{i}}=\frac{V_{i}(c_{1},\dots,c_{i})}{V_{i-1}(c_{1},\dots,c_{i-1})}, and the fraction in the right-hand side is irreducible. This is proved in exactly the same way as for positive continued fractions. 5.5. Relation between positive and negative continued fraction expansion matrices We have described two ways to expand a rational number p/q into a continued fraction: the positive p/q=[a_{1},\dots,a_{2m}] and the negative p/q=[[c_{1},\dots,c_{k}]] . For each of these expansions, we constructed a matrix: M^{+}=M^{+}(a_{1},\dots,a_{2m}) and M=M(c_{1},\dots,c_{k}) , respectively. Example 5.16 . For p/q=7/5 , we obtain: M^{+}(1,2,1,1)=\begin{pmatrix}7&4\\ 5&3\end{pmatrix},\qquad M(2,2,3)=\begin{pmatrix}7&-3\\ 5&-2\end{pmatrix}. A natural question arises: how are these matrices related? The connection turns out to be very simple: their first columns are identical and equal to the difference between the second columns of M^{+} and M . In the matrix language, this is formulated as follows. Proposition 5.17 . Let M^{+} and M be the positive and negative continued fraction matrices for p/q , respectively. Then M^{+}=M\cdot\begin{pmatrix}1&1\\ 0&1\end{pmatrix}. Proof. By Proposition 5.5 , the matrix M^{+} equals \begin{pmatrix}p&r\\ q&s\end{pmatrix} , where r/s is the last positive convergent to p/q . Similarly, Proposition 5.14 states that M=\begin{pmatrix}p&-\tilde{r}\\ q&-\tilde{s}\end{pmatrix} , where \tilde{r}/\tilde{s} is the last negative convergent. Thus, the first columns of M^{+} and M are equal, and the required equality is equivalent to the statement that r+\tilde{r}=p and s+\tilde{s}=q . Let us prove these equalities. We use the unimodularity property for convergents. We know that \tilde{r}q-\tilde{s}p=1. On the other hand, rq-sp=-1. The minus sign arises because the index of the last convergent is odd: by our definition, the number of components in the expansion of a number into a positive continued fraction is even. Thus, (r+\tilde{r})q-(s+\tilde{s})p=0. But from the inequalities on the numerators and denominators of convergents, we know that r

1 have positive and negative continued fraction expansions [a_{1},\dots,a_{2m}] and [[c_{1},\dots,c_{k}]] respectively. Then (c_{1},\dots,c_{k})=(a_{1}+1,\underbrace{2,\dots,2}_{a_{2}-1},a_{3}+2,\underbrace{2,\dots,2}_{a_{4}-1},\dots,a_{2m-1}+2,\underbrace{2,\dots,2}_{a_{2m}-1}). We will prove this theorem in two ways. The first method, covered in this chapter, uses matrix computations. The second, more geometric approach is discussed in the next chapter. It is related to the action of the modular group on the hyperbolic plane. 6.2. The group \mathop{\mathrm{SL}}_{2}({\mathbb{Z}}) and its generators Before proceeding with the first proof, we need to introduce some notation. By \mathop{\mathrm{SL}}_{2}({\mathbb{Z}}) we will denote the group of 2\times 2 integer matrices with determinant 1. We have seen that continued fraction matrices M(c_{1},\dots,c_{k}) and M^{+}(a_{1},\dots,a_{2m}) belong to this group. Let R , L , and S denote the following elements of \mathop{\mathrm{SL}}_{2}({\mathbb{Z}}) : R=\begin{pmatrix}1&1\\ 0&1\end{pmatrix},\qquad L=\begin{pmatrix}1&0\\ 1&1\end{pmatrix},\qquad S=\begin{pmatrix}0&-1\\ 1&0\end{pmatrix}. It can be shown (try this yourself or read in Chapter VII of J.-P. Serre’s “A Course in Arithmetic” [ 8 ] ) that these three matrices generate \mathop{\mathrm{SL}}_{2}({\mathbb{Z}}) . In fact, any two of them suffice: each of these three matrices can be expressed in terms of the other two. Exercise 6.2 . Show that L=S^{-1}R^{-1}S . Find expressions for R in terms of S and L , and for S in terms of R and L . The element S has order 4 (i.e., S^{4}=I ), while R and L have infinite order. Indeed, their powers can be computed explicitly: R^{a}=\begin{pmatrix}1&a\\ 0&1\end{pmatrix} and L^{a}=\begin{pmatrix}1&0\\ a&1\end{pmatrix} for any a\in{\mathbb{Z}} . Continued fraction matrices can be expressed through these generators. Proposition 6.3 . The matrices M(c_{1},\dots,c_{k}) and M^{+}(a_{1},\dots,a_{2m}) admit the following decompositions: (6.1) M^{+}(a_{1},\dots,a_{2m})=R^{a_{1}}L^{a_{2}}R^{a_{3}}L^{a_{4}}\dots R^{a_{2m-1}}L^{a_{2m}} and (6.2) M(c_{1},\dots,c_{k})=R^{c_{1}}SR^{c_{2}}S\dots R^{c_{k}}S. Proof. It is easy to see that \begin{pmatrix}a_{i}&1\\ 1&0\end{pmatrix}=R^{a_{i}}\begin{pmatrix}0&1\\ 1&0\end{pmatrix}\quad\text{and}\quad\begin{pmatrix}a_{i+1}&1\\ 1&0\end{pmatrix}=\begin{pmatrix}0&1\\ 1&0\end{pmatrix}L^{a_{i+1}}. Therefore, \begin{pmatrix}a_{i}&1\\ 1&0\end{pmatrix}\begin{pmatrix}a_{i+1}&1\\ 1&0\end{pmatrix}=R^{a_{i}}L^{a_{i+1}}, which yields formula ( 6.1 ). Formula ( 6.2 ) is even simpler, it follows from the equality \begin{pmatrix}c_{i}&-1\\ 1&0\end{pmatrix}=R^{c_{i}}S. ∎ This leads to the following proposition. Proposition 6.4 . The following equality holds: (6.3) M^{+}(a_{1},\dots,a_{2m})=-M(a_{1}+1,\underbrace{2,\dots,2}_{a_{2}-1},a_{3}+2,\underbrace{2,\dots,2}_{a_{4}-1},\dots,a_{2m-1}+2,\underbrace{2,\dots,2}_{a_{2m}},1,1). Note that if we had already proved Theorem 6.1 , equality ( 6.3 ) could be derived from Proposition 5.17 , which states that M^{+}=MR . However, we will proceed differently: first prove ( 6.3 ), then derive Theorem 6.1 from it. We will need the following lemma. Lemma 6.5 . The equalities R^{a}=-M(a+1,1,1) and L^{a}=-M(1,\underbrace{2,\dots,2}_{a},1,1) hold. Proof. The first equality is easy to verify directly. For the second equality, first note that M(1,1,1)=-I , i.e., \begin{pmatrix}1&-1\\ 1&0\end{pmatrix}^{-1}=-\begin{pmatrix}1&-1\\ 1&0\end{pmatrix}^{2} . Next, it is easy to verify directly that L=\begin{pmatrix}1&-1\\ 1&0\end{pmatrix}\begin{pmatrix}2&-1\\ 1&0\end{pmatrix}\begin{pmatrix}1&-1\\ 1&0\end{pmatrix}^{-1} . Thus, L^{a} is obtained from M(2)^{a}=M(2,\dots,2) by conjugation by the same matrix, as required. ∎ Proof of Proposition 6.4 . Since M(1,1,1)=-I , Lemma 6.5 implies that R^{a_{i}}L^{a_{i+1}}=-M(a_{i}+1,\underbrace{2,\dots,2}_{a_{i+1}},1,1). Thus, the proposition follows from relation ( 6.1 ) and the simple equality M(2,1,1,a+1)=-M(a+2) (we leave its verification as an exercise). The proposition is proved. ∎ Finally, note that the last three coefficients in ( 6.3 ) are (2,1,1) , so they can be eliminated using the relation M(2,1,1)=-R . Thus we obtain: (6.4) M^{+}(a_{1},\dots,a_{2m})=M(a_{1}+1,\underbrace{2,\dots,2}_{a_{2}-1},a_{3}+2,\underbrace{2,\dots,2}_{a_{4}-1},\dots,a_{2m-1}+2,\underbrace{2,\dots,2}_{a_{2m}-1})R. This equality shows that the first columns of matrices M^{+}(a_{1},\dots,a_{2m}) in the left-hand side and M(a_{1}+1,\dots) in the right-hand side are equal. Therefore, they correspond to expansions of the same number. This proves Theorem 6.1 . 6.3. Continued fractions and triangulations At first glance the connection between coefficients of positive and negative continued fraction expansions described in Theorem 6.1 appears complex. However, it has a natural interpretation in terms of polygon triangulations. In this section, we present the construction itself, and in the next chapter, we describe its relation to friezes and the matrices from \mathop{\mathrm{SL}}_{2}({\mathbb{Z}}) encountered earlier. Start with an arbitrary sequence of positive integers (a_{1},\dots,a_{2m}) . Consider two horizontal parallel lines. Draw a triangulation of a polygon whose vertices lie on these lines, with two types of triangles: those pointing upward (with two vertices on the lower line and one on the upper) and pointing downward (with two vertices above and one below). Begin with a segment connecting the lines; let its upper endpoint be the first vertex of our polygon and the lower endpoint the last one. Attach a_{1} upward-pointing triangles sharing a common vertex to the right of this segment. Then attach a_{2} downward-pointing triangles to their right, with their shared vertex coinciding with the right vertex of the last triangle from the previous step. Continue adding a_{3} upward, a_{4} downward, and so on. Since the total number of such groups is 2m , that is, even, the last triangle will point downward (see Fig. 6.1 ). This marks a_{2}+a_{4}+\dots+a_{2m}+1 points on the upper line and a_{1}+a_{3}+\dots+a_{2m-1}+1 points on the lower line. Figure 6.1. Triangulation corresponding to the sequence (a_{1},\dots,a_{2m}) . Let n=a_{1}+a_{2}+\dots+a_{2m}+2 . We obtain a triangulation of an n -gon of a special kind: it has exactly two “ears”, meaning its dual tree (see the proof of Proposition 4.7 ) has no vertices of degree three. Such a tree (without branching) is called a bamboo . Let k be the number of downward-pointing triangles, i.e., k=a_{2}+a_{4}+\dots+a_{2m} . The “ears” of our triangulation will be at vertices k+1 and n . The quiddity (c_{1},\dots,c_{n}) of this triangulation can be easily written. Here, c_{1}=a_{1}+1 : the first vertex meets a_{1} upward and one downward triangle. Next come a_{2}-1 twos: a vertex between two downward triangles meets two triangles. The next vertex has quiddity a_{3}+2 (meeting two downward and a_{3} upward triangles), and so on until vertex k+1 with quiddity 1. The pattern then mirrors: c_{k+2}=a_{2m}+1 , followed by a_{2m-1}-1 twos, until c_{n}=1 . Example 6.6 . The sequence [1,2,1,1] corresponds to this triangulation of a heptagon: \textstyle{\bullet\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\bullet\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\bullet\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\bullet\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\bullet\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\bullet\ignorespaces\ignorespaces\ignorespaces\ignorespaces} \textstyle{\bullet} Its quiddity is (2,2,3,1,2,4,1) . Thus, the expression in Theorem 6.1 gives the quiddities of such a triangulation’s vertices, but only a “half” of them: it includes quiddities of vertices between the two “ears”. The following exercise shows that this sequence uniquely determines the triangulation. Exercise 6.7 . Given a triangulation of an n -gon with two “ears” and quiddity (c_{1},\dots,c_{n}) , where c_{k+1}=c_{n}=1 , show that it is possible to reconstruct c_{1},\dots,c_{k} from c_{k+2},\dots,c_{n-1} , and vice versa. Moreover, such a triangulation can be used to reconstruct both the continued fraction and all its convergents, both positive and negative. For this, we define the Farey 11 11 11 John Farey Sr. (1766–1826) was an English geologist and polymath. He authored articles on numerous topics ranging from gardening and meteorology to mathematics and music. The notion of Farey sum was introduced during his research on the mathematical theory of music. sum operation on fractions. Definition 6.8 . For two non-negative irreducible fractions p/q and r/s , their Farey sum or mediant is \frac{p}{q}\oplus\frac{r}{s}=\frac{p+r}{q+s}. The Farey sum is thus the result of “naive addition of fractions”: that is, adding numerator to numerator and denominator to denominator. Exercise 6.9 . Verify that the Farey sum of two fractions lies between them: if p/q0\} be the set of complex numbers with positive imaginary part. We call it the hyperbolic plane . The real line, extended with the point \infty , is called the absolute : it can be thought of as the set of “points at infinity” (or “asymptotic directions”) of the hyperbolic plane. The lines in {\mathbb{H}} are semicircles with centers on the absolute (i.e., perpendicular to the real line), and vertical half-lines starting on the absolute. We place the vertices of the Farey graph on the absolute and draw each edge as a line (not a segment!) in {\mathbb{H}} . As we will show in Corollary 7.9 , the graph drawn this way on the upper half-plane is “planar”: its edges intersect only at vertices. We will focus not on the entire Farey graph but on its subgraph whose vertices are non-negative rational numbers and \infty=\dfrac{1}{0} . Additionally, we will depict the hyperbolic plane in the upper half-plane in an unusual way: place the point \infty in the finite part of the absolute and send some negative number to infinity. For example, we can apply the transformation z\mapsto\dfrac{z}{z+1} to the standard upper half-plane model. This maps 0 to 0 , 1 to \dfrac{1}{2} , and infinity to 1 . Thus, the positive half-axis is mapped to the interval (0,1) on the real axis, and the half-plane \mathrm{Re}\,z>0 maps to the interior of a semicircle with this interval as its diameter. All edges of the Farey graph connecting positive points on the absolute will be drawn as semicircles inside this semicircle. The subgraph formed by all positive vertices (and 0 and \infty ) and their connecting edges is called the positive Farey graph . A fragment of it is shown in Fig. 7.1 . Figure 7.1. A fragment of the positive Farey graph For completeness, note that the entire Farey graph can also be nicely depicted in a finite region by applying the transformation z\mapsto i\dfrac{z-i}{z+i} . This maps the absolute (the real line) to the unit circle and the upper half-plane to the unit disk. Here, \infty is mapped to i , 0 to -i , and the points -1 and 1 remain fixed. The arcs perpendicular to the absolute (generalized circles) map to arcs perpendicular to the absolute, resulting in the picture shown in Fig. 7.2 . Figure 7.2. The Farey graph in the disk 7.2. Embedding triangulations into the positive Farey graph Triangulations of polygons can be embedded into the Farey graph drawn on the plane with the vertices of the polygon lying on the absolute. Consider a triangulation of an n -gon and mark one of its sides; assume this side connects the n -th and first vertices. Write 0=\dfrac{0}{1} and \infty=\dfrac{1}{0} at its endpoints. Then assign to each vertex a positive rational number using an algorithm similar to that in § 4.3 : for each triangle where two vertices already have numbers, write their Farey sum in the third vertex. Now mark all n resulting rational numbers on the absolute of the hyperbolic plane and draw all possible edges of the Farey graph between them; this will reconstruct the original triangulation. This method of assigning numbers to triangulation vertices already appeared in § 6.3 for the special case of “bamboo” triangulations: here, the marked side was the left side of the triangulation. Example 7.3 . Consider the triangulation of a heptagon shown on p. 6.3 . Its embedding into the Farey graph is shown below. Figure 7.3. Triangulation corresponding to the fraction \dfrac{7}{5} Proposition 7.4 . Suppose the vertices of the n -gon are labeled with irreducible fractions \dfrac{u_{1}}{v_{1}}=\dfrac{1}{0},\dfrac{u_{2}}{v_{2}},\dots,\dfrac{u_{n}}{v_{n}}=\dfrac{0}{1} . Then the frieze corresponding to this triangulation has adjacent diagonals v_{2},\dots,v_{n} and u_{1},u_{2},\dots,u_{n-1} . Proof. By computing Farey sums of fractions, we essentially apply the algorithm from § 4.3 twice: separately to numerators and denominators. Thus, the sequence of numerators will be a diagonal of the frieze corresponding to the initial data u_{1}=1,u_{n}=0 , and the sequence of denominators will correspond to the initial data v_{1}=0 , v_{n}=1 . ∎ Example 7.5 . The triangulation from the previous example corresponds to the diagonals of the following frieze. Thus, the numerator and denominator of each fraction at the vertices appear along the antidiagonal. In particular, the negative convergents to \dfrac{7}{5} , namely \dfrac{1}{1} , \dfrac{4}{3} , and \dfrac{7}{5} itself, can be read along the antidiagonals. 7.3. The action of the group \mathop{\mathrm{PSL}}_{2}({\mathbb{Z}}) Consider the group of real 2\times 2 matrices with determinant 1, denoted by \mathop{\mathrm{SL}}_{2}({\mathbb{R}}) . This group acts on {\mathbb{H}} as follows: the element \begin{pmatrix}a&b\\ c&d\end{pmatrix} maps the point z\in{\mathbb{H}} to \dfrac{az+b}{cz+d} . Exercise 7.6 . Verify that this is indeed an action, i.e., the upper half-plane is mapped to itself, and matrix multiplication corresponds to composition of mappings. Additionally, \mathop{\mathrm{SL}}_{2}({\mathbb{R}}) contains a non-trivial element acting as the identity on {\mathbb{H}} : the matrix -I . Thus, we can consider the quotient group \mathop{\mathrm{SL}}_{2}({\mathbb{R}})/\{\pm I\} , denoted \mathop{\mathrm{PSL}}_{2}({\mathbb{R}}) , that also acts on {\mathbb{H}} . Its elements can be viewed as 2\times 2 matrices taken up to sign: \begin{pmatrix}a&b\\ c&d\end{pmatrix} and \begin{pmatrix}-a&-b\\ -c&-d\end{pmatrix} correspond to the same element in the quotient group. Finally, we consider not the entire group \mathop{\mathrm{PSL}}_{2}({\mathbb{R}}) but rather its subgroup \mathop{\mathrm{PSL}}_{2}({\mathbb{Z}}) , consisting of all integer matrices in \mathop{\mathrm{PSL}}_{2}({\mathbb{R}}) . Clearly, it maps rational points on the absolute to rational points. Moreover, it preserves the Farey graph: two points p/q and r/s are connected by an edge if and only if the matrix \begin{pmatrix}p&r\\ q&s\end{pmatrix} has determinant \pm 1 ; this means that for any matrix \begin{pmatrix}a&b\\ c&d\end{pmatrix}\in\mathop{\mathrm{PSL}}_{2}({\mathbb{Z}}) , the product \begin{pmatrix}a&b\\ c&d\end{pmatrix}\begin{pmatrix}p&r\\ q&s\end{pmatrix} has the same determinant. This is equivalent to saying the images of these points, \dfrac{ap+bq}{cp+dq} and \dfrac{ar+bs}{cr+ds} , are also connected by an edge. Thus, the group \mathop{\mathrm{PSL}}_{2}({\mathbb{Z}}) preserves the Farey graph. Remark 7.7 . This action can be viewed as follows: the group \mathop{\mathrm{SL}}_{2}({\mathbb{R}}) naturally acts on {\mathbb{C}}^{2} . By associating to a non-zero vector (z_{1},z_{2})\in{\mathbb{C}}^{2} its “slope” z=\dfrac{z_{1}}{z_{2}}\in{\mathbb{C}}\cup\{\infty\} (in other words, considering the action of \mathop{\mathrm{SL}}_{2}({\mathbb{R}}) on lines through the origin), we obtain the described action. In these terms, the absolute corresponds to the real subset {\mathbb{R}}^{2}\subset{\mathbb{C}}^{2} preserved by \mathop{\mathrm{SL}}_{2}({\mathbb{R}}) . Here, a pair of vertices \dfrac{p}{q} and \dfrac{r}{s} connected by an edge in the Farey graph corresponds to the pair of vectors (p,q) and (r,s)\in{\mathbb{Z}}^{2} with \det\left(\begin{matrix}p&r\\ q&s\end{matrix}\right)=1 . Of course, a matrix A\in\mathop{\mathrm{SL}}(2,{\mathbb{Z}}) maps such a pair of vectors to another such pair. Proposition 7.8 . The group \mathop{\mathrm{PSL}}_{2}({\mathbb{Z}}) acts transitively and faithfully on the oriented edges of the Farey graph: any edge (with marked start and end) can be mapped to any other by a unique transformation. Proof. We show that the pair (\infty,0) can be mapped to the pair \left(\dfrac{p}{q},\dfrac{r}{s}\right) , where ps-qr=1 , by a linear-fractional transformation with integer coefficients. Indeed, this transformation is given by the matrix \begin{pmatrix}p&r\\ q&s\end{pmatrix} . The faithfulness of the action is also clear: it suffices to check that the stabilizer of the pair (\infty,0) is trivial. Obviously, it consists only of \pm I . ∎ From this, we easily derive the previously mentioned result about the planarity of the Farey graph. Corollary 7.9 . The edges of the Farey graph do not intersect. Proof. Due to the transitivity of the action, it suffices to show that the edge connecting 0 and \infty does not intersect any other edge. Indeed, such another edge would have to connect a positive and a negative point \dfrac{a}{b}>0>-\dfrac{c}{d} (where a,b,c,d are positive integers). But then the determinant ad-b(-c)=ad+cb\geq 2 cannot equal 1. ∎ Corollary 7.10 . Consider two triangulations of an n -gon with identical quiddities and a marked side in each of them, embedded into the Farey graph. Then there exists a unique element of \mathop{\mathrm{PSL}}_{2}({\mathbb{Z}}) that maps one triangulation to the other and preserves the marked side. Proof. By Proposition 7.8 , there is a unique element of \mathop{\mathrm{PSL}}_{2}({\mathbb{Z}}) that maps the marked sides into each other, and such that the half-plane containing the first polygon maps to the half-plane containing the second polygon. The remaining vertices of the triangulation are uniquely determined by traversing the triangulation tree: the third vertex of each triangle is obtained as the Farey sum of the first two. ∎ 7.4. Generators of the group \mathop{\mathrm{PSL}}_{2}({\mathbb{Z}}) In Section 6.2 , we saw that any two of the following three matrices R=\begin{pmatrix}1&1\\ 0&1\end{pmatrix},\qquad L=\begin{pmatrix}1&0\\ 1&1\end{pmatrix},\qquad S=\begin{pmatrix}0&-1\\ 1&0\end{pmatrix} generate \mathop{\mathrm{SL}}_{2}({\mathbb{Z}}) . Thus, their images generate \mathop{\mathrm{PSL}}_{2}({\mathbb{Z}}) . With some abuse of notation, we will use the same symbols for elements of \mathop{\mathrm{PSL}}_{2}({\mathbb{Z}}) as in \mathop{\mathrm{SL}}_{2}({\mathbb{Z}}) , i.e., before factorization. Let us see how these transformations act on {\mathbb{H}} . The operator R maps z to z+1 . It fixes \infty and shifts the absolute by one to the right. The transformation R^{a}=\begin{pmatrix}1&a\\ 0&1\end{pmatrix} shifts the absolute by a units, where a can be any integer (possibly negative). The operator S=-\dfrac{1}{z} is the composition of inversion and reflection across the imaginary axis. This transformation is involutive: S^{2}=I . Note that in \mathop{\mathrm{SL}}_{2}({\mathbb{Z}}) , the matrix \begin{pmatrix}0&-1\\ 1&0\end{pmatrix} has order 4, not 2. The operator L fixes 0 and maps z=\dfrac{1}{n} to \dfrac{1}{n+1} . It is easy to check (do this!) that LS=SR^{-1} . 7.5. Stern–Brocot sequences Now consider the line C connecting \infty and 0 (as before, we consider oriented lines; in the figure below, the arrow points from the start to the end of the line). Applying R to it, we get the line RC starting at \infty and ending at 1 ; similarly, LC connects 1 and 0 on the absolute. We obtain a triangle bounded by the lines C , LC , and RC . Call this triangle T . The coordinate of its middle vertex is the Farey sum of the two extreme vertices. Next, apply L to T . We obtain the triangle LT with vertices at 0 , \dfrac{1}{2} , and 1 . The sides of this triangle are LC , L^{2}C , and LRC . Similarly, the triangle RT has sides RC , RLC , and R^{2}C (see Fig. 7.4 ). This gives the following set of vertices on the absolute: 0 , \dfrac{1}{2} , 1 , 2 , \infty . Figure 7.4. Stern–Brocot triangulation This procedure can be continued: apply L and R to LT and RT . The result is a set of nine vertices: 0=\dfrac{0}{1} , \dfrac{1}{3} , \dfrac{1}{2} , \dfrac{2}{3} , \dfrac{1}{1} , \dfrac{3}{2} , \dfrac{2}{1} , \dfrac{3}{1} , \dfrac{1}{0}=\infty , where each pair of consecutive vertices is connected by one of the lines obtained from C by applying L and R in all possible orders. Note that each new vertex on the absolute is the Farey sum of its neighbors. This motivates the following definition. Definition 7.11 . The zeroth Stern 12 12 12 Moritz Abraham Stern (1807–1894) was a German mathematician specializing in number theory. A student of Carl Friedrich Gauss, he introduced the concept of a Stern prime: a prime number that cannot be expressed as the sum of a smaller prime and twice the square of an integer. He defined the Stern–Brocot tree in an 1858 publication, independently of Achille Brocot. --Brocot 13 13 13 Achille Brocot (1817–1878) was a French clockmaker and amateur mathematician. A co-founder of the Parisian clockmaking firm “Brocot & Delettrez”, he authored several improvements to clock mechanisms. Independently of Stern, he devised the Stern–Brocot tree for approximating real numbers with rational numbers, which played an important role in calculating the parameters of gears used in clock mechanisms. sequence is the sequence of fractions \left(\dfrac{0}{1},\dfrac{1}{1},\dfrac{1}{0}\right) . The k -th Stern–Brocot sequence is obtained from the (k-1) -th sequence by inserting the mediant between each pair of consecutive terms. Thus, the first Stern–Brocot sequence is equal to \left(\dfrac{0}{1},\dfrac{1}{2},\dfrac{1}{1},\dfrac{2}{1},\dfrac{1}{0}\right) , the second sequence is \left(\dfrac{0}{1},\dfrac{1}{3},\dfrac{1}{2},\dfrac{2}{3},\dfrac{1}{1},\dfrac{3}{2},\dfrac{2}{1},\dfrac{3}{1},\dfrac{1}{0}\right) , and so on. Remark 7.12 . Here, as before, we treat infinity as an admissible “number,” expressed as the irreducible “fraction” \dfrac{1}{0} . This will not cause any issues since we will only compare fractions (considering infinity greater than any number) and take their Farey sums. We will not further elaborate on this point. Clearly, each Stern–Brocot sequence is increasing: this follows from the fact that the mediant of two fractions lies between them. In particular, all terms in each sequence are distinct. Theorem 7.13 . (1) Any two fractions \dfrac{p}{q}<\dfrac{r}{s} that are neighbors in some Stern–Brocot sequence satisfy the relation qr-ps=1 , i.e., the corresponding numbers are connected by an edge in the Farey graph; (2) all fractions appearing in Stern–Brocot sequences are irreducible; (3) every irreducible fraction \dfrac{a}{b}>0 appears in some Stern–Brocot sequence. Proof. (1) We prove this by induction. For the zeroth sequence, the claim is obvious. When we insert the mediant \dfrac{p+r}{q+s} between two neighbors \dfrac{p}{q} and \dfrac{r}{s} , the required relations hold for it as well: (p+r)q-(q+s)p=qr-ps=1;\qquad r(q+s)-s(p+r)=qr-ps=1. (2) This follows from (1): if qr-ps=1 , then p and q are coprime. (3) We show that every irreducible fraction \dfrac{a}{b} eventually appears in some Stern–Brocot sequence. Suppose it does not appear in a certain sequence. Find the closest neighbors \dfrac{p}{q} and \dfrac{r}{s} in this sequence between which \dfrac{a}{b} lies: \dfrac{p}{q}<\dfrac{a}{b}<\dfrac{r}{s}. Proceed to the next sequence by replacing one endpoint of \left[\dfrac{p}{q};\dfrac{r}{s}\right] with the mediant of its endpoints and choosing the half containing \dfrac{a}{b} . This process cannot continue indefinitely because the conditions \dfrac{a}{b}-\dfrac{p}{q}>0\qquad\text{and}\qquad\dfrac{r}{s}-\dfrac{a}{b}>0 imply that aq-bp\geq 1\qquad\text{and}\qquad br-as\geq 1. Thus, we have (7.1) (r+s)(aq-bp)+(p+q)(br-as)\geq p+q+r+s. On the other hand, the left-hand side of ( 7.1 ) equals (r+s)(aq-bp)+(p+q)(br-as)=a((r+s)q-(p+q)s)+b((p+q)r-(r+s)p)=a+b. Thus, ( 7.1 ) is equivalent to a+b\geq p+q+r+s. But at each step, either p , q , r , or s increases, so this inequality will fail after at most a+b steps. ∎ Returning to Fig. 7.4 , Theorem 7.13 implies that every positive rational number appears as a vertex of some triangle in the Stern–Brocot triangulation. This picture can also be interpreted as follows. Consider the infinite graph dual to the Stern–Brocot triangulation: assign to each triangle a vertex labeled by the “middle” vertex of the triangle. Connect vertices corresponding to adjacent triangles. We obtain a binary tree, the beginning of which is shown in Fig. 7.5 ; it is also called the Stern–Brocot tree . Figure 7.5. Stern–Brocot tree Theorem 7.13 states that every positive rational number appears in the Stern–Brocot tree exactly once. Thus, each number can be encoded by a path from the root (i.e., from \dfrac{1}{1} ) to the corresponding vertex: each number corresponds to a unique word in the letters R and L . For example, \dfrac{2}{1} corresponds to R , \dfrac{4}{3} to RLL , and so on. This yields the following corollary. Corollary 7.14 . For every positive irreducible fraction \dfrac{p}{q}>1 , there exists a sequence of exponents (a_{1},\dots,a_{2m}) such that \begin{pmatrix}p\\ q\end{pmatrix}=R^{a_{1}}L^{a_{2}}\dots R^{a_{2m-1}}L^{a_{2m}}\begin{pmatrix}1\\ 0\end{pmatrix}=M^{+}(a_{1},\dots,a_{2m})\begin{pmatrix}1\\ 0\end{pmatrix}, with all a_{i}>0 . Proof. Note that \begin{pmatrix}1\\ 1\end{pmatrix}=L\begin{pmatrix}1\\ 0\end{pmatrix} corresponds to the point 1 on the absolute. Theorem 7.13 states that any positive rational number on the absolute can be obtained from 1 by applying a word in R and L . Since \dfrac{p}{q}>1 , this number lies in the right half of the Stern–Brocot graph, so the first letter of the corresponding word is R , not L . ∎ To summarize: we have figured out the geometric meaning of the operators R and L . They map the entire Stern–Brocot tree to its right and left halves, respectively. Thus, the sequence (a_{1},\dots,a_{2m}) defines the transformation M^{+}(a_{1},\dots,a_{2m}) , which maps the line (\infty,0) to \left(\dfrac{p}{q},\dfrac{r}{s}\right) , where \dfrac{r}{s} is the last convergent to \dfrac{p}{q} . The resulting triangles define a “bamboo” triangulation of a polygon with the marked side (\infty,0) , consisting of a_{1} upward-pointing triangles, a_{2} downward-pointing triangles, a_{3} upward-pointing triangles, and so on. 7.6. Rotating a triangulation Consider a triangulation of an n -gon embedded in the Farey graph. Let c_{1} be the quiddity of the first vertex, i.e., the number of triangles meeting at the vertex labeled 0 . This means the second vertex is labeled by \dfrac{1}{c_{1}} (why?). Consider the operator \begin{pmatrix}c_{1}&-1\\ 1&0\end{pmatrix} and apply it to {\mathbb{H}} . Let us see where our n -gon is mapped. First, consider the images of the first two vertices, 0 and \dfrac{1}{c_{1}} : \begin{pmatrix}c_{1}&-1\\ 1&0\end{pmatrix}\begin{pmatrix}0\\ 1\end{pmatrix}=\begin{pmatrix}-1\\ 0\end{pmatrix}=\infty;\qquad\begin{pmatrix}c_{1}&-1\\ 1&0\end{pmatrix}\begin{pmatrix}1\\ c_{1}\end{pmatrix}=\begin{pmatrix}0\\ 1\end{pmatrix}=0. Thus, they are mapped to the last and first vertices, respectively, and the line connecting them is mapped to (\infty,0) . The remaining vertices are also mapped to some vertices with positive coordinates (check: why positive?). Generally, they will not coincide with the vertices of the original n -gon. However, their relative positions on the line are preserved since the absolute is preserved by this transformation. Let \alpha_{1}=0,\alpha_{2}=\dfrac{1}{c_{1}},\dots,\alpha_{n}=\infty be the vertices of the original polygon, where p_{i}\in{\mathbb{Q}}_{\geq 0}\cup\{\infty\} . Let \beta_{i} be the image of \alpha_{i} under the action of \begin{pmatrix}c_{1}&-1\\ 1&0\end{pmatrix} . Our n -gon is mapped to an n -gon with vertices \beta_{1}=\infty,\beta_{2}=0,\dots,\beta_{n}=c . This operation corresponds to rotating the n -gon. We have proved the following proposition. Proposition 7.15 . The transformation \begin{pmatrix}c_{1}&-1\\ 1&0\end{pmatrix} maps an n -gon with side (\infty,0) and quiddity (c_{1},\dots,c_{n}) (where the first vertex is 0 ) to an n -gon with side (\infty,0) and quiddity (c_{n},c_{1},\dots,c_{n-1}) . This implies the following corollary. Corollary 7.16 . Let (c_{1},\dots,c_{n}) be the quiddity of an n -gon. Then \begin{pmatrix}c_{1}&-1\\ 1&0\end{pmatrix}\dots\begin{pmatrix}c_{n}&-1\\ 1&0\end{pmatrix}=\pm I. Proof. Consider an n -gon with marked side (\infty,0) and quiddity (c_{1},\dots,c_{n}) . By the previous proposition, the composition of such transformations maps it to an n -gon with the same marked side and quiddity. According to Corollary 7.10 , this composition is the identity element in \mathop{\mathrm{PSL}}_{2}({\mathbb{Z}}) , i.e., \pm I . ∎ Another corollary of Proposition 7.15 can be obtained by considering a “bamboo” triangulation with quiddity (c_{1},\dots,c_{k},1,c_{k+2},\dots,1) . Let \dfrac{p}{q} be the coordinate of the (k+1) -th vertex. Consider the operator that rotates our triangulation k times. This operator is equal to \begin{pmatrix}c_{1}&-1\\ 1&0\end{pmatrix}\dots\begin{pmatrix}c_{k}&-1\\ 1&0\end{pmatrix}=M(c_{1},\dots,c_{k}). It maps the first vertex of the triangulation, \infty , to the (k+1) -th vertex, \dfrac{p}{q}=[[c_{1},\dots,c_{k}]] . The last vertex is mapped to the k -th vertex, \dfrac{\tilde{r}}{\tilde{s}}=[[c_{1},\dots,c_{k-1}]] . Thus, we have shown that if the sequences (a_{1},\dots,a_{2m}) and (c_{1},\dots,c_{k}) are constructed from the same “bamboo” triangulation, then the operators M^{+}(a_{1},\dots,a_{2m}) and M(c_{1},\dots,c_{k}) map \infty to the same point. Hence, the first columns of the corresponding matrices coincide (up to sign), which again proves Theorem 6.1 . Exercise 7.17 . Prove Proposition 6.4 similarly. 8. Summary and further steps 8.1. Continued fractions and friezes as solutions to equations in \mathop{\mathrm{SL}}_{2}({\mathbb{Z}}) In the previous chapters, we discussed friezes, the expansions of rational numbers into continued fractions, and the related identities in the groups \mathop{\mathrm{PSL}}_{2}({\mathbb{Z}}) and \mathop{\mathrm{SL}}_{2}({\mathbb{Z}}) . We saw that for a positive rational number \dfrac{p}{q} , we can construct its positive and negative continued fraction expansions; these expansions correspond to a “bamboo” triangulation of some n -gon. If the quiddity of this n -gon is (c_{1},\dots,c_{k},1,c_{k+2},\dots,c_{n-1},1) , then \dfrac{p}{q}=[[c_{1},\dots,c_{k}]] . Moreover, the quiddity of a triangulation of the n -gon provides a solution to the matrix equation M(c_{1},\dots,c_{n})=-I. More generally, such a solution holds for the quiddity of an arbitrary triangulation of an n -gon, not necessarily a “bamboo”. Such triangulations define friezes of order n . The elements of friezes are constructed based on the quiddity of the triangulation as continuants. In particular, if the triangulation was a “bamboo” and corresponded to the number \dfrac{p}{q} , then the numerators and denominators of the convergents to \dfrac{p}{q} can be read on the adjacent diagonals of the frieze. 8.2. Triangulations and 3d -dissections A question arises: for which sets (c_{1},\dots,c_{n}) is the matrix M(c_{1},\dots,c_{n}) equal to \pm I , i.e., defines the identity transformation in \mathop{\mathrm{PSL}}_{2}({\mathbb{Z}}) ? Do all such sets arise from triangulations? Obviously not: for example, one can insert three consecutive ones anywhere in an existing solution and obtain a new solution by using the relation M(1,1,1)=-I . So how can we describe all solutions? A complete answer to this question was obtained in 2018. It is due to Valentin Ovsienko [ 7 ] . To formulate it, let us first define the concept of a 3d -dissection of a convex polygon. Definition 8.1 . A 3d -dissection of a convex n -gon (with numbered vertices) is its partition by a set of non-intersecting diagonals into polygons, such that has the number of sides of each of these polygons is divisible by 3. The quiddity of a 3d -dissection of an n -gon is the set of numbers (c_{1},\dots,c_{n}) , where c_{i} is the number of polygons incident to the i -th vertex. Thus, instead of triangulations, we will consider dissections of an n -gon into triangles, hexagons, nonagons, etc. Unlike the case of triangulations, a 3d -dissection of an n -gon cannot be reconstructed from its quiddity. Exercise 8.2 . Give an example of two distinct 3d -dissections of an n -gon with the same quiddity. Hint . It suffices to take n=8 . It turns out that, in addition to triangulations, solutions to the equation M(c_{1},\dots,c_{n})=\pm I can also arise from other 3d -dissections of the n -gon. Namely, the following theorem holds. Theorem 8.3 ( [ 7 ] ) . The equality M(c_{1},\dots,c_{n})=\pm I holds if and only if (c_{1},\dots,c_{n}) is the quiddity of some 3d -dissection of an n -gon. Moreover, M(c_{1},\dots,c_{n})=-I if the number of polygons in the dissection with an even number of sides is even, and M(c_{1},\dots,c_{n})=I otherwise.