Shifts with Decidable Language and Non-Computable Entropy

We consider subshifts of the full shift of all binary bi-inﬁnite sequences. On the one hand, the topological entropy of any subshift with computably co-enumerable language is a right-computable real number between 0 and 1 . We show that, on the other hand, any right-computable real number between 0 and 1 , whether computable or not, is the entropy of some subshift with even polynomial time decidable language. In addition, we show that computability of the entropy of a subshift does not imply any kind of computability of the language of


Introduction
An important numerical quantity associated with a dynamical system is its topological entropy.A natural question is then: under what circumstances can one compute the topological entropy of a dynamical systems?While for specific types of dynamical systems, one can often give an algorithm, for examples see, e.g., Milnor (2002), there are also a number of negative results, e.g., for cellular automata by Hurd et al. (1992), for piecewise affine maps by Koiran (2001), and for shift spaces by Simonsen (2006) as well as by the second author, Spandl (2007).Shift spaces are an important, standard class of dynamical systems.For an introduction the reader is referred to Lind and Marcus (1995).They are closed, shift invariant subspaces of the space of bi-infinite sequences over some alphabet, usually assumed to be finite.For simplicity we will consider only subshifts of the space of all bi-infinite binary sequences.Whenever we speak about a shift space or simply a shift in this paper, we will always mean a closed, shift invariant subspace of the space of bi-infinite binary sequences.
As is well known, for simple types of shifts one can compute the entropy, for example for shifts that can be defined by a finite set of forbidden words, and also for the larger class of so-called sofic shifts; see Simonsen (2006); Spandl (2007).Furthermore, Simonsen (2005) obtained computability results for the entropy of β-shifts, Spandl (2007), as well as Hertling and Spandl (2008), for the entropy of S-gap shifts, and Spandl (2007) also for the entropy of shifts having the specification property.Hochman and Meyerovitch (2007) gave a computability-theoretic characterization similar to our main result of the set of real numbers that are the entropy of a two-dimensional shift of finite type.
A natural way of describing a general shift is via its language, that is the set of all finite strings that appear as substrings of elements of the shift space.Simonsen (2006) and Spandl (2007) have shown that the entropy is not uniformly computable with respect to the language of the shift.To be precise, Simonsen (2006) has shown that there is no Turing machine which, given a decision algorithm for the language of some shift with decidable language, is able to compute the entropy of the shift with arbitrary precision.Spandl (2007) has shown that there is no oracle Turing machine which, given the language of some shift via an oracle, is able to compute the entropy of the shift with arbitrary precision.Simonsen (2006) posed the question whether there exists a shift with decidable language whose entropy is a noncomputable number, and noted that "then the results in this paper related to uncomputability would follow immediately".In this paper, we construct such a shift.In fact we will show more.The second author, Spandl (2007), showed that, given an enumeration of the complement of the language of some shift space, one can approximate the entropy effectively from the right.Hence, if the complement of the language of a nonempty shift is computably enumerable then the entropy of the shift is a right-computable real number (between 0 and 1).In particular, the entropy of any nonempty shift with decidable language is a right-computable real number between 0 and 1.We will show that conversely any right-computable real number between 0 and 1 is the entropy of a shift with decidable language.In fact, it is even the entropy of an irreducible shift with a polynomial time decidable language.Since the class of right-computable real numbers between 0 and 1 is known to be strictly larger than the class of computable real numbers between 0 and 1, this shows that there exist irreducible shifts with polynomial time decidable language that have non-computable entropy.
In the following section, we give some basic definitions about shifts, forbidden words, and the language of a shift.Note that another natural way of representing a shift space is by giving a so-called set of forbidden words for it.In view of the question whether, given some information about a shift, one can compute its entropy, it is of course interesting to have a clear picture of the relation between different kinds of information about a shift.Here, we analyze the relation between two different kinds of information about a general shift, namely: language or set of forbidden words, and strengthen the observation by Simonsen (2006) that knowing the language of a shift is better than knowing only a set of forbidden words for the shift.Then we define the topological entropy.We observe that the obstacle to computing the topological entropy of a shift from its language is a topological one.Then we state the main result of the paper.We finish the section by considering the inverse question: if the topological entropy of a shift is computable, does this imply that the language is decidable, at least if the complement of the language is known to be c.e.? We show that this is not the case.On the contrary, we show that there exist shifts with topological entropy zero whose language is of any desired degree of computability-theoretic complexity.In the penultimate section, we prove the main result.We conclude with a summary and some open problems.

Shifts, Sets of Forbidden Words, and Languages of Shifts
We write N = {0, 1, 2, . ..} for the set of natural numbers, i.e., of non-negative integers, Σ = {0, 1} for the binary alphabet, Σ * for the set of all finite binary strings, λ for the empty string, Σ n for the set of all binary strings of length n, for any n ∈ N. A subset of Σ * is called (binary) language.A subset of Σ * or of N is called computably co-enumerable (co-c.e.) if its complement is computably enumerable (c.e.).Furthermore, we write Σ ω := {p | p : N → Σ} for the set of all one-way infinite binary sequences, and A string w ∈ Σ * is a substring of some p ∈ Σ Z if there is an n ∈ Z with w = p[n + 1 . . .n + |w|].For any sets X and Y , we write f :⊆ X → Y for a function whose domain dom(f ) is a subset of X and whose range is a subset of Y .In case dom(f ) = X we may write f : X → Y .Endowed with the product topology of the discrete topology on Σ, both Σ ω and Σ Z are compact topological spaces.The function Examples of shift spaces are easily obtained.
Lemma 2 For an arbitrary set F ⊆ Σ * the set X F ⊆ Σ Z defined by Proof: See (Lind and Marcus, 1995, Definition 1.2.1 and Theorem 6.1.21).
This poses the question whether every shift space can be defined via a set of forbidden words, i.e., whether for every shift space X there is a set F with X = X F .The answer is yes, as can be seen via the "language" of the shift space.Definition 4 For any set X ⊆ Σ Z the set L(X) := {w ∈ Σ * | w is a substring of some p ∈ X} is the language of X.
For any shift space X, the complement L(X) c of L(X) is a set of forbidden words for X, i.e., X = X L(X) c (indeed, X ⊆ X L(X) c is clear, and X L(X) c ⊆ X follows from the assumption that X is closed).In fact, it is the largest forbidden set of words for X since any other set of forbidden words for X is obviously a subset of L(X) c .
A particularly simple class of shifts are those that possess a finite set of forbidden words.But in general, a shift does not need to have a finite set of forbidden words.So, if one wishes to compute something associated with a shift, e.g., its entropy, one needs some kind of description of the shift as input for the algorithm.What is a natural description of a general shift X?One might assume that one knows the characteristic sequence of either a set of forbidden words for X or of L(X).Here the characteristic sequence χ S of a set S ⊆ Σ * is the binary sequence χ S ∈ Σ ω defined by where the bijection ν : N → Σ * is defined by the length-lexicographical ordering: order all strings in Σ * according to their length (short strings first), and strings of the same length in alphabetical order.
We have just seen that, given the language of a shift, one can easily compute a set of forbidden words for the shift: just take the complement of the language of the shift.But (Simonsen, 2006, Remark 17) showed that there is no Turing machine which, given a decision algorithm for some decidable set F ⊆ Σ * , computes a decision algorithm for the language L(X F ).The argument used by Simonsen in order to prove this statement is actually a topological one: the function mapping the characteristic sequence of an arbitrary forbidden set of a shift to the characteristic sequence of its language is not continuous and can therefore not be computable.Note that any function H :⊆ Σ ω → Σ ω that can be computed by a (Type-2) Turing machine is continuous; see, e.g., Weihrauch (2000).
is the whole set Σ * .If G were continuous in 0 ω , there should be a finite prefix 0 n of 0 ω such that G(0 n Σ ω ) ⊆ 1Σ ω .But if F is the set of all binary strings of length greater than log 2 (n) then χ F also starts with 0 n , but We will strengthen Simonsen's remark (Simonsen, 2006, Remark 17) in the following way: in Corollary 11 we will see that there exists a decidable set F such that L(X F ) is not decidable.That means that there exists computable input for the function G in Proposition 6 which is mapped by this function to non-computable output.Note that any computable function H :⊆ Σ ω → Σ ω maps any computable binary sequence p ∈ dom H to a computable binary sequence; see, e.g., Weihrauch (2000).Before we construct such a computable input, let us clarify what one can compute when one knows (an oracle for) some set F , i.e., if χ F for some set F is given.We will see that one can still enumerate L(X F ) c .In fact in order to be able to do that, it is sufficient to be able to enumerate F .We formulate only a non-uniform (not involving oracle Turing machines) version of this statement.
Proposition 7 If F ⊆ Σ * is a computably enumerable set, then L(X F ) c is computably enumerable as well.
Proof: If a set F is computably enumerable, then also the set of all strings in Σ * that have a substring in F is computably enumerable.The assertion follows now from the following lemma. ✷ if, and only if, there exists some n ∈ N such that each of the 2 2n strings uvw with u, w ∈ Σ n has a substring in F .
Proof: For a string v we set if, and only if, every p ∈ K v contains an element of F as a substring.And this is the case if, and only if, for any p ∈ K v there is some n ∈ N such that p[−n . . .|v| − 1 + n] contains an element of F as a substring.Now, the claim follows easily from the compactness of the set K v , for any v. ✷ Especially, if a shift X has a decidable set of forbidden words, then L(X) c must be a c.e. set.The converse is true as well.
Theorem 9 If X is a shift such that L(X) c is c.e., then there exists a polynomial time decidable set F ⊆ Σ * with X = X F .
Proof: This is proved by a padding argument.Let X be a shift such that L(X) c is computably enumerable.Let M be a Turing machine that halts on input v ∈ Σ * after finitely many steps if, and only if, We define a set F ⊆ Σ * as follows: We claim that this set F has the desired properties."X = X F ": This is clear."F is decidable in polynomial time": A Turing machine that decides for a given string x ∈ Σ * in time polynomial in |x| whether x belongs to F or not can work for example as follows.For every prefix v of x it starts M with input v, lets M run for at most |x| − |v| + 1 steps and accepts x if, and only if, there is a prefix v of x such that M stops on input v after exactly |x| − |v| steps.✷ Corollary 10 For a shift X the following conditions are equivalent: 1. L(X) c is computably enumerable.
2. X has a c.e. set of forbidden words.
3. X has a polynomial time decidable set of forbidden words.
Proof: "3 ⇒ 2": This is trivial."2 ⇒ 1": This is Proposition 7. "1 ⇒ 3": This is Theorem 9. ✷ Now we easily conclude that there is computable input for the function G in Proposition 6 which is mapped by G to non-computable output.
Corollary 11 There exists a polynomial time decidable set F ⊆ Σ * such that L(X F ) is not decidable.
Proof: In order to derive this from Theorem 9 it is sufficient to observe that there exist shifts whose language is co-c.e., but not decidable.For an infinite set S ⊆ N, define Fix some co-c.e., but not decidable set S ⊆ N (such a set must be infinite).Then N \ S and F (S) are c.e. and not decidable.By Proposition 7 also L(X F (S) ) c is computably enumerable.But L(X F (S) ) c is not decidable because a string of the form 10 n 1 is in L(X F (S) ) c if, and only if, n ∈ N \ S. ✷ Remark 12 For an infinite set S ⊆ N, the shift X F (S) defined in the proof is called S-gap shift (Lind and Marcus, 1995, Example 1.2.6).For a finite, nonempty set S ⊆ N, the shift X F (S) is called S-gap shift where see (Lind and Marcus, 1995, Example 1.2.6).
Corollary 11 strengthens Simonsen's observation (Simonsen, 2006, Remark 17) that there can be no Turing machine which, given a decision algorithm for any decidable set F ⊆ Σ * , computes a decision algorithm for L(X F ).

The Entropy of Shifts with Decidable or with Computably Co-Enumerable Language
The following statement is Proposition 4.1.8in Lind and Marcus (1995).
Definition 14 For a shift X, the value h top (X) := lim n→∞ The entropy of the empty shift is −∞.In the rest of the paper we will only consider nonempty shifts.It is clear that the entropy of a nonempty subshift of {0, 1} Z is always a real number between 0 and 1, i.e., a real number in the closed interval [0, 1].The converse is true as well; one can even restrict oneself to irreducible shifts.
The irreducible shifts form an important subclass of shifts; compare Lind and Marcus (1995).

Proposition 16
1.The entropy of a nonempty shift is a real number in the interval [0, 1].

Any real number in [0, 1] is the entropy of a nonempty, irreducible shift.
Proof: The first assertion is clear.The second assertion follows immediately from (Lind and Marcus, 1995, Exercise 4.3.7(d))where it is stated that every real number in [0, 1] is the entropy of an S-gap shift, as defined in Remark 12, following (Lind and Marcus, 1995, Example 1.2.6).It is clear that any S-gap shift is irreducible.✷ A different proof of the second statement will be given in the following section.In fact, the proof of our main result (see below) will show how, given a non-increasing sequence of rational numbers in [0, 1], one can construct an irreducible shift whose entropy equals the limit of this sequence.
Can one compute the entropy of a shift?What kind of information does one need to have about the shift in order to compute its entropy?By (Spandl, 2007, Theorem 6.3) one can effectively approximate the entropy from the right if one has an enumeration of L(X) c .We state a non-uniform version of this precisely.Therefore, we need the notion of a right-computable real number.We directly define also the (more basic) notion of a computable real number.

Definition 17
1.A sequence (q n ) n∈N of rational numbers is computable if there exist three total computable functions s, a, b : 2. A real number x is computable if there exists a computable sequence (q n ) n∈N of rational numbers with |x − q n | ≤ 2 −n , for all n ∈ N.

A real number
x is right-computable if there exists a computable sequence (q n ) n∈N of rational numbers with q n ≥ q n+1 for all n ∈ N (a sequence satisfying this condition will be called nonincreasing) and x = lim n→∞ q n .
Remark 18 Similarly, a real number is called left-computable if it is the limit of a computable nondecreasing sequence of rational numbers.Obviously, a real number x is right-computable if, and only if, −x is left-computable.And a real number is computable if, and only if, it is left-computable and rightcomputable.But it is well known that the class of left-computable real numbers is strictly larger than the class of computable real numbers; the same applies to the class of right-computable real numbers.If, e.g., K ⊆ N is a c.e., but undecidable set, then the number 1 − n∈K 2 −(n+1) is a right-computable but not computable real number between 0 and 1; see, e.g., Weihrauch (2000).For an overview concerning left-computable real numbers and other classes of real numbers defined by computability properties, see Zheng (2002).
Proposition 19 If X is a nonempty shift such that L(X) c is c.e., then the entropy of X is a rightcomputable real number. Proof: It is also a direct consequence of (Spandl, 2007, Theorem 6.3). ✷ Corollary 20 If a nonempty shift X has a c.e. set of forbidden words, then its entropy is a right-computable real number.
Proof: By the previous proposition and Proposition 7. ✷ Of course, one would like not only to approximate the entropy from the right, but to compute it with any precision.Simonsen (2006) and the second author, Spandl (2007), have shown that the entropy is not uniformly computable with respect to the language of the shift.To be precise, Simonsen (2006) has shown that there is no Turing machine which, given a decision algorithm for the language of some shift with decidable language, is able to compute the entropy of the shift with arbitrary precision.In fact, Simonsen (2006) showed that this negative result is true even if one restricts oneself to the class of irreducible shifts.The second author, Spandl (2007), showed that there is no oracle Turing machine which, given the language of some shift via an oracle, is able to compute the entropy of the shift with arbitrary precision.In fact, as was noted by Spandl (2007) and by Simonsen (2006) as well, these negative statements are true for topological reasons, similarly as the negative statement of Proposition 6 in the previous section was true for topological reasons.

Proposition 21
The function is discontinuous.It is even discontinuous if on R the weaker topology is considered whose open sets are the sets (a, ∞), with a ∈ R, and the sets ∅, R.
The proof will be given in the following section.The proposition says essentially that there is no algorithm, in fact not even a continuous function, which, given the characteristic function of the language of a shift, would deliver arbitrarily good lower bounds to the entropy of the shift.
Simonsen (Simonsen, 2006, Page 94) then asked the question whether there exists a shift with decidable language but non-computable entropy.We shall show that this is indeed the case.Note that this strengthens the negative results by Simonsen (2006) and Spandl (2007) about the noncomputability of the entropy when the language of a shift is known.In fact, we shall show more.We have already seen that the entropy of any nonempty shift X with decidable language (even with co-c.e.language) is a right-computable real number between 0 and 1.We shall show that any such number is the entropy of a shift with decidable language.It is even the entropy of an irreducible shift with a polynomial time decidable language.The following theorem is the main result of this paper.
Theorem 22 For every right-computable real number α ∈ [0, 1] there exists a nonempty, irreducible shift X with h top (X) = α and with polynomial time decidable language L(X).
The proof will be given in the following section.
Corollary 23 For a real number α the following conditions are equivalent.
2. There exists a shift X with co-c.e.language L(X) and entropy α.
3. There exists an irreducible shift X with polynomial time decidable language L(X) and entropy α.
"2 ⇒ 1": By Proposition 19 and Proposition 16.1."1 ⇒ 3": By Theorem 22. ✷ Corollary 24 There exists an irreducible shift X with polynomial time decidable language L(X) such that its entropy h top (X) is not a computable real number.
Proof: In Remark 18 we already mentioned that there exist right-computable real numbers between 0 and 1 that are not computable.✷ Remark 25 Our main result, Theorem 22, can be considered as an effective version of Proposition 16.2.We will see that by simplifying the proof (by forgetting about effectivity properties) one obtains a second proof of Proposition 16.2.
One may now also ask the other way around whether it might not be possible to prove our main result by effectivizing the proof given above for Proposition 16.2, i.e., by effectivizing the statement of (Lind and Marcus, 1995, Exercise 4.3.7(d))that any real number in [0, 1] is the entropy of an S-gap shift (compare Remark 12).Thus, the question arises whether for an arbitrary right-computable real number α ∈ [0, 1] there is an S-gap shift with entropy α and decidable language.The answer to this question is no, as was observed already by the second author in (Spandl, 2007, Section 7): for a nonempty set S ⊆ N, the language of the S-gap shift X F (S) is decidable if, and only if, S is decidable, and in that case the entropy h top (X F (S) ) is a computable real number.
We have seen that decidability of the language of a shift implies right-computability of the entropy, but not computability of the entropy.One might ask also the inverse question: does computability of the entropy of a shift imply any computability property of the language of the shift, e.g., that is is decidable, perhaps at least if the language is already known to be co-c.e.? The next result shows that this is not the case.In order to formulate it we remind the reader of some notions from computability theory.A language L ⊆ Σ * is many-one reducible to a set S ⊆ N if there is a total computable function h : Σ * → N with x ∈ L ⇐⇒ h(x) ∈ S, for any x ∈ Σ * .Conversely, a set S ⊆ N is many-one reducible to L ⊆ Σ * if there is a total computable function g : N → Σ * with x ∈ S ⇐⇒ g(x) ∈ L, for any x ∈ N. Finally, L ⊆ Σ * and S ⊆ N are called many-one equivalent to each other if L is many-one reducible to S and S is many-one reducible to L. If two sets are many-one equivalent to each other then they have the same computability-theoretic degree of difficulty.For example, if one of them is decidable resp.c.e. resp.co-c.e., then the other one has the same property.
Theorem 26 For any set S ⊆ N with S = ∅ and S = N there exists a shift over the binary alphabet whose topological entropy is equal to zero and whose language is many-one equivalent to S.

Proof:
For s ∈ N we define X per (s) := {c ∈ {0, 1} Z | c contains infinitely many 1's, and, for any k ∈ N, the string 10 k 1 is a substring of c if, and only if, k = s}.
In other words, X per (s) contains exactly the s + 1 bi-infinite binary periodic sequences of the form . . . 10 s 10 s 10 s 1 . . . .
For finite S ⊆ N with S = ∅, we define and for infinite S ⊆ N, we define Let us fix a set S ⊆ N with S = ∅.First, we show that X per (S) is a shift space.The set X per (S) is obviously invariant under the shift map σ, i.e., σ(X per (S)) = X per (S).Furthermore, it is closed.In the case of infinite S, we ensured that X per (S) is closed by adding the sequence 0 Z and the sequences in Σ Z containing exactly one 1.Now, we show that h top (X per (S)) = 0. Since X per (S) is nonempty and a subset of X per (N), it is sufficient to show that h top (X per (N)) = 0. Consider some n > 0. Let us give an upper bound on the number of strings in L(X per (N)) ∩ Σ n .Clearly, In the rest of the proof we assume not only S = ∅, but also S = N.We still have to show that L(X per (S)) is many-one equivalent to S. The set S is many-one reducible to L(X per (S)) because, for s ∈ N, s ∈ S ⇐⇒ 10 s 1 ∈ L(X per (S)).
For the inverse claim (that L(X per (S)) is many-one reducible to S) we distinguish two cases.
1. S is finite.Then L(X per (S)) is obviously decidable.Thus, both sets are decidable.Since furthermore ∅ S N and ∅ L(X per (S)) Σ * , they are many-one equivalent.
2. S is infinite.Then L(X per (S)) contains all strings that contain at most one 1.And a string w with two or more 1's is in L(X per (S)) if, and only if, it satisfies the following two conditions: (A) w contains at least two 1's, and there is some s ≤ |w| such that w is a substring of the periodic bi-infinite sequence . . . 10 s 10 s 10 s 1 . . ., (B) this number s (if is exists, it is obviously uniquely determined) is an element of S.
Condition (A) can be checked directly, and Condition (B) can be checked by a many-one reduction to S. To complete the proof formally, we define a computable reduction function h L(Xper(S)),S : Σ * → N from L(X per (S)) to S. Fix some s yes ∈ S and some s no ∈ S (remember our assumptions S = ∅ and S = N).We define s yes if w contains at most one 1, s no if w contains at least two 1's, but does not satisfy Condition (A), s if w satisfies Condition (A), and s is the number of 0's between any two 1's in w between which there is no other 1.
It is clear that this function is computable and reduces L(X per (S)) to S.
We have shown that X per (S) has all the desired properties.✷ Corollary 27 There exists a shift over the binary alphabet whose entropy is zero and whose language is co-c.e., but not decidable.
Proof: By taking for S in Theorem 26 any co-c.e., but undecidable set, one obtains such a shift.✷

Proofs
In this section, we prove Proposition 21 and Theorem 22.In addition, we give a new proof of Proposition 16.2.Certain sofic shifts (compare Lind and Marcus (1995)) will play an important role.

Definition 28
1.A finite Σ-labeled graph is a pair (V, E) consisting of a finite set V (the set of nodes) and a finite set E ⊆ V × V × Σ (the set of edges labeled with elements of Σ).
2. For a finite Σ-labeled graph (V, E), we define three functions start : E → V , end : E → V , and label : E → Σ giving the three components of a labeled edge as follows: e = (start(e), end(e), label(e)), for any e ∈ E.
3. A bi-infinite path through a finite Σ-labeled graph (V, E) is a function q : Z → E such that end(q(i)) = start(q(i + 1)), for all i ∈ Z.
Lemma 29 If (V, E) is a finite Σ-labeled graph, then the following set is a shift and called the sofic shift defined by the graph: {p ∈ Σ Z | there exists a bi-infinite path q : Z → E through the graph such that p[i] = label(q(i)), for all i ∈ N}.
The shift X(w) can be described as follows: its elements are exactly all bi-infinite binary sequences of the form . . .v −2 v −1 v 0 v 1 v 2 . . .where, for every i ∈ Z, v i is a binary string of length |w| that matches w in the following sense: at every position where v i has a 1, w must have a * .It is equivalent to say that v i can be obtained from w by replacing every * in w either by a 0 or a 1.In the following we will call any element of {0, * } * a pattern.In the next lemma we collect several useful properties of the shifts X(w).
5. For any v, w ∈ {0, * } + , if |v| = |w| and if v can be obtained from w by replacing some * 's in w by 0's, then X(v) ⊆ X(w).
6. Since by Statements 4 and 5 of this lemma, the set L(X(w a 0 |w|•b )) is a subset of L(X(w)), the direction from right to left is clear.For the other direction, assume that v ∈ L(X(w)) and |v| ≤ |w|.
Then v matches a subpattern of ww.Since a ≥ 2, we obtain v ∈ L(X(w a 0 |w|•b ).

Proof of Proposition 21:
The function H defined in Proposition 21 is discontinuous for example in 1 ω , even with respect to the weaker topology on R, mentioned in Proposition 21.Note that , and that the full shift Σ Z = X( * ) has entropy 1 and is irreducible.If H were continuous in 1 ω with respect to the weaker topology on R, then there would be a finite prefix 1 n of 1 ω with n ≥ 2 such that the entropy of any shift X with the property that χ L(X) starts with 1 n would be strictly larger than 1/2.In that case, we set l := ⌈log 2 (n)⌉, and observe that by Lemma 32.3 the shift X( * l 0 l ) has entropy 1/2, but, obviously, all strings of length ≤ l are in the language of this shift, hence, the characteristic sequence of its language starts with 1 n as well.✷ Before we come to the proof of Theorem 22, we need some more preparations.We had defined rightcomputable real numbers as the limits of computable, non-increasing sequences of rational numbers.In fact, one can restrict oneself to dyadic rational numbers, and one can ask that the sequence can be computed quite fast.A sequence (z n ) n∈N of natural numbers is computable in time polynomial in n if there is a Turing machine which, given a binary name of some n ∈ N, computes a binary name of z n in time bounded by a polynomial in n.
Lemma 33 A real number α ∈ [0, 1] is right-computable if, and only if, there is a sequence (z n ) n∈N of natural numbers computable in time polynomial in n such that z n ∈ {1, . . ., 2 n }, for all n, and such that the sequence (z n /2 n ) n∈N is non-increasing and converges to α.
For reasons which will become clear in the proof of Theorem 22, we do not allow z n = 0.

Proof:
The direction from right to left is clear: for a sequence (z n ) n∈N with the properties formulated in Lemma 33 the limit lim n→∞ z n /2 n is a right-computable real number in [0, 1].
We come to the direction from left to right.Let α ∈ [0, 1] be right-computable.Let us assume that a computable, non-increasing sequence (q n ) n∈N of rational numbers with lim n→∞ q n = α is known.The sequence (y n ) n∈N defined by is a computable sequence of integers y n ∈ {1, . . ., 2 n } such that the sequence (y n /2 n ) n∈N is nonincreasing and converges to α.The only problem why we cannot take y n for z n is that the sequence (y n ) n∈N might not be computable in time polynomial in n.Let M be a Turing machine which, without ever stopping, writes the one-way infinite sequence bin(y 0 )#bin(y 1 )#bin(y 2 )# . . .onto a one-way output tape, where, for an integer x, we denote its binary name by bin(x).We define the desired sequence (z n ) n∈N as follows.
For z n , perform the first n steps of the computation of M .Let m be the number of #'s written by M during these steps.In case m = 0, define z n := 2 n .In case m > 0, define Note that y 0 = 1 and that for any x, l ∈ N with x > 0 it is clear that bin(x • 2 l ) = bin(x)0 l .It is clear that the sequence (z n ) n∈N is computable in time polynomial in n.Furthermore, z n ∈ {1, . . ., 2 n } for all n, and the sequence (z n /2 n ) n∈N is non-increasing and converges to α. ✷ The strategy of the proof of Theorem 22 is to consider a computable sequence of integers (z n ) n∈N as in the previous lemma and to construct a decreasing sequence of (sofic) shifts X n with entropy equal to z n /2 n .Then the desired shift X will be defined as the limit of the shifts X n , as in the following lemma.
Proof: The first statement, that X is a subshift of Σ Z , is shown once we have shown that X is nonempty and closed and that σ(X) = X.
"X is nonempty": Consider an arbitrary sequence (x n ) n∈N of elements x n ∈ X n , for each n.Since Σ Z is compact, this sequence has an accumulation point in Σ Z .Let us call it x.Since for all n ∈ N and all m ≥ n we have x m ∈ X m ⊆ X n , we conclude that x is contained in the closure of X n for all n, hence in X n itself for all n, hence x ∈ X.Thus, X is nonempty.
"X is closed": For every n, X n is closed, and the intersection of arbitrarily many closed sets is closed again.
"σ(X) ⊆ X": From σ(X n ) ⊆ X n for all n we obtain σ( n∈N X n ) ⊆ n∈N X n , i.e., σ(X) ⊆ X. "σ(X) ⊇ X": Let us fix some y ∈ X.We have to show that there is some x ∈ X with σ(x) = y.Since y ∈ X n and σ(X n ) ⊇ X n , for all n, for every n ∈ N there is some x n ∈ X n with σ(x n ) = y.As in the proof of "X is nonempty" we can conclude that the sequence (x n ) n∈N has an accumulation point x, and that x is an element of X.The sequence (x n ) n∈N has a subsequence that converges to x.Since σ(x n ) = y for all n and since σ is continuous, we conclude that σ(x) = y.
"L(X) ⊆ n∈N L(X n )": For any subshifts Y, Z of Σ Z with Y ⊆ Z one has L(Y ) ⊆ L(Z).The assertion follows.
"L(X) ⊇ n∈N L(X n )": Let us fix some w ∈ n∈N L(X n ).For every n ∈ N there is some x n ∈ X n such that x n [0 . . .|w| − 1] = w.As in the proof of "X is nonempty" we can conclude that the sequence (x n ) n∈N has an accumulation point x, and that x is an element of X.It is also clear that x[0, . . ., |w|−1] = w.This implies w ∈ L(X).
"h top (X) = lim n→∞ h top (X n )": Since for any subshifts Y, Z of Σ Z with Y ⊆ Z one has h top (Y ) ≤ h top (Z), the sequence h top (X n ) is non-increasing.Since it is bounded from below by 0, the limit lim n→∞ h top (X n ) exists.Furthermore, h top (X) ≤ h top (X n ), for all n, follows as well, hence h top (X) ≤ lim n→∞ h top (X n ).We still have to show that h top (X) cannot be strictly smaller than lim n→∞ h top (X n ).
In order to show this, let us fix some ε > 0. We show that h top (X n ) ≤ h top (X) + ε for almost all n.Remember that for an arbitrary subshift Y of Σ Z , Therefore, there exists some k ≥ 1 with This ends the proof.✷ Proof of Theorem 22: Let α ∈ [0, 1] be a right-computable real number.By Lemma 33 there exists a sequence (z n ) n∈N of integers computable in time polynomial in n with z n ∈ {1, . . ., 2 n } such that the sequence (q n ) n∈N defined by q n := z n /2 n is non-increasing and converges to α.We define a sequence (w n ) n∈N of patterns w n ∈ {0, * } + recursively by Note that z n = 0 for all n and that the assumption that the sequence (q n ) n∈N is non-increasing implies that 4z n ≥ 2z n+1 for all n.We define a sequence (X n ) n∈N of sofic shifts by By Lemma 32.1, X n is nonempty, for each n.Since w n+1 can be obtained from w 4zn n by replacing some * 's in w 4zn n by 0's, Lemma 32.4 and 32.5 tell us that X(w n+1 ) ⊆ X(w n ), for all n.We define By Lemma 34.1, X is a nonempty subshift of Σ Z .We claim that it has all desired properties."h top (X) = α": This is true by Lemma 34.3 because we have constructed X n so that h top (X n ) = q n for all n.We show this by induction.For n = 0 it is true because z 0 = 1, hence q 0 = 1, and X 0 = X(w 0 ) = X( * ) = Σ Z is the full shift, and the entropy of the full shift is equal to 1.For n + 1 we obtain by Lemma 32.3 and by the induction hypothesis Thus, the subshift X has the desired entropy.
We still have to show that X is irreducible and that its language L(X) is decidable in polynomial time.
First, we observe that Secondly, we claim that for any n ∈ N and any Indeed, by Lemma 34.2 L(X) = m∈N L(X(w m )).Thus, the direction from right to left in (1) is clear.
For the direction from left to right, fix some n ∈ N and some v ∈ L(X(w n )) with |v| ≤ |w n |.By Lemma 32.6, v ∈ L(X(w n+1 )).Since |v| ≤ |w n | ≤ |w n+1 |, we can repeat this argument and obtain v ∈ L(X(w n+2 )), and so on.Thus, v ∈ L(X(w m )) for all m ≥ n.Since v ∈ L(X(w m )) for all m < n is clear anyway (due to L(X(w k )) ⊇ L(X(w k+1 )) for all k ∈ N), we obtain v ∈ L(X).This ends the proof of (1)."X is irreducible": Assume that x, z ∈ Σ * are two strings in L(X).Choose n large enough so that |w n | ≥ max{|x|, |z|}.By Lemma 34.2, we observe x, z ∈ L(X(w n )).This implies that x matches a subpattern of w n w n in the sense explained above, i.e., in the sense that it can be obtained from a subpattern of w n w n if the * 's in the subpattern are replaced appropriately by 0's or 1's.The same as for x is true for z.But then, since w n+1 contains w n w n as a subpattern, there is a string y ∈ Σ * such that xyz matches a subpattern of w n+1 w n+1 in the same sense, and, hence, by the same argument, matches a subpattern of w n+2 .By (1), this implies that xyz is an element of L(X).Hence, X is irreducible.
"L(X) is decidable in polynomial time": We claim that the following algorithm decides for an arbitrary input string v ∈ Σ * whether v belongs to L(X) or not.Furthermore, the algorithm can be implemented on a Turing machine that works in time polynomial in |v|.In the algorithm we use a Turing machine M which, given a binary name of any n ∈ N, computes in time polynomial in n the binary name of z n .
Algorithm: Assume that some v ∈ Σ * is the input.First part: For i = 0, 1, 2, . . .compute the binary name of z i (use M for this task) and the string w i until a number i has been found such that |w i | ≥ |v|.Second part: For this i, check whether v is an element of L(X(w i )) by checking whether v matches a subpattern of w i w i .(End of the description of the algorithm) Due to |w n | ≥ 4 n , the search in the first part of the algorithm will be successful, and by (1) it is clear that this algorithm decides whether v is an element of L(X) or not.We show now that the algorithm (when implemented properly on a Turing machine) works in time polynomial in |v|.
Let i be the smallest number i with |w i | ≥ |v|.Since |w n | ≥ 4 n for all n, we obtain i = 0 for |v| ≤ 1 and i ≤ ⌈log 4 (|v|)⌉ ≤ 1 + log 4 (|v|) for |v| > 1.The computation of the numbers z 0 , . . ., z i in the first part of the algorithm can be done in time polynomial in i, hence, certainly in time polynomial in |v|.If, for some k < i, the string w k and the numbers z k , z k+1 are known, one can in time polynomial in the length of w k+1 compute the string w k+1 .Note that w 0 = * .Hence, if |v| ≤ 1, the algorithm will already stop with i = 0. Assume now that |v| > 1.
This and |w k | ≤ |w i | for k ≤ i imply that the strings w 0 , . . ., w i can be computed in time polynomial in |v| (in the first part of the algorithm).Thus, the first part of the algorithm works in time polynomial in |v|.The checking in the second part can be done in detail as follow: for each position in w i w i , one checks whether v matches the subpattern of w i w i starting at this position with length |v| (of course, at the last |v| − 1 positions of w i w i no subpattern of length |v| can start).For each position, this checking can be done in time linear in |v|.Since there are only 2 • |w i | positions, the second part takes only time polynomial in |v|.Thus, the whole algorithm works in time polynomial in |v|.This ends the proof of Theorem 22. ✷ Proof of Proposition 16.2, 2nd variant: For any real number α ∈ [0, 1] there exists a sequence (z n ) n∈N of numbers z n with z n ∈ {1, . . ., 2 n }, for each n, such that the sequence (z n /2 n ) n∈N is non-increasing and converges to α.By defining patterns w n and shifts X(w n ) and, finally, a shift X in exactly the same way as in the proof of Theorem 22, one obtains a nonempty, irreducible shift X with topological entropy α. ✷

Summary and Open Problems
We have answered positively the question by Simonsen (2006) whether there exists a shift with decidable language whose topological entropy is non-computable.In fact, the shift constructed by us is even irreducible and its language is polynomial time decidable.Simonsen (2006) also suggested to study the class of shifts with primitive recursive language, a subclass of the shifts with decidable language.Since any polynomial time language is primitive recursive, our result shows that restriction to shifts with primitive recursive language does not help with respect to the topological entropy: there are even shifts in this smaller class whose topological entropy is non-computable.
In the second paragraph of the introduction we mentioned several positive results concerning the computability of the entropy for certain types of shift spaces.But there is still a gap between those positive results and the negative result of this paper.It remains an interesting task to narrow this gap and to identify more known classes of shifts such that the entropy is computable for the shifts in the class.
On the other hand, we have also shown that computability of the entropy of a shift does not imply any kind of computability of the language of the shift.Especially, it does not imply that the language is decidable, not even if the language happens to be computably co-enumerable.Thus, in a computability theoretic sense the language of a shift and the entropy of the shift are not closely related: decidability of the language does not imply computability of the entropy, and computability of the entropy does not imply decidability of the language.
We have not only shown that there exist shifts with (polynomial time) decidable language and noncomputable entropy.Actually, we have classified exactly the real numbers that can appear as the topological entropy of a subshift of the full shift of all binary bi-infinite sequences with co-c.e.resp.with decidable resp.with polynomial decidable language (the answer is in each case: exactly the right-computable real numbers between 0 and 1).Note that Hochman and Meyerovitch (2007) showed an analogous result for multi-dimensional shifts of finite type: they showed that the real numbers that are the entropy of a multi-dimensional shift of finite type are exactly the non-negative right-computable real numbers.It would be interesting to ask the same question for other types of dynamical systems, modifying slightly two questions raised by Koiran (2001): which real numbers can be the entropy of a one-dimensional cellular automaton (note that Hurd et al. (1992) have shown that there is no algorithm which, given a one-dimensional cellular automaton, computes its entropy with any desired precision) or of a piecewise affine map as studied by Koiran (2001)?
for the set of all bi-infinite binary sequences.For p ∈ Σ Z and n ∈ Z, we write p[n] for the value of p on input n, and p[m . . .n] := p[m] . . .p[n], if m ≤ n, and p[m . . .n] := λ, if m > n.For w ∈ Σ * we set wΣ ω := {p ∈ Σ ω | w is a prefix of p} and denote by |w| the length of w.