Sequentializing cellular automata

We study the problem of sequentializing a cellular automaton without introducing any intermediate states, and only performing reversible permutations on the tape. We give a decidable characterization of cellular automata which can be written as a single left-to-right sweep of a bijective rule from left to right over an infinite tape.


Introduction
Cellular automata (CA) are models of parallel computation, so when implementing them on a sequential architecture, one cannot simply update the cells one by one -some cells would see already updated states and the resulting configuration would be incorrect.The simplest-to-implement solution is to hold two copies of the current configuration in memory, and map (x, x) → (x, G(x)) → (G(x), G(x)).This is wasteful in terms of memory, and one can, with a bit of thinking, reduce the memory usage to a constant by simply remembering a 'wave' containing the previous values of the r cells to the left of the current cell, where r is the radius of the CA.
Here, we study the situation where the additional memory usage can be, in a sense, dropped to zero -more precisely we remember only the current configuration x ∈ S Z , and to apply the cellular automaton we sweep a permutation χ : S m → S m from left to right over x (applying it consecutively to all length-m subwords of x).The positions where the sweep starts may get incorrect values, but after a bounded number of steps, the rule should start writing the image of the cellular automaton.We formalize this in two ways, with 'sliders' and 'sweepers', which are two ways of formally dealing with the problem that sweeps 'start from infinity'.
It turns out that the cellular automata that admit a sliding rule are precisely the ones that are left-closing (Definition 11), and whose number of right stairs (see Definition 14) of length 3m divides |S| 3m for large enough m.This can be interpreted as saying that the average movement 'with respect to any prime number' is not to the right.See Theorem 20 and Theorem 28 for the precise statements, and Section 4 for decidability results.
We introduce the sweeping hierarchy where left-to-right sweeps and rightto-left sweeps alternate, and the closing hierarchy where left-closing and rightclosing CA alternate.We show that the two hierarchies coincide starting from the second step.We do not know if the hierarchies collapse on a finite level.

Preliminaries
We denote the set of integers by Z.For integers i ≤ j we write [i, j) for {x ∈ Z | i ≤ x < j} and [i, j] for [i, j)∪{j}; furthermore [i, ∞) = {x ∈ Z | i ≤ x} and (−∞, i) = {x ∈ Z | x < i} have the obvious meaning.Thus [0, ∞) is the set of non-negative integers which is also denoted by N 0 .
Occasionally we use notation for a set M of integers in a place where a list of integers is required.If no order is specified we assume the natural increasing order.If the reversed order is required we will write M R .
For sets A and B the set of all functions f : A → B is denoted B A .For f ∈ B A and M ⊆ A the restriction of f to M is written as f | M or sometimes even f M .Finite words w ∈ S n are lists of symbols, e.g.mappings w : [0, n) → S. Number n is the length of the word.The set of all finite words is denoted by S * .
Configurations of one-dimensional CA are biinfinite words x : Z → S. Instead of x(i) we often write x i .We define the left shift σ : S Z → S Z by σ(x) i = x i+1 .The restriction of x to a subset (−∞, i) gives a left-infinite word for which we write x (−∞,i) ; for a right-infinite word we write x [i,∞) .These are called half-infinite words.Half-infinite words can also be shifted by σ, and this is defined using the same formula.The domain is shifted accordingly so for x ∈ S [i,∞) we have σ(x) ∈ S [i− 1,∞) .
We use a special convention for concatenating words: Finite words 'float', in the sense that they live in S n for some n, without a fixed position, and u • v denotes the concatenation of u and v as an element of S |u|+|v| .Half-infinite configurations have a fixed domain (−∞, i] or [i, ∞) for some i, which does not change when they are concatenated with finite words or other half-infinite configurations, while finite words are shifted suitably so that they fill the gaps exactly (and whenever we concatenate, we make sure this makes sense).
More precisely, for w ∈ S * and y ∈ S (−∞,i] , we have y • w ∈ S (−∞,i+|w|] and for w ∈ S * and z ∈ S [i,∞) we have w • z ∈ S [i−|w|,∞) (defined in the obvious way).For a word w ∈ S * and half-infinite words y ∈ S (−∞,i) and z ∈ S [i+n,∞)  we write y • w • z for the obvious configuration in S Z , and this is defined if and only if |w| = n.
The set S Z of configurations is assigned the usual product topology generated by cylinders.A cylinder defined by word w ∈ S n at position i ∈ Z is the set

Sliders and sweepers
A block rule is a function χ : S m → S m .Given a block rule χ we want to define what it means to "apply χ from left to right once at every position".We provide two alternatives, compare them and characterize which cellular automata can be obtained by them.The first alternative, called a slider, assumes a bijective block rule χ that one can slide along a configuration left-to-right or right-toleft to transition between a configuration y and its image f (y).The second alternative, called a sweeper, must consistently provide values of the image f (y) when sweeping left-to-right across y starting sufficiently far on the left.
We first define what it means to apply a block rule on a configuration.
Definition 1.Let χ : S m → S m be a block rule and i ∈ Z.The application of χ at coordinate i is the function χ When m > 1, it is meaningless to speak about "applying χ to each cell simultaneously": An application of χ changes the states of several cells at once.Applying it slightly shifted could change a certain cell again, but in a different way.
We next define finite and infinite sweeps of block rule applications with a fixed start position.
For any configuration x ∈ S Z and fixed i ∈ Z the sequence of configurations x (j) = χ [i,j] (x) for j ∈ [i, ∞) has a limit (point in the topological space S Z ) for which we write χ i+ (x).
Analogously, for a block rule ξ the sequence of configurations x (j) = ξ [j,i) R (x) for j ∈ (−∞, i) has a limit for which we write ξ i− (x).
It should be observed that in the definition of χ i+ (x) one has i < j and the block rule is applied at successive positions from left to right.On the other hand j < i is assumed in the definition of ξ i− (x) and since the R in ξ [j,i) R indicates application of ξ at the positions in the reverse order, i.e. i − 1, i − 2, . . ., j, the block rule is applied from right to left.The reason the limits always exist in the definition is that the value of x (j) i changes at most m times, on the steps where the sweep passes over the cell i.
Example 3. Let S = {0, 1} and consider the block rule χ : S [0,2) → S [0,2) : (a, b) → (b, a).For consistency with the above definition denote by ξ the inverse of χ (which in this case happens to be χ again).Let s ∈ S and y ∈ S Z .We will look at the configuration x ∈ S Z with The application of χ successively at positions 0, 1, 2, . . .always swaps state s with its right neighbor.Since cell j can only possibly change when χ j−1 or χ j is applied, each cell enters a fixed state after a finite number of steps; see also the lower part of Figure 1 starting at the row with configuration x.
Figure 1: A sequence of configurations with the center cell at position 0. Starting with configuration x in the middle when going downward the swapping rule χ is applied to blocks [0, 1], [1,2], etc., and going from x upward rule ξ = χ is applied to blocks [−1, 0], [−2, −1] and so on.
Example 4. Let S = {0, 1} and consider the block rule χ : Then sliding this rule over a configuration x ∈ {0, 1} Z produces the image of x in the familiar exclusive-or cellular automaton with neighborhood {0, 1} (elementary CA 102).We will see in Example 22 that the exclusive-or CA with neighborhood {−1, 0} can not be defined this way.

Definition of sliders
Definition 5. A bijective block rule χ with inverse ξ defines a slider relation F ⊂ S Z ×S Z by (y, z) ∈ F iff for some x ∈ S Z and some i ∈ Z we have ξ i− (x) = y and χ i+ (x) = z.We call the pair (x, i) a representation of (y, z) ∈ F .
Note that every (x, i) ∈ S Z ×Z is a representation of exactly one pair, namely (ξ i− (x), χ i+ (x)) ∈ F .Lemma 6.Let (x, i) be a representation of (y, z) ∈ F under a bijective block rule χ of block length n.Then Proof.Applying block rule χ at positions j ≥ i in x never changes cells at positions k < i. Therefore x k = (χ i+ (x)) k = z k proving the first part.The second part follows analogously.
Lemma 7. Let (y, z) ∈ F be fixed.For all i ∈ Z denote For i < j the function χ [i,j) : R i −→ R j is a bijection, with inverse ξ [i,j) R .All R i have the same finite cardinality.
Proof.The claim follows directly from the definition and the facts that and that χ [i,j) and This map is injective.To prove surjectivity, we show that for any x ∈ R j its preimage ξ [i,j) R (x ) is in R i .Composing the formulas in (1) with ξ [i,j) R from the right gives χ j+ = χ i+ • ξ [i,j) R and ξ j− = ξ i− • ξ [i,j) R , so as above we get z = χ j+ (x ) = χ i+ (ξ [i,j) R (x )) and y = ξ j− (x ) = ξ i− (ξ [i,j) R (x )), as required.
The fact that the cardinalities are finite follows from Lemma 6: there are at most |S| n choices of x [i,i+n) in x ∈ R i .
Lemma 8.A slider relation F ⊂ S Z × S Z defined by a bijective block rule χ is closed and shift-invariant, and the projections (y, z) → y and (y, z) → z map F surjectively onto S Z .Proof.By Lemma 7 every (y, z) ∈ F has a representation (x, 0) at position 0. Therefore, the relation F is closed as the image of S Z in the continuous map x → (ξ 0− (x), χ 0+ (x)).
Clearly (x, i) is a representation of (y, z) if and only if (σ(x), i − 1) is a representation of (σ(y), σ(z)).Hence the relation F is shift-invariant.
The image of F under the projection (y, z) → z is dense.To see this, consider any finite word w and a configuration x with x [−|w|,0) = w.The pair (x, 0) represents some (y, z) ∈ F , and because z = χ 0+ (x) we have z [−|w|,0) = w.The denseness follows now from shift invariance and the fact that w was arbitrary.The image of F under the projection is closed so the image is the whole S Z .
The proof for the other projection is analogous.
Corollary 9.If F ⊂ S Z × S Z defined by a bijective block rule χ is a function (that is, if for all y ∈ S Z there is at most one z ∈ S Z such that (y, z) ∈ F ) then this function f : y → z is a surjective cellular automaton.
Proof.Because the projections (y, z) → y and (y, z) → z are onto, the function f is full and surjective.Because the relation F ⊂ S Z × S Z is closed, the function f is continuous.As it is continuous and shift-invariant, it is a cellular automaton.
Definition 10.Let χ be a bijective block rule such that the slider relation it defines is a function f : S Z −→ S Z .The surjective cellular automaton f is called the slider defined by χ.
Example 3 indicates that the slider for the block rule swapping two states is the left shift.By Corollary 9 every slider is a surjective CA.But not every surjective CA is a slider.This will follow from an exact characterization of which cellular automata are sliders below.

Characterization of sliders
We start by improving Corollary 9, by showing that sliders are left-closing cellular automata.
Definition 11.Two configurations y and y are right-asymptotic if there is any two different right-asymptotic configurations y and y we have f (y) = f (y ).Right-closing CA are defined symmetrically using left-asymptotic configurations.
Lemma 12.A slider is a left-closing cellular automaton.
Proof.Let slider f be defined by a bijective block rule χ : S m → S m , so that f is a surjective cellular automaton.Let ξ be the inverse of χ.
Suppose f is not left-closing, so that there exist two distinct right-asymptotic configurations y and y such that f (y) = f (y ).We may suppose the rightmost difference in y and y is at the origin.Let r be a radius for the local rule of f , where we may suppose r ≥ m, and let We can apply the local rule of f to words, shrinking them by r symbols on each side, and write F : S * → S * for this map.Since y and y have the same f -image, we have Let n be such that 2 n > |S| m and for each k ∈ {0, 1} n , define the configuration where the right tail of 0s begins at the origin.For each y k , pick a point x k representing (y k , f (y k )) at the origin.By the pigeon hole principle, there exist Let j be the maximal coordinate where k and k differ.Now, the rightmost difference in y k and ) by the assumption that j is the rightmost coordinate where k and k differ, and by In the rest of this section, we only consider the case when the slider relation F that χ defines is a function.
Next we analyze numbers of representations.We call a representation (x, i) of a pair (y, z) simply a representation of configuration y, because z = f (y) is determined by y.Let R(y, i) be the set of configurations x such that (x, i) is a representation of y.By Lemma 6 the elements of R(y, i) have the form ) for some word w ∈ S n where n is the block length of χ.
By Lemma 7 the cardinality of the set R(y, i) is independent of i.Let us denote by N (y) this cardinality.It turns out that the number is also independent of the configuration y.
Proof.Let n be the block length of rule χ.
(i) Assume first that y, y are left-asymptotic.There is an index i ∈ Z such that y (−∞,i) = y (−∞,i) .Then for any z we have that (ii) Assume then that y, y are right-asymptotic.Also f (y) and f (y ) are right-asymptotic so there is The configuration y represented by (x , i) is right-asymptotic with y and satisfies f (y ) = f (y ).Because f is left-closing by Lemma 12, we must have y = y .We conclude that f (y and the converse implication also holds by a symmetric argument.As in (i), we get that (iii) Let y, y be arbitrary.Configuration y = y (−∞,0) y [0,∞) is left-asymptotic with y and right-asymptotic with y .By cases (i) and (ii) above we have As N (y) is independent of y we write N for short.
Next we define right stairs.They were defined in [2] for reversible cellular automata -here we generalize the concept to other CA and show that the concept behaves well when the cellular automaton is left-closing.A right stair is a pair of words that can be extracted from two consecutive configurations x and f (x) that coincide with y and z, respectively, as shown in Figure 2. The precise definition is as follows.
Definition 14.Let f : S Z −→ S Z be a cellular automaton, and let m be a positive integer.Let y ∈ S [i+3m,∞) be a right infinite word and let z ∈ S (−∞,i) be a left-infinite word.
• The stair has length 3m and it is confirmed (at position i) by configuration x.
• We write Ψ 3m (y, z) for the set of all right stairs of length 3m connecting (y, z).
• We write Ψ 3m for the union of Ψ 3m (y, z) over all y and z.
Due to shift invariance, x confirms (v, w) ∈ Ψ 3m (y, z) if and only if σ(x) confirms (v, w) ∈ Ψ 3m (σ(y), σ(z)).This means that Ψ 3m (y, z) = Ψ 3m (σ(y), σ(z)), so it is enough to consider i = 0 in Definition 14.In terms of cylinders, (v, w) ∈ Ψ 3m if and only if f We need the following known fact concerning left-closing CA.It appears as Proposition 5.44 in [3] where it is stated for right-closing CA.See Figure 3(a) for an illustration.
Lemma 15 (Proposition 5.44 in [3]).Let f be a left-closing CA.For all sufficiently large m ∈ N, if s ∈ S m and t ∈ S 2m are such that f just a way to write that there exists x ∈ S Z with x (m,2m] = s and f (x) (0,2m] = t.Note that the statement of the lemma has two parts: the existence of a and the uniqueness of a.We need both parts in the following. A number m is a strong1 left-closing radius for a CA f if it satisfies the claim of Lemma 15, and furthermore m ≥ 2r where r ≥ 1 is a neighborhood radius of f .Next we state corollaries of the previous lemma, phrased for right stairs in place of s and t to be directly applicable in our setup.Proof.(a) Let y, y ∈ S [3m,∞) and z, z ∈ S (−∞,0) be arbitrary.It is enough to prove that Ψ 3m (y , z ) ⊆ Ψ 3m (y, z).The claim then follows from this and shift invariance Ψ 3m (y, z) = Ψ 3m (σ(y), σ(z)).
First we show that Ψ 3m (y , z ) ⊆ Ψ 3m (y, z ).Let (v, w) ∈ Ψ 3m (y , z ) be arbitrary, so that there exists vy, and because m ≥ r, the radius of the local rule of f , we also have f Next we show that Ψ 3m (y, z ) ⊆ Ψ 3m (y, z).Let (v, w) ∈ Ψ 3m (y, z ).We start with finite extensions of w on the left: we prove that for every finite word u ∈ S * we have f Suppose the contrary, and let bu ∈ S k+1 be the shortest counterexample, with b ∈ S and u ∈ S k .(By the assumptions, the empty word is not a counterexample.)By the minimality of bu, there exists and apply the existence part of Lemma 15.By the lemma, there exists a configuration x l such that . Consider x obtained by gluing together the left half of x l and the right half of ) .Note that in the region [−k + m, −k + 2m) configurations x l and x r have the same value.By applying the local rule of f with radius r we also get [m,∞) = vy, so that x proves that bu is not a counterexample.Consider then the infinite extension of w on the left by z: Applying the finite case above to each finite suffix of z and by taking a limit, we see with a simple compactness argument that there exists (b) Let (vc, wd) ∈ Ψ 3m and let b ∈ S be arbitrary.Let y ∈ S [3m,∞) be arbitrary, and and let z ∈ S (−∞,0) be such that z −1 = b.By (a) we have that (vc, wd) ∈ Ψ 3m (y, z).Let x be a configuration that confirms this, so Let us prove that a is unique.Suppose that also (a v, bw) ∈ Ψ 3m .We apply the uniqueness part of Lemma 15 on s and t where t = wd and s is the pre- Lemma 17.Let f be a slider.Let m be a strong left-closing radius, and big enough so that f is defined by a bijective block rule χ : S n −→ S n of block length n = 3m.Let N be the number of representatives of configurations (independent of the configuration) with respect to χ.Then As χ is a bijective block rule, it defines a slider relation F .We need to prove that for every configuration y, the only z such that (y, z) ∈ F is z = f (y).Therefore, consider an arbitrary representation (x, i) of (y, z) ∈ F .Write x = z (−∞,i) • π((av, bw), k) • c • y [i+n+1,∞) for letters a, c, b ∈ S words v, w ∈ S 2m−1 and k ∈ {1, 2, . . ., N }.This can be done and as π is surjective and all items in this representation are unique as π is injective.We have (av, bw) ∈ Ψ n (cy, z) so by Corollary 16(c) there is a unique configuration x that confirms this.Then Let us show that g(χ i (x), i + 1) = g(x, i).By the definition of χ we have where d = f loc (avc).To prove that g(χ i (x), i + 1) = x = g(x, i) it is enough to show that x confirms (vc, wd) ∈ Ψ n (y, zb).But this is the case because By induction we have that for any j ≥ i holds g(χ [i,j) (x), j) = x .Moreover, pair (χ [i,j) (x), j) represents the same (y, z) ∈ F as (x, i).Therefore, x [j+n+1,∞) = y [j+n+1,∞) and f (x ) (−∞,j) = z (−∞,j) for all j ≥ i.Let us look into position p = i + n + m + 1.Using any j > p we get f (x ) p = z p and using j = i we get x [p−m,p+m] = y [p−m,p+m] .This means that z p = f loc (y [p−m,p+m] ), that is, z p = f (y) p .Because i was arbitrary, p is arbitrary.We have that z = f (y), which completes the proof.
Theorem 19.The function f admits a slider if and only if f is a left-closing cellular automaton and |Ψ n | divides |S| n for n = 3m where m is the smallest strong left-closing radius.
We can state this theorem in a slightly more canonical (but completely equivalent) form by normalizing the length of stairs: By Corollary 16, for a left-closing cellular automaton f the limit is reached in finite time, namely as soon as m is a left-closing radius, and thus λ f is rational for left-closing f .In [2] it is shown that the map f → λ f gives a homomorphism from the group of reversible cellular automata into the rational numbers under multiplication.For a prime number p and an integer n, write v p (n) for the largest exponent k such that p k |n.For prime p and rational r = m/n, write v p (r) = v p (m) − v p (n) for the p-adic valuation of r.
Theorem 20.The function f is a slider if and only if f is a left-closing cellular automaton and v p (λ f ) ≤ 0 for all primes p.
Lemma 24.The projection (y, z) → y on the first component maps a sweeper relation F surjectively onto S Z .The relation F is a function f if and only if for each configuration y the limit lim i→−∞ χ i+ (y) exists and equals f (y).
Definition 25.Let χ be a block rule such that for each configuration y the limit z = lim i→−∞ χ i+ (y) exists.The function y → z is called the sweeper defined by χ.
Before we are going to compare the notions of sliders and sweepers we provide a result on a special kind of Mealy automata.

A note on finite Mealy automata
In this section we consider Mealy automata with a set Q of states and where the set A of input symbols and the set of output symbols coincide.For convenience instead of pairs of elements we use words of length 2. Thus, we denote by µ : QA → AQ the function mapping the current state q and an input symbol a to µ(qa) = a q , where q is the new state of the automaton.
The motivation for this is the following.When a block rule χ is sweeping over a configuration one can think of the block q ∈ S n where χ will be applied next as encoding the state of a Mealy automaton.The word a ∈ S n immediately to the right of it is the next input symbol.By applying χ at positions 0, 1, . . ., n−1 the word qa is transduced into a word a q ∈ S 2n where a can be considered the output symbol and q the next state of the automaton.When χ is bijective then clearly µ is bijective, too.
Let δ : QA → Q denote the function yielding only the new state of the Mealy automaton.The extension δ * : QA * → A * Q to input words is for all states q, all inputs w ∈ A * and a ∈ A defined by δ * (qε) = q and δ * (qwa) = δ(δ * (qw)a).
Because of the application we have in mind we now restrict ourselves to the case where Q = A and speak of elements e ∈ Q.Let ē = (. . ., e −2 , e −1 , e 0 ) denote a sequence of elements which is infinite to the left.Definition 26.A finite tail ēi = (e −i , . . ., e 0 ) of ē is good for q if δ * (ē i ) = q.An infinite sequence ē is good for q if infinitely many finite tails ēi = (e −i , . . ., e 0 ) are good for q.
A state q is good, if there is an infinite sequence ē that is good for q.Let G ⊆ Q denote the set of good states and B ⊆ Q the set of bad states.
Since µ is injective and |GA| = |AG|, in fact µ(GA) = AG.Therefore µ(BA) ⊆ AB, that is δ preserves bad states.Now, assume that there indeed exists a bad state b ∈ B. Consider b = (. . ., b, b, b).The states b i = δ * (b i ) are all bad, but at least one of them happens infinitely often, which would mean that it is good.Contradiction.

Relation between sliders and sweepers
Compared to definition 10 the advantage of definition 25 is that it does not require χ to be bijective.But as long as χ is bijective, there is in fact no difference.
Theorem 28.Let χ be a bijective block rule and f a one-dimensional CA.The slider relation defined by χ is equal to f if and only if the sweeper relation it defines is equal to f .The two implications are considered separately in Lemmata 29 and 30 below.For the remainder of this section let χ : S n → S n always denote a bijective block rule and let f : S Z → S Z denote a one-dimensional CA (without stating this every time).
Lemma 29.If χ is not a sweeper for f then it is not a slider for f .Proof.If χ is not a sweeper for f then there is a configuration y for which the limit lim i→−∞ χ [i,∞) (y) does not exist or is wrong.In both cases there is a cell j ∈ Z and a state s ∈ S such that s = f (y) j but χ [i,∞) (y) j = s for infinitely many i < j − n.
We will construct a configuration x such that χ j− (x) = y and χ j+ (x) j = s = f (y) j .Therefore χ is not a slider for f (see Def. 10).
As a first step we subdivide the "left part" (−∞, j + n) of Z into windows W k of length n.For k ≥ 0 let p k = −kn + j denote the smallest index in W k , i. e. W k = [p k , p k−1 ) (where p −1 = j + n).Analogously divide the "left part" of y into words y (k) of length n by setting y (k) = y| W k (see Fig. 4).Let M denote the set {i | χ [i,∞) (y) j = s}.M contains infinitely many integers i < p 1 = j − n.Then there has to be a word v (0) ∈ S n such that the set For all k ≥ 0 we now inductively define words v (k+1) and x (k+1) (all of length n) and along with it infinite sets M k+1 .Since M k is infinite, there is a word v (k+1) such that the set for some x (k+1) (see Fig. 5).Since χ is bijective, for the inverse ξ of χ holds On one hand χ j+ (x) already after the application of χ at position j produces state s there which never changes again.Thus χ j+ (x) = f (y).
On the other hand by construction for all k ≥ 0 holds ξ and by induction for all k ≥ 0 Obviously one gets ξ i− (x) = y.
Lemma 30.If χ is not a slider for f then it is not a sweeper for f .
Proof.If χ is not a slider for f then there exists a configuration x and an i ∈ Z such that for z = χ i+ (x) and y = χ i− (x) one has f (y) = z.Let ξ be the inverse of χ.Let j be a cell where f (y The sliding hierarchy.
Suppose then that for all k < n, ]. Thus, the value at k does not change when χ is applied at k − 1, and as in the previous paragraph, the sweep is synchronized at this position.Again χ i+ (x) n is determined by x [k,n] for all i < k, so χ i+ (x) n converges.
In the remaining case, ], the rule is not applied in the left tail of x, and thus certainly χ i+ (x) n converges.
The function defined by the sweeper relation is not continuous at Realization of bi-closing CA using LR and RL sliders In the definition of a slider we use a left-to-right slide of the window to realize the CA transition.Of course, one can analogously define right-to-left sliders and prove a characterization via right-closing CA.We can also alternate these two types of rules, and obtain a ladder-shaped hierarchy analogous to the Borel, arithmetic and polynomial hierarchies.
Definition 32.Let R denote the set of CA definable as slider relations with the "from left to right" as in Definition 10.Analogously let L denote the set of CA definable as right-to-left slider relations.Denote ∆ = L ∩ R. Let now Note that in L n , there are n sweeps (slider applications) in total, and the last sweep goes from right to left.We have In Theorem 35 below we will show a close relation between this "slider hierarchy" and a "closingness hierarchy" defined as follows, exactly analogously.Let L cl denote the set of left-closing CA and R cl the set of right-closing CA.Define Figure 7: Illustration of Theorem 14.7 in [1], with L = 4, R = 3.
As always with such hierarchies, it is natural to ask whether they are infinite or collapse at some finite level.We do not know if either hierarchy collapses, but we show that after the first level, the hierarchies coincide.The main ingredients for the theorem are the following two lemmata.
Lemma 33.Let f be a left-closing CA.For all n large enough, |Ψ n | divides some power of |S|.
Proof.Let m be a strong left-closing radius for f .Number m can be chosen as large as needed.Let f loc be the local update rule of f of radius 3m.By Theorem 14.7 in [1] there exist, for k = 3m chosen sufficiently large, • pairwise different words u 1 , . . ., u M of length k, • sets L 1 , . . ., L M ⊆ S 2k of words of length 2k, each of cardinality • a word w of length 3k whose set pre-images of length 5k under f loc is precisely See Figure 7 for an illustration.Let y ∈ S [k,∞) be arbitrary and let z ∈ S (−∞,0) be such that z [−3k,0) = w.0) .This means that for some i ∈ {1, . . ., M }, we have (ii) Conversely, let i ∈ {1, . . ., M } and v ∈ R i be arbitrary.Words in Because f is left-closing and k is a strong left-closing radius for f there exists a unique x ∈ A such that

From (i) and (ii) we can conclude that |A|
Lemma 34.Let f be a left-closing CA.Then for any large enough n, we have Proof.By the previous lemma, we have v p (λ f ) = 0 for all p |S|. Similarly as in [2] one sees that the map g → λ g is a homomorphism among left-closing CA, so for large enough n.The claim follows from Theorem 20.
Proof.By Lemma 12 we have where f i ∈ R cl for odd i and f i ∈ L cl for even i.Then write where k i=1 n i = 0 and for each odd i, n i ≤ 0 is small enough that f i • σ ni ∈ L and for each even i, n i ≥ 0 is large enough that

Decidability
In this section, we show that our characterization of sliders and sweepers shows that the existence of them for a given CA is decidable.We also show that given a block rule, whether it defines some CA as a slider (equivalently as a sweeper) is decidable.We have seen that sweepers can also define shift-commuting functions which are not continuous.We show that this condition is also decidable.
Lemma 37. Given a cellular automaton f : S Z → S Z , it is decidable whether it is left-closing, and when f is left-closing, a strong left-closing radius can be effectively computed.
Proof.It is obviously decidable whether a given m ∈ N is a strong left-closing radius, since checking this requires only quantification over finite sets of words.This shows that left-closing is semi-decidable and the m can be computed when F is left-closing.When F is not left-closing, there exist x, y such that x [1,∞) = y [1,∞) , x 0 = y 0 and F (x) = F (y).A standard pigeonhole argument shows that there then also exist such a pair of points whose left and right tails are eventually periodic, showing that not being left-closing is semidecidable.
Lemma 38.Given a left-closing cellular automaton f : S Z → S Z , one can effectively compute the rational number λ f defined in Equation (2) on page 12. Proof.As observed after defining (2), the limit is reached in finite time, once m is a strong left-closing radius.By the previous lemma, one can effectively compute a strong left-closing radius.
Theorem 39.Given a cellular automaton f : S Z → S Z , it is decidable whether f is a slider (resp.sweeper).
Proof.By Theorem 28, a block rule is a sweeping rule for f if and only if it is a slider rule for f , so in particular f admits a slider if and only if it admits a sweeper.Theorem 20 characterizes cellular automata admitting a slider as ones that are left-closing and satisfy v p (λ f ) ≤ 0 for all primes p. Decidability follows from the previous two lemmas.
We now move on to showing that given a block rule, we can check whether its slider or sweeper relation defines a CA.
In the rest of this section, we explain the automata-theoretic nature of both types of rules, which allows one to decide many properties of the slider and sweeper relations even when they do not define cellular automata.As is a common convention in automata theory, all claims in the rest of this section have constructive proofs (and thus imply decidability results), unless otherwise specified.
We recall definitions from [4] for automata on bi-infinite words.A finitestate automaton is A = (Q, S, E, I, F ) where Q is a finite set of states, S the alphabet, E ⊂ Q × S × Q the transition relation, I ⊂ Q the set of initial states and F ⊂ Q the set of final states.
The pair (Q, E) can be naturally seen as a labeled graph with labels in S. The language of such an automaton A the set L(A) ⊂ S Z of labels of bi-infinite paths in (Q, E) such that some state in I is visited infinitely many times to the left (negative indices) and some state in F infinitely many times to the right.Languages of finite-state automata are called recognizable.
If A ⊂ S −N and B ⊂ S N , write [A, B] ⊂ S Z for the set of configurations x ∈ S Z such that for some y ∈ A, z ∈ B, x i = A i+1 for i < 0 and x i = B i for i ≥ 0. We need the following lemma.
Lemma 40 (Part of Proposition IX.2.3 in [4]).For a set X ⊂ S Z the following are equivalent • X is recognizable • X is shift-invariant and a finite union of sets of the form [A, B] where B is ω-recognizable (accepted by a Büchi automaton) and A is the reverse of an ω-recognizable set.
In the theorems of this section, note that the set S Z × S Z is in a natural bijection with (S 2 ) Z .
Proposition 41.Let χ : S m → S m be a bijective block rule.Then the corresponding slider relation F ⊂ (S 2 ) Z is recognizable.
For each uw ∈ S [−m,m −1] where |u| = |w| = m, we define recognizable languages A uw ⊂ (S 2 ) (−∞,0) , B uw ∈ (S 2 ) [0,∞) such that the slider relation is For finite words, one-way infinite words and more generally patterns over any domain D ⊂ Z, define the ordered applications of χ and ξ (e.g.χ i+ ) with the same formulas as for x ∈ S Z , when they make sense.
For each word uw ∈ S . One can easily construct a Büchi automaton recognizing this language, so B w is ω-recognizable.
Let then for w ∈ S m the set A w ⊂ (S 2 ) −N be defined as those pairs (y, z) such that ξ 0− (zw)| (−∞,0) = y, where zw ∈ S (−∞,m −1] .Again it is easy to construct a Büchi automaton for the reverse of A w .Now it is straightforward to verify that the slider relation of χ is which is recognizable by Lemma 40 since the slider relation is always shiftinvariant. Lemma 42.Given a recognizable set X ⊂ (S 2 ) Z , interpreted as a binary relation over S Z , it is decidable whether X defines a function.
Proof.Since recognizable sets representing relations are closed under Cartesian products, projections and intersections (by standard constructions), if X is recognizable also the 'fiber product' Y ⊂ (S 2 ) Z containing those pairs (z, z ) satisfying ∃y : (y, z) ∈ X ∧ (y, z ) ∈ X is recognizable.The diagonal ∆ of (S 2 ) Z containing all pairs of the form (z, z) is also clearly recognizable.Since recognizable languages are closed under complementation [4], we obtain that ((S 2 ) Z \ ∆) ∩ Y is recognizable.This set is empty if and only if X is a function, proving decidability, since all proofs in this section are constructive and emptiness of a recognizable language is decidable using standard graph algorithms.
The following is a direct corollary.
Theorem 43.Given a block rule, it is decidable whether it is the sliding rule of a CA.
We now discuss sweeping rules.
Proposition 44.Let χ : S m → S m be a block rule.Then the corresponding sweeper relation F ⊂ (S 2 ) Z is recognizable.
Proof.One can easily construct a finite-state automaton accepting the language X ⊂ ({0, 1} 2 × S 2 ) Z containing those (x, x , y, z) ∈ ({0, 1} 2 × S 2 ) Z where and x i = 1 ⇐⇒ i = m and x i = 1 ⇐⇒ i = n.Simply construct an automaton that checks that there is exactly one 1-symbol on each of the first two tracks, and when it sees the first 1 is seen on the first track it starts keeping in its state the current contents of the active window (where the block rule is being applied).When 1 is seen on the second track, it also starts checking that the image is correct.
Since X is described by an automaton and |S| ≤ 2 k for some k, an adaptation of [4,Theorem IX.7.1] shows that there exists a monadic second-order formula over the successor function of Z, i.e. some formula ϕ ∈ MF 2 (<), that defines those tuples sets of integers (x, x , y 1 , ..., y k , z 1 , ..., z k ) where (y 1 , ..., y k ) codes some y and (z 1 , ..., z k ) some z such that (x, x , y, z) is in X.
Since in tuple (x, x , y 1 , ..., y k , z 1 , ..., z k ) that satisfies ϕ we have |x| = |x| = 1, it is standard to modify ϕ into a formula where x, x are replaced by firstorder variables i, j and correspond to the unique places in x and x where the unique 1 appears.Now the formula ψ defined by ∀j ∈ Z : ∀n ∈ Z : ∃i ≤ n : ϕ (i, j, y 1 , ..., y k , z 1 , ..., z k ) defines those tuples (y 1 , ..., y k , z 1 , ..., z k ) that code pairs (y, z) which are in the sweeper relation for χ.Another application of [4, Theorem IX.7.1] then shows that sweeper relation is recognizable.
The sweeping relation need not be closed, as shown in Example 31.However, whether it is closed is decidable.
Lemma 45.Given a recognizable X ⊂ S Z , it is decidable whether X is closed.
Proof.Take an automaton recognizing X, remove alls states from which an initial state is not reachable to the left, and ones from which a final state is not reachable to the right.Turn all states into initial and final states.Now X is closed if and only if the new automaton recognizes X, which is decidable by standard arguments.
Theorem 46.Given a block rule, it is decidable whether the sweeping relation it defines is a CA.
Proof.The sweeping rule of a block rule defines a CA if and only if the sweeping relation is closed and defines a function.These are decidable by Lemma 42 and Lemma 45, respectively.

Future work and open problems
To obtain a practical computer implementation method for cellular automata, one would need much more work.The radius of χ should be given precise bounds, and we would also need bounds on how long it takes until the sweep starts producing correct values.Future work will involve clarifying the connection between the radii m of local rules χ : S m → S m and the strong left-closing radii, the study of non-bijective local rules, and the study of sweeping rules on periodic configurations.
On the side of theory, it was shown in Section 3 that the hierarchy of leftand right-closing cellular automata corresponds to the hierarchy of sweeps starting from the second level.Neither hierarchy collapses on the first level, since there exists CA which are left-closing but not right-closing, from which one also obtains CA which are in L 1 but not R 1 .
Question 47.Does the hierarchy collapse on a finite level?Is every surjective CA in this hierarchy?As we do not know which cellular automata appear on which levels, we do not know whether these levels are decidable.For example we do not know whether it is decidable if a given CA is the composition of a left sweep and a right sweep.
It seems likely that the theory of sliders can be extended to shifts of finite type.If X is a subshift, say that a homeomorphism χ : X → X is local if its application modifies only a (uniformly) bounded set of coordinates.One can define sliding applications of such homeomorphisms exactly as in the case of S Z .Question 48.Let X ⊂ S Z be a transitive subshift of finite type.Which endomorphisms of X are defined by a sliding rule defined by a local homeomorphism?
In [2], block representations are obtained for cellular automata in one and two dimensions, by considering the set of stairs of reversible cellular automata.Since stairs play a fundamental role for sliders as well, it seems natural to attempt to generalize our theory to higher dimensions.
of configurations that contain word w in position [i, i + n).Cylinders are open and closed, and the open sets in S Z are precisely the unions of cylinders.We extend the notation also to half-infinite configurations, and define [y] D = {x ∈ S Z | x D = y} for D = [i, ∞) and D = (∞, i], and any y ∈ S D .These sets are closed in the topology.

Figure 2 :Figure 3 :
Figure 2: A right stair (v, w) of length 3m connecting y and z, confirmed by x at position i = 0. s t 0 m 2m (a) (b)

Corollary 16 .
Let f be a left-closing CA.Let m be a strong left-closing radius.(a) Ψ 3m (y, z) = Ψ 3m for all y and z.(b) Let (vc, wd) ∈ Ψ 3m for c, d ∈ S and v, w ∈ S 2m−1 .For every b ∈ S there exists a unique a ∈ S such that (av, bw) ∈ Ψ 3m .(See Figure 3(b) for an illustration.)(c) Every (v, w) ∈ Ψ 3m (y, z) is confirmed by a unique x.
surjective by the definition of Ψ 3m (y, z), and it is injective by Corollary 16(c).Because Ψ 3m (y, z) = Ψ 3m by Corollary 16(a), we see that |A| = |Ψ 3m |.For each w ∈ S 3m define configuration x w = zwy.Representations (x, 0) of y ∈ A are precisely (x w , 0) for w ∈ S 3m .Because each y has N representations and there are |S| 3m words w we obtain that N • |Ψ 3m | = |S| 3m .Now we prove the converse: the constraints we have proved for sliders are sufficient.This completes the characterization of sliders.Lemma 18.Let f be a left-closing cellular automaton, let m be a strong leftclosing radius, and assume that |Ψ n | divides |S| n for n = 3m.Then f is a slider.Proof.Let N = |S| n /|Ψ n | and pick an arbitrary bijection π : Ψ n ×{1, 2, . . ., N } −→ S n .Let f loc : S 2m+1 −→ S be the local rule of radius m for the cellular automaton f .Let us define a block rule χ : S n+1 −→ S n+1 as follows (see Figure3).Consider any c ∈ S, any k ∈ {1, 2, . . ., N } and any (av, bw) ∈ Ψ n where a, b ∈ S and v, w ∈ S 2m−1 .Let d = f loc (avc).We set χ : π((av, bw), k) • c → b • π((vc, wd), k)).This completely defines χ, but to see that it is well defined we next show that (vc, wd) is a right stair.By Corollary 16(a) we have that (av, bw) ∈ Ψ n (cy, z) for arbitrary y, z so there is a configuration x such that x [m,∞) = avcy and f (x) (∞,2m) = zbw.The local rule f loc determines that f (x) 2m = f loc (avc) = d.It follows that (vc, wd) ∈ Ψ n (y, zb), confirmed by x at position i = 1.Now that we know that χ is well defined, let us prove that χ is a bijection.Suppose π((av, bw), k) • c and π((a v , b w ), k ) • c have the same image b • π((vc, wd), k)) = b • π((v c , w d ), k )).We clearly have b = b , and because π is a bijection, we have v = v , c = c , w = w , d = d and k = k .By Corollary 16(a) we also have that a = a .

Figure 4 :
Figure 4: For configuration y the windows W k contain the words y (k) .

Figure 5 :
Figure 5: Transition from v (k+1) y (k) to x (k+1) v (k) by applying χ from left to right at the positions indicated by the gray bars.Application of the inverse ξ from right to left realizes the opposite transition from bottom to top.
concluding the proof.A cellular automaton f is bi-closing if it is both left-closing and right-closing, i.e. f ∈ ∆ cl 1 .Such cellular automata are also called open, since they map open sets to open sets.By the previous result, every bi-closing CA can be realized by a left-to-right sweep followed by a right-to-left sweep by bijective block rules: Theorem 36.Each bi-closing CA is in ∆ 2 .