On the Asymptotic Abelian Complexity of Morphic Words * F. Blanchet-Sadri 1 Nathan Fox 2 Narad Rampersad 3 July 14, 2014 Abstract The subword complexity of an infinite word counts the number of subwords of a given length, while the abelian complexity counts this number up to letter permutation. Although a lot of research has been done on the subword complexity of morphic words, i.e., words ob- tained as fixed points of iterated morphisms, little is known on their abelian complexity. In this paper, we undertake the classification of the asymptotic growths of the abelian complexities of fixed points of binary morphisms. Some general results we obtain stem from the con- cept of factorization of morphisms. We give an algorithm that yields all canonical factorizations of a given morphism, describe how to use it to check quickly whether a binary morphism is Sturmian, discuss how to fully factorize the Parry morphisms, and finally derive a complete clas- sification of the abelian complexities of fixed points of uniform binary morphisms. Keywords: Combinatorics on words; Abelian complexity; Morphic words; Factorization of morphisms; Sturmian morphisms; Parry mor- phisms; Uniform morphisms. * This material is based upon work supported by the National Science Foun- dation under Grant No. DMS–1060775. Part of this paper was presented at DLT 2013 [5]. A World Wide Web server interface has been established at www.uncg.edu/cmp/research/abeliancomplexity2 for automated use of the programs. 1 Department of Computer Science, University of North Carolina, P.O. Box 26170, Greensboro, NC 27402–6170, USA, [email protected]2 Department of Mathematics, Rutgers University, Hill Center for the Mathematical Sci- ences, 110 Frelinghuysen Rd., Piscataway, NJ 08854–8019, USA, [email protected]3 Department of Mathematics and Statistics, University of Winnipeg, 515 Portage Ave., Winnipeg MB , R3B 2E9, CANADA, [email protected]1
46
Embed
On the asymptotic abelian complexity of morphic words
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
On the Asymptotic Abelian Complexity of
Morphic Words∗
F. Blanchet-Sadri1 Nathan Fox2 Narad Rampersad3
July 14, 2014
Abstract
The subword complexity of an infinite word counts the number ofsubwords of a given length, while the abelian complexity counts thisnumber up to letter permutation. Although a lot of research has beendone on the subword complexity of morphic words, i.e., words ob-tained as fixed points of iterated morphisms, little is known on theirabelian complexity. In this paper, we undertake the classification ofthe asymptotic growths of the abelian complexities of fixed points ofbinary morphisms. Some general results we obtain stem from the con-cept of factorization of morphisms. We give an algorithm that yields allcanonical factorizations of a given morphism, describe how to use it tocheck quickly whether a binary morphism is Sturmian, discuss how tofully factorize the Parry morphisms, and finally derive a complete clas-sification of the abelian complexities of fixed points of uniform binarymorphisms.
Keywords: Combinatorics on words; Abelian complexity; Morphicwords; Factorization of morphisms; Sturmian morphisms; Parry mor-phisms; Uniform morphisms.
∗This material is based upon work supported by the National Science Foun-dation under Grant No. DMS–1060775. Part of this paper was presented atDLT 2013 [5]. A World Wide Web server interface has been established atwww.uncg.edu/cmp/research/abeliancomplexity2 for automated use of the programs.
1Department of Computer Science, University of North Carolina, P.O. Box 26170,Greensboro, NC 27402–6170, USA, [email protected]
2Department of Mathematics, Rutgers University, Hill Center for the Mathematical Sci-ences, 110 Frelinghuysen Rd., Piscataway, NJ 08854–8019, USA, [email protected]
3Department of Mathematics and Statistics, University of Winnipeg, 515 Portage Ave.,Winnipeg MB , R3B 2E9, CANADA, [email protected]
1
1 Introduction
The subword complexity of an infinite word w, denoted ρw, is the functionmapping each positive integer n to the number of distinct subwords of wof length n. On the other hand, the abelian complexity of w, denoted ρabw ,is the function mapping each positive integer n to the number of distinctParikh vectors of subwords of w of length n. Here, we assume the standardalphabet Ak = 0, . . . , k − 1, and the Parikh vector of a finite word overAk is the vector whose ith entry is the number of occurrences of letter i− 1in the word.
An infinite word is a morphic word if it is the fixed point of somemorphism at some letter. For compactness of notation, we frequently de-note a morphism ϕ over Ak, ϕ : A∗k → A∗k, as an ordered k-tuple ϕ =(w0, . . . , wk−1), where ϕ (a) = wa for each a ∈ Ak. The fixed point of ϕ ata, denoted ϕω (a), is the limit as n → ∞ of ϕn (a). The fixed point existsprecisely when the limit exists.
A lot of research has been done on the subword complexity of morphicwords, e.g., Ehrenfeucht and Rozenberg [11] showed that the fixed points ofuniform morphisms, i.e., morphisms ϕ over Ak satisfying |ϕ(a)| = |ϕ(b)| forall a, b ∈ Ak, have at most linear subword complexity, Berstel and Seebold[4] gave a characterization of Sturmian morphisms, i.e., morphisms ϕ overthe binary alphabet A2 = 0, 1 such that ϕω (0) exists and is Sturmian, inother words, ρϕω(0) (n) = n+1 for all n, and Frid [13] obtained a formula forthe subword complexity of the fixed points of binary uniform morphisms.On the other hand, abelian complexity is a relatively new research topic.Balkova, Brinda, and Turek [3] studied the abelian complexity of infinitewords associated with quadratic Parry numbers, Currie and Rampersad [8]studied recurrent words with constant abelian complexity, and Richomme,Saari, and Zamboni [16] investigated abelian complexity of minimal sub-shifts.
In this paper, we are interested in classifying the asymptotic growthsof the abelian complexities of words obtained as fixed points of iteratedmorphisms over A2 at 0. This classification has already been done for thesubword complexity of morphisms over Ak [9, 10, 11, 12, 14] (see also [6, Sec-tion 9.2]). Pansiot’s classification of the asymptotic growths of the subwordcomplexity of morphic words not only depends on the type of morphismsbut also on the distribution of so-called bounded letters [14]. We assumewithout loss of generality that the first letter in the image of 0 is 0 and weassume that all of our morphisms are nonerasing. Also for conciseness, wefrequently use the term “abelian complexity of a morphism” (when referring
to its fixed point at 0).As mentioned above, we are mainly concerned with the asymptotic be-
haviors of the abelian complexities rather than their specific values. Somegeneral results we obtain stem from the concept of factorization of mor-phisms. We mainly examine the monoid of binary morphisms under com-position, but we also consider factorization in a more general setting.
The binary morphism types whose asymptotic abelian complexities weclassify are the following: morphisms with ultimately periodic fixed points(Proposition 1(10)), Sturmian morphisms (Proposition 2(2)), morphismswith equal ratios of zeroes to ones in both images (Theorem 4), Parry mor-phisms, i.e., morphisms of the type (0p1, 0q) with p ≥ q ≥ 1 or of the type(0p1, 0q1) with p > q ≥ 1 studied in [3] and cyclic shifts of their factor-izations (Proposition 2(4) along with Corollaries 3 and 4), most morphismswhere the image of 1 contains only ones (Theorem 5), and most uniformmorphisms and cyclic shifts of their factorizations (Theorem 7).
All of the asymptotic abelian complexity classes we obtain, where f (n) =1 if log2 n ∈ Z, and f (n) = log n otherwise, are the following (listed inincreasing order of growth): Θ (1), e.g., (01, 10), Θ (f (n)), e.g., (01, 00),Θ (log n), e.g., (001, 110), Θ
(nloga b
)for a > b > 1, e.g., (0001, 0111),
Θ(
nlogn
), e.g., (001, 11), and Θ (n), e.g., (0001, 11).
The contents of our paper are as follows. In Section 2, we discuss theconnections between balance and abelian complexity, as well as the work ofAdamczewski on the balance function. In Section 3, we discuss some pre-liminaries and basic results. In Section 4, we study morphism factorizations.We give an algorithm that yields all canonical factorizations of a morphismϕ over Ak into two morphisms each over an alphabet of at most k letters andwe describe how to use it for checking quickly whether a binary morphismis Sturmian. In Section 5, we obtain our main results. Among other things,we derive a complete classification of the abelian complexities of fixed pointsof binary morphisms where the image of 1 is all ones, we show how to fullyfactorize the Parry morphisms, and we also derive a complete classificationof the abelian complexities of fixed points of uniform binary morphisms.Finally in Section 6, we conclude with suggestions for future work.
2 Connections with the balance function
Given C ≥ 0, a (finite or infinite) word w over Ak is called C-balanced iffor all letters a in w and for all integers 0 < n ≤ |w| (or just 0 < n if wis infinite), the difference between the maximum and the minimum possible
3
counts of letter a in a length-n subword of w is less than or equal to C.There is a strong link between balance properties of an infinite word w
and its abelian complexity. Let Ln(w) denote the set of subwords of lengthn of w. If a ∈ Ak, let |u|a denote the number of occurrences of a in the wordu. We define the balance function of w by
Bw(n) = maxa∈Ak
maxu,u′∈Ln(w)
||u|a − |u′|a|.
Thus w is C-balanced if and only if Bw(n) ≤ C for all n.Furthermore, we have ρabw (n) ≤ (Bw(n) + 1)k−1. To see this, let u be a
factor of length n of w. Observe that the Parikh vector of u has k compo-nents; for each of the first k − 1 components, the maximum and minimumpossible value for this component can differ by at most Bw(n), so there arenot more than Bw(n) + 1 choices for each of these components; finally, thelast component of the Parikh vector is uniquely determined by n and thevalues of the other components. In the binary case k = 2, we have equality:i.e., ρabw (n) = Bw(n) + 1, since the value of each component of the Parikhvectors of subwords of length n must run through all possible values be-tween the minimum and maximum. Thus in the binary case (which is thecase considered in this paper), the study of the abelian complexity functionis equivalent to the study of the balance function.
The balance properties of fixed points of primitive morphisms was exten-sively studied by Adamczewski [1]. A primitive morphism (see, for instance,Allouche and Shallit [2]) is a morphism ϕ for which there exists an integern ≥ 1 such that given any letters a and b in the alphabet, a occurs in ϕn (b).
To be able to precisely state the results of Adamczewski, we need someadditional definitions. The incidence matrix Mϕ of a morphism ϕ is thematrix whose columns are the Parikh vectors of the words ϕ(a) for each a inthe alphabet. Let θ1, θ2, . . . be the eigenvalues of Mϕ and let α1+1, α2+1, . . .be their algebraic multiplicities. Suppose further that the eigenvalues areordered so that θ1 (which is a real number) is the largest, and for 2 ≤ i < k,either |θi| > |θk| or |θi| = |θk| and αi ≥ αk.
We also need some notation to describe the asymptotic growth of Bw(n).Let f and g be real, positive functions. We write f(x) = Ω′(g(x)) iflim supx→∞ f(x)/g(x) > 0 1. We write f(x) = (O ∩ Ω′)(g(x)) if f(x) =
1In [1] this property is denoted by the symbol Ω. This is the so-called Hardy–Littlewooddefinition of “big-Omega”. In this paper, we prefer to use the symbol Ω to denote Knuth’sdefinition of “big-Omega”, namely f(x) = Ω(g(x)) if there exist M and x0 such thatf(x) ≥ Mg(x) for all x ≥ x0. In this way we retain the traditional definition of big-Theta:namely, f(x) = Θ(g(x)) if f(x) = O(g(x)) and f(x) = Ω(g(x)).
4
O(g(x)) and f(x) = Ω′(g(x)). These definitions apply equally well when thedomains of f and g are restricted to the non-negative integers.
Theorem 1. [1, Theorem 13] Let w be a fixed point of a primitive morphismϕ. Then the following hold:
1. If |θ2| < 1, then Bw(n) is bounded;
2. If |θ2| > 1, then Bw(n) = (O ∩ Ω′)((log n)α2nlogθ1 |θ2|);
3. If |θ2| = 1 and θ2 is not a root of unity, then Bw(n) = (O∩Ω′)((log n)α2+1);
4. If |θ2| = 1 and θ2 is a root of unity, then either
• Bw(n) = (O ∩ Ω′)((log n)α2+1), or
• Bw(n) = (O ∩ Ω′)((log n)α2),
accordingly as a certain constant Aϕ,w is or is not equal to zero.
When ϕ is a primitive binary morphism, the above result holds withρabw (n) in place of Bw(n). In this paper, we give some results along theselines for uniform binary morphisms (Theorem 7) and a large family of non-primitive binary morphisms (Theorem 5). However, in most cases, ourasymptotic growths are of the big-Theta type: namely, ρabw (n) = Θ(f(n))for some function f . Note that this is stronger than saying ρabw (n) =(O ∩Ω′)(f(n)): the lower bound implied by the Θ notation is valid for all nsufficiently large, whereas the lower bound implied by the O ∩ Ω′ notationis only valid for infinitely many values of n. Therefore, even for primitivemorphisms, in most cases our lower bounds are stronger than what can beconcluded from Theorem 1.
3 Preliminary Definitions and Results
Given an infinite word w over A2, zM (n) (resp., zm (n)) denotes the max-imum (resp., minimum) number of zeroes in a length-n subword of w. Forease of notation, z (v) denotes the number of zeroes in a binary word v (asopposed to the standard |v|0). The number of ones in v is then |v| − z (v).
Here are some facts about abelian complexity and zero counts.
Proposition 1. If w is an infinite word over Ak, then the following hold:
1. ρabw (n) = Θ (1) if and only if w is C-balanced for some C [16, Lemma 2.2];
5
2. If w is Sturmian, then ρabw (n) = 2 for all n [7];
3. ρabw (n) = O(nk−1
)[16, Theorem 2.4];
4. ρabw (n) ≤ ρw (n);
5. If k = 2, then ρabw (n) = zM (n)− zm (n) + 1;
6. If k = 2, then zM (m+ n) ≤ zM (m) + zM (n);
7. If k = 2, then zm (m+ n) ≥ zm (m) + zm (n);
8. If k = 2, then zM (n+ 1)− zM (n) ∈ 0, 1 and zm (n+ 1)− zm (n) ∈0, 1;
9. If k = 2, then∣∣ρabw (n+ 1)− ρabw (n)
∣∣ ≤ 1 for all positive integers n;
10. If w is ultimately periodic, then ρabw (n) = Θ (1).
Proof. For 4, every subword of w of length n yields a Parikh vector of lengthn in w, and every Parikh vector in w is obtained from at least one subword.Therefore, the map from subwords to their Parikh vectors is a surjection, soρw (n) ≥ ρabw (n).
For 5, let u` = w [i..i+ n) be a subword of w of length n containing ex-actly ` zeroes. Let u′` = w [i− 1..i+ n− 1), and let u′′` = w [i+ 1..i+ n+ 1).Since u′` and u′′` each share n − 1 positions with u`, the number of zeroesin each of them can differ from ` by at most 1. Hence, given positions imand iM such that w [im..im + n) contains zm (n) zeroes and w [iM ..iM + n)contains zM (n) zeroes, the subwords of length n beginning at positions be-tween im and iM contain all numbers of zeroes between zm (n) and zM (n),as required.
For 6, let v be a subword of w of length m+n with the maximal numberof zeroes. We can split v into a subword vm of length m and a subwordvn of length n. We have z (vm) ≤ zM (m) and z (vn) ≤ zM (n), so z (v) =z (vm) + z (vn) ≤ zM (m) + zM (n), as required. For 7, the proof is similarto that of item 6.
For 8, let v be a subword of w of length n+1 containing zM (n+ 1) zeroes.The subword of length n beginning at the same position must contain atleast zM (n+ 1) − 1 zeroes, so zM (n) ≥ zM (n+ 1) − 1, as required. Theproof for zm (n) is similar.
For 9, this is a simple consequence of item 4 and considerations of addingan additional letter to the end of a length n subword.
For 10, [2, Theorem 10.2.6] says that ρw (n) is bounded if w is ultimatelyperiodic. Combining this with item 4 yields the desired result.
Here are some morphisms that are classified based on prior results. For3, any such word is ultimately periodic.
Proposition 2. The fixed points at 0 of the following morphisms over A2
have Θ (1) abelian complexity:
1. The Thue-Morse morphism (01, 10) [16, Theorem 3.1];
2. Any Sturmian morphism (this includes (01, 0)) [16, Theorem 1.2];
3. Any morphism whose fixed point contains finitely many zeroes or ones(this includes (01, 11));
4. Any morphism of the form (0p1, 0q) with p ≥ q ≥ 1 or of the form(0p1, 0q1) with p > q ≥ 1 [3, Corollary 3.1].
Let f (x) be a real function, and define
fm (x) := infa≥x
f (a) , fM (x) := supa≤x
f (a) .
Now, let g (x) be also a real function. We write that f (x) = Ω (g (x))if fm (x) = Ω (gm (x)) and fM (x) = Ω (gM (x)), that f (x) = O (g (x)) iffm (x) = O (gm (x)) and fM (x) = O (gM (x)), and that f (x) = Θ (g (x))if fm (x) = Θ (gm (x)) and fM (x) = Θ (gM (x)). These definitions workequally well on subsets of the reals, such as the integers (which is where weapply them mostly). Here are some basic results about these definitions.
Proposition 3. The following hold:
1. fm (x) and fM (x) are monotone increasing;
2. fm (x) ≤ f (x) ≤ fM (x) for all x;
3. If g (x) is monotone increasing and g (x) ≤ f (x) for all x, then g (x) ≤fm (x) for all x;
4. If g (x) is monotone increasing and g (x) ≥ f (x) for all x, then g (x) ≥fM (x) for all x;
5. fm (x) = fM (x) = f (x) if and only if f is monotone increasing;
6. If f (x) = Ω (g (x)), then f (x) = Ω (g (x));
7. If f (x) = O (g (x)), then f (x) = O (g (x));
7
8. If f (x) = Θ (g (x)), then f (x) = Θ (g (x)).
Proof. For 1, let x1 < x2. Assume for a contradiction that fm (x2) <fm (x1). This means that inf
a≥x2f (a) < inf
a≥x1f (a). This is impossible. Now,
assume for a contradiction that fM (x2) < fM (x1). This means that supa≤x2
f (a) <
supa≤x1
f (a). This is also impossible.
For 2, first, assume for a contradiction that fm (x) > f (x). Then,infa≥x
f (a) > f (x). This is impossible. Now, assume for a contradiction
that fM (x) < f (x). Then, supa≤x
f (a) < f (x). This is also impossible.
For 3, let g (x) be monotone increasing such that g (x) ≤ f (x) for allx. Assume for a contradiction that g (x0) = fm (x0) + c for some x0 andsome c > 0. This means that g (x) ≥ inf
a≥xf (a) + c for all x ≥ x0, because
g (x) is monotone increasing. For some x1 > x, f (x1) − fm (x1) < c bydefinition of fm. Then, we have g (x1) > f (x1), a contradiction. Therefore,g (x) ≤ fm (x) for all x, as required.
For 4, let g (x) be monotone increasing such that g (x) ≥ f (x) for allx. Assume for a contradiction that g (x0) = fM (x0) − c for some x0 andsome c > 0. This means that g (x) ≤ sup
a≤x0f (a) − c for all x ≤ x0, because
g (x) is monotone increasing. For some x1 < x, fM (x1) − f (x1) < c bydefinition of fM . Then, we have g (x1) < f (x1), a contradiction. Therefore,g (x) ≥ fM (x) for all x, as required.
For 5, the forward direction is a direct consequence of item 1. For thereverse direction, assume that f (x) is monotone increasing. Then, fm (x) =infa≥x
f (a) = f (x) and fM (x) = supa≤x
f (a) = f (x), as required.
For 6, if f (x) = Ω (g (x)), there exists a constant c such that f (x) ≥cg (x) for sufficiently large x. We have for sufficiently large x,
fm (x) = infa≥x
f (a) ≥ infa≥x
cg (a) = c infa≥x
g (a) = cgm (x) ,
so fm (x) = Ω (gm (x)). Also, we have for sufficiently large x,
fM (x) = supa≤x
f (a) ≥ supa≤x
cg (a) = c supa≤x
g (a) = cgM (x) ,
so fM (x) = Ω (gM (x)), as required.For 7, the proof is similar to item 6.For 8, this follows from items 6 and 7.
8
Here is a lemma about big O, which we use to prove a lemma about bigO.
Lemma 1. Let f (x) be a monotone increasing function that is O (xm) forsome m. Then, for all k > 0, f (kx) = O (f (x)).
Proof. Write f (x) = g (x)h (x) for g (x) = xn for some n (n may be 0)and h (x) = o (x) monotone increasing. Clearly, g (kx) = O (g (x)), as(kx)n = knxn. Now, assume for a contradiction that h (kx) 6= O (h (x))for some k. Then, for all sufficiently large x, there exists c such thath (kx) > ch (x). Choose an x0 sufficiently large. Then, h (kx0), h
(k2x0
),
etc., are greater than ch (x0), c2h (x0), etc. The points (h (kx0) , ch (x0)),(h(k2x0
), c2h (x0)
), etc. form a line, so h (x) is Ω (x), a contradiction.
Therefore, h (kx) = O (h (x)), as required.
Lemma 2. Let f (x) = O (xm) for some m. Then, for all k > 0, f (kx) =O (f (x)).
Proof. Let g (x) = f (kx). We note that gm (x) = fm (kx) and gM (x) =fM (kx). So, by Lemma 1, gm (x) = O (fm (x)) and gM (x) = O (fM (x)), asrequired.
4 Morphism Factorizations
Some more general results we obtain stem from the concept of factorizationof morphisms. We mainly examine the monoid of binary morphisms undercomposition, but we also consider factorization in a more general setting.
Let ϕ be a morphism over Ak. If ϕ cannot be written as φ ζ for twomorphisms φ : A∗k′ → A∗k, ζ : A∗k → A∗k′ where neither is a permutationof Ak′ , then ϕ is irreducible over Ak′ . Otherwise, ϕ is reducible. (We usethe convention that a permutation of the alphabet is not irreducible.) Ifϕ = φ ζ for some morphisms φ : A∗k′ → A∗k, ζ : A∗k → A∗k′ , we say that ϕfactors as φ ζ over Ak′ .
Here are two propositions that together lead to a factorization algorithm.
Proposition 4. Let ϕ = (w0, w1, . . . , wk−1) be a morphism over Ak. If thereexist v0, v1, . . . , vk′−1 ∈ A+
k such that w0, w1, . . . , wk ∈ v0, v1, . . . , vk′−1∗,then there exists a morphism ζ : A∗k → A∗k′ such that ϕ = φ ζ, whereφ = (v0, v1, . . . , vk′−1). Conversely every factorization ϕ = φ ζ, where φ :A∗k′ → A∗k and ζ : A∗k → A∗k′, corresponds to vi = φ (i) for i = 0, 1, . . . , k′−1,where w0, w1, . . . , wk−1 ∈ v0, v1, . . . , vk′−1∗.
9
Proposition 5. Let σ be a function that permutes elements of a k-tuple andlet ψσ be the morphism corresponding to the k-tuple obtained by applying σto (0, 1, . . . , k − 1). Let ϕ be a morphism over Ak that factors as ϕ = φ ζfor some morphisms φ and ζ. Then, ϕ = σ (φ) ψσ (ζ).
Proof. Let a ∈ Ak. We have (σ (φ) ψσ (ζ)) (a) = (σ (φ) ψσ) (ζ (a)). Weshow that σ (φ) ψσ = φ, thereby completing the proof.
All of the images of ψσ are one letter long. Let ψσ (b) = b′ for some b, b′ ∈Ak. This means that σ (b) = b′, based on our construction of ψσ. Hence,σ (φ) (b′) = φ (b), so ((σ (φ)) ψσ) (b) = σ (φ) (b′) = φ (b), as required.
Proposition 5 allows us to define the notion of a canonical factorization.Let ϕ be a morphism over Ak that factors as ϕ = φ ζ for some morphismsφ and ζ. Let v = ζ (0) ζ (1) · · · ζ (k − 1). We say that the factorizationϕ = φ ζ is canonical if v [0] = 0 and the first occurrence of each letter a,a 6= 0, in v is after the first occurrence of letter a − 1 in v. It is clear fromProposition 5 that given a factorization φ ζ of ϕ we can put it in canonicalform by applying some permutation σ to the letters in the images in ζ andto the order of the images in φ. Hence, every factorization of ϕ correspondsto one in canonical form.
Before we give our factorization algorithm, here is an important note:the monoid of binary morphisms does not permit unique factorization intoirreducible morphisms, even if the factorizations are canonical. Indeed, let-ting ϕ = (00, 11), we have ϕ = (0, 11) (00, 1) = (00, 1) (0, 11). These aredistinct canonical factorizations of ϕ into irreducibles.
Require: ϕ, a morphism over Ak, and k′ ≥ 1, an integer//[] denotes the empty listfacts←MORPHISM FACTOR SUBROUTINE (ϕ, k′, [])canonfacts← ∅for (φ, ζ) in facts do
Let σ be the permutation that puts ϕ = φ ζ into canonical formcanonfacts← canonfacts ∪ (σ (φ) , ψσ (ζ))
return canonfacts
Algorithm 1 yields all canonical factorizations over Ak′ of a given mor-phism ϕ into two morphisms. The basis of this algorithm is the subroutineit calls, Algorithm 2, which creates a factorization by recursively findingv0, v1, . . . , vk′−1, as specified in Proposition 4, and then backtracking to find
Require: ϕ′, a morphism over alphabet 0, . . . , k − 1 (or ∅ if k = 0), k′′ ≥0, an integer, and already, a list of words indexed from 0 (already [i] = vifrom Proposition 4)Ak ← 0, . . . , k − 1 (or Ak ← ∅ if k = 0)if Ak = ∅ then
Let φ be the morphism mapping b to already [b]return (φ, ϕ′)
Choose a ∈ Ak such that |ϕ′ (a)| is minimalfacts← ∅if k′′ > 0 thenfor i← 1 to |ϕ′ (a)| dochunk ← ϕ′ (a) [0..i)Let ϕ′′ be the morphism such that ϕ′′ (b) = ϕ′ (b) [i.. |ϕ′ (b)|) if b = a,and ϕ′′ (b) = ϕ′ (b) otherwiseIf ϕ′′ (a) = ε, change ϕ′′ such that ϕ′′ (a) is undefinedLet already′ be a copy of already with chunk appended onto the endfact←MORPHISM FACTOR SUBROUTINE (ϕ′′, k′′ − 1, already′)len← |already|for (φ, ζ) in fact doif ζ (a) is defined thenζ (a)← lenζ (a)
elseζ (a)← len
Add all pairs in fact to factsfor i← 0 to |already| − 1 dochunk ← already [i]len← |chunk|if len ≤ |ϕ′ (a)| and ϕ′ (a) [0..len) = chunk then
Let ϕ′′ be the morphism such that ϕ′′ (b) = ϕ′ (b) [len.. |ϕ′ (b)|) ifb = a, and ϕ′′ (b) = ϕ′ (b) otherwiseIf ϕ′′ (a) = ε, change ϕ′′ such that ϕ′′ (a) is undefinedfact←MORPHISM FACTOR SUBROUTINE (ϕ′′, k′′, already)for (φ, ζ) in fact doif ζ (a) is defined thenζ (a)← iζ (a)
elseζ (a)← i
Add all pairs in fact to factsreturn facts
11
more factorizations. It always attempts to match or create a vi at thebeginning of the shortest image in the morphism, as that has the fewestpossibilities to consider. Algorithm 1 works as follows:
• Call Algorithm 2 with ϕ, k′, and an empty list. Given morphismϕ′, integer k′′, and a list of words v0, . . . , vm, Algorithm 2 does thefollowing:
1. If ϕ′ has no letters, return (v0, . . . , vm) ϕ′;2. If k′′ > 0, try each prefix of a minimal-length image in ϕ′ as vm+1.
Call this same subroutine each time with k′′ − 1, pruning thatprefix off that image. Consolidate the results of the recursive calland add to the set of factorization pairs with appropriate rightfactor;
3. Try matching each vi to a prefix of a minimal-length image in ϕ′.If there is a match, call this same subroutine with k′′, pruning thatprefix off that image. Consolidate the results of the recursive calland add to the set of factorization pairs with appropriate rightfactor;
4. Return the set of factorization pairs.
• Put the resulting factorizations into canonical form.
Theorem 2. Algorithm 1 can be applied recursively (and optionally alongwith a lookup table to avoid recomputing things) to obtain complete (canon-ical) factorizations of a given morphism into irreducible morphisms.
Proof. Algorithm 1’s correctness follows from Propositions 4 and 5. Toobtain all factorizations (not just canonical ones), run Algorithm 1 andthen apply all possible permutations to the resulting factorizations.
Given as input ϕ = (01, 00) and k′ = 2, Algorithm 1 outputs the canon-ical factorizations (0, 1) (01, 00), (01, 0) (0, 11), and (01, 00) (0, 1):
We conclude this section with a discussion on checking whether a binarymorphism ϕ is Sturmian. Berstel and Seebold in [4] prove that ϕ is Sturmianif and only if ϕ (10010010100101) is 1-balanced and primitive (not a powerof a shorter word). This leads to an algorithm for deciding whether a givenmorphism is Sturmian. While the resulting algorithm is typically fast togive a negative answer, a positive answer requires computing (essentially)|ϕ (10010010100101)| balance values and checking for primitivity. (Also, acheck that our morphism’s fixed point does not contain finitely many zeroesis needed.)
Richomme in [15] gives a note that leads to an alternative approach. Thenote says that a binary morphism is Sturmian if and only if it can be writtenas compositions of the morphisms (1, 0), (0, 01), (10, 1), (0, 10), and (01, 1).No canonical factorization of a Sturmian morphism ever contains (1, 0) or(10, 1), but these two can be combined to form (01, 0), which we must addto our list. Hence, we have the criterion that a binary morphism is Sturmianif and only if it has a canonical factorization that is a composite of (0, 01),(01, 0), (0, 10), and (01, 1). (We also disallow composites that are powers ofthe morphisms with ultimately periodic or finite fixed points so we can keepour fixed points nonultimately periodic.) The task of factoring a Sturmianmorphism is well suited to repeated application of Algorithm 1. In fact, wecan speed up the algorithm specifically in this case by pre-seeding v0 and v1
with each of the possible factors for a Sturmian morphism (as in, directlycalling
MORPHISM FACTOR SUBROUTINE (ϕ, 2, [v0, v1]) ,
where (v0, v1) is equal to each of the four possible morphisms). This algo-rithm is fast in both cases where the given morphism is or is not Sturmian.
5 Main Results
We have the following theorem which we prove using the following lemma,commonly known as Fekete’s Lemma.
Lemma 3. Let ann≥1 be a sequence such that am+n ≥ am + an (resp.,am+n ≤ am+an). Then, limn→∞
ann exists and equals sup an
n (resp., inf ann ).
Theorem 3. Let w be an infinite binary word and ψ be a binary morphism.Then, ρabψ(w) (n) = O
(ρabw (n)
).
13
Proof. Note that Proposition 1(7) says that zm (n) satisfies Lemma 3’s con-
ditions. Hence, limn→∞zm(n)n exists. Let us denote this limit by a.
Let f (n) = ρabw M (n) + 1. So, for any subword v, we have zm (|v|) ≤z (v) ≤ zm (|v|) + f (|v|). Without loss of generality, assume that f (n) issublinear (as the abelian complexity of ψ (w) can be at most linear, so iff (n) is linear, there is nothing to prove). Also, we assume without loss ofgenerality that |ψ (1)| ≥ |ψ (0)|, and we denote |ψ (1)| − |ψ (0)| by d. Theproof for the remaining case is similar.
Let v be a subword of w. We establish bounds on |v| in terms of |ψ (v)|.We have
|ψ (v)| = |ψ (0)| z (v) + |ψ (1)| (|v| − z (v))
⇒ |ψ (v)| = |ψ (1)| |v| − dz (v)
⇒ |ψ (1)| |v| − d (zm (|v|) + f (|v|)) ≤ |ψ (v)| ≤ |ψ (1)| |v| − dzm (|v|)⇒ 0 ≤ |ψ (1)| |v| − |ψ (v)| − dzm (|v|) ≤ d f (|v|)⇒ |ψ (1)| |v| − dzm (|v|)− d f (|v|) ≤ |ψ (v)| .
Now, given ε1 > 0, we can find N1 such that for all n > N1, zm (n) ≤(a+ ε1)n. Given ε2 > 0, we can find N2 such that for all n > N2, f (n) <aε2n. Hence, for sufficiently long v we have
which implies that |v| ≤ |ψ(v)||ψ(1)|−(a+ε1)d−adε2 . Also, given ε3 > 0, we can find
N3 such that for all n > N3, zm (n) ≥ (a− ε3)n. So, for sufficiently long v,
|ψ (v)| ≤ |ψ (1)| |v| − dzm (|v|) ,
which implies |v| ≥ |ψ(v)||ψ(1)|−(a−ε3)d . Combining this with the previous result
says that, given ε1, ε2, ε3 > 0, for sufficiently long v,
|ψ (v)||ψ (1)| − (a− ε3) d
≤ |v| ≤ |ψ (v)||ψ (1)| − (a+ ε1) d− adε2
. (1)
(Note that the denominators must be positive. We have d ≤ |ψ (1)| − 1 anda ≤ 1, so |ψ (1)|−ad ≥ 1. Since we can make ε1 and ε2 as small as we want,the right denominator can be made arbitrarily close to something that is atleast 1, which is positive.) An immediate consequence (that could have beenarrived at through simpler means) is that if d = 0 (that is, if ψ is uniform),
|v| = |ψ(v)||ψ(1)| .
14
Let u be a subword of ψ (w). Let Vu denote the set of subwords of wsuch that ψ (v) is a subword of u for all v ∈ Vu and there does not exist asubword v′ of w such that ψ (v) is a subword of ψ (v′) and ψ (v′) is a subwordof u. It must be that |ψ (v)| > |u| − 2 |ψ (1)| for all v ∈ Vu, as, in the worstcase, ψ (v) is sandwiched between most of ψ (1) on both sides. So, we have
z (u) ≤ maxv∈Vu
z (ψ (v)) + 2 |ψ (1)| , z (u) ≥ minv∈Vu
z (ψ (v))− 2 |ψ (1)| .
Let b denote z (ψ (0)), and let c denote z (ψ (1)). Without loss of gener-ality, assume that b ≥ c (the remaining case is similar). This implies thatthe maximal (resp., minimal) value of z (ψ (v)) corresponds to a maximal(resp., minimal) value of z (v). So, we have
z (u) ≤ maxv∈Vu
((b− c) z (v) + c |v|) + 2 |ψ (1)| ,
z (u) ≥ minv∈Vu
((b− c) z (v) + c |v|)− 2 |ψ (1)| .
Combining these yields
ρabψ(w) (|u|) ≤ 1 + 4 |ψ (1)|+ maxv∈Vu
((b− c) z (v) + c |v|)
− minv∈Vu
((b− c) z (v) + c |v|) .
Now, recall Eq. (1), and recall that |u| − 2 |ψ (1)| < |ψ (v)| ≤ |u|. So, givenε1, ε2, ε3 > 0, we have for sufficiently long u,
|u| − 2 |ψ (1)||ψ (1)| − (a− ε3) d
< |v| ≤ |u||ψ (1)| − (a+ ε1) d− adε2
.
So, we have for sufficiently long u,
ρabψ(w) (|u|) ≤ 1 + 4 |ψ (1)|+ maxv∈Vu
((b− c) z (v)) +c |u|
|ψ (1)| − (a+ ε1) d− adε2
− minv∈Vu
((b− c) z (v))− c |u| − 2c |ψ (1)||ψ (1)| − (a− ε3) d
.
Note that the difference
c |u||ψ (1)| − (a+ ε1) d− adε2
− c |u| − 2c |ψ (1)||ψ (1)| − (a− ε3) d
tends to something less than or equal to 2c |ψ (1)| as ε1, ε2, and ε3 tend to0. Hence, given ε4 > 0, for sufficiently long u this difference can be madeless than (2c+ ε4) |ψ (1)|. Hence, we have for sufficiently long u,
ρabψ(w) (|u|) ≤ 1 + (4 + 2c+ ε4) |ψ (1)|+ (b− c)(
maxv∈Vu
(z (v))− minv∈Vu
(z (v))
).
15
Now, note that
minv∈Vu
(z (v)) ≥ zm(
c |u| − 2c |ψ (1)||ψ (1)| − (a− ε3) d
)and
maxv∈Vu
(z (v)) ≤ zm(
c |u||ψ (1)| − (a+ ε1) d− adε2
)+ ρabw
(c |u|
|ψ (1)| − (a+ ε1) d− adε2
).
Also, note that for sufficiently long u we have
minv∈Vu
(z (v))
≥ zm(
c |u| − 2c |ψ (1)||ψ (1)| − (a− ε3) d
)≥ zm
(c |u|
|ψ (1)| − (a+ ε1) d− adε2
)− (2c+ ε4) |ψ (1)| .
So,
maxv∈Vu
(z (v))−minv∈Vu
(z (v)) ≤ ρabw(
c |u||ψ (1)| − (a+ ε1) d− adε2
)+(2c+ ε4) |ψ (1)| ,
which yields
ρabψ(w) (|u|) ≤ 1 + (4 + 2c+ ε4) |ψ (1)|
+ (b− c)(ρabw
(c |u|
|ψ (1)| − (a+ ε1) d− adε2
)+ (2c+ ε4) |ψ (1)|
)= O
(ρabw (|u|)
),
by Lemma 2, as required.
This leads to the following corollary.
Corollary 1. Let φ and ψ be binary morphisms. Then,
ρab(ψφ)ω(0) (n) = Θ(ρab(φψ)ω(0) (n)
).
16
Proof. Let ϕ1 = ψ φ and ϕ2 = φ ψ. Let w1 = ϕω1 (0) and w2 = ϕω2 (0).We have
the last equality because ψ (0) begins with 0. Then,
w1 = ψ ((φ ψ)ω (0)) = ψ (ϕω2 (0)) = ψ (w2) .
Hence, by Theorem 3,
ρab(ψφ)ω(0) (n) = O(ρab(φψ)ω(0) (n)
).
Proving the other way is similar, switching the roles of ϕ1 and ϕ2.
The following result is a generalization of one direction of [16, Theo-rem 3.3]. Note that it holds for alphabets of any size.
Theorem 4. Let ψ be a morphism over Ak such that there exist positive inte-gers n0, n1, . . . , nk−1 such that ψ (0)n0 , ψ (1)n1 , . . . , ψ (k − 1)nk−1 are abelianequivalent (have the same Parikh vector). Then, for any infinite word wover Ak, ρabψ(w) (n) = Θ (1). In particular, if the fixed point of ψ at 0 exists,
ρabψω(0) (n) = Θ (1).
Proof. Let m = lcm (|ψ (0)| , |ψ (1)| , . . . , |ψ (k − 1)|), and let n be a positiveinteger. Let w be any infinite word over Ak. Let x, x′ be subwords of ψ (w)of length n. We see that x must be of the form v0ψ (u) v1 for some subwordu of w such that |ψ (u)| > n− 2m and |v0| , |v1| < m. Similarly, x′ must beof the form v′0ψ (u′) v′1 for some subword u′ of w such that |ψ (u′)| > n− 2mand |v′0| , |v′1| < m. Assume without loss of generality that |ψ (u)| ≤ |ψ (u′)|.Note then that ψ (u) is an abelian subword of ψ(u′). This means that ψ (w)is 2m-balanced, so it has Θ (1) abelian complexity by Proposition 1(1), asrequired.
The following criterion allows the classification of more morphisms. Itgives a complete classification of the abelian complexities of fixed points ofbinary morphisms where the image of 1 is all ones.
Theorem 5. Let ϕ be a binary morphism such that ϕ (1) = 1m for somem ≥ 1. Let c be the number of zeroes in ϕ (0). Assume that c + m > 2 (sothat the fixed point at 0 can exist), and, if m = 1, then assume ϕ (0) endsin 1. Then, one of the following cases holds: ρabϕω(0) (n) = Θ (n) if c > m,
ρabϕω(0) (n) = Θ(
nlogn
)if c = m, ρabϕω(0) (n) = Θ
(nlogm c
)if 1 < c < m, and
ρabϕω(0) (n) = Θ (1) if c = 1.
17
Proof. First, the case where Θ (1) if c = 1 follows from the fact that ϕω (0) =01ω. Next, all other cases use the fact that ρabϕω(0) is monotone increasing
(ϕω (0) contains arbitrarily long blocks of ones). Finally, in each case, weconsider limits of ratios of the maximal number of zeroes in a subword andthe target complexity and show that they exist and are between 0 and ∞.
Let ϕ be the morphism (0w, 1m) where w contains c − 1 zeroes (andw contains at least one 1). Let d denote the number of ones in w. Letwn = ϕn (0). We can prove two facts about wn by induction on n. Firstly,z (wn) = cn. Secondly, |wn| − z (wn) = d
∑n−1i=0 m
icn−i−1. For the inductivestep of the latter,
|wk+1| − z (wk+1) = dz (wk) +m (|wk| − z (wk))
= dck + dm
k−1∑i=0
mick−i−1
= d
k∑i=0
mick+1−i−1,
as required.Note that, for m > 1, wn contains at least mn consecutive ones, and
for m = 1, wn contains at least n consecutive ones. This means that onecan find arbitrarily many consecutive ones in ϕω (0). Hence, zm (n) = 0for all n (and, as a result, ρabϕω(0) (n) is monotone increasing). Let zM (n)
denote the maximum number of zeroes in a subword of ϕω (0) of lengthn, and let nii≥0 be the lengths of the words wi (where w0 = 0). Notethat ni = z (wi) + (|wi| − z (wi)). We have that zM (ni) ≥ z (wi) for alli. We argue that zM (ni) = z (wi) for all i. This follows from the factthat every zero in wi must have come from a zero in wi−1, so maximalzeroes lead to maximal zeroes. Additionally, note that zM (n) must satisfythe following conditions: zM (1) ∈ 0, 1, zM (n) ≥ zM (n− 1), zM (n) −zM (n− 1) ≤ 1, and zM (n+ n′) ≤ zM (n) + zM (n′) (the last three items
from Proposition 1(8,6)). So, by Lemma 3, limn→∞zM (n)n exists. We now
examine the four cases.First, assume that c > m. We show that zM (n) = Ω (n) by showing
that limn→∞zM (n)n > 0. Since this limit exists, it must be the same for
Ω (n). We also have that ρabϕω(0) (n) = O (n) because we are over a binary
alphabet. Therefore, ρabϕω(0) (n) = Θ (n), as required.
Second, assume that c = m. We show that zM (n) = Ω(
nlogn
)by
showing that
0 < limn→∞
zM (n)n
logn
= limn→∞
zM (n) log n
n.
Since this limit exists by Lemma 3, it must be the same for every subse-quence. We now examine limi→∞
z(wi) lognini
, which is the limit of a subse-quence. We have
limi→∞
z (wi) log nini
= limi→∞
ci log
(ci + d
i−1∑j=0
cjci−j−1
)
ci + di−1∑j=0
cjci−j−1
= limi→∞
ci log(ci + dici−1
)ci + dici−1
= limi→∞
c log c
d+
c
c+ di
=c log c
d.
It is clear that 0 < c log cd < ∞, so we have that 0 < limi→∞
z(wi) lognini
<
∞, and so 0 < limn→∞zM (n) logn
n . Therefore, ρabϕω(0) (n) = Ω(
nlogn
). We
19
also have that ρabϕω(0) (n) = O(
nlogn
)because zM (ni) = z (wi) and this is
precisely the subsequence we examined (and we obtained a limit less than
∞). Therefore, ρabϕω(0) (n) = Θ(
nlogn
), as required.
Third, assume that 1 < c < m. We show that zM (n) = Ω(nlogm c
)by
showing that 0 < limn→∞zM (n)
nlogm c . Since this limit exists (Lemma 3 with
an = zM (n)n1−logm c), it must be the same for every subsequence. We now
examine limi→∞z(wi)
nlogm ci
, which is the limit of a subsequence. We have
limi→∞
z (wi)
nlogm ci
= limi→∞
ci(ci + d
i−1∑j=0
mjci−j−1
)logm c
= limi→∞
ci(ci + dm
i−cim−c
)logm c
= limi→∞
ci
ci logm c
(1 + d
(mc )i−1
m−c
)logm c
= limi→∞
ci(1−logm c)(1 + d
(mc )i−1
m−c
)logm c
= limi→∞
(m− c)logm c ci(1−logm c)
d(mc
)i logm c
= limi→∞
(m− c)logm c ci
dmi logm c
= limi→∞
(m− c)logm c ci
dci
=(m− c)logm c
d.
It is clear that 0 < (m−c)logm c
d < ∞, so we have that 0 < limi→∞z(wi)
nlogm ci
<
∞, and so 0 < limn→∞zM (n)
nlogm c . Therefore, ρabϕω(0) (n) = Ω(nlogm c
). We
also have that ρabϕω(0) (n) = O(nlogm c
)because zM (ni) = z (wi) and this is
precisely the subsequence we examined (and we obtained a limit less than∞). Therefore, ρabϕω(0) (n) = Θ
(nlogm c
), as required.
20
Fourth, assume that c = 1. Then, ϕω (0) = 01ω, which is ultimatelyperiodic, and, hence by Proposition 1(11), of Θ (1) complexity.
Corollary 2. Given 0 < α < 1 and given ε > 0, there exists a binarymorphism ϕ such that ρabϕω(0) (n) = Θ
(nβ)
for some β satisfying |α− β| < ε.
Proof. This follows from Theorem 5 and the density of the numbers logm cin [0, 1].
5.1 Factorization of Parry morphisms
When we say Parry morphisms, we mean those studied in [3] that we statedhave fixed points with bounded abelian complexity in Proposition 2(4). Wedescribe all canonical factorizations of such morphisms, which allow us toconstruct additional morphisms with bounded abelian complexity, due toCorollary 1.
We work through how to factor both types of Parry morphisms. Todo this, we discuss how to completely canonically factor various types ofmorphisms.
Lemma 4. Every complete canonical factorization of the morphism (0, 1q)has the form (0, 1p1) (0, 1p2) · · · (0, 1pm) for p1, . . . , pm primes such that∏mi=1 pi = q. Also, if
∏mi=1 pi = q, then (0, 1p1) (0, 1p2) · · · (0, 1pm) =
(0, 1q).
Proof. First, we note that (0, 1q1) (0, 1q2) = (0, 1q1q1). Also, we see thatany left factor φ of (0, 1q) must have φ (0) = 0 and φ (1) = 1r for some r.Therefore, every canonical factorization is of the desired form.
An important point here is that a morphism (0, 1q) is irreducible if andonly if q is prime.
Lemma 5. Every complete canonical factorization of (0p, 1) has the form(0p1 , 1) (0p2 , 1) · · · (0pm , 1) for p1, . . . , pm primes such that
∏mi=1 pi = p,
and if∏mi=1 pi = p, then (0p1 , 1) (0p2 , 1) · · · (0pm , 1) = (0p, 1).
Proof. The proof is similar to the proof of Lemma 4.
An important point here is that a morphism (0p, 1) is irreducible if andonly if p is prime.
Lemma 6. Every complete canonical factorization of (0p, 0q1) has the form∏mi=1 φi, where φi = (0pi , 1) for some prime pi, or φi = (0, 01). Also, any
composite of the form∏mi=1 φi, where φi = (0pi , 1) for some prime pi or
φi = (0, 01), yields a morphism of the form (0p, 0q1).
Proof. We begin with the first claim. We proceed by induction on p + q.First, if p + q = 2, then the morphism is either (0, 01) or (00, 1). Both ofthese are irreducible and in the desired form. Now, assume that all completecanonical factorizations have the desired form for p + q < `. Consider amorphism with p + q = `. If we are to factor (0p, 0q1) canonically, it isclear that the image of zero in the left factor must contain only zeroes.Hence, we have (0p, 0q1) = (0r, w1) φ. Now, note that w1 must be of theform 0s1. So, we have (0p, 0q1) = (0r, 0s1) φ. We then realize that φ
must equal(
0pr , 0
q−sr 1)
(which means that r must divide p), so (0p, 0q1) =
(0r, 0s1)(
0pr , 0
q−sr 1)
. Note that r+ s < p+ q, and pr + q−s
r < p+ q. Hence,
we can apply the inductive hypothesis to both of these factors, yielding thatall factorizations of (0p, 0q1) are in the desired form.
We now move on to the second claim. We proceed by induction on m.First, if m = 1, the morphism is either of the form (0p1 , 1), or it is (0, 01).Both of these are of the form (0p, 0q1). Now, assume that
∏hi=1 φi = (0p, 0q1)
for some p and q for all possible choices of the φi. Let m = h+ 1. We have
h+1∏i=1
φi =
(h∏i=1
φi
) φh+1 = (0p, 0q1) φh+1.
If φh+1 = (0ph+1 , 1), then
h+1∏i=1
φi = (0p, 0q1) (0ph+1 , 1) = (0pph+1 , 0q1) ,
which is in the desired form. If φh+1 = (0, 01), then
h+1∏i=1
φi = (0p, 0q1) (0, 01) =(0p, 0p+q1
),
which is also in the desired form.
An important point here is that a morphism (0p, 0q1) is irreducible ifand only if p is prime and q = 0, or p = 1 and q = 1.
Lemma 7. Every complete canonical factorization of (0p1, 1) has the form(0p1 , 1) (0p2 , 1) · · · (0pm , 1) (01, 1) for p1, . . . , pm primes such that∏mi=1 pi = p, and if
∏mi=1 pi = p, then (0p1 , 1)(0p2 , 1)· · ·(0pm , 1)(01, 1) =
(0p1, 1).
22
Proof. We show the first claim by induction on p. First, if p = 1, we have(01, 1), which is irreducible and in the desired form. Now, assume thatthe desired factorization form holds for all p < h. Consider the morphism(0h1, 1
). The image of 1 in a left factor must be 1, so the image of 0 must
contain only zeroes. Determining the right factor from these facts yields
the factorization(0h1, 1
)= (0r, 1)
(0hr 1, 1
). We can apply the inductive
hypothesis to the right factor and Lemma 5 to the left factor to yield thedesired result.
Lemma 8. Every complete canonical factorization of (0p1, 0q) has the form(m∏i=1
φi
) (01, 0)
m′∏j=1
(0, 1qj )
,
where φi = (0pi , 1) for some prime pi or φi = (0, 01), and each of the qj’sis prime (we allow the second product to be empty, in which case m′ = 0).Also, any composite of the form(
m∏i=1
φi
) (01, 0)
m′∏j=1
(0, 1qj )
,
where φi = (0pi , 1) for some prime pi or φi = (0, 01), and each of the qj’s isprime (and m′ = 0 is allowed), yields a morphism of the form (0p1, 0q).
Proof. We begin with the first claim. We proceed by induction on p + q.First, if p + q = 2, then the morphism is (01, 0). This is irreducible and inthe desired form. Now, assume that all complete canonical factorizationshave the desired form for p + q < `. Consider a morphism with p + q = `.If we are to factor (0p1, 0q) canonically, it is clear that the image of zero inthe left factor must either contain only zeroes or be 0p1.
In the first case, we have (0p1, 0q) = (0r, 0s1) φ. We then realize
that φ must equal(
0p−sr 1, 0
qr
)(which means that r must divide q), so
(0p1, 0q) = (0r, 0s1) (
0p−sr 1, 0
qr
). Note that p−s
r + qr < p + q. Hence, we
can apply the inductive hypothesis to the right factor and Lemma 6 to the
23
left factor, yielding that all factorizations of (0p1, 0q) obtained from the firstpossibility are of the desired form.
In the second case, we have (0p1, 0q) = (0p1, 0r) φ. We then realize
that φ must equal(
0, 1qr
)(which means that r must divide q), so (0p1, 0q) =
(0p1, 0r)(
0, 1qr
). Note that p+r < p+q. Hence, we can apply the inductive
hypothesis to the left factor and Lemma 4 to the right factor, yielding thatall factorizations of (0p1, 0q) obtained from the second possibility are of thedesired form.
We now move on to the second claim. Given a composite(m∏i=1
φi
) (01, 0)
m′∏j=1
(0, 1qj )
,
with the required properties, we have that it equals (0pa , 0qa1) (01, 0) ifm′ = 0 or (0pa , 0qa1) (01, 0) (0, 1qb) if m′ > 0, for some pa, qa, and qb. Wesee that
(0pa , 0qa1) (01, 0) =(0pa+qa1, 0pa
),
which is in the required form. Also,
(0pa , 0qa1) (01, 0) (0, 1qb) =(0pa+qa1, 0pa
) (0, 1qb) =
(0pa+qa1, 0paqb
),
which is also in the required form.
Lemma 9. Every complete canonical factorization of (0p1, 0q1) with p > qhas the form (
∏mi=1 φi) (01, 1), where φi = (0pi , 1) for some prime pi or
φi = (0, 01). Also, any composite of the form (∏mi=1 φi) (01, 1), where
φi = (0pi , 1) for some prime pi or φi = (0, 01) yields a morphism of theform (0p1, 0q1) with p > q.
Proof. We begin with the first claim. We proceed by induction on p + q.First, if p + q = 1, then the morphism is (01, 1). This is irreducible and inthe desired form. Now, assume that all complete canonical factorizationshave the desired form for p + q < ` and p > q. Consider a morphism withp + q = ` and p > q. If we are to factor (0p1, 0q1) canonically, it is clearthat the image of zero in the left factor must either contain only zeroes orbe 0p1.
We can easily exclude the second case, so we have (0p1, 0q1) = (0r, 0s1)φ. We then realize that φ must equal
(0p−sr 1, 0
q−sr 1)
, so (0p1, 0q1) =
(0r, 0s1) (
0p−sr 1, 0
q−sr 1)
. Note that p−sr + q−s
r < p + q and that p−sr >
24
q−sr . Hence, we can apply the inductive hypothesis to the right factor and
Lemma 6 to the left factor, yielding that all factorizations of (0p1, 0q1) ob-tained from the first possibility are of the desired form.
We now move on to the second claim. Given a composite(m∏i=1
φi
) (01, 1) ,
with the required properties, we have that it equals (0pa , 0qa1) (01, 1) forsome pa and qa. We see that (0pa , 0qa1) (01, 1) = (0pa+qa1, 0qa1), which isin the required form. Also, since pa + qa > qa, this morphism satisfies thedesired inequality.
The following theorem states how to fully factor the two types of Parrymorphisms.
Theorem 6. • If ϕ = (0p1, 0q1) with 1 ≤ q < p, then all completecanonical factorizations of ϕ are of the form (
∏mi=1 φi) (01, 1), where
φi = (0pi , 1) for some prime pi or φi = (0, 01).
• If ϕ = (0p1, 0q) with 1 ≤ q ≤ p, then for all choices of a nonnegativeodd integer N , of a sequence of nonnegative integers a0, a1, . . . , aN withall but possibly the last positive, and of integers q0, q
′ with q0 ≥ 0 andq′ > 0 where
N−12∏i=0
a2i + q0 +
N−12∑i=0
a2i+1
i∏j=0
a2j
= p, q′
N−12∏i=0
a2i = q,
there exists a complete canonical factorization (possibly with additionalcopies of (0, 1) in it):
ϕ = (0, 01)q0
N−12∏j=0
((m2j∏i=1
(0pi,2j , 1)
) (0, 01)a2j+1
) (01, 0)
(m′∏i=1
(0, 1q
′i
)),
where each of the m2j’s is a positive integer, all of the pi,2j’s are prime,∏m2j
i=1 pi,2j = a2j, all of the q′i’s are prime, and∏m′
i=1 q′i = q′.
In both cases, any composites of the necessary forms yield a Parry mor-phism of the proper type (where for the complicated case, all we require isthat the complicated p value exceed the complicated q value).
25
Proof. The result for the first type of Parry morphism follows directly fromLemma 9. We now prove the result for the second type of Parry morphism.By Lemma 8, all complete canonical factorizations of ϕ = (0p1, 0q) are ofthe form
ϕ =
(m∏i=1
φi
) (01, 0)
m′∏j=1
(0, 1qj )
,
where φi = (0pi , 1) for some prime pi or φi = (0, 01), and each of the qj ’s isprime. We can use Lemma 5, Lemma 4, and the fact that (0, 01)m = (0, 0m1)to assert
ϕ = (0, 0q01)
N−12∏j=0
((0a2j , 1) (0, 0a2j+11))
(01, 0) (
0, 1q′), (2)
for some odd N ≥ 0, some q0 ≥ 0, some q′ > 0, and some sequencea1, a2, . . . , aN all positive except for possibly the last, which is nonegative(all of these are integers). This factorization is (probably) not complete.Lemma 5, Lemma 4, and the fact that (0, 01)m = (0, 0m1) combine to givethe complete form, which is precisely what the theorem requires (and is notrestated here).
We begin by defining two sequences:
pi =
1, i = 0;
ai−1pi−1, i odd;
pi−1, otherwise,
and
qi =
q0, i = 0;
ai−1pi−1 + qi−1, i even;
qi−1, otherwise.
We prove that
(0, 0q01)
m∏j=0
((0a2j , 1) (0, 0a2j+11))
= (0p2m+2 , 0q2m+21) .
26
As this is the beginning of the factorization in Eq. (2), this implies that
ϕ = (0pN+1 , 0qN+11) (01, 0) (
0, 1q′)
= (0pN+1 , 0qN+11) (
01, 0q′)
=(
0pN+1+qN+11, 0q′pN+1
).
So, we have p = pN+1 + qN+1 and q = q′pN+1.We proceed by induction on m. If m = −1 (a shorthand for ignoring
the product completely), we simply have (0, 0q01), which equals (0p0 , 0q01),as required. Now, assume that for some h,
Hence, we have(0p2h+2a2h+2 , 0p2h+2a2h+2a2h+3+q2h+21
)= (0p2h+4 , 0q2h+41)
= (0p2(h+1)+2 , 0q2(h+1)+21) ,
as required.We now prove that
27
p2m =∏m−1i=0 a2i and q2m = q0 +
∑m−1i=0
(a2i+1
∏ij=0 a2j
).
Substituting N+12 for m proves the desired formulas:
N−12∏i=0
a2i + q0 +
N−12∑i=0
a2i+1
i∏j=0
a2j
= pN+1 + qN+1 = p,
q′
N−12∏i=0
a2i = q′pN+1 = q.
We proceed by induction on m. For m = 0, we have p0 = 1 and q0 = q0,both of which match the proposed formulas. Now, assume that for some h,
p2h =∏h−1i=0 a2i and q2h = q0 +
∑h−1i=0
(a2i+1
∏ij=0 a2j
).
Let m = h+ 1. We have, using Eq. (3) and Eq. (4),
p2h+2 = a2hp2h = a2h∏h−1i=0 a2i =
∏hi=0 a2i
and
q2h+2 = a2h+1a2hp2h + q2h
= a2h+1a2h
h−1∏i=0
a2i + q0 +
h−1∑i=0
a2i+1
i∏j=0
a2j
= a2h+1
h∏i=0
a2i + q0 +
h−1∑i=0
a2i+1
i∏j=0
a2j
= q0 +
h∑i=0
a2i+1
i∏j=0
a2j
,
both as required.We have completed one direction of the proof. The converses follow from
the various preceding lemmas.
Theorem 6, when combined with Corollary 1, yields the following corol-laries.
28
Corollary 3. Let ϕ be a morphism with a complete canonical factorizationof the form (
m0∏i=1
φ0,i
) (01, 1)
m1∏j=1
φ1,j
,
for some integers m0,m1 ≥ 0, where φm,n = (0pn , 1) for some prime pn orφm,n = (0, 01). Then ρabϕω(0) (n) = Θ (1).
Corollary 4. Let ϕ be a morphism with a (probably not complete) canonicalfactorization that is a cyclic shift of the following composite:
(0, 0q01)
N−12∏j=0
((0a2j , 1) (0, 0a2j+11))
(01, 0) (
0, 1q′)
for some odd N ≥ 0 (in case N = −1, the product term is absent), someq0 ≥ 0, some q′ > 0, and some sequence a0, a1, . . . , aN all nonnegative. If
N−12∏i=0
a2i + q0 +
N−32∑i=0
a2i+1
i∏j=0
a2j
≥ q′ N−12∏i=0
a2i,
then ρabϕω(0) (n) = Θ (1).
Proof. Just apply Theorem 6 and Corollary 1 if the inequality is strict, orapply Theorem 4 if there is equality.
An example of a morphism classifiable by Corollary 3 is (001001, 00101),which has a complete canonical factorization (0, 01)(01, 1)(0, 01)(00, 1),which satisfies the conditions of Corollary 3. An example of a morphism clas-sifiable by Corollary 4 is (0011, 0), which has a complete canonical factoriza-tion (0, 11) (0, 01) (01, 0). This is a cyclic shift of (0, 01) (01, 0) (0, 11),so we have q0 = 1, q′ = 2, and N = −1.
5.2 Classification of uniform morphisms
We now derive a complete classification of the abelian complexities of fixedpoints of uniform binary morphisms.
Let ϕ be a uniform binary morphism with fixed point at 0. The lengthof ϕ (denoted ` (ϕ) or just ` if ϕ is unambiguous) is equal to |ϕ (0)| (whichequals |ϕ (1)|). The difference of ϕ (denoted d (ϕ) or just d if ϕ is unam-biguous) equals |z (ϕ (0))− z (ϕ (1))|. The delta of ϕ (denoted ∆ (ϕ) or just
29
∆ if ϕ is unambiguous) equals zM (` (ϕ))−max z (ϕ (0)) , z (ϕ (1)), wherezM (` (ϕ)) denotes the maximum number of zeroes in a subword of length` (ϕ) of ϕω(0). Also, if ϕ is unambiguous, we denote z (ϕ (0)) by z0, z (ϕ (1))by z1, and ρabϕω(0) (n) by ρab (n).
The result we prove in this section is the following.
Theorem 7. Let ϕ be a uniform binary morphism, and define f (n) = 1 iflog2 n ∈ Z, and f (n) = logn otherwise. Then the following hold:
ρab (n) =
Θ (1) , d = 0;
Θ (1) , ϕ = ((01)b`2c 0, (10)b
`2c 1) if ` is odd;
Θ (1) , ϕ =(01`−1, 1`
);
Θ (f (n)) , d = 1, ∆ = 0, and not earlier cases;
O (log n) , d = 1,∆ > 0;
Θ(nlog` d
), d > 1.
We should at this point explain the precise connection between this resultand Theorem 1 (in the case where ϕ is primitive). The reader should recallfrom Section 2 the definition of the incidence matrix Mϕ of the morphismϕ. When ϕ is an `-uniform binary morphism, the matrix Mϕ will have twoeigenvalues: θ1 and θ2. It is an easy exercise in linear algebra (which weleave to the reader) to show that θ1 = ` and θ2 = ±d, and each of theseeigenvalues has algebraic multiplicity 1. Also note that since d is an integer,if |θ2| = 1, then θ2 is a root of unity (±1). The cases leading to ρab(n) = Θ(1)are clear, so let us suppose that we are not in any of these cases.
Suppose that ϕ is primitive. Then, replacing ∆ with Aϕ,w, the upperbounds implied by Theorem 7 follow from Theorem 1. Although these twoconstants play the same role in their respective theorems (distinguishingbetween the two possible behaviors when the second eigenvalue is a root ofunity), the precise connection between them is not completely clear: Theconstant Aϕ,w has a rather complicated definition, and a procedure for com-puting it is given in Appendix B of [1], but it is not immediately clear if itnecessarily equals the constant ∆ defined here.
Now regarding the lower bounds, recall that (except when f(n) is bounded)the lower bound implied by ρab(n) = Θ(f(n)) is, in general, stronger thanthe lower bound implied by ρab(n) = (O ∩ Ω′)(f(n)), since the former givesa lower bound valid for all sufficiently large values of n, whereas the latteronly gives a lower bound valid for infinitely many n. Therefore, for instancewhen d > 1, the lower bound implied by ρab(n) = Θ(nlog` d) in Theorem 7is stronger than what one gets from Theorem 1 for primitive morphisms.
Our proof of Theorem 7 requires the following lemmas.
Lemma 10. For any uniform binary morphism ϕ with a fixed point at 0,∆ = min z0, z1 − zm (`).
Proof. Let w = ϕω (0). If w contains finitely many zeroes or ones, then∆ = 0 and this formula is satisfied. So, we can assume without loss ofgenerality that w contains infinitely many zeroes and ones. Let v be asubword of w of length ` with z (v) = zM (`). The word v must be asubword of either ϕ (01) or ϕ (10) (as otherwise it would contain exactly z0
or z1 zeroes). Let u be the subword of the other one of these that containsexclusively the pieces not in v. Hence, |u| = ` as well, and it is clearthat z (u) = zm (`). Also, we have z0 + z1 = min z0, z1 + max z0, z1 =z (u) + z (v), so ∆ = min z0, z1 − zm (`), as required.
Lemma 11. Let ϕ be a uniform binary morphism with a fixed point at 0containing zeroes and ones. Let z be the maximal (resp., minimal) numberof zeroes in a length-` subword of ϕ (010). Then, ∆ = z−max z0, z1 (resp.,∆ = min z0, z1 − z).
Proof. Any subword of ϕ (00) of length ` has z0 zeroes, and any subword ofϕ (11) of length ` has z1 zeroes. The words ϕ (0) and ϕ (1) are subwords ofϕ (010) and have z0 and z1 zeroes respectively. Hence, there exists a subwordof ϕ (010) of length ` with every possible number of zeroes for subwords oflength `. This must include a possible choice for z, as required.
Lemma 12. Let ϕ be a uniform binary morphism with a fixed point at 0.Let w denote this fixed point. If w is not ultimately periodic, then all of thefollowing exist for each n ≥ 0:
• A subword v of w with |v| = n, z (v) = zM (n), v [0] = 0, and v1 is asubword of w.
• A subword v of w with |v| = n, z (v) = zM (n), v [n− 1] = 0, and 1vis a subword of w.
• A subword v of w with |v| = n, z (v) = zm (n), v [0] = 1, and v0 is asubword of w.
• A subword v of w with |v| = n, z (v) = zm (n), v [n− 1] = 1, and 0vis a subword of w.
31
Proof. We only show the first subword exists. The proofs for the others aresimilar (though the second and fourth cases require all subwords to occurinfinitely often, which is the case if w is not ultimately periodic). Assumefor a contradiction that, for some n, there does not exist a subword v of wwith |v| = n, z (v) = zM (n), v [0] = 0, and v1 is a subword of w. Considera subword u of w with |u| = n and z (u) = zM (n). If u [0] = 1, then u0cannot be a subword of w, as then (u0) [1..n+ 1) would be a subword oflength n with more zeroes than u. We can keep shifting in this way, therebyshowing that there exists such a u with u [0] = 0. By assumption, u1 is nota subword of w, so u0 must be. Note that (u0) [1..n+ 1) has zM (n) zeroesas well. Hence, every subword of length n beginning after u must havezM (n) zeroes, which implies that w is ultimately periodic, a contradiction.Therefore, there exists a subword v of w with |v| = n, z (v) = zM (n),v [0] = 0, and v1 is a subword of w.
Lemma 13. For a uniform binary morphism with a fixed point at 0 suchthat z0 ≥ z1,
Proof. We prove only the first formula (the rest are similar). Let ϕ be auniform binary morphism with z0 ≥ z1 with a fixed point at 0. Let w bethat fixed point. First, assume that w is not ultimately periodic. Let v0
be a subword of w with |v0| = n, z (v0) = zM (n), v0 [0] = 0, and v01 asubword of w. Let v1 be a subword of w with |v1| = n, z (v1) = zM (n),v1 [n− 1] = 0, and 1v1 a subword of w. (Both v0 and v1 are guaranteed toexist by Lemma 12.) We have that
z (ϕ (v0)) = z (ϕ (v1))
= z0zM (n) + z1 (n− zM (n))
= dzM (n) + z1n.
Let u be a subword of w of length ` with z (u) = zM (`). By Lemma 11,there exists a choice of u that is either a subword of ϕ(01) or a subwordof ϕ(10). Find i such that u = ϕ (01) [i..i+ `) or u = ϕ (10) [i..i+ `). If u
32
is a subword of ϕ(01), then z (ϕ (v01) [i..i+ `n)) = dzM (n) + z1n + ∆. Ifu is a subword of ϕ(10), then z (ϕ (1v1) [i..i+ `n)) = dzM (n) + z1n + ∆.Furthermore, every word ϕ (v01) [j..j + `n) can be associated to a subwordof ϕ(01) of length n in this way, and every word ϕ (1v1) [j..j + `n) canbe associated to a subword of ϕ(10) of length n in this way. Therefore,zM (`n) = dzM (n) + z1n+ ∆, as required.
The only cases remaining are those where w is ultimately periodic. Thereare four sub-cases here: ϕ = (w0, w0), ϕ = (0`, w0), ϕ = (01`−1, 1`), and ϕ =
((01)`−12 0, (10)
`−12 1). In these cases, ∆ = 0, so we need not worry about the
shifting procedure in the previous case. That was the only situation in whichLemma 12 was actually necessary (we could have just chosen any subwordof length n with maximal zeroes), so the previous result still holds.
Lemma 14. Let ϕ be a uniform binary morphism with a fixed point at 0,and let m be a positive integer. Then,
d (ϕm) = d (ϕ)m
and
∆ (ϕm) =
m∆ (ϕ) , d = 1;(dm−1)∆(ϕ)
d−1 , otherwise..
Proof. By Lemma 13, the maximum number of zeroes in a subword of length`mn can be computed. We can do this in two ways. First, we iterate theformula of Lemma 13 m times. Second, we apply Lemma 13 once to ϕm.Let φ = ϕm. When not specified, d, ∆, z0, z1, and zM refer to ϕ. We assumewithout loss of generality that z0 ≥ z1.
First, we obtain the recurrence
zM (`mn) = dzM(`m−1n
)+ z1`
m−1n+ ∆.
This is a nonhomogeneous linear recurrence. The associated homogeneousequation is
z′M (`mn) = dz′M(`m−1n
),
which has solution z′M (`mn) = cdm, where c is a constant. We now find aspecific solution to the given recurrence. If d 6= 1, we find a solution of theform a`m + b. We obtain
a`m + b = da`m−1 + db+ z1`m−1n+ ∆.
33
This implies a`m = da`m−1 + z1`m−1n and b = db + ∆ or a = z1n
`−d and
b = − ∆d−1 . If d = 1, we similarly find a solution of the form a`m + bm and
obtain
a =z1n
`− 1and b = ∆.
Hence, if d 6= 1, the general solution is of the form
zM (`mn) = cdm +z1n`
m
`− d− ∆
d− 1.
Substituting in m = 0 and solving for c yield
c = zM (n)− z1n
`− d+
∆
d− 1.
Hence, we have the solution
zM (`mn) = dmzM (n) +z1n (`m − dm)
`− d+
(dm − 1) ∆
d− 1. (5)
Similarly, if d = 1, the general solution is of the form
zM (`mn) = zM (n) +z1n (`m − 1)
`− 1+m∆. (6)
(Note that this expression can be obtained from the d 6= 1 case by takingthe limit as d approaches 1.)
Second, we wish to apply Lemma 13 to φ. In order to do this success-fully, we must compute z (φ (1)). Since φ = ϕm, we do this by solving therecurrence
z (ϕm (1)) = z0z(ϕm−1 (1)
)+ z1
(`m−1 − z
(ϕm−1 (1)
))= dz
(ϕm−1 (1)
)+ z1`
m−1.
This is a nonhomogeneous linear recurrence. The associated homogeneousequation is
z′ (ϕm (1)) = dz′(ϕm−1 (1)
),
which has solution z′ (ϕm (1)) = cdm where c is a constant. We now finda specific solution to the given recurrence. We find a solution of the forma`m. We obtain a`m = da`m−1 +z1`
m−1, which implies a = z1`−d . Hence, the
general solution is of the form
z (ϕm (1)) = cdm +z1`
m
`− d.
34
Substituting in m = 1 and solving for c yield c = −z1`−d . Hence, we have the
solution
z (ϕm (1)) =z1 (`m − dm)
`− d.
The expression obtained from Lemma 13 matches Eq. (5) if d 6= 1 (resp.,Eq. (6) if d = 1). The coefficient on zM (n) is dm, so it must be thatd (φ) = dm, as required. Also, the nondelta term is
z1n (`m − dm)
`− d
in both cases. Therefore, the rest of Eq. (5) (resp., Eq. (6)) is the value of∆ (φ), which is the required value in both cases.
Lemma 15. For any uniform binary morphism with a fixed point at 0,
ρab (`n) = dρab (n)− d+ 1 + 2∆.
Proof. This follows from Lemma 13 and the fact that ρab (n) = zM (n) −zm (n) + 1.
Lemma 16. A uniform binary morphism ϕ with d = 1, ∆ = 0, and afixed point at 0 containing both zeroes and ones satisfies exactly one of thefollowing:
• ϕ (0) = (01)b`2c 0 and ϕ (1) = (10)b
`2c 1;
• ϕ (0) = 01`−1 and ϕ (1) = 1`;
• There exist integers i and j such that ϕ2 (0) [i] = ϕ2 (1) [i] = 0 andϕ2 (0) [j] = ϕ2 (1) [j] = 1.
Proof. It is clear that the first two cases’ squares fall into those same casesand that neither case has a position that is a 0 in both ϕ (0) and ϕ (1).
We split into cases depending on whether there exist integers i0 and j0such that ϕ (0) [i0] = ϕ (1) [i0] = 0 and ϕ (0) [j0] = ϕ (1) [j0] = 1. Here arethe possibilities for ϕ.
First, assume no i0 or j0 exists. Let ψ = (1, 0). In this case, ϕ =(w0, ψ (w0)) for some w0. We show that if this occurs when d = 1 and∆ = 0, then we must fall into the first case. Assume for a contradiction that
ϕ = (w0, ψ (w0)) for some w0, d = 1, ∆ = 0, and ϕ 6= ((01)b`2c 0, (10)b
`2c 1).
We know that ` must be odd, and we know that z (w0) ∈⌊
`2
⌋,⌈`2
⌉.
35
Without loss of generality, assume it is⌊`2
⌋. Then, we know that 11 is a
subword of w0. (This would be 00 in the other case for z (w0).) Let i1 bean index such that w0 [i1..i1 + 2) = 11. Then, w = x011y for some words xand y, where x does not contain 11 (so it contains at least as many zeroesas ones). Consider the word u := (w0ψ (w0)) [i1..i1 + `). We have
z (u) = z (w0)− z (x0) + z (ψ (x0))
≤ z (w0)− 1
<
⌊`
2
⌋.
This means that ∆ > 0, a contradiction.Next, assume only j0 exists. If ϕ (1) = 1`, then it must be that ϕ (0) =
01`−1. This is the second exceptional case. Since we know that ϕ (1) 6= 0`
(because j0 exists), we can let i1 and j1 be the first positions of a 0 and a 1in ϕ (1) respectively. We can take i = `j0 + i1 and j = `j0 + j1.
Finally, assume i0 exists. Let i1 and j1 be the first positions of a 0 anda 1 in ϕ (0) respectively. We can take i = `i0 + i1 and j = `i0 + j1.
Lemma 17. Let ϕ be a uniform binary morphism with a fixed point at 0,d = 1 and ∆ = 0, such that there exist integers i and j such that ϕ (0) [i] =ϕ (1) [i] = 0 and ϕ (0) [j] = ϕ (1) [j] = 1. Then,
ρab (`n− 1) = ρab (`n+ 1) = ρab (`n) + 1.
Proof. We show that zM (`n− 1) = zM (`n), zm (`n− 1) = zm (`n) − 1,zM (`n+ 1) = zM (`n) + 1, and zm (`n+ 1) = zm (`n). Let w denote thefixed point of ϕ at 0. Let v0 be a subword of w with |v0| = n, z (v0) = zM (n),v0 [0] = 0, and v01 a subword of w, let v1 be a subword of w with |v1| = n,z (v1) = zM (n), v1 [n− 1] = 0, and 1v1 a subword of w, let v2 be a subwordof w with |v2| = n, z (v2) = zm (n), v2 [0] = 1, and v20 a subword of w,and let v3 be a subword of w with |v3| = n, z (v3) = zm (n), v3 [n− 1] = 1,and 0v3 a subword of w. (The subwords v0, v1, v2, and v3 are guaranteedto exist by Lemma 12.) Also, for a ∈ 0, 1 and 0 ≤ m < ` an integer, letua,m = ϕ (a) [0..m) and u′a,m = ϕ (a) [m+ 1..`).
Before we examine the cases, we show that z (u0,i) = z (u1,i) or z(u′0,i) =z(u′1,i) and that z (u0,j) = z (u1,j) or z(u′0,j) = z(u′1,j). We prove only thefirst case; the second is similar. Since d = 1 and ∆ = 0,
|z (ϕ (0))− z (ϕ (01) [i..i+ `))| ≤ 1
36
and|z (ϕ (0))− z (ϕ (10) [i+ 1..i+ `+ 1))| ≤ 1.
We have that
z (ϕ (01) [i..i+ `)) = z (ϕ (0))− z (u0,i) + z (u1,i) ,
so |z (u0,i)− z (u1,i)| ≤ 1, and we have that
z (ϕ (10) [i+ 1..i+ `+ 1)) = z (ϕ (0))− z(u′0,i) + z(u′1,i),
so∣∣∣z(u′0,i)− z(u′1,i)∣∣∣ ≤ 1. We also have
z (ϕ (0)) = 1 + z (u0,i) + z(u′0,i)
andz (ϕ (1)) = 1 + z (u1,i) + z(u′1,i).
Assume for a contradiction that z (u0,i) 6= z (u1,i) and z(u′0,i) 6= z(u′1,i). Thisimplies that
|z (u0,i)− z (u1,i)| = 1 and∣∣∣z(u′0,i)− z(u′1,i)∣∣∣ = 1.
Then,∣∣∣z (u0,i) + z(u′0,i)− z(u1,i)− z(u′1,i)
∣∣∣ ∈ 0, 2. We have
1 = d
= |z (ϕ (0))− 1− (z (ϕ (1))− 1)|=∣∣z (u0,i) + z(u′0,i)− z (u1,i)− z(u′1,i)
∣∣ ,a contradiction. Therefore, z (u0,i) = z (u1,i) or z(u′0,i) = z(u′1,i).
Without loss of generality, we assume z (u0,i) = z (u1,i) and z (u0,j) =z (u1,j) from this point forward. If the first of these is not true, we couldreplace v0 with v1 and work from right to left in those cases in the subsequentargument, while if the second is not true, we could replace v2 with v3 andwork from right to left in those cases in the subsequent argument. We nowexamine the first two specific cases (the other two are similar).
First, we show that zM (`n− 1) = zM (`n). The only possibilities are
zM (`n− 1) = zM (`n) or zM (`n− 1) = zM (`n)− 1.
37
Since v01 is a subword of w, ϕ (v01) [j..j + `n) is also a subword of w, andit has length `n. Since z (u0,j) = z (u1,j) and ∆ = 0,
z (ϕ (v01) [j..j + `n)) = z (ϕ (v0)) = zM (`n) .
Also, ϕ (v01) [j] = 1, so
z (ϕ (v01) [j + 1..j + `n)) = z (ϕ (v01) [j..j + `n)) = zM (`n) .
Since we have an example of a subword of length `n−1 with zM (`n) zeroes,zM (`n− 1) ≥ zM (`n). Therefore, zM (`n− 1) = zM (`n), as required.
Second, we show that zm (`n− 1) = zm (`n) − 1. The only possibilitiesare zm (`n− 1) = zm (`n) or zm (`n− 1) = zm (`n) − 1. Since v20 is asubword of w, ϕ (v20) [i..i+ `n) is also a subword of w, and it has length `n.Since z (u0,i) = z (u1,i) and ∆ = 0,
z (ϕ (v20) [i..i+ `n)) = z (ϕ (v2)) = zm (`n) .
Also, ϕ (v20) [i] = 0, so
z (ϕ (v20) [i+ 1..i+ `n)) = z (ϕ (v20) [i..i+ `n))− 1 = zm (`n)− 1.
Since we have an example of a subword of length `n − 1 with zm (`n) − 1zeroes, zm (`n− 1) ≤ zm (`n) − 1. Therefore, zm (`n− 1) = zm (`n) − 1, asrequired.
Lemma 18. Let ϕ be a uniform binary morphism with a fixed point at 0.Let 0 ≤ r < ` be an integer. Then,
dρab (n+ 1)− d+ 2 + 2∆− ρab (`− r) ≤ ρab (`n+ r)
≤ dρab (n)− d+ 2 + 2∆ + ρab (r) .
Proof. We assume without loss of generality that z0 ≥ z1. We have
zM (`n+ r) ≤ zM (`n) + zM (r)
andzM (`n+ r) ≥ zM (` (n+ 1))− zM (`− r)
(both from subadditivity of zM ). Combining these yields
We can easily show that these inequalities are equivalent to the desiredones.
Lemma 19. In any nonultimately periodic infinite word w, for all n > 0there exist subwords v0 and v1 each of length n with z (v0) > z (v1) such thatv0a and v1a are both subwords of w for some a ∈ 0, 1.
Proof. Assume for a contradiction that for some n there do not exist suchsubwords. This means that the next letter after a subword of length nis determined entirely by the number of zeroes in that subword, so thesubword (not abelian) complexity of w satisfies ρw (n+ 1) = ρw (n). By [2,Theorem 10.2.6], this means that w is ultimately periodic, a contradiction.
39
Lemma 20. Let ϕ be a uniform binary morphism whose fixed point at 0 isnonultimately periodic. Let 0 ≤ r < ` be an integer. If ρab (n+ 1) ≥ ρab (n),then
ρab (`n+ r) ≥ dρab (n)− d+ 1.
Proof. Without loss of generality, assume z0 ≥ z1. Let w denote the fixedpoint of ϕ at 0. Assume for a contradiction that there do not exist subwordsv0 and v1 of w of length n and some a ∈ 0, 1 with z (v0) = zm (n),z (v1) = zM (n), and v0a and v1a both subwords of w. Then, by Lemma 12,every subword of length n with zM (n) zeroes is followed by a 1, and everysubword of length n with zm (n) zeroes is followed by a 0. This implies thatzM (n+ 1) = zM (n) and zm (n+ 1) = zm (n)+1, which together imply thatρab (n+ 1) = ρab (n)−1, a contradiction. Therefore, we can let v0 and v1 besubwords of w of length n such that z (v0) = zm (n), z (v1) = zM (n), andthere exists a ∈ 0, 1 such that v0a and v1a are both subwords of w. Wehave
zM (`n+ r) ≥ z (ϕ (v1a) [0..`n+ r))
= dz (v1) + nz(ϕ(1)) + z (ϕ (a) [0..r))
= d (zM (n)) + nz(ϕ(1)) + z (ϕ (a) [0..r))
and
zm (`n+ r) ≤ z (ϕ (v0a) [0..`n+ r))
= dz (v0) + nz(ϕ(1)) + z (ϕ (a) [0..r))
= d (zm (n)) + nz(ϕ(1)) + z (ϕ (a) [0..r)) .
Subtracting these yields
zM (`n+ r)− zm (`n+ r) ≥ d (zM (n)− zm (n)) .
Equivalently, ρab (`n+ r) − 1 ≥ d(ρab (n)− 1
)or ρab (`n+ r) ≥ dρab (n) −
d+ 1, as required.
Lemma 21. Let ϕ be a uniform binary morphism with a fixed point at 0,d ≥ 2, and let c be a positive integer. Then, ρab (n) = c for finitely many n.
Proof. Without loss of generality, assume z0 ≥ z1. Let w denote the fixedpoint of ϕ at 0. The proof is by induction on c. First, ρab (n) = 1 neveroccurs, because this implies that w is periodic (which cannot happen with
40
d ≥ 2). We now show that ρab (n) = 2 finitely often. Let ρab (n) = 2. Sinceρab (n+ 1) 6= 1, given 0 ≤ r < `, Lemma 20 says that
ρab (`n+ r) ≥ dρab (n)− d+ 1 = d+ 1 ≥ 3.
Therefore, if ρab (n) = 2, then n < `, so ρab (n) = 2 finitely often.Now, assume that ρab (n) = c finitely often for some c. Then, there are
only finitely many values of n such that ρab (n) = c+ 1 and ρab (n+ 1) = c.So, except for those finitely many values, if ρab (n) = c + 1, then, given0 ≤ r < `, Lemma 20 yields
Therefore, ρab (n) = c+ 1 finitely often, as required.
Lemma 22. Let ϕ be a uniform binary morphism whose fixed point at 0 isnonultimately periodic. Let 0 ≤ r < ` be an integer. Then,
ρab (`n+ r) ≥ dρab (n)− 2d+ 1.
Proof. Without loss of generality, assume z0 ≥ z1. Let w denote the fixedpoint of ϕ at 0. By Lemma 12, let v0 be a subword of w of length n satisfyingz (v0) = zm (n) and v00 a subword of w. Assume for a contradiction thatthere does not exist a subword v1 of w of length n with z (v1) = zM (n)− 1and v10 a subword of w. Then, all subwords of length n containing zM (n)−1 zeroes are followed by ones, meaning that zM (n) zeroes can never beachieved in a subword of length n, a contradiction. Let v1 be such a subword.The rest of the proof is similar to that of Lemma 20.
We now prove Theorem 7.
Proof. The first case follows from Theorem 4. The second case follows sinceϕω (0) = (01)ω is periodic, and, therefore, has Θ (1) abelian complexity. Thethird case follows since ϕω (0) = 01ω is ultimately periodic, and, hence, ofΘ (1) abelian complexity.
We now prove the fourth case. Assume that d = 1, ∆ = 0, and weare not in the second or third case. By Lemma 16, there exist integers iand j such that ϕ2 (0) [i] = ϕ2 (1) [i] = 0 and ϕ2 (0) [j] = ϕ2 (1) [j] = 1.By Lemma 14, d
(ϕ2)
= 1 and ∆(ϕ2)
= 0, so by Lemma 17 applied toϕ2, ρab
(`2n− 1
)= ρab
(`2n+ 1
)= ρab
(`2n)
+ 1. Consider the sequencedefined by a0 = 1 and ai = `2ai−1 + 1. It can be easily shown by inductionthat ai =
∑ij=0 `
2j . Also, we know that ρab (ai) = i. Hence, we have
41
ρab(∑i
j=0 `2j)
= i, so the ai’s give a subsequence of ρab (n) with logarithmic
growth. We now use Lemma 18 to show that ρab (n) is O (log n) completingour proof that it is Θ (f (n)). Let c be the maximum value of ρab (n) forn < `. For r ∈ 0, . . . , `− 1,
Similar to the fourth case, we can prove that ρab (n) = O(log n).We now prove the sixth and final case. Let c be the maximum value of
ρab (n) for n < `. First, we show that ρab (n) = O(nlog` d
). We have, from
Lemma 18,
ρab (`n+ r) ≤ dρab (n)− d+ 2 + 2∆ + ρab (r)
≤ dρab (n)− d+ 2 + 2∆ + c,
where r ∈ 0, . . . , ` − 1. As we increase by (approximately) a factor of` in the argument, we can increase by at most (approximately) a factorof d in value. This is nlog` d behavior, as required. Now, we show thatρab (n) = Ω
(nlog` d
). We have, from Lemma 22,
ρab (`n+ r) ≥ dρab (n)− 2d+ 1.
As we increase by (approximately) a factor of ` in the argument, we must in-crease by at least (approximately) a factor of d in value. The only additionalthing we need to check is that dρab (n)−2d+1 > ρab (n). This holds as long asρab (n) > 2+ 1
d−1 . We note that 2+ 1d−1 ≤ 3 and that Lemma 21 implies that
ρab (n) ≤ 3 only finitely often. Therefore, dρab (n)− 2d+ 1 > ρab (n) for allbut finitely many n. Hence, we obtain nlog` d behavior for the lower bound,as required. Since ρab (n) is O
(nlog` d
)and Ω
(nlog` d
), it is Θ
(nlog` d
).
Note that some uniform morphisms have nontrivial factorizations. Hence,Theorem 7 gives a classification of the abelian complexities of some nonuni-form morphisms as well via Corollary 1. For example, (01, 00) = (01, 0) (0, 11) and (0, 11) (01, 0) = (011, 0). Let ϕ = (01, 00) and ψ = (011, 0).
42
Since ρabϕω(0) (n) = Θ (f (n)), ρabψω(0) (n) = Θ (f (n)) as well, though ψ is notuniform.
Referring to the fifth case of Theorem 7, we conjecture an Ω (log n) boundabelian complexity for all uniform binary morphisms with d = 1 and ∆ > 0.
Conjecture 1. Let ϕ be a uniform binary morphism with d = 1 and ∆ > 0.For all h ≥ 1 and n ≥ `h, ρab (n) ≥ ∆h+ 2.
It is possible that only a weaker version of this conjecture holds.
Conjecture 2. Let ϕ be a uniform binary morphism with d = 1 and ∆ > 0.For all h ≥ 1 and n ≥ `h, ρab (n) ≥ h+ 2.
Even this weaker version implies that if d = 1 and ∆ > 0, then ρab (n) =Θ (log n), as is believed.
The ∆ > 0 condition in the statement of Conjecture 2 is essential evenif we restrict n so that ` - n. For example, (00100101010, 10100101010) has` = 11, d = 1, ∆ = 0, and ρab (24) = ρab (31) = 2, though neither 24 nor 31is a multiple of 11.
We can show a Θ(log n) abelian complexity for the following uniformmorphism with d = 1 and ∆ > 0.
Proposition 6. If ϕ = (001, 110), then ρab (n) = Θ (log n).
Proof. For this morphism, d = 1 and ∆ = 1. Theorem 7 tells us thatρab (n) = O (log n). We now show that Conjecture 2 holds for this specificmorphism, thereby implying that ρab(n) = Ω (log n). The proof is by induc-tion on h. If h = 1, we have that ρab (n) ≥ 3 for all n ≥ 3. Now, assumethat ρab (n) ≥ m + 2 for all n ≥ 3m for some m. Let h = m + 1, and letn ≥ 3m. Lemma 15 says that ρab (3n) = ρab (n) + 2. Also, Proposition 1(9)says that
Problems to be considered in the future include: carry out worst and aver-age case running time analyses on the factorization algorithm, examine ad-ditional classes of morphisms, and attempt to extend some results to k > 2.Most of our results about abelian complexity are about binary words. Anotable exception is Theorem 4.
In general, if the alphabet size k is greater than 2, we lose the propertythat for an infinite word w,
∣∣ρabw (n+ 1)− ρabw (n)∣∣ ≤ 1. We also can no
longer reduce questions about abelian complexity to simply counting zeroes.In general, if w is an infinite word over a k-letter alphabet, Proposition 1(3)says that ρabw (n) = O
(nk−1
). If w is required to be the fixed point of a
morphism, we can give a better bound. Corollary 10.4.9 in [2] says thatif w is the fixed point of a morphism, then ρw (n) = O
(n2). Hence, by
Proposition 1(4), if w is the fixed point of a morphism, then ρabw (n) = O(n2),
no matter how large k is.Finally, we note that the truth value of Corollary 1 has not been exam-
ined in depth for alphabets of size greater than 2. Our proof of Theorem 3certainly depends on the alphabet size, but we have not yet seen a counterex-ample to it for a larger alphabet. Since binary morphisms can be factorizedover larger alphabets, the truth of Corollary 1 would allow us to classifythe abelian complexities of the fixed points of many morphisms with k > 2simply based on the results we have here for binary morphisms.
Acknowledgements
We thank the referees of a preliminary version of this paper as well as DavidWise from Carnegie Mellon University and Daniel Seita from Williams Col-lege for their valuable comments and suggestions.
References
[1] B. Adamczewski. Balances for fixed points of primitive substitutions.Theoretical Computer Science, 307:47–75, 2003.
[2] J.-P. Allouche and J. Shallit. Automatic Sequences: Theory, Applica-tions, Generalizations. Cambridge University Press, 2003.
44
[3] L. Balkova, K. Brinda, and O. Turek. Abelian complexity of infinitewords associated with quadratic Parry numbers. Theoret. Comput. Sci.,412:6252–6260, 2011.
[4] J. Berstel and P. Seebold. A characterization of Sturmian morphisms.In MFCS 1993, volume 711 of LNCS, pages 281–290, Berlin, 1993.Springer-Verlag.
[5] F. Blanchet-Sadri and N. Fox. On the asymptotic abelian complexityof morphic words. In M.-P. Beal and O. Carton, editors, DLT 2013,volume 7907 of LNCS, pages 94–105, Berlin, Heidelberg, 2013. Springer-Verlag.
[6] C. Choffrut and J. Karhumaki. Combinatorics of Words. In G. Rozen-berg and A. Salomaa, editors, Handbook of Formal Languages, vol-ume 1, chapter 6, pages 329–438. Springer-Verlag, Berlin, 1997.
[7] E. M. Coven and G. A. Hedlund. Sequences with minimal block growth.Math. Systems Theory, 7:138–153, 1973.
[8] J. Currie and N. Rampersad. Recurrent words with constant abeliancomplexity. Adv. Appl. Math., 47:116–124, 2011.
[9] A. Ehrenfeucht, K. P. Lee, and G. Rozenberg. Subword complexities ofvarious classes of deterministic developmental languages without inter-actions. Theoret. Comput. Sci., 1:59–75, 1975.
[10] A. Ehrenfeucht and G. Rozenberg. On the subword complexity of D0Llanguages with a constant distribution. Inform. Process. Lett., 13:108–113, 1981.
[11] A. Ehrenfeucht and G. Rozenberg. On the subword complexity ofsquare-free D0L languages. Theoret. Comput. Sci., 16:25–32, 1981.
[12] A. Ehrenfeucht and G. Rozenberg. On the subword complexity of locallycatenative D0L languages. Inform. Process. Lett., 16:121–124, 1983.
[13] A. E. Frid. The subword complexity of fixed points of binary uniformmorphisms. In FCT 1997, volume 1279 of LNCS, pages 179–187, Berlin,1997. Springer-Verlag.
[14] J.-J. Pansiot. Complexite des facteurs des mots infinis engendres parmorphismes iteres. In ICALP 1984, volume 172 of LNCS, pages 380–389, Berlin, 1984. Springer-Verlag.
45
[15] G. Richomme. Conjugacy of morphisms and Lyndon decomposition ofstandard Sturmian words. Theoret. Comput. Sci., 380:393–400, 2007.
[16] G. Richomme, K. Saari, and L. Q. Zamboni. Abelian complexity inminimal subshifts. J. London Math. Soc., 83:79–95, 2011.