Subclasses of Presburger Arithmetic and the Weak EXP Hierarchy ChristophHaase∗ LaboratoireSpe´cificationetVe´rification(LSV),CNRS E´coleNormaleSupe´rieure(ENS)deCachan,France [email protected] 4 1 0 Abstract burgerarithmetic;forthatreasonthecomplexityofPresburgerarith- 2 metichasextensivelybeenstudiedintheliteraturefromthe1970’s y Ibtuirsgesrhaorwitnhmtheatitcf,oir.ea.,niytsfirexsetdriciti>on0to,tih+eΣ1iq+u1a-nftriafigemreanltteronfatPiorenss- onwards.Inordertofullycapturethecomputationalcomplexityof a beginningwithanexistentialquantifier,iscompleteforΣEXP,the Presburgerarithmetic,BermanevenintroducedtheSTAmeasureon M i thecomplexityofadecisionproblem,sincePresburgerarithmetic i-thleveloftheweakEXPhierarchy,ananaloguetothepolynomial- “maynothaveprecisecomplexitycharacterisationsintermsofthe timehierarchyresidingbetweenNEXPandEXPSPACE.Thisre- usualtimeandtapemeasures”[3].TheclassSTA(s(n),t(n),a(n)) 2 sultcompletesthecomputationalcomplexitylandscapeforPres- istheclassofallproblemsoflengthnthatcanbedecidedbyan 1 burgerarithmetic,alineofresearchwhichdatesbacktotheseminal alternatingTuringmachineinspaces(n)andtimet(n)usinga(n) workbyFischer&Rabinin1974.Moreover,weapplysomeofthe alternations,where“∗”actsasawildcardinordertoindicatean ] techniquesdevelopedintheproofofthelowerboundinorderto O unboundedavailabilityofacertainresource.Basedonthework establishboundsonsetsofnaturalsdefinableintheΣ -fragment 1 by Fischer & Rabin [11] and Ferrante & Rackoff [10], Berman L ofPresburgerarithmetic:givenaΣ1-formulaΦ(x),itisshownthat establishedthefollowingresult. . thesetofnon-negativesolutionsisanultimatelyperiodicsetwhose s periodisatmostdoubly-exponentialandthatthisboundistight. c Proposition1(Berman[3]). Presburgerarithmeticiscompletefor [ CategoriesandSubjectDescriptors F.4.1[Mathematicallogic]: STA(∗,22nO(1),n). Computationallogic 2 In terms of the usual time and space measures, this settles v Keywords Presburgerarithmetic,boundedquantifieralternation, Presburgerarithmeticbetween2-NEXPand2-EXPSPACE.Despite 6 weakEXPhierarchy,ultimatelyperiodicsets,context-freecommu- thesehighcomputationalcosts,onthepositivesidewhenlooking 6 tativegrammars at fragments Presburger arithmetic becomes more manageable. 2 There are two dimensions in which we can constraint formulas 5 1. Introduction inordertoobtainfragmentsofPresburgerarithmetic:thenumber . 1 of quantifier alternations and the number of variables in each 0 P(cid:104)Nre,s0b,u1r,g+er,<ar(cid:105)i.thTmheistictheisortyhewafisrssth-oorwdenrtothbeoerdyecoifdathbelesbtryucPtruerse- quantifier block. For i,j ∈ N∪{∗}, let PA(i,j) denote the set 4 of formulas of the Σ -fragment of Presburger arithmetic1 such burger in his seminal paper in 1929 by providing a quantifier- i 1 that at most j different variables occur in each quantifier block, elimination procedure [31]. Presburger arithmetic is central to a : where“∗”isusedasawildcardforanunboundednumber.Hence, v vast number of different areas in computer science and is often Proposition1characterisesthecomputationalcomplexityofPA(∗,∗) i employedasatoolforshowingdecidabilityandcomplexityresults. X ThecentraldecisionproblemforPresburgerarithmeticisvalid- with n being the number of symbols required to write down theformula.Subsequently,PAandPA(i)abbreviatePA(∗,∗)and r ity,i.e.,todecidewhetheragivensentenceistruewithrespectto a thestandardinterpretationinarithmetic.Thetwomostprominent PA(i,∗),respectively. OneofthemostprominentfragmentsofPresburgerarithmeticis waystodecidevalidityareeitherquantifier-eliminationbased[8]or itsexistentialorquantifier-freefragment,whichiscomputationally automatabased[9,23,40].AnydecisionprocedureforPresburger notmoreexpensivethanstandardBooleansatisfiability. arithmeticisinherentlytiedtothecomputationalcomplexityofPres- Proposition2(Scarpellini[33],Borosh&Treybing[5]). Forany ∗TheauthorissupportedbytheFrenchAgenceNationaledelaRecherche fixedj ∈N,PA(1,j)isinP[33].PA(1)isNP-complete[5]. (ANR),REACHARD(grantANR-11-BS02-001). Duetoitscomparablylowcomputationalcomplexity,quantifier- freePresburgerarithmeticisthefragmentthatismostcommonly found in application areas which aim at a practical impact. The Permissiontomakedigitalorhardcopiesofallorpartofthisworkforpersonalor classroomuseisgrantedwithoutfeeprovidedthatcopiesarenotmadeordistributed existentialfragmentofPresburgerarithmeticcanevenbeextended forprofitorcommercialadvantageandthatcopiesbearthisnoticeandthefullcitation withafulldivisibilitypredicatewhileretainingdecidability[25,26]. onthefirstpage.CopyrightsforcomponentsofthisworkownedbyothersthanACM AnothersubclassofPresburgerarithmeticwhichhasextensively mustbehonored.Abstractingwithcreditispermitted.Tocopyotherwise,orrepublish, been studied is obtained by allowing for an arbitrary but fixed topostonserversortoredistributetolists,requirespriorspecificpermissionand/ora [email protected]. numberofquantifieralternations. CSL-LICS2014, July14–18,2014,Vienna,Austria. Copyright(cid:13)c 2014ACM978-1-4503-2886-9...$15.00. http://dx.doi.org/10.1145/2603088.2603092 1AllresultsobtainedaresymmetricwhenconsideringΠi-formulas. Proposition 3 (Gra¨del [17], Scho¨ning [34], Reddy & Love- systems [15] or in formal language theory [20]. For instance, land [32]). For any fixed i > 0 and j > 2, PA(i+1,j) is ΣP- analysingsuchboundshasbeencrucialinordertoobtainoptimal i complete2[17,34].PA(i)isinSTA(∗,2nO(i),i)[32]. complexityresultsformodel-checkingproblemsofaclassofone- counterautomatain[15].Inmoredetail,in[15]ithasbeenshown Thus, when fixing the number of quantifier alternations, the thatthesetofnon-negativeweightsofpathsbetweentwonodesina complexity of Presburger arithmetic decreases roughly by one weightedgraphisultimatelyperiodicwithaperiodthatisatmost exponent, and when additionally fixing the number of variables, singly-exponentialbounded.AresultbySeidletal.[35]onParikh we obtain every level of the polynomial-time hierarchy. Notice imagesofnon-deterministicfinite-stateautomataimplicitlystates thatthereisanobviousgap:acompletenessresultforPresburger thatthoseultimatelyperiodicsetsaredefinableintheΣ -fragment 1 arithmetic with a fixed number of quantifier alternations and an of Presburger arithmetic. It would thus be desirable to establish arbitrarynumberofvariablesineachquantifierblockismissing. a generic upper bound for ultimately periodic sets definable in The study of lower bounds for PA(i) goes back to the work PA(1)yieldingthesameoptimalbounds.Inthiscontext,Theorem2 ofFu¨rer[13],whoshowedaNEXPlowerboundforsomefixed providesanegativeresultinthatitshowsthatageneralboundon i > 1. Later, Gra¨del showed NEXP-hardness and EXPSPACE ultimatelyperiodicsetsdefinableinPA(1)cannotyieldtheoptimal membership of PA(2), but tight lower and upper bounds for the boundsrequiredfornaturalconcreteultimatelyperiodicsetslike wholeclassofPA(i)formulashavenotyetbeenestablished.The thoseconsideredin[15]. purposeofthefirstpartofthispaperistoclosethisgapandestablish Thispaperisstructuredasfollows.InSection2weprovidemost thefollowingtheorem. oftheformaldefinitionsrequiredinthispaper;howeverthereaderis expectedtohavesomeleveloffamiliaritywithstandardnotionsand Theorem1. Foranyfixedi>0,theΣ -fragmentofPresburger i+1 conceptsfromlinearalgebra,integerprogramming,first-orderlogic arithmeticisΣEXP-complete. i andcomputationalcomplexity.Eventhoughweprovideaslightly Here,ΣEXPdenotesthei-thleveloftheweakEXPhierarchy[19], moreelaboratedaccountonsuccinctencodingsviaBooleancircuits, i ananaloguetothepolynomial-timehierarchy[36]residingbetween it will be beneficial to the reader to be familiar with Chapters 8 NEXP and EXPSPACE; a formal definition will be provided in and20inPapadimitriou’sbookoncomputationalcomplexity[28]. Section 2.4. Equivalently, we obtain that PA(i+1) is complete Section 3is thengoing toestablish the lower andupper bounds forSTA(∗,2nO(i),i).Determiningtheprecisecomplexityofthe ofTheorem1,andTheorem2isshowninSection4.Thepaper concludesinSection5.Subsequenttothebibliography,aproofofa Σ -fragmentofPresburgerarithmeticforafixedihasbeenlisted i technicalcharacterisationoftheweakEXPhierarchyisoutlinedin as a problem that “deserves to be investigated” by Compton & theappendixforthesakeofcompleteness. Henson[7,Prob.10.14].However,aspointedoutin[7],theirgeneric methodsforprovinglowerboundsdonotseemtobeapplicableto thisfragment,andourhardnessresultisbasedonratherspecific 2. Preliminaries propertiesof,forinstance,distributionsofprimenumbers. 2.1 Generalnotation The second part of the paper diverts from the first part and focusesontheΣ -fragmentofPresburgerarithmetic.Morespecif- By Z and N we denote the set of integers and natural numbers, 1 ically, we consider sets of naturals definable by formulas in the respectively.Wewillusuallyusea,b,cfornumbersinZandN. Σ1-fragmentofPresburgerarithmeticopeninonevariable.Given Givena∈N,wedefine[a]d=ef{0,...a−1}.GivensetsM,N ⊆N, aΣ1-formulaΦ(x),denoteby Φ(x) thesetofthosea∈Nsuch as is standard M + N d=ef {m + n : m ∈ M,n ∈ N} and thatreplacingxwithainΦ(x)i(cid:74)svalid(cid:75).Itiswell-knownthat Φ(x) isanultimatelyperiodicset,seee.g.[4].AsetN ⊆Nisult(cid:74)imately(cid:75) M·N d=ef{mn:m∈M,n∈N}.Moreover,wewillusestandard periodicifthereexistsathresholdt∈N,abaseB ⊆{0,...t−1}, notationforintegerintervalsand,e.g.,fora ≤ b ∈ Ndenoteby aperiodp ∈ N,andasetofresidueclassesR ⊆ {0,...p−1} [a,b)theset{a,...b−1}.Forvectorsa=(a1,...,an)∈Zn,we suchthatN =U(t,p,B,R)with willdenoteby(cid:107)a(cid:107)thenormofa,whichisthemaximumabsolute valueofallcomponentsofa,i.e.,(cid:107)a(cid:107) d=ef max{|a |} .For U(t,p,B,R)d=efB∪{t+r+kp:r∈R,k≥0}. m×n integer matrices A, (cid:107)A(cid:107) denotes the maximium1≤ia≤bnsolute valueofallcomponentsofA.Finally,givenasetM ⊆ Zn,we GivenaΣ -formulaΦ(x),byapplyingsomeinsightsfromthe 1 denoteby(cid:107)M(cid:107)themaximumofthenormofallelementsofM.All firstpart,wecanestablishadoubly-exponentialupperboundon functionsinthispaperareassumedtomapnon-negativeintegers theperiodoftheultimatelyperiodicsetequivalentto Φ(x) and showthatthisboundistight,whichiscapturedbythes(cid:74)econd(cid:75)main tonon-negativeintegers.Unlessstatedotherwise,weassumeall integersinthispapertobeencodedinbinary,i.e.,thesizeorlength theoremofthispaper. towritedowna∈ZisO(log|a|). Theorem2. ThereexistsafamilyofΣ -formulasofPresburger 1 arithmetic (Φ (x)) such that each Φ (x) is a PA(1,O(n)) 2.2 PresburgerArithmetic n n>0 n formula with |Φn(x)| ∈ O(n2) and Φn(x) is an ultimately Usually, x,y,z will denote first-order variables, and x,y,z vec- periodicsetwithperiodpn ∈22Ω(n).Mo(cid:74)reoverf(cid:75)oranyΣ1-formula tors or tuples of first-order variables. Let x = (x1,...,xn) be Φ(x),wehave Φ(x) = U(t,p,B,R)suchthatt ∈ 2poly(|Φ(x)|) ann-tupleoffirst-ordervariables.Inthispaper,formulasofPres- andp∈22poly(|Φ(cid:74)(x)|).(cid:75) burgerarithmeticarestandardfirst-orderformulasoverthestruc- ture(cid:104)N,0,1,+,<(cid:105)obtainedfromatomicexpressionsoftheform The most interesting part about this theorem is the doubly- p(x)<b,wherep(x)isalinearmultivariatepolynomialwithinte- exponentiallowerboundoftheperiodofultimatelyperiodicsets gercoefficientsandabsolutetermzero,andb∈Z.Ifthedimension definable by PA(1) formulas. Establishing bounds on constants ofxisclearfromthecontext,forbrevitywewilloftenomitstating of ultimately periodic sets naturally occurs when analysing the itexplicitly.Leta=(a ,...,a )∈NnandΦ(x)beopeninthe 1 n computationalcomplexityofdecisionproblemsforinfinite-state first-ordervariablesx,wedenotebyΦ(a/x)theclosedformula obtainedfromreplacingeveryoccurrenceofx inΦ(x)witha .By i i 2Inordertoestablishhardness,j > 2isonlyrequiredontheinnermost Φ(x) wedenotetheset{a∈Nn :Φ(a/x)isvalid}.Thesize|Φ| quantifier. (cid:74)ofafo(cid:75)rmulaofPresburgerarithmeticisdefinedasthenumberof symbolsrequiredtowriteitdown,andthenorm(cid:107)Φ(cid:107)isthelargest Theaforementionedtimehierarchiesarenowdefinedas absolutevalueofallconstantsoccurringinΦ. ΣP d=efΠP d=efP ΣEXP d=efΠEXP d=efEXP 0 0 0 0 Remark. Fornotationalconvenience,whenstatingconcreteformu- ΣP d=efNPΣPi ΣEXP d=efNEXPΣPi laswewillpermitourselvestouseatomicformulasp(x) < q(x) i+1 i+1 forlinearpolynomialsp(x),q(x).Moreover,allresultsonthecom- ΠP d=efcoNPΣPi ΠEXP d=efcoNEXPΣPi i+1 i+1 plexityofvalidityofformulasofPresburgerarithmeticcarryover ifweassumeunaryencodingofnumbers,sincebinaryencoding PH d=ef (cid:91)ΣPi EXPHd=ef (cid:91)ΣEiXP. ofnumberscanbe“simulated”bytheintroductionofadditional i≥0 i≥0 first-order variables and repeated multiplication by two, causing For our lower bounds, we will rely on the following equivalent onlyasub-quadraticblowupintheformulasize.Inaddition,an characterisationofΣEXP. equalitypredicate“=”canbeexpressedintermsof<causinga i linearblowup,sincex=y↔x<y+1∧y<x+1.Likewise, Lemma1. Foranyi>0,alanguageL⊆{0,1}∗isinΣEXPiff i x > y andx < y < z abbreviatey < xandx < y∧y < z, thereexistsapolynomialqandapredicateR⊆({0,1}∗)i+1such respectively. thatforanyw∈{0,1}n, 2.3 Semi-LinearSetsandSystemsofLinearDiophantine w∈Liff∃w1 ∈{0,1}2q(n).∀w2 ∈{0,1}2q(n)··· Inequalities ···Q w ∈{0,1}2q(n).R(w,w ,...,w ) i i 1 i AcentralresultduetoGinsburgandSpanierstatesthatthesetsof andR(w,w ,...,w )canbedecidedindeterministicpolynomial naturalnumbersdefinablebyaformulaofPresburgerarithmetic 1 i time. open in n variables are the n-dimensional semi-linear sets [14], whichwejustcallsemi-linearsetsifthedimensionisclearfrom Despitebeinginthespiritofanelementaryresultoncomputa- thecontext.Asemi-linearsetisafiniteunionoflinearsets.The tionalcomplexity,theauthorwasunabletofindaformalproofof latteraredefinedintermsofabasevectorb∈Nnandafiniteset Lemma1inthestandardliterature.Itissomewhatstatedinformally ofperiodvectorsP ={p1,...pk}⊆Nn,anddefinetheset withoutaproofin[19].Inordertokeepthispaperself-contained andforthereader’sconvenience,aproofsketchofLemma1based L(b;P)d=efb+λ1p1+···λkpk, λi ∈N,1≤i≤k. onaproofofananaloguecharacterisationofthepolynomial-time hierarchygivenin[2]isprovidedintheappendix. LetAbeanm×nintegermatrixandc ∈ Zm.Asystemof linearDiophantineinequalitiesisgivenasS :Ax≥c.Thesize|S| 2.5 BooleanCircuits ofSisthenumberofsymbolsrequiredtowritedownSassuming Astandardapproachtoraisethecomplexityofaproblemknownto binaryencodingofnumbers.ThesetofpositivesolutionsofS is denotedby S ⊆ Nn andisthesetofalln-tuplessuchthatthe becompleteforacomplexityclassbyoneexponentistosuccinctly inequalities(cid:74)ine(cid:75)veryrowofShold. representtheinput,seee.g.[16,29].Awell-knownconceptisto representtheinputbyBooleancircuits.Inthispaper,fortechnical The following proposition is due to Frank & Tardos and es- convenienceweadaptthedefinitionprovidedin[16]. tablishesastronglypolynomial-timealgorithmforthefeasibility problemofasystemoflinearDiophantineinequalitiesinafixed Definition 1. A Boolean circuit C of size r with n ≤ r inputs dimension,i.e.,decidingwhether S (cid:54)=∅. is a function f : [r] → {&,(cid:107),∼,↑,↓ } × [r] × [r], where 1 (cid:74) (cid:75) f(i)=(t,j,k)iffthegatewithindexiisoftypet,i.e.,anand,or, Proposition4(Frank&Tardos[12]). LetS :Ax≥cbeasystem not,inputorconstantgate,respectively,andj,k<iareinputsof oflinearDiophantineinequalitiessuchthatAisanm×nmatrix. thegate,unlesst=∼inwhichcasewerequirej =k. ThenfeasibilityofScanbedecidedusingn2.5n+o(n)|S|arithmetic operationsandspacepolynomialin|S|. We identify each gate of C with an index from [r], and by convention the first n ≤ r gates are input-gates, and the r-th Whenweareinterestedinrepresentingthesetofallsolutionsof gate,i.e.,thegatewithindexr−1,istreatedastheoutputgate S,wewillemploythefollowingproposition,whichprovidesbounds ofC.Moreoverfortechnicalconvenience,wesometimesidentify onthesemi-linearrepresentationof S andisaconsequenceof the various types of the gates by natural numbers ordered as in Corollary1in[30]. (cid:74) (cid:75) Definition1,i.e.,&isidentifiedas0,(cid:107)as1,etc.Byusingconstant gatesasgateswithconstantvalue1,aninputw ∈ {0,1}n toC Proposition5(Pottier[30]). LetS :Ax≥cbeasystemoflinear inducesauniqueevaluationmappinge : [r] → {0,1}defined w Diophantine inequalities such that A is an m×n matrix. Then in the obvious way, and C evaluates to true (false) on input w (cid:83) S = i∈IL(bi;Pi)suchthatforalli∈I, if ew(r − 1) = 1 (ew(r − 1) = 0). For brevity, we define (cid:74) (cid:75) (cid:107)b (cid:107),(cid:107)P (cid:107)≤(n(cid:107)A(cid:107)+(cid:107)c(cid:107)+2)m+n. C(w)d=efew(r−1),andifm1,...,mk ∈NthenC(m1,...mk)is i i theoutputofC(w1···wk),whereeachwi ∈{0,1}(cid:100)logmi(cid:101)isthe binary,ifnecessarypadded,representationofm . i 2.4 TimeHierarchies For the remainder of this section, we will briefly recall and Let us recall the definitions of the polynomial-time hierarchy elaborateonsomeresultsandconceptsaboutcircuitsandsuccinct PH[36]andtheweakEXPhierarchyEXPH[19]intermsoforacle encodingsfromPapadimitriou’sbook[28]oncomputationalcom- complexityclasses.Asusual, plexity.GivenacircuitCandaninputw∈{0,1}nforsomen≥0, itiswell-knownthatdeterminingC(w)isP-complete[28,Thm. P= (cid:91) DTIME(nk) EXP= (cid:91) DTIME(2nk) 8.1].In[28],theproofofP-hardnessisestablishedbyshowingthat thecomputationtableofapolynomial-timeTuringmachinecanbe k>0 k>0 NP= (cid:91) NTIME(nk) NEXP= (cid:91) NTIME(2nk). emnaccohdineedMas,aaBcoomolpeuatnatcioirnctuaibt.leFiosrananff(n(n)×)-tfim(ne)-bgoriudnodfecdeTllsurTing i,j k>0 k>0 fromanalphabetthatallowsforuniquelyencodingconfigurationsof .. .. .. .. .. .. intothethreeframedgray-shadedboxesonthebottomofthedashed . . . . . . boxes.Here,weassumethatthreebitsaresufficienttorepresent (cid:46) 1 1 0 (cid:3) (cid:3) (cid:46) 1 1q1 1q0 (cid:3) (cid:3) tchoedeadlpahsa1b1et1.oCfothnesecqoumenptulyta,ttihoengtaatbelsewoifthMinwd,eaxn(d3,th4a)t,((cid:46)3q,05i)saennd- (cid:46)(cid:46)q0 11q2 00 11 (cid:3)(cid:3) (cid:3)(cid:3) (a3re,6g)a,treespwreistehnctionngsttahnetcveallluTe1o,1neo,fathseincdoimcapteudtatiinonFitgaubrlee2o.fNMoww, wewantthevaluesofthecellsT ,T ,etc.ofthecomputation 1,2 1,3 Figure1. Graphicalillustrationofacomputationtableofatime- tableofMw tobeequivalenttow1···wn,whicharerepresented TbohuencdoendtTroulrisntagtemaanchdintheeMhe.aFdorpeoxsaitmiopnleo,fhMereiwseinhdaivceaTte2d,2b=yt0apq2e. bcoyrrtehsepognadteinsgwtiothT1in,2daicnedsT(10,,30h)a,v.e..in(d0i,cie2sq((n3),)1.5T),h(e3g,1at6e)s,(in3,D17w) symbols with some q as subscript. The four gray-shaded cells and(3,26),(3,27),(3,28),respectively.Thosegateshavethegates i illustratethatsuccessivecellsonlydependonthreeprecedingcells. (0,0)and(0,1)astheirinputs,respectively.Supposethatinour encoding1isrepresentedas101and0as010,thesequenceof(cid:107), ∼and(cid:107)gatesensuresthat1ismappedto101and0to010.Con- M suchthattheconfigurationofM instepiwhilerunningonwis sequently,thegates(3,15),(3,16),(3,17)cancorrectlytransfer encodedinthei-throw.Figure1graphicallyillustratestheconcept thealphabetsymbols{0,1}ofMwintotheinternalrepresentation ofacomputationtable,where0and1arealphabetsymbolsofM, ofthecomputationtable,andinparticularcopythefirstsymbol and(cid:46)and(cid:3)areleftdelimitersandblanksymbols,respectively.The oftheinputstringw1···wiintotheinternalrepresentationofthe crucialfactforencodingcomputationtablesasBooleancircuitsis computationtable.IntheexampleinFigure2,thegateswithindex thatfori,j >1,thesymbolatT onlydependsonafixednumber (3,15),(3,16),(3,17)wouldoutput1,0and1,respectively,since i,j ofcells,namelyT ,T andT ,illustratedbythe thegate(0,0)hasvalue1whichcorrespondstothefirstsymbol i−1,j−1 i−1,j i−1,j+1 gray-shadedcellsinFigure1.Itisthenclearthatthealphabetofa oftheinputstringw1.Asstatedbefore,inourreductionthisvalue computationtablecanbeencodedintoabinaryalphabetoftruth isprovidedon-the-fly.Therestofthereductionfollowsstandard values,andthataconstantbasiccircuitcanbeconstructedfrom arguments.EachdashedboxcontainscircuitsT1,T2andT3which M whichensuresthatthevaluesofthecellsarecorrectlypropa- computetheconsecutivecellofthesimulatedcomputationtableof gatedalongthey-axis.ItthenfollowsthatM acceptswiffthere Mw,i.e.,thevaluesofthethreegatesrepresentingthiscell.The existsacomputationtableendinginanacceptingstateiffthecircuit dashedboxesontheleftusedifferentcircuitsU1,U2andU3since encodingthiscomputationtableevaluatestotrue. theydonothavealeftneighbor.Allunusedgatescanassumedto Inthenextsection,forourlowerboundwewillapplyLemma1, bedummygates,i.e.gateswithconstantvalue1,asindicatedin whichentailsdeciding(w,w1,...,wi)∈R,wherethewj areof Figure2.ItfollowsthatMwaccepts(w1,...,wi)iffCwevaluates sizeexponentialinn=|w|.LetM beapolynomial-timeTuring totrueontheinputprovided,i.e.,thevalueofthegatewiththe w machinedecidingRforafixedw.Thew1,...wj willimplicitlybe highestindexofCwisequalto1. codedintonaturalnumbers,soitwillnotbepossibletoconstruct InordertoencodeCwsuccinctly,itisclearthatduetotheregular aBooleancircuitCw upfrontthatcanevaluateMw ontheinput structureofCw,thetypeandinputgatestoanygatecanbecomputed w ,...w ofexponentialsize,sincewearerequiredtoestablish fromagivenindexofagatebyapolynomial-timealgorithm.The 1 j a polynomial-time reduction. Instead, we will succinctly encode circuitDw cannowbetakenasthecircuitcorrespondingtothis C viaanotherBooleancircuitD .Moreprecisely,C isencoded algorithm. w w w viaD asfollows:D has3r(n)+3inputgatesforsomefixed w w polynomialrdependingonMwsuchthatfori,j,k∈[2r(n)]and 3. CompletenessoftheΣi+1-Fragmentof t ∈ [5],Dw(t,i,j,k) = 1iffthedefiningfunctionf ofCw gives PresburgerArithmeticforΣEXP i f(i)=(t,j,k),i.e.,thatthegatewithindexiofC isoftypetand w hasinputgateswithindexjandk.Inparticular,Dwandhenceforth Inthissection,weshowthatPA(i+1)isΣEiXP-completeforevery C onlydependonwandM,andareindependentofw ,...w . fixed i > 0. We begin with the lower bound and first note that w 1 i Notethatwecanviewanassignmentoftruthvaluestothegatesof it is not possible to adapt Berman’s hardness proof [3] in order C asastringoflength2r(n). to get the desired result, since it relies on a trick by Fischer & w More generally, it is known that if C with no input gates is Rabin[11]inordertoperformarithmeticoperationsonabounded succinctlygivenbysomecircuitD,determiningwhetherCevaluates intervaloverlargenumberswhichlinearlyincreasesthenumberof to true is EXP-complete [28, Thm. 20.2 & Cor. 2]. The idea quantifieralternations.Instead,wewillpartlyadaptconceptsand underlyingthehardnessproofisastraight-forwardgeneralisation ideasintroducedbyGra¨delinhishardnessproofforPA(2)in[18] of the approach outlined in the paragraph above. The circuit C and Gottlob, Leone & Veith in [16]. Roughly speaking, we aim encodesthecomputationtableofanEXPTuringmachineM.Since for“implementing”Lemma1viaaPA(i+1)formula,whichwill theindicesofthegatesofC canberepresentedinbinary,viaD entailencodingbitstringsofexponentialsizeintonaturalnumbers we can encode C by implicitly encoding an exponential number and evaluating Boolean circuits in Presburger arithmetic on-the- oftheconstantbasiccircuitensuringproperpropagationbetween fly. The upper bound does not follow immediately and requires consecutivecells.Thisapproachcannowbeadaptedforourpurpose, combiningsolutionintervalsestablishedbyWeispfenningin[38] i.e.,toevaluateapolynomial-timeTuringmachineonaninputof withProposition4. exponential size. The major challenge is to transfer input to the 3.1 LowerBounds succinctlyencodedcircuiton-the-fly. ReferringtoLemma1andgivenM asabove,wecanconstruct Thegoalofthissectionistoprovethefollowingproposition. w inlogarithmicspaceaBooleancircuitD encodingC suchthat w w Proposition6. LetL⊆{0,1}∗bealanguageinΣEXP,i>0and theinput(w1,...,wi)toCwisobtainedfromthefirsti2q(n)gates, w∈{0,1}∗.Thereexistsapolynomial-timecomputiablePA(i+1) andC encodesacomputationtableofM onthisinput.Figure2 w w formulaΦ suchthatw∈LiffΦ isvalid. illustrateshowthiscanberealised.EachboxinFigure2isagate, L,w L,w andacellofthecomputationtableofM whilebeingexecutedon Tothisend,weemploythecharacterisationofΣEXPinLemma1. w i (w ,...,w )isencodedintothedashedboxes,ormorespecifically, LetM bethedeterministicpolynomial-timeTuringmachinedecid- 1 n Figure2. IllustrationoftheapproachofhowtosuccinctlyencodeaBooleancircuitencodingthecomputationtableofapolynomial-time Turingmachineonaninputofexponentialsize.Eachsquarerepresentsagate,allgatesnotsurroundedbyboxesareassumedtobegateswith constantvalue1. ingRfromLemma1,andletM besuchaTuringmachinedecid- implicitlyreplacedby∃x.¬(ϕ¯(x,y)),and¬(ϕ¯(x,y))istreated w ingRforafixedinputw∈{0,1}n,whichcanbecomputedfrom inthesamewayifitisnotyetquantifier-free.Inthisway,wecan M inlogarithmicspace.Thebitstringsw tow fromLemma1 alwaysmakesuretoresultinΣ -orΠ -formulas. 1 i 1 1 constitutingtheinputtoM arerepresentedinourreductionvia We now turn towards the details of our reduction and begin w naturalnumbersassignedtofirst-ordervariablesx=(x ,...,x ). with discussing the encoding of bit strings as natural numbers 1 i Thepreciseencodingofaw viax isdiscussedbelow.Fornow,it weusesubsequently.TheencodingweuseisduetoGra¨del[18]. j j isonlyimportanttomentionthatnoteverynaturalnumberencodes In his NEXP lower bound for PA(2) he exploits a result due to abitstring.Letusfocusonthehigh-levelstructureofΦL,w: Ingham [6, 22] that for any sufficiently large3 i ∈ N there is at least one prime in the interval [i3,(i+1)3). Given a bit string Φ d=ef∃x .∀x ···Q x . (cid:94) Ψ (x )∧ w=b1···bn ∈{0,1}n,anaturalnumbera∈Nencodeswiffor L,w 1 2 i i valid,r(n) j all1≤i≤nand 1≤j≤i,jodd (cid:16) (cid:94) (cid:17) forallprimesp∈[i3,(i+1)3):a≡bi modp. ∧ Ψ (x ) →Ψ (x ,...,x ). (1) valid,r(n) j Mw 1 i The existence of such an a is then guaranteed by the Chinese 1≤j≤i,jeven remainder theorem. Given a fixed n > 0, we call a ∈ N a Unsurprisingly,thealternationofquantifiersinLemma1isreflected valid encoding if for every 1 ≤ i ≤ n, either a ≡ 0modp or bythealternationofquantifiersin(1),soQ = ∃ifiisoddand a≡1modpforallprimenumbersp∈[i3,(i+1)3). i Q =∀ifiiseven.TheformulaΨ (x )isaΠ -formula, Inordertoenabletheextractionofbitsofbitstringsencodedas i valid,r(n) i 1 andΨ (x ,...,x )isaformulaintheBooleanclosureofΣ if naturals,weshowhowtocheckfordivisibilitywithanaturalnumber Mw 1 i 1 iisoddandaΣ -formulaifiiseven.Thefirstconjunctensures whosenumberofbitsisfixed.Next,weshowhowtoevaluatea 1 thattheexistentiallyquantifiedvariablesrepresentencodingsofbit BooleancircuitinPresburgerarithmetic.Thisservestwopurposes: stringsandthesecondconjunctthat,undertheadditionalassumption first, it allows for deciding if a given number lies in an interval thattheuniversallyquantifiedvariablesencodevalidbitstringsas [i3,(i+3)3)andfortestingwhetheragivennumberisaprimedue well,M acceptsthebitstringsencodedinx ,...,x .Forthegiven totheAKSprimalitytest[1].Second,itallowsforsimulatingM w 1 i w w∈{0,1}n,thoseformulasareconcreteinstancesofafamilyof discussedaboveonaninputofexponentialsizeusingitssuccinct formulas,andr(n)isanindexinthisfamilyforsomepolynomial encodingviaacircuitasdiscussedinSection2.5.Puttingeverything r(n)whichdominatesq(n)inLemma1andismademoreprecise togethereventuallyyieldsthedesiredreduction. atalaterstage.Consequently,forafixedi>0,wehavethatΦ Webeginwithafamilyofquantifier-freeformulasΦ (x,x) L,w bin,n isaPA(i+1)formula. suchthatgivenb∈{0,1}nandb∈N,Φ (b,b)holdsifbis bin,n In our reduction, we have to take extra care to prevent the thebinaryrepresentationofb.Consequently,thisformulaimplicitly “accidental”introductionofquantifieralternations.Ingeneralwhen constraintsbsuchthatb∈[2n]: pnreouvtridailnfgorfmorumlausl,asw,hwicehadaraeptoGperna¨dpeol’lsynapopmroiaalclyheinqu[1iv8a]leanntdΣpr1o-vaindde Φbin,n(x,x)d=ef (cid:94) (xi =0∨xi =1)∧x= (cid:88) 2ixi. (2) Π1-formulas. This ensures that, for instance, we do not have to i∈[n] i∈[n] careaboutwhetherwecouldpossiblyintroduceanewquantifier Next,weprovideafamilyofneutralformulasΦ (x,y)such mod,n alternationifaformulaisusedontheleft-handsideofanimplication. thatfora,bwithb ∈ [2n],Φ (a,b)holdsiffa ≡ 0modb. mod,n WdehneontepbryovΦ¯id(ixn)g=an∀eyut.rϕ¯al(xΣ,1y-f)oirtmsnuelautΦra(lxe)qu=iv∃alyen.ϕtΠ(x1,cyo)u,nwteerpwairltl. Etiossne.nItniaclolyn,tΦramstotdo,na(xfo,rym)urleaawlisiethstahfeosrammuelapfuorrpbooseungdiveednminul[t1ip8l]i,cait- For the sake of consistent naming, whenever Φ(x) occurs as a subformulainsomeotherformula,weimplicitlyassumethatitis 3Cheng[6]providesexplicitboundsonIngham’sresult[22]andshowsthat appropriatelyreplacedsuchthattheresultingformulaiseitheraΣ1- thisstatementholdsforalli∈Nsuchthati>2215.Asin[18],forbrevity oraΠ1-formula,dependingonthecontext.Likewise,ifforinstance wewilluseIngham’sresultasifitweretrueforalli>0.Itwillbeclear Φ(x)occursasanegatedsubformulainaformulathatissupposed thatwecouldaddCheng’soffsettoallnumbersinvolved,causingaconstant to be existentially quantified, we assume that this subformula is blowuponly. isnotrecursivelydefinedandofsizeO(n)asopposedtoO(nlogn) ThefirstlineofΦ (x,y)convertsxandyintotheirbinary prime,n whenbinaryencodingofnumbersisassumed.Thelatterfactwillbe representation. Next, the second line first concatenates these bit usefulinSection4.Theunderlyingideaofthesubsequentdefinitions representationsviatheadditionalvariablezbyappropriatelyshifting isthatifthebinaryexpansionofbisb=(cid:80)i∈[n]2ibiandbk=a the value of y by m bits, and finally z is passed to Cprime,n. forsomek ≥ 0thenacanbewrittenasa = (cid:80)i∈[n]2iai with Cao∈ns[ebq3,u(ebnt+ly,1w)3e).havethatΦprime,n(a,b)holdsiffaisprimeand a =kb : i i Wearenowinapositioninwhichwecandefineafamilyof Φ (x,y,k)d=ef (cid:94) (y =0→x =0∧y =1→x =k) Π -formulasΨ (x)usedin(1)thatallowfortestingwhether dig,n i i i i 1 valid,n some a ∈ N represents a valid respectively invalid encoding of i∈[n] a bit string of length 2n. For valid encodings, we wish to make Φmod,n(x,y)d=ef∃x.∃y.∃k.Φbin,n(y,y)∧ surethatallprimesineveryrelevantinterval[b3,(b+1)3)have ∧Φ (x,y,k)∧x= (cid:88) 2ix (3) uniformresidueclassesinaforall1 ≤ b ≤ 2n,i.e.,foranytwo dig,n i primesp ,p ∈ [b3,(b+1)3)weeitherhavea ≡ 0modp and 1 2 1 i∈[n] a ≡ 0modp ,ora−1 ≡ 0modp anda−1 ≡ 0modp .Let 2 1 2 Φ¯ (x,y)d=ef∀x.∀y.∀k.(cid:0)Φ (y,y)∧ mbeasabove, mod,n bin,n ∧Φ (x,y,k)(cid:1)→x= (cid:88) 2ix . dig,n i Ψ (x)d=ef∀y.∀p .∀p .(cid:0)1≤y≤2n∧ valid,n 1 2 i∈[n] (cid:1) ∧Φ (p ,y)∧Φ (p ,y) → WenowturntowardsevaluatingBooleancircuitswithsuitable prime,n+1 1 prime,n+1 2 (cid:0) formulas in Presburger arithmetic. The subsequent formulas for → (Φmod,m+3(x,p1)∧Φmod,m+3(x,p2))∨ evaluatingacircuitCwithninputandrgatesintotalareessentially (cid:1) ∨(Φ (x−1,p )∧Φ (x−1,p )) . an adaption of a construction given by Gottlob, Leone & Veith mod,m+3 1 mod,m+3 2 in [16]. It is easily checked that for a ∈ [2n], ΦC(a) holds iff In order to complete our hardness proof for ΣEXP for a sub- C(a)=1.InΦ ,theinputtoCisencodedviaadimensionnvector i C sequently fixed i > 0 via its characterisation in Lemma 1 and offirst-ordervariablesxandtheBooleanassignmenttothegatesvia Φ in (1), we will now define the remaining Π -formula L,w 1 adimensionrvectoroffirst-ordervariablesy,whichareimplicitly Ψ (x ,...,x )foragivenw∈{0,1}n.LetC betheBoolean assumedtorangeover{0,1}.First,weprovideaformulaensuring Mw 1 i w circuit succinctly encoded by a Boolean circuit D (t,y,z ,z ) w 1 2 thatthestructureofthegatesofCiscorrectlyencodediny: decidingM onaninputoflength2q(n)isuchthatC consistsof w w 2r(n) gatesforsomepolynomialr : N → N.Recallthatwecan Φ (x,y)d=ef C,gates viewanassignmentoftruthvaluestothegatesofthesuccinctly (cid:94) yyii ==11↔↔((yyjj ==11∧∨yykk ==11)) iiffff((ii))==(((cid:107)&,,jj,,kk)) eapnpcorodperdiacteirlceunigttCh.wInasthaefboitllostwriinngg,leotrase=qu(ean1c,e..o.f,baiit)s∈triNngisb,eoaf yi =1↔yj =0 iff(i)=(∼,j,k) valuation,forany1≤j <ieachaj willbeusedtoencodetheval- i∈[r] yyii ==1xi iiffff((ii))==((↑↓,10,0,0,0)). uanesdoafitwheililnepnuctogdaetethsewviathluiensdoexft2hqe(ng)a(tejs−w1i)thuipndtoex2q2(qn()nj)−(i1−o1f)Cuwp, (4) tothegatewithindex2r(n)−1ofC .Soinparticulartheinternal w Next,theformulaΦC(x)definedbelownowenablesustodetermine gatesofCwareencodedinai. whetherCacceptsagiveninputencodedintothefirst-ordervariable Inordertoextractencodingsofbitstringsfromnaturalnum- x: bΦ¯ers,a(sxa,yfi)rswthsitcehpawsseumpreovxidtoebneeautvraallidfoernmcoudlainsgΦ.TCwhe,0s(exf,oyrm)ualnads ΦC(x)d=ef ∃x.∃y.∃y.Φbin,n(x,x)∧Φbin,r(y,y)∧ (5) enCawb,l0eustotestwhetherabitofabitstringwhoseindexisgiven ∧Φ (x,y)∧y =1 by y is encoded to be zero in x. Formally, for a valid encoding C,gates r a∈Nandforb∈[2r(n)],wehaveΦ (a,b)iffthereisaprime Φ¯C(x)d=ef ∀x.∀y.∀y.(cid:0)Φbin,n(x,x)∧Φbin,r(y,y)∧ (6) p∈[(b+1)3,(b+2)3)anda≡0mCowd,0p,ora≡0modpforall ∧Φ (x,y)(cid:1)→y =1. primesp∈[(b+1)3,(b+2)3),respectively4.Letr(cid:48)(x)=r(x)+1, C,gates r wedefine: We now show how a predicate determining whether a given number a ∈ N is a prime number in the interval [b3,(b+1)3) ΦCw,0(x,y)d=ef∃p.Φprime,r(cid:48)(n)(p,y+1)∧Φmod,r(cid:48)(n)(x,p) forsomeb>0representablebynbitscanberealised.Itiseasily verifiedthatanynumberinthisintervalcanberepresentedbyatmost Φ¯Cw,0(x,y)d=ef∀p.Φprime,r(cid:48)(n)(p,y+1)→Φmod,r(cid:48)(n)(x,p). m=3(n+1)bits.Moreoverasdiscussedabove,bothconditions canbedecidedinpolynomialtime.Thereforewecanconstructin The formulas ΦCw,1(x,y) and Φ¯Cw,1(x,y) testing whether the logarithmicspaceaBooleancircuitC withm+ninputgates bit with index y is set to 1 in the encoding x can be defined prime,n implementingthispredicate[28,Thm.8.1]anddefine analogouslybynegatingΦCw,0(x,y).Thepreviouslyconstructed formulasnowenableustodefineformulasthatallowforevaluating Φ (x,y)d=ef∃x.∃y.∃z.Φ (x,x)∧Φ (y,y)∧ the succinctly encoded Cw on an input that is provided on-the- prime,n bin,m bin,n flyviaa.Givenanindexbimplicitlylessthan2r(n) ofagateof ∧z= (cid:88) 2ixi+2m (cid:88) 2iyi∧ΦCprime,n(z) (7) Cw,representedbythefirst-ordervariabley,andavectorofvalid i∈[m] i∈[n] encodingsa=(a1,...,ai)representedbythefirst-ordervariables x,thefollowingformulaΦ (x,y)checkswhetherthevalueof Cw,(cid:62) thegatewithindexbissettotrueunderthevaluationaaccording Φ¯ (x,y)d=ef∀x.∀y.∀z.(cid:0)Φ (x,x)∧Φ (y,y)∧ prime,n bin,m bin,n ∧z= (cid:88) 2ix +2m (cid:88) 2iy (cid:1)→Φ (z). (8) i i Cprime,n 4Inordertoproperlyhandlethecaseb=0,wehavetoshifttheintervalwe i∈[m] i∈[n] usefortheencodingbyonefrom[b3,(b+1)3)to[(b+1)3,(b+2)3). totheconventiondescribedbefore: Algorithm1Deciding∃x .ϕ(x ,...,x )foragiveninstanti- i+1 1 i+1 Φ (x,y)d=ef (cid:94) (cid:16)(cid:0)2q(n)(j−1)≤y<2q(n)j → ationa1,...ai ∈Nj ofx1,...xi. Cw,(cid:62) 1≤j<i 1: ϕ(x1,...,xi+1):=DNF(ϕ(x1,...,xi+1)) →ΦCw,1(xj,y)(cid:1)∧(cid:0)2q(n)(i−1)≤y→ΦCw,1(xi,y)(cid:1)(cid:17). 23:: forfoarllaclllaluisteersaψls(tx=1,.p.(.x,1x,i.+.1.),xoif+ϕ1)d<o bofψdo 4: replacetinψwith−p(x1,...,xi+1)≥−b+1 AformulaΦCw,⊥(x,y)testingwhetherthevalueofagateissetto 5: endfor falsecanbedefinedanalogouslybynegatingΦCw,(cid:62)(x,y).Building 6: forallliteralst=¬(p(x1,...,xi+1)<b)do uponthoseformulas,wecannowconstructBooleanconnectives 7: replacetinψ(x1,...,xi+1)withp(x1,...,xi+1)≥b thatallowforcheckingthatthegatesofCwareconsistentlyencoded. 8: endfor Given a ∈ Ni as above, ΦCw,&(a,b,c1,c2) holds if the logical 9: (S :Axi+1 ≥c):=ψ[a1/x1,...,ai/xi] and-connectiveholdsforthetruthvaluesofthegateswithindex 10: if S (cid:54)=∅then b,c1andc2encodedviaa: 11: (cid:74)re(cid:75)turn true 12: endif Φ (x,y,z ,z )= Cw,& 1 2 13: endfor (cid:0) (cid:1) ΦCw,(cid:62)(x,y)↔ΦCw,(cid:62)(x,z1)∧ΦCw,(cid:62)(x,z2) . 14: return false TheremainingBooleanconnectivesfoundinDefinition1canbe reflectedviatheadditionalformulas Together with Lemma 1, this immediately gives that for any ΦCw,(cid:107)(x,y,z1,z2), ΦCw,∼(x,y,z1,z2)andΦCw,↓1(x,y,z1,z2) fixedi>0,validityinPA(i+1)isinΣEi+XP1.Wenowshowhowto whicharedefinedanalogouslytoΦ (x,y,z ,z ).Thesefor- decreasethenumberoforaclecallsbyone. mulasnowenableustodefineaΠ -Cawna,&logueto1Φ 2 (x,y)in Tothisend,letΦbeaPA(i+1,j)formulainprenexnormal 1 C,gates (4)inordertocheckiftheBooleanassignmentofthesuccinctly formforafixedi>0andsomej,i.e., encodedcircuitCwisconsistent: Φ=∃x .∀x ···Q x .ϕ(x ,...,x ). 1 2 i+1 i+1 1 i+1 ΨCw,gates(x)=∀t.∀y.∀z1.∀z2.ΦDw(t,y,z1,z2)→ InordertodecidevalidityofΦ,byapplicationofProposition7,a →(cid:94) tt==01→→ΦΦCCww,,&(cid:107)((xx,,yy,,zz11,,zz22)) ΣfoEirXtPh-ealxg1o,r.it.h.mxicasuncahlttehrantat(cid:107)iangkl(cid:107)y≤gu2escs|Φv|a(3lju)ai+ti1onfsoar1a,ll.1..≤aik∈≤Nji tt==24→→ΦΦCCww,,(cid:62)(cid:62)((xx,).y)↔ΦCw,⊥(x,z1) wanidthsloemadeincgonzsetraonst,cw>em0,aaynadssbuymaeddthitaiotnaanlylynpuamdbdeinrginvaelvueartyioanks Here,Φ (t,y,z ,z )isaninstantiationofΦ (x)definedin(5) is represented using 2poly(|Φ|) bits. Consequently, it remains to acnledan(6a)sfDoΦrwt(hxe)ciirtcius1iotnD2lywo.pTehneiunsxe.oHfoΦwDewve(tr,,tyh,iszC1c,azn2e)aissilnyobtetofitaxleldy sbheodwectihdeadt vinalpidoilytynoomfiQalit+im1xe.i+T1h.iϕs(isa,1o/fxc1o,u.r.s.e,,anoi/txthie,xcai+se1u)ncdaenr C byconcatenatingt,y,z andz intoasinglefirst-ordervariableas standardassumptionsfromcomplexitytheory.However,thefinal 1 2 itwasdonein(7)and(8),anddetailshaveonlybeenomittedfor calltotheΣP0-oracleofaΣEiXPalgorithmgetsϕandallakasinput, thesakeofreadability.Alsonotethatthevaluesoft,y,z andz thelatterbeingofexponentialsizein|Φ|.Informallyspeaking,this 1 2 arethenimplicitlyboundedthroughΦ (t,y,z ,z ). providesuswithsufficientadditionaltimeinordertodecidevalidity Finally, we can define Ψ (x ,.D.w.,x ), th1e l2ast remaining of Mw 1 i formulafrom(1),asfollows Q x .ϕ(a /x ,...,a /x ,x ) (9) i+1 i+1 1 1 i i i+1 Ψ (x ,...,x )d=ef inpolynomialtimewithrespecttothesizeoftheinput. M(cid:26)w Ψ1Cw,gatesi(x)∧ΦCw,(cid:62)(x,2r(n)−1) ifiisodd algoArligthomritdhemci1d,inwghvicahlidtiatkyeosfϕaafnodrmthuelaaaksains(i9n)pufot,riesvaenpsie,ui.deo., ΨCw,gates(x)→ΦCw,(cid:62)(x,2r(n)−1) ifiiseven Qi+1 =∃.ThecaseQi+1 =∀canbederivedsymmetrically.Let Inspecting the construction outlined in this section, it is not dif- usdiscussAlgorithm1andanalyseitsrunningtime.InLine1,the ficult to see that for a given w ∈ {0,1}n the construction of algorithmconvertsϕintodisjunctivenormalform.Thisstepcan Φ (x ,...,x )istedious,butcanbeperformedinpolynomial beperformedinexponentialtimeDTIME(2O(|Φ|))andthustakes Lw 1 i timewithrespectton.Weleaveitasanopenproblemwhetherthis polynomialtimewithrespecttotheinput.StartinginLine2,the reductioncanactuallybeperformedinlogarithmicspace,though algorithmiteratesoverallclausesψofϕ,andsincethereareatmost theredonotseemtobeanymajorobstacles.Followingtheargumen- 2O(|Φ|) clauses this iteration is performed at most a polynomial tationofthissection,weconcludethatΦ istheformularequired number of times with respect to the size of the input. In each L,w inProposition6. iteration, in Lines 3–8 the algorithm transforms the disjuncts of ψ into linear inequalities by eliminating negation. After Line 8, 3.2 UpperBounds ψ isaconjunctionoflinearinequalitiesandthusgivesrisetoan We will now show that the previously obtained lower bounds equivalent system of linear Diophantine inequalities S in which havecorrespondingupperbounds.Letusfirstrecallanimproved thefirst-ordervariablesx1,...xiareinstantiatedbythea1,...ai. version of a result by Reddy & Loveland [32] established by Clearly,Lines3–9canbeexecutedinpolynomialtimewithrespect Weispfenning[38,Thm.2.2],whichboundsthesolutionintervals tothesizeoftheinput.Finally,inLine10feasibilityofSischecked. ofPresburgerformulas. To this end, we invoke Proposition 4 from which it follows that feasibilityofeachScanbedecidedinDTIME(2p(|Φ|)|S|)forsome Proposition7(Weispfenning[38]). Thereexistsaconstantc>0 polynomialp.Thisstepisagainpolynomialwithrespecttotheinput suchthatforanyPA(i,j)formulaΦandN ={0,...2c|Φ|(3j)i},Φ totheoraclecall.IfSisfeasiblethealgorithmreturnstrueinLine11. isvalidiffΦisvalidwhenrestrictingthefirst-ordervariablesofΦ Otherwise,ifnoSisfeasibleforalldisjunctsofϕ,thealgorithm tobeinterpretedoverelementsfromN. returnsfalseinLine14.Consequently,wehaveshownthefollowing proposition,whichtogetherwithProposition6completestheproof 4. Ultimately-PeriodicSetsDefinableinthe ofTheorem1. Σ -fragmentofPresburgerArithmetic 1 Proposition8. Foranyfixedi>0,PA(i+1)isdecidableinΣEiXP. WewillnowapplysometechniquesdevelopedinSection3inorder toproveTheorem2,i.e.,giveboundsontherepresentationofprojec- 3.3 Discussion tionsofPA(1)formulasopeninonevariableasultimately-periodic Weconcludethispartofthepaperwithashortdiscussiononthe sets.Formally,givenaPA(1)formulaΦ(x),weareinterestedinthe relationshipofourproofofthelowerboundofPA(i+1)totheproof representationoftheset ofaNEXPlowerboundforPA(2)byGra¨del[18],andapplications Φ(x) ={a∈N:Φ(a/x)isvalid}. ofandresultsderivablefromProposition8. (cid:74) (cid:75) As it emerged in Section 3.1, at many places we can apply Subsequently,weshowthatthissetisanultimatelyperiodicset andreuseideasofGra¨del’sNEXP-hardnessproofforPA(2)given whose period is at most doubly-exponential and that this bound in[18]forourlowerbound.Onemaindifferenceisthatforhishard- is tight. Throughout this section we assume binary encoding of nessproof,Gra¨delreducesfromaNEXP-completetilingproblem numbersinΦ(x) thathespecificallyintroducesinordertoshowhardnessforPA(2). WebeginwiththefirstpartofTheorem2andprovethefollowing Inourpaper,weareintheluckypositionofhavingaccesstotwenty- proposition. fiveadditionalyearsofdevelopmentsincomputationalcomplexity, Proposition9. ThereexistsafamilyofΣ -formulasofPresburger inwhichitturnedoutthatsuccinctencodingsviaBooleancircuits 1 arithmetic (Φ (x)) such that each Φ (x) is a PA(1,O(n)) provideacanonicalwayinordertoshowhardnessresultsforcom- formula withn|Φ (xn)>|0∈ O(n2) and Φn(x) is an ultimately pdliescxoitvyecrylaossfeaspthoalytninocmluidale-tEimXePa,lsgeoereit.hgm.[1fo6r,2d8e,ci2d9i]n.gMporirmeoavlietry,t[h1e] periodicsetwithpneriodpn ∈22Ω(n). (cid:74) n (cid:75) alsoenablesustouseBooleancircuitsencodedintoΣ1-respectively Tothisend,wecombineΦmod,n(x,y)from(3)inSection3.1 Πi-formulasinordertodecideprimalityofapositiveintegerofa withthefollowingstatement. boundedbitsize,whilein[18]thisisachievedbyanapplicationof theLucasprimalitycriterion,cf. Lehmer’smoregeneralproof[24]. Proposition10(Nair[27]). Letn≥9,then2n ≤lcm{1,...n}≤ Inaddition,Gra¨del’sstrongerstatementthatPA(2)isNEXP-hard 22n. alreadyforan∃∀∗-quantifierprefixcanberecoveredfromourlower Wedefine bound.Evenmoregenerallyfori>1,wecanderiveΣEXP-hardness i fromourconstructionfora(∃∀)((i−1)/2)∃∗∀∗quantifierprefixif Φn(x)d=ef∃y.Φmod,n(x,y)∧y>1. iisodd,andfora∃(∀∃)(i/2−1)∀∗∃∗quantifierprefixifiiseven. We have |Φ (x)| ∈ O(n2), and, since numbers are encoded in EventhoughessentiallyalltechnicalresultsrequiredtoproveTheo- n binary,thatΦ (x)isaPA(1,O(n))formula.Nowa∈ Φ(x) iff rem1wereavailablewhen[18]waspublished,aswehaveseenin n thereis1<m<2nsuchthata≡0modm,andconse(cid:74)quent(cid:75)ly thissectiontheproofofthelowerboundrequiressomesubstantial technicalefforts,whichisprobablyareasonwhythisresulthasnot Φ (x) = (cid:91) U(0,m,∅,{0}) n beenobtainedearlier. (cid:74) (cid:75) 1<m<2n WithregardstoapplicationsofProposition8,wegiveanexample =U(0,p,∅,{a:a∈[p],m|a,1<m<2n}), ofaresultwhichcanbeobtainedasacorollaryofthisproposition. In[21],Huynhinvestigatesthecomplexityoftheinclusionprob- where p d=ef lcm{1,...2n −1}. By Proposition 10, p ∈ 22Ω(n), lem for context-free commutative grammars. Given context-free whichyieldsthelowerboundforTheorem2. grammarsG ,G ,thisproblemistodeterminewhethertheParikh 1 2 Turning now towards the upper bound, the remainder of this image5ofthelanguagedefinedbyG isincludedintheParikhim- 1 sectionisdevotedtoprovingthesecondpartofTheorem2,i.e.,the ageofthelanguagedefinedbyG .Buildinguponacarefulanalysis 2 followingstatement. ofthesemi-linearsetsobtainedfromParikhimagesofcontext-free grammarsduetoGinsburg[14]andbyestablishingaCarathe´odory- Proposition 11. For any Σ -formula Φ(x), we have Φ(x) = 1 typetheoremforintegercones,Huynhshowsthatthecomplement U(t,p,B,R)suchthatt∈2poly(|Φ(x)|)andp∈22poly(|Φ(cid:74)(x)|). (cid:75) ofthisproblemisinNEXP.Thisresultcanhowevernoweasilybe obtainedasacorollaryofProposition8:Vermaetal.haveshown As a first step, we consider projections of sets of solutions thattheParikhimageofacontext-freegrammarcanbedefinedin of systems of linear Diophantine inequalities. To this end, let termsofaΣ -formulaofPresburgerarithmeticlinearinthesizeof S : Ax ≥ c be such a system. From Proposition 5, we have 1 (cid:83) thegrammar[37].Non-inclusionthenreducestocheckingvalidity that S = i∈IL(bi;Pi)forsomeindexsetI.LetMi bethe ofaΣ2-sentence,whichyieldsthefollowingcorollary. proje(cid:74)cti(cid:75)onofL(bi;Pi)onthefirstcomponent.WegetthatMican beobtainedas Corollary1. Non-inclusionbetweenParikhimagesofcontext-free grammarsisinNEXP. Mi ={bi+λi,1p1+···λrpi,ri :λk ∈N} =b +g ·{λ p /g +···λ p /g :λ ∈N} Of course, the “hard work” of the upper bound is done in i i 1 i,1 i r i,ri i k Proposition4,butneverthelessweareabletoobtainasuccinctproof forsomeb ,p <···<p andg =gcd{p ,...p }.Since of Huynh’s result. In general, the NEXP upper bound for PA(2) gcd{p /ig ,i.,.1.p /g }=i,ri1,itisifolklorethai,t1 i,ri providesagenericupperboundfornon-inclusionproblemsthatcan i,1 i i,ri i bereducedtocheckinginclusionbetweensemi-linearsetsdefinable Mi =bi+gi·U(t(cid:48)i+1,1,Bi(cid:48),{0}) via PA(1) formulas. For context-free commutative grammars, it forsomeB(cid:48) ⊆ [t(cid:48)]andt(cid:48) ∈ NknownastheFrobeniusnumber shouldhoweverbenotedthatitisnotknownwhetherthisupper i i i ofp /g ,...p /g .Givenco-primepositiveintegers1<a < boundistight,thebestknownlowerboundbeingΣP2 [21]. a <i,1···i< a i,∈riN,itheFrobeniusnumberf ∈ Nisthelarg1est 2 k positiveintegernotexpressibleasapositivelinearcombinationof 5TheParikhimageofawordw∈Σ∗isavectorofnaturalsofdimension a ,...a andcanbeboundedasfollows. 1 k |Σ|countingthenumberoftimeseachalphabetsymboloccursinw. Proposition12(Wilf[39]). Let1 < a1 < a2 < ··· < ak ∈ N [3] LeonardBerman. Thecomplexityoflogicaltheories. Theoretical bepairwiseco-prime.ThentheFrobeniusnumberf isboundedby ComputerScience,11(1):71–77,1980. f ≤a2k. [4] AlexisBe`s. Asurveyofarithmeticaldefinability. InAtributeto Hence, for some t ≤ b + g (p /g )2 ≤ b + p2 we MauriceBoffa,pages1–54.Socie´te´Mathe´matiquedeBelgique,2002. consequentlyhave i i i i,ri i i i,ri [5] ItshakBoroshandLeonB.Treybing. Boundsonpositiveintegral solutionsoflinearDiophantineequations.ProceedingsofttheAmerican Mi =U(ti,pi,Bi,{0}) (10) MathematicalSociety,55:299–304,1976. forsomep ≤p . [6] Yuan-YouFu-RuiCheng.Explicitestimateonprimesbetweenconsec- i i,ri utivecubes.RockyMountainJournalofMathematics,40(1):117–153, LetΦ(x)=∃x.ϕ(x,x)beaPA(1)formula.FromAlgorithm1 2010. wecanderivethat (cid:91) (cid:91) [7] KevinJ.ComptonandC.WardHenson.Auniformmethodforproving ϕ(x,x) = Sj = L(bi;Pi), lower bounds on the computational complexity of logical theories. (cid:74) (cid:75) j∈J(cid:74) (cid:75) i∈I AnnalsofPureandAppliedLogic,48(1):1–79,1990. where each S : A (x,x) ≥ c is a system of linear Diophan- [8] D.C.Cooper. Theoremprovinginarithmeticwithoutmultiplication. j j j MachineIntelligence,7:91–99,1972. tine inequalities obtained from one disjunct of the disjunctive normal form of ϕ, similar as in Line 9 of Algorithm 1. Clearly, [9] AntoineDurand-GasselinandPeterHabermehl.Ehrenfeucht-Fra¨ısse´ (cid:107)A (cid:107),(cid:107)c (cid:107)≤(cid:107)Φ(x)(cid:107)+1foralli∈I.Moreover,fromProposi- goes elementarily automatic for structures of bounded degree. In j j tion5wederivethat S = (cid:83) L(b ;P )forsomeindexset ChristophDu¨rrandThomasWilke,editors,29thInternationalSym- I suchthatforevery(cid:74)i∈j(cid:75)I i∈Ij i i posiumonTheoreticalAspectsofComputerScience,volume14of j j LeibnizInternationalProceedingsinInformatics(LIPIcs),pages242– (cid:107)b (cid:107),(cid:107)P (cid:107)≤(|Φ(x)|(cid:107)A (cid:107)+(cid:107)c (cid:107)+1)O(|Φ(x)|) ∈2poly(|Φ(x)|). 253,Dagstuhl,Germany,2012.SchlossDagstuhl–Leibniz-Zentrumfu¨r i i i i Informatik. LetMibeasabove,from(10)wehaveMi =U(ti,pi,Bi,{0}). [10] JeanneFerranteandCharlesRackoff.Adecisionprocedureforthefirst Nowdefinep d=ef lcm{p } ,combiningtheestimationsin(10) ordertheoryofrealadditionwithorder.SIAMJournalonComputing, i i∈I with Proposition 10 we have p ∈ 22poly(|Φ(x)|). It follows that 4(1):69–76,1975. [11] MichaelJ.FischerandMichaelO.Rabin.Super-exponentialcomplex- Φ(x) = U(t,p,B,R) for some t ∈ 2poly(|Φ(x)|) and p ∈ ityofPresburgerarithmetic.InBobF.CavinessandJeremyR.Johnson, 2(cid:74)2poly(|Φ(cid:75)(x)|) asabove,whichconcludestheproofofTheorem2. editors,QuantifierEliminationandCylindricalAlgebraicDecomposi- tion,TextsandMonographsinSymbolicComputation,pages122–135. SpringerVienna,1998. 5. Conclusion [12] Andra´sFrankandE´vaTardos. Anapplicationofsimultaneousdio- In the first part of this paper we have shown that Presburger phantineapproximationincombinatorialoptimization.Combinatorica, arithmetic with a fixed number of i + 1 quantifier alternations 7(1):49–65,1987. and an arbitrary number of variables in each quantifier block is [13] MartinFu¨rer.ThecomplexityofPresburgerarithmeticwithbounded completeforΣEiXP foreveryi > 0.Thisresultclosesagapthat quantifieralternationdepth.TheoreticalComputerScience,18(1):105– hasbeenleftopenintheliterature,andinparticularimprovesand 111,1982. generalisesresultsobtainedbyFu¨rer[13],Gra¨del[18]andReddy& [14] SeymourGinsburg.Themathematicaltheoryofcontextfreelanguages. Loveland[32].Moreover,itprovidesaninterestingnaturalproblem McGraw-Hill,1966. whichiscompletefortheweakEXPhierarchy,acomplexityclass [15] StefanGo¨ller,ChristophHaase,Joe¨lOuaknine,andJamesWorrell. forwhichnotthatmanynaturalcompleteproblemshavebeenknown Branching-timemodelcheckingofparametricone-counterautomata. sofar. InLarsBirkedal,editor,FoundationsofSoftwareScienceandComputa- Inthesecondpart,weestablishedboundsonultimatelyperiodic tionalStructures,volume7213ofLectureNotesinComputerScience, sets definable in the Σ -fragment of Presburger arithmetic and pages406–420.Springer,2012. 1 showedthatinparticulartheperiodofthosesetsisatmostdoubly- [16] Georg Gottlob, Nicola Leone, and Helmut Veith. Second order exponentialandthatthisboundistight.Asalreadydiscussedin logicandtheweakexponentialhierarchies. InJiˇr´ıWiedermannand theintroduction,therearehowevernaturalultimatelyperiodicsets PetrHa´jek,editors,MathematicalFoundationsofComputerScience, definableinthisfragmentthatadmitperiodsthatareatmostsingly- volume 969 of Lecture Notes in Computer Science, pages 66–81. exponential, cf. [15]. An interesting open question is whether it Springer,1995. ispossibletoidentifyafragmentofΣ -Presburgerarithmeticfor [17] ErichGra¨del.SubclassesofPresburgerarithmeticandthepolynomial- 1 whichsuchasingly-exponentialupperboundcanbeestablishedin timehierarchy.TheoreticalComputerScience,56(3):289–301,1988. generalandthatcapturessetssuchasthoseconsideredin[15]. [18] ErichGra¨del. Dominoesandthecomplexityofsubclassesoflogical theories.AnnalsofPureandAppliedLogic,43(1):1–30,1989. Acknowledgments [19] LaneA.Hemachandra. Thestrongexponentialhierarchycollapses. JournalofComputerandSystemSciences,39(3):299–322,1989. Theauthorwouldliketothanktheanonymousrefereesfortheir [20] DungT.Huynh.Decidingtheinequivalenceofcontext-freegrammars thoughtfulcommentsonthefirstversionofthispaper.Inaddition, with1-letterterminalalphabetisΣP-complete.TheoreticalComputer the author is grateful to Benedikt Bollig, Stefan Go¨ller, Felix 2 Science,33(23):305–326,1984. Klaedtke, Sylvain Schmitz and Helmut Veith for encouraging [21] DungT.Huynh.Thecomplexityofequivalenceproblemsforcommu- discussionsandhelpfulsuggestions. tativegrammars.InformationandControl,66(12):103–121,1985. [22] AlbertE.Ingham. OntheestimationofN(σ,T). TheQuarterly References JournalofMathematics,os-11(1):201–202,1940. [1] ManindraAgrawal,NeerajKayal,andNitinSaxena.PRIMESisinP. [23] FelixKlaedtke.BoundsontheautomatasizeforPresburgerarithmetic. AnnalsofMathematics,2:781–793,2002. ACMTransactionsonComputationalLogic,9(2):11:1–11:34,2008. [2] SanjeevAroraandBoazBarak.ComputationalComplexity:AModern [24] DerrickH.Lehmer. TestsforprimalitybytheconverseofFermat’s Approach. CambridgeUniversityPress,NewYork,NY,USA,1st theorem.BulletinoftheAmericanMathematicalSociety,33(3):327– edition,2009. 340,1927. [25] Leonard M. Lipshitz. The Diophantine problem for addition and A. Missingproofs divisibility. Transactions of the American Mathematical Society, In the following, let B = {0,1}. Let us recall the following 235:271–283,1978. characterisationofthepolynomial-timehierarchy. [26] LeonardM.Lipshitz.SomeremarksontheDiophantineproblemfor additionanddivisibility.InProceedingsoftheModelTheoryMeeting, Lemma2(Def.5.3andThm.5.12in[2]). Fori>0,alanguage volume33,pages41–52,1981. L⊆B∗isinΣPiffthereexistsapolynomialrandadeterministic i [27] MohanNair.OnChebyshev-typeinequalitiesforprimes.TheAmerican polynomial-time computable predicate S ⊆ (B∗)i+1 such that MathematicalMonthly,89(2):126–129,1982. w∈Liff [28] Christos H. Papadimitriou. Computational Complexity. Addison- ∃w1∈Br(n).∀w2∈Br(n)···Qiwi∈Br(n).S(w,w1,...,wi). Wesley,1994. Lemma3(Lem.1inthemaintext). Foranyi > 0,alanguage [29] ChristosH.PapadimitriouandMihalisYannakakis.Anoteonsuccinct L ⊆ {0,1}∗ is in ΣEXP iff there exists a polynomial q and a representationsofgraphs. InformationandControl,71(3):181–185, predicateR⊆({0,1}∗i)i+1suchthatforanyw∈{0,1}n, 1986. [30] Lo¨ıcPottier.MinimalsolutionsoflinearDiophantinesystems:bounds w∈Liff∃w1∈{0,1}2q(n).∀w2∈{0,1}2q(n)··· andalgorithms.InRonaldV.Book,editor,RewritingTechniquesand Applications,volume488ofLectureNotesinComputerScience,pages ···Qiwi∈{0,1}2q(n).R(w,w1,...,wi) 162–173.Springer,1991. andR(w,w ,...,w )canbedecidedindeterministicpolynomial [31] Mojz˙eszPresburger.U¨berdieVollsta¨ndigkeiteinesgewissenSystems time. 1 i derArithmetikganzerZahlen,inwelchemdieAdditionalseinzigeOp- erationhervortritt.InComptesRendusduIcongresdeMathematiciens Proof. (“⇐”)WedescribeaNEXPΣPi−1 TuringmachineM decid- desPaysSlaves,pages92–101.1929. ingforagivenw∈Bnwhetherw∈L.First,M performsaNEXP [32] C.R.ReddyandDonaldW.Loveland. Presburgerarithmeticwith guessinordertoguessw ∈ B2q(n).DefineL(cid:48) ⊆ Bn ×B2q(n) boundedquantifieralternation.InProceedingsofthe10thannualACM suchthat(w,w )∈L(cid:48)iff1 SymposiumonTheoryofComputing,pages320–325,NewYork,NY, 1 USA,1978.ACM. ∃w2∈B2q(n)···Q(cid:48)iwi∈B2q(n).¬R(w,w1,...,wi), [33] BrunoScarpellini. ComplexityofsubcasesofPresburgerarithmetic. whereQ(cid:48) = ∃ifQ = ∀andviceversa.ByLemma2,wehave Transactions of the American Mathematical Society, 284:203–218, i i 1984. that L(cid:48) is a language in ΣPi since we can check if the input is sufficiently large and immediately reject if this is not the case, [34] Uwe Scho¨ning. Complexity of Presburger arithmetic with fixed choose r : w (cid:55)→ |w| − n, and decide ¬R(w,w ,...,w ) in quantifierdimension.TheoryofComputingSystems,30(4):423–428, 1 i 1997. deterministicpolynomialtime.Thus,afterM hasguessedw1,it invokes the ΣP oracle to check (w,w ) ∈ L(cid:48) and accepts if [35] HelmutSeidl,ThomasSchwentick,AncaMuscholl,andPeterHaber- i−1 1 (w,w )(cid:54)∈L(cid:48). mehl. Countingintreesforfree. InJosepD´ıaz,JuhaniKarhuma¨ki, 1 ArtoLepisto¨,andDonaldSannella,editors,Automata,Languagesand (“⇒”)LetLbedecidedbyaNEXPΣPi−1 TuringmachineM. Programming,volume3142ofLectureNotesinComputerScience, Given w ∈ Bn, an accepting run of M has length at most 2nk pages1136–1149.Springer,2004. forsomek > 0onwhichitresolvesc ,...,c ∈ B,m ≤ 2nk [36] LarryJ.Stockmeyer. Thepolynomial-timehierarchy. Theoretical 1 m non-deterministic choices. Moreover, M makes (cid:96) oracle queries ComputerScience,3(1):1–22,1976. “v ∈L(cid:48)?”forsomeL(cid:48)inΣP suchthatn =|v |,(cid:96)≤2nk,and [37] KumarN.Verma,HelmutSeidl,andThomasSchwentick. Onthe Mjreceivesanswersa ∈Btio−t1hosequeries.jByLejmma2,wehave complexityofequationalHornclauses.InRobertNieuwenhuis,editor, j v ∈L(cid:48)iff AutomatedDeduction–CADE-20,volume3632ofLectureNotesin j ComputerScience,pages337–352.Springer,2005. ∃w2,j ∈{0,1}r(nj)···Qiwi,j ∈{0,1}r(nj).S(vj,w2,j,...,wi,j). [38] VolkerWeispfenning. ThecomplexityofalmostlinearDiophantine IfM receivesa =1asananswertoanoraclecallitcanguessthe j problems.JournalofSymbolicComputation,10(5):395–403,1990. correspondingcertificatew2,j ∈Br(nj).Otherwise,ifaj =0this [39] HerbertS.Wilf.Acircle-of-lightsalgorithmforthe”money-changing resultcanbeverifiedusingonequantifieralternation.Consequently, problem”.TheAmericanMathematicalMonthly,85(7):562–565,1978. wecanguesstheanswerstotheoraclequeriesandthenverifyat [40] PierreWolperandBernardBoigelot.Anautomata-theoreticapproach oncewhetherthoseguesseswerecorrect.Hence,w∈Liff toPresburgerarithmeticconstraints. InAlanMycroft,editor,Static Analysis,volume983ofLectureNotesinComputerScience,pages ∃c1,...cm∈B,v1,...v(cid:96)∈B2nk,a1,...a(cid:96)∈B, 21–32.Springer,1995. w2,1,...w2,(cid:96)∈Br(2nk).∀w2∈B2q(n)···Qiwi∈B2q(n). R((w·c1···cm·v1···v(cid:96)·a1···a(cid:96)·w2,1···w2,(cid:96)),w2,...,wi) for some appropriately chosen polynomial q and appropriately constructed R ⊆ (B∗)i+1 combining S with checking that the c resolvethenon-determinismofM correctlyandthattheguessed i answerstotheoraclecallsarecorrect.