Sophie Morier-Genoud
email: sophie.morier-genoud@imj-prg.fr

Valentin Ovsienko
email: valentin.ovsienko@univ-reims.fr

FAREY BOAT: CONTINUED FRACTIONS AND TRIANGULATIONS, MODULAR GROUP AND POLYGON DISSECTIONS

We reformulate several known results about continued fractions in combinatorial terms. Among them the theorem of Conway and Coxeter and that of Series, both relating continued fractions and triangulations. More general polygon dissections appear when extending these theorems for elements of the modular group PSL(2, Z). These polygon dissections are interpreted as walks in the Farey tessellation. The combinatorial model of continued fractions can be further developed to obtain a canonical presentation of elements of PSL(2, Z).

À la mémoire de Christian Duval 1 ...similar to Cheshire cat's grin.

). More general solutions correspond to "walks on Farey polygons".

. However, we do not describe this relationship in the present paper.

, the sequence (c 1 , . . . , c k ) being the period of the continued fraction of a fixed point of A, which is a quadratic irrational. In our approach the quadratic irrational is replaced by a rational number.

Introduction

In this paper we formulate combinatorial interpretations of algebraic properties of continued fractions and of matrices in the modular group PSL(2, Z). The combinatorics is related to polygon dissections and walks in the Farey tessellation.

The starting point of the present paper is a theorem due to Conway and Coxeter [START_REF] Conway | Triangulated polygons and frieze patterns[END_REF]. This theorem uses triangulations of polygons to classify Coxeter's "frieze patterns". Work of Coxeter on frieze patterns was motivated by continued fractions; see [START_REF] Coxeter | Frieze patterns[END_REF]. Our first goal is to reformulate Conway and Coxeter's theorem (and related notions) directly in terms of continued fractions, and to compare it to some known results in the area. In particular, we compare the Conway and Coxeter theorem with the theorem of Series [START_REF] Series | The modular surface and continued fractions[END_REF] that provides an embedding of continued fractions into the Farey tessellation. This comparison offers a combinatorial relation between negative and regular continued fractions.

The second goal of the paper is to develop the combinatorics that arose from the above comparison. This leads to surprising results and notions, that appeared recently in the literature [START_REF] Conley | Rotundus: triangulations, Chebyshev polynomials, and Pfaffians[END_REF][START_REF] Ovsienko | Partitions of unity in SL(2, Z), negative continued fractions, and dissections of polygons[END_REF]. Among them are relationship between continued fractions and Pfaffians of skew-symmetric matrices, and to some particular polygon dissections. We give a survey of this recent development. Furthermore, along the same lines, we obtain several statements that appear to be new. These are Theorems 4.13, 5.5, 5.7 and 6.3. We understand elements of PSL(2, Z) as generalized (finite) continued fractions, triangulations are replaced by more general polygon dissections.

Let us outline possible applications and further developments of the combinatorial approach discussed in this paper. We believe that the relation between PSL(2, Z) and polygon dissections (see, in particular, Theorems 3.7 and 6.3) can be applied to other groups extending PSL (2, Z). This relation connects the topic with several other areas of algebra, geometry and combinatorics (such as cluster algebras, frieze patterns, etc.). Application and combination of various methods known in these areas look promising. One application is already explored in the second part of this work [START_REF] Morier-Genoud | Farey boat II. Q-deformations: q-deformed rationals and q-continued fractions[END_REF], where we suggest a notion of q-deformed continued fractions and of q-deformed rational numbers; this deformation preserves the combinatorial properties discussed in the present paper.

The paper consists of six sections, each of them can be read independently.

Key words and phrases. Continued fractions, Farey graph, polygon dissections, Ptolemy rule, Pfaffians, modular group.

In Section 1 we expose a combinatorial model for continued fractions. We consider two classically known expansions of a rational number

r s = c 1 - 1 c 2 - 1 . . . - 1 c k = a 1 + 1 a 2 + 1 . . . + 1 a 2m
, with c i ≥ 2 and a i ≥ 1. The algebraic relationship between these two expansions due to Hirzebruch [START_REF] Hirzebruch | Hilbert modular surfaces[END_REF] is encoded in a triangulation of a polygon. Although this section is introductory, it contains the main tools used throughout the paper, such as Ptolemy rule and triangulations of polygons in the Farey graph. The statements in this section are essentially reformulations of results that can be found in terms of frieze patterns in Coxeter [START_REF] Coxeter | Frieze patterns[END_REF] and results in terms of hyperbolic geometry in Series [START_REF] Series | The modular surface and continued fractions[END_REF]. We call these statements "Facts" and illustrate them on running examples.

In Section 2 we focus on the matrices (0.1) M (c 1 , . . . , c k ) := c 1 -1

1 0 c 2 -1 1 0 • • • c k -1 1 0 and M + (a 1 , . . . , a 2m ) := a 1 1 1 0 a 2 1 1 0 • • • a 2m 1
1 0 associated with the continued fractions. We establish elementary algebraic properties of these matrices and in particular their algebraic relationship. In this section, the remarkable identity M (c 1 , . . . , c n ) = -Id appears using the combinatorial data introduced in Section 1.

In Section 3 we describe combinatorially the complete set of positive integer n-tuples (c 1 , . . . , c n ) that are solutions of the equation (0.2) M (c 1 , . . . , c n ) = ±Id.

The theorem of Conway and Coxeter [START_REF] Conway | Triangulated polygons and frieze patterns[END_REF] provides a certain subset of solutions of M (c 1 , . . . , c n ) = -Id in terms of triangulations of n-gons. These solutions are obtained from the triangulations by counting the number of triangles incident at each vertex of the n-gon. All positive integer solutions of (0.2) are obtained from a special class of dissections of n-gons called "3d-dissections" [START_REF] Ovsienko | Partitions of unity in SL(2, Z), negative continued fractions, and dissections of polygons[END_REF]. Under weaker conditions on the coefficients c i , the continued fraction disappears gradually, but the corresponding combinatorics lives on 1 and becomes more sophisticated.

Let us be a little bit more technical and briefly explain the way combinatorics appears in the context of the modular group. This relationship is central for the whole paper. The standard choice of generators of PSL(2, Z) is

R = 1 1 0 1 , S = 0 -1 1 0 ,
and all the relations in PSL(2, Z) are consequences of the following two relations: S 2 = Id and (RS) 3 = Id, implying the well-known isomorphism PSL(2, Z) (Z/2Z) * (Z/3Z). It is then not difficult to deduce that every A ∈ PSL(2, Z) can be written (non-uniquely) in the form (0.3)

A = R c1 S R c2 S • • • R cn S,
in such a way that all the coefficients c i are positive integers. Note that (0.3) coincides with (0.1), i.e., A = M (c 1 , . . . , c n ). It is a rule in combinatorics that positive integers count some objects, and Theorem 3.7 provides this interpretation in the case where A is a relation in PSL(2, Z), i.e., when A = Id. This section is a collection of basic properties of continued fractions that we formulate in a combinatorial manner.

Let r and s be two coprime positive integers, and assume that r > s. The rational number r s has unique expansions

(1.1) r s = c 1 - 1 c 2 - 1 . . . - 1 c k = a 1 + 1 a 2 + 1 . . . + 1 a 2m
, where c i ≥ 2 and a i ≥ 1, for all i.

The first expansion is usually called a negative, or reversal continued fraction the second is a (more common) regular continued fraction. We will use the notation c 1 , . . . , c k and [a 1 , . . . , a 2m ] for the above continued fractions, respectively. Note that one can always assume the number of terms in the regular continued fraction to be even, since [a 1 , . . . , a + 1] = [a 1 , . . . , a , 1].

The explicit formula to obtain the coefficients (c 1 , . . . , c k ) in terms of the coefficients (a 1 , . . . , a 2m ), whenever c 1 , . . . , c k = [a 1 , . . . , a 2m ], is as follows:

(1.2) (c 1 , . . . , c k ) = a 1 + 1, 2, . . . , 2 a2-1 , a 3 + 2, 2, . . . , 2 a4-1 , . . . , a 2m-1 + 2, 2, . . . , 2 a2m-1
.

This expression can be found in [21, Eq. ( 19), p.241] and [22, Eqs. ( 22), ( 23)], see also [6, p.93]. We will give a combinatorial explanation of this formula. In Section 2.3 we will give a detailed proof of a more general statement. The goal of this introductory section is to explain that both, regular and negative, continued fractions can be encoded by the same simple combinatorial picture. We will be considering triangulated n-gons with exactly two exterior triangles. All the statements of this section are combinatorial reformulations of known results.

1.1. Triangulations with two exterior triangles. Given a (convex) n-gon, we will be considering the classical notion of triangulation which is a maximal dissection of the n-gon by diagonals that never cross except for the endpoints. A triangle in a triangulation is called exterior if two of its sides are also sides (and not diagonals) of the n-gon.

In this section, we consider only those triangulations that have exactly two exterior triangles. In such a triangulation the diagonal connecting the exterior vertices of the exterior triangles has the property to cross every diagonal of the triangulation:

• • • • • • • • • • • • •
Then, every triangle in the triangulation (except for the exterior ones) can be situated with respect to this diagonal in one of the two possible ways:

• • • • • •
that we refer to as "base-down" or "base-up". We assume the first exterior triangle to be situated base-down, and the last one base-up. We enumerate the vertices from 0 to n -1 in a (clockwise) cyclic order:

1 2 3 4 5 k k + 1 0 n -1 n -2 k + 2
so that the exterior vertices are 0 and k + 1.

1.2. Combinatorial interpretation of continued fractions. Given an n-gon and its triangulation with two exterior triangles, we fix the following notation.

(1) The integers (a 1 , a 2 , . . . , a 2m ) count the number of equally positioned triangles, i.e. the triangulation consists of the concatenation of a 1 triangles base down, followed by a 2 triangles base up and so on:

c 1 s s a2 C C c 2 c 3 • u u a4 @ @ • c k c k+1 c 0 k k a1 Q Q c n-1 c n-2 • i i a3 T T • c k+2
(2) The integers (c 1 , c 2 , . . . , c n = c 0 ) count the number of triangles at each vertex, i.e., the integer c i is the number of triangles incident to the vertex i.

Formula (1.2) is equivalent to the fact that these sequences define the same rational number. For a proof, see Section 2.3. It is clear that each of the data (a 1 , . . . , a 2m ) and (c 1 , . . . , c k ) defines uniquely (the same) triangulation of a polygon with two exterior triangles. The number n of vertices is related to the sequences via

a 1 + a 2 + • • • + a 2m = n -2, c 1 + c 2 + • • • + c k = n + k -3.
Fact 1 then implies the following.

Corollary 1.1. The set of rationals r s > 1 is in a one-to-one correspondence with triangulations of polygons with two exterior triangles. Definition 1.2. Given a rational number r s > 1, we denote by T r/s the corresponding triangulation with two exterior triangles.

Example 1.3. One has 7 5 = [1, 2, 1, 1] = 2, 2, 3 .
The corresponding triangulation T 7/5 is

• • • • • • • 1.3.
The mirror formula. Consider the reversal of a regular continued fraction: [a 2m , a 2m-1 , . . . , a 1 ], which is important in number theorey; see, e.g., [START_REF] Adamczewski | Reversals and palindromes in continued fractions[END_REF].

For every ≥ 0, define the th convergent of the regular continued fraction [a 1 , . . . , a 2m ] by

r s := a 1 + 1 a 2 + 1 . . . + 1 a .
The convergents of the negative continued fraction are defined in a similar way.

The following statement is known as the "mirror formula":

r 2m r 2m-1 = [a 2m , a 2m-1 , . . . , a 1 ].
In Section 2.1, we will prove this statement with the help of the matrix form of continued fractions. The conversion into a negative continued fraction resorts to the coefficients c i on the opposite vertices of T r/s . Corollary 1.4. One has

[a 2m , a 2m-1 , . . . , a 1 ] = c k+2 , c k+3 , . . . , c n-1 .
Proof. This formula follows from Fact 1 when "rotating" the triangulation T r/s .

Example 1.5. The reversal of the continued fraction from Example 1.3 is as follows:

7 4 = [1, 1, 2, 1] = 2, 4 .
1.4. Farey sums and the labeling of vertices. The rational r s can be recovered from the triangulation T r/s by an additive rule.

Let us label the vertices of the n-gon by elements of the set Q ∪ 1 0 . We start from 0 1 and 1 0 at vertices 0 and 1, respectively. We then extend this labeling to the whole n-gon by the following "Farey summation formula". Whenever two vertices of the same triangle have been assigned the rationals r s and r s , then the third vertex receives the label

r s ⊕ r s := r + r s + s .
This process is illustrated by the following example.

(1.3) The following statement is easily proved by induction. It can be viewed as a reformulation of the result of Series [START_REF] Series | The modular surface and continued fractions[END_REF]; for more details, see Section 1.6. Fact 2. Labeling the vertices of the triangulation T r/s according to the above rule, the vertex k +1 receives the label r s . Remark 1.6. More generally, all the rationals labeling the vertices 2, 3, . . . , k, k + 1 are the consecutive convergents of the negative continued fraction c 1 , . . . , c k representing r s . 1.5. Recovering r and s with the Ptolemy-Plücker rule. In Euclidean geometry, the Ptolemy relation is the formula relating the lengths of the diagonals and sides of an inscribed quadrilateral. It reads x 1,3 x 2,4 = x 1,2 x 3,4 + x 2,3 x 4,1 , where x i,j is the Euclidean length between the vertices i and j. In algebraic geometry and combinatorics, the Ptolemy relations appear as the relations between the Plücker coordinates of the Grassmannian Gr 2,n , so that they are often called Ptolemy-Plücker relations. We will use this name in the sequel. They became an important and general rule in the theory of cluster algebras [START_REF] Fomin | Cluster algebras. I. Foundations[END_REF][START_REF] Fomin | Cluster algebras. II. Finite type classification[END_REF]. The "Ptolemy-Plücker rule" provides a way to calculate new variables from the old ones.

Let us explain how the Ptolemy rule allows one to calculate the numerator r and the denominator s of the continued fraction (1.1) from the corresponding triangulation T r/s .

Given a triangulated n-gon with exactly two exterior triangles, we will assign a value x i,j to all its edges (i, j) with i ≤ j, so that the system of equations (1.4) x i,j x k, = x i,k x j, + x i, x k,j , i ≤ k ≤ j ≤ ,

x i,i = 0, is satisfied. The system (1.4) will be called the Ptolemy-Plücker relations.

Fact 3. (i) The labels x i,j satisfying (1.4) are uniquely determined by the values x i,j of the sides and diagonals of the triangulation.

(ii) Assume that x i,j = 1 whenever (i, j) is a side or a diagonal of the triangulation

• 1 1 1 1 1 • 1 1 • 1 • 1 • 1 • 1 •
Then all the labels x i,j are positive integers.

(iii) In the triangulation T r/s , the assumption from Part (ii) implies the labeling

x 0,k+1 = r x 1,k+1 = s.
Parts (i) and (ii) are widely known in the theory of cluster algebra; see [START_REF] Gekhtman | Cluster algebras and Poisson geometry[END_REF]Section 2.1.1]. We do not dwell on the proof here.

Part (iii) was already known to Coxeter [START_REF] Coxeter | Frieze patterns[END_REF]Eq.(5.6)] who proved (in a different context) the following more general statement. Fact 4. Under the assumption that x i,j = 1 whenever (i, j) is a side or a diagonal of the triangulation, the integers x i,j are calculated as 2 × 2 determinants:

(1.5)

x i,j = det r i r j

s i s j = r i s j -s i r j ,
where ri si and rj sj are the rationals labeling the vertices i and j, as in (1.3). We will prove yet a more general result in Section 5.3 (see Theorem 5.5). We illustrate the statement (iii) by the following diagram.

• s • • • • • • • r • • • • • • 1.6.
Triangulations T r/s inside the Farey graph. The triangulation (1.3) can be naturally embedded in the Farey tessellation. In this section we explain how to extract the triangulation T r/s from the Farey tessellation. This construction is due to C. Series [START_REF] Series | The modular surface and continued fractions[END_REF], and it allows one to deduce Fact 2 from her result.

Definition 1.7. a) The set of all rational numbers Q, completed by ∞ represented by 1 0 , form a graph called the Farey graph. Two rationals written as irreducible fractions, r s and r s , are connected by an edge if and only if r s -r s = ±1.

b) Including Q ∪ {∞} into the border of the hyperbolic half-plane H, the edges are often represented as geodesics of H (which is a half-circle) and the Farey graph splits H into an infinite set of triangles called the Farey tessellation.

Basic properties of the Farey graph and Farey tessellation can be found in [START_REF] Hardy | An introduction to the theory of numbers[END_REF], we will need the following.

a) The edges of the Farey tessellation never cross, except at the endpoints.

r ′ s ′ r ′ +r ′′ s ′ +s ′′ r ′′ s ′′
We focus on the part of the graph consisting of rational numbers greater than 1. The construction of [START_REF] Series | The modular surface and continued fractions[END_REF] is as follows. Fix a rational number r s and draw a vertical line (L) ⊂ H through r s . Collect all the triangles of the Farey tessellation crossed in their interior by this line. This leads to the triangulation T r/s .

The property of the triangles to be situated "base down" and "base up" now read as: "base at the left of (L)" and "base at the right of (L)". The two exterior vertices are 0 1 and r s . The vertices are enumerated from 1 to n from 1 0 to 0 1 in the decreasing order. The vertex r s is the vertex number k + 1. Example 1.8. Choosing r s = 7 5 , we have the following picture:

0 1 1 1 4 3 7 5 3 2 2 1 1 0 (L)
where we have colored in pink the triangles at the left of (L) and in blue those at the right of (L). Note that the lowest triangle can be viewed either at the left or at the right of (L). This is precisely the triangulation T 7/5 (cf. Example 1.3) viewed inside the Farey tessellation.

Matrices of negative and regular continued fractions

It is convenient to use 2 × 2 matrices to represent continued fractions. One reason is that the corresponding matrices belong to the group SL(2, Z) and allow the operations, such as multiplication, inverse, transposition; see [START_REF] Van Der Poorten | An introduction to continued fractions[END_REF]. Another reason which is particularly important for us is that matrices are more "perennial" than continued fractions. They continue to exist when continued fractions are not well-defined (because of potential zeros in the denominators) and enjoy similar properties.

In this section, however, we still assume that the continued fractions are well-defined. Consider, as in Section 1, a rational number expanded into continued fractions:

r s = c 1 , . . . , c k = [a 1 , . . . , a 2m ].
The information about these expansions is contained in the matrices

(2.1) M (c 1 , . . . , c n ) := c 1 -1 1 0 c 2 -1 1 0 • • • c n -1 1 0 and (2.2) M + (a 1 , . . . , a 2m ) := a 1 1 1 0 a 2 1 1 0 • • • a 2m 1 1 0 .
Both matrices are elements of SL(2, Z). The goal of this introductory section is to compare these two matrices and rewrite one from another. This, in particular, implies formula (1.2). The end of the section contains motivations for the sequel.

M (c 1 , . . . , c k ) = r -r s -s , M + (a 1 , . . . , a 2m ) = r r s s ,
where r s = [a 1 , . . . , a 2m ] = c 1 , . . . , c k , and where r s = c 1 , . . . , c k-1 , and r s = [a 1 , . . . , a 2m-1 ]. Therefore, the matrices M + (a 1 , . . . , a 2m ) and M (c 1 , . . . , c k ) have the same first column, but they are different. There exists a simple relationship between these matrices. Proposition 2.2. One has:

(2.3) M + (a 1 , . . . , a 2m ) = M (c 1 , . . . , c k ) R, where R = 1 1 0 1 .
Proof. Formula (2.3) can be easily obtained using the results of the previous section. Indeed, in the triangulation T r/s labeled as in (1.3), we see that r s , r s , r s label the vertices k, k + 1, k + 2, respectively. This implies r s = r s + r s and hence (2.3). Alternatively and independently, the relation between the matrices M + (a 1 , . . . , a 2m ) and M (c 1 , . . . , c k ) can be established by elementary matrix computations. This will be done in the next sections.

Example 2.3. Choosing, as in Example 1.3, the rational r s = 7 5 , one obtains

M + (1, 2, 1, 1) = 7 4 5 3 , M (2, 2, 3) = 7 -3 5 -2 .
Note that these matrices have different traces and therefore cannot be conjugacy equivalent.

2.2. Matrices M + (a 1 , . . . , a 2m ) and M (c 1 , . . . , c k ) in terms of the generators. It will be useful to have the expressions of M + (a 1 , . . . , a 2m ) and M (c 1 , . . . , c k ) in terms of the generators of SL(2, Z). The following formulas are standard and can be found in many sources.

Proposition 2.4. The matrices M + (a 1 , . . . , a 2m ) and M (c 1 , . . . , c k ) have the following decompositions

M + (a 1 , . . . , a 2m ) = R a1 L a2 R a3 L a4 • • • R a2m-1 L a2m , (2.4) M (c 1 , . . . , c k ) = R c1 S R c2 S • • • R c k S, (2.5)
where

(2.6) R = 1 1 0 1 , L = 1 0 1 1 , S = 0 -1 1 0 .
For the sake of completeness, we give here an elementary proof.

Proof. Formula (2.4) is obtained from the elementary computation

a i 1 1 0 a i+1 1 1 0 = a i a i+1 + 1 a i a i+1 1 = 1 a i 0 1 1 0 a i+1 1 = R ai L ai+1 .
Formula (2.5) is obviously obtained from

c i -1 1 0 = R ci S.

2.3.

Converting the matrices. The matrix M + (a 1 , . . . , a 2m ) with a i ≥ 1 can be rewritten in the form (2.1).

Proposition 2.5. One has:

(2.7) M + (a 1 , . . . , a 2m ) = -M a 1 + 1, 2, . . . , 2 a2-1 , a 3 + 2, 2, . . . , 2 a4-1 , . . . , a 2m-1 + 2, 2, . . . , 2 a2m , 1, 1 .
Let us stress that (2.7) is equivalent to (2.3) under the assumption that we already know formula (1.2). However, our strategy is different, we use (2.7) to prove (1.2).

We will need the following lemma.

Lemma 2.6. One has R a = -M (a + 1, 1, 1) and

L a = -M (1, 2, . . . , 2 a , 1, 1).
Proof. With a direct computation one easily obtains M (a + 1, 1, 1) = -R a . For the second formula we use the following preliminary result that is easily obtained by induction 2 -1

1 0 a = a + 1 -a a -(a -1) .
Then a direct computation leads to M (1, 2, . . . , 2 a , 1, 1) = -L a . Hence the lemma.

Proof of Proposition 2.5. Since M (1, 1, 1) = -Id, one gets from Lemma 2.6

R ai L ai+1 = -M (a i + 1, 2, . . . , 2 ai+1 , 1, 1).
Formula (2.7) then follows from (2.4) and the simple relation M (2, 1, 1, a + 1) = -M (a + 2). Proposition 2.5 is proved.

Finally, we observe that the last three coefficients in (2.7) are (2, 1, 1), and can be removed using the equality M (2, 1, 1) = -R. So that one gets

(2.8) M + (a 1 , . . . , a 2m ) = M a 1 + 1, 2, . . . , 2 a2-1 , a 3 + 2, 2, . . . , 2 a4-1 , . . . , a 2m-1 + 2, 2, . . . , 2 a2m-1 R.
According to Proposition 2.1 the first column of the matrices from the right-hand-side and from the left-hand-side gives the rational r s . Therefore, this establishes formula (1.2) and the relation (2.3).

2.4.

Converting the conjugacy classes in PSL(2, Z). We obtain it as a corollary of Proposition 2.5.

Corollary 2.7. The matrix M + (a 1 , . . . , a 2m ) is conjugacy equivalent to the matrix

M a 1 + 2, 2, . . . , 2 a2-1 , a 3 + 2, 2, . . . , 2 a4-1 , . . . , a 2m-1 + 2, 2, . . . , 2 a2m-1
.

Proof. This statement immediately follows from (2.8) using conjugation by R.

The integers

(2.9) (c 1 , . . . , c k ) = a 1 + 2,
M + (1, 2, 1, 1) is conjugacy equivalent to M (3, 2, 3) = 12 -5 5 -2 . 2.5. Appearance of the equation M (c 1 , . . . , c n ) = -Id.
It turns out that, taking into account all the coefficients (c 1 , . . . , c n ) of the triangulation T r/s (and not only (c 1 , . . . , c k ) as we did before), one obtains the negative of the identity matrix. The following statement can be found in [START_REF] Bergeron | SL k -tilings of the plane[END_REF].

Proposition 2.9. One has

M (c 1 , . . . , c n ) = -Id. Proof. Rewrite M (c 1 , . . . , c n ) = M (c 1 , . . . , c k ) M (1) M (c k+2 , . . . , c n-1 ) M (1)
M (c 1 , . . . , c n ) = M + (a 1 , . . . , a 2m ) R -1 M (1) M + (a 2m , . . . , a 1 ) R -1 M (1) = M + (a 1 , . . . , a 2m ) S M + (a 2m , . . . , a 1 ) S,
where S is as in (2.6). Since M + (a 2m , . . . , a 1 ) = M + (a 1 , . . . , a 2m ) t , we conclude using the fact that

ASA t S = -Id for all A ∈ SL(2, Z).
Every rational number r s thus corresponds to a solution of the equation M (c 1 , . . . , c n ) = -Id. This equation will be important in the sequel for two reasons.

Firstly, the equation M (c 1 , . . . , c n ) = -Id makes sense and remains an interesting equation in general, when there is no particular rational number and the corresponding continued fraction. Expanding a rational in a continued fraction r s = c 1 , . . . , c k , we always assumed c i ≥ 2. This assumption makes the expansion unique. Allowing c i = 1 for some i, one faces two difficulties: the expansion is no more unique (there is an infinite number of them), and furthermore, the continued fraction may not be well-defined (the denominators may vanish). It turns out that considering the matrices M (c 1 , . . . , c k ) with c i ≥ 1 removes these difficulties.

Secondly, we will study the presentation of elements of the group SL(2, Z) (and PSL(2, Z)) in the form A = M (c 1 , . . . , c n ) for some positive integers c i . Therefore, it will be important to know the relations leading to different presentations of the same element. As mentioned in Proposition 2.4, Γ is generated by the matrices R and L. It consists of the matrices with positive entries satisfying the following conditions:

Γ = a b c d ∈ SL 2 (Z) a ≥ b ≥ d > 0, a ≥ c ≥ d > 0 .
The semigroup Γ is the main character of a wealth of different problems of number theory, dynamics, combinatorics, etc. It was studied by many authors from different viewpoints; see [START_REF] Aigner | Markov's theorem and 100 years of the uniqueness conjecture[END_REF][START_REF] Mcmullen | Uniformly Diophantine numbers in a fixed real quadratic field[END_REF][START_REF] Boca | Products of matrices 1 1 0 1 and 1 0 1 1 and the distribution of reduced quadratic irrationals[END_REF][START_REF] Bourgain | Beyond Expansion III: Reciprocal Geodesics[END_REF] and references therein. This is one of the motivations for a systematic study of the matrices M (c 1 , . . . , c n ) which is one of the main subjects of this paper. One motivation for considering solutions with arbitrary positive integers c i ≥ 1 is related to the observation that positive integers usually count interesting combinatorial objects. The solutions we classify in this section are given in terms of polygon dissections: triangulations and also more general "3d-dissections" of n-gons. Another motivation is to extend most of the results and ideas of Section 1 from continued fractions to arbitrary solutions of the equation M (c 1 , . . . , c n ) = ±Id. Our third motivation is related to a more general study (see Section 6) of decomposition of an arbitrary element A ∈ PSL(2, Z) in the form A = M (c 1 , . . . , c n ). Solutions of the above equations describe relations in such a decomposition.

Let us also mention that equation M (c 1 , . . . , c n ) = -Id considered over C defines an interesting algebraic variety closely related to the classical moduli space M 0,n of configurations of points in the projective line. Therefore, positive integer solutions of this equation correspond to a class of rational points of M 0,n ; see [START_REF] Morier-Genoud | Linear difference equations, frieze patterns and combinatorial Gale transform[END_REF]. We do not consider geometric applications in the present paper.

r i s i := c 1 , . . . , c i , for 1 ≤ i ≤ n.
For example, the coefficients c i of a negative continued fraction of a rational number r s is a part of the quiddity of the triangulation T r/s , and the rationals ri si are its convergents; see Section 1.2. Of course, for continued fractions, the denominator of ri si cannot vanish.

Definition 3.2. The class of solutions of (3.1) satisfying the condition

(3.2) r i s i > 0,
for all i ≤ n -3, will be called totally positive.

We will see in Section 3.3 that the above condition of total positivity is equivalent to the assumption that

c 1 + c 2 + • • • + c n = 3n -6.
The Conway and Coxeter theorem [START_REF] Conway | Triangulated polygons and frieze patterns[END_REF] establishes a one-to-one correspondence between totally positive solutions of (3.1) and triangulations of the n-gon, via the notion of quiddity that uniquely determines the triangulation. Theorem 3.3 ([11]). (i) The quiddity of a triangulated n-gon is a totally positive solution of (3.1).

(ii) A totally positive solution of (3.1) is the quiddity of a triangulated n-gon.

We do not dwell on the detailed proof of this classical result. For a simple complete proof of Theorem 3.3 see [START_REF] Bergeron | SL k -tilings of the plane[END_REF][START_REF] Henry | Coxeter friezes and triangulations of polygons[END_REF], and also [START_REF] Ovsienko | Partitions of unity in SL(2, Z), negative continued fractions, and dissections of polygons[END_REF]. The idea of the proof consists of three observations. 1) An n-tuple of integers (c 1 , . . . , c n ) satisfying (3.1) must contain c i = 1 for some i. Otherwise, for any sequence of integers (v i ) i∈Z satisfying the linear recurrence

v i+1 = c i v i -v i-1 , with the initial conditions (v 0 , v 1 ) = (0, 1), one has: v i+1 > v i . Therefore, the sequence (v i ) i∈Z cannot be periodic. This contradicts the equation M (c 1 , . . . , c n ) 1 0 = ± 1 0 .
2) The total positivity condition (3.2) implies that, whenever c i = 1 for some i, the two neighbors c i-1 , c i+1 must be greater or equal to 2. Indeed, for two consecutive 1's, if (c i , c i+1 ) = (1, 1), one has

v i+2 = v i+1 -v i = v i -v i-1 -v i = -v i-1 .
3) The "local surgery" operation

(3.3) (c 1 , . . . , c i-1 , 1, c i+1 , . . . , c n ) → (c 1 , . . . , c i-1 -1, c i+1 -1, . . . , c n )
is then well-defined. It decreases n by 1, and does not change the matrix (2.1).

Indeed, M (c 1 , . . . , c i-1 , 1, c i+1 , . . . , c n ) = M (c 1 , . . . , c i-1 -1, c i+1 -1, . . . , c n ) since c + 1 -1 1 0 1 -1 1 0 c + 1 -1 1 0 = cc -1 -c c -1 = c -1 1 0 c -1 1 0 .
One then proceeds by induction on n, the induction step consists of cutting an exterior triangle of a given triangulation, that corresponds to the operation (3.3) on the quiddity. b) The Conway and Coxeter theorem is initially formulated in terms of frieze patterns. This notion, due to Coxeter [START_REF] Coxeter | Frieze patterns[END_REF], became popular mainly because its relations to cluster algebras; see [START_REF] Caldero | Cluster algebras as Hall algebras of quiver representations[END_REF]. Frieze patterns also play an important role in such areas as quiver representations, differential geometry, discrete integrable systems (for a survey; see [START_REF] Morier-Genoud | Coxeter's frieze patterns at the crossroads of algebra, geometry and combinatorics[END_REF]).

3.2.

The complete set of solutions: 3d-dissections. It turns out that, to classify all the solutions (with no total positivity condition), it is natural to solve simultaneously the equations

M (c 1 , . . . , c n ) = -Id and M (c 1 , . . . , c n ) = Id.
This classification led to the following combinatorial notion.

Definition 3.6. (i) A 3d-dissection is a partition of a convex n-gon into sub-polygons by means of pairwise non-crossing diagonals, such that the number of vertices of every sub-polygon is a multiple of 3.

(ii) The quiddity of a 3d-dissection of an n-gon is defined, similarly to the case of a triangulation, as a cyclically ordered sequence (c 1 , . . . , c n ) of positive integers counting sub-polygons adjacent to every vertex.

The following theorem was proved in [START_REF] Ovsienko | Partitions of unity in SL(2, Z), negative continued fractions, and dissections of polygons[END_REF]. (ii) Conversely, every solution of the equation M (c 1 , . . . , c n ) = ±Id with positive integers c i is the quiddity of a 3d-dissection of an n-gon.

Similarly to Theorem 3.3, the proof uses induction on n. The idea is as follows. Besides the operations (3.3), one needs another type of "local surgery" operations. These operations remove two consecutive 1's:

(3.4) (c 1 , . . . , c i-1 , c i , 1, 1, c i+3 , c i+4 , . . . , c n ) → (c 1 , . . . , c i-1 , c i + c i+3 -1, c i+4 , . . . , c n ).
Such an operation decreases n by 3 and changes the sign of the matrix M (c 1 , . . . , c n ). Indeed, c -1

1 0 1 -1 1 0 2 c - 1
1 0 = 1 -c -c 1 -1 0 . Example 3.8.
Simple examples of 3d-dissections different from triangulations are:

1 2 2 1 1 1 1 2 1 1 1 1 1 1 1 1 2
Their quiddities are solutions of (0.2). More precisely,

M (1, 1, 2, 1, 2, 1, 1) = Id, M (1, 1, 2, 1, 1, 1, 1, 2, 1, 1)
= -Id.

Remark 3.9. Theorem 3.7 does not imply a one-to-one correspondence between solutions of (0.2) and 3d-dissections. Moreover, such a correspondence does not exist. Indeed, the quiddity of a 3d-dissection does not characterize it. This means that different 3d-dissections may correspond to the same quiddity.

For instance, the following different 3d-dissections of the octagon

1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1
have the same quiddity. This observation is due to Alexey Klimenko.

To elucidate the statement of Theorem 3.7, let us separate the cases of -Id and Id.

Corollary 3.10. Given a 3d-dissection of an n-gon, its quiddity (c 1 , . . . , c n ) satisfies M (c 1 , . . . , c n ) = -Id if and only if the number of subpolygons with an even number of vertices is even.

3.3. The total sum c 1 + • • • + c n .
An interesting characteristics of a solution is the total sum of the coefficients c i . Theorem 3.7 implies that the value c 1 + • • • + c n = 3n -6 is maximal. Note that, for a totally positive solution, the sum of c i 's is equal to 3n -6 which is three times the number of triangles in a triangulation of an n-gon.

c 1 + c 2 + • • • + c n ≤ 3n -6.
The total sum can be expressed in terms of the subpolygons of the corresponding 3d-dissection. The following statement is a combination of Corollary 2.3 and Proposition 3.1 of [START_REF] Ovsienko | Partitions of unity in SL(2, Z), negative continued fractions, and dissections of polygons[END_REF], we do not dwell on the proof here.

Proposition 3.12. The total sum of c i 's in the quiddity of a 3d-dissection of an n-gon is

c 1 + c 2 + • • • + c n = 3n -6 k≤[ n 3 ] (k -1) N k -6,
where N k is the number of 3k-gons in the 3d-dissection.

It follows that the total sum of c i 's can vary by multiples of 6, and the sign on the right-hand side of M (c 1 , . . . , c n ) = ±Id alternates.

Corollary 3.13. The solutions of the equation M (c 1 , . . . , c n ) = ±Id can be ranged by levels:

(3.5) c 1 + c 2 + • • • + c n = 3n -6, (-Id) = 3n -12, (Id) = 3n -18, (-Id)
. . .

Walks on the Farey graph

In this section we show that every solution of the equation M (c 1 , . . . , c n ) = ±Id admits an embedding into the Farey tessellation. This is a generalization of the construction from Section 1.6.

In particular, a totally positive solution corresponding to a triangulation of the n-gon, defines a monotonously decreasing walk from 1 0 to 0 1 . This is an n-cycle in the Farey graph that we refer to as a "Farey n-gon". The Farey tessellation then induces a triangulation which coincides with the initial triangulation.

A more general solution corresponding to a 3d-dissection of an N -gon defines (an oriented) walk along a certain Farey n-gon, where n < N . Every such walk is an N -cycle, and we show that the quiddity of the 3d-dissection of the N -gon can be recovered from the triangulation of the Farey n-gon. (ii) We call a Farey n-gon every n-cycle in the Farey graph such that

v 0 = 1 0 , v n-1 = 0 1 , and v i-1 > v i ,
for all i = 1, . . . , n -1.

Example 4.2. The sequence Let (c 1 , . . . , c n ) be a set of positive integers such that M (c 1 , . . . , c n ) = -Id. Our next goal is to define the corresponding n-cycle in the Farey graph.

We define a sequence of n vertices in the Farey graph r0 s0 , . . . , rn-1 sn-1

that starts with 1 0 and ends with 0 1 with the following recurrence relations:

(4.1)

r i := c i r i-1 -r i-2 s i := c i s i-1 -s i-2 .
and the initial conditions r-1 s-1 = 0 -1 , r0 s0 = 1 0 . We get a sequence of the form (4.2)

r 0 s 0 , . . . , r n-1 s n-1 = 1 0 , c 1 1 , c 1 c 2 -1 c 2 , c 1 c 2 c 3 -c 1 -c 2 c 2 c 3 -1 , . . . , 0 1 ;
The fact that rn-1 sn-1 = 0 1 follows from the relation M (c 1 , . . . , c n ) = -Id. Indeed, inductively one obtains

M (c 1 , . . . , c i ) = r i -r i-1 s i -s i-1 , where r i s i = c 1 , . . . , c i .
is the sequence of convergents of the negative continued fraction c 1 , . . . , c n . In particular, -Id =

M (c 1 , . . . , c n ) = r n -r n-1 s n -s n-1
, so r n-1 = 0 and s n-1 = 1, and furthermore r n = -1 = -r 0 and s n = 0 = s 0 . This implies that the sequences defined by Proof. Part (i). For every pair of sequences, (r i ) and (s i ), satisfying the linear recurrence (4.1) one obtains constant 2 × 2 determinants det r i r i-1

s i s i-1 = det -r i-2 r i-1 -s i-2 s i-1 = det r i-1 r i-2 s i-1 s i-2 = . . . = det r 0 r -1 s 0 s -1 = -1.
Therefore, ri si and ri-1 si-1 are connected by an edge. Part (ii). The positivity condition (3.2) and the relation r i s i-1 -r i-1 s i = -1 imply ri si < ri-1 si-1 . Hence the result.

It turns out that every Farey n-gon gives rise to a totally positive solution, so that we can formulate the following statement. For details; see [ Remark 4.5. The solution (c 1 , . . . , c n ) can be recovered from the n-gon using the notion of index of a Farey sequence (this notion was defined and studied in [START_REF] Hall | The index of a Farey sequence[END_REF]). Given an n-gon r0 s0 , r1 s1 , . . . , rn-1 sn-1 in the Farey graph, its index is the n-tuple of integers

c i := r i-1 + r i+1 r i = s i-1 + s i+1 s i .
In our terms, the index is nothing else than the quiddity of the triangulation.

4.2.

Farey n-gons and triangulations. Classical properties on the Farey graph imply the following statement whose proof can be found in [START_REF] Morier-Genoud | SL 2 (Z)-tilings of the torus, Coxeter-Conway friezes and Farey triangulations[END_REF]. We do not dwell on the proof here (see [START_REF] Morier-Genoud | SL 2 (Z)-tilings of the torus, Coxeter-Conway friezes and Farey triangulations[END_REF]Section 2.2]). The rational labels on the vertices of the triangulation can be recovered directly from the triangulation by the following combinatorial algorithm. Note that this is the same algorithm as in Section 1.4, except for step [START_REF] Adamczewski | Reversals and palindromes in continued fractions[END_REF], and applied to arbitrary triangulations.

(1) In the triangulated n-gon, label the vertex number 1 by 1 0 and the vertex number n by 0 1 . (2) Label all the vertices of the n-gon according to the rule: Whenever two vertices of the same triangle have been assigned the rationals r s and r s , then the third vertex receives the label r s ⊕ r s := r + r s + s . Example 4.10. Let n = 6, and consider the totally positive solutions (3, 1, 3, 1, 3, 1) and (1, 3, 1, 3, 1, 3). They correspond to the Farey hexagons

1 0 , 3 1 , 2 1 , 3 2 , 1 1 , 0 1 and 1 0 , 1 1 , 2 3 , 1 2 , 1 3 , 0 1
and to the triangulated hexagons respectively. One checks that the first Farey hexagon is obtained from the second one by the action of the matrix 3 -1 1 0 .

4.3. 3d-dissections and walks on the Farey tessellation. Construction (4.1) can be applied with an arbitrary positive solution of the equation M (c 1 , . . . , c N ) = ±Id. This leads again to an N -cycle starting at 1 0 and ending at 0 1 . In the sequence of vertices defining the cycle a vertex may appear several times and it will be important to distinguish r s and -r -s . In other words, we will consider the twofold covering of the projective line over Q.

Definition 4.11. Given a Farey n-gon, 1 0 , r1 s1 , . . . , rn-1 sn-1 , 0 1 and an integer N ≥ n, an N -periodic (or antiperiodic) sequence of its vertices, ri j si j j∈Z , is called (i) a walk on the n-gon if ri j si j and ri j+1 si j+1 are connected by an edge, for all j;

(ii) a positive walk if it is a walk and r ij s ij+1 -s ij r ij+1 > 0, for all j.

In other words, fixing an orientation on the Farey n-gon, a positive walk has the same orientation.

0 , 1 1 , 1 2 , 0 1 , the 7-periodic walk 1 0 , 1 1 , 0 1 , -1 0 , -1 -1 , -1 -2 , 0 -1
is positive. The quadrilateral and its Farey triangulation and the walk are represented by the diagrams:

1 0 1 1 0 1 1 2 1 0 -1 0 1 1 G G 0 1 -1 -1 0 -1 1 2 -1 -2 c c 1 1
where the dashed arrow indicates a change of signs in the sequence so that the next step of the walk is drawn in the copy of the n-gon with opposite signs.

The following 10-antiperiodic walk

1 0 , 1 1 , 1 2 , 0 1 , -1 -1 , -1 -2 , 0 -1 , 1 0 , 1 1 , 0 1
along the same quadrilateral is also positive and is represented by

1 0 -1 0 1 0 1 1 o o 0 1 -1 -1 0 -1 1 1 G G 0 1 1 2 c c 1 1 -1 -2 c c 1 1 1 2 c) Consider the Farey hexagon 1 0 , 1 1 , 2 3 , 1 2 , 1 3 , 0 1 : 1 0 1 1 0 1 2 3 1 3 1 2
The 9-periodic walk

1 0 , 1 1 , 1 2 , 1 3 , 0 1 , -1 -1 , -2 -3 , -1 -2 , 0 -1
is positive and is represented by the diagram

1 0 G G 1 1 -1 0 -1 -1 % % 0 1 V V 2 3 0 -1 f f V V -2 -3 Õ Õ 1 3 o o 1 2 -1 -3 -1 -2
Recall (cf. Section 4.1) that every solution of the equation M (c 1 , . . . , c N ) = ±Id defines an N -(anti)periodic positive walk on some Farey n-gon, where n ≤ N . The following theorem is nthe main result of this section. . Since for every i we have

(4.3) det r i r i+1 s i s i+1 = r i s i+1 -r i+1 s i = 1,
both, the numerator and the denominator must satisfy a linear recurrence

V i+1 = c i V i -V i-1 ,
with some N -periodic sequence (c i ) i∈Z . The monodromy of this equation is the matrix M (c 1 , . . . , c N ). Since (r i ) i∈Z and (s i ) i∈Z are two (anti)periodic solutions, this monodromy is equal to ±Id. Part (ii). Given a solution of the equation M (c 1 , . . . , c N ) = ±Id, applying the construction (4.2), one obtains a sequence of rationals ri si i∈Z , which is periodic or antiperiodic depending on the sign in the right-hand-side of the equation and satisfies (4.3). To prove that this sequence is indeed a walk on a Farey n-gon, one needs to show that every pair of neighbors ri si and rj sj (i.e., such points that there is no other point in the sequence in the interval ri si , The 7-periodic walk

1 0 , 1 1 , 0 1 , -1 0 , -1 -1 , -1 -2 , 0 -1 generates the 7-periodic sequence (c i ) i∈Z with the period (1, 1, 1, 1, 2, 1, 2). The 10-antiperiodic walk 1 0 , 1 1 , 1 2 , 0 1 , -1 -1 , -1 -2 , 0 -1 , 1 0 , 1 1 , 0 1
generates the 10periodic sequence (c i ) i∈Z with the period (1, 2, 1, 1, 1, 1, 2, 1, 1, 1). These are quiddities of the 3d-dissections

1 2 2 1 1 1 1 2 1 1 1 1 1 1 1 1 2 respectively. The 9-periodic walk 1 0 , 1 1 , 1 2 , 1 3 , 0 1 , -1 -1 , -2 -3 , -1 -2 , 0 -1
generates the quiddity of the following 3ddissection of a nonagon:

1 2 2 2 2 1 1 2 2
We can say that while walking on a triangulated n-gon, the "invisible hand" draws a 3d-dissection of an N -gon with N > n.

4.4.

The quiddity of a 3d-dissection from a Farey walk. Given an n-gon, 1 0 , r1 s1 , . . . , rn-1 sn-1 , 0 1 , and an N -(anti)periodic walk on it ri j si j j∈Z , it is natural to ask, how to recover the sequence (c 1 , . . . , c N ) which is a solution of the equation M (c 1 , . . . , c N ) = ±Id. The answer is as follows.

The integer c ij counts the number of triangles in the n-gon that lie on the positive side of the walk,

ri j+1 si j+1 ri j si j . . . ri j-1 si j-1
with respect to the orientation of the hyperbolic plane. This is a quiddity of a 3d-dissection of an N -gon, as follows from Theorem 3.7.

PPP: Ptolemy, Plücker and Pfaff

In this section we prove that every solution (c 1 , . . . , c n ) of the equation M (c 1 , . . . , c n ) = ±Id, with c i positive integers, defines a certain labeling of the diagonals of a convex n-gon:

x : V × V → Z,
where V is the set of vertices of the n-gon, usually identified with {1, . . . , n}. Moreover, the set of integers x i,j , satisfies the Ptolemy-Plücker relations. In this sense, the results discussed in Section 1.5 are still valid in the case where no continued fraction is defined. Note that the totally positive solutions are in a one-to-one correspondence with the labelings where all x i,j are positive integers. For an arbitrary solution, one can only guarantee that the shortest diagonals are labeled by positive integers.

This section contains the proofs of the main results. Our main tool is the well-known polynomial called (Euler's) continuant. This is the determinant of a tridiagonal matrix, it gives an explicit formula for the entries of the matrices M (c 1 , . . . , c n ). The Ptolemy-Plücker relations are deduced from the Euler identity for the continuants.

We conclude the section with the similar "Pfaffian formulas" for the trace tr(M (c 1 , . . . , c n )) recently obtained in [START_REF] Conley | Rotundus: triangulations, Chebyshev polynomials, and Pfaffians[END_REF]. The proof is more technical and we do not dwell on it. 5.1. Continuant = "continued fraction determinant". The material of this subsection is classical.

Let us think of (c 1 , . . . , c n ) as formal commuting variables, and consider the negative continued fraction:

(5.1)

r n s n = c 1 , . . . , c n ,
here and below n ≥ 1. Then both the numerator and the denominator are certain polynomials in c i . It turns out that these polynomials are basically the same.

Definition 5.1. The tridiagonal determinant

K n (c 1 , . . . , c n ) := det          c 1 1 1 c 2 1 . . . . . . . . . 1 c n-1 1 1 c n         
is called the continuant. We also set for convenience K 0 := 1 and K -1 := 0.

The following statement is commonly known. The proof is elementary and we give it for the sake of completeness.

Proposition 5.2. The numerator and the denominator of (5.1) are given by the continuants

(5.2) r n = K n (c 1 , . . . , c n ), s n = K n-1 (c 2 , . . . , c n ).
Proof. Formula (5.2) follows from the recurrence relation

(5.3) V i+1 -c i+1 V i + V i-1 = 0,
with (known) coefficients (c i ) i∈Z and (indeterminate) sequence (V i ) i∈Z . Let ri si = c 1 , . . . , c i be a convergent of the continued fraction (5.1), then both sequences, (r i ) i≥1 and (s i ) i≥1 satisfy (5.3), with the initial conditions (r 1 , r 2 ) = (c 1 , c 1 c 2 -1) and (s 1 , s 2 ) = (1, c 2 ). Indeed, this is equivalent to Proposition 2.1. On the other hand, the continuants satisfy (5.4)

K i (c 1 , . . . , c i ) = c i K i-1 (c 1 , . . . , c i-1 ) -K i-2 (c 1 , . . . , c i-2 ).
Hence the result.

As a consequence of (5.2), we obtain the following formula for the entries of the matrix M (c 1 , . . . , c n ):

(5.5)

M (c 1 , . . . , c n ) = K n (c 1 , . . . , c n ) -K n-1 (c 1 , . . . , c n-1 ) K n-1 (c 2 , . . . , c n ) -K n-2 (c 2 , . . . , c n-1 )
.

Indeed, M (c 1 , . . . , c n ) is the matrix of convergents, cf. Section 2.1.

5.2.

The Euler identity for continuants. The polynomials K n (c 1 , . . . , c n ) were studied by Euler who proved the following identity (see, e.g., [START_REF] Graham | Concrete mathematics. A foundation for computer science[END_REF]).

Theorem 5.3 (Euler). For 1 ≤ i ≤ j < k ≤ ≤ n, one has (5.6) K k-i (c i , . . . , c k-1 )K -j (c j+1 , . . . , c ) = K j-i (c i , . . . , c j-1 )K -i (c i+1 , . . . , c ) + K -i+1 (c i , . . . , c )K k-j-1 (c j+1 , . . . , c k-1 ).
We give here an elegant proof due to A. Ustinov [START_REF] Ustinov | A short proof of Euler's identity for continuants[END_REF] that makes use of the Pfaffian of a skew-symmetric matrix.

Proof. Using the notation

x i-1,j+1 := K j-i+1 (c i , . . . , c j ), for i < j, consider the 4 × 4 skew-symmetric matrix

Ω =       0 x i+1,j x i+1,k x i+1, -x i+1,j 0 x j,k x j, -x i+1,k -x j,k 0 x k, -x i+1, -x j, -x k, 0      
.

It readily follows from the recurrence relation (5.4), that the matrix Ω has rank 2. Hence

det(Ω) = (x i+1,j x k, + x i+1, x j,k -x i+1,k x j, ) 2 = 0,
which is precisely (5.6).

Remark 5.4. a) Formula (5.2) allows one to work with continued fractions with c i assigned to concrete numbers (integers, real, complex, etc.), even when the "naive" expression (5.1) is not well-defined. This may happen when some denominators vanish, for instance if several consecutive coefficients c i , c i+1 , . . . are equal to 1. b) Replacing the negative continued fraction by a regular one: rn sn = [a 1 , . . . , a n ], where n can be even or odd, formula (5.2) is replaced by a similar formula with the only difference that the continuant is replaced by the determinant

K + n (a 1 , . . . , a n ) := det          a 1 1 -1 a 2 1 . . . . . . . . . -1 a n-1 1 -1 a n         
, also known under the name of continuant. c) The continuants enjoy many remarkable properties (some of which are listed in [START_REF] Graham | Concrete mathematics. A foundation for computer science[END_REF][START_REF] Berstel | Noncommutative rational series with applications[END_REF][START_REF] Conley | Rotundus: triangulations, Chebyshev polynomials, and Pfaffians[END_REF]). They were already known to Euler who thoroughly studied the polynomials K n and, in particular, established Ptolemy-type identities for them. In a sense, the continuants establish a relationship between the continued fractions and projective geometry; see [START_REF] Morier-Genoud | Linear difference equations, frieze patterns and combinatorial Gale transform[END_REF] and references therein. d) Let us mention that equation (5.3) is called the discrete Sturm-Liouville, Hill, or Schrödinger equation. It plays an important role in many areas of algebra, analysis and mathematical physics. When the sequence of coefficients is periodic: c i+n = c i , for all i, there is a notion of monodromy matrix of (5.3), which is nothing else than the matrix M (c 1 , . . . , c n ). 5.3. Ptolemy-Plücker relations. We are ready to explain the connection between solutions of the equation M (c 1 , . . . , c n ) = ±Id and the Ptolemy-Plücker relations.

Let x i,j , where i, j ∈ {1, . . . , n}, be a set of n 2 formal (commuting) variables. In order to have a clear combinatorial picture, and following [START_REF] Fomin | Cluster algebras. II. Finite type classification[END_REF], we will always think of an n-gon with the vertices cyclically ordered by {1, . . . , n}, and the diagonals (i, j) labeled by x i,j .

We call the Ptolemy-Plücker relations the following system of equations (5.7)

     x i,j x k, = x i,k x j, + x i, x k,j , i ≤ k ≤ j ≤ , x i,i = 0, x i,i+1 = 1.
We will distinguish two special cases, where the set of variables x i,j is either symmetric, or skewsymmetric:

x i,j = x j,i , or x i,j = -x j,i . The following statement arose as an attempt to interpret some of the results of [START_REF] Coxeter | Frieze patterns[END_REF] (see also [START_REF] Morier-Genoud | Linear difference equations, frieze patterns and combinatorial Gale transform[END_REF]).

Theorem 5.5. Let (c 1 , . . . , c n ) be positive integers. The system (5.7) together with the symmetry condition x i,j = x j,i has a unique solution such that x i-1,i+1 = c i if and only if one has M (c 1 , . . . , c n ) = -Id.

Proof. We use the following lemma.

Lemma 5.6. If (x i,j ) satisfies the Ptolemy-Plücker relations (5.7) then for all i ≤ j one has

(5.8) x i-1,j+1 = det          c i 1 1 c i+1 1 . . . . . . . . . 1 c j-1 1 1 c j          = K j-i+1 (c i , . . . , c j ).
where

c i = x i-1,i+1 .
Proof. We proceed by induction on j. The induction base is x i-1,i+1 = c i = K 1 (c i ) by definition, and the following calculation of x i-1,i+2 .

i -

1 ci 1 i + 2 ci+1 1 xi-1,i+2 i i + 1 1
The Ptolemy-Plücker relation reads

c i c i+1 = x i-1,i+2 + 1, hence x i-1,i+2 = K 2 (c i , c i+1 ).
The induction step consists of expanding the determinant of (5.8) with respect to the last column and compare with the Ptolemy-Plücker relation given by the diagram

i -1 xi-1,j xi-1,j-1 j + 1 cj 1 xi-1,j+1 j -1 j 1 .
Both relations are equivalent to (5.4). Hence the lemma.

Let us show that the Ptolemy-Plücker relations imply M (c 1 , . . . , c n ) = -Id. Applying Lemma 5.6 to the case |j -i| = n -1, and using the cyclic numeration of the vertices of the n-gon, we get x i,i-1 = K n (x i , . . . , x i+n-1 ) = 1, provided x i,j = x j,i . Then, again implying (5.7), one readily gets

K n+1 (x i , . . . , x i+n ) = 0, K n+2 (x i , . . . , x i+n+1 ) = -1.
We conclude by (5.5), that M (c 1 , . . . , c n ) = -Id.

Conversely, assume that M (c 1 , . . . , c n ) = -Id. Starting from x i,i = 0, x i,i+1 = 1 and then labeling the diagonals of the n-gon using (5.8) one obtains a solution of (5.7) using the Euler identities (5.3) for the continuants.

A similar computation (that we omit) allows one to prove the following skew-symmetric counterpart of Theorem 5.5.

Theorem 5.7. Let (c 1 , . . . , c n ) be positive integers. The system (5.7) together with the skew-symmetry condition x i,j = -x j,i has a unique solution such that x i-1,i+1 = c i if and only if M (c 1 , . . . , c n ) = Id.

Remark 5.8. Let us mention that the coordinates x i,j satisfying (5.7) together with the skew-symmetry condition can be identified with the Plücker coordinates of the Grassmannian G 2,n of 2-dimensional subspaces in the n-dimensional vector space. The coordinate ring of G 2,n is one of the basic examples of cluster algebras of Fomin and Zelevinsky [START_REF] Fomin | Cluster algebras. I. Foundations[END_REF] (for details; see [START_REF] Fomin | Cluster algebras. II. Finite type classification[END_REF]). A description of the relationship between Coxeter's frieze patterns and cluster algebras can be found in [START_REF] Morier-Genoud | Coxeter's frieze patterns at the crossroads of algebra, geometry and combinatorics[END_REF].

5.4. Relation to 3d-dissections. So far in this section we considered formal variables x i,j . Assigning concrete integral values to these variables, one has to deal with integer solutions of the equation M (c 1 , . . . , c n ) = ±Id. In particular, Theorems 3.7, 5.5 and 5.7 imply the following relation to 3ddissections (see Section 3.2).

Corollary 5.9. Given an n-tuple of positive integers (c 1 , . . . , c n ), start labeling the diagonals of an n-gon by

x i,i = 0,

x i,i+1 = 1, x i-1,i+1 = c i ,
for all 1 ≤ i ≤ n, and then continue using the Ptolemy-Plücker relations. This procedure is consistent, and there exists a set of integers x i,j and satisfying (5.7), if and only if (c 1 , . . . , c n ) is a quiddity of a 3d-dissection. It turns out that the square of this polynomial is equal to the determinant of a 2n × 2n matrix.

Theorem 5.10 ( [START_REF] Conley | Rotundus: triangulations, Chebyshev polynomials, and Pfaffians[END_REF][START_REF] Conley | Lagrangian configurations and symplectic cross-ratios[END_REF]). The trace of the matrix M (c 1 , . . . , c n ) is equal to the square root of the determinant of the following skew-symmetric 2n × 2n matrix (5.9) det

                     1 c 1 1 1 c 2 1 . . . . . . . . . . . . . . . 1 -1 1 c n -c 1 -1 1 -1 . . . . . . . . . . . . -1 -1 -c n -1                      = (tr M (c 1 , . . . , c n )) 2 .
In other words, tr(M (c 1 , . . . , c n )) is the Pfaffian of the matrix on the left-hand-side of (5.9). We refer to [START_REF] Conley | Rotundus: triangulations, Chebyshev polynomials, and Pfaffians[END_REF] for a proof of this result. Let us mention that formula (5.9) reflects a relation to symplectic geometry; see [START_REF] Conley | Lagrangian configurations and symplectic cross-ratios[END_REF]. More precisely, the 2n × 2n matrix in (5.9) appears as the Gram matrix of the symplectic form in the standard symplectic space evaluated on a Lagrangian configuration. This relation deserves further investigation.

Example 5.11. In the case n = 3 one can easily check directly that det

           0 0 1 c 1 1 0 0 0 0 1 c 2 1 -1 0 0 0 1 c 3 -c 1 -1 0 0 0 1 -1 -c 2 -1 0 0 0 0 -1 -c 3 -1 0 0            = (c 1 c 2 c 3 -c 1 -c 2 -c 3 ) 2 ,
which is nothing other than the square of the trace of M (c 1 , c 2 , c 3 ).

Remark 5.12. If one wants to check (5.9) with the computer and forgets to put the minus sign, here is what one will obtain for n ≥ 2:

(5.10) det

                     1 c 1 1 1 c 2 1 . . . . . . . . . . . . . . . 1 1 1 c n c 1 1 1 1 . . . . . . . . . . . . 1 1 c n 1                      = (-1) n (tr M (c 1 , . . . , c n )) 2 -4 .
Note that the expression in the right-hand-side of (5.10) is the discriminant of the characteristic polynomial of M (c 1 , . . . , c n ). It will appear again in Section 6.1.

Minimal presentation of PSL(2, Z)

The group SL(2, Z) (and thus PSL(2, Z)) is generated by two elements, and a standard choice of generators is either {S, R}, {S, U }, or {U, R}, where

S = 0 -1 1 0 , R = 1 1 0 1 , U = 1 -1 1 0 .
A natural question is how to make such a presentation canonical. It is a simple and well-known fact that every element A ∈ PSL(2, Z) can be presented in the form A = M (c 1 , . . . , c k ) where c i are positive integers. The above question is equivalent to the existence of a canonical presentation in this form. This question was considered and answered (modulo conjugation of A) in [START_REF] Hirzebruch | Classification of Hilbert modular surfaces[END_REF][START_REF] Zagier | Nombres de classes et fractions continues[END_REF][START_REF] Katok | Coding of closed geodesics after Gauss and Morse[END_REF]. The coefficients (c 1 , . . . , c k ) are obtained as the (minimal) period of the negative continued fraction of a fixed point of A. This fixed point is a quadratic irrationality.

We show the existence and uniqueness of the "minimal presentation", A = M (c 1 , . . . , c k ), with c i ≥ 1, and k is the smallest possible. The coefficients (c 1 , . . . , c k ) of this presentation are calculated via expansion of a rational number (the quotient of largest coefficients of A). This statement looks quite surprising since it recovers the period of a quadratic irrationality from a continued fraction of a rational. Consider the real projective line RP 1 , which is identified with R ∪ {∞} by choosing an affine coordinate x. The action of PSL(2, Z) on RP 1 is given by linear-fractional transformations, viz

A = a b c d : x → ax + b cx + d .
When A is hyperbolic, it has two fixed points x ± ∈ RP 1 :

x ± = a -d ± (a + d) 2 -4 2c .
Note that the expression (tr A) 2 -4 appeared in (5.10). When choosing the representative A ∈ PSL(2, Z) with tr A > 0, the point x + has the property that, for all x = x -, A m (x) tends to x + , when m → ∞.

The point x + is thus called the attractive fixed point of A. Since x ± are quadratic irrationals, the corresponding continued fractions are periodic (starting from some place) by Lagrange's theorem; see, e.g., [START_REF] Van Der Poorten | An introduction to continued fractions[END_REF][START_REF] Borwein | Neverending fractions. An introduction to continued fractions[END_REF]. Consider the negative continued fraction expansion of the attractive fixed point:

x + = c 1 , . . . , c , c +1 , . . . , c +k , where (c +1 , . . . , c +k ) is the minimal period of the continued fraction.

The statement explained in [35, pp.90-92] can be formulated as follows.

Proposition 6.1. Every hyperbolic element A ∈ PSL(2, Z) is conjugate to M (c +1 , . . . , c +k ), and the ktuple (c +1 , . . . , c +k ), defined modulo cyclic permutations, characterises the conjugacy class of A uniquely.

We refer to [START_REF] Hirzebruch | Classification of Hilbert modular surfaces[END_REF][START_REF] Zagier | Nombres de classes et fractions continues[END_REF] and [START_REF] Katok | Coding of closed geodesics after Gauss and Morse[END_REF] for a detailed and very clear treatment of this statement and its applications. Proposition 6.1 and its impact for number theory, see, e.g., [START_REF] Duke | Kronecker's first limit formula, revisited[END_REF] and references therein, is the main motivation for us to study minimal presentations of elements of PSL(2, Z). When representing a matrix, the condition c i ≥ 2, for all i, cannot always be satisfied (many interesting matrices need 1's at the ends of their minimal presentations). 6.2. Minimal presentation. Every element A ∈ PSL(2, Z) can be written in the form A = M (c 1 , . . . , c k ), where c i ≥ 1. We are interested in the shortest presentations of this form. It turns out that the coefficients c i can be recovered from the coefficients of A, without expansions of quadratic irrationals.

c 1 + 1, c 2 , . . . , c k ); (ii) if a < b, then the minimal presentation of A is (6.2) A = M (c 1 , . . . , c k-1 , c k + 1, 1, 1)
where b d = c 1 , . . . , c k ; and the conjugacy class of A is parametrized by (c 1 + c k , c 2 , . . . , c k-1 ). Proof. Part (i). After multiplication from the right by R -1 , the matrix AR -1 satisfies the conditions of Part (ii) of Theorem 6.3. One then uses that R -1 = M (1, 1, 2, 1) and M (2, 1, 2, 1) = Id (up to a sign, i.e., in PSL(2, Z)). Hence (6.1). Next, one has

RAR -1 = M (2, 1, 1, c 1 , . . . , c k ) = M (c 1 + 1, c 2 , . . . , c k ).
Part (ii). The matrix A becomes as in Part (ii) of Theorem 6.3, when multiplied from the right by S = M (1, 1, 2, 1, 1). Next, since R a = M (a + 1, 1, 1), one has

R c k AR -c k = M (c k + 1, 1, 1, c 1 , . . . , c k-1 ) = M (c 1 + c k , c 2 , . . . , c k-1 ).
Hence the result. Remark 6.6. Comparing (6.1) and (6.2) to somewhat similar known formulas in terms of the positive continued fractions (see [START_REF] Karpenkov | Geometry of Continued Fractions[END_REF], Theorem 7.14), we observe that they are quite different. Indeed, formulas (6.1) and (6.2) use the "dominant" (largest) coefficients of A, while the formulas in [START_REF] Karpenkov | Geometry of Continued Fractions[END_REF] use the smallest coefficients. Rewriting (6.1) and (6.2) in terms of the standard generators, and using Proposition 2.4, we have the following decomposition.

(i) if a > b, then A = R c1 S R c2 S • • • SR c k SR, = R a1 (U R) a2 • • • R a2m-1 (U R) a2m where a c = [a 1 , . . . , a 2m ] = c 1 , . . . , c k ; (ii) if a < b, then A = R c1 S R c2 S • • • SR c k , = R a1 (U R) a2 • • • R a2m-1 (U R) a2m-1 R where b d = [a 1 , . . . , a 2m ] = c 1 , . . . , c k .
Together with Proposition 2.4, Theorem 3.7 implies an explicit description of relations in the group PSL(2, Z). Every element A ∈ PSL(2, Z) can be written in terms of the generators R and S (see formula (2.5)) as follows

A = R c1 S R c2 S • • • R cn S,
where c i are some positive integers. The following statement is actually equivalent to Theorem 3.7.

Corollary 6.8. One has

R c1 S R c2 S • • • R cn S = Id in PSL(2, Z), if and only if (c 1 , . . . , c n ) is the quiddity of a 3d-dissection of an n-gon.
Note that all of the above relations follow from the following two: [START_REF] Borwein | Neverending fractions. An introduction to continued fractions[END_REF][START_REF] Aigner | Markov's theorem and 100 years of the uniqueness conjecture[END_REF]. Note that this is the period of the negative continued fraction of the attractive fixed point of A:

S 2 = Id, (
x + = -1 + √ 6 = 2, 2, 6 . Note that these operations have already been used in Sections 3.1 and 3.2. It has already been checked, that these operations preserve the element M (c 1 , . . . , c k ) of PSL(2, Z).

Given an arbitrary presentation A = M (c 1 , . . . , c k ) with positive integers c i , applying the operations (6.3) and (6.4) when this is possible (and in arbitrary order), the k-tuple (c 1 , . . . , c k ) can be reduced to one of the case c i ≥ 2, except perhaps for c 1 , or c 1 , c 2 and c k , or c k-1 , c k .

By multiplying from the right by M (1) or M (1, 1), we can furthermore normalize the sequence (c 1 , . . . , c k ) in such a way that it contains at most one entry 1 at the end, i.e., that c k-1 ≥ 2. This implies that the continued fraction c 1 , . . . , c k is well defined.

Assume there are two different presentations of the same element, To prove Proposition 6.4, first note that the operations (6.3) and (6.4) allow one reduce any presentation A = M (c 1 , . . . , c k ) to the form with c i ≥ 2, except perhaps for the ends of the sequence. Hence the "only if" part. The proof of the "if" part is similar to that of Theorem 6.3, Part (i).

6.4. Minimal presentation and Farey n-gon. Given a matrix A ∈ PSL(2, Z), we explain how to recover the coefficients (c 1 , . . . , c k ) in a combinatorial manner. More precisely, the coefficients can be interpreted as the quiddity of some triangulated polygon.

We focus on the case of matrices of the form The corresponding Farey hexagon is 1 0 , 3 1 , 5 2 , 2 1 , 1 1 , 0 1 and the triangulation T A can be pictured as follows: The quiddity sequence at the vertices 1 0 , 3 1 , 5 2 is (3, 2, 1) so that we deduce A = 2 -5 1 -2 = M (3, 2, 1). (c) The famous Cohn matrices are the triples of matrices, (A, AB, B) in which the triples of Markov numbers appear both, as right upper entry, and as 1 3 of the traces. It is known (see [START_REF] Aigner | Markov's theorem and 100 years of the uniqueness conjecture[END_REF]) that such matrices

4 .

 4 Farey sums and the labeling of vertices 7 1.5. Recovering r and s with the Ptolemy-Plücker rule 7 1.6. Triangulations T r/s inside the Farey graph 8 2. Matrices of negative and regular continued fractions 10 2.1. The matrices of continued fractions 10 2.2. Matrices M + (a 1 , . . . , a 2m ) and M (c 1 , . . . , c k ) in terms of the generators 11 2.3. Converting the matrices 11 2.4. Converting the conjugacy classes in PSL(2, Z) 12 2.5. Appearance of the equation M (c 1 , . . . , c n ) = -Id 12 2.6. The semigroup Γ 13 3. Solving the equation M (c 1 , . . . , c n ) = ±Id 13 3.1. Conway and Coxeter totally positive solutions 14 3.2. The complete set of solutions: 3d-dissections 15 3.3. The total sum c 1 + • • • + c n 16 4. Walks on the Farey graph 17 4.1. Solutions of M (c 1 , . . . , c n ) = -Id and n-cycles in the Farey graph 17 4.2. Farey n-gons and triangulations 19 4.3. 3d-dissections and walks on the Farey tessellation 20 4.4. The quiddity of a 3d-dissection from a Farey walk 23 5. PPP: Ptolemy, Plücker and Pfaff 23

Fact 1 .

 1 If (a 1 , . . . , a 2m ) and (c 1 , . . . , c k ) are the integers defined by (1) and (2), respectively, then they are the coefficients of the expansions of the same rational number as a regular and negative continued fraction, i.e., [a 1 , . . . , a 2m ] = c 1 , . . . , c k .

Figure 1 .

 1 Figure 1. A fragment of the Farey graph

2. 1 .

 1 The matrices of continued fractions. The matrices (2.1) and (2.2) are known as the matrices of continued fractions, because one has the following statement whose proof is elementary. Proposition 2.1. One has

2. 6 .

 6 The semigroup Γ. The matrices M + (a 1 , . . . , a 2m ) of regular continued fractions do not represent arbitrary elements of PSL(2, Z).Definition 2.10. The semigroup Γ ⊂ SL(2, Z) consists of the elements M + (a 1 , . . . , a 2m ) where a i are positive integers.

3 .

 3 Solving the equation M (c 1 , . . . , c n ) = ±Id In this section we describe all positive integer solution of the two equations M (c 1 , . . . , c n ) = -Id, and M (c 1 , . . . , c n ) = Id, for the matrices (2.1). Recall that matrices M (c 1 , . . . , c n ) with c i ≥ 1, satisfying M (c 1 , . . . , c n ) = -Id, arose from continued fractions, see Section 2.5. The equation M (c 1 , . . . , c n ) = Id is quite different but also relevant.

3. 1 .

 1 Conway and Coxeter totally positive solutions. A classical theorem of Conway and Coxeter [11] describes a particular class of solutions of the equation (3.1) M (c 1 , . . . , c n ) = -Id. More importantly, this theorem relates this equation to combinatorics. The following notion is the most important ingredient of the theory. Definition 3.1. (a) Given a triangulation of a convex n-gon by non-crossing diagonals, its quiddity is the (cyclically ordered) n-tuple of positive integers, (c 1 , . . . , c n ), counting the number of triangles adjacent to the vertices. (b) Given an n-tuple of positive integers, (c 1 , . . . , c n ), we consider the following sequence of rational numbers, or infinity:

Example 3 . 4 .Remark 3 . 5 .

 3435 The sequence (2, 2, 2, 5, 4, 2, 2, 1, 4, 2, 4, 1, 3, 2, 5, 1) is a solution of (3.1) because it is the quiddity of the following triangulation of a hexadecagon: a) The meaning of total positivity will be explained in Sections 4.1 and 5.3.

Theorem 3 . 7 (

 37 [START_REF] Ovsienko | Partitions of unity in SL(2, Z), negative continued fractions, and dissections of polygons[END_REF]). (i) The quiddity of a 3d-dissection of an n-gon satisfies M (c 1 , . . . , c n ) = ±Id.

Corollary 3 . 11 .

 311 Positive integer solutions of the equation M (c 1 , . . . , c n ) = ±Id always satisfy

4. 1 .

 1 Solutions of M (c 1 , . . . , c n ) = -Id and n-cycles in the Farey graph. We use the following combinatorial data in the Farey graph. Definition 4.1. (i) An n-cycle in the Farey graph is a sequence (v i ) i∈Z of vertices (with the cyclic order convention v i+n = v i ), such that v i-1 and v i are connected by an edge for all i.

( 4 . 1 )Proposition 4 . 3 .

 4143 are n-antiperiodic, and one obtains (i) If (c 1 , . . . , c n ) is a positive solution of M (c 1 , . . . , c n ) = -Id, then the sequence (4.2) is an n-cycle in the Farey graph. (ii) If (c 1 , . . . , c n ) is a totally positive solution, then the sequence (4.2) is a Farey n-gon.

29 ,

 29 Proposition 2.2.1]. Corollary 4.4. Totally positive solutions of the equation M (c 1 , . . . , c n ) = -Id are in one-to-one correspondence with Farey n-gons.

Proposition 4 . 6 .

 46 Every Farey n-gon is triangulated in the Farey tessellation. In other words, the full subgraph of the Farey graph, containing the vertices of a Farey n-gon forms a triangulation of the n-gon. Example 4.2 gives an illustration of this statement. Therefore from a totally positive solution of M (c 1 , . . . , c n ) = -Id, one obtains two triangulations: one given by Conway and Coxeter's correspondence (see Theorem 3.3, Part (ii)), and the other one given by Farey n-gons, see Corollary 4.4.

Theorem 4 . 7 (

 47 [START_REF] Morier-Genoud | SL 2 (Z)-tilings of the torus, Coxeter-Conway friezes and Farey triangulations[END_REF], Theorem 1). The Conway and Coxeter triangulation coincides with the Farey triangulation.

Example 4 . 8 .

 48 Applying the above rule for the rational labelling on the hexadecagon of Example 3the Farey hexadecagon of Example 4.2. Note that the triangulation induced from the Farey tessellation coincides with the initial triangulation in Example 3.4. Consider a cyclic permutation of (c 1 , . . . , c n ). This gives another solution of M (c 1 , . . . , c n ) = -Id. Clearly the corresponding triangulations given by Theorem 3.3, Part (ii) are related by a cyclic permutation of the vertices, i.e. a rotation. Proposition 4.9. The Farey n-gons corresponding to a cyclic permutation of (c 1 , . . . , c n ) are related by a cyclic permutation modulo the action of SL(2, Z) by linear-fractional transformations. This statement is proved in [29, Proposition 2.2.1].

Example 4 .

 4 12. a) A Farey n-gon itself is an n-antiperiodic positive walk. The antiperiodicity is due to the fact that after arrival at rn sn = 0 1 , one has to continue with -1 0 in order to keep r n s n+1 -s n r n+1 = 1. Let us give simple concrete examples of positive walks. b) Consider the Farey quadrilateral 1

Theorem 4 .

 4 13. (i) Every N -(anti)periodic positive walk on a Farey n-gon corresponds to a solution of the equation M (c 1 , . . . , c N ) = ±Id. (ii) Conversely, every solution of M (c 1 , . . . , c N ) = ±Id can be obtained from an N -(anti)periodic walk on Farey n-gons with n ≤ N . Proof. Part (i). Consider an N -(anti)periodic positive walk ri si 1≤i≤N

1 sj- 1

 11 rj sj ) is connected by an edge in the Farey graph. Suppose that ri si and rj sj are not connected. Assume that ri si < rj sj . Then either ri+1 si+1 > rj sj , or ri-1 si-1 > rj sj , and both of these points must be connected to ri si . Similarly, either rj+1 < ri sj , or rj-< ri si , and both of these points must be connected to rj sj . This means that there are crossing edges (geodesics in the Farey tessellation), which is a contradiction. Theorem 4.13 establishes a one-to-one correspondence between positive N -(anti)periodic walks on the Farey tessellation and solutions of M (c 1 , . . . , c N ) = ±Id. Theorem 4.13 together with Theorem 3.7 then imply the following. Corollary 4.14. The sequence (c 1 , . . . , c N ) corresponding to an N -(anti)periodic positive walk is a quiddity of a 3d-dissection of an N -gon.Example 4.15. Let us continue Example 4.12.

5. 5 .

 5 Traces and Pfaffians. Let us give one more determinant formula. We are interested in calculating the trace of the matrix M (c 1 , . . . , c n ). It follows from (5.5) that this trace is equal to the difference of two continuants: tr(M (c 1 , . . . , c n )) = K n (c 1 , . . . , c n ) -K n-2 (c 2 , . . . , c n-1 ).

6. 1 .

 1 Parametrizing the conjugacy classes in PSL(2, Z). Let us outline the history of the problem discussed in this section. The matrices M (c 1 , . . . , c k ), with c i ≥ 2 for every i, were used to parametrize conjugacy classes of hyperbolic elements of PSL(2, Z) (recall that A ∈ PSL(2, Z) is hyperbolic if |tr A| ≥ 3).

Example 6 . 2 .3 1 , 2 .

 6212 Consider the matrix A = 10 3 whose attractive fixed point is x + = 3+ √ 13 It's continued fraction expansion reads x + = [3, 3] = 4, 2, 2, 5 . According to Proposition 6.1, the matrix A must be conjugate to M (2, 2, 5) = 13 -3 9 -2 , and, indeed, one checks that A = M (4) M (2, 2, 5) M (4) -1 .

Theorem 6 . 3 .Proposition 6 . 4 .

 6364 (i) The presentation A = M (c 1 , . . . , c k ) with positive integer coefficients c i is unique, provided k is the smallest possible. (ii) If A = a -b c -d where a, b, c, d > 0 and a > b, then the coefficients (c 1 , . . . , c k ) are those of the continued fraction a c = c 1 , . . . , c k . We also have the following "minimality criterion". If an element A of PSL(2, Z) is written in the form A = M (c 1 , . . . , c k ), then this is the minimal presentation of A, if and only if c i ≥ 2, except perhaps for the ends of the sequence, i.e., for c 1 , or c 1 , c 2 and c k , or c k-1 , c k . Before giving the proof of Theorem 6.3 and Proposition 6.4, let us consider several examples and corollaries. Part (ii) of Theorem 6.3 covers all different cases of elements of PSL(2, Z), modulo multiplication by R and S from the right and from the left. For instance, the following statement treats the case of all matrices with positive coefficients. Corollary 6.5. Let A = a b c d be an element of PSL(2, Z) with a, b, c, d > 0, one has the following two cases: (i) if a > b, then the minimal presentation of A is (6.1) A = M (c 1 , . . . , c k , 2, 1, 1), where a c = c 1 , . . . , c k ; and the conjugacy class of A is parametrized by (

Corollary 6 . 7 .

 67 Let A = a b c d be an element of PSL(2, Z) with a, b, c, d > 0. Its expression in terms of the standard generators is:

3 = [ 4 , 3 ] = 5 , 2 , 2 .

 343522 (a) Consider first the matrix A = 13 -9 3 -2 . It satisfies the condition from Part (ii) of Theorem 6.3, and, indeed, we see that 13 One then checks that A = M (5Corollary 6.5, Part (i). Since 10 3 = [3, 3] = 4, 2, 2 , one easily checks that A = M (4, 2, 2, 2, 1, 1), in accordance with (6.1). (c) The matrix A = 3 10 2 7 is as in Corollary 6.5, Part (ii). Since 10 7 = [1, 2, 2, 1] = 2, 2, 4 , one checks that A = M (2, 2, 5, 1, 1), and the conjugacy class of A is thus parametrized by

. 6 . 3 .( 2 )

 632 Proof of Theorem 6.3 and Proposition 6.4. Theorem 6.3 Part (i). Consider the following two "local surgery" operations.(1) Whenever the n-tuple (c 1 , . . . , c k ) contains a fragment c i , 1 , c i+2 with c i , c i+2 > 1, the following "Conway-Coxeter operation" removes 1 and decreases the two neighboring entries by 1:(6.3) (c 1 , . . . , c i , 1, c i+2 , . . . , c k ) → (c 1 , . . . , c i -1, c i+2 -1, . . . , c k ).Whenever the n-tuple (c 1 , . . . , c k ) contains a fragment c i , 1, 1 , c i+3 (with arbitrary c i , c i+3 ), the following operation reduces k by 3 producing the (k -3)-tuple (6.4) (c 1 , . . . , c i , 1, 1, c i+3 , . . . , c k ) → (c 1 , . . . , c i + c i+3 -1, . . . , c k ).

A

  = M (c 1 , . . . , c k ) = M (c 1 , . . . , c k ), with positive integers c i and minimal k, so that the continued fraction c 1 , . . . , c k = c 1 , . . . , c k is also well defined. Then, without loss of generality, we can assume that c 1 > c 1 . Since, for k ≥ 3, one has c 1 , . . . , c k > c 1 -1 and c 1 , . . . , c k < c 1 , this implies that c 1 , . . . , c k > c 1 , . . . , c k , which contradicts the assumption. Theorem 6.3 Part (ii). The positivity of the coefficients of A and the condition det A = 1 imply that a c < b d . We give a geometric argument using results of Section 1. The rationals a c < b d are linked by an edge in the Farey graph and one has the following two possible local pictures in T a c ∪ T b d . cases split as follows: in the left case a < b whereas in the right case a > b. In the right case b d is the previous convergent in the expansion of a c as negative continued fraction. In other words, if a c = c 1 , . . . , c k then b d = c 1 , . . . , c k-1 ; which gives A = M (c 1 , . . . , c k ) according to Proposition 2.1. Theorem 6.3 is proved.

Figure 2 .Example 6 . 10 .

 2610 Figure 2. The triangulation T A .

6. 5 .

 5 Further examples: Cohn matrices. Let us give more examples of interesting matrices.Example 6.11. (a) Recall that an element A ∈ PSL(2, Z) is called parabolic if tr (A) = 2; a parabolic element is conjugate to R a with a ∈ Z. The parabolic element R a , for a ≥ 0 has the following minimal presentation R a = M (a + 1, 1, 1), while the minimal presentations of L a and R -a are as follows: above equality hold in P SL(2, Z), i.e., the matrix equalities are up to a sign. The elements L a and R -a belong to the same conjugacy class parametrized by (2, 2, . . . , 2). The element R a belongs to a different conjugacy class.(b) The minimal presentation of the continued fraction matrix M + (a 1 , . . . , a 2m ) is given by (2.7).

Acknowledgements. We are grateful to Charles Conley, Vladimir Fock, Sergei Fomin, Alexey Klimenko, and Sergei Tabachnikov for multiple stimulating and enlightening discussions. We are grateful to the referee for a number of helpful remarks and suggestions. This paper was partially supported by the ANR project SC3A, ANR-15-CE40-0004-01.

are enumerated by (n, t), where n ∈ Z and t is a rational 0 ≤ t ≤ 1. The initial triple of Cohn matrices given by

and B(n) := A(n)A(n + 1) corresponds to the Markov triple (1, 5, 2) = 1 3 tr (A), 1 3 tr (AB), 1 3 tr (B) . Other triples of Cohn matrices are given by the products of the matrices from the initial triple, encoded by a tree isomorphic to the Farey (or Stern-Brocot) tree of rationals in [0, 1], starting from the triple (0, 1 2 , 1). The minimal presentation of the initial matrices with n ≥ 2 is

We see that all of these matrices with different n are conjugate to each other, the conjugacy classes of A and B being parametrized by (3) and (4, 2), respectively. 6.6. The 3d-dissection of a matrix. We apply Theorem 6.3 in order to associate a 3d-dissection to every element A ∈ SL(2, Z). Our construction is as follows.

Writing