Acta Polytechnica

We focus on a generalization of the three gap theorem well known in the framework of exchange of two intervals. For the case of three intervals, our main result provides an analogue of this result implying that there are at most 5 gaps. To derive this result, we give a detailed description of the return times to a subinterval and the corresponding itineraries.


Introduction
The well-known three gap theorem provides information about gaps between consecutive integers n for which {αn} < β with α, β ∈ (0, 1), where the notation {x} = x − x stands for the fractional part of x.In particular, the gaps take at most three values, the longest one being the sum of the other two.This result was first proved by Slater [14], but it appeared in different versions and generalizations multiple times since.For a nice overview of this problem we refer to [1].The reason is that the theorem can be interpreted in the framework of coding with respect to intervals [0, β), [β, 1) of rotation by the angle α on the unit circle.For irrational α and β = 1 − α, such coding gives rise to famous Sturmian words.The three gap theorem is then intimately connected with the dynamical system associated with codings of rotations, induced transformations, return times and return itineraries.See also [8] for a distinct setting of exchange of two intervals related to the three gap theorem.
Codings of rotations are advantageously interpreted in the language of interval exchange.The simplest case provides Sturmian words as codings of exchange of two intervals.We follow the study on itineraries induced by exchange of two intervals, presented in [13], to study the exchange of three intervals.
In this article we focus on codings of a nondegenerate symmetric exchange T : J → J of three intervals.The main result is the description of the return times to a general interval I ⊂ J and an insight into the structure of the set of I-itineraries, i.e., the finite words that are codings of the return trajectories to I (see the definition below).These results are given in Theorem 4.1 and then interpreted as analogues of the well-known three gap and three distance theorems (see Section 6).
Particular attention is paid to the special cases when the set of I-itineraries has only three elements.These cases belong to the most interesting from the combinatorial point of view, since they provide infor-mation about return words to factors, and about the morphisms preserving three interval exchange words.These specific cases are studied in Section 5.This allows us to describe the return words to palindromic bispecial factors, which can be seen as a complement to some of the results in [6].We also focus on substitutions fixing words coding interval exchange transformations.The latter has implications [12] for the question of Hof, Knill and Simon [10] about palindromic substitution invariant words with application to aperiodic Schrödinger operators.

Combinatorics on words
A finite word w = w 0 • • • w n−1 is a concatenation of letters of a finite alphabet A. The number n of letters in w is the length of w and is denoted by |w|.The set of all finite words over an alphabet A, including the empty word , with the operation of concatenation forms a monoid, denoted by A * .One considers also infinite words u = u 0 u 1 u 2 • • • ∈ A N .If u ∈ A * ∪ A N and u = vwz, for some v, w ∈ A * and z ∈ A * ∪ A N , we say that v, w, z are factors of u.In particular, v is a prefix and z is a suffix of u.We write wz = v −1 u, vw = uz −1 .An infinite word u is said to be aperiodic if it does not have a suffix of the form wwww • • • .
If the infinite word u contains at least two occurrences of each of its finite factors, then it is said to be recurrent.If the distances between two consecutive occurrences of every factor are bounded, then u is uniformly recurrent.If w, v are factors of u such that vw is also a factor of u and vw contains w as its prefix and as its suffix but not anywhere else, then v is a return word to w in u.Thus u is uniformly recurrent if and only if each factor w of u has finitely many return words.
The language of an infinite word u is the set of all its finite factors.It is denoted by L(u).The number of factors of u of length n defines the factor complexity function C u : N → N. It is known that aperiodic infinite words have complexity C u (n) ≥ n + 1 for n ∈ N. Sturmian words are aperiodic words with minimal factor complexity.

Exchange of three intervals
Given a partition of an interval J into disjoint union of intervals J 1 , . . ., J k , the exchange of k intervals is a bijection determined by a piecewise translation permuting the intervals according to a prescribed permutation π.In the article, we consider the case: let k = 3, 0 < α < β < 1, and T : [0, 1) → [0, 1) be given by ( The transformation T is an exchange of three intervals with the permutation (321).It is often called a 3iet for short.The orbit {T n (ρ) : n ∈ Z} of a point ρ ∈ [0, 1) can be coded by an infinite word u ρ = u 0 u 1 u 2 . . .over the alphabet {A, B, C} given by The infinite word u ρ is called a 3iet word, the point ρ is called the intercept of u ρ .An exchange of intervals satisfies the minimality condition if the orbit of any given ρ ∈ [0, 1) is dense in [0, 1), which amounts to requiring that 1 − α and β be linearly independent over Q.Then the word u ρ is aperiodic, uniformly recurrent, and the language of u ρ does not depend on the intercept ρ.The complexity of the infinite word u ρ is known to satisfy C uρ (n) ≤ 2n + 1 (see [6]).If for every n ∈ N equality is achieved, then the transformation T and the word u ρ are said to be non-degenerate.A necessary and sufficient condition for a 3iet T to be non-degenerate is that T is minimal and 1 / ∈ (1 − α)Z + βZ; (2) see [6].

Itineraries in exchange of three intervals
Definition 3.1.Given a subinterval I ⊂ [0, 1), we define the so-called return time to I as a mapping r I : The prefix of the word u x of length r I (x) coding the orbit of x ∈ I under a 3iet T is called the I-itinerary of x and denoted R I (x).The set of all I-itineraries is denoted by It I = { R I (x) : x ∈ I }.The map T I : I → I defined by is called the first return map of T to I, or induced map of T on I.The indices in r I or R I are usually omitted, if this causes no confusion.
For a given subinterval I ⊂ [0, 1) there exist at most five I-itineraries under a 3iet T .In particular, from the article of Keane [11], one can deduce what the intervals of points with the same itinerary are.We summarize it as the following lemma.Lemma 3.2.Let T be a 3iet defined by (1) and let and further For x ∈ I, let K x be a maximal interval such that for every y ∈ K x , we have For a 3iet T , Lemma 3.2 implies that T I is an exchange of at most 5 intervals.Consequently, the transformation T I has at most four discontinuity points.In fact, the following result of [9] says that independently of the number of I-itineraries, the induced map T I has always at most two discontinuity points.Proposition 3.3 [9].Let T : J → J be a 3iet with the permutation (321) and satisfying the minimality condition, and let I ⊂ J be an interval.The first return map T I is either a 3iet with permutation (321) or a 2iet with permutation (21).In particular, in the notation of Lemma 3.2, we have D ≤ C.
We will use two other facts about itineraries of an interval exchange, stated as Propositions 3.4 and 3.5.Both of these were proven in [12] for general interval exchange transformations with symmetric permutation and thus hold also for 3iets with permutation (321).
Note that a 3iet T is right-continuous.Therefore, if In particular, if # It I = 5, then It Ĩ = It I .

Return time in a 3iet
The aim of this section is to describe the possible return times of a non-degenerate 3iet T to a general subinterval I ⊂ [0, 1).Our aim is to prove the following theorem.
Theorem 4.1.Let T be a non-degenerate 3iet and let I ⊂ [0, 1).There exist positive integers r 1 , r 2 such that the return time of any x ∈ I takes value in the set First, we will formulate an important lemma, which needs the following notation.Given letters X, Y, Z ∈ {A, B, C} and a finite word w ∈ {A, B, C} * , let ω XY →Z (w) be the set of words obtained from w replacing one factor XY by the letter Z, i.e., Similarly, Clearly, By abuse of notation, we write Lemma 4.2.Assume that the orbits of points α, β, γ and δ are mutually disjoint.For sufficiently small ε > 0, we have the following relations between Iitineraries of points in I: where A, B, C, D are given in Lemma 3.2.
Proof.We will first demonstrate the proof of the case (a For simplicity, denote t = max{ r I (x) : x ∈ K } the maximal return time.The existence of such ε follows trivially from the definition of the interval exchange transformation and the assumptions of the lemma.
It follows from the definition of A and condition ( 7) that for all i such that 0 < i ≤ k α we have T i (K) ∩ I = ∅.Moreover, condition (7) implies that all such T i (K) are intervals.It implies that for any x, y ∈ K, the prefixes of R(x) and R(y) of length k α + 1 are the same.Denote this prefix by w.
The definition of k α implies that α ∈ T kα (K).Since and thus This implies that the set Thus, the iterations x, T (x), . . ., T t−kα−2 (x) of every x ∈ K are coded by the same word, say v.
The whole situation is depicted in Figure 1.From what is said above, we can write down the I-itineraries This finishes the proof of (a).The claim in item (c) is analogous to (a).Cases (b) and (d) are derived from (a) and (c) by the use of equivalence (6).

Let us now demonstrate the proof of the case (e). Denote s
The existence of such ε follows trivially from the definition of the interval exchange transformation and the assumptions of the lemma.
. Condition ( 8) implies that T i (K) is an interval for all i such that 0 < i ≤ k δ +s.Moreover, T i (K)∩I = ∅ for all i such that 0 < i < k δ .We obtain T k δ (K)∩I = [δ − ε, δ).In other words, the I-itineraries of all points of K start with a prefix of length k δ which is equal to R(D − ε).Condition (8) and the definition of s implies that for all i such that k δ < i < s + k δ we have T i (K) ⊂ J X for some X ∈ {A, B, C} and Case (f) can be treated in a way analogous to case (e).Now we can prove the main theorem describing the return times in 3iet.In the proof, it is sufficient to focus on the case when # It I = 5, since, as we have seen from Proposition 3.4, the set of I-itineraries, and thus also their return times, for the other cases are only a subset of It Ĩ for some "close enough" generic subinterval Ĩ ⊂ [0, 1).So throughout the rest of this section, suppose that # It I = 5.This means by Lemma 3. Proof of Theorem 4.1.We will discuss the 12 possibilities of ordering of points A, B, C, D in the interior of the interval [γ, δ) with the condition D < C. The structure of the set of I-itineraries will be best shown in terms of I-itineraries of points in the left neighbourhood of the point D and right neighbourhood of the point C.For simplicity, we thus denote for sufficiently small positive ε In order to be allowed to use Lemma 4.2, we will assume that the orbits of points α, β, γ and δ are mutually disjoint.Otherwise, we use Proposition 3.4 to find a modified interval Ĩ where this is satisfied and Further, we use rule (c) to . show that R(x) = ω CA→B (R 1 ) for x ∈ [A, B) and further by applying rule (a), we obtain that It is easy to see that the lengths of the above Iitineraries are t 1 , t 1 − 1, t 1 , t 1 + t 2 , t 2 , respectively.
For that, realize that by definition (4) and ( 5) of the action of ω XY →Z and ω Z→XY , the length of the word ω B→AC ω CA→B (R 1 ) is equal to the length of the itinerary R 1 , i.e. t 1 .Setting r 1 = t 1 − 1 and r 2 = t 2 , we obtain the desired return times.The proofs of the other cases are analogous, we state the results in terms of R 1 and R 2 .
(iv) Let D < C < B < A. We obtain respectively.We set r 1 = t 1 and r 2 = t 2 .
(vi) Let D < A < C < B. We obtain respectively.We set r 1 = t 1 and r 2 = t 2 .
(viii) Let D < B < C < A. We obtain 29 100 99 100 1 100 99 100 12,13,12,11] Table 1.The cases (i)-(xii) from the proof of Theorem 4.1 for α = 1 Lemma 4.2 in a different order.By doing so, we would obtain the itineraries expressed differently, which yields interesting relations between words R 1 , R 2 .For example, in the case (ix), we derive that the Note also the symmetries between the cases (i) and (ii), (iii) and (iv), (v) and (vi), (vii) and (viii), in consequence of Proposition 3.5.Indeed, if we exchange the pair of points D ↔ C, B ↔ A, letters A ↔ C, and finally the inequalities "<" and ">", we obtain a symmetric situation in the list of cases we discussed in the proof.In this sense, each of cases (ix) up to (xii) is symmetric to itself.

Description of the case of three I-itineraries
The cases (i)-(xii) in the proof of Theorem 4.1 correspond to the generic instances of a subinterval I in a non-degenerate 3iet which lead to 5 different I-itineraries.Let us focus on the cases where, on the contrary, the set of I-itineraries has only 3 elements.First we recall two reasons why such cases are interesting.
For a factor w from the language of a nondegenerate 3iet transformation T , denote It is easy to see that [w] -usually called the cylinder of w -is a semi-closed interval and its boundaries belong to the set {T −i (z) : 0 ≤ i < n, z ∈ {α, β}}.Clearly, a factor v is a return word to the factor w if and only if v is a [w]-itinerary.It is well known [16] that any factor of an infinite word coding a non-degenerate 3iet has exactly three return words and thus the set It [w] has three elements.
The second reason why to study intervals I yielding three I-itineraries is that any morphism fixing a nondegenerate 3iet word corresponds to such an interval I. Details of this correspondence will be explained further in this section.Proposition 5.1.Let T be a non-degenerate 3iet and let I = [γ, δ) ⊂ [0, 1) be such that # It I = 3.One of the following cases occurs: Sketch of a proof.Since by Lemma 3.2 the subintervals of I corresponding to the same itinerary are delimited by the points A, B, C and D, we may have # It I = 3 only if some of these points coincide, more precisely if #{A, B, C, D} = 2.The non-degeneracy of the considered 3iet implies that always A = B, which further limits the discussion.The six cases listed in the statement are the possibilities of how this may happen, respecting the condition D < C or D = C.In order to describe the itineraries, denote again for ε > 0 sufficiently small.One can then follow the ideas of the proof of Lemma 4.2.

Return words to factors of a 3iet
Let us apply Proposition 5.1 in order to provide the description of return words to factors of a non-degenerate 3iet word.If a factor w has a unique right prolongation in the language L(T ), i.e. there exists only one letter a ∈ A such that wa ∈ L(T ), then the set of return words to w and the set of return words to wa coincide.And (almost) analogously, if a factor w has a unique left prolongation in the language L(T ), say aw for some a ∈ A, then a word v is a return word to w if and only if ava −1 is a return word to aw.Consequently, to describe the structure of return words to a given factor w, we can restrict to factors which have at least two right and at least two left prolongations.Such factors are called bispecial.It is readily seen that the language of an aperiodic recurrent infinite word u contains infinitely many bispecial factors.Before giving the description of return words to bispecial factors, we state the following lemma.Let us recall that for a word w the notation w denotes the reversal of w while for an interval  The language of T contains two types of bispecial factors: palindromic and non-palindromic.In [6], Ferenczi, Holton and Zamboni studied the structure of return words to non-palindromic bispecial factors.The following proposition completes this description.Proposition 5.3.Let w be a bispecial factor.If w is a palindrome, then its return words are described by the cases (i) and (ii) of Proposition 5.1.If w is not a palindrome, then its return words are described by the cases (iii) -(vi) of Proposition 5.1.
Proof.Let w be a bispecial factor.If w is not a palindrome, the claim follows from Theorem 4.6 of [6].

Substitutions fixing 3iet words
Another application of Proposition 5.1 is providing some information about substitution having as a fixed point a non-degenerate 3iet word.A substitution over an alphabet A is a morphism η : A * → A * such that η(b) = for b ∈ A and there is a letter a ∈ A satisfying η(a) = aw for some non-empty word w.The action of η can be naturally extended to infinite words u ∈ A N by setting η(u) = η(u 0 )η(u 1 )η(u 2 ) . ... If η(u) = u, then u is said to be a fixed point of η.Obviously, a substitution always has the fixed point lim n→∞ η n (a) where the limit is taken over the product topology.A substitution η is primitive if there exists an integer k such that for all a, b ∈ A, the letter b occurs in η k (a).
3iet words fixed by a substitution were studied in [3] and [5].In [3] it was shown that a substitution fixing a non-degenerate 3iet word corresponds to an interval I such that the induced transformation is homothetic to the original one.More precisely, we have the following theorem.
Theorem 5.4 [3].Let ξ be a primitive substitution over {A, B, C} and let T be a non-degenerate 3iet.If substitution ξ fixes the word u ρ coding the orbit of a point ρ ∈ [0, 1) under T , then there exists an interval I ⊂ [0, 1) such that the induced transformation T I is homothetic to T , the set of I-itineraries is equal to Using the above theorem together with Proposition 5.1, one can derive information about the itineraries which determine the substitution η.Corollary 5.5.Let η be a primitive substitution as in Theorem 5.4 fixing a non-degenerate 3iet word over the alphabet {A, B, C}.We have Proof.By Theorem 5.4, η corresponds to an interval I such that T I is homothetic to T .Since T is nondegenerate, also T I is non-degenerate, and therefore its discontinuity points C, D are distinct.By Proposition 5.1, the three I-itineraries are of the form given by cases (i) or (ii).
Example 5.6.We can illustrate the above corollary on the substitution The morphism η satisfies the property given in Corollary 5.5 (see [12]).Namely, we have As a consequence of Corollary 5.5, we have for the columns of the incidence matrix M η that Thus, (1, −1, 1) is an eigenvector of M η corresponding to the eigenvalue 1 and −1, respectively.This fact has been already derived in [2] by other methods.

Gaps and distance theorems
Let us reinterpret the statement of the main result (Theorem 4.1) from the point of view of three gap and three distance theorems which are narrowly connected with the exchange of two intervals.Under the name three gap theorem one usually refers to the description of gaps between neighbouring elements of the set where α ∈ R \ Q, δ ∈ (0, 1), see [15].Sometimes one uses a more general formulation, namely the set where moreover ρ ∈ R, 0 ≤ γ < δ < 1.The three gap theorem states that there exist integers r 1 , r 2 such that gaps between in G(α, ρ, γ, δ) take at most three values, namely in the set {r 1 , r 2 , r 1 + r 2 }.Let us interpret the three gap theorem in the framework of exchange of two intervals J 0 = [0, 1 − α), J 1 = [1 − α, 1).The transformation T : [0, 1) → [0, 1) is of the form i.e., T (x) = {x + α}.Therefore we can write G(α, ρ, γ, δ) := n ∈ N : T n (ρ) ∈ [γ, δ) , (10) and the gaps in this set correspond to return times to the interval [γ, δ) under the transformation T .Our Theorem 4.1 is an analogue of the three gap theorem in the form (10) generalized for the case when the transformation T is a non-degenerate 3iet.We see that there are 5 gaps, but still expressed using two basic values r 1 , r 2 .
We could try to study the analogue of the three distance theorem in the form (11) for exchanges of three intervals.In fact, it can be derived from the results of [9] that if T is a 3iet with discontinuity points α, β, then D(α, β, ρ, N ) := T n (ρ) : n ∈ N, n < N has again at most three distances ∆ 1 , ∆ 2 , and ∆ 1 +∆ 2 for some positive ∆ 1 , ∆ 2 .
The three distance theorem can also be used to derive that the frequencies of factors of length n in a Sturmian word take at most three values.Recall that the frequency of a factor w in the infinite word u = u 0 u 1 u 2 . . . is given by freq(w) := lim #{ 0 ≤ i < N : w is a prefix of u i u i+1 . . .} , if the limit exists.
It is a well known fact that the frequencies of factors of length n in a coding of an exchange of intervals are given by the lengths of cylinders corresponding to the factors.The boundary points of these cylinders are T −j (1 − α), for j = 0, . . ., n − 1.Consequently, the distances in the set D(α, 1 − α, N ) are precisely the frequencies of factors, and the three distance theorem implies the well known fact that Sturmian words have for each n only three values of frequencies of factors of length n, namely 1 , 2 , 1 + 2 .
The frequencies of factors of length n in 3iet words are given by distances between neighbours of the set In [4] it is shown, based on the study of Rauzy graphs, that the number of distinct values of frequencies in infinite words with reversal closed language satisfies #{ freq(w) : w ∈ L(u), |w| = n } ≤ 2 C u (n) − C u (n − 1) + 1, which in case of 3iet words reduces to ≤ 5. Article [7] shows that the set of integers n for which this bound is achieved is of density 1 in N.

Figure 1 .
Figure 1.Situation in the proof of Lemma 4.2, case (a).
2 that points A, B, C, D lie in the interior of the interval I = [γ, δ) and are mutually distinct.Moreover, by Proposition 3.3, we have D < C. Such conditions imply 12 possible orderings of A, B, C, D which give rise to 12 cases in the study of return times.We will describe them in the proof of Theorem 4.1 as cases (i)-(xii) and then show in Example 4.5 that all 12 cases may occur.Remark 4.3.Note that if γ = 0, i.e. we induce on an interval I = [0, δ), we have T −1 (γ) = β and therefore necessarily B = C. Thus there are at most four Iitineraries.Due to Proposition 3.5, a similar situation happens if δ = 1.

Figure 2 .
Figure 2. Situation in the proof of Lemma 4.2, case (e).

5 √ 5 − 1 5 , β = − 1 6 √ 5 + 2 3
as in Example 4.5.The endpoints of the interval I = [γ, δ) are in the first and second column.The last column contains a list of lengths of I-itineraries of all 5 subintervals of I starting from the leftmost one.

Example 4 . 5 . 5 √ 5 − 1 5 and β = − 1 6 √ 5 + 2 3 .
Set α = 1 Table1 shows12 choices of I = [γ, δ) which produce 12 distinct orders of the points A, B, C and D, shown in the third column.The last column contains the respective lengths of the 5 distinct I-itineraries.Let us describe in detail one of the cases, namely the case B < D < C < A. The induced interval is determined by setting γ = 29 100 and δ = 99 100 .One can verify that B = T −0 (β953224925083256.It corresponds to the case (x) in the proof of Theorem 4.1 with R 1 = CA and R 2 = CAC.The I-
Itineraries induced by exchange of three intervalsProof.According to the definition of [w], for each [w]-itinerary r, the word rw belongs to the language and w occurs in rw exactly twice, as a prefix and as a suffix.In other words r is a return word to w.Moreover, [w] is the maximal (with respect to inclusion) interval with this property.It follows also that if r is an [w]-itinerary, then the word w −1 rw is a T n ([w])-itinerary.Applying Proposition 3.5 to the interval T n ([w]) we obtain that s := w −1 rw is an T n ([w])-itinerary.Since the word sw = rw has a prefix w and a suffix w, with no other occurrences of w, the word s is a return word to w and thus by definition of the cylinder, s = w −1 rw belongs to [w]-itinerary for any T n ([w])-itinerary s.From the maximality of the cylinder we have T n ([w]) ⊂ [w].Since the lengths of the intervals [w] and T n ([w]) coincide we see, in particular, that the length of the interval [w] is less or equal to the length of the interval [w].But from the symmetry of the role w and w, their length must be equal and thus T n ([w]) = [w].
has a solution if and only if R = L. Thus, we have neither A = C = D nor B = C = D and we are in the case (i) or (ii) of Proposition 5.1.

Corollary 5 .
5 implies a relation of numbers of occurrences of letters in letter images of η which may be used to get an interesting relation for the incidence matrix M η of η.It is an integer-valued matrix defined by (M η ) ab = |η(a)| b for a, b ∈ A.