The Chowla and the Sarnak conjectures from ergodic theory point of view

We rephrase the conditions from the Chowla and the Sarnak conjectures in abstract setting, that is, for sequences of numbers in {-1,0,1}, and introduce several natural generalizations. We study the relationships between these properties and other notions from topological dynamics and ergodic theory.

where Ω(n) is the number of prime factors of n counted with multiplicities. The importance of these two functions in number theory is well known and may be illustrated by the following statement which is equivalent to the Prime Number Theorem, see e.g. [4], p. 91. Recall also the classical connection of µ with the Riemann zeta function, namely 1 ζ(s) = ∞ n=1 µ(n) n s for any s ∈ C with Re(s) > 1.
In [27], it is shown that the Riemann Hypothesis is equivalent to the following: for each ε > 0, we have as N → ∞.
In [6], Chowla formulated a conjecture on the correlations of the Liouville function. The analogous conjecture for the Möbius function takes the following form: THE CHOWLA AND THE SARNAK CONJECTURES 2901 for each choice of 1 ≤ a 1 < · · · < a r , r ≥ 0, with i s ∈ {1, 2}, not all equal to 2, we have n≤N µ i0 (n) · µ i1 (n + a 1 ) · . . . · µ ir (n + a r ) = o(N ). ( Recently, Sarnak [23] formulated the following conjecture: for any dynamical system (X, T ), where X is a compact metric space and T is a homeomorphism of zero topological entropy, for any f ∈ C(X) and any x ∈ X, we have From now on, we refer to (4) as the Sarnak conjecture. Moreover, it is also noted in [23] that for any measure-theoretic dynamical system (X, B, µ, T ), for any f ∈ L 2 (X, B, µ), the condition (4) holds for µ-almost every x ∈ X. As can be shown, this a.e. version of (4) is a consequence of the following Davenport's estimation [7]: for each A > 0, we have max z∈T n≤N z n µ(n) ≤ C A N log A N for some C A > 0 and all N ≥ 2, combined with the spectral theorem (for a complete proof see Section 3). Finally, Sarnak also proved that the Chowla conjecture (3) implies (4). The aim of this paper is to deal with the Chowla conjecture (3) and the Sarnak conjecture (4) in a more abstract setting. In Section 4.1, we introduce conditions (Ch) and (S 0 ) in the context of arbitrary sequences z ∈ {−1, 0, 1} N * . They are obtained from (3) and (4) by replacing µ with z, respectively. In other words, we consider the sums of the form: n≤N z i0 (n)z i1 (n + a 1 ) · . . . · z ir (n + a r ) (6) and n≤N f (T n x)z(n), and require that they are of order o(N ) (a s and i s are as in (3), T , f and x are as in (4)). Finally, we define a new condition (S), formally stronger than (S 0 ), by requiring that the sum given by (7) is of order o(N ) for any homeomorphism T of a compact metric space X, any f ∈ C(X) and any completely deterministic point x ∈ X. 1 Note that if h top (T ) = 0 then all points are completely deterministic. We provide a detailed proof of the fact that (Ch) implies (S), see Theorem 4.10 below. Classical tools from ergodic theory, such as joinings (see Section 4.3), will be here crucial. This approach (for z = µ and (S 0 ) instead of (S)) was suggested in [23], together with a rough sketch of the proof. 2 Since (S) implies (S 0 ) directly from the definitions, we obtain the following: (Ch) =⇒ (S) =⇒ (S 0 ). 1 Recall that x ∈ X is said to be completely deterministic if for any accumulation point ν of ( 1 N n≤N δ T n x ) N ∈N , the system (X, ν, T ) is of zero entropy. 2 Sarnak also announced a purely combinatorial proof of this result (and sent it to us in a letter). See also [25].
In Section 5.2, we show that a sequence z ∈ {−1, 0, 1} N * satisfying (Ch) need not be generic. In Section 5.3, we give an example of a sequence satisfying a weakened version of (Ch), in which we consider only exponents i s = 1, but failing to satisfy (Ch) in its full form. Finally, in Section 5.4 and Section 5.5, we discuss the properties of recurrence and unique ergodicity for sequences satisfying (Ch). Section 6 is motivated by the problem of describing the set {(h top (z 2 ), h top (z)) : z ∈ {−1, 0, 1} N * satisfying (Ch)}.
For any sequence w satisfying (Ch) and such that w 2 = µ 2 , we have (cf. [23] and Remark 6.13 below) (h top (w 2 ), h top (w)) = ( 6 π 2 , 6 π 2 log 3). Moreover, if u ∈ {−1, 1} N * satisfies (Ch) then (h top (u 2 ), h top (u)) = (0, 1). We will discuss, in general, what are possible values of (h top (z 2 ), h top (z)) for sequences over {−1, 0, 1} and provide further examples of z satisfying (Ch) with h top (z 2 ) being an arbitrary number in [0, 1] using Sturmian sequences. 3 In Section 7, we deal with Toeplitz sequences [9,14] over the alphabet {−1, 0, 1}. Although Toeplitz sequences are obtained as a certain limit of periodic sequences (and periodic sequences are orthogonal to µ), their behavior differs from the behavior of periodic sequences in the context of the Chowla and the Sarnak conjectures. Given a sequence z ∈ {−1, 0, 1} N * satisfying some extra assumptions (see Theorems 7.1 and 7.3), we construct Toeplitz sequences t, that are not orthogonal to z and are of positive topological entropy, providing also more precise entropy estimates. We apply this to z = µ, z = µ B and to sequences satisfying (Ch), defined in Section 6.3.1 and Section 6.3.2. For further motivations and related results see [1,11].

Preliminaries.
2.1. Measure-theoretical dynamical systems. Definition 2.1. We say that S is a factor of T (or T is an extension of S) if there exists π : (X, B, µ) → (Y, A, ν) such that S • π = π • T . To simplify notation, we will identify the factor S with the σ-algebra π −1 (A) ⊂ B. Moreover, any Tinvariant sub-σ-algebra A ⊂ B will be identified with the corresponding factor T | A : (X/A, A, µ| A ) → (X/A, A, µ| A ).

2.1.2.
Entropy. Let T be an automorphism of a standard Borel probability space (X, B, µ). Recall that the measure-theoretic entropy of T is defined in the following way. Given a finite measurable partition (We may also write H µ (Q) if we need to underline the role of µ.) The measuretheoretic entropy of T with respect to the partition Q is then defined as where N −1 n=0 T −n Q is the coarsest refinement of all partitions T −n Q, n = 0, . . . , N − 1.
Definition 2.2 (Kolmogorov and Sinai). The measure-theoretic entropy of T is given by where the supremum is taken over all finite measurable partitions.
Definition 2.3. We say that T : (X, B, µ) → (X, B, µ) is a K-system if any nontrivial factor of T has positive entropy.
is called the relative entropy of T 1 with respect to T 2 . • If the extension T 1 → T 2 is non trivial, and if for any intermediate fac- between T 1 and T 2 , with factoring map π 3 : X 3 → X 2 , the relative entropy of T 3 with respect to T 2 is positive unless π 3 is an isomorphism, we say that the extension T 1 → T 2 is relatively K.
let J(T 1 , . . . , T k ) be the set of all probability measures ρ on (X 1 × · · · × X k , B 1 ⊗ · · · ⊗ B k ), invariant under T 1 × · · · × T k and such that ( Definition 2.6. Following [13], we say that T 1 and is a common factor of T 1 and T 2 . To keep the notation simple, we assume that B 3 is a sub-σ-algebra of both B 1 and B 2 . Given λ ∈ J(T 3 , T 3 ), we define the relatively independent extension of λ, i.e. λ ∈ J(T 1 , T 2 ), by setting for each A i ∈ B i , i = 1, 2: Consider now those ∆ ∈ J(T 1 , T 2 ) that project down to the diagonal joining ∆ ∈ J(T 3 , T 3 ) given by ∆(A × B) := µ 3 (A ∩ B). If ∆ is the only such joining, we say that T 1 and T 2 are relatively independent over their common factor T 3 . We then write T 1 ⊥ T3 T 2 .
Remark 2.7 ([26], Lemme 3). If the extension T 1 → T 3 is of zero relative entropy and T 2 → T 3 is relatively K then T 1 ⊥ T3 T 2 . In particular, (taking for T 3 the trivial one-point system) if T 1 has zero entropy and T 2 is K, then T 1 ⊥ T 2 .

Invariant measures.
Let T : X → X be a continuous map of a compact metric space. We denote by P T (X) the set of T -invariant probability measures on (X, B) with B standing for the σ-algebra of Borel sets. The space of probability measures on X is endowed with the (metrizable) weak topology: where C(X) denotes the space of continuous functions on X. The weak topology is compact, and P T (X) is closed in it. By the Krylov-Bogolyubov theorem, P T (X) = ∅. In fact, for any x ∈ X, if we set and if, for some increasing sequence (N k ) k∈N and some probability measure ν, δ N k ,x − −−− → k→∞ ν, then ν ∈ P T (X). In such a situation, we say that x is quasi-generic for ν along (N k ), and we set if Q-gen(x) = {ν}, we say that x is generic for ν. 6 In what follows, we will also use the notation δ T,N,x if confusion could arise.
Definition 2.8 ( [29], see also [15]). We say that x ∈ X is completely deterministic if, for each ν ∈ Q-gen(x), we have h(T, ν) = 0. We will then write 2.2.2. Symbolic dynamical systems. Let A be a nonempty finite set and I = N * or Z. Then A I endowed with the product topology is a compact metric space.
Coordinates of w ∈ A I will be denoted either by w n or by w(n) for n ∈ I.
Definition 2.9. The subsets of A I of the form where k ≥ 1, t ∈ I and a 0 , . . . , a k−1 ∈ A, are called cylinders and they form a basis for the product topology.
We will identify blocks with the corresponding cylinders: Definition 2.11. We say that a block C = (a 0 , . . . , a k−1 ) ∈ A k appears in w if w ∈ C t (a 0 , . . . , a k−1 ) for some t ∈ I.
On A I there is a natural continuous action by the left shift S: (For I = Z, S is clearly invertible and it is a homeomorphism.) Definition 2.12. Let C = (a 0 , . . . , a k−1 ) ∈ A k . The following quantity is called the upper frequency with which C appears in w: We will denote by the same letter S the action by the left shift restricted to any closed shift-invariant subset of A I (such a subset is called a subshift). In particular, given w ∈ A I , we will consider the two following subshifts: X w := {u ∈ A I : all blocks that appear in u also appear in w} and X + w := {u ∈ A I : all blocks that appear in u appear in w with positive upper frequency}. (11) Finally, let F ∈ C(A I ) be given by We will use the same notation F , even if the domain of F changes, e.g. when we consider a subshift.

Topological entropy.
Let T be a homeomorphism of a compact metric space (X, d). For n ∈ N, let Given ε > 0 and n ∈ N, let N (ε, n) = max{|E| : E ⊂ X, d n (x, y) ≥ ε for all x = y in E}.
Definition 2.13 (Bowen and Dinaburg). The topological entropy h top (T ) is defined as We consider now the special case of a subshift, namely, S : X w → X w , where w ∈ A I . Let p n (w) := |{B ∈ A n : B appears in w}| . and put Then In a similar way, given ν ∈ P S (A I ), we denote by h top (supp(ν)) the following quantity: where p n (supp(ν)) := |{B ∈ A n : ν(B) > 0}| . 7 In particular, if Q-gen(w) = {ν}, then h top (supp(ν)) = h top (S, X + w ) (see Lemma 5.12 below).

Invariant measures in symbolic dynamical systems.
Remark 2.14. Any ν ∈ P S (A N * ) is determined by the values it takes on blocks, so it can be extended to a measure in P S (A Z ) taking the same value on each block as ν. This measure will be also denoted by ν. 8 Moreover, if w ∈ A N * is quasi-generic for ν ∈ P S (A N * ) along (N k ) then for any w ∈ A Z such that w[1, ∞] = w, the point w is quasi-generic for ν ∈ P S (A Z ) along (N k ).
For any probability distribution (p 1 , . . . , p |A| ) on A, we denote by B(p 1 , . . . , p |A| ) the corresponding Bernoulli measure on A I .
The cases A = {−1, 0, 1} or A = {0, 1} will be of special interest for us. Let π : {−1, 0, 1} I → {0, 1} I be the coordinate square map: which is clearly S-equivariant. Given ν ∈ P S ({0, 1} I ), let ν denote the corresponding relatively independent extension of ν: for every block B, we set 7 It is not hard to see that p m+n (supp(ν)) ≤ pm(supp(ν)) · pn(supp(ν)).  Definition 2.15. Let A be a finite set. We say that w ∈ A I is a Sturmian sequence if p n (w) = n + 1 for all n ∈ N * (in particular, |A| = 2, i.e. without loss of generality, A = {0, 1}). If w is Sturmian or periodic, we will say that w is a generalized Sturmian sequence.
Remark 2.16. Any generalized Sturmian sequence can be obtained in the following way. Consider a line L with an irrational slope in the plane (see Figure 1 on page 2931). We build w by considering the consecutive intersections of L with the integer grid, putting a 0 each time L intersects a horizontal line and a 1 each time it intersects a vertical line of the grid (if the line intersects a node, put either 0 or 1). In order to include also periodic sequences, we allow the slope of L to be rational, provided that L does not meet any node of the grid. For more information on Sturmian sequences, we refer the reader e.g. to [12].

Toeplitz sequences.
Definition 2.18. Let t ∈ A I , where A is a finite set. We say that the sequence t is Toeplitz if for each a ∈ I there exists r a such that t(a) = t(a + kr a ) for each k ∈ I.
Each Toeplitz sequence t ∈ A I is obtained as a limit of some periodic sequences defined over the extended alphabet A ∪ { * }. Namely, there exists an increasing sequence (p n ), p n |p n+1 such that for each n ≥ 1, where, for each n ≥ 1, T n is a block of length p n over the alphabet A ∪ { * } and * at position k at instance n means that t(k) has not been defined at the stage n of the construction 9 . Whenever (the number of * in T n )/p n → 0 when n → ∞, we say that t is regular. The dynamical systems generated by regular Toeplitz sequences are uniquely ergodic and have zero entropy.
For non-regular Toeplitz sequences the entropy can be positive. Moreover, nonregular Toeplitz sequences can display extremely non-uniquely ergodic behavior. 10 For more information about Toeplitz sequences, we refer the reader to [9,14,31].
Proposition 3.1. Let T be an automorphism of a standard Borel probability space (X, B, µ) and let f ∈ L 1 (X, B, µ). Then, for almost every x ∈ X, we have Proof. We may assume without loss of generality that T is ergodic. Fix f ∈ L 2 (X, B, µ). By the Spectral Theorem, we have where σ f is the spectral measure of f . 11 Hence, by Davenport's estimation (5), for each A > 0, we obtain where C A is a constant that depends only on A. Take ρ > 1, then for N = [ρ m ] for some m ≥ 1, (17) takes the form (m log(ρ)) A for any A > 0.
By choosing A = 2, we obtain In particular, by the triangular inequality for the L 2 norm, and the above sum is almost surely finite. Hence, for almost every point x ∈ X, we have 10 Downarowicz [8] proved that each abstract Choquet simplex can be realized as the simplex of invariant measures for a Toeplitz subshift. 11 Recall that σ f is a finite measure on the circle determined by its Fourier transform given by Suppose additionally that f ∈ L ∞ (X, B, µ). .
, using (18) and the fact that ρ can be taken arbitrarily close to 1, we obtain To finish the proof, notice that for any f ∈ L 1 (X, B, µ), and any ε > 0, there exists g ∈ L ∞ (X, B, µ) such that f −g 1 < ε. It follows by the pointwise ergodic theorem that for almost all x ∈ X, we have Since ε > 0 is arbitrary, the proof is complete.

Basic definitions.
We will now introduce the necessary definitions concerning the Chowla conjecture and the Sarnak conjecture in the abstract setting, i.e. for arbitrary sequences, not only for µ.
Whenever (Ch) is satisfied for z, we will also say that z satisfies the Chowla conjecture.
Definition 4.2 (cf. [23]). We say that z ∈ {−1, 0, 1} I satisfies the condition (S 0 ) if, for each homeomorphism T of a compact metric space X with h top (T ) = 0, for each f ∈ C(X) and for each x ∈ X, we have We say that z ∈ {−1, 0, 1} I satisfies the condition (S) if, for each homeomorphism T of a compact metric space X, for each f ∈ C(X) and each x ∈ X that is completely deterministic.
Whenever (S) is satisfied for z, we will also say that z satisfies the Sarnak conjecture.
Note that by the variational principle, see e.g. [28], if the topological entropy of T is zero, then all points are completely deterministic. Hence (S) implies (S 0 ).
Remark 4.4. In the classical situation z = µ, z 2 is generic for the Mirsky measure [19], cf. [5,23]. Moreover, the Mirsky measure on X z 2 has full topological support, cf. (50). In a more general framework, similar results hold for so called B-free systems, see [3].
Recall that the function F was given by the formula (12), i.e. F (w) = w(1).

EL ABDALAOUI, KU LAGA-PRZYMUS, LEMAŃCZYK AND DE LA RUE
The above lemma can be also viewed from the probabilistic point of view. Indeed, let (X n ) n≥1 (or (X n ) n∈Z ) be a stationary sequence of random variables taking values in {−1, 0, 1}. Notice that whenever for each choice of 1 ≤ a 1 < . . . < a r and j s ∈ {−1, 0, 1}, where k := |{s ∈ {1, . . . , r} : 2} not all equal to 2 (the proof is the same as the one of Lemma 4.5 with notational changes only). 13 In fact, the following holds: Conditions (26) and (27) are equivalent.
Proof. We have already seen that (26) implies (27). Let us show the converse implication. In other words, we need to show that there exists at most one stationary process (that is, at most one S-invariant distribution on {−1, 0, 1} N * ) such that (27) holds. However, each stationary process (X n ) is entirely determined by the family As the proof shows, the above lemma can be proved in a more general framework, namely, for stationary processes having moments of all orders.
Remark 4.8. It follows immediately from Lemma 4.6 that each of the following conditions is equivalent to (Ch): • Q-gen(z) = ν : ν ∈ Q-gen(z 2 ) ; Now, we can completely characterize sequences z ∈ {−1, 1} N * satisfying (Ch). Proof. Notice that u 2 is the generic point for the Dirac measure at (1, 1, ...) and by Lemma 4.6, u is a generic point for the relatively independent extension of that Dirac measure, which is the Bernoulli measure B(1/2, 1/2).

(Ch) implies (S).
In this section, we will provide a dynamical proof of the following theorem: Remark 4.11. In particular, (Ch) implies (S 0 ) (see [23]), which has already been proved by Sarnak. The proof of the implication (Ch) =⇒ (S) given below is to be compared with Sarnak's arguments on page 9 of [23]. Later, in Theorem 4.24, we show that (S) and (S 0 ) are equivalent. Hence, another way to prove Theorem 4.10 is to use (Ch) =⇒ (S 0 ) and (S) ⇐⇒ (S 0 ).
is either trivial (i.e. 1-1 a.e.) or relatively K. 14 Proof. Notice that since the extension is an intermediate factor, by the proof of Lemma 4.12, all we need to check is that π • ξ equals to the projection on the first coordinate. The latter follows from the equality w = (w · u) 2 which holds for w ∈ {0, 1} Z and . It follows immediately that the support of B has to be empty.
where ν u denotes the relevant conditional measure in the disintegration of ν over ν. Notice that ν u is the product measure (1/2, 1/2) of all positions belonging to the support of u. If u(1) = 0 then the formula holds. If u(1) = 1 then F on π −1 (u) takes two values ±1 with the same probability, so the integral is still zero. Lemma 4.16. Let T be a homeomorphism of a compact metric space X, let x ∈ X be completely deterministic, and suppose that z is a quasi-generic point for ν along the sequence (N k ). Assume that . Then: (a) ρ is a joining of (T, X, κ) and (S, {−1, 0, 1} Z , ν) for some zero entropy measure κ ∈ Q-gen(x); Proof. It follows from (28) that and h(T, κ) = 0 since x is completely deterministic. Hence ρ is a joining of (T, X, κ) and (S, {−1, 0, 1} Z , ν), and the extension has relative entropy zero (by the Pinsker formula, see e.g. [21], Theorem 6.3). On the other hand, by Lemma 4.13, the extension is relatively K. To complete the proof, we only need to use Remark 2.7.
Proof of Theorem 4.10. Assume that z ∈ {−1, 0, 1} N * satisfies (Ch), let T be a homeomorphism of the compact metric space X, and let x ∈ X be a completely deterministic point. Fix (N k ) such that for some measure ρ. Then by Remark 4.8, the projection of ρ onto the second coordinate is of the form ν for some ν ∈ Q-gen(z 2 ). Take a function f ∈ C(X). It follows from (29) Using Lemma 4.15, we have By this and using also Lemma 4.16 (b), we obtain 4.4. (Ch), (S 0 -strong) and (S-strong) are equivalent. In this section, we will throw some more lights on Theorem 4.10, by considering some strengthening of properties of (S)-type.
2} not all equal to 2.
Definition 4.18. A sequence z ∈ {−1, 0, 1} I is said to satisfy the condition (S-strong) if for each homeomorphism T of a compact metric space X, we have for each f ∈ C(X), each completely deterministic x ∈ X and each choice of 1 ≤ a 1 < . . . < a r , r ≥ 0, i s ∈ {1, 2} not all equal to 2.
If the above holds, we will also say that z satisfies the strong Sarnak conjecture. In particular, for z = µ the strong Sarnak conjecture takes the form for f, T, x, r, a s , i s as above. For the proof, we will need the following result.
for some natural numbers 1 ≤ a 1 < a 2 < . . . < a r and i s ∈ {1, 2}. Then the following holds: (a) If z satisfies (Ch) then u satisfies (Ch) provided that not all i s are equal to 2.
(b) If z is completely deterministic, then so is u. 15 Proof. We write with a 0 = b 0 = 0. Consider then the smallest α and β such that i α = j β = 1. Since both sequences (a i ), (b j ) are strictly increasing, the sum a α + b β can be obtained only as a γ + b δ with either a γ < a α or b δ < b β . It follows that, in the above sum, the term z(n + a α + b β ) appears with the power i α j β + even number, that is, an odd power, which completes the proof of part (a) of the lemma. We will show now that the assertion (b) also holds. Suppose that δ S,N k ,u → ρ and consider the following sequence of measures on {−1, 0, 1} I × · · · × {−1, 0, 1} I : Passing to a subsequence if necessary, we may assume that ρ k converges to ρ. Then ρ is a joining of (S, κ 0 ), (S, κ 1 ), . . . , (S, κ r ), where κ s ∈ Q-gen(z) for 0 ≤ s ≤ r.
Remark 4.21. Part (b) of Lemma 4.20 will not be used in this section. We will need it later, in the proof of Proposition 6.7.
Proof of Proposition 4.19. Since clearly (S-strong) implies (S 0 -strong), which, in turn, implies (Ch), it suffices to show that (Ch) implies (S-strong). This however follows immediately from Theorem 4.10 and Lemma 4.20.
Moreover, in view of Proposition 4.19 and Propositon 4.9, we immediately obtain the following:  The first part of the proof deals with the symbolic case and shows that if a sequence u is quasi-generic for some shift-invariant measure of zero entropy, then u can be well approximated by a sequence that has zero topological entropy. In [30], the following characterization of completely deterministic points was stated without a proof: A sequence u is completely deterministic if and only if, for any ε > 0 there exists K such that, after removing from u a subset of density less than ε, what is left can be covered by a collection C of K-blocks such that |C| < 2 εK . The following lemma is a reformulation of this criterion in a language suitable for our needs. Lemma 4.25. Let A be finite nonempty set, and let (N k ) k≥1 be an increasing sequence of integers, with N k |N k+1 for each k. Assume that u ∈ A N * satisfies where ν is such that h(S, ν) = 0.
Then, for any ε > 0, we can find an arbitrarily large integer k and a map ϕ : A N k → A N k , satisfying the following properties: • ϕ A N k < 2 εN k ; • the sequence u obtained from u by replacing, for each j ≥ 0, the block u| • the first symbol occuring in u is the same as in u.
Then, for any integer N ≥ 1 and any Proof of Lemma 4.25. Let P be the finite partition of A N * determined by the values of the first coordinate. Then n−1 j=0 S −j P is the partition of A N * according to the n-block appearing in coordinates from 1 to n. Since the entropy of (S, ν) vanishes, given an arbitrary δ > 0, we can take n large enough so that Now, let us say that an n-block is heavy if the ν-measure of the corresponding cylinder set is larger than 2 −εn , and say it is light otherwise. We claim that the ν-measure of the union of all light n-blocks is arbitrarily small whenever δ is chosen small enough. Indeed, for any light n-block B, we have This and (34) imply Observe also that the number of heavy n-blocks cannot exceed 2 εn . Say that an integer j ≥ 1 is good in u if the n-block u| j+n−1 j is heavy. By (32) (applied to the characteristic function of the union of all light n-blocks), and assuming δ is small enough, we can take k large enough so that, for each s ≥ 0, We can also assume that k is large enough so that Let us now define the map ϕ : The definition of ϕ(W ) will depend on whether W is acceptable or not. If W is not acceptable, then we simply set ϕ(W ) := a N k , where a ∈ A is the first symbol occuring in the sequence u. If W is acceptable, then we run the following algorithm. Let j 1 be the first integer which is good in W , and inductively, define j i+1 as the smallest integer larger than or equal to j i + n which is good in W , provided such an integer exists. This algorithm outputs a finite list of integers j 1 , . . . , j r which are good in W , such that j i + n ≤ j i+1 , and such that the disjoint heavy n-blocks W | ji+n−1 ji , 1 ≤ j ≤ r, cover a proportion at least 1 − ε of W (because symbols which are not covered correspond to integers which are not good in W ). Then, in W , replace by a all symbols which are not covered by these heavy n-blocks, and define ϕ(W ) as the resulting N k -block.
The number of N k -blocks which are images of some acceptable block W by this procedure is bounded by the number of choices for the subset of {1, . . . , N k } where we put the letter a, times the number of choices for the heavy blocks. The former is bounded by the number of subsets of {1, . . . , N k } which have less than ε N k elements, which is at most 2 H(ε)N k by Lemma 4.26. Since the number of heavy blocks is at most 2 εn , the latter is bounded by (2 εn ) r , which is less than 2 εN k (indeed, nr ≤ N k because in W we see r disjoint heavy blocks of length n).
Observe that, by the construction of ϕ and by the choice of a, the first symbol in u is the same as in u.
Now, it only remains to show that (33) holds. Let s ≥ 0. Each m ∈ {0, . . . , N k+s /N k − 1} such that u| is not acceptable gives rise in the corresponding subblock to at least εN k integers j which are not good in this subblock. But there are two reasons why this could happen: • either j is one of the last n positions of the subblock, which by (37) only concerns a number of integers bounded by εN k /2, • or j is not good in u, which therefore concerns at least εN k /2 integers j in this subblock.
Then, (36) ensures that the proportion of integers m ∈ {0, . . . , N k+s /N k − 1} such that u| is not acceptable is less than ε. Moreover, observe that if W is an acceptable N k -block, then ϕ(W ) differs from W in at most ε N k places. This concludes the proof of the lemma. Lemma 4.27. Let k and u be produced as in Lemma 4.25. Let us consider u as a sequence in (A N k ) N * , and denote by S N k the action of the shift map in this setting (that is, S N k shifts N k letters in A at the same time). Set also, for each integer s ≥ 0, M s := N k+s /N k . Then there exists an increasing sequence of integers (s ) ≥1 , and an S N k -invariant probability measure ν on (A N k ) N * such that • we have the weak convergence Proof. First, let µ be any weak limit of a subsequence of the form δ S N k ,Ms ,u , ≥ 1.
Since h(ν, S N k ) = 0, we have also h(µ, S N k ) = 0. Let Φ be the continuous map defined by the N k -block recoding ϕ from Lemma 4.25. We get the announced result with ν the pushforward measure of µ by Φ. Lemma 4.28. With the same assumptions as in Lemma 4.25, for any ε > 0, we can find a sequence u ∈ A N * and a subsequence (N k( ) ) ≥1 such that: • h top (u) = 0; • for each ≥ 1, (33) with k replaced by k( ), is satisfied.
Proof. Let u (1) be the sequence we obtain applying Lemma 4.25 with ε/2, and let k(1) be the corresponding integer k. Then u (1) can be viewed as an infinite concatenation of at most 2 N k(1) ε/2 different N k(1) -blocks. By Lemma 4.27, and since all integers N k , k ≥ k(1), are multiples of N k(1) , we can apply Lemma 4.25 to the new sequence u (1) itself, viewed as a sequence in (A N k(1) ) N * . Doing this with ε/4, we obtain a new sequence u (2) and an integer k(2). If we consider both u (1) and u (2) as concatenation of N k(1) -blocks, all blocks used in u (2) are already used in u (1) , so that u (2) is itself an infinite concatenation of at most 2 N k(1) ε/2 different N k(1) -blocks. On the other hand, if we consider now both u (1) and u (2) as sequences in A N * , they coincide on their first N k(1) symbols. We go on in the same way by induction. At step , we have constructed a sequence u ( ) and we have an integer k( ) satisfying and for each 1 ≤ j ≤ , u ( ) is an infinite concatenation of at most 2 N k(j) ε/2 j different N k(j)blocks.
Consider u ( ) as a sequence on the alphabet A N k( ) , which is quasi-generic for some S N k( ) -invariant probability with zero entropy along a subsequence of the original sequence (N k ). We apply on it Lemma 4.25 with ε/2 +1 to get a new sequence u ( +1) and an integer k( + 1), satisfying the analogous properties to (38) and (39) at level + 1, and such that u ( +1) coincides with u ( ) on their first N k( ) symbols. The sequence (u ( ) ) ≥1 which is obtained in this way, converges to a sequence u, satisfying for all ≥ 1, By (38), this ensures that for each ≥ 1, Moreover, by (39), for each ≥ 1, u is an infinite concatenation of at most 2 N k( ) ε/2 different N k( ) -blocks. Therefore, there are at most N k( ) · 2 N k( ) ε/2 different N k( )blocks which appear in u. This implies that h top (u) = 0.
To conclude the proof of the equivalence of (S) and (S 0 ), we need also some tool to pass from the continuous case of a general sequence f (T n x) n∈N * to the discrete case of a symbolic sequence x ∈ A N * for some finite A ⊂ R. This is the object of what follows.
For each finite subset A ⊂ R, we denote by ϕ A the function from [min A, +∞) to A which maps t ≥ min A to the largest element a ∈ A satisfying a ≤ t. We also denote by Φ A the function from [min A, +∞) N * to A N * which maps each sequence (y n ) n∈N * to ϕ A (y n ) n∈N * . Lemma 4.29. Let y = (y n ) n∈N * be a bounded sequence of real numbers, with values in some compact interval [α, β]. We assume that, along some increasing sequence of integers (N k ), the following weak convergence holds: where µ is a shift-invariant probability on [α, β] N * . Then, for each ε > 0, we can find a finite subset A ⊂ R such that: Proof. The first condition required on A is easily satisfied: we just have to choose A so that • the distance between two consecutive elements of A is always less than ε.
Then, for such an A, observe that ϕ A is continuous on [min A, +∞) \ A (A is the set of discontinuity points of ϕ A ), and that Φ A is continuous on where r(A) := {y ∈ [α, β] N * : y n ∈ A for some n ∈ N}.
Consider the pushforward measure of µ by the projection of [α, β] N * to the first coordinate: This is a probability measure on the interval [α, β], hence with at most a countable number of atoms. Moreover, the pushforward measure of µ by the projection of [α, β] N * to any other coordinate has the same atoms, since µ is shiftinvariant. Choosing the elements of A from the complement of this set of atoms is always possible, and ensures that µ r(A) = 0.
Finally, note that for any k, the pushforward of δ S,N k ,y by Φ A is precisely δ S,N k ,Φ A y . Since by (41), the set of discontinuities of Φ A has µ-measure 0, we get (40).
Proof of Theorem 4.24. It is clear from the definitions that condition (S) implies (S 0 ). Assume that z ∈ {−1, 0, 1} N * does not satisfy (S). Then there exist a homeomorphism T of a compact metric space X, a continuous function f : X → R, and a completely deterministic point x ∈ X such that 1 N n≤N f (T n x)z n does not converge to 0 as N → ∞. We can thus find some increasing sequence of integers (N k ), and some θ = 0 such that Without loss of generality, we can further assume that N k |N k+1 for each k. Indeed, extracting a subsequence if necessary, we can always assume that and then replace inductively each N k+1 by the closest multiple of N k . We can also assume that where ν is a T -invariant probability measure on X satisfying h(T, ν) = 0 (because x is completely deterministic). Let α := min f , β := max f . If we set y = (y n ) n∈N := f (T n x) n∈N * ∈ [α, β] N * , then we also have where µ is the pushforward of ν to [α, β] N * by the topological factor map defined by f . In particular, we have h(S, µ) = 0. Now, choose ε > 0 small enough so that Let A be the finite set given by Lemma 4.29 applied to y = (f (T n x)) n∈N * and ε, and set u = (u n ) n∈N * := Φ A (y). Then, we have and Moreover, since h(S, µ) = 0 and S, A N * , (Φ A ) * µ is a measure-theoretic factor of S, [α, β] N * , µ , we also have h S, (Φ A * µ) = 0. We apply now Lemma 4.28 to u and ε, obtaining a sequence u with h top (u) = 0 and a subsequence (N k( ) ) such that It follows from (45), by (44) and by (42) that for sufficiently large 1 N k( ) n≤N k( ) u n z n ≥ |θ|/2 − 2ε.
Therefore (43) implies that 1 N n≤N u n z n → 0, i.e. z does not satisfy (S 0 ) and the assertion follows.

(S) does not imply (Ch).
A natural question arises, whether it is possible to find a sequence which satisfies (S) and does not satisfy (Ch). We will provide now such an example.
In particular (by genericity), Observe that However, the function F · F • S takes the value 1 with probability 2/4 3 (given by the blocks 012 and 023), while the value -1 has probability 1/4 3 (it is given by 123). It follows that the integral in (46) is not equal to zero, i.e. (Ch) does not hold. Note that, in this construction, z is a generic point (so the more z 2 is a generic point). It remains to show that z satisfies (S). This is however clear: for any topological dynamical system (X, T ) and any x ∈ X, each accumulation point, say ρ, of the sequence of empiric measures δ T ×S,N,(x,z) , N ≥ 1, is a joining of (T, X, ρ| X ) and (S, Y, ν) (the latter, since z is generic for ν). If x is completely deterministic, then ρ| X ∈ Q-gen(x) has zero entropy, hence (X, T, ρ| X ) is disjoint from any K-system. In particular, ρ = ρ X ⊗ ν and (S) follows from (47).
Remark 5.2. The point z in the above example is clearly not completely deterministic. In fact, if z satisfies (S) and is completely deterministic, then 1 N n≤N z 2 (n) = 1 N n≤N z(n) · z(n) → 0, so the support of z has zero density and z automatically satisfies (Ch). Remark 5.3. Example 5.1 can be seen as a starting point for a construction of sequences such that the convergence in (Ch) holds whenever a r < k 0 (k 0 ≥ 2), and fails for some choice of 1 ≤ a 1 < · · · < a r = k 0 . Indeed, consider again the shift on If a r < k 0 then each of the functions F • S a in the above integral take the values 1 and −1 with probability 2/4 2 and these events (as a varies from 0 to k 0 − 1) are independent. Therefore, whenever a r < k 0 , then the corresponding integral equals zero (when one of the i s equals 1). However, the function F · F • S k0 takes the value 1 with probability 2/4 3 (given by the blocks 0 * 1 * 2 and 0 * 2 * 3) while the value −1 has probability 1/4 3 (it is given by 1 * 2 * 3), so the integral is not equal to zero. In other words, (Ch) fails for this sequence when r = 1 and a 1 = k 0 .

(Ch) without genericity.
We will show that z may satisfy (Ch) without being a generic point (in fact, even z 2 may fail to be generic). Since the measures κ 0 and κ 1 are mutually singular, up to a set of (κ 0 + κ 1 )-measure zero, we can represent Y as a union Y 0 ∪ Y 1 , Y 0 ∩ Y 1 = ∅ with Y i being a set of full measure for κ i , i = 0, 1. Let Z a n → ∞ and set We define a new sequence w ∈ {−1, 0, 1} N * by setting Proof. Suppose that, for some increasing sequence (P i ), δ Pi,w → ν. Then, for each i ≥ 1, there exists s i ≥ 1, so that M si ≤ P i < M si+1 . By considering subsequences, if necessary, we can assume that M si /P i → α (moreover, for any α ∈ [0, 1] the sequence (P i ) can be chosen so that this convergence holds). Since Clearly, w is not generic, and we can easily check that neither is w 2 (we obtain that w 2 is quasi-generic for all convex combinations of the Dirac measure at (1, 1, . . .) and a Bernoulli measure). Now, since (Ch) holds for w 0 and w 1 , the integral of F i0 · F i1 • S a1 · . . . · F ir • S ar with respect to κ i for i = 0, 1 is equal to zero for any choice of 1 ≤ a 1 < . . . < a r , r ≥ 0, i s ∈ {1, 2} not all equal to 2. Therefore, for any such choice we also have which shows that (Ch) holds for w.

5.3.
The squares in (Ch) are necessary. We will now show that the squares in (Ch) are necessary. In other words, we will show that (Ch) is not equivalent to the following condition: for each choice of 1 ≤ a 1 < . . . < a r , r ≥ 0. The example will be introduced in the probabilistic language (cf. the discussion on page 2912). In order to obtain a sequence z ∈ {−1, 0, 1} N * satisfying (Ch1) and not satisfying (Ch) it suffices to take a generic point for the distribution of the process (X n ) n∈N * considered in the following example.
Remark 5.7. The dynamical system determined by (X n ) n∈N * is a non-trivial factor of the system determined by (Y n ) n∈N * . Moreover, (Y n ) n∈N * is an independent process, so the associated dynamical system is K. Hence h top (z) > 0 for any z ∈ {−1, 0, 1} N * generic for the distribution of (X n ) n∈N * .

(Ch) vs. recurrence.
In this section we discuss the recurrence properties of sequences satisfying (Ch).
Definition 5.10. Let A be a nonempty finite set. A sequence w ∈ A N * is said to be recurrent if each block B appearing in w appears in it infinitely often.
Note that, if then obviously w is recurrent. It is well-known (see, e.g. [10], pp. 189-190) that under the recurrence assumption, one can construct the topological natural extension of the one-sided subshift generated by w. More precisely, under the assumption of recurrence of w, there exists w ∈ A Z such that: • each block appearing in w appears in w.
Our main result in this section is the following: Proposition 5.11. Suppose that (49) holds for z 2 , i.e.
and z satisfies (Ch). Then (49) holds for z; in fact, In particular, z is recurrent.
For the proof we will need two lemmas. Lemma 5.12. Let w ∈ A N * and consider the subshift X w ⊂ A N * . Then given a block B ∈ A r (for some r ≥ 1), the following two conditions are equivalent: • there exists ν ∈ Q-gen(w) such that ν(B) > 0, • B appears in w with positive upper frequency.
Proof. Clearly, X + z ⊂ X + N . Take B ∈ X + N . Then B := π( B) ∈ X + z 2 and by Lemma 5.12 there exists ν ∈ Q-gen(z 2 ) such that ν(B) > 0. Therefore Since z satisfies (Ch), it follows from Lemma 4.6 that ν ∈ Q-gen(z). Lemma 5.12 implies now that B ∈ X + z and the assertion follows. Proof of Proposition 5.11. By Lemma 5.12 and Remark 4.8 (which can be applied since z satisfies (Ch)), we have It follows from (50) that X + N = X N . This and Lemma 5.13 imply X z ⊂ X N = X + N = X + z ⊂ X z so (49) holds for z. Therefore, and using also (53), we conclude that (51) holds.
It is possible to have z satisfying (Ch) and non-recurrent with z 2 being recurrent. Consider the following two examples: Example 5.15. For i ≥ 1, let B i be the block consisting of 10 i zeroes. Then set A 1 := 1B 1 , A 2 := A 1 A 1 B 2 and in general A s+1 := A s A s B s for s ≥ 2 to obtain in the limit the sequence z 2 which is recurrent. Replace first 1 by -1 without changing other positions to define z. Then z satisfies (Ch) and z is not recurrent. A "drawback" of this example is that the density of zeroes is equal to 1.
Then the subshift X z cannot be uniquely ergodic.
Proof. It suffices to show that the subshift X + z is not uniquely ergodic. By Lemma 5.13, we have By Remark 4.8, we have Q-gen(z) = { ν : ν ∈ Q-gen(z 2 )}. Let B be the block with non-empty support given by (54). Then it follows from Lemma 5.12 that there exists ν ∈ Q-gen(z 2 ) such that ν(B) > 0. Moreover, for any block C with B 2 = C 2 we have ν(C) = ν(B) > 0. It follows that ν = ν, but {ν, ν} ⊂ P S (X + z ). For z = µ or z = µ B the fact that the subshift X z is not uniquely ergodic "comes" from X z 2 . To see this, we need first to recall the following definition [16]: . . , k} N * is hereditary if for any x ∈ X and y ∈ {0, . . . , k} N * the condition y(n) ≤ x(n) satisfied for all n, implies that y ∈ X.
Remark 5. 19. In view of [23] and [3], for z = µ or z = µ B , the subshift X z 2 consists of all sequences w ∈ {0, 1} Z which are B-admissible, i.e. such that where for A ⊂ Z and b ≥ 1, t(A, b) := |{c ∈ Z/bZ : ∃n ∈ A, n = c mod b}| is the number of classes modulo b in A.
It follows immediately from the above remark that the subshift X µ 2 B is hereditary. Now, each hereditary system of positive topological entropy (and such are (S, X µ 2 B ) [3]) is not uniquely ergodic, e.g. [17]. 17 Remark 5.20. We can choose a generic point z ∈ {−1, 1} N * for the Bernoulli measure B(1/2, 1/2) to obtain an example of z satisfying (Ch) and for which (S, X z ) is not uniquely ergodic while (S, X z 2 ) has this property. 5.6. Characterization of completely deterministic sequences by orthogonality to (Ch). In response to an interesting question asked by an anonymous referee, we include the following characterization of completely deterministic sequences by orthogonality to sequences satisfying (Ch). We express our thanks to the referee and to Teturo Kamae who helped us proving this result.
Now, by Theorem 2 in [15], we can find z ∈ {−1, 1} N * which is generic for B(1/2, 1/2) (which is equivalent to the fact that z satisfies (Ch) by Proposition 4.9), such that 1 But then, we get by (56) 6. Sequences satisfying (Ch). In this section our main goal is to give natural examples of sequences z satisfying (Ch). We begin with Section 6.1 by discussing the possible values of (h top (z 2 ), h top (z)). Moreover, we discuss the possible values for such pairs when z satisfies (Ch). In Section 6.2.1 we describe a method of obtaining sequences satisfying (Ch). Section 6.2.2 contains background on Sturmian sequences. These tools are used in Section 6.3, where we provide two classes of sequences z satisfying (Ch): with h top (z 2 ) = 0 and h top (z 2 ) > 0.
6.1. A replacement lemma. The authors would like to thank Benjamin Weiss for fruitful discussions which resulted in the material presented in this section. Note that, under the assumption that the Chowla conjecture is true for µ, we have in particular (h top (µ 2 ), h top (µ)) = ( 6 π 2 , 6 π 2 log 3). A natural question arises, what kind of pairs of numbers can be obtained as (h top (z 2 ), h top (z)) for sequences z ∈ {−1, 0, 1} N * satisfying (Ch).
First, we observe that there are some natural restrictions for the values of the pair (h top (z 2 ), h top (z)) for z ∈ {−1, 0, 1} N * . These restrictions are detailed in the extended version of this paper on arXiv, see Appendix in [2]. The following replacement lemma is useful for further investigations.
n≤N k δ S n z for each increasing sequence (N k ) such that one of these limits exists, Proof. For a sequence x over a finite alphabet, we set C n (x) := {B : |B| = n, B appears in x}, so that p n (x) = |C n (x)| for n ∈ N.
The sequence z will be defined as a limit of sequences z k , which will be constructed inductively. Fix 0 < ε k → 0. Let z 1 := z, and choose d 1 large enough so that 1/d 1 < ε 1 . Suppose that d 1 , . . . , d k and z 1 , . . . , z k are already chosen. Let d k+1 be large enough, so that min{i : Let B k+1 ∈ {−1, 0, 1} 3d k+1 be a block which appears in z k infinitely many times. We define z k+1 by replacing some of the occurrences of B k+1 in z k by blocks of the form 0 . . . 0 in such a way that On the other hand, Therefore h top (z) = max(h top (z), h top (w)). In a similar way, we conclude that Moreover, if the replacement of blocks made in course of the construction is scarce enough, the resulting sequence z will be such that for any increasing sequence (N k ) such that one of the above limits exists. This completes the proof.
, there exists z whose support has dentity 0 (hence satisfying (Ch)), such that Of course, one can object that the examples of sequences z satisfying (Ch) provided by the above propositions are rather trivial, since the density of nonzero terms vanishes. If we restrict ourselves to sequences z for which the (upper) density of nonzero terms is positive, Remark 5.9 proves that the topological entropy of z has to be positive if z satisfies (Ch). In fact, we have the following more precise result. Proposition 6.3. Let z ∈ {−1, 0, 1} N * , satisfying (Ch) and such that Then h top (z) ≥ δ.
In particular, the support of ν contains cylinder sets of arbitrarily large length, for which the density of 1's is at least δ. Then, since z satisfies (Ch), Remark 4.8 shows that z is quasi-generic for ν, and we deduce that h top (z) ≥ δ.
Proof. The assertion follows directly from the fact that µ(n) = λ(n) · µ 2 (n), Remark 6.5 and Proposition 6.4. Proposition 6.4 turns out to be a particular case of the following result.
Then w is completely deterministic by Lemma 4.20 (b), and we obtain by Proposition 4.19.
Remark 6.8. In Proposition 6.7, the condition (Ch) can be replaced by (S); the proof goes along the same lines.

Sturmian sequences -background.
In this section, we give the necessary background on Sturmian sequences. respectively. Note that L t intersects as many vertical lines of the grid as the side of the triangle opposed to angle α does (see Figure 1). Since this side has length at, therefore L t intersects either [at] or [at] + 1 vertical lines. This is the number of 1's in the corresponding block of η; we will denote it by #1(L t ). In a similar way, the number of 0's is equal to [bt] or [bt] + 1; we denote it by #0(L t ). Then at < #1(L t ) ≤ at + 1 and bt < #0(L t ) ≤ bt + 1. (59) Now, fix B n ∈ {0, 1} n . Then n = n(L t ) for some t > 0 and for some line segment L t of length t. It follows now by (59) and (60) that and in a similar way This completes the proof as a a+b = | tan α| 1+| tan α| takes any value between 0 and 1. Remark 6.10. In particular, it follows from the above lemma that Proof. Let η ∈ {0, 1} N * be a Sturmian sequence, and δ be as in Lemma 6.9, i.e.
Since z satisfies (Ch), it is generic for the relatively independent extension of the measure given by the block frequencies in z 2 = η. In particular, given a block C appearing in η = z 2 , and B such that B 2 = C, B will appear in z. Hence which yields h top (z) = δ. Proof. Take u ∈ {−1, 0, 1} N * generic for the Bernoulli measure B(1/4, 1/2, 1/4). Notice that u 2 is generic for B(1/2, 1/2), and that B(1/4, 1/2, 1/4) is the relatively independent extension of B(1/2, 1/2). By Lemma 4.6, u satisfies (Ch). Let η ∈ {0, 1} N * be a Sturmian sequence, and let δ be as in Lemma 6.9. By Proposition 6.7, z := u · η also satisfies (Ch). Notice that any block B appearing in z arises by replacing some of the 1's in a block C appearing in η by 0's or −1's. Moreover, all blocks of this form appear in z. Thus, 3 δn−3 ≤ p z (n) ≤ (n + 1) · 3 δn+3 , whence h top (z) = δ log 3. In a similar way, we obtain h top (z 2 ) = δ, which completes the proof. Remark 6.13. Suppose that b k = a 2 k , k ≥ 1 are pairwise relatively prime and let µ B be given by formula (16). Let z ∈ {−1, 0, 1} N * be a sequence satisfying (Ch), such that z 2 = µ 2 B (we can get such a sequence as the product of µ 2 B and a sequence of −1's and 1's which is generic for B(1/2, 1/2), noting that µ 2 B is completely deterministic by [3], and using Propositin 6.4). By Theorem 5.3. in [3], we have [23,22]) that in the classical case when z = µ, we have 7. Toeplitz sequences correlating with a given sequence, and their topological entropy. Since the Sarnak conjecture holds for periodic sequences, the following question arises: Are all sequences that display some strong periodic structure orthogonal to µ? Toeplitz sequences (see Section 2.2.7) are a natural class to consider in this context, since they are explicitly given as some limits of periodic sequences: indeed, any block appearing in a Toeplitz sequence, appears in it periodically (the period may vary, depending on the chosen block). It was however already shown in [1] that there are Toeplitz sequences that are not orthogonal to µ. 19 The aim of this section is to work in an abstract setting, dealing, instead of µ, with a sequence z ∈ {−1, 0, 1} N * satisfying some additional assumptions. Under these assumptions, we will construct Toeplitz sequences t = (t n ) such that 1 N n≤N t n · z(n) → 0 (67) and show that h top (t) > 0, giving more precise entropy estimates. The starting point for our constructions is the following simple observation: if the upper density of 1's in z 2 is positive then The underlying idea of the constructions is to find a Toeplitz sequence t which has "as much as possible in common" with the sequence z under consideration. We apply our results to the following two classes of sequences: (a) sequences satisfying (Ch), related to Sturmian sequences (see Section 6.3.1 and Section 6.3.2); (b) z = µ, z = µ B and any sequence z such that z 2 = w 2 , where w is as in (a). Notice that in case (a), in view of Theorem 4.10, (67) clearly implies that t is not completely deterministic, so, in particular, h top (t) > 0. Therefore, what we are really interested in, are the obtained entropy (lower) estimates. In case (b), we cannot refer to (Ch) anymore to show that h top (t) > 0, it needs to be shown separately. Note however that our entropy estimates are not as precise as in case (a) (the reason is that we have less knowledge about z). It is also unclear whether the constructed Toeplitz sequences are not completely deterministic.
(see Proposition 7.7 below). Moreover, under some additional assumptions on z, we will give estimates for h top (t). More precisely, we will prove the following. Remark 7.2. Note that condition (c) above holds for an arbitrary q ≥ 2 whenever (S, ν) is ergodic and there exists b ≥ 1 such that for any rational eigenvalue λ of (S, ν), λ c = 1 for some 1 ≤ c ≤ b. In particular, (c) holds if (S, ν) is totally ergodic. Remark 7.4. Although Theorem 7.1 seems to give a better lower entropy estimation than Theorem 7.3, it cannot be applied in many interesting cases (see Section 7.2.1) because of the assumption (c) which we are not able to verify. In such cases, we apply Theorem 7.3. Independently of us, Downarowicz and Kasjan proved in [11] a result similar to Theorem 7.3 in the particular case z = µ.
The proofs of Theorems 7.1 and 7.3 go along the same lines. Since they are quite technical, they will be split into several sections. 7.1.1. A Toeplitz sequence correlating with z. Fix some q ≥ 2 and, for each j ≥ 1, consider the arithmetic progression Definition 7.5. We say that j ∈ N * is initial if there is no j < j with j ∈ A j . Then, {A j : j initial} is a partition of N * .
When j is initial, we denote by A * j the set A j \ {j}. Elements of A * j for some initial j are said to be non-initial. We denote the set of all non-initials by N .
The Toeplitz sequence we are interested in, is the sequence t = (t n ) t∈N * ∈ {−1, 0, 1} N * defined by t n := z(n) if n is initial, z(j) if n ∈ A * j for some initial j.
(70) Lemma 7.6. For any N ≥ 1, we have Proof. Let j be initial. Since the difference of two consecutive terms in A * j is q j , and since the first term of the arithmetic progression A j is missing in A * j , we have by Lemma 7.6. Moreover, using once more Lemma 7.6, we have By (68), the latter expression is bounded below by a fixed positive number whenever q and N are large enough, which completes the proof.
7.1.2. Two types of non-initial numbers. Fix an integer m ≥ 1. For any integer k ≥ 0, we consider the interval I m,k := kq m , (k + 1)q m ∩ N * .
We distinguish two types of non-initials in I m,k : Definition 7.8. A non-initial in I m,k is said to be: • of type 1 if it belongs to some A * j with j ≤ m, • of type 2 if it belongs to some A * j with j > m. Remark 7.9. Observe that, if for some k ≥ 1 and some 1 ≤ r ≤ q m , kq m + r is a non-initial of type 1 in I m,k , then for any other k ≥ 1, k q m + r ∈ I m,k is also a non-initial of type 1 (since it belongs to the same A * j ). Hence, the pattern formed by non-initials of type 1 inside I m,k does not depend on which k ≥ 1 we consider.
On the other hand, consider A * m+h for some h ≥ 1. This set of non-initial numbers intersects I m,k every q h -th integer k, and when it does, the single noninitial point of type 2 in the intersection is always of the form kq m + r for some r depending on h but not on k. Definition 7.10. We say that the integer k is good if the only non-initial integers in I m,k,L are of type 1. By Remark 7.9, for all good k's, the pattern formed by non-initial integers inside I m,k,L is always the same. Proof. Let n ∈ I m,k,L be a non-initial element of type 2. Then n ∈ A * j for some initial j > m, and we have n ≡ j mod q j , hence also n ≡ j mod q m . This and the definition of I m,k,L imply j > q m − L, i.e. the non-initials of type 2 inside I m,k,L belong to some A * j with j > q m − L. (73) Now, fix an initial j > m and let k 0 be such that j ∈ I m,k0 . Then It follows that In view of (73), this ends the proof. 7.1.4. Density of non-initials of type 1 inside I m,k,L . We want now to bound the density of non-initials of type 1 inside I m,k,L (which are the only non-initials in this interval when k is good). Lemma 7.12. Let n ∈ I m,k,L be a non-initial of type 1. Then n ∈ A * j , where j satisfies j > q j − L ( cf. (73)).
Proof. Let n be a non-initial of type 1 inside I m,k,L . Then, by the definition of type 1, there exists an initial j with j ≤ m such that n ∈ A * j . Thus n ≡ j mod q j , and also n ≡ (k + 1)q m + j mod q j .
Proposition 7.13. For k ≥ 1, the proportion of non-initial elements of type 1 inside I m,k,L is equal to Proof. First, let us show that there are no non-initial elements of type 1 inside I m,k,L which are in some A * j with j > . Indeed, suppose that such an element exists. Then, we can write j = + s for some integer s ≥ 1, and Lemma 7.12 gives + s > q +s − q = q (q s − 1).
It remains to estimate the contribution of non-initial elements of type 1 which are in some A * j with j ≤ . For each such j, since q j divides the length L = q of I m,k,L , we have |A j ∩ I m,k,L | L = 1 q j .

Ergodic components.
Proposition 7.14. Let A be a finite alphabet, and let ν be a shift-invariant probability measure on A N * . Let n ≥ 1 and suppose that (S n , ν) has b ≥ 1 ergodic components.
Proposition 7.16. Fix ε > 0. Let A be a finite alphabet, fix w ∈ A N * and suppose that the following conditions hold: (a) w is quasi-generic for some shift-invariant measure ν for which (b) H := h top (supp(ν)) > 0, (c) there exist q ≥ 2 and b ≥ 1 such that, for all m ≥ 1, the number of ergodic components of the action of S q m on (A N * , ν) is bounded by b. Then, for all ≥ 1 large enough, there exists τ > 0 such that, for all m > , we can find 0 ≤ s ≤ b! − 1 satisfying (using as before the notation L := q ) Proof. It follows by (b) that when (and hence also L) is large enough. Fix such an , which additionally satisfies the following inequality: Let τ := 1 2 min ν(C) : C ∈ A L−b! , ν(C) > 0 (77) and take m > . By (a), we may find an increasing sequence (N j ) such that ν = lim j→∞ δ S,Nj ,w .
Since Nj qm q m /N j → 1, by replacing N j with Nj qm q m if necessary, we can assume that q m |N j for j ≥ 1. Passing to a subsequence if necessary, we can further assume the existence of η := lim j→∞ δ S qm ,Nj /qm,w . Notice that, if C is a cylinder such that (S q m −L+1+s ) * (η)(C) ≥ a for some a > 0, then lim sup This and (78) imply which completes the proof.
An immediate consequence of Proposition 7.16 are the following two corollaries. Proof of Theorem 7.3. We will need the following notation: if A = {a 1 < a 2 < · · · < a r } is a finite subset of N * , and if x = (x(n)) n∈N * is a sequence in {0, 1} N * , we denote by x(A) the finite sequence x(A) := x(a 1 ), . . . , x(a r ) ∈ {0, 1} r .
Fix ε > 0. Replacing q by q r if necessary, for some large r (which does not alter the validity of (c')), we can assume that q is large enough to satisfy the assertion of Proposition 7.7, and also that 1 Let be an integer large enough to satisfy the assertion of Corollary 7.17, and set L := q . Then, by Proposition 7.11, we can take m large enough so that the upper density of the set of integers k which are not good is strictly less than τ . Let 0 ≤ s ≤ b! − 1 be given by Corollary 7.17. Then, for any C ∈ {0, 1} L−b! satisfying lim sup there exist infinitely many good integers k such that the block corresponding to the cylinder set C appears at position s of I m,k,L in the sequence z 2 . Since, by Corollary 7.17, the number of such cylinder sets is at least 2 H(1−ε/2)L , we can deduce that {z 2 (I m,k,L ) : k good} ≥ 2 H(1−ε/2)L .
(80) We will show now that for sufficiently large, the number of blocks of length L in t is at least 2 H(1−ε)L , more precisely, we claim that 7.2.1. µ and its generalizations: h top (z 2 ) > 0. Let B = {b k : k ≥ 1} be a set of pairwise coprime numbers with b k = a 2 k and let z(n) = µ B (n) be given by formula (16). Then the following is true: (a) The point z 2 is generic for some measure ν. Moreover, for any block C appearing in z 2 , ν(C) > 0 (for z = µ, see [22] and for the general case, see [3]).
(c) (S, ν) has purely discrete spectrum. Moreover, for q prime: • if q b k for all k ≥ 1 then (S q , ν) is ergodic, • if q | b k for some k ≥ 1 then such k is unique and for any m ≥ 1, S q m has at most b k ergodic components (see Theorem 4.4 in [3]).
Thus, we can apply Theorem 7.3 to z: Corollary 7.19. Fix ε > 0. For z = µ B (including the case z = µ), there exists a Toeplitz sequence t which correlates with z, such that h top (t) ≥ (1 − ε)h top (z 2 ).
Remark 7.20. It would be interesting to know, whether we can find a Toeplitz sequence t so that t correlates with µ B and, moreover, h top (t) ≥ (1 − ε)h top (z) (cf. Remark 7.4).
Remark 7.21. Recall that h top (µ 2 ) = 6/π 2 . Therefore, in view of Proposition 7.7 and Theorem 7.3, in case z = µ, it suffices to take q = 5 in the construction of t, in order to obtain h top (t) > 0.  Proof. In view of Remark 5.9, it suffices to show that h top (supp(ρ)) = h top (z).
Clearly, whenever B is such that ρ(B) > 0, then B appears in z. Let now B be a block which appears in z. Then B = B 1 · B 2 (the multiplication is to be understood coordinatewise) for some block B 1 which appears in η and some block B 2 which appears in u. Therefore by Remark 2.17 and since B(C) > 0 for any block C. This ends the proof.