LIP. Laboratoire de l Informatique du Parallélisme. Ecole Normale Supérieure de Lyon

Similar documents
Laboratoire de l Informatique du Parallélisme

Laboratoire de l Informatique du Parallélisme

Cellular Automata and Tilings

a cell is represented by a triple of non-negative integers). The next state of a cell is determined by the present states of the right part of the lef

Laboratoire de l Informatique du Parallélisme

Cellular automata, tilings and (un)computability

CSCI3390-Lecture 16: NP-completeness

CAPES MI. Turing Machines and decidable problems. Laure Gonnord

A Lower Bound for Boolean Satisfiability on Turing Machines

A Lower Bound of 2 n Conditional Jumps for Boolean Satisfiability on A Random Access Machine

How to Pop a Deep PDA Matters

Turing Machines, diagonalization, the halting problem, reducibility

Computability and Complexity

An Optimal Lower Bound for Nonregular Languages

Some Combinatorial Aspects of Time-Stamp Systems. Unite associee C.N.R.S , cours de la Liberation F TALENCE.

6.5.3 An NP-complete domino game

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM)

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

struction will simulate the given 1d-PQCA with deterministic head position, i.e. if this QTM is observed at any time during its computation, the proba

Part I: Definitions and Properties

Undecidable Problems and Reducibility

THE GARDEN-OF-EDEN THEOREM FOR FINITE CONFIGURATIONS

Undecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65

Permutive one-way cellular automata and the finiteness problem for automaton groups

On Rice s theorem. Hans Hüttel. October 2001

Dimension sensitive properties of cellular automata and subshifts of finite type

A RELATION BETWEEN SCHUR P AND S. S. Leidwanger. Universite de Caen, CAEN. cedex FRANCE. March 24, 1997

Computation Histories

Turing machines Finite automaton no storage Pushdown automaton storage is a stack What if we give the automaton a more flexible storage?

Cellular Automata: Overview and classical results

On Stateless Multicounter Machines

Undecidability. Andreas Klappenecker. [based on slides by Prof. Welch]

Laboratoire de l Informatique du Parallélisme. École Normale Supérieure de Lyon Unité Mixte de Recherche CNRS-INRIA-ENS LYON n o 8512

The Church-Turing Thesis

Turing Machines Decidability

Computability and Complexity

number of reversals in instruction (2) is O(h). Since machine N works in time T (jxj)

Theory of Computation (IX) Yijia Chen Fudan University

Theory of Computing Tamás Herendi

Q = Set of states, IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar

Introduction to Turing Machines. Reading: Chapters 8 & 9

About the relationship between formal logic and complexity classes

A note on parallel and alternating time

UNIT-VIII COMPUTABILITY THEORY

CS5371 Theory of Computation. Lecture 14: Computability V (Prove by Reduction)

Upper and Lower Bounds on the Number of Faults. a System Can Withstand Without Repairs. Cambridge, MA 02139

Basic building blocks for a triple-double intermediate format

TRANSLATING PARTITIONED CELLULAR AUTOMATA INTO CLASSICAL TYPE CELLULAR AUTOMATA VICTOR POUPET

Turing Machines and Time Complexity

Complexity Theory Part II

Parallel Turing Machines on a Two-Dimensional Tape

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Non Determinism of Finite Automata

Claude Marche. Bat 490, Universite Paris-Sud. Abstract

CSCE 551 Final Exam, Spring 2004 Answer Key

Theory of Computation

Advanced topic: Space complexity

Decidability of Existence and Construction of a Complement of a given function

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

DM17. Beregnelighed. Jacob Aae Mikkelsen

The purpose here is to classify computational problems according to their complexity. For that purpose we need first to agree on a computational

ECS 120 Lesson 15 Turing Machines, Pt. 1

1 Non-deterministic Turing Machine

Peter Wood. Department of Computer Science and Information Systems Birkbeck, University of London Automata and Formal Languages

MTAT Complexity Theory October 13th-14th, Lecture 6

Comparison of several polynomial and exponential time complexity functions. Size n

3515ICT: Theory of Computation. Regular languages

Non-emptiness Testing for TMs

Announcements. Problem Set 7 graded; will be returned at end of lecture. Unclaimed problem sets and midterms moved!

RN-coding of numbers: definition and some properties

Polynomial-time Reductions

6.045: Automata, Computability, and Complexity (GITCS) Class 15 Nancy Lynch

c 1998 Society for Industrial and Applied Mathematics Vol. 27, No. 4, pp , August

Computability and Complexity Theory

for Propositional Temporal Logic with Since and Until Y. S. Ramakrishna, L. E. Moser, L. K. Dillon, P. M. Melliar-Smith, G. Kutty

CS4026 Formal Models of Computation

Theory of Computation

Cellular Automata: Tutorial

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

conp, Oracles, Space Complexity

Preface These notes were prepared on the occasion of giving a guest lecture in David Harel's class on Advanced Topics in Computability. David's reques

Lecture 14 - P v.s. NP 1

CS6901: review of Theory of Computation and Algorithms

CS 21 Decidability and Tractability Winter Solution Set 3

CPSC 421: Tutorial #1

On the Myhill-Nerode Theorem for Trees. Dexter Kozen y. Cornell University

Notes for Lecture Notes 2

Notes on Space-Bounded Complexity

Lecture 3: Nondeterminism, NP, and NP-completeness

The group of reversible Turing machines

COMPARATIVE ANALYSIS ON TURING MACHINE AND QUANTUM TURING MACHINE

An algebraic characterization of unary two-way transducers

Computability and Complexity

BALA RAVIKUMAR Department of Computer Science, Sonoma State University Rohnert Park, CA 94928, USA

A representation of context-free grammars with the help of finite digraphs

1 Introduction A general problem that arises in dierent areas of computer science is the following combination problem: given two structures or theori

CS 7220 Computational Complexity and Algorithm Analysis

Introduction to Languages and Computation

Lecture 12: Mapping Reductions

Circuit depth relative to a random oracle. Peter Bro Miltersen. Aarhus University, Computer Science Department

Transcription:

LIP Laboratoire de l Informatique du Parallélisme Ecole Normale Supérieure de Lyon Institut IMAG Unité de recherche associée au CNRS n 1398 Inversion of 2D cellular automata: some complexity results runo Durand February 1993 Research Report N o 93-05 Ecole Normale Supérieure de Lyon 46, Allée d Italie, 69364 Lyon Cedex 07, France, Téléphone : + 33 72 72 80 00; Télécopieur : + 33 72 72 80 80; Adresses électroniques : lip@frensl61.bitnet; lip@lip.ens lyon.fr (uucp).

Inversion of 2D cellular automata: some complexity results runo Durand February 1993 Abstract In this paper, we prove the co-np-completeness of the following decision problem: \given a 2-dimensional cellular automaton A, is A injective when restricted to nite congurations not greater than its length?" In order to prove this result, we introduce two decision problems concerning respectively Turing Machines and tilings that we prove NP-complete. We then present a transformation of problems concerning tilings into problems concerning cellular automata. Keywords: cellular automata, inversion, reversibility, complexity Resume Nous prouvons dans cet article la co-np-completude du probleme de decision suivant: \etant donne un automate cellulaire plan A, sa restriction aux congurations nies de taille inferieure a la taille du codage de A est-elle bijective?" Nous introduisons deux problemes de decision concernant les machines de Turing et les pavages, puis nous demontrons que ces problemes sont NP-complets. Pour prouver notre resultat principal, nous introduisons une transformation des pavages en une famille adequate d'automates cellulaires. Mots-cles: automates cellulaires, inversion, reversibilite, complexite

Inversion of 2D cellular automata: some complexity results runo Durand Laboratoire de l'informatique du Parallelisme ENS-Lyon, 46 Allee d'italie 69364 Lyon Cedex 07 France bdurand@lip.ens-lyon.fr January 10, 1993 1 Introduction Cellular automata (CA) are often used for modeling complex natural systems with many very simple cells interacting locally with each other. Possible evolutions of cellular automata have been extensively studied in order to analyze evolutions of such natural systems. Problems like bijectivity or surjectivity of CA are very basic because they correspond to physical notions: conservation of information (which corresponds to physical reversibility) or reachability of all states. In 1962-63, Moore and Myhill proved the so-called \garden of Eden" theorem which proves that surjectivity is equivalent to injectivity on nite congurations [9, 8]. Richardson proved in 1972 [10] that if a CA realizes a bijective function, then there exists another CA called its inverse that realizes the inverse function. The same year, Amoroso and Patt proved that the reversibility (or the surjectivity) of one-dimensional CA is decidable [1]. One-dimensional CA work on a bi-innite line of cells, two-dimensional CA work on a plane tiled with square cells, etc: : : This work was partially supported by the Esprit asic Research Action \Algebraic and Semantical Methods In Computer Science" and by the PRC \Mathematique et Informatique". 1

Recently, Jarrko Kari proved that the reversibility of two-dimensional CA fails to be decidable [7, 6]. An easy consequence of this result is that the reverse CA of a reversible CA cannot be found by algorithm: its size can be greater than any computable function of the size of the reversible CA. The proof of this result consists in transforming the tiling problem of the plane which has been proved undecidable in 1966 by erger [3, 11] into the reversibility problem on an adequate family of CA. The main goal of this paper is to prove that if we restrain the eld of action of the two-dimensional CA to nite conguration bounded in size, it is still \dicult" to prove that the CA is (or is not) reversible. As far as we know, it would be the rst complexity result concerning a global property of 2D CA. We prove that the decision problem presented above belongs to the class of co-np-hard problems or to the class of co-np-complete problems if the size of the considered nite congurations are supposed bounded by the size of the representation of the considered CA. It is not the case for one-dimensional CA for which the inverse can be computed in polynomial time in the size of the transition table (see [12] for another point of view on this problem). Our result is proved by introducing a very adequate set of tiles having an ad-hoc property. J. Kari has proved the undecidability of the surjectivity problem for two-dimensional CA [6] by introducing a very complicated set of tiles. We keep the ideas of the construction of J. Kari but the tile set we use is much simpler. With this construction, we reduce decision problems concerning tilings into decision problem concerning CA. In the following section, we give the usual denitions of cellular automata, tilings, and present well-known theorems which are related to our topics. In the next section we prove our main complexity result: the problem that we call CA-FINITE-INJECTIVE is co-np-complete. Our proof consists in a reduction of a problem concerning nite tilings that we call FINITE-TILING. We prove this problem NP-complete by a reduction of another problem concerning the minimal computing time of non-deterministic Turing machines: NDTM-TIME. The reduction of FINITE-TILING into CA-FINITE-INJECTIVE is not so simple as the previous one. Anyway, all technical aspects of the proof are contained in the construction of a special set of tiles which veries specic properties. The construction is not dicult by itself nor are the properties, but in order to prove the properties, we have to check it for many kinds of tiles which is very long and tedious. 2

2 Denitions and basic properties 2.1 Cellular automata Cellular automata are formally dened as quadruplets (n; S; N; f): The set of states is a nite set S = fs 1 ; s 2 ; : : :; s k g. A conguration is an application from Z n to S. The set of all the conguration is SZ n and the dimension of the space is n. If we imagine Z n as being a tiling of R n by identical hypercubes, each tile forms a cell which has an associated state. The neighborhood N of a cellular automaton is an l-tuple of distinct vectors of Z n. For us, N = fv 1 ; : : :; v l g and 8(i; j) 2 f1; : : :; lg 2, i 6= j ) v i 6= v j : The v i 's are the relative positions of the cells in the neighborhood with respect to a given center cell. The states of the neighbor cells are the states used to compute the new state of the center cell. The local function of the cellular automaton f : S l 7! S gives the local transition rule. The global function G of the cellular automaton is dened via f on the set of congurations SZ n : G(c) = c 0, 8i 2 Z n, c 0 (i) = f(c(i + v 1 ); : : :; c(i + v l )): In the following, we consider 2-dimensional CA i.e. CA for which n = 2. Remark that two distinct cellular automata do not dier by the denition of their global function G: they are only characterized by N and f. Sometimes, a quiescent state q is distinguished in S. An everywhere quiescent conguration has to remain unchanged when the CA is applied i.e. f(q; q; : : :; q) = q. A nite conguration is an almost everywhere quiescent conguration. If there exist two integers i and j such that all the nonquiescent cells of the conguration are located inside a square of size i j, then, in the following, we say that the size of the nite conguration is smaller than (or equal to) i j. Size: The size necessary to code a cellular automaton is at most s l : log s where s is its number of states and l the number of elements of its neighborhood. 3

The size of the representation of the CA is exactly the sum of the size of its local transition function and of the size of its neighborhood. The local transition function is only a l-dimensional table. Hence its size is s l : log s. The size of the neighborhood is the size of the coding of the coordinates of each neighbor cell. We assume in the following that this last size is lower than the size of the transition table. If it is not the case, it means that the neighbors of a cell are very far from it (about 2 sl cells far away) hence a single iteration of the CA is intractable! The reductions we present are still valid, but the decision problems do not belong, a priori, to co-np. 2.2 Turing machines. There exist many dierent (although equivalent) denitions of deterministic Turing machines (DTM) and non-deterministic Turing machines (NDTM). We briey present below our denitions, and we discuss of what could be considered as the size of a DTM and a NDTM. In our formalism, the two kinds of machines dier only by their transition function. oth of them have a single bi-innite tape, on which can be read and written 0's and 1's by a read-write head (RWH). The letter \0" is sometime called the blank symbol. The computations begin on an almost everywhere blank tape. The input is written on the non-blank part of the tape. DTM and NDTM both have a nite set of states S. The number of states of a Turing machine is denoted by (). One of the states of S is called initial state and is denoted by q I. Two special states are added but do not belong to S: an acceptance halt-state q Y and a refusal halt state q N. The two models dier by the denition of their transition function: for a DTM, the transition function associates a new state, a new letter and a movement of the RWH to a state and a letter. Formally: : S f0; 1g 7?! (S [ fq Y ; q N g) f0; 1g fleft; rightg for a NDTM, the transition function associates an arbitrary number of possible new state, a new letter and a movement of the RWH to a state and a letter. Formally: : S f0; 1g 7?! (S [ fq Y ; q N g) f0; 1g fleft; rightg The computation of a Turing machine begins in the initial state, and with the RWH located on the rst left letter of the input word of the machine. It consists in the iteration of the following \procedure". : 4

1. if the machine is in a halt-state, then the machine stops and says \yes" if in q Y, \no" if in q N. If the Turing machine is not only a decision machine but also computes an output, the output word is supposed to be located at the right of the current position of the RWH. 2. if the machine is not in a halt-state, then let q be the current state, and x be the letter on the tape at the current position of the RWH. If the machine is deterministic, and if (q; x) = (q 0 ; x 0 ; d), then the machine writes x 0 on the tape with the RWH, enters the new state q 0 and its RWH moves according to d. If the machine is non-deterministic, and if (q; x) = (Q; x 0 ; d), then the machine writes x 0 on the tape with the RWH, enters one of the states contained in Q, and its RWH moves according to d. In the following, our study only concerns decision problems. That is why we consider only decision Turing machines: when given an input, we expect them to answer \yes" or \no" if the computation ends, but what is written on its tape does not matter. Lemma 1 Consider a TM. The size necessary to code the machine is a polynomial function of its number of states () even if is nondeterministic. Proof. First recall that the size necessary (and sucient) to code a function f : A 7! is exactly a log b if a and b denote the number of element of respectively A and. Hence the size of the transition function of is 2:(): log(4:(() + 2)) if is a DTM. 2:(): log(4:2 (()+2) ) = 2:():(() + 4) if is a NDTM. As the coding of the number of elements of the set of states requires log(()) bits, then the size necessary to code the machine is a polynomial function of the number of states. 2.3 Tilings A tile is a square the sides of which are colored. The colors belong to a nite set C called the color set. A set of tiles T is a subset of C 4. All the tiles have the same (unit) size. A tiling of the plane is valid if and only if 5

all pairs of adjacent sides have the same color. Notice that it is not allowed to turn tiles. Notice that coloring the sides and the corners would lead to the same notion. Furthermore, we could have aected to each tile a single color and say that a tiling of the plane is valid if and only if a given relation holds between each cell and its neighbors. Theorem 1 Given a tile set, it is undecidable to know whether this tile set can be used to tile the plane. This well-known theorem is due to erger [3] in 1966 and a simplied proof was given in 1971 by Robinson [11]. We can also dene nite tilings. We assume that the set of colors contains a special \blank" color and that the set of tiles contains a \blank" tile i.e. a tile whose all sides are blank. A nite tiling is an almost everywhere blank tiling of the plane. If there exist two integers i and j such that all the nonblank tiles of the tiling are located inside a square of size i j, then, we say that the size of the nite tiling is smaller than (or equal to) i j. Notice that inside the i j square, there can be blank and non-blank tiles. If there is at least one non-blank tile, then the tiling is called non-trivial. Another undecidability result is known and can be proved simply by using a construction presented in [6] which reduces the undecidability of the halting problem for Turing machines to the following problem: Theorem 2 Given a tile set with a blank tile, it is undecidable whether this tile set can be used to form a valid nite non-trivial tiling of the plane. 3 Complexity results In this section, we prove that the problem of knowing if a given CA is reversible restricted to nite congurations the size of which is lower than n n (where n is the size of the CA) is co-np-complete. We call this problem CA-FINITE-INJECTIVE. In order to prove this result, we introduce two decision problems we prove NP-complete: NDTM-TIME and FINITE- TILING. 3.1 NDTM-TIME is NP-complete NDTM-TIME 6

INSTANCE: A Non-Deterministic Turing Machine. An integer n lower than the number of states of the machine. QUESTION: Is there a computation of the machine beginning on an empty tape and halting after less than n steps. Proof. This problem belongs to NP: we construct a NDTM 0 that, given an instance of the problem (i.e. a NDTM that we call and an integer n lower than the number of states of ) computes n transitions of and after these computations, if answers \yes" then 0 answers yes, else, if the computation is not nished or if the answer of is \no" then 0 answers \no". Consider an universal Turing Machine as described for instance in [5]. This machine, when given as input a deterministic Turing machine, is able to compute its evolution on the blank tape. The needed time to compute a step of the evolution of is lower than a polynomial function of the size of. We transform this universal DTM into an universal NDTM: when the input is a NDTM, then if oers a choice in its evolution, then the universal NDTM oers the same choice. Thus, the universal NDTM simulates an arbitrary computation of the NDTM in polynomial time. 0 acts as follows: on the input n and, it computes one step of the universal NDTM with as input, then it substracts 1 to n, then computes another step, substracts 1 to n? 1, etc: : : When n = 0, then if the simulation of has ended on the acceptance halt-state q Y, then the NDTM 0 halts in its acceptance state. Else it halts in its refusal state. As n is lower than the number of states of, then the computation time for each step such dened is polynomial. Hence there is an acceptance computation of 0 on the entrance (; n) with the usual restriction for n if and only if there exists a computation of the machine beginning on an empty tape and halting after less than n steps. NDTM-TIME is in NP. To prove that this problem is NP-complete, we prove that any problem in NP can polynomially reduce to NDTM-TIME. Our proof is much more simple than Cook's proof which proves that any problem in NP can reduce to the well-known SATISFIAILITY problem [4]. Recall that a problem is said to polynomially reduce to the problem 0 if and only if there exists a polynomial-time (deterministic) algorithm which transforms any instance x of into an instance x 0 of 0. Furthermore, it is required that the answer of on x should be \yes" if and only if the answer of 0 on x 0 is \yes" [2]. Let be any problem in NP. There exists a non-deterministic Turing machine (NDTM for short) that solves in polynomial time. Let be 7

such a NDTM and P the associated polynomial function. We transform in the following way: 1. We rst construct a new NDTM. 0 We conserve all states and transitions of. We transform the halt-state q N of into a \normal" new state q 0 of 0 and add the following transitions: (q 0 ; 0) = f(q 0 ; 0; r)g (q 0 ; 1) = f(q 0 ; 1; r)g It means that, in 0, if a computation enters the state q 0, then it is absolutely sure that the computation will not reach any halt-state and thus will never end. We create a new refusal halt-state for 0 with no transitions arriving in this state. The new NDTM 0 halts on an input if and only if halts on the same input and answers \yes". 0 either halts and answers \yes" or does not halt. The size of 0 is just a constant larger than the size of 0. 2. Let x be an instance of the problem. We construct a new NDTM (;x) such that (;x) writes x on its tape and then runs 0 ( 0 reads x as input). If we run (;x) on a blank tape then the answer of (;x) is \yes" if and only if x is a solution for. If x is not a solution for then (;x) does not halt. Anyways, the answer is never \yes" after the time 2jxj + P (jxj) = Q(jxj) where jxj denotes the size of x. Q is obviously a polynomial function. The size of (;x) is a polynomial function of the size of and of the size of x. Its number of states is f(( ); jxj) = jxj + ( ) + 2 where () is the number of states of the Turing machine and f is a polynomial function. Given x and, (;x) can be computed by a polynomial-time (deterministic) algorithm. 3. We add new states to the state set of (;x). As we intend that these added states do not modify any evolution of (;x), we do not add new transitions. The number of states we add is exactly jq(jxj)? f(( ); jxj)j which is a polynomial function. This addition of states can be computed by a polynomial-time (deterministic) algorithm on the inputs x and. The new NDTM is called 0 (;x). 8

Given a problem in NP and an input x of this problem, there exists a polynomial-time algorithm that computes the NDTM 0 (;x). The answer for on the instance x is \yes" if and only if the answer for NDTM-TIME on the instance 0 (;x) is "yes". We have proved that is polynomially reducible to NDTM-TIME. 3.2 From NDTM-TIME to FINITE-TILING FINITE-TILING INSTANCE: Finite set C of colors with a blank color, collection T 2 C 4 of tiles including a blank tile. A positive integer n jcj. QUESTION: Is there a nite non-trivial tiling of the plane and a n n square such that all non-blank tiles are located inside the square. Proof. First remark that this problem trivialy belongs to NP. Now consider an instance of NDTM-TIME i.e. a NDTM and an integer n lower than the number of states () of the machine. We rst construct a set of tiles associated to. Let S be the set of states of. An almost identical construction can be found in [6]. The goal of this construction was to prove that the problem of knowing if there exists a nite and non-trivial tiling of the plane is undecidable. We dene below the colors used by our tiles: A \blank" color. An \initialization" color I. A \halting" color H. A \left" color L. A \right" color R. A \state" color s for each s 2 S [ fq Y ; q N g. A \symbol" color a for each a 2 f0; 1g. A \state-symbol" color s:a for each s 2 S [ fq Y ; q N g and for each a 2 f0; 1g. With these colors, we construct a tile set T : we specify the tiles by the color of their North, East, South, and West sides: 9

The \blank" tile (; ; ; ). The \initialization" tiles (L; I; ; ); (0; I; ; I); (q I :0; I; ; I); (R; ; ; I) its initial state. (Fig- Recall that `0' is the blank symbol of and q I ure 1) L 0 q I.0 R I I I I I I Figure 1: The \initialization" tiles The \static" tiles (Figure 2) (L; ; L; ); (0; ; 0; ); (1; ; 1; ); (R; ; R; ) L 0 1 R L 0 1 R Figure 2: The \static" tiles The \computation" tiles of 2 kinds: (Figure 3) { (a 0 ; ; s:a; s 0 ) if the transition (s 0 ; a 0 ; left) is a possible image of (s; a). 10

{ (a 0 ; s 0 ; s:a; ) if the transition (s 0 ; a 0 ; right) is a possible image of (s; a). a' a' s' s' s.a s.a Figure 3: The \computation" tiles The \merging" tiles of 2 kinds: (Figure 4) { (s:a; s; a; ) for each s 2 S [ fq Y ; q N g and for each a 2 f0; 1g. { (s:a; ; a; s) for each s 2 S [ fq Y ; q N g and for each a 2 f0; 1g. s.a s.a s s a a Figure 4: The \merging" tiles The \halting" tiles (; H; L; ); (; H; 0; H); (; H; 1; H); (; H; s h :a; H); (; ; R; H) for each a 2 f0; 1g and for each s h 2 fq Y ; q N g. (Figure 5) With these tiles, we simulate the space time diagram of a computation of the NDTM. It is clear that there exists a non-trivial tiling of the plane of length lower than n n if and only if there exists a computation of that 11

H H H H H H L a q h.a R Figure 5: The \halting" tiles ends after less than n? 2 steps. The number of colors of our set of tiles is exactly 5 + (() + 2) + 2 + 2:(() + 2) = 3:() + 13. Our transformation is polynomial, hence FINITE-TILING is NP-complete. 3.3 From FINITE-TILING to CA-FINITE-INJECTIVE A transformation between tilings and two-dimensional cellular automata was rst presented by Jarkko Kari in [7] and a more complete proof can be found in [6]. The main idea of the transformation is to introduce a special set of tiles which has a very special property called by J. Kari nite plane lling property. We introduce another set of tiles, simpler than J. Kari's, which satises a slightly more restrictive property. We shall refer to this tile set as D. With the help of D, for each tile set T, we construct a cellular automaton A T in order to reduce FINITE-TILING to CA-FINITE-INJECTIVE. CA-FINITE-INJECTIVE INSTANCE: A two-dimensional cellular automaton A with Von Neumann neighborhood. Two integer p and q smaller than the size of A. QUESTION: Is A injective restricted to all nite congurations smaller than p q. Theorem 3 CA-FINITE-INJECTIVE is co-np-complete. efore proving this theorem, we introduce our tile set D and its properties. 12

3.3.1 Our tile set D The tiles of D are described in Fig. 6. The sides contain a color (\blank", \border", \odd", \even", or \the-end"), a label (N, S, E, W, N+, S+, E+, W +, or!), and possibly an arrow. The labels are there to force that, in a valid tiling, inside a rectangle bordered with \border" tiles, there exists a unique cell labeled with (N +, E+, S+, W +) (see Fig. 8 and lemma 3). The four tiles in the center of Fig. 6 with no written side label have their North, East, South, and West sides labeled by (N+, E+, S+, W +), (X, Y, X, Y ), (N, Y +, S, Y +) or (X+, E, X+, W ) where X is N or S, and Y is E or W. The sides labeled n (resp. e, s, w) in the Fig. 6 have in the tiling the label N or the label N+ (resp. E or E+, S or S+, W or W +). The others are labeled by!. With this set of tiles, a tiling is considered as valid if and only if all pairs of n n w e w e s s blank border odd even the-end Figure 6: The tiles of D adjacent sides have the same color, the same label, and for each arrow, the 13

head points out on the tail of the arrow of the adjacent cell. Denition 1 A basic rectangle of size p q is a nite valid tiling of the plane of size p q with no side labeled \blank" or \border" inside the rectangle. See Fig. 7 for a description of the path given by the arrows in a basic rectangle. Lemma 2 For every integers p, and q, both greater than 3, there exists a nite valid tiling of the plane by D of size p 2q. Each valid nite tiling of the plane consists in a nite number of juxtaposed basic rectangles. Proof. It is very easy to convince oneself that a nite tiling of size 2p2q can be obtained by using the row of tiles between the horizontal dashed lines and the two columns of tiles between the vertical dashed lines in Fig. 6. Remark that the North side of a tile is \odd" if the number of tiles below it until a border is odd, and the West side of a tile is \odd" if the number of tiles on its right until a border is odd. The North side of the last row (resp. West side of the last column) is colored by \the-end" which means that the coordinate of the row (resp. column) is odd and that it is the last row (resp. column). To prove that each valid nite tiling of the plane consists in a nite number of basic rectangles juxtaposed, we have to check if it is possible or not to nd another kind of combinations of these tiles. It is very easy to convince oneself that if one consider a North-West non-blank tile, then it is a North-West corner, that it is followed on its right by a North border and below by a West border, etc: : : Lemma 3 Consider a basic rectangle. Then the path dened by the arrows of the cells forms a loop which visits one time each tile of the inside of the rectangle. Inside the rectangle, there exists an unique cell labeled (N +, E+, S+, W +). Proof. Exactly as in proof of lemma 2, we observe that the leftmost column contains a vertical path directed North etc: : : The loop in the rectangle is of the same kind as in Fig. 7. It is very easy to check that there exists an unique cell labeled (N+, E+, S+, W +) in the rectangle: the cells with a side labeled X+ have to form a cross in the rectangle as shown in Fig. 8. The horizontal part of the cross is labeled horizontally by W + or E+ and, above it the vertical labels are N, below they are S. 14

y a proof similar to the proof of lemma 2, we can show the following result: Lemma 4 Consider a nite tiling (valid or not). If the tiling is correct on each cell of a path, then this path forms a loop and visits every tiles of a basic rectangle. Figure 7: The path in a basic rectangle 3.3.2 The reduction Consider an instance of FINITE-TILING i.e. a nite set C of colors with a blank color, a collection T 2 C 4 of tiles including a blank tile, and a positive integer n jcj. We construct a cellular automaton A T = (S; N; f T ) dened as follows: The state set S D T f0; 1g. S contains all triplets (d; t; ) of D T f0; 1g under the following restrictions: { if one of the sides of d is \blank" or \border", then t is the blank tile of T. 15

W W N W W W N+ W E E E N N+ N N+ W+ N N+ W+ W+ W+ W+ W+ E+ E+ E+ S S+ Figure 8: The labels in a basic rectangle { if d is labeled by (N+, E+, S+, W +), then t is not the blank tile of T. The neighborhood N is the Von Neumann neighborhood i.e. N = f(0; 0); (0; 1); (0;?1); (1; 0); (?1; 0)g The local rule f T applied on a cell the state of which is (d; t; ) may change only the bit component. At each cell both the tilings D and T are checked. If there is a tiling error, or if the cell contains no arrow, then the state of the cell is not altered. Else, there is no tiling error in the concerned cell, and the bit component is changed by performing an \exclusive or" operation with the bit attached to the cell pointed by the direction of the D-component. The quiescent state of A T is (blank, blank,0). We present now the basic theorem which provides a link between tilings and cellular automata. Theorem 4 Let n be an integer greater or equal to 3 and T be a set of tiles. The cellular automaton A T is not injective restricted to nite congurations of size lower than 2n 2n if and only if the tile set T can be used to form a nite non-trivial tiling of the plane of size lower than (2n? 4) (2n? 4). Proof. Assume that A T is not injective restricted to nite congurations of size lower than 2n 2n. Then there exist two dierent nite congurations of size lower than 2n 2n c and c 0 having the same image by A T. Remark that only the bits can be dierent in c and c 0 since A T does not aect the 16

tiles components: c and c 0 are dierent in at least one cell. On this cell, there is an arrow and the tilings are correct, otherwise the images of c and c 0 could not be the same. Thus c and c 0 dier in the cell pointed by the arrow because a \xor" is performed by A T. y nite induction, by lemma 4, the path such constructed forms a loop and there exists a basic rectangle of D on which the tiling of T is correct. y lemma 3, the borders of the rectangle are blank in the state component of T, hence we can construct a nite tiling with T. The tiling is not trivial because T is not blank on the cell labeled by (N+, E+, S+, W +) in D (lemma 2). The size of the tiling is at most (2n? 4) (2n? 4). Conversely assume that there exists a nite non-trivial tiling of the plane by T of size lower than (2n? 4) (2n? 4). We put this tiling inside a 2n2n rectangle tiled by D. The tiling is not trivial thus there exists a non-blank tile on which we can put the tile of D labeled by (N+, E+, S+, W +). We dene two congurations c and c 0 of size 2n 2n: c is obtained by adding the bit component 0 everywhere. For c 0, we add to the two tilings the bit component 1 on the cells whose D-component has an arrow, and 0 elsewhere. As both the tilings are correct, A T performs an \exclusive or" on the loop of the rectangle and both c and c 0 have the same image c. Hence A T restricted to nite congurations of size lower than 2n 2n is not injective. Corollary 1 Given a set of tiles T and an even integer n, T can be used to form a nite non-trivial tiling of the plane of size lower than n n if and only if the cellular automaton A T is not injective when restricted to nite congurations of size lower than (n + 4) (n + 4). Proof of theorem 3. With the previous result, it is very easy to prove that CA-FINITE-INJECTIVE is co-np-complete. We prove a stronger result: CA-FINITE-INJECTIVE is co-np-complete with a restriction on the instance: p = q(= n) and n 2 is an even integer. CA-FINITE-INJECTIVE with or without the restriction mentionned above is in co-np because one can check in time polynomial in the size of the cellular automaton A if two nite congurations smaller than n n have the same image by A. So we only have to prove that the reduction presented from FINITE-TILING to CA-FINITE-INJECTIVE with the help of the automaton A T (corollary 1) has a polynomial cost. If c denotes the number of colors used by the tile set T and t its number of tiles, then t c 4. If we call d the size of the tile set D then the size of the state set S of A T is at most 2dt. In the case of D, the number d of its tiles is exactly 61. 17

The size of the neighborhood is 5 hence the size of the transition table of the automaton A T is at most (2dt) 5 : log(2dt) which is a polynomial function of t. As each element of the transition table can be computed in constant time, the reduction between the two problems is polynomial. Notice that we have proved that under a polynomial reduction, the answer to the problem FINITE-TILING applied to the instance T is \yes" if and only if the answer to the problem CA-FINITE-INJECTIVE applied to the instance A T is \no". It explains why CA-FINITE-INJECTIVE is co-np-complete and not NPcomplete. References [1] S. Amoroso and Y.N. Patt. Decision procedures for surjectivity and injectivity of parallel maps for tesselation structures. J. Comp. Syst. Sci., 6:448{464, 1972. [2] J.D. Ullman A.V. Aho, J.E. Hopcroft. The Design and Analysis of Computer Algorithms. Addison-Wesley, 1974. [3] R. erger. The undecidability of the domino problem. Memoirs of the American Mathematical Society, 66, 1966. [4] S.A. Cook. The complexity of theorem-proving procedures. In Proc. 3rd Ann. ACM Symp. on Theory of Computing, pages 151{158. Association for Computing Machinery, 1971. [5] J.D. Ullman J.E. Hopcroft. Introduction to Automata Theory, Languages, and Computation. Addison-Wesley, 1979. [6] J. Kari. Reversibility and surjectivity problems of cellular automata. to appear in Journal of Computer and System Sciences. [7] J. Kari. Reversability of 2d cellular automata is undecidable. Physica, D 45:379{385, 1990. [8] E.F. Moore. Machine models of self-reproduction. Proc. Symp. Apl. Math., 14:13{33, 1962. [9] J. Myhill. The converse to Moore's garden-of-eden theorem. Proc. Am. Math. Soc., 14:685{686, 1963. 18

[10] D. Richardson. Tesselations with local transformations. Journal of Computer and System Sciences, 6:373{388, 1972. [11] R.M. Robinson. Undecidability and nonperiodicity for tilings of the plane. Inventiones Mathematicae, 12:177{209, 1971. [12] K. Sutner. De ruijn graphs and linear cellular automata. Complex Systems, 5:19{30, 1991. 19