Keywords

1 Introduction

The power free words are one of the major themes in the area of combinatorics on words. An \(\alpha \)-power of a word r is the word \(r^{\alpha }=rr\dots rt\) such that \(\frac{\vert r^{\alpha }\vert }{\vert r\vert }=\alpha \) and t is a prefix of r, where \(\alpha \ge 1\) is a rational number. For example \((1234)^{3}=123412341234\) and \((1234)^{\frac{7}{4}}=1234123\). We say that a finite or infinite word w is \(\alpha \)-power free if w has no factors that are \(\beta \)-powers for \(\beta \ge \alpha \) and we say that a finite or infinite word w is \(\alpha ^+\)-power free if w has no factors that are \(\beta \)-powers for \(\beta >\alpha \), where \(\alpha , \beta \ge 1\) are rational numbers. In the following, when we write “\(\alpha \)-power free” then \(\alpha \) denotes a number or a “number with \(+\)”. The power free words, also called repetitions free words, include well known square free (2-power free), overlap free (\(2^+\)-power free), and cube free words (3-power free). Two surveys on the topic of power free words can be found in [8] and [13].

One of the questions being researched is the construction of infinite power free words. We define the repetition threshold \({{\,\mathrm{RT}\,}}(k)\) to be the infimum of all rational numbers \(\alpha \) such that there exists an infinite \(\alpha \)-power-free word over an alphabet with k letters. Dejean’s conjecture states that \({{\,\mathrm{RT}\,}}(2)=2\), \({{\,\mathrm{RT}\,}}(3)=\frac{7}{4}\), \({{\,\mathrm{RT}\,}}(4)=\frac{7}{5}\), and \({{\,\mathrm{RT}\,}}(k)=\frac{k}{k-1}\) for each \(k>4\) [3]. Dejean’s conjecture has been proved with the aid of several articles [1,2,3, 5, 6, 9].

It is easy to see that \(\alpha \)-power free words form a factorial language [13]; it means that all factors of a \(\alpha \)-power free word are also \(\alpha \)-power free words. Then Dejean’s conjecture implies that there are infinitely many finite \(\alpha \)-power free words over \(\varSigma _k\), where \(\alpha >{{\,\mathrm{RT}\,}}(k)\).

In [10], Restivo and Salemi presented a list of five problems that deal with the question of extendability of power free words. In the current paper we investigate Problem 4 and Problem 5:

  • Problem 4: Given \(\alpha \)-power-free words u and v, decide whether there is a transition word w, such that uwu is \(\alpha \)-power free.

  • Problem 5: Given \(\alpha \)-power-free words u and v, find a transition word w, if it exists.

A recent survey on the progress of solving all the five problems can be found in [7]; in particular, the problems 4 and 5 are solved for some overlap free (\(2^+\)-power free) binary words. In addition, in [7] the authors prove that: For every pair (uv) of cube free words (3-power free) over an alphabet with k letters, if u can be infinitely extended to the right and v can be infinitely extended to the left respecting the cube-freeness property, then there exists a “transition” word w over the same alphabet such that uwv is cube free.

In 2009, a conjecture related to Problems 4 and Problem 5 of Restivo and Salemi appeared in [12]:

Conjecture 1

[12, Conjecture 1] Let L be a power-free language and let \(e(L)\subseteq L\) be the set of words of L that can be extended to a bi-infinite word respecting the given power-freeness. If \(u, v \in e(L)\) then \(uwv \in e(L)\) for some word w.

In 2018, Conjecture 1 was presented also in [11] in a slightly different form.

Let \(\mathbb {N}\) denote the set of natural numbers and let \(\mathbb {Q}\) denote the set of rational numbers.

Definition 1

Let

$$ \begin{aligned} \varUpsilon = \{(k,\alpha )\mid k\in \mathbb {N} \text{ and } \alpha \in \mathbb {Q} \text{ and } k=3 \text{ and } \alpha>2\}\\ \cup \{(k,\alpha )\mid k\in \mathbb {N} \text{ and } \alpha \in \mathbb {Q} \text{ and } k>3 \text{ and } \alpha \ge 2\}\\ \cup \{(k,\alpha ^+)\mid k\in \mathbb {N} \text{ and } \alpha \in \mathbb {Q} \text{ and } k\ge 3 \text{ and } \alpha \ge 2\}\text{. } \end{aligned} $$

Remark 1

The definition of \(\varUpsilon \) says that: If \((k,\alpha )\in \varUpsilon \) and \(\alpha \) is a “number with \(+\)” then \(k\ge 3\) and \(\alpha \ge 2\). If \((k,\alpha )\in \varUpsilon \) and \(\alpha \) is “just” a number then \(k=3\) and \(\alpha >2\) or \(k>3\) and \(\alpha \ge 2\).

Let \({{\,\mathrm{L}\,}}\) be a language. A finite word \(w\in {{\,\mathrm{L}\,}}\) is called left extendable (resp., right extendable) in \({{\,\mathrm{L}\,}}\) if for every \(n\in \mathbb {N}\) there is a word \(u\in {{\,\mathrm{L}\,}}\) with \(\vert u\vert =n\) such that \(uw\in {{\,\mathrm{L}\,}}\) (resp., \(wu\in {{\,\mathrm{L}\,}}\)).

In the current article we improve the results addressing Problems 4 and Problem 5 of Restivo and Salemi from [7] as follows. Let \(\varSigma _k\) denote an alphabet with k letters. Let \({{\,\mathrm{L}\,}}_{k,\alpha }\) denote the \(\alpha \)-power free language over the alphabet \(\varSigma _k\). We show that if \((k,\alpha )\in \varUpsilon \), \(u\in {{\,\mathrm{L}\,}}_{k,\alpha }\) is a right extendable word in \({{\,\mathrm{L}\,}}_{k,\alpha }\), and \(v\in {{\,\mathrm{L}\,}}_{k,\alpha }\) is a left extendable word in \({{\,\mathrm{L}\,}}_{k,\alpha }\) then there is a word w such that \(uwv\in {{\,\mathrm{L}\,}}_{k,\alpha }\). We also show a construction of the word w.

We sketch briefly our construction of a “transition” word. Let u be a right extendable \(\alpha \)-power free word and let v be a left extendable \(\alpha \)-power free word over \(\varSigma _k\) with \(k>2\) letters. Let \(\bar{u}\) be a right infinite \(\alpha \)-power free word having u as a prefix and let \(\bar{v}\) be a left infinite \(\alpha \)-power free word having v as a suffix. Let x be a letter that is recurrent in both \(\bar{u}\) and \(\bar{v}\). We show that we may suppose that \(\bar{u}\) and \(\bar{v}\) have a common recurrent letter. Let t be a right infinite \(\alpha \)-power free word over \(\varSigma _{k}\setminus \{x\}\). Let \(\bar{t}\) be a left infinite \(\alpha \)-power free word such that the set of factors of \(\bar{t}\) is a subset of the set of recurrent factors of t. We show that such \(\bar{t}\) exists. We identify a prefix \(\tilde{u}xg\) of \(\bar{u}\) such that g is a prefix of t and \(\tilde{u}xt\) is a right infinite \(\alpha \)-power free word. Analogously we identify a suffix \(\bar{g}x\tilde{v}\) of \(\bar{v}\) such that \(\bar{g}\) is a suffix of \(\bar{t}\) and \(\bar{t}x\tilde{v}\) is a left infinite \(\alpha \)-power free word. Moreover our construction guarantees that u is a prefix of \(\tilde{u}xt\) and v is a suffix of \(\bar{t}x\tilde{v}\). Then we find a prefix hp of t such that \(px\tilde{v}\) is a suffix of \(\bar{t}x\tilde{v}\) and such that both h and p are “sufficiently long”. Then we show that \(\tilde{u}xhpx\tilde{v}\) is an \(\alpha \)-power free word having u as a prefix and v as a suffix.

The very basic idea of our proof is that if uv are \(\alpha \)-power free words and x is a letter such that x is not a factor of both u and v, then clearly uxv is \(\alpha \)-power free on condition that \(\alpha \ge 2\). Just note that there cannot be a factor in uxv which is an \(\alpha \)-power and contains x, because x has only one occurrence in uxv. Our constructed words \(\tilde{u}xt\), \(\bar{t}x\tilde{v}\), and \(\tilde{u}xhpx\tilde{v}\) have “long” factors which does not contain a letter x. This will allow us to apply a similar approach to show that the constructed words do not contain square factor rr such that r contains the letter x.

Another key observation is that if \(k\ge 3\) and \(\alpha >{{\,\mathrm{RT}\,}}(k-1)\) then there is an infinite \(\alpha \)-power free word \(\bar{w}\) over \(\varSigma _k\setminus \{x\}\), where \(x\in \varSigma _k\). This is an implication of Dejean’s conjecture. Less formally said, if uv are \(\alpha \)-power free words over an alphabet with k letters, then we construct a “transition” word w over an alphabet with \(k-1\) letters such that uwv is \(\alpha \)-power free.

Dejean’s conjecture imposes also the limit to possible improvement of our construction. The construction cannot be used for \({{\,\mathrm{RT}\,}}(k)\le \alpha <{{\,\mathrm{RT}\,}}(k-1)\), where \(k\ge 3\), because every infinite (or “sufficiently long”) word w over an alphabet with \(k-1\) letters contains a factor which is an \(\alpha \)-power. Also for \(k=2\) and \(\alpha \ge 1\) our technique fails. On the other hand, based on our research, it seems that our technique, with some adjustments, could be applied also for \({{\,\mathrm{RT}\,}}(k-1)\le \alpha \le 2\) and \(k\ge 3\). Moreover it seems to be possible to generalize our technique to bi-infinite words and consequently to prove Conjecture 1 for \(k\ge 3\) and \(\alpha \ge {{\,\mathrm{RT}\,}}(k-1)\).

2 Preliminaries

Recall that \(\varSigma _k\) denotes an alphabet with k letters. Let \(\epsilon \) denote the empty word. Let \(\varSigma _k^*\) denote the set of all finite words over \(\varSigma _k\) including the empty word \(\epsilon \), let \(\varSigma _k^{\mathbb {N},R}\) denote the set of all right infinite words over \(\varSigma _k\), and let \(\varSigma _k^{\mathbb {N},L}\) denote the set of all left infinite words over \(\varSigma _k\). Let \(\varSigma _k^{\mathbb {N}}=\varSigma _k^{\mathbb {N},L}\cup \varSigma _k^{\mathbb {N},R}\). We call \(w\in \varSigma _k^{\mathbb {N}}\) an infinite word.

Let \({{\,\mathrm{occur}\,}}(w,t)\) denote the number of occurrences of the nonempty factor \(t\in \varSigma _k^*\setminus \{\epsilon \}\) in the word \(w\in \varSigma _k^*\cup \varSigma _k^{\mathbb {N}}\). If \(w\in \varSigma _k^{\mathbb {N}}\) and \({{\,\mathrm{occur}\,}}(w,t)=\infty \), then we call t a recurrent factor in w.

Let \({{\,\mathrm{F}\,}}(w)\) denote the set of all finite factors of a finite or infinite word \(w\in \varSigma _k^*\cup \varSigma _k^{\mathbb {N}}\). The set \({{\,\mathrm{F}\,}}(w)\) contains the empty word and if w is finite then also \(w\in {{\,\mathrm{F}\,}}(w)\). Let \({{\,\mathrm{F}\,}}_r(w)\subseteq {{\,\mathrm{F}\,}}(w)\) denote the set of all recurrent nonempty factors of \(w\in \varSigma _k^{\mathbb {N}}\).

Let \({{\,\mathrm{Prf}\,}}(w)\subseteq {{\,\mathrm{F}\,}}(w)\) denote the set of all prefixes of \(w\in \varSigma _k^*\cup \varSigma _k^{\mathbb {N},R}\) and let \({{\,\mathrm{Suf}\,}}(w)\subseteq {{\,\mathrm{F}\,}}(w)\) denote the set of all suffixes of \(w\in \varSigma _k^*\cup \varSigma _k^{\mathbb {N},L}\). We define that \(\epsilon \in {{\,\mathrm{Prf}\,}}(w)\,\cap \,{{\,\mathrm{Suf}\,}}(w)\) and if w is finite then also \(w\in {{\,\mathrm{Prf}\,}}(w)\,\cap \,{{\,\mathrm{Suf}\,}}(w)\).

We have that \({{\,\mathrm{L}\,}}_{k,\alpha }\subseteq \varSigma _k^*\). Let \({{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N}}\subseteq \varSigma _k^{\mathbb {N}}\) denote the set of all infinite \(\alpha \)-power free words over \(\varSigma _k\). Obviously \({{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N}}=\{w\in \varSigma _k^{\mathbb {N}}\mid {{\,\mathrm{F}\,}}(w)\subseteq {{\,\mathrm{L}\,}}_{k,\alpha }\}\). In addition we define \({{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N},R}={{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N}}\,\cap \,\varSigma _k^{\mathbb {N},R}\) and \({{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N},L}={{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N}}\,\cap \,\varSigma _k^{\mathbb {N},L}\); it means the sets of right infinite and left infinite \(\alpha \)-power free words.

3 Power Free Languages

Let \((k,\alpha )\in \varUpsilon \) and let uv be \(\alpha \)-power free words. The first lemma says that uv is \(\alpha \)-power free if there are no word r and no nonempty prefix \(\bar{v}\) of v such that rr is a suffix of \(u\bar{v}\) and rr is longer than \(\bar{v}\).

Lemma 1

Suppose \((k,\alpha )\in \varUpsilon \), \(u\in {{\,\mathrm{L}\,}}_{k,\alpha }\), and \(v\in {{\,\mathrm{L}\,}}_{k,\alpha }\cup {{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N},R}\). Let

$$ \begin{aligned}\varPi =\{(r,\bar{v})\mid r\in \varSigma _k^*\setminus \{\epsilon \} \text{ and } \bar{v}\in {{\,\mathrm{Prf}\,}}(v)\setminus \{\epsilon \} \text{ and } \\ rr\in {{\,\mathrm{Suf}\,}}(u\bar{v}) \text{ and } \vert rr\vert >\vert \bar{v}\vert \}\text{. }\end{aligned}$$

If \(\varPi =\emptyset \) then \(uv\in {{\,\mathrm{L}\,}}_{k,\alpha }\cup {{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N},R}\).

Proof

Suppose that uv is not \(\alpha \)-power free. Since u is \(\alpha \)-power free, then there are \(t\in \varSigma _k^*\) and \(x\in \varSigma _k\) such that \(tx\in {{\,\mathrm{Prf}\,}}(v)\), \(ut\in {{\,\mathrm{L}\,}}_{k,\alpha }\) and \(utx\not \in {{\,\mathrm{L}\,}}_{k,\alpha }\). It means that there is \(r\in {{\,\mathrm{Suf}\,}}(utx)\) such that \(r^{\beta }\in {{\,\mathrm{Suf}\,}}(utx)\) for some \(\beta \ge \alpha \) or \(\beta >\alpha \) if \(\alpha \) is a “number with \(+\)”; recall Definition 1 of \(\varUpsilon \). Because \(\alpha \ge 2\), this implies that \(rr\in {{\,\mathrm{Suf}\,}}(r^{\beta })\). If follows that \((tx,r)\in \varPi \). We proved that \(uv\not \in {{\,\mathrm{L}\,}}_{k,\alpha }\cup {{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N},R}\) implies that \(\varPi \not =\emptyset \). The lemma follows.    \(\square \)

The following technical set \(\varGamma (k,\alpha )\) of 5-tuples \((w_1,w_2,x,g,t)\) will simplify our propositions.

Definition 2

Given \((k,\alpha )\in \varUpsilon \), we define that \((w_1,w_2,x,g,t)\in \varGamma (k,\alpha )\) if

  1. 1.

    \(w_1,w_2,g\in \varSigma _k^*\),

  2. 2.

    \(x\in \varSigma _k\),

  3. 3.

    \(w_1w_2xg\in {{\,\mathrm{L}\,}}_{k,\alpha }\),

  4. 4.

    \(t\in {{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N},R}\),

  5. 5.

    \({{\,\mathrm{occur}\,}}(t,x)=0\),

  6. 6.

    \(g\in {{\,\mathrm{Prf}\,}}(t)\),

  7. 7.

    \({{\,\mathrm{occur}\,}}(w_2xgy,xgy)=1\), where \(y\in \varSigma _k\) is such that \(gy\in {{\,\mathrm{Prf}\,}}(t)\), and

  8. 8.

    \({{\,\mathrm{occur}\,}}(w_2,x)\ge {{\,\mathrm{occur}\,}}(w_1,x)\).

Remark 2

Less formally said, the 5-tuple \((w_1,w_2,x,g,t)\) is in \(\varGamma (k,\alpha )\) if \(w_1w_2xg\) is \(\alpha \)-power free word over \(\varSigma _k\), t is a right infinite \(\alpha \)-power free word over \(\varSigma _k\), t has no occurrence of x (thus t is a word over \(\varSigma _k\setminus \{x\}\)), g is a prefix of t, xgy has only one occurrence in \(w_2xgy\), where y is a letter such that gy is a prefix of t, and the number of occurrences of x in \(w_2\) is bigger than the number of occurrences of x in \(w_1\), where \(w_1,w_2, g\) are finite words and x is a letter.

The next proposition shows that if \((w_1,w_2,x,g,t)\) is from the set \(\varGamma (k,\alpha )\) then \(w_1w_2xt\) is a right infinite \(\alpha \)-power free word, where \((k,\alpha )\) is from the set\(\varUpsilon \).

Proposition 1

If \((k,\alpha )\in \varUpsilon \) and \((w_1,w_2,x,g,t)\in \varGamma (k,\alpha )\) then \(w_1w_2xt\in {{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N},R}\).

Proof

Lemma 1 implies that it suffices to show that there are no \(u\in {{\,\mathrm{Prf}\,}}(t)\) with \(\vert u\vert >\vert g\vert \) and no \(r\in \varSigma _k^*\setminus \{\epsilon \}\) such that \(rr\in {{\,\mathrm{Suf}\,}}(w_1w_2xu)\) and \(\vert rr\vert >\vert u\vert \). Recall that \(w_1w_2xg\) is an \(\alpha \)-power free word, hence we consider \(\vert u\vert >\vert g\vert \). To get a contradiction, suppose that such ru exist. We distinguish the following distinct cases.

  • If \(\vert r\vert \le \vert u\vert \) then: Since \(u\in {{\,\mathrm{Prf}\,}}(t)\subseteq {{\,\mathrm{L}\,}}_{k,\alpha }\) it follows that \(xu\in {{\,\mathrm{Suf}\,}}(r^2)\) and hence \(x\in {{\,\mathrm{F}\,}}(r^2)\). It is clear that \({{\,\mathrm{occur}\,}}(r^2,x)\ge 1\) if and only if \({{\,\mathrm{occur}\,}}(r,x)\ge 1\). Since \(x\not \in {{\,\mathrm{F}\,}}(u)\) and thus \(x\not \in {{\,\mathrm{F}\,}}(r)\), this is a contradiction.

  • If \(\vert r\vert >\vert u\vert \) and \(rr\in {{\,\mathrm{Suf}\,}}(w_2xu)\) then: Let \(y\in \varSigma _k\) be such that \(gy\in {{\,\mathrm{Prf}\,}}(t)\). Since \(\vert u\vert >\vert g\vert \) we have that \(gy\in {{\,\mathrm{Prf}\,}}(u)\) and \(xgy\in {{\,\mathrm{Prf}\,}}(xu)\). Since \(\vert r\vert >\vert u\vert \) we have that \(xgy\in {{\,\mathrm{F}\,}}(r)\). In consequence \({{\,\mathrm{occur}\,}}(rr,xgy)\ge 2\). But Property 7 of Definition 2 states that \({{\,\mathrm{occur}\,}}(w_2xgy, xgy)=1\). Since \(rr\in {{\,\mathrm{Suf}\,}}(w_2xu)\), this is a contradiction.

  • If \(\vert r\vert >\vert u\vert \) and \(rr\not \in {{\,\mathrm{Suf}\,}}(w_2xu)\) and \(r\in {{\,\mathrm{Suf}\,}}(w_2xu)\) then: Let \(w_{11}, w_{12}, w_{13}, w_{21}, w_{22}\in \varSigma _k^*\) be such that \(w_1=w_{11}w_{12}w_{13}\), \(w_2=w_{21}w_{22}\), \(w_{12}w_{13}w_{21}=r\), \(w_{12}w_{13}w_{2}xu=rr\), and \(w_{13}w_{21}=xu\); see Figure below.

      

    xu

       

    \(w_{11}\)

    \(w_{12}\)

    \(w_{13}\)

    \(w_{21}\)

    \(w_{22}\)

    x

    u

     

    r

    r

    It follows that \(w_{22}xu=r\) and \(w_{22}=w_{12}\). It is easy to see that \(w_{13}w_{21}=xu\). From \({{\,\mathrm{occur}\,}}(u,x)=0\) we have that \({{\,\mathrm{occur}\,}}(w_2,x)={{\,\mathrm{occur}\,}}(w_{22},x)\) and \({{\,\mathrm{occur}\,}}(w_{13},x)=1\). From \(w_{22}=w_{12}\) it follows that \({{\,\mathrm{occur}\,}}(w_1,x)>{{\,\mathrm{occur}\,}}(w_2,x)\). This is a contradiction to Property 8 of Definition 2.

  • If \(\vert r\vert >\vert u\vert \) and \(rr\not \in {{\,\mathrm{Suf}\,}}(w_2xu)\) and \(r\not \in {{\,\mathrm{Suf}\,}}(w_2xu)\) then: Let \(w_{11}, w_{12}, w_{13}\in \varSigma _k^*\) be such that \(w_1=w_{11}w_{12}w_{13}\), \(w_{12}=r\) and \(w_{13}w_2xu=r\); see Figure below.

    \(w_{11}\)

    \(w_{12}\)

    \(w_{13}\)

    \(w_{2}\)

    x

    u

     

    r

    r

    It follows that

    $$\begin{aligned} {{\,\mathrm{occur}\,}}(w_{12},x)={{\,\mathrm{occur}\,}}(w_{13},x)+{{\,\mathrm{occur}\,}}(w_2,x)+{{\,\mathrm{occur}\,}}(xu,x)\text{. } \end{aligned}$$

    This is a contradiction to Property 8 of Definition 2.

We proved that the assumption of existence of ru leads to a contradiction. Thus we proved that for each prefix \(u\in {{\,\mathrm{Prf}\,}}(t)\) we have that \(w_1w_2xu\in {{\,\mathrm{L}\,}}_{k,\alpha }\). The proposition follows.    \(\square \)

We prove that if \((k,\alpha )\in \varUpsilon \) then there is a right infinite \(\alpha \)-power free word over \(\varSigma _{k-1}\). In the introduction we showed that this observation could be deduced from Dejean’s conjecture. Here additionally, to be able to address Problem 5 from the list of Restivo and Salemi, we present in the proof also examples of such words.

Lemma 2

If \((k,\alpha )\in \varUpsilon \) then the set \({{\,\mathrm{L}\,}}_{k-1,\alpha }^{\mathbb {N},R}\) is not empty.

Proof

If \(k=3\) then \(\vert \varSigma _{k-1}\vert = 2\). It is well known that the Thue Morse word is a right infinite \(2^+\)-power free word over an alphabet with 2 letters [11]. It follows that the Thue Morse word is \(\alpha \)-power free for each \(\alpha >2\).

If \(k>3\) then \(\vert \varSigma _{k-1}\vert \ge 3\). It is well known that there are infinite 2-power free words over an alphabet with 3 letters [11]. Suppose \(0,1,2\in \varSigma _k\). An example is the fixed point of the morphism \(\theta \) defined by \(\theta (0)=012\), \(\theta (1)=02\), and \(\theta (2)=1\) [11]. If an infinite word t is 2-power free then obviously t is \(\alpha \)-power free and \(\alpha ^+\)-power free for each \(\alpha \ge 2\).

This completes the proof.    \(\square \)

We define the sets of extendable words.

Definition 3

Let \({{\,\mathrm{L}}}\subseteq \varSigma _k^*\). We define

$$\begin{aligned} {{\,\mathrm{lext}}}({{\mathrm{L}}})=\{w\in {{\,\mathrm{L}\,}}\mid w \text{ is } \text{ left } \text{ extendable } \text{ in } {{\,\mathrm{L}}}\} \end{aligned}$$

and

$$\begin{aligned} {{\,\mathrm{rext}}}({{\mathrm{L}}})=\{w\in {{\,\mathrm{L}\,}}\mid w \text{ is } \text{ right } \text{ extendable } \text{ in } {{\,\mathrm{L}}}\}\text{. } \end{aligned}$$

If \(u\in {{\,\mathrm{lext}\,}}({{\mathrm{L}}})\) then let \({{\,\mathrm{lext}\,}}(u,{{\mathrm{L}}})\) be the set of all left infinite words \(\bar{u}\) such that \({{\,\mathrm{Suf}\,}}(\bar{u})\subseteq {{\mathrm{L}}}\) and \(u\in {{\,\mathrm{Suf}\,}}(\bar{u})\). Analogously if \(u\in {{\,\mathrm{rext}\,}}({{\mathrm{L}}})\) then let \({{\,\mathrm{rext}\,}}(u,{{\mathrm{L}}})\) be the set of all right infinite words \(\bar{u}\) such that \({{\,\mathrm{Prf}\,}}(\bar{u})\subseteq {{\,\mathrm{L}}}\) and \(u\in {{\,\mathrm{Prf}\,}}(\bar{u})\).

We show the sets \({{\,\mathrm{lext}\,}}(u,{{\,\mathrm{L}}})\) and \({{\,\mathrm{rext}\,}}(v,{{\,\mathrm{L}}})\) are nonempty for left extendable and right extendable words.

Lemma 3

If \({{\,\mathrm{L}\,}}\subseteq \varSigma _k^*\) and \(u\in {{\,\mathrm{lext}\,}}({{\mathrm{L}}})\) (resp., \(v\in {{\,\mathrm{rext}\,}}({{\mathrm{L}}})\)) then \({{\,\mathrm{lext}\,}}(u,{{\,\mathrm{L}}})\not =\emptyset \) (resp., \({{\,\mathrm{rext}\,}}(v,{{\,\mathrm{L}}})\not =\emptyset \)).

Proof

Realize that \(u\in {{\,\mathrm{lext}\,}}({{\mathrm{L}}})\) (resp., \(v\in {{\,\mathrm{rext}\,}}({{\mathrm{L}}})\)) implies that there are infinitely many finite words in \({{\,\mathrm{L}}}\) having u as a suffix (resp., v as a prefix). Then the lemma follows from König’s Infinity Lemma [4, 8].    \(\square \)

The next proposition proves that if \((k,\alpha )\in \varUpsilon \), w is a right extendable \(\alpha \)-power free word, \(\bar{w}\) is a right infinite \(\alpha \)-power free word having the letter x as a recurrent factor and having w as a prefix, and t is a right infinite \(\alpha \)-power free word over \(\varSigma _k\setminus \{x\}\), then there are finite words \(w_1,w_2,g\) such that the 5-tuple \((w_1,w_2,x,g,t)\) is in the set \(\varGamma (k,\alpha )\) and w is a prefix of \(w_1w_2xg\).

Proposition 2

If \((k,\alpha )\in \varUpsilon \), \(w\in {{\,\mathrm{rext}\,}}({{\,\mathrm{L}\,}}_{k,\alpha })\), \(\bar{w}\in {{\,\mathrm{rext}\,}}(w,{{\,\mathrm{L}\,}}_{k,\alpha })\), \(x\in {{\,\mathrm{F}\,}}_r(\bar{w})\,\cap \,\varSigma _k\), \(t\in {{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N},R}\), and \({{\,\mathrm{occur}\,}}(t,x)=0\) then there are finite words \(w_1,w_2,g\) such that \((w_1,w_2,x,g,t)\in \varGamma (k,\alpha )\) and \(w\in {{\,\mathrm{Prf}\,}}(w_1w_2xg)\).

Proof

Let \(\omega ={{\,\mathrm{F}\,}}(\bar{w})\,\cap \,{{\,\mathrm{Prf}\,}}(xt)\) be the set of factors of \(\bar{w}\) that are also prefixes of the word xt. Based on the size of the set \(\omega \) we construct the words \(w_1,w_2,g\) and we show that \((w_1,w_2,x,g,t)\in \varGamma (k,\alpha )\) and \(w_1w_2xg\in {{\,\mathrm{Prf}\,}}(\bar{w})\subseteq {{\,\mathrm{L}\,}}_{k,\alpha }\). The Properties 1, 2, 3, 4, 5, and 6 of Definition 2 are easy to verify. Hence we explicitly prove only properties 7 and 8 and that \(w\in {{\,\mathrm{Prf}\,}}(w_1w_2xg)\).

  • If \(\omega \) is an infinite set. It follows that \({{\,\mathrm{Prf}\,}}(xt)=\omega \). Let \(g\in {{\,\mathrm{Prf}\,}}(t)\) be such that \(\vert g\vert =\vert w\vert \); recall that t is infinite and hence such g exists. Let \(w_2\in {{\,\mathrm{Prf}\,}}(\bar{w})\) be such that \(w_2xg \in {{\,\mathrm{Prf}\,}}(\bar{w})\) and \({{\,\mathrm{occur}\,}}(w_2xg, xg)=1\). Let \(w_1=\epsilon \). Property 7 of Definition 2 follows from \({{\,\mathrm{occur}\,}}(w_2xg, xg)=1\). Property 8 of Definition 2 is obvious, because \(w_1\) is the empty word. Since \(\vert g\vert =\vert w\vert \) and \(w\in {{\,\mathrm{Prf}\,}}(\bar{w})\) we have that \(w\in {{\,\mathrm{Prf}\,}}(w_1w_2xg)\).

  • If \(\omega \) is a finite set. Let \(\bar{\omega }= \omega \,\cap \, {{\,\mathrm{F}\,}}_r(\bar{w})\) be the set of prefixes of xt that are recurrent in \(\bar{w}\). Since x is recurrent in \(\bar{w}\) we have that \(x\in \bar{\omega }\) and thus \(\bar{\omega }\) is not empty. Let \(g\in {{\,\mathrm{Prf}\,}}(t)\) be such that xg is the longest element in \(\bar{\omega }\). Let \(w_1\in {{\,\mathrm{Prf}\,}}(w)\) be the shortest prefix of \(\bar{w}\) such that if \(u\in \omega \setminus \bar{\omega }\) is a non-recurrent prefix of xt in \(\bar{w}\) then \({{\,\mathrm{occur}\,}}(w_1,u)={{\,\mathrm{occur}\,}}(\bar{w},u)\). Such \(w_1\) obviously exists, because \(\omega \) is a finite set and non-recurrent factors have only a finite number of occurrences. Let \(w_2\) be the shortest factor of \(\bar{w}\) such that \(w_1w_2xg\in {{\,\mathrm{Prf}\,}}(\bar{w})\), \({{\,\mathrm{occur}\,}}(w_1,x)<{{\,\mathrm{occur}\,}}(w_2,x)\), and \(w\in {{\,\mathrm{Prf}\,}}(w_1w_2xg)\). Since xg is recurrent in \(\bar{w}\) and \(w\in {{\,\mathrm{Prf}\,}}(\bar{w})\) it is clear such \(w_2\) exists. We show that Property 7 of Definition 2 holds. Let \(y\in \varSigma _k\) be such that \(gy\in {{\,\mathrm{Prf}\,}}(t)\). Suppose that \({{\,\mathrm{occur}\,}}(w_2xg,xgy)>0\). It would imply that xgy is recurrent in \(\bar{w}\), since all occurrences of non-recurrent words from \(\omega \) are in \(w_1\). But we defined xg to be the longest recurrent word \(\omega \). Hence it is contradiction to our assumption that \({{\,\mathrm{occur}\,}}(w_2xg,xgy)>0\). Property 8 of Definition 2 and \(w\in {{\,\mathrm{Prf}\,}}(w_1w_2xg)\) are obvious from the construction of \(w_2\).

This completes the proof.    \(\square \)

We define the reversal \(w^R\) of a finite or infinite word \(w=\varSigma _k^*\cup \varSigma _k^{\mathbb {N}}\) as follows: If \(w\in \varSigma _k^*\) and \(w=w_1w_2\dots w_m\), where \(w_i\in \varSigma _k\) and \(1\le i\le m\), then \(w^R=w_mw_{m-1}\dots w_2w_1\). If \(w\in \varSigma _k^{\mathbb {N},L}\) and \(w=\dots w_2w_1\), where \(w_i\in \varSigma _k\) and \(i\in \mathbb {N}\), then \(w^R=w_1w_2\dots \in \varSigma _k^{\mathbb {N},R}\). Analogously if \(w\in \varSigma _k^{\mathbb {N},R}\) and \(w=w_1w_2\dots \), where \(w_i\in \varSigma _k\) and \(i\in \mathbb {N}\), then \(w^R=\dots w_2w_1\in \varSigma _k^{\mathbb {N},L}\).

Proposition 1 allows one to construct a right infinite \(\alpha \)-power free word with a given prefix. The next simple corollary shows that in the same way we can construct a left infinite \(\alpha \)-power free word with a given suffix.

Corollary 1

If \((k,\alpha )\in \varUpsilon \), \(w\in {{\,\mathrm{lext}\,}}({{\,\mathrm{L}\,}}_{k,\alpha })\), \(\bar{w}\in {{\,\mathrm{lext}\,}}(w,{{\,\mathrm{L}\,}}_{k,\alpha })\), \(x\in {{\,\mathrm{F}\,}}_r(\bar{w})\,\cap \,\varSigma _k\), \(t\in {{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N},L}\), and \({{\,\mathrm{occur}\,}}(t,x)=0\) then there are finite words \(w_1,w_2,g\) such that \((w_1^R,w_2^R,x,g^R,t^R)\in \varGamma (k,\alpha )\), \(w\in {{\,\mathrm{Suf}\,}}(gxw_2w_1)\), and \(txw_2w_1\in {{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N},L}\).

Proof

Let \(u\in \varSigma _k^*\cup \varSigma _k^{\mathbb {N}}\). Realize that \(u\in {{\,\mathrm{L}\,}}_{k,\alpha }\cup {{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N}}\) if and only if \(u^R\in {{\,\mathrm{L}\,}}_{k,\alpha }\cup {{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N}}\). Then the corollary follows from Proposition 1 and Proposition 2.    \(\square \)

Given \(k\in \mathbb {N}\) and a right infinite word \(t\in \varSigma _k^{\mathbb {N},R}\), let \(\varPhi (t)\) be the set of all left infinite words \(\bar{t}\in \varSigma _k^{\mathbb {N},L}\) such that \({{\,\mathrm{F}\,}}(\bar{t})\subseteq {{\,\mathrm{F}\,}}_r(t)\). It means that all factors of \(\bar{t}\in \varPhi (t)\) are recurrent factors of t. We show that the set \(\varPhi (t)\) is not empty.

Lemma 4

If \(k\in \mathbb {N}\) and \(t\in \varSigma _k^{\mathbb {N},R}\) then \(\varPhi (t)\not =\emptyset \).

Proof

Since t is an infinite word, the set of recurrent factors of t is not empty. Let g be a recurrent nonempty factor of t; g may be a letter. Obviously there is \(x\in \varSigma _k\) such that xg is also recurrent in t. This implies that the set \(\{h\mid hg\in {{\,\mathrm{F}\,}}_r(t)\}\) is infinite. The lemma follows from König’s Infinity Lemma [4, 8].    \(\square \)

The next lemma shows that if u is a right extendable \(\alpha \)-power free word then for each letter x there is a right infinite \(\alpha \)-power free word \(\bar{u}\) such that x is recurrent in \(\bar{u}\) and u is a prefix of \(\bar{u}\).

Lemma 5

If \((k,\alpha )\in \varUpsilon \), \(u\in {{\,\mathrm{rext}\,}}({{\,\mathrm{L}\,}}_{k,\alpha })\), and \(x\in \varSigma _{k}\) then there is \(\bar{u}\in {{\,\mathrm{rext}\,}}(u,{{\,\mathrm{L}\,}}_{k,\alpha })\) such that \(x\in {{\,\mathrm{F}\,}}_r(\bar{u})\).

Proof

Let \(w\in {{\,\mathrm{rext}\,}}(u,{{\,\mathrm{L}\,}}_{k,\alpha })\); Lemma 3 implies that \({{\,\mathrm{rext}\,}}(u,{{\,\mathrm{L}\,}}_{k,\alpha })\) is not empty. If \(x\in {{\,\mathrm{F}\,}}_r(w)\) then we are done. Suppose that \(x\not \in {{\,\mathrm{F}\,}}_r(w)\). Let \(y\in {{\,\mathrm{F}\,}}_r(w)\,\cap \,\varSigma _k\). Clearly \(x\not =y\). Proposition 2 implies that there is \((w_1,w_2,y,g,t)\in \varGamma (k,\alpha )\) such that \(u\in {{\,\mathrm{Prf}\,}}(w_1w_2yg)\). The proof of Lemma 2 implies that we can choose t in such a way that x is recurrent in t. Then \(w_1w_2yt\in {{\,\mathrm{rext}\,}}(u,{{\,\mathrm{L}\,}}_{k,\alpha })\) and \(x\in {{\,\mathrm{F}\,}}_r(w_1w_2yt)\). This completes the proof.    \(\square \)

The next proposition shows that if u is left extendable and v is right extendable then there are finite words \(\tilde{u}, \tilde{v}\), a letter x, a right infinite word t, and a left infinite word \(\bar{t}\) such that \(\tilde{u}xt, \bar{t}x\tilde{v}\) are infinite \(\alpha \)-power free words, t has no occurrence of x, every factor of \(\bar{t}\) is a recurrent factor in t, u is a prefix of \(\tilde{u}xt\), and v is a suffix of \(\bar{t}x\tilde{v}\).

Proposition 3

If \((k,\alpha )\in \varUpsilon \), \(u\in {{\,\mathrm{rext}\,}}({{\,\mathrm{L}\,}}_{k,\alpha })\), and \(v\in {{\,\mathrm{lext}\,}}({{\,\mathrm{L}\,}}_{k,\alpha })\) then there are \(\tilde{u}, \tilde{v}\in \varSigma _k^*\), \(x\in \varSigma _k\), \(t\in \varSigma _k^{\mathbb {N},R}\), and \(\bar{t}\in \varSigma _k^{\mathbb {N},L}\) such that \(\tilde{u}xt\in {{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N},R}\), \(\bar{t}x\tilde{v}\in {{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N},L}\), \({{\,\mathrm{occur}\,}}(t,x)=0\), \({{\,\mathrm{F}\,}}(\bar{t})\subseteq {{\,\mathrm{F}\,}}_r(t)\), \(u\in {{\,\mathrm{Prf}\,}}(\tilde{u}xt)\), and \(v\in {{\,\mathrm{Suf}\,}}(\bar{t}x\tilde{v})\).

Proof

Let \(\bar{u}\in {{\,\mathrm{rext}\,}}(u,{{\,\mathrm{L}\,}}_{k,\alpha })\) and \(\bar{v}\in {{\,\mathrm{lext}\,}}(v,{{\,\mathrm{L}\,}}_{k,\alpha })\) be such that \({{\,\mathrm{F}\,}}_r(\bar{u})\,\cap \,{{\,\mathrm{F}\,}}_r(\bar{v})\,\cap \, \varSigma _k\not =\emptyset \). Lemma 5 implies that such \(\bar{u}, \bar{v}\) exist. Let \(x\in {{\,\mathrm{F}\,}}_r(\bar{u})\,\cap \,{{\,\mathrm{F}\,}}_r(\bar{v})\,\cap \, \varSigma _k\). It means that the letter x is recurrent in both \(\bar{u}\) and \(\bar{v}\).

Let t be a right infinite \(\alpha \)-power free word over \(\varSigma _k\setminus \{x\}\). Lemma 2 asserts that such t exists. Let \(\bar{t}\in \varPhi (t)\); Lemma 4 shows that \(\varPhi (t)\not =\emptyset \). It is easy to see that \(\bar{t}\in {{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N},L}\), because \({{\,\mathrm{F}\,}}(\bar{t})\subseteq {{\,\mathrm{F}\,}}_r(t)\) and \(t\in {{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N},R}\).

Proposition 2 and Corollary 1 imply that there are \(u_1,u_2,g,v_1,v_2,\bar{g}\in {{\,\mathrm{L}\,}}_{k,\alpha }\) such that

  • \((u_1,u_2,x,g,t)\in \varGamma (k,\alpha )\),

  • \((v_1^R,v_2^R,x,\bar{g}^R,\bar{t}^R)\in \varGamma (k,\alpha )\),

  • \(u\in {{\,\mathrm{Prf}\,}}(u_1u_2xg)\), and

  • \(v^R\in {{\,\mathrm{Prf}\,}}(v_1^Rv_2^Rx\bar{g}^R)\); it follows that \(v\in {{\,\mathrm{Suf}\,}}(\bar{g}xv_2v_1)\).

Proposition 1 implies that \(u_1u_2xt, v_1^Rv_2^Rx\bar{t}^R\in {{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N},R}\). It follows that \(\bar{t}xv_2v_1\in {{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N},L}\). Let \(\tilde{u}=u_1u_2\) and \(\tilde{v}=v_2v_1\). This completes the proof.    \(\square \)

The main theorem of the article shows that if u is a right extendable \(\alpha \)-power free word and v is a left extendable \(\alpha \)-power free word then there is a word w such that uwv is \(\alpha \)-power free. The proof of the theorem shows also a construction of the word w.

Theorem 1

If \((k,\alpha )\in \varUpsilon \), \(u\in {{\,\mathrm{rext}\,}}({{\,\mathrm{L}\,}}_{k,\alpha })\), and \(v\in {{\,\mathrm{lext}\,}}({{\,\mathrm{L}\,}}_{k,\alpha })\) then there is \(w\in {{\,\mathrm{L}\,}}_{k,\alpha }\) such that \(uwv\in {{\,\mathrm{L}\,}}_{k,\alpha }\).

Proof

Let \(\tilde{u},\tilde{v},x,t,\bar{t}\) be as in Proposition 3. Let \(p\in {{\,\mathrm{Suf}\,}}(\bar{t})\) be the shortest suffix such that \(\vert p\vert >\max \{\vert \tilde{u}x\vert ,\vert x\tilde{v}\vert , \vert u\vert , \vert v\vert \}\). Let \(h\in {{\,\mathrm{Prf}\,}}(t)\) be the shortest prefix such that \(hp\in {{\,\mathrm{Prf}\,}}(t)\) and \(\vert h\vert >\vert p\vert \); such h exists, because p is a recurrent factor of t; see Proposition 3. We show that \(\tilde{u}xhpx\tilde{v}\in {{\,\mathrm{L}\,}}_{k,\alpha }\).

We have that \(\tilde{u}xhp\in {{\,\mathrm{L}\,}}_{k,\alpha }\), since \(hp\in {{\,\mathrm{Prf}\,}}(t)\) and Proposition 3 states that \(\tilde{u}xt\in {{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N},R}\). Lemma 1 implies that it suffices to show that there are no \(g\in {{\,\mathrm{Prf}\,}}(\tilde{v})\) and no \(r\in \varSigma _k^*\setminus \{\epsilon \}\) such that \(rr\in {{\,\mathrm{Suf}\,}}(\tilde{u}xhpxg)\) and \(\vert rr\vert >\vert xg\vert \). To get a contradiction, suppose there are such rg. We distinguish the following cases.

  • If \(\vert r\vert \le \vert xg\vert \) then \(rr\in {{\,\mathrm{Suf}\,}}(pxg)\), because \(\vert p\vert >\vert x\tilde{v}\vert \) and \(xg\in {{\,\mathrm{Prf}\,}}(x\tilde{v})\). This is a contradiction, since \(px\tilde{v}\in {{\,\mathrm{Suf}\,}}(\bar{t}x\tilde{v})\) and \(\bar{t}x\tilde{v}\in {{\,\mathrm{L}\,}}_{k,\alpha }^{\mathbb {N},L}\); see Proposition 3.

  • If \(\vert r\vert >\vert xg\vert \) then \(\vert r\vert \le \frac{1}{2}\vert \tilde{u}xhpxg\vert \), otherwise rr cannot be a suffix of \(\tilde{u}xhpxg\). Because \(\vert h\vert>\vert p\vert > \max \{\vert \tilde{u}x\vert ,\vert x\tilde{v}\vert \}\) we have that \(r\in {{\,\mathrm{Suf}\,}}(hpxg)\). Since \({{\,\mathrm{occur}\,}}(hp,x)=0\), \(\vert h\vert>\vert p\vert >\vert x\tilde{v}\vert \), and \(xg\in {{\,\mathrm{Suf}\,}}(r)\) it follows that there are words \(h_1,h_2\) such that \(\tilde{u}xhpxg=\tilde{u}xh_1h_2pxg\), \(r=h_2pxg\) and \(r\in {{\,\mathrm{Suf}\,}}(\tilde{u}xh_1)\). It follows that \(xg\in {{\,\mathrm{Suf}\,}}(\tilde{u}xh_1)\) and because \({{\,\mathrm{occur}\,}}(h_1,x)=0\) we have that \(\vert h_1\vert \le \vert g\vert \). Since \(\vert p\vert >\vert \tilde{u}x\vert \) we get that \(\vert h_2pxg\vert >\vert \tilde{u}xg\vert \ge \vert \tilde{u}xh_1\vert \); hence \(\vert r\vert >\vert \tilde{u}xh_1\vert \). This is a contradiction.

We conclude that there is no word r and no prefix \(g\in {{\,\mathrm{Prf}\,}}(\tilde{v})\) such that \(rr\in {{\,\mathrm{Suf}\,}}(\tilde{u}xhpxg)\). Hence \(\tilde{u}xhpx\tilde{v}\in {{\,\mathrm{L}\,}}_{k,\alpha }\). Due to the construction of p and h we have that \(u\in {{\,\mathrm{Prf}\,}}(\tilde{u}xhpx\tilde{v})\) and \(v\in {{\,\mathrm{Suf}\,}}(\tilde{u}xhpx\tilde{v})\). This completes the proof.    \(\square \)