Hidden automatic sequences

An automatic sequence is a letter-to-letter coding of a fixed point of a uniform morphism. More generally, we have morphic sequences, which are letter-to-letter codings of fixed points of arbitrary morphisms. There are many examples where an, a priori, morphic sequence with a \emph{non-uniform} morphism happens to be an automatic sequence. An example is the Lys\"enok morphism $a \to aca$, $b \to d$, $c \to b$, $d \to c$, the fixed point of which is also a 2-automatic sequence. Such an identification is useful for the description of the dynamical systems generated by the fixed point. We give several ways to uncover such hidden automatic sequences, and present many examples. We focus in particular on morphisms associated with Grigorchuk(-like) groups.

its letters are not rational. However, it is true that any q-automatic sequence (q ≥ 2) can be obtained as a non-uniformly morphic sequence, i.e., as the letter-to-letter image of an iterative fixed point of a non-uniform morphism [3,Theorem 5].
In Section 2 we will revisit a 1978 theorem of the second author to give a sufficient condition for a fixed point of a non-uniform morphism to be automatic. This is Theorem 1 below. Section 3 will show an interplay between this Theorem 1 and a result of [3] stating that any automatic sequence can also be obtained as the letter-to-letter image of the fixed point of a non-uniform morphism. In Section 4, using several sequences in the OEIS [31] as examples, we will show how to prove with this theorem (actually a particular case, the "Anagram Theorem") that these sequences, defined as fixed points of non-uniform morphisms, are automatic. We will recall the 2-automaticity of the fixed point of the Lysënok morphism in Section 5,and give several examples of sequences related to Grigorchuk groups and similar groups.

A general theorem revisited
Note that the vector of lengths of the Istrail morphism σ IS : (2, 3, 1) is a left eigenvector of the incidence matrix of the morphism. So Berstel's result also follows from [14, Section V, Theorem 1], as noted as an example in the same paper [14, Section IV, Example 8] 1 . Since this theorem is stated in [14] in the context of dynamical systems, we will give an equivalent reformulation in Theorem 1 below. Before stating the theorem, we need a lemma on nonnegative matrices, which does not use any resultà la Perron-Frobenius: see, e.g., the proof in [25,Corollary 8.1.30,p. 493].
Lemma 1 Let M be a matrix whose entries are all nonnegative. If v is an eigenvector of M with positive coordinates associated with a real eigenvalue λ, then λ is equal to the spectral radius of M.
We invite the reader to verify that the statement in this lemma is not true if v is only supposed to have nonnegative coordinates.
Let q be the constant length of the morphism τ ′ . We show in general why q is equal to the spectral radius of M . Let λ be the eigenvalue associated with the left eigenvector (L 0 , L 1 , . . . , L r−1 ), and let r ′ := L 0 + · · · + L r−1 . Then This implies that q has to be equal to λ. But, from Lemma 1 above, λ must be equal to the spectral radius of M .
The condition about the length vector given in Theorem 1 is not necessary. We will see in Section 5 an example of a sequence that is defined as the fixed point of a non-uniform morphism (the Lysënok morphism), that does not satisfy the length vector condition of Theorem 1, but that is 2-automatic.
For an alphabet of two letters we have the following obstruction for a morphism to satisfy the left eigenvector condition. 3 From k-automatic to non-uniformly morphic and back The paper [3] gives an algorithm to represent any k-automatic sequence with associated morphism γ as a morphic sequence, where the morphism γ ′ is non-uniform 2 . We call this algorithm the CUP-algorithm, standing for Create Unique Pair. The question arises: if we are given this non-uniform representation, how do we find the uniform representation? The answer lies, once more, directly in the left eigenvector criterium.
We first give an example. We start with a famous 2-automatic sequence: the Thue-Morse sequence. For technical reasons we do not take the Thue-Morse morphism 0 → 01, 1 → 10 as γ, but its cube. So let γ be the third power of the Thue-Morse morphism: We define morphisms γ ′ on an extended alphabet {0, 1, b ′ , c ′ }, where b ′ = 0 ′ will be projected on 0, and c ′ = 1 ′ will be projected on 1. Define the two non-empty words z and t as any concatenation which gives zt = γ(01) = 0110100110010110, As in [3] it is easy to see that the infinite fixed point of γ ′ starting with 0 maps to the Thue-Morse sequence under the projection D given by The incidence matrix of these morphisms is where m 0 is the number of 0's in z, and m 1 is the number of 1's in z.
be the length vector of γ ′ . Then the following holds for any choice of z and t: This is exactly the left eigenvector criterium of Theorem 1. The general result is the following theorem.
Theorem 2 Let x be a k-automatic sequence, and let γ ′ be the non-uniform morphism turning x into a (non-uniformly) morphic sequence in the CUP algorithm. Then the incidence matrix of γ ′ satisfies the left eigenvector criterium.
Proof. Let γ be the uniform morphism of length k on the alphabet {0, 1, . . . , r − 1} such that x is a letterto-letter projection of a fixed point y of γ. It is easy to see that, as in the proof in [3], we may suppose that y = x. Let L = (k, k, . . . , k) be the length vector of γ, and let M be the incidence matrix of γ. Note that M satisfies the eigenvector criterium: LM = kL. Without loss of generality we assume that b = 0, and c = 1 are the two letters which give two extra letters b ′ = r and c ′ = r + 1 in the CUP algorithm. Let m 0 be the number of 0's in z, and m 1 the number of 1's in z, of the CUP splitting γ(01) = zt. Then the length vector The first column of M ′ is equal to The inner product of the length vector L ′ with this first column is equal to Obviously the inner product of L ′ with the second till r th column is also equal to k 2 . The inner product of the length vector L ′ with the (r + 1) th column is equal to The inner product of the length vector L ′ with the (r + 2) th column is equal to This finishes the checking of the left eigenvector criterium L ′ M ′ = kL ′ .

First examples of hidden automatic sequences
We start this section with the following Anagram Theorem, which is actually a particular case of Theorem 1. The interest of this simpler theorem is that it permits to prove that some fixed points of non-uniform morphisms are automatic in a purely "visual" (but rigorous) way. More examples like sequence A285249 are collected in the following corollary to Theorem 3.

Corollary 1
The following automaticity properties for sequences in the OEIS hold.
• The four sequences A284878, A284905, A285305, and A284912 are generated by morphisms f , where f (0) and f (1) can be written as concatenations of one, respectively two of the two words w = 01 and w ′ = 10. So Theorem 3 immediately implies that they are all 3-automatic.
• The sequences A285252, A285255 and A285258, are fixed points of squares of such morphisms, and so they are 9-automatic (hence 3-automatic).
• Finally the fact that A284878, is 3-automatic easily implies that A284881 is 3-automatic.
Remark 1 Other sequences in the OEIS that do not satisfy the hypotheses of Theorem 3 can be proved automatic because they satisfy the hypotheses of Theorem 1: for example the sequences A285159 and A285162 (replace the morphism given in the OEIS by its square to obtain these two sequences as fixed points of morphisms), A285345, A284775 and A284935 are 3-automatic. and of the remark that τ • ψ = ψ • ψ, which easily implies that τ and ψ have the same fixed point beginning with a. A similar proof was given in [20].

Hidden automatic sequences and self-similar groups
Another proof (essentially the one in [21] and [5]) introduces a non-overlapping-2-block morphism (i.e., a morphism that, starting from a sequence u 0 , u 1 , u 2 , u 3 . . ., yields a sequence on the new "letters" u 0 u 1 , u 2 u 3 , ...), namely the substitution (coding ab = 1, ac = 2, ad = 3) from which we see immediately that the Lysënok fixed point is also generated by a substitution of constant length 2.
We may ask whether this second approach works in other "similar" situations, i.e., for morphisms related to Grigorchuk or "Grigorchuk-like groups". Before we address this question, it is worthwhile to give a general result on automatic sequences in terms of "non-overlapping-k-block morphisms".
Theorem 4 Let q ≥ 2 and let u = (u(n)) n≥0 be a sequence with values in A. Then, u is q-automatic if and only if there exist a positive integer r and a q-uniform morphism µ on A q r such that the sequence of q r -blocks obtained by grouping in u the terms q r at a time (namely the sequence (u(q r n), u(q r n + 1), . . . u(q r n + q r − 1)) n≥0 ) is a fixed point of µ.
Theorem 4 is indeed illustrated by the Lysënok fixed point, and by the following example (which, contrary to the Lysënok morphism, is primitive).
Then the iterative fixed fixed point of σ beginning with a is 4-automatic (hence 2-automatic).
The fact that σ [2] has constant length 4 implies that x is a 4-automatic sequence, hence a 2-automatic sequence.
Another general result will prove useful.
Proposition 2 If the incidence matrix of a primitive non-uniform morphism has an irrational dominant eigenvalue, then an iterative fixed point of this morphism cannot be automatic.
Proof. Since the morphism is primitive, the frequency of each letter exists, and the vector of frequencies is the unique normalized eigenvector of the matrix for the dominant eigenvalue. If the sequence were automatic, all the frequencies of letters would be rational, which gives a contradiction with the irrationality of the eigenvalue and the fact that the entries of the matrix are integers.
We deduce the following corollary.

Corollary 3
We can give the nature (i.e., whether they are automatic or not automatic) of the following fixed points of morphisms related to Girgorchuk-like groups.
• The fixed point of the morphism a → aba, b → d, c → b, d → c (see, e.g., [8,Proposition 5.6]) is 2-automatic (with the same proof as for the fixed point of the Lysënok morphism).
• The morphism a → b, b → c, c → aba (see, [22,Theorem 3.1], also see [29, p. 40]) has the property that its cube has a fixed point. This fixed point is not automatic since the frequencies of letters exist and are irrational.
• The morphism a → c, b → aba, c → b (see, e.g., [29, p. 46]) has the property that its cube has three fixed points. None of them is automatic. (Namely, the characteristic polynomial of the -primitiveincidence matrix is equal to x 3 − 7x 2 + 12x − 8, which has no rational root.) We end this section with a theorem which will apply to two morphisms related to other Grigorchuk-like groups (see our Corollary 5 below).
Theorem 5 Let x = (x n ) n≥0 be a sequence on some alphabet A. Let A ′ be a proper subset of A. Suppose that there exists a sequence y = (y n ) n≥0 on A ′ with the property that each of its prefixes is a factor of x. Let d ≥ 2. If no sequence in the closed orbit of y under the shift is d-automatic, then x is not d-automatic.
Proof. Define an order on A such that each element of A \ A ′ is larger than each element of A. The set of sequences on A is equipped with the lexicographical order induced by the order on A. Let z = (z n ) n≥0 be the lexicographically least sequence in the orbit closure of x. Since the sequence y has its values in A ′ and since each prefix of y is a factor of x, the orbit closure of y under the shift is included in the orbit closure of x. Now, since the elements of A \ A ′ are larger than the elements of A ′ , the least element of the orbit closure of y is equal to the least element of the orbit closure of x, i.e., is equal to z. Now, if x were d-automatic for some d ≥ 2, then z would be d-automatic [4,Theorem 6], which contradicts the hypothesis on the orbit of y.
Corollary 4 Let Let x = (x n ) n≥0 be a sequence on some alphabet A. Let A ′ be a proper subset of A. Suppose that there exists a sequence y = (y n ) n≥1 on A ′ with the property that each of its prefixes is a factor of x. Suppose that y is Sturmian, or that y is uniformly recurrent 3 and that its complexity is not O(n), then x is not d-automatic for any d ≥ 2.
Proof. If y is Sturmian, all sequences in its orbit closure are Sturmian (they have complexity n + 1), hence cannot be d-automatic. If y is uniformly recurrent, all the sequences in its orbit closure have the same complexity -which is not O(n)-and thus none of them can be d-automatic.
We are ready for our last corollary about the two fixed points of morphisms respectively given in [10,Theorem 2.9] and [6,Theorem 4.5].
Corollary 5 The fixed point beginning with a of the morphism a → aca, b → bc, c → b is not automatic. The fixed point beginning with a of the morphism a → aca, c → cd, d → c is not automatic.
Proof. Note that the fixed point of the morphism b → bc, c → b (respectively c → cd, d → c) is a Sturmian sequence and apply Corollary 4 above.

Final remarks
For more on the Grigorchuk group or similar groups, the reader can also consult, e.g., [24,19,18,27,23]. Note that automata groups appear to be close to morphic or automatic sequences, while automatic groups (see, e.g., [17]) seem to be rather away from these sequences. Note that substitutions can also be used, in a different context, to characterize families of groups: for example it is proved in [12] that a finite group is an extension of a nilpotent group by a 2-group if and only if it satisfies a Thue-Morse identity for all elements x, y, where the nth Thue-Morse identity between x and y is defined by ϕ n x,y (x) = ϕ n x,y (y) for every n ≥ 0, and the Thue-Morse substitution ϕ x,y is defined by ϕ x,y (x) := xy and ϕ x,y (y) := yx.