1 Introduction
Cluster algebras were introduced by Fomin and Zelevinsky in 2002 in [Reference Fomin and ZelevinskyFZ02]. Originally motivated by the study of canonical bases in Lie theory, the theory has seen tremendous development over the last 15 years, and cluster algebras are now connected to various areas of mathematics and physics, including Lie theory, quiver representations, combinatorics, dynamical systems, algebraic geometry, Teichmüller theory, and string theory.
In this paper we add another item to this list by providing a connection between cluster algebras and continued fractions. The method of continued fractions is a classical tool that is of fundamental importance in analysis and number theory, and also appears in many other areas of mathematics, for example in knot theory and hyperbolic geometry.
The connection we are proposing is of a combinatorial nature. The key combinatorial objects are the socalled snake graphs. These graphs appeared naturally in the theory of cluster algebras of surface type in [Reference ProppPro05, Reference Musiker and SchifflerMS10, Reference Musiker, Schiffler and WilliamsMSW11, Reference Musiker, Schiffler and WilliamsMSW13] and were studied in a systematic way in our previous work [Reference Çanakçı and SchifflerCS13, Reference Çanakçı and SchifflerCS15, Reference Çanakçı and SchifflerCS17b]. Each cluster variable in a cluster algebra of surface type is given by a combinatorial formula whose terms are parametrized by the perfect matchings of a snake graph [Reference Musiker, Schiffler and WilliamsMSW11]. A very special type of snake graphs also appears in the book [Reference AignerAig13] in the context of Markov numbers. The snake graphs considered there (as well as those in [Reference ProppPro05]) are those corresponding to cluster variables in the cluster algebra of the once punctured torus.
In the present paper we construct a snake graph ${\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ for every continued fraction $[a_{1},a_{2},\ldots ,a_{n}]$ with $a_{i}\in \mathbb{Z}_{{\geqslant}1}$ . Our first main result is the following combinatorial interpretation of continued fractions as quotients of cardinalities of sets.
Theorem 3.4 . If $m({\mathcal{G}})$ denotes the number of perfect matchings of the graph ${\mathcal{G}}$ then
and the fraction on the righthand side is reduced.
In particular, this theorem implies that the number of terms in the Laurent expansion of cluster variables in cluster algebras of surface type is equal to the numerator of the associated continued fraction.
We then show that our construction actually provides a bijection between snake graphs and finite continued fractions in Theorem 4.1, as well as a bijection between infinite snake graphs and infinite continued fractions in Theorem 4.5. A direct consequence is the following corollary.
Corollary 4.3 . The number of snake graphs that have precisely $N$ perfect matchings is equal to $\unicode[STIX]{x1D719}(N)$ , where $\unicode[STIX]{x1D719}$ is Euler’s totient function.
This relation between snake graphs and continued fractions is useful in both directions. On the one hand, we can use it to interpret results on snake graphs from [Reference Çanakçı and SchifflerCS13] as identities in terms of continued fractions. We present several examples in Theorem 5.2, where we recover the classical identities for the convergents of continued fractions and Euler’s identities for continuants, but we also produce another family of identities that we did not find in the literature on continued fractions.
On the other hand, we can use the machinery of continued fractions in the study of cluster algebras. Let ${\mathcal{A}}$ be a cluster algebra of surface type and initial cluster $(x_{1},x_{2},\ldots ,x_{N})$ . Then the cluster variables $x_{\unicode[STIX]{x1D6FE}}$ of ${\mathcal{A}}$ are in bijection with the arcs $\unicode[STIX]{x1D6FE}$ in the surface [Reference Fomin, Shapiro and ThurstonFST08], and can be computed via the snake graph formula of [Reference Musiker, Schiffler and WilliamsMSW11] mentioned above. The same formula also defines an element $x_{\unicode[STIX]{x1D6FE}}$ for every generalized arc, where generalized arcs differ from arcs by being allowed to have selfcrossings.
Now let $\unicode[STIX]{x1D6FE}$ be a generalized arc with snake graph ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}}={\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ . Then there exists a unique generalized arc $\unicode[STIX]{x1D6FE}^{\prime }$ whose snake graph ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}^{\prime }}$ is the subgraph ${\mathcal{G}}[a_{2},a_{3},\ldots ,a_{n}]$ of ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}}$ . For each $a_{i}$ , we construct a Laurent polynomial $L_{i}$ in the initial cluster variables $x_{1},x_{2},\ldots ,x_{N}$ depending on $\unicode[STIX]{x1D6FE}$ , and we prove the following result.
Theorem 6.3 . For every generalized arc $\unicode[STIX]{x1D6FE}$ , we have the following identity in the field of fractions of the cluster algebra ${\mathcal{A}}$ :
Moreover, $x_{\unicode[STIX]{x1D6FE}}$ and $x_{\unicode[STIX]{x1D6FE}^{\prime }}$ are relatively prime in the ring of Laurent polynomials and thus the lefthand side of the equation is reduced.
In particular, if $\unicode[STIX]{x1D6FE}$ and $\unicode[STIX]{x1D6FE}^{\prime }$ have no selfcrossing then the lefthand side of the equation is a quotient of cluster variables.
This formula is of considerable computational interest, since the $L_{i}$ are given by an explicit formula; see Proposition 6.2.
Theorem 6.3 suggests that one should study the quotients of certain elements of the cluster algebra and their asymptotic behavior. Using techniques from continued fractions, we obtain the following result. In this theorem, we work in the cluster algebra of the once punctured torus for convenience.
Theorem 7.3 . Let ${\mathcal{A}}$ be the cluster algebra of the once punctured torus with initial cluster $\mathbf{x}=(x_{1},x_{2},x_{3})$ . Let $x_{1}^{\prime }=(x_{2}^{2}+x_{3}^{2})/x_{1}$ denote the cluster variable obtained from $\mathbf{x}$ by the single mutation $\unicode[STIX]{x1D707}_{1}$ . Let $u(i)$ denote the cluster variable obtained from $\mathbf{x}$ by the mutation sequence $\unicode[STIX]{x1D707}_{1}\unicode[STIX]{x1D707}_{2}\unicode[STIX]{x1D707}_{1}\unicode[STIX]{x1D707}_{2}\unicode[STIX]{x1D707}_{1}\cdots \,$ of length $i$ and ${\mathcal{G}}$ be its snake graph. Let $v(i)$ be the Laurent polynomial corresponding to the snake graph obtained from ${\mathcal{G}}$ by removing the south edge $e_{0}$ .
(a) The quotient $u(i)/v(i)$ converges as $i$ tends to infinity and its limit is
The quotient of the cluster variables $u(i)/u(i1)$ converges as $i$ tends to infinity and its limit is
(b) Let $z=(x_{1}^{\prime }x_{1})/x_{3}$ . Then $\unicode[STIX]{x1D6FC}$ has the following periodic continued fraction expansion:
Similar formulas hold for other mutation sequences. In particular the analogous results for the annulus with two marked points are obtained by setting $x_{3}=1$ .
The results of this paper have applications in several lines of research which will be studied in future work, including cluster algebras and cluster categories of infinite rank [Reference Holm and JorgensenHJ12, Reference Grabowski and GratzGG14, Reference Liu and PaquetteLP17, Reference Çanakçı and FeliksonCF17], continuous cluster categories [Reference Igusa and TodorovIT15], Euler characteristic of quiver Grassmannians (see Corollary 6.11 for a first result), string modules and string objects in the module categories and cluster categories of triangulated marked surfaces [Reference Brüstle and ZhangBZ11, Reference Qiu and ZhouQZ17, Reference LabardiniFragosoLab16], combinatorial structure of continued fractions, integer sequences, and friezes [Reference CoxeterCox71].
Continued fractions are ubiquitous in mathematics and have also appeared in the context of cluster algebras before, although unrelated to our results. Nakanishi and Stella used them for constructing an initial seed of a cluster algebra in order to prove periodicity in sineGordon $Y$ systems in [Reference Nakanishi and StellaNS16]. Di Francesco and Kedem obtained a very particular kind of (generalized) continued fractions in their computation of generating functions of cluster variables that lie along a specific sequence of mutations in a cluster algebra associated to a Cartan matrix. Their (generalized) continued fractions are of the form $a_{1}+{\textstyle \frac{b_{1}}{a_{2}+{\textstyle \frac{b_{2}}{a_{3}\cdots }}}}$ with numerators $b_{i}\neq 1$ , and the $a_{i}$ depending on the $b_{i}$ . When specializing all $b_{i}=1$ , one obtains continued fractions of the form $[1,1,2,2,\ldots ,2]$ [Reference Di Francesco and KedemDFK10]. Our two approaches have an interesting overlap in the case of the cluster algebra of the Kronecker quiver which arises as a special case in two different ways. For Di Francesco and Kedem it corresponds to the case of the Cartan matrix $(a_{11})=(2)$ of rank 1, and for us to the annulus with two marked points on the boundary. In § 7, we compute examples of the asymptotic behavior of cluster variables for the torus with one puncture, from which the Kronecker case can be obtained by specializing one of the variables to 1. It would be interesting to compare our limit function with the generating function in [Reference Di Francesco and KedemDFK10] in this case.
The paper is organized as follows. In § 2 we recall definitions and facts about snake graphs and continued fractions. The construction of the snake graph ${\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ of a continued fraction $[a_{1},a_{2},\ldots ,a_{n}]$ is given in § 3, and the bijection between snake graphs and continued fractions in § 4. In § 5 we list several identities of continued fractions that follow immediately from the snake graph calculus of [Reference Çanakçı and SchifflerCS13]. The relation to cluster algebras is given in §§ 6 and 7. In particular, the proof of Theorem 6.3 is given in § 6 and Theorem 7.3 in § 7.
2 Preliminaries
2.1 Cluster algebras from surfaces
Cluster algebras were introduced by Fomin and Zelevinsky in [Reference Fomin and ZelevinskyFZ02]. A cluster algebra is a $\mathbb{Z}$ subalgebra of a field of rational functions $\mathbb{Q}(x_{1},\ldots ,x_{N})$ in $N$ variables. The cluster algebra is given by a set of generators, the cluster variables, which is constructed recursively from the initial cluster variables $x_{1},\ldots ,x_{N}$ by a process called mutation. It is known that each cluster variable is a Laurent polynomial in $x_{1},\ldots ,x_{N}$ with integer coefficients [Reference Fomin and ZelevinskyFZ02] and that these coefficients are nonnegative [Reference Lee and SchifflerLS15]. We refer the reader to [Reference Fomin and ZelevinskyFZ07] for the precise definition of cluster algebras.
In this paper, we are mainly interested in the special type of cluster algebras which are associated to marked surfaces; see [Reference Fomin, Shapiro and ThurstonFST08]. Let $S$ be a connected oriented twodimensional Riemann surface with (possibly empty) boundary. Fix a nonempty set $M$ of marked points in the closure of $S$ with at least one marked point on each boundary component. The pair $(S,M)$ is called a bordered surface with marked points. Marked points in the interior of $S$ are called punctures.
An arc $\unicode[STIX]{x1D6FE}$ in $(S,M)$ is a curve in $S$ , considered up to isotopy, such that:

(a) the endpoints of $\unicode[STIX]{x1D6FE}$ are in $M$ ;

(b) $\unicode[STIX]{x1D6FE}$ does not cross itself, except that its endpoints may coincide;

(c) except for the endpoints, $\unicode[STIX]{x1D6FE}$ is disjoint from $M$ and from the boundary of $S$ ;

(d) $\unicode[STIX]{x1D6FE}$ does not cut out an unpunctured monogon or an unpunctured bigon.
A generalized arc is a curve which satisfies conditions (a), (c) and (d), but it can have selfcrossings. Curves that connect two marked points and lie entirely on the boundary of $S$ without passing through a third marked point are called boundary segments. By (c), boundary segments are not arcs.
For any two arcs $\unicode[STIX]{x1D6FE},\unicode[STIX]{x1D6FE}^{\prime }$ in $(S,M)$ , let $e(\unicode[STIX]{x1D6FE},\unicode[STIX]{x1D6FE}^{\prime })$ be the minimal number of crossings of arcs $\unicode[STIX]{x1D6FC}$ and $\unicode[STIX]{x1D6FC}^{\prime }$ , where $\unicode[STIX]{x1D6FC}$ and $\unicode[STIX]{x1D6FC}^{\prime }$ range over all arcs isotopic to $\unicode[STIX]{x1D6FE}$ and $\unicode[STIX]{x1D6FE}^{\prime }$ , respectively. We say that two arcs $\unicode[STIX]{x1D6FE}$ and $\unicode[STIX]{x1D6FE}^{\prime }$ are compatible if $e(\unicode[STIX]{x1D6FE},\unicode[STIX]{x1D6FE}^{\prime })=0$ .
An ideal triangulation is a maximal collection of pairwise compatible arcs (together with all boundary segments). The arcs of a triangulation cut the surface into ideal triangles.
In [Reference Fomin, Shapiro and ThurstonFST08], the authors associated a cluster algebra ${\mathcal{A}}(S,M)$ to any bordered surface with marked points $(S,M)$ , and showed that the clusters of ${\mathcal{A}}(S,M)$ are in bijection with triangulations of $(S,M)$ , and the cluster variables of ${\mathcal{A}}(S,M)$ are in bijection with the (tagged) arcs of $(S,M)$ .
2.2 Snake graphs
Abstract snake graphs have been introduced and studied [Reference Çanakçı and SchifflerCS13, Reference Çanakçı and SchifflerCS15, Reference Çanakçı and SchifflerCS17b] motivated by the snake graphs appearing in the combinatorial formulas for elements in cluster algebras of surface type in [Reference ProppPro05, Reference Musiker and SchifflerMS10, Reference Musiker, Schiffler and WilliamsMSW11, Reference Musiker, Schiffler and WilliamsMSW13]. In this section we recall the main definitions. Throughout we fix the standard orthonormal basis of the plane.
A tile $G$ is a square in the plane whose sides are parallel or orthogonal to the elements in the fixed basis. All tiles considered will have the same side length.
We consider a tile $G$ as a graph with four vertices and four edges in the obvious way. A snake graph ${\mathcal{G}}$ is a connected planar graph consisting of a finite sequence of tiles $G_{1},G_{2},\ldots ,G_{d}$ with $d\geqslant 1,$ such that $G_{i}$ and $G_{i+1}$ share exactly one edge $e_{i}$ and this edge is either the north edge of $G_{i}$ and the south edge of $G_{i+1}$ or the east edge of $G_{i}$ and the west edge of $G_{i+1}$ , for each $i=1,\ldots ,d1$ . An example is given in Figure 1. The graph consisting of two vertices and one edge joining them is also considered a snake graph.
The $d1$ edges $e_{1},e_{2},\ldots ,e_{d1}$ which are contained in two tiles are called interior edges of ${\mathcal{G}}$ and the other edges are called boundary edges. Denote by $\operatorname{Int}({\mathcal{G}})=\{e_{1},e_{2},\ldots ,e_{d1}\}$ the set of interior edges of ${\mathcal{G}}$ . We will always use the natural ordering of the set of interior edges, so that $e_{i}$ is the edge shared by the tiles $G_{i}$ and $G_{i+1}$ .
We denote by $_{\text{SW}}{\mathcal{G}}$ the twoelement set containing the south and the west edge of the first tile of ${\mathcal{G}}$ and by ${\mathcal{G}}^{\text{NE}}$ the twoelement set containing the north and the east edge of the last tile of ${\mathcal{G}}$ . We will sometimes refer to the two edges in $_{\text{SW}}{\mathcal{G}}$ as the south edge of ${\mathcal{G}}$ and the west edge of ${\mathcal{G}}$ , respectively. Similarly, the two edges in ${\mathcal{G}}^{\text{NE}}$ will be called the north edge of ${\mathcal{G}}$ and the east edge of ${\mathcal{G}}$ , respectively. If ${\mathcal{G}}$ is a single edge, we let $_{\text{SW}}{\mathcal{G}}=\emptyset$ and ${\mathcal{G}}^{\text{NE}}=\emptyset$ .
A snake graph ${\mathcal{G}}$ is called straight if all its tiles lie in one column or one row, and a snake graph is called zigzag if no three consecutive tiles are straight. We say that two snake graphs are isomorphic if they are isomorphic as graphs.
A sign function $f$ on a snake graph ${\mathcal{G}}$ is a map $f$ from the set of edges of ${\mathcal{G}}$ to $\{+,\}$ such that on every tile in ${\mathcal{G}}$ the north and the west edge have the same sign, the south and the east edge have the same sign, and the sign on the north edge is opposite to the sign on the south edge. See Figure 1 for an example.
Note that on every snake graph there are exactly two sign functions. A snake graph is determined up to symmetry by its sequence of tiles together with a sign function on its interior edges. If ${\mathcal{H}}$ is a subgraph of ${\mathcal{G}}$ , we write ${\mathcal{G}}\setminus {\mathcal{H}}$ for the full subgraph of ${\mathcal{G}}$ whose vertices are in ${\mathcal{G}}\setminus {\mathcal{H}}$ . For example, if ${\mathcal{G}}$ is the snake graph of eight tiles in Figure 1 then ${\mathcal{G}}\setminus G_{8}$ is the snake graph consisting of the first six tiles.
2.2.1 Infinite snake graphs
We define infinite snake graphs ${\mathcal{G}}$ analogously using an infinite sequence of tiles $(G_{1},G_{2},\ldots )$ . If ${\mathcal{G}}$ is an infinite snake graph then $_{\text{SW}}{\mathcal{G}}$ is defined as above, but ${\mathcal{G}}^{\text{NE}}$ does not exist.
2.3 Labeled snake graphs from surfaces
In this subsection we recall the definition of snake graphs of [Reference Musiker, Schiffler and WilliamsMSW11]. We follow the exposition in [Reference Schiffler, Assem and TrepodeSch16].
Let $T$ be an ideal triangulation of a surface $(S,M)$ and let $\unicode[STIX]{x1D6FE}$ be an arc in $(S,M)$ which is not in $T$ . Choose an orientation on $\unicode[STIX]{x1D6FE}$ , let $s\in M$ be its starting point, and let $t\in M$ be its endpoint. Denote by
the points of intersection of $\unicode[STIX]{x1D6FE}$ and $T$ in order. For $j=1,2,\ldots ,d$ , let $\unicode[STIX]{x1D70F}_{i_{j}}$ be the arc of $T$ containing $p_{j}$ , and let $\unicode[STIX]{x1D6E5}_{j1}$ and $\unicode[STIX]{x1D6E5}_{j}$ be the two ideal triangles in $T$ on either side of $\unicode[STIX]{x1D70F}_{i_{j}}$ . Then, for $j=1,\ldots ,d1,$ the arcs $\unicode[STIX]{x1D70F}_{i_{j}}$ and $\unicode[STIX]{x1D70F}_{i_{j+1}}$ form two sides of the triangle $\unicode[STIX]{x1D6E5}_{j}$ in $T$ and we define $e_{j}$ to be the third arc in this triangle; see Figure 2.
Let $G_{j}$ be the quadrilateral in $T$ that contains $\unicode[STIX]{x1D70F}_{i_{j}}$ as a diagonal. We will think of $G_{j}$ as a tile as in § 2.2, but now the edges of the tile are arcs in $T$ and thus are labeled edges. We also think of the tile $G_{j}$ itself being labeled by the diagonal $\unicode[STIX]{x1D70F}_{i_{j}}$ .
Define a sign function $f$ on the edges $e_{1},\ldots ,e_{d}$ by
The labeled snake graph ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}}=(G_{1},\ldots ,G_{d})$ with tiles $G_{i}$ and sign function $f$ is called the snake graph associated to the arc $\unicode[STIX]{x1D6FE}$ . Each edge $e$ of ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}}$ is labeled by an arc $\unicode[STIX]{x1D70F}(e)$ of the triangulation $T$ . We define the weight $x(e)$ of the edge $e$ to be the cluster variable associated to the arc $\unicode[STIX]{x1D70F}(e)$ . Thus $x(e)=x_{\unicode[STIX]{x1D70F}(e)}$ .
The main result of [Reference Musiker, Schiffler and WilliamsMSW11] is a combinatorial formula for the cluster variables in ${\mathcal{A}}(S,M)$ . Let $\unicode[STIX]{x1D6FE}$ be an arc and $x_{\unicode[STIX]{x1D6FE}}$ the corresponding cluster variable. A perfect matching $P$ of ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}}$ is a subset of the set of edges of ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}}$ such that each vertex of ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}}$ is incident to exactly one edge in $P$ . Then, if the triangulation has no selffolded triangles, we have
where the sum runs over all perfect matchings of ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}}$ , the summand $x(P)=\prod _{e\in P}x(e)$ is the weight of the perfect matching $P$ , and $\operatorname{cross}({\mathcal{G}})=\prod _{j=1}^{d}x_{i_{j}}$ is the product (with multiplicities) of all initial cluster variables whose arcs are crossed by $\unicode[STIX]{x1D6FE}$ . In the presence of selffolded triangles, the combinatorial formula in [Reference Musiker, Schiffler and WilliamsMSW11] is slightly more complicated.
2.4 Continued fractions
Continued fractions are remarkably influential in many areas of mathematics. For a standard introduction, we refer to [Reference Hardy and WrightHW60, ch. 10]. For a more extensive treatment of continued fractions, see [Reference PerronPer50].
A finite continued fraction is a function
of $n$ variables $a_{1},a_{2},\ldots ,a_{n}$ . Similarly, an infinite continued fraction is a function
of infinitely many variables $a_{1},a_{2},\ldots$ We use the notation $[\overline{a}]$ for the periodic continued fraction $[\overline{a}]=[a,a,a,\ldots ]$ , where $a_{i}=a$ , for all $i$ . Note that
In §§3–5 of this paper we are interested in finite continued fractions where each $a_{i}$ is an integer. However, in §6, we consider finite continued fractions of Laurent polynomials as well as finite continued fractions of complex numbers, and in § 7, infinite continued fractions of Laurent polynomials.
We say that a continued fraction $[a_{1},a_{2},\ldots ,a_{n}]$ is positive if each $a_{i}\in \mathbb{Z}_{{\geqslant}1}$ . We say that a continued fraction $[a_{0},a_{1},\ldots ,a_{n}]$ is simple if $a_{0}\in \mathbb{Z}$ and $a_{i}\in \mathbb{Z}_{{\geqslant}1}$ , for each $i\geqslant 1$ .
Note that if $[a_{1},a_{2},\ldots ,a_{n}]$ is a simple continued fraction with $a_{n}=1$ , then $[a_{1},a_{2},\ldots ,a_{n}]=[a_{1},a_{2},\ldots ,a_{n1}+1]$ . Thus it suffices to consider continued fractions whose last coefficient is at least 2. The following classical result shows that this is the only ambiguity for finite continued fractions.
Proposition 2.1 [Reference Hardy and WrightHW60, Theorem 162].

(a) There is a bijection between $\mathbb{Q}_{{>}1}$ and the set of finite positive continued fractions whose last coefficient is at least 2.

(b) There is a bijection between $\mathbb{Q}$ and the set of finite simple continued fractions whose last coefficient is at least 2.
Example 2.2. We have $[2,3,4]=2+{\textstyle \frac{1}{3+1/4}}=2+{\textstyle \frac{4}{13}}={\textstyle \frac{30}{13}}$ .
We shall need the following general fact about continued fractions.
Lemma 2.3. $[ra_{1},r^{1}a_{2},ra_{3},\ldots ,r^{(1)^{n+1}}a_{n}]=r\,[a_{1},a_{2},\ldots ,a_{n}]$ .
Proof. If $n=1$ , both sides of the equation are equal to $ra_{1}$ . Suppose $n>1$ . Then
Example 2.4. We have $[2,3,4]={\textstyle \frac{30}{13}}$ , and $[2\cdot 13,{\textstyle \frac{3}{13}},4\cdot 13]=30$ .
For infinite continued fractions we have the following classical result.
Proposition 2.5 [Reference Hardy and WrightHW60, Theorem 170].

(a) There is a bijection between $\mathbb{R}_{{>}1}\setminus \mathbb{Q}_{{>}1}$ and the set of infinite positive continued fractions.

(b) There is a bijection between $\mathbb{R}\setminus \mathbb{Q}$ and the set of infinite simple continued fractions.
3 The snake graph of a continued fraction
We have seen in § 2.2 that snake graphs appear naturally in the theory of cluster algebras from surfaces, where they are used to compute the Laurent expansions of the cluster variables. The terms in the Laurent polynomial of a cluster variable are parametrized by the perfect matchings of the associated snake graph.
In this section we present a new connection between snake graphs and continued fractions. For every positive continued fraction $[a_{1},a_{2},\ldots ,a_{n}]$ , we construct a snake graph ${\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ in such a way that the number of perfect matchings of the snake graph is equal to the numerator of the continued fraction.
Recall that a snake graph ${\mathcal{G}}$ is determined by a sequence of tiles $G_{1},\ldots ,G_{d}$ and a sign function $f$ on the interior edges $\operatorname{Int}{\mathcal{G}}$ of ${\mathcal{G}}$ . As usual, we denote the interior edges by $e_{1},\ldots ,e_{d1}$ . Denote by $e_{0}\in _{\text{SW}}{\mathcal{G}}$ the south edge of ${\mathcal{G}}$ and choose an edge $e_{d}\in {\mathcal{G}}^{\text{NE}}$ . The sign function can be extended in a unique way to all edges of ${\mathcal{G}}$ . In particular, we obtain a sign sequence
This sequence uniquely determines the snake graph and a choice of a northeast edge $e_{d}\in {\mathcal{G}}^{\text{NE}}$ .
Now let $[a_{1},a_{2},\ldots ,a_{n}]$ be a positive continued fraction, and let $d=a_{1}+a_{2}+\cdots +a_{n}1$ . Consider the sign sequence
where
We define
Thus each integer $a_{i}$ corresponds to a maximal subsequence of constant sign $\operatorname{sgn}(a_{i})$ in the sequence (3.2).
We let $\ell _{i}$ denote the position of the last term in the $i$ th subsequence, thus $\ell _{i}=\sum _{j=1}^{i}a_{j}.$
Definition 3.1. The snake graph ${\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ of the positive continued fraction $[a_{1},a_{2},\ldots ,a_{n}]$ is the snake graph with $d$ tiles determined by the sign sequence (3.2).
An example is given in Figure 3. In the special case where $n=1$ and $a_{1}=1$ , this definition means that ${\mathcal{G}}[1]$ is a single edge.
Let $f:\{e_{0},e_{1},\ldots ,e_{d}\}\rightarrow \{\pm \}$ denote the sign function of ${\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ induced by the sign sequence.
Lemma 3.2. For each $i=1,2,\ldots ,n1$ , the subsnake graph of ${\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ consisting of the three consecutive tiles $(G_{\ell _{i}1},G_{\ell _{i}},G_{\ell _{i}+1})$ is straight.
Proof. This follows immediately from the construction, since $f(e_{\ell 1})\neq f(e_{\ell })$ .◻
Next we define zigzag subsnake graphs ${\mathcal{H}}_{1},\ldots ,{\mathcal{H}}_{n}$ of ${\mathcal{G}}={\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ as follows. Let
where $(G_{j},\ldots ,G_{k})$ is the subsnake graph of ${\mathcal{G}}$ consisting of the tiles $G_{j},G_{j+1},\ldots ,G_{k}$ , if $j\leqslant k$ , and $(G_{j+1},\ldots ,G_{j})$ is the single edge $e_{j}$ ; see Figure 3 for an example.
Lemma 3.3. For each $i=1,2,\ldots ,n$ , the graph ${\mathcal{H}}_{i}$ is a zigzag snake graph with $a_{i}1$ tiles. In particular, ${\mathcal{H}}_{i}\cong {\mathcal{G}}[a_{i}]$ is the snake graph of the continued fraction $[a_{i}]$ with a single coefficient $a_{i}$ .
Proof. By construction, the interior edges of ${\mathcal{H}}_{i}$ all have the same sign $\operatorname{sgn}(a_{i})$ , and ${\mathcal{H}}_{i}$ has $a_{i}1$ tiles. This implies that ${\mathcal{H}}_{i}\cong {\mathcal{G}}[a_{i}]$ and that it is a zigzag snake graph.◻
We are now ready for the main result of this section.
Theorem 3.4.

(a) The number of perfect matchings of ${\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ is equal to the numerator of the continued fraction $[a_{1},a_{2},\ldots ,a_{n}]$ .

(b) The number of perfect matchings of ${\mathcal{G}}[a_{2},a_{3},\ldots ,a_{n}]$ is equal to the denominator of the continued fraction $[a_{1},a_{2},\ldots ,a_{n}]$ .

(c) If $m({\mathcal{G}})$ denotes the number of perfect matchings of ${\mathcal{G}}$ then
$$\begin{eqnarray}[a_{1},a_{2},\ldots ,a_{n}]=\frac{m({\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}])}{m({\mathcal{G}}[a_{2},\ldots ,a_{n}])}.\end{eqnarray}$$
Proof. (a) If $n=1$ , then ${\mathcal{G}}[a_{1}]$ is a zigzag snake graph with $a_{1}1$ tiles. If $a_{1}=1$ , this graph is a single edge and it has exactly one perfect matching. If $a_{1}>1$ , then there is exactly one perfect matching of ${\mathcal{G}}[a_{1}]$ that contains the edge $e_{0}$ . On the other hand, if a perfect matching does not contain $e_{0}$ , then it must contain the other edge $b_{0}$ in $_{\text{SW}}{\mathcal{G}}[a_{1}]$ and it must be a perfect matching on the remaining part which is a zigzag snake graph with $a_{1}2$ tiles. By induction this gives a total of $a_{1}$ perfect matchings.
Now suppose that $n>1$ , and let $P$ be a perfect matching of the snake graph ${\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ . We will denote by ${\mathcal{N}}[a_{1},a_{2},\ldots ,a_{n}]$ the numerator of the continued fraction $[a_{1},a_{2},\ldots ,a_{n}]$ . By Lemma 3.2, the tiles $G_{\ell _{1}1},G_{\ell _{1}}$ and $G_{\ell _{1}+1}$ form a straight subsnake graph of ${\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ . If $P$ does not contain the two boundary edges of $G_{\ell _{1}}$ then the restrictions of $P$ to ${\mathcal{H}}_{1}\cong {\mathcal{G}}[a_{1}]$ and ${\mathcal{G}}\setminus {\mathcal{H}}_{1}\cong {\mathcal{G}}[a_{2},a_{3},\ldots ,a_{n}]$ are perfect matchings of these subgraphs. By induction this gives $a_{1}+{\mathcal{N}}[a_{2},a_{3},\ldots ,a_{n}]$ perfect matchings. On the other hand, if $P$ contains the boundary edges of $G_{\ell _{1}}$ then, since ${\mathcal{H}}_{1}$ and ${\mathcal{H}}_{2}$ are zigzag snake graphs, the restriction of $P$ to ${\mathcal{H}}_{1}$ and ${\mathcal{H}}_{2}$ consists of boundary edges only, and there is a unique such matching on ${\mathcal{H}}_{1}$ and on ${\mathcal{H}}_{2}$ . Moreover, the restriction of $P$ to ${\mathcal{G}}[a_{3},a_{4},\ldots ,a_{n}]$ is a perfect matching of that subgraph. By induction, this gives ${\mathcal{N}}[a_{3},a_{4},\ldots ,a_{n}]$ perfect matchings. Putting these two cases together, we get a total of
perfect matchings.
For the remainder of this proof, denote by $N$ and $D$ the numerator and the denominator of the continued fraction $[a_{3},\ldots ,a_{n}]$ . Thus $[a_{3},\ldots ,a_{n}]=N/D$ and $N,D$ are relatively prime. Then
Note that this fraction is reduced, because $N$ and $D$ are relatively prime. Thus
Furthermore, from the identity
we see that ${\mathcal{N}}[a_{2},\ldots ,a_{n}]=a_{2}N+D$ , and hence (3.4) implies that
This completes the proof of (a).
Statement (b) follows directly from (a) because the denominator of $[a_{1},a_{2},\ldots ,a_{n}]$ is equal to the numerator of $[a_{2},\ldots ,a_{n}]$ , and (c) is obtained by combining (a) and (b).◻
Example 3.5. For $[a_{1},a_{2},\ldots ,a_{n}]=[1,1,\ldots ,1]$ , the snake graph ${\mathcal{G}}={\mathcal{G}}[1,1,\ldots ,1]$ is the straight snake graph with $n1$ tiles and its number of perfect matchings is the ( $n+1$ )st Fibonacci number. The first few values are given in the table below.
Example 3.6. For $[a_{1},a_{2},\ldots ,a_{n}]=[2,2,\ldots ,2]$ , the snake graph ${\mathcal{G}}={\mathcal{G}}[2,2,\ldots ,2]$ has a staircase shape where each horizontal and each vertical segment has exactly three tiles, and in total there are $n1$ segments. The number of perfect matchings of ${\mathcal{G}}$ is the ( $n+1$ )st Pell number. The first few values are given in the table below.
Remark 3.7. The relation between cluster algebras and continued fractions established in Theorem 3.4 has interesting implications on several levels. On the one hand, it allows us to use the machinery of continued fractions in the theory of cluster algebras to gain a better understanding of the elements of the cluster algebra and think of them in a new way. This aspect is explored in the current paper.
On the other hand, Theorem 3.4 provides a new combinatorial model for continued fractions which allows us to interpret the numerators and denominators of positive continued fractions as cardinalities of combinatorially defined sets. This interpretation is useful in the understanding of continued fractions. A simple example is that the continued fractions $[a_{1},a_{2},\ldots ,a_{n}]$ and $[a_{n},\ldots ,a_{2},a_{1}]$ have the same numerator; this is a fact which is well known, though not obvious in the theory of continued fractions, but which becomes trivial using Theorem 3.4, because ${\mathcal{G}}[a_{n},\ldots ,a_{2},a_{1}]$ is obtained from ${\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ by a rotation about 180 $^{\circ }$ or by a reflection at the line $y=x$ , depending on the position, north or east, of the side $e_{d}$ .
Moreover, the snake graph calculus of [Reference Çanakçı and SchifflerCS13, Reference Çanakçı and SchifflerCS15, Reference Çanakçı and SchifflerCS17b] has produced a large number of identities of snake graphs which now can be translated to identities of (complex) continued fractions. In this way, we recover most of the classical identities involving convergents of the continued fractions, and also obtain seemingly new identities. We give three examples in § 5, and we will publish further results in this direction in a forthcoming paper [Reference Çanakçı and SchifflerCS17a].
Remark 3.8. A special kind of snake graph plays a central role in Aigner’s book on Markov numbers [Reference AignerAig13]. He uses the term ‘snake graph’ in the same way as Propp in [Reference ProppPro05]. We follow the more general definition of snake graphs of [Reference Musiker, Schiffler and WilliamsMSW11]. Our snake graphs correspond to cluster variables of cluster algebras from arbitrary surfaces, whereas the ones in [Reference AignerAig13, Reference ProppPro05] correspond to the special case of the cluster algebra of the torus with one puncture. In terms of continued fractions, the snake graphs in [Reference AignerAig13, Reference ProppPro05] have very special continued fractions, with coefficients in $\{1,2\}$ and strong symmetry conditions, and whose numerators are equal to Markov numbers. On the other hand, our snake graphs realize all positive continued fractions and the values realize all rational numbers greater than 1.
4 The set of all abstract snake graphs
Definition 3.1 can be thought of as a map from the set of positive continued fractions to the set of snake graphs. On the other hand, the sign sequence (3.1) can be thought of as a map from snake graphs to positive continued fractions. Modulo a choice of an edge $e_{d}$ in the northeast of the snake graph, it turns out that these maps are bijections. We have the following theorem.
Theorem 4.1. There is a commutative diagram
where the maps are defined as follows:

– $\mathsf{F}$ maps the pair $({\mathcal{G}},e_{d})$ to the continued fraction defined by the sign sequence
$$\begin{eqnarray}(f(e_{0}),f(e_{1}),\ldots ,f(e_{d1}),f(e_{d}));\end{eqnarray}$$ 
– $\mathsf{F}^{\prime }$ maps the snake graph ${\mathcal{G}}$ to the continued fraction defined by the sign sequence
$$\begin{eqnarray}(f(e_{0}),f(e_{1}),\ldots ,f(e_{d1}),f(e_{d1}))\end{eqnarray}$$taking the sign of the edge $e_{d1}$ twice; 
– $\mathsf{G}$ sends the continued fraction $[a_{1},a_{2},\ldots ,a_{n}]$ to the pair consisting of the snake graph ${\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ and an edge $e_{d}$ determined by the sign sequence (3.2);

– $g$ is defined by
$$\begin{eqnarray}g([a_{1},a_{2},\ldots ,a_{n1},a_{n}])=\left\{\begin{array}{@{}ll@{}}\,[a_{1},a_{2},\ldots ,a_{n1}+1] & \text{if }a_{n}=1,\\ \,[a_{1},a_{2},\ldots ,a_{n1},a_{n}] & \text{if }a_{n}>1,\end{array}\right.\end{eqnarray}$$ 
– $\unicode[STIX]{x1D712}$ maps the snake graph ${\mathcal{G}}$ to the quotient $m({\mathcal{G}})/m({\mathcal{G}}\setminus {\mathcal{H}}_{1})$ ; and

– $Ev$ is the bijection from Proposition 2.1 sending the continued fraction to its value.
Moreover the maps $\mathsf{F},\mathsf{G},\mathsf{F}^{\prime },\unicode[STIX]{x1D712}$ and $Ev$ are bijections.
Remark 4.2. We need to exclude the continued fraction $[1]$ in the statement of the theorem, because the map $g$ is not defined on it. Of course, it corresponds to the unique snake graph with zero tiles, the singleedge snake graph.
Proof. Note first that all maps are well defined, since the continued fraction $[1]$ is excluded.
To show that the diagram commutes, suppose first that $f(e_{d})=f(e_{d1})$ . Then $\mathsf{F}({\mathcal{G}},e_{d})=\mathsf{F}^{\prime }({\mathcal{G}})$ . Moreover, if $[a_{1},a_{2},\ldots ,a_{n}]=\mathsf{F}({\mathcal{G}},e_{d})$ then $a_{n}>1$ and thus $g(\mathsf{F}({\mathcal{G}},e_{d}))=\mathsf{F}^{\prime }({\mathcal{G}})$ . Now suppose that $f(e_{d})=f(e_{d1})$ , and let $[a_{1},a_{2},\ldots ,a_{n}]=\mathsf{F}({\mathcal{G}},e_{d})$ . Then $a_{n}=1$ and thus $g({\mathcal{F}}({\mathcal{G}},e_{d}))=[a_{1},a_{2},\ldots ,a_{n1}+1]$ , and this is also equal to $\mathsf{F}^{\prime }({\mathcal{G}})$ . The lower triangle commutes by Theorem 3.4.
Next, we show that $\mathsf{F}$ and $\mathsf{G}$ are bijections. Let ${\mathcal{G}}$ be a snake graph with $d$ tiles, $e_{d}\in {\mathcal{G}}^{\text{NE}}$ , and $f$ a sign function on ${\mathcal{G}}$ . Then $\mathsf{F}({\mathcal{G}},e_{d})$ is the continued fraction $[a_{1},a_{2},\ldots ,a_{n}]$ defined by the sign sequence
where $e_{1},\ldots ,e_{d1}$ are the interior edges of ${\mathcal{G}}$ and $e_{0}$ is the south edge of ${\mathcal{G}}$ . The map $\mathsf{G}$ sends this continued fraction to the pair $({\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}],e_{d}^{\prime })$ , where ${\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]={\mathcal{G}}$ by construction, and $e_{d}^{\prime }\in {\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]^{\text{NE}}$ is the unique edge such that $f(e_{d}^{\prime })=f(e_{d})$ ; thus $e_{d}^{\prime }=e_{d}$ . This shows that $\mathsf{G}\circ \mathsf{F}$ is the identity. Conversely, let $[a_{1},a_{2},\ldots ,a_{n}]$ be a positive continued fraction. Then $\mathsf{G}([a_{1},a_{2},\ldots ,a_{n}])=({\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}],e_{d})$ , where $e_{d}$ is determined by the sign sequence (3.2). Applying $\mathsf{F}$ to this pair yields the continued fraction determined by the same sign sequence. Thus $\mathsf{F}\circ \mathsf{G}$ is the identity.
To show that $\mathsf{F}^{\prime }$ is a bijection, let $[a_{1},a_{2},\ldots ,a_{n}]$ be a positive continued fraction with $a_{n}>1$ . Applying the map $\mathsf{G}$ yields a pair $({\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}],e_{d})$ , where $e_{d}\in {\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]^{\text{NE}}$ is the unique edge whose sign is equal to the sign of the last interior edge $e_{d1}$ , because $a_{n}>1$ . Thus $f(e_{d})=f(e_{d1})=\operatorname{sgn}(a_{n})$ . Forgetting the edge $e_{d}$ and applying the map $\mathsf{F}^{\prime }$ will produce the continued fraction given by the sign sequence
and since $f(e_{d1})=f(e_{d})$ , this continued fraction is $[a_{1},a_{2},\ldots ,a_{n}]$ . This shows that $\mathsf{F}^{\prime }$ is surjective. Now assume that there are two snake graphs ${\mathcal{G}},{\mathcal{G}}^{\prime }$ , with respective sign functions $f,f^{\prime }$ such that $\mathsf{F}^{\prime }({\mathcal{G}})=\mathsf{F}^{\prime }({\mathcal{G}}^{\prime })=[a_{1},a_{2},\ldots ,a_{n}]$ . Then the sign sequences of ${\mathcal{G}}$ and ${\mathcal{G}}^{\prime }$ have the same length $d+1=\sum a_{j}$ , and either $f(e_{i})=f^{\prime }(e_{i}^{\prime })$ for each $i=1,2,\ldots ,d$ , or $f(e_{i})=f^{\prime }(e_{i}^{\prime })$ for each $i=1,2,\ldots ,d$ . Since $e_{0}$ (respectively, $e_{0}^{\prime }$ ) is the south edge of ${\mathcal{G}}$ (respectively, ${\mathcal{G}}^{\prime }$ ), this implies that ${\mathcal{G}}={\mathcal{G}}^{\prime }$ . Thus $\mathsf{F}^{\prime }$ is a bijection.
The map $Ev$ is a bijection by Proposition 2.1, and therefore the map $\unicode[STIX]{x1D712}$ is a bijection by commutativity of the diagram.◻
For an example, see Figure 4.
Corollary 4.3. For every integer $N\geqslant 1$ , the number of snake graphs ${\mathcal{G}}$ with exactly $N$ perfect matchings is equal to the Euler totient function $\unicode[STIX]{x1D719}(N)$ .
Proof. The snake graph consisting of a single edge has $1=\unicode[STIX]{x1D719}(1)$ perfect matching. For $N\geqslant 2$ , the map $\unicode[STIX]{x1D712}$ of the theorem induces a bijection
and the set on the righthand side has cardinality $\unicode[STIX]{x1D719}(N)$ .◻
Example 4.4. The 10 snake graphs with 11 perfect matchings are shown in Figure 5 together with their rational numbers. The corresponding continued fractions are as follows:
We also have the following analogue of Theorem 4.1 for infinite snake graphs.
Theorem 4.5. There is a commutative diagram
where the maps are defined as follows:

– $\mathsf{F}$ maps the snake graph ${\mathcal{G}}$ to the continued fraction defined by the infinite sign sequence
$$\begin{eqnarray}(f(e_{0}),f(e_{1}),f(e_{2}),\ldots );\end{eqnarray}$$ 
– $\unicode[STIX]{x1D712}$ maps the snake graph ${\mathcal{G}}$ to the limit
$$\begin{eqnarray}\lim _{n\rightarrow \infty }\frac{m({\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}])}{m({\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]\setminus {\mathcal{H}}_{1})};\end{eqnarray}$$ 
– $Ev$ is the bijection from Proposition 2.5 sending the continued fraction to its value.
Moreover, the maps $\mathsf{F},\unicode[STIX]{x1D712}$ and $Ev$ are bijections.
5 Three formulas for continued fractions
In this section, we give three examples of formulas that follow directly from our earlier work on snake graph calculus. We restrict ourselves here to the three cases that are easiest to state in terms of continued fractions. However, the results in [Reference Çanakçı and SchifflerCS13, Reference Çanakçı and SchifflerCS15] yield several other formulas, which will be given in a forthcoming paper.
In what follows, the identities of snake graphs are identities in the snake ring introduced in [Reference Çanakçı and SchifflerCS17b]. Equivalently, one can think of these identities as canonical bijections between the sets of perfect matchings of the snake graphs involved, where multiplication is to be replaced by disjoint union of graphs and addition by union of sets of perfect matchings. For example, an identity of the form ${\mathcal{G}}_{1}{\mathcal{G}}_{2}={\mathcal{G}}_{3}{\mathcal{G}}_{4}+{\mathcal{G}}_{5}{\mathcal{G}}_{6}$ means that there is a bijection between $\operatorname{Match}({\mathcal{G}}_{1}\sqcup {\mathcal{G}}_{2})$ and $\operatorname{Match}({\mathcal{G}}_{3}\sqcup {\mathcal{G}}_{4})\cup \operatorname{Match}({\mathcal{G}}_{5}\sqcup {\mathcal{G}}_{6})$ , where $\operatorname{Match}({\mathcal{G}})$ denotes the set of perfect matchings of ${\mathcal{G}}$ .
We keep the notation of § 3. Let $b_{i}$ be the single edge corresponding to the tile $G_{\ell _{i}}$ in ${\mathcal{G}}={\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ , and let $b_{0}$ be the unique edge in $_{\text{SW}}{\mathcal{G}}\setminus \{e_{0}\}$ and $b_{n}$ the unique edge in ${\mathcal{G}}^{\text{NE}}\setminus \{e_{d}\}$ .
Theorem 5.1. We have the following identities of snake graphs, where we set ${\mathcal{G}}[a_{1},\ldots ,a_{0}]=b_{0}$ and ${\mathcal{G}}[a_{n+1},\ldots ,a_{n}]=b_{n}$ .

(a) For every $i=1,2,\ldots ,n$ ,
$$\begin{eqnarray}b_{i}\,{\mathcal{G}}[a_{1},\ldots ,a_{n}]={\mathcal{G}}[a_{1},\ldots ,a_{i}]\,{\mathcal{G}}[a_{i+1},\ldots ,a_{n}]+{\mathcal{G}}[a_{1},\ldots ,a_{i1}]\,{\mathcal{G}}[a_{i+2},\ldots ,a_{n}].\end{eqnarray}$$ 
(b) For every $j\geqslant 0$ and $i$ such that $1\leqslant i+j\leqslant n1$ ,
$$\begin{eqnarray}\begin{array}{@{}rcl@{}}{\mathcal{G}}[a_{1},\ldots ,a_{i+j}]{\mathcal{G}}[a_{i},\ldots ,a_{n}]\,\, & =\,\, & {\mathcal{G}}[a_{1},\ldots ,a_{n}]\,{\mathcal{G}}[a_{i},\ldots ,a_{i+j}]\\ \,\, & \,\, & +\,(1)^{j}\,{\mathcal{G}}[a_{1},\ldots ,a_{i2}]\,{\mathcal{G}}[a_{i+j+2},\ldots ,a_{n}].\end{array}\end{eqnarray}$$ 
(c) For snake graphs ${\mathcal{G}}[a_{1},\ldots ,a_{n}]$ and ${\mathcal{G}}[b_{1},\ldots ,b_{m}]$ such that $[a_{i},\ldots ,a_{i+k}]=[b_{j},\ldots ,b_{j+k}]$ for $k\geqslant 0,1<i<n,1<j<m$ and $a_{i1}<b_{j1},a_{i+k+1}\neq b_{j+k+1},$ we have
$$\begin{eqnarray}\displaystyle {\mathcal{G}}[a_{1},\ldots ,a_{n}]\,{\mathcal{G}}[b_{1},\ldots ,b_{m}] & = & \displaystyle {\mathcal{G}}[a_{1},\ldots ,a_{i1},b_{j},\ldots ,b_{m}]\,{\mathcal{G}}[b_{1},\ldots ,b_{j1},a_{i},\ldots ,a_{n}]\nonumber\\ \displaystyle & & \displaystyle +(1)^{k}\,{\mathcal{G}}[a_{1},\ldots ,a_{i2}1,1,b_{j1}a_{i1}1,b_{j2},\ldots ,b_{1}]\,{\mathcal{G}}^{\prime },\nonumber\end{eqnarray}$$where$$\begin{eqnarray}{\mathcal{G}}^{\prime }=\left\{\begin{array}{@{}ll@{}}{\mathcal{G}}[b_{m},\ldots ,b_{j+k+2}1,1,a_{i+k+1}b_{j+k+1}1,a_{i+k+2},\ldots ,a_{n}] & \text{if }a_{i+k+1}>b_{j+k+1},\\ {\mathcal{G}}[b_{m},\ldots ,b_{j+k+2},b_{j+k+1}a_{i+k+1}1,1,a_{i+k+2}1,\ldots ,a_{n}] & \text{if }a_{i+k+1}<b_{j+k+1}.\end{array}\right.\end{eqnarray}$$
Proof. Part (a) follows from a construction called grafting with the single edge $b_{i}$ ; see [Reference Çanakçı and SchifflerCS15, §3.3, case 3]. Part (b) is the resolution of two snake graphs with a crossing overlap ${\mathcal{G}}[a_{i},\ldots ,a_{i+j}]$ ; see [Reference Çanakçı and SchifflerCS13, §2.4]. If $j$ is even, then the overlap is crossing in the pair on the left ${\mathcal{G}}[a_{1},\ldots ,a_{i+j}]{\mathcal{G}}[a_{i},\ldots ,a_{n}]$ , and if $j$ is odd, then the overlap is crossing in the pair on the right ${\mathcal{G}}[a_{1},\ldots ,a_{n}]{\mathcal{G}}[a_{i},\ldots ,a_{i+j}]$ . Part (c) is the resolution of two snake graphs with a crossing overlap ${\mathcal{G}}[a_{i1},a_{i},\ldots ,a_{i+k},d]={\mathcal{G}}[a_{i1},b_{j},\ldots ,b_{j+k},d]$ where $d=\min \{a_{i+k+1},b_{j+k+1}\}$ ; see [Reference Çanakçı and SchifflerCS15, §3.1].◻
Translating into continued fractions, we get the following theorem.
Theorem 5.2. We have the following identities of numerators of continued fractions, where we set ${\mathcal{N}}[a_{1},\ldots ,a_{0}]=1$ and ${\mathcal{N}}[a_{n+1},\ldots ,a_{n}]=1$ .

(a) For every $i=1,2,\ldots ,n$ ,
$$\begin{eqnarray}{\mathcal{N}}[a_{1},\ldots ,a_{n}]={\mathcal{N}}[a_{1},\ldots ,a_{i}]\,{\mathcal{N}}[a_{i+1},\ldots ,a_{n}]+{\mathcal{N}}[a_{1},\ldots ,a_{i1}]\,{\mathcal{N}}[a_{i+2},\ldots ,a_{n}].\end{eqnarray}$$ 
(b) For every $j\geqslant 0$ and $i$ such that $1\leqslant i+j\leqslant n1$ ,
$$\begin{eqnarray}\displaystyle {\mathcal{N}}[a_{1},\ldots ,a_{i+j}]\,{\mathcal{N}}[a_{i},\ldots ,a_{n}] & = & \displaystyle {\mathcal{N}}[a_{1},\ldots ,a_{n}]\,{\mathcal{N}}[a_{i},\ldots ,a_{i+j}]\nonumber\\ \displaystyle & & \displaystyle +\,(1)^{j}\,{\mathcal{N}}[a_{1},\ldots ,a_{i2}]\,{\mathcal{N}}[a_{i+j+2},\ldots ,a_{n}].\nonumber\end{eqnarray}$$ 
(c) For continued fractions $[a_{1},\ldots ,a_{n}]$ and $[b_{1},\ldots ,b_{m}]$ such that $[a_{i},\ldots ,a_{i+k}]=[b_{j},\ldots ,b_{j+k}]$ for $0\leqslant k\leqslant \min (ni2,mj2),~2<i<n,~2<j<m$ and $a_{i1}<b_{j1},a_{i+k+1}\neq b_{j+k+1},$ we have
$$\begin{eqnarray}\displaystyle {\mathcal{N}}[a_{1},\ldots ,a_{n}]\,{\mathcal{N}}[b_{1},\ldots ,b_{m}] & = & \displaystyle {\mathcal{N}}[a_{1},\ldots ,a_{i1},b_{j},\ldots ,b_{m}]\,{\mathcal{N}}[b_{1},\ldots ,b_{j1},a_{i},\ldots ,a_{n}]\nonumber\\ \displaystyle & & \displaystyle \!+\,(1)^{k}\,{\mathcal{N}}[a_{1},\ldots ,a_{i2}1,1,b_{j1}a_{i1}1,b_{j2},\ldots ,b_{1}]\,{\mathcal{N}}^{\prime },\nonumber\end{eqnarray}$$where$$\begin{eqnarray}{\mathcal{N}}^{\prime }=\left\{\begin{array}{@{}ll@{}}{\mathcal{N}}[b_{m},\ldots ,b_{j+k+2}1,1,a_{i+k+1}b_{j+k+1}1,a_{i+k+2},\ldots ,a_{n}] & \text{if }a_{i+k\!+1}>b_{j+k\!+1},\\ {\mathcal{N}}[b_{m},\ldots ,b_{j+k+2},b_{j+k+1}\!a_{i+k+1}1,1,a_{i+k+2}1,\ldots ,a_{n}] & \text{if }a_{i+k\!+1}<b_{j+k\!+1}.\end{array}\right.\end{eqnarray}$$
Proof. (a) The equation in part (a) of Theorem 5.1 is an equation of Laurent polynomials in several variables $x_{i}$ . Setting each of these variables equal to 1, we get the identity
Now the result follows from Theorem 3.4. Part (b) and (c) are proved in the same way. ◻
Remark 5.3. Parts (a) and (b) are known formulas for continuants; see [Reference MuirMui60, ch. XIII] or [Reference UstinovUst06] for (b).
We did not find the result (c) in the literature. An example of this identity is the following, where $i=j=3,k=1$ :
The lefthand side is equal to $139\cdot 239$ , the righthand side is equal to $149\cdot 2232\cdot 3$ , and both are equal to 33221.
Remark 5.4. The formulas in Theorem 5.1 are identities for elements of the cluster algebra. This implies that in the formulas in Theorem 5.2, we can replace the integers $a_{i}$ by certain Laurent polynomials as shown in § 6 (using Theorem 5.1). We shall then show in § 6.1 that the formulas in Theorem 5.2 also hold for complex numbers $a_{i}$ .
6 The relation to cluster algebras
We have seen that the numerator of a continued fraction is equal to the number of perfect matchings of the corresponding abstract snake graph, and that it can therefore be interpreted as the number of terms in the numerator of the Laurent expansion of an associated cluster variable. In other words, if one knows the Laurent polynomial of the cluster variable, one obtains the numerator of the continued fraction by setting all variables $x_{i}$ (and coefficients $y_{i}$ ) equal to 1.
In this section, we show how to go the other way and recover the Laurent polynomials of the cluster variables from the continued fractions. More precisely, we will associate a Laurent polynomial $L_{i}$ to each $a_{i}$ in such a way that the continued fraction $[L_{1},\ldots ,L_{n}]$ of Laurent polynomials is equal to a quotient of cluster variables.
Let $(S,M)$ be a marked surface with a triangulation $T$ that has no selffolded triangles. Denote by ${\mathcal{A}}={\mathcal{A}}(S,M)$ the associated cluster algebra with initial cluster $\mathbf{x}_{T}=(x_{1},x_{2},\ldots ,x_{N})$ corresponding to $T$ . Let $\unicode[STIX]{x1D6FE}$ be a generalized arc in $(S,M)$ , and let ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}}$ be its (labeled) snake graph as defined in § 2.3. Using Theorem 4.1, there is a positive continued fraction $[a_{1},a_{2},\ldots ,a_{n}]$ such that ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}}={\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ as graphs. Let $\ell _{i}=\sum _{j=1}^{i}a_{j}$ and ${\mathcal{H}}_{1},{\mathcal{H}}_{2},\ldots ,{\mathcal{H}}_{n}$ be the subgraphs as defined in § 3. For $i=1,2,\ldots ,n1$ , denote by $b_{i}$ the label of the tile $G_{\ell _{i}}$ and let $b_{0}$ be the unique edge in $_{\text{SW}}{\mathcal{G}}\setminus \{e_{0}\}$ and $b_{n}$ be the unique edge in ${\mathcal{G}}^{\text{NE}}\setminus \{e_{d}\}$ . We define the following Laurent polynomials, where we simply write $b_{i}$ for the cluster variable $x_{b_{i}}$ .
Definition 6.1.
The following explicit formula for the $x({\mathcal{H}}_{i})$ is taken from [Reference Çanakçı and FeliksonCF17]. We include a proof here for the convenience of the reader.
Proposition 6.2. With the above notation,
where $\ell _{0}=0,x_{0}=b_{0}$ , and $x_{\ell _{d}}=b_{n}$ .
Proof. We prove the formula for $i=1$ . For arbitrary $i$ , the proof is the same up to a shift in the subscripts. If $a_{1}=1$ then ${\mathcal{H}}_{1}$ is a single edge $e_{0}$ and thus $x({\mathcal{H}}_{1})=x_{e_{0}}$ . On the other hand, $\ell _{1}=\ell _{0}+1$ and thus the formula in the proposition becomes $x_{0}(x_{e_{0}}/x_{0}x_{1})x_{1}=x_{e_{0}}$ , proving the result for $a_{1}=1$ .
Now suppose $a_{1}>1$ . According to Lemma 3.3, ${\mathcal{H}}_{1}={\mathcal{G}}[a_{1}]$ is a zigzag snake graph with $a_{1}1$ tiles $G_{1},G_{2},\ldots ,G_{a_{1}1}$ and $a_{1}$ perfect matchings. An example with $a_{1}=7$ is given in Figure 6. Note that $\ell _{1}=a_{1}$ . Let ${\mathcal{H}}_{1}^{\prime }$ be the subgraph consisting of the tiles $G_{1},G_{2},\ldots ,G_{a_{1}2}$ . Then ${\mathcal{H}}_{1}^{\prime }$ has $a_{1}1$ perfect matchings each of which can be completed to a perfect matching of ${\mathcal{H}}_{1}$ by adding the unique edge $e\in {\mathcal{H}}_{1}^{\text{NE}}$ that is not equal to $e_{\ell _{1}1}$ . Note that the edge $e$ has label $\ell _{1}$ . The only remaining perfect matching $P_{0}$ of ${\mathcal{H}}_{1}$ does not contain the edge $e$ and it does contain the edge $e_{\ell _{1}1}$ and every other boundary edge of ${\mathcal{H}}_{1}$ . In the example in Figure 6, the matching $P_{0}$ is marked in thick black. Since ${\mathcal{H}}_{1}$ is a complete zigzag snake graph, the weight of $P_{0}$ is $x(P_{0})=x_{0}x_{1}x_{2}\cdots x_{\ell _{1}2}x_{e_{\ell _{1}1}}$ , and thus
Therefore,
and by induction, this is equal to
To state our main result, we need to construct a second generalized arc $\unicode[STIX]{x1D6FE}^{\prime }$ in such a way that its snake graph is obtained from the snake graph ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}}$ of $\unicode[STIX]{x1D6FE}$ by removing the first zigzag subgraph ${\mathcal{H}}_{1}$ . For an example, see Figure 7.
Let $s$ be the starting point of the generalized arc $\unicode[STIX]{x1D6FE}$ , and let $\unicode[STIX]{x1D6E5}$ be the first triangle in $T$ that $\unicode[STIX]{x1D6FE}$ meets. Then the two sides of $\unicode[STIX]{x1D6E5}$ that are incident to $s$ correspond to the two edges in $_{\text{SW}}{\mathcal{G}}_{\unicode[STIX]{x1D6FE}}$ . Let $\unicode[STIX]{x1D6FC}$ be the side that corresponds to the edge in $_{\text{SW}}{\mathcal{G}}_{\unicode[STIX]{x1D6FE}}$ whose sign is opposite to the sign of the first interior edge of ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}}$ . In other words, $\unicode[STIX]{x1D6FC}=e_{0}$ if $a_{1}=1$ and $\unicode[STIX]{x1D6FC}=b_{0}$ if $a_{1}>1$ . We orient $\unicode[STIX]{x1D6FC}$ such that its terminal point is the point $s$ , and we consider the generalized arc $\unicode[STIX]{x1D6FE}^{\prime }$ corresponding to the concatenation $\unicode[STIX]{x1D6FE}\circ \unicode[STIX]{x1D6FC}$ . Since arcs are considered up to isotopy, it follows from the construction that $\unicode[STIX]{x1D6FE}^{\prime }$ avoids the first $a_{i}$ crossings of $\unicode[STIX]{x1D6FE}$ with $T$ and then runs parallel to $\unicode[STIX]{x1D6FE}$ ; see Figure 7. At the level of snake graphs we have ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}^{\prime }}={\mathcal{G}}_{\unicode[STIX]{x1D6FE}}\setminus {\mathcal{H}}_{1}={\mathcal{G}}[a_{2},\ldots ,a_{n}]$ .
We are now ready for the main theorem of this section.
Theorem 6.3. Let $\unicode[STIX]{x1D6FE}$ be a generalized arc in $(S,M,T)$ and let ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}}={\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ be its snake graph. Then we have the following identity in the field of fractions of the cluster algebra ${\mathcal{A}}(S,M)$ :
where $\unicode[STIX]{x1D6FE}^{\prime }$ is the generalized arc constructed above and $L_{i}$ the Laurent polynomials in Definition 6.1. Moreover, $x_{\unicode[STIX]{x1D6FE}}$ and $x_{\unicode[STIX]{x1D6FE}^{\prime }}$ are relatively prime in the ring of Laurent polynomials and thus the lefthand side of the equation is reduced.
In particular, if $\unicode[STIX]{x1D6FE}$ and $\unicode[STIX]{x1D6FE}^{\prime }$ have no selfcrossing, then lefthand side of the equation is the quotient of two cluster variables.
Remark 6.4. It is possible that $\unicode[STIX]{x1D6FE}$ has no selfcrossings but $\unicode[STIX]{x1D6FE}^{\prime }$ does. For an example, see Theorem 7.3.
Remark 6.5. Theorem 6.3 suggests that one should study quotients of elements of the cluster algebra and their asymptotic behavior. We present a first result in this direction in § 7.
Proof. If $n=1$ then $\unicode[STIX]{x1D6FE}^{\prime }=b_{1}$ by construction. Therefore $x_{\unicode[STIX]{x1D6FE}}/x_{\unicode[STIX]{x1D6FE}^{\prime }}=x({\mathcal{G}}_{\unicode[STIX]{x1D6FE}})/b_{1}=x({\mathcal{H}}_{1})/b_{1}=L_{1}$ . If $n=2$ , then
and, using Theorem 5.1(a) with $i=1$ and $n=2$ , this is equal to $x({\mathcal{G}}[a_{1},a_{2}])/x({\mathcal{G}}[a_{2}])=x_{\unicode[STIX]{x1D6FE}}/x_{\unicode[STIX]{x1D6FE}^{\prime }}$ .
Now suppose that $n>2$ . Again using Theorem 5.1(a), we have
Passing to the Laurent polynomials and dividing by $x({\mathcal{G}}[a_{2},a_{3},\ldots ,a_{n}])$ and $b_{1}$ , we get
Using the definition of $L_{1}$ and induction, this is equal to
where $L_{i}^{\prime }=(b_{0}/b_{1})L_{i}$ if $i$ is even, and $L_{i}^{\prime }=(b_{1}/b_{0})L_{i}$ if $i$ is odd. Lemma 2.3 implies that (6.1) is equal to
which in turn equals $[L_{1},L_{2},\ldots ,L_{n}]$ . Finally, if a Laurent polynomial $f$ is a common divisor of $x_{\unicode[STIX]{x1D6FE}}$ and $x_{\unicode[STIX]{x1D6FE}^{\prime }}$ then the number of terms in $f$ is a common divisor of the number of terms in $x_{\unicode[STIX]{x1D6FE}}$ and $x_{\unicode[STIX]{x1D6FE}^{\prime }}$ , and Theorem 3.4 implies that $f$ is a Laurent monomial. Thus $f$ is a unit in the ring of Laurent polynomials. This completes the proof.◻
Since $x_{\unicode[STIX]{x1D6FE}}$ and $x_{\unicode[STIX]{x1D6FE}^{\prime }}$ are relatively prime, we obtain the following formula for $x_{\unicode[STIX]{x1D6FE}}$ .
Corollary 6.6. With the notation of Theorem 6.3, we have
for some Laurent monomial $M$ .
Remark 6.7. Theorem 6.3 provides a very efficient way to compute the Laurent expansion of a cluster variable $x_{\unicode[STIX]{x1D6FE}}$ , without determining the perfect matchings of the snake graph ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}}$ .
Example 6.8. To illustrate the theorem, we compute the quotient of the cluster variables associated to the arcs $\unicode[STIX]{x1D6FE}$ and $\unicode[STIX]{x1D6FE}^{\prime }$ in the triangulation shown on the left of Figure 7.
The snake graph ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}}$ of $\unicode[STIX]{x1D6FE}$ is shown in the center of Figure 7. If we choose $e_{5}\in {\mathcal{G}}^{\text{NE}}$ to be the east edge then ${\mathcal{G}}$ corresponds to the continued fraction $[2,3,1]$ and the corresponding subgraphs ${\mathcal{H}}_{1},{\mathcal{H}}_{2},{\mathcal{H}}_{3}$ are shown on the right of the figure. By definition, we have $b_{1}=x_{2},b_{2}=x_{5}$ and
Thus
and expanding by $x_{2}b_{3}/x_{5}$ shows that this quotient is equal to
On the other hand,
where the sum is over all perfect matchings of ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}}$ . The snake graph ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}}$ has precisely nine perfect matchings, which are shown in Figure 8. The two perfect matchings on the left correspond to the term $x({\mathcal{H}}_{1})x_{2}x_{3}x_{4}b_{3}/x_{2}x_{3}x_{4}x_{5}$ , the six perfect matchings in the center correspond to the term $x({\mathcal{H}}_{1})x({\mathcal{H}}_{2})x({\mathcal{H}}_{3})/x_{2}x_{5}$ , and the perfect matching on the right corresponds to the term $x({\mathcal{H}}_{3})b_{0}x_{1}x_{3}x_{4}x_{5}/x_{1}x_{2}x_{3}x_{4}x_{5}$ .
Similarly, the snake graph ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}^{\prime }}$ of $\unicode[STIX]{x1D6FE}^{\prime }$ consists of the three tiles labeled 3, 4 and 5 and has four perfect matchings. Three of these perfect matchings correspond to the term $x({\mathcal{H}}_{2})x({\mathcal{H}}_{3})x_{5}$ and the other to the term $x_{2}x_{3}x_{4}b_{3}/x_{3}x_{4}x_{5}$ .
Thus we see that
Alternatively, according to Theorem 4.1, we can also choose $e_{5}^{\prime }\in {\mathcal{G}}^{\text{NE}}$ to be the north edge, and then ${\mathcal{G}}$ corresponds to the continued fraction $[2,4]$ . If we denote by ${\mathcal{H}}_{i}^{\prime },b_{i}^{\prime }$ the corresponding subgraphs and by $L_{i}^{\prime }$ the Laurent monomials, then we have:

– ${\mathcal{H}}_{1}^{\prime }={\mathcal{H}}_{1}$ and ${\mathcal{H}}_{2}^{\prime }$ consists of the three tiles labeled 3,4,5;

– $b_{0}^{\prime }=b_{0},b_{1}^{\prime }=x_{2}$ , and $b_{2}^{\prime }=e_{5}$ is the east edge of ${\mathcal{G}}^{\text{NE}}$ ;

– $L_{1}^{\prime }=L_{1}$ and
$$\begin{eqnarray}L_{2}^{\prime }=x({\mathcal{H}}_{2}^{\prime })\frac{b_{1}^{\prime }}{b_{0}^{\prime }b_{2}^{\prime }}=x({\mathcal{H}}_{2}^{\prime })\frac{x_{2}}{b_{0}e_{5}}.\end{eqnarray}$$
Therefore
which again is equal to $x_{\unicode[STIX]{x1D6FE}}/x_{\unicode[STIX]{x1D6FC}}$ . In Figure 8, the two perfect matchings in the first frame together with the six perfect matchings in the second frame correspond to the term $x({\mathcal{H}}_{1})x({\mathcal{H}}_{2}^{\prime })/x_{2}$ in the expression above, whereas the single perfect matching on the right of Figure 8 corresponds to the term $b_{0}e_{5}x_{1}x_{3}x_{4}x_{5}/x_{2}x_{1}x_{3}x_{4}x_{5}$ .
Remark 6.9. The proof of Theorem 6.3 actually shows a stronger result, namely, that
for every labeled snake graph ${\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ whose labels satisfy the condition that, for every straight subsnake graph of three consecutive tiles $G_{b_{i}1},G_{b_{i}},G_{b_{i}+1}$ :

(1) the north edge of $G_{b_{i}1}$ and the south edge of $G_{b_{i}+1}$ both have the same weight $b_{i}$ , if the subsnake graph is horizontal;

(2) the east edge of $G_{b_{i}1}$ and the west edge of $G_{b_{i}+1}$ both have the same weight $b_{i}$ , if the subsnake graph is vertical.
6.1 Complex continued fractions
Theorem 6.3 allows us to consider continued fractions of complex numbers as follows. Let $[z_{1},z_{2},\ldots ,z_{n}]$ be a continued fraction of complex numbers $z_{j}\in \mathbb{C}$ . Define $a_{j}=\lceil \,z_{j}\,\rceil$ to be the least integer larger than or equal to the absolute value $z_{j}$ of $z_{j}$ . Thus $[a_{1},a_{2},\ldots ,a_{n}]$ is a positive continued fraction and we can associate to it the snake graph ${\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ . Let $d$ be the number of tiles as usual. We can realize this snake graph as the snake graph of an arc $\unicode[STIX]{x1D6FE}$ in a triangulated polygon $(S,M,T)$ such that each edge of the snake graph corresponds to an arc in $T$ and hence to a cluster variable. It is important to realize that, since we are working in a polygon, the label of the edge $e_{j}$ , for $j=0,1,\ldots ,d$ , is different from the label of any other edge of ${\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ .
We could now compute the quotient of cluster variables $x_{\unicode[STIX]{x1D6FE}}/x_{\unicode[STIX]{x1D6FE}^{\prime }}$ as in Theorem 6.3. However, we will use the following specialization of the cluster variables. Recall that the integers $\ell _{i}=\sum _{j=1}^{i}a_{j}$ and the subgraphs ${\mathcal{H}}_{i}$ are defined in such a way that the interior edge $e_{\ell _{i}1}$ lies in ${\mathcal{H}}_{i}^{\text{NE}}$ . We set $x_{e_{\ell _{j}1}}=z_{i}a_{i}+1$ , for $j=1,2,\ldots ,n$ and $x_{e}=1$ , for all other edges $e$ in ${\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ . Then Proposition 6.2 implies that under this specialization
Moreover, under this specialization all $b_{i}$ have label 1, and thus $L_{i}=x({\mathcal{H}}_{i})=z_{i}$ . Therefore
where the lefthand side is the continuant of $[z_{1},z_{2},\ldots ,z_{n}]$ . This shows that the formulas of Theorem 5.2 also hold for continued fractions of complex numbers.
Example 6.10. If $[z_{1},z_{2}]=[2i,3+i]$ , we have $a_{1}=2$ , $a_{2}=\lceil \sqrt{10}\,\rceil =4$ , and the special weights are $x_{e_{1}}=2i1$ and $x_{e_{6}}=6+i$ . Then $L_{1}=2i$ , $L_{2}=3+i$ , so ${\mathcal{N}}[L_{1},L_{2}]=2i(3+i)+1=z_{1}z_{2}+1={\mathcal{N}}[z_{1},z_{2}]$ .
6.2 An application to quiver Grassmannians
We keep the notation of Theorem 6.3. Let $\unicode[STIX]{x1D6EC}_{T}$ be the Jacobian algebra (over $\mathbb{C}$ ) of the quiver with potential determined by the triangulation $T$ (see [Reference LabardiniFragosoLab16]), and let $M_{\unicode[STIX]{x1D6FE}}$ be the indecomposable $\unicode[STIX]{x1D6EC}$ module corresponding to $\unicode[STIX]{x1D6FE}$ . From now on assume that $\unicode[STIX]{x1D6FE}$ has no selfcrossing. Then $M_{\unicode[STIX]{x1D6FE}}$ is a rigid module and $x_{\unicode[STIX]{x1D6FE}}$ is a cluster variable. Then the cluster character formula [Reference PaluPal08] implies that
for some $a_{i}(\text{}\underline{e})\in \mathbb{Z}$ , where the sum runs over all dimension vectors $\text{}\underline{e}\in \mathbb{Z}_{{\geqslant}0}^{N}$ , $\text{Gr}_{\text{}\underline{e}}(M_{\unicode[STIX]{x1D6FE}})$ denotes the quiver Grassmannian of $M_{\unicode[STIX]{x1D6FE}}$ of submodules of dimension vector $\text{}\underline{e}$ , and $\unicode[STIX]{x1D712}$ is the Euler characteristic. The positivity theorem for cluster variables implies that $\unicode[STIX]{x1D712}(\text{Gr}_{\text{}\underline{e}}(M_{\unicode[STIX]{x1D6FE}}))\geqslant 0$ .
Let ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}}$ be the snake graph of $\unicode[STIX]{x1D6FE}$ and $[a_{1},a_{2},\ldots ,a_{n}]$ be its continued fraction. Comparing formula (6.2) to the perfect matching formula of [Reference Musiker, Schiffler and WilliamsMSW11], and specializing all $x_{i}=1$ , we see that the number of perfect matchings of ${\mathcal{G}}_{\unicode[STIX]{x1D6FE}}$ is equal to the sum $\sum _{\text{}\underline{e}}\unicode[STIX]{x1D712}(\text{Gr}_{\text{}\underline{e}}(M_{\unicode[STIX]{x1D6FE}}))$ . Now Theorem 3.4 implies the following corollary.
Corollary 6.11. With the notation above,
Remark 6.12. A similar formula has recently been obtained in [Reference Baur, Faber, Gratz, Serhiyenko and TodorovBFGST16].
7 Infinite continued fractions and limits of rational functions from cluster algebras
If $[a_{1},a_{2},\ldots ]$ is an infinite positive continued fraction, we associate to it an infinite snake graph ${\mathcal{G}}[a_{1},a_{2},\ldots ]$ which is defined in the same way as in §3. Of course this infinite snake graph has infinitely many perfect matchings, and the numerator of the continued fraction is also infinite. However, according to Proposition 2.5, the continued fraction converges and its limit is a real irrational number. Therefore Theorem 3.4 implies that
Example 7.1. The limit of the ratios of consecutive Fibonacci numbers is the golden ratio. Thus
The limit of the ratios of consecutive Pell numbers is the silver ratio. Thus
Using our construction of § 6, we can associate to a continued fraction $[a_{1},a_{2},\ldots ]$ the rational function $[L_{1},L_{2},\ldots ]$ . If each of the finite snake graphs ${\mathcal{G}}[a_{1},a_{2},\ldots ,a_{n}]$ has a geometric realization in the same cluster algebra, this rational function represents a limit of quotients of elements of the cluster algebra.
For example, consider the torus with one puncture and denote by $\mathbf{x}=(x_{1},x_{2},x_{3})$ the initial cluster of the corresponding cluster algebra; see Figure 9. The infinite arc $\unicode[STIX]{x1D6FE}$ crosses the arcs labeled 1 and 2 of the triangulation alternatingly. The corresponding infinite snake graph, shown on the right of the figure, is a straight snake graph with alternating tile labels $1,2,1,2,\ldots ,$ and all interior edges have weight $x_{3}$ . The associated continued fraction is the continued fraction of the golden ratio $[\,\overline{1}\,]=[1,1,1,\ldots ]$ . Let $[L_{1},L_{2},L_{3},\ldots ]$ be the corresponding continued fraction of rational functions as defined in § 6. Thus