Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

1 Introduction

1.1 Turing Machines and Their Generalization

Turing machines have been studied since the 30 s as the standard formalization of the abstract concept of computation. However, more recently, Turing machines have also been studied in the context of dynamical systems. In [20], two dynamical systems were associated to a Turing machine, one with a ‘moving tape’ and one with a ‘moving head’. After that, there has been a lot of study of dynamics of Turing machines, see for example [1, 11, 12, 15, 16, 19, 28]. Another connection between Turing machines and dynamics is that they can be used to define subshifts. Subshifts whose forbidden patterns are given by a Turing machine are called effectively closed, computable, or \(\varPi ^0_1\) subshifts, and especially in multiple dimensions, they are central to the topic due to the strong links known between SFTs, sofic shifts and \(\varPi ^0_1\)-subshifts, see for example [4, 9]. An intrinsic notion of Turing machine computation for these subshifts on general groups was proposed in [3], and a similar study was performed with finite state machines in [26, 27].

In all these papers, the definition of a Turing machine is (up to notational differences and switching between the moving tape and moving head model) the following: A Turing machine is a function \(T : \varSigma ^\mathbb {Z}\times Q \rightarrow \varSigma ^\mathbb {Z}\times Q\) defined by a local rule \(f_T : \varSigma \times Q \rightarrow \varSigma \times Q \times \{-1,0,1\}\) by the formula

$$\begin{aligned} T(x, q) = (\sigma _{-d}(\tilde{x}), q') \text{ if } f_T(x_0, q) = (a,q',d), \end{aligned}$$

where \(\sigma : \varSigma ^{\mathbb {Z}} \rightarrow \varSigma ^{\mathbb {Z}}\) is the shift action given by \(\sigma _{d}(x)_{z} = x_{z-d}\), \(\tilde{x}_0 = a\) and \(\tilde{x}|_{\mathbb {Z}\setminus \{0\}} = x|_{\mathbb {Z}\setminus \{0\}}\). In this paper, such Turing machines are called classical Turing machines. This definition (as far as we know) certainly suffices to capture all computational and dynamical properties of interest, but it also has some undesirable properties: The composition of two classical Turing machines – and even the square of a classical Turing machine – is typically not a classical Turing machine, and the reverse of a reversible classical Turing machine is not always a classical Turing machine.

In this paper, we give a more general definition of a Turing machine, by allowing it to move the head and modify cells at an arbitrary (but bounded) distance on each timestep. With the new definition, we get rid of both issues: With our definition,

  • Turing machines are closed under composition, forming a monoid, and

  • reversible Turing machines are closed under inversion, forming a group.

We also characterize reversibility of classical Turing machines in combinatorial terms, and show what their inverses look like. Our definition of a Turing machine originated in the yet unpublished work [25], where the group of such machines was studied on general \(\mathbb {Z}\)-subshifts (with somewhat different objectives).

These benefits of the definition should be compared to the benefits of allowing arbitrary radii in the definition of a cellular automaton: If we define cellular automata as having a fixed radius of, say, 3, then the inverse map of a reversible cellular automaton is not always a cellular automaton, as the inverse of a cellular automaton may have a much larger radius [8]. Similarly, with a fixed radius, the composition of two cellular automata is not necessarily a cellular automaton.

We give our Turing machine definitions in two ways, with a moving tape and with a moving head, as done in [20]. The moving tape point of view is often the more useful one when studying one-step behavior and invariant measures, whereas we find the moving head point of view easier for constructing examples, and when we need to track the movement of multiple heads. The moving head Turing machines are in fact a subset of cellular automata on a particular kind of subshift. The moving tape machine on the other hand is a generalization of the topological full group of a subshift, which is an important concept in particular in the theory of orbit equivalence. For topological full groups of minimal subshifts, see for example [13, 14, 17]. The (one-sided) SFT case is studied in [24].

1.2 Our Results and Comparisons with Other Groups

In Sect. 2, we define our basic models and prove basic results about them. In Sect. 2.3, we define the uniform measure and show as a simple application of it that injectivity and surjectivity are both equal to reversibility.

Our results have interesting counterparts in the theory of cellular automata: One of the main theorems in the theory of cellular automata is that injectivity implies surjectivity, and (global) bijectivity is equivalent to having a cellular automaton inverse map. Furthermore, one can attach to a reversible one- or two-dimensional cellular automaton its ‘average drift’, that is, the speed at which information moves when the map is applied, and this is a homomorphism from the group of cellular automata to a sublattice of \(\mathbb {Q}^d\) (where d is the corresponding dimension), see [18]. In Sect. 3 we use the uniform measure to define an analog, the ‘average movement’ homomorphism for Turing machines.

In Sect. 3, we define some interesting subgroups of the group of Turing machines. First, we define the local permutations – Turing machines that never move the head at all –, and their generalization to oblivious Turing machines where movement is allowed, but is independent of the tape contents. The group of oblivious Turing machines can be seen as a kind of generalization of lamplighter groups. It is easy to show that these groups are amenable but not residually finite. What makes them interesting is that the group of oblivious Turing machines is finitely generated, due to the existence of universal reversible logical gates. It turns out that strong enough universality for reversible gates was proved only recently [2].

We also define the group of (reversible) finite-state machines – Turing machines that never modify the tape. Here, we show how to embed a free group with a similar technique as used in [10], proving that this group is non-amenable. By considering the action of Turing machines on periodic points,Footnote 1 we show that the group of finite-state automata is residually finite, and the group of Turing machines is locally embeddable in finite groups (in particular sofic).

Our definition of a Turing machine can be seen as a generalization of the topological full group, and in particular finite-state machines with a single state exactly correspond to this group. Thus, it is interesting to compare the results of Sect. 3 to known results about topological full groups. In [14, 17] it is shown that the topological full group of a minimal subshift is locally embeddable in finite groups and amenable, while we show that on full shifts, this group is non-amenable, but the whole group of Turing machines is LEF.Footnote 2

Our original motivation for defining these subgroups – finite-state machines and local permutations – was to study the question of whether they generate all reversible Turing machines. Namely, a reversible Turing machine changes the tape contents at the position of the head and then moves, in a globally reversible way. Thus, it is a natural question whether every reversible Turing machine can actually be split into reversible tape changes (actions by local permutations) and reversible moves (finite-state automata). We show that this is not the case, by showing that Turing machines can have arbitrarily small average movement, but that elementary ones have only a discrete sublattice of possible average movements. We do not know whether this is the only restriction.

In Sect. 4, we show that the group of Turing machines is recursively presented and has a decidable word problem, but that its torsion problem (the problem of deciding if a given element has finite order) is undecidable in all dimensions. For finite-state machines, we show that the torsion problem is decidable in dimension one, but is undecidable in higher dimensions, even when we restrict to a finitely generated subgroup. We note a similar situation with Thompson’s group V: its torsion problem is decidable in one-dimension, but undecidable in higher dimensions [5, 6].

1.3 Preliminaries

In this section we present general definitions and settle the notation which is used throughout the article. The review of these concepts will be brief and focused on the dynamical aspects. For a more complete introduction the reader may refer to [22] or [7] for the group theoretic aspects. Let \(\mathcal {A}\) be a finite alphabet. The set \(\mathcal {A}^{\mathbb {Z}^d} = \{ x: \mathbb {Z}^d\rightarrow \mathcal {A}\}\) equipped with the left group action \(\sigma : \mathbb {Z}^d\times \mathcal {A}^{\mathbb {Z}^d} \rightarrow \mathcal {A}^{\mathbb {Z}^d}\) defined by \((\sigma _{\varvec{v}}(x))_{\varvec{u}} = x_{\varvec{u}-\varvec{v}}\) is a full shift. The elements \(a \in \mathcal {A}\) and \(x \in \mathcal {A}^{\mathbb {Z}^d}\) are called symbols and configurations respectively. With the discrete topology on \(\mathcal {A}\) the set of configurations \(\mathcal {A}^{\mathbb {Z}^d}\) is compact and given by the metric \(d(x,y) = 2^{-\inf (\{ |\varvec{v}| \in \mathbb {N}\mid \ x_{\varvec{v}} \ne y_{\varvec{v}} \})}\) where \(|\varvec{v}|\) is a norm on \(\mathbb {Z}^d\) (we settle here for the \(||\cdot ||_{\infty }\) norm). This topology has the cylinders \([a]_{\varvec{v}} = \{x \in \mathcal {A}^{\mathbb {Z}^d} | x_{\varvec{v}} = a\in \mathcal {A}\}\) as a subbasis. A support is a finite subset \(F \subset \mathbb {Z}^d\). Given a support F, a pattern with support F is an element p of \(\mathcal {A}^F\). We also denote the cylinder generated by p in position \(\varvec{v}\) as \([p]_{\varvec{v}} = \bigcap _{\varvec{u} \in F} [p_{\varvec{u}}]_{\varvec{v}+\varvec{u}}\), and \([p]= [p]_{\varvec{0}}\).

Definition 1

A subset X of \(\mathcal {A}^{\mathbb {Z}^d}\) is a subshift if it is \(\sigma \)-invariant – \(\sigma (X)\subset X\) – and closed for the cylinder topology. Equivalently, X is a subshift if and only if there exists a set of forbidden patterns \(\mathcal {F}\) that defines it.

$$X = \bigcap _{p \in \mathcal {F}, \varvec{v} \in \mathbb {Z}^d}{\mathcal {A}^{\mathbb {Z}^d} \setminus [p]_{\varvec{v}}}.$$

Let XY be subshifts over alphabets \(\mathcal {A}\) and \(\mathcal {B}\) respectively. A continuous \(\mathbb {Z}^d\)-equivariant map \(\phi : X \rightarrow Y\) between subshifts is called a morphism. A well-known Theorem of Curtis, Lyndon and Hedlund which can be found in full generality in [7] asserts that morphisms are equivalent to maps defined by local rules as follows: There exists a finite \(F \subset \mathbb {Z}^d\) and \(\varPhi : \mathcal {A}^{F} \rightarrow \mathcal {B}\) such that \(\forall x \in X: \phi (x)_{\varvec{v}} = \varPhi (\sigma _{-\varvec{v}}(x)|_F)\). If \(\phi \) is an endomorphism then we refer to it as a cellular automaton. A cellular automaton is said to be reversible if there exists a cellular automaton \(\phi ^{-1}\) such that \(\phi \circ \phi ^{-1} = \phi ^{-1} \circ \phi = \mathrm {id}\). It is well known that reversibility is equivalent to bijectivity.

Throughout this article we use the following notation inspired by Turing machines. We denote by \(\varSigma = \{0,\dots ,n-1\}\) the set of tape symbols and \(Q = \{1,\dots ,k\}\) the set of states. We also use exclusively the symbols \(n = |\varSigma |\) for the size of the alphabet and \(k = |Q|\) for the number of states. Given a function \(f : \varOmega \rightarrow \prod _{i \in I}A_i\) we denote by \(f_i\) the projection of f to the i-th coordinate.

2 Two Models for Turing Machine Groups

In this section we define our generalized Turing machine model, and the group of Turing machines. In fact, we give two definitions for this group, one with a moving head and one with a moving tape as in [20]. We show that – except in the case of a trivial alphabet – these groups are isomorphic.Footnote 3 Furthermore, both can be defined both by local rules and ‘dynamically’, that is, in terms of continuity and the shift. In the moving tape model we characterize reversibility as preservation of the uniform measure. Finally we conclude this section by characterizing reversibility for classical Turing machines in our setting.

2.1 The Moving Head Model

Consider \(Q = \{1,\dots ,k \}\) and let \(X_k\) be the subshift with alphabet \(Q \cup \{0\}\) such that in each configuration the number of non-zero symbols is at most one.

$$\begin{aligned} X_k = \{ x \in \{0,1,\ldots ,k\}^{\mathbb {Z}^d} \ |\ 0 \notin \{x_{\varvec{u}}, x_{\varvec{v}}\} \implies \varvec{u} = \varvec{v} \}. \end{aligned}$$

In particular \(X_0 = \{0^{\mathbb {Z}^d}\}\) and \(i < j \implies X_i \subsetneq X_j\). Let also \(\varSigma = \{0,\dots , n-1\}\) and \(X_{n,k} = \varSigma ^{\mathbb {Z}^d} \times X_{k}\). For the case \(d = 1\), configurations in \(X_{n,k}\) represent a bi-infinite tape filled with symbols in \(\varSigma \) possibly containing a head that has a state in Q. Note that there might be no head in a configuration.

Definition 2

Given a function

$$\begin{aligned} f : \varSigma ^{F} \times Q \rightarrow \varSigma ^{F'} \times Q \times \mathbb {Z}^d, \end{aligned}$$

where \(F,F'\) are finite subsets of \(\mathbb {Z}^d\), we can define a map \(T_f : X_{n,k} \rightarrow X_{n,k}\) as follows: Let \((x,y) \in X_{n,k}\). If there is no \({\varvec{v}} \in \mathbb {Z}^d\) such that \(y_{\varvec{v}} \ne 0\) then \(T(x,y) = (x,y)\). Otherwise let \(p = \sigma _{-{\varvec{v}}}(x)|_{F}\), \(q = y_{\varvec{v}} \ne 0\) and \(f(p,q) = (p',q',{\varvec{d}}).\) Then \(T(x,y) = (\tilde{x},\tilde{y})\) where:

$$\tilde{x}_{\varvec{t}} = {\left\{ \begin{array}{ll} x_{\varvec{t}} &{} \text { if } {\varvec{t}}-{\varvec{v}} \notin F' \\ p'_{{\varvec{t}}-{\varvec{v}}}&{}\text { if } {\varvec{t}}-{\varvec{v}} \in F' \end{array}\right. },\ \ \ \ \tilde{y}_{\varvec{t}} = {\left\{ \begin{array}{ll} q' &{} \text { if } {\varvec{t}} = {\varvec{v}}+{\varvec{d}} \\ 0&{}\text { otherwise } \end{array}\right. }$$

Such \(T = T_f\) is called a (moving head) (d, n, k)-Turing machine, and f is its local rule. If there exists a (dnk)-Turing machine \(T^{-1}\) such that \(T \circ T^{-1} = T^{-1} \circ T = \mathrm {id}\), we say T is reversible.

Note that \(\sigma _{-{\varvec{v}}}(x)|_{F}\) is the F-shaped pattern ‘at’ \(\varvec{v}\), but we do not write \(x|_{F + {\varvec{v}}}\) because we want the pattern we read from x to have F as its domain.

This definition corresponds to classical Turing machines with the moving head model when \(d = 1\), \(F = F' = \{0\}\) and \(f(x,q)_3 \in \{-1,0,1\}\) for all xq. By possibly changing the local rule f, we can always choose \(F = [-r_i, r_i]^d\) and \(F' = [-r_o,r_o]^d\) for some \(r_i, r_o \in \mathbb {N}\), without changing the Turing machine \(T_f\) it defines. The minimal such \(r_i\) is called the in-radius of T, and the minimal \(r_o\) is called the out-radius of T. We say the in-radius of a Turing machine is \(-1\) if there is no dependence on input, that is, the neighborhood \([-r_i, r_i]\) can be replaced by the empty set. Since \(\varSigma ^{F} \times Q\) is finite, the third component of f(pq) takes only finitely many values \(\varvec{v} \in \mathbb {Z}^d\). The maximum of \(|\varvec{v}|\) for such \(\varvec{v}\) is called the move-radius of T. Finally, the maximum of all these three radii is called the radius of T. In this terminology, classical Turing machines are those with in- and out-radius 0, and move-radius 1.

Definition 3

Define \(\mathrm {TM}(\mathbb {Z}^d,n,k)\) as the set of (dnk)-Turing machines and \(\mathrm {RTM}(\mathbb {Z}^d,n,k)\) the set of reversible (dnk)-Turing machines.

In some parts of this article we just consider \(d = 1\). In this case we simplify the notation and just write \(\mathrm {RTM}(n,k) := \mathrm {RTM}(\mathbb {Z},n,k)\).

Of course, we want \(\mathrm {TM}(\mathbb {Z}^d,n,k)\) to be a monoid and \(\mathrm {RTM}(\mathbb {Z}^d,n,k)\) a group under function composition. This is indeed the case, and one can prove this directly by constructing local rules for the inverse of a reversible Turing machine and composition of two Turing machines. However, it is much easier to extract this from the following characterization of Turing machines as a particular kind of cellular automaton.

For a subshift X, we denote by \(\mathrm {End}(X)\) the monoid of endomorphisms of X and \(\mathrm {Aut}(X)\) the group of automorphisms of X.

Proposition 1

Let nk be positive integers and \(Y = X_{n,0}\). Then:

$$\begin{aligned} \mathrm {TM}(\mathbb {Z}^d,n,k)&= \{ \phi \in \mathrm {End}(X_{n,k}) \mid \phi |_Y = \mathrm {id}, \phi ^{-1}(Y) = Y \} \\ \mathrm {RTM}(\mathbb {Z}^d,n,k)&= \{ \phi \in \mathrm {Aut}(X_{n,k}) \mid \phi |_Y = \mathrm {id}\} \end{aligned}$$

Corollary 1

We have \(\phi \in \mathrm {RTM}(\mathbb {Z}^d,n,k)\) if and only if \(\phi \in \mathrm {TM}(\mathbb {Z}^d,n,k)\) and \(\phi \) is bijective.

Clearly, the conditions of Proposition 1 are preserved under function composition and inversion. Thus:

Corollary 2

Under function composition, \((\mathrm {TM}(\mathbb {Z}^d,n,k), \circ )\) is a submonoid of \(\mathrm {End}(X_{n,k})\) and \((\mathrm {RTM}(\mathbb {Z}^d,n,k), \circ )\) is a group.

We usually omit the function composition symbol, and use the notations \(\mathrm {TM}(\mathbb {Z}^d,n,k)\) and \(\mathrm {RTM}(\mathbb {Z}^d,n,k)\) to refer to the corresponding monoids and groups.

2.2 The Moving Tape Model

It’s also possible to consider the position of the Turing machine as fixed at 0, and move the tape instead, to obtain the moving tape Turing machine model. In [20], where Turing machines are studied as dynamical systems, the moving head model and moving tape model give non-conjugate dynamical systems. However, the abstract monoids defined by the two points of view turn out to be equal, and we obtain an equivalent definition of the group of Turing machines.

As in the previous section, we begin with a definition using local rules.

Definition 4

Given a function \(f : \varSigma ^{F} \times Q \rightarrow \varSigma ^{F'} \times Q \times \mathbb {Z}^d\), where \(F,F'\) are finite subsets of \(\mathbb {Z}^d\), we can define a map \(T_{f} : \varSigma ^{\mathbb {Z}^d} \times Q \rightarrow \varSigma ^{\mathbb {Z}^d} \times Q\) as follows: If \(f(x|_F, q) = (p, q', \varvec{d})\), then \(T_f(x, q) = (\sigma _{\varvec{d}}(y), q')\) where

$$ y_{\varvec{u}} = \left\{ \begin{array}{cc} x_{\varvec{u}}, &{}\text{ if } \varvec{u} \notin F' \\ p_{\varvec{u}}, &{}\text{ if } \varvec{u} \in F', \end{array}\right. $$

is called the moving tape Turing machine defined by f.

These machines also have the following characterization with a slightly more dynamical feel to it. Say that x and y are asymptotic, and write \(x \sim y\), if \(d(\sigma _{\varvec{v}}(x), \sigma _{\varvec{v}}(y)) \rightarrow 0\) as \(|\varvec{v}| \rightarrow \infty \). We write \(x \sim _m y\) if \(x_{\varvec{v}} = y_{\varvec{v}}\) for all \(|\varvec{v}| \ge m\), and clearly \(x \sim y \iff \exists m: x \sim _m y\).

Lemma 1

Let \(T : \varSigma ^{\mathbb {Z}^d} \times Q \rightarrow \varSigma ^{\mathbb {Z}^d} \times Q\) be a function. Then T is a moving tape Turing machine if and only if it is continuous, and for a continuous function \(s : \varSigma ^{\mathbb {Z}^d} \times Q \rightarrow \mathbb {Z}^d\) and \(a \in \mathbb {N}\) we have \(T(x, q)_1 \sim _a \sigma _{s(x, q)}(x)\) for all \((x, q) \in \varSigma ^{\mathbb {Z}^d} \times Q\).

Note that in place of a we could allow a continuous \(\mathbb {N}\)-valued function of (xq) – the definition obtained would be equivalent, as the a of the present definition can be taken as the maximum of such a function.

We call the function s in the definition of these machines the shift indicator of T, as it indicates how much the tape is shifted depending on the local configuration around 0. In the theory of orbit equivalence and topological full groups, the analogs of s are usually called cocycles. We also define in-, out- and move-radii of moving tape Turing machines similarly as in the moving head case.

We note that it is not enough that \(T(x, q)_1 \sim \sigma _{s(x, q)}(x)\) for all \((x, q) \in \varSigma ^{\mathbb {Z}^d} \times Q\): Let \(Q = \{1\}\) and consider the function \(T : \varSigma ^{\mathbb {Z}} \times Q \rightarrow \varSigma ^{\mathbb {Z}} \times Q\) defined by \((T(x, 1)_1)_i = x_{-i}\) if \(x_{[-|i|+1,|i|-1]} = 0^{2i-1}\) and \(\{x_i,x_{-i}\} \ne \{0\}\), and \((T(x, 1)_1)_i = x_i\) otherwise. Clearly this map is continuous, and the constant-\(\varvec{0}\) map \(s(x,q) = \varvec{0}\) gives a shift-indicator for it. However, T is not defined by any local rule since it can modify the tape arbitrarily far from the origin.

As for moving head machines, it is easy to see (either by constructing local rules or by applying the dynamical definition) that the composition of two moving tape Turing machines is again a moving tape Turing machine. This allows us to proceed as before and define their monoid and group.

Definition 5

We denote by \(\mathrm {TM}_{\mathrm {fix}}(\mathbb {Z}^d,n,k)\) and \(\mathrm {RTM}_{\mathrm {fix}}(\mathbb {Z}^d,n,k)\) the monoid of moving tape (dnk)-Turing machines and the group of reversible moving tape (dnk)-Turing machines respectively.

Now, let us show that the moving head and moving tape models are equivalent. First, there is a natural epimorphism \(\varPsi : \mathrm {TM}(\mathbb {Z}^d,n,k) \rightarrow \mathrm {TM}_{\mathrm {fix}}(\mathbb {Z}^d,n,k)\). Namely, let \(T \in \mathrm {TM}(\mathbb {Z}^d,n,k)\). We define \(\varPsi (T)\) as follows: Let \((x,q) \in \varSigma ^{\mathbb {Z}^d}\times Q\). Letting y be the configuration such that \(y_{\varvec{0}} = q\) and 0 everywhere else and \(T(x,y) = (x',y')\) such that \(y'_{\varvec{v}} = q'\) we define \(\varPsi (T)(x,q) = (\sigma _{-\varvec{v}}(x'),q')\). This is clearly an epimorphism but it’s not necessarily injective if \(n = 1\). Indeed, we have that \(\mathrm {RTM}_{\mathrm {fix}}(\mathbb {Z}^d,1,k) \cong S_k\) and \(\mathrm {TM}_{\mathrm {fix}}(\mathbb {Z}^d,1,k)\) is isomorphic to the monoid of all functions from \(\{1,\dots ,k\}\) to itself while \(\mathbb {Z}^d \le \mathrm {RTM}(\mathbb {Z}^d,1,k) \le \mathrm {TM}(\mathbb {Z}^d,1,k)\). Nevertheless, if \(n \ge 2\) this mapping is an isomorphism.

Lemma 2

If \(n \ge 2\) then:

$$\begin{aligned} \mathrm {TM}_{\mathrm {fix}}(\mathbb {Z}^d,n,k)&\cong \mathrm {TM}(\mathbb {Z}^d,n,k) \\ \mathrm {RTM}_{\mathrm {fix}}(\mathbb {Z}^d,n,k)&\cong \mathrm {RTM}(\mathbb {Z}^d,n,k). \end{aligned}$$

The previous result means that besides the trivial case \(n = 1\) where the tape plays no role, we can study the properties of these groups using any model.

2.3 The Uniform Measure and Reversibility

Consider the space \(\varSigma ^{\mathbb {Z}^d} \times Q\). We define a measure \(\mu \) on \(\mathcal {B}(\varSigma ^{\mathbb {Z}^d} \times Q)\) as the product measure of the uniform Bernoulli measure and the uniform discrete measure. That is, if F is a finite subset of \(\mathbb {Z}^d\) and \(p \in \varSigma ^F\), then:

$$\mu ([p]\times \{q\}) = \frac{1}{kn^{|F|}}.$$

With this measure in hand we can prove the following:

Theorem 1

Let \(T \in \mathrm {TM}_{\mathrm {fix}}(\mathbb {Z}^d,n,k)\). Then the following are equivalent:

  1. 1.

    T is injective.

  2. 2.

    T is surjective.

  3. 3.

    \(T \in \mathrm {RTM}_{\mathrm {fix}}(\mathbb {Z}^d,n,k)\).

  4. 4.

    T preserves the uniform measure (\(\mu (T^{-1}(A)) = \mu (A)\) for all Borel sets A).

  5. 5.

    \(\mu (T(A)) = \mu (A)\) for all Borel sets A.

Remark 1

The proof is based on showing that every Turing machine is a local homeomorphism and preserves the measure of all large-radius cylinders in the forward sense. Note that preserving the measure of large-radius cylinders in the forward sense does not imply preserving the measure of all Borel sets, in general. For example, the machine which turns the symbol in \(F =\{\varvec{0}\}\) to 0 without moving the head satisfies \(\mu ([p]) = \mu (T[p])\) for any \(p \in \varSigma ^S\) with \(S \supset F\). But \(\mu ([]) = 1\) and \(\mu (T([]))=\mu ([0]) =1/2\), where \([] = \{0,\ldots ,n\}^\mathbb {Z}\) is the cylinder defined by the empty word.

Using the measure, one can define the average movement of a Turing machine.

Definition 6

Let \(T \in \mathrm {TM}_{\mathrm {fix}}(\mathbb {Z}^d,n,k)\) with shift indicator function \(s : \varSigma ^{\mathbb {Z}^d} \times Q \rightarrow \mathbb {Z}^d\). We define the average movement \(\alpha (T) \in \mathbb {Q}^d\) as

$$\begin{aligned} \alpha (T) := \mathbb {E}_{\mu }(s) = \int _{\varSigma ^{\mathbb {Z}^d}\times Q} s(x,q) d\mu , \end{aligned}$$

where \(\mu \) is the uniform measure defined in Subsect. 2.3. For T in \(\mathrm {TM}(\mathbb {Z}^d,n,k)\) we define \(\alpha \) as the application to its image under the canonical epimorphism \(\varPsi \), that is, \(\alpha (T) := \alpha (\varPsi (T))\).

We remark that this integral is actually a finite sum over the cylinders \(p \in \varSigma ^F\). Nonetheless, its expression as an expected value allows us to show the following: If \(T_1,T_2 \in \mathrm {RTM}(\mathbb {Z}^d,n,k)\) then \(\alpha (T_1 \circ T_2) = \alpha (T_1)+\alpha (T_2)\). Indeed, as reversibility implies measure-preservation, we have that

$$\begin{aligned} \mathbb {E}_{\mu }(s_{T_1 \circ T_2}) = \mathbb {E}_{\mu }(s_{T_1}\circ T_2+s_{T_2}) = \mathbb {E}_{\mu }(s_{T_1})+ \mathbb {E}_{\mu }(s_{T_2}). \end{aligned}$$

This means that \(\alpha \) defines an homomorphism from \(\mathrm {RTM}(\mathbb {Z}^d,n,k)\) to \(\mathbb {Q}^d\).

2.4 Classical Turing Machines

As discussed in the introduction, we say a one-dimensional Turing machine is classical if its in- and out-radii are 0, and its move-radius is 1. In this section, we characterize reversibility in classical Turing machines. If \(T_0\) has in-, out- and move-radius 0, that is, \(T_0\) only performs a permutation of the set of pairs \((s,q) \in \varSigma \times Q\) at the position of the head, then we say \(T_0\) is a state-symbol permutation. If \(T_1\) has in-radius \(-1\), never modifies the tape, and only makes movements by vectors in \(\{-1,0,1\}\), then \(T_1\) is called a state-dependent shift.Footnote 4

Theorem 2

A classical Turing machine T is reversible if and only if it is of the form \(T_1 \circ T_0\) where \(T_0\) is a state-symbol permutation and \(T_1\) is a state-dependent shift.

It follows that the inverse of a reversible classical Turing machine is always of the form \(T_0 \circ T_1\) where \(T_0\) is a state-symbol permutation and \(T_1\) is a state-dependent shift. In the terminology of Sect. 3, the theorem implies that all reversible classical Turing machines are elementary.

3 Properties of \(\mathrm {RTM}\) and Interesting Subgroups

In this section we study some properties of \(\mathrm {RTM}\) by studying the subgroups it contains. We introduce \(\mathrm {LP}\), the group of local permutations where the head does not move and \(\mathrm {RFA}\), the group of (reversible) finite-state automata which do not change the tape. These groups separately capture the dynamics of changing the tape and moving the head. We also define the group of oblivious Turing machines \(\mathrm {OB}\) as an extension of \(\mathrm {LP}\) where arbitrary tape-independent moves are allowed, and \(\mathrm {EL}\) as the group of elementary Turing machines, which are compositions of finite-state automata and oblivious Turing machines.

First, we observe that \(\alpha (\mathrm {RTM}(\mathbb {Z}^d,n,k))\) is not finitely generated, and thus:

Theorem 3

For \(n \ge 2\), the group \(\mathrm {RTM}(\mathbb {Z}^d,n,k)\) is not finitely generated.

Although \(\alpha \) is not a homomorphism on \(\mathrm {TM}(\mathbb {Z}^d,n,k)\), using Theorem 1, we obtain that \(\mathrm {TM}(\mathbb {Z}^d,n,k)\) cannot be finitely generated either.

3.1 Local Permutations and Oblivious Turing Machines

For \(\varvec{v} \in \mathbb {Z}^d\), define the machine \(T_{\varvec{v}}\) which does not modifies the state or the tape, and moves the head by the vector \(\varvec{v}\) on each step. Denote the group of such machines by \(\mathrm {Shift}(\mathbb {Z}^d,n,k)\). Clearly \(\alpha : \mathrm {Shift}(\mathbb {Z}^d,n,k) \rightarrow \mathbb {Z}^d\) is a group isomorphism. Define also \(\mathrm {SP}(\mathbb {Z}^d,n,k)\) as the state-permutations: Turing machines that never move and only permute their state as a function of the tape.

Definition 7

We define the group \(\mathrm {LP}(\mathbb {Z}^d,n,k)\) of local permutations as the subgroup of reversible (dnk)-Turing machines whose shift-indicator is the constant-\(\varvec{0}\) function. Define also \(\mathrm {OB}(\mathbb {Z}^d,n,k) = \langle \mathrm {Shift}(\mathbb {Z}^d,n,k), \mathrm {LP}(\mathbb {Z}^d,n,k) \rangle \), the group of oblivious Turing machines.

In other words, \(\mathrm {LP}(\mathbb {Z}^d,n,k)\) is the group of reversible machines that do not move the head, and \(\mathrm {OB}(\mathbb {Z}^d,n,k)\) is the group of reversible Turing machines whose head movement is independent of the tape contents. Note that in the definition of both groups, we allow changing the state as a function of the tape, and vice versa. Clearly \(\mathrm {Shift}(\mathbb {Z}^d,n,k) \le \mathrm {OB}(\mathbb {Z}^d,n,k)\) and \(\mathrm {SP}(\mathbb {Z}^d,n,k) \le \mathrm {LP}(\mathbb {Z}^d,n,k)\).

Proposition 2

Let \(S_{\infty }\) be the group of permutations of \(\mathbb {N}\) of finite support. Then for \(n \ge 2\), \(S_{\infty } \hookrightarrow \mathrm {LP}(\mathbb {Z}^d,n,k)\).

In particular, \(\mathrm {RTM}(\mathbb {Z}^d,n,k)\) is not residually finite. By Cayley’s theorem, Proposition 2 also implies that \(\mathrm {RTM}(\mathbb {Z}^d,n,k)\) contains all finite groups.

Proposition 3

The group \(\mathrm {OB}(\mathbb {Z}^d,n,k)\) is amenable.

Write \(H \wr G\) for the restricted wreath product.

Proposition 4

If G is a finite group and \(n \ge 2\), then \(G \wr \mathbb {Z}^d \hookrightarrow \mathrm {OB}(\mathbb {Z}^d,n,k)\).

The groups \(G \wr \mathbb {Z}^d\) are sometimes called generalized lamplighter groups. In fact, \(\mathrm {OB}(\mathbb {Z}^d,n,k)\) can in some sense be seen as a generalized generalized lamplighter group, since the subgroup of \(\mathrm {OB}(\mathbb {Z}^d,n,k)\) generated by the local permutations \(\mathrm {LP}(\mathbb {Z}^d,n,1)\) with radius 0 and \(\mathrm {Shift}(\mathbb {Z}^d,n,1)\) is isomorphic to \(A \cong S_n \wr \mathbb {Z}^d\).

Interestingly, just like the generalized lamplighter groups, we can show that the whole group \(\mathrm {OB}(\mathbb {Z}^d,n,k)\) is finitely generated.

Theorem 4

\(\mathrm {OB}(\mathbb {Z}^d,n,k)\) is finitely generated.

3.2 Finite-State Automata

Definition 8

We define the reversible finite-state automata \(\mathrm {RFA}(\mathbb {Z}^d,n,k)\) as the group of reversible (dnk)-Turing machines that do not change the tape. That is, the local rules are of the form \(f(p,q) = (p,q',z)\) for all entries \(p \in \varSigma ^F, q \in Q\).

This group is orthogonal to \(\mathrm {OB}(\mathbb {Z}^d,n,k)\) in the following sense:

Proposition 5

$$\begin{aligned} \mathrm {RFA}(\mathbb {Z}^d,n,k) \cap \mathrm {LP}(\mathbb {Z}^d,n,k)&= \mathrm {SP}(\mathbb {Z}^d,n,k) \\ \mathrm {RFA}(\mathbb {Z}^d,n,k) \cap \mathrm {OB}(\mathbb {Z}^d,n,k)&= \langle \mathrm {SP}(\mathbb {Z}^d,n,k), \mathrm {Shift}(\mathbb {Z}^d,n,k) \rangle \end{aligned}$$

As usual, the case \(n = 1\) is not particularly interesting, and we have that \(\mathrm {RFA}(\mathbb {Z}^d,1,k) \cong \mathrm {RTM}(\mathbb {Z}^d,1,k)\). In the general case the group is more complex.

We now prove that the \(\mathrm {RFA}(\mathbb {Z}^d,n,k)\)-groups are non-amenable. In [10], a similar idea is used to prove that there exists a minimal \(\mathbb {Z}^2\)-subshift whose topological full group is not amenable.

Proposition 6

Let \(n \ge 2\). For all \(m \in \mathbb {N}\) we have that:

$$\underset{m \text { times}}{\underbrace{\mathbb {Z}/2\mathbb {Z}*\dots *\mathbb {Z}/2\mathbb {Z}}} \hookrightarrow \mathrm {RFA}(\mathbb {Z}^d,n,k)$$

Corollary 3

For \(n \ge 2\), \(\mathrm {RFA}(\mathbb {Z}^d,n,k)\) and \(\mathrm {RTM}(\mathbb {Z}^d,n,k)\) contain the free group on two elements. In particular, they are not amenable.

By standard marker constructions, one can also embed all finite groups and finitely generated abelian groups in \(\mathrm {RFA}(\mathbb {Z}^d,n,k)\) – however, this group is residually finite, and thus does not contain \(S_\infty \) or \((\mathbb {Q}, +)\).

Proposition 7

Let \(n \ge 2\) and G be any finite group or a finitely generated abelian group. Then \(G \le \mathrm {RFA}(\mathbb {Z}^d,n,k)\).

Theorem 5

Let \(n \ge 2, k \ge 1, d \ge 1\). Then the group \(\mathrm {RFA}(\mathbb {Z}^d,n,k)\) is residually finite and is not finitely generated.

The proof of this theorem is based on studying the action of the group on finite subshifts where heads are occur periodically. Non-finitely generatedness is obtained by looking at signs of permutations of the finitely many orbits, to obtain the sign homomorphism to an infinitely generated abelian group.

3.3 Elementary Turing Machines and the LEF Property of \(\mathrm {RTM}\)

Definition 9

We define the group of elementary Turing machines \(\mathrm {EL}(\mathbb {Z}^d,n,k) := \langle \mathrm {RFA}(\mathbb {Z}^d,n,k),\mathrm {LP}(\mathbb {Z}^d,n,k)\rangle \). That is, the group generated by machines which only change the tape or move the head.

Proposition 8

Let \(\mathbb {Q}_p = \frac{1}{p}\mathbb {Z}\). Then \(\alpha (\mathrm {RFA}(\mathbb {Z}^d,n,k)) = \alpha (\mathrm {EL}(\mathbb {Z}^d,n,k)) = \mathbb {Q}_k^d\). In particular, \(\mathrm {EL}(\mathbb {Z}^d,n,k) \subsetneq \mathrm {RTM}(\mathbb {Z}^d,n,k)\).

We do not know whether \(\alpha (T) \in \mathbb {Z}^d\) implies \(T \in \mathrm {EL}(\mathbb {Z}^d,n,1)\), nor whether \(\mathrm {EL}(\mathbb {Z}^d,n,k)\) is finitely generated – the sign homomorphism we use in the proof of finitely-generatedness of the group of finite-state automata does not extend to it.

By the results of this section, the group \(\mathrm {RTM}(\mathbb {Z}^d,n,k)\) is neither amenable nor residually finite. By adapting the proof of Theorem 5, one can show that it is locally embeddable in finite groups. See [2931] for the definitions.

Theorem 6

The group \(\mathrm {RTM}(\mathbb {Z}^d,n,k)\) is LEF, and thus sofic, for all nkd.

4 Computability Aspects

4.1 Basic Decidability Results

First, we observe that basic management of local rules is decidable. Note that these results hold, and are easy to prove, even in higher dimensions.

Lemma 3

Given two local rules \(f, g : \varSigma ^F \times Q \rightarrow \varSigma ^F \times Q \times \mathbb {Z}^d\),

  • it is decidable whether \(T_f = T_g\),

  • we can effectively compute a local rule for \(T_f \circ T_g\),

  • it is decidable whether \(T_f\) is reversible, and

  • we can effectively compute a local rule for \(T_f^{-1}\) when \(T_f\) is reversible.

A group is called recursively presented if one can algorithmically enumerate its elements, and all identities that hold between them. If one can furthermore decide whether a given identity holds in the group (equivalently, whether a given element is equal to the identity element), we say the group has a decidable word problem. The above lemma is the algorithmic content of the following proposition:

Proposition 9

The groups \(\mathrm {TM}(\mathbb {Z}^d,n,k)\) and \(\mathrm {RTM}(\mathbb {Z}^d,n,k)\) are recursively presented and have decidable word problems in the standard presentations.

4.2 The Torsion Problem

The torsion problem of a recursively presented group G is the set of presentations of elements \(g \in G\) such that \(g^n = 1_G\) for some \(n \ge 1\). Torsion elements are recursively enumerable when the group G is recursively presented, but the torsion problem need not be decidable even when G has decidable word problem.

In the case of \(\mathrm {RTM}(\mathbb {Z}^d,n,k)\) the torsion problem is undecidable for \(n \ge 2\). This result was shown by Kari and Ollinger in [19] using a reduction from the mortality problem which they also prove to be undecidable.

The question becomes quite interesting if we consider the subgroup \(\mathrm {RFA}(\mathbb {Z}^d,n,k)\) for \(n \ge 2\), as then the decidability of the torsion problem is dimension-sensitive.

Theorem 7

The torsion problem of \(\mathrm {RFA}(\mathbb {Z},n,k)\) is decidable.

Theorem 8

For all \(n \ge 2, k \ge 1, d \ge 2\), there is a finitely generated subgroup of \(\mathrm {RFA}(\mathbb {Z}^d,n,k)\) whose torsion problem is undecidable.