1 Introduction

Kalle Saari showed in [5, 6] that every Sturmian word contains exactly six minimal squares (that is, squares having no proper square prefixes) and that each position of a Sturmian word begins with a minimal square. Thus a Sturmian word \(\mathbf {s}\) can be expressed as a product of minimal squares: \(\mathbf {s} = X_1^2 X_2^2 X_3^2 \cdots \). In our earlier work [3], see also [2], we defined the square root \(\sqrt{\mathbf {s}}\) of the word \(\mathbf {s}\) to be the infinite word \(X_1 X_2 X_3 \cdots \) obtained by deleting half of each square \(X_i^2\). We proved that the words \(\mathbf {s}\) and \(\sqrt{\mathbf {s}}\) have the same language, that is, the square root map preserves the languages of Sturmian words. More precisely, we showed that if \(\mathbf {s}\) has slope \(\alpha \) and intercept \(\rho \), then \(\sqrt{\mathbf {s}}\) has intercept \(\psi (\rho )\), where \(\psi (\rho ) = \frac{1}{2} (\rho + 1 - \alpha )\). The simple form of the function \(\psi \) immediately describes the dynamics of the square root map in the subshift \(\varOmega _\alpha \) of Sturmian words of slope \(\alpha \): all words in \(\varOmega _\alpha \) are attracted to the set \(\{01\mathbf {c}_\alpha , 10\mathbf {c}_\alpha \}\) of words of intercept \(1-\alpha \); here \(\mathbf {c}_\alpha \) is the standard Sturmian word of slope \(\alpha \).

The square root map makes sense for any word expressible as a product of squares. Saari defines in [6] an intriguing class of such infinite words which he calls optimal squareful words. Optimal squareful words are aperiodic infinite words containing the least number of minimal squares such that every position begins with a square. It turns out that such a word must be binary, and it must contain exactly six minimal squares; less than six minimal squares forces the word to be ultimately periodic. Moreover, the six minimal squares must be the minimal squares of some Sturmian language; the set of optimal squareful words is however larger than the set of Sturmian words. The six minimal squares of an optimal squareful word take the following form for some integers \(\mathfrak {a}\) and \(\mathfrak {b}\) such that \(\mathfrak {a}\ge 1\) and \(\mathfrak {b}\ge 0\):

$$\begin{aligned}&0^2, \qquad \qquad \quad \,\, (10^\mathfrak {a})^2, \quad \\&(010^{\mathfrak {a}-1})^2, \qquad (10^{\mathfrak {a}+1}(10^\mathfrak {a})^\mathfrak {b})^2, \qquad \\&(010^\mathfrak {a})^2, \qquad \quad (10^{\mathfrak {a}+1}(10^\mathfrak {a})^{\mathfrak {b}+1})^2. \end{aligned}$$

It is natural to ask if there are non-Sturmian optimal squareful words whose languages the square root map preserves. In [3], we proved by an explicit construction that such words indeed exist. The construction is as follows. The substitution

$$\begin{aligned} \tau :\begin{array}{l} S \mapsto LSS \\ L \mapsto SSS \end{array} \end{aligned}$$

produces two infinite words \(\varvec{\varGamma } _1^* = SSSLSSLSS \cdots \) and \(\varvec{\varGamma } _2^* = LSSLSSLSS \cdots \) having the same language \(\mathcal {L}\). Let \(\widetilde{s}\) be a (long enough) reversed standard word in some Sturmian language and \(L(\widetilde{s})\) be the word obtained from \(\widetilde{s}\) by exchanging its first two letters. By substituting the language \(\mathcal {L}\) by the substitution \(\sigma \) mapping the letters S and L respectively to \(\widetilde{s}\) and \(L(\widetilde{s})\), we obtain a subshift \(\varOmega \) consisting of optimal squareful words. We proved that the words \(\varvec{\varGamma } _1\) and \(\varvec{\varGamma } _2\), the \(\sigma \)-images of \(\varvec{\varGamma } _1^*\) and \(\varvec{\varGamma } _2^*\), are fixed by the square root map and, more generally, either \(\sqrt{\mathbf {w}} \in \varOmega \) or \(\sqrt{\mathbf {w}}\) is periodic for all \(\mathbf {w} \in \varOmega \).

The aim of this paper is to study the dynamics of the square root map in the subshift \(\varOmega \) in the slightly generalized case where \(\tau (S) = LS^{2\mathfrak {c}}\) and \(\tau (L) = S^{2\mathfrak {c}+1}\) for some positive integer \(\mathfrak {c}\) and to see in which ways the dynamics differ from the Sturmian case. Our main results are the characterization of periodic and asymptotically periodic points and the limit set. We show that asymptotically periodic points must be ultimately periodic points and that periodic points must be fixed points; there are only two fixed points: \(\varvec{\varGamma } _1\) and \(\varvec{\varGamma } _2\). We prove that any word in \(\varOmega \) that is not an infinite product of the words \(\sigma (S)\) and \(\sigma (L)\) must eventually be mapped to a periodic word, thus having a finite orbit, while products of the words \(\sigma (S)\) and \(\sigma (L)\) are always mapped to aperiodic words. It follows from our results that the limit set of the square root map contains exactly the words that are products of \(\sigma (S)\) and \(\sigma (L)\). In addition, we study the injectivity of the square root map on \(\varOmega \): only certain left extensions of the words \(\varvec{\varGamma } _1\) and \(\varvec{\varGamma } _2\) may have more than one preimage.

Let us make a brief comparison with the Sturmian case to see that the obtained results indicate that the square root map behaves somewhat differently on \(\varOmega \). The mapping \(\psi \), defined above, is injective, so in the Sturmian case all words have at most one preimage. As \(\psi \) maps points strictly towards the point \(1-\alpha \) on the circle, all points are asymptotically periodic (see Definition 17) and all periodic points are fixed points. The fixed points are the two words \(01\mathbf {c}_\alpha \) and \(10\mathbf {c}_\alpha \) mentioned above, and the limit set consists only of these two fixed points.

The paper is organized as follows. The following section gives needed results on Sturmian words and standard words and it describes the construction of the subshift \(\varOmega \) in full detail. In Sect. 3, we proceed to characterize the limit set and to study injectivity. Section 4 contains results on periodic points.

2 Notation and Preliminary Results

Due to space constraints we refer the reader to [1] for basic notation, results on words, and for basic concepts such as prefix, suffix, factor, language, primitive word, conjugate, ultimately periodic word, aperiodic word, and subshift. We distinguish finite words from infinite words by writing the symbols referring to infinite words in boldface.

If w is a word such that \(w = u^2\), then we call w a square with square root u. A square is minimal if it does not have a square as a proper prefix. If w is a word, then by L(w) we denote the word obtained from w by exchanging its first two letters (we will not apply L to too short words). The language of a subshift \(\varOmega \) is denoted by \(\mathcal {L}_{}(\varOmega )\), and the shift operator on infinite words is denoted by T. We index words from 0. We write \(u \lhd v\) if the word u is lexicographically less than v. For binary words over \(\{0,1\}\), we set \(0 \lhd 1\).

2.1 Sturmian Words and Standard Words

Several proofs in [3] regarding Sturmian words and the square root map require knowledge on continued fractions. In this paper, only some familiarity with continued fractions is required. We only recall that every irrational real number \(\alpha \) has a unique infinite continued fraction expansion:

$$\begin{aligned} \alpha = [a_0; a_1, a_2, a_3, \ldots ] = a_0 + \dfrac{1}{a_1 + \dfrac{1}{a_2 + \dfrac{1}{a_3 + \ldots }}} \end{aligned}$$
(1)

with \(a_0 \in \mathbb {Z}\) and \(a_k \in \mathbb {Z}_+\) for \(k \ge 1\). The numbers \(a_i\) are called the partial quotients of \(\alpha \). An introduction to continued fractions in relation to Sturmian words can be found in [2, Chap. 4].

We view here Sturmian words as the infinite words obtained as codings of orbits of points in an irrational circle rotation with two intervals. For alternative definitions and further details, see [1, 4]. We identify the unit interval [0, 1) with the unit circle \(\mathbb {T}\). Let \(\alpha \) in (0, 1) be irrational. The map \(R:\mathbb {T}\rightarrow \mathbb {T}, \, \rho \mapsto \{\rho + \alpha \}\), where \(\{\rho \}\) stands for the fractional part of the number \(\rho \), defines a rotation on \(\mathbb {T}\). Divide the circle \(\mathbb {T}\) into two intervals \(I_0\) and \(I_1\) defined by the points 0 and \(1-\alpha \). Then define the coding function \(\nu \) by setting \(\nu (\rho ) = 0\) if \(\rho \in I_0\) and \(\nu (\rho ) = 1\) if \(\rho \in I_1\). The coding of the orbit of a point \(\rho \) is the infinite word \(\mathbf {s}_{\rho ,\alpha }\) obtained by setting its \(n^\text {th}, n \ge 0,\) letter to equal \(\nu (R^n(\rho ))\). This word \(\mathbf {s}_{\rho ,\alpha }\) is defined to be the Sturmian word of slope \(\alpha \) and intercept \(\rho \). To make the definition proper, we need to define how \(\nu \) behaves in the endpoints 0 and \(1-\alpha \). We have two options: either take \(I_0 = [0,1-\alpha )\) and \(I_1 = [1-\alpha ,1)\) or \(I_0 = (0,1-\alpha ]\) and \(I_1 = (1-\alpha ,1]\). The difference is seen in the codings of the orbits of the points \(\{-n\alpha \}\). This choice is largely irrelevant in this paper with the exception of the definition of the mapping \(\psi \) in the next subsection. The only difference between Sturmian words of slope \([0;1,a_2,a_3,\ldots ]\) and Sturmian words of slope \([0;a_2+1,a_3,\ldots ]\) is that the roles of the letters 0 and 1 are reversed. We make the typical assumption that \(a_1 \ge 2\) in (1). Since the sequence \((\{n\alpha \})_{n\ge 0}\) is dense in [0, 1)—as is well-known—Sturmian words of slope \(\alpha \) have a common language (that is, the set of factors) denoted by \(\mathcal {L}_{}(\alpha )\). The Sturmian words of slope \(\alpha \) form the Sturmian subshift \(\varOmega _\alpha \), which is minimal and aperiodic.

Let \((d_k)\) be a sequence of positive integers. Corresponding to \((d_k)\), we define a sequence \((s_k)\) of standard words by the recurrence

$$\begin{aligned} s_k = s_{k-1}^{d_k} s_{k-2} \end{aligned}$$

with initial values \(s_{-1} = 1\), \(s_0 = 0\). The sequence \((s_k)\) converges to an infinite word \(\mathbf {c}_\alpha \), which is a Sturmian word of intercept \(\alpha \) and slope \(\alpha \), where \(\alpha \) is an irrational with continued fraction expansion \([0;d_1+1,d_2,d_3,\ldots ]\). Thus standard words related to the sequence \((d_k)\) are called standard words of slope \(\alpha \). The standard words are the basic building blocks of Sturmian words, and they have rich and surprising properties. For this paper, we only need to know that standard words are primitive and that the final two letters of a (long enough) standard word are different. Actually, in connection to the square root map, it is more natural to consider reversed standard words obtained by writing standard words from right to left. If s is a standard word in \(\mathcal {L}_{}(\alpha )\), then also the reversed standard word \(\widetilde{s}\) is in \(\mathcal {L}_{}(\alpha )\) because \(\mathcal {L}_{}(\alpha )\) is closed under reversal. For more on standard words, see [1, Chap. 2.2].

2.2 Optimal Squareful Words and the Square Root Map

An infinite word is squareful if its every position begins with a square. An infinite word is optimal squareful if it is aperiodic and squareful and it contains the least possible number of distinct minimal squares. In [6], Kalle Saari proves that optimal squareful words contain six distinct minimal squares; a squareful word containing at most five minimal squares is necessarily ultimately periodic. Moreover, Saari shows that optimal squareful words are binary and that the six minimal squares are of very restricted form. The square roots of the six minimal squares of an optimal squareful word are

$$\begin{aligned}&S_1 = 0, \qquad \quad \,\,\, S_4 = 10^\mathfrak {a}, \nonumber \\&S_2 = 010^{\mathfrak {a}-1}, \quad S_5 = 10^{\mathfrak {a}+1}(10^\mathfrak {a})^\mathfrak {b}, \\&S_3 = 010^\mathfrak {a}, \qquad S_6 = 10^{\mathfrak {a}+1}(10^\mathfrak {a})^{\mathfrak {b}+1}, \nonumber \end{aligned}$$
(2)

for some integers \(\mathfrak {a}\) and \(\mathfrak {b}\) such that \(\mathfrak {a}\ge 1\) and \(\mathfrak {b}\ge 0\). We call an optimal squareful word containing the minimal square roots of (2) an optimal squareful word with parameters \(\mathfrak {a}\) and \(\mathfrak {b}\). Throughout this paper, we reserve this meaning for the fraktur letters \(\mathfrak {a}\) and \(\mathfrak {b}\). Furthermore, we agree that the symbols \(S_i\) always refer to the minimal square roots of (2).

Let \(\mathbf {s}\) be an optimal squareful word and write it as a product of minimal squares: \(\mathbf {s} = X_1^2 X_2^2 \cdots \) (such a product is unique). The square root \(\sqrt{\mathbf {s}}\) of \(\mathbf {s}\) is the word \(X_1 X_2 \cdots \) obtained by deleting half of each minimal square \(X_i^2\). We reserve the notation \(\root n \of {\mathbf {s}}\) for the \(n^\text {th}\) square root of \(\mathbf {s}\). We chose this notation for its simplicity; the \(n^\text {th}\) square root of a number x would typically be denoted by \(\root 2^n \of {x}\). We often consider square roots of finite words. We let \(\varPi (\mathfrak {a},\mathfrak {b})\) to be the language of all nonempty words w such that w is a factor of some optimal squareful word with parameters \(\mathfrak {a}\) and \(\mathfrak {b}\) and w is factorizable as a product of minimal squares (2). Let \(w \in \varPi (\mathfrak {a},\mathfrak {b})\), that is, \(w = X_1^2 \cdots X_n^2\) for minimal square roots \(X_i\). Then we can define the square root \(\sqrt{w}\) of w by setting \(\sqrt{w} = X_1 \cdots X_n\). The square root map (on infinite words) is continuous with respect to the usual topology on infinite words (see [1, Sect. 1.2.2]). The following lemma, used later, sharpens this observation.

Lemma 1

Let \(\mathbf {u}\) and \(\mathbf {v}\) be two optimal squareful words with the same parameters \(\mathfrak {a}\) and \(\mathfrak {b}\). If \(\mathbf {u}\) and \(\mathbf {v}\) have a common prefix of length \(\ell \), then \(\sqrt{\mathbf {u}}\) and \(\sqrt{\mathbf {v}}\) have a common prefix of length \(\lceil \ell /2 \rceil \).

Proof

Say \(\mathbf {u}\) and \(\mathbf {v}\) have a nonempty common prefix w. We may suppose that \(w \notin \varPi (\mathfrak {a},\mathfrak {b})\) as otherwise the claim is clear. Let z be the longest prefix of w that is in \(\varPi (\mathfrak {a},\mathfrak {b}) \cup \{\varepsilon \}\), and let \(X^2\) and \(Y^2\) respectively be the minimal square prefixes of the words \(T^{|z|}(\mathbf {u})\) and \(T^{|z|}(\mathbf {v})\). Hence \(\sqrt{\mathbf {u}}\) begins with \(\sqrt{z}X\) and \(\sqrt{\mathbf {v}}\) begins with \(\sqrt{z}Y\). Since X and Y begin with the same letter, it is easy to see that either X is a prefix of Y or Y is a prefix of X. By symmetry, we suppose that X is a prefix of Y. It follows that \(\sqrt{\mathbf {u}}\) and \(\sqrt{\mathbf {v}}\) have a common prefix of length \(|zX^2|/2\). By the maximality of z, we have \(|zX^2| > |w|\) proving that \(\sqrt{\mathbf {u}}\) and \(\sqrt{\mathbf {v}}\) have a common prefix of length \(\lceil |w|/2 \rceil \).    \(\square \)

Sturmian words are a proper subset of optimal squareful words. If \(\mathbf {s}\) is a Sturmian word of slope \(\alpha \) having continued fraction expansion as in (1), then it is an optimal squareful word with parameters \(\mathfrak {a}= a_1 - 1\) and \(\mathfrak {b}= a_2 - 1\). The square root map is especially interesting for Sturmian words because it preserves their languages. Define a function \(\psi :\mathbb {T}\rightarrow \mathbb {T}\) as follows. For \(\rho \in (0,1)\), we set

$$\begin{aligned} \psi (\rho ) = \frac{1}{2} (\rho +1-\alpha ), \end{aligned}$$

and we set

$$\begin{aligned} \psi (0) = {\left\{ \begin{array}{ll} \frac{1}{2} (1-\alpha ), &{}\text {if} \, 0 \in I_0, \\ 1-\frac{\alpha }{2}, &{}\text {if} \, 0 \notin I_0. \end{array}\right. } \end{aligned}$$

The mapping \(\psi \) moves a point \(\rho \) on \(\mathbb {T}\) towards the point \(1-\alpha \) by halving the distance between the points \(\rho \) and \(1-\alpha \). The distance to \(1-\alpha \) is measured in the interval \(I_0\) or \(I_1\) depending on which of these intervals the point \(\rho \) belongs to. In [3], we proved the following result relating the intercepts of a Sturmian word and its square root.

Theorem 2

Let \(\mathbf {s}_{\rho ,\alpha }\) be a Sturmian word of slope \(\alpha \). Then \(\sqrt{\mathbf {s}_{\rho ,\alpha }} = \mathbf {s}_{\psi (\rho ),\alpha }\).

Specific solutions to the word equation

$$\begin{aligned} X_1^2 X_2^2 \cdots X_n^2 = (X_1 X_2 \cdots X_n)^2 \end{aligned}$$
(3)

in the Sturmian language \(\mathcal {L}_{}(\alpha )\) play an important role. We are interested only in the solutions of (3) where all words \(X_i\) are minimal square roots (2), i.e., primitive roots of minimal squares. Thus we give the following definition.

Definition 3

A nonempty word w is a solution to (3) if w can be written as a product of minimal square roots \(w = X_1 X_2 \cdots X_n\) which satisfy the word equation (3). The solution is primitive if w is primitive.

Consider for example the word \(S_2 S_1 S_4\) for \(\mathfrak {a}= 1\) and \(\mathfrak {b}= 0\). We have

$$\begin{aligned} (S_2 S_1 S_4)^2 = (01 \cdot 0 \cdot 10)^2 = 01010 \cdot 01010 = (01)^2 \cdot 0^2 \cdot (10)^2 = S_2^2 S_1^2 S_4^2, \end{aligned}$$

so the word \(S_2 S_1 S_4\) is a solution to (3).

In [3, Theorem 5.2], the following result was proved.

Theorem 4

If \(\widetilde{s}\) is a reversed standard word, then the words \(\widetilde{s}\) and \(L(\widetilde{s})\) are primitive solutions to (3).

Solutions to (3) are important as they can be used to build fixed points of the square root map. If \((u_k)\) is a sequence of solutions to (3) with the property that \(u_k^2\) is a proper prefix of \(u_{k+1}\) for \(k \ge 1\), then the infinite word \(\mathbf {w}\) obtained as the limit \(\lim _{k\rightarrow \infty } u_k\) has arbitrarily long prefixes \(X_1^2 \cdots X_n^2\) with the property that \(X_1 \cdots X_n\) is a prefix of \(\mathbf {w}\). In other words, the word \(\mathbf {w}\) is a fixed point of the square root map. All known constructions of fixed points rely on this method. For example, the two Sturmian words \(01\mathbf {c}_\alpha \) and \(10\mathbf {c}_\alpha \) of slope \(\alpha \) and intercept \(1-\alpha \) both have arbitrarily long squares \(u^2\) as prefixes, where \(u = L(\widetilde{s})\) for a reversed standard word \(\widetilde{s}\) [3, Proposition 6.3]. In the next subsection, we see that the dynamical system studied in this paper is also fundamentally linked to fixed points obtained from solutions of (3).

The following lemma [3, Lemma 5.5] is of technical nature, but it conveys an important message: under the assumptions of the lemma, swapping two adjacent and distinct letters that do not occur as a prefix of a minimal square affects a product of minimal squares only locally and does not change its square root. This establishes the often-used fact that \(\widetilde{s}\widetilde{s}\) and \(\widetilde{s} L(\widetilde{s})\) are both in \(\varPi (\mathfrak {a},\mathfrak {b})\) and have the same square root for a reversed standard word \(\widetilde{s}\). For example, if \(\widetilde{s} = 1001001010010\), then

$$\begin{aligned} \widetilde{s}\widetilde{s}&= 1001001010 \cdot 0101 \cdot 00 \cdot 1001010010 \quad \text {and} \\ \widetilde{s}L(\widetilde{s})&= 1001001010 \cdot 010010 \cdot 1001010010, \end{aligned}$$

so the change is indeed local and does not affect the square root. Notice that every long enough standard word has \(S_6\) as a proper suffix.

Lemma 5

Let u and v be words such that

  • u is a nonempty suffix of \(S_6\),

  • \(|v| \ge |S_5 S_6|\),

  • v begins with xy for distinct letters x and y,

  • uv and L(v) are factors of some optimal squareful words with the same parameters.

Suppose there exists a minimal square \(X^2\) such that \(|X^2| > |u|\) and \(X^2\) is a prefix of uv or uL(v). Then there exist minimal squares \(Y_1^2\), \(\ldots \), \(Y_n^2\) such that \(X^2\) and \(Y_1^2 \cdots Y_n^2\) are prefixes of uv and uL(v) of the same length and \(X = Y_1 \cdots Y_n\).

2.3 The Subshift \(\varOmega \)

In this subsection, we define the main object of study of this paper. The results presented were obtained in [3] in the case \(\mathfrak {c}= 1\), the generalization being straightforward.

Let \(\mathfrak {c}\) be a fixed positive integer. Repeated application of the substitution

$$\begin{aligned} \tau :\begin{array}{l} S \mapsto LS^{2\mathfrak {c}} \\ L \mapsto S^{2\mathfrak {c}+1} \end{array} \end{aligned}$$

to the letter S produces two infinite words

$$\begin{aligned} \varvec{\varGamma } _1^*&= SS^{2\mathfrak {c}} (LS^{2\mathfrak {c}})^{2\mathfrak {c}} (S^{2\mathfrak {c}+1} (LS^{2\mathfrak {c}})^{2\mathfrak {c}} )^{2\mathfrak {c}} \cdots \text { and} \\ \varvec{\varGamma } _2^*&= LS^{2\mathfrak {c}} (LS^{2\mathfrak {c}})^{2\mathfrak {c}} (S^{2\mathfrak {c}+1} (LS^{2\mathfrak {c}})^{2\mathfrak {c}} )^{2\mathfrak {c}} \cdots \end{aligned}$$

with the same language \(\mathcal {L}\). We set \(\varOmega ^*\) to be the minimal and aperiodic subshift with language \(\mathcal {L}\).

Fix integers \(\mathfrak {a}\) and \(\mathfrak {b}\) such that \(\mathfrak {a}\ge 1\) and \(\mathfrak {b}\ge 0\), and let \(\alpha \) be an irrational with continued fraction expansion \([0;\mathfrak {a}+1,\mathfrak {b}+1,\ldots ]\). Let w to be a word such that \(w \in \{\widetilde{s}_k, L(\widetilde{s}_k)\}\) where \(\widetilde{s}_k\) is a reversed standard word of slope \(\alpha \) such that \(|\widetilde{s}_k| > |S_6|\).Footnote 1 Let then \(\sigma \) be the substitution mapping S to w and L to L(w). By substituting the letters S and L in words of \(\varOmega ^*\), we obtain a new minimal and aperiodic subshift \(\sigma (\varOmega ^*)\), which we denote by \(\varOmega _A\). We also set \(\varvec{\varGamma } _1 = \sigma (\varvec{\varGamma } _1^*)\) and \(\varvec{\varGamma } _2 = \sigma (\varvec{\varGamma } _2^*)\). The subshift \(\varOmega _A\) is generated by both of the words \(\varvec{\varGamma } _1\) and \(\varvec{\varGamma } _2\). The words \(\varvec{\varGamma } _1\) and \(\varvec{\varGamma } _2\) differ only by their first two letters. This difference is often irrelevant to us, so we let \(\varvec{\varGamma } \) to stand for either of these words. Further, we let the symbol \(\gamma _k\) to stand for the word \(\sigma (\tau ^k(S))\) and \(\overline{\gamma }_k \) to stand for \(\sigma (\tau ^k(L))\).

It is easy to see that \(\varvec{\varGamma } _1 = \lim _{k\rightarrow \infty } \gamma _{2k}\) and \(\varvec{\varGamma } _2 = \lim _{k\rightarrow \infty } \overline{\gamma }_{2k} \). In what follows, we often consider infinite products of \(\gamma _k\) and \(\overline{\gamma }_k \), and we wish to argue independently of the index k. Hence we make a convention that \(\gamma \) and \(\overline{\gamma } \) respectively stand for \(\gamma _k\) and \(\overline{\gamma }_k \) for some \(k \ge 0\). The words \(\gamma \) and \(\overline{\gamma } \) are primitive; see [3, Lemma 8.2]. For simplification, we abuse notation and write S for \(\gamma _0\) and L for \(\overline{\gamma }_0 \). It will always be clear from context if letters S and L or words S and L are meant.

It can be shown that the words of \(\varOmega _A\) are optimal squareful words with parameters \(\mathfrak {a}\) and \(\mathfrak {b}\); see [3, Lemma 8.3]. Therefore the square root map is defined for words in \(\varOmega _A\). The square root map on \(\varOmega _A\) has the following crucial properties.

Lemma 6

The following properties hold:

  • \(\sqrt{\gamma \gamma } = \gamma \),

  • \(\sqrt{\gamma \overline{\gamma } } = \gamma \),

  • \(\sqrt{\overline{\gamma } \gamma } = \overline{\gamma } \), and

  • \(\sqrt{\overline{\gamma } \overline{\gamma } } = \overline{\gamma } \).

Proof

The proof of [3, Proposition 8.1] works essentially as it is.    \(\square \)

Lemma 6 shows that the words \(\varvec{\varGamma } _1\) and \(\varvec{\varGamma } _2\) are fixed points of the square root map. Namely, the word \(\gamma _{k+2}\) has \(\gamma _k^2\) as a prefix and \(\overline{\gamma }_{k+2} \) has \(\overline{\gamma }_k ^2\) as a prefix. Thus by Lemma 6, we have, e.g.,

$$\begin{aligned} \sqrt{\varvec{\varGamma } _1} = \sqrt{\lim _{k\rightarrow \infty } \gamma _{2k}^2} = \lim _{k\rightarrow \infty } \gamma _{2k} = \varvec{\varGamma } _1. \end{aligned}$$

The words in \(\varOmega _A\) can be (uniquely) written as a product of the words S and L up to a shift. Consider a word \(\mathbf {w}\) in \(\varOmega _A\) and write \(\mathbf {w} = T^\ell ({\mathbf {w'}})\) for some \(\mathbf {w'} \in \varOmega _A \cap \{S, L\}^\omega \) and \(\ell \) such that \(0 \le \ell < |S|\). There are four distinct possibilities (types):

  1. (A)

    \(\ell = 0\),

  2. (B)

    \(\ell > 0\) and the prefix of \(\mathbf {w}\) of length \(|S|-\ell \) is in \(\varPi (\mathfrak {a},\mathfrak {b})\),

  3. (C)

    \(\ell > 0\) and the prefix of \(\mathbf {w}\) of length \(2|S|-\ell \) is in \(\varPi (\mathfrak {a},\mathfrak {b})\), or

  4. (D)

    none of the above applies.

These possibilities are mutually exclusive: cases (B) and (C) cannot simultaneously apply because \(S, L \notin \varPi (\mathfrak {a},\mathfrak {b})\).Footnote 2 In our earlier paper, we proved the following theorem, see [3, Theorem 8.7].Footnote 3

Theorem 7

Let \(\mathbf {w} \in \varOmega _A\). If \(\mathbf {w}\) is of type (A),(B), or (C), then \(\sqrt{\mathbf {w}} \in \varOmega _A\). If \(\mathbf {w}\) is of type (D), then \(\sqrt{\mathbf {w}}\) is periodic with minimal period conjugate to S.

Thus to make \(\varOmega _A\) a proper dynamical system, we need to adjoin a periodic part to it. Let

$$\begin{aligned} \varOmega _P = \{T^\ell (S^\omega ):0 \le \ell < |S|\}, \end{aligned}$$

and define \(\varOmega = \varOmega _A \cup \varOmega _P\). Clearly \(\varOmega \) is compact and \(\sqrt{\varOmega _A} \subseteq \varOmega \) by Theorem 7. Further, as the proof of Theorem 7 in [3] applies to arbitrary products of S and L, it follows that \(\sqrt{\mathbf {w}}\) is periodic with minimal period conjugate to S if \(\mathbf {w} \in \varOmega _P\). Thus \(\sqrt{\varOmega _P} \subseteq \varOmega _P\), and the pair \((\varOmega , \sqrt{\cdot })\) is a valid dynamical system. Notice further that \(L^\omega \in \varOmega _P\); it is a special property of a reversed standard word \(\widetilde{s}\) that \(\widetilde{s}\) and \(L(\widetilde{s})\) are conjugates, see [3, Proposition 2.6].

Let us recall next what is known about the structure of the words in \(\varOmega \). The word \(\varvec{\varGamma } \) is by definition an infinite product of the words \(\gamma _k\) and \(\overline{\gamma }_k \) for all \(k \ge 0\). Thus all words in \(\varOmega _A\) are (uniquely) factorizable as products of \(\gamma _k\) and \(\overline{\gamma }_k \) up to a shift. Let us for convenience denote by \(\varOmega _\gamma \) the set \(\varOmega \cap \{\gamma , \overline{\gamma } \}^\omega \) consisting of words of \(\varOmega \) that are infinite products of \(\gamma \) and \(\overline{\gamma } \). The following lemma describes two important properties of factorizations of words of \(\varOmega _A\) as products of \(\gamma \) and \(\overline{\gamma } \). This result is an immediate property of the substitution \(\tau \) that generates \(\varOmega ^*\).

Lemma 8

Consider a factorization of a word in \(\varOmega _A \cap \varOmega _\gamma \) as a product of \(\gamma \) and \(\overline{\gamma } \). Such factorization has the following properties:

  • Between two occurrences of \(\overline{\gamma } \) there is always \(\gamma ^{2\mathfrak {c}}\) or \(\gamma ^{4\mathfrak {c}+1}\).

  • Between two occurrences of \(\overline{\gamma } \gamma ^{4\mathfrak {c}+1}\overline{\gamma } \) there is always \(\gamma ^{2\mathfrak {c}}\) or \((\gamma ^{2\mathfrak {c}}\overline{\gamma } )^4 \cdot {\overline{\gamma } }^{-1}\).

We also need to know how certain factors synchronize or align in a product of \(\gamma \) and \(\overline{\gamma } \). The proof is a straightforward application of the elementary fact that a primitive word cannot occur nontrivially in its square.

Lemma 9

(Synchronizability Properties). Let \(\mathbf {w} \in \varOmega _\gamma \). If z is a word in \(\{\gamma \gamma , \gamma \overline{\gamma } , \overline{\gamma } \gamma \}\) occurring at position \(\ell \) of \(\mathbf {w}\), then the prefix of \(\mathbf {w}\) of length \(\ell \) is a product of \(\gamma \) and \(\overline{\gamma } \).Footnote 4

The preceding lemma shows that if \(\mathbf {w}\) is a word in \(\varOmega _A\), then for each k there exists a unique \(\ell \) such that \(0 \le \ell < |\gamma _k|\) and \(T^\ell (\mathbf {w}) \in \varOmega _{\gamma _k}\). We then say that the \(\gamma _k\)-factorization of \(\mathbf {w}\) starts at the position \(\ell \) of \(\mathbf {w}\).

Let us conclude this subsection by making a remark regarding the subshift \(\varOmega ^*\). It is possible to define a counterpart for the square root map of \(\varOmega \). Write a word \(\mathbf {w}\) of \(\varOmega ^*\) as a product of pairs of the letters S and L: \(\mathbf {w} = X_1 X_1' \cdot X_2 X_2' \cdots \), where \(X_i X_i' \in \{SS, SL, LS, LL\}\). We define the square root \(\sqrt{\mathbf {w}}\) of \(\mathbf {w}\) to be the word \(X_1 X_2 \cdots \). Based on the above, it is not difficult to see that \(\sigma (\sqrt{\mathbf {w}}) = \sqrt{\sigma (\mathbf {w})}\) for \(\mathbf {w} \in \varOmega ^*\). In other words, the square root map for words in \(\varOmega _S \cap \varOmega _A\) has the same dynamics as the square root map in \(\varOmega ^*\).

3 The Limit Set and Injectivity

In this section, we consider what happens for words of \(\varOmega \) when the square root map is iterated. We extend Theorem 7 and show that also the words of type (B) and type (C) are eventually mapped to a periodic word. In fact, we prove a stronger result: the number of steps required is bounded by a constant depending only on the word S. These results enable us to characterize the limit set as the set \(\varOmega _S\). In other words, asymptotically the square root map on \(\varOmega \) has the same dynamics as the counterpart mapping on \(\varOmega ^* \cup \{S^\omega , L^\omega \}\). We also show that the square root map is mostly injective on \(\varOmega _A\), only certain left extensions of \(\varvec{\varGamma } \) may have two preimages.

Let us first look at an example. Let \(\mathfrak {a}= 1\), \(\mathfrak {b}= 0\), and \(S = 01010010\). Set \(\mathbf {w} = T^4(S^2 \mathbf {u})\) for some \(S^2 \mathbf {u} \in \varOmega _S \cap \varOmega _A\). The word \(\mathbf {w}\) is of type (C) as the word \(T^4(S^2)\), which equals \(00 \cdot 1001010010\), is in \(\varPi (\mathfrak {a}, \mathfrak {b})\). Now \(\sqrt{\mathbf {w}} = 010010 \cdot \sqrt{\mathbf {u}}\) and \(\sqrt{\mathbf {w}} \in \varOmega _A\) by Theorem 7. So \(\sqrt{\mathbf {w}}\) is of type (B), and \(\root 2 \of {\mathbf {w}} = 010 \cdot \root 2 \of {\mathbf {u}}\). Still we have \(\root 2 \of {\mathbf {w}} \in \varOmega _A\). It is clear now that \(\root 2 \of {\mathbf {w}}\) is not of type (A) or (B). The word \(\root 2 \of {\mathbf {u}}\) begins with S or L, and neither \(010 \cdot S\) nor \(010 \cdot L\) is in \(\varPi (\mathfrak {a},\mathfrak {b})\), so \(\root 2 \of {\mathbf {w}}\) is not of type (C) either. Thus it is of type (D), so \(\root 3 \of {\mathbf {w}}\) is periodic. The minimal period of \(\root 3 \of {\mathbf {w}}\) is readily checked to be 01010010, that is, \(\root 3 \of {\mathbf {w}} = S^\omega \). With some effort it can be verified that in this particular case \(\root 3 \of {\mathbf {v}}\) is periodic for all \(\mathbf {v} \in \varOmega \setminus \varOmega _S\). Notice that the parameter \(\mathfrak {c}\) is irrelevant to all of the preceding arguments.

Theorem 10

There exists an integer n, depending only on the word S, such that \(\root n \of {\mathbf {w}} \in \{S^\omega , L^\omega \}\) for all \(\mathbf {w} \in \varOmega \setminus \varOmega _S\).

Theorem 10 can be proven using the following two lemmas, the first of which is the important Embedding Lemma.

Lemma 11

(Embedding Lemma). Let \(\mathbf {w} \in \varOmega \) and \(u_1\) and \(u_2\) to respectively be the prefixes of \(\mathbf {w}\) and \(\sqrt{\mathbf {w}}\) of length \(|S|\).

  1. (i)

    If \(\mathbf {w}\) begins with 0 and \(u_1 \ne u_2\), then \(u_1 \lhd u_2\).

  2. (ii)

    If \(\mathbf {w}\) begins with 1 and \(u_1 \ne u_2\), then \(u_1 \rhd u_2\).

Lemma 12

Let w be any of the words SS, SL, LS, or LL. If \(\ell \) is an odd integer such that \(0< \ell < |S|\), then \(T^\ell (w) \notin \varPi (\mathfrak {a},\mathfrak {b})\).

Proof

Let \(\ell \) be an odd integer such that \(0< \ell < |S|\). Since \(|T^\ell (w)| = |S^2| - \ell \), we see that \(|T^\ell (w)|\) is odd. Thus it is impossible that \(T^\ell (w) \in \varPi (\mathfrak {a},\mathfrak {b})\).    \(\square \)

Next we turn our attention to injectivity. The results provided next give sufficient information to characterize the limit set. There is a slight imperfection in the following results. Namely, we are unable to characterize the preimage of the periodic part \(\varOmega _P\), and we believe no nice characterization exists. First of all, the words \(S^\omega \) and \(L^\omega \) must have several preimages, periodic and aperiodic, by Theorem 10. Secondly, if \(\mathbf {w}\) in \(\varOmega _A\) is of type (D), then not only is \(\sqrt{\mathbf {w}}\) periodic with minimal period conjugate to S but the square root of any word in \(\varOmega _A\) that shares a prefix of length \(3|S|\) with \(\mathbf {w}\) is periodic with the same minimal period.Footnote 5 Therefore here we only focus on characterizing preimages of words in the aperiodic part \(\varOmega _A\).

The next theorem says that the square root map is not injective on \(\varOmega _A\) but is almost injective: only words of restricted form may have more than one preimage and even then there is at most two preimages. In the Sturmian case, all words have at most one preimage.

Theorem 13

If \(\mathbf {w}\) is a word in \(\varOmega _A\) having two preimages \(\mathbf {u}\) and \(\mathbf {v}\) in \(\varOmega \) under the square root map, then \(\mathbf {u} = zS\varvec{\varGamma } _1\) and \(\mathbf {v} = zS\varvec{\varGamma } _2\) where zS is a suffix of some \(\gamma _k\) such that \(z \in \varPi (\mathfrak {a},\mathfrak {b})\).

Theorem 13 can be proven using the following lemma.

Lemma 14

Suppose that \(\mathbf {u}\) and \(\mathbf {v}\) are words in \(\varOmega _\gamma \) such that \(\sqrt{\mathbf {u}} = \sqrt{\mathbf {v}}\). If \(\mathbf {u} = \gamma \gamma \cdots \) and \(\mathbf {v} = \gamma \overline{\gamma } \cdots \), then \(\mathbf {u} = \gamma \gamma \gamma ^{2\mathfrak {c}} \overline{\gamma } \cdots \) and \(\mathbf {v} = \gamma \overline{\gamma } \gamma ^{2\mathfrak {c}} \overline{\gamma } \cdots \) and both \(\mathbf {u}\) and \(\mathbf {v}\) must be preceded by \(\overline{\gamma } \gamma ^{2\mathfrak {c}-1}\) in \(\varOmega \).

The limit set \(\varLambda \) is the set of words that have arbitrarily long chains of preimages, that is,

$$\begin{aligned} \varLambda = \bigcap _{n = 0}^\infty \root n \of {\varOmega }. \end{aligned}$$

In the Sturmian case, the limit set contains only the two fixed points of the square root map. For the subshift \(\varOmega \), the limit set is much larger. In fact, the limit set contains all words that are products of the words S and L.

Theorem 15

We have \(\varLambda = \varOmega _S\).

4 Periodic Points

In this section, we characterize the periodic points of the square root map in \(\varOmega \). The result is that the only periodic points are fixed points. We further characterize asymptotically periodic points and show that all asymptotically periodic points are ultimately periodic points.

Recall that a word \(\mathbf {w}\) is a periodic point of the square root map with period n if \(\root n \of {\mathbf {w}} = \mathbf {w}\).

Theorem 16

If \(\mathbf {w}\) is a periodic point in \(\varOmega \), then \(\mathbf {w} \in \{\varvec{\varGamma } _1, \varvec{\varGamma } _2, S^\omega , L^\omega \}\).

The case with the Sturmian periodic points is similar: periodic points are fixed points and the fixed points are obtained as limits from solutions of (3).

Next we consider the dynamical notion of an asymptotically periodic point and characterize asymptotically periodic points in \(\varOmega \).

Definition 17

Let (Xf) be a dynamical system. A point x in X is asymptotically periodic if there exists a periodic point y in X such that

$$\begin{aligned} \lim _{n \rightarrow \infty } d(f^n(x), f^n(y)) = 0. \end{aligned}$$

If this is the case, then we say that the point x is asymptotically periodic to y.

The following proposition essentially says that if a word in \(\varOmega \) is asymptotically periodic, then it is an ultimately periodic point. The situation is opposite to the Sturmian case where all words are asymptotically periodic and only periodic points are ultimately periodic points.

Proposition 18

If \(\mathbf {w} \in \varOmega _S\), then \(\mathbf {w}\) is asymptotically periodic if and only if \(\mathbf {w} \in \{\varvec{\varGamma } _1, \varvec{\varGamma } _2, S^\omega , L^\omega \}\), that is, if and only if \(\mathbf {w}\) is a periodic point. If \(\mathbf {w} \in \varOmega \setminus \varOmega _S\), then \(\mathbf {w}\) is asymptotically periodic to \(S^\omega \) or \(L^\omega \).