Combinatorics on words obtaining by k to k substitution and k to k exchange of a letter on modulo-recurrent words

. We introduce two new concepts which are the k to k substitution and k to k exchange of a letter on infinite words. After studying the return words and the special factors of words obtaining by these applications on Sturmian words and modulo-recurrent words. Next, we establish the complexity functions of these words. Finally, we determine the palindromic complexity of these words


Introduction
The complexity function, which counts the number of distinct factors of given length in some infinite word, is often used in characterization of some families of words [1].For instance, Sturmian words are the infinite words non eventually periodic with minimal complexity [9,10].Over the past thirty years, Sturmian words are intensively studied.Thus, these investigations has led to numerous characterizations and various properties [5,6,8,13,14] on these words.In [2,11,12], the palindromic factors are used abundantly to study Sturmian words.
Combinatorics on words obtaining by k to k substitution and k to k exchange of a letter on modulo-recurrent words The notion of k to k insertion of a letter on infinite words was introduced in [13], and widely studied in [4,12].Later in [3], authors has studied the notion of k to k erasure of letter on infinite words .Now, we introduce the concepts of k to k substitution and k to k exchange of letter on infinite words.The first notion consists to substitute a letter steadily with step of length k in some infinite words namely Strumian words and modulo-recurrent words.Thus, the new word obtaining by this application is called word by k to k substitution of letter.The second consists to exchange a letter steadily with step of length k in the same infinite words.Therefore, the new word obtaining by this application is called word by k to k exchange of letter.This paper is focused in the studying of combinatorial properties of these two new types of words obtaining on strumian words and modulo-recurrent words.
The paper is organized as follow.In the Section 2, we give useful definitions and notations in combinatorics on words, and we recall some properties of Sturmian words and modulo-recurrent words.In Section 3, we study the special factors and we determine the complexity of words obtained by k to k substitution and by k to k exchange of letter on uniformly modulo-recurrent words.The study of some palindromic properties and the palindromic complexity of these words are established in Secttion 4.

Combinatorial properties
An alphabet A, is a non empty finite set whose the elements are called letters.A word is a finite or infinite sequence of elements over A. The set of finite words over A is denoted A * and ε, the empty word.For any u ∈ A * , the number of letters of u is called length of u and it is denoted |u|.Moreover, for any letter x of A, |u| x is the number of occurrences of x in u.A word u of length n written with a unique letter x is simply denoted u = x n .
Let u = x 1 x 2 • • • x n be a word such that x i ∈ A, for all i ∈ {1, 2, . . ., n}.The image of u by the reversal map is the word denoted u and defined by u = x n • • • x 2 x 1 .The word u is simply called reversal image of u.A finite word u is called palindrome if u = u.If u and v are two finite words over A, we have uv=v u.
The set of infinite words over A is denoted A ω and we write A ∞ = A * ∪ A ω , the set of finite and infinite words.An infinite word u is said to be aperiodic if there exist two words v ∈ A * and w ∈ A + such that u = vw ω .If v = ε, then u is periodic.
Let u ∈ A ∞ and w ∈ A * .The word w is a factor of u if there exist u 1 ∈ A * and u 2 ∈ A ∞ such that u = u 1 wu 2 .The factor w is said to be a prefix (respectively, a suffix) if u 1 (respectively, u 2 ) is the empty word.
A word u is said to be recurrent if each of its factors appears infinitly in u.A word u is said to be uniformly recurrent if for all integers n, there exists an integer N such that any factor of length N in u contains all the factors of length n.
A non-empty factor w of u, is said to be right (respectively, left) extendable by a letter x in u if wx (respectively, xw) appears in u.The number of right (respectively, left) extensions of w, is denoted ∂ + w (respectively, ∂ − w).The factor w is said to be right (respectively, left) special in ), we say that w have two-right (respectively, three-right) extensions in u.The factor w is said to be bispecial in u if w is both right and left special.
Let u be an infinite word over A. The set of factors of length n in u, is written L n (u) and the set of all factors in u is denoted by L(u).Let u = x 0 x 1 x 2 • • • , where x i ∈ A, i ≥ 0 be an infinite word and w his factor.Then, w appears in u at the position The complexity function of a given infinite word u is the map of N to N * defined by This function is related to the special factors by the relation (see [7]): We call first rigth (respectively, left) difference of the complexity function p u , the functions defined for any integer n by: The set of palindromic factors of length n in u is denoted Pal n (u), and the set of all palindromic factors in u, is denoted Pal(u).The palindromic complexity function of u is the map of N to N, defined by: A word u ∈ A ∞ is said to be rich if for any factor w of u, the number of palindromic factor in w is |w| + 1.
The window complexity function of u is the map, p f u of N into N * , defined by: The shift is the application S of A ω to A ω which erases the first letter of some given word.For instance,

Sturmian words and modulo-recurrent words
In this subsection, we recall some useful properties on Sturmian words and modulo-recurrent words.
Definition 2.1.An infinite word u over A 2 = {a, b} is said to be Sturmian if for any integer n, p u (n) = n + 1.
The well-known Sturmian word in the literature is the famous Fibonacci word.It is generated by the morphism φ defined over A 2 = {a, b} by: φ(a) = ab and φ(b) = a.Definition 2.2.[8] An infinite word u = x 0 x 1 x 2 • • • is said to be modulo-recurrent if, any factor w of u appears in u at all positions modulo i, for all i ≥ 1.
for all n ∈ N.Then, u is a modulo-recurrent word.Definition 2.3.Let u be a modulo-recurrent word.Then, u is called non-trivial if there exists an integer n 0 such that for all n ≥ n 0 : Definition 2.4.Let u be an infinite word.Then, u is said to be uniformly modulo-recurrent if it is uniformly recurrent and modulo-recurrent.
Definition 2.5.A factor w of some infinite word u is said to be a window factor when it appears in u at a mutiple position its length.
Let us denote L f n (u), the set of n-window factors of u for a given factor of length n.Thus, his cardinal is Theorem 2.6.
It is clear that the Sturmian words are non-trivial and uniformly modulo-recurrent.The champernowne word is modulo-recurrent but does not uniformly recurrent.
The following theorem presents some characterization on Sturmian words.
Combinatorics on words obtaining by k to k substitution and k to k exchange of a letter on modulo-recurrent words Theorem 2.7.[11] Let u be a Sturmian word.Then, for all n ∈ N, we have: The modulo-recurrent words can be characterized by their window complexity as follow: Theorem 2.8.[8] A recurrent word u is modulo-recurrent if and only if p f u (n) = p u (n), for all n ≥ 1.

k to k substitution and k to k exchange of letter in infinite words
We introduce two new concepts called k to k substitution and k to k exchange of a letter in infinite words with k ≥ 1.We study the combinatorial properties of these words.
Definition 3.1.Let u be an infinite word over A in the form: Let us substitute the letters x i with a letter c / ∈ A in u.Then, we obtain an infinite word: This new word is called word by k to k substitution of letter in u and is denoted v = S c k (u).Now, Let us denote ., the circular exchange map of letter defined over A and exchange the letters x i in u.Thus, we obtain the word: It is called word by k to k exchange of a letter in u and denoted by w = E k (u).
Example 3.1.Let us consider the Fibonacci word Then, we have: called word by 3 to 3 substitution of the letter c in f.
called word by 2 to 2 exchange of letter in f.

Return words and special factors in v
We study the return words of the extrenal letter c and special factors in v.
Proposition 3.1.Let u be a recurrent word such that v = S c 3 (u).Then, we have: Proof.We have Ret v (c) = {cS(w i ); w i ∈ L f k+1 (u)}.Moreover, we have {S(w i ); Let u be a modulo-recurrent word such that v = S c 3 (u).Then: Proof.According to Proposition 3.1, we have Let u be a Sturmian word and w a factor of v = S c k (u).Then, w admits three-right (respectively, three-left) extensions in v if and only if |w| < k and w is right (respectively, left) special in u.
Proof.Let us consider w ∈ L(v).
CS: Let us assume that |w| < k such that w is a rigth special factor of u.Then, wa and wb are factors of textbf u.In addition, |wa| = |wb| ≤ k.Thus wa, wb ∈ L(v) since u is modulo-recurrent.Therefore, u being modulo-recurrent then by Corollary 3.1, we have wc ∈ L(v).So, w have three-right extensions in v.
CN: Let us suppose that w have three-right extensions in v.We discuss over the length of w.Case 1: |w| < k.Since wc ∈ L(v), then w ∈ L(u) and wa, wb ∈ L(v).Thus, we have wa, wb ∈ L(u).Case 2: |w| = k.Then, w have three-right extensions in v, i.e. w ∈ L(u).In addition, any factor of length (k + 1) in v contains exactly one occurrence of the letter c.That implies wa, wb / ∈ L(v).This contradicts the fact that w have three-right extensions in v.
Case 3: . By a similar reasoning to the case 2, we have a contradiction.
Hence, in all cases, w have three-right extensions in v if |w| < k.
With the same arguments we can show that w have also three-left extensions in v. ■ Theorem 3.2.Let u be a Sturmian word over A 2 and v = S c k (u).Then, the number of three-right (respectively, three-left) extensions of length n in v is: Proof.Let us designate by Br v (n), the set of factors of length n having two-right extensions in v and denote w n the right special factor of length n in u.It follows that: • For n ≤ k, we have: Combinatorics on words obtaining by k to k substitution and k to k exchange of a letter on modulo-recurrent words • For n > k, we have: Let u be a Sturmian word over A 2 and v = S c k (u).Then, any right (respectively, left) special factor of length n in v with (n ≥ k), give two-right (respectively, two-left) extensions in v.

Complexity function of the infinite word v
In this subsection, we determine the complexity function for the word v obtaining by k to k substitutiton of letter in some infinite word u.
Let u 1 ∈ L(u) for a given infinite word u.Then, we denote by F c k (u 1 ), the set of words obtaining by substitution of the letter c in u 1 , i.e.
Proposition 3.2.Let u be a modulo-recurrent word such that u 1 ∈ L(u) and v = S c k (u).Then: Remark 3.2.Any factor of length n in v comes from a factor of length n in u.

Proof.Theorem 3 . 3 .
Let us consider w ∈ L(v).Then, by Lemma 3.1, w have three-right (respectively, three-left) extensions in v if and only if w is right (respectively, left) special in u and |w| < k.Since u is Sturmian, then for each length n, u have only one right (respectively, left) special factor.Consequently, v produces three-right (respectively, three-left) extensions factor of length n if n < k and neither otherwise.■Let u be a Sturmian word over A 2 and v = S c k (u).Then, the number of two-right (respectively, two-left) extensions of length n in v is:

Proposition 3 . 3 .
2, the k to k substitution conserve the lengths of factors.■ Let u be an infinite word such that v = S c k (u).Then, for any integer n > 1, we have:p v (n) ≤ (n + 1)p u (n) − r u (n − 1) − l u (n − 1) if n ≤ k (k + 1)p u (n) − r u (n − 1) − l u (n − 1) if n > k.Proof.Firstly, the substitutions starting with the first letter of extensions to the left of the same special factor to the left give the same factor.The same applies to substitutions ending in the last letter extensions to the right of the same special factor to the right give the same factor.Thus, according to the values of k and n we have two cases.Case 1 : n ≤ k.Then, some factors of u of length n are also factors of v.Moreover, the other factors of v of length n are produced from factors of u of length n by substitution of one letter.Thus, we have:L n (v) ⊆ L n (u) {rcs; rxs ∈ L n (u), x ∈ A} .Consequently, we have the following inequality:p v (n) ≤ p u (n) + np u (n) − r u (n − 1) − l u (n − 1), i.e. p v (n) ≤ (n + 1)p u (n) − r u (n − 1) − l u (n − 1), for all n ≤ k.Case 2 : n > k.Then, any factor of length n in v contains at least one occurrence of the letter c.By Remark 3.2, any factor of length n in u prodruces at most (k + 1) factors of length n in v. Hence, p v (n) ≤ (k + 1)p u (n) − r u (n − 1) − l u (n − 1), for all n > k.