On von Neumann regularity of cellular automata

We show that a cellular automaton on a one-dimensional two-sided mixing subshift of finite type is a von Neumann regular element in the semigroup of cellular automata if and only if it is split epic onto its image in the category of sofic shifts and block maps. It follows from previous joint work of the author and Törmä that von Neumann regularity is a decidable condition, and we decide it for all elementary CA, obtaining the optimal radii for weak generalized inverses. Two sufficient conditions for non-regularity are having a proper sofic image or having a point in the image with no preimage of the same period. We show that the non-regular ECA 9 and 28 cannot be proven non-regular using these methods. We also show that a random cellular automaton is non-regular with high probability.


Introduction
The von Neumann regular elements -elements a having a weak inverse b such that aba = a -of cellular automaton (CA) semigroups are studied in [1].We show that in the context of cellular automata on one-dimensional two-sided mixing subshifts of finite type, von Neumann regularity coincides with the notion of split epicness onto the image, another generalized invertibility notion from category theory.
Question 1 of [1] asks which of the so-called elementary cellular automata (ECA) are von Neumann regular.They determine this for all ECA except ones equivalent to those with numbers 6, 7, 9, 23, 27, 28, 33, 41, 57, 58 and 77, see the next section for the definition of the numbering scheme.
What makes this question interesting is that von Neumann regularity of one-dimensional cellular automata is not obviously1 decidable -clearly checking if a given CA f has a weak inverse is semidecidable, but it is not immediately clear how to semidecide the nonexistence of a weak inverse.However, split epicness has been studied previously in [3], and in particular it was shown there that split epicness of a morphism between two sofic shifts is a decidable condition.This means Question 1 of [1] can in theory be decided algorithmically.
As the actual bound stated in [3] is beyond astronomical, it is an interesting question whether the method succeeds in actually deciding each case.Using this method we give a human proof that 9, 27, 28, 41 and 58 are not von Neumann regular, and we prove by computer that ECA 6, 7, 23, 33, 57 and 77 are von Neumann regular, answering the remaining cases of Question 1 of [1].
The von Neumann regular CA on this list have weak inverses of radius at most four.Nonregularity is proved in each case by looking at eventually periodic points of eventual period one and applying the method of [3], namely the strong periodic point condition.For ECA 27, 41 and 58, non-regularity can also be proved by simply observing that their images are proper sofic.For ECA 9 and ECA 28, this method cannot be used, as the image is an SFT.The ECA 9, 27, 28, 58 admit preimages of the same period for all periodic points, so the method used in [1] cannot be used to prove their non-regularity.In particular 9 and 28 seem to require using the strong periodic point condition.
This is an extended version of the paper [4].The new results about ECA are the precise optimal radii for the weak inverses (one of those reported in [4] was suboptimal, and we had only checked the optimality in one case), and the observation that 9 and 28 admit preimages of the same period for periodic points.We also prove that a random CA is not von Neumann regular with high probability (Theorem 35), which refutes an almost-conjecture stated in [4].

Preliminaries
The full shift is Σ Z where Σ is a finite alphabet, carrying the product topology.It is homeomorphic to the Cantor set, thus compact and metrizable.It is a dynamical system under the shift σ(x)i = xi+1.Its subsystems (closed shift-invariant subsets) are called subshifts, and the bi-infinite words x ∈ Σ Z are their points.
A cellular automaton (CA) is a shift-commuting continuous function f : X → X on a subshift X.The cellular automata on a subshift X form a monoid End(X) under function composition.A CA f is reversible if ∃g : f • g = g • f = id where g is a cellular automaton.Reversibility is equivalent to bijectivity by a compactness argument.
A CA has a local rule, that is, there exists a radius r ∈ N such that f (x)i is determined by x| [i−r,i+r] for all x ∈ X (and does not depend on i).More generally, a neighborhood is a finite subset N ⊂ Z such that f (x)i is determined by x| i+N .The elementary cellular automata (ECA) are the CA on the binary full shift {0, 1} Z which can be defined with radius 1.There is a numbering scheme for such CA: If n ∈ [0, 255] has base 2 representation b7b6...b1b0, then ECA number n is the one mapping in base 2.This numbering scheme is from [5].The usage of base 10 for n in this notation is standard, and some CA researchers remember ECA by these numbers.From radius 2 onward, we switch to hexadecimal notation.
We recall [1, Definition 3]: define maps R, S : {0, 1} Z → {0, 1} Z by the formulas R(x)i = x−i (this reverses the configuration) and S(x)i = 1 − xi (this flips all the bits in the configuration).Two cellular automata f, g ∈ End({0, 1} Z ) are where • denotes function composition and S = {id, S}.This means that we may pre-or postcompose by the bit flip S, and we may conjugate the CA by the reversal R. Composing by R from just one side almost never gives a cellular automaton, so this is not allowed.
A subshift can be defined by forbidding a set of finite words from appearing as subwords of its points (which themselves are infinite words), and this is in fact a characterization of subshifts.A subshift is of finite type or SFT if it can be defined by a finite set of forbidden words, and sofic if it can be defined by forbidding a regular language, in the sense of automata and formal languages.A proper sofic subshift is one that is sofic but not SFT.
The language L(X) of a subshift X is the set of finite words that appear in its points.A subshift X is mixing if for all words u, v appearing in the language of X, for all large enough n some word uwv with |w| = n appears in the language of X.In the case of a sofic shift X with language L, we can simplify this to ∃m : The language of a subshift determines it uniquely, and thus a convenient way to define a subshift is to describe its language.For a language L which is extendable meaning ∀v ∈ L : ∃u, w ∈ L : uvw ∈ L, there exists a unique smallest subshift whose language contains L. We write this subshift as L −1 (L).For L regular, this gives a sofic shift.We note that this is not an inverse for L, but rather If u ∈ A * is a finite nonempty word, we write u Z for the |u|-periodic point (i.e.fixed point of σ |u| ) in A Z whose subword at [0, |u| − 1] is equal to u.We say two points are left-asymptotic if their values agree at −n for large enough n, and symmetrically define right-asymptoticity.Points are asymptotic if they are left-and right-asymptotic.The notation ω uwv ω denotes a point left-asymptotic to (a shift-image of) u Z and right-asymptotic to (a shift-image of) v Z , with the word w between.When the positioning is important, we include a decimal point.
The de Bruijn graph (with parameter n) is the graph with nodes for words of length n − 1.When considering a cellular automaton with neighborhood consisting of n consecutive positions, we typically label the transition from au to ub (|u| = n − 2) by the image of aub under the local rule.This is a convenient way to write the local rule of an ECA (in the case n = 3).Images of configurations can be found by following the corresponding path in the de Bruijn path (looking at consecutive pairs of symbols) and reading the edge labels.
In some parts of the paper, we assume knowledge of automata theory and formal languages.In automata theoretic terms, the de Bruijn graph can be directly seen as a non-deterministic finite-state automaton for the language of a CA with neighborhood [0, n−1] (note that shifting the neighborhood does not affect the image): simply consider every node as both initial and final.This is called the de Bruijn automaton.
See standard references for more information on symbolic dynamics [6] or automata theory and formal languages [7].
A semigroup is a set with an associative product, denoted by juxtaposition.A category is specified by a class of objects, for each pair of objects A, B a class of morphisms f : A → B, a composition gf = g •f : A → C for morphisms f : A → B, g : B → C, and identity morphisms id : A → A for each object.The composition should be associative, and the identity morphism should act trivially in composition.See [8] for more information on categories (very little is needed here).

Split epicness and von Neumann regularity
In this section, we show split epicness and von Neumann regularity are equivalent concepts on mixing SFTs.On full shifts, this is simply a matter of defining these terms.
If S is a semigroup, then a ∈ S is If C is a category, a morphism f : X → Y is split epic if there is a morphism g : Y → X such that f • g = idY .Such a g is called a right inverse or a section.
Note that, in general, category-theoretic concepts depend on the particular category at hand, but if C is a full subcategory of D (meaning a subcategory induced by a subclass of the objects, by taking all the morphisms between them), then split epicness for a morphism f : X → Y where X, Y are objects of C means the same in both.
We are in particular interested in the categories K2, K3, K4 (in the naming scheme of [3]) with respectively SFTs, sofic shifts, or all subshifts as objects, and block maps, i.e. shiftcommuting continuous functions f : X → Y as morphisms.Note that K2 is a full subcategory of K3, which in turn is a full subcategory of K4.By the previous paragraph, the choice does not really matter.
The following theorem is essentially only a matter of translating terminology, and works in many concrete categories.
Theorem 2. Let X be a subshift, and f : X → X a CA.Then the following are equivalent: • f is regular as an element of End(X).
Proof.Suppose first that f is regular, and h ∈ End(X) satisfies f hf = f and hf h = h.Then the restriction g = h| f (X) : f (X) → X is still shift-commuting and continuous, and ∀x : f g(f (x)) = f (x) implies that for all y ∈ f (X), f g(y) = y, i.e. g is a right inverse for the codomain restriction f : X → f (X) and it extends to the map h : X → X by definition.Suppose then that f g = id f (X) for some g : f (X) → X, as a right inverse of the codomain restriction f : X → f (X).Let h : X → X be such that h| f (X) = g, which exists by assumption.Then f h(f (x)) = f g(f (x)) = f (x).Thus f is regular, and hf h is a generalized inverse for it by the proof of the previous lemma.
Note that when X is a full shift, extending morphisms is trivial: if g : Y → X has been defined by a local rule of radius r, defined on the words of length 2r + 1 in Y , we can simply fill in the local rule arbitrarily to obtain a cellular automaton h : X → X with h| Y = g.This does not work for general Y, X, as the image of h might not be contained in X, but it turns out that partially defined CA on mixing SFTs can be extended in an analogous way.
For two subshifts X, Y write X per → Y if the period of every periodic point of X is divisible by the period of some periodic point of Y .The following is Boyle's extension lemma [9].Lemma 3. Let S ⊂ S be subshifts, let T be a mixing SFT.Suppose φ : S → T is shiftcommuting and continuous, and S per → T .Then there exists a shift-commuting continuous map φ : S → Y such that φ| S = φ.Lemma 4. Let X be a mixing SFT, Y ⊂ X a subshift, and g : Y → X any shift-commuting continuous map.Then g = h| Y for some cellular automaton h : X → X.
Proof.In the previous lemma, let Let X be a mixing SFT, and f : X → X a CA.Then the following are equivalent for n = 2, 3, 4: • f is regular as an element of End(X).
Proof.By Theorem 2, we need to check that "f : X → f (X) has a right inverse g : f (X) → X which can be extended to a morphism h : X → X such that h| f (X) = g" is equivalent to split epicness.The forward implication is trivial, and the backward implication follows from the previous lemma, since every g : f (X) → X extends to such h.Theorem 5 clearly implies that regularity respects equivalence of CA (this is not difficult to obtain directly from the definition either).Corollary 6.If f, g ∈ End({0, 1} Z ) are equivalent, then f is regular if and only if g is regular.

Deciding split epicness
We recall the characterization of split epicness [3,Theorem 1].This is Theorem 7 below.Definition 1.Let X, Y be subshifts and let f : X → Y be a morphism.Define We say f satisfies the strong p-periodic point condition if there exists a length-preserving function G : Pp(Y ) → L(X) such that for all u, v ∈ Pp(Y ) and w ∈ L(Y ) with ω u.wv ω ∈ Y , there exists an f -preimage for ω u.wv ω of the form ω G(u)w ′ .wThe condition states that we can pick, for each eventually periodic point, a preimage whose tails have the same eventual periods as the image, and that we can make these choices consistently (determined by a function G).
The strong periodic point condition is an obvious necessary condition for having a right inverse, as the right inverse must consistently pick preimages for periodic points, and since it is a CA, eventually it only sees the periodic pattern when determining the preimage, and begins writing a periodic preimage.Let us show the XOR CA with neighborhood {0, 1} is not regular using this method -this is clear from the fact it is surjective and noninjective, or from the fact there are 1-periodic points with no preimage of period 1, but it also neatly illustrates the strong periodic point method.
is not regular.To see this, consider the strong p-periodic point condition for p = 1.Since f (0 Z ) = f (1 Z ) = 0 Z , the point 0 Z has two preimages, and we must have either G(0) = 0 or G(0) = 1.It is enough to show that neither choice of a = G(0) is consistent, i.e. there is a point y which is in the image of f such that y has no preimage that is left and right asymptotic to a Z .This is shown by considering the point y = ...0000001000000... (which is in the image of f since f is surjective).It has two preimages, and the one leftasymptotic to a Z is right-asymptotic to (1 − a) Z .
In [3, Theorem 1], it is shown that the strong periodic point condition actually characterizes split epicness, in the case when X is an SFT and Y is a sofic shift.
Theorem 7. Given two sofic shifts X ⊂ S Z and Y ⊂ R Z and a morphism f : X → Y , it is decidable whether f is split epic.If X is an SFT, split epicness is equivalent to the strong periodic point condition.
We note that Definition 1 is equivalent to a variant of it where G is only defined on Lyndon words [10], i.e. lexicographically minimal representative words of periodic orbits: if G is defined on those, it can be extended to all of Pp in an obvious way, and the condition being satisfied by minimal representatives implies it for all eventually periodic points.
split epic, then every periodic point in Y must have a preimage of the same period in X -this is a special case of the above, and could thus be called the weak periodic point condition.In [3, Example 5], an example is given of morphism between mixing SFTs which satisfies the weak periodic point condition but not the strong one.We will see later that ECA 9 and ECA 28 are non-regular, but satisfy the weak periodic point condition.In [1,Theorem 4], for full shifts on finite groups, the weak periodic point condition is shown to be equivalent to split epicness (when CA are considered to be morphisms onto their image).In the context of CA on Z 2 , there is no useful strong periodic point condition in the sense that split epicness is undecidable, see Corollary 12.
In the proof of Theorem 7 in [3], decidability is obtained from giving a bound on the radius of a minimal inverse, and a very large one is given, as we were only interested in the theoretical decidability result.The method is, however, quite reasonable in practise: • To semidecide non-(split epicness), look at periodic points one by one, and try out different possible choices for their preimages.Check by automata-theoretic methods (or "by inspection") which of these are consistent in the sense of Definition 1.
• To semidecide split epicness, invent a right inverse -note that here we can use the other semialgorithm (running in parallel) as a tool, as it tells us more and more information about how the right inverse must behave on periodic points, which tells us more and more values of the local rule.
One of these is guaranteed to finish eventually by [3].For the regular elementary cellular automata, a simpler method sufficed, we essentially used only the weak periodic point condition combined with brute force search, see Section 7.
We finish this section with two more conditions for regularity.Proposition 9 below is a slight generalization of [3, Proposition 1].We give a proof here, as the proof in [3] unnecessarily applies a more difficult result of S. Taati (and thus needs the additional assumption of "mixing").Lemma 8.If X is an SFT and f : X → X is idempotent, i.e. f2 = f , then f (X) is an SFT.
Proof.Clearly x ∈ f (X) ⇐⇒ f (x) = x, which is an SFT condition.Namely, if the radius of f is r, the forbidden patterns are the words of length 2r + 1 where the local rule changes the value of the current cell.Proposition 9.If X is an SFT and f : X → X is regular, then f (X) is of finite type.
Proof.Let g : X → X be a weak inverse.Then g • f : X → X is idempotent, so g(f (X)) is an SFT.Note that the domain-codomain restriction g| f (X),g(f (X)) : f (X) → g(f (X)) is a conjugacy, meaning shift-commuting homeomorphism, between f (X) and g(f (X)): its twosided inverse is f | g(f (X)),f (X) : g(f (X)) → f (X) by a direct computation.Thus f (X) is also an SFT, since being an SFT is preserved under conjugacy [6, Theorem 2.1.10].
We also mention another condition, Proposition 11 below, although it is not applicable to the ECA we consider.
Lemma 10.Let X be a subshift with dense periodic points and f : Since f is injective and Xp is finite, we must have f (Xp) = Xp.Thus f (X) is a closed set containing the periodic points.If periodic points are dense, f (X) = X.
We are interested mainly in mixing SFTs, where periodic points are easily seen to be dense.We remark in passing that in the case of mixing SFTs, the previous lemma can also be proved with an entropy argument: An injective CA cannot have a diamond 2 when seen as a block map, so [6,Theorem 8.1.16]shows that the entropy of the image f (X) of an injective CA is equal to the entropy of X.By [6, Corollary 4.4.9], a mixing SFT X is entropy minimal, that is, it has no proper subshifts of the same entropy, and it follows that f (X) = X.Proposition 11.Let X be a mixing SFT and f : X → X a surjective CA.Then f is injective if and only if it is regular.
Proof.Suppose f is a surjective CA on a mixing SFT.If it is also injective, it is bijective, thus reversible (by compactness of X), thus regular.Conversely, let f be surjective and regular, and let g : X → X be a weak inverse.Then g is injective, so it is surjective by the previous lemma.Thus f must be bijective as well.
More generally, the previous proposition works on surjunctive subshifts in the sense of [11,Exercise 3.29], i.e. subshifts (on groups) where injective cellular automata are surjective.In particular this is the case for full shifts on surjunctive groups [12,13] such as abelian ones.Since injectivity is undecidable for surjective CA on Z d , d ≥ 2 by [14], we obtain the following corollary.
Corollary 12. Regularity is undecidable for two-dimensional cellular automata.In fact, given a surjective CA f : Σ Z 2 → Σ Z 2 , it is undecidable whether f is split epic.

Von Neumann non-regularity of elementary CA
In [1], regularity was resolved for all ECA where the weak periodic point condition failed for period at most three, or there was a weak inverse directly among the ECA.The remaining cases up to equivalence are 6, 7, 9, 23, 27, 28, 33, 41, 57, 58, 77.In this section, we prove the non-regular cases.
Proof.See the lemmas below.
For the reader's convenience, we include the de Bruijn graphs in Figure 1.
Lemma 14.The elementary CA 9 is not regular.
We have f (0 Z ) = 1 Z and f (1 Z ) = 0 Z , so if g : X → {0, 1} Z is a right inverse for f , then g(0 Z ) = 1 Z .Consider now the configuration x = ...000011.00000... where coordinate 0 is to the left of the decimal point (i.e. at the rightmost 1 of the word 11).
The proof above shows that the ECA 9 does not have the strong periodic point property for p = 1.In general, for fixed p one can use automata theory to decide whether it holds up to that p, though here (and in all other proofs) we found the contradictions by hand before we had to worry about implementing this.
Next, we cover ECA 27.The image X of f can be shown to be proper sofic, so Proposition 9 directly shows that the CA can not be regular.Nevertheless, we give a direct proof to illustrate the method.
Lemma 15.The ECA 27 is not regular.
Proof.Let f be the ECA 27, i.e. f (x)i = 1 ⇐⇒ x [i−1,i+1] ∈ {000, 001, 011, 100}.Let X be the image of f .Again, we will see that this CA does not satisfy the strong periodic point condition for p = 1.Observe that f (1 Z ) = 0 Z and f (0 Z ) = 1 Z so if g is a right inverse from the image to {0, 1} Z , then g(0 Z ) = 1 Z and g(1 Z ) = 0 Z .
We now reason similarly as in Lemma 14.We have g(x)i = 1 for all large enough i, and if n is maximal such that g(x)n = 0, then f (g(x))n+1 = 1 and f (g(x))n+1+i = 0 for all i ≥ 1, so again necessarily n = −1.A short combinatorial analysis shows that no continuation to the left from n produces f (g(x))n = 1 and f (g(x))n−1 = 0, that is, the image of g has no possible continuation up to coordinate −3.
Lemma 16.The ECA 28 is not regular.
(Alternatively, x ∈ X by Proposition 25 which states that X is the SFT with the single forbidden word 111.)This contradicts the choice g(0 Z ) = 0 Z by a similar analysis as in Example 1: computing the preimage from right to left, the asymptotic type necessarily changes to 1s.Thus we must have g(0 Z ) = 1 Z .
On the other hand, if g(0 Z ) = 1 Z , then going from right to left, we cannot find a consistent preimage for f (...0001.00000...) = ...0001.10000... (Alternatively, going from left to right, the asymptotic type necessarily changes to 0s or never becomes 1-periodic.) It follows that g(0 Z ) has no consistent possible choice, a contradiction.
Next we consider ECA 41.Again Proposition 9 would yield the result, because the image is proper sofic.For ECA 41, in fact even the weak periodic point condition fails, see Section 6.
Lemma 17.The ECA 41 is not regular.
has no preimage that is right asymptotic to 1 Z , obtaining a contradiction.
Next we consider ECA 58.Again Proposition 9 would also yield the result, since the image is proper sofic.Lemma 18.The ECA 58 is not regular.

Weak periodic point condition and SFT images
In this section we look at the weak periodic point condition (WPP) and the condition of having SFT images, for the five non-regular CA that were left open in [1] (where the WPP was checked up to period 3) and for which we showed the strong periodic point condition (SPP) fails in the previous section.The results are summarized in Table 1, "no" means that the particular method can be used to conclude non-regularity (because the necessarily condition does not hold), "yes" means that it can not.

Weak periodic point condition
We show that the ECA 9, 27, 28 and 58 satisfy the weak periodic point condition, i.e. every periodic point in the image has a preimage with the same period, while 41 does not.
Proposition 19.ECA 41 does not satisfy the weak periodic point condition.
Proposition 20.ECA 28 satisfies the weak periodic point condition.
Proof.In this ECA, 010, 011, 100 → 1, others map to 0. It is easy to check that this ECA amounts to a right shift followed by a bit flip when restricted to the flipped golden mean shift, i.e. the SFT with the unique forbidden word 00.Thus, on the golden mean shift (the SFT with unique forbidden word 11), a section for this CA is left shift composed with bit flip.
Thus, any periodic point in the golden mean shift will have a preimage with the same period.Consider then a p-periodic point x not in the golden mean shift, we may assume x = (11u) Z for some u, say |u| = p − 2. Now take any preimage y for x, and observe that necessarily y [n−1,n+3] = 0100 for all n ∈ pZ, by a quick look at the local rule.In automata theoretic terms, 11 is a synchronizing word for the de Bruijn automaton.This synchronization means that also (y [0,p−1] ) Z is a preimage.Proposition 21.ECA 9 satisfies the weak periodic point condition.
Proof.In this one, 000, 011 → 1, others map to 0. It is easy to check that on the subshift L −1 ((1000 * ) * ) (on the image side), a section is again given by left shift composed with bit flip.The words 11, 101 are easily seen to force a unique preimage word of length at least 2 (i.e. are synchronizing for the automaton), and we can argue as in the previous proof for all periodic points containing one of these words.
For ECA 27 and 58 we decided the weak periodic point condition by computer.
Proposition 22.The weak periodic point condition is decidable.
Proof.Let f be a CA.The language of words (u, v) of the same length such that f (u Z ) = v Z is clearly regular, let L be its right projection.The image of f is sofic, so let K be the language of words v such that v Z is in the image subshift of f , which is also clearly regular.If every periodic point admits an f -preimage of the same period, then clearly K = L.If u Z does not admit a point of the same period, and |u| is minimal for this point, then u ∈ K \ L.
An implementation (as a Python/SAGE script) is included in [15] as check WPP.sage.
Proposition 23.ECA 27 and 58 satisfy the weak periodic point condition.

SFT images
We show that ECA 9 and 28 have SFT images, while the others do not.We begin with the observation that one can do this easily by computer: Proposition 24.It is decidable whether the image of a CA is an SFT.
Proof.The image subshift is sofic.To check if a sofic shift is an SFT, observe that by [6, Exercise 1.3.8], a subshift is an SFT if and only if the set of first offenders, i.e. the minimal forbidden words, is finite.If L is the complement of the language of X ⊂ Σ Z , then the first offenders are by definition exactly the language L \ (Σ + L ∪ LΣ + ), where Σ + denotes the nonempty words over Σ; regular languages are effectively closed under these operations and it is trivial to check if a regular language is finite.
In the remainder of this section, we give more or less ad hoc human proofs of SFTness and proper soficness of images, not following this algorithm.
Proposition 25.ECA 28 has SFT image, defined by a single forbidden word 111.
Proof.Again recall that this ECA is defined by The reader may also find the labeled de Bruijn graph given in Figure 1 helpful.
As we saw in the proof of Proposition 20, the only preimage of 11 is 0100, so 111 does not have a preimage.
We describe a procedure (in fact, a type of transducer) giving preimages for transitive points (points containing every finite word that appears in the image, which are clearly dense).As we saw in the proof of Proposition 20, the only preimage of 11 is 0100, so 111 does not have a preimage.Now, consider a transitive point in the SFT with 111 forbidden (note that this SFT is mixing, so one exists).To construct a preimage, on top of every 11 put the word 0100.Now start filling the gaps to the right from each 0100 already filled.For the leftmost run of 0s, write 0s on top.When you reach the first 1, write 1 on top of it.If it is part of a 11, you have completed the run successfully.Otherwise, start filling according to the shift-and-flip-rule.Table 2: For the regular ECA, the optimal radius for a weak inverse, the number of inverses (counting only the possible behaviors on the words in the image of the ECA), and the p-value we used when executing the algorithm.
• If a periodic point has only one preimage left in d, set the corresponding values in ℓ and drop this point from d.
• If some possible choices in d are inconsistent with ℓ, remove them.If after reaching the fixed point we have not yet determined the ℓ-image of some word, pick a random such word, recursively try both values for the ℓ-image and enumerate the results.
We initially also used the following consistency condition: • If all the possible preimages of a particular periodic point have a particular bit b in position i, then we can safely make ℓ map the word at [i − r, i + r] to b.
We also experimented with more sensible choices for the choice of a new image in ℓ.With a naive implementation, these only made the calculation slower, but such ideas (and even the strong periodic point condition) might be more useful with larger neighborhoods and state sets.
Finding the inverses using this procedure takes a few seconds with the highly non-optimized Python program find weak inverses.py in [15].For ECA 7, finding the unique weak inverse takes only a few minutes when performed by hand.The optimal radii and p used are listed in Table 2, and we give the actual inverses in the following section.

The weak inverses
In the conference version [4] of this paper, we picked the behavior of the weak inverse rules on an ad hoc basis on the words not in the image subshift, in order to get a nice presentation for each rule.Here, as we give the exhaustive list, it seems cleaner to simply output 0 on the inputs that do not appear in the image subshift, which means that the rule numbers are different from those reported in the conference version even in the case when the weak inverse is "unique".
To get all weak inverses of the optimal radius r, take one of the rules listed in the propositions below, compute the words L in the image subshift of the ECA in question (for example by applying the ECA to all words of length 2r + 3), and change 0 to 1 on any of the words in the complement of L. These propositions are simply a summary of the output of the program find weak inverses.py in [15].There is also a separate (independent) script check weak inverses.py in [15] that verifies these propositions.Proposition 29.The radius 3 weak inverses for ECA 6, which map to 0 outside the image subshift, have hex codes 00000e030f 03000f 00000e0f 0f 030e0 * where * is replaced by one of 7, f .Proposition 30.The unique radius 2 weak inverse for ECA 7, which maps to 0 outside the image subshift, has hex code 21232123.On the image subshift of ECA 7, this is equivalent to the ECA 35 composed with σ, which has hex code 23232323.
• the M many choices of images f (ι(a, b)) = f (ι(b, a)) for a = b, From this, it follows that if we have N < 0.9n and M ≥ k, then the probability that some pair is mapped to a unary point that is not in I is at least 1 − 0.9 k , which tends to 1 as k → ∞.It remains to show that N < 0.9n and M ≥ k with high probability where k → ∞.
First, let us look at N .Writing Na ∈ {0, 1} for the random variable indicating that the symbol a ∈ A has a preimage, N = a Na, we have The claim now follows from Chebyshev's inequality, which states that the difference bethe value of a random variable and its mean is likely to be of the order of the square root of its variance.More precisely, writing Var(N ) = To conclude, it clearly suffices to show that for any fixed n, cellular automata are nonregular with high probability for large r.The argument is essentially the same as the above, with minor changes: Instead of unary points, we use points of period p with 2p ≤ r and p large.Most words of length p are primitive, i.e. the corresponding periodic point has least period p, write again Pp for this set.The set Pp splits into equivalence classes under the shift, and if we pick the local rule at random, then the image of each x ∈ Pp is picked uniformly from the set Qp of points of (not necessarily least) period p.
The images for different points in Pp are independent from each other, so this is in fact the same distribution as we considered above, except that some periodic points may be mapped to a point of smaller period.Thus, by a coupling argument the probability that 90% of points in Pp have preimages in Pp is clearly at most as large as it was in the previous process.Now, we just have to show that there are at least k points in Pp with preimages in P2p with high probability, with k tending to infinity with r.We observe that images of points in P2p are picked uniformly at random from points in Q2p, and are independent from each other and from the choices of images of points in Pp.Thus, the calculation is the same as above, since given that a point in P2p maps to a point in Qp, the probability that it did not map to Pp is negligible.

Lemma 1 .
(von Neumann) regular if ∃b ∈ S : aba = a ∧ bab = b.We say b is a generalized inverse of a.If aba = a (but not necessarily bab = b), then b is a weak inverse of a. (More properly, one might call this a weak generalized inverse, but we use the shorter term as it is unambiguous.)If a has a weak inverse, then it has a generalized inverse and thus is regular.Proof.If aba = a, then letting c = bab, we have aca = ababa = aba = a and cac = bababab = babab = bab = c.

Figure 1 :
Figure 1: De Bruijn graphs of the non-regular ECA.

Table 1 :
Necessary conditions for regularity satisfied by the five non-regular ECA.