Descriptive complexity for pictures languages (Extended abstract) EtienneGrandjeana,FrédéricOliveb,GaétanRicharda aUniversitédeCaen/ENSICAEN/CNRS-GREYC-Caen,France bAix-MarseilleUniversité-LIF-Marseille,France 2 1 Abstract 0 2 Thispaperdealswithdescriptivecomplexityofpicturelanguagesofanydimensionbysyntacticalfragments ofexistentialsecond-orderlogic. n a • We uniformly generalize to any dimension the characterization by Giammarresi et al. [GRST96] of J theclassofrecognizablepicturelanguagesinexistentialmonadicsecond-orderlogic. 7 2 • We state several logical characterizations of the class of picture languages recognized in linear time onnondeterministiccellularautomataofanydimension.Theyarethefirstmachine-independentchar- ] O acterizationsofcomplexityclassesofcellularautomata. L Ourcharacterizationsareessentiallydeducedfromnormalizationresultsweproveforfirst-orderandexis- . s tentialsecond-orderlogicsoverpictures. Theyareobtainedinageneralanduniformframeworkthatallows c [ to extend them to other "regular" structures. Finally, we describe some hierarchy results that show the optimalityofourlogicalcharacterizationsanddelineatetheirlimits. 1 v Keywords: Picturelanguages,locality,recognizability,lineartime,cellularautomata,logical 3 characterizations,existentialsecond-orderlogic. 5 8 5 . Introduction 1 0 Onegoalofdescriptivecomplexityistoestablishlogicalcharacterizationsofnaturalclassesofproblems 2 1 infinitemodeltheory.Manyresultsinthisareainvolvesecond-orderlogic(SO)anditsrestrictions,monadic : second-orderlogic(MSO)andexistentialsecond-orderlogic(ESO). Indeed,therearetwolinesofresearch v thatroughlycorrespondtoeitheroftheserestrictions: i X r (a)Theformallanguagecurrent. ItstartsfromthepioneeringresultbyBüchi,ElgotandTrahtenbrot[Büc60], a which states that the class of regular languages equals the class of MSO-definable languages; in short, REG =MSO. This line of research aims at characterizing in logic the natural classes of algebraically de- finedlanguages(setsofwords)orsetsofstructures(trees,graphs,etc.)definedbyfinitestaterecognizability orlocalpropertiessuchastilings. Emailaddresses:[email protected](EtienneGrandjean),[email protected](Frédéric Olive),[email protected](GaétanRichard) PreprintsubmittedtoElsevier January30,2012 (b)Thecomputationalcomplexitycurrent. Itoriginatesfromanotherfamousresult,Fagin’sTheorem[Fag74], whichcharacterizestheclassNPastheclassofproblemsdefinableinESO. Formanyyears,bothdirectionsofresearchhaveproducedplentyofresults: seee.g. [EF95,Lib04]for + descriptivecomplexityofformallanguagesand[EF95,Imm99,GKL 07,Lib04]fortheoneofcomplexity classes. However,andthismaybesurprising,onlyfewconnectionsareknownbetweenthosetwoareasof descriptivecomplexity. Ofcourse,anexplanationisthatformallanguagetheoryhasitsownpurposesthat have little to do with complexity theory. In our opinion, the main reason is that while MSO logic exactly fits the fundamental notion of recognizability, as exemplified in the work of Courcelle [CE12], this logic seemstransversaltocomputationalcomplexity. WearguethisisduetotheintrinsiclocalitythatMSOlogic inheritsfromfirst-orderlogic[Han65,Gai82]. Typically,whereasMSO,orevenexistentialMSO(EMSO), expressessomeNP-completegraphproblemssuchas3-colourability,itcannotexpresssomeotheronessuch asHamiltonicity(see[Tur84,dR87,Lib04])orevensometractablegraphproperties,suchastheexistence ofaperfectmatching. Incontrast,thesituationisveryclearontreesasonwords: MSOonlycapturesthe class of "easiest" problems; an extension of Büchi’s Theorem [TW68] states that a tree language is MSO definableiffitisrecognizablebyafinitetreeautomaton Thus,items(a)and(b)aboveseemquiteseparateforproblemsonwords,treesorgraphs,inonecase(for wordsandtrees)becauseMSOonlyexpresseseasyproblems(regularlanguages),intheothercasebecause MSOandEMSOdonotcorrespondtoanycomplexityclassovergraphs. Whataboutpicturelanguages,thatissetsofd-pictures,i.e., d-dimensionalwords(orcolouredgrids)? First,noticethefollowingresults: 1. In a series of papers culminating in [GRST96], Giammarresi and al. have proved that a 2-picture language is recognizable, i.e. is the projection of a local 2-picture language, iff it is definable in EMSO. Inshort: REC2=EMSO. 2. In fact, the class REC2 contains some NP-complete problems. More generally, one observes that for each dimension d ≥1, RECd can be defined as the class of d-picture languages recognized by nondeterministicd-dimensionalcellularautomatainconstanttime1. Insomesense,thepresentpaperisanattempttobridgethegapbetweentheformallanguagecurrentof descriptivecomplexityinvolvingMSOandthecomputationalcomplexitycurrentthatinvolvesESO. This paperoriginatesfromtwoquestionsaboutword/picturelanguages: 1. How can we generalize the proof of the above-mentioned theorem of Giammarresi and al. to any dimension? Thatis,canweestablishtheequalityRECd=EMSOforanyd≥1? 2. Canweobtainlogicalcharacterizationsoftimecomplexityclassesofcellularautomata2? Thepaperaddressesbothquestions;italsocompares,inacommonframework,thepointofviewofformal language theory with that of computational complexity. A d-picture language over an alphabet Σ is a set 1Thatmeans:forsuchapicturelanguageL,thereissomeconstantintegercsuchthateachcomputationstopsatinstantc,andp∈L iffithasatleastonecomputationwhosefinalconfigurationisacceptinginthefollowingsense:allthecellsareinanacceptingstate. 2ThisoriginatesfromaquestionthatJ.Mazoyeraskedusin2000(personalcommunication):givealogicalcharacterizationofthe lineartimecomplexityclassofnondeterministiccellularautomata. 2 of d-pictures p:[1,n]d →Σ, i.e., d-dimensional Σ-words3. There are two natural manners to represent a d-picture pasafirst-orderstructure: • asapixelstructure: onthepixeldomain[1,n]d; • asacoordinatestructure: onthecoordinatedomain[1,n]. Significantly, these two representations respectively correspond to the two above-mentioned points of viewasshownbyourresults. Ourresults: Weestablishtwokindsoflogicalcharacterizationsofd-picturelanguages,foralldimensionsd≥1: 1. On pixel structures: RECd =ESO(arity1)=ESO(var1)=ESO(∀1,arity1). That means a d-picture languageisrecognizableiffitisdefinableinmonadicESO (resp. inESO with1first-ordervariable, orinmonadicESOwith1universallyquantifiedfirst-ordervariable). 2. Oncoordinatestructures: NLINd =ESO(vard+1)=ESO(∀d+1,arityd+1); thatmeansad-picture ca languageisrecognizedbyanondeterministicd-dimensionalcellularautomatoninlineartimeiffitis definable in ESO with d+1 distinct first-order variables (resp. ESO with second-order variables of arityatmostd+1andaprenexfirst-orderpartofprefix∀d+1). Both items (1) and (2) are easy consequences of normalization results of, respectively, first-order and ESO logics we prove over picture languages. In particular, the "normalization" equality ESO(arity1)= ESO(∀1,arity1)isaconsequenceofthefactthatonpixelstructures(andmoregenerally,onstructuresthat consistofbijectivefunctionsandunaryrelations)anyfirst-orderformulaisequivalenttoabooleancombi- nationof"cardinality"formulasoftheform: "thereexistskdistinctelementsxsuchthatψ(x)",whereψisa quantifier-freeformulawithonlyonevariable. The"normalization"equalityexplicitlyexpressesthe"local" featureofMSOonpicturesandcanbegeneralizedtoother"regular"structures. Thirdly,incontrastwith(1)and(2),weestablishseveralstricthierarchyresultsforanyfixedd≥2and ford-picturelanguagesrepresentedbycoordinatestructures: inparticular,weprove ESO(vard−1)(cid:40)RECd(cid:40)ESO(vard)=NLINd ca andESO(vard)(cid:40)ESO(arityd). Here,thefactthatnonaturalrestrictionofESO (inparticular,ESO(vard)) exactlycapturestheclassRECdforthecoordinaterepresentationofpicturesseemstousthesymptomofthe largeexpressivenessofthislogic:significantly,thestrictinclusionESO(vard)(cid:40)ESO(arityd)ford-pictures inthecoordinaterepresentation,ifd≥2,stronglycontrastswiththeequalityESO(arity1)=ESO(var1)that holdsinthepixelrepresentation. In this document, we sketch many proofs and omit other ones, in particular, the proofs of hierarchy theorems,inSection4. However,theverytechnicalproofofthenormalizationofthelogicESO(∀d,arityd) oncoordinateencodingsof(d−1)-pictures(ford≥2)iscompletelydescribedintheappendix. 3Moregenerally, thedomainofad-pictureisofthe"rectangular"form[1,n1]×...×[1,nd]. Forsimplicityanduniformityof presentation,wehavechosentopresenttheresultsofthispaperintheparticularcaseof"square"picturesofdomain[n]d.Fortunately, ourresultsalsoholdwiththesameproofsforgeneraldomains[1,n1]×...×[1,nd]. 3 1. Preliminaries In the definitions below and all along the paper, we denote by Σ, Γ some finite alphabets and by d a positiveinteger. Foranypositiveintegern, weset[n]:={1,...,n}. Weareinterestedinsetsofpicturesof anyfixeddimensiond. Definition1.1. A d-dimensional picture or d-picture on Σ is a function p:[n]d →Σ where n is a positive integer. Thesetdom(p)=[n]d iscalledthedomainofpicture panditselementsarecalledpoints,pixelsor cellsofthepicture. Asetofd-picturesonΣiscalledad-dimensionallanguage,ord-language,onΣ. Noticethat1-picturesonΣarenothingbutnonemptywordsonΣ. 1.1. Picturesasmodeltheoreticstructures Alongthepaper,wewilloftendescribed-languagesassetsofmodelsoflogicalformulas. Toallowthis pointofview,wemustsettleonanencodingofd-picturesasmodeltheoreticstructures. Forlogicalaspectsofthispaper,werefertotheusualdefinitionsandnotationsinlogicandfinitemodel theory (see [EF95] or [Lib04], for instance). A signature (or vocabulary) σ is a finite set of relation and function symbols each of which has a fixed arity. A (finite) structure S of vocabulary σ, or σ-structure, consists of a finite domain D of cardinality n≥1, and, for any symbol s∈σ, an interpretation of s over D,oftendenotedby sforsimplicity. Thetupleoftheinterpretationsoftheσ-symbolsover Discalledthe interpretationofσoverDand,whennoconfusionresults,itisalsodenotedσ.Thecardinalityofastructure isthecardinalityofitsdomain.Foranysignatureσ,wedenotebystruc(σ)theclassof(finite)σ-structures. We write models(Φ) the set of σ-structures which satisfy some fixed formula Φ. We will often deal with tuplesofobjects. Wedenotethembyboldletters. There are two natural manners to represent a picture by some logical structure: on the domain of its pixels,oronthedomainofitscoordinates. Thisgivesrisetothefollowingdefinitions: Definition1.2. Given p:[n]d→Σ,wedenotebypixeld(p)thestructure pixeld(p)=([n]d,(Qs)s∈Σ,(succi)i∈[d],(mini)i∈[d],(maxi)i∈[d]). Here: • succ is the (cyclic) successor function according to the jth dimension of [n]d, that is: for each a= j (a) ∈[n]d,succ (a)=a(j) wherea(j),theith componentofa(j),equalsa,theith componenta of i i∈[d] j i i i a,exceptthe jthonewhichequalsthecyclicsuccessorofthe jthcomponenta ofa. Moreformally: j – a(j)=a +1ifa <n,anda(j)=1otherwise; j j j j – a(j)=a foreachi(cid:44) j. i i • themin’s,max’sandQ ’sarethefollowingunary(monadic)relations: i i s – min ={a∈[n]d:a =1}; i i – max ={a∈[n]d:a =n}; i i i – Q ={a∈[n]d:p(a)=s}. s 4 Definition1.3. Given p:[n]d→Σ,wedenotebycoordd(p)thestructure coordd(p)=(cid:104)[n],(Qs)s∈Σ,<,succ,min,max(cid:105). (1) Here: • EachQ isad-aryrelationsymbolinterpretedasthesetofcellsof plabelledbyans. Inotherwords: s Q ={a∈[n]d:p(a)=s}. s • <,min,maxarepredefinedrelationsymbolsofrespectivearities2,1,1,thatareinterpreted,respec- tively,asthesets{(i,j):1≤i< j≤n},{1}and{n}. • succisaunaryfunctionsymbolinterpretedasthecyclicsuccessor. (Thatis: succ(i)=i+1fori<n andsucc(n)=1.) Forad-languageL,wesetpixeld(L)={pixeld(p):p∈L}andcoordd(L)={coordd(p):p∈L}. 1.2. Logicsunderconsideration Letusnowcometothelogicsinvolvedinthepaper. Allformulasconsideredhereafterbelongtorela- tionalExistentialSecond-Orderlogic. Givenasignatureσ,indifferentlymadeofrelationalandfunctional symbols, arelationalexistentialsecond-orderformulaofsignatureσhastheshapeΦ≡∃Rϕ(σ,R), where R=(R ,...,R )isatupleofrelationalsymbolsandϕisafirst-orderformulaofsignatureσ∪{R}.Wedenote 1 k byESOσ theclassthusdefined. Wewilloftenomittomentionσforconsiderationsontheselogicsthatdo notdependonthesignature. Hence,ESO standsfortheclassofallformulasbelongingtoESOσ forsome σ. WewillpaygreatattentiontoseveralvariantsofESO.Inparticular,wewilldistinguishformulasoftype Φ≡∃Rϕ(σ,R)accordingto: - thenumberofdistinctfirst-ordervariablesinvolvedinϕ, - thearityofthesecond-ordersymbolsR∈R,and - thequantifierprefixofsomeprenexformofϕ. With the logic ESOσ(∀d,arity(cid:96)), we control these three parameters: it is made of formulas of which first-order part is prenex with a universal quantifier prefix of length d, and where existentially quantified relationsymbolsareofarityatmost(cid:96). Inotherwords,ESOσ(∀d,arity(cid:96))collectsformulasofshape: ∃R∀xθ(σ,R,x) whereθisquantifierfree,xisad-tupleoffirst-ordervariables,andRisatupleofrelationsymbolsofarity smallerthan(cid:96). Relaxingsomeconstraintsoftheabovedefinition,weset: (cid:91) (cid:91) ESOσ(∀d)= ESOσ(∀d,arity(cid:96))andESOσ(arity(cid:96))= ESOσ(∀d,arity(cid:96)). (cid:96)>0 d>0 Finally,wewriteESOσ(vard)fortheclassofformulasthatinvolveatmostdfirst-ordervariables,thus focusingonthesolenumberofdistinctfirst-ordervariables(possiblyquantifiedseveraltimes). 5 2. AlogicalcharacterizationofREC Inordertodefineanotionoflocalitybasedonsub-picturesweneedtomarktheborderofeachpicture. Definition2.1. ByΓ(cid:93) wedenotethealphabetΓ∪{(cid:93)}where(cid:93)isaspecialsymbolnotinΓ. Let pbeanyd- pictureofdomain[n]d onΓ. Theborderedd-pictureof p,denotedby p(cid:93),isthed-picture p(cid:93):[0,n+1]d→Γ(cid:93) definedby (cid:40) p(a)ifa∈dom(p); p(cid:93)(a)= (cid:93)otherwise. Here,"otherwise"meansthataisontheborderof p(cid:93),thatis,somecomponenta ofais0orn+1. i Let us now define our notion of local picture language. It is based on some sets of allowed patterns (calledtiles)oftheborderedpictures. Definition2.2. 1. Givenad-picture pandaninteger j∈[d],twocellsa=(a) andb=(b) of p i i∈[d] i i∈[d] are j-adjacentiftheyhavethesamecoordinates,exceptthe jthoneforwhich|a −b |=1. j j 2. Atileforad-languageLonΓisacouplein(Γ(cid:93))2. 3. A picture p is j-tiled by a set of tiles ∆ ⊆ (Γ(cid:93))2 if for any two j-adjacent points a,b ∈ dom(p(cid:93)): (p(cid:93)(a),p(cid:93)(b))∈∆. 4. Given d sets of tiles ∆ ,...,∆ ⊆(Γ(cid:93))2, a d-picture p is tiled by (∆ ,...,∆ ) if p is j-tiled by ∆ for 1 d 1 d j each j∈[d]. 5. WedenotebyL(∆ ,...,∆ )thesetofd-picturesonΓthataretiledby(∆ ,...,∆ ). 1 d 1 d 6. Ad-languageLonΓislocalifthereexist∆ ,...,∆ ⊆(Γ(cid:93))2 suchthatL=L(∆ ,...,∆ ). Wethensay 1 d 1 d thatLis(∆ ,...,∆ )-local,or(∆ ,...,∆ )-tiled. 1 d 1 d Definition2.3. A d-language L on Σ is recognizable if it is the projection of a local d-language over an alphabetΓ. Itmeansthereexistasurjectivefunctionπ:Γ→Σandalocald-language L onΓsuchthat loc L={π◦p: p∈L }. loc BecauseofDefinition2.2,italsomeansthereexistasurjectivefunctionπ:Γ→Σanddsubsets∆ ,...,∆ 1 d of(Γ(cid:93))2suchthat L={π◦p: p∈L(∆ ,...,∆ )}. 1 d WewriteRECd fortheclassofrecognizabled-languages. Remark2.4. Ournotionof localityisweakerthantheonegivenbyGiammarresiandal.[GRST96]. But thisdoesn’taffectthemeaningof recognizability,whichcoincideswiththatusedin[GRST96].Thisconfirms therobustnessofthislatternotion. Acharacterizationofrecognizablelanguagesofdimension2byexistentialmonadicsecond-orderlogic wasprovedbybyGiammarresietal.[GRST96]. Theyestablished: Theorem2.5([GRST96]). Forany2-dimensionallanguageL,L∈REC2⇔pixel2(L)∈ESO(arity1). Inthissection,wecomebacktothisresult. Wesimplifyitsproof,refinethelogicitinvolves,andgeneralize itsscopetoanydimension. 6 Theorem2.6. Foranyd>0andanyd-languageL,thefollowingassertionsareequivalent: 1. L∈RECd; 2. pixeld(L)∈ESO(∀1,arity1); 3. pixeld(L)∈ESO(arity1). Proposition2.7statestheequivalence1⇔2.InProposition3.9,weestablishthenormalizationESO(arity1)= ESO(∀1,arity1)onpixelstructures,fromwhichtheequivalence2⇔3immediatelyfollows. Proposition2.7. Foranyd>0andanyd-languageLonΣ: L∈RECd⇔pixeld(L)∈ESO(∀1,arity1). Sketch of Proof. ⇒ A picture belongs to L if there exists a tiling of its domain whose projection coincideswithitscontent. Inthelogicinvolvedintheproposition,the“arity1”correspondstoformulating theexistenceofthetiling,whilethe∀1 isthesyntacticresourceneededtoexpressthatthetilingbehavesas expected. Letusdetailtheseconsiderations. ByDefinition2.2,thereexistanalphabetΓ(whichcanbeassumeddisjointfromΣ),asurjectivefunction π:Γ→Σanddsubsets∆ ,...,∆ ⊆(Γ(cid:93))2suchthatListheset{π◦p(cid:48):p(cid:48)∈L(∆ ,...,∆ )}. 1 d 1 d Thebelongingofapicturep(cid:48):[n]d→ΓtoL(∆1,...,∆d)iseasilyexpressedonpixeld(p(cid:48))=(cid:104)[n]d,(Qs)s∈Γ,...(cid:105) with a first-order formula which asserts, for each dimension i∈[d], that for any pixel x of p(cid:48), the couple (x,succ(x))canbetiledwithsomeelementof∆. Becauseitdealswitheachcell xseparately,thisformula i i hastheform∀xΨ(x,(Qs)s∈Γ),whereΨisquantifier-free. Now,apicturep:[n]d→ΣbelongstoLiffitresultsfromaπ-renamingofapicturep(cid:48)∈L(∆ ,...,∆ ). It 1 d meansthereexistsaΓ-labelingof p(thatis,atuple(Qs)s∈Γofsubsetsof[n]d)correspondingtoapictureof L(∆1,...,∆d)(i.e.fulfilling∀xΨ(x,(Qs)s∈Γ))andfromwhichtheactualΣ-labelingof p(thatis,thesubsets (Qs)s∈Σ)isobtainedviaπ(easilyexpressedbyaformulaoftheform∀xΨ(cid:48)(x,(Qs)s∈Σ,(Qs)s∈Γ)). Finally,theformula(∃Qs)s∈Γ∀x:Ψ∧Ψ(cid:48)conveysthedesiredpropertyandfitstherequiredform. ⇐ In order to prove the converse implication, it is convenient to first normalize the sentences of ESO(∀1,arity1). Thisistheroleofthetechnicalresultbelow, whichassertsthatonpixelencodings, each suchsentencecanberewritteninaverylocalformwherethefirst-orderpartalludesonlypairsofadjacent pixelsoftheborderedpicture. Westateitwithoutproof: Fact2.8. Onpixelstructures,anyϕ∈ESO(∀1,arity1)isequivalenttoasentenceoftheform: ∃U∀x(cid:94) mmainxi((xx)) →→ mMi((xx)) ∧∧ . (2) i∈[d] ¬maxii(x) → Ψii(x) Here,Uisalistofmonadicrelationvariablesandm,M,Ψ arequantifier-freeformulassuchthat i i i • atomsofm andM havealltheformQ(x); i i • atomsofΨ havealltheformQ(x)orQ(succ(x)), i i where,inbothcases,Q∈{(Qs)s∈Σ,U}. 7 Now, consider Lsuchthatpixeld(L)∈ESO(∀1,arity1). Fact2.8ensuresthatpixeld(L)ischaracterized byasentenceoftheform(2)above. WehavetoprovethatListheprojectionofsomelocald-languageL loc on some alphabet Γ, that is a (∆ ,..., ∆ )-tiled language for some ∆ ,..., ∆ ⊆Γ2. Let U ,...,U denote 1 d 1 d 1 k the list of (distinct) elements of the set {(Qs)s∈Σ,U} of unary relation symbols of ϕ so that the first ones U ,...,U are the Q ’s (here, min and max symbols are excluded). The trick is to put each subformula 1 m s i i m(x),M(x)andΨ(x)ofϕintoitscompletedisjunctivenormalformwithrespecttoU ,...,U . Typically, i i i 1 k eachsubformulaΨ(x)whoseatomsareoftheformU (x)orU (succ(x)),forsome j∈[k],istransformed i j j i intothefollowing"completedisjunctivenormalform": (cid:95) (cid:94)(cid:15)jUj(x)∧(cid:94)(cid:15)(cid:48)jUj(succi(x)). (3) ((cid:15),(cid:15)(cid:48))∈∆i j∈[k] j∈[k] Here,thefollowingconventionsareadopted: • (cid:15)=((cid:15) ,...,(cid:15) )∈{0,1}k andsimilarlyfor(cid:15)(cid:48); 1 k • foranyatomαandanybit(cid:15) ∈{0,1},(cid:15) αdenotestheliteralαif(cid:15) =1,theliteral¬αotherwise. j j j For(cid:15)∈{0,1}k,wedenotebyΘ (x)the"completeconjunction"(cid:86) (cid:15) U (x).Intuitively,Θ (x)isacomplete (cid:15) j∈[k] j j (cid:15) descriptionof xandthesetΓ=(cid:83) {0i−110m−i}×{0,1}k−m isthesetofpossiblecolors(rememberthatthe i∈[m] Q ’sthataretheU ’sfor j∈[m]formapartitionofthedomain). Thecompletedisjunctivenormalform (3) s j ofΨ(x)canbewrittenintothesuggestiveform i (cid:95) (cid:0)Θ(cid:15)(x)∧Θ(cid:15)(cid:48)(succi(x))(cid:1). ((cid:15),(cid:15)(cid:48))∈∆i If each subformula m(x) and M(x) of ϕ is similarly put into complete disjunctive normal form, that is i i (cid:87)((cid:93),(cid:15))∈∆iΘ(cid:15)(x)and(cid:87)((cid:15),(cid:93))∈∆iΘ(cid:15)(x), respectively(thereisnoambiguityinourimplicitdefinitionofthe∆i’s, since(cid:93)(cid:60)Γ),thentheabovesentence(2)equivalenttoϕbecomesthefollowingequivalentsentence: (cid:95) ϕ(cid:48)=∃U∀x(cid:94) mmaixnii((xx)) →→ ((cid:93),(cid:95)(cid:15))∈∆iΘΘ(cid:15)(cid:15)((xx)) ∧∧ i∈[d] ¬maxi(x) → ((cid:15),(cid:95)(cid:93))∈∆i (Θ(cid:15)(x)∧Θ(cid:15)(cid:48)(succi(x))) ((cid:15),(cid:15)(cid:48))∈∆i Finally,let L denotethed-languageoverΓdefinedbythefirst-ordersentenceϕ obtainedbyreplacing loc loc each Θ by the new unary relation symbol Q in the first-order part of ϕ(cid:48). In other words, pixeld(L ) is (cid:15) (cid:15) loc definedbythefollowingfirst-ordersentence: (cid:95) ϕ =∀x(cid:86) mmaixnii((xx)) →→ ((cid:93),(cid:95)(cid:15))∈∆iQQ(cid:15)(cid:15)((xx)) ∧∧ loc i∈[d] ¬maxi(x) → ((cid:15),(cid:95)(cid:93))∈∆i (Q(cid:15)(x)∧Q(cid:15)(cid:48)(succi(x))) ((cid:15),(cid:15)(cid:48))∈∆i Hence,L =L(∆ ,...,∆ ). Thatis,L isindeedlocalandthecorrespondingsetsoftilesarethe∆’softhe loc 1 d loc i previousformula. Itisnoweasytoseethatourinitiald-language Listheprojectionofthelocallanguage 8 L bytheprojectionπ:Γ→Σdefinedasfollows:π((cid:15))=siff(cid:15) =1fori∈[m]andU isQ . Thiscompletes loc i i s theproof. (cid:3) Proposition2.9. ESO(arity1)⊆ESO(∀1,arity1)onpixelstructures,foranyd>0. Sketch of Proof. In a pixel structure, each function symbol succ is interpreted as a cyclic successor, i thatisabijectivefunction. So, apixelstructureisabijectivestructure, thatisafirst-orderunarystructure whose (unary) functions f are bijective and that explicitly includes all their inverse bijections f−1. It has been proved in [DG06] that any first-order formula on a bijective structure can be rewritten as a so-called cardinalityformula, thatisasabooleancombinationofsentencesoftheformψ≥k =∃≥kxψ(x)(fork≥1) whereψ(x)isaquantifier-freeformulawiththesinglevariablexandwherethequantifier∃≥kxmeans"there exist at least k elements x". Therefore, it is easily seen that proving the proposition amounts to show that eachsentenceoftheformψ≥k or¬ψ≥k canbetranslatedinESO(∀1,arity1)onpixelstructures. Thisisdoneasfollows:foragivensentence∃≥kxψ(x),weintroducenewunaryrelationsU=0,U=1,...,U=k−1 andU≥k,withtheintendedmeaning: Apixela∈[n]dbelongstoU=j(resp.U≥k)iffthereareexactly j(resp.atleastk)pixelsb∈[n]d lexicographicallysmallerthanorequaltoasuchthatpixeld(p)|=ψ(b). Thenwehavetocompeltheserelationsymbolstofittheirexpectedinterpretations,bymeansofafirst-order formulawithasingleuniversallyquantifiedvariable. First,wedemandtherelationstobepairwisedisjoint: (cid:94) (cid:16) (cid:17) (cid:94)(cid:16) (cid:17) (1) ¬U=i(x)∨¬U=j(x) ∧ ¬U=i(x)∨¬U≥k(x) . i<j<k i<k Then, we temporarily denote by ≤ the lexicographic order on [n]d inherited from the natural order lex on [n], and by succ , min , max its associated successor function and unary relations corresponding lex lex lex to extremal elements. Then the sets described above can be defined inductively by the conjunction of the followingsixformulas: (2) (min (x)∧¬ψ(x))→U=0(x) lex (3) (min (x)∧ψ(x))→U=1(x) lex (cid:94)(cid:16) (cid:17) (4) ¬max (x)∧U=i(x)∧¬ψ(succ (x)) →U=i(succ (x)) lex lex lex i<k (cid:94) (cid:16) (cid:17) (5) ¬max (x)∧U=i(x)∧ψ(succ (x)) →U=i+1(succ (x)) lex lex lex i<k−1 (cid:16) (cid:17) (6) ¬max (x)∧U=k−1(x)∧ψ(succ (x)) →U≥k(succ (x)) lex lex lex (cid:16) (cid:17) (7) ¬max (x)∧U≥k(x) →U≥k(succ (x)). lex lex 9 Hence, under the hypothesis (1)∧...∧(7), the sentences ψ≥k and ¬ψ≥k are equivalent, respectively, to ∀x(max (x)→U≥k(x))and∀x(max (x)→¬U≥k(x)). lex lex Tocompletetheproof,itremainstogetridofthesymbolssucc ,min andmax thatarenotallowed lex lex lex inourlanguage. Itisdonebyreferringtothesesymbolsimplicitlyratherthanexplicitly. Forinstance,since succlex(x)=succisucci+1...succd(x), for each non maximal x∈[n]d, i.e., distinct from (n,...,n), and for (cid:86) thesmallesti∈[d]suchthat max (x),eachformulaϕinvolvingsucc (x)actuallycorrespondstothe j>i j lex conjunction: (cid:94)(¬maxi(x)∧ (cid:94) maxj(x))→ϕi, i∈[d] i<j≤d where ϕi is obtained from ϕ by the substitution succlex(x)(cid:32)succisucci+1...succd(x). Similar arguments allowtogetridofmin andmax . (cid:3) lex lex Remark2.10. Inthisproof,twocrucialfeaturesofastructureoftypepixeld(p)areinvolved: • its"bijective”nature,thatallowstorewritefirst-orderformulasascardinalityformulaswithasingle first-ordervariable; • the "regularity" of its predefined arithmetics (the functions succ defined on each dimension), that i endowspixeld(p)withagridstructure: itenablesustoimplicitlydefinealinearorderofthewhole domaindom(p)bymeansoffirst-orderformulaswithasinglevariable,whichinturnallowstoexpress cardinalityformulasby“cumulative”arguments,viathesetsU=i. Proposition 3.9 straightforwardly generalizes to all structures – and there are a lot – that fulfill these two properties. Toconcludethissection,letusmentionthatwecouldrathereasilyderivefromTheorem2.6thefollowing additionalcharacterizationofRECd: Corollary2.11. Foranyd>0andanyd-languageL,thefollowingassertionsareequivalent: 1. L∈RECd; 2. pixeld(L)∈ESO(var1). 3. AlogicalcharacterizationofNLIN ca Besidesthenotionofrecognizablepicturelanguage,themainconceptstudiedinthispaperisthelinear timecomplexityonnondeterministiccellularautomatonofanydimension. Definition3.1. Aone-wayd-dimensionalcellularautomaton(d-automaton,forshort)overanalphabetΣis atupleA=(Σ,Γ,δ,F),where • the finite alphabet Γ called the set of states of A includes the input alphabet Σ and the set F of acceptingstates: Σ,F⊆Γ; • δisthe(nondeterministic)transitionfunctionofA: δ:Γ×(Γ(cid:93))d→P(Γ). 10