Almost everywhere balanced sequences of complexity 2n+1
AALMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY n + 1 JULIEN CASSAIGNE, SÉBASTIEN LABBÉ, AND JULIEN LEROY
Abstract.
We study ternary sequences associated with a multidimensional continued fractionalgorithm introduced by the first author. The algorithm is defined by two matrices and we showthat it is measurably isomorphic to the shift on the set { , } N of directive sequences. For a givenset C of two substitutions, we show that there exists a C -adic sequence for every vector of letterfrequencies or, equivalently, for every directive sequence. We show that their factor complexity is atmost 2 n +1 and is 2 n +1 if and only if the letter frequencies are rationally independent if and only ifthe C -adic representation is primitive. It turns out that in this case, the sequences are dendric. Wealso prove that µ -almost every C -adic sequence is balanced, where µ is any shift-invariant ergodicBorel probability measure on { , } N giving a positive measure to the cylinder [12121212]. We alsoprove that the second Lyapunov exponent of the matrix cocycle associated to the measure µ isnegative. Contents
1. Introduction 12. A bidimensional continued fraction algorithm 63. Semi-norm of matrices and convergence 94. Convergence in the monoid generated by C and C , f C ) 227. Word frequencies 248. Balance property 249. The second Lyapunov exponent 3010. Factor complexity 3111. Conjugacy with a semi-sorted version of Selmer algorithm 36Appendix 39References 391. Introduction
A theorem of Dirichlet says that every positive irrational number α has infinitely many rationalapproximations pq ∈ Q such that | α − pq | < q . Such approximations can be computed from thecontinued fraction expansion of αα = [ a ; a , a , . . . ] = a + 1 a + 1 a + 1 . . . Date : February 22, 2021.2010
Mathematics Subject Classification.
Primary 37B10; Secondary 68R15 and 11J70 and 37H15.
Key words and phrases.
Substitutions and factor complexity and Selmer and continued fraction and bispecialand Lyapunov exponents and balance. a r X i v : . [ m a t h . D S ] F e b J. CASSAIGNE, S. LABBÉ, AND J. LEROY where a ∈ N and a , a , . . . ∈ N \ { } . Indeed, for all n ∈ N , the truncation p n q n = [ a ; a , . . . , a n ]provides a sequence ( p n /q n ) n ∈ N of rational approximations of α called convergents satisfying Dirich-let’s theorem. Equivalently, the convergents p n /q n can be computed from a product of the matrices A = ( ) and A = ( ) involving the above sequence of partial quotients: p n +1 p n q n +1 q n ! = A a A a A a · · · A a n +1 . The convergence of p n /q n to α then implies that(1) α ! R ≥ = \ k ≥ A i A i · · · A i k R ≥ where the sequence ( i n ) n ∈ N ∈ { , } N is 1 a a a · · · a k a k +1 · · · . Equation (1) holds even if 1 and2 do not both occur infinitely many times in ( i n ) n ∈ N , in which case α is rational. If ∆ = { ( x, y ) ∈ R ≥ | x + y = 1 } denotes the projection of the positive cone, Equation (1) defines a continuousand onto map π : { , } N → ∆. This map is almost one-to-one and its (almost everywhere) inverseis obtained by iterating the normalized Euclid’s algorithm f E which successively applies either x A − x / k A − x k or x A − x / k A − x k , according to whether x ∈ A R ≥ or x ∈ A R ≥ .Thus the shift map on { , } N defines a symbolic representation of the dynamical system (∆ , f E ).Sturmian words give a combinatorial flavor to Equation (1). With the matrices A and A arerespectively associated the substitutions s : 1 ,
12 and s : 1 , . With thedirective sequence ( i n ) n ∈ N ∈ { , } N is then associated the { s , s } -adic word w ∈ { , } N :(2) w = lim n →∞ s i s i · · · s i n (1 ω )which is a Sturmian word [Arn02] if both letters 1 and 2 appear infinitely often in the directivesequence. Since A j is the incidence matrix of the substitution s i for i ∈ { , } , the frequencies of 1and 2 in w satisfy Equation (1). Thus the vector of frequencies of letters in w exists and is equalto π (( i n ) n ∈ N ) = α ( α, σ : A ∗ → A ∗ is thematrix M σ = ( | σ ( a ) | b ) b,a ∈ A , where | u | v stands for the number of occurrences of a word v in a word u . It is easily seen that for any word w ∈ A ∗ , M σ ( | w | a ) a ∈ A = ( | σ ( w ) | a ) a ∈ A .Sturmian words form a deeply studied class of binary words with lots of equivalent defini-tions [Lot02]. They are for instance the aperiodic words with minimal factor complexity L w ( n ) = n + 1 [CH73], where L w ( n ) denotes the language of words of length n of w ∈ A N , i.e., L w ( n ) = { u ∈ A n | u occurs in w } . Sturmian words are also the aperiodic 1-balanced binary words [MH40],where an infinite word w ∈ A N is K -balanced if any two finite words of the same length occurringin w have, up to K , the same number of occurrences of each letter. The balance property allowsto prove for any Sturmian word w , the frequencies of 1 and 2 exist and are irrational. More thanthat, any Sturmian word w has uniform word frequencies, that is, for all finite word u occurringin w , the ratio | w k w k +1 ··· w k + n | u n +1 has a limit f u when n goes to infinity, uniformly in k . Results.
We consider an extension of Equation (1) to a set of two 3 × R ≥ . Doing so, we generalize Sturmian words on a three-letter alphabet by extendingEquation (2) to two well-chosen substitutions. We obtain words w of complexity 2 n + 1 that arebalanced for almost every given vector of letter frequencies. This article extends our previouswork [CLL17] presented during the conference WORDS 2017. LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 3 The two matrices are C = and C = and we show that for each sequence ( i n ) n ∈ N ∈ { , } N , the set T n ≥ C i C i · · · C i n R ≥ is one-dimensional. This property, sometimes called weak convergence , is not satisfied by all choices of3 × π : { , } N → ∆ = { x ∈ R ≥ | k x k = 1 } by(3) π (( i n ) n ∈ N ) R ≥ = \ n ≥ C i C i · · · C i n R ≥ . This map is not injective, as for example π (1222 . . . ) = (0 , , t = π (2111 . . . ), but it is onto. Wealso show that π is bijective exactly on the set P of primitive sequences, i.e., sequences ( C i n ) n ∈ N such that for all m and all large enough n > m , C i m · · · C i n has only positive entries. Furthermore,the image π ( P ) is the set I of normalized vectors with rationally independent entries. The inverseof π : P → I is given by the MCFA introduced by the first author [Cas] that consists in iteratingthe map f C on x ∈ I that applies either x C − x / k C − x k or x C − x / k C − x k accordingto whether x ∈ C R ≥ or x ∈ C R ≥ . Thus we obtain a similar symbolic representation as for theclassical Euclid’s algorithm. It turns out that the map f C is conjugate with a semi-sorted versionof another MCFA, the Selmer algorithm [Sel61, Sch00], see Section 11. Theorem A.
The symbolic dynamical system ( { , } N , σ ) is a symbolic representation of (∆ , f C ) .More precisely, • for any shift-invariant Borel probability measure µ on { , } N such that µ ( P ) = 1 , the map π : ( { , } N , σ, µ ) → (∆ , f C , π ∗ µ ) is a measure-preserving isomorphism; • for any f C -invariant Borel probability measure ν on ∆ such that ν ( I ) = 1 , the map π :( { , } N , σ, π − ∗ ν ) → (∆ , f C , ν ) is a measure-preserving isomorphism. This result in particular applies to any positive Bernoulli measure β on { , } N and to the f C -invariant probability measure ξ defined by the density function 1 / (1 − x )(1 − x ) [AL17]. Observethat any Bernoulli measure on { , } N is ergodic and that the measure ξ is also ergodic [FS21].Thus the pointwise ergodic theorem may be applied to obtain properties for Bernoulli-almost everydirective sequence ( i n ) n ∈ N or for Lebesgue-almost every vector x . Theorem C below is an exampleof such a result.We pursue the analogy with Euclid’s algorithm by giving a combinatorial flavor to the symbolicrepresentations ( i n ) n ∈ N ∈ { , } N . We consider the substitutions c : c : C and C and we show that the class of C -adic wordswith C = { c , c } provides a nice generalization of Sturmian words over a three-letter alphabet.We indeed have the following interpretations of the previous discussion: • by weak convergence, the frequencies of letters exist in every C -adic word; • by surjectivity of π , every x ∈ ∆ is the vector of letter frequencies of a C -adic word; • the bijection π : P → I induces a bijection between primitive C -adic words and vectors ofletter frequencies with rational independent entries. J. CASSAIGNE, S. LABBÉ, AND J. LEROY
We give another equivalence of primitive C -adic words in terms of their factor complexity, gen-eralizing the Sturmian case. We also show that the primitive C -adic words are exactly the C -adicwords that are dendric, a property recently introduced under the name of “tree sets” [BDFD + Theorem B.
Let w be a C -adic word with directive sequence ( i n ) n ∈ N . The following are equivalent. (i) w has factor complexity p ( n ) = 2 n + 1 for all n ∈ N ; (ii) the frequencies of letters in w are rationally independent; (iii) ( C i n ) n ∈ N is primitive; (iv) w is a uniformly dendric word. The last property of Sturmian words that we consider is their balancedness. Not all primitive C -adic words are balanced [And18], but we prove that almost all of them are (for many measures).Our proof is based on the method proposed by Avila and Delecroix [AD19] for Brun and FullySubtractive MCFA. It consists in applying the pointwise ergodic theorem to show that somefixed contracting matrix appears sufficiently often in almost every sequence ( C i n ) n ∈ N . The samemethod allows to show that the second Lyapunov exponent is negative. The definition of Lyapunovexponents can be found in Section 9.An application of multidimensional continued fraction algorithms is to provide simultaneousDiophantine approximation of a vector of real numbers [Sch80]. The quality of the approximationscan be evaluated in terms of the first two Lyapunov exponents of the MCF [Bal92, Lag93]. Inparticular, if the second Lyapunov exponent is negative, this implies that the algorithm is stronglyconvergent [Har02, HK00, HK02]. Theorem C.
Let µ be a shift-invariant ergodic Borel probability measure on { , } N . If µ ([12121212]) > , then for µ -almost every directive sequence ( i n ) n ∈ N ∈ { , } N , the word w = lim n →∞ c i . . . c i n (1) isbalanced and the second Lyapunov exponent θ µ of the cocycle with matrices { C , C } is negative. This result in particular applies to any positive Bernoulli measure and to the measure π − ∗ ( ξ ).Thus it extends a result of Berthé, Steiner and Thuswaldner [BST21] who proved that the secondLyapunov exponent is negative for the measure π − ∗ ( ξ ). Observe that π − ∗ ( ξ ) is not a Bernoullimeasure (see Remark 6.2) so all these measures are pairwise mutually singular. Example and applications.
Consider the periodic sequence 121212 · · · . We have that π (121212 · · · ) = 1 β + 1 ββ − β ≈ . . . is a positive right eigenvector of the primitive matrix C C associated with the Perron-Frobeniuseigenvalue β ≈ . C C . It is the positive root of the characteristic polynomial x − x + x − C C . The infinite word on the alphabet { , , } having the above vector as its vector of letterfrequencies is the C -adic word which is the unique fixed point of the substitution c c : 1 , , w = ( w n ) n ≥ = lim k →∞ ( c c ) k (1) = 1321213121321312132121321312132121312132 · · · LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 5 whose set of factors of lengths 0, 1, 2, 3 and 4 are listed in the following table: n n + 1 factors of length n { ε } { , , } { , , , , } { , , , , , , } { , , , , , , , , } The left eigenvector of C C associated with the dominant eigenvalue β is u = (1 , β − β, β − f : { , , } → C by f (1) = 1, f (2) = β ∗ − β ∗ and f (3) = β ∗ − β ∗ ≈ . . i is one of the two complex Galois conjugate of β . Observe that the vector u ∗ = ( f (1) , f (2) , f (3)) is the image of u under the automorphism of the field Q ( β ) defined by β β ∗ . The scalar product of u ∗ with π (121212 · · · ) is zero. Thus, as w is balanced, the partial sums S f ( N ) = P N − i =0 f ( w i ) are bounded. The set { S f ( N ) : N ∈ N } , shown in Figure 1, is a well-knownconstruction of the Rauzy fractal associated with a substitution [Rau82, DT89, ST09, BST10].Theorem C implies that the Rauzy fractal is bounded for almost every C -adic word. As shownrecently, this is not true for all C -adic words [And18]. Figure 1.
The Rauzy fractal associated with the fixed point w of c c . On the left (rightresp.) the color of the point S f ( N ) ∈ C is chosen according to the letter w N ( w N − resp.). The Figure 1 can be reproduced in SageMath in few lines: sage: c1 = WordMorphism("1->1,2->13,3->2")sage: c2 = WordMorphism("1->2,2->13,3->3")sage: c12 = c1*c2sage: c12.rauzy_fractal_plot()sage: c12.rauzy_fractal_plot(exchange=True)
In Figure 1, we observe that the fractal can be decomposed into three parts in two distinct wayswhich defines an exchange of pieces inside the fractal. Theorem C has important consequences.Recent progresses [BST20, FN20], which builds on our preliminary work [CLL17], prove that theexchange of pieces is equivalent to a rotation on a two-dimensional torus and more importantlythat almost every rotation on the 2-dimensional torus admits a coding of complexity 2 n +1 throughsuch a fractal partition of the 2-torus. Comparison with other generalizations of Sturmian words over larger alphabets.
Thereexist many other generalizations of Sturmian words over larger alphabets, each focusing on par-ticular properties satisfied by Sturmian words.
J. CASSAIGNE, S. LABBÉ, AND J. LEROY
Words of complexity 2 n + 1 were for instance considered by Arnoux and Rauzy [AR91] withthe condition that, like Sturmian words, there is exactly one left and one right special factor ofeach length; these words are now called Arnoux-Rauzy words. It is known that the frequenciesof any Arnoux-Rauzy word are well defined and belong to the Rauzy gasket [AS13], a fractal setof Lebesgue measure zero. Thus the above condition on the number of special factors is veryrestrictive for the possible letter frequencies.Words of complexity p ( n ) ≤ n + 1 include Arnoux-Rauzy words, codings of interval exchangetransformations and more [Ler14]. For any given letter frequencies one can construct words offactor complexity 2 n + 1 by the coding of a 3-interval exchange transformation. It is howeverknown that these words are almost always unbalanced [Zor97].In recent years, multidimensional continued fraction algorithms were used to obtain ternarybalanced words with low factor complexity for any given vector of letter frequencies. Indeedthe Brun algorithm leads to balanced words [DHS13] and it was shown that the Arnoux-Rauzy-Poincaré algorithm leads to words of factor complexity p ( n ) ≤ n + 1 [BL15].Thus the words that we consider in this paper provide the first class of words which simul-taneously generalize the three Sturmian properties of having factor complexity ( A − n + 1,having any vector of rationally independent letter frequencies and being almost always balanced.The problem of finding an analogue of f C in dimension d ≥
4, generating finitely balanced S -adicsequences with complexity ( d − n + 1 for almost every vector of letter frequencies is still open. Structure of the article.
In Section 2, we define the MCFA used in this article as well as theassociated matrices C and C , the substitutions c and c and the adic words.Since we are dealing with convergence of cones C i C i · · · C i n R ≥ , an important part of the paperdeals with products of matrices. In Section 3, we define a semi-norm k · k D on R d which is well-suited for the matrices C and C and, using it, we give sufficient conditions so that a sequence( M n ) n ∈ N of non-negative d × d matrices is weakly convergent (Proposition 3.6). We then apply ourresults in Section 4 to sequences ( C i n ) n ∈ N ∈ { C , C } N and show that any such sequence is weaklyconvergent (Proposition 4.4). In particular, this defines the map π of Equation (3).In Section 5, we characterize the rational dependencies of π (( i n ) n ∈ N ). In particular, we showthat π ( P ) = I (Theorem 5.1) and that the restriction of π to P is a bijection (Corollaries 5.4and 5.5). In particular, this implies Theorem A, as detailed in Section 6.We show in Section 7 that all C -adic words have uniform word frequencies (Proposition 7.1)and in Section 8 that almost all of them are balanced (part 1 of Theorem C). We show thatthe Lyapunov exponent is negative in Section 9, completing the proof of Theorem C. The factorcomplexity of C -adic words is studied in Section 10, completing Theorem B. The link with Selmeralgorithm is studied in Section 11. Acknowledgments.
We are thankful to Valérie Berthé for her enthusiasm toward this project.We also thank Vincent Delecroix for helping discussions.2.
A bidimensional continued fraction algorithm On R ≥ , the bidimensional continued fraction algorithm introduced by the first author [Cas] is F C ( x , x , x ) = ( x − x , x , x ) , if x ≥ x ;( x , x , x − x ) , if x < x . More information on multidimensional continued fraction algorithms can be found in [Bre81,Sch00].
LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 7 Figure 2.
The n -cylinders of f C on ∆ for each n ∈ { , , , , , } . Any n -cylinder isrepresented by a word u u · · · u n − over { , } ∗ and is the set of points x ∈ ∆ such thatfor all k ∈ { , , . . . , n − } , M ( f kC ( x )) = C u k . Alternatively, the map F C can be defined by associating nonnegative matrices to each part of apartition of R ≥ into Λ ∪ Λ whereΛ = { ( x , x , x ) ∈ R ≥ | x ≥ x } , Λ = { ( x , x , x ) ∈ R ≥ | x < x } . The matrices are given by the rule M ( x ) = C i if and only if x ∈ Λ i where C = and C = . The map F C on R ≥ and the projective map f C on ∆ = { x ∈ R ≥ | k x k = 1 } are then defined as: F C ( x ) = M ( x ) − x and f C ( x ) = F C ( x ) k F C ( x ) k . Many of their properties can be found in [Lab15]. Since { Λ , Λ } is a partition of R ≥ , any vector x ∈ R ≥ defines a sequence of matrices ( C i n ) n ∈ N by C i n = M ( F nC ( x )) and we have(4) x ∈ \ n ≥ C i C i · · · C i n R ≥ . The n -cylinders induced by f C on ∆ are illustrated in Figure 2.2.1. Background on substitutions and S -adic words. Let A be an alphabet, i.e., a finite set.By substitution over A we mean an endomorphism σ of the free monoid A ∗ which is non-erasing, i.e. σ ( a ) = ε for all a , where ε is the empty word. If S is a set of substitutions over A ∗ , a word w ∈ A N is said to be S -adic if there is a sequence σ = ( σ n ) n ∈ N ∈ S N and a sequence a = ( a n ) n ∈ N ∈ A N J. CASSAIGNE, S. LABBÉ, AND J. LEROY such that the limit lim n → + ∞ σ σ · · · σ n − ( a n ) exists and is equal to w . The 2-tuple ( σ , a ) is calledan S -adic representation of w and the sequence σ a directive sequence of w .A sequence of substitutions ( σ n ) n ∈ N ∈ S N is said to be everywhere growing if min a ∈ A | σ [0 ,n ) ( a ) | goes to infinity as n goes to infinity.With an substitution σ : A ∗ → A ∗ , we associate its incidence matrix M σ ∈ N A × A defined by( M σ ) a,b = | σ ( b ) | a . Thus, for any word w ∈ A ∗ , we have −−→ σ ( w ) = M σ −→ w , where −→ w ∈ N A is definedby −→ w a = | w | a .2.2. Substitutions and S -adic words associated with the matrices C and C . We considerthe alphabet A = { , , } and the two subsitutions c : c : C -adic words over the set C = { c , c } . One may check that C i is the incidence matrix of c i for i = 1 ,
2. Note that the choice of the above substitutions c and c is less trivial than one may firstthink. Indeed, not all choices for the image of the letter 2 allow the complexity to be 2 n + 1 andobtain Theorem B. In particular, changing c to be 1 , , c and c left-marked (the first letter of the images are all distinct), but thischoice does not work as it increases the factor complexity for the associated C -adic words.Like for matrices, any vector x ∈ R ≥ defines a sequence of substitutions ( c i n ) n ∈ N , where c i n = c ( F nC ( x )) and c ( y ) = c i if and only if y ∈ Λ i . For example, using vector x = T (1 , e, π ), we have c ( x ) c ( F C x ) c ( F C x ) c ( F C x ) c ( F C x ) = c c c c c = C C C C C .The next lemma shows that not every 2-tuple (( σ n ) n ∈ N , ( a n ) n ∈ N ) ∈ C N × A N can be a C -adicrepresentation of a word. In what follows, we use the notations σ [ m,n ] = σ m σ m +1 · · · σ n and σ [ m,n ) = σ m σ m +1 · · · σ n − when m ≤ n . Lemma 2.1.
For every directive sequence σ = ( σ n ) n ∈ N ∈ C N there exists a sequence of letters ( a n ) n ∈ N ∈ A N such that w = lim n → + ∞ σ [0 ,n ) ( a n ) exists and is an infinite word. Moreover, w isindependent of the choice of ( a n ) n ∈ N . More precisely,(1) If σ contains infinitely many occurrences of both c and c , then the limit w = lim n → + ∞ σ [0 ,n ) ( a n ) exists and w = lim n → + ∞ σ [0 ,n ) (1) .(2) If there is some integer N such that σ n = c for all n ≥ N , then the limit w = lim n → + ∞ σ [0 ,n ) ( a n ) exists and is an infinite word if and only if ( a n ) n ∈ N ∈ A ∗ { , } N . In that case, we have w = ( σ [0 ,N ) (1)) ω .(3) If there is some integer N such that σ n = c for all n ≥ N , then the limit lim n → + ∞ σ [0 ,n ) ( a n ) exists and is an infinite word if and only if there is some integer N ≥ N such that ( a N +2 n , a N +2 n +1 ) = (1 , for all n . In that case, we have w = σ [0 ,N ) (13 ω ) .Proof. For all m , we set w m = σ [0 ,m ) ( a m ). We also let p m denote the longest prefix of w m which isa prefix of w n for all n ≥ m . The limit lim n → + ∞ w n exists and is an infinite word if and only if thelength of p n tends to infinity as n increases. Furthermore, in that case lim n → + ∞ w n = lim n → + ∞ p n .Let us prove (1). Since both c and c occur infinitely many times in ( σ n ) n ∈ N , there is asequence of integers ( l m ) m ∈ N such that ( σ n ) n ≥ l m has a prefix of the form c c k c for some k ≥ l m +1 ≥ l m + k + 2. Furthermore, for all k ≥ a ∈ A , 1 is a proper prefix of c c k c ( a ). Thus LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 9 for all n ≥ l m +1 and all a ∈ A , 1 is a proper prefix of σ [ l m ,n ] ( a ), hence σ [0 ,l m ) (1) is a proper prefixof σ [0 ,n ] ( a ). As the length of σ [0 ,l m ) (1) tends to infinity as n increases, this shows thatlim n → + ∞ σ [0 ,n ) ( a n ) = lim n → + ∞ σ [0 ,n ) (1)for all sequences ( a n ) n ∈ N , which ends the proof.Let us prove (2). As c (1) = 1, the sequence of letters ( a n ) n ∈ N cannot contain infinitely manyones, otherwise the sequence ( σ [0 ,n ) ( a n )) n ∈ N ∈ ( A ∗ ) N would have a constant subsequence and thelimit, if it exists, would be a finite word. Thus the sequence ( a n ) n ∈ N has to be in A ∗ { , } N . As forall m and all n ≥ m , 1 m is a proper prefix of both c n (2) and c n (3), the limit lim n → + ∞ σ [0 ,n ) ( a n )is the periodic word ( σ [0 ,N ) (1)) ω . The proof of (3) is obtained in a similar way. (cid:3) The next result is a direct consequence of Lemma 2.1. One could actually show that the conversealso holds.
Corollary 2.2.
If a C -adic word w is aperiodic, then it admits an everywhere growing directivesequence ( σ n ) n ∈ N ∈ C N . The algorithm F C defines C -words. By Lemma 2.1, when the sequence ( c i n ) n ∈ N = ( c ( F nC x )) n ∈ N contains infinitely many occurrences of c and c , it defines a unique C -adic word W ( x ) = lim n →∞ c i c i · · · c i n (1) . For example, using vector x = T (1 , e, π ), we will show in Section 5 that the sequence ( c ( F nC x )) n ∈ N contains infinitely many occurrences of c and c and the associated infinite C -adic word is W ( x ) = 2323213232323132323213232321323231323232 · · · . Semi-norm of matrices and convergence
Equation (4) shows that the iteration of the map F C on x ∈ R ≥ defines a sequence of matrices( M n ) n ≥ ∈ { C , C } N such that x ∈ \ n ≥ M [0 ,n ) R ≥ . In this section, we give sufficient conditions for a sequence of d -dimensional nonnegative matrices( M n ) n ∈ N to be weakly convergent , i.e., to be such that the cone \ n ≥ M [0 ,n ) R d ≥ is one-dimensional.The following result states that the notion of weak convergence is related to the existence of(uniform) frequencies in S -adic words. Let w = ( w n ) n ∈ N ∈ A N be an infinite word and let u ∈ A ∗ be a word occurring in w . The frequency of u in w is the limit, whenever it exists, lim n →∞ | w [0 ,n ) | u n ,where w [ m,n ) = w m w m +1 · · · w n − and | v | u stands for the number of occurrences of u in the word v .The word w has uniform word frequencies if for every u ∈ A ∗ , the ratio | w [ k,k + n ) | u n converges when n goes to infinity, uniformly in k . Theorem 3.1. [BD14]
Let A be an alphabet of size d . Let w ∈ A N be a word that admitsan everywhere growing directive sequence ( σ n ) n ∈ N and let ( M n ) n ∈ N be the associated sequence ofincidence matrices. If for all k ∈ N , the cone (5) \ n ≥ k M [ k,n ) R d ≥ is one-dimensional, then w has uniform word frequencies. In particular, if f ∈ R d ≥ is such that k f k = 1 and (6) \ n ≥ M [0 ,n ) R d ≥ = R ≥ f , then f is the vector of letter frequencies of w . A semimetric on the projective space.
Recall that the
Hilbert metric is defined as d H ( R > v , R > w ) = max ≤ i,j ≤ d log v i w j v j w i where v = ( v , . . . , v d ) ∈ R d> and w = ( w , . . . , w d ) ∈ R d> . Here, we define another closely relatedfunction as(7) d M ( R > v , R > w ) = 1 k v k · k w k · max ≤ i,j ≤ d | v i w j − v j w i | where v = ( v , . . . , v d ) ∈ R d ≥ \ { } and w = ( w , . . . , w d ) ∈ R d ≥ \ { } . It is not a distance as itdoes not satisfy the triangle inequality, but it is a semimetric, that is, it satisfies the first threeaxioms of a distance as shown below. Lemma 3.2. d M is a semimetric, i.e., (i) d M ( R > v , R > w ) ≥ , (ii) d M ( R > v , R > w ) = 0 if and only if R > v = R > w , (iii) d M ( R > v , R > w ) = d M ( R > w , R > v ) .Proof. Let v = ( v , . . . , v d ) ∈ R d ≥ \ { } and w = ( w , . . . , w d ) ∈ R d ≥ \ { } .(i) We have d M ( R > v , R > w ) ≥ R > v = R > w , then there exists k > w = k v . Thenmax ≤ i,j ≤ d | v i w j − v j w i | = max ≤ i,j ≤ d | v i ( kv j ) − v j ( kv i ) | = k max ≤ i,j ≤ d | v i v j − v j v i | = 0 . Thus d M ( R > v , R > w ) = 0. Reciprocally, if d M ( R > v , R > w ) = 0, thenmax ≤ i,j ≤ d | v i w j − v j w i | = k v k · k w k · d M ( R > v , R > w ) = 0 . Therefore, for every i, j such that 1 ≤ i, j ≤ d , we have v i w j = v j w i . Choose j such that w j = 0and set k = v j w j . Thus, for all i , we have v i = kw i . As v = 0, we have k > R > v = R > w .(iii) We have d M ( R > v , R > w ) = 1 k v k · k w k · max ≤ i,j ≤ d | v i w j − v j w i | = 1 k w k · k v k · max ≤ i,j ≤ d | w i v j − w j v i | = d M ( R > w , R > v ) . (cid:3) Using the semimetric d M , we define the diameter of a cone Λ ⊆ R d ≥ as(8) diam(Λ) = sup v , w ∈ Λ \{ } d M ( R > v , R > w ) . The fact that the diameter is defined from a semimetric is enough for our needs since the followinglemma proves that a cone of diameter zero is reduced to a single line.
Lemma 3.3.
Let Λ ⊆ R d ≥ be a cone. If diam(Λ) = 0 , then there exists u ∈ R d ≥ \ { } satisfying Λ = R ≥ u . LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 11 Proof.
Let u ∈ Λ \ { } . By definition, we have R ≥ u ⊆ Λ. Now let v ∈ Λ \ { } . Since diam(Λ) = 0,we have d M ( R > u , R > v ) = 0. From Lemma 3.2 (ii), there exists k ∈ R > such that v = k u .Therefore v ∈ R > u . We have proved Λ ⊆ R ≥ u . (cid:3) Our aim is now to study the diameter of T n ≥ M [0 ,n ) R d ≥ for a given sequence of matrices ( M n ) n ∈ N .To that aim, we provide an upper bound for the diameter of a cone defined by the image of thenonnegative orthant under the application of a nonnegative matrix. It is defined in terms of theentries of the matrix and in terms of a matrix semi-norm that we define below.If V is a non-trivial vector subspace of R d and k · k is a semi-norm on R d which is a norm on V ,then the matrix semi-norm k · | V k is defined for any d × d matrix M as(9) k M | V k := sup v ∈ V \{ } k M v kk v k . For any vector f ∈ R d ≥ \ { } , f ⊥ stands for the vector space of codimension 1 orthogonal to f .Let Λ ⊂ R d ≥ be some cone. As done in [AD19], if k · k is a norm on f ⊥ for all f ∈ Λ \ { } , wedefine a matrix semi-norm on R d × d as(10) k M k Λ = sup f ∈ Λ \{ } k M | f ⊥ k . Thus, we have k M k Λ = sup f ∈ Λ \{ } sup v ∈ f ⊥ \{ } k M v kk v k . The diameter of the image of the nonnegative orthant under a positive matrix can be bounded bythe semi-norm of its transpose matrix.
Lemma 3.4.
Let A = ( a ij ) ∈ R d × d> be a positive matrix. Then (11) diam( A R d ≥ ) ≤ ≤ i,j ≤ n { a ij } · (cid:13)(cid:13)(cid:13) T A (cid:13)(cid:13)(cid:13) A R d ≥ . Proof.
From the definition of d M and of the diameter of a cone, and using the fact that for all v, w ∈ R d ≥ , | T wv | ≤ k w k k v k , we computediam( A R d ≥ ) = sup v,w ∈ R d ≥ \{ } d M ( R > Av, R > Aw )= sup v,w ∈ R d ≥ \{ } k Av k k Aw k max ≤ i,j ≤ d (cid:12)(cid:12)(cid:12) ( T e i Av )( T e j Aw ) − ( T e j Av )( T e i Aw ) (cid:12)(cid:12)(cid:12) = sup v,w ∈ R d ≥ \{ } k Av k k Aw k max ≤ i,j ≤ d (cid:12)(cid:12)(cid:12) ( T e i Av )( T w T Ae j ) − ( T e j Av )( T w T Ae i ) (cid:12)(cid:12)(cid:12) = sup v,w ∈ R d ≥ \{ } k Av k k Aw k max ≤ i,j ≤ d (cid:12)(cid:12)(cid:12) T w T A (cid:16) ( T e i Av ) e j − ( T e j Av ) e i (cid:17)(cid:12)(cid:12)(cid:12) ≤ sup v,w ∈ R d ≥ \{ } k Av k k Aw k · k w k · max ≤ i,j ≤ d (cid:13)(cid:13)(cid:13) T A (cid:16) ( T e i Av ) e j − ( T e j Av ) e i (cid:17)(cid:13)(cid:13)(cid:13) = sup w ∈ R d ≥ \{ } k w k k Aw k · sup v ∈ R d ≥ \{ } k Av k · max ≤ i,j ≤ d (cid:13)(cid:13)(cid:13) T A (cid:16) ( T e i Av ) e j − ( T e j Av ) e i (cid:17)(cid:13)(cid:13)(cid:13) . Now observe that sup w ∈ R d ≥ \{ } k w k k Aw k ≤ ≤ i,j ≤ n { a ij } . Furthermore, for all v ∈ R d ≥ \ { } , we have f = Av ∈ A R d> and, for all 1 ≤ i, j ≤ d ,( T e i Av ) e j − ( T e j Av ) e i ∈ f ⊥ \ { } , and, as a consequence, (cid:13)(cid:13)(cid:13) T A (cid:16) ( T e i Av ) e j − ( T e j Av ) e i (cid:17)(cid:13)(cid:13)(cid:13) ≤ (cid:13)(cid:13)(cid:13) T A (cid:13)(cid:13)(cid:13) A R d ≥ (cid:13)(cid:13)(cid:13) ( T e i Av ) e j − ( T e j Av ) e i (cid:13)(cid:13)(cid:13) . We finally getdiam( A R d ≥ ) ≤ ≤ i,j ≤ n { a ij } · sup v ∈ R d ≥ \{ } k Av k · (cid:13)(cid:13)(cid:13) T A (cid:13)(cid:13)(cid:13) A R d ≥ · max ≤ i,j ≤ d (cid:13)(cid:13)(cid:13)(cid:16) ( T e i Av ) e j − ( T e j Av ) e i (cid:17)(cid:13)(cid:13)(cid:13) ≤ ≤ i,j ≤ n { a ij } · sup v ∈ R d ≥ \{ } k Av k · (cid:13)(cid:13)(cid:13) T A (cid:13)(cid:13)(cid:13) A R d ≥ · k Av k = 1min ≤ i,j ≤ n { a ij } · (cid:13)(cid:13)(cid:13) T A (cid:13)(cid:13)(cid:13) A R d ≥ . (cid:3) The next lemma shows that the matrix semi-norm defined in Equation (10) behaves well withrespect to product of matrices.
Lemma 3.5.
Let
A, B ∈ R d × d ≥ such that AB = 0 and let k · k be any semi-norm on R d which is anorm on every f ⊥ with f ∈ ( A R d ≥ ∪ B R d ≥ ) \ { } . We have (cid:13)(cid:13)(cid:13) T ( AB ) (cid:13)(cid:13)(cid:13) AB R d ≥ ≤ (cid:13)(cid:13)(cid:13) T B (cid:13)(cid:13)(cid:13) B R d ≥ (cid:13)(cid:13)(cid:13) T A (cid:13)(cid:13)(cid:13) A R d ≥ . Proof.
We have (cid:13)(cid:13)(cid:13) T ( AB ) (cid:13)(cid:13)(cid:13) AB R d ≥ = sup z ∈ f ⊥ \{ } , f ∈ AB R d ≥ \{ } k T ( AB ) z kk z k . If for all z ∈ f ⊥ \ { } , f ∈ AB R d ≥ \ { } , we have T Az = 0, then (cid:13)(cid:13)(cid:13) T ( AB ) (cid:13)(cid:13)(cid:13) AB R d ≥ = 0 and the resultfollows. Otherwise, we have (cid:13)(cid:13)(cid:13) T ( AB ) (cid:13)(cid:13)(cid:13) AB R d ≥ = sup z ∈ f ⊥ \{ } , f ∈ AB R d ≥ \{ } , T Az =0 k T ( AB ) z kk z k . Observe that for all f ∈ AB R d ≥ \ { } and all z ∈ f ⊥ \ { } , we have T Az ∈ g ⊥ \ { } for some g ∈ B R d ≥ \ { } . Since k · k is a norm on every g ⊥ with g ∈ B R d ≥ \ { } , we have (cid:13)(cid:13)(cid:13) T Az (cid:13)(cid:13)(cid:13) = 0 for all z ∈ f ⊥ \ { } , f ∈ AB R d ≥ \ { } such that T Az = 0. Therefore, we get (cid:13)(cid:13)(cid:13) T ( AB ) (cid:13)(cid:13)(cid:13) AB R d ≥ = sup z ∈ f ⊥ \{ } , f ∈ AB R d ≥ \{ } , T Az =0 k T B T Az kk T Az k · k T Az kk z k≤ sup z ∈ f ⊥ \{ } , f ∈ AB R d ≥ \{ } , T Az =0 k T B T Az kk T Az k · sup z ∈ f ⊥ \{ } , f ∈ AB R d ≥ \{ } , T Az =0 k T Az kk z k≤ sup z ∈ g ⊥ \{ } ,g ∈ B R d ≥ \{ } k T Bz kk z k · sup z ∈ f ⊥ \{ } , f ∈ A R d ≥ \{ } k T Az kk z k = (cid:13)(cid:13)(cid:13) T B (cid:13)(cid:13)(cid:13) B R d ≥ · (cid:13)(cid:13)(cid:13) T A (cid:13)(cid:13)(cid:13) A R d ≥ where we substituted z = T Az , f = Ag and g = Bv for some v ∈ R d ≥ since there exists v ∈ R d ≥ such that f = ABv . (cid:3) LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 13 Primitive sequences and convergence.
Recall that a square matrix M is primitive if thereis some positive integer k such that M k has only positive entries. As an analogue, if m = ( M n ) n ∈ N is a sequence of nonnegative square matrices of the same size d , we say that m is primitive if forall r ∈ N , there exists s > r such that M r M r +1 · · · M s has only positive entries.If m is the sequence of incidence matrices associated with a sequence of endomorphisms ( σ n ) n ∈ N of A ∗ , then primitivity of m means that for all r ∈ N , there exists s > r such that for all letters a, b ∈ A , a occurs in σ r σ r +1 σ s ( b ).The next result provides sufficient condition for having weak convergence of a primitive sequenceof matrices without any recurrence hypothesis like in Proposition 3.5.5 of [AA20]. Proposition 3.6.
Let m = ( M n ) n ∈ N be a primitive sequence of nonnegative integer matrices. Ifthere exists K > such that (cid:13)(cid:13)(cid:13) T M [0 ,n ) (cid:13)(cid:13)(cid:13) M [0 ,n ) R d ≥ ≤ K for some norm and for infinitely many n ∈ N ,then there exists a vector u ∈ R d ≥ \ { } satisfying (12) \ n ≥ M [0 ,n ) R d ≥ = R ≥ u . Proof.
Since m is primitive, there exists an increasing sequence ( n k ) k ∈ N such that n = 0 and M [ n k ,n k +1 ) has only positive entries for every k ∈ N . Furthermore, the sequence ( n k ) k ∈ N can bechosen among the indices n for which (cid:13)(cid:13)(cid:13) T M [0 ,n ) (cid:13)(cid:13)(cid:13) M [0 ,n ) R d ≥ ≤ K . If A ( k ) = ( a ( k ) ij ) = M [0 ,n k ) , then for k ≥
1, one has min ≤ i,j ≤ n { a ( k ) ij } ≥ d k − . Moreover, as the dimension is finite, the chosen norm is equivalent to the 2-norm, which impliesthat there exists a constant K such that (cid:13)(cid:13)(cid:13) T M [0 ,n ) (cid:13)(cid:13)(cid:13) M [0 ,n ) R d ≥ ≤ K · (cid:13)(cid:13)(cid:13) T M [0 ,n ) (cid:13)(cid:13)(cid:13) M [0 ,n ) R d ≥ . Therefore, as M [0 ,n k − ) R d ≥ ⊂ M [0 ,n ) R d ≥ ⊂ M [0 ,n k ) R d ≥ whenever n k − ≤ n ≤ n k , we get ,usingLemma 3.4,lim n →∞ diam( M [0 ,n ) R d ≥ ) = lim k →∞ diam( M [0 ,n k ) R d ≥ ) ≤ lim k →∞ ≤ i,j ≤ n { a ( k ) ij } · (cid:13)(cid:13)(cid:13) T M [0 ,n k ) (cid:13)(cid:13)(cid:13) M [0 ,nk ) R d ≥ ≤ lim k →∞ d k − · K · K = 0 . We conclude from Lemma 3.3 that the cone T n ≥ M [0 ,n ) R d ≥ is one-dimensional. (cid:3) A piecewise linear semi-norm.
Proposition 3.6 holds for any norm on R d . In this section,we consider the following function k · k D : R d → R and show that it is a semi-norm on R d and anorm on well-chosen subspaces. It is defined as(13) k v k D = max( v ) − min( v ) . It is invariant under the addition of constant vectors, that is,(14) k v + a T (1 , . . . , k D = k v k D for every v ∈ R d and a ∈ R . Note that the function k · k D is not a norm on R d as k v k D = 0 forsome nonzero vector v . But k · k D is a norm on some well-chosen subspaces. Lemma 3.7.
Let f ∈ R d ≥ \ { } . Then (i) k · k D is a semi-norm on R d , (ii) k · k D is a norm on f ⊥ , (iii) k · k D and k · k ∞ are equivalent norms on f ⊥ . More precisely, k v k ∞ ≥ k v k D ≥ k v k ∞ forevery v ∈ f ⊥ .Proof. (i) We show that it is a semi-norm. It is absolutely homogeneous . Let a ∈ R ≥ and v ∈ R d .We have k av k D = max( av ) − min( av ) = a max( v ) − a min( v ) = a k v k D , and k − v k D = k v k D . It is subadditive . Let u, v ∈ R d . We have k u + v k D = max( u + v ) − min( u + v ) ≤ max( u ) + max( v ) − min( u ) − min( v ) = k u k D + k v k D . It is non-negative . For every v ∈ R d , we have max( v ) ≥ min( v )so that k v k D ≥ f ⊥ . It is definite . Let v ∈ f ⊥ and suppose that k v k D = 0.We have max( v ) = min( v ) so that v = a T (1 , . . . ,
1) for some a ∈ R . By definition of v , we havethat 0 = h f , v i = a k f k which holds only if a = 0 since k f k = 0. Therefore v = 0.(iii) We always have k v k D = max( v ) − min( v ) ≤ | max( v ) | + | min( v ) | ≤ k v k ∞ . If min( v ) >
0, then T v f > v is orthogonal to f . Similarly,max( v ) < T v f < v is orthogonal to f . Therefore v ∈ f ⊥ implies that min( v ) ≤ ≤ max( v ). We conclude that k v k D = max( v ) − min( v ) = | max( v ) | + | min( v ) | ≥ k v k ∞ . (cid:3) If follows from Lemma 3.7 that k · | f ⊥ k D is a matrix semi-norm as soon as f ∈ R d ≥ \ { } . Notethat it follows from Equation (14) that it satisfies(15) (cid:13)(cid:13)(cid:13)(cid:16) M + T (1 , . . . , u (cid:17) | f ⊥ (cid:13)(cid:13)(cid:13) D = k M | f ⊥ k D for every matrix M ∈ R d × d and row vector u ∈ R d .Finally, if M ∈ R d × d and f ∈ R d ≥ \ { } , then it follows from Lemma 3.7 (iii) that(16) 12 · k M | f ⊥ k D ≤ k M | f ⊥ k ∞ ≤ · k M | f ⊥ k D . The supremum is attained on the boundaries.
We now state a general result whichstates that the supremum of (cid:13)(cid:13)(cid:13) T M (cid:13)(cid:13)(cid:13) M R d ≥ D is attained on the boundaries of a finite number of subconesforming a partition of R d ≥ . It is used in this article for proving the balancedness of almost all C -adic sequences. Lemma 3.8.
Let d ≥ and M ∈ R d × d> be a positive and invertible matrix. Consider the set H ofhyperplanes orthogonal to some vector in (17) S = ( M E ∪ ( E − E ) ∪ M ( E − E )) \ { } where E = { e i : 1 ≤ i ≤ d } and D be the finite union of intersections of distinct hyperplanes of H : (18) D = [ h ,h ∈H ,h = h h ∩ h . Then the maximal value of the semi-norm is attained at some vector z in D \ ± ( T M ) − R d> , i.e., (19) (cid:13)(cid:13)(cid:13) T M (cid:13)(cid:13)(cid:13) M R d ≥ D = max z ∈D\± ( T M ) − R d> k T M z k D k z k D . Proof.
We have (cid:13)(cid:13)(cid:13) T M (cid:13)(cid:13)(cid:13) M R d ≥ D = sup f ∈ M R d ≥ \{ } (cid:13)(cid:13)(cid:13) T M (cid:12)(cid:12)(cid:12) f ⊥ (cid:13)(cid:13)(cid:13) D = sup f ∈ M R d ≥ \{ } sup z ∈ f ⊥ \{ } k T M z k D k z k D = sup z ∈ Z \{ } k T M z k D k z k D , LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 15 where Z = { z ∈ R d | z ⊥ f for some f ∈ M R d ≥ \ { }} = { z ∈ R d | T zM u = 0 for some u ∈ R d ≥ \ { }} = { z ∈ R d | entries of T M z are not all positive or all negative } = R d \ ± ( T M ) − R d> The vectors of Z correspond to 2 d − d cones delimited by the hyperplanes orthogonal tothe vectors of M E .The norm k z k D is a piecewise linear form which is linear on each of the cones delimited by thehyperplanes orthogonal to the nonzero vectors of E − E . There are 2 d ( d − such cones. Similarly,the norm k T M z k D is a piecewise linear form which is linear on every of the cones delimited by thehyperplanes orthogonal to the nonzero vectors of M ( E − E ).We consider any of the subcones Λ delimited by hyperplanes orthogonal to some vectors in S defined in Equation (17) that are inside of Z . Remark that by construction both k z k D and k T M z k D are linear on Λ. The intersection of Λ with the euclidean sphere of radius 1 is compact. Therefore,the maximum m of the function k T Mz k D k z k D restricted to Λ \ { } is attained at some point z with k z k = 1: k T M z k D k z k D = m. Let L be a linear form of R d such that L ( z ) = k T M z k D − m k z k D for z ∈ Λ. If L = 0, then k T Mz k D k z k D = m is constant on Λ, so its maximum is attained on an edge of Λ. Otherwise, the equation L ( z ) = 0 defines a hyperplane H containing the origin. By definition of the maximum we have L ( z ) ≤ z ∈ Λ. Therefore Λ is contained in one of the halfspaces delimited by H . Theset H ∩ Λ is either an edge or a face of Λ. If it is a face, then the maximum is also attained atthe extremities of the face. Therefore, the maximum of k T M z k D − m k z k D must the attained onan edge of Λ, that is, at some point in D \ ± ( T M ) − R d> . (cid:3) Convergence in the monoid generated by C and C In this section, we consider the monoid of 3 × C and C and we studythe weak convergence of sequences in { C , C } N , notably using Proposition 3.6.4.1. Primitiveness.
Proposition 3.6 provides sufficient conditions for the convergence when thesequence is primitive. Our first task is to characterize primitive sequences of matrices in { C , C } N . Proposition 4.1.
A sequence m = ( M n ) n ∈ N ∈ { C , C } N is not primitive if and only if there issome integer N ≥ such that for all i ∈ N , M N +2 i = M N +2 i +1 .Proof. Given a matrix M , we associate with it a boolean matrix B ( M ) of the same size defined by( B ( M )) ij = , if M ij > , otherwise . Thus a matrix M has only positive entries if and only if B ( M ) contains only 1’s.Assume first that there is some integer N ≥ i ∈ N , M N +2 i = M N +2 i +1 . Thegraph in Figure 3 represents the possible boolean matrices associated with products of the form C k C k C k · · · C k n − . The vertices are boolean matrices and there is an edge from B to B with label C i if B = B ( B · C i ). We immediately check that this implies that the sequence m isnot primitive. C C C C C C C , C Figure 3. If M N +2 i = M N +2 i +1 for all i ∈ N , then m is not primitive. Now assume that there is no integer N ≥ i ∈ N , M N +2 i = M N +2 i +1 . Thisimplies that there are infinitely many N ∈ N such that the sequence ( M n ) n ≥ N starts with a productof the form C C k +12 C or C C k +11 C . Observe that we have B ( C C C ) = , B ( C C C ) = and, for k ≥ B ( C C k +12 C ) = , B ( C C k +11 C ) = . We build graphs analogously to the one in Figure 3 but with starting vertex one of the 4 matricesabove. These graphs are represented in Figure 4 and we immediately check that m is primitive. (cid:3) C C C C C C C , C C C C C C C C , C Figure 4. If m contains infinitely many occurrences of products of the form C C k +12 C or C C k +11 C , then m is primitive. LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 17 Lemma 4.2.
Let m = ( M n ) n ∈ N ∈ { C , C } N be a sequence of matrices. If m contains infinitelymany occurrences of both C and C , then there exists an increasing sequence of integers ( n m ) m ∈ N such that n = 0 and (20) M [ n m ,n m +1) ∈ { C C k C , C C k C | k ∈ N } for all m ∈ N .Proof. By recurrence, suppose that there exist M ∈ N and an increasing sequence of integers( n m ) ≤ m ≤ M such that n = 0 and satisfying Equation (20) for every m ∈ N such that 0 ≤ m < M .Then, the next value n M +1 of the sequence is defined recursively as n M +1 = min { k > n M | M k = M n M } + 1 . The existence of n M +1 is obvious since both C and C occur infinitely often in m . (cid:3) The semi-norm k · k D in the monoid generated by C , C . The next lemma presentsa nice property of the matrices of the form C C n C or C C n C for n ≥ k · k D . Note that when d = 3, k ( v , v , v ) k D = max {| v − v | , | v − v | , | v − v |} . Lemma 4.3.
For every n ∈ N , we have (cid:13)(cid:13)(cid:13) T ( C C n C ) (cid:13)(cid:13)(cid:13) R ≥ D = 1 and (cid:13)(cid:13)(cid:13) T ( C C n C ) (cid:13)(cid:13)(cid:13) R ≥ D = 1 . Proof.
Let f ∈ R ≥ \ { } be a nonzero nonnegative vector and let z ∈ f ⊥ . We only prove it for C C n C , the other one being symmetric. We separate the odd and even cases. Let k ∈ N . UsingEquation (14), we have k T ( C C k C ) z k D = (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) k k + 1 01 k z (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) D = (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) z (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) D and k T ( C C k +12 C ) z k D = (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) k k + 1 11 k + 1 0 z (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) D = (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) − − z (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) D Since z is orthogonal to f ∈ R ≥ \ { } , we have min( z ) ≤ ≤ max( z ). Thus, for z = z and z = − − z, we have min( z ) ≤ min( z ) ≤ ≤ max( z ) ≤ max( z ) − max( z ) ≤ min( z ) ≤ ≤ max( z ) ≤ − min( z ) , which implies that k z k D , k z k D ≤ k z k D .This shows that for all z ∈ f ⊥ \ { } and all n ∈ N , k T ( C C n C ) z k D k z k D ≤ . Furthermore, f being nonzero nonnegative, there exist a, b ∈ R with a ≤ ≤ b such that z =(0 , a, b ) ∈ f ⊥ \ { } . For this vector z , we have k T ( C C k C ) z k D = k (0 , a, b ) k D = k z k D ; k T ( C C k +12 C ) z k D = k ( − a, , − b ) k D = k z k D , showing that sup z ∈ f ⊥ \{ } k T ( C C n C ) z k D k z k D = 1. (cid:3) Observe that Lemma 4.3 does not hold in general. Indeed some matrices M obtained as theproduct of matrices C and C are such that k T M z k D > k z k D . For example, it is the case for M = C C . For z = T (8 , − ,
13) we compute k T ( C C ) z k D = (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) · − (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) D = (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) − (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) D = 26which is larger than k z k D = 18.4.3. Convergence in the monoid generated by C , C . The next result shows that anysequence ( M n ) n ∈ N ∈ { C , C } N is weakly convergent.Let u ∈ R ≥ be a vector belonging to the cone T n ≥ M [0 ,n ) R ≥ . For all k ∈ N , we define thevector u ( k ) = M − ,k ) u . Proposition 4.4.
For any sequence m = ( M n ) n ∈ N ∈ { C , C } N , there exists a vector u ∈ R ≥ \{ } satisfying (21) \ n ≥ M [0 ,n ) R ≥ = R ≥ u . Proof.
We split the proof into two cases, depending on whether m is primitive or not.Assume first that m = ( M n ) n ∈ N ∈ { C , C } N is a primitive sequence. From Proposition 4.1 andLemma 4.2 there exists an increasing sequence of integers ( n m ) m ∈ N such that n = 0 and(22) M [ n m ,n m +1) ∈ { C C k C , C C k C | k ∈ N } for all m ∈ N . We compute using Equation (16), Lemma 3.5 and Lemma 4.3 that (cid:13)(cid:13)(cid:13) T M [0 ,n ‘ ) (cid:13)(cid:13)(cid:13) M [0 ,n‘ ) R ≥ ∞ ≤ (cid:13)(cid:13)(cid:13) T M [0 ,n ‘ ) (cid:13)(cid:13)(cid:13) M [0 ,n‘ ) R ≥ D = 2 (cid:13)(cid:13)(cid:13)(cid:13)(cid:13) ‘ − Y m =0 T M [ n m ,n m +1 ) (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)Q ‘ − m =0 M [ nm,nm +1) R ≥ D ≤ ‘ − Y m =0 (cid:13)(cid:13)(cid:13) T M [ n m ,n m +1 ) (cid:13)(cid:13)(cid:13) M [ nm,nm +1) R ≥ D ≤ ‘ − Y m =0 (cid:13)(cid:13)(cid:13) T M [ n m ,n m +1 ) (cid:13)(cid:13)(cid:13) R ≥ D = 2 . Therefore, from Proposition 3.6, there exists a vector u ∈ R ≥ \ { } satisfying(23) \ n ≥ M [0 ,n ) R ≥ = \ m ≥ M [0 ,n m ) R ≥ = R + u and the conclusion follows.Assume now that m is not primitive. From Proposition 4.1, there is an integer N ≥ M N +2 i = M N +2 i +1 for all i ∈ N . Let us show that T n ≥ N M [ N,n ) R ≥ is one-dimensional.Let u ∈ T n ≥ M [0 ,n ) R ≥ . For all k ∈ N , let us write u ( k ) = T ( u ( k )1 , u ( k )2 , u ( k )3 ) and let us show that u ( N )2 = 0. Indeed, for all k ∈ N , the vector u ( N +2 k +2) is equal to one of the following two vectors: C − u ( N +2 k ) = ( u ( N +2 k )1 − u ( N +2 k )2 − u ( N +2 k )3 , u ( N +2 k )2 , u ( N +2 k )3 ); C − u ( N +2 k ) = ( u ( N +2 k )1 , u ( N +2 k )2 , u ( N +2 k )3 − u ( N +2 k )1 − u ( N +2 k )2 ) . LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 19 In both cases, the middle entry is unchanged. Thus, by recurrence, for every k ∈ N , we have u ( N +2 k )2 = u ( N )2 . Also the sum of the two other entries decreases by at least u ( N )2 . Therefore, forevery k ∈ N , we have 0 ≤ u ( N +2 k )1 + u ( N +2 k )3 ≤ u ( N )1 + u ( N )3 − ku ( N )2 , which implies that u ( N )2 = 0.To end the proof, it suffices to observe that if u ( N )2 = 0, the action of C − and C − on the vectors u ( N + k ) , k ∈ N , corresponds to the well-known additive Euclidean algorithm applied to the firstand third components. This shows that T n ≥ N M [ N,n ) R ≥ is one-dimensional and thus that so is T n ≥ M [0 ,n ) R ≥ . (cid:3) Rational dependencies of the limit cone
Proposition 4.4 states that for any sequence of matrices ( M n ) n ≥ ∈ { C , C } N , the cone T n ≥ M [0 ,n ) R ≥ converges to a one dimensionnal subspace f R with k f k = 1. In this section, we give more insighton the properties of ( M n ) n ≥ in terms of the rationnal dependencies of the entries of the vector f .We define the dimension of a vector f ∈ R as the dimension of the Q -vector space spanned byits entries, denoted dim Q ( f ). If dim Q ( f ) <
3, then there exists a rationnal dependency between itsentries. If dim Q ( f ) = 3, we say that f is totally irrational. In this section, we show that ( M n ) n ≥ is primitive if and only if the vector f is totally irrationnal. More precisely, we prove the followingresult. Recall that ∆ denotes the simplex { x ∈ R ≥ | k x k = 1 } . Theorem 5.1.
Let ( M n ) n ∈ N ∈ { C , C } N and let f ∈ ∆ such that T n ∈ N M [0 ,n ) R ≥ = R ≥ f . (i) dim Q ( f ) = 1 if and only if ( M n ) n ∈ N ∈ { C , C } ∗ { C N , C N } . (ii) dim Q ( f ) = 2 if and only if ( M n ) n ∈ N ∈ (cid:16) { C , C } ∗ { C , C } N (cid:17) \ { C , C } ∗ { C N , C N } . (iii) dim Q ( f ) = 3 if and only if ( M n ) n ∈ N is primitive. Note that the three conditions are mutually exclusive since we proved in Proposition 4.1 that( M n ) n ∈ N is primitive if and only if ( M n ) n ∈ N / ∈ { C , C } ∗ { C , C } N . The proof of the first two casesof Theorem 5.1 are done separately in Lemma 5.2 and Lemma 5.3. Lemma 5.2.
Let ( M n ) n ∈ N ∈ { C , C } N and let f ∈ ∆ such that T n ∈ N M [0 ,n ) R ≥ = R ≥ f . We have (i) M n = C for every n ∈ N if and only if f = (1 , , , (ii) M n = C for every n ∈ N if and only if f = (0 , , , (iii) ( M n ) n ∈ N ∈ { C , C } ∗ { C N , C N } if and only if dim Q ( f ) = 1 .Proof. For every k ∈ N , let f ( k ) = ( f ( k )1 , f ( k )2 , f ( k )3 ) = M − ,k ) f .(i) If f = (1 , , M = C , since (1 , , / ∈ C R ≥ . Moreover, f (1) = f . Therefore, byinduction, M n = C for every n ∈ N . Reciprocally, T n ∈ N C n R ≥ = R ≥ (1 , , M n ) n ∈ N ∈ { C , C } ∗ { C N , C N } . Then, there exists k ∈ N such that ( M n ) n ≥ k ∈{ C N , C N } . From (i) and (ii), f ( k ) ∈ { (1 , , , (0 , , } . Thus f ∈ Q \ { } so that dim Q ( f ) = 1.Reciprocally, if dim Q ( f ) = 1 then f ∈ Q \ { } . We may suppose f ∈ Z \ { } . If min( f ( k ) ) = 0,then k f ( k +1) k ≤ k f ( k ) k −
1. Thus there exists k ∈ N such that min( f ( k ) ) = 0. Then, if f ( k ) is not of the form (0 , , a ), (0 , a,
0) or ( a, ,
0) for some a , then k f ( k +2) k ≤ k f ( k ) k −
1. Thusthere exists k ∈ N such that f ( k ) ∈ { ( a, , , (0 , a, , (0 , , a ) } for some a >
0. If f ( k ) = (0 , a, f ( k +1) ∈ { ( a, , , (0 , , a ) } . Like for the cases (i) and (ii), we deduce that ( M n ) n ≥ k +1 is in { C N , C N } , which ends the proof. (cid:3) Lemma 5.3.
Let ( M n ) n ∈ N ∈ { C , C } N and let f = ( f , f , f ) ∈ ∆ such that T n ∈ N M [0 ,n ) R ≥ = R ≥ f . We have (i) if M n = M n +1 for every n ∈ N then f = 0 and dim Q ( f ) ≤ , (ii) if dim Q ( f ) = 2 and f = 0 , then M n = M n +1 for every n ∈ N .Proof. For every k ∈ N , let f ( k ) = ( f ( k )1 , f ( k )2 , f ( k )3 ) = M − ,k ) f .(i) Note that, for every k ∈ N , f (2 k +2) is equal to one of the following two vectors: C − f (2 k ) = ( f (2 k )1 − f (2 k )2 − f (2 k )3 , f (2 k )2 , f (2 k )3 ) or(24) C − f (2 k ) = ( f (2 k )1 , f (2 k )2 , f (2 k )3 − f (2 k )1 − f (2 k )2 ) . (25)In both cases, the middle entry is unchanged. Thus, by recurrence, for every k ∈ N , we have f (2 k )2 = f . Also the sum of the two other entries decreases by at least f . Therefore, for every k ∈ N , we have 0 ≤ f (2 k )1 + f (2 k )3 ≤ f + f − kf which implies that f = 0.(ii) We do the proof by induction. Suppose that f (2 k )2 = 0. We have that f (2 k ) ∈ M k M k +1 R ≥ .If M k M k +1 = C C and f (2 k +2) = ( α, β, γ ) for some α, β, γ ≥
0, then f (2 k ) = ( α + β, β + γ, α )so that β = γ = 0 and f (2 k )1 = α = f (2 k )3 . Thus we have f (2 k +1) = (0 , α, Q ( f ) =dim Q ( f (2 k +1) ) = 1, which is a contradiction. We similarly reach a contradiction when supposing M k M k +1 = C C . We thus obtain that M k M k +1 = C C or M k M k +1 = C C . As in bothcases we get, using (24) or (25), f (2 k +2)2 = 0, this ends the proof. (cid:3) We now give the description of primitive sequences.
Proof of Theorem 5.1.
Statements (i) and (ii) follow from Lemma 5.2 and Lemma 5.3.For every k ∈ N , let f ( k ) = ( f ( k )1 , f ( k )2 , f ( k )3 ) = M − ,k ) f . Let us assume that dim Q ( f ) = 3. If( M n ) n ∈ N is not primitive, then by Proposition 4.1 and Lemma 5.3(i), there exists N ∈ N such thatdim Q ( f ( N ) ) ≤
2. As f = M [0 ,N ) f ( N ) , we obtain dim Q ( f ) ≤
2, which contradicts our hypothesis.Let us now assume that ( M n ) n ∈ N is primitive. Using Proposition 4.1 and Lemma 5.2(iii), wecannot have dim Q ( f ) = 1. So we assume dim Q ( f ) = 2. Observe first that, if f ( N ) has a zero entryfor some N ∈ N , then either f ( N )2 = 0 or f ( N +1)2 = 0. Then, since dim Q ( f ( N ) ) = dim Q ( f ( N +1) ) =dim Q ( f ), this would imply by Proposition 4.1 and Lemma 5.3(ii) that ( M n ) n ∈ N is not primitive,which is a contradiction. From now on we assume that all entries of f ( n ) are positive for all n , andwe show that we again reach a contradiction.Since dim Q ( f ) <
3, there exists some integer vector v ∈ f ⊥ \ { } . The sequence ( M n ) n ∈ N canbe factored over { C C k C , C C k C | k ∈ N } . Let us consider the sequence ( n m ) such that n = 0and M n m . . . M n m +1 − is in this set for all m ∈ N . Since C and C are unimodular, for all m ∈ N , T M [0 ,n m ) v is an integer vector and so ( k T M [0 ,n m ) v k D ) m ∈ N is a nonnegative integer sequence. Inwhat follows, we reach a contradiction by showing that ( k T M [0 ,n m ) v k D ) m ∈ N is non-increasing anddecreases infinitely often.The proof that ( k T M [0 ,n m ) v k D ) m ∈ N is non-increasing is already done in the first part of the proofof Lemma 4.3, observing that for all m , f ( n m ) has positive entries and T M [0 ,n m ) v ∈ ( f ( n m ) ) ⊥ \ { } .Furthermore, if T M [0 ,n m ) v = T ( a, b, c ), then k T M [0 ,n m ) v k D = max( | b − a | , | c − b | , | c − a | ) and, usingEquation (14) and considering separately the even and odd cases (like in the proof of Lemma 4.3),we get k T M [0 ,n m +1 ) v k D = max {| b | , | c | , | c − b |} , if M [ n m ,n m +1 ) ∈ { C C k C | k ∈ N } ;max {| a | , | b | , | a − b |} , if M [ n m ,n m +1 ) ∈ { C C k C | k ∈ N } . Since f ( n m ) has positive entries and T M [0 ,n m ) v ∈ ( f ( n m ) ) ⊥ \ { } , we have min { a, b, c } < < max { a, b, c } , hence LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 21 • if M [ n m ,n m +1 ) ∈ { C C k C | k ∈ N } , k T M [0 ,n m +1 ) v k D = k T M [0 ,n m ) v k D if and only if a is(inclusively) between b and c , in which case k T M [0 ,n m +1 ) v k D = k T M [0 ,n m ) v k D = | c − b | ; • if M [ n m ,n m +1 ) ∈ { C C k C | k ∈ N } , k T M [0 ,n m +1 ) v k D = k T M [0 ,n m ) v k D if and only if c is(inclusively) between a and b , in which case k T M [0 ,n m +1 ) v k D = k T M [0 ,n m ) v k D = | a − b | .Using Proposition 4.1, there are infinitely many integers m such that either M [ n m ,n m +1 ) is in { C i C k +1 j C i | k ∈ N , { i, j } = { , }} , or M [ n m ,n m +1 ) M [ n m +1 ,n m +2 ) is in { C i C kj C i C j C ‘i C j | k, ‘ ∈ N , { i, j } = { , }} . We show that for any such m , we have k T M [0 ,n m +2 ) v k D < k T M [0 ,n m ) v k D . Let uswrite T M [0 ,n m ) v = ( a, b, c ).Assume first that M [ n m ,n m +1 ) = C C k +12 C for some k ∈ N ; the case M [ n m ,n m +1 ) = C C k +11 C issymmetric. Writing T M [0 ,n m +1 ) v = a b c = a + kb + ca + ( k + 1) b + ca + ( k + 1) b , we have k T M [0 ,n m ) v k D = k T M [0 ,n m +1 ) v k D = k T M [0 ,n m +2 ) v k D ⇔ k T M [0 ,n m ) v k D = k T M [0 ,n m +1 ) v k D = | c − b |k T M [0 ,n m +1 ) v k D = k T M [0 ,n m +2 ) v k D ∈ {| c − b | , | a − b |} Observing that | c − b | = | c | and | a − b | = | b | , we deduce that k T M [0 ,n m +2 ) v k D < k T M [0 ,n m ) v k D .Now assume that M [ n m ,n m +1 ) = C C k C and that M [ n m ,n m +1 ) = C C ‘ C ; the case M [ n m ,n m +1 ) = C C k C and M [ n m ,n m +1 ) = C C ‘ C is symmetric.Writing T M [0 ,n m +1 ) v = a b c = a + kba + ( k + 1) ba + kb + c , we have k T M [0 ,n m ) v k D = k T M [0 ,n m +1 ) v k D = k T M [0 ,n m +2 ) v k D ⇔ k T M [0 ,n m ) v k D = k T M [0 ,n m +1 ) v k D = | c − b |k T M [0 ,n m +1 ) v k D = k T M [0 ,n m +2 ) v k D = | a − b | Observing that | a − b | = | b | , we deduce that k T M [0 ,n m +2 ) v k D < k T M [0 ,n m ) v k D . (cid:3) Corollary 5.4.
Let f ∈ ∆ . If there exist two different sequences ( M n ) n ∈ N , ( M n ) n ∈ N ∈ { C , C } N such that \ n ∈ N M [0 ,n ) R ≥ = R ≥ f = \ n ∈ N M [0 ,n ) R ≥ , then dim Q ( f ) ≤ and both sequences ( M n ) n ∈ N , ( M n ) n ∈ N are not primitive.Proof. For every k ∈ N , let f ( k ) = ( f ( k )1 , f ( k )2 , f ( k )3 ) = M − ,k ) f and f ( k ) = ( f ( k )1 , f ( k )2 , f ( k )3 ) = M ,k ) f . There exists n ∈ N such that M k = M k for every k ∈ N with 0 ≤ k < n and M n = M n . Since f ( n ) ∈ M n R ≥ , f ( n ) ∈ M n R ≥ and f ( n ) = f ( n ) , this implies that f ( n )1 = f ( n )3 so that dim Q ( f ) ≤ M n ) n ∈ N and ( M n ) n ∈ N are not primitive. (cid:3) As a consequence, any primitive sequence of matrices ( M n ) n ∈ N ∈ { C , C } N can be recoveredfrom the vector it contracts the positive cone to by applying the algorithm F C . Corollary 5.5.
Let ( M n ) n ∈ N ∈ { C , C } N be a primitive directive sequence. Let f = ( f , f , f ) ∈ ∆ be such that T n ∈ N M [0 ,n ) R ≥ = R ≥ f . Then for all n ∈ N , M n = M ( F nC ( f )) .Proof. Suppose on the contrary that ( M n ) n ∈ N = ( M ( F nC ( f ))) n ∈ N . From Corollary 5.4, dim Q ( f ) ≤ M n ) n ∈ N is not primitive which is a contradiction. (cid:3) Symbolic representation of (∆ , f C )In this section, we prove Theorem A. Let us first define the measure-preserving dynamicalsystems we are dealing with.6.1. Background on dynamical systems.
Let ( X, B X , µ ), ( Y, B Y , ν ) be two measured spaces.A map f : X → Y is measure-preserving if it is measurable and satisfies µ ( f − ( B )) = ν ( B ) for all B ∈ B Y . If furthermore, f is a bijection and f − is measurable, then f − is also measure-preserving.In that case we say that f is an invertible measure-preserving map.Let ( X, B X , µ ) be a measured space and ( Y, B Y ) be a measurable space. If π : X → Y ismeasurable, then the pushforward measure on Y is the measure π ∗ µ defined by π ∗ µ ( B ) = µ ( π − ( B ))for all B ∈ B Y . The map π : ( X, B X , µ ) → ( Y, B Y , π ∗ µ ) is then measure-preserving.A measure-preserving dynamical system is a tuple ( X, T, B , µ ), where ( X, B , µ ) is a probabilityspace and T : X → X is measure-preserving. We also say that the measure µ is T -invariant . It issaid to be ergodic if for every set B ∈ B , T − B = B implies that µ ( B ) ∈ { , } .Two measure-preserving dynamical systems ( X, T, B X , µ ), ( Y, S, B Y , ν ) are said to be isomorphic if there exist sets ˜ X ∈ B X , ˜ Y ∈ B Y of measure 1 and an invertible measure-preserving map π : ˜ X → ˜ Y such that π ◦ T ( x ) = S ◦ π ( x ) for all x ∈ ˜ X . Such a map π is called an isomorphism .In this paper, the measure-preserving dynamical system are always on a topological space X and consider the Borel σ -algebra on it, so we simply denote them by ( X, T, µ ).6.2.
Dynamical systems associated with f C . Equipped with its natural Borel σ -algebra, ∆ isa measured space and f C : ∆ → ∆ is measurable. Furthermore, the Borel probability measure ξ defined by the density function 6 π (1 − x )(1 − x )if f C -invariant [AL17], which makes (∆ , f C , ξ ) a measure-preserving dynamical system. This mea-sure is furthermore ergodic [FS21] so it is the unique f C -invariant probability measure which isequivalent to the Lebesgue measure.The set { , } N is equipped with the product topology of the discrete topology on { , } andwe consider the associated Borel σ -algebra. The shift map S : { , } N → { , } N defined by S (( i n ) n ∈ N ) = ( i n +1 ) n ∈ N is continuous, hence measurable. For every 0 ≤ p ≤
1, the vector ( p , p ) =( p, − p ) uniquely defines a Borel probability measure β p by β p ([ i i · · · i n ]) = p i p i · · · p i n , where[ i i · · · i n ] = { ( j k ) k ∈ N | j k = i k for 0 ≤ k ≤ n } . This measure is shift-invariant and is called a Bernoulli measure . It is positive whenever 0 < p <
1. For any p , ( { , } N , S, β p ) is thus a measure-preserving dynamical system. It is classical to show that any Bernoulli measure is ergodic.We know show that (∆ , f C ) and ( { , } N , S ) are isomorphic (for many measures). We considerthe sets ∆ , ∆ that are the restriction to ∆ of Λ and Λ , i.e.∆ = { ( x , x , x ) ∈ ∆ | x ≥ x } ;∆ = { ( x , x , x ) ∈ ∆ | x < x } . LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 23 We respectively define the maps π : { , } N → ∆ and δ : ∆ → { , } N by π (( i n ) n ∈ N ) = f , where \ n ≥ C i C i · · · C i n R ≥ = R ≥ f δ ( f ) = ( i n ) n ∈ N , where f nC ( f ) ∈ ∆ i n for every n. The map π is well defined and continuous by Proposition 4.4. The map δ is well defined because { ∆ , ∆ } is a partition of ∆. We finally let P denote the set of sequences ( i n ) n ∈ N ∈ { , } N suchthat ( C i n ) n ≥ is primitive and we let I denote the set of vectors in ∆ with rationally independententries. Proof of Theorem A.
The map π is measurable because it is continuous. The map δ is also mea-surable because so is f C and for all i i · · · i n − ∈ { , } n , δ − ([ i i · · · i n − ]) = \ ≤ k The systems (∆ , f C , ξ ) and ( { , } N , S, δ ∗ ξ ) are isomorphic. For any positiveBernoulli measure β , the systems ( { , } N , S, β ) and (∆ , f C , π ∗ β ) are isomorphic.Proof. The first part follows from the fact that, ξ being equivalent to the Lebesgue measure, ξ ( I ) = 1. For the second part, it is well known that any Bernoulli measure β is ergodic. If β ispositive, then β ([121]) is positive and, by ergodicity, we get for all m ∈ N , β ( S n ≥ m S − n [121]) = 1and so β ( T m ∈ N S n ≥ m S − n [121]) = 1. By Proposition 4.1, we have T m ∈ N S n ≥ m S − n [121] ⊂ P , hence β ( P ) = 1. (cid:3) In what follows, we consider measures µ on { , } N to obtain results for µ -almost directivesequences ( i n ) n ∈ N . However our main goal is to deal with sequences of matrices ( C i n ) n ∈ N . Toalleviate notation, we will transfer the measures µ on { C , C } N and speak about µ -almost everysequences ( M n ) n ∈ N ∈ { C , C } N . Remark 6.2. Observe that δ ∗ ξ = π − ∗ ξ is not a Bernoulli measure since δ ∗ ξ ([11]) = δ ∗ ξ ([1]) .Indeed, δ ∗ ξ ([1]) = δ ∗ ξ ([2]) = Z Z − x x π (1 − x )(1 − x ) dx dx = 12 δ ∗ ξ ([11]) = δ ∗ ξ ([22]) = Z Z − x π (1 − x )(1 − x ) dx dx ≈ . δ ∗ ξ ([12]) = δ ∗ ξ ([21]) = Z Z x π (1 − x )(1 − x ) dx dx ≈ . Since the measure δ ∗ ξ and Bernoulli measures on { , } N are ergodic and shift-invariant, they arepairwise mutually singular. Word frequencies In this section, we come back to Theorem 3.1 that motivated the study made in the previoussections and we prove the following result. Proposition 7.1. Every C -adic word w = lim n → + ∞ σ [0 ,n ) (1) , ( σ n ) n ∈ N ∈ C N , has uniform wordfrequencies. In particular, if f ∈ R d ≥ is such that k f k = 1 and (26) \ n ≥ M σ [0 ,n ) R ≥ = R ≥ f , then f is the vector of letter frequencies of w .Proof. Let ( M n ) n ≥ be the sequence of incidence matrices associated with ( σ n ) n ∈ N . By Proposi-tion 4.4, there is a vector f such that k f k = 1 and \ n ≥ M [0 ,n ) R ≥ = R ≥ f . By Corollary 2.2, every C -adic word either is ultimately periodic, or has an everywhere growingdirective sequence ( σ n ) n ∈ N ∈ C N . In the latter case, it directly follows from Theorem 3.1 that f isthe vector of letter frequencies.Let us now assume that w is ultimately periodic, hence that ( σ n ) n ∈ N is not everywhere grow-ing. Then w has uniform word frequencies and it remains to show that f is the vector of letterfrequencies. By Lemma 2.1, there is an integer N ≥ σ n = c for all n ≥ N and w = ( σ [0 ,N ) (1)) ω .(2) σ n = c for all n ≥ N and w = ( σ [0 ,N ) (13 ω ) for some integer N ≥ N .Using Lemma 5.2, we deduce that in the first case (resp., second case), f is the normed vectorproportionnal to M [0 ,N ) e (resp., to M [0 ,N ) e ) and this indeed corresponds to the vector of letterfrequencies of w . (cid:3) Balance property A word w ∈ A N is said to be finitely balanced if there exists a constant C > u, v ∈ A ∗ of the same length and occurring in w , and for every letter i ∈ A , || u | i − | v | i | ≤ C .Assuming that an S -adic word has uniform word frequencies, a sufficient condition for finite balancecan be expressed using the incidence matrices of the directive sequence. Theorem 8.1. [BD14, Theorem 5.8] Let ( σ n ) n ∈ N be the directive sequence of an S -adic represen-tation of a word w . For each n , let M n be the incidence matrix of σ n . Assume that w has uniformletter frequencies and let f be the letter frequencies vector. If (27) X n ≥ (cid:13)(cid:13)(cid:13) T M [0 ,n ) (cid:12)(cid:12)(cid:12) f ⊥ (cid:13)(cid:13)(cid:13) · k M n k < ∞ then the word w is balanced. Note that if the substitutions σ n belong to a finite set, then the norms k M n k are uniformlybounded and can be removed from the sum.Therefore we want to show that (cid:13)(cid:13)(cid:13) T M [0 ,n ) (cid:12)(cid:12)(cid:12) f ⊥ (cid:13)(cid:13)(cid:13) = sup v ∈ f ⊥ \{ } k T M [0 ,n ) v kk v k . converges to 0 as n goes to infinity fast enough so that the sum at Equation (27) converges. Weachieve this in the current section using norm k · k D defined earlier. LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 25 The strategy that we use is inspired by the Lemma 6 from Avila and Delecroix [AD19] whichprovides sufficient conditions so that the second Lyapunov exponent is negative and so that theassociated words are balanced [BD14, Theorem 6.4]. We already proved in Lemma 4.3 that (cid:13)(cid:13)(cid:13) T ( C C n C ) (cid:13)(cid:13)(cid:13) R ≥ D = 1 and (cid:13)(cid:13)(cid:13) T ( C C n C ) (cid:13)(cid:13)(cid:13) R ≥ D = 1 for every n ∈ N . Now we want to prove theexistence of a contracting matrix for the norm k · k D .8.1. Existence of a contracting matrix. The next result gives the existence of a matrix in themonoid generated by C and C that is contracting for the semi-norm k · k D . Lemma 8.2. If M = ( C C ) or if M = ( C C ) , then (cid:13)(cid:13)(cid:13) T M (cid:13)(cid:13)(cid:13) M R ≥ D ≤ . Proof. Assume that M = ( C C ) (the other case is symmetric). We have( C C ) = and (cid:16) ( C C ) (cid:17) − = − − − − . If z = T ( a, b, c ), we have (cid:13)(cid:13)(cid:13) T M z (cid:13)(cid:13)(cid:13) D = (cid:13)(cid:13)(cid:13) T (( C C ) ) z (cid:13)(cid:13)(cid:13) D = (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) z (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) D = (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) − abc (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) D = (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) a + c − b (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) D . Recall from Equation (17) that H is the set of hyperplanes orthogonal to some vectors in S = ( M E ∪ ( E − E ) ∪ M ( E − E )) \ { } where E = { e i : 1 ≤ i ≤ } We compute: M e = T (2 , , , ( e − e ) = T (1 , − , , M ( e − e ) = T ( − , , − ,M e = T (3 , , , ( e − e ) = T (1 , , − , M ( e − e ) = T (1 , , ,M e = T (2 , , , ( e − e ) = T (0 , , − , M ( e − e ) = T (0 , , . Thus H consists of 9 distinct hyperplanes. The hyperplanes and cones delimited by them areillustrated in Figure 5 on the plane a + b + c = 1 where the excluded region ± ( T M ) − R > is shownin grey. The set D is the finite union of intersections of distinct hyperplanes of H . It contains atmost · = 36 distinct lines passing through the origin whose directions z are listed in Table 1.From Lemma 3.8, it is sufficient to consider vectors z ∈ D \ ± T M − R > . Exactly 13 of those linesbelong to ± T M − R > (the grey region) and are excluded from the search of the optimal value. Wehave that D \ ± ( T M ) − R > contains 23 vectors up to a positive multiplicative constant. For each ofthem, we compute the respective values and norm in Table 1. The maximum of k T Mz k D k z k D is attainedat z = (2 , − , 2) with a value of 4 / 5. The conclusion follows. An alternative representation wherethe subcone T M − R > is bounded (the central region of a Venn diagram) is shown in Figure 9. (cid:3) An acceleration of the algorithm. In Lemma 4.3, we proved that C C n C and C C n C are neutral for the semi-norm k · k D and in Lemma 8.2, we proved that ( C C C )( C C C ) and( C C C )( C C C ) are contracting for the semi-norm k · k D . Therefore, it is natural to considerthe acceleration of the algorithm on the monoid generated by C C n C and C C n C (see Figure 6).Note that C C k C = k k + 1 k and C C k +12 C = k k + 1 k + 11 1 0 (1,0,0) (0,1,0)(0,0,1) k M T z k D = a + c k M T z k D = a + b + c k M T z k D = b k z k D = b − a k z k D = a − b k z k D = c − a k z k D = c − b k z k D = a − c k z k D = b − c (0 , , − , , − − , , − , , , − , , − , 1) (-1,1,0)(1,-1,0) (-1,-1,2)(1,1,-2) (-2,1,1)(2,-1,-1)(1 , − , 1) ( − , , − − , , )(-3,2,2)( − , − , 2) (-1,1,1)(2,-3,2) (-2,5,-2)(-1,3,-1) Figure 5. An illustration on the plane a + b + c = 1 of the proof that ( C C ) is contractingon of each subcone. The hyperplanes associated with vectors in M E , E − E and M ( E − E )are respectively drawn in red, blue and green. The green circle illustrates the points atinfinity on the projective space. The grey regions represent the vectors z ∈ ± ( T M ) − R > that we do not need to consider for the maximum. The eleven points z in D \ ± ( T M ) − R > listed in Table 1 are shown on the boundary of the grey region. The maximum of k T Mz k D k z k D is attained at z = (2 , − , 2) with a value of 4 / and C C k C = k k + 1 k and C C k +11 C = k + 1 k + 1 k . LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 27 u v z = u ∧ v T M z z ∈ R \ ± ( T M ) − R > k z k D k T M z k D M e M e (2 , − , − 2) (0 , , 1) yes 4 1 M e M e (1 , , − 2) (0 , − , 0) yes 3 1 M e ( e − e ) ( − , , − 2) (0 , − , − 3) yes 5 4 M e ( e − e ) (1 , , − 4) (0 , − , − 1) yes 5 3 M e ( e − e ) ( − , , 2) (0 , − , − 2) yes 5 2 M e M ( e − e ) ( − , , 2) (0 , , − 1) yes 4 1 M e M ( e − e ) (1 , − , 0) (0 , , 1) yes 2 1 M e M ( e − e ) ( − , , 2) (0 , , 0) yes 3 1 M e M e (0 , , − 1) (1 , , 0) yes 2 1 M e ( e − e ) ( − , , − 2) (4 , , − 1) yes 7 5 M e ( e − e ) (2 , , − 5) (3 , , 1) yes 7 3 M e ( e − e ) ( − , , 3) (1 , , − 2) yes 7 3 M e M ( e − e ) ( − , , 2) (0 , , − 1) yes 4 1 M e M ( e − e ) (0 , − , 1) ( − , , 0) yes 2 1 M e M ( e − e ) ( − , , 3) ( − , , − 1) yes 5 1 M e ( e − e ) ( − , , − 1) (3 , , 0) yes 4 3 M e ( e − e ) (1 , , − 3) (1 , − , 0) yes 4 2 M e ( e − e ) ( − , , 2) (2 , , 0) yes 4 2 M e M ( e − e ) ( − , , 1) (1 , , 0) yes 2 1 M e M ( e − e ) (0 , − , 1) ( − , , 0) yes 2 1 M e M ( e − e ) ( − , , 2) (0 , , 0) yes 3 1( e − e ) ( e − e ) ( − , − , − 1) ( − , − , − 4) no - -( e − e ) ( e − e ) (1 , , 1) (5 , , 4) no - -( e − e ) M ( e − e ) (0 , , 0) (4 , , 2) no - -( e − e ) M ( e − e ) (1 , − , 1) ( − , , 1) yes 3 2( e − e ) M ( e − e ) (1 , , 1) (3 , , 3) no - -( e − e ) ( e − e ) (1 , , 1) (5 , , 4) no - -( e − e ) M ( e − e ) (1 , , − 1) (3 , , 2) no - -( e − e ) M ( e − e ) ( − , − , 2) ( − , − , − 1) no - -( e − e ) M ( e − e ) (0 , , 1) (1 , , 1) no - -( e − e ) M ( e − e ) ( − , , 1) (1 , , 0) yes 2 1( e − e ) M ( e − e ) (2 , − , − 1) (1 , , 2) no - -( e − e ) M ( e − e ) (1 , , 0) (2 , , 2) no - - M ( e − e ) M ( e − e ) (1 , , − 1) (1 , , 1) no - - M ( e − e ) M ( e − e ) (1 , , − 1) (1 , , 1) no - - M ( e − e ) M ( e − e ) ( − , , 1) ( − , − , − 1) no - - Table 1. Table of values for each of the 36 vectors in D . The vector in D \ ± ( T M ) − R > which maximizes the ratio k T Mz k D k z k D is z = ( − , , − 2) with a value of 4 / An upper-bound for the norm restricted to the complementary plane. The nextlemma gives an upper-bound for the norm restricted to the complementary plane. Its proof followsthe line of the proof of the Lemma 6 from Avila and Delecroix [AD19] that they applied for Brunand fully subtractive algorithms. 11 121 12 Figure 6. The partition associated with the acceleration of the algorithm. Lemma 8.3. Let µ be a shift-invariant ergodic measure on { , } N . For every ε > , there exists N such that for every n > N and µ -almost all sequences ( M n ) n ∈ N ∈ { C , C } N , we have (cid:13)(cid:13)(cid:13) T M [0 ,n ) (cid:12)(cid:12)(cid:12) f ⊥ (cid:13)(cid:13)(cid:13) ∞ ≤ n + 12 (cid:18) (cid:19) n ( µ ([12121212]) − ε ) − , where T n ∈ N M [0 ,n ) R > = R > f .Proof. First consider the case where µ ([2]) = 0, the case µ ([1]) = 0 is symmetric. Then themeasure µ is the Dirac measure concentrated on the sequence 1 ω , hence µ ([12121212]) = 0 and n +12 (cid:16) (cid:17) n ( µ ([12121212]) − ε ) − ≥ n ≥ ε > 0. By Lemma 5.2, we then have f = (1 , , n , we have T C n = n n and T C n +11 = n + 1 0 1 n , which implies that (cid:13)(cid:13)(cid:13) T C n (cid:12)(cid:12)(cid:12) f ⊥ (cid:13)(cid:13)(cid:13) ∞ = 1 for all n .Assume now that µ ([1]) and µ ([2]) are positive. By ergodicity of µ , µ -almost every sequence( M n ) n ∈ N contains infinitely many occurrences of C and of C . By Lemma 4.2, there is an increasingsequence ( n i ) i ∈ N such that n = 0 and A i = M [ n i ,n i +1 ) ∈ { C C k C , C C k C : k ∈ N } for all i . For all large enough n ∈ N , there exists a unique m ∈ N such that n m ≤ n − < n m +1 .Let g = M − ,n m ) f , then using Lemma 3.5, we get (cid:13)(cid:13)(cid:13) T M [0 ,n ) (cid:12)(cid:12)(cid:12) f ⊥ (cid:13)(cid:13)(cid:13) ∞ ≤ (cid:13)(cid:13)(cid:13) T M [ n m ,n ) (cid:12)(cid:12)(cid:12) g ⊥ (cid:13)(cid:13)(cid:13) ∞ · (cid:13)(cid:13)(cid:13) T M [0 ,n m ) (cid:12)(cid:12)(cid:12) f ⊥ (cid:13)(cid:13)(cid:13) ∞ ≤ (cid:13)(cid:13)(cid:13) T M [ n m ,n ) (cid:13)(cid:13)(cid:13) ∞ · (cid:13)(cid:13)(cid:13) T M [0 ,n m ) (cid:13)(cid:13)(cid:13) M [0 ,nm ) Λ ∞ LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 29 Remark that M [ n m ,n ) is of the form C C k = k k 10 1 0 or C C k +12 = k k + 1 11 0 0 or C C k = k k or C C k +11 = k + 1 k for some k ∈ N . Moreover (cid:13)(cid:13)(cid:13) C C k (cid:13)(cid:13)(cid:13) ∞ = (cid:13)(cid:13)(cid:13) C C k +12 (cid:13)(cid:13)(cid:13) ∞ = (cid:13)(cid:13)(cid:13) C C k (cid:13)(cid:13)(cid:13) ∞ = (cid:13)(cid:13)(cid:13) C C k +11 (cid:13)(cid:13)(cid:13) ∞ = k + 2 . Therefore (cid:13)(cid:13)(cid:13) T M [ n m ,n ) (cid:13)(cid:13)(cid:13) ∞ ≤ n − n m − 12 + 2 ≤ n − 12 + 2 = n + 12 . Let us now focus on the term (cid:13)(cid:13)(cid:13) T M [0 ,n m ) (cid:13)(cid:13)(cid:13) M [0 ,nm ) Λ ∞ where M [0 ,n m ) = Q m − i =0 A i .Let J m be the set of indices j ∈ { , , . . . , n m − } such that M [ j,j +8) = ( C C ) . Let J m ⊂ J m be a subset of maximal cardinality such that(28) min (( J m − J m ) \ { } ) ≥ . Observe that | J m | ≥ | J m | . If j ∈ J m , then then there exists a unique i ( j ) ∈ N such that n i ( j ) ∈ { j, j + 1 , j + 2 } and therefore A i ( j ) A i ( j )+1 ∈ { ( C C ) , ( C C ) } . In particular if j, j ∈ J m with j = j , then | i ( j ) − i ( j ) | ≥ I m = i ( J m ) = { i ( j ) : j ∈ J m } .Using Lemma 3.5 recursively, Equation (16), Lemma 4.3 and Lemma 8.2, we compute (cid:13)(cid:13)(cid:13) T M [0 ,n m ) (cid:13)(cid:13)(cid:13) M [0 ,nm ) Λ ∞ = (cid:13)(cid:13)(cid:13)(cid:13)(cid:13) T m − Y i =0 A i !(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)Q m − i =0 A i Λ ∞ = (cid:13)(cid:13)(cid:13)(cid:13)(cid:13) T m − Y i =0 A i !(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)Q m − i =0 A i Λ D ≤ Y i ∈ I m (cid:13)(cid:13)(cid:13) T ( A i A i +1 ) (cid:13)(cid:13)(cid:13) A i A i +1 Λ D · Y i ∈{ , ,...,m − } i/ ∈ I m , i/ ∈ I m +1 (cid:13)(cid:13)(cid:13) T A i (cid:13)(cid:13)(cid:13) A i Λ D ≤ (cid:18) (cid:19) | I m | · ≤ (cid:18) (cid:19) | J m | . Let us now conclude the proof. From the pointwise ergodic theorem, for µ -almost every x ∈{ , } N , we havelim n →∞ n n − X k =0 χ [12121212] ◦ S k ( x ) = lim n →∞ n n − X k =0 χ [12121212] ◦ S k ( x ) = µ ([12121212]) . Therefore, for µ -almost every x ∈ { , } N and for all ε > 0, there exists N such that for all n > N we have (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) n n − X k =0 χ [12121212] ◦ S k ( x ) − µ ([12121212]) (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) < ε and we obtain | J m | = n m − X k =0 χ [12121212] ◦ S k ( x ) ≥ n − X k =0 χ [12121212] ◦ S k ( x ) − > n ( µ ([12121212]) − ε ) − (cid:3) Proof of Theorem C (part 1). From Proposition 7.1, for every ( i n ) n ∈ N ∈ { , } N , the C -adic word w = lim n → + ∞ c i c i · · · c i n (1) has uniform word frequencies and its vector of letter frequencies f satisfies \ n ∈ N C i C i · · · C i n R ≥ = R ≥ f . From Lemma 8.3, for every ε > 0, there exists N such that for µ -almost all sequences ( M n ) n ∈ N ∈{ C , C } N , we have X n>N (cid:13)(cid:13)(cid:13) T M [0 ,n ) (cid:12)(cid:12)(cid:12) f ⊥ (cid:13)(cid:13)(cid:13) ∞ · k M n k ∞ ≤ X n>N n + 12 (cid:18) (cid:19) n ( µ ([12121212]) − ε ) − · . In particular, if 0 < ε < µ ([12121212]), the above series converges. Therefore, from Theorem 8.1we conclude that for µ -almost every directive sequence in { , } N , the word w is balanced. (cid:3) The second Lyapunov exponent In this section, we prove the part of Theorem C about the second Lyapunov exponent. Theproof follows from the lemmas proved in Section 8. It is different than the one provided in [BST21]as it is based on the approach proposed by Avila and Delecroix [AD19]. We furthermore provethe negativity of the second Lyapunov exponent not only for Lebesgue-almost every vector ofletter frequencies, but also for µ -almost every directive sequence ( i n ) n ∈ N ∈ { , } N , where µ is anyshift-invariant ergodic Borel probability measure on { , } N .Given an infinite word γ ∈ { , } N , we define the matrices A n as A n ( γ ) = C γ C γ . . . C γ n − , for every n ≥ cocycle relation A m + n ( γ ) = A m ( γ ) A n ( S m γ ) , where S : { , } N → { , } N is the shift map. Let µ be a shift-invariant ergodic measure on { , } N . The Lyapunov exponents of the cocycle A n with respect to µ are the exponential growthof eigenvalues of the matrices A n along a µ -generic directive sequence γ . Since the matrices C and C are invertible, the cocycle A n is log-integrable , that is Z { , } N log max (cid:16) k A ( γ ) k , k A ( γ ) − k (cid:17) dµ ( γ ) < ∞ . The first Lyapunov exponent is then the µ -almost everywhere limit θ µ = lim n →∞ log k A n ( γ ) k n . LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 31 Since moreover the sequences of nested cone M [0 ,n ) R ≥ converges to a line R ≥ f , the second Lya-punov exponent is the µ -almost everywhere limit θ µ = lim n →∞ log (cid:13)(cid:13)(cid:13) T A n ( γ ) (cid:12)(cid:12)(cid:12) f ⊥ (cid:13)(cid:13)(cid:13) n , see Equation (6.1) from [BD14].In [Bal92, p. 1522] and [Lab15], approximations of the first and second Lyapunov exponents θ µ and θ µ of Selmer and Cassaigne algorithms were computed where µ = π − ? ( ξ ) and ξ is the f C -invariant measure on ∆ which is absolutely continuous with respect to Lebesgue measure. Thevalues are summarized in the table below:Algorithm θ θ − θ /θ Source F S log(1 . ≈ . 182 log(0 . ≈ − . ≈ . 387 Baldwin [Bal92, p. 1522] F S ≈ . ≈ − . ≈ . F C ≈ . ≈ − . ≈ . x ∈ ∆, the associated secondLyapunov is negative. We prove the negativity of the second Lyapunov exponent for the cocycleassociated with matrices in { C , C } below. Proof of Theorem C (part 2). Let γ ∈ { , } N . According to Proposition 4.4, the sequence ofnested cones A n ( γ ) R ≥ converges to a line R ≥ f for some f ∈ ∆. From Lemma 8.3, for every ε > µ -almost all sequences γ ∈ { , } N , we have θ µ = lim n →∞ log (cid:13)(cid:13)(cid:13) T A n ( γ ) (cid:12)(cid:12)(cid:12) f ⊥ (cid:13)(cid:13)(cid:13) n ≤ lim n →∞ log (cid:18) n +12 (cid:16) (cid:17) n ( µ ([12121212]) − ε ) − (cid:19) n = lim n →∞ log( n +12 ) + (cid:16) n ( µ ([12121212]) − ε ) − (cid:17) log (cid:16) (cid:17) n = 18 ( µ ([12121212]) − ε ) log (cid:18) (cid:19) . Therefore θ µ ≤ µ ([12121212]) log (cid:18) (cid:19) ≈ − . < . (cid:3) The above upper bound is far from the one provided in [BST21, Theorem 5.1] where they provedusing other methods that θ µ < − . Factor complexity If w is an infinite word over some alphabet A , we let Fac( w ) denote the set of its factors, i.e.,Fac( w ) = { u ∈ A ∗ | ∃ i ∈ N : w i · · · w i + | u |− = u } . The factor complexity of w is the function p w : N → N , n w ) ∩ A n ) . An infinite word w is said to be uniformly recurrent if for all u ∈ Fac( w ), u occurs infinitely manytimes in w and the gap between two successive occurrences is bounded. It is classical to provethat every primitive S -adic word is uniformly recurrent.In this section, we study the factor complexity of C -adic words. In particular, we prove thefollowing result, which ends the proof of Theorem B. It is worth noticing the analogy with Theo-rem 5.1. Theorem 10.1. Let w be a C -adic word with directive sequence ( c i n ) n ∈ N . (i) there exists k ≥ such that p w ( n ) = k for all large enough n if and only if ( c i n ) n ∈ N ∈{ c , c } ∗ { c N , c N } . (ii) there exists k ≥ such that p w ( n ) = n + k for all large enough n if and only if ( c i n ) n ∈ N ∈ (cid:16) { c , c } ∗ { c , c } N (cid:17) \ { c , c } ∗ { c N , c N } . (iii) p w ( n ) = 2 n + 1 for all n if and only if ( c i n ) n ∈ N is primitive. In particular, this is alsoequivalent to the fact that w is a uniformly recurrent dendric word (see Section 10.1 forthe definition). The proof essentially consists in studying the bispecial factor of C -adic words.10.1. Bispecial factors and extension sets. For every infinite word w ∈ A N and every factor u ∈ Fac( w ), we set E − ( u, w ) = { a ∈ A | au ∈ Fac( w ) } ; E + ( u, w ) = { b ∈ A | ub ∈ Fac( w ) } ; E ( u, w ) = { ( a, b ) ∈ A × A | aub ∈ Fac( w ) } . The set E ( u, w ) is called the extension set of u in w . We represent it by a tabular of the form E ( u, w ) = · · · j · · · ... i × ... , where a symbol × in position ( i, j ) means that ( i, j ) belongs to E ( u, w ).The elements of E − ( u, w ), E + ( u, w ) and E ( u, w ) are respectively called the left extensions ,the right extensions and the biextensions of u in w . When the context is clear, we will omit theinformation on w and simply write E − ( u ), E + ( u ) and E ( u ). The word u is said to be left special if E − ( u ) > right special if E + ( u ) > bispecial if it is both left special and right special.The factor complexity of an infinite word is completely governed by the biextensions of itsbispecial factors [CN10]. In particular, we have the following result. Proposition 10.2 ( [CN10, Proposition 4.5.3]) . Let w ∈ A N be an infinite word. If for everybispecial factor u , one has (29) E ( u ) − E − ( u ) − E + ( u ) + 1 = 0 , then p w ( n ) = ( p w (1) − n + 1 for every n . Equation (29) is in particular satisfied when there exists ( a, b ) ∈ E ( u ) such that E ( u ) ⊂ ( { a } × A ) ∪ ( A × { b } ). Such a bispecial factor is said to be ordinary . On our tabular representation, thismeans that the biextensions form a cross as follows: E ( u ) = · · · b · · ·× ... ... a × · · · × · · · × ... ... × . Another geometric representation of the extension set of a word u ∈ Fac( w ) is given by the extension graph of u . It is the undirected bipartite graph whose set of vertices is the disjoint unionof E − ( u ) and E + ( u ) and whose set of edges is E ( u ). A bispecial factor u is said to be dendric whenever its extension graph is a tree. Dendric bispecial factors thus also satisfy Equation (29). LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 33 Infinite words for which all bispecial factors are dendric are also called dendric and were recentlyintroduced under the name of tree sets [BDFD + Bispecial factors in C -adic words. In this section, we give a detailed description ofthe extension sets of bispecial factors in C -adic words. To simplify proofs, we consider C = { c , c , c , c , c , c } , where c = c : c = c c : c = c c c : c = c : c = c c : c = c c c : . Every (primitive) C -adic word is a (primitive) C -adic word and conversely.For an S -adic word w with S -adic representation (( σ n ) n ∈ N , ( a n ) n ∈ N ), we set for each n ∈ N , w ( n ) = lim m → + ∞ σ n σ n +1 · · · σ m − ( a m ), provided that the limit exists. We let ε denote the emptyword. We have the following result. Lemma 10.3 (Synchronization) . Let w , w ∈ A N be such that w = σ ( w ) for some σ ∈ C . If u ∈ Fac( w ) is a non-empty bispecial factor, then(1) If σ = c , there is a unique word v ∈ Fac( w ) such that u = σ ( v )1 .(2) If σ = c , there is a unique word v ∈ Fac( w ) such that u = 3 σ ( v ) .(3) If σ = c , there is a unique word v ∈ Fac( w ) such that u ∈ σ ( v ) { , ε } .(4) If σ = c , there is a unique word v ∈ Fac( w ) such that u ∈ { , ε } σ ( v )2 .(5) If σ = c , there is a unique word v ∈ Fac( w ) such that u ∈ { , ε } σ ( v ) { , } .(6) If σ = c , there is a unique word v ∈ Fac( w ) such that u ∈ { , } σ ( v ) { , ε } .Furthermore, v is a bispecial factor of w and is shorter than u .Proof. Let us only prove the case σ = c , the other ones being similar. It is immediate to checkthat we have 22 , , , / ∈ Fac( w ). Therefore, the letters 2 and 3 and not left special, neitherright special in w . Since u is a bispecial factor of w , it follows that 1 is the first and the last letterof u and that there is a unique word v ∈ Fac( w ) such that u = c ( v )1. The word v is triviallyshorter than u . By uniqueness of v , it is also bispecial. Indeed, if there is a unique letter a ∈ A such that av ∈ Fac( w ), then since c ( a ) ∈ A ∗ a , it is also the unique letter such that au ∈ Fac( w ).Similarly, if there is a unique letter b ∈ A such that vb ∈ Fac( w ), then since c ( b A ) ⊂ b A ∗ , it isalso the unique letter such that ub ∈ Fac( w ). (cid:3) If w is an C -adic word with directive sequence ( σ n ) n ∈ N ∈ C N , then w = σ ( w ), with w = w (1) .Thus if u and v be as in Lemma 10.3. The word v is called the bispecial antecedent of u under σ . Similarly, u is called a bispecial extended image of v under σ . Since the bispecial antecedentof a non-empty bispecial word is always shorter, for any bispecial factor u of w , there is a uniquesequence ( u i ) ≤ i ≤ n such that • u = u , u n = ε and u i = ε for all i < n ; • for all i < n , u i +1 ∈ Fac( w ( i +1) ) is the bispecial antecedent of u i under σ i .The factor u is called a bispecial descendant of ε in w ( n ) .As any bispecial factor of a primitive C -adic word is a descendant of the empty word, to under-stand the extension sets of any bispecial word in w , we need to know the possible extension sets of ε in w ( n ) and to understand how the extension set of a bispecial factor governs the extensionsets of its bispecial extended images. Lemma 10.4. If w is a primitive C -adic word with directive sequence ( σ n ) n ∈ N , then the extensionset E ( ε, w ) is one of the following, depending on σ . σ = c × × × × × σ = c × × × × × σ = c × × × × × σ = c × × × × × σ = c × × × × × σ = c × × × × × Proof. The directive sequence being primitive, all letters of A occur in w (1) . The result then followsfrom the fact that all morphisms σ in C are either left proper ( σ ( A ) ⊂ a A ∗ for some letter a ) orright proper ( σ ( A ) ⊂ A ∗ a for some letter a ). (cid:3) The next lemma describes how the extension set of a bispecial word determines the extensionset of any of its bispecial extended images. Lemma 10.5. Let w be a C -adic word with directive sequence ( σ n ) n ∈ N ∈ C N . If v is a bispecialfactor of w (1) and if u = xσ ( v ) y ∈ Fac( w ) is a bispecial extended image of v ( x, y ∈ A ∗ ), then(1) if σ ( A ) ⊂ i A ∗ for some letter i ∈ A , we have E ( u, w ) = { ( a, b ) | ∃ ( a , b ) ∈ E ( v, w (1) ) : σ ( a ) ∈ A ∗ ax ∧ σ ( b ) i ∈ yb A ∗ } ; (2) if σ ( A ) ⊂ A ∗ i for some letter i ∈ A , we have E ( u, w ) = { ( a, b ) | ∃ ( a , b ) ∈ E ( v, w (1) ) : iσ ( a ) ∈ A ∗ ax ∧ σ ( b ) ∈ yb A ∗ } . Proof. Let us prove the first equality, the second one being symmetric.For the inclusion ⊇ , consider ( a , b ) ∈ E ( v ) such that σ ( a ) ∈ A ∗ ax and σ ( b ) i ∈ yb A ∗ . Let c ∈ A be such that a vb c is a factor of w (1) . Then σ ( a vb c ) ∈ σ ( a vb ) i A ∗ ⊆ A ∗ axσ ( v ) yb A ∗ isa factor of w and we have ( a, b ) ∈ E ( u ).For the inclusion ⊆ , consider ( a, b ) ∈ E ( u ). Using Lemma 10.3, the word ax (resp., yb ) is thesuffix (resp., prefix) of a word σ ( x ), x ∈ A + (resp., σ ( y ), y ∈ A + ) such that x vy ∈ Fac( w (1) ).Furthermore, still using Lemma 10.3, x is a strict suffix of σ ( a ), where x ∈ A ∗ a and y is a prefixof σ ( b ), where y ∈ b A ∗ . If y is a strict prefix of σ ( b ), then ( a , b ) is an extension of v suchthat σ ( a ) ∈ A ∗ ax and σ ( b ) ∈ yb A ∗ . Otherwise, if σ ( b ) = y , we have b = i since σ ( A ) ⊂ i A ∗ and ( a , b ) is an extension of v such that σ ( a ) ∈ A ∗ ax and σ ( b ) i = yi , which concludes theproof. (cid:3) Lemma 10.5 can be more easily understood using the tabular representation of the extensionsets. Indeed, for the first case ( σ ( A ) ⊂ i A ∗ ), the extensions of u = xσ ( v ) y can be obtained asfollows:1) replace any left extensions a by σ ( a ) and any right extension b by σ ( b ) i ;2) remove the suffix x from the left extensions whenever it is possible (otherwise, delete therow) and remove the prefix y from the right extensions whenever it is possible (otherwise,delete the column);3) keep only the last letter of the left extensions and the first letter of the right extensions; LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 35 4) permute and merge the rows and columns with the same label.The second case ( σ ( A ) ⊂ A ∗ i ) is similar.Let us make this more clear on an example and consider the extension set E ( v ) = { (1 , , (2 , , (2 , , (2 , , (3 , } . This extension set corresponds to the extension set of the empty word whenever the last appliedsubstitution is c (see Lemma 10.4). Using Lemma 10.5, the extension sets of 2 c ( v ) and2 c ( v )1 are obtained as follows (arrow labels indicate above step number): E ( v )1 2 31 × × × × × −→ E ( c ( v ))12 132 2212 × × × × × 2) and 3) −−−−−→ E (2 c ( v ))1 1 21 × × × × × −→ E (2 c ( v ))1 21 × × × × E ( v )1 2 31 × × × × × −→ E ( c ( v ))131 1321 12113 × × × × × 2) and 3) −−−−−→ E (2 c ( v )1)3 3 2 . × × × × −→ E (2 c ( v )1)2 31 × × × The proof of Theorem 10.1 will essentially consists in describing how ordinary bispecial wordsoccur. The next lemma allows to understand when bispecial words have ordinary bispecial extendedimages. Lemma 10.6. Let w be a C -adic word with directive sequence ( σ n ) n ∈ N ∈ C N . Let u ∈ Fac( w ) bea non-empty bispecial factor and v be its bispecial antecedent. We have the following.(1) If σ ∈ { c , c } , then E ( u ) = E ( v ) ;(2) if v = ε and σ ∈ { c , c } , then u is ordinary;(3) if σ ∈ { c , c , c } , if E ( v ) ⊆ ( A × { , } ) ∪ { ( a, } for some letter a ∈ A with E ( v ) ∩ { ( a, , ( a, } 6 = ∅ and if E ( v ) \ { ( a, } is the extension set of an ordinary bispecialword, then u is ordinary;(4) if σ ∈ { c , c , c } , if E ( v ) ⊆ ( { , } × A ) ∪ { (1 , a ) } for some letter a ∈ A with E ( v ) ∩ { (2 , a ) , (3 , a ) } 6 = ∅ and if E ( v ) \ { (1 , a ) } is the extension set of an ordinary bispecialword, then u is ordinary;(5) if v is ordinary, then u is ordinaryProof. Items 1 and 5 directly follow from Lemma 10.5. Item 2 can be checked by hand usingLemma 10.4 and Lemma 10.5. Let us prove Item 3, Item 4 being symmetric.We say that two extension sets E and E are equivalent whenever there exist two permutations p and p of A such that E = { ( p ( a ) , p ( b )) | ( a, b ) ∈ E } . If σ = c , then u ∈ { σ ( v ) , σ ( v )1 } byLemma 10.3. We make use of Lemma 10.5. If u = 2 σ ( v ), then the extension set of u is equivalentto the one obtained from E ( v ) by merging the columns with labels 1 and 2. If u = 2 σ ( v )1, thenthe extension set of u is equivalent to the one obtained from E ( v ) by deleting the column withlabel 3. In both cases, u is ordinary.The same reasoning applies when σ ∈ { c , c } : depending on the word x such that u ∈ A ∗ σ ( v ) x , either we delete the column with label 3, or we merge the columns with labels 1 and2. (cid:3) Factor complexity of C -adic words. ε × × × × × × × × × × × × × c · · c · c · Figure 7. Non-ordinary bispecial descendants of ε ∈ Fac( w ( n ) ) whenever σ n = c . ε × × × × × × × × × × × × × × × × × × × × × · c · · c · c · c · · c · c · Figure 8. Non-ordinary bispecial descendants of ε ∈ Fac( w ( n ) ) whenever σ n = c . Proof of Theorem 10.1. Note that the three conditions on ( c i n ) n ∈ N in Theorem 10.1 are mutuallyexclusive so it is enough to prove that they are sufficient.(i) This directly follows from 2.1 and from the Morse-Hedlund theorem that states that aninfinite word has bounded factor complexity if and only if it is eventually periodic [MH38].(ii) Let N such that ( c i n ) n ∈ N is in { c , c } N with c and c occurring infinitely many times in( c i n ) n ∈ N . Thus w ( N ) is a Sturmian sequence over the alphabet { , } . As σ [0 ,N ) is injective, w hasfactor complexity p w ( n ) = n + k for some k ≥ n [Cas98, Proposition 8].(iii) The sequence ( c i n ) n ∈ N being primitive, the word w is uniformly recurrent. Let us show that w is dendric. To show that the extension graphs of all bispecial factors are trees, we make useof Lemma 10.6. If u is a bispecial factor of w , it is a descendant of ε ∈ Fac( w ( n ) ) for some n . If σ n ∈ { c , c } , then from Lemma 10.4 and Lemma 10.6, all descendants of ε are ordinary. Theextension graph of u is thus a tree.For σ n ∈ { c , c , c , c } , we represent the extension sets of the descendants of ε in thegraphs represented in Figure 7 and Figure 8. Observe that the situation is symmetric for c and c and for c and c so we only represent the graphs for c and c . Furthermore, inthese graphs, we do not represent the extension sets of ordinary bispecial factors as the property ofbeing ordinary is preserved by taking bispecial extended images (Lemma 10.6). Given an extensionset of some bispecial word v , if u is a bispecial extended image of v such that u = xσ ( v ) y , welabel the edge from E ( v ) to E ( u ) by x · σ · y . Finally, for all v , we have E ( c ( v )1) = E ( v ) and E (3 c ( v )) = E ( v ), but for the sake of clarity, we do not draw the loops labeled by c · · c . We conclude by observing that the extension graphs of all descendants are trees. (cid:3) Proof of Theorem B. It directly follows from Theorem 5.1 and Theorem 10.1. (cid:3) Corollary 10.7. Every C -adic word has uniform word frequencies. Furthermore, if µ is a shift-invariant ergodic Borel probability measure on { , } N satisfying µ ([12121212]) > , µ -almost every C -adic word is uniformly recurrent and balanced, has factor complexity p w ( n ) = 2 n + 1 for every n and its vector of letter frequencies is totally irrational.Proof. Uniform factor frequencies follows from Proposition 7.1. Since µ is ergodic and satisfies µ ([12121212]) > 0, then µ -almost every directive sequence ( c i n ) n ∈ N is primitive. The result thenfollows from Theorem 5.1 and Theorem 10.1. (cid:3) Conjugacy with a semi-sorted version of Selmer algorithm Selmer algorithm [Sel61, Sch00] (also called the GMA algorithm [Bal92]) is an algorithm whichsubtracts the smallest entry to the largest. As recalled in Section 9, the numerical computation LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 37 of Lyapunov exponents [Lab15] indicates that exponents for the Selmer algorithm and F C havestatistically equal values (the difference is at most 10 − ). We confirm this observation by showinga relation between F C and the Selmer algorithm. The map F C is not conjugate to the Selmeralgorithm, however, in this section, we show that F C is conjugate to a semi-sorted version of theSelmer algorithm which keeps the largest entry at index 1. We also show that the application ofthis semi-sorted Selmer algorithm on its absorbing subset defines S -adic subshifts that actuallyare images of C -adic subshifts by a permutation of the alphabet.On Θ = { x = ( x , x , x ) ∈ R ≥ | max( x , x ) ≤ x } , the semi-sorted version of Selmer algorithmis defined by F S ( x , x , x ) = ( x , x − x , x ) if x ≤ x + x and x ≥ x , ( x , x , x − x ) if x ≤ x + x and x < x , ( x − x , x , x ) if x > x + x and x ≥ x , ( x − x , x , x ) if x > x + x and x < x . Like with F C , we consider the partitionΘ = { ( x , x , x ) ∈ Θ | x ≤ x + x and x ≥ x } , Θ = { ( x , x , x ) ∈ Θ | x ≤ x + x and x < x } , Θ = { ( x , x , x ) ∈ Θ | x > x + x and x ≥ x } , Θ = { ( x , x , x ) ∈ Θ | x > x + x and x < x } and the matrices S = , S = S = , S = . The map F S is then defined by F S ( x ) = S − i x whenever x ∈ Θ i . The Selmer algorithm beingweakly convergent [Sch00], there is a continuous map π : { , , , } N → Θ defined by \ n ∈ N S i S i · · · S i n R ≥ = R ≥ π (( i n ) n ∈ N ) . Note that if dim Q ( x ) = 3, then for all large enough n , F nS ( x ) belongs to Γ = Θ ∪ Θ . Therefore, if µ is a shift-invariant ergodic measure on { , , , } N such that π ∗ µ ( { x ∈ Θ | dim Q ( x ) = 3 } ) = 1,then µ ([3]) = µ ([4]) = 0. To compute the Lyapunov exponents associated with such a measure, wemay thus restrict the Selmer algorithm to the absorbing set Γ. The next result shows that F C and F S (restricted to Γ) are conjugate, confirming the equality of their respective Lyapunov exponents. Proposition 11.1. The maps F C : R ≥ → R ≥ and F S : Γ → Γ are conjugate, i.e., there exists alinear homeomorphism z : R ≥ → Γ such that z ◦ F C = F S ◦ z . Furthermore, for all x ∈ R , wehave dim Q ( x ) = dim Q ( z ( x )) .Proof. Let z : R ≥ → Γ be the homeomorphism defined by x Z x with Z = . For i = 1 , 2, we have x ∈ Λ i if and only if Z x ∈ Γ i and C i is conjugate to S i through the matrix Z : S Z = = ZC and S Z = = ZC . Thus we have z ◦ F C = F S ◦ z . The equality dim Q ( x ) = dim Q ( z ( x )) directly follows from thedefinition of z . (cid:3) For example, orbits of the two algorithms are related like in the following diagram:(3 , , 22) (15 , , 19) (3 , , 4) (15 , , , , 37) (37 , , 22) (22 , , 19) (19 , , F C F C F C F S F S F S z z z z Like for the matrices C and C , we associate with S and S the two substitutions s = 31 and s = ,S i being the incidence matrix of s i for i = 1 , 2. Given a sequence σ = ( σ n ) n ∈ N ∈ { s , s } N ofsubstitutions and a sequence ( a n ) n ∈ N ∈ A N of letters, the convergence of ( σ [0 ,n ) ( a n )) n ∈ N to aninfinite word is not as nicely described as with the substitutions c and c (see Lemma 2.1). Wecan however easily define the associated { s , s } -adic subshift X σ = { w ∈ A N | u ∈ Fac( w ) ⇒ ∃ a ∈ A , n ∈ N : u ∈ Fac( σ [0 ,n ( a )) } . This subshift is minimal as soon as the sequence σ is primitive. We will now show that such asubshift is actually the image of a C -adic subshifts under a permutation of the alphabet.If X is a subshift over some alphabet A and if σ : A ∗ → A ∗ is a substitution, we define the image of X under σ by σ · X = { S i ( σ ( w )) | w = ( w n ) n ∈ N ∈ X, ≤ i < | σ |} . It corresponds to the shift-orbit closure of σ ( X ).Let z l and z r be the substitutions: z l : 13 and z r : . Notice that Z is the incidence matrix of both z l and z r . The substitution z l is left proper while z r is right proper. Moreover they are conjugate through the equation z l ( w ) · · z r ( w )for every w ∈ A ∗ . In particular, for any word w ∈ A N , we have z l ( w ) = 1 z r ( w ) and z r ( w ) = Sz l ( w ) , where S is the shift map. For every minimal subshift X ⊂ A N , we thus have z l · X = z r · X. LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 39 The substitutions c i are not conjugate to s i but are related through substitutions z l and z r for i = 1 , s ◦ z l = z r ◦ c = (1 , , s ◦ z r = z l ◦ c = (1 , , . (31)This allows to prove the following result, where a minimal subshift is dendric if it is generated bya dendric word. Proposition 11.2. For all ( i n ) n ∈ N ∈ { , } N , the sequence c = ( c i n ) n ∈ N is primitive if and only ifso is the sequence s = ( s i n ) n ∈ N . Furthermore, in this case we have X s = ρ ( c · X c ) , where ρ isthe permutation (23) . In particular, X s is a minimal dendric subshift so it has factor complexity n + 1 for all n .Proof. Using Proposition 4.1, we first observe that c is not primitive if and only if there exists N such that for all n ≥ N , i n = i n +2 . Since s (1) = s (1) = 1, we deduce that if c is not primitive,then s is not primitive either. To prove that s is primitive when so is c , we may proceed like inProposition 4.1. We define graphs similar to those of Figure 4 and show that s is primitive.Now assume that c is primitive. By minimality of X c , we get z l · X c = z r · X c and usingEquations 30 and 31, we have z l · X c = X s . To end the proof, it suffices to observe that z l = ρ ◦ c . (cid:3) Corollary 11.3. For every totally irrational vector x ∈ Γ , the application of the semi-sortedSelmer algorithm yields a { s , s } -adic subshift which is minimal and dendric. Appendix Figure 9 is an alternative representation of Figure 5. References [AA20] S. Akiyama and P. Arnoux, editors. Substitution and Tiling Dynamics: Introduction to Self-inducingStructures . Springer International Publishing, 2020. doi:10.1007/978-3-030-57666-0 .[AD19] A. Avila and V. Delecroix. Some monoids of Pisot matrices. In New trends in one-dimensional dynamics ,volume 285 of Springer Proc. Math. Stat. , pages 21–30. Springer, Cham, 2019.[AL17] P. Arnoux and S. Labbé. On some symmetric multidimensional continued fraction algorithms. ErgodicTheory and Dynamical Systems , pages 1–26, 2017. doi:10.1017/etds.2016.112 .[And18] M. Andrieu. Autour du déséquilibre des mots C -adiques. Proceedings of Mons Theoretical ComputerScience Days , 2018.[AR91] P. Arnoux and G. Rauzy. Représentation géométrique de suites de complexité 2 n + 1. Bull. Soc. Math.France , 119(2):199–215, 1991.[Arn02] P. Arnoux. Sturmian sequences. In Substitutions in dynamics, arithmetics and combina-torics , volume 1794 of Lecture Notes in Math. , pages 143–198. Springer, Berlin, 2002. doi:10.1007/3-540-45714-3_6 .[AS13] P. Arnoux and Š. Starosta. The Rauzy gasket. In Further developments in fractalsand related fields , Trends Math., pages 1–23. Birkhäuser/Springer, New York, 2013. doi:10.1007/978-0-8176-8400-6_1 .[Bal92] P. R. Baldwin. A convergence exponent for multidimensional continued-fraction algorithms. J. Statist.Phys. , 66(5-6):1507–1526, 1992. doi:10.1007/BF01054431 .[BD14] V. Berthé and V. Delecroix. Beyond substitutive dynamical systems: S -adic expansions. In Numerationand substitution 2012 , RIMS Kôkyûroku Bessatsu, B46, pages 81–123. Res. Inst. Math. Sci. (RIMS),Kyoto, 2014.[BDFD + 15] V. Berthé, C. De Felice, F. Dolce, J. Leroy, D. Perrin, Reutenauer, and G. Rindone. Acyclic, connectedand tree sets. Monatsh. Math. , 176(4):521–550, 2015. doi:10.1007/s00605-014-0721-4 .[BL15] V. Berthé and S. Labbé. Factor complexity of S -adic words generated by the Arnoux-Rauzy-Poincaréalgorithm. Adv. in Appl. Math. , 63:90–130, 2015. doi:10.1016/j.aam.2014.11.001 . { z | T ( Me ) z = 0 } = (2 , , ⊥ { z | T ( Me ) z = 0 } = (2 , , ⊥ { z | T ( Me ) z = 0 } = (3 , , ⊥ M − T e = (0 , , − M − T e = ( − , , M − T e = (2 , − , − − M − T e − M − T e − M − T e + + ++ + −− − + − + ++ − + − + − + − −− − − (3 , − , − , − , , − , − , − , − , , − 1) ( − , , 1) ( − , − , , , − , , − 3) (2 , − , − ) (2 , − , Figure 9. This illustration is an alternative representation of Figure 5. Each plane or-thogonal to M e , M e or M e passing through the origin intersects the sphere in a greatcircle which is represented as a circle in the figure. The grey regions represent the vectors z ∈ ± ( T M ) − R > . In Lemma 3.8 it is proved that the supremum of k T Mz k D k z k D is is attainedon the boundary of the gray region. The points z in D \ ± ( T M ) − R > listed in Table 1 areshown. The maximum of k T Mz k D k z k D is attained at z = (2 − , 2) with a value of 4 / [Bre81] A. J. Brentjes. Multidimensional continued fraction algorithms . Mathematisch Centrum, Amsterdam,1981.[BST10] V. Berthé, A. Siegel, and J. Thuswaldner. Substitutions, Rauzy fractals and tilings. In Combinatorics,automata and number theory , volume 135 of Encyclopedia Math. Appl. , pages 248–323. CambridgeUniv. Press, Cambridge, 2010.[BST20] V. Berthé, W. Steiner, and J. M. Thuswaldner. Multidimensional continued fractions and symboliccodings of toral translations. May 2020. arXiv:2005.13038 .[BST21] V. Berthé, W. Steiner, and J. M. Thuswaldner. On the second Lyapunov exponent of some multidimen-sional continued fraction algorithms. Math. Comp. , 90(328):883–905, 2021. doi:10.1090/mcom/3592 .[Cas] J. Cassaigne. Un algorithme de fractions continues de complexité linéaire. DynA3S meeting, LIAFA,Paris, Oct. 12th, 2015.[Cas98] J. Cassaigne. Sequences with grouped factors. In Developments in Language Theory III, Publicationsof Aristotle University of Thessaloniki , pages 211–222, 1998.[CH73] E. M. Coven and G. A. Hedlund. Sequences with minimal block growth. Math. Systems Theory , 7:138–153, 1973. doi:10.1007/BF01762232 . LMOST EVERYWHERE BALANCED SEQUENCES OF COMPLEXITY 2 n + 1 41 [CLL17] J. Cassaigne, S. Labbé, and J. Leroy. A set of sequences of complexity 2 n + 1. In Combinatoricson words , volume 10432 of Lecture Notes in Comput. Sci. , pages 144–156. Springer, Cham, 2017. doi:10.1007/978-3-319-66396-8_14 .[CN10] J. Cassaigne and F. Nicolas. Factor complexity. In Combinatorics, Automata and Number Theory ,volume 135 of Encyclopedia Math. Appl. , pages 163–247. Cambridge Univ. Press, Cambridge, 2010.[DHS13] V. Delecroix, T. Hejda, and W. Steiner. Balancedness of Arnoux-Rauzy and Brun words. In Com-binatorics on words , volume 8079 of Lecture Notes in Comput. Sci. , pages 119–131. Springer, 2013. doi:10.1007/978-3-642-40579-2_14 .[DT89] J.-M. Dumont and A. Thomas. Systemes de numeration et fonctions fractales relatifs aux substitutions. Theoret. Comput. Sci. , 65(2):153–169, 1989. doi:10.1016/0304-3975(89)90041-8 .[FN20] N. P. Fogg and C. Noûs. Symbolic coding of linear complexity for generic translations of the torus,using continued fractions. May 2020. arXiv:2005.12229 .[FS21] C. Fougeron and A. Skripchenko. Simplicity of spectra for certain multidimensional continued fractionalgorithms. Monatshefte für Mathematik , February 2021. doi:10.1007/s00605-021-01517-9 .[Har02] D. M. Hardcastle. The three-dimensional Gauss algorithm is strongly convergent almost everywhere. Experiment. Math. , 11(1):131–141, 2002.[HK00] D. M. Hardcastle and K. Khanin. On almost everywhere strong convergence of multi-dimensional continued fraction algorithms. Ergodic Theory Dynam. Systems , 20(6):1711–1733, 2000. doi:10.1017/S014338570000095X .[HK02] D. M. Hardcastle and K. Khanin. The d -dimensional Gauss transformation: strong convergence andLyapunov exponents. Experiment. Math. , 11(1):119–129, 2002.[Lab15] S. Labbé. 3-dimensional Continued Fraction Algorithms Cheat Sheets. November 2015. arXiv:1511.08399 .[Lag93] J. C. Lagarias. The quality of the Diophantine approximations found by the Jacobi-Perron algorithmand related algorithms. Monatsh. Math. , 115(4):299–328, 1993. doi:10.1007/BF01667310 .[Ler14] J. Leroy. An S -adic characterization of minimal subshifts with first difference of complexity 1 ≤ p ( n +1) − p ( n ) ≤ Discrete Math. Theor. Comput. Sci. , 16(1):233–286, 2014.[Lot02] M. Lothaire. Algebraic combinatorics on words , volume 90 of Encyclopedia of Mathematics and itsApplications . Cambridge University Press, Cambridge, 2002. doi:10.1017/CBO9781107326019 .[MH38] M. Morse and G. A. Hedlund. Symbolic Dynamics. Amer. J. Math. , 60(4):815–866, 1938. doi:10.2307/2371264 .[MH40] M. Morse and G. A. Hedlund. Symbolic dynamics II. Sturmian trajectories. Amer. J. Math. , 62:1–42,1940. doi:10.2307/2371431 .[Nog95] A. Nogueira. The three-dimensional Poincaré continued fraction algorithm. Israel J. Math. , 90(1-3):373–401, 1995. doi:10.1007/BF02783221 .[Rau82] G. Rauzy. Nombres algébriques et substitutions. Bull. Soc. Math. France , 110(2):147–178, 1982. doi:10.24033/bsmf.1957 .[Sch80] W. M. Schmidt. Diophantine approximation , volume 785 of Lecture Notes in Mathematics . Springer,Berlin, 1980.[Sch00] F. Schweiger. Multidimensional Continued Fractions . Oxford Univ. Press, New York, 2000.[Sel61] E. S. Selmer. Continued fractions in several dimensions. Nordisk Nat. Tidskr. , 9:37–43, 95, 1961.[ST09] A. Siegel and J. M. Thuswaldner. Topological properties of Rauzy fractals. Mém. Soc. Math. Fr. (N.S.) ,(118):140, 2009.[Zor97] A. Zorich. Deviation for interval exchange transformations. Ergodic Theory Dynam. Systems ,17(6):1477–1499, 1997. doi:10.1017/S0143385797086215 .(J. Cassaigne) Aix-Marseille Université, CNRS, Centrale Marseille, Institut de mathématiquesde Marseille, I2M - UMR 7373, 13453 Marseille, France Email address : [email protected] (S. Labbé) Univ. Bordeaux, CNRS, Bordeaux INP, LaBRI, UMR 5800, F-33400, Talence, France Email address : [email protected] (J. Leroy) Département de mathématique, Université de Liège, 12 Allée de la découverte (B37),4000 Liège, Belgique Email address ::