1. Preliminaries
The Stern–Brocot (SB) tree
is a binary rooted tree which provides a way to order (and thus to count) the elements of
, the set of positive rational numbers, so that every number appears (and thus is counted) exactly once (see [
1], of which this work can be considered a development, and also [
2,
3,
4]). To begin with, we say that a pair of nonnegative fractions
is a
Farey pair if the unimodular relation
holds (so that their distance is
). The basic operation needed to construct
associates to each Farey pair their
mediant
One readily sees that the
child always lies somewhere in between its
parents and
, forming Farey pairs with them. Moreover, among all the fractions lying strictly between
and
, it is the one (and only one) with the smallest denominator, and is always in lowest terms whenever the parents do (see [
5]).
Remark 1. Note that the mediant operation arises naturally in the following way: let L be the vertical half-line in , and denote by U the subspace of given by of all vectors with positive integer coordinates. Let be the map given by , which is the ordinate of the intersection of u with L. Each reduced fraction on L is thus the image with T of a vector of U with coprime coordinates. Finally, given , we have Now, taking as the initial pair
and
, we take their mediant
as the
root of the tree. Then one writes one generation after the other using the above operation (a portion of this structure is depicted in
Figure 1). As already observed,
and
are in bijection. To a given
, we associate its
depth as the level of
it belongs to.
Lemma 1. Ref. [1], Lemma 1.2. Let then Remark 2. Note that the sub-tree of having as the root node and vertex set (sometimes called Farey tree) can be obtained exactly in the same way as taking as the initial pair and instead of and . One easily sees ([1], Lemma 1.1) that where is the invertible map defined by and . One can also construct an equivalent tree whose vertex set is formed by binary strings, with each fraction
corresponding to a binary word
obtained by concatenation of its left and right parent as follows (see
Figure 2).
Definition 1. Farey–Christoffel (FC) words
SetIf moreover and is a Farey pair and , we define Defining FC words by reversed concatenation does not really change matters. In particular, it is easy to show by induction that FC words defined as above (resp. by reversed concatenation) are also
Lyndon words; i.e., they are minimal (resp. maximal) with regard to cyclic permutations. We should also notice that what we call here Farey–Christoffel words, to emphasize their relation with the Farey order of the rationals, are commonly called just
Christoffel words [
6] since they were studied for the first time by Christoffel in 1875; see [
7].
Some notations: For
set
. Then, for
given by
, we set
Also denote by
the length of
w and by
the number of occurrences of the symbol
in
w.
The above construction establishes a one-to-one correspondence between and the set of FC words.
Theorem 1. We have the following properties:
- 1.
Given , we have with (so that );
- 2.
Given with , we have for some satisfying ;
- 3.
Given , we have ;
- 4.
Given with , it can be uniquely factorized as , where u and v are non-empty palindrome words. Moreover, if , then and .
Proof. The first assertion follows from the definition, whereas the third easily follows from the second. Let us then prove 2. We proceed by induction on the depth. For the root node , we get , the empty word, so that the assertion is trivial. Suppose it is true up to depth , and consider with depth . We have with . On the other hand, is obtained as the child of a left and right parent, say and , one of depth and the other of depth , for some (the case in which one parent is an ancestor is left to the reader). Set and , with and . Therefore, . Now consider a child of . If is the right child then by construction with , which is clearly palindromic. If is the left child, the same argument yields with .
To show the last statement, we note that from the above, it follows that for , the palindrome c always has the structure , with and . Therefore, we can write with and , which are both palindrome words. As for the uniqueness, let with for all palindromes. Assume without loss that , so and , with . Since they are all palindromes, we have , so that . Then it readily follows that for some positive . But this is absurd, since it should be and , but we already know that and with p and q as coprime, and the case would imply , which is absurd since and it could not be palindromic. This holds true for each , except for the leftmost and rightmost nodes at each level, for which the uniqueness of the factorization is trivial since or . □
Remark 3. The last statement of the above theorem yields two factorizations for with : the palindromic factorization , with u and v both palindromes, and the so-called standard factorization , in terms of FC subwords. Both of them are unique.
Remark 4. It follows from the definition that given a word with standard factorization , with and , and are FC words; in particular, they are the children of w, with the indicated standard factorization. Moreover, if , then either u is a proper prefix of v, and is the standard factorization of v, or v is a proper suffix of u, in which case .
Some rather immediate consequences of the above properties are formulated in the following corollaries (see also [
6]).
Corollary 1. Let be an FC word associated with some element of . The FC words associated to its left and right children are given bywhere and are the shortest palindrome with a suffix, respectively, a prefix, given by u. Corollary 2. Let be an FC word associated with some element of . The maximum among all its cyclic permutations is realized by the word .
Corollary 3. The number of FC words of length n is given by Euler’s totient function .
Proof. From Theorem 1, we have that . The totient function gives us the number of distinct p which are relatively prime with n, which coincides with the number of possible pairs which are relatively prime. □
2. Relation with Cutting and Sturmian Sequences
Now, given , we call the slope of w. This is motivated by the following facts. To a given binary word , we can associate a stepwise walk on the lattice constructed by moving by a vertical step upwards (respectively, horizontal step oriented on the right) for each occurrence of the symbol 1 (respectively, 0). Clearly, the walks corresponding to and meet at the origin and at the point . Moreover, letting , the central sequence c is nothing but the cutting sequence of the ray having slope , where one writes 0 each time the ray cuts a vertical line, and 1 each time it cuts a horizontal line, on the open interval .
Furthermore, the FC word of slope
can be defined from the very beginning as a sequence of unitary steps joining points of the integer lattice from
to
, so that (i) the corresponding path is the nearest path below the line segment joining these two points; (ii) there are no points of the integer lattice between the path and line segment (see [
6]). When the slope is irrational, a similar definition leads to the notion of (infinite)
Sturmian sequences.
In
Figure 3, we report the case with slope
(with
).
Figure 4 shows the cutting sequences of the two parents of
, namely
and
(when concatenating two finite cutting sequences, one has to interpose the word 10, which corresponds to a cut with a corner).
Remark 5. The standard factorization in terms of FC subwords (cf. Remark 3) can be obtained geometrically by cutting the walk corresponding to w at the lattice point closest to the segment joining with . The last property implies that and therefore . In the same way, we can show that . We therefore see that the lengths of the factors and are the respective multiplicative inverses in of p and q.
Now, putting together Remark 6 and, e.g., [
8],
Section 1 (or else [
9], Chap. 6), one sees that the FC word
can also be characterized as the symbolic representation of the orbit
with regard to the partition
, with
and
the rotation of angle
, sometimes also called the
Sturm sequence of . More specifically, set
and note that
, which can be iterated to give
Setting
, we then have
Note that, since
, we have
. More precisely, if
(
) in
w, the symbol 0 is always isolated, and between any two 0s, there are either
or
1s. If instead,
(
) in
w, the symbol 1 is isolated, and between any two 1s, there are either
or
0s. The opposite plainly happens to
.
The above generation rule can be further rephrased as follows (closely mirroring the original construction by Christoffel). Let
and set
. Define the group translation
as
Lemma 2. Let , with , and (so that ) be the corresponding element of . Consider the partition with and . Proof. From the geometric interpretation of the FC words given above, one deduces the following rule: for any , we have if and in the opposite case.
Now note that, setting , if , then , whereas if , then . In other words, if and only if and if and only if . □
Remark 6. If one works with the sub-tree instead of (see Remark 2), assigning the initial symbols 0 and 1 to and (instead of ), then the above conclusions are unchanged provided is replaced by (and by ), so that the denominator of the corresponding fraction always equals the length of the FC word. Moreover, the algorithm of Lemma 2 remains unchanged provided we let act on instead of and we set and .
Finally, we note that the map ϕ induces the substitution map on FC words given by and . A short reflection shows that this rule can be used to obtain the FC word constructed above from the Sturm sequence of α itself, that is, the word , with and .
3. Relation with Continued Fractions
We have already seen (cf. Lemma 1) how the depth of each element
is related to the partial quotients of its continued fraction expansion (c.f.e.)
. This connection can be further expanded. One starts by constructing a matrix representation of the positive rationals as follows: given
and
set
and identify
Clearly,
and
are but the parents of
x. We have
and moreover
and
Hence the matrices A and B, when acting from the right, move downwards on , respectively, to the left and to the right.
Putting together the above, along with Lemma 1, we get
Proposition 1. Each , with , corresponds to a unique element , for which there are only two possibilities:
Moreover, let and be the corresponding FC word, then For a given element , the matrix product X can be used to code the descending path, which reaches x starting from as a binary string , where each symbol 0 corresponds to an occurrence of A (down left move) and each symbol 1 to an occurrence of B (down right move).
We may now ask what kind of relation can be established between
and its FC word
(a reverse relation yielding the c.f.e. of
x from the corresponding FC word
w is discussed in
Section 4 below).
The sought relation can be readily obtained from Corollary 1. Indeed, given a palindromic word
and a symbol
, we set
For example, we have
and
. Note moreover that
. A direct consequence of Corollary 1 is now the following rule.
Proposition 2. Let be the path of , and its FC word. Then we have Example 1. Taking from Proposition 1, we have . Thus, applying rule (5), we getFinally, (to be compared with the portions of the trees and reproduced above). Remark 7. The maps (4) were introduced by Aldo de Luca in [10], who called them palindromic closures. More generally, in the combinatorial word theory literature, the transformation mapping the word to the central palindrome c of is usually encoded by a function defined recursively as follows [11]: set . If for some , then . Although the two approaches are of course equivalent, the one outlined above seems more transparently connected to the present construction. 3.1. Reversals and Duality
If we let
A and
B act on the left, we get
and
That is, they move a fraction
, respectively, to its left and right
descendants and
on
. Now, if we associate to a given fraction
a matrix product
, where
, as above, then we can consider the involution
, where
is the rational number represented by the reversed matrix product
. This map acts as a permutation on
, and the corresponding permuted tree
can be constructed starting from the root node
and writing under each vertex
the set of its descendants
.
Note moreover that, according to Proposition 1, the following rule is in force: let , then
and therefore,
n even
n odd
Definition 2. Let be the path of and its FC word. The FC word is associated with , for whichis called the dual word for w. In the same vein, x and will be referred to as dual elements in . It turns out (see [
11]) that whenever
w and
are dual words associated with the irreducible fractions
and
, we have
and
and
as the respective multiplicative inverses in
of
p and
q, that is,
with
(these inverses exist because
p and
q are relatively prime and therefore are also relatively prime to
. Therefore,
and
are relatively prime). A straightforward consequence of this property and the content of Remark 5 is the following:
Lemma 3. Let and be dual elements in . Then 3.2. Motions on and
We start recalling some results discussed in [
1] about dynamics on
. We start observing that the descendants of a fraction
are just its pre-images with regard to the map
given by
The map
F can thus be used to “vertically” generate the permuted tree
. Moreover, according to ([
1], Proposition 2.3),
can also be generated “horizontally” by means of the map
given by
,
and
More precisely, denoting with
the
n-th rational number obtained by ‘reading’
row by row, from left to right, starting from the root, and letting
be the element of the permuted tree
corresponding to
, it holds
(or else
).
Turning now to consider the permuted FC tree
, an easy consequence of the construction outlined above (see also [
6], Lemma 2.2) is the following:
Lemma 4. Let w be the FC word associated with some element . The FC words associated with its descendants and are obtained by applying to w the substitution rules: Now note that any FC word
w of length
n can be written in the form
whenever its slope
, or else
whenever
. As noted before (cf. the statement given after Equation (
1), see also [
12]), the integers
may only get two values. They are
or
, if the slope
is smaller than one, and
or
otherwise. Following [
12], we call the exponent
(or
) the
value of
w.
This naturally induces a decomposition of (or ) as (with obvious meaning of the notations), so that and ; in particular consists of all the left nodes of , while consists of all the right nodes, plus the root.
We are now ready to introduce a map T on words which generates the “horizontal” motion on , namely the displacement row by row, from left to right, starting from the root, in a similar way to how R does it for .
Theorem 2. The map T that moves from a given word to the next one can be written as , where the maps and act as follows:where k is the value of w. Proof. Let
with
Let
be the parent node of
w and
; we have that
is given by
and, recalling that
, we have
Then, thanks to
, we have
and we have shown
.
Now we will show that
by induction on the depth
m of the word
w. For
,
is trivial. Let us then assume it holds true for each
w at depth
m, and we will prove it for
. Let
with
Let
be the parent node of
w, and
the parent node of
. Then
. Clearly,
is given by
Now, let us consider the
q subwords
individually, and we call
the complement of
in the set
. Then, if
, we have, by the induction hypothesis, that
and so, by the action of
, the subword
becomes
, and applying
, we get
which we wanted to show.
On the other hand, if
, then the subword
is either 0 or 01, so that
and
. The definition of
given by the theorem is equivalent to saying that for each subword
, we substitute each of the first
zeros with 01, while what remains, i.e., 01, we substitute with 1. Thus, applying
, it is clear that for
for which
, we get 01, while for
for which
, we get 1. And, applying
, we get that 01 becomes 001, while 1 becomes 01. So, putting it all together, we have
which is what we needed to prove. □
The map T, defined for FC words, can be used to “horizontally” generate the tree as the map R can be used to “horizontally" generate the tree . Since R is defined on , we would like to find an extension of T such that the correspondence with R is not limited to .
To this end, let us first recall the definition and characterization of a notion already introduced in
Section 2. As described by Aldo de Luca and Filippo Mignosi in [
13],
A Sturmian word (in this paper we use the term “sequence”) can be characterized as a (one-sided) infinite word which is not ultimately periodic and is such that for any positive integer n the number of its factors of length n is minimal (i.e., ). A Sturmian word can also be defined by considering the intersections with a squared-lattice of a semi-line having a slope which is an irrational number (this construction is usually called billiard sequence. We will limit ourself to consider semi-line with intercept 0, i.e., starting at the origin ).
Another common characterization of Sturmian sequences is the following: an aperiodic sequence over a binary alphabet is Sturmian if and only if it is
balanced (see [
14,
15]). An infinite word
w on
is balanced if given two factors of
w,
u and
v; with
, the difference between
and
, or equivalently between
and
, is at most 1.
We recall that Sturmian sequences can also be regarded as infinite cutting sequences (cf.
Section 2), thus enjoying the property that if the slope
x is >1 then they have isolated 0s interspersed with blocks of the form
or
(
), or, otherwise, they have isolated 1s, with blocks of the form
or
if
(
) [
12]. We can now state the following:
Theorem 3. Given a Sturmian sequence w with irrational slope x (and intercept 0), the sequence given by is a Sturmian sequence. Moreover, its slope is .
We consider, in this theorem, Sturmian sequences preceded by a 0 in the same way we consider, in Theorem 2, FC words in the form with c finite cutting sequences. In this way, without further adjustments, the map T in Theorem 2 is well defined on the set of Sturmian sequences with an irrational slope (and intercept 0). To prove this theorem, we first show that is a balanced sequence, and we do so through two lemmas.
Lemma 5. Given and a Sturmian sequence w with irrational slope (and intercept 0), then given by is balanced.
Proof. We will use induction on the length n of the factors of . For , it is trivial that the difference in the number of 0s between two factors is at most 1. Moreover, the statement clearly holds for , since there can only be at most one 1 in each factor.
Let the statement be true for some , and let us assume, by contradiction, that there exist two factors and with and . Note that without loss of generality, we may assume equality, instead of , since the case immediately contradicts the inductive hypothesis. Then it follows that and are of the form and ; that is, the ends of the two words must necessarily be different. Otherwise, by considering the subwords obtained by removing an equal symbol at the ends, we would obtain words of length n that differ in the number of 1s by two, contradicting the inductive hypothesis. Clearly, the opposite situation, and , would be even worse. We can thus consider the factor obtained by extending the block of 0s that has as a prefix and the block of 0s that it has as a suffix (this is always possible thanks to the definition of and the characteristics of w), obtaining for some . Comparing it with , these two words do not have the same length, but they certainly have the same number of 1s and, therefore, the same number of blocks, either or . Since we have added at least a 1 to and removed a 1 from , it follows that . Denoting by a and b, respectively, the number of blocks in and in , we have .
Considering the pre-images via , we obtain two subwords of w, which we denote by and , which have the same number d of blocks. However, u has a blocks of type , whereas v has b; consequently, u has a block of type , whereas v has . This implies that , with the same number of 0s. Then, by removing the prefix 0 from and appending to v, as suffix, the symbol 0 that follows it, we obtain and , two factors of w, with and , which is absurd because it contradicts the hypothesis that w is a Sturmian sequence and, as such, should be balanced. □
Lemma 6. Given and a Sturmian sequence w with irrational slope (and intercept 0), given by is balanced.
Proof. We divide the proof into two parts, and in both cases, as in the previous proof, we proceed by induction on the length n of factors of . Notational warning: the symbol, used for list concatenation in Haskell, is used here, with an abuse of notation, for infinite concatenations, similarly to the use of the ∑ symbol.
First case: ; that is, and w is of the form , with or 2. We can observe that, for the w under consideration, . Then, for and 3, it is trivial that the difference in the number of 0s between two factors is at most 1.
Assume that the statement holds for some , and let us prove it for .
Suppose, by contradiction, that it does not hold; that is, as in the proof above, there exist two factors of the form e with and . We know that each 0 must be followed by at least two 1s, thus we can consider the factors and . Hence , and .
Considering and the given w, we have that, via , each corresponds to 0 and all the remaining 1 correspond to 01. Then, we get and with , , and . Hence . Now, considering the two factors u and v, we have with , which is absurd because it contradicts the hypothesis that w is a Sturmian sequence and as such should be balanced.
Second case: ; that is, and w is of the form , with or and , with or 2; i.e., it will be a semi-infinite sequence composed of subwords 01 and 011. Then, for and 3 it is trivial that the difference in the number of 0s between two factors is at most 1.
Assume that the statement holds for some , and let us prove it for .
Suppose, by contradiction, that it does not hold; again, we would have two factors of the form and with and . We then consider the factors , with or 1, obtained by extending the blocks of 1s in the prefix and suffix, and , so that and .
Considering and the given w, we have that, via , each corresponds to 0 and all the remaining 1 correspond to 01. Then, considering and , we get , , , and . But, since ends in 01, whether it is followed by 0 or by 1, we have that v is always followed by another 0. Thus, and . We now have four cases:
If , we have , so that
with ;
If , we have , so that
with ;
If , we have , so that
with ;
If , we have , so that
with .
All four results are absurd, since the hypothesis states that w is a Sturmian sequence and, as such, balanced. □
Now we can finally prove Theorem 3.
Proof. When considering
, we have that the slope of
w is
. We call
the number of 1s in the first
n blocks of
w, and
the number of 0s. For each 0 in
w, we get a 1 in
, and for all 0s, except those followed by a 1, we get a 0 in
. That means that the ratio between 1s and 0s in
is given by
and, by considering the limit, we get
On the other hand, considering
, we have that the slope of
w is
and the value
. In the first
n blocks of
w, we have exactly
n 0s, and we have
p times
k 1s, and
q times
1s, with
. For each
k block of 1s in
w, we get
0s in
, and for each
block of 1s, we get
k 0s, while for each block of any kind in
w, we get exactly one 1 in
. Thus, the ratio between 1s and 0s in
is given by
Now, considering that
we have that
tends to
; hence,
tends to
, and we get
Thus, the ratio between 1s and 0s in
is irrational; hence, the sequence is aperiodic and, since we have shown in the two lemmas above that it is also balanced, it follows that it is a Sturmian sequence. □
Remark 8. Connection with S-adic systems
On the permuted tree , one can introduce a symmetric random walk in the following way: set and if , then either or , both with probability . In [1], it is proved that this process enters any non-empty interval almost surely (Thm. 1.12) and, more specifically, it does it with asymptotic frequency (Corollary 3.7), where encodes the infinite path of by interpreting it as the binary expansion of a real number in . Differently said, , and, if , thenA similar study can be pursued on the permuted tree , starting from the observation that the substitutions and defined in Lemma 4, whose incidence matrices coincide with A and B, define a so-called S-adic system (see [16], pp. 87–109, and [17]), which, however, are rarely considered as generating a random process. For an interesting analysis of the spectral properties of the S-adic random system arising from an i.i.d. sequence of unimodular substitutions, see [18]. In addition, it would be also interesting to study the dynamics induced by the map T defined in Theorem 2 from a statistical point of view (see the next section for some results for the map R). Remark 9. FC words and musical scales
FC words that are dual to one another deserve an important role in the theory of well-formed scales in music theory [19] (see also [20]). Loosely speaking, we first say that a scale is generated
if its elements can be obtained by an iterated application of a generator (Western music, since its Greek origins, has primarily used the fifth interval as a generator of harmonic systems.), i.e., a fixed transposition on a given pitch class, and then we say that a generated scale is
well formed if each generating interval spans the same number of scale steps (including the return to the original interval). A remarkable property brought to light by the recent developments in music and combinatorics on words [21] starts from the observation that, for example, the FC word , corresponding to the fraction 2/5, is the sequence of intervals corresponding to the ancient mixolydian (descending) mode B’-A-G-F-E-D-C-(B) (or else to the ascending lydian mode as a medieval ecclesiastical mode), where 0 stands for a tone and 1 for a semi-tone. If we now take the slope 4/3, where 4 and 3 are the multiplicative inverses of, respectively, 2 and 5 modulo 7, the dual FC word corresponds to the same mode B’-E-A-D-G-C-F-(Bb) but in a different presentation, where 0 now stands for a descending perfect fifth (the generator) and 1 for an ascending perfect fourth (the generator’s complement within the octave), so that the pitches reached all lie within the octave under the initial B’. The two presentations are respectively called the
scale-step pattern
and the
scale folding
of the mode. The other seven diatonic modes forming the diatonic 7-notes family can be obtained from this mode by conjugation, where we say that two elements w and of are
conjugate
if there exist words u and v such that and (or equivalently if they are conjugated in the free group ). Figure 5 (Figure 8 of Thomas Noll’s paper [22]) shows the musical folding of each (ecclesiastical) diatonic mode displayed with their corresponding scale-step pattern. In the table, which is an instance of Farey–Christoffel duality, the symbol a stands for a tone, while b for a semi-tone, whereas x is an ascending fifth and y a descending fourth. Other musical scales can be treated in the same vein, such as the pentatonic scales (starting from the scale-step pattern 01011, whose dual is 00101), or the so-called ‘tetractys’ (starting with 011, which is self-dual). This quick sketch can hopefully give a sense of the richness lying in the folds of the interaction between these domains. One interpretation of this richness may come from thinking of the FC words as divisions into “almost equal” parts (cf. Section 17.3 in [23]), in the following sense: if is relatively prime, then with positive remainder r. Therefore, n is not divisible into d equal integer parts. On the other hand, the second-best solution is to divide n into equal parts of size q, and the remaining r parts of size . By writing these parts as a word of length d, as evenly as possible, one obtains an FC word (cf. the geometric interpretation presented at the beginning of Section 2 and in Figure 3). 4. Ordering and Dynamical Systems
We shall now discuss some further aspects of the relation between the c.f.e. of a given element of
and its FC word
. To this end, we recall that any FC word
w of length
n can be written in the form shown in (
8) or (
9) depending on its slope (cf.
Section 3.2).
Then, we can construct a derived word via the following algorithm: suppose that the slope of w is smaller than one and its value is k (that is ). Then the symbol 1 is isolated and we perform the substitution and . If, instead, the slope is larger than one, and , then the symbol 0 is isolated and we perform the substitution and . We keep iterating this procedure until we end up with a single symbol, 0 or 1, while recording the values of the derived sequences. If the slope of the initial sequence w is smaller than one, we set . On the other hand, the value of a single symbol can be taken to be ∞ (as it seems natural when passing to infinite sequences by indefinite repetition of the finite string). We have the following:
Proposition 3. Let and be the corresponding FC word. The values of the successively derived words coincide with the partial quotients of the c.f.e. of x.
Proof. The proof amounts to noting that the reduction procedure corresponds to repeated applications to the slope of the map (
6)
given by
whose action of c.f.e.’s is
In the first case, if
, one sets
. More precisely, if
w has slope
x and value
k, then the derived sequence
has slope
, and value either
or
. □
In
Table 1 we give and example of this process for
.
Now, any
of depth
is the descendant of another fraction
of depth
, which we call its
antecedent, given by the following rule: if
then
and
; if instead
then
and
. Differently said,
. Therefore, according to what we have said in
Section 3.1, the binary coding
of an element
of depth
can be computed in terms of the symbolic orbit of
x with map
F:
This rule can be immediately checked for the already discussed example
. For a less trivial example, consider the fraction
, whose c.f.e. is
. It has depth
, and from Proposition 1, its symbolic coding is
. Without knowing the c.f.e., this binary sequence can be obtained from the antecedents; i.e., the
F-images of
x to the root of
. They are
and one easily checks that the sequence obtained applying rule (
12) is just
written above.
We have said that the tree
enumerates the positive rationals, but what is the ordering induced on
? Denoting again with
the
n-th rational number obtained by ‘reading’
row by row, from left to right, starting from the root, we have
The general rule is in the following:
Theorem 4. Given , let be its binary coding. Then we have with .
Example 2. The number yields ; namely, is the nine hundred seventy-third rational number in the Stern–Brocot ordering.
Proof. Let
be the element of the permuted tree
corresponding to
(or else
and
are dual elements in
). Then
if and only if
. According to the above, it holds
(or else
), where
R is the map defined in (
7). Furthermore, an easy adaptation of ([
1], Theorem 2.3) shows that
R is topologically conjugated with the dyadic odometer (or von Neumann–Kakutani transformation [
24])
, given by
and
via the map
defined in (
10), i.e.
Finally, it is well known (see, e.g., [
25]) that the map
K can be used to generate the Van der Corput sequence
, defined as follows: set first
. Then, given
, let
be its dyadic expansion and set
. The first terms of
are
Accordingly, we have
,
, and one readily gets the claim. □
Remark 10. Note that the forward orbit of 1
with R is dense in , but it grows only logarithmically, as . Moreover, according to [26,27], the following representation is in force: , , where is the number ofhyperbinaryrepresentations of n; that is, the number of ways of writing the integer n as a sum of powers of 2
, with each power being used at most twice. For instance, and thus . The two maps F and R introduced above satisfy the following remarkable commutation rule:
Proposition 4. For all , we have Proof. For the case
, the proof amounts to a straightforward verification, either by direct inspection or through the action of
F and
R on c.f.e.’s; that is (
11) and
The general case easily follows by induction. □
Note that the map
R is invertible, with inverse
On the other hand, the map
F is two-to-one, with
In particular, the set of
F-pre-images of
coincides with the set of the descendants
considered above (cf.
Section 3.1).
Therefore, as an ordered set, the tree
can be generated both ‘horizontally’, as the set of successive
R-images of 1, and ‘vertically’, as the set of successive
F-pre-images of 1:
, and, more specifically,
Regarding the ergodic properties of these maps, we start observing that
F possesses an absolutely continuous invariant measure
, which can be computed explicitly: first, the invariance means that
where the latter is the measure which assigns to each measurable set
the number
. Second, expressing this measure as
, the invariance property translates into the following functional equation for the density
h:
and one immediately checks that a continuous solution is
. Note that
; that is,
is an infinite
F-invariant a.c. measure. On the other hand, as the function
establishes a topological conjugacy between
R and the dyadic odometer
K (see (
13)), it provides a topological conjugacy also between
F and the doubling map
(as shown in [
1]), i.e.
The map
D acts as a shift on binary expansions and preserves the Lebesgue measure on the unit interval. This in particular entails that
F is
chaotic: topologically transitive, its periodic orbits are dense, and it has sensitive dependence on the initial conditions.
Since the Lebesgue measure is also preserved by the invertible map
K, the conjugacies (
13) and (
17) ensure that both
F and
R leave invariant the probability measure
.
On the other hand, with all orbits , being dense, the dynamical system is uniquely ergodic, and therefore, is its unique invariant measure. In a different guise, the map F possesses several invariant measures, two of which are and , which are of course singular with respect to one another. In particular, as the entropy of the doubling map D with respect to the Lebesgue measure is log 2, this same value is also the entropy of F with respect to the probability measure , which is therefore called the measure of maximal entropy for F.
An Alternative Ordering
Proposition 4 can be viewed as expressing the fact that the “horizontal” action of the map
R respects the order induced by the “vertical” action of the map
F on the tree. Moreover, the conjugation (
17) between
F and
D can be obtained in two steps, passing via map
through the orientation preserving Farey map
, so that
. We can ask whether there is an orientation-reversing version of the above constructions. For instance, if we consider the standard Farey map
H, then the map
, given by
is conjugated via
with the tent interval map
T; i.e., (
17) is replaced by
. Therefore,
is the measure of maximal entropy for
G as well. In addition, one easily verifies that
G also preserves the a.c. measure with density
. We also note that
, where
is the golden mean, since
is a repelling fixed point.
Now, what is the map
which plays the role of
R in this orientation-reversing setting? A close inspection based on continued fraction expansions leads to the following expression:
We also set
,
and
. Now note that
where
is the
ℓ-th Fibonacci number, given by
We then construct the sequence
as
, whose first elements are
and observe that
S is continuous everywhere but at the points
,
, where it is right-continuous. An alternative expression for
S is thus the following:
where
One checks that for all
, it holds
5. Motions on the Modular Surface
F can be obtained as the factor map of a first return map for the geodesic flow on the modular surface. Let us briefly recall what this means.
Let be the upper half-plane, viewed as a Riemmanian manifold with hyperbolic metric . Set , with , endowed with the quotient topology. We recall that the Fuchsian group has two generators U and V, which can be chosen as and . It holds (so that is not a free group).
Let
be the geodesic flow on the unit tangent bundle of
M, and let us construct a subset of
which is met infinitely many times by each
-orbit. To this end, set
and consider the section
C made by the projections on
of all vectors of
having a base point on
and being right-oriented; that is, vectors of the form
with
and
. One easily sees that the elements thus selected are all distinct. There are however
-orbits which do not visit
C infinitely often. These are exactly the projections of geodesics which either start or end in a cusp of
, which is a rational point on the real line. On
, these orbits converge towards (or come from) the cusp at infinity and for this reason they are called
scattering geodesics. They form of course a set of zero measures.
Now, a vector
whose projection lies in
C can be described by the two asymptotic coordinates
u and
w which identify the geodesic
having a tangent vector
v at
. Hence,
In turn,
C can be decomposed as
where
Figure 6 shows a geodesic
such that the projection on
of
belongs to
.
We now construct the
first return map which sends each intersection of a
-orbit with
C to the next one. To this end, we consider the geodesic triangle
with vertices 0, 1 and
∞, that is
Its three sides are equivalent with regard to
:
and
are mapped to
by the transformations
and
, respectively. Now, suppose that the projection of
lies in
C and has coordinates
. There are two possibilities: if the projection of
v lies in
(so that the geodesic
determined by
v leaves
through
), then it is mapped by
to
; if instead the projection of
v lies in
(so that
leaves
through
), then it gets mapped by
to
. Therefore, the first return map on
is
The action of
on the second coordinate finally yields the
factor map given by (
6).
Now, referring to
Figure 7, one can produce a tessellation of
by taking all the images of the geodesic triangle
with the isometries
A and
B (acting as Möbius transformations).
Moreover, a direct consequence of the generating rule (
12) is that, given
, the matrix product
X dealt with in Proposition 1, as well as the corresponding binary sequence
, are in a one-to-one correspondence with the coding with regard to the above tessellation of the scattering geodesic
which converges to
, the central cusp of the geodesic triangle
, as shown in
Figure 8 (see [
28]).
In a similar fashion as finite paths on
correspond to scattering geodesics on
, we can establish a correspondence between FC words and
Ford circles. These are a countable family of circles orthogonal to the sides of the just-mentioned geodesic triangles. Each of them, denoted
, is tangent to
in some rational point
, and has diameter
. The largest circles thus have a unit diameter and correspond to
,
(
Figure 9 shows
,
,
,
and
).
Clearly, each Ford circle with corresponds to a unique FC word w with , and vice versa.
Ford circles and scattering geodesics are related as follows:
First, the image with of the vertical geodesic is a geodesic connecting and . is a Farey triangle with a central cusp in .
If, instead, we apply to the positive and negative horocycles of , namely the horizontal line (B-invariant) and the circle (A-invariant), we obtain two Ford circles:
, of diameter and tangent to in ;
, of diameter and tangent to in ;
which touch each other at the point . The “child” circle touches the cusp at , and the “parents” circles and at and , respectively. Finally, the geodesics that cross perpendicularly (in particular ) converge at the cusp.
Example 3. , (see Figure 9). One easily checks that the two Ford circles
and
, with
, are either tangent to each other or they do not intersect, and the former situation occurs whenever
. Moreover, three Ford circles
,
and
with
are tangent to each other if and only if
(see, e.g., Theorems 5.6 and 5.7 in [
29]).
We can say more, but first, we briefly present the classical correspondence between a matrix
and
. Given
, with
and
, we can identify
with
by corresponding
v to the unique element
such that
and
, where
is the unit vector tangent to the imaginary axis. One can also write the unit tangent vector as
where
is the angle formed by
with the vertical line, measured counterclockwise. By identifying
with
, we obtain the parametrization
for the points in
, and
where
is given by
In this way, the action of the
positive and
negative horocyclic flows and
on
corresponds to the right multiplication by one-parameter subgroups of matrices
This also assures us of the commutativity between isometries and flows, since the former act from the left while the latter act from the right. Finally, we can say the following: consider the correspondence between an element
and
, given by (
2), and the correspondence between a matrix
, viewed as an element of
, and
, given by (
23). This gives a correspondence between elements in
and points
, as follows:
recalling that
.
However, this correspondence is not a bijection since the same point in can be associated with multiple points in and hence with multiple , which are not even associated to some . But considering the direction from to , which is well defined, we get a correspondence between x and .
Moreover, for our scope, we just need to prove that
correspond to
with
and opposite vectors
and
.
But this is easily shown considering
and recalling that
,
So, we have a direct way to determine both
x and
z from
, where
z is obtained in the canonical way, and
Example 4. As in the previous example, we have , which indeed is the negative horocycle for , with and the positive horocycle for , with (see Figure 9). With the elements presented thus far, we can show that the horizontal movement on corresponds to horocyclic flows along Ford circles. To this end, we first present the following.
Lemma 7. The horocyclic flow with unit time on a Ford circle moves from a tangency point with another Ford circle to the next one.
Proof. From the content of this section, we know that the Ford circles associated with (the horizontal line) and can be mapped to any other Ford circle via an isometry. We can consider the Ford circle associated with and the tangency point with another Ford circle associated with . Then, both horocyclic flows, with either negative or positive unit time, are mapped to the respective flows on the Ford circles and . For these, it can be directly checked that, moving with unit time (positive or negative), we are moving from the starting tangency point to the next one in the corresponding direction along the corresponding horocycle. This proves the lemma. □
To state the next result, for any positive integer
t, we set
so that, in particular,
and
.
Then, the horocyclic flows with time
t correspond to either
or
, as in (
24). Moreover, as shown in (
25) and (
26), we recall that each fraction
x in
(and
) corresponds to the tangency point between the parents of the Ford circle
, and vice versa.
We can now state the following:
Theorem 5. The horizontal displacement on , starting at the root 1 and moving from left to right on each level, corresponds to clockwise motion along Ford circles. More precisely, assume that we reached , the m-th element of , as in Theorem 4, with . Then, the move to the next element corresponds to the following displacement (via horocyclic flow) on Ford circles:
If x is the rightmost element in a level, i.e., , then moving to y corresponds to applying when n is even and when n is odd;
If, instead, x is either the leftmost or an inner element in a level, i.e., for some and , with , then moving to y corresponds to applying if , otherwise.
Proof. Firstly, it is important to note that when considering the horocyclic flows, each time we move from one Ford circle to another tangent to it, the vector switches direction from inward to outward, or vice versa. This means that, since the movement is clockwise, we transition from the positive horocyclic flow with negative time (to the left of the vector) to the negative horocyclic flow with positive time (to the right of the vector), or vice versa, from to . Since each level of the tree contains an even number of elements, as we move along the level, we perform an odd number of swaps between horocycles before reaching the last element . This element corresponds to , i.e., the point of tangency between and (the parents of ). As a result, the vector will point in the opposite direction compared to with regard to . Therefore, when moving from one level to the next, say from n to , we alternate between , when n is odd, and , when n is even. In this way, the direction of the vector v is reversed two more times, and the next level starts from with the vector in the opposite direction compared to . Thus, the horocyclic flow that begins at the start of a level n of the tree corresponds to A if n is odd, and to D if n is even.
Now let , where , with , so that it is the k-th element of the n-th level of . If we want to move horizontally to the next element , we have two possibilities: either , in which case we move to position on the same level, or is the first element of the next level . However, we have already discussed this case, so, from now on, we will consider .
If k is odd, then x is the left child of its parent node , and is the right child. In , each of these two corresponds to the tangency points between the Ford circle of and the Ford circle of the other parent. Therefore, as in Lemma 7, moving from one point to the next along corresponds to the horocyclic flow with , which, depending on the orientation of the vector v, corresponds to A if n is odd, or D if n is even.
If, instead, k is even, then we have a right child, and its parent is different from the parent of . Indeed, we need to go back at least two levels to find a common ancestor. Considering the structure of the tree, one can see that for , the number of steps needed to reach the common ancestor is 1, 2, 1, 3, 1, 2, 1, , , 1, …, 1. In general, for , for , we need p steps. This can be easily proven by induction on the level of the tree. For , it is trivially true. Assuming the formula holds for levels up to n, it follows that, by construction, for all the new left children, which correspond to , the formula holds. For a given right child x, the common ancestor with the node directly to its right, which coincides with the common ancestor of its parent with the node to its right, is one step further than the number of steps required from its parent . By induction, from , corresponding to , we need p steps, so from x, we will need . From one level to the next, the nodes duplicate, and x will be at the position so that , as required.
We have that both and correspond to points on the Ford circle associated with the (nearest) common ancestor , specifically to the points of tangency with their respective parent. On the horocycle, between them, there are points, where p is the number of steps required to reach the common ancestor. Indeed, all the nodes traverse while moving up from to the ancestor form a Farey pair with y, as do the nodes traversed to reach down to , and, by the properties of and the Ford circles, these are all and only the points that lie between them. Thus, following the ideas in the proof of Lemma 7, this movement corresponds to the horocyclic flow with time . The exact one, A or D, depends on m, and, more directly, on n and k. As we have seen, for even n, odd k corresponds to D and even k corresponds to A, while the reverse is true when n is odd. □
We already showed how the scattering goedesics in are correlated with the vertical movement on the Stern–Brocot tree . With this theorem, we established a parallel between Ford horocycles, which are orthogonal to the geodesics defined in the Farey tessellation, and the horizontal movement on .
Remark 11. The repeated horizontal movement on can be interpreted geometrically as a cyclical movement along the upper arcs of the Ford circles and, dynamically, as a repeated composition of horocyclic flows. This corresponds to a repeated right multiplication of matrices, expressed aswhere the brackets correspond to the jump to the next level on , or equivalently, to the return to i in and subsequent descent towards . Remark 12. If one wants to consider the horizontal movement on the n-th level of as a composition of horocyclic flows but always resetting and starting from , we would havewhich more clearly show the palindromic and symmetric nature of the movement along a level of , obviously already present in Theorem 5. To conclude, we provide
Figure 10,
Figure 11,
Figure 12 and
Figure 13 to visualize the motions described in Theorem 5. In the first figure, we indicate the direction of traversal of the circles, which will be omitted in the subsequent figures, as it remains the same, i.e., clockwise. Additionally, clockwise is considered the negative direction along the horizontal line
. After the first two figures, we will omit vectors and points to reduce clutter. Moreover, in all figures, we color-code the horocyclic flows: red (
) for the negative horocycle
, associated with positive time, and blue (
) for the positive horocycle
, associated with negative time (Cf. the correspondence (
24)). Specifically, red represents
, and blue represents
, where
denotes the number of tangent points that must be surpassed to reach the end of the arc. A note is due: in the figures showing the movement on the
n-th level, we have added, for completeness, the descent from
to the first element of the
n-th level, which would not be included in the movement through the level. Visually, it corresponds to the leftmost colored arc, descending from
i along
.