Alberto Pardo

Keywords: Dynamical Analysis, dynamical systems, Word Combinatorics, Sturmian words, recurrence functions, greatest common divisor, continued fractions, continued logarithm expansion, transfer operator, Riemann sums, Dirichlet series, Tauberian theorem

Dynamical Analysis incorporates tools from dynamical systems, namely the Transfer Operator, into the framework of Analytic Combinatorics, permitting the analysis of numerous algorithms and objects naturally associated with an underlying dynamical system. This dissertation presents, in the integrated framework of Dynamical Analysis, the probabilistic analysis of seemingly distinct problems in a unified way: the probabilistic study of the recurrence function of Sturmian words, and the probabilistic study of the Continued Logarithm algorithm.

 who demonstrated that they present a notable number theoretical characterization as discrete codings of lines with irrational slope, relating them naturally to dynamical systems, in particular the Euclidean dynamical system. These words have never been studied from a probabilistic perspective. Here, we quantify the recurrence properties of a "random" Sturmian word, which are dictated by the so-called "recurrence function"; we perform a complete asymptotic probabilistic study of this function, quantifying its mean and describing its distribution under two different probabilistic models, which present different virtues: one is a naturally choice from an algorithmic point of view (but is innovative from the point of view of dynamical analysis), while the other allows a natural quantification of the worstcase growth of the recurrence function. We discuss the relation between these two distinct models and their respective techniques, explaining also how the two seemingly different techniques employed could be linked through the use of the Mellin transform. In this dissertation we also discuss our ongoing work regarding two special families of Sturmian words: those associated with a quadratic irrational slope, and those with a rational slope (not properly Sturmian). Our work seems to show the possibility of a unified study.

The Continued Logarithm Algorithm, introduced by Gosper in Hakmem (1978) as a mutation of classical continued fractions, computes the greatest common divisor of two natural numbers by performing divisionlike steps involving only binary shifts and subtractions. Its worst-case performance was studied recently by Shallit (2016), who showed a precise upper-bound for the number of steps and gave a family of inputs attaining this bound. In this dissertation we employ dynamical analysis to study the average running time of the algorithm, giving precise mathematical constants for the asymptotics, as well as other parameters of interest. The underlying dynamical system is akin to the Euclidean one, and was first studied by Chan (around 2005) from an ergodic point of view, but the presence of powers of 2 in the quotients ingrains into the central parameters a dyadic flavour that cannot be grasped solely by studying this system. We thus introduce a dyadic component and deal with a two-component system. With this new mixed system at hand, we then provide a complete average-case analysis of the algorithm by Dynamical Analysis.

Résumé. L'analyse dynamique intègre des outils propres aux systèmes dynamiques (comme l'opérateur de transfert) au cadre de la combinatoire analytique, et permet ainsi l'analyse d'un grand nombre d'algorithmes et objets qu'on peut associer naturellement à un système dynamique. Dans ce manuscrit de thèse, nous présentons, dans la perspective de l'analyse dynamique, l'étude probabiliste de plusieurs problèmes qui semblent à priori bien différents : l'analyse probabiliste de la fonction de récurrence des mots de Sturm, et l'étude probabiliste de l'algorithme du "logarithme continu".

Les mots de Sturm constituent une famille omniprésente en combinatoire des mots. Ce sont, dans un sens précis, les mots les plus simples qui ne sont pas ultimement périodiques. Les mots de Sturm ont déjà été beaucoup étudiés, notamment par [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF] qui en ont exhibé une caractérisation fondamentale comme des codages discrets de droites à pente irrationnelle. Ce résultat relie ainsi les mots de Sturm au système dynamique d'Euclide. Les mots de Sturm n'avaient jamais été étudiés d'un point de vue probabiliste. Ici nous introduisons deux modèles probabilistes naturels (et bien complémentaires) et y analysons le comportement probabiliste (et asymptotique) de la "fonction de récurrence" ; nous quantifions sa valeur moyenne et décrivons sa distribution sous chacun de ces deux modèles : l'un est naturel du point de vue algorithmique (mais original du point de vue de l'analyse dynamique), et l'autre permet naturellement de quantifier des classes de plus mauvais cas. Nous discutons la relation entre ces deux modèles et leurs méthodes respectives, en exhibant un lien potentiel qui utilise la transformée de Mellin. Nous avons aussi considéré (et c'est un travail en cours qui vise à unifier les approches) les mots associés à deux familles particulières de pentes : les pentes irrationnelles quadratiques, et les pentes rationnelles (qui donnent lieu aux mots de Christoffel).

L'algorithme du logarithme continu est introduit par Gosper dans Hakmem (1978) comme une mutation de l'algorithme classique des fractions continues. Il calcule le plus grand commun diviseur de deux nombres naturels en utilisant uniquement des shifts binaires et des soustractions. Le pire des cas a été étudié récemment par [START_REF] Shallit | Length of the continued logarithm algorithm on rational inputs[END_REF], qui a donné des bornes précises pour le nombre d'étapes et a exhibé une famille d'entrées sur laquelle l'algorithme atteint cette borne. Dans cete thèse, nous étudions le nombre moyen d'étapes, tout comme d'autres paramètres importants de l'algorithme. Grâce à des méthodes d'analyse dynamique, nous exhibons des constantes mathmatiques précises. Le système dynamique ressemble à première vue à celui d'Euclide, et a été étudié d'abord par [START_REF] Chan | The asymptotic growth rate of random Fibonacci type sequences[END_REF] avec des méthodes ergodiques. Cependant, la présence des puissances de 2 dans les quotients change la nature de l'algorithme et donne une nature dyadique aux principaux paramètres de l'algorithme, qui ne peuvent donc pas être simplement caractérisés dans le monde réel. C'est pourquoi nous introduisons un nouveau système dynamique, avec une nouvelle composante dyadique, et travaillons dans ce système à deux composantes, l'une réelle, et l'autre dyadique. Grâce à ce nouveau système mixte, nous obtenons l'analyse en moyenne de l'algorithme.

Mots clés. Analyse dynamique, systèmes dynamiques, combinatoire des mots, mots de Sturm, fonction de récurrence, plus grand commun diviseur, fractions continues, logarithme continu, opérateur de transfert, sommes de Riemann, series de Dirichlet, théorème tauberien, probabilités, modèle probabiliste.

R ÉSUM É LONG

Contexte général

Dans ce manuscrit de thèse, nous présentons l'étude probabiliste de plusieurs objets provenant de disciplines qui semblent a priori bien distinctes : d'abord, une famille très importante et classique de mots, appelés mots de Sturm, qui jouent un rôle fondamental en combinatoire des mots; deuxièment, un algorithme de pgcd (l'algorithme du "logarithme continu" -CL pour ses initiales en anglais), propre à la théorie des nombres. Ces objets ont été déjà beaucoup étudiés, en particulier, les "ordres de croissance maximaux" de certains de leurs paramètres caractéristiques sont bien connus. Nous adoptons ici un point de vue différent et nous en faisons une étude probabiliste. Au lieu d'être motivés par la question de savoir "quel est le meilleur/pire cas?", nous considérons des questions comme "comment décrire un mot (de Sturm) aléatoire? comment décrire une execution aléatoire de l'algorithme de pgcd?" Même si nos objets d'étude (mots, algorithmes de pgcd) proviennent de disciplines qui semblent éloignées, ils peuvent être décrits dans un cadre commun de théorie des nombres. Ce cadre inclut les fractions continues (classiques pour le cas des mots de Sturm, et une famille qui n'est pas si classiques pour le cas du CL où les puissances de 2 jouent un rôle central), et leurs systèmes dynamiques respectifs. Ici nous utilisons des outils propres aux systèmes dynamiques (comme l'opérateur de transfert) et au cadre de la combinatoire analytique [START_REF] Flajolet | Analytic Combinatorics[END_REF]. La combinatoire analytique a pour objet fondamental les fonctions génératrices (ici de type "Dirichlet", typiques de la théorie des nombres [START_REF] Tenenbaum | Introduction to analytic and probabilistic number theory[END_REF]), avec des coefficients qui comptent des objets combinatoires (ou de théorie des nombres), et relie leur comportement analytique (les singularités) aux asympytotiques de leur coefficients (grâce aux théorèmes tauberiens). La situation est illustrée dans la figure 2a. La combinatoire analytique est largement utilisée dans l'étude d'algorithmes, de structures de données, ou même en combinatoire per se, probabilistiquement. Quand les objets étudiés sont engendrés par un système dynamique, la combinatoire analytique peut (et doit) être complétée par une autre classe de méthodes, donnant lieu à ce qui s'appelle l'analyse dynamique [START_REF] Flajolet | Continued fraction algorithms, functional operators, and structure constants[END_REF], introduite par Baladi, Flajolet, Vallée et d'autres. L'outil clé de l'analyse dynamique est l'opérateur de transfert du système dynamique sous-jacent, qui étend l'opérateur transformateur de densité du système, et suit naturellement l'évolution de nos paramètres pendant l'itération du système. Nous pouvons alors utiliser cet opérateur pour engendrer des fonctions génératrices. Quand l'opérateur agit sur un espace fonctionnel approprié, il présente une valeur propre dominante, qui joue le rôle de la singularité dominante en combinatoire analytique.

L'analyse dynamique est illustrée dans la figure 2b. Nous expliquons brièvement comment on y arrive. La puissance k-ième (par composition) de l'opérateur de transfert H s décrit la situation après k iterations du système dynamique (sous-jacent à l'algorithme ou processus). Nous cherchons alors des expressions pour notre fonction génératrice en termes de puissances de H s , souvent avec toutes les puissances apparaissant en même temps (I -H s ) -1 = I + H s + H 2 s + . . ., quand nous considérons toutes les exécutions possibles d'un algorithme. Trouver une telle expression peut parfois être impossible avec la combinatoire analytique classique, car l'utilisation des outils nécessite une certaine indépendence entre les différentes étapes de l'algorithme. Une fois que nous avons trouvé ces expressions pour les fonctions génératrices, nous utilisons les propriétés spectrales de l'opérateur; si l'opérateur a de bonnes propriétés (dans un espace fonctionnel approprié), l'action de la puissance H k s est déterminée par la valeur propre dominante et la projection sur l'espace propre associé. Par bonnes propriétés, nous entendons que l'opórateur présente un saut spectral [START_REF] Baladi | Systèmes dynamiques et algorithmique[END_REF] : la valeur propre dominante est unique et simple, et est séparée du reste du spectre. Nous remarquons que cette situation est similaire à celle du théorème de Perron-Frobenius pour des matrices; le comportement cherché est analogue mais dans un space de dimension infinie. Le choix de l'espace fonctionnel est délicat car il y a un compromisà trouver : l'espace doit être suffisamment grand pour contenir des fonctions utiles, mais suffisamment petit pour avoir un saut spectral. Une fois établi que les puissances de l'opérateur de transfert sont déterminées par les puissances de la valeur propre dominante, nous pouvons finir l'analyse et déterminer les singularités principales des fonctions génératrices.

Étude probabiliste des mots de Sturmian

Les mots de Sturm constituent une famille omniprésente en combinatoire des mots (voir e.g., [START_REF] Fogg | Substitutions in dynamics, arithmetics and combinatorics[END_REF] et [START_REF] Lothaire | Algebraic combinatorics on words[END_REF]). Ce sont précisement les mots les plus simples qui ne sont pas ultimement périodiques, au sens qu'ils ont le plus petit nombre possible de facteurs de chaque longeur n, c'est-à-dire n+1. Les mots de Sturm apparaissent naturellement en relation avec la géométrie digitale et les quasicristaux, et, par conséquence, ont été beaucoup étudiés. Sur l'alphabet binaire {0, 1}, Morse et Hedlund [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF] fournissent une description arithmétique des mots de Sturm fondamentale, qui montre un lien profond avec les fractions continues. Plus précisément, ils ont démontré qu'à chaque mot de Sturm correspond est associé un nombre irrationnel α de l'intervalle unité (appellé sa pente), qui décrit la fréquence des 1 dans le mot : chaque mot de Sturm peut être écrit systématiquement en fonction de sa pente comme S α . Cette représentation correspond, en fait, à un codage discret de droite comme décrit dans la figure La fonction de récurrence du mot de Sturm S α décrit la fac ¸on dont les facteurs finis de longueur n arrivent dans le mot infini S α . En particulier, R α (n) indique le "temps d'attente" maximum qu'il faut pour découvrir tous les facteurs de S α de longueur n. La fonction R α (n) dépend, d'une fac ¸on assez élégante, du couple (α, n). Plus précisément, Morse et Hedlund [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF] ont relié la fonction de récurrence R α (n) au dévelopepment en fraction continue de α, plus particulièrement à ses continuants q k (α), les dénominateurs des convergents de la fraction continue de α.

Morse and Hedlund ont démontré que, quand n appartient à l'intervalle [q k-1 (α), q k (α)[ entre deux continuants consécutifs q k-1 (α) et q k (α) de α, la fonction de récurrence R α (n) admet une expression simple. De plus, les auteurs exhibent un comportement en "n log n" pour le pire cas de R α (n), dont l'apparition dépend fortement du choix spécifique de (α, n), mais qui se produit presque sûrement pour une infinité de n.

La question que nous posons est : Si le couple (α, n) est tiré au hasard de fac ¸on systématique, quel est le comportement probabiliste de la fonction de récurrence R α (n)? Dans cette thèse, nous proposons deux modèles probabilistes différents pour répondre à la question.

Premier modèle probabiliste

Notre premier modèle, décrit dans le chapitre 5, a été publié en [BCR + 15] pour la conférence MFCS 2015. C'est une première approche pour le pire cas d'un point de vue probabiliste obtenue en conditionnant avec des intervalles de plus en plus petits qui contiennent les pires cas. Dans ce modèle, nous tirons la pente α "uniformément" dans l'intervalle unité puis nous prenons de sous-suites particulières k → → n k qui fixent la position barycentrique µ de n relative à l'intervalle [q k-1 (α), q k (α)[. Nos résultats [BCR + 15], obtenus par des méthodes d'analyse dynamique, quantifient l'incidence de la position µ sur le comportement du pire cas de la fonction de récurrence, et montrent effectivement un comportement du type " n log n en moyenne" sur certaines sous-suites k → → n k .

Nous utilisons des méthodes d'analyse dynamique, ici avec le système dynamique classique d'Euclide (avec l'application de Gauss) et son opérateur transformateur de densités. Nous démontrons que l'espérance associé à la k-ième étape n k s'écrit en termes de la puissance k-ième de l'opérateur transformateur de densités. Sur l'espace fonctionnel des fonctions de variation bornée, cet opérateur présente un saut spectral dont on a besoin, et les puissance de l'opérateur sont alors approchées par les (véritables) puissances de la valeur propre dominante. Dans ce cas nous avons eu besoin aussi de résultats sur le terme de reste, qui sont assez connus.

Deuxième modèle probabiliste

Le modèle précédent est très utile quand il s'agit de décrire le pire cas de la fonction de récurrence et l'incidence de la position relative µ. Dans notre deuxième modèle nous considérons, à nouveau, une pente aléatoire α, mais la taille d'entrée n est fixée et indépendant de α. L'analyse de la fonction de récurrence dans ce modèle "n → ∞ fixé" est décrite au chapitre 4, et a été publiée dans les actes de ANALCO 2017 [START_REF] Rotondo | The recurrence function of a random Sturmian word[END_REF]. Ce modèle peut être utilisé aussi afin d'étudier d'autres fonctions, comme la position relative µ, qui jouent un rôle dans l'analyse des mots de Sturm, ainsi que les fractions continues elles-mêmes.

Nous obtenons trois résultats principaux dans [START_REF] Rotondo | The recurrence function of a random Sturmian word[END_REF]; nous considérons les variables aléatoires α → → (1/n)R α (n) et les étudions pour n grand. Nous exhibons leur distribution limite, et nous démontrons l'existence de la densité limite. Nous étudions aussi l'espérance conditionnelle du quotient de récurrence (1/n)R α (n), quand nous excluons la possibilité que n se trouve trop proche du bord gauche de l'intervalle [q k-1 (α), q k (α)[. Enfin, nous exhibons une classe d'événements pour lesquels l'ordre de cette espérance conditionnelle est exactement log n. Ce dernier résultat peut être considéré comme une extension probabiliste du résultat classique de Morse et Hedlund.

Nos preuves utilisent des méthodes élémentaires : elles reposent sur une comparaison précise entre une intégrale et sa somme de Riemann; cependant, l'intégrale est impropre (mais convergente) et la somme de Riemann implique une condition supplémentaire de primalité, ce que nous avons appellé une "somme de Riemann première". Les sommes de Riemann premières apparaissent aussi dans [START_REF] Florin | On the distribution of the Farey sequence with odd denominators[END_REF], où les auteurs étudient la suite de Farey, mais travaillent dans des domains bornés. Ici nous adaptons les méthodes pour des domaines non bornés, avec des termes d'erreur précis pour la convergence vers les intégrales.

Comportement probabiliste de familles "particulières" de mots de Sturm

Il y a deux familles particulières de mots de Sturm qui sont importantes en tant que telles. Leur étude constitue un travail un cours qui, en fait, vise à unifier les approches pour les deux familles et le cas générique du deuxième modèle. Nos résultats actuels (non encore publiés) montrent que le comportement de ces familles est semblable au cas générique. Les preuves utilisent aussi d'autres outils utiles tels que les séries de Dirichlet et les théorèmes taubériens.

Christoffel words Quand la pente α est rationnelle, le mot S α est périodique, ce que l'on appelle un mot de Christoffel [START_REF] Berstel | Combinatorics on words: Christoffel words and repetitions in words[END_REF]. Dans ce cas, la question est : Est-ce vrai que, quand la longueur du développement en fraction continue d'α tend vers l'infini, la fonction de récurrence a un comportement en moyenne semblable à celui d'un mot de Sturm générique?

Mots de Sturm engendrés par morphisms Il y a une deuxième famille importante, à savoir, les mots de Sturm qui sont engendrés par de morphisms [START_REF] Allauzen | Une caractérisation simple des nombres de Sturm[END_REF]. Ils sont associés à des pentes α irrationnelles quadratiques, qui ont des développements en fractions continues périodiques. Ici nous posons une question similaire : Est-ce vrai que, quand la période de l'irrationnel quadratique α tend vers l'infini, le comportement de la fonction de récurrence, en moyenne, est semblable à celui du cas générique? L'analyse dans ce cadre est plus compliquée car elle dépend de (n, α, ℓ) où ℓ dénote la quantité de tours de la période.

Analysis of the Continued Logarithm Algorithm

L'algorithme du logarithme continu -CL pour ses initiales en anglais-est introduite par Gosper dans Hakmem [START_REF] Gosper | Continued fraction arithmetic[END_REF] comme une "mutation" de l'algorithme classique des fractions continues. Cet algorithme calcule le plus grand commun diviseur de deux nombres entiers en utilisant uniquement des shifts binaires et des soustractions. Le pire cas a été étudié récemment par Shallit [START_REF] Shallit | Length of the continued logarithm algorithm on rational inputs[END_REF], qui a donné des bornes précises pour le nombre d'étapes et a exhibé une famille d'entrées sur laquelle l'algorithme atteint cette borne. Dans cete thèse, nous étudions le nombre moyen d'étapes, tout comme d'autres paramètres importants de l'algorithme. Grâce à des méthodes d'analyse dynamique, nous exhibons des constantes mathématiques précises.

Plus précisément, nous considérons les couples (p, q), avec 1 ≤ p ≤ q ≤ N , avec la probabilité uniforme, et nous étudions les valeurs moyennes du nombre d'étapes de pseudo-divisons et de shifts binaires, quand N → ∞. Dans notre résultat principal, le théorème 7.2, nous démontrons que ces valeurs moyennes sont asymptotiquement linéaires par rapport à la taille log N , et nous décrivons précisement leur comportement asymptotique quand N → ∞.

Le système dynamique sous-jacent ressemble à première vue à celui d'Euclide, et a été étudié d'abord par Chan [START_REF] Chan | The asymptotic growth rate of random Fibonacci type sequences[END_REF] et Borwein et al [START_REF] Borwein | Continued logarithms and associated continued fractions[END_REF], avec des méthodes ergodiques, mais la présence des puissances de 2 dans les quotients change la nature de l'algorithme et donne une nature dyadique aux principaux paramètres de l'algorithme, qui ne peuvent donc pas être simplement caractérisés dans le monde réel. C'est pourquoi nous introduisons un nouveau système dynamique, avec une nouvelle composante dyadique, et travaillons dans ce système à deux composantes, l'une réelle, et l'autre dyadique. Grâce à ce nouveau système mixte, nous obtenons l'analyse en moyenne de l'algorithme.

Acknowledgements. I begin by thanking my thesis directors. First Alfredo Viola, who has unconditionally supported me since the times of the "Low-correlation sequences" seminar and introduced me to my other thesis directors Valérie Berthé, Brigitte Vallée, as well as the community in general. I keep very fond memories of our time together and hope we will continue to have seminars or work discussions for a long time. I am profoundly grateful to Brigitte, who has helped me and taught me a lot, through her seemingly unbounded energy. We have worked a lot together, and I think that, even though we have had our share of divergence and communication problems, overall it has been very positive and led to interesting and unexpected ideas (in part due to this divergence of thought process!). I would like to thank Valérie, who has always supported me, both academically and administratively, and directed me towards interesting topics and problems which resulted in this thesis. I hope we can continue to work on the pending topics and unify it with the rest of the work.

I would like to express my gratitude to the referees, Bruno Salvy and Pierre Arnoux, for having accepted to review my thesis through the summer, and for all of their corrections and suggestions. They have certainly helped improve the quality of this dissertation. I also extend my thanks to all of the members of the jury for having accepted to be here for my defence, I feel honoured.

INTRODUCTION

General context

In this dissertation, we study objects coming from a priori diverse fields: first, a very important family of words, the so-called Sturmian words, fundamental in Combinatorics on Words; second, a gcd algorithm (the Continued Logarithm Algorithm -CL for short), stemming from Number Theory. These objects have been studied extensively, and the "extreme orders" of some of their important characteristics are now wellunderstood. We adopt a different point of view; we wish to study them from a probabilistic perspective. Rather than being motivated the question "what is the worst/best case scenario?", we consider questions such as "what does a random (Sturmian) word look like? what does a random gcd algorithm execution look like ?

Even though the objects we consider (words, gcd algorithms) come from seemingly distant fields, they can both be described within a common Number Theoretic framework. This framework includes continued fraction expansions (the usual one for Sturmian words, and a less classical one for the CL algorithm, where powers of two play a central role), and their corresponding underlying dynamical systems. dynamical system, Analytic Combinatorics can be (and must be) complemented by another class of methods, giving rise to the so-called Dynamical Analysis [START_REF] Flajolet | Continued fraction algorithms, functional operators, and structure constants[END_REF], pioneered by Baladi, Flajolet, Vallée and others.

The key object in Dynamical Analysis is the transfer operator of the underlying dynamical system, which extends the density transformer operator of the system, and naturally tracks the evolution of our parameters of interest through its iterates. It thus can be viewed as a generating operator that generates itself the generating functions of interest. When it acts on a convenient functional space, this operator has a dominant eigenvalue, which plays the same role as the dominant singularity in classical Analytic Combinatorics.

The extension to Dynamical Analysis is illustrated in Figure 5b. We briefly explain how this is achieved. The k-th power (by composition) of the transfer operator H s reflects the situation after k iterations of the dynamical system (underlying the algorithm or process). Thus we must first exploit this to give expressions for our target generating functions in terms of the powers of H s , often with all powers at the same time (I -H s ) -1 = I + H s + H 2 s + . . . when considering every possible execution of an algorithm. Finding such an expression is sometimes impossible in classical Analytic Combinatorics, as the usual techniques require some sort of independence between distinct steps of the algorithm. Given expressions for our generating functions in terms of the powers of H s , we exploit the spectral properties of the operator; if the operator is well-behaved (in an appropriately chosen functional space), the action of the power H k s is determined by the dominant eigenvalue and the projection over its eigenspace. By well-behaved we mean it presents a spectral gap [START_REF] Baladi | Systèmes dynamiques et algorithmique[END_REF]: the dominant eigenvalue is unique and simple, and separated from the rest of the spectrum. The reader may be familiar with the Perron-Frobenius Theorem for matrices; the target behavior is analog but in a space of infinite dimension. The choice of the functional space is then a delicate one as there must be a balance: it must be big enough to contain useful input functions, but small enough to give us our desired spectral gap. Then, once we have established that the powers of the operator follow the powers of the dominant eigenvalue, we may complete the analysis and determine the main singularities of the generating functions.

This dissertation is structured into 3 parts, following the bottom of the diamond in Figure 4: • Part I is concerned with the common background for the whole thesis, which corresponds to the bottom part of Figure 4. We introduce the background in continued fractions and dynamical systems in Chapter 1. Particular attention has been payed to introducing continued fractions, dynamical systems and the functional properties of the transfer operator. The concepts we require from Analytic Combinatorics are introduced in Chapter 2, in particular Dirichlet Generating Functions and the Tauberian Theorem.

• Part II deals with the problems coming from Combinatorics on Words. Therein we define all the necessary notions concerning Sturmian words and our problematic (in Chapter 3), to then proceed to our probabilistic study of Sturmian words (in chapters 4 and 5).

• Finally, Part III closes the thesis with a probabilistic study of the CL algorithm. Now we give further details regarding the contents of Part II and Part III.

CONTENTS

Probabilistic study of Sturmian words

Sturmian words are central objects in Word Combinatorics (see e.g., [START_REF] Fogg | Substitutions in dynamics, arithmetics and combinatorics[END_REF] and [START_REF] Lothaire | Algebraic combinatorics on words[END_REF]). These are precisely the simplest infinite words that are not eventually periodic, in the sense that they have the absolutely smallest number of factors of each length n, that is n + 1. Sturmian words turn up naturally in relation to digital geometry and quasicrystals, and have been widely studied.

On the binary alphabet {0, 1}, Morse and Hedlund [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF] provide a powerful arithmetic description of Sturmian words and relate them to continued fraction expansions. Specifically, they show that each Sturmian word is in strong correspondence with an irrational number α of the unit interval (called its slope), describing the frequency of ones in the word: each Sturmian word may be written as S α for some irrational α in the unit interval. This representation is related to the discrete coding of lines such as the one in Figure 6. The recurrence function of the Sturmian word S α describes how the finite factors of length n occur inside the infinite word S α . In particular R α (n) denotes the maximum "waiting time" that is needed to discover all the factors of S α of length n. The function R α (n) depends nicely upon the pair (α, n). More precisely, Morse and Hedlund [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF] relate the recurrence function R α (n) to the continued fraction expansion of α, more particularly to its continuants q k (α), the denominators resulting from the convergents of the continued fraction for α.

Morse and Hedlund showed that when n belongs to the interval [q k-1 (α), q k (α)) between two consecutive continuants q k-1 (α) and q k (α) of α, the recurrence function R α (n) admits a simple expression. Further, the authors exhibited a "n log n" worst-case behavior for R α (n), whose occurrence depends strongly on the specific choices of (α, n), but occurs almost surely for infinitely many n.

We present the general background regarding Sturmian words as well as Morse and Hedlund's results, rewritten in our notation, in Chapter 3. We deemed, in particular, that the link between the recurrence of Sturmian words and continuants had to be explained thoroughly as we make extensive use of it. Finally, at the end of the chapter, in Section 3.4, we discuss Morse and Hedlund's classical results concerning the growth of the recurrence function and we present briefly our context, questions, and results.

The question we pose is: If the pair (α, n) is chosen randomly in some systematic way. What is the probabilistic behavior of the recurrence function R α (n)? In this dissertation, we consider two distinct probabilistic models to answer this question. Roughly speaking, our first model [BCR + 15] considers sequences of n, appropriately chosen for each α, in turn chosen uniformly at random, while our second model [START_REF] Rotondo | The recurrence function of a random Sturmian word[END_REF] leaves n fixed and large (n → ∞) and chooses α at random. The latter is described and studied in Chapter 4 while the former in Chapter 5, and the relation between the two models is studied in Chapter 6. For each model, we answer the preceding question by giving precise limit distributions and densities, and studying how these relate to the worst-case "n log n" behavior, found by Morse and Hedlund, through the study of appropriate conditional probabilities.

First probabilistic model

Our first model, described in Chapter 5, was published in [BCR + 15] for MFCS 2015. It was a first attempt to approach this worst-case scenario from a probabilistic setting by actually conditioning to smaller and smaller sets which encapsulate the worst cases. In this setting, one picks the slope α "uniformly at random" from the unit interval and then considers particular subsequences k → → n k that fix the barycentric position µ of n within the interval [q k-1 (α), q k (α)). Our results in [BCR + 15] , following a Dynamical Analysis, quantify the incidence of the position µ on the worst-case behavior of the recurrence function, and exhibit a " n log n average behavior" over certain sequences k → → n k .

More precisely, we exhibit the asymptotic value, as k → ∞, of the distribution of

(1/n k )R α  n k 
. As this analysis may be performed even for varying relative position µ k , we show a kind of Morse-Hedlund result "on average": the expectation is of order n log n when µ k → 0 at a prescribed exponential rate. Considering the dynamical system underlying the problem (here the classical Euclidean one, with the Gauss map), we use methods from Dynamical Analysis, in this case the plain density transformer operator of the system. We express the expectations relative to the k-th step in terms of the k-th power of the density transformer. Over an appropriate functional space (here the functions of bounded variation), the operator presents our desired spectral gap, and the powers of the operator are approximated by the (true) k-th power of the dominant eigenvalue. In this case we also require specific knowledge regarding the remainder term, which has been studied extensively for the Euclidean system.

Main results for the first probabilistic model. The main results obtained are summarized here:

▷ Theorem 5.1.
For a fixed relative (barycentric) position µ , we characterize the limit expectations and the limit density of (1/n k )R α (n k ) as k → ∞. ▷ Theorem 5.2.

For a varying relative (barycentric) position µ k → 0 , we characterize the the limit density of (1/n k )R α (n k ) as k → ∞, demonstrating the rate of convergence to the case of fixed µ = 0 from Theorem 5.1. Moreover, we demonstrate that the expectations of (1/n k )R α (n k ) do have a log n k behavior when µ k tends to zero exponentially (not too fast).

Second probabilistic model

The previous model for Sturmian words is very useful when it comes to describing the worst-case behavior of the recurrence function and the incidence of the relative position µ. Our second model considers, again, a random slope α, but somewhat orthogonally to the previous model, we take an input size n independent from α. The analysis of the recurrence function within this "fixed n → ∞" model is described in Chapter 4, and was published in the proceedings of ANALCO 2017 [START_REF] Rotondo | The recurrence function of a random Sturmian word[END_REF]. This model can be employed to study other functions, such as the relative position µ, playing a role in the analysis of Sturmian words, or continued fractions.

We obtain three main results in [START_REF] Rotondo | The recurrence function of a random Sturmian word[END_REF]; we consider the random variables α → → (1/n)R α (n) and study them for large n. We exhibit a limit for their distribution, and prove the existence of a limit density. We also study the conditional expectation of the recurrence quotient (1/n)R α (n), when we exclude the possibility that n be too close to the left-end of the interval [q k-1 (α), q k (α)). Finally, we describe a class of events for which the order of this conditional mean value is exactly of order log n. This can be viewed as a probabilistic extension of the Morse and Hedlund result.

Our proofs use elementary methods: they are based on a precise comparison between an integral and its Riemann sum ; however, the integral is improper (but convergent) and the Riemann sum is constrained by a coprimality condition, what we call a "coprime Riemann sum". Coprime Riemann sums appear in [START_REF] Florin | On the distribution of the Farey sequence with odd denominators[END_REF],

where the authors study the Farey sequence, but limited to bounded domains. Here we adapt the methods of proof to unbounded domains, getting tight error bounds for the convergence towards the integrals.

We introduce a general family of functions, called continuant-functions or Q-functions, which are defined via the sequence of continuants k → → q k (α). Ustinov in [START_REF] Ustinov | On the statistical properties of elements of continued fractions[END_REF] had already considered similar functions to answer a question from Sinai and Ulcigrai [START_REF] Yakov | Renewal-type limit theorem for the Gauss map and continued fractions[END_REF]; here we generalize the class of functions to Qfunctions, demonstrating its ubiquity in continued fraction problems. The recurrence quotient (1/n)R α (n) is an instance of this family, and the other "geometric" parameters of interest provide natural examples of such a notion. The class of Q-functions lead naturally to coprime Riemann sums. Thus the paper describes a framework for studying the more general Q-functions, giving special attention to the recurrence function.

Main results for the second probabilistic model. The main results obtained are summarized here:

▷ Theorem 4.1.
We show that for a wide family of Q-functions, which we call LQ-functions, the random variables (1/n)R α (n) have a limiting distribution as n → ∞. This distribution is expressed in terms of an analog ψ(x, y) of the Gauss measure. Moreover, we show explicit bounds for the remainder term.

▷ Theorem 4.2.
This result makes precise when the histograms do converge to the derivative of the distribution, thus making sense of it as a density. Since the distributions of Q-functions, such as (1/n)R α (n), are discrete, we have to be careful when speaking of the limit density. Here we characterize this limit density of LQ-functions completely, giving also remainder terms.

▷ Theorem 4.3.

This result demonstrates that if we condition to an event such as µ ≥ ϵ(n), which prevents that n be too close to the left-end of the interval [q k-1 (α), q k (α)), the expected value of (1/n)R α (n) involves a log ϵ(n). This is the counter-part of the results by Morse and Hedlund for this probabilistic model. The proof exploits strongly the knowledge of the remainder term from Theorem 4.1.

We highlight also that the convergence in distribution for Q-functions still holds for more general conditions, but without any guarantee for the remainder term however, see Theorem 4.10.

Probabilistic behavior of "particular" Sturmian words

There are two kinds of special Sturmian words, both interesting in their own right.

Christoffel words When the parameter α is rational, the word S α is periodic and is called a Christoffel word [START_REF] Berstel | Combinatorics on words: Christoffel words and repetitions in words[END_REF]. It is still interesting to study such words probabilistically, particularly how the word evolves (when the length p(α) of its continued fraction becomes large) towards a Sturmian word, notably from the point of view of its recurrence function. Our main question is: Is it true that, when the length of the continued fraction of α becomes large, the behavior of the recurrence function becomes close to the recurrence function of a generic Sturmian word?

We have carried out this study, yielding results in the same vein as the ANALCO paper. This results are not yet published, and we explain them in subsection 6.3.1. We consider the set Ω N of rational numbers from the unit interval with a denominator at most N , endowed with the uniform probability. We introduce generating functions of Dirichlet kind, in order to sieve the right rationals for our asymptotics (through a Tauberian Theorem). We show that when the bound for the denominator N tends to infinity, the analogous distributions for the recurrence quotient are given by the same coprime Riemann-sum as before.

Sturmian words generated by morphisms

There is a second important family of Sturmian words, namely Sturmian words that are generated by word morphisms [START_REF] Allauzen | Une caractérisation simple des nombres de Sturm[END_REF]. They are associated to quadratic irrationals α, that give rise to periodic continued fraction expansions. Our main question is: Is it true that, when the period π(α) of the quadratic irrational α becomes large, the behavior of the recurrence function resembles that of a generic Sturmian word? The analysis is more difficult because it now depends on the triple (n, α, ℓ) where the integer ℓ describes the number of times the period is needed.

We have already obtained interesting results for the case ℓ = 1 (not yet published), where we get the same distributions from our second probabilistic model but through substantially different methods. There seems to be a stationary behavior as ℓ → ∞, and this is work still in progress. The results obtained thus far are discussed in subsection 6.3.2.

Our proofs mix methods from dynamical analysis and elementary methods like those in the second model: as for rational numbers, we introduce generating functions of Dirichlet type to manage the quadratic irrationals, which are endowed with their usual notion of size, here closely related to the fundamental unit of the associated quadratic field. The associated generating functions are (again) expressed in terms of the transfer operator of the Euclid dynamical system, but now via their traces. This leads to a more involved study.

A specific interesting result This study also leads us to a specific interesting result on finite continued fractions. Such a continued fraction is defined by a finite sequence (m 1 , m 2 , . . . m k ) of partial quotients and represents a rational p/q. The "mirror" continued fraction defined by the mirror sequence (m k , m k-1 , . . . m 1 ) represents another reduced rational p ′ /q that has the same denominator as the previous one (but not the same numerator). Very often, the two expansions occur together in our studies (and in many other studies), and the two associated rational numbers seem a priori to be correlated in a strong way. We adapt a result of Shparlinski [START_REF] Shparlinski | Modular hyperbolas[END_REF] Theorem 13] and we prove that, when one draws a rational p/q uniformly at random, the two rational numbers p/q and p ′ /q asymptotically behave in an independent way, as the denominator q becomes large. This is explained in Section 4.5.3.

Analysis of the Continued Logarithm Algorithm

The Continued Logarithm Algorithm -CL for short-introduced by Gosper in 1978 [START_REF] Gosper | Continued fraction arithmetic[END_REF], computes the gcd of two integers; it employs efficient operations, as it only performs (binary) shifts and subtractions. Shallit [START_REF] Shallit | Length of the continued logarithm algorithm on rational inputs[END_REF] has studied its worst-case complexity in 2016 and showed it to be linear, and he proposed the problem of determining the average-case analysis of the algorithm to us. We answer his question in the publication [START_REF] Rotondo | Analysis of the continued logarithm algorithm[END_REF], accepted in LATIN 2018 and described in Chapter 7: we study its main parameters (number of iterations K, total number of shifts S) and obtain precise asymptotics for their mean values.

More precisely, we consider the set Ω N gathering all integer pairs (p, q) with 1 ≤ p ≤ q ≤ N , endowed with the uniform probability, and we study the mean values of K and S as N → ∞. In our main result, Theorem 7.2, we prove that these mean values are asymptotically linear in the size log N , and describe precisely their asymptotic behavior as N → ∞. This result is to be expected intuitively, since the algorithm resembles the Euclidean one where both the worst and average case are linear [START_REF] Vallée | Euclidean dynamics[END_REF]. The study leading up to this average case asymptotics, however, presents several interesting (and non-trivial) aspects.

The dynamical analysis involves the dynamical system underlying the algorithm, which produces continued fraction expansions whose quotients are powers of 2. Even though this CL system has already been studied by Chan [Cha05] and Borwein et al [START_REF] Borwein | Continued logarithms and associated continued fractions[END_REF], the presence of powers of 2 in the quotients ingrains into the central parameters a dyadic flavor that cannot be grasped solely by studying the CL system. Indeed, even if the input of the CL algorithm is a pair of coprime integers, the algorithm builds a sequence q k of remainders, for which the pair (q k-1 , q k ) is no longer coprime. The successive gcd(q k-1 , q k ) are now powers of 2, and it appears experimentally that (1/k) log 2 gcd(q k-1 , q k ) gets close to 1/2 as k becomes large.

In order to take into account this involved dyadic phenomenon, central to our analysis, we add a second dyadic component to the (usual) CL dynamical system, and work with a two-component system, which allows us to keep track of all the interesting parameters under study. This new dynamical system with its two components, is not classical at all, but we succeed in finding a convenient space where its transfer operator acts nicely, with a single dominant eigenvalue. With this new mixed system at hand, we provide a complete average-case analysis of the CL algorithm, with explicit constants. The extended dynamical system and its properties are presented in Section 7.4. In particular, in Section 7.4.2 we discuss to a certain extent the appropriate probability measures on the dyadics, while in Section 7.4.3 we provide the properties of the transfer operator that are needed to complete the analysis. This becomes significant because the use of dyadics in Dynamical Analysis performed here is not commonplace. Even though there exist works studying other gcd algorithms that employ dyadics, namely the so-called "Turtle and the Hare" algorithm [START_REF] Benoî T Daireaux | The Lyapunov tortoise and the dyadic hare[END_REF], and the Binary algorithm [START_REF] Vallée | Dynamics of the binary euclidean algorithm: Functional analysis and operators[END_REF] , the CL algorithm evolves and uses the dyadics in a novel way.

Main results for the CL algorithm. The main result obtained is summarized here:

▷ Theorem 7.2.
The mean value of the total number of iterations K and the total number of shifts S are asymptotically linear in the size log N as N → ∞, and we provide explicit constants.

We remark that we are working on the so-called "real case" for the Continued Logarithm expansion. We consider a random real in the unit interval and, a given number k, we wish to describe the evolution of the main parameters associated with the expansion truncated after k steps, when the depth k tends to ∞. This is a work still in progress.

Part I

Presentation of the general context CHAPTER 1

CONTINUED FRACTIONS AND THE GAUSS MAP

We kick off by introducing several useful concepts that are recurrent in our studies and will prove fundamental for both the solution and conception of our problems.

The numeration process

Continued fractions can be introduced in several ways, and arise in contexts as seemingly diverse as diophantine approximation and Pell's equation. The most classical text describing extensively the elementary properties of continued fractions is definitely "Continued Fractions" by Khinchin [START_REF] Ya | Continued fractions[END_REF].

A continued fraction is a "formal" expression of the form

1 m 1 + 1 m 2 + 1 m 3 + . . . , which we denote by [m 1 , m 2 , . . .],
where the coefficients m 1 , m 2 , . . ., known as quotients or partial quotients, are positive integers.

We can make sense of this as a limit of the so-called convergents

[m 1 , . . . , m k ] := 1 m 1 + 1 . . . + 1 m k , (1.1)
that is, the truncated expansion considering only the first k coefficients. This can be realized as a finite continued fraction, or by filling in with 0s as follows [m 1 , . . . , m k , 0, 0, 0 . . .], thus explaining the notation.

More precisely define

[m 1 , m 2 , . . .] := lim[m 1 , . . . , m k ] ,
1.1. THE NUMERATION PROCESS 26 and this limit is well-defined (see e.g., [START_REF] Ya | Continued fractions[END_REF]) , for any choice of quotients m 1 , m 2 , . . . ≥ 1. We will now describe how of the continuants evolve, and in fact derive the existence of the limits too, as well as other interesting properties.

The finite continued fraction [m 1 , . . . , m k ] represents a rational number

p k q k = 1 m 1 + 1 . . . + 1 m k , gcd(p k , q k ) = 1 , (1.2)
where we enforce that p k and q k to be coprime to make the choice unique.

Note p k and q k defined in (1.2) depend only on the vector (m 1 , . . . , m k ) ∈ Z k ≥1 and hence we will often write p(m 1 , . . . , m k ) and q(m 1 , . . . , m k ) to underline this dependence, or even p k (m) and q k (m) when the whole sequence m = (m 1 , . . . , m k , . . .) is fixed beforehand, thus emphasizing the "truncation" aspect. We write simply p k and q k as above when there is no danger of confusion.

The limit [m 1 , m 2 , . . .] in (1.1) actually exists for any choice of coefficients (m k ) ∞ k=1 (this is proved e.g., in [Khi97, Theorem 10, p.10]) and represents a real number α ∈ [0, 1]. Conversely, every real number α ∈ (0, 1] has a continued fraction expansion

α = 1 m 1 + 1 m 2 + . . . , (1.3)
and we write m i = m i (α) when there is danger of confusion. This expansion is unique when α is irrational and, of course, necessarily infinite. For rationals we have two expansions, both finite (we will point out why later on), by means of the equality

[m 1 , . . . , m k-1 , m k ] = [m 1 , . . . , m k-1 , m k -1, 1] (1.4)
which holds for m k ≥ 2.

Thus rationals have two finite expansions; one of them ending with the digit 1. It is direct to see that this is the only possible "redundancy" in the continued fraction expansion (this can be seen by direct comparisons), somewhat analogously to the case of the binary base representation, where the redundancies come from the cases of the form 0.a 1 . . . a k 100 . . . = 0.a 1 . . . a k 011 . . . This is to say, if two continued fraction expansions represent the same real number, then we are necessarily in the case (1.4) described above.

When considering the quotients m 1 (α), m 2 (α), . . . coming from the expansion of α, we will also write p k (α) and q k (α) to denote the numerators and denominators of the convergents. The sequence

(q k (α)) ∞ k=1
of denominators is known as the sequence of continuants, and plays a fundamental role in our studies.

Given α ∈ (0, 1) it will be useful to explain how its expansion is computed. We first note that if equality (1.3) is to hold, then

1 α = m 1 + [m 2 , m 3 , . . .] which implies m 1 (α) =  1 α 
, where ⌊•⌋ denotes the floor function. Then the continued fraction [m 2 , m 3 , . . .] corresponds, in its turn, to the rational part {1/α} and the procedure is iterated.

Thus we may think of this procedure as a dynamical system producing the digits m 1 (α), m 2 (α), . . .

The Gauss map

The process of computing a continued fraction expansion, its successive digits, can be described somewhat more.

Definition 1.1 (Gauss map). Let I := (0, 1), we consider the shift map T g , called the Gauss map, defined by

T g : I → I , α → →  1 α  , (1.5)
where {•} denotes the fractional part {α} := α -⌊α⌋. We further define the digit function m by

m : I → N , α → →  1 α  . (1.6) 0.2 0.4 0.6 0.8 1 x 0.2 0.4 0.6 0.8 1 T(x) Figure 1.1: The Gauss map
We remark then that the digits m i (α) are retrieved from the equality m i (α) = m(T i-1 g α), thus making the continued fraction expansion a coding of the trajectory {α, T g α, T 2 g α, . . .} by m. Note that this is well defined when α ∈ I \ Q, while the trajectory will be finite when α is rational, as we will soon explain.

The evolution of the orbits through the Gauss map T g from Definition 1.1 constitutes a fundamental example in dynamical systems. We extend the notions given for the Gauss map to more general dynamical systems in Section 1.2, where we define complete interval dynamical systems in Definition 1.3.

Observation 1.1. It is important to remark that the Gauss map T g and the digit function m are defined so that α = 1 m 1 (α) + T g (α)

.

(1.7)

This equation may be iterated giving

α = 1 m 1 (α) + 1 . . . + 1 m k (α) + T k g α , (1.8) which we denote by [m 1 (α), m 2 (α), . . . , m k-1 (α), m k (α) + T k g α]
in a little abuse of notation (as we are introducing non-integer coefficients).

Continued fractions and the Euclidean Algorithm

The Euclidean Algorithm computes the greatest common divisor (gcd) of a pair of positive integers a ≤ b by exploiting the equality gcd(a, b) = gcd(r, a) where r = b mod a is the remainder of the division of b by a, and then proceeding likewise with (r, a) until we get to a pair (0, g) for which it is clear that gcd(0, g) = g. This algorithm is very efficient, having linear complexity (on the bit-length) of a and b. Here we explain this fact briefly, by showing that there is a fundamental connection between the Euclidean Algorithm and continued fractions of rational numbers. In particular, as (1.4) is the only redundancy in the representation, rational numbers have only finite expansions (exactly two of them). Second, this means that one may study the Euclidean algorithm by studying the continued fraction expansion or viceversa.

Basic properties of continuants

We now develop important properties regarding the convergents p k /q k , providing information regarding the growth of the sequence of continuants q k . These will prove useful in proving that α = [m 1 (α), m 2 (α), . . .] indeed holds as expected, as the convergence rate of [m 1 (α), m 2 (α), . . . , m k (α)] towards α will be dictated by the size of q k as we explain in Proposition 1.4. Along the way we will introduce several properties which are fundamental to our studies.

We start off by studying the recurrence equation satisfied by the sequences (p k ) k and (q k ) k , providing its matricial form too.

Proposition 1.1. Let (m k ) ∞
k=1 be a sequence of positive integers. The sequences (p k ) ∞ k=1 ⊂ N and (q k ) ∞ k=1 ⊂ N of successive numerators and denominators of the continued fraction expansion, defined by

p k q k = [m 1 , . . . , m k ] , gcd(p k , q k ) = 1 ,
satisfy the recurrences

p k+1 = m k+1 p k + p k-1 , q k+1 = m k+1 q k + q k-1 , (1.9)
for all k ≥ 0, where we consider p 0 = 0, p -1 = 1 and q 0 = 1, q -1 = 0.

This can be written in matricial form as

 q k+1 p k+1 q k p k  =  m k+1 1 1 0   q k p k q k-1 p k-1  , (1.10) along with  q 0 p 0 q -1 p -1  =  1 0 0 1  . (1.11)
Proof. For convenience will prove the proposition in matricial form. Observe that the result is equivalent to

 q(m 1 , . . . , m k ) p(m 1 , . . . , m k ) q(m 1 , . . . , m k-1 ) p(m 1 , . . . , m k-1 )  =  m k 1 1 0  • • •  m 1 1 1 0  , (1.12)
1.1. THE NUMERATION PROCESS 29 for all k ≥ 0 and (m 1 , . . . , m k ) ∈ N k . This expression is particularly useful as what we effectively do in the inductive step is add the coefficient m 1 to the beginning of (m 2 , . . . , m k ) ∈ N k , for which we assume the result to hold by induction.

The proof proceeds by strong induction over k. It is clear that the base case p 0 = 0, p -1 = 1 and q 0 = 1, q -1 = 0 holds for any choice of the quotients. Now assume that the recurrence holds for j up to k, for any choice of quotients m 1 , . . . , m k (strong induction). Let us consider now a concrete m 1 , . . . , m k , m k+1 and show (1.12) for tuple of length k + 1.

We have

p(m 1 , . . . , m k+1 ) q(m 1 , . . . , m k+1 ) = 1 m 1 + p(m 2 ,...,m k+1 ) q(m 2 ,...,m k+1 ) = q(m 2 , . . . , m k+1 ) m 1 q(m 2 , . . . , m k+1 ) + p(m 2 , . . . , m k+1 ) ,
and therefore p(m 1 , . . . , m k+1 ) = q(m 2 , . . . , m k+1 ) as well as q(m 1 , . . . , m k+1 ) = m 1 q(m 2 , . . . , m k+1 )+ p(m 2 , . . . , m k+1 ) because their gcd equals gcd(q(m 2 , . . . , m k+1 ), p(m 2 , . . . , m k+1 )) = 1 .

As the previous equalities will also hold when we substitute k → → k -1, we have

 q(m 1 , . . . , m k+1 ) p(m 1 , . . . , m k+1 ) q(m 1 , . . . , m k ) p(m 1 , . . . , m k )  =  q(m 2 , . . . , m k+1 ) p(m 2 , . . . , m k+1 ) q(m 2 , . . . , m k ) p(m 2 , . . . , m k )   m 1 1 1 0  .
It follows from the inductive hypothesis that

 q(m 2 , . . . , m k+1 ) p(m 2 , . . . , m k+1 ) q(m 2 , . . . , m k ) p(m 2 , . . . , m k )  =  m k+1 1 1 0  • • •  m 2 1 1 0  , thus  q(m 1 , . . . , m k+1 ) p(m 1 , . . . , m k+1 ) q(m 1 , . . . , m k ) p(m 1 , . . . , m k )  =  m k+1 1 1 0  • • •  m 2 1 1 0   m 1 1 1 0  ,
which proves the result for k + 1. ■ An immediate corollary of the recurrence is that the sequence of continuants grows at least exponentially.

Corollary 1.1. Let (m k ) ∞ k=1 be a sequence of positive integers. The sequence (q k ) ∞ k=1 ⊂ N of successive continuants of the continued fraction expansion satisfies

q k ≥ 2 (k-1)/2 .
Proof. Observe that q k+1 ≥ 2q k-1 by the recurrence. ■ Observation 1.2 (Precise bound). This last inequality can be made somewhat more precise by considering that q k+1 ≥ q k + q k-1 . Then by induction we conclude that q k ≥ f k where f k is the k-th Fibonacci number, defined from f 0 = 0, f 1 = 1 and f j+1 = f j + f j-1 for j ≥ 1. Equality can only hold for each

k if α = [1, 1, 1, . . .] which then satisfies α = 1/(1 + α) so that α = ( √ 5 -1)/2.
Finally, we recall that

f k = ⌊Φ k / √ 5⌉
where ⌊•⌉ is the "round to the nearest integer" function and Φ =

√ 5+1 2
is the Golden ratio. This means that q k (α) ≥ Φ k-2 for all k ≥ 1. 3

Notice that the previous corollary gives a bound for the depth K(a, b) of the continued fraction expansion of a reduced rational number a/b, as then b = q K(a,b) ≥ 2 (K(a,b)-1)/2 and therefore K(a, b) ≤ 2 log 2 b + 1.

By definition we have that gcd(p k , q k ) = 1, and the recurrence in Proposition 1.1 implies also gcd(q k-1 , q k ) = 1 and gcd(p k-1 , p k ) = 1. All of these greatest common divisors can be deduced at once too from the following "determinant" property of the convergents.

THE NUMERATION PROCESS

Corollary 1.2 (Determinant). Let (m k ) ∞ k=1 be a sequence of positive integers. The sequences (p k ) ∞ k=1 ⊂ N and (q k ) ∞ k=1 ⊂ N of successive numerators and denominators of the continued fraction expansion satisfy

q k p k-1 -p k q k-1 = (-1) k , (1.13)
for all k ≥ 0.

Proof. Take determinants in (1.10). ■

The determinant property (1.13) gives a non-trivial relation between the sequences (p k ) k and (q k ) k of numerators and denominators. For instance, notice that

p k-1 q k = p k q k q k-1 q k + (-1) k q 2 k = p k q k q k-1 q k + O(2 -k ) .
Another property that will play a fundamental role in our studies is the so-called "mirror property" (described for instance in [START_REF] Adamczewski | Reversals and palindromes in continued fractions[END_REF]) which tells us what happens when we consider the convergents of the mirror sequence (m 1 , . . . , m k ) → → (m k , . . . , m 1 ): the numerator p k becomes the continuant q k-1 .

Corollary 1.3 (Mirror property). Let (m k ) ∞ k=1 be a sequence of positive integers q(m k , m k-1 , . . . , m 1 ) = q(m 1 , . . . , m k ) , p(m k , m k-1 , . . . , m 1 ) = q(m 1 , . . . , m k-1 ) , (1.14)
for all k ≥ 0.

Proof. Transpose the matrices. ■

This tells us at once that gcd(q k-1 , q k ) = 1 is no surprise: actually q k-1 and q k give the reduced convergent for the mirror sequence!

Inverse branches of the Gauss map

To actually get to the matters of convergence, it is important to relate the partial expansions [m 1 , . . . , m k ] to the complete expansion [m 1 , m 2 , . . .] (which equals our number α ∈ I).

We recall that α

∈ I itself is of the form α = [m 1 (α), . . . , m k-1 (α), m k (α) + z] for z = T k g α ∈ [0, 1] (see Equation 1.8), making significant the function z → → [m 1 (α), . . . , m k-1 (α), m k (α) + z].
Definition 1.2 (Inverse branches). The inverse branches of the system (T, I) defined in Definition 1.1 are given by

h m (x) := 1 m + x , H := {h m : m ∈ N} . (1.15)
While the depth k inverse branches, equivalently, the inverse branches of T k , are given by

h m 1 ,...,m k (x) := h m 1 • • • • • h m k (x) , H k := {h m : (m 1 , . . . , m k ) ∈ N k } . (1.16)
Later on in Section 1.2 we shall define the concept of inverse branches for more general dynamical systems having a countable number of complete branches.

Notice that by definition

h m 1 ,...,m k (x) = [m 1 , . . . , m k-1 , m k + x].
Proposition 1.2. Let (m k ) ∞ k=1 be a sequence of positive integers. Consider the sequences (p k ) ∞ k=1 ⊂ N and (q k ) ∞ k=1 ⊂ N of successive numerators and denominators of the continued fraction expansion associated with the quotients

(m k ) ∞ k=1 , then h m 1 ,...,m k (z) = p k + zp k-1 q k + zq k-1 .
(1.17)

Proof. We proceed by induction. The result is clear for k = 0 as q 0 = p -1 = 1 and p 0 = q -1 = 0 by definition. Assume the result to hold for k, we will prove it for k + 1. Indeed

[m 1 , . . . , m k , m k+1 + z] =  m 1 , . . . , m k + 1 m k+1 +z  = p k + p k-1 m k+1 +z q k + q k-1 m k+1 +z = m k+1 p k + p k-1 + zp k m k+1 q k + q k-1 + zq k ,
and the result follows from Proposition 1.1. ■ Corollary 1.4. Let m 1 , m 2 , . . . be the quotients in the continued fraction expansion of α ∈ I, then for every k ≥ 0 we have

α = h m 1 ,...,m k (T k α) = p k + (T k g α)p k-1 q k + (T k g α)q k-1
.

(1.18)

We remark that the inverse branch

h(z) = [m 1 , . . . , m k + z] satisfies h ′ (z) = (-1) k (q k + zq k-1 ) 2 , thanks to (1.13). Note then that |h ′ (x)| ≤ 1/q 2
k for all x ∈ I. It is important to underline the simplicity of the formula for h ′ (z), which will play a crucial role in the results to come. In particular, we draw the attention to the equality |h ′ (0)| -1/2 = q k , which yields an analytic formula for the denominators purely in terms of the inverse branches h ∈ H ⋆ .

We also note that the sign of the derivative h ′ (z) is not that surprising. Indeed, the inverse branch h a : x → → 1 a+x is decreasing for any a, hence h m 1 • h m 2 is increasing, h m 1 • h m 2 • h m 3 decreasing, and so on. A simple, but very informational consequence of this property is

p 0 q 0 < p 2 q 2 < . . . < α < . . . < p 3 q 3 < p 1 q 1 , (1.19)
namely that the even convergents of α form an increasing subsequence, while the odd convergents constitute a decreasing subsequence. Observe in particular that this means that

|αq k -p k | = (-1) k (αq k -p k ) .
(1.20)

Fundamental Intervals

The monoticity of the inverse branches h = h m 1 ,...,m k ∈ H k implies that the cylinder I m 1 ,...,m k := h(I), which will consist of all reals from I having a continued fraction expansion starting with the digits m 1 , . . . , m k , is an interval with endpoints h(0) = p k q k and h(1) =

p k +p k-1 q k +q k-1 , which has length |I m 1 ,...,m k | = |h(1) -h(0)| = 1 q k (q k + q k-1 )
.

(1.21)

The intervals I m 1 ,...,m k = h m 1 ,...,m k (I) are known as the fundamental intervals of the dynamical system.

We summarize the previous discussion.

DYNAMICAL SYSTEMS AND THE PERRON-FROBENIUS OPERATOR

Proposition 1.3 (Fundamental intervals). The inverse branches h = h m 1 ,...,m k ∈ H k of the Euclidean dynamical system are monotonic. The fundamental interval I m 1 ,...,m k := h m 1 ,...,m k (I), which is the set of all reals from I having a continued fraction expansion starting with the digits m 1 , . . . , m k , has length

|I m 1 ,...,m k | = |h(1) -h(0)| = 1 q k (q k + q k-1 )
.

More generally, the monoticity implies |h([x, y])| = |h(y) -h(x)| .

In particular, from (1.21) we deduce

    α - p k q k     ≤ 1 q 2 k ≤ 2 2 k ,
but we can be even more precise Proposition 1.4. Let α ∈ I be a real number having a continued fraction expansion starting with the digits m 1 , . . . , m k ∈ N, then we have the inequalities

1 q k (q k + q k+1 ) ≤     α - p k q k     ≤ 1 q k q k+1 .
Proof. Apply (1.13) and (1.18) substituting k → → k + 1. ■

As a consequence our convergents [m 1 (α), m 2 (α), . . . , m k (α)] constitute very good approximations to α, the rate of convergence being exponential. In any case something much stronger holds. Continued fractions in fact correspond to optimal approximations of reals by rational numbers. This is explained in detail e.g., in [Khi97, Theorems 16 and 17] which we cite here Proposition 1.5. Let α ∈ I = (0, 1), α ̸ = 1/2. Then the convergents of α satisfy (if the index k does not exceed the depth of α, if the number α were rational)

|αp k (α) -q k (α)| < |αp -q| ,
for all (p, q) ∈ N, with p/q ̸ = p k /q k and 0 < q ≤ q k (α).

We remark that, for α = 1/2, we have |1 • α -1| = |1 • α -0|, and here 1/1 is not a convergent by definition, but this is, in fact, the only exceptional case.

It is therefore said that the convergents correspond to the best approximants of the "second-kind" p/q, minimizing |αp -q| when one bounds q. Proposition 1.5 then tells us that continued fractions do occur naturally when we attempt to approximate reals by rationals.

Observation 1.3 (Dirichlet's Theorem). The inequalities in Proposition 1.4 yield the existence of good approximants to α ∈ (0, 1) in the following sense: for any Q ≥ 1, there are p ∈ Z and q ∈ N such that

 |qα -p| ≤ 1/Q q ≤ Q . Indeed, pick (p, q) = (p k , q k )
where k is the index such that q k ≤ Q < q k+1 . This result is known as "Dirichlet's Theorem", and may also be proved as a direct application of the "pidgeon-hole principle" (see for instance in [START_REF] Hardy | An introduction to the theory of numbers[END_REF]).

Dynamical systems and the Perron-Frobenius operator

In (discrete-time) dynamical systems we are interested in the evolution of the discrete orbit of a map f : X → X on a set X, more precisely, the orbit {x, f (x), f 2 (x), . . .} for an initial point x ∈ X. When the set X

DYNAMICAL SYSTEMS AND THE PERRON-FROBENIUS OPERATOR

33

is given some extra structure, be it topological, or a weight (measure), we would like to know how these evolve in time, along the orbits, for given initial points x ∈ X.

In general we will be concerned with a concrete (and widely applicable) kind of dynamical systems called the interval dynamical systems with complete branches. These systems are naturally associated with the process of numeration, they give a coding of the orbits which characterizes the initial point x as is the case of continued fractions or the decimal expansion.

In Section 1.3 we will consider properties related to the so called measure theoretic dynamical systems. A measure theoretic dynamical system is a tuple (Ω, T, Σ, µ) consisting of a compact set Ω, a σ-algebra Σ, a measurable map T : (Ω, Σ) → (Ω, Σ) and a probability measure µ on Σ. Such systems are quite general and give the context for Ergodic theory.

A general definition of a dynamical system

In this section we introduce the general notion of a dynamical system associated with a numeration process. Of course, numeration involves "digits" (a.k.a., letters) from a countable set A, known as the alphabet. This alphabet is N for the case of continued fractions. Each letter of the alphabet codes information with regard to the position of the orbit at a given moment of time.

Definition 1.3 (Interval dynamical systems). An interval dynamical system of class C k is defined from the following elements

• a countable set A, known as the alphabet.

• disjoint open intervals I a for a ∈ A, such that I =  a∈A I a (a topological partition). • a coding map σ : I → A satisfying σ(x) = a for x ∈ I a .

• a map T : I → I, called the shift map, which satisfies that T | Ia : I a → J a := T (I a ) is bijective for each a ∈ A and of class C k (I a ). The inverses h a := T | -1 Ia : J a → I a are known as the inverse branches of T and we denote H := {h a : a ∈ A} .

Observe that the inverse branches h ∈ H are necessarily monotone, as they are bijections. This means that

|I a | = |h(B) -h(A)| if J a = (A, B).
Such a dynamical system is called complete if J a = I for each a ∈ A, and is called markovian when for each a ∈ A, the images J a are made out of the elements from the topological partition: J a =  a ′ ∈Sa I a ′ for some set S a ⊂ A. That is, an interval system is markovian when

I a ∩ J b ̸ = ∅ implies I a ⊂ J b .
Observe that for a markovian system we have that σ(x) = a implies σ(T x) ∈ S a , hence the name.

Given an initial point x ∈ I we say that T (x) := (x, T x, T 2 x, . . .) is the orbit of x and that M (x) := (σx, σ(T x), σ(T 2 x) . . .) is the infinite word (coding) associated to x. In what follow we will only consider complete interval dynamical systems of class at least C 1 .

Example 1.1. To give a first example of such a complete dynamical system let us consider the binary 1.2. DYNAMICAL SYSTEMS AND THE PERRON-FROBENIUS OPERATOR 34 expansion:

• Consider the alphabet A = {0, 1}.

• The partition I 0 = (0, 1/2) and I 1 = (1/2, 1).

• The map T (x) = 2x mod 1.

Then M (x) is the base two representation of x and the inverse branches are given by

h 0 (x) = x/2 , h 1 (x) = (x + 1)/2 .
We remark that numbers from h 1 (I) begin their binary expansion by 1 while those in h 0 (I) begin their binary expansion by 0. Similarly, for d 1 , . . . , d k ∈ A the sets

h d 1 • . . . • h d k (I) , correspond to the x ∈ I having M (x) starting with d 1 , . . . , d k , i.e., h d 1 • . . . • h d k (I) = {x ∈ I : (σ(x), σ(T x), . . . , σ(T k-1 x)) = (d 1 , . . . , d k )}
It is easy to see that this simple remark applies to all (complete) interval dynamical systems. 3

Definition 1.4 (Fundamental intervals). Consider a complete interval dynamical system of class C k with alphabet A and inverse branches H = {h a : a ∈ A}.

The fundamental interval I a 1 ,...,a k associated with the digits a 1 , . . . , a k is defined by

I a 1 ,...,a k := h a 1 • . . . • h a k (I) . (1.22)
This is indeed an interval as the inverse branches are continuous. We also note that I a 1 ,...,a k corresponds exactly to the reals x ∈ I that have a coding beginning with a 1 , . . . , a k .

Definition 1.5 (Expanding maps). A map T : I → I is said to be expanding if and only if there exists a topological partition of I into countable disjoint open intervals (I a ) a∈A such that

• the restriction T a | Ia : I a → I, T a := T | Ia is monotone and C 1 (I a ) for each a ∈ A.

• |(T n ) ′ | ≥ δ > 1 for some δ > 0 and n ∈ N.

Proposition 1.6. Consider a complete interval dynamical system of class C j , j ≥ 1 associated with the map T . If T is expanding, then the lengths of the fundamental intervals satisfy   I a 1 ,...,a k   → k 0 uniformly. A consequence of this proposition is that the fundamental intervals generate the so-called Borel σ-algebra of I. The Borel σ-algebra of I is the one generated by the open intervals of I. Such property is key for several proofs because, when this is the case, it is enough to prove many things just over the fundamental intervals. We will come back to this property later on in Section 1.3.

Dynamical systems of interest

In this thesis there are three fundamental dynamical systems: the euclidean dynamical system (associated with the Gauss map), the rotation dynamical system and the Continued Logarithm dynamical system. We have already discussed the Euclidean system, here we introduce the other two.

Example 1.2 (Circle rotations). We consider a unit length circle, more precisely T 1 = R/Z, which corresponds to the interval [0, 1] when we identify the points 0 and 1, and a rotation angle α ∈ [0, 1).

The associated rotation is given by R α (x) := (x + α) mod 1. This means that R α (x) = x + α for x ∈ [0, 1 -α) and R α (x) = x + α -1 otherwise (in an abuse of notation identifying [0, 1) with T 1 ).

Figure 1.3: The rotation R α (x) of angle α = ( √ 5 -1)/2.
For reasons that will be made clear in Section 3.2, we introduce the alphabet A = {0, 1} and the topological partition given by

I 0 = [0, 1 -α) (or (0, 1 -α]) and I 1 = [1 -α, 1) (respectively (1 -α, 1] taking 0 ≡ 1).
We note that the shift map R α is clearly invertible as R -1 α = R -α , but this system is not complete (note R α (I a ) ̸ = I) and cannot be made even markovian when α ̸ ∈ Q.

Example 1.3 (Continued logarithm). The continued logarithm expansion is a mutation of the classical continued fractions, introduced by Gosper [START_REF] Shallit | Length of the continued logarithm algorithm on rational inputs[END_REF] in Hakmem.

Formally, the expansion of a number α ∈ I is of the form

α = 2 -a 1 1 + 2 -a 2 . . . , a 1 , a 2 , . . . ≥ 0 ,
and, accordingly, reversing the process, the associated shift T c is given by

T c (x) = 2 -a x -1 , x ∈ I a := (2 -a-1 , 2 -a ) ,
where the symbols a belong to the alphabet A = {0, 1, 2, . . .}. This system is complete and of class C ∞ , with inverse branches h a : I → I a given by

h a (x) = 1 2 a (1 + x)
.

We will come back to this system in Chapter 7, when we will study its associated gcd algorithm.

Pushforward measure -Invariant measure

Almost every dynamical system of interest is what is informally called "chaotic". In such systems it is difficult to predict anything significant regarding the position of T k (x), for large k, without knowing x itself. This is why it is more natural to consider the effect of dynamical systems when an initial distribution or density is given, and study how these evolve as we iterate with the shift map T . The pushforward measure describes precisely how a (probability) measure µ evolves after one iteration of a measurable map T .

Definition 1.6 (Pushforward measure, Measure preserving transformation, invariant measure). Given measurable spaces (Ω 1 , Σ 1 ) and (Ω 2 , Σ 2 ), i.e., Σ i is a σ-algebra over Ω i , a measurable map T : (Ω 1 , Σ 1 ) → (Ω 2 , Σ 2 ) and a measure µ : Σ 1 → [0, ∞], we define the pushforward measure T * µ by

(T * µ)(B) := µ(T -1 B) , (1.23) for B ∈ Σ 2 .
If the spaces coincide, i.e., (Ω 1 , Σ 1 ) = (Ω 2 , Σ 2 ), the map T is said to preserve the measure µ if T * µ = µ . When a probability space (Ω 1 , Σ 1 , µ) is fixed before-hand, we will simply say that T is measure preserving when T * µ = µ. Equivalently, it is said that the measure µ is invariant with respect to T .

The importance of finding invariant measures is realized intuitively from the stationary behavior for T k x for large k. If there were a kind of stationary distribution for T k x then we must have, loosely speaking T * (T k * µ) ≈ T k * µ so that T k * µ approaches an invariant (our "stationary probability") as k → ∞. Since (1.23) can be seen as

 Ω 1 B (x)d(T * µ(x)) =  Ω 1 B •T (x)dµ(x)
for all B ∈ Σ, it follows by measuretheoretic induction that Proposition 1.7 (Integration with respecto to a pushforward measure). Consider a measure space (Ω, Σ, µ) and a measurable map T : Ω → Ω. A measurable map g : Ω → Ω is integrable with respect to the pushforward measure T * µ if and only if g • T is integrable with respect to µ, and then we have the equality

 Ω g(x)d(T * µ(x)) =  Ω g • T (x)dµ(x) .
Example 1.4. We return to the example of circle rotations on the unit circle T 1 = R/Z modulo 1.

For a rotation R α (x) := (x + α) mod .1. It is clear that the uniform (Lebesgue) measure on T 1 is invariant.

When α rational, we may build other invariant measures. For instance, if α = p/q with gcd(p, q) = 1, consider the measure µ given by µ(A) = #{a/q ∈ A : a ∈ Z}/q , so that the measure is actually uniform on the points 0, 1/q, . . . , (q -1)/q. Our rotation R α just permutes these points, hence the reason the measure µ is invariant.

Of course, the invariant measures we just constructed for rational α have "atoms", i.e., measurable sets A such that any strict subset (measurable) of it has 0 measure. For irrationals, as the sequence α, 2α mod 1, 3α mod 1 . . . is dense on I (we will prove this in the next section), we will have a very different behavior: the Lebesgue measure is the only (unique) invariant Borel measure. Intuitively speaking, we may approach any possible translation I + a of an interval I by rotating I enough times. Hence I and I + a should have the same measure, for any invariant measure, and this characterizes the Lebesgue measure. 3

The Perron Frobenius operator

We have described how the map T defining a (interval) dynamical system acts on a measure µ. For the cases of interval dynamical systems, we may speak more concretely about how it acts on a density with respect to the Lebesgue measure λ Leb on I (the uniform probability).

The way the densities evolve as we apply a map T is given by what is called the Perron-Frobenius operator, known as the density transformer.

Definition 1.7 (Perron-Frobenius operator). Consider an interval dynamical system of class C 1 with inverse branches H. Then the Perron-Frobenius operator H : C 1 (I) → C 1 (I) of the system is defined by

H[g](x) =  h∈H |h ′ (x)|g(h(x)
dy |dh 1 (y)| |dh 2 (y)| |dh 3 (y)| Figure 1
.4: Illustration of the derivation of the density of T g x from that of x. The probability of T g x falling around y in a small interval of length "dy" is the sum of the probabilities of x falling within an interval of length "|dh m (y)|" from the respective points h m (y).

The case of the Gauss map; the Gauss density

Let us describe the case of the dynamical system associated to the Gauss map. As we know, this system has inverse branches

h m (x) = 1 m + x , |h ′ m (x)| = 1 (m + x) 2 ,
so that its associated Perron Frobenius operator is

H[g](x) = ∞  m=1 1 (m + x) 2 g  1 m + x  .
In the case of the Gauss map, as well as other interval dynamical systems, the iterates of the Perron Frobenius operator will play a big role, generating expressions of interest. We give here the formula for the Gauss map.

Proposition 1.9. For the Euclidean dynamical system (I, T g ) the iterates of the Perron-Frobenius operator take on the form

H k [g](x) :=  (m 1 ,...,m k )∈N k 1 (q k (m) + xq k-1 (m)) 2 g  p k (m) + xp k-1 (m) q k (m) + xq k-1 (m)  .
(1.25)

Proof. Recall Proposition 1.2. ■

To motivate the ensuing limiting density, known as the Gauss density, we observe that formally when x → ∞ (of course, we do actually have the constraint x ∈ I)

H[g](x) ≈ g(0) ∞  m=1 1 (m + x) 2 ≈ g(0)  ∞ 1 dt (t + x) 2 = g(0) 1 + x ,
which is indeed almost the right guess. Indeed

H  t → → 1 1 + t  (x) = ∞  m=1 1 (m + x) 2 1 1 + 1 m+x = ∞  m=1 1 (m + x)(m + x + 1)
, which is a telescoping sum because

1 (m+x)(m+x+1) = 1 m+x -1 m+x+1 . Thus we get H  t → → 1 1 + t  (x) = 1 1 + x .
This density (with a normalization factor) is known as the Gauss density, and is key to the study of continued fractions as will be made clear in the rest of the chapter. In a letter to Laplace in 1812, Gauss noted [START_REF] Arnoux | Natural extensions and Gauss measures for piecewise homographic continued fractions[END_REF] that the map T g preserves the derived probability measure µ g .

Definition 1.8 (Gauss density -Gauss measure). The Gauss density is given by

ψ(x) := 1 log 2 1 1 + x .
This defines a probability measure over the Borel σ-algebra B I on I, known as the Gauss measure

µ g (A) = 1 log 2  A dx 1 + x , for A ∈ B I .

The case of the CL map

Let us now describe the case of the dynamical system associated to the CL map. As we know, this system has inverse branches

h a (x) = 2 -a 1 + x , |h ′ a (x)| = 2 -a (1 + x) 2 ,
so its associated Perron Frobenius operator is given by

H[g](x) = 1 (1 + x) 2 ∞  a=0 2 -a g  2 -a 1 + x  .
Here the right invariant density ψ c , due to [START_REF] Chan | The asymptotic growth rate of random Fibonacci type sequences[END_REF], is slightly more difficult to guess. The CL density is given by

ψ c (x) := 1 log(4/3) 1 (x + 1)(x + 2)
.

(1.26)

Entropy and dynamical systems

The entropy of a dynamical system is a fundamental quantity that describes the way the system evolves.

Entropy in Information Theory. The reader may be familiar with the concept of entropy in Information Theory [START_REF] Cover | Elements of information theory[END_REF]. For a discrete random variable X taking values with probabilities p 1 , p 2 , . . . the entropy H(X) is defined by

H(X) = -  i p i log p i , (1.27) 1.3. ALMOST EVERYWHERE PROPERTIES

39

where it is understood that 0 log 0 is formally 0.

Given a stochastic process (X i ) ∞ i=1 (i.e., a series of random variables), its entropy, if it exists, is defined by

H(X ) = lim n→∞ 1 n H(X 1 , . . . , X n ) , (1.28)
where H(X 1 , . . . , X n ) is the entropy of the random vector (X 1 , . . . , X n ).

Entropy in Dynamical Systems. Consider now a complete interval dynamical system with shift map T , alphabet A, inverse branches h a 1 ,...,a k ∈ H k and fundamental intervals I a 1 ,...,a k = h a 1 ,...,a k (I).

The digits a 1 (X), a 2 (X), . . ., when we consider a distribution over X ∈ I with measure µ (i.e. P(X ∈ A) = µ(A)), constitute random variables which give rise to a stochastic process. The entropy of this stochastic process H µ is said to be the entropy of the dynamical system with respect to the measure µ and satisfies

H µ (T ) = -lim k→∞ 1 k  (a 1 ,...,a k )∈A k µ (I a 1 ,...,a k ) log µ (I a 1 ,...,a k ) .
(1.29)

Observation 1.4. Notice that in (1.29), the entropy can be rewritten as

H µ (T ) = -lim k→∞ E  1 k log µ (J k (X))  , (1.30)
where J k (x) is the fundamental interval of depth k containing x, and X is distributed according to µ.

The entropy is, then, strongly related to what we call the "real probabilistic framework", and in Section 1.4 we shall point out how the transfer operator relates to the entropy.

Notation 1.1. When we speak about "the entropy" without reference to a measure, the Lebesgue measure is assumed. From Equation 1.30 it is actually seen that this does not change the entropy when µ and λ Leb are equivalent measures in the sense that there exist constants A, B > 0 with Aµ ≤ λ Leb ≤ Bµ.

In Example 1.5 we derive the entropy of the Euclidean system, which equals π 2 6 log 2 , from a classical result of Lévy (Proposition 1.10) and the Dominated Convergence Theorem. We could also derive it with the techniques from Section 1.4 and we point this out in Section 1.4.6.

Almost everywhere properties 1.3.1 Introduction

In Section 1.1 we described some classical properties of continued fractions, however, the great interest of continued fractions lies also in their analytic properties! We now get into some classical, yet very important statistics regarding the continued fraction expansion of a real number from I.

We study the properties of the Gauss map T g : x → → {1/x} in more detail, in particular its interplay with the Lebesgue measure λ Leb , demonstrating a sort of stationary behavior of the dynamical system, namely its ergodicity.

First, it is important to remark that the σ-algebra generated by the fundamental intervals

I m 1 ,...,m k := h m 1 • • • • • h m k (I), with k ≥ 0 and m 1 , . . . , m k ≥ 1, is the Borel σ-algebra B I .
It is clear that the σ-algebra generated by the fundamental intervals is a subset of B I , but the fact that they generate the whole of B I will come in handy later on: it will be enough to prove most things over fundamental intervals, on which T g behaves nicely.

ALMOST EVERYWHERE PROPERTIES 40

To see why the fundamental intervals I m 1 ,...,m k generate the Borel σ-algebra, notice that the lengths |I m 1 ,...,m k | tend to 0 uniformly as k → ∞ (we have stated a more general result in Proposition 1.6), hence any interval (a, b) ⊂ I may actually be produced as a countable union of fundamental intervals by considering the continued fraction expansions of the borders a and b of the interval.

The other important concept, Ergodicity, implies a "stationary behavior" (Theorem 1.1). It can be thought of as a sort of "escape property", points from anywhere in the dynamical system will always escape, as we apply our map T , from any set smaller than the whole space (in terms of measure).

Definition 1.9 (Ergodic transformation -ergodic measure). Let (Ω, B, µ) be a probability space and let T : Ω → Ω be a measurable transformation. We say that T is ergodic (or µ is ergodic with respect to T ) if and only if the implication

T -1 (B) = B =⇒ µ(B) = 0 or µ(B) = 1 , (1.31)
holds for every measurable set B.

We note that [START_REF] Billingsley | Ergodic Theory and Information[END_REF] actually adds the condition that T be a measure-preserving transformation to the definition of ergodicity, thus not adding the condition to the Ergodic Theorem below (Theorem 1.1). On the other hand, [START_REF] Pollicott | Dynamical systems and ergodic theory[END_REF] or [START_REF] Einsiedler | Ergodic theory with a view towards number theory[END_REF] define an ergodic transformation the way we do, and add explicitly the condition that the transformation be measure-preserving to the Ergodic Theorem.

Birkhoff's Ergodic Theorem

The fundamental consequence of the "ergodicity" is Birkhoff's Ergodic Theorem (Theorem 1.1 below), which roughly tells us that the "time averages" approach the "space average": the proportion of time spent by the orbit x, S(x), S 2 (x), . . . on some part B of the space Ω is given µ(B).

Theorem 1.1 (Birkhoff's Ergodic Theorem). Let (Ω, B, µ) be a probability space and let T : Ω → Ω be an ergodic measure-preserving transformation. Then the time and space averages coincide, more precisely

lim n→∞ 1 n n-1  k=0 f  T k (x)  = E µ [f ] ,
for almost every x ∈ Ω and f ∈ L 1 (Ω, B, µ).

Birkhoff's Ergodic Theorem may also be thought of as a generalization of the law of large numbers. Indeed, the law of large numbers corresponds to the case in which x, T (x), T 2 (x), . . . are independent and identically distributed a .

We remark that this is not the most general form of Theorem 1.1. The hypothesis that T be an ergodic transformation may be dropped (it remains measure-preserving), with the cost that the resulting limit becomes a random variable given by a conditional expectation. See [START_REF] Einsiedler | Ergodic theory with a view towards number theory[END_REF] for more details.

Ergodicity of the Gauss map and CL map

We now prove that the system (I, T g , B I , µ g ) associated with the Gauss Map T g (x) = 1 x mod 1 is ergodic. Theorem 1.2. The measure preserving dynamical system (I, T g , B I , µ g ) is ergodic.

Proof. The plan is as follows: we will prove that if T -1 g A = A with A measurable, then

µ g (A)µ g (B) ≤ Cµ g (A ∩ B) (1.32)
holds for a certain constant C > 0 and all B ∈ B I . Of course, taking B = A c , this implies that either µ g (A) = 0 or µ g (A) = 1, the desired conclusion.

a More precisely this happens on a product space with T being T (X1, X2, . . .) = (X2, X3, . . .).

Since the fundamental intervals (I m 1 ,...,m k ) generate the σ-algebra B I , it is enough to prove (1.32) for B being an arbitrary fundamental interval B = I m 1 ,...,m k . Let A be an invariant set, that is T -1 g A = A. Then we want to show that µ g (A) is either 0 or 1.

Since T -1

g A = A, we observe that (always bearing we chose B = I m 1 ,...,m k )

µ g (A ∩ I m 1 ,...,m k ) = µ g  T -k g A  ∩ I m 1 ,...,m k  ,
thus, if it is true that for a certain constant C > 0 and all A ∈ B I we have

µ g (A)µ g (I m 1 ,...,m k ) ≤ Cµ g  T -k A  ∩ I m 1 ,...,m k  (1.33)
for all A ∈ B I and m 1 , . . . , m k ≥ 1, the result will follow.

Clearly, it is enough to prove this result changing the Gauss measure µ g for the Lebesgue measure λ Leb because they are equivalent measures as we have (bounding the integrand)

1 2 log(2) λ Leb (D) ≤ µ g (D) ≤ 1 log(2)
λ Leb (D) , ∀D ∈ B I .

(1.34) Therefore, it suffices to prove that for a certain constant  C > 0

λ Leb (A) λ Leb (I m 1 ,...,m k ) ≤  Cλ Leb  T -k g A  ∩ I m 1 ,...,m k 
holds for all k ≥ 0, m 1 , . . . , m k ≥ 1 and A ∈ B I .

Since we want to prove the latter inequality for all A ∈ B I , it is enough to prove it for an arbitrary interval A = [x, y] with x < y, as these generate the σ-algebra of Borel sets B I .

Now observe (key!) that

 T -k g A  ∩ I m 1 ,...,m k = h m 1 ,...,m k ([x, y]) so that λ Leb  T -k g A  ∩ I m 1 ,...,m k  = λ Leb (h m 1 ,...,m k ([x, y])) = |h m 1 ,...,m k (y) -h m 1 ,...,m k (x)|
which reduces, by the determinant property (1.13), to

|h m 1 ,...,m k (y) -h m 1 ,...,m k (x)| =     p k + yp k-1 q k + yq k-1 - p k + xp k-1 q k + xq k-1     = |y -x| (q k + yq k-1 )(q k + xq k-1 )
.

Now λ Leb (I m 1 ,...,m k ) = λ Leb (h m 1 ,...,m k ([0, 1]) = 1 q k (q k +q k-1
) and of course we have q k-1 ≤ q k , hence

1 q k (q k + q k-1 ) ≤ 2 × 1 (q k + q k-1 ) 2 ≤ 2 × 1 (q k + yq k-1 )(q k + xq k-1 ) , thus proving that λ Leb (A) λ Leb (I m 1 ,...,m k ) ≤ 2λ Leb  T -k g A  ∩ I m 1 ,...,m k  ,
and the result follows. ■ Observation 1.5. We note that the previous proof comes down to the following key points:

(i) the fundamental intervals generate the Borel σ-algebra B I .

(ii) the given invariant measure µ is equivalent to the Lebesgue measure.

(iii) there is a constant C such that |h ′ (y)|/|h ′ (x)| ≤ C for all x, y ∈ I and inverse branches h ∈ H * .

ALMOST EVERYWHERE PROPERTIES

For an expanding map T , we have immediately (i) by the same argument given for the Gauss map, while for (iii) we note that the inverse branches are monotone and therefore h ′ does not change sign, hence (iii) may be restated in terms of having

|(log |h ′ (x)|) ′ | = |h ′′ (x)/h ′ (x)| ≤ C 1 for some C 1 .
All of these properties are immediate for the CL dynamical system, while (ii) is also immediate as the invariant density ψ c (x) satisfies

1 6 log(4/3) ≤ ψ c (x) = 1 log(4/3) 1 (x + 1)(x + 2)
≤ 1 2 log(4/3) .

Consequences of ergodicity: frequency of digits

We now explain the classical estimates for continued fractions that derive from this Theorem.

Corollary 1.5. For almost every real number x = [m 1 , m 2 , . . .] ∈ I, the frequency of the digit j ≥ 1 equals

lim N →∞ 1 N #{i : 1 ≤ i ≤ N, m i (x) = j} = 1 log 2 log  1 + 1 j(j + 2)  . (1.35) Proof. Note that m(x) = j if and only if x ∈ I j =  1 j+1 , 1 j 
. Thus, by the Birkhoff Ergodic Theorem applied to the characteristic function 1 I j we get

lim N →∞ 1 N #{i : 1 ≤ i ≤ N, m i (x) = j} = µ g (I j ) =  1/j 1/(j+1) ψ(x)dx ,
which yields the result. ■

Observation 1.6. The above distribution given by (1.35) is known as the Gauss-Kuzmin distribution. Similar kinds of stationary distributions can be derived for any number of consecutive partial quotients

lim N →∞ 1 N #{i : 1 ≤ i ≤ N, m i+1 (x) = j 1 , . . . , m i+k = j k } = µ g (I j 1 ,...,j k ) = 1 log 2 1 1 + p k (j) q k (j) |I j 1 ,...,j k | + O  |I j 1 ,...,j k | 2  .
This can be restated as follows

lim N →∞ 1 N #{i : 1 ≤ i ≤ N, T i x ∈ [y, y + δ]} = 1 log 2 1 1 + y δ + O(δ 2 ) , δ → 0 .
Corollary 1.6. For almost every real number x = [m 1 , m 2 , . . .] ∈ I, the arithmetic and geometric means of the quotients satisfy

lim N →∞ (m 1 • • • m N ) 1/N = ∞  j=1  1 + 1 j(j + 2)  log j/ log 2 . (Kuzmin constant)
and lim

N →∞ m 1 + • • • + m N N = ∞ .
(1.36)

Proposition 1.10 (Lévy's constant). For almost every real number x = [m 1 , m 2 , . . .] ∈ I, the continuants

(q k (x)) ∞ k=1 satisfy lim N →∞ 1 N log q N (x) = π 2 12 log 2 , (1.37)
and the constant appearing on the right-hand side is known as the Lévy constant.

ALMOST EVERYWHERE PROPERTIES

Proof. In this case applying the Ergodic Theorem is not immediate. To take the expression lim N →∞ 1 N log q N (x) to the form of the Ergodic Theorem, we note that p k (x) = q k-1 (T g x) so that

1 q N (x) = p N (x) q N (x) p N -1 (T g x) q N -1 (T g x) • • • p 1 (T N -1 g x) q 1 (T N -1 g (x)
) , because of the telescoping taking place, indeed p N -j (T j g x) = q N -j-1 (T j+1 g

x). Thus we get

log 1 q N (x) = N -1  k=0 log p N -k (T k g x) q N -k (T k g x) ,
which is almost of the form needed to apply the Ergodic Theorem, were it not for the fact that the function

x → → p N -k (x)
q N -k (x) depends on k and N . To get around this, we note that x → →

p N -k (x) q N -k (x)
is in general a good approximation of the identity function. Thus we must find a bound for

∆ N (x) :=      N -1  k=0  log p N -k (T k g x) q N -k (T k g x) -log T k g x      , which makes 1 N ∆ N (x) → 0, in order to conclude lim N →∞ 1 N log 1 q N (x) = lim N →∞ 1 N N -1  k=0 log T k g x = 1 log 2  1 0 log x 1 + x dx .
Showing that the integral gives the desired constant

 1 0 log x 1 + x dx = - π 2 12
follows simply from term-wise integration of the sum

1 1+x = 1 -x + x 2 ∓ • • • + (-1) m x m + (-1) m+1 x m+1 1+x and  (-1) k /k 2 = -π 2 /12.
Fix k, let us look at how big the difference

     log p N -k (T k g x) q N -k (T k x) -log T k g x      =      log  (T k g x) × q N -k (T k g x) p N -k (T k g x)     
, actually is. Of course, to study log u with u close to 1, we look at the corresponding u -1, for us

(T k g x) × q N -k (T k g x) p N -k (T k g x) -1 =  T k g x - p N -k (T k g x) q N -k (T k g x)  × q N -k (T k g x) p N -k (T k g x) ,
and we recall

  T k g x - p N -k (T k g x) q N -k (T k g x)    ≤ (q N -k (T k g x)) -2 hence for N -k ≥ 2      (T k x) × q N -k (T k g x) p N -k (T k g x) -1      ≤ 1 p N -k (T k g x)q N -k (T k g x) ≤ 1 2 . Since |log u| ≤ 2|u -1| for u ∈ [ 1 2 , 3 2 ],
which applies to our difference whenever k ≤ N -2

1.3. ALMOST EVERYWHERE PROPERTIES 44 ∆ N (x) ≤ N -1  k=0      log p N -k (T k g x) q N -k (T k g x) -log T k g x      = N -1  k=0      log  (T k g x) × q N -k (T k g x) p N -k (T k g x)      ≤ 2 N -1  k=0      (T k g x) × q N -k (T k g x) p N -k (T k g x) -1      ≤ 2 N -1  k=0 1 p N -k (T k g x)q N -k (T k g x) ≤ 2 N -1  k=0 2 -(N -k-1)/2 ≤ 2 ∞  k=0 2 -k/2 = 2 1 - √ 2/2 .
Thus 1 N ∆ N (x) tends to 0, yielding the result. ■

Example 1.5 (Entropy of the Euclidean system). We now compute the entropy of the Euclidean dynamical system with respect to the Lebesgue measure, recall the definition of entropy from Section 1.2.7. By definition

H(T g ) = -lim k→∞ E  1 k log λ Leb (J k (X))  ,
where J k (x) is the fundamental interval of depth k containing x and X is drawn according to the uniform distribution. We recall that for the Euclidean system, the interval of depth k containing X is the one delimited by p k (X) q k (X) and

p k (X)+p k-1 (X)
q k (X)+q k-1 (X) as follows from Section 1.1.5. Thus we derive

H(T g ) = -lim k→∞ E  1 k log 1 q k (X) (q k (X) + q k-1 (X))  .
Since 0 < q k-1 (X) ≤ q k (X) we deduce that

H(T g ) = 2 lim k→∞ E  1 k log q k (X)  .
From Proposition 1.10 we would expect the entropy H to equal π 2 6 log 2 . This is not immediate, as the random variable 1 k log q k (X) is not bounded in general (build X from a sequence m 1 , m 2 , . . . that grows very fast). However, 1 k log q k (X) is bounded almost everywhere by a fixed constant B > 0 (see [Khi97, Theorem 31, pp.65-68]), whence we derive the entropy by the Dominated Convergence Theorem (see [Fol99]).

In all

H(T g ) = π 2 6 log 2 . (1.38)
Example 1.6 (Continued logarithm). We continue with the example of the Continued Logarithm from Example 1.3. We noted already in Observation 1.5 that the map T c is Ergodic with respect to (I, B I , µ c ), where µ c is the invariant measure given by dµ c (x) = ψ c (x)dx, a fact that was already noted by Chan in [START_REF] Chan | The asymptotic growth rate of random Fibonacci type sequences[END_REF].

It follows that we may apply Birkhoff's Ergodic Theorem, from which we derive the following result.

Proposition 1.11. For almost every x ∈ I, the digits (a i (x)) of the CL expansion of x from Example 1.3 satisfy

lim N →∞ a 1 (x) + . . . + a N (x) N = log(3/2) log(4/3) . (1.39)
We notice immediately that the digits of the CL expansion are much smaller than those of classical continued fractions (see Corollary 1.6). This is to be expected from the fact that we are coding the exponents. In fact, it is similarly true that the averages of log m i (x) converge almost everywhere (see the first part of Corollary 1.6).

Proof. Since for almost every x we have a 1 (x) = ⌊log 2 (1/x)⌋ and a k (x) = a 1 (T k-1 c

x), it follows at once from the Ergodic Theorem that

lim N →∞ a 1 (x) + . . . + a N (x) N = 1 log(4/3)  1 0 ⌊log 2 (1/z)⌋ dz (z + 1)(z + 2)
.

We now compute this integral

 1 0 ⌊log 2 (1/z)⌋ dz (z + 1)(z + 2) = ∞  k=1 k  2 -k 2 -k-1 dz (z + 1)(z + 2) ,
and we remark that

1 (z+1)(z+2) = 1 z+1 -1 z+2 , thus  2 -k 2 -k-1 dz (z + 1)(z + 2) =  2 -k 2 -k-1 dz z + 1 -  2 -k 2 -k-1 dz z + 2 =  2 -k 2 -k-1 dz z + 1 -  2 -k-1 2 -k-2 dz z + 1
by performing a change of variables in the second integral. Thus if

I k :=  2 -k 2 -k-1 dz z+1 we get  1 0 ⌊log 2 (1/z)⌋ dz (z + 1)(z + 2) = - ∞  k=1 k∆I k = I 1 + ∞  k=1 I k+1 =  1/2 0 dz z + 1 ,
were we applied summation by parts, and this equals log(1/2 + 1) = log(3/2). ■

Example 1.7. We show that, for an irrational α ̸ ∈ Q, the circle rotation R α : x → → (x + α) mod 1 is ergodic with respect to the Lebesgue measure. For the proof we follow [START_REF] Einsiedler | Ergodic theory with a view towards number theory[END_REF].

Two important remarks

• Observe that if B is an invariant measurable set, meaning that R -1 α B = B, then 1 B = 1 B • R α almost everywhere.

• Now the key observation. Since α is irrational, the points 0, α, 2α, 3α, . . . taken in T 1 (i.e., modulo 1) are dense in the circle T 1 . To see why, note that n • α + m • 1 = δ can be arbitrary small (this follows from Observation 1.3) and then consider for s ∈ (0, 1) consider ⌊ s δ ⌋n • α modulo 1, which satisfies

  ⌊ s δ ⌋n • α + ⌊ s δ ⌋m -s   ≤ |δ|.
Thus the distance d T 1 (s, ⌊ s δ ⌋n • α mod 1) on T 1 is at most δ. Suppose then that B were an invariant measurable set. Let f ∈ C(T 1 ) be such that ∥f -1 B ∥ 1 < ϵ.

Then we have ∥f • R k α -f ∥ 1 < 2ϵ, as follows from the first remark and the fact that for any integrable g we have  g =  g•R α , because the Lebesgue measure is translation invariant. Since kα can be made arbitrarily close to any s ∈ T 1 (by density) and f is continuous, we deduce that the inequality ∥f

• R s -f ∥ 1 < 2ϵ holds too. Thus   f -  f (s)ds    1 =       (f (x) -f (x + s))ds     dx ≤  ∥f -f • R s ∥ 1 ds ≤ 2ϵ ,
by applying the triangle inequality and Tonelli's Theorem [Fol99].

Thus we deduce that

∥1 B -λ Leb (B) ∥ 1 ≤ ∥1 B -f ∥ 1 +   f -  f (s)ds    1 + ∥  f (s)ds -λ Leb (B) ∥ 1 < 4ϵ .
Since ϵ > 0 was arbitrary, we conclude that actually ∥1 B -λ Leb (B) ∥ 1 = 0 and so 1 B (x) = λ Leb (B) for almost every x ∈ T 1 , implying that either λ Leb (B) is 0 or 1.

As a consequence of Definition 3.4 and Theorem 1.1, for every irrational angle α ∈ I \ Q we have that for almost every x the "time average" equals the space average

lim N →∞ 1 N N -1  k=0 f • R k α (x) =  1 0 f (s)ds ,
for any f ∈ L 1 (I, B I , λ Leb ).

In particular this tells us that for almost every initial point x ∈ S 1 and interval

I ⊂ S 1 lim N →∞ 1 N N -1  k=0 1 I  R k α (x)  = |I| ,
the frequency of time spent by the rotation on an interval I equals its length (as we have a unit length circle). However there is still this somewhat annoying "almost every x" condition regarding the initial point. The convergence actually holds for every initial point x ∈ S 1 and f ∈ C(S 1 ), as the system is what is called "uniquely ergodic". We will not get into much detail regarding unique ergodicity, in any case it is fair to say that a dynamical system is uniquely ergodic if and only if it has a unique invariant measure.

The fact that it holds for continued functions will imply (by bounding from above and below) the result for intervals that we will later need.

Proposition 1.12. Let α be an irrational. Given an interval I ⊂ T 1 and x is any point x ∈ T 1 , the orbit of the irrational rotation R α of angle α, starting from x, spends a fraction of time proportional to the length |I| on the interval I, namely

lim N →∞ 1 N N -1  k=0 1 I (R k α x) = |I| .
(1.40)

The above proposition could have been derived as a consequence of the so-called "uniform distribution modulo 1", u.d.mod1 for short. Informally, a sequence x 1 , x 2 , . . . is uniformly distributed modulo 1 if and only if the fractional parts {x k } spend |J| proportion of the time on the interval J ⊂ I. There is a classical criterion (the Weil criterion) which gives a necessary and sufficient condition for u.d.mod1, which is quite direct to verify in the case of the irrational rotations. A book of reference on the subject is [START_REF] Kuipers | Uniform distribution of sequences[END_REF].

Large digits in the expansion: the Borel-Bernstein Theorem

There is finally one other important property regarding the quotients m k of the continued fraction expansions that will be of great interest to us. We know so far that m k = s occurs with frequency ∼ 1 log 2 1 s 2 almost surely (see Corollary 1.5), and we know that the arithmetic mean (m 1 + . . . + m N )/N tends to infinity almost surely (see Corollary 1.6). Can we give asymptotic bounds for the "large quotients" m k in terms of the index k? The answer to this question is be given by the so-called Borel-Bernstein Theorem [START_REF] Kesseböhmer | Infinite ergodic theory of numbers[END_REF] which we prove in two parts.

The principle of the proof is not reduced only to continued fractions, and we will underline the corresponding results for the continued logarithm. These, as far as the author is aware, do not appear in the literature.

As we intend to prove an almost everywhere result, which concerns an infinite number of quotients m N , it comes as no surprise that the Borel-Cantelli Lemma will be involved. The first Borel-Cantelli Lemma gives a criterion to decide when a series of events on a measurable space are "transient", meaning that almost every point of the space will be in only finitely many events.

Thus it is important to highlight the following definition which comes in handy when stating the Borel-Cantelli Lemma 1.3. ALMOST EVERYWHERE PROPERTIES Definition 1.10. Let (X, M, µ) be a measure space and suppose A 1 , A 2 , . . . are measurable sets. We define the set i.o. A n , which reads infinitely often A n , by

i.o. A n := lim sup A n = ∞  n=1  k≥n A k .
(1.41)

In other words, x ∈ X \ (i.o. A n ) iff from some n 0 (x) we have x ̸ ∈ A k for all k ≥ n 0 (x).

Theorem 1.3 (Borel-Cantelli Lemma). Let (X, M, µ) be a measure space and suppose A 1 , A 2 , . . . are measurable sets such that

 µ (A k ) < ∞ .
Then the set i.o. A n = lim sup A n has measure 0. In other words, for almost every x ∈ X there is n 0 (x) such that x ̸ ∈ A k for all k ≥ n 0 (x).

Proof. Let B n :=  k≥n A k and observe that

µ(B n ) = µ    k≥n A k   ≤  k≥n µ (A k ) < ∞ .
This is the tail of a convergent series, therefore

 k≥n µ (A k ) → 0 as n → ∞, hence µ(B n ) → 0.
Clearly B n is a decreasing sequence of sets, and the above equation proves that µ(B 1 ) < ∞, thus

µ (i.o. A n ) = µ   n≥1 B n  = lim n→∞ µ(B n ) ,
and this number equals 0. ■ Now we come to the digits (or quotients) m n (x) of the continued fraction expansion of x. The corresponding application of the previous Borel-Cantelli Lemma gives Theorem 1.4 (Borel-Bernstein). Let f : N → R >0 be such that

 n 1/f (n) < ∞. Then for almost every x ∈ I the inequality m n (x) < f (n) (1.42)
holds for all large enough n.

Proof. Let us consider

A k := {x ∈ I : m k (x) ≥ f (k)}. Then we note that λ Leb (A k ) ≤  m 1 ,...,m k-1 ≥1   h m 1 ,...,m k-1   0, 1 f (k)     , simply because m k (x) ≥ f (k) implies 1/T k-1 x ≥ f (k), i.e., x ∈ h m 1 ,...,m k-1   0, 1 f (k)   for some coefficients m 1 , . . . , m k-1 ≥ 1.
Here by the monoticity of h and the mean-value theorem we have

  h m 1 ,...,m k-1   0, 1 f (k)     = |h m 1 ,...,m k-1 (0) -h m 1 ,...,m k-1 ( 1 f (k) )| ≤ |h ′ m 1 ,...,m k-1 (0)| f (k) , and since |h ′ m 1 ,...,m k-1 (0)| = 1/q 2 k-1 ≤   I m 1 ,...,m k-1   we obtain, from  m 1 ,...,m k ≥1 |I m 1 ,...,m k-1 | = 1, that λ Leb (A k ) ≤ 1 f (k) .
Thus the result follows from the Borel-Cantelli Lemma Theorem 1.3. ■

ALMOST EVERYWHERE PROPERTIES 48

We see that Theorem 1.4 tells at once that almost surely

m n (x) < n (log n) 1+ϵ ,
for all large enough n, when ϵ > 0. We will see conversely that n log n is, in a way, a kind of threshold for m n (x) as m n (x) > n log n will hold almost surely for infinitely many indices n.

Observation 1.7. The same proof reads almost ad verbum for the continued logarithm and many other dynamical systems. Indeed, for a complete interval dynamical system having digits in an infinite alphabet A ⊂ N we require just the following key steps and hypothesis:

• Define A k =  a 1 ,...,a k-1 ∈A h a 1 ,...,a k-1    j∈A:j≥f (k) I j   , I j = h j (I) .
• There is a constant C > 0 such that |h ′ (y)/h ′ (x)| ≤ C for all x, y ∈ I and h ∈ H * .

• The function f (k) is strictly increasing for large enough k, hence invertible for large enough k. It is key to note then that #{k :

a ≥ f (k)} = f -1 (a) + O(1).
And we get the following result for the digit sequence a 1 (x), a 2 (x), . . ., for almost every x ∈ I.

Proposition 1.13. Consider a complete interval dynamical system of class C 1 with associated shift map T : I → I and inverse branches h a labeled by A ⊂ N. Suppose further that, for some fixed constant C > 0 independent from the choice of the inverse branch, every inverse branch h ∈ H * of the system satisfies |h ′ (y)/h ′ (x)| ≤ C for all x, y ∈ I. Let f be a strictly increasing function such that the condition

 a∈A f -1 (a) × λ Leb (h a (I)) < ∞ (1.43)
is satisfied. Then for almost every x ∈ I, the digit sequence a 1 (x), a 2 (x), . . . satisfies

a n (x) < f (n) ,
for all large enough n.

Example 1.8 (Continued fractions). The difference in the statements of Theorem 1.4 and Proposition 1.13 is simply due to the fact that during the proof of Theorem 1.4 we exploited the particular ordering of the fundamental intervals, which gives the equality {x : m(x) ≥ f (k)} = (0, 1 f (k) ], while for the other, we cannot suppose such an equality and we are forced to reverse a double sum and count.

Nevertheless, Proposition 1.13 does yield that the digits of classical continued fractions satisfy m n (x) < n(log n) 1+ϵ for large enough n.

Indeed, we show how to reverse f (n) = n(log n) 1+ϵ asymptotically. We have

log n = log f (n) -(1 + ϵ) log log n = log f (n) -(1 + ϵ) log(log f (n) -(1 + ϵ) log log n) = log f (n) -(1 + ϵ) log log f (n) + log  1 -(1 + ϵ) log log n log f (n)  ,
and here log n < log f (n). Thus

f -1 (a) = a (log a) 1+ϵ ×  1 -(1 + ϵ) log log f -1 (a) log a  ,
and log f -1 (a) < log a implies log log f -1 (a) log a

= O 

log log a log a  as a → ∞. Given this asymptotic formula and λ Leb (h a (I)) = 1 a(a+1) , Proposition 1.13 yields that for a.e., x, m a (x) < a(log a) 1+ϵ for large enough a.

Example 1.9 (Continued logarithms). Here λ Leb (h a (I)) = 1/2 a+1 for a ∈ A = {0, 1, 2, . . . , }, thus picking ϵ > 0 and f -1 (a) = (2 -ϵ) a we get that for almost every x ∈ I

a n (x) < log n log(2 -ϵ)
holds for all large enough n.

A more precise analysis yields that for almost every x ∈ I a n (x) < log 2 n + log 2 log 2 n + (1 + ϵ) log 2 log 2 log 2 n, holds for all large enough n.

Theorem 1.5 (Borel-Bernstein). Let f : N → R >0 be such that  n 1/f (n) = ∞.
Then the inequality m n (x) ≥ f (n) holds for infinitely many indices n.

If the variables m n (x) for n ≥ 1 were independent, this result would follow from the classical "converse" of the Borel-Cantelli Lemma (on a probability space), which tells us that if  P(A n ) = ∞ and (A i ) are mutually independent, then P  i.o.A n  = 1. This is not our case however, but the same proof still holds if an inequality such as

P(A n+1 = s|A 1 = s 1 , . . . , A n = s n ) ≥ CP(A n+1 = s) ,
holds for some C > 0.

Thus, in order to prove this result, we rely on a lemma which tells us that the probability of finding m k+1 (x) = s, given the knowledge of m 1 , . . . , m k , is always of order Θ(1/s 2 ).

Lemma 1.1. Consider integers m 1 , . . . , m k ≥ 1 and s ≥ 1. Then, the conditional probability, with respect to the Lebesgue measure on I, of having

m k+1 (x) = s given that m 1 (x) = m 1 , . . . , m k (x) = m k , which is given by |I m 1 ,...,m k ,s |/|I m 1 ,...,m k |, satisfies the inequalities 1 3 1 s 2 ≤ |I m 1 ,...,m k ,s | |I m 1 ,...,m k | ≤ 2 1 s 2 .
(1.44)

Proof. We remark that by from Proposition 1.3

|I m 1 ,...,m k ,s | =   h m 1 ,...,m k ( 1 s+1 ) -h m 1 ,...,m k ( 1 s )    =     p k (s + 1) + p k-1 q k (s + 1) + q k-1 - p k s + p k-1 q k s + q k-1    
which by (1.13) equals

|I m 1 ,...,m k ,s | = 1 (sq k + q k-1 )((s + 1)q k + q k-1 )
.

Therefore |I m 1 ,...,m k ,s | |I m 1 ,...,m k | = 1 s 2 1 + q k-1 q k (1 + q k-1 sq k )(1 + 1/s + q k-1 sq k ) , hence we find 1 3 1 s 2 ≤ |I m 1 ,...,m k ,s | |I m 1 ,...,m k | ≤ 2 1 s 2 . ■ Proof.
[Theorem 1.5] If we had m n (x) < f (n) for all n from N to N + M , an event which we call E N,M , we note that conditioning

λ Leb (E N,M +1 ) =  s<f (n) λ Leb (m N +M +1 (x) = s|E N,M ) λ Leb (E N,M ) .
Here we are going to apply our bounds on the conditional probability, first we write the sum in a more convenient form

 s<f (n) λ Leb (m N +M +1 = s|E N,M ) = 1 -  s≥f (n) λ Leb (m N +M +1 = s|E N,M ) , 1.3. ALMOST EVERYWHERE PROPERTIES 50
and therefore, from the bound we get

 s<f (n) λ Leb (m N +M +1 = s|E N,M ) ≤ 1 - 1 3  s≥f (n) 1 s 2 ≤ 1 - 1 3 1 f (n) ,
where we have applied

 s≥t 1/s 2 ≥  ∞ t ds/s 2 = 1/t. Thus we derive λ Leb (E N,M +1 ) ≤  1 - 1 3 1 f (n)  λ Leb (E N,M ) ≤ • • • ≤ M  k=0  1 - 1 3f (n)  ,
which converges to 0 as M → ∞ by the divergence of  1/f (n). Indeed, from the classical inequality

e x ≥ 1 + x for all x ∈ R we derive 1 -1 3f (n) ≤ exp(-1 3f (n)
). Thus we have proved, as λ Leb (I) = 1 < ∞ and E N,M +1 ⊂ E N,M decreases in M , that we have λ Leb (E N ) = 0 where E N :=  M ≥N E N,M . Now we are done, because the probability that there exists

N such that m n (x) < f (n) for all n ≥ N is λ Leb (  ∞ N =1 E N ) = 0 . ■
Thus, the previous Theorems tell us that m N (x) is roughly N log N in the "worst-case".

Corollary 1.7. Let ϵ > 0. For almost every x ∈ I the partial quotients m N (x) of the continued fraction expansion of x satisfy the limits

lim N →∞ m N (x) N (log N ) 1+ϵ = 0 , and lim sup N →∞ m N (x) N log N = ∞ ,
meaning that there is an increasing sequence N k of positive integers (depending on x) such that

lim k→∞ m N k (x) N k log N k = ∞ .
The Borel-Bernstein Theorem (divided into Theorem 1.4 and Theorem 1.5) as well as Corollary 1.7 apply in the context of the recurrence function of Sturmian words, namely Theorem 3.4, first proved by Morse and Hedlund in [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF], which gives information regarding the "worst-case" for the recurrence function of Sturmian words.

Real probabilistic framework

In Section 1.3 we studied the continued fraction expansion of almost every real number x ∈ I, namely up to a set of measure (or probability) zero. It is worth noting that the results from Section 1.3, even though the limits are explicit, all involve convergence rates that may vary widely according to the real number x ∈ I that is considered (fixed). In this section we introduce what we call the "Real probabilistic framework": here we do not study a fixed x ∈ I anymore, but the behavior of larger sets on average or distribution.

Given a random X ∈ I with continued fraction expansion m 1 (X), m 2 (X), . . ., we stop the expansion at a given position k and study the average properties of the resulting rational [m 1 (X), m 2 (X), . . . , m k (X)], which will be our random variable of interest.

Similarly, we may ask analogous questions for the continued logarithm expansion and other interval dynamical systems. The main tool to perform such studies is in fact the Perron Frobenius operator, as well as a generalization of it: the so-called transfer operator.

We recall Definition 1.7: the Perron-Frobenius operator H for an interval dynamical system of class C 1 is defined formally by the expression

H[g](x) :=  h∈H |h ′ (x)|g(h(x)) ,
for an input function g that must belong to an "appropriate" functional space.

The Perron Frobenius operator describes how the densities evolve after one iteration of the corresponding map of the system. Thus, if g is the density of the random variable X, then H[g] is the density of T (X). In particular, we remark that g is an invariant density if and only if it satisfies H[g] ≡ g.

When we iterate the Perron Frobenius operator k times we get

H k [g](x) :=  h∈H k |h ′ (x)|g(h(x)) ,
involving the depth k inverse branches H k . Thus the powers of the Perron Frobenius operator follow the evolution of the densities of the system.

Often, the Perron-Frobenius operator H has a behavior which resembles that of matrices; the iterate H k is determined by the so-called spectrum of H, with the dominant eigenvalues being the most determinant.

Our target properties for H are the following:

(P1) There is a unique and simple dominant eigenvalue λ = 1 for H.

(P2) There is a so-called spectral gap: the dominant eigenvalue is separated from the rest of the spectrum.

Then the iterates of H, which describe the evolution of the process, are asymptotically determined by the corresponding projection onto the eigenspace of λ = 1 and the corresponding eigenvector ϕ, which gives the invariant density after normalization.

Indeed, then [START_REF] Baladi | Systèmes dynamiques et algorithmique[END_REF] one has an appropriate decomposition H = P + N, where P is the projector over the dominant eigenspace (given by P[f ](t) = ϕ(t)  I f (x)dx), and N is an operator with the same spectrum except for λ = 1. Iterating gives H k = P + N k and the spectral radius of N k tends to0 as k → ∞.

In subsection 1.4.1 we give several useful concepts and results concerning the spectrum of an operator. Then subsection 1.4.3 introduces the concept of quasi-compactness, a property strongly related to (P2), in particular we give sufficient conditions for the quasi-compactness. In subsection 1.4.4 we complete the set of properties (P1) and (P2) by explaining how the spectral gap is obtained from the uniqueness of the dominant eigenvalue and the quasi-compactness.

In 1.4.7 we describe the transfer operator, which generalizes the Perron Frobenius operator.

REAL PROBABILISTIC FRAMEWORK 52

In this section we follow mainly [Bal00, pp. 28-36] as well as [START_REF] Kato | Perturbation theory for linear operators[END_REF], and the notes in [START_REF] Sarig | Introduction to the transfer operator method[END_REF] and [START_REF] Baladi | Systèmes dynamiques et algorithmique[END_REF].

Concepts from functional analysis

Let (B, ∥ • ∥ B ) be a Banach space, i.e., a vector space B along with a norm ∥ • ∥ B which makes it complete. We recall that an operator A : (B, ∥ • ∥ B ) → (B, ∥ • ∥ B ) is continuous if and only if it is bounded, i.e., the set {A(v) : ∥v∥ B ≤ 1} is bounded, or equivalently, there is constant C > 0 such that ∥A(v)∥ B ≤ C∥v∥ B . The minimal such constant C is the norm of the operator ∥A∥, and the operator norm makes the space of bounded operators into a normed space which further satisfies ∥AB∥ ≤ ∥A∥∥B∥. Definition 1.11 (Spectrum and eigenvalues). The spectrum SP(A) of an operator A acting on a Banach space F is the set of all complex numbers λ such that (A -λI) does not have a bounded (norm) inverse, where I is the identity operator.

The spectral radius of A is defined by

R(A) = sup{|z| : z ∈ SP(A)} .
(1.46)

We say λ ∈ SP(A) is an eigenvalue of A if and only if (A-λI) is not injective. Equivalently, this means that there is a non zero v ∈ B such that A(v) = λv. We then say that v ̸ = 0 is an eigenvector associated with the eigenvalue λ. The multiplicity of an eigenvalue λ is the dimension of the eigenspace {v ∈ B : A(v) = λv}.

Observation 1.9 (Perron Frobenius operator). In this example we do a formal computation with regard to the Perron Frobenius operator. We note that if λ were an eigenvalue associated with the eigenvector g in L 1 , then H[g](x) = λg(x) .

Integrating and noting that  I H[g](x)dx =  I g(x)dx, we derive that either  I g(x)dx = 0 or λ = 1. 3 Proposition 1.14. Let (B, ∥ • ∥ B ) be a Banach space and let A be a bounded operator acting on B. If ∥A∥ < 1 then I -A is invertible and

(I -A) -1 = I + A + A 2 + . . . , (1.47)
where the series actually converges to a bounded operator with norm at most 1/(1 -∥A∥).

Proof. Simply note that F := I + A + A 2 + . . . defines a linear operator, due the completeness of B, which is bounded because

∥A k ∥ ≤ ∥A∥ k implies ∥F ∥ ≤ 1/(1 -∥A∥).
Due to the continuity of A we have, point-wise

(I -A)F = F -AF = F -(A + A 2 + A 3 + . . .) = I ,
and similarly from the other side. ■ Corollary 1.8. Let (B, ∥ • ∥ B ) be a Banach space and let A be a bounded operator acting on B.

Then the following inequality holds for the spectral radius R(A) ≤ ∥A∥ .

(1.48)

Proof. Let λ be a complex number with |λ| > ∥A∥. Then we note that

∥A -λI∥ = λ   I - A λ    ,
and here ∥ A λ ∥ < 1, thus it follows from Proposition 1.14 that A -λI is invertible. Since this holds for arbitrary λ ∈ C with |λ| > ∥A∥, we conclude that R(A) ≤ ∥A∥. ■ Corollary 1.9. Let A be a bounded linear operator acting on acting on a Banach space B. The spectrum SP(A) of A is compact.

Proof. From Proposition 1.14 we see that C \ SP(A) is open, as the proposition actually tells us that the set of invertible bounded operators is open (with the operator norm). From Corollary 1.8 it is bounded. ■

There is a general formula connecting the spectral radius and the norm, see [START_REF] Yosida | Functional analysis[END_REF].

Theorem 1.6 (Spectral radius formula). Let (B, ∥ • ∥) be a Banach space and let A : B → B be a linear bounded operator acting on it. Then we have the following spectral radius formula

R(A) = lim ∥A n ∥ 1/n . (1.49)
Notice, then, that the spectral radius tells us straight away the order of growth of ∥A n ∥, this is related to the radius of convergence of power series we shall see in Proposition 2.3. In the case of matrices this is usually known as Gelfand's formula and, in that case, it is independent from the choice of norm.

Notation 1.2. Throughout this text we will make use of several classical norms which constitute the basis of more complex ones. To start with, the ∥ • ∥ 1 (or ∥ • ∥ L 1 ) norm from L 1 (X, µ), given by the integral of the absolute value

∥f ∥ 1 :=  X |f (x)|dµ(x) .
We recall that this norm makes L 1 into a Banach space.

Second, the supremum norm (or uniform convergence norm) ∥•∥ ∞ for the continuous functions on C 0 (X, C), given by ∥f ∥ ∞ := sup

x∈X |f (x)| .
Again, this makes C 0 (X, C) into a Banach space. 3

The spectral radius of the Perron Frobenius operator

Coming back to the Perron Frobenius operator defined in Definition 1.7, it is clear that it acts on the space L 1 (I) of integrable function on I. The space L 1 is complete under the norm ∥g∥ 1 =  I g(x)dx. Observe

 I |H[g](x)|dx ≤  I |g(x)|dx, .
This follows from an application of the triangle inequality, which yields

|H[g](x)| ≤ H[|g|](x), as well as the fact that H preserves the integrals  H[|g|] =  |g|. It follows that ∥H∥ ≤ 1 and R(H) ≤ 1 over L 1 .
For the Euclidean dynamical system, we already know that x → → 1/(1 + x) is an eigenvector associated with the eigenvalue λ = 1, hence R(H) = 1 in this case. We explain a generalization from [START_REF] Bourdon | Dynamical analysis of α-Euclidean algorithms[END_REF].

Throughout the text we will encounter several spaces other than L 1 (I). Concretely, we will consider BV(I), the subspace of functions of bounded variation (see [Fol99]), and the even smaller space C 1 (I) of continuously differentiable functions.

Definition 1.12 (Bounded variation). The total variation of a function f :

[a, b] → C from L 1 ([a, b]) is defined by V b a (f ) = sup P ∈P n P -1  i=0 |f (x i+1 ) -f (x i )| , (1.50)
where the supremum is taken over, P, the of all finite partitions P = (x 0 , x 1 , . . . , The total variation satisfies various useful (and simple) properties

x n P ) of [a, b] with a = x 0 < x 1 < . . . < x n P -1 < x n P = b .
Proposition 1.15. Let f, g belong to BV([a, b]) then 1. If f ∈ C 1 ([a, b]) we have V b a (f ) =  b a |f ′ (x)|dx. 2. Triangle inequality: V b a (f + g) ≤ V b a (f ) + V b a (g). 3. Additivity: V b a (f ) = V c a (f ) + V b c (f ) if c ∈ (a, b). 4. Product rule: V b a (f g) ≤ ∥f ∥ ∞ V b a (g)+∥g∥ ∞ V b a (f ). Also V b a (f g) ≤  b a |f (x)g ′ (x)|dx+∥g∥ ∞ V b a (f ) when g ∈ C 1 ([a, b]). 5. Boundedness: ∥f ∥ ∞ ≤ V b a (f ) + 1 b-a ∥f ∥ 1 . 6. Composition: V d c (f • j) = V b a (f ) if j : [c, d] → [a,
∥f ∥ BV := ∥f ∥ 1 + V 1 0 (f ) . (1.51) The proof of this fact is simple enough. Indeed, if f ∈ BV(I), we have V 1 0 (H[f ]) ≤  h∈H V 1 0 (|h ′ |f • h) by Proposition 1.15 and for each particular h ∈ H we note V 1 0 (|h ′ |f • h) ≤ ∥h ′ ∥ ∞ V I h (f ) +  1 0 |h ′′ (x)f (h(x))|dx ≤ ∥h ′ ∥ ∞ V I h (f ) + C  1 0 |h ′ (x)||f (h(x))|dx ,
where I h = h(I) is the fundamental interval associated with h. Thus it follows, summing up over all h, that

V 1 0 (H[f ]) ≤ ∆ 1 V 1 0 (f ) + C∥f ∥ 1 . Finally, since ∥H[f ]∥ 1 ≤ ∥f ∥ 1 we get ∥H[f ]∥ BV ≤ ∆ 1 V 1 0 (f ) + (1 + C)∥f ∥ 1 , (1.52) in particular H[f ] is of bounded variation. 3
Here is the main theorem of this subsection, which is a simplified version of [BDV02, Proposition 4].

Theorem 1.7. Consider a complete interval dynamical system of class C 2 (see Definition 1.3) with inverse branches h ∈ H. Assume further that

∆ n := sup{∥h ′ ∥ ∞ : h ∈ H n } satisfies 1. (Weak expansion) The quantity ∆ 1 satisfies ∆ 1 ≤ 1.

(Strong expansion)

There exists and integer m and a real constant γ < 1 such that ∆ m ≤ γ.

(Bounded distortion)

There exists a constant C > 0 such that |h ′′ (x)| ≤ C|h ′ (x)| for all h ∈ H and x ∈ I.

Then the system admits an invariant density of bounded variation, in particular the spectral radius R(H) of the Perron Frobenius operator is indeed R(H) = 1.

Proof. From (1.52) applied to the iteration of the system m times, so with H m rather than H, we get

∥H m [f ]∥ BV ≤ γ∥f ∥ BV + C m ∥f ∥ 1 ,
for some finite C m . Note that we have a bounded distortion for h ∈ H m too by induction (use ∆ 1 < ∞).

REAL PROBABILISTIC FRAMEWORK 55

Now iterating and recalling ∥H∥ 1 ≤ 1 we get

∥H m×k [f ]∥ BV ≤ γ k ∥f ∥ BV + C m 1 -γ ∥f ∥ 1 . (1.53)
This means that the set

F := {f n = 1 n n-1  j=0 H m×j [1] : n ≥ 1} , 1(x) := x ,
is a bounded set for the ∥ • ∥ BV norm. Thus Helly's selection Theorem implies that a certain subsequence of

f n converges to a function f ∞ of BV(I). Since the elements f n are densities, so is f ∞ . Note that H m [f ∞ ] = f ∞ ,
and from this we derive an invariant density (note it is positive)

g := 1 m m-1  j=0 H j [f ∞ ]
for our original system. ■

Quasi-compactness

To be able to analyze the long term behavior of H k as k gets larger we need to characterize the dominant eigenvalues as well as the corresponding eigenvectors. If these are separated by a gap from the rest of the spectrum, we will get asymptotics for H k .

Definition 1.13 (Essential spectral radius). The essential spectral radius R e (A) of a bounded linear operator A acting on the Banach space (B, ∥ • ∥) is the infimum of the numbers R ≥ 0 such that for all λ ∈ SP(A) with |λ| > R we have that λ is an isolated eigenvalue of finite multiplicity.

When R e (A) is strictly smaller than R(A), we can work with the "dominant" eigenvalues (those with |λ| > R e (A)) like in the case of matrices. Such an operator is called a quasi-compact operator.

Definition 1.14 (Quasicompact operator). A bounded operator A : (B, ∥ • ∥) → (B, ∥ • ∥) acting on a Banach space (B, ∥ • ∥) is said to be quasi-compact if and only if R e (A) is strictly smaller than R(A).

The most classical example are the so-called compact operators, from where the name originates.

Definition 1.15 (Compact operator). A linear operator T : X → Y between two normed spaces is said to be compact if the image (T x i ) of any bounded sequence (x i ) i ⊂ X contains a convergent subsequence.

Note that we have defined compact operators in somewhat more generality than quasi-compact operators. This will come in handy when we state Hennion's theorem, Theorem 1.8 below.

For compact operators we simply have R e (A) = 0, so 0 can be the only accumulation point of eigenvalues. These conditions, for our case, are too restrictive.

It is not possible to get this spectral gap when the underlying functional space is too big (e.g., L 1 ), thus a huge part of the problem lies in choosing the right functional space F on which H will act (i.e., H[F] ⊂ F) but for which we will have an spectral gap (and so a "smaller spectrum").

The following theorem by Hennion [Hen93, Corollaire 1] gives sufficient conditions for an operator to be quasi-compact. His result is a reinforcement of a theorem of Ionescu Tulcea and Marinescu [START_REF] Ionescu Tulcea | Théorie ergodique pour des classes d'opérations non complètement continues[END_REF], by using a formula by Nussbaum [START_REF] Roger | The radius of the essential spectrum[END_REF] for the essential spectral radius in terms of ball-coverings. He goes on to show several examples of applications of his result. The reader is referred to the appendices of [START_REF] Sarig | Introduction to the transfer operator method[END_REF] for a self-contained proof of Hennion's Theorem.

Theorem 1.8 (Hennion [START_REF] Hennion | Sur un thorme spectral et son application aux noyaux lipchitziens[END_REF]). Let A be a bounded operator acting on a Banach space (B, ∥ • ∥). Denote by R(A) its spectral radius. Assume that there is a norm

| • | on B such that 1. A is a compact operator from (B, ∥ • ∥) to (B, | • |).
2. There are sequences (r n ) and (ρ n ) of positive numbers such that r = lim inf(r n ) 1/n < R(A) and for all n ≥ 1 and v ∥A n v∥ ≤ r n ∥v∥ + ρ n |v| .

(1.54)

Then the essential radius of A on (B, ∥ • ∥) satisfies R e (A) ≤ r < R(A), in particular A is quasi- compact.
Note that in the previous theorem we do not ask for the space (B, | • |) to be complete, just a normed space. The norm | • | is, in a sense, a weaker auxiliary norm.

There is an alternative formulation of Theorem 1.8 which appears in [DMDV05, Theorem C]. The hypothesis are a bit stronger but easily applicable for our context.

Theorem 1.9 (See [START_REF] Benoî T Daireaux | The Lyapunov tortoise and the dyadic hare[END_REF], theorem C). Let (B, ∥ • ∥) be a Banach space. Let A be a bounded operator on (B, ∥ • ∥). Denote by R(A) its spectral radius. Assume that there exists another norm | • | on B, also making it a Banach space, which satisfies the following properties

1. The closed unit ball of (B, ∥ • ∥) is compact in (B, | • |).
2. There are sequences (r n ) and (ρ n ) of positive numbers such that r = lim inf(r n ) 1/n < R(A) and, for all n ≥ 1, the following inequality

∥A n v∥ ≤ r n ∥v∥ + ρ n |v| (Lasota-Yorke)
known as a Lasota-Yorke inequality, is fulfilled.

Then the essential radius of

A on (B, ∥ • ∥) satisfies R e (A) ≤ r < R(A), in particular the operator A is quasi-compact.
Proof. We explain how this version derives from Theorem 1.8. In order to do this we must show condition (1) from Theorem 1.8, in other words, show that if (x n ) is a bounded sequence in (B, ∥ • ∥), then there is a subsequence (x n j ) j that makes (T x n j ) j converge under the | • | norm. We may assume without loss of generality that ∥x n ∥ ≤ 1 for all n.

Since the open ball from

(B, ∥ • ∥) is compact under | • |, we know there is a subsequence (x m k ) of (x n ) such that |x m k | converges,
in particular it is bounded. From (2) we derive the inequality ∥Av∥ ≤ r 1 ∥v∥ + ρ 1 |v| which tells us that ∥Ax m k ∥ is bounded, hence by our hypothesis (1) it has a convergence subsequence under | • |, thus showing the result. ■ Observation 1.11. We remark that property (2) in Theorem 1.9 can somewhat be relaxed. Indeed, assume that the Lasota-Yorke inequality from property (2) is satisfied for some s ≥ 1 with r

1/s s < R(A). Then by induction (note ∥A k ∥ ≤ ∥A∥ k for all k) we get that ∥A ns v∥ ≤ r n s ∥v∥ + k s |v| ,
for some constants k s ≥ 0 and all v ∈ B. Thus we derive a similar inequality for a number of iterations that is not a multiple of s. Indeed, if 0 ≤ t < s, from ∥A ns+t v∥ ≤ ∥A∥ t ∥A ns v∥ we get

∥A ns+t v∥ ≤ max{1, ∥A∥, . . . , ∥A∥ s-1 } × (r n s ∥v∥ + k s |v|) ,
from which we may apply Theorem 1.9 and get that R e (A) ≤ r

1/s s < R(A). 3
Theorem 1.10. Consider an complete interval dynamical system of class C 2 (see Definition 1.3) with inverse branches h ∈ H. Assume further that

∆ n := sup{∥h ′ ∥ ∞ : h ∈ H n } satisfies 1. (Weak expansion) The quantity ∆ 1 satisfies ∆ 1 ≤ 1.

(Strong expansion)

There exists and integer m and a real constant γ < 1 such that ∆ m ≤ γ. ). Let us go back to the Euclidean dynamical system with the Gauss map T g . We recall that here the Perron Frobenius operator H is given by

H[g](x) :=  h∈H |h ′ (x)|g(h(x)) = ∞  m=1 1 (m + x) 2 g  1 m + x  ,
we will show that, over an appropriate space, this operator is quasi-compact.

Of course, this operator acts on L 1 (I) and has R(H) = 1, having an eigenvalue λ = 1 associated with the eigenvector x → → 1/(1 + x), corresponding to the Gauss measure. We will show that for a well-chosen space our operator is quasi-compact by applying Hennion's Theorem in the form of Observation 1.11.

We will work with the set of continuously differentiable functions C 1 (I). First, it is clear that H actually acts on this space because the sum defining it converges uniformly and so do the sums of the term-wise derivatives, for any fixed order. The operator H is a bounded one on (B, ∥ • ∥). Indeed observe that the derivative of H[g] is

(H[g]) ′ (x) = - ∞  m=1 1 (m + x) 3  1 m + x g ′  1 m + x  + 2g  1 m + x  ,
as follows from the uniform convergence of the previous sum. Then

|(H[g]) ′ | ≤ 2ζ(3)∥g∥, while it is clear that |H[g]| ≤ ζ(2)∥g∥, thus, as ∥H[g]∥ = |H[g]| + |(H[g]) ′ |, it follows that the H is a bounded operator.
Now we turn to property (1) of Theorem 1.9. In fact, this property follows at once in this case from the celebrated Arzelà-Ascoli Theorem b (see e.g., [START_REF] Munkres | Topology. Featured Titles for Topology Series[END_REF]).

For property (2) of Theorem 1.9 we study what happens with each particular term

H (m 1 ,m 2 ) [g](x) := |h ′ m 1 ,m 2 (x)|g(h m 1 ,m 2 (x)) for each m 1 , m 2 ≥ 1. Differentiating     H (m 1 ,m 2 ) [g]  ′ (x)    ≤ |h ′ m 1 ,m 2 (x)| 2 |g ′ (h m 1 ,m 2 (x))| + |h ′′ m 1 ,m 2 (x)||h ′ m 1 ,m 2 (x)||g(h m 1 ,m 2 (x))| . Notice that |h ′′ m 1 (x)| ≤ 2|h ′ m 1 (x)|, thus there exists a constant C > 0 such that |h ′′ m 1 ,m 2 (x)| ≤ C|h ′ m 1 ,m 2 (x)|. Then observe that |h ′ m 1 ,m 2 (x)| ≤ 1/4 =: γ, thus     H (m 1 ,m 2 ) [g]  ′ (x)    ≤ γ|h ′ m 1 ,m 2 (x)||g ′ (h m 1 ,m 2 (x))| + C|h ′ m 1 ,m 2 (x)||g(h m 1 ,m 2 (x))| .
Similarly for any k ≥ 1

    H (m 1 ,m 2 ,...,m 2k-1 ,m 2k ) [g]  ′ (x)    ≤ γ k |h ′ (x)||g ′ (h(x))| + C|h ′ (x)||g(h m 1 ,m 2 (x))| , b
The only non-trivial part is the equicontinuity, and this in turn follows from the Mean Value Theorem for derivatives.

REAL PROBABILISTIC FRAMEWORK

58

where h = h (m 1 ,m 2 ,...,m 2k-1 ,m 2k ) . Notice that ∥h ′ ∥ ∞ ≤ 1 for h ∈ H implies  h∈H 2k |h ′ (x)| ≤  h∈H |h ′ (x)|, which is uniformly bounded in our case. From this we derive   H 2k [g]    ≤ D 1 γ k ∥g∥ + D 0 |g|
, for some constants D 0 , D 1 (independent from the choice of g) and all g ∈ C 1 (I). It then follows from Observation 1.11 that R e (H) ≤ γ 1/2 = 1/2. 3

The previous proof works for all complete interval dynamical systems as long as we add the condition that the image of the constant function

1(x) = 1 through H, that is H[1]
, be well-defined.

Proposition 1.16. Consider an complete interval dynamical system of class C 2 (see Definition 1.3) with inverse branches h ∈ H. Assume further that

∆ n := sup{∥h ′ ∥ ∞ : h ∈ H n } satisfies 1. (Weak expansion) The quantity ∆ 1 satisfies ∆ 1 ≤ 1.

(Strong expansion)

There exists an integer m and a real constant γ < 1 such that ∆ m ≤ γ.

(Fast decay of the branches) The series

 h∈H |h ′ (x)| is uniformly bounded by a constant D 1 . 4. (Bounded distortion) There is a constant C > 0 such that |h ′′ (x)| ≤ C|h ′ (x)| for all h ∈ H and x ∈ I.
Then the associated Perron Frobenius operator

H acting on C 1 (I) is quasi-compact with R e (H) ≤ γ 1/m .
Furthermore, the iterate H m satisfies a Lasota-Yorke bound of the kind

  H m×k [f ]   1 ≤ D 1 γ k   f   1 + D 0   f   0 , (1.55)
for some D 0 independent from f and k.

Spectral gap

Given a quasi-compact operator A, we know that its spectrum, out of some finite ball around the origin, is discrete and consists of eigenvalues of finite multiplicity. When there is just one dominant eigenvalue λ max , with multiplicity 1, the quasi-compactness tells us that there is a "gap'; there is a constant 0 < C < |λ max | such that all other elements λ from the spectrum SP(A) satisfy |λ| < C.

When our operator A presents such a spectral gap, we may rewrite [START_REF] Kato | Perturbation theory for linear operators[END_REF][START_REF] Sarig | Introduction to the transfer operator method[END_REF] our operator A as the sum A = λ max P + N , where P is a projection (i.e. it satisfies P 2 = P ) with dim Im(P ) = 1, and a bounded linear operator N such that P N = N P = 0, with spectral radius R(N ) < C.

Thus iterating we get

A k = λ k max P + N k and we recall that ∥N k ∥ 1/k → R(N ) by Theorem 1.6, hence A k (v) = λ k max P (v) + O(∥v∥ × C k ) .
In the case of a Hilbert space, i.e., when our Banach space is associated with an inner product ⟨•, •⟩, it is not difficult to define a projection P onto a space of finite dimension. Here, however, we deal with Banach spaces with, a priori, no inner-product. This is why we must explain the notion of projection in this context, making the connection with the spectrum.

Theorem 1.11 (Separation of spectrum [START_REF] Sarig | Introduction to the transfer operator method[END_REF]). Let A be a bounded operator acting on a Banach space (B, ∥ • ∥). Suppose SP(A) = Σ in ⊎ Σ out where Σ in , Σ out are compact, and let γ be a smooth closed curve which does not intersect SP(A), and which contains Σ in in its interior, and Σ out in its exterior. Then 1. The operator

P := 1 2πi  γ (zI -A) -1 dz
is a projection P 2 = P , and so B = ker(P) ⊕ Im(P), 2. The projection commutes with A, i.e., PA = AP. Therefore A(ker(P)) ⊂ ker(P), and A(Im(P)) ⊂ Im(P) .

3. The spectrum of the projection P is related to that of A by the equalities

SP(A   Im(P) ) = Σ in , and SP(A   ker(P) ) = Σ out .
Of course, what we intend to do is to show that the Perron-Frobenius operator H has a unique dominant eigenvalue λ max = 1 of multiplicity one. This, together with the quasi-compactness will lead to the decomposition

A = P + N where P[f ](x) = φ(x)  I f (t)dt
where φ is the invariant density.

Eigenvalues and the ergodic properties of the Perron Frobenius operator

Actually there are some deep relations between the eigenvalues of the Perron Frobenius operator H of an interval dynamical system and the ergodic properties of the system.

Definition 1.16 (Mixing). Let (Ω, B, µ) be a probability space and let T : Ω → Ω be an ergodic measurepreserving transformation. We say that the map T is mixing if and only if for every pair of measurable sets A, B ∈ B we have

lim n→∞ µ  A ∩ T -n B  = µ(A)µ(B) .
Remark. Mixing is also sometimes called strong-mixing in order to contrast it with weak-mixing. We have weak-mixing when the means converge

lim n→∞ 1 N N -1  n=0 µ  A ∩ T -n B  = µ(A)µ(B) .
Clearly mixing implies weak-mixing. Note, in turn, that weak-mixing implies ergodicity

We now cite [START_REF] Sarig | Introduction to the transfer operator method[END_REF] Proposition 1.17. Consider a complete interval dynamical system of class

C 1 with shift T . Let (L, ∥ • ∥) be a Banach space with L ⊂ L 1 (I) and ∥ • ∥ L ≥ ∥ • ∥ L 1 .
Suppose the Perron Frobenius operator H acts on L and is quasi-compact. If there is an invariant density φ for T , which makes T mixing for the measure defined by µ(A) :=  A φ(x)dx, then H presents a spectral gap on L with dominant eigenvalue λ = 1 and projection

P (f ) = φ  I f (x)dx .

REAL PROBABILISTIC FRAMEWORK 60

It turns out that there are converses for H acting on C 1 (I) (see e.g., [START_REF] Sarig | Introduction to the transfer operator method[END_REF] or [START_REF] Baladi | Systèmes dynamiques et algorithmique[END_REF]):

(i) if λ = 1 is a simple eigenvalue, the map T is ergodic.

(ii) λ = 1 is the only eigenvalue on {|λ| = 1} (moreover simple) if and only if the system is mixing.

We underline for (ii) that there is the underlying assumption that H acts on C 1 (I). When we have the weaker assumption that H acts on L 1 (I), it turns out that [START_REF] Sarig | Introduction to the transfer operator method[END_REF] having λ = 1 as a simple eigenvalue, and all other eigenvalues of smaller absolute value, implies that the system is weak-mixing.

For the case of the Euclidean dynamical system, proving that the system is mixing is not immediate. A useful tool to prove mixing is the so-called exactness.

Definition 1.17 (Exactness). Let (Ω, Σ, µ) be a probability space. A measurable map T is said to be exact

if for every E ∈  ∞ n=0 T -n (Σ), either µ(E) = 0 or µ(Ω \ E) = 0. Proposition 1.
18. An exact probability preserving map is mixing.

The proof of this proposition can be found in [Sar12, Appendix A.2] and makes use of the Martingale convergence theorem. Proving that a map is exact is simpler than proving it is mixing directly.

Example 1.11 (Exactness of the Gauss map). Suppose

E satisfies E ∈  n T -n (B I ) and µ g (E) > 0. We must show that µ g (I \ E) = 0.
Recall that during the proof of Theorem 1.2 we proved (1.33), i.e., that for any measurable A and fundamental interval I m 1 ,...,m k we have

µ g ((T -k A) ∩ I m 1 ,...,m k ) ≥ C -1 µ g (A)µ g (I m 1 ,...,m k )
for a certain constant C > 0 independent from the choice of A and the interval. We note that if

E ∈ ∩ n T -n T -n (B I ) we have E = T -n E n for a certain E n ∈ B I . Then it follows, picking k = n and A = E n that µ g (E ∩ I m 1 ,...,m k ) ≥ C -1 µ g (E n )µ g (I m 1 ,...,m k ) But µ g (E n ) = T g (T -n E n ) = µ g (E), thus µ g (E ∩ I m 1 ,...,m k ) ≥ C -1 µ g (E)µ g (I m 1 ,...,m k ).
(1.56)

The rest of the corresponding proof in [START_REF] Sarig | Introduction to the transfer operator method[END_REF] proceeds by the Martingale convergence theorem. We may, however, produce a direct argument, which we give here. The argument is a bit technical but not complicated, and typical of measure theory. The concept is the following: we may approximate any measurable set by a disjoint countable union of fundamental intervals.

As the Gauss measure is clearly regular [Fol99], for every ϵ > 0 there would be an open set O ϵ containing

I \ E such that µ g (O ϵ ) ≤ µ g (I \ E) + ϵ.
The open set O ϵ can be produced as a countable disjoint union of fundamental intervals I a 1 ,...,a k of different depths. For every such interval we have (1.56), thus, summing over these intervals we obtain

µ g (E ∩ O ϵ ) ≥ C -1 µ g (E)µ g (O ϵ ) , but µ g (E ∩ O ϵ ) ≤ µ g (E ∩ (I \ E)) + ϵ = ϵ and µ g (O ϵ ) ≥ µ g (I \ E), hence ϵ ≥ C -1 µ g (E)µ g (I \ E) .
As ϵ > 0 was arbitrary we derive µ g (E)µ g (I \ E) = 0, and therefore µ g (I \ E) = 0. 3

We note that the previous proof generalizes exactly as mentioned in Observation 1.5, giving Proposition 1.19. Consider a complete interval dynamical system of class C 1 with map T , and an invariant density g ∈ C 0 (I) with respect to the Lebesgue measure λ Leb . Suppose

REAL PROBABILISTIC FRAMEWORK

61

(i) the map T k is expanding for some k ∈ N, i.e., sup h∈H k ∥h ′ (x)∥ ∞ < 1 for some k.

(ii) there is a distortion constant C > 0 such that |h ′ (y)|/|h ′ (x)| ≤ C for all x, y ∈ I and inverse branches h ∈ H * of any depth.

Then the map T is exact with respect to the invariant measure dµ(x) = g(x)dλ Leb (x).

This means, in particular, that the CL system is exact, and therefore mixing.

We conclude this subsection by stating the resulting theorem for the spectrum. This is a combination of Proposition 1.19, Theorem 1.7 and Proposition 1.17

Theorem 1.12. Consider a complete interval dynamical system of class C 1 (see Definition 1.3) with inverse branches h ∈ H. Assume further that

∆ n := sup{∥h ′ ∥ ∞ : h ∈ H n } satisfies 1. (Weak expansion) The quantity ∆ 1 satisfies ∆ 1 ≤ 1.

(Strong expansion)

There exists and integer m and a real constant γ < 1 such that ∆ m ≤ γ.

(Bounded distortion) There exists a constant

C > 0 such that |h ′′ (x)| ≤ C|h ′ (x)| for all h ∈ H and x ∈ I.
Then the Perron Frobenius operator H, acting on the space (BV, ∥ • ∥ BV ) admits a spectral gap, with 1 as a the simple dominant eigenvalue, associated with the unique invariant density φ of the system (there is one).

The iterates H k of the Perron Frobenius operator decomposes as

H k [f ](x) =  I f (t)dt  φ(x) + O  ∥f ∥ BV θ k  ,
for some θ < 1, which depends on the subdominant eigenvalues.

Observation 1.12. It is also possible to substitute BV by C 1 (I) when the invariant density is continuous and the series

 h∈H |h ′ (x)| is uniformly bounded.
Why choose BV or C 1 (I). When the branches of the dynamical system are not complete, the Perron-Frobenius operator involves characteristic functions which naturally lead to BV rather than C 1 (I). For our case, however, the branches will always be complete and hence we may choose either one depending on the target application. When the input functions are naturally discontinuous as in Chapter 5, we pick BV(I). For the case of the CL system in Chapter 7 however, we will prefer C 1 (I) as we will also require some analytical properties of the transfer operator (to apply analytical perturbation, see subsection 1.4.7) associated with the system.

An application of the spectral decomposition to the values of the digits

In this subsection we will study the digits m k (X) of the continued fraction expansion of a random number X ∈ I from our "real probabilistic framework" perspective. The random number X is drawn uniformly at random from the unit interval and we study the distribution of m k and the expected values

E[f (m k )].
These results were already noted by Kuzmin, who demonstrated the convergence of the iterates of the Perron-Frobenius operator of the Gauss map in a more direct fashion. His proof can be found in [START_REF] Ya | Continued fractions[END_REF].

Here we apply our results from the section.

Distribution. We remark that

m k (X) = m ⇐⇒ T k (X) ∈  1 m + 1 , 1 m  , 1.4. REAL PROBABILISTIC FRAMEWORK 62
and this means that

P (m k (X) = m) =  1/m 1/(m+1) H k [1](x)dx ,
where 1(x) = 1 is the initial uniform density.

As we know that the dynamic system associated with the Gauss map satisfies the hypothesis of Theorem 1.12, we get that

H k [1](x) = 1 log 2 1 1+x + O(θ k ) for some θ < 1. Integrating P (m k (X) = m) = 1 log(2)  1/m 1/(m+1) dx 1 + x + O  θ k /m 2  , (1.57)
which gives the exact same distribution from (1.35) but on a different model!

We remark that these results are independent from the choice of the initial density in BV(I).

Expected values. For the expected values, from (1.57), we deduce that whenever

S :=  |f (m)|/m < ∞ we have E[f (m k )] = 1 log 2 ∞  m=1 f (m) log  1 + 1/m 1 + 1/(m + 1)  + O(S × θ k ) . (1.58)
The expected values E[f (m k )] may be produced by using the Perron-Frobenius operator in the lines of the ideas exploited in Chapter 5. This is due to the fact that m k (X) = ⌊q k (X)/q k-1 (X)⌋ where ⌊•⌋ denotes the integer part. Then the expected value E[f (m k )] can be written as H k [g](0) directly, for an appropriate g which equals

g(x) = 1 1 + x f  1 x  .
With such an analysis it is possible to get slightly better error terms, and hence be able to assert the value of E[f (m k )] for a larger class of f . We will not get into details here, for more on this topic, the reader is referred to Chapter 5.

Final comments. It is also worthwhile to mention that, for the case of the Euclidean dynamical system, the value of the subdominant spectral radius (when we take out the dominant eigenvalue) is known [IK02] to be φ 2 where φ = √ 5-1 2 . = 0.61803 . . .. This means that we may pick θ = φ 2 + ϵ for any ϵ > 0.

The transfer operator

The transfer operator is an extension of the Perron Frobenius operator by adding a complex parameter s. We then obtain the transfer operator H s defined by

H s [f ](x) :=  h∈H |h ′ (x)| s f (h(x)) . (1.59)
This parameter help us express (Dirichlet) generating functions for our parameters of interest in relation to the dynamical system.

Of course, we consider too the k-th iterate of the transfer operator, which again describes the depth k branches of the dynamical system, given by

H k s [f ](x) =  h∈H k |h ′ (x)| s f (h(x)) . (1.60)
When we consider all of the inverse branches we get the so-called quasi-inverse of the transfer operator:

(I -H s ) -1 := I + H 1 s + H 2 s + . . . . (1.61)
Spectral decomposition. It turns out that, when the Perron Frobenius operator H = H 1 presents a spectral gap, the transfer operator inherits the spectral gap locally around s = 1 by what is called analytic perturbation. This is possible when the operator depends analytically on the variable s (see [START_REF] Sarig | Introduction to the transfer operator method[END_REF]), meaning that the derivative operator is also part of the functional space.

Thus we have a decomposition as before

H s = λ(s)P s + N s ,
where again P s is the projection onto the eigenspace of λ(s), the dominant eigenvalue. It follows then that for k ≥ 1

H k s = (λ(s)) k P s + N k s ,
Note then that, if we can ensure that |λ(s)| < 1 for s ̸ = 1, as well as R(N s ) < C < λ(s) for a fixed constant C, for all s close enough to s = 1, the quasi-inverse satisfies

(I -H s ) -1 := I + λ(s) 1 -λ(s) P s + N s I -N s . (1.62)
Suppose, as will be the case for us, that the dominant eigenvalue for s = 1 is λ(1) = 1. The dependence of λ(s) and N s on s is analytic for s sufficiently close to 1 by principles of perturbation theory, hence we have the estimate

(I -H s ) -1 ∼ - 1 λ ′ (1) 1 s -1 P , (1.63)
as s → 1.

The approximation in (1.63) is key to apply the Tauberian Theorem (see Theorem 2.3 and the generalization in [START_REF] Tenenbaum | Introduction to analytic and probabilistic number theory[END_REF]) and extract asymptotics for the Dirichlet Generating Functions expressed in terms of the quasiinverse. The process of using the transfer operator, in particular the quasi-inverse, to produce generating functions related to the system is known as Dynamical Analysis. The concepts of generating functions, as well as the need for Dynamical Analysis, are explained in Chapter 2.

The transfer operator and the entropy. The reader may wonder what the curious λ ′ (1) in (1.63) is. The answer is that actually -λ ′ (1) gives the entropy (recall subsection 1.2.7) of the system.

We explain this briefly. It is clear that if

H k = -  h∈H k  1 0   h ′ (x)   dx  log  1 0   h ′ (y)   dy  ,
then the entropy H is given by

H = -lim k→∞ 1 k H k .
Let us write first

H k = -  1 0    h∈H k   h ′ (x)   log  1 0   h ′ (y)   dy    dx .
If there is bounded distortion, there is a constant

C such that C -1 |h ′ (x)| ≤ |h ′ (y)| ≤ C|h ′ (x)
| for all x, y and h ∈ H ⋆ . As a consequence, applying the bounds for h ′ (y) we get

H k = -  1 0    h∈H k   h ′ (x)   log   h ′ (x)     dx + O(1) ,

CONTINUED FRACTIONS: RATIONALS AND QUADRATICS IRRATIONALS 64

where the constant in O(1) depends only on C and not on k.

Observe that, if we have a spectral gap by analytic perturbation and invariant density φ, then

 h∈H k   h ′ (x)   log   h ′ (x)   = ∂ ∂s H k s [1](x) ∼ kλ ′ (1)P[1](x) = kλ ′ (1)φ(x) ,
thus the Entropy follows upon integration.

The entropy of a complete interval dynamical system with expanding map may be computed through a classical formula, known as Rokhlin's entropy formula [START_REF] Pollicott | Dynamical systems and ergodic theory[END_REF].

Proposition 1.20 (Rokhlin's entropy formula). Consider a complete interval dynamical system with expanding map T . Then the entropy of the dynamical system is given by

H =  1 0 log |T ′ (x)|φ(x)dx ,
where φ is the unique invariant density of the system.

Example 1.12. We compute again that the entropy for the Euclidean system (see Example 1.5), associated with the Gauss map T g (x) = {1/x}, but using Rokhlin's formula. Notice that the branches of T g all have derivative -1/x 2 , hence

H = - 2 log 2  1 0 log x 1 + x dx ,
as we recall that the invariant density φ(x) is the Gauss density φ

(x) = 1 log 2 1 1+x .
Here we write

1 1+x = 1 -x + x 2 ∓ . . . (-1) k-1 x k-1 + (-x) k 1+x so that H = - 2 log 2 k-1  j=0 (-1) j+1  1 0 x j (log x)dx -2(-1) k  1 0 x k log x 1 + x dx .
Here by parts

 1 0 x j (log x)dx = -1 (j+1) 2 while it is clear that  1 0 x k log x 1+x dx tends to 0 as k → ∞ by dominated convergence. Thus H = 2 log 2 ∞  j=1 (-1) j+1 j 2 = π 2 6 log 2 .⋄
The transfer operator in this dissertation. The quasi-inverse will play a key role in Chapter 7 where we will study the algorithm associated with the CL expansion. In order to do this we will actually need to consider all possible truncated expansions of the Continued Logarithm expansion. The k-th iterates of the plain Perron Frobenius operator will play a fundamental role in Chapter 5, where we will work with continued fractions of fixed depth. Finally in Chapter 4 we have a novel selection criteria for the branches from H ⋆ which, however, cannot be directly written in terms of the operator (see Chapter 6 for the relation between the two models).

Continued fractions: Rationals and quadratics irrationals

Among the various subfamilies of real numbers we may consider, two of them stand out: the rationals and the quadratic irrationals. In this section we will cite the corresponding results for each, explaining the models and the corresponding sizes but we do not offer proofs.

CONTINUED FRACTIONS: RATIONALS AND QUADRATICS IRRATIONALS 65

Rational numbers correspond to finite continued fraction expansions. First, these are precisely the executions of the Euclidean algorithm over the positive integers, so their study takes on great importance. Second, we may naturally wonder how the properties of a finite expansion actually turn into the properties of the reals.

Quadratic irrationals are the irrational numbers α which are the root of a degree-two polynomial over the integers. Due to a famous theorem of Lagrange (see [START_REF] Fogg | Substitutions in dynamics, arithmetics and combinatorics[END_REF] Most importantly, quadratic irrationals naturally turn up in Combinatorics on Words (see [START_REF] Allauzen | Une caractérisation simple des nombres de Sturm[END_REF], [Lot02, Section 2.3.6]) as fixed points of morphisms, such as the one described in Example 3.2. It is not all quadratic irrationals however, but just the ones called Sturm numbers, which have a continued fraction expansion of one of the following forms:

• α = [1, m 0 , m 1 , . . . , m p ] with m p ≥ m 0 , • α = [1 + m 0 , m 1 , . . . , m p ] with m p ≥ m 0 .

Probabilistic model for rational numbers

If we restrict ourselves to the set of rational numbers from the interval I, we may take sets corresponding to fractions with bounded denominators

Ω N := {a/b : 1 ≤ a ≤ b ≤ N } ,
which are finite sets, and draw elements from Ω N uniformly at random. Observe that

|Ω N | = φ(1) + . . . + φ(N ) where φ is Euler's totient function φ(n) := #{a : 1 ≤ a ≤ n , gcd(a, n) = 1}.
On this probabilistic model parametrized on N , it is natural to consider probabilities and expected values, which we denote by P N and E N respectively for this section.

We remark that studying rational trajectories corresponds to the study of the Euclidean algorithm. Indeed, Ω N corresponds exactly to all pairs of coprime integers (a, b) with 1 ≤ a ≤ b ≤ N . As such, these average properties have been studied extensively over the years, due to the crucial importance of the algorithm.

Asymptotic probabilistic properties of digits for rational numbers

A function f is of moderate growth if and only if f (m) = O(log m). We are interested in the cumulative function F over the continued fraction development of a rational x = a/b, defined by

F (x) = f (m 1 ) + . . . + f (m k ) ,
where a/b = [m 1 , . . . , m k ] and m k > 1.

Theorem 1.13 (Simplified Theorem 4 from [START_REF] Vallée | Euclidean dynamics[END_REF]). The expectation E N [F ] of the cumulative function F on the set of rationals with denominator bounded by N is asymptotically ,

E N [F ] ∼ 12 log 2 π 2 µ(f ) log N , E N [F k ] ∼ (E N [F ]) k , where µ(f ) = 1 log 2  ∞ m=1 f (m) log  1+1/m 1+1/(m+1)  .
The standard deviation is o(log N ), and, consequently, the random variable expressing the cumulative sum F is concentrated around its mean.

CONTINUED FRACTIONS: RATIONALS AND QUADRATICS IRRATIONALS 66

By concentration: the normalized random variable F/E N [F ] tends to 1 in probability as N → ∞. The reader is referred to [FS09, Proposition III.3, p.162] for the corresponding concentration result.

We remark highlight the case f ≡ 1, which gives the average run-time of the Euclidean algorithm. The conclusion is that the average number of steps K over

Ω N is ∼ 12 log 2 π 2 log N .
In turn, this means that if we normalized the expected values by the average number of steps we would get

E N [F ] E N [K] ∼ µ(f ) ,
which coincides with the behavior from the "real probabilistic model", see (1.58).

Probabilistic model for quadratics irrationals

Quadratic irrationals are, of course, countable, yet we need an analogue notion of size, like the denominator of a rational number. In what follows we will begin by studying those that have a purely periodic continued fraction expansion for simplicity, only afterwards to delve into the ones that do have a preperiod. In [START_REF] Cesaratto | Gaussian behavior of quadratic irrationals[END_REF] the quadratic irrationals that have a purely periodic expansion are said to be reduced, and we write rqi in shorthand to mean reduced quadratic irrational.

It is important to notice that given a period (m 1 , . . . , m p ) for our continued fraction expansion, the repetition (m 1 , . . . , m p , m 1 , . . . , m p ) is another possible period, and so on. Thus, when working with quadratic irrationals we must be careful to consider the so-called "primitive" periods. A period is primitive if and only if it is not the repetition of a smaller one.

The size of a quadratic irrational

Let us now introduce the norm. Consider a primitive period m ∈ N k , its associated rqi The size function ϵ may be natural from a number-theoretical point of view, but there is another related notion of size υ which relates naturally to the periodicity of the continued fraction expansion. This notion of size may be defined by

x * m is the root of h m (X) = X with x * m ∈ I.
υ(x) := p(x)-1  i=0 T i (x) = |h ′ (x)| 1/2 , (1.64)
where p(x) denotes the period of the continued fraction expansion of x, and h is the LFT associated with x.

In what follows, given a tuple

m = (m 1 , . . . , m k ), m R = (m k , m k-1 , . . . , m 1 ) denotes its mirror. Given two tuples m ∈ N k and u ∈ N j we denote by m • u their concatenation m • u := (m 1 , . . . , m k , u 1 , . . . , u j ).
Also we will write m ℓ to denote the repetition ℓ times of m, i.e.,

m ℓ := m • m . . . • m    ℓ times .
We now explain why υ is a natural notion of size for a quadratic irrational.

Proposition 1.21. Let u ∈ N j and w ∈ N k then the continuant function satisfies

lim ℓ→∞ q(w ℓ ) q(w ℓ • u) =   h ′ u R  x * w R   1/2 , (1.65)
in particular, picking u = w produces

lim ℓ→∞ q(w ℓ ) q(w ℓ+1 ) =   h ′ w R  x * w R   1/2 = υ(x * w ) .
(1.66)

CONTINUED FRACTIONS: RATIONALS AND QUADRATICS IRRATIONALS 67

The classical notion of size ϵ for a reduced quadratic irrational is then defined by ϵ(x) = υ(x) -r(x) , with r(x) = 1 for even p(x), and r(x) = 2 for odd p(x).

(1.67)

Now given the size ϵ we define

K := {x ∈ I : x is a rqi} , K N := {x ∈ K : ϵ(x) ≤ N } .
We remark hat K N is clearly a finite set. Indeed, we need only show that there is a finite number of rqi's x with υ(x) -1 ≤ N . In turn, to prove this, note that υ(x) = (q p(x) (x) + x q p(x)-1 (x)) -1 and hence we must have q p(x) ≤ N which trivially implies that the quotients m k (x) and the period p(x) are bounded.

Fixed N we choose a quadratic irrational uniformly at random from J N . On this probabilistic model it is again natural to consider probabilities and expected values, which we denote by P N and E N respectively.

Asymptotic probabilistic properties of digits for quadratics irrational

Here we follow [START_REF] Cesaratto | Gaussian behavior of quadratic irrationals[END_REF], stating a simplified version of their main results for reduced quadratic irrationals.

Again, in this context, we consider a function f of moderate growth (i.e., f (m) = O(log m)). We are interested in the cumulative function F over the period of a rqi x, defined by

F (x) := f (m 1 (x)) + . . . + f (m p(x) (x)) .
Simple examples are f ≡ 1, and f (m) = log m, which are related, respectively, to the length of the minimal period and the cost of storing the quotients of x.

Theorem 1.14 (Simplified Theorem 1 from [START_REF] Cesaratto | Gaussian behavior of quadratic irrationals[END_REF]). Consider the set K of reduced quadratic irrationals x, endowed with the size ϵ. Given a function f of moderate growth, we consider its cumulative sum F on the subset K. Then the following holds on the set K N of reduced quadratic irrationals x with ϵ(x) ≤ N for N → ∞:

(i) The expectation satisfies E N [F ] ∼ µ(f ) log N , as N → ∞, where µ(f ) = 1 log 2  ∞ m=1 f (m) log  1+1/m 1+1/(m+1)  (ii)
There is also a constant ν(f ) such that the variance satisfies

V N [F ] ∼ ν(f ) log N , as N → ∞.
(iii) Moreover, the distribution of F is asymptotically Gaussian,

P N  x : C(x) -µ(f ) log N  ν(c) log N ≤ t  = 1 √ 2π  t -∞ e -u 2 /2 du + O  1 √ N  .
We remark that the expected length of the minimal period p(x) over K N is exactly log N (note that µ(1) is telescopic). It follows then that

E N [F ] E N [p] ∼ 1 log 2 ∞  m=1 f (m) log  1 + 1/m 1 + 1/(m + 1)  ,
which coincides with the behavior from the "real probabilistic model", see (1.58).

As for part (iii), there is also a similar result for the "real probabilistic model" [START_REF] Vallée | Euclidean dynamics[END_REF]Theorem 7], but the variance may differ.

CHAPTER 2

CONCEPTS FROM ANALYTIC COMBINATORICS

In this chapter we introduce key tools for the probabilistic analysis of algorithms and data structures: generating functions. We give a fast and slightly informal overview of the principles of Analytic Combinatorics. We deal, more specifically, with Dirichlet generating functions and Tauberian theorems, which we use extensively in this dissertation. In the context of dynamical systems, these generating functions are naturally written in terms of transfer operators (see section 1.4.7), giving rise to the so-called Dynamical Analysis.

Generating functions encode sequences in a convenient way. Citing Herbert Wilf "A generating function is a clothesline on which we hang up a sequence of numbers for display." [START_REF] Herbert | generatingfunctionology[END_REF]). Given a sequence, we consider a formal series (classically a power series from C[[z]]) encoding the terms as coefficients of the series. Then operations between generating functions relate to sequences built up from the original ones. This last property is fundamental and forms the basis of the symbolic part of Analytic Combinatorics.

Analytic Combinatorics, detailed extensively in [START_REF] Flajolet | Analytic Combinatorics[END_REF], gives a systematic way to study combinatorial objects which can be constructed by combining simple building blocks by following a set of finite rules. These objects should have an appropriate notion of size, which is strongly linked to the choice of the generating function type (we mention here 3 types here!). This diversity stems from the fact that generating functions encode the counting sequence of the family of objects according to their size, and different generating functions produce quite different kinds of convolutions (Proposition 2.1,Proposition 2.2,Proposition 2.7), which tell us how many object of a given size are produced when we apply the "product" rule. We introduce these notions in subsection 2.1.1.

At this stage, generating functions are purely formal (algebraic) objects. It is then, interpreting them as functions of a complex variable, that their power fully comes to light. It turns out that the singularities of the generating functions (now really seen as functions!), through their nature, determine the asymptotics of the coefficients. Thus we have two steps in the analysis: a symbolic step and an analytic one. The analytic step for classical generating functions (ordinary and exponential) is briefly discussed in subsection 2.1.3.

Numerous data structures and algorithms can be studied through the principles of Analytic Combinatorics. This is not always direct; our set of construction rules (in order to derive the generating functions) must follow the evolution of the algorithm, actually accumulating the meaningful information along the way.

When the algorithm has some sort of finite memory or independence in its evolution, the analysis might be simpler, steps separate into products. In some cases though, as is the case of the Euclidean Algorithm over the integers, all steps depend strongly on one another. This is where dynamical analysis comes into play.

Dynamical analysis mixes the methodology from Analytic Combinatorics with objects coming from dynamical systems, in particular the so-called transfer operator, introduced in subsection 1.4.7, which follows naturally the evolution of the dynamical system. With this operator at hand, we may obtain generating functions for our systems, now Dirichlet generating functions, which we describe in subsection 2.1.4. In subsection 2.2.1 we state Delange's [START_REF] Delange | Généralisation du théorème de Ikehara[END_REF] Tauberian Theorem, which relates the singularities of a Dirichlet generating function with the asymptotics of the cumulative sums of its coefficients. The process of dynamical analysis is introduced informally in subsection 2.2.3.

Generating functions

In this section we introduce generating functions. In section 2.1.1, we begin by introducing the most classical type of generating functions, known as the "ordinary generating functions", as well as the closely related "exponential generating functions" in section 2.1.2. We mention, in particular, how these types of generating function are related to different combinatorial contexts. Then we introduce the notion of singularities in section 2.1.3, explaining briefly the role played by the dominant (smallest absolute value) singularities in the growth of the coefficients of the generating functions. In section 2.1.4 we introduce Dirichlet generating functions, explaining how they arise, as well as some very important examples coming from number theory.

In this context we highlight the Delange Tauberian theorem in section 2.2.1,which links the behaviour of the dominant (now right-most) singularities to the growth of the partial sums of the coefficients. Finally we explain in section 2.2.3 the need for the so-called Dynamical Analysis in the study of parameters stemming from a dynamical system like those introduced in Chapter 1.

Ordinary generating functions

In its most basic form, an ordinary generating function is a power series encoding a given sequence as its coefficients. Their formal interest arises from the fact that operations between generating functions correspond to transformations between the coefficient series, with useful combinatorial interpretations when the coefficients count objects or describe probabilities.

Definition 2.1 (Ordinary generating function). The ordinary generating function (OGF) of a sequence (a n ) n≥0 is the formal power series

A(z) ∈ C[[z]] defined by A(z) :=  n≥0 a n z n . (2.1) Notation 2.1. The coefficient corresponding to z n in a power series A(z) is denoted by [z n ]{A(z)}.
We underline some basic properties of ordinary generating functions Proposition 2.1. Let (a n ) n≥0 and (b n ) n≥0 be sequences with OGFs A(z) and B(z) respectively. Then the formal product A(z)B(z) is the OGF associated with the convolution sequence

c n :=  n k=0 a k b n-k . Example 2.1. We note that (1 -z) -1 = 1 + z + z 2 + z 3 + . . . formally over the ring C[[z]].
The proof is just multiplying the formal power series on the right-hand side by (1 -z).

Here the left-hand side (1 -z) -1 was interpreted, for the moment, as the inverse of the unit (1 -z) in the ring. Since the formal operations proving that (1 -z) -1 = 1 + z + z 2 + . . . make sense over the complex numbers when |z| < 1, we conclude that the equality also remains true over the complex numbers when |z| < 1, and then the inverse • the size of an element is a non-negative integer;

(1 -z) -1 is just 1 1-z . 3
• the number of elements of any given size is finite.

Given a combinatorial class A, we denote by A n the set of all elements of size n and by A n the number of such elements. The sequence (A n ) is known as the counting sequence of the class.

The ordinary generating function of a combinatorial class A is the OGF of its counting sequence, which admits the combinatorial form

A(z) =  α∈A z |α| . (2.2)
It turns out that certain operations between generating functions correspond to operations between combinatorial classes. Here we mention three key constructions (sum, product and quasi-inverse) which will come in handy in order to get a good grasp of the operations in Dynamical Analysis (where we have sum, composition, playing the role of multiplication, and a quasi-inverse too).

Definition 2.3 (Constructions for unlabelled classes). We denote by E the combinatorial class consisting of a single element of size 0, and we call this the neutral class. By Z we denote the combinatorial class consisting of a single element of size 1, and we call this the atom class. When A ∩ B = ∅ we may identify A + B with A ∪ B and forget the first "label" entry. Observe also that the sum construction can be extended to countably many terms with a little care.

Sum construction. Given combinatorial classes

Product construction. We define the product class A × B with the product of the underlying sets and the sizes being simply the sum

|(β, γ)| A×B := |β| A + |γ| B .
The product may easily be extended to a finite number of factor combinatorial classes. For a countably infinite number of factors, on the other hand, we have to be more careful to ensure that the resulting counting sequence is well-defined.

Sequence construction. Given a combinatorial class G with no element of size 0, we define

SEQ(G) := E + G + G × G + G × G × G + . . .
which corresponds to all finite "sequences" (g 1 , . . . , g k ) of elements from G, k ≥ 0, along with the size function

|(g 1 , . . . , g k )| = |g 1 | G + . . . + |g k | G . 3
Comments regarding the constructions. There exist several other notable constructions such as the "set" or "multi-set". We will not get into these here, for more constructions and a more in depth exposition, the reader is referred to [START_REF] Flajolet | Analytic Combinatorics[END_REF].

It is also possible to define classes recursively using our "grammar" of constructions. Determining systematically the well-foundedness of a recursive specification is a non-trivial matter in general, see [START_REF] Pivoteau | Algorithms for combinatorial structures: well-founded systems and Newton iterations[END_REF]. To give an example of a recursive specification, the sequence SEQ(G) can be defined recursively by

SEQ(G) = E + Z × SEQ(G) .
Combinatorial constructions and power series. Note that the key role of the power series is easily realized from Proposition 2.1, which relates naturally F × G to F (z) • G(z). On the other hand, F (z) + G(z) is the generating function associated with F + G. Finally, from these two we derive that the OGF associated with SEQ(G) is

1 + G(z) + (G(z)) 2 + . . . = 1/(1 -G(z)). This is summarized in Table 2.1. operation generating function F + G F (z) + G(z) F • G F (z) • G(z) SEQ (G) 1 1-G(z)
Table 2.1: A small dictionary between our basic constructions and their corresponding generating functions. Here F (z) and G(z) denote the corresponding ordinary generating functions of the unlabeled classes F and G respectively. We remark that for exponential generating functions we have a similar dictionary, substituing the product • between labeled combinatorial classes for the labeled product ⋆ below.

Exponential generating functions

There are other types of useful generating functions, which correspond to a different kind of combinatorial objects. Here we give brief and informal account of the so-called labeled classes, for more details the reader is referred again to [START_REF] Flajolet | Analytic Combinatorics[END_REF]. Whereas unlabeled constructions are naturally associated with OGFs, labeled constructions will be associated with the so called exponential generating functions EGFs. What we want to highlight here is how the nature of the objects in question dictates the kind of generating function used.

Definition 2.4 (Exponential generating function). The exponential generating function (EGF) of a sequence

(a n ) n≥0 is the formal power series A(z) ∈ C[[z]] defined by A(z) :=  n≥0 a n z n n! . (2.3)
Proposition 2.2. Let (a n ) n≥0 and (b n ) n≥0 be sequences with EGFs A(z) and B(z) respectively. Then the formal product A(z)B(z) is the EGF associated with the convolution sequence

c n :=  n k=0  n k  a k b n-k .
In the unlabeled universe all atoms Z are equivalent, indistinguishable. In the labeled universe, on the other hand, they are all different and, what is more, they bear different integer "labels". A labeled object of size n is a graph whose vertices are labeled with distinct integers. An object of size n is said to be well-labeled if the labels form the set {1, . . . , n}.

Definition 2.5 (Labeled combinatorial class). A labeled combinatorial class is a combinatorial class of welllabeled objects.

Of course, a labeled object γ of size n may be turned into a well-labeled object ρ(γ) of size n by making the label set {1, . . . , n} and keeping the relative order of the labels of the nodes. The operation ρ is known as the reduction of the labeled object.

Combinatorial constructions and power series. Even though here we may define the sum construction similarly, the product construction is slightly more complex. Given two labeled combinatorial classes A and B we will define a new labeled product A⋆B defined as follows

A⋆B := {(β, γ) : (β, γ) well-labeled , ρ(β) from class A, ρ(γ) from class B} .
That is to say, intuitively, an object from A ⋆ B with size n is built by first picking a subset S of {1, . . . , n}, and then an object of size |S| from A, which we relabel with the set S, and an object from B, which we relabel according to the set {1, . . . , n} \ S.

With this definition at hand, it turns out that we still have the same dictionary from Table 2.1, but considering labeled classes, exponential generating functions and labeled products instead. We insist that in the labeled case the sequence construction SEQ may also be defined analogously by considering ⋆ instead of ×.

The formula for the generating function of the product A ⋆ B of two labeled classes is intuitively clear from Proposition 2.2. Indeed, the binomial coefficient corresponds to the action of choosing how to distribute the n labels for an object of size n between two labeled objects coming from A and B with sizes k and n -k.

Power series and singularities: the second step

Once we have characterized the generating functions for our objects of interest, we wish to obtain meaningful information regarding their coefficients. Sometimes, when we are lucky, we may deduce precise expressions for our quantities. More often than not, however, the generating functions involved are not that simple and we may only ever hope to derive asymptotics for their coefficients. This is to be expected in general, as the sequence of coefficients may be quite involved. In this section we explain how to extract asymptotics from the singularities of the OGFs or EGFs. The subject is classical and can be found in [FS09, Chapter IV] and a brief summary is included here for the sake of introducing the key link between coefficients of generating functions and their corresponding singularities.

Analytic functions.

In what follows, we look at our generating functions as actual functions on the complex plane, f : D → C, for an appropriately chosen open set D ⊆ C.

The introduction of complex numbers makes for a much stronger notion of differentiability: a complex function is (complex) differentiable on a domain D if and only if it analytic at every point of D. We explain what this means. The function f (z) is analytic at z 0 ∈ D if there are complex coefficients a 0 , a 1 , . . . which make f (z) =  a k (z -z 0 ) k for z on some open ball around z 0 . When f is analytic at every point of D, we say that it is analytic on D.

From the equivalence between being differentiable and analytic, it follows that a complex function that is differentiable once is actually differentiable infinitely many times! This is not the only remarkable property satisfied by analytic functions; if the open domain D is connected and the set of zeros of f has an accumulation point in D, the function f must be identically zero. This property has key consequences. One of them, known as the uniqueness of analytic continuation, tells us that an analytic function f : D → C has only one analytic extension a g :

D ′ → C if D ′ is a connected open set.
Intuitively, the value of g on D "determines" the rest. Back to our generating functions, the series actually yield analytic functions whenever the former are convergent. Power series actually have a so-called radius of convergence which is intimately related to the coefficients of the series (see Proposition 2.3). In turn, the radius of convergence is associated with the singularities (see Definition 2.6) of the complex-valued function derived from the GF.

First principle of Coefficient Asymptotics. A first indicator of the order of growth of the coefficients of a power series is the so-called radius of convergence (this is introduced in any elementary calculus or analysis book such as). The radius of convergence of a power series  n≥0 a n z n is the supremum of all possible r > 0 such that the series converges for |z| < r. If there is no such r , the radius of convergence is defined to be 0.

Proposition 2.3. The radius of convergence R of a power series f (z) =  n≥0 a n z n is determined by R = 1 lim sup |a n | 1/n , (2.4)
whenever the lim sup is non-zero, and it is said to be infinite otherwise.

In other words, given ϵ > 0 a We say that g :

D ′ → C is an extension of f : D → C when D ⊂ D ′ , g|D = f • We have |a n | 1/n < 1 R + ϵ for all large enough n • We have |a n | 1/n > 1
R -ϵ for infinitely many n. Proposition 2.3 tells us that the radius of convergence largely dictates the asymptotic growth of the coefficients of the power series (more precisely, their "maximal" exponential growth, namely lim sup |a n | 1/n ), but how do we determine the radius of convergence of a given generating function? This is where the so called singularities will come into play: a power series converges until the circle (centered at the origin) of radius |z| "hits" a singularity! Singularities. We now introduce a key concept: the singularities. We briefly comment on how these are related to the radius of convergence, giving a characterization of the radius of convergence. Proposition 2.4. If f (z) is analytic at the origin, and its power series expansion has a radius of convergence R, then there must be a singularity of f in the circle |z| = R.

In order to prove this proposition, we would first have to prove the so-called Cauchy's Integral Theorem and derive Cauchy's formula for the coefficients, see for instance [START_REF] Rudin | Real and complex analysis[END_REF] or [START_REF] Freitag | Complex analysis. Universitext[END_REF].

The singularities of smallest absolute value, i.e., R, the radius of convergence, are known as the dominant singularities of f (z) and play a larger role in the asymptotics of the coefficients.

When f (z) =  n≥0 f n z n has non-negative coefficients f n ≥ 0, we can say at more with regard to the positions of the singularities, in a similar fashion to the Perron-Frobenius theorem for matrices.

Theorem 2.1 (Pringsheim's Theorem). Suppose f (z) is analytic at the origin, and that the coefficients in the expansion are all non-negative. If the radius of convergence is R > 0, then R is a singularity of f . Second principle of Coefficient Asymptotics. We have related the radius of convergence R to the analytic properties, namely the position of the singularities, of the complex function f (z) given by the power series. In turn, we know that this radius of convergence determines the maximal exponential growth of the coefficients of its associated power series. We now explain, begninning from an example, how to get precise asymptotics from the knowledge of the dominant singularities in the case of meromorphic functions. The final principle is stated in Proposition 2.6.

Example 2.2 (Euclidean algorithm for polynomials over F q ). In this example we follow the method of [START_REF] Berthé | Probabilistic analyses of the plain multiple gcd algorithm[END_REF] to study the number of steps performed by the Euclidean algorithm over F q [x] (see also the example from [FS09, Example IX.15, pp. 662-663] where it is presented from the perspective of continued fractions).

Let us suppose that our input polynomials (a(x), b(x)) satisfy deg b(x) ≤ deg a(x), then the Euclidean algorithm proceeds by performing successive divisions

           a(x) = q 1 (x)b(x) + r 1 (x) , deg r 1 (x) < deg b(x) b(x) = q 2 (x)r 1 (x) + r 2 (x) , deg r 2 (x) < deg r 1 (x)
. . .

r k-1 (x) = q k (x)r k (x) + 0 .
The algorithm stops when the remainder equals zero, i.e., r k+1 (x) = 0, and outputs the previous one r k (x).

Then we are interested in studying the average number of division steps k = k(a(x), b(x)). If, otherwise, deg b(x) > deg a(x) the algorithm proceeds as above for the reversed input (b(x), a(x)).

GENERATING FUNCTIONS 75

We explain what we mean by average: pick the pair (a(x), b(x)) uniformly at random from the set

Ω n := {(a(x), b(x)) : deg a(x) + deg b(x) = n , a(x), b(x) monic polynomials} ,
where we recall that monic means that the leading coefficient is 1. What is the average of k = k(a(x), b(x))?

A few comments are in order:

• The whole process remains unchanged if we divided a(x) and b(x) by their gcd; each remainder r i is just divided by gcd(a(x), b(x)). Thus we will mainly work with the coprime pair  a(x)

:= a(x)/ gcd(a(x), b(x)),  b(x) := b(x)/ gcd(a(x), b(x))
, determining the execution of the algorithm.

• In turn, the reduced pair ( a(x),  b(x)) is determined univocally by the sequence of quotients (q 1 (x), . . . , q k (x)).

Note that q 1 (x) is monic by assumption,while the rest q 2 (x), q 3 (x), . . . , q k (x) can be arbitrary polynomials.

Thus, the input pair is characterized by the gcd and the sequence of quotients.

Let us consider U (z) = 1 1-qz , the OGF of monic polynomials, and G(z) = (q-1)qz 1-qz , the OGF of the general polynomials of positive degree. These expression follow from the sequence and product construction.

We "mark" the degree of a(x) by z and the degree of b(x) by t, thus rendering our generating function a bivariate one (in the ring C[[z, t]]). By this we mean that the coefficient of z n t m will correspond to a sum over the cases in which deg a(x) = n and deg b(x) = m. Even though we have not formally introduced multivariate series, we remark that we may realize such a series as a series where the coefficients are themselves series in another variable. The combinatorial operations of sum, multiplication and sequence extend to series in several variables, corresponding to the same operations between generating functions as before.

We have the bivariate identity

U (z) • U (t) = U (zt)    gcd ×  1 + (U (z) -1) + (U (t) -1)    q 1 (x)⇔monic polynomial  × 1 1 -G(zt)    q 2 (x),...,q k (x)⇔SEQ(general polynomials of deg≥1)
. This expression is justified by the fact that the gcd contributes equally to the degree of both a(x) and b(x), hence the factor U (zt), while the first quotient q 1 (x) may contribute to either the degree of a(x) or b(x) depending on which of the two has the smallest degree. Finally, the quotients q 2 (x), . . . , q k (x) contribute equally to the degrees of both a(x) and b(x), hence the identity.

Let us set z = t, forgetting the distinction between the two. This makes z mark the sum of the degrees of a(x) and b(x). In order to get the depth, which is just the number of quotients q 2 (x), . . . , q k (x) plus 1,we introduce a variable u marking the number of quotients

F (z, u) :=  (a(x),b(x))∈Ω u #steps(a(x),b(x)) z |(a(x),b(x))| = U (z 2 ) ×  (2U (z) -1) × u 1 -uG(z 2 )  .
Operating with our expressions for U (z) and G(z) we obtain

F (z, u) = (qz + 1)u (1 -q 2 uz 2 -q(1 -u)z 2 )(1 -qz) .
Differentiating in u and evaluating at u = 1 produces

S(z) :=  (a(x),b(x))∈Ω #steps(a(x), b(x)) z |(a(x),b(x))| = ∂ ∂u F (z, u)      u=1 = 1 -qz 2 (1 + qz)(1 -qz) 3 .
In terms of F (z, u), our expected value reads

E Ωn [#steps] =  (a(x),b(x))∈Ωn #steps(a(x), b(x))  (a(x),b(x))∈Ωn 1 = [z n ]S(z) [z n ]F (z, 1)
.

At this point we could actually compute the exact coefficients of both S(z) and F (z, 1), as our functions are rational (quotient of polynomials) and apply the identity Equation 2.5 below. However we will do it by looking directly at the nature of the singularities of both generating functions, thus explaining the process of singularity extraction.

For the case of S, the dominant singularities are given by z = 1/q, with multiplicity three, and z = -1/q with multiplicity 1. Thus we concentrate on these by applying partial fractions

S(z) = A (1 -qz) 3 + B (1 -qz) 2 + C 1 -qz + D 1 + qz + R(z) , A = q -1 2q ,
for certain constants B, C, D and R(z) that has a larger radius of convergence. The first four terms actually involve a well-known series because

1 (1 -z) n = ∞  k=0  n + k -1 k  z k , (2.5)
as follows upon differentiating (n -1) times the identity

1/(1 -z) =  ∞ k=0 z k . From (2.5) we get, by applying Proposition 2.3 to R(z), that [z n ]S(z) = A • (n + 2)(n + 1) 2 • q n + B • (n + 1) • q n + Cq n + D(-q) n + O((q -ϵ) n )
for some ϵ > 0.

For F (z, 1) we have F (z, 1) = (U (z)) 2 = 1/(1 -qz) 2 thus [z n ]F (z, 1) = (n + 1)q n and we derive

E Ωn [#steps] ∼ A n + 2 2 .
The constant A = q-1 2 q is computed simply by multiplying S(z) by (1 -qz) 3 and taking z → 1/q. 3

The previous example showcases several important concepts we now underline.

Probability and bivariate generating functions. First, suppose we had a bivariate generating function

F (z, u) =  α∈Ω u C(α) z |α| ,
where Ω is the set of objects, |α| the weight of α and C(α) the cost of α, a function we want to characterize. From F (z, u) we may express at once quantities such as the expected value of C(α) when α is chosen uniformly at random from Ω n , the set of objects of size n. Indeed

E Ωn [C] = [z n ]  ∂ ∂u F (z, u)    u=1  [z n ]F (z, 1
) , as in the previous example but also note that

E Ωn [C k ] = [z n ]  (u ∂ ∂u ) k F (z, u)    u=1  [z n ]F (z, 1) ,
where (u ∂ ∂u ) k means we apply the operator u ∂ ∂u exactly k times. This is what Wilf in [START_REF] Herbert | generatingfunctionology[END_REF] calls the "xD operator". In [START_REF] Flajolet | Analytic Combinatorics[END_REF] this operation corresponds to a "pointing" construction; the pointing ΘC of a combinatorial class C corresponds to distinguishing one atom from the structure as special.

We may even express the probability distributions in terms of F (z, u)

P Ωn (C = i) = [z n u i ]F (z, u) [z n ]F (z, 1)
.

Asymptotics and the nature of the singularities. Second, the asymptotic growth is dictated by the nature of the dominant (of smallest absolute value) singularities. In the example above we have rational functions, but the principle applies more generally to the so-called meromorphic functions. Meromorphic functions are functions which are locally a quotient of two analytic functions. For that case we just approximate our meromorphic function around each singularity by a rational function.

We remark that the dominant singularities "may" cancel out, and so these may not suffice to get the asymptotic behavior of all coefficients. To clarify what we mean, consider the trivial 1/(1 -z 2 ) + 1/(1 -z/2).

Here we have 1/(1 -z 2 ) = 1/(1 -z) + 1/(1 + z), and so the contribution of the dominant poles indeed cancels out (as they should!) for odd coefficients.

We state the principle here, for further details see [FS09, Chapter IV].

Proposition 2.5. Let F (z) =  n a n z n be meromorphic on the disc |z| ≤ R, having poles at the nonzero points α 1 , . . . , α k . Assume further that F (z) can be continued analytically to all points on the circle |z| = R. Then there are polynomials Π 1 , . . . , Π k such that:

a n = k  j=1 Π j (n)α -n j + O(R -n ) .
Furthermore, the degree of Π j is equal to the degree of the pole at α j minus 1.

When we have a unique dominant (of smallest absolute value) singularity, matters are simpler.

Proposition 2.6. For a meromorphic generating function F (z) =  a n z n , having a unique dominant (i.e., of smallest absolute value) singularity σ of type F (z) ∼ G(z) (z-σ) 1+a where G(z) is analytic at z = σ, we have

a n = G(σ) (-1) 1+a σ 1+a  n + a a  σ -n + O  1 (|σ| + ϵ) n  , for some ϵ > 0, as n → ∞. Remark that  n+a a  is a polynomial of degree a. Further, we have  n+a a  = n a a! + O(n a-1 ).
Observation 2.1. In our simplified explanation for the singularity analysis, we have not talked about effective error bounds. It is possible to actually bound the size of the coefficients of a power series by considering more precise expressions in terms of contour integrals in the complex plane. Indeed, Cauchy's integral formula (see [FB09, pp. 96-98]) tells us that for a power series f (z) =  a n z n , we have

a n = 1 2πi  γ f (z) dz z n+1 ,
for any simple (and piece-wise smooth) contour γ within the radius of convergence of f . These integral expressions lend themselves to bounding by considering bounds for |f (z)| on specific circles |z| = r. That is how the classical saddle-point bounds are derived (see [FS09, pp. 546-548]).

Dirichlet generating functions

Problems stemming from number theory many a times involve functions that are called multiplicative. An arithmetical function f :

N → C is multiplicative if f (ab) = f (a)f (b) when gcd(a, b) = 1, and completely multiplicative if f (ab) = f (a)f (b) for all a, b ∈ N.
There are numerous multiplicative functions; for instance the number of divisors d(n), the number of prime divisors ω(n), Euler's φ function and the celebrated Möbius µ function (see Definition 2.9 below). The appropriate generating functions to these functions is not a power series, but rather a Dirichlet series. (2.7)

Of course, the series (2.7) converges absolutely for ℜs > 1 and so it actually defines an analytic function on this half-plane. It can, however, be extended analytically to the whole plane except s = 1.

Example 2.3 (Divisor counting function). Define d(n) =  d|n 1. The DGF of d(n) is (ζ(s)) 2 .
A fundamental function in the context of DGFs is the so-called Möbius function µ(n) defined as follows Definition 2.9 (Möbius function). Let n be a positive integer. Then µ(n) is defined as follows

µ(n) :=  (-1) k , if n is free of squares and has exactly k prime divisors , 0 , otherwise .
The fundamental property of the Möbius function is given by the following proposition which tells us that µ actually allows us to perform a "sieving" over the "divisibility property".

Proposition 2.8. For every positive integer n, the Möbius function satisfies

 d|n µ(d) =  1, if n = 1 , 0, otherwise . (2.8)
Proof. The proof is simple enough. We only care about the divisors which are square-free, as the µ-function is 0 for the rest. Write the decomposition of n into product of prime powers n = p a 1 1 . . . p a k k , then all square free divisors of n are given by d =  s∈S p s where S ⊂ {1, . . . , k}, as we may not pick a prime number twice. Of course, µ(  s∈S p s ) = (-1) |S| and for each j we have

 k j  possible subsets S with |S| = j. Thus  d|n µ(d) =  k j=0  k j 
(-1) j and the result follows from the Binomial Theorem.

■ Observation 2.2. Furthermore F (n) :=  d|n g(d) , ∀n =⇒ g(n) =  d|n µ(d)F (n/d) .
(2.9)

We are going to briefly explain why µ corresponds to inclusion-exclusion (see [Sta97, pp.64-65], [Wil06, Chapter 4]) with this example. Following the proof of Proposition 2.8, we note that

 d|n µ(d)F (n/d) =  S⊂{1,...,k} (-1) |S| F  n  s∈S p s  . The term F  n  s∈S ps
 corresponds to a sum of g(k) over all divisors k of n for which the exponent of p s is not a s for s ∈ S. Thus we are actually trying to exclude the terms g(k), k|n, with the property "there is a prime p i such that p a i i ̸ |k". Of course, what remains after the cancellation can just be g(n). 3

The property from Observation 2.2 is known as the Möbius inversion formula [Apo98, p. 32], and can be explained purely in terms of DGFs in quite a direct way, even though the underlying combinatorial interpretation is the inclusion-exclusion above.

Proposition 2.9. The Dirichlet generating function of the Möbius function µ

(n) is 1 ζ(s) . Proof. If F (s) :=  µ(n)n -s ,
 F (n)n -s = ζ(s)  g(n)n -s , therefore  g(n)n -s = 1 ζ(s)  F (n)n -s .
Now this proves the result because 1 ζ(s) is the DGF of the Möbius function µ (see Proposition 2.9) and the product gives the DGF of the convolution by Proposition 2.7.

Observation 2.3. An important application of the Möbius function which we will use in Chapter 4 is to "filter" the pairs of integers (a, b) with gcd(a, b) = 1. Indeed, suppose we had a positive function f : N × N → R ≥0 and wanted to compute

 (a,b):gcd(a,b)=1 f (a, b). Then  (a,b):gcd(a,b)=1 f (a, b) =  (a,b)∈N×N f (a, b)  d| gcd(a,b) µ(d) .
Note that d| gcd(a, b) if and only if both d|a and d|b. Thus

 (a,b):gcd(a,b)=1 f (a, b) =  (a,b)∈N×N f (a, b)  d|a ∧ d|b µ(d) ,
and reversing the sums (for this we should add some conditions on f )

 (a,b):gcd(a,b)=1 f (a, b) = ∞  d=1 µ(d)  (a,b):d|a∧d|b f (a, b) , from which we conclude  (a,b):gcd(a,b)=1 f (a, b) = ∞  d=1 µ(d)  (a,b)∈N×N f (a • d, b • d) .
(2.10) This last equation is extremely useful when f satisfies some homogeneity conditions such as f (ad, bd) = d -r f (a, b) for some r > 1 (this already makes the series for f converge absolutely, and the reversing of the sums is valid as well!) and we know the value of S :=  (a,b) f (a, b), because then we deduce

 (a,b):gcd(a,b)=1 f (a, b) = S ∞  d=1 µ(d) d r = S ζ(r)
.

(2.11)

A consequence of the previous remark is that the density of coprime pairs is 6/π 2 (see [START_REF] Tenenbaum | Introduction to analytic and probabilistic number theory[END_REF])

Proposition 2.10. The density andζ(2) = π 2 /6 yields the result. ■

D N := #{(a, b) : 1 ≤ a, b ≤ N , gcd(a, b) = 1}/N 2 of coprime integers on {1, . . . , N } 2 satisfies D N = 6 π 2 + O((log N )/N ) . Proof. Consider a function f := f N (a, b) that is 1 iff gcd(a, b) = 1 with 1 ≤ a, b ≤ N and 0 otherwise. Indeed, from (2.10) it follows that #{(a, b) : 1 ≤ a, b ≤ N , gcd(a, b) = 1} = ∞  d=1 µ(d)  N d  2 = N 2 ζ(2) + O   N  d≤N 1 d   ,

Analytic Combinatorics for Dirichlet generating functions

From the point of view of Analytic Combinatorics, Dirichlet series correspond to integer weights that are multiplicative, i.e. |αβ| = |α||β| , for all α, β in the combinatorial class.

Dirichlet generating functions as analytic objects. Ordinary generating and exponential functions have a radius of convergence where they present at least one point where they cannot be continued analytically. Dirichlet generating functions, on the other hand, have a half-plane of convergence. This is explained by the following classical theorem (see e.g., [Apo98, p. 245]).

Theorem 2.2. If the Dirichlet series F (s) =  an n s converges for s 0 then it also converges for all s with ℜs > ℜs 0 . If the series diverges for s 0 , then it diverges for all s with ℜs < ℜs 0 .

Dirichlet series in general (if they are not everywhere convergent or everywhere divergent) present two fundamental abscissas: the abscissa of convergence σ c , for which the series converges if ℜs > σ c , and the abscissa of absolute convergence σ a , for which the series converges absolutely if ℜs > σ a . If the terms of the series are positive, as will be our case, then both abscissas coincide σ a = σ c . In any case, it is fair to underline that the inequality 0 ≤ σ a -σ c ≤ 1 holds (see [START_REF] Apostol | Introduction to Analytic Number Theory[END_REF]).

From the point of view of the generating functions as complex-valued functions, the convolutional product from Proposition 2.7 makes sense within the intersection of the half-planes of convergence. By the uniqueness of the analytic continuations (see [FB09, pp.126-128]), we do not pay attention to such details; we first operate formally, deriving our DGFs, and then make sense of them on their corresponding half-planes.

Example 2.4. The series in (2.7), defining the Riemann zeta function, converges for ℜs > 1. Thus it defines an analytic function over the half-plane ℜs > 1. It turns out that the zeta function can be extended analytically to the whole plane with the sole exception of s = 1 (see [START_REF] Whittaker | infinite processes and of analytic functions[END_REF] Chapter XIII]) where

ζ(s) = 1 s -1 + γ +  k≥1 (-1) k k! γ k • (s -1) k , ( 2

Tauberian theorems

Tauberian theorems are the "transfer theorems", telling us how the information on the singularities translates into asymptotics, corresponding to Dirichlet generating functions. It will be the case for DGF that we will not be able to derive asymptotics for individual coefficients but rather their cumulative sums. This is to be expected as, for instance, DGFs encode irregular functions such as the number of divisors function d(n).

The following theorem is a classical Tauberian theorem from Delange [START_REF] Delange | Généralisation du théorème de Ikehara[END_REF].

Theorem 2.3 (Delange). Let F (s) be a Dirichlet series with non negative coefficients such that F (s) converges when the real part of s satisfies ℜs > σ > 0. Assume that

• F (s) is analytic on ℜs = σ, s ̸ = σ.
• there is a > -1 such that

F (s) = G(s) (s -σ) 1+a + H(s) ,
where G(s) and H(s) are analytic at s = σ with G(σ) ̸ = 0.

Then  n≤N a n ∼ G(σ) σΓ(a + 1) N σ log a N , as N → ∞.
The statement of Theorem 2.3 is to be compared with the singularity analysis for meromorphic functions.

More generally, this holds too for non-integer sizes and we consider more general DGFs of the form F (s) =  i∈I a i g(i) -s where g(i) need not be an integer anymore. Proposition 2.11. Let (a i ) i∈I be a family of non-negative numbers indexed on a countable set I, and let g : I → (0, ∞). Suppose the series F (s) =  i∈I a i g(i) -s converges when the real part of s satisfies ℜs > σ > 0. Assume that

• F (s) is analytic on ℜs = σ, s ̸ = σ.
• there is a > -1 such that

F (s) = G(s) (s -σ) 1+a + H(s) ,
where G(s) and H(s) are analytic at s = σ with G(σ) ̸ = 0.

Then  i:h(i)≤N a i ∼ G(σ) σΓ(a + 1) N σ log a N ,
as N → ∞.

An example of Analytic Combinatorics in arithmetics

In this example we study the gcd of ℓ numbers picked independently and uniformly at random from {1, . . . , N }. We want to compute its k-th order moment, i.e.,

M N,k,ℓ (s) := 1 N ℓ N  s 1 =1 . . . N  s ℓ =1 (gcd(s 1 , . . . , s ℓ ))
 ∞  n=1 φ(n) n s  × ζ(s) =  ∞  n=1 n n s  = ζ(s -1) ⇒ ∞  n=1 φ(n) n s = ζ(s -1) ζ(s) .
(2.13) More generally, the above argument yields that

 d|n φ(n/d)d k = n  m=1 (gcd(n, m)) k .
Let us write

A n,k :=  d|n φ(n/d)d k = n  m=1 (gcd(n, m)) k .
The convolution defining A n,k implies (thanks to Proposition 2.7)

∞  n=1 A n,k n s = ζ(s -1) ζ(s) × ζ(s -k) .
The cumulative sums of A n,k which yields the Tauberian theorem (Theorem 2.3) give

S N,k :=  n≤N A n,k ∼        N k+1 k + 1 log N ζ(2) k = 1 , N k+1 k + 1 ζ(k) ζ(k + 1) k > 1 .
This is due to the nature of the dominant singularity. Indeed, to analyze the singularities we employ (2.7).

When k = 1 we have a double pole at s = 2, due the numerator (ζ(s -1)) 2 . When k > 1 we have a dominant singularity at s = k + 1 which is a simple pole.

The sum defining S N,k sums (gcd(n, m)) k over m ≤ n. To get the other cases, we exploit the symmetry and deduce

N  n=1 N  m=1 (gcd(n, m)) k = 2S N,k - N  n=1 n k ,
as we have summed the "diagonal case" n = m twice. Notice here that

 N n=1 n k = N k+1 k+1 + O(N k ) . When k > 1 this means that 1 N 2 N  n=1 N  m=1 (gcd(n, m)) k ∼  2 k + 1 ζ(k) ζ(k + 1) - 1 k + 1  N k-1 . (2.14)
For the case k = 1, the diagonal case is of a smaller order than 2S N,1 therefore we simply get

1 N 2 N  n=1 N  m=1 gcd(n, m) ∼ 2S N,1 /N 2 ∼ log N ζ(2) .
(2.15)

General case. We extend the φ function by defining φ ℓ to be φ ℓ (n) := #{(y 1 , . . . , y ℓ-1 ) ∈ {1, . . . , n} ℓ-1 : gcd(n, y 1 , . . . , y ℓ-1 ) = 1} , (2.16) in particular φ 2 (n) = φ(n), the classical φ function. As a consequence we get, as for the case ℓ = 2, that φ ℓ (n/d) = #{(y 1 , . . . , y ℓ-1 ) ∈ {1, . . . , n} ℓ-1 : gcd(n, y 1 , . . . , y ℓ-1 ) = d} , and therefore

 d|n φ ℓ (n/d)d k = n  y 1 =1 . . . n  y ℓ-1 =1
(gcd(n, y 1 , . . . , y ℓ-1 )) k .

(2.17)

In particular from the convolution of the case k = 0 we deduce its DGF

 ∞  n=1 φ ℓ (n) n s  × ζ(s) = ∞  n=1 n ℓ-1 n s = ζ(s -ℓ + 1) ⇒ ∞  n=1 φ ℓ (n) n s = ζ(s -ℓ + 1) ζ(s) . (2.18) Define A n,k,l := n  y 1 =1 . . . n  y ℓ-1 =1
(gcd(n, y 1 , . . . , y ℓ-1 )) k , thus from the convolution we get

∞  n=1 A n,k,l n s = ζ(s -ℓ + 1) ζ(s) × ζ(s -k) . (2.19)
From the singularities we get the asymptotics for the cumulative sums,

S N,k,ℓ =  n≤N A n,k,ℓ =                N k+1 k + 1 ζ(k -ℓ + 2) ζ(k + 1) k > ℓ -1 , N k+1 k + 1 log N ζ(k + 1) k = ℓ -1 , N ℓ ℓ ζ(ℓ -k) ζ(ℓ) k < ℓ -1 .
This follows from the nature of the singularities, which in turn depends on whether k > ℓ -1 (simple pole at s = k + 1), k = ℓ -1 (pole of order two at s = k + 1 = ℓ), or k < ℓ -1 (simple pole at s = ℓ).

Here the "diagonal" cases are subtracted through a process of inclusion-exclusion (see [START_REF] Stanley | Enumerative combinatorics[END_REF] or [Wil06, Ch.4])

N  y 0 =1 . . . N  y ℓ-1 =1
(gcd(y 0 , y 1 , . . . , y ℓ-1 )

) k =  ℓ 1  S N,k,ℓ -  ℓ 2  S N,k,ℓ-1 ± . . . (2.20)
Basically, first we sum ℓ times as the maximum of the entries may be anywhere, but we must subtract the cases in which we have that the maximum entry in the tuple appears twice, etc...

When k > ℓ -1, this means that 1 N ℓ N  y 0 =1 . . . N  y ℓ-1 =1
(gcd(y 0 , y 1 , . . . , y ℓ-1 )

) k ∼ 1 ζ(k+1) N k+1-ℓ k+1 ℓ  j=1  ℓ j  ζ(k -ℓ + 1 + j)(-1) j+1 . (2.21)
For k = ℓ -1 the "diagonal cases" we subtract are of smaller order, hence we get just the first term of the inclusion-exclusion

1 N ℓ N  y 0 =1 . . . N  y ℓ-1 =1 (gcd(y 0 , y 1 , . . . , y ℓ-1 )) k ∼ log N ζ(ℓ) . (2.22)
Finally, when k < ℓ -1, the firs term  ℓ 1  S N,k,ℓ with the "largest ℓ" dominates over the others

1 N ℓ N  y 0 =1 . . . N  y ℓ-1 =1 (gcd(y 0 , y 1 , . . . , y ℓ-1 )) k ∼ ζ(ℓ -k) ζ(ℓ) .
(2.23)

We summarize in the following proposition Proposition 2.12. Consider random variables Y

⟨N ⟩ i

, i = 0, . . . , ℓ-1, drawn independently and uniformly at random from {1, . . . , N }. The expected value of the gcd of these variables has 3 different phases depending on whether

k < ℓ -1, k = ℓ -1 or k > ℓ -1. E[  gcd(Y ⟨N ⟩ 0 , . . . , Y ⟨N ⟩ ℓ-1 )  k ] ∼                C k,ℓ N k+1-ℓ ζ(k + 1) if k > ℓ -1 , log N ζ(ℓ) if k = ℓ -1 , ζ(ℓ -k) ζ(ℓ) if k < ℓ -1 , (2.24)
where

C k,ℓ := 1 k + 1 ℓ  j=1  ℓ j  ζ(k -ℓ + 1 + j)(-1) j+1 .
Observation 2.4. The ideas from Observation 2.3 give a fast way to compute the moments of the greatest common divisor. Indeed

1 N ℓ N  y 0 =1 . . . N  y ℓ-1 =1 (gcd(y 0 , y 1 , . . . , y ℓ-1 )) k = ∞  s=1 µ(s) ∞  d=1 d k  N d × s  ℓ 1 N ℓ . (2.25)
This is significantly faster than the calculation on the left-hand side since the number of pairs (s, d) on the right-hand side that are non-zero is at most

 ∞ s=1 ⌊ N s ⌋ ∼ N log N . From (2.25
) it is clear that we get (2.23) when k < ℓ -1 by estimating ⌊x⌋ = x + O(1), but the rest of the cases are more involved because the error due to this approximation of the integer part does not vanish.

Second, from (2.25) we observe that (note simply that k marks the gcd) lim

N →∞ P N  gcd(Y ⟨N ⟩ 0 , Y ⟨N ⟩ 1 , . . . , Y ⟨N ⟩ ℓ-1 ) = d  = d -ℓ ζ(ℓ) ,
where the random variables Y ⟨N ⟩ i are drawn independently and uniformly at random from {1, . . . , N }. 3

What is Dynamical Analysis? Why is it useful?

In the previous examples coming from number theory, even though it may be non trivial to find expressions for the corresponding DGFs, in the end we did derive an "explicit" generating function in terms of the wellknown function ζ. This will not always be the case when we consider DGFs arising in a dynamical system.

In this context we make use of the transfer operator H s , introduced in section 1.4.7, which follows the evolution of the dynamical system. The transfer operator is a building block for our generating functions related to the time evolution of the system. However, there is little hope of extracting an explicit formula for this operator as the dynamical system may be quite correlated from step to step (notice that without correlation, we would have a product of GFs by the principles of Analytic Combinatorics).

After deriving an expression for our DGFs in terms of the transfer operator, we would like to extract asymptotics by means of Delange's Tauberian Theorem (i.e., Theorem 2.3). In order to do this, we require information concerning the dominant singularities of the operator. This is where the spectral properties of the transfer operator H s come into play, dictating the behavior of H k s at time k. The functional space of choice takes on a crucial importance; it must be expressive enough to allow us to produce our generating functions, but, at the same time, we prefer having fewer eigenvalues (we want a spectral gap, see Section 1.4).

Part II

Studies in Word Combinatorics CHAPTER 3

STURMIAN WORDS

Sturmian words constitute a family of words of primary importance in the field of Word Combinatorics. Introduced by Gustav A. Morse and Marston Hedlund [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF] in 1940, they represent the simplest non-trivial words in a precise sense we will soon describe. This chapter aims to explain why these objects, which are seemingly purely of combinatorial nature, admit a surprising, and convenient, arithmetical characterization.

We start off from some basic definitions from Combinatorics on Words, in particular that of a Sturmian word (see Definition 3.3), and build up the machinery necessary to characterize Sturmian words as what are called mechanical sequences. This equivalent characterization is given by Theorem 3.1 due to Morse and Hedlund [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF].

With this characterization at hand, we move on to explain why the recurrence function, a fundamental function measuring how much it takes for the factors of a word to reappear, of Sturmian words can be seen purely in terms of continuants deriving from the continued fraction expansion of the frequency of 1s, known also as the "slope" of the word, within the corresponding word. This remarkable property is given in Theorem 3.3 and is due also to Morse and Hedlund [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF].

Concepts from Combinatorics on Words

Consider a finite set A of symbols (also letters), which we call the alphabet. We are interested in the properties of words over this alphabet. Words are sequences of symbols from A, and may be infinite u = (u n ) n∈N from A N , or finite. We denote by A ⋆ the set of all finite words over the alphabet A, while its elements will be denoted by lower-case letters such as w, v and u. The set A ⋆ contains a special element ϵ, known as the empty word.

The length of a finite word w = w 1 . . . w n where w 1 , . . . , w n ∈ A is denoted by |w| = n, and the length of the empty word is |ϵ| = 0. An important operation between words is the concatenation

•. Given words u = u 1 . . . u n and v = v 1 . . . v m , their concatenation u • v is the word u • v = u 1 . . . u n v 1 . . . v m .
This operation turns A ⋆ into a monoid with identity ϵ.

The symbol • is omitted in general. This is coherent, as each individual symbol can be thought of as a word and then w = w 1 . . . w n can be interpreted as saying that w is the concatenation of n length-1 words.

The complexity function of an infinite word

We study the properties of infinite words, particularly with regard to their factors. Let u = (u n ) n∈N be an infinite word in A N . A finite word w of length n is a factor of u if and only if there exists an index m in u for which w = u m . . . u m+n-1 .

Let L u (n) stand for the set of factors of length n of u, while L u stands for the set of all finite factors of u and is known as its language. Two functions describe the set L u (n) of finite factors of the word u, namely the complexity and the recurrence function.

Definition 3.1 (Complexity function). The complexity function of u ∈ A ⋆ is the sequence

p u : n → → |L u (n)| .
Periodic words are amongst the "simplest" ones in terms of the complexity function, as they clearly satisfy p u (n) ≤ C for some constant C. Sturmian words are, informally, the "next simplest words".

Let us see some basic properties of this function Proposition 3.1. Let u ∈ A N be an infinite word. The complexity function p u (n) satisfies the simple properties

p u (n) ≤ |A| n , p u (n) ≤ p u (n + 1) , p u (0) = 1 , (3.1)
as well as

p u (n + m) ≤ p u (n) • p u (m) , (3.2)
for all n, m ≥ 0.

Inequality (3.2) implies that the complexity function is sub-multiplicative, hence by Fekete's Lemma [START_REF] Fekete | über die Verteilung der Wurzeln bei gewissen algebraischen Gleichungen mit ganzzahligen Koeffizienten[END_REF] (applied to the logarithms) the limit

lim n→∞ 1 n log p u (n) , (3.3)
exists and is known as the entropy of the word u. The entropy (3.3) can be thought of as an upper bound for the compressibility of u, given that the cost per symbol (taking base of the logarithm to be 2) we would have if we simply coded each block of length n as an integer {0, . . . , p u (n) -1} with fixed length in binary.

Definition 3.2 (Eventually periodic word). A word u ∈ A N is said to be eventually periodic if and only if there are finite words w, v ∈ A ⋆ , with v ̸ = ϵ such that u = wv N where v N is the infinite word

v • v • v • • • .
In such a case u is said to be the preperiod of u, while v is known as the period of u.

Here is a characterization of the eventually periodic words in terms of the complexity function Proposition 3.2. A word u ∈ A N is eventually periodic if and only if p u (n) ≤ n holds for some n.

Proof. It is clear that p u (n) is bounded when u is periodic. Indeed, the factors w of length n within u are always among u 1 . . . u n , u 2 . . . u n+1 , . . . , u i+j . . . u i+j+n-1 where i is the length of the preperiod of u and j the length of the period of v.

Conversely, assume p u (n) ≤ n. Then for some k we must have p u (k) = p u (k + 1). Indeed, it is clear that p u (k + 1) ≥ p u (k), and, if we never had equality, then p u (k + 1) ≥ 1 + p u (k) which implies p u (n) ≥ n + 1 as we always have p u (0) = 1 because of the empty word ϵ. As this is not the case, there is k such that p u (k) = p u (k + 1).

This equality means that each factor of length k within u has exactly one extension to length k + 1, this means that w 1 . . . w k determine w k+1 . Starting from u 1 . . . u k , which determines univocally u 2 . . . u k+1 , at some point we must repeat a word of length k as L u (k) is finite. Thus u is eventually periodic. ■ Observation 3.1. As we have seen during the previous proof, a word u ∈ A N is eventually periodic

• if and only if p u (n) = p u (n + 1) holds for some n,

CONCEPTS FROM COMBINATORICS ON WORDS

91

• if and only if p u (n) ≤ C for all n, for some C > 0.

Observation 3.2. A word u ∈ A N is not eventually periodic if and only if p u (n) ≥ n + 1 for all n.

Definition of Sturmian words

The simplest words that are not eventually periodic satisfy the equality p u (n) = n + 1 for each n ≥ 0. As p u (1) = 2, the alphabet is necessarily binary, and we consider A = {0, 1}, the binary alphabet, without loss of generality. It is not immediately obvious that such words do exist, but they do and are known as Sturmian words. In fact, there is a simple way of systematically constructing such words! See Definition 3.4 below.

Definition 3.3 (Sturmian word

). An infinite word u ∈ {0, 1} N is said to be Sturmian if and only if its complexity function satisfies p u (n) = n + 1 for all n ≥ 0.

Example 3.1 (The Fibonacci word). One of the simplest, and most classic, examples of a Sturmian word is given by the so-called Fibonacci word. The Fibonacci word is produced recursively as the limit of the sequence of words (f n ) n ⊂ {0, 1} ⋆ defined by:

f 0 = 0, f -1 = 1 , f n+1 = f n • f n-1 , n ≥ 1 ,
which follow the classical recurrence of the Fibonacci numbers. Remark that we get

f 0 = 0 f 1 = 01 f 2 = 010 f 3 = 01001 f 4 = 01001010 . . .
Observe that, as f n is a prefix of f n+1 we may speak of the limit f ∞ , being defined as the infinite word having every f n as a prefix. This limit word f ∞ is the Fibonacci word and is a Sturmian word. Here we show a part of the Fibonacci word

f ∞ = 0100101001001010010100100101001001010010100100101001010 • • •
We will come back to prove that f ∞ is indeed a Sturmian when we will have introduced several useful concepts and results from Word Combinatorics. For the moment we will remark that f ∞ is not eventually periodic. The number of ones in f n is the n-th Fibonacci number f n , while the length of f n is f n+2 , thus the frequency of 1s in f ∞ should be given by lim f n /f n+2 . As f n ∼ ϕ n / √ 5 where ϕ > 1 satisfying ϕ 2 = ϕ + 1 is the golden number, the frequency of 1s in f ∞ should be 1/ϕ 2 which is irrational! 3

Basic properties of Sturmian words

Sturmian words satisfy several simple, but useful, properties. An important one is the "recurrence" Proposition 3.3. Sturmian words are recurrent, that is, every factor appears an infinite amount of times.

Proof. Let u = u 1 u 2 . . . be a Sturmian word and suppose otherwise. If a factor w of u appeared finitely many times, then there is an index i such that w does not appear in v := u i+1 u i+2 . . . but then p v (n) ≤ n and v is eventually periodic, hence so is u, an contradiction! ■ Proposition 3.4. If u ∈ {0, 1} N is a Sturmian word then Similarly, all nodes save for L n have indegree 1, while L n has indegree 2. This leaves us with a structure like the one in the figure: there are two paths from R n to L n and one coming back from L n to R n .

1. the words 01 and 10 are factors of u.

2. exactly one of the words 00, 11 is a factor of u.

3. there is only one word R n ∈ L u (n) that can be extended on the right in two ways R n 0 ∈ L u (n + 1) and R n 1 ∈ L u (n + 1). The other have only one right extension.

4. there is only one word L n ∈ L u (n) that can be extended on the left in two ways 0L n ∈ L u (n + 1) and 1L n ∈ L u (n + 1). The other have only one right extension.

Proof. Property 1 follows from the fact that there are infinitely many 0s and 1s. Now, property 2 follows from the Definition 3.3 which tells us that p u (2) = 3.

For property 3 we observe that both p u (n) = n + 1 and p u (n + 1) = n + 2. Since every factor has some right-extension, this tells us that exactly one must have two right-extensions. Finally, item 4 is analogous as every factor has a left-extension (because by the recurrence we may assume that it is not a prefix of u). ■

Observation 3.3. Note that R n is necessarily a suffix of R n+1 and L n is a prefix of L n+1 .
The structure of L u (n) described in Proposition 3.4 is best seen from its Rauzy graph G u (n) (see e.g., [START_REF] Berthé | Fréquences des facteurs des suites sturmiennes[END_REF]) : the Rauzy graph G u (n) associated with an infinite word u is a finite automaton with state space L u (n) which describes a moving "sliding window" of length n along the word u; From a state b ∈ L u (n) upon scanning letter y, the next word is b • y ∈ L u (n + 1): we label the edge with u and the next state is τ (b • y) where τ (f ) for a word f just erases the leftmost symbol of f . A Sturmian Rauzy graph of order n is thus particularly sparse: it has n + 1 vertices and n + 2 edges. The special words L n and R n play a particular role in the Rauzy graph, this is shown in Figure 3.1

The Rauzy Graph G u (n), illustrated in Figure 3.1, is strongly-connected as u is recurrent. As a consequence its structure is composed of 3 oriented paths, forming two cycles. This is closely related to the 3-distance Theorem (see [START_REF] Vera | On the distribution mod 1 of the sequence nα[END_REF] and [START_REF] Berthé | Fréquences des facteurs des suites sturmiennes[END_REF]), which tells us that the words of L u (n) have only 3 possible frequencies in u, and gives explicit expressions for them.

Thus far we have not explained how to build Sturmian words, which is not immediate from Definition 3.3. In Section 3.2 we give an explicit theorem by Morse and Hedlund [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF], telling us that Sturmian words occur exactly as a particular coding of the orbit of circle rotations (of irrational angle) introduced in subsection 1.2.2. This not only gives an explicit construction for Sturmian words, it characterizes them all.

THE ARITHMETIC NATURE OF STURMIAN

The arithmetic nature of Sturmian words

Although Sturmian words may seem purely combinatorial objects, which look difficult to construct, it turns out that all Sturmian words occur as special codings of circle rotations with an irrational angle α. This is the central result of this section, but along the way we shall prove several properties regarding Sturmian words.We cite Morse and Hedlund "Sturmian trajectories possess certain numerical characteristics, namely, a frequency, a pole, and a type index, and admit mechanical constructions uniquely determined by these characteristics." [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF] This equivalence between Sturmian words and codings of circle rotations was first proved by Morse and Hedlund in [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF]. They, however, did not originally define Sturmian words as above. They defined Sturmian words to be what in the notation of [START_REF] Fogg | Substitutions in dynamics, arithmetics and combinatorics[END_REF] is called a "balanced word". This concept that will come in handy during the proof of this characterization of Sturmian words.

Definition 3.4 (Mechanical sequences). Given a pair (α, β) ∈ [0, 1] 2 , we define two infinite words S(α, β) and S(α, β) whose n-th symbols are respectively ⌊α(n + 1) + β⌋ -⌊αn + β⌋ for S(α, β) and ⌈α(n + 1) + β⌉ -⌈αn + β⌉ for S(α, β).

The words S(α, β) and S(α, β) are depicted in Figure 3.2. In digital geometry, these words code the line y = αx + β from above (S) and below (S) by horizontal lines (coded by a 0) and diagonals (coded by a 1).

In consequence it is commonplace to call α the slope of the word.

Theorem 3.1. [Morse and Hedlund] [MH40]

A word u ∈ {0, 1} N is Sturmian if and only if it equals S(α, β) or S(α, β) for a pair (α, β) formed by an irrational α ∈ (0, 1) and a real β ∈ [0, 1).

We now explain why the sequences from Theorem 3.1 correspond to codings of circle rotations and why they are actually Sturmian when α is irrational. The equivalence with rotations is stated in Proposition 3.5.

A coding of irrational circle rotations. We recall that in circle rotations, we consider the unit circle T 1 = R/Z, which is comprised of all reals mod 1. We will consider the representatives in [0, 1), thus the projection of a real number t onto the circle is represented by t mod 1 = {t}, the fractional part of t.

Rotations R α : T 1 → T 1 are defined by R α (x) := (x + α) mod 1, and we will be interested in coding the trajectory (or orbit) of an initial point β ∈ T 1 , which is given by (β, R α (β), R 2 α (β), . . .). The words S(α, β) and S(α, β) correspond to special codings of circle rotations. Indeed, note for example that for the word S(α, β) we have the n-th symbol equal to 1 if and only if going through the circle modulo 1 from αn + β to α(n + 1) + β we traverse 0 ≡ 1, that is, if αn + β mod 1 belongs to I 1 = [1 -α, 1). The coding is illustrated in Figure 3.3.

Proposition 3.5. The infinite word u = S(α, β) is given in terms of the intervals I 0 = [0, 1 -α) and I 1 = [1 -α, 1) by coding the rotation of β, considering the n-th symbol (n ≥ 0) to be 1 when R n α (β) = nα + β mod 1 belongs to I 1 and 0 otherwise. Analogously, we may consider I 0 = (0, 1 -α] and I 1 = (1 -α, 1] with the identification 0 ≡ 1, thus giving the word we denote by S(α, β). When α is irrational, factors of length n correspond to exactly distinct n + 1 intervals. Thus we find immediately that p u (n) ≤ n + 1 for each n. Equality actually holds because the orbit is dense in the circle a . Thus S(α, β) and S(α, β) are Sturmian words when the slope α is irrational.

Symbols u i in u = u 0 u 1 u 2 . . . indicate whether R i α (β) ∈ I 0 or R i α (β) ∈ I 1 ,
Observation 3.4. It is important to remark that the fact that the length of I 1 coincides with the angle of rotation is fundamental to produce Sturmian words.

Indeed, suppose that we coded 1 on the interval I 1 = [1 -α ′ , 1) with α ′ > α and α + α ′ < 1. Then the intervals corresponding to words of length 2 are necessarily

I 00 = [0, 1 -α -α ′ ), I 01 = [1 -α -α ′ , 1 -α ′ ), I 11 = [1 -α ′ , 1 -α), I 10 = [1 -α, 1) ,
so we have all possible words of length 2, giving a word that is not Sturmian. 3

A final important remark is that S(α, β) and S(α, β) coincide unless αk + β is an integer for some k (this can happen only for a single integer k), in which case they differ just on two symbols: indeed

⌊α(k + 1) + β⌋ -⌊αk + β⌋ = 0 ̸ = 1 = ⌈α(k + 1) + β⌉ -⌈αk + β⌉ and ⌊αk + β⌋ -⌊α(k -1) + β⌋ = 1 ̸ = 0 = ⌈αk + β⌉ -⌈α(k -1) + β⌉ ,
due to the floor and ceiling functions.

Strategy for the proof of Theorem 3.1. The proof is classical, here we follow [START_REF] Fogg | Substitutions in dynamics, arithmetics and combinatorics[END_REF]. As we have already shown that S(α, β) and S(α, β) are Sturmian, we need only prove the converse, that is: if u is a Sturmian word, then either u = S(α, β) or u = S(α, β).

The proof goes through the following steps:

(1) the frequency of 1s, as defined in Definition 3.5, exists for every Sturmian word u, call it α.

(2) α is irrational.

a Enough to see that n•α+m•1 = ϵ can be arbitrary small (follows from Observation 1.3), as then

  ⌊ t ϵ ⌋n • α + ⌊ t ϵ ⌋m -t   ≤ ϵ.

THE ARITHMETIC NATURE OF STURMIAN WORDS

95

(3) two Sturmian words with the same α have the same language of factors.

(4) a Sturmian word u with frequency of 1s α can be "approximated" by taking increasingly long factors from S(α, 0) and S(α, 0).

(5) there is a convergence of this sequence of factors (over A N ) to either S(α, β) or S(α, β) for some β.

We formalize the notion of frequency and discuss the frequency of the words S(α, β) and S(α, β) defined in Definition 3.4 which is both fundamental and motivates our plan.

Definition 3.5 (Frequency of a factor). Let u ∈ A N and consider a factor w ∈ A ⋆ . Then, the limit

f w := lim n→∞ 1 n   0 ≤ i ≤ n -|w| : u i+1 . . . u i+|w| = w   , (3.4)
if it exists, is called the frequency of w in u.

The numerator in (3.4) represents the number of occurrences of w in u 1 . . . u n . It is important to compare this with Birkhoff's Ergodic Theorem (Theorem 1.1).

For S(α, β) and S(α, β), the frequencies exist for every factor w. Indeed, for w = w 1 . . . w n , consider the fundamental interval

I w := I w 1 ∩ R α -1 I w 2 ∩ . . . ∩ R α -(n-1) I wn .
Then, thanks to Proposition 3.5, the indicator function 1 Iw (β) tells us whether w occurs at the beginning of the word (index 0). Thus the sum

1 Iw (β) + 1 Iw (R 1 α β) . . . + 1 Iw (R n-1 α β
) is number of occurrences of w among the indices 0, . . . , n -1. Proposition 1.12 tells us that the frequency of w actually exists and equals the length of I w .

Observe that for S(α, β) and S(α, β), the frequency of 1s is simply α, the angle of rotation/slope. Since the frequency of a factor w, more generally, is |I w |, note that the factors from the language of S(α, β) and S(α, β) are characterized solely by α and are independent from β. Thus for the words S(α, β) and S(α, β) we conclude that there is a bijection between α and the language of the word. This conclusion motivates steps (3) and (4) from the proof plan.

Observation 3.5. From Theorem 3.1 we conclude that the frequency of any factor w of a Sturmian word u actually exists.

The slope of a Sturmian word

In this subsection we prove steps (1) and (2) from the proof plan for Theorem 3.1, namely, that the frequency of 1s α exists for every Sturmian word u and that α ̸ ∈ Q.

Actually, for Sturmian words, not only does the frequency exist, as a matter of fact all factors of u give excellent approximations of the frequency of 1s (this is given in Corollary 3.1 below). This remarkable property is called the balance of a word. Definition 3.6 (Balanced word). A binary word u, be it finite or infinite, is said to be balanced if for every n ≥ 0 and for pair of factors w and v of length n, we have that the number of symbols 1 present in both w and v differ by at most 1. Notation 3.1. We denote by |u| 1 the number of ones in u. Thus, the latter part of the definition can be rewritten as ||w| 1 -|v| 1 | ≤ 1. Analogously we write |u| 0 for the number of 0s.

We remark that for a balanced word u ∈ A N , all factors w, v ∈ L n (u) satisfy ||w| 1 /|w| -|v| 1 /|v|| ≤ 1/n.

To prove that Sturmian words are balanced (i.e., Proposition 3.6), we require a technical lemma.

Lemma 3.1. If a binary sequence u is not balanced (be it finite or not), then it contains two subwords 0w0 and 1w1 for some w ∈ {0, 1} * . Further, without loss of generality, we may suppose that the pair satisfies the property that there is no pair of factors a, b ∈ L u (m) with |a| 1 -|b| 1 ≥ 2 and m < |w| + 2. Proof. Consider a Sturmian word u ∈ {0, 1} N . We already know from Proposition 3.2 that u is not eventually periodic. We now prove it is balanced. Suppose otherwise, then from Lemma 3.1 it follows that there are factors 0w0 and 1w1 in u for some w ∈ {0, 1} ⋆ , minimal in length. From Proposition 3.4 we know that either we have 00 as a factor or 11, but not both. This means immediately that w ̸ = ϵ, but it also tells us that if w = w 0 . . . w n for some n ≥ 0, then w 0 = w n . Furthermore, w is a palindrome, i.e., w k = w n-k for all k = 0, . . . , n. Indeed, if it were not, let k ≥ 1 be the smallest such that w k ̸ = w n-k , then 0w 0 . . . w k-1 0 and 1w n-k+1 . . . w n 1 form a shorter pair of unbalanced factors. Now, since w can be extended to the right in two ways, i.e., w = R n+1 , this means that one of 0w, 1w is R n+2 . Without loss of generality we assume it to be 0w. Thus we have that 0w0, 0w1, 1w1 are factors of u, however note that 1w0 is not.

Here we remark the following key property:

if 1w1 = u i . . . u i+n+2 , then 0w does not occur within v := w i . . . w i+2n+3 . (1)
This is proved as follows: if it did occur withing v, then the word 0w must start within the first n + 3 letters of v (which correspond to a 1w1), as follows from comparing lengths. Then, as w is a palindrome we must have 0w 0 . . . w k = w n-k w n-k-1 . . . w 0 1 for some k, but this is absurd as then w k = 1 and w n-k = 0.

Now we may continue with the proof of the proposition, armed with our key property. Property (1) tells us that within v = w i . . . w i+2n+2 at most n + 2 factors of length n + 2 may occur. As we have words w i . . . w i+n+1 , w i+1 . . . w i+n+2 , . . . , w i+n+2 . . . w i+n+3 , for a total of n + 3, some factor of length n + 2 must appear at least twice. But all of these factors of length n + 2 are distinct from 0w = R n+2 , so all of them have one right extension. Thus the factor appearing twice tells us that then this cycle repeats forever, a contradiction, since we know u is not ultimately periodic.

For the converse we must show that p u (n) = n + 1. Suppose otherwise, then let n be the smallest positive integer such that p u (n) ≥ n + 2. Then p u (n -1) = n and so there are two distinct factors, a and b, of length (n -1) that can be extended right-wards in two ways. Thus our word contains the words a0, a1, b0, b1 as factors. We may suppose that the words a and b differ only on their first symbol (else a smaller n would do).

Then we have factors of the form 0w0 and 1w1, contradicting the balancedness of u. ■ With these results in hand, we can finally prove that the Fibonacci word f ∞ defined in Example 3.1 is a Sturmian word.

Example 3.2 (The Fibonacci word revisited). We show that the Fibonacci word f ∞ defined in Example 3.1 is not eventually periodic, and hence from Proposition 3.6 it will follow that it is a Sturmian word. We prove f ∞ is balanced. In order to prove it, it is more convenient to define the sequence f k in terms of a morphism σ : {0, 1} ⋆ → {0, 1} ⋆ defined by σ(0) = 01 and σ(1) = 0. Being a morphism on the monoid {0, 1} ⋆ means that σ satisfies σ(ϵ) = ϵ and σ(a

• b) = σ(a) • σ(b)
, so defining it on {0, 1} is enough.

We remark then that σ(f k ) = f k+1 indeed, by induction we see that σ(f 0 ) = σ(0) = 01 = f 1 and then if we have σ(f j ) = f j+1 for all j ≤ k, we have

σ(f k+1 ) = σ(f k • f k-1 ) = σ(f k ) • σ(f k-1 ) = f k+1 • f k = f k+2 .

THE ARITHMETIC NATURE OF STURMIAN WORDS 97

Thus in fact, f ∞ is usually defined as the fixed point of the morphism σ [START_REF] Fogg | Substitutions in dynamics, arithmetics and combinatorics[END_REF].

Suppose now that f ∞ were not balanced, then from Lemma 3.1 it follows that there would be factors of the form 0w0 and 1w1 within f m for m large enough. Since f ∞ is clearly recurrent, we may further assume that the two subwords 0w0 and 1w1 we will be working with are not at the beginning of f ∞ . Clearly w is not empty as 11 cannot appear in f ∞ by Proposition 3.4. The word w can only start with a 0 and end with a 0, since there cannot be two consecutive 1s (else 1w1 would not be a subword). Thus w = 0w ′ 0 and so 00w ′ 00 and 10w ′ 01 are subwords of f m . Now, observe that the morphism σ is injective from {0, 1} ⋆ to {0, 1} ⋆ , in fact

• A 1 within the sequence implies that the symbol immediately to its left is a 0, and that we may extract the preimage of this pair to be 0.

• A 00 indicates that the first 0 must come from σ(1) as otherwise it would be followed by a 1.

In conclusion, we know that the letter to the left of 10w ′ 01 is a 0 and then f m contains 010w ′ 01 which has 0σ -1 (0w ′ )0 as its preimage and this is a subword of σ -1 (f m ) = f m-1 . Similarly, we note that having 00w ′ 00 in f m implies having 1σ -1 (0w ′ )1 in f m-1 . So both 0σ -1 (0w ′ )0 and 1σ -1 (0w ′ )1 appear as subwords of f m-1 and f m-1 is not balanced either. This idea follows inductively until we get m small enough for it to be obvious that f m is balanced and we have reached an absurd. 3

Proposition 3.7. Let u ∈ A N be a Sturmian word, then for any pair of factors

u ∈ L u (n) and v ∈ L u (m) we have     |u| 1 n - |v| 1 m     ≤ 1 n + 1 m . (3.5)
Proof. This proposition follows from Proposition 3.6. Let g k be the minimal number of 1s for the words of L u (k), so that each word of L u (k) has either g k or g k + 1 ones.

As any factor of length n × m is composed of n factors of length m, or equivalently m factors of length n, we derive the inequalities mg n ≤ n(g m + 1) , ng m ≤ m(g n + 1) .

This means that

g n n - g m m ≤ 1 m , g m m - g n n ≤ 1 n ,
and these imply

|u| 1 n - |v| 1 m ≤ g n + 1 n - g m m ≤ 1 n + 1 m , |v| 1 m - |u| 1 n ≤ g m + 1 m - g n n ≤ 1 m + 1 n ,
thus proving the result. ■ Corollary 3.1. Let u ∈ {0, 1} ∞ be a Sturmian word, then the frequency α := f 1 of 1s exists and satisfies

    |w| 1 |w| -f 1     ≤ 1 |w| , (3.6)
for any w ∈ L(u).

Proof. Proposition 3.7 implies that the sequence (g k /k) ∞ k=1 , where g k is the least possible number of ones in a factor of length k in u, is a Cauchy sequence and hence converges to a real number α ∈ [0, 1].

This number α is equal to f 1 , frequency of 1s, as Sturmian sequences are balanced. Finally (3.6) follows from Proposition 3.7 by choosing V to be a word in L m (u) having the least possible number of 1s and then taking the limit m → ∞. ■ Following our proof plan described at the beginning of Section 3.2, the frequency α = f 1 will end up being the rotation angle in Theorem 3.1. As such, the rotation angle α must be irrational (step (2)).

Proposition 3.8. Let u ∈ {0, 1} ∞ be a Sturmian word, then the frequency α := f 1 of 1s is irrational.

Proof. Assume for the sake of contradiction that α = p/q with gcd(p, q) = 1. Let g k be the minimal number of 1s for the words of L k (u). Then we have (just think of u as a series of blocks of length k)

g k k ≤ α ≤ g k + 1 k .
Pick k = q, then g q q ≤ p q ≤ g q + 1 q , thus either p = g q or p = g q + 1.

Suppose first that p = g q and consider k = 2 r q for r ≥ 0. Then 2 r g q ≤ g 2 r q and therefore g 2 r q 2 r q is increasing in r. As it converges to α = g q /q it we get that g 2 r q 2 r q = g q /q for all r ≥ 0. We show this is absurd.

As the word u is not periodic, there is a factor w of length q such that |w| 1 = g q + 1. From Proposition 3.3 we know that w occurs an infinite number of times in u, hence it must occur at two indices congruent modulo q. Thus for r large enough we can find a factor v of length 2 r q for which w occurs at least twice, and hence |v| 1 ≥ 2 r a q + 2. This means that a 2 r q ≥ 2 r a q + 1, thus producing the contradiction.

The proof for the case p = g q + 1 is analogous. ■

The language of a Sturmian word

In this subsection we prove steps (3) and (4) from the proof plan for Theorem 3.1 given at the beginning of Section 3.2, namely, that the language of a Sturmian word u is determined by its slope α and that we can approximate u by arbitrarily long factors of S(α, 0) and S(α, 0) in a precise sense.

The topology of A N . We turn the space of infinite words A N over the alphabet A into a metric space by introducing the distance

d(u, v) = 2 -m , m := min{k ≥ 1 : u k ̸ = v k } ,
and d(u, v) = 0 when u = v, which coincides with the intuition "min ∅ = ∞" and "2 -∞ = 0".

Thus a sequence of infinite words u (1) , u (2) , . . . in A N converges to a word v if and only if, for each index k ≥ 1 there is

N k ≥ 0 for which u (n) 1 . . . u (n) k = v 1 . . . v k for all n ≥ N k .
Informally, if the prefixes "stabilize", becoming constant from some point on.

Observation 3.6. Of course, the topology we have just introduced for A N is non other than the product topology: consider the discrete topology over the finite alphabet A.

Since the discrete topology makes A compact, the product A N is compact by Tychonoff's Theorem (see for instance [START_REF] Munkres | Topology. Featured Titles for Topology Series[END_REF]). Definition 3.7 (Convergence on A ∞ := A ⋆ ∪ A N ). To extend A N to A ∞ := A ⋆ ∪ A N we may consider that A ∞ is actually a closed topological subspace of (A ∪ {ϵ}) N , where ϵ denotes the empty word. Thus we may speak of the convergence of finite words in A ⋆ to infinite words in A N .

Example 3.3. This is the case of Example 3.1, where the finite words f k converge to f ∞ .

3

We may also speak of continuous functions on the space (A N , d). The simple example of such a function being the shift map S : A → A defined by S(x 1 x 2 x 3 . . .) = x 2 x 3 . . .. The map S is clearly continuous as it satisfies the inequality d(Su, Sv) ≤ 2d(u, v).

We already know that (A N , d) is compact due to Tychonoff's theorem, however we present a classical proof with a diagonal argument for the sake of completeness.

Proposition 3.9. The metric space (A N , d) is compact.

Proof. Given a sequence of words u (1) , u (2) , . . ., we will show that there is a convergent subsequence.

Since the alphabet A is finite, there must be some letter a 1 ∈ A that appears infinitely many times as the first letter u

(k) 0 = a. Let u (n (0) 1 ) , u (n (0)
2 ) , . . . be a subsequence such that u

(n (0) k ) 0 = a 0 for all k ≥ 1.
Repeating the argument we get an increasing subsequence (n

(1) k ) ∞ k=1 of (n (0) k ) ∞ k=1 such that the second entry u n (1) k 1
is always equal to some symbol a 1 ∈ A, and so on producing (n

(2) k ) ∞ k=1 , (n (3) k ) ∞ k=1 , . . . Now comes the diagonal argument. Consider m k := n (k) k , then u (n (k) k ) 0 . . . u (n (k) k ) k = a 0 . . . a k for all k ≥ 1 and we see that u (n (k) k ) converges to a = a 0 a 1 . . . ■
The slope and the factors of Sturmian words. We denote by S : A N → A N the shift S(x 1 x 2 x 3 . . .) = x 2 x 3 . . . The study of the factors of S comes down to the study of its orbit O(u) := {u, Su, S 2 u, . . .}, from a topological perspective. More precisely, we are interested in X u := O(u), its topological closure.

The set X u is compact and closed under S (by the continuity). We shall see that the set X u , the subshift of u, is actually characterized by the fact that every element has the same given frequency of 1s as u.

Proposition 3.10. Let u ∈ {0, 1} N be a Sturmian word. The for every v ∈ X u = O(u) we have L v = L u and the frequency of 1s in v and u are equal.

In order to prove Proposition 3.10, we introduce a new concept: the uniform recurrency of a word. This property actually amounts to each elements from X u having the exact same language as u. Uniformly recurrent words have, even though the may be aperiodic, a sort of recurrence that we will afterwards measure with the so called recurrence function, a central object to this dissertation.

Definition 3.8 (Uniformly recurrent word). A word u ∈ A N is said to be uniformly recurrent if and only if each factor w in u appears infinitely often and with bounded gaps.

That is, given a factor w in u, there exists is a constant C := C u (w) > 0 such that if u i+1 . . . u i+n = w, there is j with 0 < j -i ≤ C such that u j+1 . . . u j+n = w.

Sturmian words are all uniformly recurrent. Thinking from S(α, β) and S(α, β) , this happens because kα mod 1 is dense on [0, 1] and factors correspond to intervals (recall Proposition 3.5).

Proposition 3.11. Sturmian words are uniformly recurrent.

Proof. Let u be a Sturmian word and suppose otherwise. We already know from Proposition 3.3 that u is recurrent, so for it to be not "uniformly recurrent" we must assume we had a factor w of u that appears infinitely many times but not with bounded gaps, i.e., for each C > 0 there are indices i and j such that j -i > C and u i+1 u i+2 . . . u i+n = u j+1 u j+2 . . . u j+n = w and w is not a factor of the finite word u i+2 . . . u j+n-1 .

Thus we may construct an infinite sequence of factors, increasing in length, that do not contain w. This sequence has a fixed point v ∈ {0, 1} N . Since this new word v is a limit of factors of u not containing w, we see that it has at most |w| factors of length |w| (because u is Sturmian). Thus v is eventually periodic and its frequency of 1s is rational, but its frequency of 1s should coincide with that of u by Proposition 3.10, which is irrational because of Proposition 3.8.

■ Corollary 3.2. Let u be a Sturmian word. Then L u (n) = L v (n) for all v ∈ O(u).
Then the following Theorem 3.2 is the final result of this subsection, which states that the slope α characterizes the language of a Sturmian word and summarizes the fact that speaking about language and subshifts is the same thing. This is key to the proof of Theorem 3.1 as this means that a Sturmian word u with slope α has the same language as S(α, 0) and S(α, 0) (clearly of slope α) and hence u belongs to their subshift; it

THE ARITHMETIC NATURE OF STURMIAN WORDS

100 can be approximated from arbitrarily long factors of these.

Theorem 3.2. Let u and v be two Sturmian words with the same frequency of 1s. Then the language of factors of both words coincide L u = L v , equivalently O(u) = O(v). Conversely, if L u = L v , then u and v have the same slope (frequency of ones).

Observation 3.7. As a consequence, for Sturmian words we may speak of L α , where α is the slope.

In order to prove this, we need a technical lemma regarding balanced sets of words. This is related to the characterization of a Sturmian word as an aperiodic balanced word u ∈ {0, 1} N . In fact, from this technical lemma one can easily derive that a balanced and aperiodic word is a Sturmian word.

Definition 3.9. A set of finite words L is said to be balanced if and only if for every pair of words w, v ∈ L and factors w ′ and v ′ , of w and v respectively, of the same length we have

||w ′ | 1 -|v ′ | 1 | ≤ 1.
Lemma 3.2 (Ex. 6.1.12 [START_REF] Fogg | Substitutions in dynamics, arithmetics and combinatorics[END_REF]). If a set of finite words L is balanced, then the number of words of length n is at most n + 1.

Proof. We may assume without loss of generality that our sets L satisfy that if u ∈ L and v is a factor of u, then v ∈ L, as the addition of v still makes L balanced. We proceed by induction on n. The result is clear for n = 0 and n = 1. Now assume the result to be true for all n < m, let us prove it for m.

Assume we had m + 2 words of length m. Then, as we had only m words of length m -1, two of these u and v must have two right-extensions u0, u1 and v0, v1 on L.

Write u = u 1 . . . u m-1 and v = v 1 . . . v m-1 and let k = max{1 ≤ i < m : v i ̸ = u i }. Of course k ≤ m -1 is well-defined as u ̸ = v. Then U = u k u k+1 . . . u m-1 u k and V = v k v k+1 . . . v m-1 v k are
g k (u) k ≤ α ≤ g k (u) + 1 k , g k (v) k ≤ α ≤ g k (v) + 1 k ,
but this immediately implies that g k (u) = g k (v), because kα cannot be an integer. In turn, this means that the union L k (u) ∪ L k (v) is balanced in the sense of Definition 3.9. Thus from Lemma 3.2 we deduce that Proof. Let u be a Sturmian word of frequency α = f 1 (u). We show that there is β ∈ [0, 1) such that either u = S(α, β) or u = S(α, β).

|L k (u) ∪ L k (v)| ≤ k + 1, which means that L k (u) = L k (v) = L k (u) ∪ L k (v)
Let us consider the centered v = S(α, 0), which as we have seen corresponds to the codings of circle rotations in Proposition 3.5. We know from Theorem 3.2 that u ∈ O(v) so that u is seen as the limit of S n 1 v, S n 2 v, . . . for some increasing sequence n 1 , n 2 , . . . We note that S n k v = S(α, {n k α}) and that the sequence {n k α} on the unit interval mod 1 must have a convergent subsequence. Thus we may assume

β = lim k→∞ n k α on T 1 .
We prove that u = S(α, β) or u = S(α, β) by showing that S n k v tends to S(α, β) or S(α, β). As β = lim n k α on T 1 , we may assume that the sequence n k α either increases to β (tends to it counter-clockwise in the sense of Figure 3.3) or it decreases to it (tends to it clockwise). Whether we have u = S(α, β) or u = S(α, β) will depend exactly on this property.

We note that S n k v = S(α, {n k α}) and S(α, β) differ within the first m symbols if and only if {n k α} and β belong to two different intervals of T 1 delimited by the points 0, -α, . . . , -mα modulo 1. As {n k α}

A SECOND CONCEPT FROM WORD COMBINATORICS: RECURRENCE

101 tends to β modulo 1, the only case in which this does not happen for large enough k is when β is one of the points 0, -α, . . . , -mα modulo 1.

It is important to picture what happens at the borders of these delimited intervals (as in Proposition 3.5 with 0 ≡ 1 and 1 -α). In the case of S(α, β) we note that the delimited intervals (corresponding to factors of length m) partitioning T 1 . These intervals are [a 0 = 0, a 1 ), [a 1 , a 2 ), . . . , [a m , a m+1 = 1) where the sequence a i increases. Moreover, for S(α, β) they read (0, a 1 ], (a 1 , a 2 ], . . . , (a m , 1] for the same underlying sequence a i . Suppose β = a j , then if {n k α} increases towards β we have that {n k α} ∈ (a j-1 , β], setting a -1 = a m , for large enough k and so S(α, {n k α}) coincides with S(α, β) in the first m symbols for large enough k. Else if {n k α} decreases towards β we have that {n k α} ∈ (β, a j+1 ], setting a m+1 = a 1 , for large enough k and then S(α, {n k α}) coincides with S(α, β) on the first m symbols for large enough k. ■

A second concept from Word Combinatorics: recurrence

We have already introduced the complexity function and several other key properties concerning Sturmian words, in particular that they are "mechanical sequences" (see Theorem 3.1). Along the way we defined the concept of uniform recurrence, as a convenient combinatorial formulation of the equivalence between having two words u and v have equal languages L u = L v and having v belonging to the closure X u of the orbit O(u) = {u, Su, S 2 u, . . .} b (equivalently u ∈ X v ). We recall that an infinite word u ∈ A N is uniformly recurrent if every factor of u appears infinitely often and with bounded gaps (see Definition 3.8). We proved in Proposition 3.11 that Sturmian words are uniformly recurrent.

Here we will concentrate on the concept of recurrence for its own sake. We have already discussed the complexity (the number of finite factors) of infinite words. It is also important to study where finite factors occur inside the infinite word u. For uniformly recurrent words, such as Sturmian words, all factors reappear with bounded gaps. We can then quantify the size of these gaps by using the so-called recurrence function.

In this section we introduce the recurrence function, discuss its basic properties and explain a fundamental result, Theorem 3.3, again by Morse and Hedlund [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF]. This theorem relates the recurrence function of a Sturmian word with slope α to the continuants of α, and its proof depends strongly on Theorem 3.1.

Definitions and basic properties

In this subsection we introduce the recurrence function, and discuss briefly a proposition relating it to the complexity function.

We recall the definition of uniform recurrence.

Definition. 3.8 A word u ∈ A N is said to be uniformly recurrent if and only if each factor w in u appears infinitely often and with bounded gaps.

In other words, given a factor w in u, there exists is a constant C := C u (w) > 0 such that if u i+1 . . . u i+n = w, there is j with 0 < j -i ≤ C such that u j+1 . . . u j+n = w.

Denote by w u (q, n) the minimal number of symbols u k with k ≥ q which have to be inspected to discover the whole set L u (n), starting from the index q. Then, the integer w u (q, n) is a sort of "waiting time" and u is uniformly recurrent if each set {w u (q, n) | q ∈ N} is bounded, and we may define the so-called recurrence function n → → R u (n).

Definition 3.10. Recurrence function Let u ∈ A N be a uniformly recurrent word, then the recurrence function is defined by

R u (n) := max{w u (q, n) | q ∈ N} , (3.7)
b Recall that S : A N → A N , the shift map, is defined by S(x1x2x3 . . .) = x2x3 . . . where w u (q, n) := min{m ∈ N : u q . . . u q+m-1 contains all of the factors L u (n)}.

A SECOND CONCEPT FROM WORD COMBINATORICS

Rα (n) q0 =1 q1 =2 q2 =3 q3 =5 q4 =8 q5 =13 (
Rα (n) q0 =1 q1 =2 q2 =3 q3 =8 q4 =11 q5 =19 (
This is clearly equivalent to the following usual definition: any factor of length R u (n) from u contains all factors of length n of u, and the length R u (n) is the smallest integer which satisfies this property.

The complexity function and the recurrence function are related through the following bound Proposition 3.12. Let u ∈ A N by an infinite word on a finite alphabet A, then the complexity function p u and the recurrence function R u of u satisfy

R u (n) ≥ p u (n) + n -1 .
Proof. If a factor w of length m in u contains every factor of length n, then for each of the p u (n) = |L u (n)| factors of length n, there is a corresponding index of w where they start. Then we must surely add n -1 characters to complete the factor of length n with the largest starting index on w. ■ Any Sturmian word is uniformly recurrent. Its recurrence function only depends on the slope α (recall Theorem 3.2) and is thus denoted by n → → R(α, n). Figure 3.4 gives the plots for two different slopes. Note that the recurrence is piece-wise affine, a fact that will be explained by Theorem 3.3.

The frequencies of the factors of a Sturmian word

The recurrence function is strongly related to the frequencies of the factors. Intuitively, a factor appearing more rarely should force us to have a larger R u (n).

We have already explained what happens with the frequencies of the factors of Sturmian words, as these correspond to circle intervals. We recall it here Proposition 3.13. Let u ∈ {0, 1} N be a Sturmian word of slope α and w = w 1 . . . w n be a factor of u of length n. Then the frequency of w in u is given by |I w | where

I w := I w 1 ∩ R -1 α (I w 2 ) . . . ∩ R n-1 α (I wn ) ,
where I 1 := [1 -α, 1) and I 0 := [0, 1 -α), considered as circle intervals on T 1 .

This would make it seem as if we had to compute the length |I w | for every single factor w. We underline that this is not the case: for any given length n, there are at most three possible frequencies for the factors of length n. This property is most easily explained from the form of the Rauzy graph (see Figure 3.1).

We recall that the Rauzy Graphs G u (n), as shown in Figure 3.1, are strongly-connected (Sturmian words are recurrent). Its structure is composed of 3 oriented paths, forming two cycles, thanks to Proposition 3.4.

A SECOND CONCEPT FROM WORD COMBINATORICS: RECURRENCE 103

The structure of the graph tells us at once that there can be at most 3 possible frequencies for the words in L u (n), one of them being the sum of the other two (the frequency of the path back from L n to R n ).

Proposition 3.14 (Weak three-distance theorem). Let α ∈ I \ Q. Consider the circle T 1 intervals I 0 , . . . , I n delimited by the set of points 0, α, . . . , nα mod 1 ordered geometrically. Then the lengths of the intervals (I k ) n k=0 attain at most 3 possible values, the largest being the sum of the other two. This is a weak version of the three-distance theorem ([Sós58], [START_REF] Berthé | Fréquences des facteurs des suites sturmiennes[END_REF]), which, in its full form also gives precise formulas for each of the three distances in terms of the continuants (q k (α)) k of the slope α. We will not prove the complete version of the three-distance theorem, but it is worth highlighting that Lemma 3.4 could be seen as a particular consequence of it.

The smallest and largest of these 3 frequencies play a fundamental role. The smallest frequency, which corresponds to the smallest intervals I w , are the words we would expect to appear less often, and similarly the largest frequency, which corresponds to the largest intervals I w . Definition 3.11 (Smallest distance). Let α ∈ [0, 1). On the circle T 1 = R/Z consider the intervals delimited by the set of points 0, α, . . . , nα mod 1. We denote by Γ(α, n) the smallest length of these intervals.

Observation 3.8. Note that the smallest distance Γ(α, n) corresponds to the smallest possible frequency of a factor from L α (n + 1).

The smallest distance can be characterized in terms of the convergents of α.

Proposition 3.15. Let α ∈ [0, 1) and n ∈ N. Let k be the unique non-negative integer such that q k (α) ≤ n < q k+1 (α). The smallest distance Γ(α, n) is then given by

Γ(α, n) = M k (α) := |αq k -p k | .
(3.8)

Proof. We note that if the distance on T 1 between αi and αj for 0 ≤ i < j ≤ n is Γ(α, n), then so is the distance between 0 and (j -i)α where 0 ≤ (j -i) ≤ n. The proof then follows from Proposition 1.5. ■

We also give the notation for the largest distance, which will also be involved in the proof.

Definition 3.12 (Largest distance). Let α ∈ [0, 1). On T 1 = R/Z consider the intervals delimited by the points 0, α, . . . , (n -1)α modulo 1. We denote by Υ(α, n) the maximum of the lengths of these intervals.

We remark that the remaining distance equals Υ(α, n) -Γ(α, n) due to 3.14.

The Morse-Hedlund formula for recurrence of Sturmian words

Now that we have described the recurrence function and the smallest distance, we come to a key theorem of this section, relating the recurrence function R α (n) to the continuants of α.

Theorem 3.3 (Morse, Hedlund [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF]). Fix an irrational slope α > 0, then the recurrence function can be computed in terms of the continuants of α by the formula

R α (n) = n -1 + q k-1 (α) + q k (α) , (3.9)
where the index k = k(α, n) is the only positive integer such that q k-1 (α) ≤ n < q k (α).

Observe that Theorem 3.3 implies that the recurrence function is piece-wise affine (when we extend to non-integer points), this is illustrated in Figure 3.4.

Here we rewrite the Morse and Hedlund's proof in our notation. In order to do this, we will first relate the recurrence function to the smallest distance Γ(α, n).

Definition 3.13 (First recurrence time). We define the first recurrence time ξ[ϵ, α] to be the smallest positive integer m such that the maximum length of the circle T 1 intervals delimited by 0, α, 2α, . . . , (m -1)α, on the unit circle, is at most ϵ > 0.

A SECOND CONCEPT FROM WORD COMBINATORICS: RECURRENCE 104

It is important to note that in Definition 3.13 we have m points and not m + 1 as in the definition of Γ(α, m).

Observation 3.9. By symmetry we have ξ[ϵ, α] = ξ[ϵ, -α] for any α ∈ R.

Lemma 3.3. The recurrence function R α (n) and the smallest distance Γ(α, n) are related through the first recurrence time ξ as follows

R α (n) = ξ[Γ(α, n), α] + n -1 , (3.10)
for all n.

Proof. We prove first the inequality

R α (n) ≤ ξ[Γ(α, n), α] + n -1. Let m = ξ[Γ(α, n), α] + n -1,
we intend to show that every factor in u = u α,β := S(α, β) of length m contains all factors of length n. Pick an arbitrary factor of length m within u, by changing β we may assume that the factor is u 0 . . . u m-1 .

Thus, to show that u 0 . . . , u m-1 contains every factor of length n we have to show that the factors are among

u 0 . . . u n-1 , u 1 . . . u n , . . . u m-n . . . u m-1 .
Factors of length n correspond to the intervals on the circle T 1 delimited by 0, -α, . . . , -nα , modulo 1, and we must show that among the points β, β + α, . . . , β + (m -n)α modulo 1, there is at least one in each of the n + 1 circle intervals. Observe that if this were not the case, then the maximum distance between two geometrically consecutive points β, β + α, . . . , β + (m -n)α modulo 1 is greater than Γ(α, n), the minimal distance between points 0, -α, . . . , -nα mod 1, but this is impossible since m -n + 1 = ξ[Γ(α, n), α] precisely.

Next, we show the converse inequality

R α (n) ≥ ξ[Γ(α, n), α] + n -1. Let m -n + 1 = ξ[Γ(α, n), α] -1,
we will show that there is a factor of length m not containing every factor of length n.

From the definition Definition 3.13 of ξ and Observation 3.9 it follows that, among the intervals delimited by the points β, β + α, . . . , β + (m -n)α on T 1 , there is an interval I of length greater than Γ(α, n). By adjusting β (this does not change the language) we may assume there is one of the intervals delimited by 0, -α, . . . , -nα, call it J, fully contained within this interval I, as the lengths of these intervals is strictly smaller than that of I. But this means that the word corresponding to J does not occur in u 0 . . . u m-1 , because it cannot start at any index 0, 1, . . . , m -n. ■

Next we study the behavior of the largest distance. This is key due to the fact that ξ[Γ(α, n), α] is precisely the smallest "time" to have largest distance smaller than Γ(α, n).

Lemma 3.4. Let α ∈ I be an irrational and let k > 1, then the largest distance Υ defined in Definition 3.12 satisfies

Υ(α, q k-1 (α) + q k (α)) ≤ M k-1 , (3.11) Υ(α, q k-1 (α) + q k (α) -1) > M k-1 , (3.12) where M k (α) := |αq k (α) -p k (α)|.
Proof. We start from (3.11). We must show that the maximum length of the non-overlapping intervals of T 1 delimited by the set of points 0, α, 2α, . . . , (q k-1 + q k -1)α modulo 1, is at most M k-1 . To do this we show that for each αi mod 1 in our set there is another point αj mod 1, from our set, at T 1 -distance less than M k-1 always rotating in the same direction. This indeed implies the first part.

We recall (1.20), i.e., M k = (-1) k (αq k -p k ), note in particular the change of sign with the parity of k, as this will be key to the proof of the first inequality (3.11). • Consider the case i < q k , then the point α(i + q k-1 ) mod 1 is still in our set, and observe that αq k-1 ≡ (-1) k-1 M k-1 (mod.1), hence α(i + q k-1 ) ≡ αi + (-1) k-1 M k-1 (mod.1). Hence the "oriented" distance in T 1 from αi to α(i + q k-1 ) is M k-1 , rotating positively (increasing on [0, 1)) for k odd, and negatively (decreasing) otherwise.

THE GROWTH OF THE RECURRENCE FUNCTION OF STURMIAN

• Next consider the case i ≥ q k , then we write i = q k + j and note that αi ≡ αj + (-1) k M k (mod.1). Thus αj ≡ αi + (-1) k-1 M k (mod.1) means that the "oriented" distance in T 1 from αi to αj is M k , rotating positively for k odd, and negatively otherwise. In any case, since M k < M k-1 , this implies (3.11).

We now move on to proving (3.12). This is the most crucial part of the lemma. In this case we consider the intervals in T 1 delimited by the points 0, α, . . . , (q k + q k-1 -2)α, seen modulo 1. For (3.11) it was enough to exhibit points on the circle that were close together (without necessarily being endpoints of a same interval), for (3.12) however, we must show something slightly stronger: there is a delimited interval having at least the given length.

We will show that there is a delimited interval having α(q k -1) mod 1 as an endpoint and length greater than M k-1 . This is somewhat to be expected by looking at the preceding proof of (3.11). It is clear that the distance from α(q k -1) mod 1 to each of the points 0, α, . . . , α(q k -2) modulo 1 is at least Γ(α, q k -1) = M k-1 . It is also clear that α(q k -1) mod 1 cannot be at distance M k-1 from two distinct points from 0, α, . . . , α(q k -2) modulo 1 simultaneously as then α would have to be rational c . Thus we conclude that a T 1 interval I of length greater than M k-1 , having α(q k -1) mod 1 as a border, and containing no point from 0, α, . . . , α(q k -2) modulo 1. Now note that the smallest circle distance from α(q k -1) mod 1 to αq k , . . . , α(q k + q k-1 -2) modulo 1 is greater than

M k-1 , indeed Γ(α, q k-1 -1) = M k-2 > M k-1 .
Thus I contains a subinterval I * ⊂ I, maybe even itself, having α(q k -1) mod 1 as an endpoint, with length greater than M k-1 and no other point from 0, α, . . . , (q k + q k-1 -2)α modulo 1 there. ■

Proof. [Theorem 3.3] From Lemma 3.3 we know that R α (n) = ξ[Γ(α, n), α] + n -1 where we recall that Γ is the smallest distance defined in Definition 3.11. Recall also that ξ[Γ(α, n), α] is the waiting time m ∈ N to have Υ(α, m) ≤ Γ(α, n). Since, by Proposition 3.15, Γ(α, n) = M k-1 (α) for n satisfying q k-1 (α) ≤ n < q k (α), we note that Lemma 3.4 implies that m = q k-1 (α) + q k (α), thus proving the result. ■

The growth of the recurrence function of Sturmian words

The recurrence function R(α, n) := R α (n) of Sturmian words has been widely studied (e.g., [START_REF] Cassaigne | Limit values of the recurrence quotient of sturmian sequences[END_REF][START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF]) on what we call the worst case. In particular, in the pioneering work by Morse and Hedlund [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF]. They studied it first by turning the problem into one about continuants by Theorem 3.3, and then applying Theorem 1.4 and Theorem 1.5 to get information about this worst-case almost everywhere.

Cassaigne [START_REF] Cassaigne | Limit values of the recurrence quotient of sturmian sequences[END_REF] introduced a similar notion of recurrence quotient ρ u := lim sup n R(u, n)/n (note the lim sup) and studied the spectrum of values attained by it, in particular its topological properties and when it is smallest. In his survey, Cassaigne [START_REF] Cassaigne | Recurrence in infinite words[END_REF] proves ([Cas01, Theorem 3]) that when u is any not eventually periodic word, then ρ u ≥ 3. We will see, however, that from a measure-theoretic point of view, we have ρ u = ∞ for almost every Sturmian word u.

We begin by explaining the results from [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF] concerning the extreme values of the recurrence function in subsection 3.4.1. These results motivate our work, but unlike them, we study, for the first time, the recurrence quotient S(α, n) := (R(α, n) + 1)/n in a probabilistic setting. We introduce the key ideas in c Else there are i ̸ = j with 0 ≤ i, j < q k -1 and α(q k -1 -i) ≡ α(j -q k + 1) ≡ M k-1 (mod.1) which implies α ∈ Q.

THE GROWTH OF THE RECURRENCE FUNCTION OF STURMIAN WORDS

106 subsection 3.4.3 and develop these extensively in Chapter 4 and Chapter 5.

Classical results: worst-case analysis

Morse and Hedlund [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF] first studied the extreme values attained by the recurrence function, turning the problem into one about continuants by Theorem 3.3, and then applying Theorem 1.4 and Theorem 1.5. Here is the corresponding result.

Theorem 3.4 (Morse-Hedlund [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF]). Let h(x) be a function that is positive and non-decreasing for x ≥ 0 and such that lim

x→∞ h(x) = ∞. For almost every α ∈ I lim sup n→∞ R(α, n) n h(log n)
is finite or infinite according as to whether the series  n≥0 1/h(n) is convergent or divergent respectively. Proof. Note that for n such that q k-1 (α) ≤ n < q k (α) we have, by Theorem 3.3, that

R(α, n) n = 1 - 1 n + q k-1 (α) + q k (α) n .
Thus the maximum for n subject to

q k-1 (α) ≤ n < q k (α) is R(α, q k-1 (α)) q k-1 (α) = 1 - 1 q k-1 (α) + q k-1 (α) + q k (α) q k-1 (α) = 2 - 1 q k-1 (α) + m k (α) + q k-2 (α) q k-1 (α) ,
and for R(α, n)/(nh(log n)) we deduce that the maximum for n in [q k-1 (α), q k (α)) is R(α, q k-1 ) q k-1 h(log q k-1 ) = m k (α) h(log q k-1 (α))

+ o(1) .

It will therefore be enough to analyze what happens with the lim sup of

m k (α) h(log q k-1 (α)) as k → ∞.
We observe that from Theorem 1.4 and Theorem 1.5 we have that lim sup m k (α) h(log q k-1 ) is finite or infinite according to the convergence or divergence of the sum  1/h(log q k-1 ).

For almost every α (recall Proposition 1.10) (1/k) log q k (α) tends to K = π 2 /(12 log 2) which lies between 1 and 2. Thus, for large enough k (depending on α), the value log q k-1 (α) lies between k and 2k, hence we have h(k) ≤ h(log q k-1 (α)) ≤ h(2k) for large enough k.

Note that the monoticity of h implies that  1/h(n) converges if and only if  1/h(2n) converges, thus the convergence of  1/h(log q k-1 ) is equivalent to the convergence of  1/h(k), this completes the proof. ■

As a consequence we have the following explicit limits:

Proposition 3.16. Let ϵ > 0. For almost every α the recurrence function satisfies:

lim sup n→∞ R(α, n) n log n = ∞ , lim sup n→∞ R(α, n) n (log n) 1+ϵ = 0 .
Informally, we say that the worst-case of R(α, n)/n is roughly of order log n. It is worthwhile to point out that the "best case" is always linear. Proposition 3.17. For almost every α the recurrence function satisfies:

lim inf n→∞ R(α, n) n = 2 .
n q k-1 q k Figure 3
.7: Here we illustrate the case q k-1 (α) ≤ n < q k (α), with a relative position µ(α, n) ≈ 1/3.

Proof. Note in the proof of Theorem 3.4 that the best case arrives when n = q k (α)-1 and that q k-1 (α)/q k (α) is close to 0 infinitely often (i.e., the quotients m k (α) are unbounded almost surely). ■

It is natural therefore to work with what we call the recurrence quotient

S(α, n) := R(α, n) + 1 n . (3.13)
The recurrence quotient is illustrated in Figure 3.6. Observe in particular that, as explained during the proof of Theorem 3.4, the recurrence quotient is largest on the left-end of the intervals [q k-1 , q k ), while it is smallest on the right-end.

The results above, Theorem 3.4 and Proposition 3.17, tell us that the "best" and "worst" cases for R(α, n) differ widely. This is why the question "what does a random Sturmian word look like?" is so relevant. Does the recurrence function of a random Sturmian word behave more like n log n, or is it more linear?

Position parameters

From the proof of Proposition 3.16 and Proposition 3.17, as well as Figure 3.6, it should be evident that the positioning of n within the interval [q k-1 (α), q k (α)) plays a huge role when it comes to the magnitude of the recurrence quotient S(α, n) defined in (3.13). Thus we introduce several position parameters which will be ever present in our studies.

First there is the relative or barycentric position of n within the interval [q k-1 (α), q k (α)), where k = k(α, n) is the only positive integer satisfying q k-1 (α) ≤ n < q k (α). We therefore define

µ(α, n) = n -q k-1 (α) q k (α) -q k-1 (α) , (3.14)
where k = k(α, n) is the only positive integer satisfying q k-1 (α) ≤ n < q k (α).

The relative position µ is illustrated in Figure 3.7.

We remark that with this new parameter µ = µ(α, n), the recurrence quotient can be rewritten as

S(α, n) = 1 + q k-1 (α) + q k (α) n = 1 + q k-1 (α) + q k (α) q k-1 (α) + µ • (q k (α) -q k-1 (α))
,

THE GROWTH OF THE RECURRENCE FUNCTION OF STURMIAN WORDS

108 so that, dividing through by q k (α)

S(α, n) = 1 + q k-1 (α) q k (α) + 1 q k-1 (α) q k (α) + µ •  1 - q k-1 (α) q k (α)  = 1 + 1 + q k-1 (α) q k (α) µ + q k-1 (α) q k (α) • (1 -µ)
.

(3.15)

The case when µ(α, n) ≈ 1/2 is of particular interest. Indeed, we have S(α, n) ≈ 3 , as the numerators and denominators in (3.15) cancel out. This corresponds exactly to Proposition 3.17.

Equation 3.15 makes evident that, to have a large S(α, n) then we must have

µ(α, n) ≈ 0 , q k-1 (α) q k (α) ≈ 0 .
This was implicit in the proof of Theorem 3.4, the Morse-Hedlund theorem giving the "worst case". Indeed, note that we at once picked µ(α, n) = 0 by making the choice n = q k-1 (α) while

q k-1 (α) q k (α) =  m k + q k-2 (α) q k-1 (α)  -1
, that is small only when m k is large. Thus we rephrased the principles of Theorem 3.4.

This motivates the introduction of the parameter

ρ(α, n) = q k-1 (α) q k (α) , (3.16)
where k = k(α, n) is the only positive integer satisfying q k-1 (α) ≤ n < q k (α). The parameter ρ(α, n), which we call quotient, measures the relative sizes of the ends of the intervals.

We summarize in the following proposition the bounds relating µ, ρ and S.

Proposition 3.18. The recurrence quotient S(α, n) satisfies the following inqualities with respect to the relative position µ = µ(α, n) and the quotient ρ = ρ(α, n)

1 + 1 µ + ρ ≤ S(α, n) ≤ 1 + 4 µ + ρ .
(3.17)

Thus the positional parameters µ(α, n) and ρ(α, n) play a key role in our studies of the recurrence.

Our framework: probabilistic analyses

Motivated by the question "does the recurrence function R(α, n) of a random Sturmian word behave more like n log n (as in Theorem 3.4), or is it more linear (as in Proposition 3.17)?", we present two probabilistic models which aim to definitely answer this question. We also seek to explain the worst-case behavior.

In [BCR + 15] we provided a first probabilistic study concerning the recurrence quotient S(α, n), and in [START_REF] Rotondo | The recurrence function of a random Sturmian word[END_REF] we undertook the study of a completely different model which turns out to be somewhat more natural from an algorithmic perspective. In the present text we begin from the latter [START_REF] Rotondo | The recurrence function of a random Sturmian word[END_REF] in Chapter 4 and then move on to the model from [BCR + 15] in Chapter 5, in order to have a gentler introduction to the subject. In any case we explain what the two models are before getting into the heart of the matter. The relation between the two models will be explained throughout.

First, it is fair to recall that, since the language of a Sturmian word u is determined exclusively by its slope α (see subsection 3.2.1) and, in turn, the recurrence function R u (n) depends only on the language of u, we just write R(α, n) in terms of α. Thus we may pick α at random rather than u, which at first may sound like "picking a random language of a Sturmian word". We argue, however, that this choice is justified: if we pick a random Sturmian word, which is necessarily of the form S(α, β) or S(α, β) thanks to Theorem 3.1, to study the resulting recurrence function we need only consider the distribution of the final slope α. Our original models [BCR + 15] and [RV17] consider α distributed uniformly on [0, 1]. This seemingly crucial hypothesis can be slightly relaxed, however, as we later showed that we would get the exact same results of [START_REF] Rotondo | The recurrence function of a random Sturmian word[END_REF] if we instead considered α to be a random variable having a density with respect to the usual Lebesgue measure. The reason why this occurs is interesting, and boils down to a sort of independence "on the average" between the fractions p k /q k and q k-1 /q k , which is a remarkable fact on its own right.

Here we introduce both models briefly, explaining the basic results and their consequences for Sturmian words. Chapters 4 and 5 provide a more in depth study.

Two probabilistic models

Now we present our probabilistic models in detail.

(i) Fixed n → ∞ model.
Given a random u, we wonder how the recurrence R u (n) behaves as n → ∞. Our "fixed n → ∞" model follows this idea. Given a random α we study the distribution of the recurrence quotient S(α, n) as n → ∞. This is the model from [START_REF] Rotondo | The recurrence function of a random Sturmian word[END_REF] and is described in detail in Chapter 4.

Model. Fix the integer n (corresponding to the length of the factors, which will further tend to ∞); the index k of the interval

[q k-1 (α), q k (α)) which contains n is a random variable k = k(α, n).
The sequence n → → S n (α) := S(α, n), where S is the recurrence quotient from (3.13), is now a sequence of random variables which we wish to study. It is important to note that then so are µ n (α) := µ(α, n) and ρ n (α) := ρ(α, n), which are interesting from the point of view of continued fractions in their own right.

Results: a little taste. Our first main theorem in Chapter 4, Theorem 4.1, implies the existence of a limiting distribution for the recurrence quotient S n (α) := S(α, n) when α is drawn uniformly at random from the unit interval I = [0, 1].

[Simplified Theorem 4.1 applied to the recurrence quotient]. The sequence n → → S n (α) as n → ∞ admits a limit distribution F S (λ) whose derivative is shown in Figure 3.8.

THE GROWTH OF THE RECURRENCE FUNCTION OF STURMIAN WORDS 110

For the recurrence quotient we also derive the following tail-inequality valid for all n,

P[S n ≥ b] ≤ 2 b -1 ,
and every b ≥ 3. The limiting distribution actually indicates that the asymptotically (as n → ∞) tight constant in the above inequality should be 12 π 2 , which is closer to 1 than to 2. Theorem 4.1 actually applies to a more general class of functions that we called Q-functions (which we introduced in [START_REF] Rotondo | The recurrence function of a random Sturmian word[END_REF]). This class includes useful functions such as S(α, n), µ(α, n) and ρ(α, n).

Our second result concerns the limiting density. It is not necessarily true, in general, that the derivative of the limiting distribution d dλ F (λ) will also be the limiting density; one must be careful when speaking about the limiting density. In our case, the variables S n have actually a discrete distribution which tend to a continuous (and differentiable, except for the single point λ = 3) one.

[Simplified Theorem 4.2] Consider the distribution function F n (λ) of S n , as well as the corresponding limit distribution F S (λ) derived from Theorem 4.1 For any strictly positive sequence n → → ϵ(n) which tends to 0 with nϵ(n) → ∞, the secants of the distribution F n with step ϵ(n) converge to F ′ S (λ) uniformly on λ.

Observe then that this result asserts the convergence of the histograms towards the limit density provided that the step ϵ(n) is not excessively small.

Even though we may study the recurrence quotient in distribution, its expected value E[S n ] is infinite for each n. This happens because of the contribution of the cases in which the position parameters µ(α, n) and ρ(α, n), introduced in subsection 3.4.2, are both small. As we wish to characterize the log n worst-case behavior of S(α, n) given by Proposition 3.16, we condition to events such as {α : µ(α, n) ≥ 1/n} or {α : ρ(α, n) ≥ 1/n}, making µ and ρ bounded reasonably far from 0.

[Simplified Theorem 4.3] Consider a sequence ϵ(n) which is Ω(1/(n log n)). The conditional expectations of the recurrence quotient S n with respect to the event

µ n ≥ ϵ(n) satisfy E  S n   µ n ≥ ϵ(n)  ∼ n→∞ 12 π 2 |log ϵ(n)| .
We will see in Chapter 4 that the choice of 1/n is, in a way, optimal and that we get back a log n. This log arises naturally.

(ii) Fixed depth k → ∞ model.

We introduced this model in [BCR + 15], and we describe it in detail in Chapter 5. It is seemingly very different from the one described in (i) (we discuss their relation in Chapter 6), and motivated by geometric considerations regarding the interval [q k-1 (α), q k (α)) containing n.

In the previous n → ∞ model, the position parameters from subsection 4.2.1 are random variables which in principle we cannot control. Since α is random, there is no hope of fixing the quotient ρ, but we may try fixing the relative position µ by making n depend on both α and µ.

In our second (ii) model we fix the relative position by considering random (depending on α) sequences

(n k (α)) k , satisfying µ(α, n k (α)) ≈ µ, our prescribed constant.
Then we wonder how the recurrence quotient behaves within these sequences!

THE GROWTH OF THE RECURRENCE FUNCTION OF STURMIAN WORDS 111

Model. Fix a depth k (that further tends to ∞), and a real number µ ∈ [0, 1]. For any slope α, we consider the interval [q k-1 (α), q k (α)) delimited by the two successive continuants with indices k -1 and k, and we choose there the integer n := n k at a barycentric position, which now becomes a random variable.

This model may be called the model "large fixed k". The sequence k → → S k (α) := S(α, n k (α)) is a sequence of random variables.

Results: a little taste. Our main theorem in Chapter 5, Theorem 5.1, regards the limiting expected values and densities.

[Part (i) from Theorem 5.1]. For each µ ∈ (0, 1], the expected values

E[S k ] satisfy lim k→∞ E[S k ] = 1 + 1 log 2 | log µ| 1 -µ ,
where the convergence can be made uniform provided that µ ∈ [ϵ, 1] for some fixed constant ϵ > 0.

This shows precisely how the size of the recurrence quotient S depends on the relative position µ. It is actually possible to say more, by making µ = µ k a variable of k that tends to 0. This is our second main theorem, Theorem 5.2.

[Part of (i) from Theorem 5.2]. For any α, and for each τ ∈ [φ 2 , 1[, there exists a family of increasing subsequences N (α, τ ), depending on both α and τ , of indices n for which

E  R α (n) n - 12| log τ | π 2 log n  = O(1) (n → ∞). (3.18)
This result can be seen as a probabilistic version of the Proposition 3.16 from Morse and Hedlund [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF].

These, as well as other results concerning the distributions are described extensively in Chapter 5.

THE GROWTH OF THE RECURRENCE FUNCTION OF STURMIAN WORDS

CHAPTER 4

A FIRST PROBABILISTIC STUDY OF STURMIAN WORDS AND Q-FUNCTIONS

Introduction

Two different probabilistic settings.

As mentioned in subsection 3.4.3, we adopt a probabilistic approach and consider a random Sturmian word, associated with a random irrational slope α of the unit interval. We consider two possibilities:

(i) fix the integer n (corresponding to the length of the factors, which will further tend to ∞); the index k of the interval [q k-1 (α), q k (α)) which contains n is a random variable k = k(α, n). This model may be called the model "large fixed n". The sequence n → → S(α, n) is now a sequence of random variables.

(ii) fix a depth k (that further tends to ∞), and a fixed µ ∈ [0, 1]. For any slope α, we consider the interval [q k-1 (α), q k (α)) delimited by the two successive continuants with indices k -1 and k, and we choose there the integer n := n ⟨µ⟩ k (α) at a fixed barycentric position µ, which now becomes a random variable. This model may be called the model "large fixed k". The sequence k → → S ⟨µ⟩ k (α) := S(α, n µ (α, k)) is a sequence of random variables.

In both cases, we are interested in the same type of questions about the sequence of random variables: does there exist a limit for the expectations? a limit distribution? a limit density?

Main results of the chapter [RV17].

Here we consider the recurrence quotient within model (i), i.e., the model with "a large fixed n", while model (ii) will be considered in Chapter 5 and we discuss their relation in Chapter 6. We obtain three results for the recurrence quotient on this model; more precisely, we consider the random variables α → → S(α, n) and study them for large n. We exhibit a limit for their distribution, and prove that there exists a limit density, as n → ∞. We also study the conditional expectation of the recurrence quotient, when we exclude the possibility of n being too close to the left end of the interval [q k-1 (α), q k (α)). More generally, we describe a class of events for which the order of this conditional mean value is exactly log n. This can be n q k-1 q k Figure 4.1: Here we illustrate the case q k-1 (α) ≤ n < q k (α), with a relative position µ(α, n) ≈ 1/3. viewed as a probabilistic extension of Theorem 3.4.

Our proofs employ elementary methods: they are based on a precise comparison between an integral and its Riemann sum; however, the integral is improper (but convergent) and the Riemann sum is constrained by a coprimality condition, what we call a "coprime Riemann sum".

We also introduce a general family of functions, called continuant-functions or Q-functions, which are defined via the sequence of continuants k → → q k (α). The recurrence quotient is an instance of such a function, but the other "geometric" parameters of interest provide natural examples of such a notion. Our framework is naturally adapted to the study of a general Q function.

Framework and results.

This section starts off by introducing several parameters describing the geometry of "continuant intervals" or the position of the integer n inside the continuant interval. Section 4.2.2 defines the class of Q functions that provides a convenient framework for our study. Then, we state Theorems 4.1 and 4.2 in Sections 4.2.4 and 4.2.5, for a fairly general set of Q-functions. We return to our specific parameters of interest, notably the recurrence function in Section 4.2.4, with two figures (Figures 4.9 and 4.5b). Finally, Section 4.4 concludes with a study of the conditional expectations.

Position parameters.

Besides the recurrence quotient, there are also three other interesting parameters ν, µ, ρ which describe the geometry of the interval [q k-1 (α), q k (α)) which contains n (this is the case for ρ) or the position of n inside this interval (the case for µ and ν)

ρ(α, n) = q k-1 (α) q k (α) , (4.1) µ(α, n) := n -q k-1 (α) q k (α) -q k-1 (α) , ν(α, n) = n q k (α) . (4.2)
When n belongs to the interval [q k-1 (α), q k (α)), the recurrence quotient is expressed in terms of ρ and ν as

S(α, n) = 1 + 1 + ρ(α, n) ν(α, n) . (4.3)
As ν(α, n) belongs to the interval [ρ(α, n), 1], the following bounds hold

2 + ρ(α, n) ≤ S(α, n) ≤ 2 + 1 ρ(α, n) (4.4)
(the lower bound holds for n close to q k (α) whereas the upper bound is attained for n = q k-1 (α)).

The ratio ρ(α, n) belongs to (0, 1], and the Borel-Bernstein Theorem (Theorem 1.5) proves that lim inf n→∞ ρ(α, n) = 0 for almost any irrational α. This is implicit in the proof of Theorem 3.4.

Parameter

Function f (x, y) Density 12 π 2 J f (λ)

S 1 + x + y  12 π 2 1 λ-1 log(λ -1) if 2 ≤ λ ≤ 3 12 π 2 1 λ-1 log(1 + 1 λ-2 ) if λ ≥ 3 . ρ x y 12 π 2 1 1 + λ | log λ| for 0 ≤ λ ≤ 1 µ 1 -x y -x  12 π 2 1 2λ-1  2 log 2 -log λ λ-1  if λ ̸ = 1/2 24 π 2 (1 -log 2) if λ = 1/2 . ν 1 y 12 π 2 1 λ log(1 + λ) for 0 ≤ λ ≤ 1

Q-functions.

More generally, we are interested in functions whose definition depends fundamentally on the partition

Q(α) = {[q k-1 (α), q k (α)) : k ≥ 1}
defined by the continuants of α, and consider the functions (α, n) → → Λ(α, n) that are associated with some function f and are written in terms of it as,

Λ(α, n) = f  q k-1 (α) n , q k (α) n  , (4.5)
as soon as n ∈ [q k-1 (α), q k (α)).

To get our results in distribution and density, we will have to add several conditions on f , in particular for the results concerning the conditional probabilities, as we will need information concerning the rates of convergence towards the distribution.

A function Λ defined as in (4.5) is what we call a Q-function (also continuant function), and we demand that the function f associated with Λ satisfy (i) it is defined on the unbounded rectangle

R := {(x, y) : 0 ≤ x ≤ 1 < y},
(ii) it is non negative on R .

To get good error terms when it comes to the convergence in distribution, we shall consider a more specific class of Q-functions, called LQ-functions for short, which are the Q-functions associated with a function f that is the quotient of two linear functions:

f (x, y) = a 1 x + b 1 y + c 1 a 2 x + b 2 y + c 2 . (4.6)
Our four parameters of interest, namely the recurrence quotient S, the ratio ρ and the two parameters µ and ν which describe the position of integer n with respect to the interval [q k-1 (α), q k (α)) are LQ-functions, associated to the following functions f

f S (x, y) = 1 + x + y, f ρ (x, y) = x y , f µ (x, y) = 1 -x y -x , f ν (x, y) = 1 y .
The problem of determining the joint limit distribution for the Q-functions resulting from the projections (x, y) → → x and (x, y) → → y has already been considered by Ustinov in [START_REF] Ustinov | On the statistical properties of elements of continued fractions[END_REF], with the addition of a condition [m k+1 (α), m k+2 (α), . . .] ≤ z, on the tail of the continued fraction development (here k is the index such that q k-1 (α) ≤ n < q k (α)). Such a condition does not fundamentally change the problem, as we just need change the probability of the fundamental interval

|I m 1 ,...,m k | = |h m 1 ,...,m k ([0, 1])| in our current study for |h m 1 ,...,m k ([0, z])| = z q k (m)(q k (m) + zq k-1 (m)) ,
which is the length of the fundamental interval with the added condition that [m k+1 (α), m k+2 (α), . . .] ≤ z.

The motivation of Ustinov was mainly answering Sinai and Ulcigrai [START_REF] Yakov | Renewal-type limit theorem for the Gauss map and continued fractions[END_REF], in a question purely concerning the distributions of the stopped continued fractions. Sinai and Ulcigrai showed the existence of the limiting distribution, deriving it from a flow, but did not give an explicit formula.

Probabilistic setting.

We recall the present setting, anticipated in subsection 3.4.4. Consider a fixed integer n, and a random real α in the unit interval [0, 1]. The sequence Λ n (α) := Λ(α, n) is now a sequence of random variables. We are interested in the limit distribution of the sequence when n → ∞. Does there exist a limit distribution? a limit density?

Distributions.

In the distributional study, we associate each real λ ≥ 0 to a subdomain of R,

∆ f (λ) := {(x, y) : 0 ≤ x ≤ 1 < y; f (x, y) ≤ λ} (4.7)
(which is a convex domain when f is an LQ), and consider the integral plays a fundamental role in the sequel, as our originally discrete distribution smooths out (converges weakly) to the distribution associated with the density ψ, as the following result shows:

I f (λ) =   ∆ f (λ) ω(x, y)dxdy = I[ω, ∆ f (λ)] , (
Theorem 4.1. Consider a LQ-function Λ associated with a function f . Then the sequence n → → Λ n (α) as n → ∞ admits a limit distribution, and the sequence

F n (λ) := P [Λ n ≤ λ] = 12 π 2 I f (λ) + O  1 n  , (4.11)
involves the integral I f (λ) defined in (4.8). Moreover, the constant of the O term can be chosen so that it works for every pair (f, λ)

0.0 1 2 0.0 1 2 ∆ f (λ) λ = 2.5 0.0 1 2 0.0 1 2 ∆ f (λ) λ = 3.5 Figure 4.3: Domain of integration ∆ f (λ) for f (x, y) := f S (x, y) = 1 + x + y.
It is worthwhile to notice that R is the "smooth version" of the domain occupied by the points

  q k-1 (α) n , q k (α) n  : α ∈ [0, 1] \ Q, k = k(α, n)  ,
where k(α, n) is the integer k ≥ 1 such that q k-1 (α) ≤ n < q k (α).

The domain ∆ f (λ) in the case of the recurrence quotient S is illustrated in Figure 4.3. In this case ∆ f (λ) consists of all the points of R lying below the line f S (x, y) = λ.

Observe that as λ increases, the line f S (x, y) = λ just gets translated upwards in the y-axis. When λ < 3 we have the case shown in the first subfigure of Figure 4.3, the domain is delimited by the line f S (x, y) = λ, the y-axis and the line y = 1. As we reach the vertex (1, 1) for the case λ = 3, we get to the case of the second subfigure of Figure 4.3, and the domain ∆ f (λ) is now a polygon with 4 sides, delimited by the line f S (x, y) = λ, the line x = 1, the line y = 1 and the y-axis.

The shape of the derivative of the limit distribution (see Figure 4.4), which we will then make sense of as a density in Theorem 4.2, is dictated by the moving frontier of ∆ f (λ). The maximum at λ = 3 coming from the fact that this moving frontier increases until λ = 3 and then decreases when we "change sides". These ideas will be made formal with Theorem 4.2.

Results -densities.

We further show the convergence to the densities, more precisely, convergence of the histograms to the corresponding densities, and we characterize the points where these densities are not differentiable. An illustrating example is given by the recurrence quotient S, in this case the limit density (see Figure 4.2) is displayed in Figure 4.4, while we see the actual convergence of the experimental histograms towards this density in Figure 4.5. The number of experiments is M = 10 7 , while n = 1000. The histograms are scaled so that they integrate to 1.

Note that the limit density of S is continuously differentiable except for the point λ = 3, its maximum, where it presents a "cusp". This will be completely explained in our results.

For this we need to consider the boundary curves {(x, y) : f (x, y) = λ} and their intersection with R. We prove the following:

Theorem 4.2. Consider a LQ-function Λ associated with a function f which is written as in (4.6). Then, (a) The function λ → → I f (λ) and its derivative J f exist for any λ. The derivative J ′ f exists except perhaps on a finite set, consisting of the point b 1 /b 2 and two possible other values λ 0 and λ 1 . The following holds:

(i) At each of the points λ = λ i , the function J f admits a left and a right derivative, each of them being finite.

(ii) When the determinant r(a, b)

:= a 1 b 2 -a 2 b 1 is zero, the derivative J ′ f exists at λ = b 1 /b 2 . (iii) When the determinant r(a, b) := a 1 b 2 -a 2 b 1 is not zero, the derivative J ′ f does not exist at b 1 /b 2 and is O(|b 2 λ -b 1 | -1 ) for λ → b 1 /b 2 .
(b) For any strictly positive sequence n → → ϵ(n) which tends to 0 with nϵ(n) → ∞, the secants of the distribution F n with step ϵ(n) converge to J f (λ) and the following holds

F n (λ + ϵ(n)) -F n (λ) ϵ(n) = 12 π 2 J f (λ) + E(λ, ϵ(n)) , (4.12) (c)
The error term satisfies

E(λ, ϵ(n)) = O  1 ϵ(n)n  + O  |J ′ f (λ)|ϵ(n)  ,
and the constants in the O-term do not depend on the pair (f, λ).

Conditional expectations.

In order to control the size of the recurrence quotient S(α, n), we now focus on the position parameters ρ, ν and µ defined in (4.1) and (4.2), and consider the three sequences

ρ n (α) := ρ(α, n), ν n (α) := ν(α, n), µ n (α) := µ(α, n) .
The largest values of the recurrence quotient arise when ν or µ are small. In particular, the event [ν n ≥ ϵ(n)] gathers the reals α for which the integer n is not too close to the left end of the interval [q k-1 (α), q k (α)), and, at the same time, the length of the interval [q k-1 (α), q k (α)) is of the same order as the right end q k (α).

We then consider a sequence ϵ(n) → 0, and condition with one of the events

[ρ n ≥ ϵ(n)], [ν n ≥ ϵ(n)], [µ n ≥ ϵ(n)] .
Theorem 4.3. Consider a parameter Γ ∈ {ρ, µ, ν} defined in (4.1) and (4.2) and a sequence ϵ(n) which is Ω(1/(n log n)). Then the conditional expectation of the recurrence quotient S n with respect to the event

[Γ n ≥ ϵ(n)] satisfies E  S n   Γ n ≥ ϵ(n)  ∼ n→∞ 12 π 2 |log ϵ(n)| .
This result exhibits a sequence of events, over a space in which the integer n is not too close to the left-end of interval [q k-1 (α), q k (α)). When we are sure not to be too close to this left-end, the recurrence quotient is (on average) of order log n. This can be viewed as a probabilistic counterpart of Theorem 3.4, in the case of particular sequences of the form ϵ(n) = 1/(nψ(n)), for which the series of general term ϵ(n) is divergent. We return to this study at the end of Section 4.4.

The log appearing in the expression of Theorem 4.3, we argue, turns up naturally from the expressions for f S (x, y) and ψ(x, y). Indeed, ψ(x, y) is the "smoothed" density for 

q k-1 (α) n , q k (α)
n  around the point (x, y) ∈ R, therefore the quantity f S (x, y)ψ(x, y) is the one we have to integrate to get expected values (we show this in Theorem 4.4). We point out now that f S (x, y)ψ(x, y) = ψ(x, y) + 1 y , and here it is 1/y that produces the logarithm. To make f S (x, y) = 1 + x + y big the only possibility is having a large y, so any condition [Γ n ≥ ϵ(n)] that makes f S bounded, must bound y accordingly.

Proofs: distributions and densities.

We first recall some useful properties of continued fraction expansions and introduce coprime Riemann sums. Then, we prove the existence of limit distribution and limit densities for a general LQ-function. The proof of Theorem 4.1 consists of three main steps, summarized in Proposition 4.1, Proposition 4.2, and Proposition 4.3, and we conclude the proof of Theorem 4.1 in Section 4.3.3. Sections 4.3.4 and 4.3.5. are devoted to the proof of Theorem 4.2.

Continued fractions, fundamental intervals and continuants.

(See Chapter 1 for more details). The continued fraction of an irrational number α of the unit interval [0, 1] is

α = 1 m 1 + 1 m 2 + 1 . . . + 1 m k + 1 . . . .

PROOFS: DISTRIBUTIONS AND DENSITIES. 120

Truncated at depth k, it gives rise to a rational number p k /q k associated with a coprime integer pair (p k , q k ).

The numerator p k = p k (α) and the denominator q k = q k (α) are uniquely defined by the irrational number α. All the irrational numbers α which begin with the same sequence m = (m 1 , m 2 , . . . , m k ) ∈ N k belong to an interval, called a fundamental interval of depth k and denoted by I k (m). As the irrational numbers of I k (m) have the same convergents of order ℓ ≤ k, we denote their numerator and denominator by p ℓ (m), q ℓ (m). The ends of the interval I k (m) are

p k (m) q k (m) , p k (m) + p k-1 (m) q k (m) + q k-1 (m) .
As the equality |p k (m)q k-1 (m) -p k-1 (m)q k (m)| = 1 holds, the length of the fundamental interval involves the function ω defined in (4.9) under the form

|I k (m)| = ω(q k-1 (m), q k (m)) . (4.13)
This explains why the function ω defined in (4.9) and the associated density ψ are ubiquitous in the study of the Q-functions.

Distributions. Strategy of the proof.

There are two main steps in the proofs of Theorem 4.1.

(i) Discrete step. We express in Proposition 4.1 the distribution of a Q function in terms of a variant of a Riemann sum, that is called in the following a "coprime" Riemann sum. This type of "constrained" Riemann sum was already considered in [START_REF] Florin | A conjecture of R. R. Hall on Farey points[END_REF].

(ii) Continuous step. We compare the "coprime" Riemann sum to the associated integral. We begin by the comparison of the "plain" Riemann sum to the integral in Proposition 4.2, then, we take into account the coprimality condition in Proposition 4.3. We extend here the results of [START_REF] Florin | A conjecture of R. R. Hall on Farey points[END_REF] which are only proven for finite domains.

Distributions and Riemann sums.

We begin with the alternative expression of a Q-function Λ, associated with f , (already defined in (4.5)), which is written with the Iverson bracket a under the form

Λ(α, n) =  k≥0 f  q k-1 (α) n , q k (α) n    n ∈ [q k-1 (α), q k (α)[   .
The distribution of a Q-function associated with f is

P (Λ n ≤ λ) =  1 0 dα  k≥0   q k-1 (α) n , q k (α) n  ∈ ∆ f (λ)   .
For each k, the family of fundamental intervals I k (m) defines a pseudo-partition when m goes through N k , and, for any α ∈ I k (m), the equality q k (α) = q k (m) holds. We deduce

P[Λ n ≤ λ] = ∞  k=0  m∈N k |I k (m)|   q k-1 (m) n , q k (m) n  ∈ ∆ f (λ)   .
|I k (m)| = 1 n 2 ω  q k-1 (m) n , q k (m) n  .
Now, as we go through all the sequences m ∈ N ⋆ , the coprime pairs (q k-1 (m), q k (m)) give rise to all the coprime pairs (a, b). Moreover, each coprime pair (a, b), except the pair (1, 1), appears exactly twice, due to the existence of two continued fraction expansions, the proper one (in which the last digits strictly greater than 1), and the improper one (in which the last digit is equal to 1). Then, the equality holds

P[Λ n ≤ λ] = 2 n 2  (a,b)∈Z 2 (a,b)=1 ω  a n , b n    a n , b n  ∈ ∆ f (λ)   .
The right member is the Riemann sum of the function 2ω on the domain ∆ f (λ) with step 1/n, with an extra condition of coprimality. More generally, for a function g integrable on a subset Ω, we are led to the following two Riemann sums with step 1/n: the first one R n (g, Ω) is the usual one,

R n (g, Ω) = 1 n 2  (a,b)∈Z 2 g  a n , b n    a n , b n  ∈ Ω   ,
whereas the second one  R n (g, Ω) takes into account the coprimality of (a, b), and is called the "coprime" Riemann sum,

 R n (g, Ω) = 1 n 2  (a,b)∈Z 2 gcd(a,b)=1 g  a n , b n    a n , b n  ∈ Ω   ,
We summarize:

Proposition 4.1. Consider a Q-function Λ associated with a function f . Then the distribution F n (λ) := P [Λ n ≤ λ] is expressed with a coprime Riemann sum,

P[Λ n ≤ λ] =  R n (2ω, ∆ f (λ)) . (4.14)
which involves the density ω defined in (4.9) and the domain ∆ f (λ) defined in (4.7).

The previous result extends if we replace ∆ f (λ) by any other domain Ω ⊂ R. In particular, in Section 4, we will deal with two Q-functions Λ and Γ associated respectively to f and g, together with the domain

∆ f,g (λ, ϵ) := {(x, y) ∈ R : f (x, y) ≥ λ, g(x, y) ≥ ϵ} , (4.15)
and use the equality

P[Λ n ≥ λ, Γ n ≥ ϵ] =  R n  2ω, ∆ f,g (λ, ϵ)  . (4.16)
Usual Riemann sums and integrals.

We first deal with the usual Riemann sum, and compare it to its associated integral I(g, Ω). This is a classical proof, but we consider improper integrals and we wish to have precise error terms.

We now deal (only within this subsection) with S := [0, 1] × (0, ∞) , (4.17) consider a subset Ω ⊂ S and associate with it the family of subsets

Ω(k) := Ω ∩ ([0, 1] × [k, k + 1]) ,
 k≥0 C g (Ω, k) < ∞,  k≥0 D g (Ω, k) < ∞ .
Their sums are denoted by C g (Ω) and D g (Ω), and we denote by M g (Ω) their maximum.

Such a function g is called strongly decreasing on Ω with bound M g (Ω). Such a function is integrable on Ω and the inequality I(g, Ω) ≤ M g (Ω) holds.

Proposition 4.2. Consider the domain S defined in (4.17) and a function g which is strongly decreasing on a convex Ω ⊂ S with bound M g (Ω). Then, the Riemann sum of the function g on Ω compares to the integral,

|R n (g, Ω) -I(g, Ω)| ≤ 5 n M g (Ω) . (4.18)
Proof. We will prove the estimate, for each k ≥ 0,

|R n (g, Ω(k)) -I(g, Ω(k)| ≤ 4 n (C g (Ω, k) + D g (Ω, k)) .
This will entail the result by taking the sum over k ≥ 0.

We consider the elementary squares of side 1/n, namely

R a,b =  a n , a + 1 n  ×  b n , b + 1 n  ,
and we concentrate on those which meet Ω(k). There are two cases for such rectangles R a,b , namely

(i) R a,b ⊂ Ω(k), or (ii) R a,b ∩ Ω(k) c ̸ = ∅ .
In the first case (i), the definition of the bound D g entails the estimate

    1 n 2 g  a n , b n  -I(g, R a,b )     ≤ I     g  a n , b n  -g     , R a,b  ≤ 1 n 3 D g (Ω, k) .
As the number of such squares is at most n 2 , the contribution from case

(i) is at most (1/n) D g (Ω, k).
In the second case (ii), the positivity of g and the definition of the bound C g entails the estimate

    1 n 2 g  a n , b n  -I(g, Ω ∩ R a,b )     ≤ 1 n 2 C g (Ω, k) .
But, the convexity of Ω entails that there are at most 4n such squares, and the contribution of the second case is at most (4/n) C g (Ω, k).

To see where the constant 4 comes from, we first replace Ω(k) by a closed convex polygon C n ⊂ Ω, without affecting the bound : in each square R a,b of the second case, pick a point in Ω(k) and then take the convex hull. If Ω(k) is a closed convex polygon, we go through the border in clockwise order and look at the grid rectangles we encounter as explained in Coprime Riemann sums and integrals.

The following result is an extension of the results obtained in [START_REF] Florin | A conjecture of R. R. Hall on Farey points[END_REF], that are only proven for finite domains.

Proposition 4.3. Consider a positive function g defined on R, homogeneous of degree -β there with β > 1. Such a function is strictly decreasing on R. Consider also a convex subset Ω ⊂ R. Then, the coprime Riemann sum of the function g on Ω compares to the integral of g on Ω, namely

     R n (g, Ω) - 6 π 2 I(g, Ω)     ≤ 1 n (1 + 5ζ(β)) M g (R) .
Proof. To filter the cases in which gcd(a, b) > 1, we use the Möbius function µ which performs "inclusionexclusion". The Möbius function µ : N → {-1, 0, +1} satisfies

 d|n µ(d) =  1 if n = 1 0 if n > 1 . (4.19)
We consider the restricted "coprime" Riemann sum, where the sum is taken over the pairs (a, b) with gcd(a, b) = 1, namely

n 2  R n (g, Ω) =  (a,b)∈Z 2 gcd(a,b)=1 g  a n , b n    a n , b n  ∈ Ω   .
We then "insert" the µ-function inside this restricted "coprime" Riemann sum,

n 2  R n (g, Ω) =  (a,b)∈Z 2 g  a n , b n    a n , b n  ∈ Ω      d| gcd(a,b) µ(d)   .
As the point (a/n, b/n) belongs to R with a > 0, the inequality gcd(a, b) ≤ n holds. Then, inverting the summations entails the equality

n 2  R n (g, Ω) =  d≤n µ(d)  (a,b)∈Z 2 g  ad n , bd n    ad n , bd n  ∈ Ω   .

PROOFS: DISTRIBUTIONS AND DENSITIES. 124

Finally, the following equality holds

 R n (g, Ω) =  d≤n µ(d) R n (g d , Ω d ) , (4.20)
and involves the function g d and the subset Ω d defined as

g d (x, y) := g(dx, dy), Ω d = 1 d Ω .
As the inclusion Ω d ⊂ S holds, we now apply the previous Proposition 4.2 to each (plain) Riemann sum R n (g d , Ω d ) and obtain

|R n (g d , Ω d ) -I(g d , Ω d )| ≤ 5 n M g d (Ω d ) . (4.21)
We now use three properties. We first remark the equality

I(g d , Ω d ) = 1 d 2 I(g, Ω) ,
due to the change of variables (x ′ , y ′ ) = (dx, dy). Second, the series of general term µ(d)/d 2 is convergent, and, with the Möbius inversion, its sum equal 1/ζ(2) and

       d≤n µ(d) d 2 - 6 π 2       ≤ 1 n .
Third, we relate the bound M g d (Ω d ) to its analogous. As g is homogeneous of degree -β, its derivative is homogeneous of degree (-β -1) and the two relations

g d (x, y) = g(dx, dy) = 1 d β g(x, y) , ∂g d ∂y (x, y) = d ∂g ∂y (dx, dy) = 1 d β ∂g ∂y (x, y) ,
hold for (x, y) ∈ R. As g and its derivative are 0 outside R, the same holds for g d and its derivative, and

M g d (Ω d ) = M g d (Ω d ∩ R) = 1 d β M g (Ω d ∩ R) ≤ 1 d β M g (R) .
Then, as β > 1, one has

 d≤n M g d (Ω d ) ≤ ζ(β)M g (R) .
With the three previous properties, together with Eq. (4.21), we obtain the final result. ■ 4.3.3 Distributions. Proof of Theorem 4.1.

Theorem 4.1 is a particular case of the previous Proposition 4.3, when it applies to ω and ∆ f (λ) defined in (4.9) and (4.7). The function ω is homogeneous of degree 2 and the domain ∆ f (λ) is convex, as it is the intersection of the unbounded rectangle R with the half-plane {f (x, y) ≤ λ}. Applying Proposition 4.3 then proves Theorem 4.1. We first prove Assertion (b) assuming Assertion (a). We let

F n (λ) := P[Λ n ≤ λ], F ∞ (λ) = 12 π 2 I f (λ) .
We know from Assertion (a) that the derivative J f (λ) of λ → → I f (λ) exists. This is the same for the function F ∞ and we wish to estimate the difference

    F n (λ + ϵ(n)) -F n (λ) ϵ(n) -F ′ ∞ (λ)     .
We begin with the triangle inequality

    F n (λ + ϵ(n)) -F n (λ) ϵ(n) -F ′ ∞ (λ)     (4.22) ≤     F n (λ + ϵ(n)) -F ∞ (λ + ϵ(n)) ϵ(n)     +     F ∞ (λ) -F n (λ) ϵ(n)     +     F ∞ (λ + ϵ(n)) -F ∞ (λ) ϵ(n) -F ′ ∞ (λ)     .
With the special form of function f , the domain ∆ f (λ) is convex, and Theorem 4.1 provides the estimates

|F n (λ) -F ∞ (λ)| = O (1/n) , |F n (λ + ϵ(n)) -F ∞ (λ + ϵ(n))| = O (1/n) ,
where the constant in the O-terms does not depend on λ and ϵ(n). Then, the first two terms in Inequality (4.22) are O(1/(nϵ(n)) and tend to 0 because nϵ(n) → ∞. For the last term in (4.22), we use Taylor expansion of order 2 of the function F ∞ together with Assertion (a).

Proof of Theorem 4.2. Second step.

We now prove Assertion (a).

The set of lines F. In the set F of lines, defined as

F := {f (x, y) = λ : λ ∈ R},
the equation of the line f (x, y) = λ is written in terms of coefficients described in (4.6) as

(a 1 x + b 1 y + c 1 ) -λ (a 2 x + b 2 y + c 2 ) = 0 . (4.23)
The case in which the two vectors (a 1 , b 1 , c 1 ) and (a 2 , b 2 , c 2 ) are colinear is excluded, as in this case f (x, y) is constant. The case b 1 = b 2 = 0 is also excluded as we wish that f depend on y. Thus, there is at most one vertical line in F.

There are two cases for the set F defined in (4.23) (i) the case when the determinant r(a, b) := a 1 b 2 -a 2 b 1 is zero and in this case the determinant r(a, c) := a 1 c 2 -a 2 c 1 is not zero. The set F is formed by parallel lines of slope -a 1 /b 1 . This is for instance the case of the recurrence quotient with slope -1 or the case of ν with slope 0.

(ii) the case when the determinant r(a, b) := a 1 b 2 -a 2 b 1 is not zero. In this case, we can choose r(a, b) = 1 due to the homogeneity of the problem. Then, the set F is made up of all the lines which contain the point (x 0 , y 0 ) uniquely defined by the relations

 a 1 b 1 a 2 b 2   x 0 y 0  =  -c 1 -c 2  or  x 0 y 0  =  r(b, c) -r(a, c)  .
The point (x 0 , y 0 ) is called the basic point of F. Remark that case (i) can be seen as the limit of the case (ii) when (x 0 , y 0 ) tends to ∞ in the direction a 1 /b 1 . The basic points attached to our parameters ρ, µ are (0, 0) for ρ and (1, 1) for µ. In the set F of basic point (x 0 , y 0 ), the value of λ and the inverse 1/τ of the slope τ of the line f (x, y) = λ, are related via linear fractional transformations with determinant equal to 1, namely

λ = F (τ ) = a 1 τ + b 1 a 2 τ + b 2 τ = G(λ) = b 2 λ -b 1 a 2 λ -b 2 .
In the set F of basic point (x 0 , y 0 ), the parametrization of the line f (x, y) = λ of slope 1/τ is thus

x = x 0 + τ (y -y 0 ), τ = G(λ) .
Expressions of I f and its derivative. Consider a function f as in (4.6); denote by δ f (τ ) the segment (possibly empty or unbounded) which is the intersection of the line f (x, y) = λ = F (τ ) of slope 1/τ with the rectangle R. Now, the function f is fixed, the point (x 0 , y 0 ) is fixed, and all the indices which involve f are removed.

There is an open interval D which gathers the values of τ for which the segment δ(τ ) is not empty, and we denote by A(τ ), B(τ ) the ordinates of the two ends of the segment δ(τ ).

As soon as the line f (x, y) = F (τ ) is not horizontal, we consider the natural parametrization h τ of the line δ(τ ), namely a map h τ : (A(τ ), B(τ )) → δ(τ ) which associates to y the point

h τ (y) = h(τ, y) = (x 0 + τ (y -y 0 ), y) of the line δ(τ ). The map τ → → h τ is of class C ∞ on D.
Using the change of variables (θ, y) → → (h(θ, y), y), and its Jacobian |(∂h)/(∂θ)(y, θ)| = |y -y 0 |, the integral L(τ (We have used the fact that F is increasing). Then the derivative of L admits the expression

) := L f (τ ) := I f (F (τ )) = I f • F (τ ) is written as L(τ ) =  τ -∞ dθ  B(θ) A(θ) Q(θ, y)dy ,
L ′ (τ ) =  B(τ ) A(τ ) Q(τ, y)dy . (4.24)
The function L ′ is itself differentiable on the set D, except perhaps on a finite set (as we will see now) and involves the previous functions under the form

L ′′ (τ ) =  B(τ ) A(τ )
∂Q ∂τ (τ, y)dy (4.25)

+ B ′ (τ ) Q(τ, B(τ )) -A ′ (τ ) Q(τ, A(τ )) , (4.26) with ∂Q ∂τ (τ, y) = ∂ω ∂x (x 0 + τ (y -y 0 ), y) |y -y 0 | 2 .
We prefer to deal with the function L, as it is easier to "see the geometry". We will return to the function I and its two derivatives with the relations

I ′ (λ) = L ′ (τ ) F ′ (τ ) , I ′′ (λ)F ′ (τ ) 2 = L ′′ (τ ) -L ′ (τ ) F ′′ (τ ) F ′ (τ ) , (4.27)
and use the special form of F defined in (4.23).

The role of the corners. The values of τ in D for which I ′ is a priori not differentiable are those for which the line of slope 1/τ is vertical or meets one of the two "corners" of R, namely the slope 1/τ 0 for which it meets the point (0, 1), and the slope 1/τ 1 for which it meets the point (0, 1).

There are now two different geometric cases: the generic case (G) or the exceptional case (E), described as follows:

(G) If the point (x 0 , y 0 ) does not belong to the line y = 1, there are exactly two lines in F, each of them containing one corner of R, associated with two distinct values τ 0 and τ 1 .

(E) If the point (x 0 , y 0 ) belongs to the line y = 1, there is only one value τ 0 = τ 1 = ∞.

Finally, there are at most three values of τ in the set {0, τ 0 , τ 1 } where L ′ is possibly not differentiable. But, L ′ possesses at each finite τ i a left and a right derivative, each of them being finite. This is thus the same for the derivative I ′ of the function I. At τ = 0, the derivatives F ′ (0) and F ′′ (0) are finite as soon as b 2 ̸ = 0.

Behavior of L ′′ (τ ) for λ → 0. The ratio R(τ ) := B(τ )/A(τ ) is important, as the estimates

Q(τ, y) = Θ(y -1 ), ∂Q ∂τ (τ, y) = Θ(y -1 )
entail that L ′ (τ ) and the first term of L ′′ (τ ) in (4.25) are both Θ(log R(τ )).

The bound B(τ ) always tends to +∞ but there are two cases for A(τ ): it remains bounded or not.

(i) The case when A(τ ) remains bounded occurs if and only if the basic point belongs to one of the two vertical lines x 0 = 1 or x 0 = 1. Then the estimates R(τ ) = Θ(τ -1 ) and L ′ (τ ) = Θ(log τ ), directly entail that L ′′ (τ ) is Θ(τ -1 ).

(ii) If A(τ ) tends also to ∞, then the ratio R(τ ) tends to |x 0 -1|/|x 0 |, and this limit may be only finite non zero. Then, the derivatives A ′ (τ ) and B ′ (τ ) are Θ(τ -2 ) whereas A(τ ) and B(τ ) are Θ(τ -1 ) and thus Q(τ, B(τ )) and Q(τ, B(τ )) are Θ(τ ) and each term of (4.26) is Θ(τ -1 ), whereas the first term in (4.25) tends to a finite limit. More precisely, the estimate

τ  B ′ (τ )Q(τ, B(τ )) -A ′ (τ )Q(τ, A(τ ))  → 1
ends with (4.27) the proof of Theorem 4.2 (a). ■ We now focus on the conditional expectations. Our final purpose is to prove Theorem 4.3 which is devoted to the recurrence quotient. However, we begin by a more general study and we obtain in Section 4.3 a general result regarding the conditional expectations (Theorem 4.5). We then apply it in Section 4.4 to the particular case of the recurrence quotient, and this provides Theorem 4.6, which can be viewed itself as an extension of Theorem 4.3.

Limit expectation of bounded LQ-functions.

Thus far, we dealt with distributions of LQ-functions. Now, we consider expected values of an LQ-function, and use the equality

E[Λ n ] =  ∞ 0 P[Λ n ≥ λ] dλ ,
valid when Λ ≥ 0, as in our case. We consider here the case of an LQ-function Λ associated with a bounded function f (which is the case when b 2 is not zero). It is then possible to interchange the limit and the integral and use Theorem 4.1.

When reversing the order of integration, we first integrate with respect to λ, and we are led to the integral

E ψ [f ] := 6 π 2 I(f • 2ω, R) (4.28)
which is exactly the expectation E ψ [f ] of the function f on the rectangle R with respect to the density ψ := (12/π 2 ) ω. We thus obtain the following result which provides an extension of Theorem 4.1:

Theorem 4.4. Consider an LQ-function Λ associated with a function f bounded by B f . Then the sequence n → → Λ n admits a limit expected value as n → ∞ equal to the expectation E ψ [f ] of the function f on the rectangle R with respect to the density ψ := (12/π 2 ) ω, and

E [Λ n ] = E ψ [f ] + B f O  1 n  , (4.29)
where the constant in the O-term does not depend on f and λ.

Case of the recurrence quotient.

The function f associated with the recurrence quotient S(α, n) is f S (x, y) = 1 + x + y. It is is unbounded on R, and the function f S is not integrable with respect to ψ. In fact, by the argument of Proposition 4.1 the expected value can be worked out to be

E[S n ] =  R n (2ωf S , R),
and here  R n (2ωf S , R) is infinite for each n.

This is why we consider the conditional expectations for the sequence S n with respect to an event [Γ n ≥ ϵ(n)] associated with another LQ-function Γ, namely

E[S n |Γ n ≥ ϵ(n)] .
We will choose in the sequel the LQ-function Γ from the set {µ, ν, ρ} and a positive sequence ϵ(n) tending to 0 not all too quickly. We consider more general conditional expectations,

E[Λ n |Γ n ≥ ϵ] (ϵ > 0)
when Γ is an LQ-function associated with a function g which tends to 0 for y → ∞. (This means that the pair (b 1 , b 2 ) in (4.6) satisfies b 1 /b 2 = 0). The subset

{(x, y) ∈ R : g(x, y) ≥ ϵ}
is bounded for ϵ > 0, and we denote, for ϵ > 0,

B f |g (ϵ) := sup{f (x, y) : g(x, y) ≥ ϵ} < ∞.
In this case, the expectation of f with respect to ψ conditioned to the event [g ≥ ϵ] is well defined, and denoted as

E ψ [f |g ≥ ϵ] .
The following holds.

Theorem 4.5. Consider two LQ-functions Λ and Γ with respective associated functions f and g. Assume that g tends to 0 for y → ∞. Then the conditional expectation of Λ n with respect to the event

[Γ n ≥ ϵ] satisfies E[Λ n |Γ n ≥ ϵ] • P[Γ n ≥ ϵ] = E ψ [f |g ≥ ϵ] • P ψ [g ≥ ϵ] +B f |g (ϵ) O  1 n 
where the constant in the O-term does not depend on either f , g or ϵ.

Proof. The conditional expectation is a ratio; the denominator is P[Γ n ≥ ϵ] whereas the numerator

 ∞ 0 P[Λ n ≥ λ, Γ n ≥ ϵ] dλ .
Associate with the pair (Λ, Γ) its function pair (f, g) and, for any pair (λ, ϵ) of positive real numbers, consider the bounded convex subset already described in (4.15)

∆ f,g (λ, ϵ) := {(x, y) ∈ R : f (x, y) ≥ λ, g(x, y) ≥ ϵ} .
We have remarked in Section 3 that a slight extension of Proposition 4.1 entails the equality

P[Λ n ≥ λ, Γ n ≥ ϵ] =  R n  2ω, ∆ f,g (λ, ϵ)  .
Moreover, with the convexity of the domain ∆ f,g (λ, ϵ) ⊂ R, Proposition 4.3 applies, yielding

P[Λ n ≥ λ, Γ n ≥ ϵ] = 12 π 2 I[ω, ∆ f,g (λ, ϵ)] + O  1 n  .
Now we integrate on λ, noticing that we need only integrate from 0 to B f |g (ϵ)

 ∞ 0 P[Λ n ≥ λ, Γ n ≥ ϵ]dλ = 12 π 2  ∞ 0 I[ω, ∆ f,g (λ, ϵ)]dλ + B f |g (ϵ)O  1 n  .
We are led to the integral of ω on the domain of R 3 defined by

{(x, y, λ) ∈ R × R ≥0 : f (x, y) ≥ λ, g(x, y) ≥ ϵ} 4.5. OTHER APPLICATIONS AND EXTENSIONS 130 Parameter Γ Bound for S E ψ [f S |f Γ ≥ ϵ(n)] P ψ [f Γ ≥ ϵ(n)] ρ S ≤ 2 + 1/ρ =⇒ B f S |fρ (ϵ) = O(1/ϵ) A| log(ϵ(n)| + 1 -Aϵ(n)| log ϵ(n)| µ S ≤ 1 + 1/µ =⇒ B f S |fµ (ϵ) = O(1/ϵ) A| log ϵ(n)| + A 1 -ϵ(n) ϵ(n)| log ϵ(n)| ν S ≤ 1 + 2/ν =⇒ B f S |fν (ϵ) = O(1/ϵ) A| log ϵ(n)| + 1
Figure 4.8: In the second column, the bounds for S for each parameter Γ ∈ {ρ, µ, ν}. In the third column, the values of the product

E ψ [f S |f Γ ≥ ϵ(n)] P ψ [f Γ ≥ ϵ(n)] needed to apply Theorem 4.5. The constant A is 12/π 2 .
We interchange the summation, and we first integrate with respect to λ (which provides the term f (x, y)), and obtain

 ∞ 0 I[ω, ∆ f,g (λ, ϵ)]dλ =   (x,y)∈R, g(x,y)≥ϵ ω(x, y) • f (x, y)dxdy , = π 2 12 E ψ [f |g ≥ ϵ] • P ψ [g ≥ ϵ] . ■
4.4.4 Conditional expectation of the recurrence quotient. Proof of Theorem 4.3.

We will prove here a stronger version of Theorem 4.3, where the remainder terms are more precise.

Theorem 4.6. Consider a parameter Γ ∈ {ρ, µ, ν} defined in (4.1) and (4.2), and a sequence n → → ϵ(n) which tends to 0. Then the conditional expectation of the recurrence quotient S n with respect to the event

[Γ n ≥ ϵ(n)] satisfies E  S n   Γ n ≥ ϵ(n)  = 12 π 2 | log ϵ(n)| + C(Γ) + O  1 ϵ(n)n + ϵ(n)| log ϵ(n)| 2  . (4.30)
Moreover, the constants C(Γ) satisfy

C(ν) = +1, C(µ) = 0, C(ρ) = +1 .
Proof. The proof is an application of Theorem 4.5. First, a direct computation with Theorem 4.1 shows that if Γ is one of the Q-functions ρ, µ or ν, the following estimates hold

P[Γ n ≥ ϵ(n)] = 1 + O(ϵ(n) + 1/n) .
Along with the bounds and the integrals provided in Figure 4.8, this implies the result. ■ Now, Theorem 4.3 is an immediate application of Theorem 4.6. Indeed, in the case when ϵ

(n) = Ω  1 n log n  , the remainder term in (4.30) is o(| log ϵ(n)|).

Other applications and extensions

The principles employed above do not limit themselves to Q-functions, here we present other interesting applications; first to the study of the number of continuants in an interval [n, cn) with fixed c > 1, and then to study the minimal distance Γ from Definition 3.11. We also expand on the concept of Q-functions.

Number of continuants in an interval.

There is an interesting application of the previous ideas, that counts the number of terms of the sequence k → → q k (α) that belongs to the interval [n, cn), for some fixed c > 1. We thus study the function

(α, n) → → T (α, n) :=  k≥0 [[q k (α) ∈ [n, cn)]] .
Proposition 4.4. Consider the Lévy constant κ := exp  π 2 /(12 log 2)  . Then the mean number of continuants in the interval [n, κn] tends to 1 as n → ∞ Proof. Even if T is not a Q-function, its expectation E[T n ] is expressed as a Riemann sum of the function 2ω, in a domain T c . However the domain T c is not a subset of the rectangle R. We have indeed

E[T n ] =  1 0 T (α, n)dα =  1 0 dα  k [[q k (α) ∈ [n, cn)]] =  k  m∈N k |I k (m)| [[q k (m) ∈ [n, cn)]] = 1 n 2  k  m∈N k ω  q k-1 (m) n , q k (m) n    q k (m) n ∈ [1, c)   = 2  (a,b)∈Z 2 gcd(a,b)=1 ω  a n , b n    a n ≤ b n , 1 ≤ b n ≤ c   =  R n (2ω, T c ), with T c = {(x, y) : x ≤ y, 1 ≤ y ≤ c} .
Even if T c is not a subset of R, Proposition 4.3 applies, and the coprime Riemann series admits a limit equal to the integral 6 π 2 I(2ω, T c ) = 12 log 2 π 2 log c .

■

Interpretation. The expression in Proposition 4.4 is no coincidence. Given a complete interval dynamical system (see Definition 1.3) with shift map S, consider the inverse branches h ∈ H k rather than the tuple of digits m 1 , . . . , m k . Pick a probability measure µ, which plays the role of the Lebesuge measure above.

Under good hypothesis, the author conjectures that the following limit should exist and equal

lim n→∞  k≥1  h∈H k µ (h(I))  n < 1 µ(h(I)) ≤ θn  = log θ H µ (S) ,
where H µ (S) is the entropy of our system with respect to the probability measure µ, see Section 1.2.7.

We give the philosophical intuition behind this conjecture. If the limit g(θ) exists for each θ > 0, it should be of the form g(θ) = c log θ for a certain C, as it satisfies g(θ 1 • θ 2 ) = g(θ 1 ) + g(θ 2 ) and it is increasing. We expect the constant c to be as above because θ = exp(H µ (S)) is the candidate to make the expected number of continuants in (n, θn] roughly equal to 1.

The smallest distance and Q  -functions

Introduction Many functions that are not Q-functions may turn into one after integration. This is the case of the smallest distance Γ(α, n) from Chapter 3, Definition 3.11, which constitutes an interesting building example. We shall then show also that T k(α,n) α is another example.

The average case of the smallest distance and its distribution has appeared several times in the literature over the years. First Friedman and Niven [START_REF] Friedman | The average first recurrence time[END_REF] considered the study of the first recurrence time (see Definition 3.13) on average, introducing several techniques involving the so-called Farey series. Then Kesten [START_REF] Kesten | Some probabilistic theorems on Diophantine approximations[END_REF] built on the work of Friedman and Niven to study the expected values of the smallest distance. It turns out that his proof can be simplified by explaining more deeply the relation between coprime Riemann sums and integrals (see Proposition 4.8 below). Here we shall show that we may achieve the same results, even in distribution, by extending the concepts of this chapter.

It is also worthwhile to point out the works by Knuth [START_REF] Knuth | The distribution of continued fraction approximations[END_REF] and Bosma, Jager and Wiedijk [START_REF] Bosma | Some metrical observations on the approximation by continued fractions[END_REF].

Knuth has studied the related quantity θ k (α) := q k (α) • |αq k (α) -p k (α)| probabilistically, giving a limit density as k → ∞. Bosma, Jager and Wiedijk, on the other hand, have proved similar results from an Ergodic perspective. We shall give more details on the matter when we state the result for the smallest distance.

Normalized smallest distance Clearly asking for the limit distribution of Γ(α, n) does not make much sense: it tends to 0 uniformly, as we know that Γ(α, n) ≤ 1/(n + 1). The inequality follows form the fact that we have partitioned the circle of radius 1 into n + 1 intervals. The right function would be the normalized smallest distance:

nΓ(α, n) = Γ(α, n)/(1/n) .
Let us recall an important proposition from Chapter 3, which explains the relationship between the smallest distance Γ(α, n) and the convergents of α.

Proposition. 3.15 Let α ∈ [0, 1) and n ∈ N. Let k be the unique non-negative integer such that q k (α) ≤ n < q k+1 (α). The smallest distance Γ(α, n) is then given by

Γ(α, n) = M k (α) := |αq k -p k | .
We recall Proposition 1.4, which tells us that

1 q k + q k+1 ≤ |αq k -p k | ≤ 1 q k+1 ,
and Proposition 3.15. From these we derive that for q k (α) ≤ n < q k+1 (α)

q k 2q k+1 < n |αq k -p k | < 1 .

Thus we derive

Proposition 4.5. For almost every α ∈ (0, 1), the normalized smallest distance nΓ(α, n) satisfies the bounds

1 2 ≤ lim sup n→∞ nΓ(α, n) ≤ 1 . (4.31)
Probabilistic study of the normalized smallest distance We shall prove the following Theorem giving the limit distribution of the normalized smallest distance.

Theorem 4.7. The normalized smallest distance n • Γ(α, n) has a limit distribution

lim n→∞ P (α : n • Γ(α, n) ≤ β) = 12 π 2 (β -G(β)) , (4.32)
where G(β) is 0 for β ≤ 1/2, and for 1/2 ≤ β ≤ 1 we have

G(β) = - 1 2 (log β) 2 + (β -1) log β 1 -β -Li 2 (β) + 2 β -1 + π 2 12 ,
where we recall Li

2 (x) = -  x 0 log(1-u) u du for |x| ≤ 1.
This Theorem was first proved by Kesten in [START_REF] Kesten | Some probabilistic theorems on Diophantine approximations[END_REF] but by using significantly different methods. As a consequence we have the following result for the expectation.

Theorem 4.8. The expected value of the normalized smallest distance n • Γ(α, n) satisfies

lim n→∞ E [n • Γ(α, n)] = log 2 ζ(2) . (4.33)
Theorem 4.7 has an analog in [START_REF] Bosma | Some metrical observations on the approximation by continued fractions[END_REF] which we cite here Theorem 4.9. Let b > 0. For almost every α ∈ I we have

lim n→∞ 1 n #{j : j ≤ n, q j (α)|αq j (α) -p j (α)| ≤ b} =  b log 2 if 0 ≤ b ≤ 1 2 , 1 log 2 (-b + log(2b) + 1) if 1 2 ≤ b ≤ 1 .
Note that in Theorem 4.9 only the n's that are continuants are considered (i.e., n = q j (α)) and the result is of Ergodic nature, giving the average behavior of the orbit of a fixed α, almost every α ∈ I. The proof of Theorem 4.9 rewrites the quantity |αq j (α) -p j (α)| in terms of T j (α) and [m j (α), . . . , m 1 (α)] = q j-1 (α)/q j (α), to then apply the Ergodicity of the natural extension (x, y) → → (T g (x), 1/(m(x) + y)).

Knuth in [Knu84] obtains this same limit distribution for q k (α)|αq k (α) -p k (α)|, but for k fixed, when considering α ∈ I drawn uniformly at random from I. His strategy, however, is rather different, as he considered methods close to those of Chapter 5.

In order to study the smallest distance, we introduce a new concept.

Definition 4.1 (Q  -function). A function Λ : [0, 1]×N → R ≥0 is said to be a Q  -function if
and only if for each positive integer n and prefix m ∈ N k such that q k-1 (m) ≤ n < q k (m), the integral of α → → Λ(α, n) on the fundamental interval I m associated with m can be written as

 Im Λ(α, n)dα = 1 n 2 f  q k-1 (m) n , q k (m) n  , (4.34)
for some function f : (0, 1] × [1, ∞) → R ≥0 , independent from both m and n. In such a case we say that f is the function associated with the Q  -function Λ.

OTHER APPLICATIONS AND EXTENSIONS 134

Thus Q  -functions have averages over the fundamental intervals that are actually Q-functions. It comes as no surprise that we will be interested in the expected values of Q  -functions, even more so due to the following proposition which states that the indicator

[[n Γ(α, n) ≤ b]], for fixed b > 0, is a Q  -function. Proposition 4.6. Fix b > 0. The indicator function (α, n) → → [[n Γ(α, n) ≤ b]], is a Q  -function, explicitly  Im [[n Γ(α, n) ≤ b]]dα =        1 n 2 1 y(x+y) if 1 ≤ b y 1 n 2  b x -1 x(x+y)  if by < 1 ≤ b(x + y) 0 otherwise , where x = q k-1 (m) n
and y = q k (m) n , so that q k-1 (m) ≤ n < q k (m) implies 0 < x ≤ 1 < y. Proof. We observe that if k is even, then

I m =  p k (m) q k (m) , p k (m) + p k-1 (m) q k (m) + q k-1 (m)  ,
while, if k is odd,

I m =  p k (m) + p k-1 (m) q k (m) + q k-1 (m) , p k (m) q k (m)
 .

Here

n Γ(α, n) ≤ b ⇐⇒ α ≤ p k-1 q k-1 + b n q k-1 , and α ≥ p k-1 q k-1 - b n q k-1 .
The first possibility holds trivially when k is even, because then α ≤ p k-1 q k-1 , and similarly the latter one holds trivially occur when k is odd because then α ≥ p k-1 q k-1 . Case k even. Let us start by supposing that k is even. Then

I m =  p k (m) q k (m) , p k (m) + p k-1 (m) q k (m) + q k-1 (m)  ,
and we must compute the length of the interval

J m,n := I m ∩  p k-1 q k-1 - b n q k-1 , p k-1 q k-1 + b n q k-1  . Since α ≤ p k-1
q k-1 for k even, we need only check what happens with the left border

p k-1 q k-1 -b n q k-1 .
We compare first

p k-1 q k-1 -b n q k-1 with p k (m)+p k-1 (m) q k (m)+q k-1 (m) . Observe that p k-1 (m) q k-1 (m) - p k (m) + p k-1 (m) q k (m) + q k-1 (m) = 1 q k-1 (q k + q k-1 ) thus p k-1 q k-1 - b n q k-1 ≤ p k (m) + p k-1 (m) q k (m) + q k-1 (m) ⇐⇒ 1 q k-1 (q k-1 + q k ) ≤ b n q k-1 ⇐⇒ n ≤ b (1 + x k ) q k But p k-1
q k-1 -b n q k-1 may also exceed the left-hand border of I m when

p k-1 q k-1 - b n q k-1 ≤ p k q k ⇐⇒ 1 q k ≤ b n ⇐⇒ n ≤ b q k .
Thus, for b q k < n ≤ b (q k + q k-1 ) i.e. by < 1 ≤ b(x + y), we have

J m,n =  p k-1 q k-1 - b n q k-1 , p k (m) + p k-1 (m) q k (m) + q k-1 (m)  , |J m,n | = 1 n 2  b x - 1 x(x + y)  ,
while, if n > b (1 + x k ) q k we have the empty set J m,n = ∅, and for n ≤ b q k we get the original interval

J m,n = I m in which case |J m,n | = 1 n 2 1 y(x+y)
. The analysis gives the same results in the end when k is odd, thus

 Im [[n Γ(α, n) ≤ b]]dα =        1 n 2 1 y(x+y) if 1 ≤ b y 1 n 2  b x -1 x(x+y)  if by < 1 ≤ b(x + y) 0 otherwise , where x = q k-1 (m) n and y = q k (m) n , so that q k-1 (m) ≤ n < q k (m) implies 0 < x ≤ 1 < y. ■
Here is an analogous to Proposition 4.1 for Q  -functions. Notice that here the density ω(x, y) does not necessarily intervene, as we actually see from Proposition 4.6.

Proposition 4.7. Let Λ be a Q  -function associated with a function f ≥ 0. Then its expected value is given by

E α [Λ(α, n)] = 2 n 2  a≤n<b , gcd(a,b)=1 f  a n , b n  . (4.35)
Proof. For a Q  -function Λ, associated with f , the expected value takes on the form

E[Λ n ] =  k≥1  m∈N k [ [q k-1 (m) ≤ n < q k (m)] ]  Im Λ(α, n)dα (4.36)
which by definition equals

E[Λ n ] = 1 n 2  k≥1  m∈N k [ [q k-1 (m) ≤ n < q k (m)] ]f  q k-1 (m) n , q k (m) n  . (4.37)
Now the rest follows as before by noticing that the pairs (q k-1 (m), q k (m)) traverse all the pairs of coprime integers (a, b) with a ≤ b twice. ■ Observation 4.1. Observe that for the normalized smallest distance, the integrals over the fundamental intervals

 Im [[n Γ(α, n) ≤ b]]dα
can be decomposed, for any b > 0, as a sum of homogeneous functions of degree 2 and maybe also 1. So it is not trivial to apply Proposition 4.3 at once.

Here there are two ways forward. In fact, if we admit the case of homogeneous functions of degree -1 in Proposition 4.3, we get a bound of order O((log n)/n). We feel, however, that it is more illuminating to step back and explain what happens on a much wider context.

The general intuition is explained by the following Proposition 4.8. Given a "filtering" or "weighting" function δ with a natural density C > 0 (see the statement of the proposition), any perturbation of the Riemann-integral by filtering (or weighting) the steps by δ just gives the same Riemann integral multiplied by C. For our application we just need δ(a, b) = [[gcd(a, b) = 1]], which has density C = 6/π 2 (see Proposition 2.10), but it is important to give the whole intuition behind it.

Proposition 4.8. Let f : [0, 1] k → R be bounded, and Riemann integrable. Consider a bounded function δ :

N k → R with a natural density lim N 1 ,...,N k →∞ 1 N 1 . . . N k  x 1 ≤N 1 ,...,x k ≤N k δ(x 1 , . . . , x k ) = C ,

OTHER APPLICATIONS AND EXTENSIONS 136

for a certain constant C > 0. Then we have lim

N 1 ,...,N k →∞ 1 N 1 . . . N k  x 1 ≤N 1 ,...,x k ≤N k f  x 1 N k , . . . , x k N k  δ(x 1 , . . . , x k ) = C  • • •  [0,1] k f (x 1 , . . . , x k )dx 1 . . . dx k .
Proof. The proof of this Lemma is the archetypical proof in Measure Theory; we prove that a certain class of "easy functions" satisfies the statement, and then move on to prove that these functions approximate well our "target functions".

The result is trivially true when we pick

f = 1 (a 1 ,b 1 ]×...×(a k ,b k ]
. Indeed, by inclusion-exclusion (see e.g., [Sta97, pp.64-65])

 a 1 < x 1 N 1 ≤b 1 ,...,a k < x k N k ≤b k δ(x 1 , . . . , x k ) =  S⊂[k] (-1) |S|  x i N i ≤a i for i∈S , x i N i ≤b i for i̸ ∈S δ(x 1 , . . . , x k ) , (4.38)
because here the properties (sets) that may fail to be satisfied are a i < x i N i for i = 1, . . . , k. Here we observe that lim

N 1 ,...,N k →∞ 1 N 1 . . . N k  x i N i ≤a i for i∈S , x i N i ≤b i for i̸ ∈S δ(x 1 , . . . , x k ) = C   i∈S a i  •    i̸ ∈S b i   , therefore lim N 1 ,...,N k →∞ 1 N 1 . . . N k  a 1 < x 1 N 1 ≤b 1 ,...,a k < x k N k ≤b k δ(x 1 , . . . , x k ) = C  S⊂[k] (-1) |S|   i∈S a i  •    i̸ ∈S b i   , (4.39)
= C (b 1 -a 1 ) . . . (b k -a k ) . (4.40)
As a consequence, the result follows at once for step functions (the finite linear combinations of the characteristic functions of rectangles), we have our "easy functions". We remark that what happens in the borders of the intervals defining the rectangle is not very important, since these cases do not eventually contribute to the limits because |δ| is bounded.

Let us denote

S f (N 1 , . . . , N k ) := 1 N 1 . . . N k  x 1 ≤N 1 ,...,x k ≤N k f  x 1 N k , . . . , x k N k  δ(x 1 , . . . , x k )
for the sake of brevity.

So our "easy functions" are the step functions, now our "target functions" will be all of the Riemann integrable functions. Indeed, the set of step functions is dense in the set of Riemann integrable functions under the norm of L 1 , hence if f is Riemann integrable and ϵ > 0 is arbitrary, there is a step unction g such that ∥f -g∥ 1 ≤ ϵ and we explain why this, together with the Riemann integrability of |f -g|, actually imply the conclusion.

OTHER APPLICATIONS AND EXTENSIONS 137

Let K be such that |φ| ≤ K, as it is bounded by hypothesis, then

  S f (N 1 , . . . , N k )-S g (N 1 , . . . , N k )    ≤ 1 N 1 . . . N k  x 1 ≤N 1 ,...,x k ≤N k   f  x1 N k , . . . , x k N k  -g  x1 N k , . . . , x k N k    |δ(x 1 , . . . , x k )| ≤ K N 1 . . . N k  x 1 ≤N 1 ,...,x k ≤N k   f  x1 N k , . . . , x k N k  -g  x1 N k , . . . , x k N k    ,
and observe here that the right-hand side tends to K  |f -g|, because |f -g| is Riemann integrable.

It follows that for, say

N 1 , . . . , N k ≥ M we get |S f -S g | ≤ 2Kϵ
. By making M larger if necessary, we may assume |S g - g| ≤ ϵ as we already know the result to hold for g, thus by the triangle inequality

|S f -  f | ≤ |S f -S g | + |S g -  g| + |  g -  f | ≤ (2K + 2)ϵ ,
provided that N 1 , . . . , N k ≥ M , which proves the result because ϵ > 0 was arbitrary. ■ With Proposition 4.8 at hand, we now explain how to get the distributions from before.

Theorem 4.10. Consider f ∈ C 1 (R, R), and let Λ(α, n) be the Q-function associated with f , i.e.,

Λ(α, n) := f  q k-1 n , q k n  for q k-1 (α) ≤ n < q k .
Assume that ∇f (x, y) ̸ = 0 for almost-every (x, y) ∈ R, then the limiting distribution of Λ(α, n) as n → ∞ is given by

lim n→∞ P (α : Λ(α, n) ≤ λ) = 12 π 2   ∆ f (λ)
ω(x, y)dxdy , for every λ ≥ 0.

Remark. Observe that the hypothesis hold for the recurrence quotient, where we have f S (x, y) = 1 + x + y, or the relative position, where we have f µ (x, y) = 1-x y-x . In these cases, however, the fact that (x, y) → → 1 f (x,y)≤λ is Riemann-integrable is actually simple enough since the border f (x, y) = λ is a line.

Proof. We give a sketch of the proof. There are two parts to it, after noticing that (see Proposition 4.1)

P (α : Λ(α, n) ≤ λ) = 2 n 2  (a,b)∈N 2 ω  a n , b n    f  a n , b n  ≤ λ     a n < b n   δ(a, b), where δ(a, b) = [[gcd(a, b) = 1]].
In order to apply Proposition 4.8 we first need to show that

(x, y) → → [[f (x, y) ≤ λ]] is Riemann-integrable,
and then extend the result to the unbounded R (the result works for the bounded rectangle [0, 1] × [0, 1]).

First we explain why (x, y) → → [[f (x, y) ≤ λ]] is Riemann-integrable. This follows from the fact that the points of discontinuity belong to f -1 (λ), which is a null set, thanks to the inverse function theorem (we may omit the points where ∇f = 0 as this is already a null set, and we show the rest is countable). Now Proposition 4.8 applies only to bounded rectangles (by re-scaling), but the fast convergence of the sums We mention here that when one drops the condition that Λ be an LQ-function, then we cannot really give guarantees with regard to the convergence to the distribution. This is why we gave a different proof in our paper for ANALCO [START_REF] Rotondo | The recurrence function of a random Sturmian word[END_REF] with precise error terms, as these are much needed for the results regarding the convergence in density and the conditional expectations.

By using Proposition 4.8 we complete he proof of Theorem 4.7.

Proof. [of Theorem 4.7] We are now ready to prove Theorem 4.7 by using Proposition 4.6. Indeed, fixed b > 0 we divide into two cases: (i) 1/b ≤ y and (ii) y ≤ 1/b.

When we are in case (ii) we have that the domain (x, y) is contained in the bounded rectangle

[0, 1]×[1, 1/b].
Hence we may apply Proposition 4.8 for case (ii) after re-scaling the y-axis. For the case (ii) 1/b ≤ y we note that the formula given by Proposition 4.6 falls into the case of Proposition 4.3. Hence it follows that in the limit we get 12/π 2 times the integral as before:

lim n→∞ P (α : n • Γ(α, n) ≤ b) = 12 π 2   R f b (x, y)dxdy ,
where

f b (x, y) =        1 n 2 1 y(x+y) if 1 ≤ b y 1 n 2  b x -1 x(x+y)  if by < 1 ≤ b(x + y) 0 otherwise . Thus for b ≤ 1/2 lim n→∞ P (α : n • Γ(α, n) ≤ b) = 12 π 2  1 0   1/b 1/b-x  b x - 1 x(x + y)  dy +  ∞ 1/b dy y(x + y)  dx , since then 1/b -x ≥ 1.
It is then a computation to find that this reduces to 12 π 2 b. For b > 1/2 it may hold that 1/b -x < 1 depending on x. Thus subtracting these cases

lim n→∞ P (α : n • Γ(α, n) ≤ b) = 12 π 2 b - 12 π 2  1 1/b-1   1 1/b-x  b x - 1 x(x + y)  dy  dx ,
for b > 1/2. Computing the integral gives the result. ■

Independence from the initial distribution

Introduction Thus far we have only considered the uniform (Lebesgue) distribution on the interval I = [0, 1]. It is more generally true that as long as our distribution have a density with respect to the Lebesgue measure (i.e., that our measure µ is absolutely continuous with respect to the Lebesgue measure λ Leb , in symbols µ ≪ λ Leb ) the limit in Theorem 4.1 will remain the exact same. We do not give guarantees with regard to the convergence speeds, and these may vary according to the nature of the density g(x) = dµ dλ Leb (x). Theorem 4.11 (Independence from the initial distribution). Consider a probability measure µ that is absolutely continuous with respect to the Lebesgue measure λ Leb , in symbols this reads µ ≪ λ Leb . Then, for each fixed λ ∈ R, the limit

lim n→∞ P µ (S n ≤ λ)
exists and is independent from the choice of µ ≪ λ Leb .

To motivate the proof, let us consider a density g ∈ C 1 (I, R). We note that for a fundamental interval J := I m 1 ,...,m k we have the following estimate

µ(J) =  J g(x)dx = g  p k q k  |J| + O(|J| 2 ) ,

OTHER APPLICATIONS AND EXTENSIONS

139 by the mean-value Theorem, as p k (m)/q k (m) ∈ J. Recalling that |J| = 1/(q k (q k + q k-1 )) we get

µ(J) = 1 q 2 k g  p k q k  1 + q k-1 q k + O(|J| 2 ) ,
and here we write ρ = q k-1

q k and  ρ = p k /q k . Clearly, if g ≡ 1 we get the same result from Theorem 4.10. We will prove that we may indeed get rid of this factor g(p k /q k ) by showing that p k /q k is asymptotically independent (on average) to q k-1 /q k . Then the factor g(x) integrates separately to 1 and we get the result.

The independence of p k /q k and q k-1 /q k . We recall that by the mirror property (1.14) we have

ρ = [m k , m k-1 , . . . , m 1 ] ,  ρ = [m 1 , m 2 , . . . , m k ] .
This property is crucial. We explain intuitively why ρ and  ρ should be independent. Indeed, given a sequence m = (m 1 , m 2 , . . .), the convergents

 ρ = [m 1 , m 2 , . . . , m k ] converges exponentially fast to x = [m 1 , m 2 , . . .]. Similarly ρ = [m k , m k-1 , . . . , m 1 ]
is mainly determined by the first digits of m k , m k-1 , . . . , m 1 , which present a kind of stationary behavior for almost every x. Thus we see that intuitively ρ and  ρ should be independent from one another.

Even if we made a seemingly fundamental use of the Riemann sums with x = q k-1 /n and y = q k /n before, this time it will prove significantly simpler to work with the parameters ρ = q k-1 /q k ,  ρ = p k /q k and y = q k /n. Note we now have three parameters, because the denominators p k have not intervened in our expressions up to this point. In any case note that x = ρ • y so we may retrieve the expressions from before.

We present a proof that is algebraic in nature and depends fundamentally on the equivalent fact that x mod q and x -1 mod q are asymptotically independent on average. Indeed, we shall prove that this follows from the determinant equation (1.13) which implies the congruence p k q k-1 ≡ (-1) k+1 (mod.q k ). We remark how to get rid of the sign ±1: the two signs will occur symmetrically, owing to the fact that each rational has exactly two continued fraction expansions (one of even and one of odd length). To the best of our knowledge, this remark proving that p k /q k and q k-1 /q k behave somewhat independently is new, and we would also like to prove this dynamically, but we have not been able to do this yet.

The fact that the modular inverses x mod q and x -1 mod q are asymptotically independent on average might be intuitively clear to many people working in Number Theory, and in order to prove it in the form we want, we cite the survey [START_REF] Shparlinski | Modular hyperbolas[END_REF] of Shparlinski, which gives several applications of a precise form of independence inequalities for x mod q and x -1 mod q.

For the proof we require [Shp12, Theorem 13] which we cite here. The proof of this Theorem reduces to the application of a bound by Estermann for Kloosterman sums. Kloosterman sums

K m (r, s) =  x: 1≤x≤m, gcd(x,m)=1 exp  2πi m  r x + s (x -1 mod m   ,
are intuitively a measure of "correlation" between x and x -1 mod m, so it comes as no surprise that they be of use here.

Theorem 4.12 (From [Shp12], Theorem 13). Let X = {U + 1, . . . , U + X}, where m > X ≥ 1 and U ≥ 0 are arbitrary integers. Suppose that for every x ∈ X we are given a set Y x = {V x + 1, . . . , V x + Y } where m > Y ≥ 1 and V x ≥ 0 are arbitrary integers. Then for any integer m ≥ 1 and a with gcd(a, m) = 1, we have 

(x,y)∈Ha,m , x∈X ,y∈Yx 1 = φ(m) m 2 XY + O(m 1/2+o(1) ) ,
where H a,m = {(x, y) : xy ≡ a(mod.m)}.

In other words, we know very well (with an error term) what happens over rectangles. It comes as no surprise then, following the previous result for linear combinations of characteristic functions of rectangles, that we have the following Theorem 4.13.

Theorem 4.13. Let f : [0, 1] × [0, 1] × [0, ∞) → R ≥0 be locally Riemann-integrable and compactly supported (i.e., f (•, •, y) = 0 for large enough y). Then lim

N →∞ 1 N 2  (x,y): 1≤x≤y, gcd(x,y)=1 f  x y , x -1 mod y y , y N  = 6 π 2    [0,1]×[0,1]×[0,∞) y f (ρ,  ρ, y)dρd ρdy .
It is important to remark that the sum on Theorem 4.13 is bidimensional, yet it yields a triple integral.

Proof.

[Sketch] First, we may work on a compact domain

D := [0, 1] × [0, 1] × [0, R]
containing the support of f . Consider arbitrary step functions g and h with g ≥ f ≥ h ≥ 0 on D.

If the result holds for such arbitrary g and h, it is easy to see it also holds for f on D (Riemann-integrability on D). Thus it is enough to prove it for step functions; the functions that are linear combinations of characteristic functions of "rectangles"

[a, b] × [c, d] × [A, B]
(maybe excluding the borders).

For a basis step function

f = 1 [a,b]×[c,d]×[A,B]
the result is a direct calculation that follows from Theorem 4.12 and the approximation c

 N k=1 φ(k) ∼ 3 π 2 N 2 . ■
Now we delve into the relation between modular inverses and the convergents. The formal relation is given by the following theorem.

Theorem 4.14.

Let f : [0, 1] × [0, 1] × [0, ∞) → R ≥0 then  m∈N ⋆ f  q k-1 (m) q k (m) , p k (m) q k (m) , q k (m) N  =  (a,b)∈N 2 : 1≤a≤b, gcd(a,b)=1  f  a b , a -1 mod b b , b N  + f  a b , 1 - a -1 mod b b , b N   -f  1, 1, 1 N  . Proof. Let Υ : {m ∈ N + : m 1 > 1} → N + be defined by m = (m 1 , . . . , m k ) → → (1, m 1 -1, m 2 , . . . , m k ),
then we may write

 k≥1  m∈N k f  q k-1 (m) q k (m) , p k (m) q k (m) , q k (m) N  =  k≥1  m∈N k , m 1 >1  f  q k-1 (m) q k (m) , p k (m) q k (m) , q k (m) N  + f  q k (Υ(m)) q k+1 (Υ(m)) , p k+1 (Υ(m)) q k+1 (Υ(m)) , q k+1 (Υ(m)) N   + f  1, 1, 1 N  ,
as every (w 1 , . . . , w k+1 ) with w 1 = 1 is exactly Υ(w 2 + 1, . . . , w k+1 ). Notice the term f  1, 1, 1 N  on the right-hand side that is due to the fact that for (1) we may not apply Υ.

Observe that the mirror property (1.14) reads q k (Υ(m)) = q k-1 (m) and q k+1 (Υ(m)) = q k (m). This follows from the equality [m 1 , . . . , m k ] = [m 1 , . . . , m k -1, 1], and the mirror property (1.14).

c Recall e.g., that the Dirichlet Generating Function of the Euler totient function φ is ζ(s -1)/ζ(s), hence this follows from the Tauberian Theorem in Theorem 2.3. See Section 2.2 on DGFs for more details.

OTHER APPLICATIONS AND EXTENSIONS 141

Let θ : N ⋆ → N ⋆ be the mirror (m 1 , . . . , m p ) → → (m p , . . . , m 1 ), then we recall that the mirror property reads

 p k-1 (θ(m)) p k (θ(m)) q k-1 (θ(m)) q k (θ(m))  =  p k-1 (m) p k (m) q k-1 (m) q k (m)  T . (4.41)
Let us continue. Due to the change of parity in the depth

{p k (m), p k+1 (Υ(m))} = {q -1 k-1 mod q k , (-q -1 k-1 ) mod q k } ,
where, in fact, (-q -1 k-1 ) mod

q k = q k -  q -1 k-1 mod q k  . Thus  k≥1  m∈N k f  q k-1 (m) q k (m) , p k (m) q k (m) , q k (m) N  =  k≥1  m∈N k , m 1 >1  f  q k-1 q k , 1 - q -1 k-1 mod q k q k , q k N  + f  q k-1 q k , q -1 k-1 mod q k q k , q k N   + f  1, 1, 1 N  .
We recall that the mirror property tells us that

p k (θ(m)) = q k-1 (m), q k-1 (θ(m)) = p k (m), q k (θ(m)) = q k (m) ,
thus by applying the mirror θ on the right-hand side (note that this turns m 1 > 1 into m k > 1) we have

 m∈N ⋆ f  q k-1 (m) q k (m) , p k (m) q k (m) , q k (m) N  =  m∈N k  m∈N k , m k >1  f  p k q k , 1 - p -1 k mod q k q k , q k N  + f  p k q k , p -1 k mod q k q k , q k N   + f  1, 1, 1 N  .
The coprime pairs (p k , q k ) go through each reduced fraction a/b = p k /q k exactly once (except for a/b = 1), thanks to condition m k > 1, thus we obtain

f  1, 1, 1 N  +  m∈N * f  q k-1 (m) q k (m) , p k (m) q k (m) , q k (m) N  =  (a,b)∈N 2 : 1≤a≤b, gcd(a,b)=1  f  a b , a -1 mod b b , b N  + f  a b , 1 - a -1 mod b b , b N   ,
and we are done. ■

The following result solves the problem for the distribution of S n as the event S n (α) ≤ λ makes the function we need compactly supported (we clearly have the bound q k N ≤ λ when S n ≤ λ). The result still holds for the distributions of other LQ-functions the same argument.

Theorem 4.15. Let f : [0, 1]×[0, 1]×[0, ∞) → R be locally Riemann-integrable and compactly supported. Then

lim N →∞ 1 N 2  k≥0  m∈N ⋆ f  q k-1 q k , p k q k , q k N  = 12 π 2    [0,1]×[0,1]×[0,∞)
y f (ρ ρ, ρ,  ρ, y)dρd ρdy .

CONCLUSIONS 142

Observation 4.2. If we wanted to consider also p k-1 for our approximations, we could too. Indeed, the equality p k-1 q k -p k q k-1 = (-1) k implies

p k-1 q k = p k q k • q k-1 q k + (-1) k q 2 k ,
thus it is easy to extend the result for a C 1 function. The rest follows from approximation with C 1 functions.

Corollary 4.1. Let f : [0, 1] × [0, 1] × [0, 1] × [0, ∞) → R be locally Riemann-integrable and compactly supported. Then lim N →∞ 1 N 2  k≥0  m∈N ⋆ f  p k-1 q k , q k-1 q k , p k q k , q k N  = 12 π 2    [0,1]×[0,1]×[0,∞) y f (ρ ρ, ρ,  ρ, y)dρd ρdy .
Concluding remarks. We did not originally think it was possible to extend the results for the limit distributions to more general "initial" densities. The real motivation for this extension was the study of the recurrence function over pure quadratic irrationals (see subsection 6.3.2). When studying the average behavior of the recurrence function when q k-1 (α) ≤ n < q k (α) for an index k within the first period of the continued fraction expansion of α, the distribution of the recurrence quotient coincides with the classical case from this chapter, but changing the Lebesgue measure for the Gauss measure. The results from this subsection tell us that we retrieve the same limit distributions.

Conclusions

Beginning from the question "what does the recurrence function of a random Sturmian word look like?", we define and work within a model that is natural at least from an algorithmic standpoint: pick a large integer n and let the slope of the word be drawn at random from [0, 1]. We are led to the notion of the so-called Q-functions: functions that, given n and a slope α, place n within the sequence of continuants k → → q k (α) of α, namely consider the index k for which n ∈ [q k-1 (α), q k (α)), and then return a value depending only on the two ratios (1/n)q k-1 (α) and (1/n)q k (α). The recurrence quotient of Sturmian words defines such a Q function, via a Theorem of Morse and Hedlund, where n is the length of the factors and α the slope of the word.

Then, we study the distribution of a general Q-function. It defines in fact a sequence of distributions, and we prove that the limit distribution and the limit densities exist. They all involve, as a sort of reference density, the density ψ defined in (4.10), which plays a similar role to that of the Gauss density (defined in (1.8)) when one studies functions that depend on the ratio q k-1 (α)/q k (α), and appears in our study [BCR + 15] which we explain extensively in Chapter 5.

Our results apply in particular to the recurrence quotient of Sturmian words; we exhibit the limit distribution (and the limit density) of such a quotient. We compare our probabilistic study to the results of Morse and Hedlund (see Theorem 3.4), which exhibit extreme behaviors, attained when n is close to the left border q k-1 (α) of the interval [q k-1 (α), q k (α)) containing the integer n. That is why we also consider conditional expectations, where the conditional events are related to the various parameters which describe the position of the integer n inside [q k-1 (α), q k (α)). We then compare this "constrained probabilistic" behaviors to the extreme behaviors, in a precise manner.

We had already performed a similar study in [BCR + 15] under a different probabilistic model, which we called "fixed depth k → ∞" model in subsection 3.4.3. We present this model in detail in Chapter 5. In this model it is rather the index k of the interval [q k-1 (α), q k (α)[ the integer n belongs to that is fixed. Then for k → ∞, we exhibited limit distribution and limit densities all of which involve, as a sort of reference density, the Gauss density. The two models are clearly different, but the two types of results show certain similarities which we discuss in Chapter 6.

Further studies. In Chapter 6 we also present two variants of this model, which we consider in order to tackle the study of the recurrence function for two special families of α.

Rational Numbers. This type of slope gives rise to periodic words, and occurs for Christoffel words. For a bound N , we restrict α to the set of rationals with denominator at most N , endowed with the uniform distribution, and we wish to observe the transition when N → ∞. We wish to explain how a periodic word "becomes" Sturmian.

Quadratic Irrationals. This type of slope α, which we presented in Section 1.5, occurs for substitutive Sturmian words. There is a natural notion of size (ϵ(x) from Section 1.5) associated with such numbers, closely related to the period of their continued fraction expansion, and we wish to observe the transition when the size becomes large.

CHAPTER 5

THE RECURRENCE FUNCTION AND THE RELATIVE POSITION

Introduction

The recurrence function, introduced in Chapter 3, measures the "complexity" of an infinite word and describes the possible occurrences of finite factors inside it together with the maximal gaps between successive occurrences. This recurrence function has been widely studied, notably in the case of Sturmian words (see [START_REF] Cassaigne | Limit values of the recurrence quotient of sturmian sequences[END_REF][START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF]). We recall that, due to Theorem 3.1, Sturmian words are strongly characterized by their slope α. This is in particular the case for the recurrence function n → → R α (n), as explained by Theorem 3.3), where the integer m = R α (n) is the length of the smallest "window" needed to discover the whole set L α (n) of finite factors of length n. The set of factors L α (n) is widely used in many applications of Sturmian words (for instance quasicrystals, or digital geometry), and therefore the function n → → R α (n) intervenes very often as a pre-computation cost, hence the importance of better understanding it "on average", when the real α is randomly chosen in the unit interval.

We have presented a random model, the "large fixed n" model, in Chapter 4. The "large fixed n" answers the question "given a random slope α and a large n of our choice, how big is R(α, n) on average?", which makes sense from an algorithmic point of view. In the current chapter we will present another model, the "large fixed k" model, we fix the interval [q k-1 (α), q k (α)) between two continuants of α which contains n, and prescribe a geometric description of the positioning of n within the interval. Thus the integer n is not fixed anymore, becoming a random variable. This model is more adept to answering questions about the incidence of the position of n within the interval and hence yield nicely worst-case families of n.

The expression of the recurrence function is recalled in Section 5.2. Our viewpoint and our main results are given in Section 5.3. Proofs are provided in Section 5.4.

The recurrence function of Sturmian words

Notation. In the sequel φ = ( √ 5 -1)/2 = 0.6180339 . . . stands for the inverse of the golden ratio, and for two integers a, b, the set of integers n that satisfy a

≤ n ≤ b is denoted by [[a, b]] := [a, b] ∩ N.
We recall that the simplest words that are not eventually periodic satisfy the equality p u (n) = n + 1 for (the lower bound holds for n close to q k (α) whereas the upper bound is attained for n = q k-1 (α)). The ratio ρ k (α) belongs to (0, 1], and the Borel-Bernstein Theorem (see e.g., [IK02]) proves that lim inf k→∞ ρ k (α) = 0 for almost every irrational α. More precisely: Proposition. 3.16 and 3.17. Let ϵ > 0. For almost every α the recurrence function satisfies:

lim sup n→∞ R(α, n) n log n = ∞ , lim sup n→∞ R(α, n) n (log n) 1+ϵ = 0 , as well as lim inf n→∞ R(α, n) n = 2 .
Finally we recall that, thanks to the previous proposition, we work, not with the recurrence function R(α, n), but rather with the recurrence quotient

S(α, n) := R(α, n) + 1 n ,
for which we will sometimes write S α (n) when we want to fix α and highlight the dependence on n.

Probabilistic model and main results

The notable feature of the model we are about to introduce, which was mentioned in subsection 3.4.3, is that it highlights the relationship between the size of the recurrence function R(α, n) and the barycentric position µ(α, n) of n, within its corresponding interval [q k-1 (α), q k (α)).

In the first model presented here [START_REF] Rotondo | The recurrence function of a random Sturmian word[END_REF] (which was actually our second model historically, see Chapter 4 for more details), the size n of the factors was a fixed (and very large) positive integer, and then the position µ n (α) := µ(α, n) becomes a random variable which can be studied in its own right (see its density in 4.2).

In the model from [BCR + 15], which we are about to present in detail, we do not have the freedom to choose n anymore (in fact, we will have an analogous random variable n ⟨µ⟩ k ) but we have full freedom to fix the relative position µ as a parameter. We thus begin by revisiting the geometric parameters µ and ρ that will interest us in this model, then we introduce the model and finally the results along with their proofs.

Position parameter µ.

We consider a fixed sequence (µ k ) k with values in [0, 1), and for each α ∈ I := [0, 1], and each k ∈ N, we consider the real number at (barycentric) position

µ k inside the interval [[q k-1 (α), q k (α) -1]], namely  n ⟨µ k ⟩ k (α) := q k-1 (α) + µ k (q k (α) -q k-1 (α)),
together with its integer part (which belongs to

[[q k-1 (α), q k (α) -1]]), n ⟨µ k ⟩ k (α) = ⌊ n ⟨µ k ⟩ k (α)⌋ = q k-1 (α) + ⌊µ k (q k (α) -q k-1 (α))⌋.
The subsequence (n ⟨µ k ⟩ k (α)) k is the subsequence associated with the positions µ k .

We are interested in the subsequence of n → → S(α, n) associated with the subsequence {n

⟨µ k ⟩ k (α), k ∈ N},
and we then let

S ⟨µ k ⟩ k (α) := S(α, n ⟨µ k ⟩ k (α)), namely S ⟨µ k ⟩ k (α) = 1 + q k-1 (α) + q k (α) n ⟨µ k ⟩ k (α) = 1 + q k-1 (α) + q k (α) q k-1 (α) + ⌊µ k (q k (α) -q k-1 (α)⌋ . (5.3)
If we drop the integer part in the expression of S ⟨µ k ⟩ k

, we deal with the sequence  S

⟨µ k ⟩ k (α) := S(α,  n ⟨µ k ⟩ k (α)), namely,  S ⟨µ k ⟩ k (α) = 1 + q k-1 (α) + q k (α)  n ⟨µ k ⟩ k (α) = 1 + q k-1 (α) + q k (α) q k-1 (α) + µ k (q k (α) -q k-1 (α)) , (5.4)
which is expressed with the two sequences (ρ k (α)) k and (µ k ) as

 S ⟨µ k ⟩ k (α) = f µ k (ρ k (α)) with f µ (x) := 1 + 1 + x x + µ(1 -x)
.

(5.5)

The study of the function f µ provides a precise knowledge on the sequence  S

 S ⟨µ k ⟩ k (α) ∈  1 + m k + 2 µ k m k + 1 , 3  or  S ⟨µ k ⟩ k (α) ∈  3, 1 + m k + 2 µ k m k + 1  depending whether µ k ∈ [1/2, 1] or µ k ∈ [0, 1/2].
(ii) The sequence S ⟨µ k ⟩ k (α) is bounded if α has bounded partial quotients or if the sequence (µ k ) admits a strictly positive lower bound.

Proof. The map f µ : [0, 1] → R is strictly decreasing when µ ∈ (0, 1/2), and strictly increasing when µ ∈ (1/2, 1). This is the constant function equal to 3 when µ = 1/2. For any a ∈ (0, 1), the image f µ ([a, 1]) is the interval with endpoints 3 and f µ (a). This proves Assertion (i).

With the two inequalities

 n ⟨µ⟩ k ≥ n ⟨µ⟩ k ≥ q k-1 ≥ φ 1-k , 0 ≤  n ⟨µ⟩ k -n ⟨µ⟩ k ≤ 1,
we obtain the inequality

0 ≤ S ⟨µ⟩ k - S ⟨µ⟩ k = q k + q k-1 n ⟨µ⟩ k •  n ⟨µ⟩ k ( n ⟨µ⟩ k -n ⟨µ⟩ k ) ≤ 1 q k-1 q k + q k-1  n ⟨µ⟩ k ≤ φ k-1  S ⟨µ⟩ k , (5.6)
and we apply (i). ■

Probabilistic model

Let us describe now our probabilistic model. We choose a sequence (µ k ) k of positions that will be fixed. This defines, for each real α, a sequence of indices n k := n

⟨µ k ⟩ k
, and then a sequence of real numbers k → → S For any position, the index n

⟨µ k ⟩ k belongs to the interval [[q k-1 , q k -1]].
Then, as the expectations for α ∈ [0, 1] of the two extreme sequences k → → log q k-1 (α), k → → log q k (α) satisfy the same estimates (see [L 36]), it is also the case for the expectation for α ∈ [0, 1] of the sequence k → → log n

⟨µ k ⟩ k (α). It thus satisfies E[log n ⟨µ k ⟩ k ] = π 2 12 log 2 k + O(1), (5.7)
and it is of linear growth with respect to k.

Results for a constant position µ

We first consider the case in which the sequence (µ k ) k is a constant, taking a fixed value µ, and we study the expectation and the distribution of the sequence k → → S ⟨µ⟩ k of random variables, when k → ∞, as a function of the position µ. Theorem 5.1 below shows that there are two main cases:

(a) the case when µ = 0; here, the expectations are infinite, but the functions k → → S ⟨0⟩ k admit a limit density;

(b) the case when µ ̸ = 0; here, both the expectations and the densities have a finite limit; the case µ = 1/2 is particular, as the limit density is a Dirac measure, concentrated at the value 3.

For indices n associated with parameters µ satisfying µ ≥ µ 0 > 0, we exhibit a behavior for the sequence n → → R α (n) which is thus "linear on average"; the "log n" behavior of Theorem 3.4 does not occur in this case.

Theorem 5.1. [Fixed position µ] Let φ = ( √ 5 -1)/2 < 1. The following results hold for the random variables

S ⟨µ⟩ k . (i) [Expectations] For each µ ∈]0, 1], their expected values E[S ⟨µ⟩ k ] satisfy E[S ⟨µ⟩ k ] = 1 + 1 log 2 | log µ| 1 -µ + O  φ 2k µ  + O  φ k | log µ| 1 -µ  , (5.8)
where the constants in the O-terms are uniform with respect to µ and k.

(ii) [Limit density] For each µ ∈ [0, 1] with µ ̸ = 1/2, they admit a limit density s ⟨µ⟩ equal to

s ⟨µ⟩ (x) = 1 log 2  1 (x -1) |x(1 -µ) + µ -2|  1 Iµ (x),
(5.9)

where I µ is the real interval with endpoints 3 and 1 + 1/µ. More precisely, for any b ∈ I µ , one has

P  S ⟨µ⟩ k ≤ b  =  b 0 s ⟨µ⟩ (x) dx + 1 b O  φ k  ,
where the constant of the O-term is uniform with respect to b and k. It is also uniform with respect to µ when µ satisfies |µ -1/2| ≥ µ 0 for any µ 0 > 0.

Results when the sequence µ k → 0

We now focus on the difficult case, when the sequence (µ k ) k is no longer constant, and we consider a sequence (µ k ) k of positions which tends to 0. Theorem 5.2 below tackles this case, first considering sequences (µ k ) k which tend exponentially fast to 0, for which we observe that the expectations are of order k. We then consider general sequences (µ k ) k which tend to 0, and we show that the associated random variables admit a limit density, with a speed of convergence which depends upon the sequence (µ k ) k .

Theorem 5.2. [Sequence µ k → 0] The following holds for the random variables S ⟨µ⟩ k associated with a sequence µ k → 0.

(i) [Expectations] Consider the sequence µ k = τ k , with τ ∈ [φ 2 , 1). Then E[S ⟨τ k ⟩ k ] = k | log τ | log 2 + O(1), (5.10)
where the constant hidden in the O-term is uniform with respect to τ and k.

For any α, and for each τ ∈ [φ 2 , 1[, there exists a family of increasing subsequences N (α, τ ), depending on both α and τ , of indices n for which

E  R α (n) n - 12| log τ | π 2 log n  = O(1) (n → ∞).
(5.11)

For any τ < 1, if µ k is drawn uniformly from [0, 1], the conditional expectation with respect to the event

[µ k ≥ τ k ] satisfies lim k→∞ E  S ⟨µ k ⟩ k   [µ k ≥ τ k ]  = 1 + π 2 6 log 2 .
(ii) [Limit density] For any sequence µ k → 0, the random variables S ⟨µ k ⟩ k admit as limit density the density s ⟨0⟩ equal to

s ⟨0⟩ (x) = 1 log 2 1 (x -1)(x -2) 1 [3,∞] (x).
More precisely, for any b ≥ 3, the probability P[S

⟨µ k ⟩ k ≥ b] satisfies P[S ⟨µ k ⟩ k ≥ b] = 1 log 2 log  b -1 b -2  + O(µ k ) + 1 b O  φ k  ,
where the constants hidden in the O-term are uniform to respect to b and k. If now the sequences

(b k ) k and (µ k ) k satisfy the following three conditions (b k → ∞, µ k → 0 with b k µ k → 0), then lim k→∞ b k • P  S ⟨µ k ⟩ k ≥ b k  = 1 log 2 .
Observation 5.1. The estimate (5.7) together with (5.10) yields (5.11). We have then exhibited a log n behavior "on average" for the ratio R α (n)/n for (an infinity of) particular subsequences n (which depend on α). On the contrary, when the position is not too small, the ratio R α (n)/n remains bounded (on average).

Strategy for the proofs.

We begin with Theorem 5.1 which deals with a fixed position µ. There are three main steps in the proof of Theorem 5.1.

(i) We drop the integer part in the expression of S ⟨µ⟩ k and consider the sequence  S ⟨µ⟩ k (α) which can be written as f µ (ρ k (α)) (see (5.5))). This is an instance of a smooth sequence (as defined in Section 5.4.1 below). We express its mean value and distribution in terms of the k-th iterate of the Perron Frobenius operator H.

(ii) With the spectral properties of the operator H (described in Section 5.4.2), when acting on the Banach space BV (I) of the functions of bounded variation on the unit interval I, we obtain the asymptotics of the expectations and the expression of the limit distribution, always for the sequence  S ⟨µ⟩ k . (iii) We return to the initial sequence S ⟨µ⟩ k with the following estimates

E[S ⟨µ⟩ k ] = E[  S ⟨µ⟩ k ]  1 + O(φ k )  , P(S ⟨µ⟩ k ≤ b) -P(  S ⟨µ⟩ k ≤ b) = O  φ k b  , (5.12)
which are refinements of Eq.(5.6).

Since the probabilistic estimates obtained in Theorem 5.1 are uniform with respect to µ and k, we may extend them to the case where µ depends on k, and we may study the interesting case where the sequence (µ k ) k tends to 0 for k → ∞. We then obtain the results of Theorem 5.2.

Observation 5.2. There are two error terms in the asymptotic estimates (5.8) of the expectations. The first one comes from the spectral gap of the Perron-Frobenius operator and the second one arises when one takes into account integer parts in the definition of S ⟨µ⟩ k .

Smooth sequences

The sequence  S ⟨µ⟩ k provides an instance of a smooth sequence, defined as follows: Definition 5.1. A sequence of random variables (T k ) defined on the unit interval I = [0, 1] is a smooth sequence if there exists a function f ∈ BV(I) for which

T k (α) = f (ρ k (α))
with ρ k (α) = q k-1 (α) q k (α) for all α ∈ I.

Here, we deal with the function f µ defined in (5.5), whose inverse map g µ is

g µ : f µ (I) → → [0, 1], g µ (x) = -1 -µ + µx 2 -µ -x(1 -µ) .
For µ ∈ (0, 1), the function f µ is integrable on I, and its L 1 -norm satisfies

∥f µ ∥ L 1 = 1 + 1 1 -µ + 1 -2µ (1 -µ) 2 | log µ|, ∥f 1 ∥ L 1 = 5/2.
Moreover, for every µ ∈ (0, 1), the function f µ is monotonic and thus of bounded variation, with a total variation equal to (1/µ)|1 -2µ|, hence ∥f µ ∥ BV = O(1/µ). Remark that f 0 does not belong to BV(I).

We now recall some basic facts on the underlying dynamical system, together with the Perron-Frobenius operator, that will be useful in the sequel.

The dynamical system and the Perron-Frobenius operator

The underlying dynamical system. The underlying dynamical system is the Euclidean system from Chapter 1. We recall it briefly here.

We consider the dynamical system (I, T g ) associated with the unit interval I and the Gauss map T g , defined by

T g (x) = 1 x -  1 x  =  1 x  for x ̸ = 0, T g (0) = 0.
The map T g builds the continued fraction expansion of α, via the function m(α) := ⌊1/α⌋, as

α = [m 1 , m 2 , . . . , m k , . . .] with m k+1 (α) = m(T k g (α)
) for all k ≥ 0.

The inverse branches of T g belong to the set

H :=  h m : x → → 1 m + x ; m ≥ 1  ,
and the inverse branches of T k g belong to the set

H k = {h m 1 • h m 2 • . . . • h m k : m 1 , . . . , m k ≥ 1} . For a k-uple m = (m 1 , m 2 , . . . , m k ), let h m := h m 1 • h m 2 • . . . • h m k .
The linear fractional transformation h m is expressed in terms of the sequences (p k ) and (q k ), of successive numerators and denominators of the convergents, under the form

h m (x) = h m 1 • h m 2 • . . . • h m k (x) = 1 m 1 + 1 . . . + 1 m k + x = p k-1 x + p k q k-1 x + q k .
We remark that q k , p k depend only on the k-uple m = (m 1 , m 2 , . . . , m k ). We insist that there is no conflict with the notation q k (α). Indeed, when α is an irrational which belongs to the interval h m (I), the equality q k (α) = q k (m) holds as the digits are uniquely determined from α.

The mirror property (1.14) (in Corollary 1.3) relates the coefficients of

h = h m 1 • h m 2 • . . . • h m k and those of its mirror  h := h m k • h m k-1 • . . . • h m 1 : h(y) = p k-1 y + p k q k-1 y + q k =⇒  h(y) = p k-1 y + q k-1 p k y + q k .
Perron-Frobenius operator. We recall that when the unit interval I is endowed with a density f , after one iteration of T g , it is endowed with the density

H[f ](x) :=  h∈H |h ′ (x)| • f • h(x),
and after k iterations of T g , with the density

H k [f ](x) =  h∈H k |h ′ (x)| • f • h(x).
The operator H is exactly the Perron Frobenius operator from Definition 1.7. Now, at x = 0, the two maps h and  h satisfy |h ′ (0)| = |  h ′ (0)| = 1/q 2 k , and the equality q k-1 /q k =  h(0) holds. With this remark, the k-th iterate H k generates the continuants q k ,

H k [f ](0) =  h∈H k 1 q 2 k f  p k q k  =  h∈H k 1 q 2 k f  q k-1 q k  .
(5.13)

We now summarize some classical spectral properties of the operator H (see e.g. [IK02] or [START_REF] Bourdon | Dynamical analysis of α-Euclidean algorithms[END_REF]). When acting on the Banach space BV(I) of functions of bounded variation, the operator H admits a unique dominant eigenvalue λ = 1, with an eigenfunction proportional to ψ(x) = 1/(1 + x), as follows from Theorem 1.12, and it has a subdominant spectral radius equal to φ 2 . Moreover, the adjoint H * has an eigenmeasure proportional to the Lebesgue measure. Then, for any g ∈ BV(I) and ϵ > 0, the iterate H k [g] decomposes as

H k [g](x) = 1 log 2 1 1 + x •  I g(x)dx + O((φ + ϵ) 2k )∥g∥ BV .
(5.14)

Smooth random variables and Perron-Frobenius operator

We now perform Step (i) in the proof of Theorem 5.1. The following lemma (inspired by [START_REF] Flajolet | Continued fraction algorithms, functional operators, and structure constants[END_REF]) expresses the expectation and distribution of smooth sequences in terms of the Perron-Frobenius operator H.

Lemma 5.1. Assume that (T k ) is a smooth sequence associated with the function f . Then, the expected value E[T k ] and the distribution of the random variable (T k ) are both expressed with the k-th iterate of the Perron-Frobenius operator H:

E[T k ] = H k  f (x) • 1 1 + x  (0), P[T k ∈ J] = H k  1 J • f (x) • 1 1 + x  (0),
for any subinterval J of I.

Proof. For each index k, consider the family of linear fractional transformations h ∈ H k . The intervals h(I) form a partition of the interval I, and the length of the interval h(I) is expressed as a function of the continuants q k , as

|h(I)| = 1 q k (q k + q k-1 ) = 1 q 2 k    1 1 + q k-1 q k    .
Moreover T k (α) is constant on the interval h(I), and equal to f (q k-1 /q k ). Finally

E[T k ] :=  I T k (α)dα =  h∈H k 1 q 2 k ℓ  q k-1 q k  with ℓ(x) = 1 1 + x f (x).
With Relation (5.13), the last expression is exactly H k [ℓ](0).

We now consider, for any J ⊂ R, the probability

P (T k ∈ J) = E[1 J • T k ].
Using the same transforms as above (now applied to the function

1 J • f (x)) yields P[T k ∈ J] = H k  1 J • f (x) • 1 1 + x  (0). ■

Asymptotic study of smooth variables

We now perform Step (ii) in the proof of Theorem 5.1. Since the probabilistic characteristics of the random variable T k are expressed with the k-th iterate of the Perron Frobenius operator H, their asymptotics will be related to the dominant spectral properties of this operator when it acts on the Banach space BV (I) of the functions of bounded variation on the unit interval, and we use the decomposition (7.9).

Lemma 5.2. The following asymptotics hold, for any smooth sequence (T k ) relative to a function f ∈ BV (I):

E[T k ] = 1 log 2  I f (x) • 1 1 + x dx + O(φ 2k ∥f ∥ BV ), P[T k ∈ J] = 1 log 2  I 1 J • f (x) • 1 1 + x dx + O(φ 2k ),
for any subinterval J of I. If moreover the function f is of class C 1 and monotonic, with an inverse function g, the random variable T k admits a limit density; for any interval [a, b] ⊂ f (I), one has

P[T k ∈ [a, b]] = 1 log 2  b a |g ′ (u)| 1 + g(u) du + O(φ 2k ) = 1 log 2     log 1 + g(a) 1 + g(b)     + O(φ 2k ).
Proof. This is just an easy application of the decomposition (7.9). For the distribution, the norm ∥1 J • f • ψ∥ BV admits an upper bound which does not depend on the choice of f or J. ■

The previous lemma entails the following asymptotics for the probabilistic characteristics of the sequence  S ⟨µ⟩ k . Recall that the density s ⟨µ⟩ is defined in (5.9). Lemma 5.3. For µ ∈]0, 1], the following two asymptotic estimates, namely

E[  S ⟨µ⟩ k ] = 1 + 1 log 2 | log µ| 1 -µ + O  φ 2k µ  , P   S ⟨µ⟩ k ∈ J  =  J s ⟨µ⟩ (x)dx + O(φ 2k ).
The second estimate also holds for µ = 0.

Proof. This is just the application of the previous lemma for f := f µ . The function f µ belongs to BV (I) for µ > 0, with norm ∥f µ ∥ BV = O(1/µ). ■

This ends

Step (ii) of the proof of Theorem 5.1. The estimates (5.12) needed in Step (iii).

Third

Step of the proof of Theorem 5.1.

We first describe Step (iii) of the proof of Theorem 5.1 that explains how to return to the initial sequence S ⟨µ⟩ k (involving integer parts). We also give hints to prove Theorem 5.2. This technical lemma is useful to compare the distributions of two random variables.

Lemma 5.4. (i) Consider two positive random variables X and Y defined on the unit interval I. Assume that there exists ε > 0 for which one has ∥X -Y ∥ 0 < εY . Then, for any b > 0, the following holds

|P (X ≤ b) -P (Y ≤ b) | ≤ max  P (b(1 -ε) ≤ X ≤ b) , P (b ≤ X ≤ b(1 + ε))
 .

(ii) Consider two sequences (X k ) and (Y k ) of random variables defined on the unit interval I, with values in [0, +∞[. Assume the following (a) there is a real sequence

(a k ) k for which ∥X k -Y k ∥ 0 ≤ a k Y k , (b
) the sequence (X k ) k admits a limit density s with a speed of convergence c k .

Then the sequence Y k satisfies

P(Y k ≤ b k ) = P(X k ≤ b k ) + O(c k ) + O  b k a k sup {s(x); x ∈ [b k (1 -a k ), b k (1 + a k )]}  .
Proof. The inequality Y (1 -ε) ≤ X ≤ Y (1 + ε) entails the inclusions between events

{X ≤ b} \ {Y ≤ b} ⊂ {b(1 -ε) ≤ X ≤ b}, {Y ≤ b} \ {X ≤ b} ⊂ {b ≤ X ≤ b(1 + ε)},
and thus Assertion (i) with the choicesA = {X ≤ b} and B = {Y ≤ b}.

Assertion (ii). Using (a) and Assertion (i) entails the inequality

|P (X k ≤ b k ) -P (Y k ≤ b k ) | ≤ max {P (b k (1 -a k ) ≤ X k ≤ b k ) , P (b k ≤ X k ≤ b k (1 + a k ))} .
(5.15)

With (b), the following estimate (ii) The following holds for the expectations

P (c ≤ X k ≤ d) =
 b k b k -a k b k s(t)dt + O(c k ),  b k +a k b k b k s(t)dt + O(c k ),
E[S ⟨µ⟩ k ] = E[  S ⟨µ⟩ k ](1 + O(φ k )).
(iii) The following holds for the distributions, for any b ∈ I µ ,

P(S ⟨µ⟩ k ≤ b) -P(  S ⟨µ⟩ k ≤ b) = O  φ k b  + O(φ 2k ).
Proof.

Assertion (i). Denote by Φ the Golden ratio Φ = 1+ √ 5

2 . The inequalities (see Observation 1.2)

0 ≤  n ⟨µ⟩ k -n ⟨µ⟩ k ≤ 1 and  n ⟨µ⟩ k ≥ n ⟨µ⟩ k ≥ q k-1 ≥ Φ k-3 show that 0 ≤ S ⟨µ⟩ k - S ⟨µ⟩ k = q k + q k-1 n ⟨µ⟩ k •  n ⟨µ⟩ k ( n ⟨µ⟩ k -n ⟨µ⟩ k ) ≤ 1 q k-1 q k + q k-1  n ⟨µ⟩ k ≤ φ k-3  S ⟨µ⟩ k .
Assertion (ii). This a clear consequence of Assertion (i).

Assertion (iii). It follows from Assertion (i) of the present Lemma together with Assertion (ii) of the previous Lemma 5.4. ■ 5.4.6 Comparison between densities s ⟨µ⟩ and s ⟨0⟩ .

Lemma 5.6. Consider µ ∈ [0, 1/2[. The difference between the densities s ⟨µ⟩ and s ⟨0⟩ satisfies on the interval [3, ∞]

|s ⟨µ⟩ (x) -s ⟨0⟩ (x)| ≤ µ 1 [x(1 -µ) + µ -2] 2 for x ∈ I µ |s ⟨µ⟩ (x) -s ⟨0⟩ (x)| = s ⟨0⟩ (x) for x ≥ 1 + 1 µ
The difference between the two distributions satisfies:

     b 3 s ⟨µ⟩ (x)dx -  b 3 s ⟨0⟩ (x)dx     = O(µ)
where the O-constant does not depend on b.

5.4.7 End of the proof of Theorem 5.2

For Theorem 5.2, we now consider a sequence of positions (µ k ), and as our estimates of Theorem 5.1 are uniform with respect to µ and k, it is possible to deal with a µ which depends on k. Moreover, the previous lemma is useful to compare the distributions of the variables S CHAPTER 6

COMPARISON BETWEEN THE MODELS AND SPECIAL FAMILIES OF SLOPES

In this chapter we take a step back and seek to compare and find connections between the models and methods from chapters 4 and 5, namely the models with large fixed n and with large fixed k. Further, we study two families of special slopes: the rationals and the quadratic irrationals. This is ongoing work, and we shall point out the expected results and research directions taken. These studies have shown connections with the previous two models, and in particular to the link between the methods employed.

6.1 Relation between the two models.

We wish to relate the two (asymptotic) models: the model "with fixed large n" and the model "with fixed large k"? Of course, these two models should be close if the behavior of the sequence k → → q k (α) does not depend too strongly on α, and we know that it is not the case. However, the behavior of the sequence k → → log q k (α) is much more regular, as it is well known (see for instance [START_REF] Ya | Continued fractions[END_REF]) that

lim k→∞ 1 k log q k (α) = L = π 2 12 log 2
for almost all α . (6.1)

Consider first the present model "with n fixed", and a sequence ℓ → → n(ℓ) = τ ℓ . Then Theorem 4.3 reads

E[S n(ℓ) | µ n(ℓ) ≥ τ -ℓ ] ∼  12 π 2 log τ  ℓ . (6.2)
Furthermore, as n(ℓ) belongs to the interval [q k-1 (α), q k (α)[, the existence of the limit for the quotient q k (α)/n, that holds for almost any α, and is recalled in (6.1) entails the relation between the index ℓ and the index k := k(α, n(ℓ)), that holds for almost any α, namely log n(ℓ) = ℓ log τ ∼ π 2 12 log 2 k(α, n(ℓ)) . (6.3) Now, we deal with the model "with k fixed", and we consider that the index k(α, n(ℓ)) satisfies (6.3) everywhere. Then, the application of the result in the model "with k fixed", described in (5.10) should entail

E[S ⟨τ k ⟩ k ] ∼  1 log 2 log τ  k ∼  12 π 2 log 2 τ  ℓ . (6.4)
Remark that the conditional events are not the same in the two equations (6.2) and (6.4):

-in (6.2), the event is {α | µ(α, n(ℓ)) ≥ τ -ℓ }, -in (6.4) the event is {α | µ(α, n(ℓ)) ∼ τ -ℓ }.

This (heuristic) comparison exhibits in both cases a linear growth with respect to ℓ. However, the events of interest are not the same, and we have considered that the index k(α, n(ℓ)) satisfies (6.3) everywhere.

Relationship between the techniques employed

The techniques may seem fundamentally distinct at first sight, we claim, however, that they are closely related to one another.

From Riemann sums to the Transfer Operator

It may come away as a surprise that we may express the results with fixed n → ∞ from Chapter 4 (our article [START_REF] Rotondo | The recurrence function of a random Sturmian word[END_REF]) in terms of the transfer operator. At first sight the results and tools are fundamentally different: a variable depth for the continued fraction expansion against a fixed depth.

This surprising link is given by the use of the Mellin transform [START_REF] Flajolet | Analytic Combinatorics[END_REF] [FGD + 95] . The Mellin transform of our coprime Riemann sums will be given in terms of the quasi-inverse of the transfer operator of the Euclidean system. The appearance of the quasi-inverse is natural: we must filter (in terms of n) from all possible branches.

We recall the definition of the Mellin transform [FGD + 95], and later mention the key properties that interest us. For the Mellin transform method to work, we require several conditions regarding the behavior of the quasi-inverse in a band around its dominant singularity at s = 1. We expect, expect that this should be doable by an application of the Dolgopyat-Baladi-Vallée estimates (see Theorem 6.1) we cite below. These estimates give, precisely, a good understanding of the behavior of the quasi-inverse on a band around s = 1.

Definition 6.1 (Mellin Transform). Let f (x) be locally Lebesgue integrable over (0, ∞). The Mellin transform of f (x) is defined by

M[f (x); s] :=  ∞ 0 f (x)x s-1 dx .
Once we will have calculated the Mellin transform of our target function, we will explain briefly how to exploit this knowledge to get back the the distributions from Chapter 4.

Context and notation.

In this chapter we write ρ k = q k-1 /q k and y = q k /n, where t = 1/n.

Consider a Q-function Λ, we may write

Λ(α, n) = f Λ  q k-1 (α) q k (α) , q k (α) n 
for a certain f Λ , whenever q k-1 (α) ≤ n < q k (α). We recall from Chapter 4 that we write Λ n (α) := Λ(α, n) to denote the random variable for a fixed n.

Then, following Chapter 4, we are interested in the behaviour of

F Λ (t) := t 2  k≥0  m∈N k 1 (tq k ) 2 (1 + ρ k ) f Λ (ρ k , tq k )
as t → 0. The reason being that this sum is gives the expectation of Λ n when α is distributed uniformly, namely

F (1/n) = E[Λ n ] .
Notice that here t → 0 is a continuous version of 1/n.

That is why we are interested, more generally, in sums of the form

F (t) := t 2  k≥0  m∈N k f (ρ k , tq k ) . (6.5)
In particular, we consider the choice

f (ρ, y) = 1 y 2 (ρ + 1) [[f Λ (ρ, y) ≤ λ, ρy ≤ 1 < y]] , (6.6)
which gives the probability density at λ, namely F (1/n) = P (Λ n ≤ λ).

The connection with H s . We begin by operating formally. Taking Mellin Transform of F (t) in (6.5) and exchanging the sums and the integrals we have

 ∞ 0 F (t)t s-1 dt =  k  m  ∞ 0 f (ρ k , tq k )t s+1 dt .
We make a change of variables t → → tq k in each integral, getting

 ∞ 0 F (t)t s-1 dt =  k  m q -(s+2) k  ∞ 0 f (ρ k , t)t s+1 dt .
At this point we recall from Chapter 5 that we have identity (5.13), transforming a sum in p k /q k into a sum on q k-1 /q k . For our case this gives

 m q -(s+2) k  ∞ 0 f (ρ k , t)t s+1 dt = H k s/2+1  x → →  ∞ 0 f (x, t)t s+1 dt  (0) ,
as the variable s accompanies q -2 k = |h ′ (0)|. Thus, summing in k, we get our Mellin transform in terms of the quasi-inverse

M[F (t); s] =  ∞ 0 F (t)t s-1 dt = (I -H s/2+1 ) -1  x → →  ∞ 0 f (x, t)t s+1 dt  (0) . (6.7)
This is our key relation; the Mellin transform takes us from our coprime Riemann sums from Chapter 4 to a quasi-inverse of the transfer operator, at least formally. This is in principle a moral relation between the two, we explain below why we expect this to also be an effective link.

Analytic properties. We observe in (6.7) that the integral is well-defined for any s when we take f of the form (6.6) (which yields the densities), because the domain of integration is limited to the compact [1, 1/x]. Moreover, the function

x → →  ∞ 0 f (x, t)t s+1 dt
is of class C 1 as soon as the frontier {(ρ, y) :

f Λ (ρ, y) = λ, ρy ≤ 1 < y} is of class C 1 .
Now we turn to the quasi-inverse itself. For this we cite the following result (see [START_REF] Baladi | Euclidean algorithms are Gaussian[END_REF]). There is a real neighborhood Σ 1 of 1, an exponent ξ > 0, a real t 0 > 0 and a constant M > 0 such that, for s = σ + it, the operator (I -H s ) -1 satisfies the following :

(i) For σ ∈ Σ 1 , the operator (I -H s ) -1 has a unique pole, simple, and located at s = 1.

(ii) For σ ∈ Σ 1 and |t| > t 0 , the operator (I -H s ) -1 satisfies

||(I -H s ) -1 || 1,t ≤ M • |t| ξ
With this estimates, we expect the Mellin transform M[F (t); s] to be meromorphic on ℜs > -a for some a > 0, and a unique pole at s = 0 where

M[F (t); s] ∼ 1 s 12 π 2  1 0  ∞ 0 f (x, t)tdt  dx , (6.8)
due to (1.63).

The relation between the behavior of the Mellin transform on the singularities on the left of the convergence strip, and the asymptotics for F (t) as t → 0, are given precisely in Theorem 4 and Figure 4 from [FGD + 95].

In short, a singularity of type M[F (t); s] ∼ C s k+1 as s → 0 will translate into an asymptotic of type F (t) ∼ C (-1) k k! (log t) k as t → 0. This is true provided that M[F (t); s] can be extended meromorphically lef-twise to a strip ⟨-a, ∞⟩ where a > 0 and s = 0 is the sole singularity, and the transform also decreases fast enough on the lines c ± i∞ for c on a strip around 0 (which we expect due to Theorem 6.1).

Then we would deduce

lim n→∞ 1 n 2  k  m∈N k f  q k-1 q k , q k n  = lim t→0 F (t) = 12 π 2   [0,1]×[0,∞)
f (ρ, y)ydρdy , (6.9) which would yield again the results from Chapter 4 when f is of the form (6.6).

Riemann sums resembling the Perron-Frobenius operator

When considering the fixed n → ∞ model, the depth a k(α, n) of the continued fraction expansion needed is apparently "free", contrary to the fixed k → ∞ model where we actually prescribe it. This is why a priori we expect a relation with the quasi-inverse of the transfer operator.

It is not completely true, however, that the depth is "free"; we know that for almost every α there is the limit

lim 1 k log q k (α) = π 2 12 log 2 ,
hence we derive that for k = k(α, n) satisfying q k-1 (α) ≤ n < q k (α), we have

lim n→∞ log n k(α, n) = π 2 12 log 2 almost surely.
This motivates the intuition that k(α, n) is, in general, fairly close to 12 log 2 π 2 log n.

Hence, the idea now is to reverse the construction of Chapter 5. By choosing an interval [log n, log n + θ] to which log q k must belong, we "control" the size of k through n. With this in mind we have the following a Recall that k = k(α, n) is the unique positive integer satisfying q k-1 (α) ≤ n < q k (α).

SPECIAL FAMILIES OF SLOPES 161

Proposition 6.1. Let f be Riemann-integrable and θ > 0, then lim

N →∞  k≥1  m 1 ,...,m k ≥1 1 q 2 k f  q k-1 q k  [[N < log q k ≤ N + θ]] = 12θ π 2  1 0 f (x)dx .
Proof. This is just a generalization of Proposition 4.4. ■

Observe how the expression from Proposition 6.1 resembles that of the Perron-Frobenius operator H. When we choose θ to be the entropy θ = π 2 12 log 2 , which makes the expected number of continuants q k with q k ∈ (N, N + θ] be 1 by Proposition 4.4, we retrieve

lim N →∞  k≥1  m 1 ,...,m k ≥1 1 q 2 k f  q k-1 q k  [[N < log q k ≤ N + π 2 12 log 2 ]] = 1 log 2  1 0 f (x)dx .

Special families of slopes

Now we present the study of two important families of slopes: the rationals and the quadratic irrationals. It turns out that the method employed here for rationals and quadratic irrationals are very much related, and in fact, related to those of section 6.2.1. This is a subject of ongoing research and we hope to be able to develop a unified approach for the study of Q-functions for all 3 families of slopes (real, rational and quadratic irrational).

Eventually periodic words: α rational

We consider the rectangle R := [0, 1] × [1, ∞) and we recall that a Q-function Λ is associated with a function f Λ : R → R ≥0 when, given an irrational slope α ∈ [0, 1],

Λ(α, n) := f Λ  q k-1 (α) n , q k (α) n  , for n ∈ [q k-1 (α), q k (α)) .
The definition extends to a rational α of the form α = c/d with a coprime pair (c, d), as soon as the integer n satisfies n < d.

Given a fixed an integer n, we are interested in the distribution of the function (c/d) → → Λ(c/d, n). More precisely, we consider the subsets

Ω D = {(c, d) : 1 ≤ c ≤ d ≤ D; gcd(c, d) = 1} , R D (ϱ, n) =  (c, d) ∈ Ω D : Λ  c d , n  ≤ ϱ  ,
and we wish to study the distribution of the function Λ on the set

Ω D Pr D  (c, d) ∈ Ω D | Λ  c d , n  ≤ ϱ  = |R D (ϱ, n)| |Ω D | .
Our main expected result for the rationals is as follows:

Expected Theorem 6.2. Consider a continuant function Λ associated with a function f . Let the density ψ and the domain ∆ f (ϱ) be defined by

ψ : R → R, ψ(x, y) = 2 ζ(2) 1 y(x + y) , ∆ f (ϱ) = {(x, y) ∈ R | f (x, y) ≤ ϱ} .
Then, the distribution of the function Λ(•, n) on the set Ω D involves the coprime Riemann sum (see in Section 4.3.2)  R n [ψ; ∆ f (ϱ)] of step 1/n of the function ν over the domain ∆ f (ϱ) under the form

Pr D [Λ(•, n) ≤ ϱ] = ζ(2)  R n [ψ; ∆ f (ϱ)] + ϵ D (n, ϱ) ϵ D (n, ϱ) → D→∞ 0 .
Moreover, the coprime Riemann sum is related to the integral I[ν; ∆ f (ϱ)] of the function ψ over the domain ∆ f (ϱ) with the estimate

ζ(2)  R n [ψ, ∆ f (ϱ)] = I[ψ; ∆ f (ϱ)] + O  1 n 2  .
Note that this means that, as the bound D for the denominators increases, the distribution approaches the same exact distribution we have for the real numbers.

One further question we are interested in would be the following: could we get good mixed error bounds in D and n which would allow us to make both tend to infinite at the same time, but in some prescribed way?

Proof elements. We consider the subsets

ω d := {(c, d) : 1 ≤ c ≤ d; gcd(c, d) = 1}, r d (ϱ, n) :=  (c, d) ∈ ω d : Λ  c d , n  ≤ ϱ 
and the two generating functions With the two relations

Ω D =  d≤D ω d , R D (ϱ, n) =  d≤D r d (ϱ) ,
we remark that the probability of interest is expressed as a ratio, where the numerator involves the coefficients of the series F n,ϱ (s) whereas the denominator involves the coefficients of the series ζ(s -1)/ζ(s).

Here comes the key step of the argument. Once we have determined the partial quotients m = (m 1 , . . . , m k ) which make q k-1 (m) ≤ n < q k (m), we have all we need to compute our Q-function Λ; that is, any element α ∈ I m 1 ,...,m k will give the same value of Λ(α, n). Thus, any element in the image of h m 1 ,...,m k gives the same value of Λ n (provided that q k-1 (m) ≤ n < q k (m)).

A number from h m (I) is rational if and only if it is of the form c/d = h m 1 ,...,m k (λ/µ) for some integers 1 ≤ λ ≤ µ. We note that for m = (m 1 , . . . , m k )

h m 1 ,...,m k (λ/µ) = µ p k (m) + λ p k-1 (m) µ q k (m) + λ q k-1 (m) ,
and the right-hand side fraction is reduced if and only if λ/µ is reduced (i.e., gcd(λ, µ) = 1). We are only interested in the reduced denominator for our Dirichlet series (which is marked with s).

Therefore we may rewrite

F n,ϱ (s) =  k≥1  m∈N k  q k-1 (m) ≤ n < q k (m) , f Λ  q k-1 (m) n , q k (m) n  ≤ ϱ   (λ,µ):λ≤µ ,gcd(λ,µ) 1 (µ q k (m) + λ q k-1 (m)) s .
Here we could actually use the same ideas as before with coprime Riemann sums, and that was actually our first approach. There would be one coming from the pairs (q k-1 , q k ) which traverse all coprime pairs with q k-1 < q k , and another one for (µ, λ) inside.

We now explain an approach following principles similar to those of section 6.2.1. The principle is that our whole Dirichlet sum may be rewritten in terms of the quasi-inverse operator of the Euclidean dynamical system. Then we get a situation similar to that of section 6.2.1 but with Dirichlet series instead of a Mellin transform. The analogous asymptotics are the derived from an application celebrated Perron formula (see [START_REF] Apostol | Introduction to Analytic Number Theory[END_REF] or [START_REF] Tenenbaum | Introduction to analytic and probabilistic number theory[END_REF]).

We seek to rewrite the inner sum in terms of the quasi-inverse operator of the Euclidean dynamical system. In order to do this, the expressions involved will be rewritten in terms of inverse branches.

Each fraction λ/µ is produced uniquely as h(0) for an inverse branch g ∈ H ⋆ • {h 1 } (i.e., ending in a quotient 1, or we could also work with all inverse branches not ending in a quotient 1). For simplicity in the explanation we consider all branches g ∈ H ⋆ (we are going twice over every fraction except for 1/1). Next, we consider the inverse branch h = h m .

Notice that

1 (µ q k (m) + λ q k-1 (m)) s =   (h • g) ′ (0)   s/2 .
Finally, to get everything in terms of inverse branches, we must introduce an auxiliar function b working on the set of inverse branches (notice that this is well-defined) taking h m 1 ,...,m k to h m 1 ,...,m k-1 , i. With this auxiliary function, we notice that for m ∈ N k and g = h m ∈ H k , we have

q k (m) = |g ′ (0)| -1/2 , and q k-1 (m) = |(b(g)) ′ (0)| -1/2 .
For short, write

A g (x, n, ϱ) :=  |(b(g)) ′ (x)| -1/2 ≤ n < g ′ (x)| -1/2 , f Λ  |(b(g)) ′ (x)| -1/2 n , g ′ (x)| -1/2 n  ≤ ϱ  . (6.11)
Thus we get (forgetting about the (λ, µ) = (1, 1), hence the ∼ )

2F n,ϱ (s) ∼  h∈H ⋆ A h (0, n, ϱ)  g∈H ⋆   (h • g) ′ (0)   s/2 . (6.12)
Here we notice that h • g traverses all inverse branches of the form h • H ⋆ , and hence corresponds to the transfer operator

(I -H s/2 ) -1 • H [h],s/2 with H [h],s [f ](x) := |h ′ (x)| s f (h(x)).
Thus we write

2F n,ϱ (s) ∼  h∈H ⋆ A h (0, n, ϱ)(I -H s/2 ) -1 • H [h],s/2 [1](0) .

SPECIAL FAMILIES OF SLOPES 164

One step further

2F n,ϱ (s) ∼ (I -H s/2 ) -1   h∈H ⋆ A h (0, n, ϱ)H [h],s/2 [1]  (0) . (6.13)
Here the pole is found at s = 2, where the quotient with the pole of F (s) gives us

 h∈H ⋆ A h (0, n, ϱ)  I H [h],1 [1](t)dt =  h∈H ⋆ A h (0, n, ϱ) |I h | , (6.14)
the same expression from the "real case" from Chapter 4. We expect that it should be possible to combine the Perron formula with the Dolgopyat-Baladi-Vallée estimates (see Theorem 6.1) to assert that this actually is the limit of the probabilites as

P D [Λ(•, n) ≤ ϱ] as D → ∞.

Sturmian words and morphisms: α quadratic irrational

Now we get back to the quadratic irrationals introduced in Section 1.5, in particular to the reduced quadratic irrationals α (rqi for short), which are those whose continued fraction expansion is purely periodic. We recall that there is a natural notion of size ϵ(α) associated with such numbers α. Our objective is to study, in distribution, what happens with the recurrence quotient S(α, n) defined in (3.13), when α is drawn uniformly at random from the set K N = {α rqi : ϵ(α) ≤ N } with large N .

The size of a quadratic irrational and the model

The classical notion of size ϵ given in Equation 1.67 depends strongly on the more basic notion of size υ(α) -1 defined in (1.64), hence we start by reminding the definition of υ.

We recall that

υ(α) := k-1  i=0 T i (α) = |h ′ (α)| 1/2 ,
where h ∈ H k is the inverse branch associated with the minimal period m = (m 1 , . . . , m k ) of α, which has length k = p(α). We recall that ν is related to the growth of the continuants of α as we accumulate periods

υ(α) = lim ℓ→∞ q(m ℓ ) q(m ℓ+1 ) .
Defined υ, note that ϵ(α) = υ(α) -r(α) , with r(α) = 1 for even p(α), and r(α) = 2 for odd p(α).

Therefore, it will be enough to do the analysis for υ, as this will then translate into the results for ϵ. We consider, then, rather than K N , the sets

M N :=  α rqi : 1 υ(α) ≤ N  ,
and in our new model we shall pick α uniformly at random from M N rather than K N . We shall use henceforth P N and E N for the corresponding probabilities and expected values.

The generating functions

Primitive periods. As we consider all possible periods m = (m 1 , . . . , m k ), there are clearly periods that define the same periodic word. This is why we pick the minimal, so-called "primitive", periods: periods m = (m 1 , . . . , m k ) that are not themselves the power (repetition) of a smaller period.

We observe then that if P is the set of primitive periods, we have the decomposition

N ⋆ = ∞  ℓ=1 P ℓ , (6.15)
where P ℓ := {w ℓ : w ∈ P}. Indeed, any period m is a repetition of its smaller period, which is unique.

The expression (6.15) will be key, because working with the generating function over all periods in N ⋆ is in general easier much easier than working over P.

Working over all possible periods. So far we have defined υ over the r.q.i. α, but for the sake of having "nice" expressions for our GFs, it will be useful to extend it to words. We could think of a r.q.i. α as its primitive period (m 1 , . . . , m k ). Given now an arbitrary period m = (m 1 , . . . , m k ) which need not be primitive, we still define

υ(m) := |h ′ m (x * m )| 1/2 ,
and the previous properties that held for a r.q.i. α still hold for this new extension, namely

υ(m) = lim ℓ→∞ q(m ℓ ) q(m ℓ+1 ) , υ(m) = k-1  i=0 T i g (x * m ) .
We remark then the key multiplivative property

υ(m ℓ ) = (υ(m)) ℓ , (6.16)
for every m ∈ N ⋆ and ℓ ≥ 1.

Target generating functions. We wish to study the occurrence of S(n, x * m ) ≤ λ over all periods m ∈ N ⋆ that are primitive and 1 υ(x * m ) ≤ N . To study such an event, due to the Tauberian Theorem, we consider in first instance (we shall later adapt it!) the DGF

P n (s) :=  m∈P (υ(m)) s [[S(x * m , n) ≤ λ]] .
The decomposition in Equation 6.15 works its way into our final generating functions, giving

G n (s) :=  m∈N ⋆ (υ(m)) s [[S(x * m , n) ≤ λ]] = P n (s) +  ℓ≥2 P n (ℓs) .
The power to the ℓ in (6.15) then shifts the dominant singularities of our DGFs to the left, thanks to (6.16).

From this fact we deduce that the leading terms of the asymptotics for the DGF over N ⋆ and P coincide. Thus, generally, it will be enough to take all possible periods from N ⋆ .

The number of complete cycles ℓ

Our current plan, i.e., working with P n (s), actually is slightly "flawed". Let us recall briefly how S(α, n) is computed:

S(α, n) = 1 + q k-1 (α) n + q k (α) n ,
where k = k(α, n) is such that q k-1 (α) ≤ n < q k (α). Since q k (α) ≥ 2 (k-1)/2 for every α, then this means that k = k(α, n) ≤ 2 log 2 n + 2, which is fixed when n is fixed. On the other hand, whenever S(α, n) ≤ λ, then q k (α) ≤ λn and this implies that the quotients are bounded m i ≤ λn for all i = 1, . . . , k(α, n).

Hence only a finite number of primitive tuples m ∈ P which produce S(x * m , n) ≤ λ satisfy that k(x * m , n) is larger than the period |m| (the length of the tuple m). Thus for most of the periods m ∈ P, satisfying S(x * m , n) ≤ λ, we never make use of the periodicity of the continued fraction expansion of x * m in order to determine the value of S(x * m , n). In such a case we say that n occurs during the first period of x * m . This is not a desirable situation as this prevents us from observing the incidence of the periodic nature of the expansion on the probabilistic study.

We formalize this notion by introducing an appropriate index ℓ that gives the number of complete "cycles" or periods of m that are needed in the calculation of S(x * m , n).

To define what we mean by "needed in the calculation of S(α, n)", we say that a prefix m of the continued fraction expansion of α is needed in the calculation of S(α, n) if k(α, n) ≤ |m|. Definition 6.2 (Number of cycles ℓ). Given a tuple m = (m 1 , . . . , m p ) ∈ N p and an integer n ∈ N we define the number of cycles ℓ = ℓ(m, n) of m around n to be the unique non-negative integer ℓ such that q(m ℓ ) ≤ n < q(m ℓ m 1 . . . m p-1 ) is satisfied.

Suppose α = x * m , and that v = w 1 . . . w k is the prefix of m • m • . . . needed to compute S(α, n). Then we may decompose v = m ℓ u where u ̸ = ϵ is a prefix of m and we then write u ⪯ m. We distinguish two cases:

1. When ℓ = 0, the word v is a prefix of m and we may then complete the rest of the period after v as we like without having this change the value of S.

2. When ℓ > 0, the word v has interdependencies given by the period of m.

Generating function for the first cycle: ℓ = 0

Let us start by studying the probabilities with the added condition that ℓ = 0. This case is still interesting and introduces several tools used in the study of quadratic irrationals.

We recall that ℓ = 0 is equivalent to the condition k(x * m , n) ≤ |m|. Adding this condition to the definition of G n (s) gives a new DGF

F n (s) :=  m∈N⋆ (υ(m)) s [[S(x * m , n) ≤ λ , k(x * m , n) ≤ |m|]] . (6.17)
Here we introduce a w that will represent the actual (maximal

) prefix of m • m • m . . . needed to compute k(x * m , n), i.e., k(x * m , n) = |w|. Thus we write F n (s) =  m∈N⋆ (υ(m)) s  w:ϵ⪵w⪯m [[S(x * w , n) ≤ λ , k(x * m , n) = |w|]] , by our extra condition |w| = k(x * m , n) ≤ |m| (which implies S(x * w , n) = S(x * m , n)).

SPECIAL FAMILIES OF SLOPES 167

Note that reversing the sums gives

F n (s) =  w:ϵ⪵w [[S(x * w , n) ≤ λ , k(x * m , n) = |w|]]  m:w⪯m (υ(m)) s .
It turns out that one may actually express the sums with υ(m) in terms of the so-called trace of the transfer operator. On the other hand, the condition in the Iverson bracket may be rewritten in a more familiar form to get

F n (s) =  k≥1  w∈N k  1 + q k-1 (w) + q k (w) n ≤ λ , q k-1 (w) ≤ n < q k (w)   m:w⪯m (υ(m)) s . (6.18)
This equation is reminiscent of (6.12) from the rational case. The difference between the two is the presence of

υ(m) = |h ′ m (x * m )| 1/2 (this case!) instead of q(m) = |h ′ m (0)| 1/2
(rational case!). We are now going to rewrite this expression again in terms of a quasi-inverse. In order to do this we introduce the notion of the trace of an operator.

Generating the sizes: the trace of an operator In this section we cite [START_REF] Vallée | Dynamique des fractions continues contraintes priodiques[END_REF] and [START_REF] Cesaratto | Gaussian behavior of quadratic irrationals[END_REF] for the main properties of the trace of the transfer operator, as well as its components, over an appropriate space A ∞ (V). The space A ∞ (V) consists of functions that are analytic on a complex disc V and are continuous on its closure V.

Producing υ(m). We begin by explaining how to produce υ(m) for a fixed m ∈ N ⋆ . Consider the operator

H [m],s [g](x) := |h ′ m (x)| s g(h m (x)) .
It turns out that this "component operator" has the following eigenvalues (with multiplicity one) when acting on the space A ∞ (V)

|h ′ m (x * m )| s , (-1) |m| |h ′ m (x * m )| s+1 , (-1) 2|m| |h ′ m (x * m )| s+2 , . . .
To motivate the above eigenvalues, notice that that if λ is an eigenvalue of H [m],s corresponding to the eigenfunction g 1 , and if g 1 (x * m ) ̸ = 0 we have

λg 1 (x * m ) = H [m],s [g 1 ](x * m ) = |h ′ (x * m )| s g 1 (h m (x * m )) = |h ′ m (x * m )| s g 1 (x * m ) ⇒ λ = |h ′ m (x * m )| s . If g 1 (x * m ) = 0 but g ′ 1 (x * m ) ̸ = 0, differentiating we get λg ′ 1 (x * m ) = (-1) |m| |h ′ m (x * m )| s+1 g ′ 1 (h m (x * m )) = (-1) |m| |h ′ m (x * m )| s+1 g ′ 1 (x * m ) ⇒ λ = (-1) |m| |h ′ m (x * m )| s+1 .
and so on... On the space A ∞ (V), these operators are what is called "trace class": they have a trace that is the sum of the eigenvalues. Thus the trace equals: (υ(m)) 2s + smaller order series , (6.20) meaning that the "remainder" series has a larger half-plane of convergence (due to the exponent 2s + 2).

TrH [m],s = |h ′ m (x * m )| s 1 -(-1) |m| |h ′ m (x * m )| , and we deduce TrH [m],s = (υ(m)) 2s + O  (υ(m)) 2s+2  . ( 6
The argument (I -H s ) -1 • H [w],s of the trace in (6.20) is the series of all terms H [m],s with w ⪯ m. Indeed, this follows by composition: we start with v and the component (I -H s ) -1 tells us that afterwards we may complete as we please.

The singularity. We briefly mention how to get the dominant singularity of Tr

 (I -H s ) -1 • H [w],s  from (6.20).
Since the sum in H [w],s consists of just one term, it is enough to look for the dominant singularity of (I -H s ) -1 which is found at s = 1 where we have just the dominant eigenvector ψ g (x) := 1 log 2 1 1+x (the Gauss density)

(I-H s ) -1 •H [w],1 [ψ g ](x) ∼ 1 s -1 12 log 2 π 2 ψ g (x)  1 0 H [w],1 [ψ g ]dx =  1 s -1 12 log 2 π 2  Iw ψ g (x)dx  ψ g (x) , as s → 1. Thus 1 s-1 12 log 2 π 2  Iw ψ g (x)
dx approximates the dominant eigenvalue in the trace, the rest we expect to be of much smaller absolute value as s → 1.

Going back to (6.18), each  m:w⪯m (υ(m)) s is approximated by 1 s/2-1 12 log 2 π 2  Iw ψ g (x)dx around their pole s = 1. This gives a pole for the whole series

F n (s) ∼ 1 s -2 24 log 2 π 2  k≥1  w∈N k  1 + q k-1 (w) + q k (w) n ≤ λ , q k-1 (w) ≤ n < q k (w)   Iw ψ g (x)
dx , (6.21) where we remark that  Iw ψ g (x)dx = P µg (α ∈ I w ), where P µg is the probability when the input slope is chosen according to the Gauss measure dµ g (x) = dx/(1 + x) from the whole of I.

Results for ℓ = 0

We state our main expected result (unpublished) concerning the first cycle ℓ = 0. Expected Theorem 6.3. Consider the set K of reduced quadratic irrationals α, endowed with the size α → → 1 υ(α) . Given N , we consider the uniform distribution on the set M N of reduced quadratic irrationals α with 1/υ(α) ≤ N , giving a probability measure which we denote P N . Let S n (α) = S(α, n) be the recurrence quotient defined in Chapter 3, Equation 3.13, k(α, n) be the sole positive integer k such that q k-1 (α) ≤ n < q k (α), and p(α) be the period of the quadratic irrational α. Then, as N → ∞ we have lim

N →∞ P N (S(α, n) ≤ λ , k(α, n) ≤ p(α)) = P µg (S n ≤ λ) ,
where P µg is the probability when the input slope is chosen according to the Gauss measure dµ g (x) = dx/(1 + x) from the whole of I.

Furthermore, as n → ∞ we have that P µg (S n ≤ λ) converges to the limit distribution from Theorem 4.1.

We comment briefly on the proof elements. From (6.21) we have the dominant singularity for F n (s), defined in (6.17), at s = 2. Then we recall that the dominant singularity of F n (s), where we sum over all possible prefixes m ∈ N ⋆ coincides with that of the same sum but over the primitive periods in P. At this point we expect to prove the result by showing a combination of the Perron formula and the Dolgopyat-Baladi-Vallée estimates (see Theorem 6.1).

Finally, the fact that P µg (S n ≤ λ) converges to the limit distribution from Theorem 4.1 follows from the "independence from the initial distribution" explained in Section 4.5.3. In fact, this result for the quadratic irrationals was the main motivation for our study of Section 4.5.3.

Of course, we should be able to derive analogous results for other LQ-funtions.

The case ℓ → ∞ and future work

Our study for the case ℓ → ∞ is very much work in progress. Our experiments, and intuitions, suggest strongly that there is some kind of stationary behavior as we will shortly explain.

In this section we consider a Q-function Λ(α, n) with associated function f . Recall that this means that

Λ(α, n) = f (q k-1 (α)/q k (α), q k (α)/n) where k = k(α, n) is the sole positive integer satisfying q k-1 (α) ≤ n < q k (α).
In the case ℓ → ∞ we wish to study the averages

A ℓ (m) := 1 q(m ℓ+1 ) -q(m ℓ ) q(m ℓ+1 )-1  n=q(m ℓ ) Λ(x * m , n) (6.22)
over a period m ∈ N ⋆ . Note that the condition on n makes the index from Section 6.3.5 be fixed and equal to ℓ, and further, these are all the possible n giving the number of complete turns ℓ. There are sound intuitive reasons for choosing to study these averages, which we now explain.

Scaling properties as ℓ → ∞. We recall that υ(m) = lim ℓ→∞ q(m ℓ ) q(m ℓ+1 ) , moreover, we can show that for u ∈ N ⋆ we have

lim ℓ→∞ q(m ℓ ) q(m ℓ u) =   h ′ u R  x * m R   1/2 , (6.23)
where we recall that u R and m R denote the mirror image of u and m. All of this means that, in a way, the continuants q behave almost multiplicatively.

Example 6.1. We begin by exploiting the regularity of Λ over each interval  q k (m), q k+1 (m)  , thus decompose

1 q(m ℓ+1 ) -q(m ℓ ) q(m ℓ+1 )-1  n=q(m ℓ ) Λ(x * m , n) = 1 q(m ℓ+1 ) -q(m ℓ ) (ℓ+1)|m|-1  k=ℓ|m| q k+1 -1  n=q k Λ(x * m , n) ,
and we substitute using our formula for Λ

q k+1 -1  n=q k Λ(x * m , n) = q k+1 -1  n=q k f  ρ k (x * m ), q k+1 n  ≈ q k+1 (x * m )  1/ρ k+1 (x * m ) 1 f (ρ k+1 (x * m ), y) dy y 2 , where ρ k (x) := q k-1 (x)
q k (x) .

SPECIAL FAMILIES OF SLOPES 170

The previous integral approximation allows us to estimate the result for a given w fairly fast (for the experiments in particular), but we hope that it will also allow for a nice alternative expression for our final dirichlet generating functions.

At this point we expect

lim ℓ→∞ 1 q(m ℓ+1 ) -q(m ℓ ) q(m ℓ+1 )-1  n=q(m ℓ ) Λ(x * m , n) = υ(m) 1 -υ(m)  ϵ≺u⪯m   h ′ u R  x * m R   -1/2  1 h u R (x * m R ) 1 f  1 h u R (x * m R ) , y  dy y 2 ,
due to (6.23). Thus the averages for a fixed m ∈ N ⋆ would converge.

Closing comments. There are several potential generating functions we have considered.

For conciseness, let us write, for h, g ∈ H ⋆ , that h ≤ g if and only if h = h m 1 and g = h m 2 where m 1 ⪯ m 2 .

Our current conjecture is that a good choice of a DGF should be

G [∞] n,λ (s) =  h∈H ⋆  g≤h B g (0, nx *  h , λ)(υ(h)) s , (6.24)
where υ(h m ) := υ(m),  h is the mirror of h, and B g (x, n, λ) is an analog of A g (x, n, λ) from (6.11), defined by

B g (x, n, λ) :=  |(e(g)) ′ (x)| -1/2 ≤ n < |g ′ (x)| -1/2 , f Λ  |(e(g)) ′ (x)| -1/2 n , g ′ (x)| -1/2 n  ≤ ϱ  ,
where e is the "ending" (if b was beginning in (6.11)) defined by e(h m 1 ,...,m k ) = h m 2 ,...,m k .

There is a sound reason for this choice. The functions A g and B g are sort of dual, if g = h ℓ • g with g ≤ h, then we may consider the mirror to consider g first,through the remarkable identity

A g (0, n|(h ℓ ) ′ (0)| 1/2 , λ) = B g (  h ℓ (0), n, λ) .
Thus, the natural generating function for the ℓ-th tour, namely

G [ℓ] n,λ (s) =  h∈H ⋆  h ℓ ≤g≤h ℓ+1 A g (0, n|(h ℓ ) ′ (0)| 1/2 , λ)(υ(h)) s , (6.25) notice the scaling |(h ℓ ) ′ (0)| 1/2 = q(h ℓ ) -1
, gives naturally rise to (6.24) as ℓ → ∞.

Then we expect the generating function from (6.24) to be dealt with as in the previous cases, being expressed as the sum of traces of expressions involving the quasi-inverse. Our conjecture is that we will get the same dominant pole as before, thus giving a similar result following (maybe) a combined application of the Perron formula and Theorem 6.1. This is part of the ongoing work towards a unified vision of all of the three cases (real, rational and quadratic irrational).

Part III

Studies in Arithmetics The Continued Logarithm expansion has been studied from an Ergodic point of view by Chan [START_REF] Chan | The asymptotic growth rate of random Fibonacci type sequences[END_REF][START_REF] Chan | The asymptotic growth rate of random Fibonacci type sequences[END_REF], which parallels the classical study of continued fractions presented in Chapter 1. In particular, he shows that the associated dynamical system is ergodic and exhibits its invariant density. The motivation of Chan is somewhat different: he shows that for almost every sequence {a 1 , a 2 , . . .} of natural numbers (we will see what he meant by this), if we define a Fibonacci-like sequence f k by f -1 = 0, f 0 = 1, a 0 = 0 and

f k = 2 a k f k-1 + 2 a k-1 f k-2 for k ≥ 1, then lim n→∞ 1 n log f n = 1.30022988 . . .
This property is in fact analogous to Proposition 1.10 and we give an explicit constant for the above limit. More recently, the continued logarithm has been considered by Borwein et al. [START_REF] Borwein | Generalized continued logarithms and related continued fractions[END_REF][START_REF] Borwein | Continued logarithms and associated continued fractions[END_REF] The idea of Gosper gives rise to an algorithm for computing the gcd of two integers. Shallit describes this algorithm in [START_REF] Shallit | Length of the continued logarithm algorithm on rational inputs[END_REF], considering purely as an algorithm for computing the continued logarithm expansion of a rational number, and not a gcd-algorithm, and studies the worst case (when the expansion is longest). This algorithm has two advantages: first, it can be calculated starting from the most representative bits, and uses very simple operations (subtractions and shifts) as explained in the above citation of Gosper; it does not employ divisions. Second, as the quotients intervening in the associated continued fraction are powers of two 2 a , we can store each of them with log 2 a bits. This gives a compelling argument in favor of the small complexity of the algorithm, both in terms of computation and storage.

Shallit [START_REF] Shallit | Length of the continued logarithm algorithm on rational inputs[END_REF] performs the worst-case analysis of the algorithm, and studies the number of steps K(p, q), and the total number of shifts S(p, q) that are performed on an integer input (p, q) with p < q: he proves the inequalities K(p, q) ≤ 2 log 2 q + 2, S(p, q) ≤ (2 log 2 q + 2) log 2 q , and exhibits instances, the family (1, 2 n -1), which show that the previous bounds are asymptotically optimal, namely K(1, 2 n -1) = 2n -2, S(1, 2 n -1) = n(n -1)/2 + 1.

Following Shallit's study of the worst-case [START_REF] Shallit | Length of the continued logarithm algorithm on rational inputs[END_REF], he proposed to us to perform the average-case analysis of the algorithm (equivalently, the expansion over rationals), and we answered his question in [START_REF] Rotondo | Analysis of the continued logarithm algorithm[END_REF].

We considered the set Ω N which gathers the integer pairs (p, q) with 0 ≤ p ≤ q ≤ N , endowed with the uniform probability, and we study the mean values E N [K] and E N [S] as N → ∞. We prove that these mean values are asymptotically linear in the size log N , and exhibit their precise asymptotics for N → ∞,

E N [K] ∼ 2 H log N, E N [S] ∼ log 3 -log 2 2 log 2 -log 3 E N [K] .
The constant H is related to the entropy of an associated dynamical system and

H = 1 2 log 2 -log 3   π 2 6 + 2  k≥1 (-1) k k 2 2 k -(log 2)(3 log 3 -4 log 2)   . (7.1)
This entails numerical estimates (validated by experiments) for the mean values

E N [K] ∼ 1.49283 log N, E N [S] ∼ 1.40942 log N ,
and the mean number of pseudo-divisions is about half the maximum a from Shallit [START_REF] Shallit | Length of the continued logarithm algorithm on rational inputs[END_REF].

a Note 2/ log 2 . = 2.885 . . . Definition 7.1 (CL system). Let I := (0, 1) be the unit interval, we define the shift map T c : I → I, called the CL map, by

T c (x) = 2 -a 1 (x) x -1 , a 1 (x) =  log 2 1 x  , (7.5)
where {•} denotes the fractional part {y} := y -⌊y⌋. Then the inverse branches are given by

h a (x) = 1 2 a (1 + x) , a ≥ 0 . (7.6)
We further define the digits a k (x) by

a k (x) = a 1 (T k-1 c x) , (7.7)
for k ≥ 2.

Observation 7.1. We note that for x = p/q this gives

T c  p q  = q -2 a 1 p 2 a 1 p ,
so, for fractions, we may think of T c as a map on the pairs (p, q) which maps

(p, q) → → (p ′ , q ′ ) := (q -2 a 1 p, 2 a 1 p) ,
where a 1 (p/q) = max{k ∈ N : 2 k p ≤ q}. This is how Shallit in [START_REF] Shallit | Length of the continued logarithm algorithm on rational inputs[END_REF] computes the coefficients of the continued fraction expansion. It may be seen as a gcd-algorithm as we will soon explain in Section 7.1.2.

The CL system (I, T c ) is displayed on the left of the figure below, along with the shift S : I → I which gives rise to the CL system by induction on the first branch. The map S is a mix of the Binary and Farey maps, as its first branch comes from the Binary system, and the second one from the Farey system. On the right, the usual Euclid dynamical system (defined from the Gauss map T g ) is derived from the Farey shift by induction on the first branch.

The continued logarithm algorithm

In Observation 7.1 we explained how the CL map can be seen as a map on pairs (p, q), representing respectively the successive numerators and denominators. In this section we describe the gcd algorithm derived from this.

The algorithm, described by Shallit in [START_REF] Shallit | Length of the continued logarithm algorithm on rational inputs[END_REF], is a sequence of (pseudo)-divisions: each division associates a pair (p, q) c with p < q to a new pair (r, p ′ ) (where r stands for "remainder") defined as follows q = 2 a p + r, q ′ = 2 a p, with a = a(p, q) := max{k ≥ 0 | 2 k p ≤ q} .

This is a gcd algorithm; indeed gcd(r, q ′ ) = gcd(q -2 a p, 2 a p) is equal to gcd(2 a p, q), and this latter gcd may differ from gcd(p, q) only in a power of 2. Thus the CL algorithm determines the odd part of gcd(p, q) whereas the even part is directly determined by the dyadic valuations of p and q, which amounts to reading the trailing 0s in binary.

Here we show a first example of the execution of the algorithm for (13, 31)

c Our notations are not the same as in the paper of Shallit as we reverse the roles of p and q.

i a i 2 a i q i q i+1 (2 a i q i ) 2 (q i+1 ) 2 δ(2 a i q i ) δ(q i+1 ) δ( g 7.1: Execution for the input pair (p, q) = (31, 75). Here  g i = gcd(2 ai q i , q i+1 ). The dyadic valuation δ( g i ) seems to linearly increase with i, with the asymptotic δ( g i ) ∼ δ(q i+1 ) ∼ i/2 as i → ∞. a p q r 2 a p 1 13 31 5 26 2 5 26 6 20 1 6 20 8 12 0 8 12 4 8 1 4 8 0 8

Matrix form. This transformation is conveniently written in matrix form: the pair (p, q) gives a new one (r, 2 a p) satisfying

 p q  = N a  r 2 a p  , with N a =  0 2 -a 1 1  = 2 -a M a , M a =  0 1 2 a 2 a  . (7.8)
The CL algorithm begins from an input pair (p, q) with p < q. It lets the initial pair be (q 1 , q 0 ) := (p, q), and then performs a sequence of divisions

 q i+1 , q i  T = N a i+1  q i+2 , 2 a i+1 q i+1  T ,
and stops after k = K(p, q) steps on a pair of the form (0, 2 a k q k ). The complete execution of the algorithm uses the set of matrices N a defined in (7.8), and expands the input as

 p, q  T = N a 1 • N a 2 • • • N a k  0, 2 a k q k  T .
The rational input p/q is then written as a continued fraction according to the linear fractional transformations (LFTs for short) h a associated with matrices N a or M a ,

p q = 2 -a 1 1 + 2 -a 2 1 + 2 -a 3 1 + . . . 2 -a k 1 = h a 1 • h a 2 • • • • • h a k (0) , with h a : x → → 2 -a 1 + x . (7.9)
We note that h a , for a ≥ 0, are the inverse branches of the CL map as in Definition 1.3.

Moreover, thanks to the equality (7.4), it is possible to change our definition of a(p, q) to make the last exponent a k be 0 (and the last quotient to be 1). Indeed, according to our definition of a(p, q), the last exponent is necessarily a k > 0, and through (7.4) we make it into the form on the right-hand side .

Figure 7.1 describes the execution of the algorithm for the initial pair (31, 75). Note that this example is related to our previous example (13, 31). Indeed, we get the pair (62, 13) = (2 • 31, 31) after one iteration.

Worst case analysis. It is simple enough to see that the algorithm terminates; indeed if 2 a p = q the algorithm surely ends, else the next second entry of the pair, q ′ = 2 a p, is less than q. It is not trivial, however, to find its worst case behavior. Shallit [START_REF] Shallit | Length of the continued logarithm algorithm on rational inputs[END_REF] proved that the number of steps K(p, q) is at most 2 log 2 q + O(1) by proving that the size of the entries at least half every two steps. This is also the idea in a classical simplified proof that Euclid's algorithm terminates in O(log q) steps [DPV08], but it is more involved in the case of the CL algorithm: Shallit proves his result by showing that (p, q) → → p 2 + q 2 is decreasing, roughly dividing its size by 2 for each step, when one reduces (p, q) dividing by the gcd when possible.

The worst case for the Euclidean algorithm is given by the pairs of the form (f k , f k+1 ) where the (f k ) are the Fibonacci numbers, and the final depth is k, see for example [START_REF] Thomas | Introduction to algorithms[END_REF]. This follows from choosing the quotients m i so as to make the continuants q i as small as possible. As f k ∼ φ k / √ 5 we see that the worst case for the Euclidean algorithm is actually (log q)/ log φ rather than 2 log 2 q + O(1). In the case of the CL algorithm, however, the bound 2 log 2 q + O(1) is asymptotically tight as Shallit demonstrated by considering the family (p, q) = (1, 2 n -1). Indeed, every two steps we have

(1, 2 n -1) → → a=n-1 (2 n-1 -1, 2 n-1 ) → → a=0 (1, 2 n-1 -1) .
We remark that here the worst-case is not given by minimizing the quotients (or exponents) 2 a at each step. This is due to the fact that there are other cancellations taking place: the natural continuants q k (x) for the CL expansion do not naturally produce reduced fractions as we shall see in Section 7.2.1 below.

The CL dynamical system

In this section we point out several properties of the CL dynamical system.

The continuants of the CL expansion

Each number x ∈ I admits an infinite continued fraction expansion derived from the dynamical system, called its CL expansion. When truncated at depth k, the expansion of x becomes finite, as in (7.9), and represents a rational p/q, which we assume to be irreducible. As x belongs to a unique fundamental interval J of depth k, of the form J = h(I) with h ∈ H k , the pair (k, x) determines a unique LFT h := h a of depth k, and the rational p/q equals h(0).

The k-tuple a defines a matrix M a (see equation (7.8)) and an integer pair (P, Q), called the continuant pair, defined by (P, Q) T := M a (0, 1) T . The equality P Q = p q clearly holds, but the pair (P, Q) is not necessarily coprime. Nevertheless, gcd(P, Q) is a power of 2, as follows from taking determinants |det(M a )| = 2 a 1 +•••+a k . Moreover, the integer R(Q) := Q/ gcd(P, Q), called the reduced continuant, is an important parameter actually dictating the quality of the rational approximation of x given by the truncation of its CL expansion.

The recurrence of the continuant pairs. The continuant pairs satisfy a recurrence analogous to that of Proposition 1.1 for the convergents of the Euclidean Algorithm. To avoid ambiguity, we will write P (a) and Q(a) for the continuant pair associated with a tuple a = (a 1 , . . . , a k ). In an abuse of notation, we will also write P k (a) and Q k (a) to denote P (a 1 , . . . , a k ) and Q(a 1 , . . . , a k ), respectively, when a is a tuple of length at least k (maybe an infinite sequence). Similarly, when given an irrational x we will also write P k (x) and Q k (x) for P (a 1 (x), . . . , a k (x)) and Q(a 1 (x), . . . , a k (x)).

The following result is actually the starting point definition used by Chan [START_REF] Chan | The asymptotic growth rate of random Fibonacci type sequences[END_REF].

Proposition 7.1. Consider non-negative integers a 1 , . . . , a k then we have the following recurrence for the continuant pairs of the CL expansion

P (a 1 , . . . , a k ) = 2 a k P (a 1 , . . . , a k-1 ) + 2 a k-1 P (a 1 , . . . , a k-2 ) , (k ≥ 2) Q(a 1 , . . . , a k ) = 2 a k Q(a 1 , . . . , a k-1 ) + 2 a k-1 Q(a 1 , . . . , a k-2 ) , (k ≥ 1)
where we take P 0 = 0, P 1 = 1 and Q -1 = 0, Q 0 = 1.

Proof. The definition (P (a), Q(a)) T := M a (0, 1) T is not the simplest when it comes to proving this recurrence, but if we extend it slightly to 2 × 2 matrices

 2 a k P (a 1 , . . . , a k-1 ) P (a 1 , . . . , a k ) 2 a k Q(a 1 , . . . , a k-1 ) Q(a 1 , . . . , a k )  = M a = M a 1 • M a 2 • . . . M a k , (7.10)
we easily get the result. Now we explain (7.10). It is clear, from our definition, that the second column in the left-hand side matrix is correct. As for the first column, notice that the equalities

M a = (M a 1 . . . M a k-1 )M a k , M a k =  0 1 2 a k 2 a k  ,
imply that the first column of M a is the second column of (M a 1 . . . M a k-1 ) multiplied by 2 a k , hence yielding the first column on the left-hand side of (7.10). ■ Note that from (7.10) we see at once that |P (a 1 , . . . , a k-1 )Q(a 1 , . . . , a k ) -Q(a 1 , . . . , a k-1 )P (a 1 , . . . , a k )| = 2 a 1 +...+a k-1 .

(7.11)

The continuants and the inverse branches. Another important result noted by Chan in [START_REF] Chan | The asymptotic growth rate of random Fibonacci type sequences[END_REF] concerns the inverse branches of the CL system. The following proposition tells us how to express the inverse branches in terms of the continuant pairs. The reader familiar with linear fractional transforms (LFT) will note at once that, since h a is the LFT associated with M a , this result follows at once from the expression (7.10) as the multiplication of matrices corresponds to the composition of LFTs .

Proposition 7.2. Consider non-negative integers a 1 , . . . , a k . Then, the inverse branch

h a (x) = h a 1 • . . . • h a k (x) ,
can be written in terms of the continuant pairs as follows

h a (x) = P (a 1 , . . . , a k ) + x • 2 a k P (a 1 , . . . , a k-1 ) Q(a 1 , . . . , a k ) + x • 2 a k Q(a 1 , . . . , a k-1 ) . (7.12)
The expression in (7.12) tells us a lot regarding the CL system. In particular it gives us an expression for the length of the fundamental intervals and the speed of convergence of the truncated expansions.

Corollary 7.1. Consider non-negative integers a 1 , . . . , a k . Then, the length of the fundamental interval I a := I a 1 ,...,a k , associated with the CL system, is given by

|I a | = 2 a 1 +...+a k Q(a 1 , . . . , a k ) • (Q(a 1 , . . . , a k ) + 2 a k Q(a 1 , . . . , a k-1 ))
.

The gcd of the continuant pair. Contrary to the case of classical continued fractions, the continuant pair, seen as a rational number, is not reduced. In fact, it follows at once from (7.11) that the greatest common divisor gcd(P k , Q k ) divides 2 a 1 +...+a k-1 , hence being a power of two, but in general it is not 1. Indeed, when a k (x), a k-1 (x) > 0, the gcd is not one, and this happens infinitely many often for almost every x.

In fact, we have the following conjecture regarding the continuant pairs of a real number Conjecture. For almost every x ∈ I the limit

lim k→∞ 1 k log 2 gcd(P k (x), Q k (x)) = 1 2 (7.13) holds. 3
This conjecture is based on experimental evidence, with the convergence to 1/2 being apparently faster for the expected values

lim k→∞ 1 k E x [log 2 gcd(P k (x), Q k (x))] = 1 2 .
For the moment we can offer the following bounds, showing that the greatest common divisor increases at least at an exponential rate almost surely.

Proposition 7.3. For almost every x ∈ I lim inf k→∞ 1 k log 2 gcd(P k (x), Q k (x)) ≥ 1 2 E µ [A] . = 0.30542 . . . ,
where A(x) = min{a 1 (x), a 1 (T c x)} and µ is the probability measure on I given by the density ψ c (x) = 1 log(4/3) 1 (x+1)(x+2) with respect to the Lebesgue Measure. This proposition demonstrates that a big gcd is the rule rather than the exception.

Corollary 7.2. For almost every x ∈ I we have

lim sup k→∞ 1 k log 2 gcd(P k (x), Q k (x)) ≤ log(3/2) log(4/3) - 1 2 E µ [A] . = 1.1040 . . . ,
where A(x) = min{a 1 (x), a 1 (T c x)} and µ is the probability measure on I given by the density ψ c (x) = 1 log(4/3) 1 (x+1)(x+2) with respect to the Lebesgue Measure. The proof of Proposition 7.3 employs Birkhoff's Ergodic Theorem, and relies strongly on two observations that we will now explain. On the other hand, Corollary 7.2 follows directly from (7.11) by Proposition 1.11 and Proposition 7.3. Let δ(n) denote the dyadic valuation of n, i.e., the greatest integer such that 2 δ(n) |n. We know that the greatest common divisor of P k and Q k is a power of two (similarly for gcd(Q k , Q k-1 ) and gcd(P k , P k-1 ) in fact), therefore it suffices to study the evolution of δ(P k ) and δ

(Q k ). Then log 2 gcd(P k , Q k ) = min{δ(P k ), δ(Q k )}.
The first key observation for Proposition 7.3 is that the continuant pairs of an irrational x ∈ I satisfy

P k (x) = Q k-1 (T c x) , (7.14)
for all k ≥ 1.

Equation 7.14 implies that, if we could prove that for almost every x we had lim 1 k δ(Q k (x)) = 1 2 , then the same limit would hold with P k instead of Q k . Therefore if lim 1 k δ(Q k (x)) = 1 2 holds for almost every x, then lim 1 k log 2 gcd(P k (x), Q k (x)) = 1 2 for almost every x. This observation also holds when taking lim sup or lim inf instead of a limit, and changing 1/2 for another constant.

The second observation is given by the following lemma.

Lemma 7.1. Suppose that for a given h ≥ 0 we had δ

(Q k-1 ) ≥ h and δ(Q k-2 ) ≥ h. If a k-1 , a k ≥ t we have δ(Q k ) ≥ h + t and δ(Q k+1 ) ≥ h + t,
and further δ(Q j ) ≥ h + t for all j ≥ k.

Proof. Follows at once from Proposition 7.1. ■ From Lemma 7.1 we see that

δ(Q k (x)) ≥ min{a k (x), a k-1 (x)} + min{a k-2 (x), a k-3 (x)} + . . . ,
from which the result follows by applying Birkhoff's Theorem to

T 2 c = T c • T c , recall a k (x) = a 1 (T k-1 c x).

The Perron Frobenius operator

The Perron Frobenius operator (recall subsection 1.2.4) for the CL dynamical system is given explicitly by

H[f ](x) :=  h∈H |h ′ (x)| f (h(x)) =  1 1 + x  2  a≥0 2 -a f  2 -a 1 + x  . (7.15)
This operator describes the evolution of densities : if f is the initial density, H[f ] is the density after one iteration of the system (I, T c ). The invariant density ψ c is a fixed point for H and satisfies the functional equation

ψ c (x) =  1 1 + x  2  a≥0 2 -a ψ c  2 -a 1 + x  . (7.16)
We recall that in Observation 1.5 we pointed out that the CL map T c is Ergodic with respect to the Lebesgue measure, a result proved by Chan in [START_REF] Chan | The asymptotic growth rate of random Fibonacci type sequences[END_REF], who showed the explicit invariant CL density ψ c (x) given by ψ c (x) = 1 log(4/3) 1 (x + 1)(x + 2) .

However, Chan did not provide an explicit expression for the entropy. We obtain here such an expression, with a precise study of the transfer operator of the system.

We introduce two (complex) parameters t, v in (7.15), and deal with a perturbation of the operator H, defined by

H t,v [f ](x) :=  h∈H |h ′ (x)| t d(h) v f (h(x)) =  1 1 + x  2t  a≥0 2 a(v-t) f  2 -a 1 + x  . ( 7
= E -D, E = E ψ [2| log x|], D = (log 2) E ψ [a] , (7.18)
(here, the function a associates with x the integer defined with the Iverson bracket a(x)

:= a • [[x ∈ h a (I)]].
The constants A is the entropy of the system, and E, D admit explicit expressions

E = 1 log(4/3)   π 2 6 + 2  k≥1 (-1) k k 2 2 k   , D = (

Costs and model for the algorithm

The main interesting costs associated with a finite expansion, as in (7.9), are defined via the associated inverse branch (an LFT) h ∈ H k and mainly involve the continuant pair (P, Q), associated with h, together with the absolute value of the determinant of the LFT h, denoted by d(h).

Generating functions for our main costs

We recall that for the Euclidean dynamical system, if h(0) = p/q is the reduced fraction, then |h ′ (0)| = q -2 , giving back our reduced denominator. For the CL dynamical system this is not so simple. We want to be able to produce the reduced continuants R(Q), which correspond to the size of our input, in terms of h ′ and h so as to use the transfer operator.

Let us look at an inverse branch h ∈ H k . We note that by Proposition 7.2 its derivative gives |h ′ (0)| = d(h)/Q 2 . Here we wish to obtain R(Q) = Q/ gcd(P, Q). Since the gcd is a power of two, we have gcd(P, Q) = 2 min{δ(P ),δ(Q)} where δ(q) denotes the dyadic valuation of q. Also, we recall, d(h) is a power of two. Hence we introduce the dyadic numbers Q 2 .

For an integer q, δ(q) denotes the dyadic valuation, i.e., is the greatest integer k for which 2 k divides q.

The dyadic norm | • | 2 is defined on Q with the equality |a/b| 2 := 2 δ(b)-δ(a) . The dyadic field Q 2 is the completion of Q for this norm. See [START_REF] Koblitz | p-adic numbers, p-adic analysis, and zeta-functions[END_REF] for more details about the dyadic field Q 2 .

Dyadics numbers can be realized as series of the form y = 2 a 1 + 2 a 2 + . . . where a 1 < a 2 < . . . are integers (maybe negative). For instance we remark that -1 = 1 + 2 + 4 + 8 + . . . Indeed, notice that A n := (1 + 2 + . . . + 2 n ) is a Cauchy sequence because |A n -A m | 2 = 2 -min{n,m} and hence the limit A = lim A n exists. Then 1 + A n = 2 n+1 which tends to 0, thus A = -1.

The next result describes provides alternative expressions for these costs.

Proposition 7.4. Consider the function

G 2 : Q 2 → R + (called the gcd map) equal to G 2 (y) = min(1, |y| -2 2 ), namely G 2 (y) = 1 for |y| 2 ≤ 1, G 2 (y) = |y| -2 2 for |y| 2 > 1 . (7.20)
The main costs associated with the CL expansion of a rational h(0)

Q, g(P, Q) := gcd(P, Q), R(P, Q) = Q/gcd(P, Q), |Q| 2 , are all expressed in terms of the quadruple (|h ′ (0)|, |h ′ (0)| 2 , d(h), G 2 [h(0)]) as follows Q -2 = |h ′ (0)|/d(h), |Q| -2 2 = d(h) |h ′ (0)| 2 , R -2 (Q) = |h ′ (0)| |h ′ (0)| 2 G 2 [h(0)], g 2 (P, Q) = d(h) |h ′ (0)| 2 G 2 [h(0)] .
Proof. One has (by definition) As g(P, Q) is a power of 2, and using the function G 2 defined in (7.20), one has

P/Q = h(0), Q -2 = |h ′ (0)|/d(h), r(Q) -2 = g 2 (P, Q)/Q 2 . Cost C Cost c = log C Quadruple γ C Constant M (c) Numerical value of M (c) d(h) σ (0, 0, 1, 0) D . = 0.97693 . . . Q 2 q (-1, 0, 1, 0) A + D . = 2.6004 . . . g 2 (P, Q) ϱ (0, 1, 1, 1) B + D . = 1.26030 . . . R 2 (P, Q) r (-1, -1, 0, -1) A -B . = 1.34015 . . . |Q| -2 2 q 2 (0, 1, 1, 0) B + D . = 1.26030 . . .
g 2 (P, Q) = min(|P | 2 , |Q| 2 ) -2 = |Q| -2 2 min(1, |P/Q| -2 2 ) = |Q| -2 2 G 2 (P/Q)
We conclude with the equalities :

|Q| -2 2 = |h ′ (0)| 2 /|d(h)| 2 , d(h) • |d(h)| 2 = 1. ■
Any cost C from Proposition 7.4 admits an expression of the form

|h ′ (0)| t |h ′ (0)| u 2 d(h) v G 2 [h(0)] z .
The quadruple (t, u, v, z) associated with the cost C is denoted as γ C . Moreover, as these costs C are expected to be of exponential growth with respect to the depth of the CF, we will work with their logarithms c = log C. Figure 7.2 summarizes the result.

Probabilistic model for the rational case

We now change our context and deal with sets of coprime d integer pairs Ω := {(p, q) : 0 < p < q, gcd(p, q) = 1}, Ω N := {(p, q) : 0 < p < q ≤ N, gcd(p, q) = 1} .

The set Ω N is endowed with the uniform measure, and we wish to study the mean values E N [C] of the main parameters C on Ω N . We focus on parameters which describe the execution of the algorithm, that can be "read" from the CF(p/q) built by the algorithm as in (7.9).

We apply standard analytic combinatorics methodology (see Chapter 2) and we work with (Dirichlet) generating functions (DGFs in short). We first consider the plain Dirichlet generating function (recall (2.13))

S(s) :=  (p,q)∈Ω 1 q 2s = ∞  q=1 φ(q) q 2s = ζ(2s -1) ζ(2s) , (7.21)
but we also associate a cost C : Ω → R + with two generating functions, the bivariate DGF and the cumulative DGF, namely

S C (s, w) :=  (p,q)∈Ω e wC(p,q) q 2s , S C (s) :=  (p,q)∈Ω C(p, q) 1 q 2s = ∂ ∂w S C (s, w)     w=0 . (7.22)
The expectation E N [C] is now expressed as a ratio which involves the sums Φ N (S), Φ N (S C ) of the first N coefficients of the Dirichlet series S(s) and S C (s), namely,

E N [C] = Φ N [S C ]/Φ N [S] . (7.23)
d This restriction can be easily removed and our analysis extends to the set of all the integer pairs.

THE EXTENDED DYNAMICAL SYSTEM. 184

We know from principles of Analytic Combinatorics that the dominant singularity of a DGF (here its singularity of largest real part) provides precise information about its coefficients, in the case of DGFs for the cumulative Φ N [C]. Here this transfer from the analytic behavior of the DGF to the asymptotics of its coefficients is provided by Theorem 2.3, due to Delange.

We thus need an alternative expression of these series, from which it is possible to obtain information regarding the dominant singularity, which will be transferred to the asymptotics of coefficients.

Proposition 7.5. The Dirichlet generating S(s) and its bivariate version S C (s, w) relative to a cost C : Ω → R, admit alternative expressions e involving the gcd map G 2 from Proposition 7.4

S(s) =  h∈H ⋆ •h 0 |h ′ (0)| s |h ′ (0)| s 2 G s 2 • h(0) , S C (s, w) =  h∈H ⋆ •h 0 e wC(h) |h ′ (0)| s |h ′ (0)| s 2 G s 2 • h(0) .
For any cost C ∈ {σ, q, ϱ, r, q 2 } studied in Proposition 7.4, the general term of the bivariate DGF is

|h ′ (0)| t |h ′ (0)| u 2 d(h) v G z 2 • h(0)
. The quadruple (t, u, v, z) = γ C (s, w), corresponding to a cost C, linearly depends on the two exponents s and w. The following table describes the quadruple γ C (s, w) for our costs, together with its derivative with respect to w at w = 0 denoted as γ C .

Cost C Quadruple γ C (s, w)

Quadruple γ C σ (s, s, w, s) (0, 0, 1, 0) q (s -w, s, w, s) (-1, 0, 1, 0) ϱ (s, s + w, w, s + w) (0, 1, 1, 1) r (s -w, s -w, 0, s -w) (-1, -1, 0, -1) q 2 (s, s -w, w, s) (0, -1, 1, 0) Dynamical analysis. At this point we look for an alternative form for our generating functions in terms of the transfer operator of the dynamical system which underlies the algorithm. Here, it is not possible to obtain such an alternative expression if we stay in the real "world". This is why we will add a component to our system which allows us to express parameters with a dyadic flavor. It will be possible to express our DGFs in term of a (quasi-inverse) of an (extended) transfer operator, and relate their dominant singularity to the dominant eigenvalue of this extended transfer operator.

We then obtain our main result: We will prove that the mean values E N [C] of our costs of interest are all of order Θ(log N ), and satisfy precise asymptotics that involve three constants A, B, D: the constants A and D come from the real word, and have been previously defined in (7.18) and (7.19), but there arises a new constant B that comes from the dyadic world and describes the behavior of the logarithm of the gcd. See the precise statement in Theorem 4.1.

7.4 The extended dynamical system.

In this section, we extend the CL dynamical system, adding a new component to study the dyadic nature of our costs. We then introduce the corresponding transfer operators. It is then possible to express the generating functions in terms of the quasi-inverses of this transfer operator.

Extension of the dynamical system

We will work with a two-component dynamical system: its first component is the initial CL system, to which we add a second (new) component which is used to "follow" the evolution of dyadic phenomena during the e We recall that the last exponent is 0 by convention.

execution of the first component.

We consider the extended interval I := I × Q 2 . We define a new shift T : I → I from the characteristics of the old shift T defined in (7.5). As the branches T a , h a are LFTs with rational coefficients, they are well-defined on Q 2 , and they are moreover bijections from Q 2 ∪ {∞} to Q 2 ∪ {∞}.

Finally, each branch T a of the new shift T is defined via the equality T a (x, y) := (T a (x), T a (y)) on the fundamental domain I a := I a × Q 2 , and the shift T a is a bijection from I a to I := I × Q 2 whose inverse branch h a : (x, y) → → (h a (x), h a (y)) is a bijection from I to I a .

Measures on Q 2

To properly speak of the transfer operator, or even the Perron Frobenius operator, we must first define a base measure which extends the Lebesgue measure from the one-component CL system. By "base" measure we mean the measure with respect to which the densities (the Perron Frobenius operator works on densities!) are to be integrated to define probabilities. This base measure is key, as it leads to the form of the Perron Frobenius operator of the system, and it is fundamental that there be a change of variable formula.

The Haar measure. Given an appropriate (Hausdorff locally compact) abelian topological group (G, +, 0) there is a unique measure ν (up to scalars) that is translation invariant, i.e., ν G (A + v) = ν G (A) for every Borel set A ⊂ G and v ∈ A. This measure is called the Haar measure of the group and is finite on each compact set of G. For a proof of this fact see [START_REF] Ramakrishnan | Fourier analysis on number fields[END_REF].

We consider three basic subdomains of Q 2 B := Q 2 ∩ {|y| 2 < 1}, U := Q 2 ∩ {|y| 2 = 1}, C := Q 2 ∩ {|y| 2 > 1}, (7.24) and we will denote by Z 2 the closed unit ball Z 2 := U ⊎ B.

Since Q 2 is locally compact, there is such a Haar measure ν 0 on Q 2 .We may normalize our Haar measure ν 0 further so that ν 0 (U) = 1/3 (see [START_REF] Ramakrishnan | Fourier analysis on number fields[END_REF]).

If our measure is to be translation invariant, we must have ν 0 (2 k U) = 2ν 0 (2 k+1 U) (7.25) for every k ∈ Z.

Observation 7.2. The measure ν 0 satisfies ν 0 (2 k U) = (1/3)2 -k for any k ∈ Z. Since the sets {2 k U : k ∈ Z} actually form a basis for the dyadic topology, this characterizes the measure ν 0 uniquely. Thus, our measure ν 0 cannot be finite and does not give a probability on Q 2 . The measure ν 0 actually satisfies a change of variable formula akin to that of the Lebesgue integral. Here we first explain it for quotients of linear functions, which in particular tells us that the change of variables holds for the inverse branches h of the CL system.

Lemma 7.2. Let ν 0 be a translation invariant measure on Q 2 , and let h be a non-constant rational function h(y) = ay+b cy+d . Then for any measurable F : Q 2 → C with F ≥ 0 or F ∈ L 1 (ν 0 ), we have the change of variables formula  Proof. It is enough, by compositions, to prove the result when h is of the form h(y) = y + b, h(y) = ay or h(y) = 1/y. By working with linear combinations of simple sets, it is enough to prove the results for the case in which F is the characteristic function of a set of the form B := t + 2 k Z 2 with 2 -k < |t| 2 , as these generate the σ-algebra. This is a classical strategy in measure theory (see e.g., [Fol99]).

The case h(y) = y + b is just the translation invariance of the measure ν 0 . Consider then h(y) = ay first.

Then  Note that B/a = t/a + (2 k /a)Z 2 = t/a + (2 k |a| 2 )Z 2 which by (7.25) and the translation invariance has measure ν 2 (B/a) = |a| -1 2 ν(B). Thus we get our change of variables for this case. Lastly consider the case h(y) = 1/y. We claim that it is enough to prove the result for B = 2 k Z 2 , i.e., taking t = 0. Indeed, assume the result holds for t = 0 and any k. Consider t ̸ = 0, then we will have

 Q 2 |y| -2 2 F (1/y)dν 0 (y) = ∞  j=-∞ 2 2j  2 j U 1 t+2 k Z 2 (1/y)dν 0 (y) = ∞  j=-∞ 2 2j  2 -j U |y| -2 2 1 t+2 k Z 2 (y)dν 0 (y) ,
where we first decomposed Q 2 into the disjoint union of (2 j U) j , and then applied our assumption. Now (t + 2 k Z 2 ) ∩ (2 -j U) is not empty only when |t| 2 = 2 j and so the intersection is the whole t + 2 k Z 2 . Thus, considering the only non-zero term, for which |t| 2 = 2 j , we have

 Q 2 |y| -2 2 F (1/y)dν 0 (y) = ∞  j=-∞ 2 2j ×  2 -j U |y| -2 2 1 t+2 k Z 2 (y)dν 0 (y)  = |t| 2 2 × (|t| -2 2 ν 0 (t + 2 k Z 2 )) ,
thereby proving the result for t ̸ = 0. Now we prove that the result holds for B = 2 k Z 2 with k ∈ Z. Indeed

 Q 2 |y| -2 2 F (1/y)dν 0 (y) = ∞  j=-∞ 2 2j  2 j U 1 2 k Z 2 (1/y)dν 0 (y) = ∞  j=-∞ 2 2j ν 0  (2 j U) ∩ (2 -k Z 2 )  ,
and here (2 j U) ∩ (2 -k Z 2 ) = 2 j U when j ≤ -k and is empty otherwise. Thus, applying (7.25) we deduce A function f : Q 2 → Q 2 is continuously differentiable if and only if there is a continuous R : Q 2 ×Q 2 → Q 2 such that f (x) -f (y) = R(x, y)(x -y) for all x, y ∈ Q 2 . Then we define f ′ (x) := R(x, x). We remark that for the case of the rational functions from Lemma 7.2 both notions coincide.

Theorem 7.1. Let g : Q 2 → Q 2 be a continuously differentiable bijection satisfying g ′ (y) ̸ = 0 for all y.

Then for a function F ∈ L 1 (Q 2 , ν 0 ), we have the change of variable formula  The proof of this result, given in [START_REF] Schikhof | Ultrametric calculus, volume 4 of Cambridge Studies in Advanced Mathematics[END_REF] for ultrametrics, goes through two steps. First, there is a key local invertibility theorem stating that for sufficiently small balls B around a point a, the image g(B) is a ball of radius |g ′ (a)| 2 diam(B) around g(a). Then the proof concludes by noticing that |g ′ | 2 is locally constant.

Thus the proof relies strongly on the "ultrametric" properties of Q 2 . It is true, however, that even though the proofs look different from the surface, the main proof steps are similar to those of the Lebesgue measure (see e.g., in [START_REF] Tom | Mathematical analysis[END_REF]). It is simple enough to see that this defines probability measure on Q 2 .

Proposition 7.6. The measure ν is a probability measure on Q 2 .

Proof. We need to verify that ν(Q 2 ) = 1. Note that ν 0 (Z 2 ) = 1/3 (ν 0 (U) + ν 0 (2U) + . . .) = 2/3. Measure for the extended system Now, given the probability ν on Q 2 we can define our probability for the extended system. This will be the product measure dρ(x, y) := dλ Leb (x) × dν(y) .

(7.28)

Density transformer and transfer operator

We now consider the "Perron Frobenius operator" H associated with the extended system. The density transformer reads as follows: given a function F ∈ L 1 (I, ρ), it returns a new function defined by We will focus on costs described in Figure 7.2: we thus deal with operators associated with quadruples γ C (s, w) defined in Proposition 7.5, and in particular with the quadruple (s, s, 0, s), and its associated operator H s := H s,s,0,s . The DGF  S C (s) defined in (7.22) is obtained with taking the derivative of the bivariate DGF with respect to w (at w = 0); it is thus written with a double f quasi inverse which involves the plain operator H s , separated "in the middle" by the cumulative operator H s,(C) , namely

 S C (s) ≍ J s • (I -H s ) -1 • H s,(C) • (I -H s ) -1 [1](0,

Functional Analysis

This section is devoted to the study of the quasi-inverses (I -H s ) -1 intervening in the expressions of the generating functions of interest. We deal with a delicate context: even though the inverse branches are contracting on the interval I, they are not contracting on Q 2 , just contracting on average. We first define an appropriate functional space on which the operators are proven to act and admit dominant spectral properties. This will prove that the quasi-inverse (I -H s ) -1 admits a pole at s = 1, and we study its residue, which gives rise to the constants that appear in the expectations of our main costs.

Lasota-Yorke for the classical CL dynamical system

We kick off this section by explaining why the CL dynamical system, that is, the system with just the real component, is so well-behaved. This good behavior will end up extending to the extended system.

The following Lemma shows that the transfer operator H t operating over C 1 (I), defined by Moreover, the integral I a (t) satisfies I a (1) = 2 -1 2 -at , I a (t) ≤ 2 -1 2 -at (t ≥ 1), I a (t) ≤ 2 1-2t 2 -at (t ≤ 1)

This admits a generalization to k-uples a := (a 1 , a 2 , . . . , a k ) and leads to the Lasota-Yorke bound,

|H k t [f ]| 1 ≤ (1 + 2k|t|)|f | 0 + ϱ k |f | 1
that holds for ℜt = 1. Here, ϱ is the contraction ratio, and we have used the fact that |h ′′ (x)| ≤ 2k|h ′ (x)| for any branch h of depth k.

Functional space

The delicate point of the dynamical analysis is finding a good functional space. It must surely be a subspace of L 1 (I, ρ). Here, we know that, in the initial CL system, the transfer operator H s acts nicely on the space of continuously differentiable functions C 1 (I). As in our case it is the real part of the system that leads the evolution, we will just ask for some sort of integrability condition over Q 2 .

For a function F defined on I, the main role will be played by the family of "sections" F y : x → → F (x, y) which will be asked to belong to C We are interested in determining the (or a sufficiently large) set of quadruples (t, u, v, z) for which the operator H t,u,v,z defined in (7.30) is bounded on F and, moreover, is analytic with respect to the quadruple (for the analytic perturbation!).

As we will deal mainly with integrals arising from a change of variables, it will be important to underline the following property of the inverse branches h Before moving on to the corresponding results, we motivate the constraint u = z which we will impose on our domain for (t, u, v, z). Such a constraint is not a problem (and we claim it is necessary) when it comes to the concrete cases of our GFs (recall Proposition 7.5).

Given R : Q 2 → [0, ∞), we consider the integral Why consider u = z . Assume, for the sake of motivating the need for the equality u = z, that both u and z were real numbers (else we would take the real parts).

First consider the case u > z. Then we would have h a (U) ⊂ C. This means that for the integral over h a (U) we have G 2 (x) = |x| -2 2 and get an integral which is |x| 2(u-z) times our target R(x)G 2 (x), but the factor |x| 2(u-z) is unbounded! If we had u < z, then the factor multiplying the integral over h a (C) will give us a divergent series, even if we could compare the corresponding integral with  Q 2 R(x)G 2 (x)dν 0 (x). = G z-1 2 (x). Indeed, whenever x ∈ h a (B) ∪ h a (U) we have |x| 2 ≥ 2 a ≥ 1. For the third, the factor |x| 2(u-z) 2 vanishes, and we may have a large (G 2 (x)) z-1 only when x ∈ h a (C) ∩ C and ℜz-1 is negative. By definition of h a we have 1 < |x| 2 < 2 a , whence |G z-1 2 (x)| ≤ max{1, 2 2aℜ(1-z)| }. We conclude the ensuing discussion with the following lemma. Proof. The only thing we have not explained is the second bound. For this we use our expression for J a,u [R] as a sum of three integrals. Notice that differentiating in u the first 2 terms produces a factor -a × (log 2).

For the third integral we have that |log G 2 (x)| ≤ 1 + 2(log 2)a is satisfied, while the derivative of 2 -a(1-u) also gives a term with a factor a. This yields the inequality. ■

We are now ready to state the key result concerning our domain.

Proposition 7.7. For a triple (t, u, v) ∈ C 3 satisfying the conditions ℜ(t) > 0 and ℜ(t -v -|u -1|) > 0, the operator H t,u,v,u acts on F and is analytic with respect to the triple (t, u, v).

Proof. We divide the proof into two parts: the proof that the operator acts on F, and the proof that it depends analytically on the triples (t, u, v).

The operator acts on the space. Observe that by the triangle inequality when ℜt > 0 , as |h ′ (x)| ≤ 2 -a . For our given conditions, the series  a 2 -a(ℜ(t-v-|1-u|)) converges. We must now consider ∥H t,u,v,u [F ]∥ 1 . By differentiating we find that Now we note again that |h ′ a (x)| ≤ 2 -a , take sup x and apply Lemma 7.4. After the integration on y ∈ Q 2 with the measure dν(y) = G 2 (y)dν 0 (y), we get

∥H t,u,v,u [F ]∥ 1 ≤ 2|t| ∞  a=0 2 -aℜ(t-v-|1-u|) ∥F ∥ 0 + ∞  a=0 2 -aℜ(t-v-|1-u|+1) ∥ ∂ ∂x F ∥ 0 .
This last inequality implies that the operator is bounded, as then

∥H t,u,v,u [F ]∥ ≤ (2|t| + 1)  ∞  a=0 2 -aℜ(t-v-|1-u|)  × ∥F ∥ ,
and the series converges over our domain.

The operator depends analytically on the triple. The analycity will follow from the fact that the series of the term-wise derivatives belong to F.

Observe that differentiating H t,u,v,u [F ](x, y) with respect to t gives Of course, log |h ′ a (x)| = -a • (log 2) + O(1) in the variable a, and the rest proceeds as before, showing that this partial derivative gives a bounded operator. Indeed, the additional factor a does not change the convergence/divergence region of the series  a 2 a(ℜv+|1-u|-ℜ(t)) . With respect to v we have an analogous situation. Thus let us get to the interesting case: differentiating with respect to u. It is here that we need the second inequality from Lemma 7.4. From Lemma 7.4 we deduce

    ∂ ∂u H t,u,v,u [F ](x, y)     0 = ∞  a=0 2 -aℜ(t-v)     ∂ ∂u J a,u [y → → |F y | 0 ]     ≤ 4 ∞  a=0
(1 + a)2 -a(ℜ(t-v)-|1-u|) ∥F ∥ 0 ,

where the series converges again on the same domain. And for the other norm ∥ • ∥ 1 we have, as in the previous part when we considered ∂ ∂x ,

    ∂ ∂u H t,u,v,u [F ](x, y)     1 ≤ 2|t| ∞  a=0 2 -aℜ(t-v)     ∂ ∂u J a,u [y → → |F y | 0 ]     + ∞  a=0 2 -aℜ(1+t-v)     ∂ ∂u J a,u [y → → |F y | 1 ]     ,
and the boundedness follows again from Lemma 7.4 and the convergence of the series. ■ Proposition 7.8. The operator H s := H s,s,0,s acts on F for ℜs > 1/2. Moreover for each s with ℜs > 1 the spectral radius of H s is strictly less than 1. The next result describes some of the main spectral properties of the operator on the space F. Assertion (a) entails that the k-th iterate of the operator behaves as a true k-th power of its dominant eigenvalue. Then, as stated in (c), its quasi-inverse behaves as a true quasi-inverse which involves its dominant eigenvalue.

Proposition 7.9. The following properties hold for the operator H t,u,v,u , when the triple (t, u, v) belongs to a neighborhood V of (1, 1, 0).

(a) At (t, u, v, u) = (1, 1, 0, 1), the operator H t,u,v,u coincides with the density transformer H 1 . The operator H 1 has a unique dominant eigenvalue equal to 1, the corresponding eigenvector is the invariant density Ψ and the projection is given by the integration with respect to the meas ure ρ.

(b) There is a unique dominant eigenvalue with multiplicity one, separated from the remainder of the spectrum by a spectral gap, and denoted as λ(t, u, v), with a (normalized) dominant eigenfunction Ψ t,u,v and a dominant eigenmeasure ρ t,u,v for the dual operator.

(c) The estimate holds for any function F ∈ F with ρ[F ] ̸ = 0, (I -H t,u,v,u ) -1 [F ](x, y) ∼ λ(t, u, v) 1 -λ(t, u, v) Ψ t,u,v (x, y) ρ t,u,v [F ] ,

as (t, u, v) → (1, 1, 0).

(d) For ℜs = 1, s ̸ = 1, the spectral radius of H s,s,0,s is strictly less than 1.

The third result describes the Taylor expansion of λ(t, u, v) at (1, 1, 0), and makes precise the behavior of the quasi-inverse described in (c).

Proof.

(a) We already know that the Perron Frobenius operator H of the CL system presents a spectral gap, with a dominant eigenvalue 1 that is simple, and no other eigenvalue on the unit circle. We know that H 1 inherits the Lasota-Yorke bound from that of H. Then, since H 1 is actually an extension of H to two-variable functions, the density transformer H 1 of the extended system will inherit this spectral gap.

(b) There is a Lasota-Yorke bound, inherited from Lemma 7.3, for the H 1,1,0,1 in F with the two norms ∥ • ∥ 0 and ∥ • ∥ 1 . The unit ball in (F, ∥ • ∥) is precompact on (F, ∥ • ∥ 0 ) again by the Arzelà-Ascoli Theorem, and we apply Hennion's Theorem, yielding the quasi-compactness of H t,u,v,u .

(c) Follows from classical principles as in subsection 1.4.7.

(d) We assume that there exists a complex number s of the form s = 1 + it, t ̸ = 0, with t real, for which H s has a spectral radius equal to 1. Then, due to the Lasota-Yorke inequality satisfied by H s , the operator H s is quasi-compact, and therefore it admits an eigenvalue of modulus 1. We follow the same first steps as in "Dynamical Sources in Information Theory: Fundamental intervals and Word Prefixes" [START_REF] Vallée | Dynamical sources in information theory: fundamental intervals and word prefixes[END_REF] Proposition 9 [basic case] that prove that the following holds

    1 2 a (1 + x a ) 2     it = 1
for any a ≥ 0 and involves the quadratic irrational x a ∈ [0, 1] that is the fixed point of the branch h a .

Remark two facts:

(i) each x a is a non rational element of the quadratic field Q( √ 1 + 2 2-a ), and

(ii) we have the inequality 0 < x a < 2 -a .

FUNCTIONAL ANALYSIS 194

Then, for any a large enough, there exists an integer k a for which

    k a 2π t log 2 -a     = log 2 (1 + x a )
, 0 < log 2 (1 + x a ) ≤ K2 -a for some constant K .

This proves that the sequence k 2a -2k a tends to 0; it is thus equal to 0 for a large enough. This now entails that the two irrational quadratics x 2 a and x 2a are equal. This is not possible since Q(

√ 1 + 2 2-a ) ∩ Q( √ 1 + 2 2-2a ) = Q, at least when a > 1 is odd.
This is intuitively obvious, but the proof is not immediate. This is actually significantly simpler to prove by contradiction for a odd, which can be done as we may pick any sufficiently large odd a. The contradiction arrives after squaring and comparing dyadic valuations.

Going back, now knowing that α, γ ̸ = 0, and squaring

α 2 (1 + 2 2-a ) = γ 2  1 + 2 2-2a  + 2γ(δ -β)  1 + 2 2-2a + (δ -β) 2 ,
and therefore δ = β, as √ 1 + 2 2-2a ̸ ∈ Q. Thus let us look at the possibility δ = β. Then

α  1 + 2 2-a = γ  1 + 2 2-2a ,
for nonzero integers α, γ. Then α 2 (2 a + 4)2 a = γ 2 (2 2a + 4) , and this is nonsense when a is odd and a > 1 as the left hand side has an odd dyadic valuation, while the right hand side has an even valuation. ■

We have precise information concerning the eigenvalue λ(t, u, v) when (t, u, v) is near (1, 1, 0).

 Ψ(x, y) =  1 1 + x  2     1 1 + y     2 2  a≥0  Ψ  2 -a 1 + x , 2 -a 1 + y  .
Comparing to Equation 7.16, we "lose" the factor 2 -a in the sum, and so we have not succeeded in finding an explicit formula for Ψ. We do not know how to evaluate the integral E 2 defined in Proposition 7.10(b). However, we conjecture the equality D -B = log 2, from experiments of the same type as those described in Figure 7.1. This would entail an explicit value for the entropy H of the extended system, We then obtain our final result:

Theorem 7.2. The mean values E N [c] for c ∈ {K, σ, q, ϱ, r, q 2 } on the set Ω N are all of order Θ(log N ) and admit the precise following estimates,

E N [K] ∼ 2 H log N, E N [c] ∼ M (c) • E N [K]
, for c ∈ {σ, q, ϱ, r, q 2 } .

The constant H is the entropy of the extended system. The constants H and M (c) are expressed with a scalar product that involves the gradient ∇λ of the dominant eigenvalue at (1, 1, 0) and the beginning  γ C of the quadruple γ C associated with the cost c. More precisely

H = ⟨∇λ, (-1, -1, 0)⟩, M (c) = ⟨∇λ,  γ C ⟩ .
The constants M (c), in terms of the derivatives of λ(t, u, v) as defined in Proposition 7.10, are exhibited in Figure 7. We now show that the two DGFs S(s) and  S C (s) satisfy the hypotheses of the Tauberian theorem. The two expressions obtained in (7.31) and (7.32) involve quasi-inverses (I -H s ) -1 , a simple one in (7.31), a double one in (7.32). First, Propositions 7.8 with 7.9(b), and 7.9(d) prove that such quasi-inverses are analytic on ℜs ≥ 1, s ̸ = 1. Then Proposition 7.9(c), together with Equation 7.32, shows that S(s) and  S C (s) have a pole at s = 1, of order 1 for S(s), of order 2 for  S C (s). We now evaluate the dominant constants: first, the estimate holds, 1 -λ(s, s, 0) ∼ (A -B)(s -1) = H(s -1) .

Second, with Proposition 7.9(c), the DGFs S(s) and  S C (s) admit the following estimates which both involve the constant a = J[Ψ](0, 0), namely,

S(s) ∼ a H(s -1) ,  S C (s) ∼ a H 2 (s -1) 2 ρ  H 1,(C) [Ψ]
 .

We now explain the occurrence of the constant M (c): we use the definition of the triple  γ C (s, w), the definition of the cumulative operator H 1,(C) as the derivative of the bivariate operator H γ C (s,w) at (s, w) = (1, 0), and the fact that H 1,1,0,1 = H 1 is the density transformer. This entails the sequence of equalities, . In both cases there had been preceding studies on the worst case (see [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF] and [START_REF] Shallit | Length of the continued logarithm algorithm on rational inputs[END_REF]), and we, on the other hand, strive to study them probabilistically. This is where Dynamical Analysis actually comes in, as the objects we consider can be described in a common framework mixing continued fractions and dynamical systems.

Studies in Combinatorics on Words

We have first studied the recurrence function R α (n) of Sturmian words, a fundamental quantity dictating the worst "waiting time" to find all factors of a given length n, in two different probabilistic models. The fundamental link between Sturmian words and continued fractions is given by Morse and Hedlund in [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF], and this means that the Euclidean system is the dynamical system underlying here. For our first model, given a Sturmian word of slope α, and a sequence (µ k ), we have associated a sequence of indices n k (lengths of factors) defined by their barycentric position µ k inside [q k-1 (α), q k (α)). We then have elucidated the role played by the position in the behavior of the recurrence of a random Sturmian word when α is drawn uniformly at random. In this case the dynamical analysis involves the powers of the density transformer of the underlying system, and constitutes a starting point to our work. Our second model constitutes another take on the problem, with a somewhat orthogonal viewpoint. We fix the length n of the factors and pick α at random, then we study the distribution of the recurrence function. This study a priori differs widely from the previous one; it employs elementary properties of continued fractions as well as coprime Riemann sums over unbounded domain. This idea led us to the concept of Q-functions, of which we have shown several examples, other than the recurrence quotient, in relation to continued fractions. This study involves the generalization and adaptation of ideas which have appeared in [START_REF] Florin | On the distribution of the Farey sequence with odd denominators[END_REF] (for coprime Riemann sums) and [START_REF] Ustinov | On the statistical properties of elements of continued fractions[END_REF].

Work in progress. We have since considered the possibility of the slope α belonging to a particular (but important) set, such as the rational numbers (yielding periodic words) or the quadratic irrationals (related to words produced by morphisms). These lead to models mixing the ideas from our two previous studies and requiring several other key concepts such as the transfer operator of the system and the trace. We have obtained partial results in this direction, and individuated the need to introduce an index ℓ, counting the number of complete periods of the continued fraction expansion of α, for the case of quadratic irrationals. The stationary behavior when ℓ → ∞ is an attractive question we are working on. Futhermore, the work may lead to a unification of all three contexts (real, rational and quadratic irrational).

Studies in Number Theory

We have studied the Continued Logarithm Algorithm on average and analyzed in particular the number of pseudo divisions, and the total number of shifts. Thus we have answered a question posed by Shallit [START_REF] Shallit | Length of the continued logarithm algorithm on rational inputs[END_REF] following his analysis on the worst-case. Our work makes crucial use of Dynamical Analysis, but requires a twist: the introduction of a dyadic component to the transfer operator. This dyadic component is necessary to account for the complex dyadic behavior of the algorithm; even if the input pair is coprime, the greatest common divisor of the working pair increases as the algorithm progresses, always being a power of two. We have shown that this system possess the spectral properties we require to carry out our dynamical analysis, namely, there is a spectral gap which follows from the fact that the one-component original system is well-behaved. Thus we complete our analysis deriving constants which depend on the entropy of the system.

Work in progress and open questions. We would like to obtain an explicit expression for the elusive invariant density of the extended system. This would entail a proven expression for the entropy of the dynamical system, for which we have provided a conjectural value. This conjectural value is sound in the sense that it related to a more basic conjecture (see (7.13)), stating that 1 k log 2 gcd(q k , q k+1 ) → 1 2 , which seems reasonable, and fits in very well with the experiments performed.

It is also surely possible to analyze the bit complexity of the algorithm, notably in the case when one eliminates the rightmost zeroes when shared by the two q ′ i s (as suggested by Shallit). Such a version of this algorithm may have a competitive bit complexity that merits a further study.

There exist two other gcd algorithm that are based on binary shifts, all involving a dyadic point of view: the Binary Algorithm, and "the Tortoise and the Hare" algorithm, already analyzed in [START_REF] Vallée | Dynamics of the binary euclidean algorithm: Functional analysis and operators[END_REF] and [START_REF] Benoî T Daireaux | The Lyapunov tortoise and the dyadic hare[END_REF]; however, the role of the binary shifts is different in each case. The strategy of the present algorithm is led by the most significant bits, whereas the strategy of the "Tortoise and the Hare" is led by the least significant bits. The Binary algorithm adopts a mixed strategy, as it performs both right-shifts and subtractions. We have the project to unify the analysis of these three algorithms, and better understand the role of the dyadic component in each case.

Finally, we are working on the so-called "real case" for the Continued Logarithm expansion. We consider a random real in the unit interval and, a given number k of steps in its continued fraction expansion, we wish to describe the evolution of the main parameters, notably gcd(q k-1 , q k ), associated with this expansion, when the depth k tends to ∞. We wish to prove that generic reals have behavior akin to that of rationals p/q from the previous model on the rationals.

Figure 1 :

 1 Figure 1: Le schéma de la thèse.

  6 (a) Le flux de travail de la combinatoire analytique. (b) Le flux de travail de l'analyse dynamique.

Figure 2 :

 2 Figure 2: La combinatoire analytique et son prolongement à l'analyse dynamique.

Figure 3 :

 3 Figure 3: Morse et Hedlund ont relié les mots de Sturm aux codages discrets de droites avec une pente irrationnelle α.

  An application of the spectral decomposition to the values of the digits . . . . . . . 1.4.7 The transfer operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.5 Continued fractions: Rationals and quadratics irrationals . . . . . . . . . . . . . . . . . . . 1.5.1 Probabilistic model for rational numbers . . . . . . . . . . . . . . . . . . . . . . . . 1.5.2 Asymptotic probabilistic properties of digits for rational numbers . . . . . . . . . . 1.5.3 Probabilistic model for quadratics irrationals . . . . . . . . . . . . . . . . . . . . .

Figure 4 :

 4 Figure 4: The diagram of this thesis.

Figure 5 :

 5 Figure 5: Analytic Combinatorics and the extension to Dynamical Analysis.

Figure 6 :

 6 Figure 6: Morse and Hedlund connected Sturmian words to discretized lines of irrational slope α.

,

  Continued fractions are naturally equivalent to the execution of the Euclidean algorithm. Indeed, let us pick a rational number a/b. One step of the expansion gives: + {b/a} , and here {b/a} = b mod a a so that our original pair (a, b) has become (b mod a, a) after one iteration, exactly like in the Euclidean Algorithm. As we know, the Euclidean algorithm certainly terminates, as the first entry always decreases strictly until becoming 0 (clearly b mod a < a), thus giving a finite representation where m 1 , m 2 , . . . are the quotients of the divisions in the Euclidean algorithm applied to (a, b)!

Figure 1

 1 Figure 1.2: The shift map of the binary dynamical system

For a bounded

  operator A : (B, ∥ • ∥ B ) → (B, ∥ • ∥ B ) we say, equivalently, that A acts on the Banach space. Consider a bounded linear operator A : (B, ∥ • ∥ B ) → (B, ∥ • ∥ B ) acting on our Banach space.

1. 4 .

 4 REAL PROBABILISTIC FRAMEWORK 54 The function f is said to be of bounded variation, BV for short, on [a, b] if and only if V b a (f ) < ∞. The set of all functions of bounded variation on [a, b] is denoted by BV([a, b]).

  Bounded distortion) There exists a constant C > 0 such that |h ′′ (x)| ≤ C|h ′ (x)| for all h ∈ H and x ∈ I. Then the associated Perron Frobenius operator H acting on BV(I) is quasi-compact with R e (H) ≤ γ 1/m . Proof. Use the ideas from Observation 1.11 and (1.53) along with the weak norm ∥ • ∥ 1 and the strong norm ∥ • ∥ BV . The only thing we have to prove is that the closed unit ball of (BV(I), ∥ • ∥ BV ) is compact on (L 1 (I), ∥ • ∥ 1 ) but this follows at once from Helly's selection Theorem. ■ Example 1.10 (Continued fractions on C 1

  Consider first the norm | • | defined by |g| = sup x∈I |g(x)|, and the stronger norm ∥ • ∥ defined by ∥g∥ = |g| + |g ′ |. The norm ∥ • ∥ makes B a Banach space.This follows from the fact that the uniform convergence (i.e., in the sup norm) of continuous functions gives a continuous function (see e.g.,[START_REF] Munkres | Topology. Featured Titles for Topology Series[END_REF] or [Fol99]). This means at once that (B, | • |) is a Banach space, but the same holds for (B, ∥ • ∥) just by showing that if the derivatives converge uniformly to a continuous function this must also be the derivative of the limit function of the functions themselves (upon integration).

Figure 1 . 5 :

 15 Figure 1.5: An illustration of the spectral gap.

  or [Ten15, pp.156-158]), quadratic irrationals α ∈ I correspond exactly to continued fraction expansions which are ultimately periodic, meaning of the form α = [m 1 , m 2 , . . . , m k , m k+1 , . . . , m k+p , m k+1 , . . . , m k+p , . . .] , which we denote by [m 1 , m 2 , . . . , m k , m k+1 , . . . , m k+p ]. Thus we may also wonder things such as how do the quadratic irrationals transition to reals as we allow larger and larger periods.

  The equation h m (X) = X clearly translates into the zero of a quadratic polynomial AX 2 + BX + C = 0 with (A, B, C) relatively prime integers. Then the size ϵ(x * m ) > 1 of x * m is going to be the fundamental unit of the quadratic field Q( √ ∆), where ∆ = B 2 -4AC.

  Definition 2.2 (Combinatorial class). A combinatorial class is a pair (A, | • | A ) made up of a finite or countable set A along with a size function | • | A satisfying the following conditions:

  A and B we denote by A + B the combinatorial class with underlying set {(0, a) : a ∈ A} ∪ {(1, b) : b ∈ B} and size | • | A+B defined by |(0, a)| = |a| A for a ∈ A and |(1, b)| = |b| B for b ∈ B.

  Definition 2.6 (Singularity). An analytic function f : D → C defined in an open set D has a singularity at z 0 ∈ ∂D if and only if f it is not analytically continuable at z 0 .The function f function is analytically continuable to a point z 0 if there exists an analytic function g, defined on a larger open set D ′ containing D and z 0 , coinciding with f on D.

.

  Definition 2.7 (Dirichlet generating function). The Dirichlet generating function (DGF) of a sequence (a n ) n≥1 is the formal power series A(s) :=  n≥1 a n n s . (2.6) Dirichlet generating functions naturally follow the process of multiplication. Proposition 2.7. Let consider two sequences (a n ) n≥1 and (b n ) n≥1 with associated DGFs A(s) and B(s) respectively. Then the product A(s)B(s) is the DGF of the convolution   d|n a d b n/d  n≥1 Note here that  d|n denotes the sum over all positive divisors d of n. The most basic building block for DGFs is the so-called Riemann Zeta function. Definition 2.8 (Riemann Zeta function). The Riemann Zeta function ζ(s), or Zeta function for short, is defined by the series ζ(s) :=  n≥1 1 n s , ℜs > 1 .

Figure 2 . 1 :

 21 Figure 2.1: The principles of dynamical analysis.

3. 1 .

 1 CONCEPTS FROM COMBINATORICS ON WORDS 92 (a) The generic structure of a Rauzy graph of a Sturmian word. (b) Rauzy graph for the Fibonacci word f ∞ , here the length of the factors is n = 7.

Figure 3 . 1 :

 31 Figure 3.1: The structure of a Rauzy graph of a Sturmian word. Observe that, since each word has exactly one right extension except for R n , all nodes except from R n have outdegree 1 while R n has outdegree 2.Similarly, all nodes save for L n have indegree 1, while L n has indegree 2. This leaves us with a structure like the one in the figure: there are two paths from R n to L n and one coming back from L n to R n .

Figure 3 . 2 :

 32 Figure 3.2: In digital geometry S and S code discrete lines. In the picture S(α, 0), where α is the slope.

Figure 3

 3 Figure 3.3: Intervals corresponding to the coding of the rotation of the circle.

Proof.

  Let a and b satisfy |a| 1 -|b| 1 ≥ 2 and have length as short as possible. It is clear then that a and b must differ in their borders (else we can eliminate the part that is equal and still get the same difference |a| 1 -|b| 1 ). Clearly then a = 1w1 and b = 0  w0, for some words w and  w. Indeed, the "crossed" cases a = 1w0, b = 0  w1 and a = 0w1,b = 1  w0 are not possible (because |a| 1 -|b| 1 = |w| 1 -|  w| 1 and the latter are shorter). Then, having a = 0w0, b = 1  w1 implies |w| 1 -|  w| 1 = 2 + |a| 1 -|b| 1 ≥ 2. Now we claim w =  w. Assume otherwise, then there is a first index for which they differ, that is w = xαy,  w = x αy ′ where α ∈ {0, 1}, x, y, y ′ ∈ {0, 1} ⋆ . Note then that α cannot be 1 because otherwise we would have 1x1 and 0x0 as subwords, and these satisfy |1x1| 1 -|0x0| 1 = 2 while being shorter. Hence α = 0 and w = x0y,  w = x1y ′ . But then we have |a| 1 -|b| 1 = |y1| 1 -|y ′ 0| 1 which again leads to an absurd. ■ Proposition 3.6. A binary word u ∈ {0, 1} N is Sturmian if and only if it is balanced and non-eventually periodic.

  words in L and differ only in the first and last symbol. Thus we get ||U | 1 -|V | 1 | = 2, a contradiction ■ Proof. [Proof of Theorem 3.2] Consider two Sturmian words u and v with the same frequency α of 1s. Let g k (u) and g k (v) denote the minimal number of ones in a factor of length k in u and v respectively, so that any factor of length k in u has either g k (u) or g k (u) + 1 ones, and similarly for v. Then we know that

  by comparing the cardinalities following the definition of Sturmian words. ■ 3.2.3 End of the proof of the characterization of Morse-Hedlund Theorem 3.1

  a) Recurrence function for the Fibonacci word in Example 3.1. Here α = 1/ϕ 2 , with ϕ =

  b) Recurrence function for α = 1/e.

Figure 3 . 4 :

 34 Figure 3.4: Examples of recurrence function for two Sturmian words. In order to illustrate better the behavior of the recurrence function, we have interpolated linearly between consecutive non-jump points.

Figure 3 . 5 :

 35 Figure 3.5: The oriented distance is given by the difference modulo 1.

  Recurrence quotient for the Fibonacci word in Example 3.1. Here α = 1/ϕ 2 , with ϕ = Recurrence quotient for α = 1/e.

Figure 3 . 6 :

 36 Figure 3.6: Examples of recurrence quotients for two Sturmian words.

Figure 3

 3 Figure 3.8: The density d dλ F S (λ) of S n . Observe the cusp at λ = 3.

Figure 4 . 2 :

 42 Figure 4.2: Limit densities for the main parameters.

  4.8) which involves the function ω defined on R by ω(x, y) = 1 y(x + y) , (4.9) whose integral on R satisfies I(ω, R) = π 2 /12. The associated density ψ(x, y)

Figure 4 . 4 :

 44 Figure 4.4: Limit density of the recurrence quotient S.

  (a) Experimental histogram of the recurrence quotient S(α, n) with step ϵ(n) = 1 n . (b) Experimental histogram of the recurrence quotient S(α, n) with step ϵ(n) = 1 ⌈ √ n⌉ .

Figure 4 . 5 :

 45 Figure 4.5: Limiting densities J f S (λ) for the sequence n → → S(α, n) as estimated by the scaled histograms. The number of experiments is M = 10 7 , while n = 1000. The histograms are scaled so that they integrate to 1.

a

  The Iverson bracket is a Boolean function defined by [ [P] ] = 1 as soon as Property P is true 4.3. PROOFS: DISTRIBUTIONS AND DENSITIES. 121 Then, with the expression of the length |I k (m)| in terms of the function ω given in (4.13) and the fact that ω is homogeneous of degree-2, we obtain

4. 3 .

 3 PROOFS: DISTRIBUTIONS AND DENSITIES. 122 for any k ≥ 1, which form a pseudo-partition of Ω. We also consider a positive function g defined on Ω of class C 1 , bounded on any bounded subset on Ω for which the following two finite bounds bC g (Ω, k) := sup{g(x, y) : (x, y) ∈ Ω(k)}, D g (Ω, k) x, y) ∈ Ω(k)  ,define sequences whose associated series are convergent,

  Figure 4.6. ■ b By convention, we consider that Cg(Ω, k) and Dg(Ω, k) are 0 if the set Ω(k) is empty.

4. 3 .

 3 Figure4.6: The convex domain Ω, and, in blue, a convex polytope P. These two convex sets have the same grid squares that intersect both themselves and their complement. We traverse the polygon clockwise from the lowest vertex. Each time we intersect a horizontal line we move ±1 square horizontally in the grid, similarly for the vertical lines, and diagonals. Being the polygon convex, once we stop moving upwards vertically (at most n steps), we can only move downwards (at most n steps) when moving vertically. A similar observation for the horizontal case tells us that there can be at most 2n horizontal steps.

4. 3 .

 3 PROOFS: DISTRIBUTIONS AND DENSITIES. 125 4.3.4 Proof of Theorem 4.2. First step.

  Figure 4.7: The lines f µ (x, y) = λ for the case of µ. Note the basic point (1, 1) at the bottom-right corner.

4. 3 .

 3 PROOFS: DISTRIBUTIONS AND DENSITIES. 127 with Q(θ, y) = ω(x 0 + θ(y -y 0 ), y) |y -y 0 | .

Figure 4

 4 Figure 4.9: Limiting density for nΓ(α, n) in red and an escaled experimental histogram in blue.

1

  b(a+b) over (a, b) with a ≤ n < b gives the result by taking larger and larger rectangles. ■

  ⟨µ k ⟩ k (α), that may be "transferred" to the sequence S ⟨µ k ⟩ k (α) since the two sequences are "close enough". The following result provides such a first instance of this strategy: Proposition 5.1. Consider a sequence (µ k ) k with µ k ∈ [0, 1], and let α ∈ [0, 1] \ Q.

  (i) Denote by m k the k-th partial quotient of α. Then, ρ k (α) ≤ 1/(m k + 1) and

  ⟨µ k ⟩ k (α). When the real α is random, and uniformly drawn in the unit interval I = [0, 1], the sequence k → → S ⟨µ k ⟩ k becomes a sequence of random variables, and we study the mean value and the distribution of the sequence k → → S ⟨µ k ⟩ k for k → ∞.

Figure 5 . 1 :

 51 Figure 5.1: On the left, the graph of lim k→∞ E[S ⟨µ⟩ k ] as a function of µ. On the right, the graph of the density s ⟨0⟩ .

5. 4 .

 4 STRATEGY FOR THE PROOFS. 155 Assertion (i). The inequality |P(B) -P(A)| ≤ max {P(B \ A), P(A \ B)} is an immediate consequence of the equalities P(B) = P(B \ A) + P(A ∩ B), P(A) = P(A \ B) + P(A ∩ B).

  )dt + O(c k ) holds for any interval [c, d] with a O-constant uniform with respect to the interval [c, d]. Then each of the two integrals in (5.15) is of the form

  and is O  b k a k sup {s(x); x ∈ [b k (1 -a k ), b k (1 + a k )]}  + O(c k ). ■Lemma5.5. For any µ ∈ [0, 1], the probabilistic characteristics of the random variable S ⟨µ⟩ k and its smoothed version  S ⟨µ⟩ k are related as follows: (i) The difference between the two random variables satisfies 0 ≤ S ⟨µ⟩ k - S ⟨µ⟩ k ≤ φ k-3  S ⟨µ⟩ k .

F

  e., b(h m 1 ,...,m k ) := h m 1 ,...,m k-1 .

Figure 7 . 2 :

 72 Figure 7.2: Main costs of interest, with their quadruple, and the constant which intervenes in the analysis of their mean value. (see Thm 1).

2 F

 2 Q 2 |h ′ (y)| 2 F (h(y))dν 0 (y) =  Q (y)dν 0 (y) .

Q 2 |h

 2 ′ (y)| 2 F (h(y))dν 0 (y) = |a| 2  Q 1 B (ay)dν 0 (y) = |a| 2  Q 1 B/a (y)dν 0 (y) = |a| 2 ν 0 (B/a) .

  2 j U) = ν 0 (2 k Z 2 ) ,as desired. ■ Lemma 7.2 can be generalized to quite an extent, giving the classical change of variables formula but for padics. We refer the reader to the paper [Eva06, see Proposition 2.3], which states the multivariable change of variables over the p-adics. The book [Sch84, see Appendix A.7] gives a very readable account of such results for complete (locally compact) non-archimedean fields that are non-trivially valued. Bourbaki [Bou07], chapter 10, p.36. gives a general version of this result for Haar measures and manifolds.

Q 2 |g 2 F

 22 ′ (y)| 2 F (g(y))dν 0 (y) =  Q (y)dν 0 (y) .

7. 4 .

 4 THE EXTENDED DYNAMICAL SYSTEM. 187 Probability measure on Q 2 . We now introduce our probability measure ν, defined by ν(A) :=  A G 2 (y)dν 0 (y) , (7.26) for every measurable A ⊂ B Q 2 .

F

  Of course, for |y| 2 ≤ 1 we have G 2 (y) = 1, hence ν(Z 2 ) = 2/3 too. Now we must show that ν(C) = 1/3. Note that by undoing the change of variables y → → 1/y we haveν(C) =  C G 2 (y)dν 0 (y) =  C |y| -2 2 dν 0 (y) =  B dν 0 (y) = ν(B) .Observe that, as ν = ν 0 over Z 2 ,ν(B) = ν(2U) + ν(2 2 U) + . . . = 2 -1 ν(U) + 2 -2 ν(U) + . . . = ν(U) ,hence ν(B) = ν(U) = 1/3, and the proposition follows. ■ Observation 7.3. We remark that the measure ν satisfies ν(2 k U) = (1/3)2 -|k| for any k ∈ Z.From Lemma 7.2 and dν = G 2 dν 0 , we deduce the following change of variables formula, valid for anyF ∈ L 1 (Q 2 , ν),  Q 2|h ′ (y)| 2 F (h(y)) (y) dν(y) .(7.27)

HF

  [F ](x, y) :=  h∈H |h ′ (x)| |h ′ (y)| 2 F (h(x), h(y)) is a density in L 1 (I, ρ), then H[F ]is indeed the new density on I after one iteration of the shift T . This follows easily from the change of variables formula (7.27) applied to each inverse branch h ∈ H. Proposition 7.5 leads us to a new operator that depends on a quadruple (t, u, v, z),H t,u,v,z [F ](x, y) :=  h∈H |h ′ (x)| t |h ′ (y)| u 2 d(h) v F (h(x), h(y))  G 2 (h(y)) G 2 (y)  z .(7.30)

  Alternative expressions of the Dirichlet generating functionsWe start from the expressions in Proposition 7.4. Consider the three types of DGF defined in (7.21) and (7.22), use the equality G 2 (0) = 1, and consider the operator J s relative to the branch J used in the last step. For the plain DGF in (7.21), we obtainS(s) =  h∈H ⋆ •J |h ′ (0)| s |h ′ (0)| s 2 G s 2 • h(0) = J s • (I -H s ) -1 [1](0, 0) ,(7.31)We now consider the bivariate DGF's defined in (7.22). For the depth K, one hasS K (s, w) = e w J s • (I -e w H s ) -1 [1](0, 0) ;For costs C of Figure7.2, the bivariate DGF involves the quasi-inverse of H γ C (s,w) ,S C (s, w) = J γ C (s,w) • (I -H γ C (s,w) ) -1 [1](0, 0) , except for C = |Q| -2 2 ,where the function 1 is replaced by the function G w 2 .

H

  t : f (x) → →  a≥0 |h ′ a (x)| t f (h a (x)) ,satisfies Lasota-Yorke bound like that in Theorem 1.9. Over the reals we consider the norm | • | 0 and the semi-norm | • | 1 , related respectively to ∥ • ∥ 0 and ∥ • ∥ 1 for the extended case with space F, defined by|f | 0 := sup x∈I |f (x)| , |f | 1 := sup x∈I |f ′ (x)| .f There is another term which involves only a quasi-inverse. It does not intervene in the analysis.

  Yorke bound, along with the compactness of the closed unit ballB = {f ∈ C 1 (I) : |f | 0 + |f | 1 ≤ 1} of the Banach space (C 1 (I), | • | 0 + | • | 1 ), over (C 1 (I), | • | 0 ), imply that the operator H t is quasi-compact due to Hennion's Theorem (see Theorem 1.9). The compactness of the ball B over (C 1 (I), | • | 0 ) follows at once from the celebrated Arzelà-Ascoli Theorem g . Lemma 7.3. The component operator H t,(a) associated to a ∈ N defined asH t,(a) [f ](x) = |h ′ a (x)| t f (h a (x))acts on C 1 (I) and the integralK a [f, t] :=  I  H t,(a) [f ](x) + [H t,(a) [f ](x)] ′  dx satisfies |K a [f ](t)| ≤ I a (t)|f | 0 (1 + 2|t|) + |f| 1 I a (t + 1), with I a (t) :=  I |h ′ a (x)| t dx .

  1 (I), with the following norm| • | 1,1 , |F y | 1,1 := |F y | 0 + |F y | 1 , with |F y | 0 := sup x∈I |F y (x)|, |F y | 1 := sup x∈IWe then just ask for the function y → → |F y | 1,1 to be bounded on Q 2 and deal with the Banach spaceF :=  F : I → C : F y ∈ C 1 (I), y → → F y in L 1 (Q 2 , ν)  endowed with the norm ∥F ∥ := ∥F ∥ 0 + ∥F ∥ 1 , with ∥F ∥ 0 :=  Q 2 |F y | 0 dν(y), ∥F ∥ 1 :=  Q 2 |F y | 1 dν(y) . (7.33) g For f ∈ B : |f (x) -f (x0)| = |  x x 0 f ′ (t)dt| ≤ |x -x0| |f |1 ≤ |x -x0|, which proves the equicontinuity.

7.5. 3

 3 Action of the operator H t,u,v,z on F

Observation 7. 4 .

 4 Consider an inverse branch ha (x) = 1 2 a (1+x) of depth 1. Then |h ′ a (x)| t = |h ′ a (x)| t-1 |h ′ a (x)| =   2 a (h a (x)) 2   t-1 |h ′ a (x)| ,(7.34)which of course holds for the dyadic norm | • | 2 as well. The factor |h ′ a (x)| on the right-hand side of (7.34) will serve to perform the change of variables when working with integrals. Thus I |h ′ a (x)| t dx =  ha(I)   2 a u 2   t-1 du , (7.35) even when changing | • | for the norm | • | 2 and the Lebesgue measure for the Haar measure ν 0 on Q 2 . 3

  |h ′ a (y)| u 2 R(h a (y)) G z 2 (h a (y))G 2 (y) dν 0 (y) , (7.36) which we wish to compare with  Q 2 R(y)G 2 (y)dν 0 (y). We perform the change of variables x = h a (y) and we note the two following equalities, following from (7.34) and the previous discussion, according as to whether y ∈ CG 2 (y) 1-z |h ′ a (y)| u 2 =  2 -a(u-1) |x| 2(u-1) 2 |h ′ a (y)| 2 , y ̸ ∈ C 2 -a(u-2z+1) |x| 2(u-z) 2 |h ′ a (y)| 2 , y ∈ C .Then, the integral decomposes into three integrals J a,u,z [R] = 2 -a(u-1) z 2 (x) dν 0 (x) .

2 =

 2 u = z . When z = u ∈ C notice that we have |x| -2 G 2 (x) for the first two integrals, whence |x| -2(u-1) 2

Lemma 7. 4 . 2 R 2 R

 422 Given a function R : Q 2 → [0, ∞) and a real u we defineJ a,u [R] :=  Q 2 G -u 2 (y)|h ′ a (y)| u 2 R(h a (y))(G 2 (h a (y))) u G 2 (y)dν 0 (y) . Then J a,u [R] satisfies J a,u [R] = 2 -a(u-1)  ha(B) R(x) G 2 (x) dν 0 (x) +2 -a(u-1)  ha(U ) R(x) G 2 (x) dν 0 (x) +2 -a(1-u)  ha(C) R(x) G u-1 2 (x)G 2 (x) dν 0 (x) ,as well as the bounds|J a,u [R]| ≤ 2 a|1-u|  Q (y)G 2 (y)dν 0 (y) , • 2 a|1-u| • (1 + a) Q (y)G 2 (y)dν 0 (y) .

  sup x∈I |H t,u,v,u [F ](x, y)| ≤ ∞  a=0 |h ′ a (x)| ℜt |h a (y)| ℜu d(h a ) ℜv sup x∈I |F (x, h a (y))|  G 2 (h a (y)) G 2 (y)  ℜu .Consider then Lemma 7.4 with R(y) := |F y | 0 , we get that∥H t,u,v,u [F ]∥ 0 ≤ ∞ a=02 -a(ℜ(t-v-|1-u|)) ∥F ∥ 0

  u,v,u [F ](x, y) = ∞  a=0 (log |h ′ a (x)|)|h ′ a (x)| t |h ′ a (y)| u 2 d(h a ) v F (h a (x), h a (y))  G 2 (h a (y)) G 2 (y)  u .

  Dominant spectral properties of the operator

Proposition 7. 10 .

 10 The Taylor expansion of the eigenvalue λ(t, u, v) at (1, 1, 0), written as λ(t, u, v) ∼ 1 -A(t -1) + B(u -1) + Dv, involves the constants A = -∂λ/∂t(1, 1, 0), B = ∂λ/∂u(1, 1, 0), D = ∂λ/∂v(1, 1, 0) (a) The constants A and D already appear in the context of the plain dynamical system, and are precisely described in (7.19) and (7.18). In particular A -D is equal to the integral E := E Ψ [2| log x|];(b) The constant B is defined in terms of the extension of the dynamical system and its invariant densityΨ = Ψ 1,1,0 . The constant B + D is equal to the dyadic analog E 2 of the integral E, namely, B + D = E 2 := E Ψ [2 log |y| 2 ];(c) The constant A -B is the entropy of the extended dynamical system.About the constant B. The invariant density Ψ -more precisely the function  Ψ := Ψ • G 2 -satisfies a functional equation of the same type as the invariant function ψ, (described in Equation 7.16), namely,

  k k 2 2 k -(log 2)(3 log 3 -4 log 2)   .= 1.33973 . . . 7.6. FINAL RESULT FOR THE ANALYSIS OF THE CL ALGORITHM 195 7.6 Final result for the analysis of the CL algorithm

  2 and we recall them here Cost C Cost c = log C Beginning  γ C Constant M (c) Numerical value of M (c) 26072 . . . Proof. Now, the Tauberian Theorem comes into play, relating the behavior of a Dirichlet series F (s) near its dominant singularity with asymptotics for the sum Φ N (F ) of its first N coefficients. Delange's Tauberian Theorem (Theorem 2.3)

  ρ  H 1,(C) [Ψ]  = ∂ ∂w λ( γ C (1, w))    w=0 = ⟨∇λ,  γ C ⟩ = M (c) . ■ 7.6. FINAL RESULT FOR THE ANALYSIS OF THE CL ALGORITHM In this dissertation we have presented several instances of Dynamical Analysis to study objects coming from Combinatorics on Words (namely Sturmian words) and Number Theory (the Continued Logarithm algorithm)

  b] is a monotone bijection. Observation 1.10. Consider a complete interval dynamical system of class C 2 with |h ′ | ≤ ∆ 1 and |h ′′ | ≤ C|h ′ | for all h ∈ H. Then associated Perron Frobenius operator H acts on BV(I) under the norm

  The coefficients γ k of the expansion are called the Stieltjes constants.3

	2.2. ANALYTIC COMBINATORICS FOR DIRICHLET GENERATING FUNCTIONS	81
	where γ is the Euler-Mascheroni constant defined by γ := lim n	 n k=1	1 k -log n.
				.12)

  This example originates from a private communication betwen Joachim von zur Gathen and Brigitte Vallée[START_REF] Vallée | Private communication between brigitte vallée and joachim von zur gathen[END_REF].In order to compute this we consider auxiliary functions φ ℓ (n), extending Euler's φ function. Let us consider first the case ℓ = 2 which corresponds to Euler's φ function. Case ℓ = 2. A key identity of Euler's totient function φ states that  d|n φ(d) = n for all n ∈ N. This identity can be interpreted combinatorially as follows. First rewrite, by symmetry of the divisors,  d|n φ(d) =  d|n φ(n/d) and note that φ(n/d) is the number of integers in {1, . . . , n/d} that are coprime to n/d. Then φ(n/d) corresponds too to the number of integers m from {1, . . . , n} that satisfy gcd(n, m) = d (indeed gcd(n, m) = d ⇐⇒ gcd(n/d, m/d) = 1).

	Thus the sum		d|n φ(n/d) counts all integers m from {1, . . . , n} by dividing them according to d =
	gcd(n, m). Therefore we conclude that	 d|n φ(n/d) = n.
	It is important to remark that Proposition 2.7 then yields

k , 2.2. ANALYTIC COMBINATORICS FOR DIRICHLET GENERATING FUNCTIONS 82 as ℓ → ∞.

  (Dolgopyat-Baladi-Vallée estimates). Consider the transfer operator H s associated with the Euclidean dynamical system when it acts on the functional space C 1 (I) endowed with the family of norms ||.|| 1,t defined for t ̸ = 0 as ||f || 1,t := sup |f | + (1/|t|) sup |f ′ | .

	6.2. RELATIONSHIP BETWEEN THE TECHNIQUES EMPLOYED	160
	Theorem 6.1

  Producing the sum over the suffixes. Now we get back to (6.18). Summing over all suffixes m with w ⪯ m produces

	Tr		(I -H s ) -1 • H [w],s		=	
						m:w⪯m

.19)

  .17) Such an operator H t,v is called a transfer operator. When (t, v) satisfies ℜ(t -v) > 0, we prove the following: the operator H t,v acts nicely on the space C 1 (I) endowed with the norm| • | 1,1 , defined by |f | 1,1 := |f | 0 + |f ′ | 0 ,where | • | 0 denotes the sup norm. In particular, it has a dominant eigenvalue λ(t, v) separated from the remainder of the spectrum by a spectral gap, for (t, v) close to (1, 0).

	The Taylor expan-
	sion of λ(t, v) near (1, 0)
	λ(t, v) ≈ 1 -A(t -1) + Dv
	involves the two constants A = -∂λ/∂t(1, 1, 0), D = ∂λ/∂v(1, 1, 0) , that are expressed as mean values
	with respect to the invariant density ψ,
	A

  There are two contexts in which a finite CL expansion arises: in the real context, where it comes from the truncation at a fixed depth of an infinite CL expansion -and in the rational context, where it is finite per se, and the depth is no longer fixed. Our main study deals with the second context, but it is also central to understand the former, real context.

	7.3. COSTS AND MODEL FOR THE ALGORITHM		182
	Then, with (7.18) and (7.19), there is an explicit value for the entropy A, and
	A	. = 1.62352 . . . , D	. = 0.97693 . . . , E	. = 2.60045 . . . .
				log 2)	log(3/2) log(4/3)	(7.19)

  The inverse branches h a are of bounded distortion |h ′′ a (x)| ≤ 2|h ′ a (x)|, hence we may write ℜt |h ′ a (y)| ℜu 2 d(h a ) ℜv F (h a (x), h a (y))

		   	∂ ∂x	H t,u,v,u [F ](x, y)	    ≤2|t|	∞  a=0	|h ′ a (x)|  G 2 (h a (y)) G 2 (y)	 ℜu
							+	∞  a=0	|h ′ a (x)| ℜt+1 |h ′ a (y)| ℜu 2 d(h a ) ℜv ∂F ∂x	(h a (x), h a (y))  G 2 (h a (y)) G 2 (y)	 ℜu	.
	   	∂ ∂x	H t,u,v,u [F ](x, y)	    ≤

∂ ∂x H t,u,v,u [F ] satisfies ∞  a=0 |t| |h ′ a (x)| ℜt-1 |h ′′ a (x)||h ′ a (y)| ℜu 2 d(h a ) ℜv F (h a (x), h a (y))  G 2 (h a (y)) G 2 (y)  ℜu + ∞  a=0 |h ′ a (x)| ℜt+1 |h ′ a (y)| ℜu 2 d(h a ) ℜv ∂F ∂x (h a (x), h a (y))  G 2 (h a (y)) G 2 (y)

 ℜu .

funding from the ANR DynA3S.

Finally, I want to thank my family, my friends, both from Uruguay, from the Maison de l'Italie and IRIF, for

THE RECURRENCE FUNCTION OF STURMIAN WORDS

146 each n ≥ 0. Such words do exist: they are called Sturmian words. Morse and Hedlund provided a powerful arithmetic description of Sturmian words (see Chapter 3 for more details).

Proposition. 3.1 Associate with a pair (α, β) ∈ [0, 1] 2 the two infinite words S(α, β) and S(α, β) whose n-th symbols are respectively u n = ⌊α(n + 1) + β⌋ -⌊αn + β⌋, u n = ⌈α(n + 1) + β⌉ -⌈αn + β⌉.

Then a word u ∈ {0, 1} N is Sturmian if and only if it equals S(α, β) or S(α, β) for a pair (α, β) formed with an irrational α ∈ (0, 1) and a real β ∈ [0, 1).

It is also important to study where finite factors occur inside the infinite word u. This is where the recurrence function (see subsection 3.3.1) comes in, giving a measure of how often factors reappear on the worst case.

More precisely, let w u (q, n) be the minimal number of symbols u k with k ≥ q which have to be inspected for discovering the whole set L u (n) from the index q. Then u is uniformly recurrent if each set {w u (q, n); q ∈ N} is bounded, and the recurrence function

Any Sturmian word is uniformly recurrent (see Proposition 3.11). Its recurrence function only depends on the slope α and is thus denoted by n → → R(α, n) = R α (n). Moreover, it only depends on α via its continuants. We now recall this notion which plays a central role in the paper. Consider the continued fraction expansion (see Chapter 1 for more details) of the irrational α α = 1

The positive integers m k are called the partial quotients. The truncated expansion [m 1 , . . . , m k ] at depth k defines a rational, and the continuant q k (α) is the denominator of this rational. The continuant sequence satisfies q -1 = 0, q 0 = 1 and for any k ≥ 1 the recurrence q k = m k q k-1 + q k-2 for all k.

We recall a fundamental result (Theorem 3.3) by Morse and Hedlund [START_REF] Morse | Symbolic dynamics II. Sturmian trajectories[END_REF] :

It is thus natural to study the quotient

this quotient depends itself on two quotients: the quotient ρ k (α) := q k-1 (α)/q k (α), and the quotient ν k (α) := n/q k (α), and

As ν k (α) belongs to the interval [ρ k (α), 1], the following bounds hold

CHAPTER 7

THE CONTINUED LOGARITHM ALGORITHM

In Chapter 1, Example 1.3, we introduced the so-called continued logarithm expansion as an example of an interesting interval dynamical system (see Example 1.3, Observation 1.5). Here we study its associated gcd-algorithm in detail, explaining the origins of the algorithm, what was known about it and we present our novel study of its average performance.

Introduction

In an unpublished manuscript, Gosper [START_REF] Gosper | Continued fraction arithmetic[END_REF] introduced a new kind of continued fraction expansion, called the "Continued Logarithm" [START_REF] Borwein | Continued logarithms and associated continued fractions[END_REF]. He writes There is a mutation of continued fractions, which I call continued logarithms, which have several advantages over regular continued fractions, especially for computational hardware. (..)

The primary advantage is the conveniently small information parcel. The restriction to integers of regular continued fractions makes them unsuitable for very large and very small numbers. The continued fraction for Avogadro's number, for example, cannot even be determined to one term, since its integer part contains 23 digits, only 6 of which are known. (...) By contrast, the continued logarithm of Avogadro's number begins with its binary order of magnitude, and only then begins the description equivalent to the leading digits -a sort of recursive version of scientific notation. (..)

Although these operations are not as nice on paper, they are beautifully suited to binary machines, requiring only shift, add, subtract, exchange, and compare-for-greater.

The continued logarithm expansion of a real number x ∈ (0, 1) (it can be easily extended to the whole positive numbers) is of the form

where the exponents a 1 , a 2 , a 3 , . . . are non-negative integers. Observe that indeed the first coefficient a 1 gives the logarithmic size of x in base 2, thus why Gosper called it a "sort of recursive version of scientific

The continued logarithm expansion

To motivate the choice of the algorithm we begin rather from the associated continued fraction expansion which gives origin to it. The reason behind this is that, otherwise, the algorithm may come away as somewhat less natural (but we will also explain why it is reasonable from an algorithmic point of view) as there are several details that may be done in other ways.

The continued logarithm associates to each x ∈ (0, 1) a formal expansion

for certain non-negative integer digits a 1 (x), a 2 (x), . . . We denote the RHS expression by [a 1 , a 2 , . . .], which can be shown to represent a real number [START_REF] Ya | Continued fractions[END_REF], when interpreted as the appropriate limit

As for continued fractions (see Chapter 1), for rational numbers this expansion is going to be finite

but not unique. There are two representations

when a k > 0. This, however, is the only possible redundancy in the representation.

To define the process of computing the continued logarithm expansion in a definite way, we compute the coefficients simply by considering that a 1 = a 1 (x) is determined uniquely by 2 -a 1 -1 < x ≤ 2 -a 1 , and so on. This is the coding of the CL dynamical system we defined in Example 1.3, with the shift map T c , which we call the CL map b , which satisfies

x = 2 -a 1 (x) 1 + T c (x) .

We recall the CL dynamical system here, which is an interval dynamical system (see Definition 1.3).

b It is called the "Hei-Chi Chan map" in [START_REF] Arnoux | Natural extensions and Gauss measures for piecewise homographic continued fractions[END_REF] in honor of Chan who studied its Ergodic properties in [START_REF] Chan | The asymptotic growth rate of random Fibonacci type sequences[END_REF].