Nicolas Ollinger

Gaétan Richard

Automata on the Plane vs Particles and Collisions

Keywords: counter automata, languages, two-dimensional, tilings

published or not. The documents may come   L'archive ouverte pluridisciplinaire

Introduction

In [START_REF] Ollinger | Collisions and their catenations: Ultimately periodic tilings of the plane[END_REF], motivated by the study of space-time diagrams of cellular automata, we introduced collisions as a practical notion of ultimately periodic tiling of the plane: an extension of the notion of ultimately periodic biinfinite words to infinite bidimensional tilings. Intuitively, ultimately periodic words and collisions share the property to be locally almost everywhere periodic in every direction. Imagine that you are walking on the plane, trying to color it according to a collision: you only need to keep a finite information, your position inside the biperiodic pattern, plus a way to store your distance to the boundaries: places where one should switch from a biperiodic region to another. All you need to know about this distance is when it becomes equal to zero. Therefore, counter machines coloring the plane can certainly encode every collision.

In this note, we explore the analogy between regular tilings and colorings by counter machines. A map automaton over a free monoid is a deterministic counter machine that starts in a given initial state with empty counters on the unit element of the monoid. The automaton walks on the monoid by firing transitions labelled by the generator associated to each of its move. Such an automaton can certainly color each element of the monoid with a finite set of colors according to its state. To color a group, like the euclidean plane Z 2 , with a map automaton, we simply choose a monoid presentation for the group and require the automaton to be compatible with the group structure -that is, to have the same state and counter values on two elements of the free monoid corresponding to a same element of the group.

As expected, in the case of biinfinite words, map automaton with no counter capture periodic words; map automata with one counter capture ultimately periodic words; and map automata with two counters can paint arbitrarily complex recursive tilings. In the case of bidimensional tilings, map automata coloring the plane with a periodicity vector act like a finite family of map automata on biinfinite words. Thus, map automata with no counter capture biperiodic tilings; map automata with one counter capture particles. In the case of two counters automata, if the coloring is periodic then it can be arbitrarily recursively complex. However, aperiodic map automata with two counters capture collisions. In the case of aperiodic colorings, the two counters of a map automata act like a compass pointing to the origin cell using finitely many biperiodic quadrants: this is a collision.

The note is organized as follows. In section 1, we introduce map automata on monoid presentations and some of their properties. Section 2 studying map automata on Z and section 3 studying map automata on Z 2 are constructed symmetrically: notions of regular colorings are first defined before a sequential study of automata with 0, 1 and 2 counters.

Definitions

In this paper, Z m denotes the cyclic group Z/mZ. Let Σ be a finite alphabet, Σ * is the free monoid generated by Σ, the set of words on Σ, with empty word . The catenation of u ∈ Σ * and v ∈ Σ * is denoted as uv. A finite monoid presentation is a pair (G, R) where G is a finite alphabet of generators and R ⊆ G * × G * is a finite set of relators. The monoid G = G|R associated to the presentation is the largest monoid satisfying the relators equations, i.e.

such that for each (u, v) ∈ R, u = v in this monoid. A G-coloring is a mapping c : G → Σ. It is periodic, with period z ∈ G \ { }, if for all z ∈ G, c(zz ) = c(z ).
Is is aperiodic if it is not periodic. It is biperiodic, with periods z, z ∈ G \ { }, if z and z are two non-collinear periods, i.e. there does not exist k, k ∈ Z + such that z k = z k .

Let Υ = {0, +} and Φ = {-, 0, +} be respectively the set of test values and counter operations. Let 0 denote the constant k-uple (0, . . . , 0). For all φ ∈ Φ k , testing τ and modifying θ actions are defined for all i ∈ Z k , v ∈ N k as:

τ (v)(i) =      0 if v(i) = 0 + if v(i) > 0 θ φ (v)(i) =              max(0, v(i) -1) if φ i = - v(i) if φ i = 0 v(i) + 1 if φ i = +
A k-counter map automaton on the alphabet Σ is a tuple (Σ, k, S, s 0 , δ) where k ∈ N is the number of counters, S is a finite set of states with initial state s 0 ∈ S and δ :

S × Υ k × Σ → S × Φ k is the transition rule of the automaton. Its transition function f : S × N k × Σ * → S × N k is recursively defined on Σ * by f (s, v, ) = (s, v) and f (s, v, za) = (s , θ φ (v )) where f (s, v, z) = (s , v ) and δ(s , τ (v ), a) = (s , φ) for all s ∈ S, v ∈ N k , z ∈ Σ * and a ∈ Σ.
A k-counter map automaton (k-CMA) A on the monoid presentation G = G|R is a tuple (G, k, S, s 0 , δ) where (G, R) is a finite presentation of G and (G, k, S, s 0 , δ) is a k-counter map automaton on the alphabet G compatible with the monoid structure, i.e. satisfying f (s 0 , 0, zz 1 ) = f (s 0 , 0, zz 2 ) for all z ∈ G * and (z 1 , z 2 ) ∈ R. Its mapping function g :

G → S × N k is defined, for all z ∈ G, as g(z) = f (s 0 , 0, z). Its minimum (resp. maximum) counter function min c : G → N (resp. max c ) is defined for all z ∈ G as min c (z) = min i∈Z k v i (resp. max c (z) = max i∈Z k v i ) where g(z) = (s, v). Two elements z, z ∈ G are undistinguished by A if z = z and g(z) = g(z ). An element z ∈ G is discriminative under A if min c (z) = 0. A connected subset Z of G is independent under A if {min c (z) | z ∈ Z} is an infinite subset of Z + .
Notice that a subset of G independent under A does not have any discriminative points under A. The automaton is periodic, with period z ∈ G \ { }, if for all z ∈ G, g(z ) = g(zz ).

Lemma 1. A k-CMA A on a group G is periodic if and only if two elements of G are undistinguished by A.

Proof. Let A be a k-CMA on a group G. If it is periodic with period z ∈ G then and z are undistinguished. Conversely, if z, z ∈ G are undistinguished then for any path z 0 ∈ G, g(zz 0 ) = g(z z 0 ) by the fact that transition does only depends on state. In particular, for any

z 0 ∈ G, g(z 0 ) = g(zz -1 z 0 ) = g(z z -1 z 0 ) and thus z z -1 is a valid period. The projector π 1 : S × N k → S is defined for all s ∈ S and v ∈ N k by π 1 (s, v) = s. The coloring of A by ϕ : S → Σ is the mapping c ∈ Σ G satisfying c(z) = ϕ(π 1 (g(z))) for all z ∈ G. The G-k-map set is the set of all colorings of G by all k-counter map automata. The translated of a coloring c, by a vector z ∈ G, is the coloring c z ∈ Σ G defined for all z ∈ G by c z (z ) = c(zz ). Lemma 2. Every G-k-map set is closed under translation.
Proof. Let c be a coloring of a k-CMA (G, k, S, s 0 , δ) by ϕ. Let z ∈ G be a vector and m z = max c (z). Let us consider functions b : N → [0, . . . , m z ] and t : N → N defined for all n ∈ N by b(n) = min(m z , n) and t(n) = max(0, n -m z ). These two functions can be naturally extended to N k . Let S = S ×[0, . . . , m z ] k and e : S × N k → S × N k be defined by e(s, v) = ((s, b(v)), t(v)) for all (s, v) ∈ S × N k . Let A be the k-CMA (G, k, S , s , δ ) chosen such that, for all z ∈ G, its mapping function g satisfies : g (z ) = e(g(zz )) (in particular s is the first component of e(g(z))). Straightforwardly, the translated c z of c by z is the coloring of A by ϕ :

S × [0, . . . , m z ] k → Σ defined, for all s ∈ S and t ∈ [0, . . . , m z ] k , as ϕ ((s, t)) = ϕ(s). Lemma 3. Let c be a coloring of a k-CMA A on a group G. Let Z ⊆ G be independent under A. There exists a G-0-map c such that c |Z = c |Z . Proof. Let A be a k-CMA (G, k, S, s 0 , δ) and c a coloring of A by ϕ. Let Z be a subset of G independent under A. For all s ∈ S, let Z s = Z ∩g -1 {s} × N k . S being finite, there exists s 0 ∈ S such that min c (z) | z ∈ Z s 0 is infinite. Let A be the 0-CMA (G, 0, S, s 0 , δ ) where δ (s, a) = δ(s, + k , a) for all s ∈ S and a ∈ G. Let's first prove that A is indeed a 0-CMA. Let z ∈ G * and (z , z ) ∈ R. Let N = max(|zz |, |zz |). By construction, there exists z N ∈ Z s 0 such that min c z N > N . Since no discriminative point is encountered on the path from z N to z N zz , f (s 0 , zz ) = s where (s, n) = f (g(z N
), zz ). The same holds for zz . Let z 0 be any element of Z s 0 , Z being independent we have that π 1 (g(z)) = π 1 (g (z 0 z)) for all z ∈ Z. If we consider the c to be the coloring of A by ϕ, it follows that c(z) = c (z 0 z). By lemma 2, the translated c z 0 of c by z 0 is a G-0-map equal to c on Z.

Map Automata on Z

In the following, we denote by Z the one-dimensional grid (Z, +) = l, r|lr = , rl = , the presentation is embed with the canonical morphism r = 1.

Regular Colorings of Z

For i ∈ Z and p ∈ Z + , let us denote as i[p] the remainder of the division of i by p. On Z, a periodic coloring c can be characterised by a finite pattern

u ∈ Σ p such that for all i ∈ Z, c(i) = u i[p] . A coloring is ultimately periodic with period p ∈ Z + and defect k ∈ N, if for all element i ∈ Z, |i| > k implies c(i+p) = c(i).
Ultimately periodic colorings correspond to colorings which are periodic out of a finite support. They can also be characterised by three finite words u, v ∈ Σ p and w ∈ Σ 2k+1 such that for all element i ∈ Z,

c(i) = u i[p] if i < -k, c(i) = v i[p] if i > k and c(i) = w i+k otherwise.
Notice that periodicity is a special case of ultimate periodicity.

Automata with no counter

Theorem 4. A Z-coloring is a Z-0-map if and only if it is periodic.

Proof. Let g : Z → S be the mapping function of a 0-CMA A. S being finite, there exist two elements undistinguished by A. By lemma 1, the automaton is periodic.

Conversely, let c be a periodic Z-coloring with period p ∈ Z + . Let A be the 0-CMA (Z, 0, Z p , 0, δ) where δ(i, l) = i -1 and δ(i, r

) = i + 1. The coloring of A by ϕ : i → c(i) is c.

Automata with 1 counter

Theorem 5. A Z-coloring is a Z-1-map if and only if it is ultimately periodic.

Proof. Let g : Z → S × N be the mapping function of a 1-CMA A. Z-0-maps being Z-1-maps, we can assume that g is one to one (i.e., has no undistinguished elements). Thus, there exists k ∈ N such that g

-1 (S × {0}) ⊆ [-k, k].
By lemma 3, on both ]-∞, -k[ and ]k, +∞[, g is periodic and thus c is ultimately periodic.

Conversely, Let c be an ultimately periodic Z-coloring with period p ∈ Z + and defect k ∈ N. Let A be the 1-CMA over set of states [-k -p, k + p] whose mapping function is defined for all elements i ∈ Z by:

g(i) =              (i, 0) if |i| ≤ k + p ((i -k)[p] + k, (i -k)/p ) if i > k + p (i + k[p] -k -p, (k -i)/p ) if i < -k -p
The coloring of A by ϕ : i → c(i) is c.

Automata with 2 counters

It is well known that finite automata with two counters can simulate any Turing machine (see Minsky [START_REF] Minsky | Computation: Finite and Infinite Machines[END_REF]). Morita [START_REF] Morita | Universality of a reversible two-counter machine[END_REF], improved the result proving that the simulation can be done in a reversible way. It is therefore no surprise that these machines can embed any computation of a Turing machine and encode any recursively enumerable language.

Theorem 6. There exists a ∅ -complete1 Z-2-map.

Sketch of the proof. Let K be a ∅ -complete language containing 0 and (n i ) i∈N be a computable enumeration without repetition of K satisfying n 0 = 0. There exists a one to one computable function that on input n i computes n i+1 . Combining Morita construction [START_REF] Morita | Universality of a reversible two-counter machine[END_REF] with techniques of [START_REF] Kari | Periodicity and immortality in reversible computing[END_REF], one can construct a reversible 2-counters machine with set of states S A ∪ {s α , s ω } such that, for all i ∈ N, starting from (s α , (n i , 0)), the machine eventually halts in configuration (s w , (n i+1 , 0)). It is also possible to construct a reversible 2-counter machine with set of states S B ∪ {s α , s ω } such that, for all i ∈ N, starting from (s w , (n i , 0)), the machine halts in configuration (s α , (n i , 0)) after exactly 2n i steps of computations. By making disjoint union of these two machines, one can construct 2-CMA A with set of states S = S A ∪ S B ∪ {s α , s ω } sharing transitions of both machines and with starting state s α . The transition function works by the applying 2-counter machine transition on generator r and reverse transition on generator l. Let c be the coloring of A by ϕ : S → {0, 1} defined for all s ∈ S by ϕ(s) = 1 if and only if s ∈ S B . The coloring c contains the factor 01 2n 0 if and only if n ∈ K.

3 Map Automata on Z 2

In the following, we denote by Z 2 the two-dimensional grid (Z 2 , +) = n, s, e, w|ns = , sn = , ew = , we = , ne = en , the presentation is embed with the canonical morphism e = 1 0 and n = 0 1 .

Regular Colorings of Z 2

The case of Z 2 is strongly linked with the previous case as the following lemma suggests.

Lemma 7. Each line (resp. column) of a Z 2 -k-map is a Z-k-map.

Proof. Let c be a Z 2 -k-map. By definition, the restriction of c to {0}×Z (resp. Z × {0}) is a Z-k-map. By lemma 2, this result is valid for every line (resp. column).

An easy corollary is that a periodic map automaton on Z 2 acts as periodic copies of map automata on Z. To define regular coloring of Z 2 , we chose the approach presented in [START_REF] Ollinger | Collisions and their catenations: Ultimately periodic tilings of the plane[END_REF]. Simplest element is a biperiodic coloring called background (Fig. 1a). A particle is a coloring with one direction of periodicity and ultimate periodicity in every other direction (Fig. 1b). Let v (u, u ) be the angular portion of the plane, on the right hand side of u, starting in position v ∈ Z 2 and delimited by the vectors u, u ∈ Z 2 . A collision as a coloring c characterised by a sequence of m vectors (u i ) i∈Zm such that for all i ∈ Z m , the coloring is u i -periodic in the cone between u i-1 and u i+1 starting from u i , i.e., for all i ∈ Z m , and z 1c). The ball of radius r and center (x, y) is the set [x -r, x + r] × [y -r, y + r]. When no center is specified, it implicitly refers to center (0, 0).

∈ u i (u i-1 , u i+1 ), c(z + u i ) = c(z) (Fig.
u v u u u v v u 0 u 1 u 2 (a) Background (b) Particle (c) Collision

Automata with no counter

Theorem 8. A Z 2 -coloring is a Z 2 -0-map if and only if it is biperiodic.

Proof. Let g : Z → S be the mapping function of a 0-CMA A. S being finite, there exists two elements undistinguished by A. Thus, there is only a finite number of lines or columns. By lemma 7 and theorem 4, each of them is periodic.

Let c be a biperiodic Z 2 -coloring with periods (m, 0) and (0, n) (such canonical periods always exist). Let A be the 0-CMA (Z 2 , 0, Z m × Z n , (0, 0), δ) where δ((x, y), e) = (x + 1, y) and δ((x, y), n) = (x, y + 1). c is the coloring of A by ϕ : Z m × Z n → Σ defined, for all x ∈ Z m and y ∈ Z n , by ϕ(x, y) = c(x, y).

Automata with 1 counter

Theorem 9. A Z 2 -coloring is a Z 2 -1-map if and only if it is a particle.

Proof. Let c be a Z 2 -1-map. Suppose that c is not periodic. By lemma 7, all lines of c are non periodic Z-1-map and by lemma 3 each of them contains at least one discriminative point. S × {0} being finite, we reach a contradiction. Thus, c is made of a finite number of lines (or columns) which are Z-1-map.

Since each of these maps is ultimately-periodic, c is a particle.

Conversely, let c be a particle with period u = (x, y) with y > 0 (this can always be achieved up to exchanging axes). Thus c consists of periodic repetitions of y ultimately periodic lines. Without loss of generality, we can assume that all the lines are p ∈ Z + periodic with defect p satisfying p > x. Thus, we can use the same construction as in proof of theorem 5 on the whole block of lines (see Fig. 2). At first, let us construct a 1-CMA automaton over the set of states [-k -p, k + p] × [0, y -1] whose mapping function is defined for each element of one line of blocks (grayed in Fig. 2). This automaton can be constructed such that the mapping function satisfies, for all element (i, j) ∈ Z × [0, y -1] :

g(i, j) =              ((i, j), 0) if |i| ≤ 2p ((i[p] + p, j), i/p -1) if i > 2p ((i[p] -2p, j), -i/p -1) if i < -2p
Then we extend the construction in order to achieve a u periodic mapping function g :

Z 2 → [-k -p, k + p] × [0, y -1] by g(i, j) = g(i + x j/y , j[y]).
As x < p this function is well-defined since counters differ by at most one and periodicity ensure correctness of definition (see Fig 2).

The resulting coloring of A by ϕ : (i, j) → c(i, j) is c. u

Automata with 2 counters

Theorem 10. There exists a ∅ -complete Z 2 -2-map.

Proof. It is possible to extend any Z-k-map to a Z 2 -k-map by using identity function on e, w. Thus, existence of a ∅ -complete Z-2-map induces existence of a ∅ -complete Z 2 -2-map.

Theorem 11. Every collision is a Z 2 -2-map.

Proof. Let c be a collision. Instead of working on the whole plane, we cut it into four quarters and study at first independently each quarter. Without loss of generality, we consider the northern quarter. Intuitively, each line on this quarter can be see as succession of particle patterns separated by repetitions of several background patterns (see Fig. 3). Moreover, since the growth of background size between two consecutive particles is linear and that background patterns are periodic, it is possible to ensure that the growth in numbers of backgrounds patterns inside a line is the same for every background (up to choosing some bigger background patterns). More formally, for all k ∈ N, let

w(k) = c |[-k,k
]×{k} be the k-th northern sphere word of c. There exists an integer K ∈ N such that for all k > K, w(k) is only included in cones (i.e., avoid the central perturbation). The number of cones being finite, let l ∈ N be a multiple of vertical component of all the vectors intersecting with these sphere words. Formally, for all l ∈ [0, . . . , l-1], there exists n ∈ N, a(l , 0) . . . a(l , n) ∈ Σ * and b(l , 0) . . . b(l , n -1) ∈ Σ * such that for all k ∈ N, kl > K, w(kl

+ l ) = a(l , 0)b(l , 0) k a(l , 1)b(l , 1) k . . . a(l , n-1)b(l , n-1) k a(l , n). Notice that the set of constructed words W = {a(i, j) | i ∈ [0, . . . , l -1], i ∈ [0, . . . , n]} ∪ {b(i, j) | i ∈ [0, . . . , l -1], i ∈ [0, . . . , n -1]} is finite.
Using similar techniques as previously, let us consider the partial mapping function g which maps any element to the corresponding letter in W . Moreover, local transition function is chosen such that, for any element in w(kl+l ), counter are equal to (0, k) (resp. (k, 0)) if the corresponding letter is in a(l , 2i) (resp. a(l , 2i + 1)) and (i, k -i) (resp. (k -i, i)) if the letter is in the i-th w(l) w(2l)

a 0 a 0 a 1 a 1 a 2 a 2 a 3 a 3 a 4 a 4 b 0 b 1 b 2 b 3 b 0 b 0 b 1 b 1 b 2 b 2 b 3 b 3
Fig. 3. Decomposition of collisions (for concision, l is omitted in the picture)

repetition of the word b(l , 2i) (resp. b(l , 2i + 1)). One can note that g can be achieved by a local transition function. The last remaining problem is that g is, for now, only defined on the northern quarter of the plane.

The previous construction can be also achieved on all other quarters of the plane. What is left is to prove that these four constructions can be chosen so that they match on boundaries. To do this, one has just to look at the diagonals (it is the only place where two or more constructions overlap). First, note that, up to taking common multiples, we can assume that all four sphere words have the same l. Then, the empty counter depends on the parity of number of particle involved. Since background can also be seen as particle, one can easily introduce "phantom" particles to get rid of this problem.

The last point is that the mapping resulting of the union of the four constructions is defined everywhere but in the center of the map which consists on a finite number of points. Up to introducing new states, on can extend this mapping function to the one of a 2-CMA on Z 2 .

Theorem 12. Every aperiodic Z 2 -2-map is a collision.

Proof. Let A be a 2-CMA (Z 2 , 2, S, s 0 , δ). A being aperiodic, its mapping function g is one to one. In a first step, let us prove that for all ball of radius r containing n discriminative points under A, there is n + 1 discriminative points under A in the ball of radius r + |S| + 1.

Let B be a ball of radius r containing n discriminative points. Assume that B the ball of radius r + |S| + 1 does not contain any discriminative points. Let ul (resp. ur, ll) be one extremal upper-left (resp. upper-right, lower-left) ll ur z z discriminative point (see Fig. 4). Note that these points does not need to be distinct. Without loss of generality, one can assume that ur and ll have both the first counter empty. Let us consider the set {ll -(i, 0) | i ∈ N} of elements left of ll. S being finite, there exists two elements z and z in B \ B such that g(z) = (s, (a 0 , a 1 )) and g(z ) = (s, (b 0 , b 1 )) for some s ∈ S and a 0 , a 1 , b 0 , b 1 ∈ Z + . One can assume that z is the left one. There exists a path r i , i ∈ N + from z to ll. Since the same path starting from z does not encounter any discriminative point, a 0 -(b 0 -0) > 0. By doing the same reasoning on the path from z to ur in B avoiding B, we can deduce that b 0 -(a 0 -0) > 0 leading to a contradiction.

Let B be the ball containing all discriminative points whose counters are both less than (|S| + 1) 3 . We shall prove that all discriminative points are located on a finite number of thick half-lines of width (S + 1) 2 originated from B as depicted on Fig. 5. It follows that z a is on a half-line starting from an elements in B and thus z is at distance at most (|S| + 1) 2 of such an half-line. Slope of this half-line depends only on the point in the ball and b -a < (|S| + 1) 3 which only leave a finite number of possibilities.

The last intermediate result needed is that any point z ∈ Z 2 such that min c z < N has one discriminative point under A at distance at most N (|S| + 1). To prove this, let B be the ball of center z ∈ Z 2 and of radius |S|. This ball contains two distinct points z a , z b ∈ Z 2 whose mapping has the same state. Following this vector in the direction of decreasing counter value leads to encounter of a discriminative point at distance at most N (|S| + 1). A useful corollary is that any connected component between two consecutive (but not parallel) half-lines of discriminative points is independent since it contains balls of arbitrary size.

To conclude the proof, let us show that any map associated to A is a collision characterised by the sequence u ∈ Z 2 p of half-lines ordered by slope. Since all half-lines start inside a finite ball, there exist an element k ∈ N such that all discriminative points in the cone ku i (ku i-1 , ku i+1 ) are on a half-line of vector u i for all i ∈ Z p (see Fig. 5). In this cone, we have elements of the half-line (which are by construction u i periodic) and elements of connected components between two consecutive half-lines. These connected components are independent by the previous corollary. By lemma 3, they are bi-periodic and thus also ku i periodic for some k ∈ N + .

Fig. 1 .

 1 Fig. 1. Regular colorings of Z 2

Fig. 2 .

 2 Fig. 2. Grouping by blocks (number indicates value of the counter and dotted portion the non-periodic place where counter is empty)

Fig. 4 .

 4 Fig. 4. Finding a new discriminative point

Fig. 5 .

 5 Fig. 5. Disposition of discriminative pointsFormally, let us take a discriminative point z. By iterating previous result, there are at least |S| + 1 discriminative points in the ball of radius (|S| + 1) 2 centered around z. Among these points, either two have distinct empty counter which implies that non empty counter of z is less the (|S| + 1) 3 , or there exists two points z a and z b such that g(z a ) = (s, (a, 0)) and g(z b ) = (s, (b, 0)) for some s ∈ S and b > a ∈ N + . Let z ∈ G * such that z a z = z b . One can check that g(z a z n ) = (s, (a + n(b -a), 0)) for all n such that a + (b -a) n > (|S| + 1) 3 .

i.e., of maximal complexity (for many-one reductions) among recursively enumerable sets