ebook img

Allegories: decidability and graph homomorphisms PDF

13 Pages·2017·0.91 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Allegories: decidability and graph homomorphisms

Allegories: decidability and graph homomorphisms Damien Pous, Valeria Vignudelli To cite this version: Damien Pous, Valeria Vignudelli. Allegories: decidability and graph homomorphisms. Logic in Com- puter Science, Jul 2018, Oxford, United Kingdom. ￿10.1145/3209108.3209172￿. ￿hal-01703906v2￿ HAL Id: hal-01703906 https://hal.archives-ouvertes.fr/hal-01703906v2 Submitted on 27 Apr 2018 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Allegories: decidability and graph homomorphisms∗ DamienPous ValeriaVignudelli UnivLyon,CNRS,ENSdeLyon,UCBLyon1,LIP UnivLyon,CNRS,ENSdeLyon,UCBLyon1,LIP Lyon,France Lyon,France Abstract A key result about allegories is that an inequationu ≥ v is AllegorieswereintroducedbyFreydandScedrov;theyformafrag- universallyvalidforbinaryrelations(i.e.,itholdsforallinstantia- mentofTarski’scalculusofrelations.Weshowthattheirequational tionofitsvariableswithbinaryrelations)ifandonlyifthereisa theoryisdecidablebycharacterisingitintermsofaspecificclass graphhomomorphismfromg(u)tog(v).Forinstance,theinequa- ofgraphhomomorphisms. tiona·b ∩a·c◦ ≥a·(b ∩c◦)∩d canbeprovedbyexhibitingthe Weactuallydosoforanextensionofallegorieswhichweprove followinghomomorphism: tobeconservative:allegorieswithtop.Thismakesitpossibleto a b exploitacorrespondencebetweentermsandK4-freegraphs,for a whichisomorphismswereknowntobefinitelyaxiomatisable. c Keywords Allegories,Algebra,Graphs,Treewidth,Minors,De- a b cidability,Homomorphisms c d 1 Introduction ThischaracterisationwassketchedbyFreydandScedrov[12,page In the nineties, Freyd and Scedrov proposed the notion of alle- 208]andlaterprovedbyAndrékaandBredikhin[2,Theorem1]. gory [12],anaxiomatisationofcategorieswithsomeadditional It actually appeared earlier under a different and more general structurepresentinthecategoryofrelations(withsetsasobjects form, to prove that the database problem of conjunctive queries andbinaryrelationsasmorphisms).Allegoriesariseinregularcate- containmentisdecidable[5,Lemma13]. gories[18,ChapterA3];theywerealsoappliedtocircuitdesign[4]. Thischaracterisationhoweveronlyappliestorepresentablealle- Weshowinthispaperthattheirequationaltheoryisdecidable. gories,thoseallegoriesthatareisomorphictoanalgebraofconcrete Forgettingthecategoricalstructure,allegoriesformafiniteand binaryrelations.Indeed,theequationaltheoryofallegoriesisin- purelyequationalaxiomatisationofthepositivecalculusofrela- completewithrespecttothesemodels.FreydandScedrovgivea tions[3].Theirsyntaxisthefollowing: counter-example[12,p.210]:therearehomomorphismsthatcor- u,v ::=a |u·v |u ∩v |u◦ |1 respondtoinequationsthatarenotderivablefromtheaxiomsof allegories.Incompletenessalsofollowsfromageneralnegative Letterarangesoverasetofvariables.Thefirstthreeoperations resultbyAndrékaandMikulás[3]:anyfinitefirst-orderaxiomati- intuitivelydenoterelationalcomposition(·),intersection(∩)and sationmustbeincompletewhentheconsideredfragmentcontains converse(_◦).Theconstant1correspondstotheidentityrelation. atleasttheoperationsofcomposition,intersectionandconverse. Wecanassociatetoeachtermualabelled,directedgraphg(u) Whenlookingatcounter-examplestocompleteness,onecansee withtwodesignatedverticesforinputandoutput.Inthisconstruc- thattheproblemsalwaysarisefromhomomorphismsthatequate tion,a isadirectededgelabelledwitha,·isseriescomposition morethantwoverticesatatime.Infact,FreydandScedrovsuggest ofgraphs,obtainedbymergingtheoutputofthefirstgraphand that“theequationschosenasthedefinitionofallegoryhappento theinputofthesecondone,∩isparallelcomposition,merging bepreciselythosethataccountforallcontainmentsobtainableby theinputsandtheoutputsofthetwographsrespectively,(_◦)ex- identifyingtheverticestwoatatime”[12,p.210]. changesinputandoutput,and1isthegraphwithnoedgeanda Weobtaindecidabilitybyprovingthisclaim,whichhappensto singlevertex.Forinstance,thegraphsofthetermsa·(b ∩c◦)∩d bemoredifficultthanexpected.Anattemptatexhibitingaproof and1∩a·barethefollowingones: wasproposedinGutierrez’sdoctoraldissertation[16].However, a b hisproofbuildsonalemmawhichhappenstobefalseandcannot a befixed[1,13].Gutierrezalsoclaimeddecidabilityearlier,inashort c b abstract[15]whereheproposesanalternativecharacterisation,but d proofsarenotavailableandsomeofhisassertionsseemhighlynon- ∗Thispaperisthefullversionof[20](Proc.LiCS’18),withappendices.Thiswork trivialtoprove.(SeeAppendixE).Tothebestofourknowledge, hasbeensupportedbytheEuropeanResearchCouncil(ERC)undertheEuropean theproblemisthuscurrentlyconsideredasopen. Union’sHorizon2020programme(CoVeCe,grantagreementNo678157),andbythe LABEXMILYON(ANR-10-LABX-0070)ofUniversitédeLyon,withintheprogram Thekeydifficultyisthatsomegraphscannotberepresentedbya "Investissementsd’Avenir"(ANR-11-IDEX-0007)operatedbytheFrenchNational term.Thus,eventhougheveryhomomorphismcanbedecomposed ResearchAgency(ANR). intoasequenceofhomomorphismsequatingatmosttwoverticesat LICS’18,July9–12,2018,Oxford,UnitedKingdom atime,thereisnoguaranteethattheintermediategraphsappearing ©2018Copyrightheldbytheowner/author(s).Publicationrightslicensedtothe insuchadecompositionarethegraphsofsometerms.Considerfor AssociationforComputingMachinery. instancethegraphsinFigure1.Therearehomomorphismsfrom Thisistheauthor’sversionofthework.Itispostedhereforyourpersonaluse.Not forredistribution.ThedefinitiveVersionofRecordwaspublishedinLICS’18:LICS theoutergraphstotheinnerone,obtainedbymergingvertices ’18:33rdAnnualACM/IEEESymposiumonLogicinComputerScience,July9–12,2018, depictedwiththesamesymbol.Whilethosethreegraphsaregraphs Oxford,UnitedKingdom,https://doi.org/10.1145/3209108.3209172. ofterms,weshallseethatonlythefirstonecanbedecomposedinto 1 LICS’18,July9–12,2018,Oxford,UnitedKingdom DamienPousandValeriaVignudelli 1≜ G·H ≜ G H ⇀ ↼̸ G ⊤≜ G ∩H ≜ H Figure1.Validandinvalidhomomorphisms.(Theedgesofthe dom(G)≜ G G◦≜ G graphinthemiddleshouldbelabelledwithdifferentlettersand orientedarbitrarily;theorientationandlabellingoftheedgesof a≜ a theoutergraphsarethendeterminedbythetwohomomorphisms.) Figure2.Graphoperations. asequencewhereallintermediategraphsaregraphsofterms(see AppendixAformoredetails),andthuscorrespondstoaninequality Definition1. AgraphisatupleG =⟨V,E,s,t,l,ι,o⟩,whereV is provablefromallegoriesaxioms. afinitesetofvertices,Eisafinitesetofedges,s,t :E→V aremaps Weproceedintwosteps. indicatingthesourceandtargetofeachedge,l :E →Aisamap 1. Firstwesolvetheproblemforallegorieswithtop,thatis, indicatingthelabelofeachedge,andι,o ∈V arethedesignated allegoriesextendedwithaneutralelementforintersection, vertices,respectivelycalledinputandoutput. whosegraphisthedisconnectgraphwithnoedgesandtwo vertices,inputandoutput.Doingsogivesusmoreflexibility: Definition2. AhomomorphismfromG =⟨V,E,s,t,l,ι,o⟩toG′= therearemoregraphsthatcanberepresentedbyaterm(for ⟨V′,E′,s′,t′,l′,ι′,o′⟩isapairh=⟨f,д⟩offunctionsf :V →V′ instance,thedisconnectedones),andthereisaclearcharac- andд:E→E′thatrespectthevariouscomponents:s′◦д= f ◦s, terisationoftheclassofgraphsofterms:theyareprecisely t′◦д= f ◦t,l =l′◦д,ι′= f(ι),ando′= f(o). thegraphsoftreewidthatmosttwo,orequivalently,the Asurjective(resp.injective)homomorphismisahomomorphism graphsexcludingK4 asaminor.Thismovealsomakesit whosetwocomponentsaresurjective(resp.injective)functions.A possibletoexploitarecentaxiomatisationofisomorphisms (graph)isomorphismisasurjectiveandinjectivehomomorphism onsuchgraphs[7]:weshowthatthecorrespondingaxioms whosetwocomponentsarebijectivefunctions.WewriteG ≃G′ arederivableinallegorieswithtop(Proposition19),andwe whenthereexistsanisomorphismbetweengraphsGandG′. canthenreasonmoduloisomorphisms.Thislatterpossibility Weconsiderthefollowingsignaturesfortermsandalgebras: iscrucialinmostofourproofs. 2. Thenweprovethatallegorieswithtopareaconservative Σ=(cid:8)·2,∩2,_◦1,10(cid:9) Σ⊤=Σ∪{⊤0} Σdom=Σ∪{dom1} extensionofallegories:everyequationoverthesignatureof Weusuallyomitthe·symbolandweassignprioritiessothatthe allegoriesthatholdsinallallegorieswithtopactuallyholds term(a·(b◦))∩ccanbewrittenjustasab◦∩c. inallallegories.Wedosousingmodel-theoreticmeans,by Graphsformalgebrasforthosesignaturesbyconsideringthe showinghowtoembedanygivenallegoryintoanallegory operationsdepictedinFigure2,whereinputsandoutputsarerepre- withtop(Proposition44).Wesolveinpassingaproblem sentedbyunlabelledingoingandoutgoingarrows.Theoperations thatwasleftopenin[7]:wegiveafiniteaxiomatisationof composition (·) and intersection (∩) respectively correspond to isomorphismsforconnectedK4-freegraphs. seriesandparallelcomposition,converse(_◦)justexchangesinput Outlineandcontributions Wefirstrecallthecorrespondence andoutput,anddomain(dom(_))relocatestheoutputtotheinput. betweentermsandK4-freegraphs[7](Section2)andsetuptools Byinterpretingalettera∈AasthegraphafromFigure2,one toextracttermsfromgraphs(Section3).Thenwedefineallegories canthusassociateagraphg(u)toeverytermovertheconsidered withtopandweprovelawsthatarerequiredinthesequel(Sec- signaturesandwithvariablesinA. tion4).Section5isdevotedtoourmaincontribution:therewe Observethatintersectingagraphwith1amountstomerging characterisetheinequationaltheoryofallegoriesintermsofse- itsinputanditsoutput.Asaconsequence,thedomainoperation quencesofappropriatehomomorphisms(Theorem16).Thischarac- isderivableinthesignatureΣ⊤thankstotheisomorphismbelow. terisationleadstodecidability(Section6)andtoanotionofnormal Intuitively,relocatingtheoutputtotheinputcanbeimplemented form(Section7).Wefinallyproceedwiththeconservativityre- byfirstdisconnectingtheoutput(bymultiplicationwith⊤onthe sults(Section8),whichmakeitpossibletoliftourcharacterisation right),andthenmergingitwiththeinput(byintersectionwith1). anddecidabilityprooftopureallegories,andtoprovideafinite dom(G)≃1∩G⊤ axiomatisationofisomorphismsforconnectedK4-freegraphs. Theconservativityresultsandtheequationalproofsneededin Accordingly,wewillusethefollowingshorthandwhenworking thepaperhavebeenformallyverifiedusingtheCoqproofassistant. withΣ⊤-terms:dom(u)≜1∩u⊤. Thedevelopmentcanbedownloadedandbrowsedonline[21]. Therearegraphswhicharenotthegraphofanyterm.Forin- stance,thisisthecaseforthefollowinggraphs,whatevertheori- 2 Termsandgraphs entationandlabellingoftheiredges. We let a,b... range over the letters of a fixed alphabet A. We (1) considerlabelleddirectedgraphswithtwodesignatedvertices.We justcallthemgraphsinthesequel.Notethatweallowmultiple Wenowrecallsomestandardgraphtheorynotions,tostatethe edgesbetweentwovertices,aswellasself-loops. characterisationofthegraphsofΣ⊤-termsfrom[7]. 2 Allegories:decidabilityandgraphhomomorphisms LICS’18,July9–12,2018,Oxford,UnitedKingdom Asimplegraphisanunlabelledundirectedgraphwithatmost oneedgebetweentwoverticesandwithoutself-loops.Weusestan- 1∩a(bd∩e)(c∩c′)◦ dom(a(bd∩e)∩c∩c′) b d wdaerddennootatetiobnyaknjdatperomteinntoilaolgeydfgreombegtwraepehnthtweooryve[r9t]i.cIenspkaartnidcujl;aar, 11∩∩((aa((bbdd∩∩ee))∩∩cc)′c)c′◦◦ dom(a∩(c∩c′)(d◦b◦∩e◦)) a e c,c′ kj-pathisa(possiblytrivial)pathwhoseendsarekandj;G+kjis thesimplegraphobtainedfromGbyaddingtheedgekjifkandj werenotalreadyadjacent. Figure3.Differenttermsdenotingthesameconnectedgraph. Definition3. AminorofasimplegraphGisasimplegraphob- tainedfromG byasequenceofthefollowingoperations:delete Thegraphsof1,a,a◦,ab∩c,1∩a,and1∩ab anddom(a)areall anedgeoravertex,contractanedge(i.e.,deleteitandmergeits prime.Thegraphsofab,a(b∩c),1∩a∩bc anddom((1∩a)(b∩c◦)) endpoints).AsimplegraphisH-freeifH isnotoneofitsminors. arenot,thelattertwobeingthegraphof(1∩a)(1∩bc).Aprimeis eitherapetaloraneye.Petalscanbecharacterisedasfollows. RobertsonandSeymour’sgraphminortheorem[22],statesthat (simple)graphsarewell-quasi-orderedbytheminorrelation.Asa Lemma7. AtestGisapetalifeither consequence,theclassesofgraphsofboundedtreewidth[9],which • G ≃1,orG ≃1∩aforsomelettera,or areclosedundertakingminors,canbecharacterisedbyfinitesets • G has no self-loop on its input, is connected, and remains ofexcludedminors.Twosimpleandstandardinstancesarethe connectedwhenremovingtheinput. followingones:thegraphsoftreewidthatmostone(theforests) Asexpected,everyconnectedgraphcanbedecomposedasa arepreciselythoseexcludingthecyclewiththreevertices(C3); seriescompositionofprimes.Thiscantypicallybedepictedasfol- thoseoftreewidthatmosttwoarethoseexcludingthecomplete lows,whereeyesaregreenandpetalsareyellow.Thefourdepicted graphwithfourvertices(K4)[10]. verticesarecalledcheckpoints:theymustbevisitedbyany(undi- rected)pathfromtheinputtotheoutput.Propercheckpointsare (C3) (K4) thosedifferentfrominputandoutput. Definition4. TheskeletonofagraphGisthesimplegraphSob- tainedfromGbyforgettinginput,output,labelling,edgedirections, edgemultiplicities,andself-loops.ThestrongskeletonofGisS+ιo Thisdecompositionisnotuniquehowever:therecanbesuperfluous ifι(cid:44)o,andSotherwise. occurrencesof1,andtheorderinwhichcontiguouspetalsappear Asanexample,K4 isthestrongskeletonofallinstancesofthe doesnotmatter.IfthestartinggraphbelongstoTW2,thensodo graphsin(1). itsprimecomponents;thisallowsonetoproceedrecursively. Thefollowingpropositionmakesitpossibletodecomposenon- Proposition5([7,Corollary26]). LetGbeagraph.Thefollowing trivialeyes.Thisisaconsequenceof[7,Proposition21(i)]. areequivalent. 1. ThereexistsaΣ⊤-termusuchthatG ≃g(u). Proposition8. LetG ∈TW2beaneye.EitherGconsistsofasingle 2. ThestrongskeletonofGhastreewidthatmosttwo. edge,orthereareconnectedgraphsG1,G2 ∈TW2s.t.G ≃G1∩G2. 3. ThestrongskeletonofGisK4-free. WewriteG[k;j]forthegraphGwithinputandoutputrespectively Inthesequel,wewriteTW2forthesetofgraphssatisfyingthese settokandj.AsillustratedinFigure3,therecanbeseveralways conditions.Theresultsfrom[7]alsoentailthatProposition5adapts ofextractingatermfromatest.Weshallmostlyusethefollowing toconnectedgraphsjustbyrestrictingtoΣdom-terms.(Σ-terms observation,toresorttothecasewhereinputandoutputdiffer: alonearenotenough,considerforinstancethegraphdom(a).) Observation9. LetGbeatestandletkbeavertexofG.Wehave G ≃dom(G[ι;k]). 3 Parsinggraphs Toextractatermusingthisobservation,onemusthowevermake Manydifferenttermscandenotethesamegraph.Firstbecauseof associativity,commutativity,andneutralelements.Butalso,and surethatG[ι;k]belongstoTW2.WhenGisalreadyknowntobe moreimportantly,becauseofgraphswhoseinputandoutputare inTW2,onecanusefork anyneighbouroftheinput:G[ι;k]is equal.ConsiderforinstancethegraphinFigure3,whichisthe necessarilyinTW2insuchacase,sinceitsstrongskeletonisthe graphofthefivetermsgivenontheleft.Notethatthetermsinthe sameasthatofG.Thisishowthetwotermsinthesecondcolumn ofFigure3areextracted.Otheroptionsareoftenpossible,consider secondcolumndonotexistinthesyntaxofpureallegories(the forinstancethefollowinggraph: signatureΣ):weneedeitherthedomainoperationoritsencoding through the constant ⊤. The ability to write such terms in the a b syntaxofallegorieswithtopiscrucialinSection5. Wenowproveafewresultsthatallowustoextracttermsfrom Choosingtheneighbouroftheinputyieldsdom(adom(b)),while agivengraphinTW2.Wefirstfocusonconnectedgraphs. choosingtheothervertexyieldsdom(ab).Conversely,someoptions areforbidden:thetopmostvertexinthegraphofFigure3cannot Definition6(Primes,tests,petals,eyes). AgraphGisprimeifit isconnectedandforallgraphsG1,G2,G ≃G1·G2entailsG1≃1 beDchisocsoennn,ethcteesdtrgornagphsskeclaentobneopfatrhseedreassuflotilnlogwgsr:aphbeingK4. orG2≃1.Agraphisatestifitsinputisequaltoitsoutput.Apetal isaprimetest.Aneyeisaprimewithdistinctinputandoutput. Proposition10. LetG ∈TW2beadisconnectedgraph. 3 LICS’18,July9–12,2018,Oxford,UnitedKingdom DamienPousandValeriaVignudelli u ∩u =u (A0) u v v u u ∩(v ∩w)=(u ∩v)∩w (A1) u w u w u ∩v =v ∩u (A2) u ∩⊤=u (A3) u v v u w w u·(v·w)=(u·v)·w (A4) u·1=u (A5) Figure5.SurjectivehomomorphismsforAxioms(AD)and(AM). u◦◦=u (A6) (u ∩v)◦=u◦∩v◦ (A7) (u·v)◦=v◦·u◦ (A8) Axiom(AD),semi-distributivity,isequivalenttomonotonicity uv ∩uw ≥u(v ∩w) (AD) ofcompositionontheright,andthusalsoontheleftbyduality,so (v ∩wu◦)u ≥vu ∩w (AM) thatalloperationsaremonotoneintheend. Axiom(AM)iscalledmodularidentity.Thisistheonlyunusual axiom.Itgeneralisesthenotionofmodularityforlattices[8].Its Figure4.Axiomsofallegorieswithtop(All⊤). dualisthefollowinglaw: u(v ∩u◦w)≥uv ∩w (AM’) 1. IfGhasaconnectedcomponentH whichcontainsneitherthe inputnortheoutput,thenthegraphG′obtainedbyremoving Asymmetricalconsequenceofmodularidentityisthefollowing HfromGbelongstoTW2andforeveryvertexkinH,wehave inequation,knownasDedekindlaw: H[k;k]∈TW2andG ≃G′∩⊤H[k;k]⊤. 2. Otherwise,GhasexactlytwoconnectedcomponentsG′and (v ∩wu◦)(u ∩v◦w)≥vu ∩w (DD) G′′respectivelycontainingtheinputandtheoutput,wehave G′[ι;ι],G′′[o;o]∈TW2andG ≃G′[ι;ι]⊤G′′[o;o]. Theaxiomsofallegoriesaresoundwithrespecttobinaryrela- tions.Asaconsequenceofthecharacterisationofrepresentable Proof. ItsufficestoshowthatthecomputedgraphsareinTW2.This allegoriesmentionedintheIntroduction,wehave: followsfromtheobservationthattheirstrongskeletonisalwaysa subgraphofthestrongskeletonofG,andthefactthattheclassof Proposition13. If⊢All⊤u ≥vthenthereexistsahomomorphism K4-freegraphsisclosedundertakingsubgraphs. □ fromg(u)tog(v). Remark11. Theoccurrencesoflettersinatermareinonetoone Axioms(A1-A8)actuallyallcorrespondtographisomorphisms. correspondencewiththeedgesofitsgraph.Asaconsequence,ifC[] Idempotency(A0)correspondstoaninjectivehomomorphismfrom isatermcontextsothatC[a]isatermwithadesignatedoccurrence righttoleft,andtoasurjectivehomomorphismfromlefttoright; ofthelettera,thengivenatermu,thegraphofC[u]isobtained Axioms (AD) and (AM) correspond to the surjective homomor- fromthegraphofC[a]byreplacingtheedgecorrespondingtothe phismsdepictedinFigure5.Notethatthosethreefamiliesofsur- selectedoccurrenceofawiththegraphofu. jectivehomomorphismsmayequatearbitrarilymanyvertices:the graphofumighthavemanyverticesinadditiontoinputandoutput. 4 Allegories (ThisissuewillbeaddressedinSection5.4.) AsaconsequenceofProposition13,wehave⊢ 1≥uifand Definition12. AnallegorywithtopisaΣ⊤-algebrasatisfyingthe onlyifg(u)isatest.Wethuscalltests thetermAslsl⊤atisfyingthis axioms in Figure 4, where an inequation of the formu ≥ v is condition.Equivalently,atestisatermthatisprovablyequalto ashorthandfortheequationu ∩ v = v.Given Σ⊤-termswith sometermoftheshape1 ∩v.FollowingnotationsfromKleene variablesinA,wewrite⊢ u =vwhenthisequationisderivable All⊤ algebrawithtests(KAT)[19],weletα,β rangeovertests. from the axioms in Figure 4 (equivalently, when it holds in all allegorieswithtop,forallinterpretationofthevariables).Similarly Recallthatdom(u)≜1∩u⊤isaderivedoperationinallegories withtop.Suchanoperationisnotdefinableinpureallegories,but forinequations. AnallegoryisaΣ-algebrasatisfyingthoseaxiomsbut(A3).We wecandefineasimilaroperationbysettingdom′(u) ≜ 1 ∩uu◦. Bothdomainoperationsaretestsbydefinition,butthegraphsof define⊢ u =vaccordingly. All dom(u)anddom′(u)arenotisomorphic;theyaredepictedbelow. Axioms(A0-A8)capturethemostnaturalpropertiesoftheoper- ators:intersectionisidempotent,associative,commutative,andhas u u u ⊤asaneutralelement(sothatthederivedrelation≥isapartial orderwith⊤asmaximumelementandintersectionasmeet);com- Theseoperationsarehoweverinterchangeableinallegorieswith positionisassociativeandhasneutralelement1;converseisan involutionthatreversescompositions.Theyentail1◦=1,⊤◦=⊤, top:wewillprovetheequationbelowafterProposition14. monotonicityofintersectionandconverse,andanotionofduality: everystatementwhichholdsuniversallyalsoholdswhenreversing ⊢All⊤ dom(u)=dom′(u) (2) allcompositions.Weusesuchlawsfreelyinthesequel. 4 Allegories:decidabilityandgraphhomomorphisms LICS’18,July9–12,2018,Oxford,UnitedKingdom Proposition14. Thefollowinglawsarederivableinallegories. 1∩1=1 (A9) dom′(u ∩v)=1∩uv◦ (3) dom(u ∩v)=1∩u·v◦ (A10) α(v ∩w)=αv ∩w (4) u·⊤=dom(u)·⊤ (A11) αβ =α ∩β =βα (5) (1∩u)·v =(1∩u)·⊤∩v (A12) α =α◦=αα =dom′(α) (6) dom′(uv)=dom′(udom′(v)) (7) Figure6.Axiomsfor2p-algebras(with(A1-A8)). Proof. Weprove(3)bydoubleinclusion.1∩uv◦ ≥ dom′(u ∩v) followsbymonotonicityfromu ≥u ∩v andv◦ ≥u◦ ∩v◦.For TheclassTW2isclosedundersubgraphs,soG (cid:44)→HandH ∈TW2 theotherdirection,weuseDedekindlaw(DD)withw =1: impliesG ∈ TW2.SincewerequireG andH tobeK4-freewhen 1∩(u ∩v)(u◦∩v◦)≥1∩(uv◦∩1)=1∩uv◦ G(No(cid:7)teHt,hwatewahlseonhha:vGet→hatHGis⇀asHurajencdtiHve∈hoTmWom2iomrpphliiessmGeq∈uaTtWin2g. ForEquation(4),wehave exactlytwovertices,thenneitherG ∈TW2impliesH ∈TW2nor theconverse.SeeAppendixB.) α(v ∩w)≥α(v ∩α◦w) (1≥α◦) Relation⇀isapreorderand⇌isanequivalencerelation.The ≥αv ∩w (by(AM’)) remainderofthissectionisdevotedtoshowingthattherelation ≥αv ∩αw (1≥α) ⇌issoundandcompletew.r.t.provabilityinAll⊤: ≥α(v ∩w) (by(AD)) Theorem16. Wehave⊢ u =vifandonlyifд(u)⇌д(v). All⊤ Itsufficestoprovethefirstequationin(5),whichfollowsfrom Westartwiththebackwardimplication,forwhichitsufficesto idempotencyand(4):αβ =α(1∩β)=α1∩β =α ∩β. show thatд(u) (cid:44)→ д(v) entails ⊢ u ≥ v (Section 5.2) and Forthefirstequationin(6),wehave д(u) д(v)entails⊢ u ≥v(SecAtilol⊤n5.3).Forbothimplications, All⊤ (1∩u)◦=1∩1u◦=dom′(1∩u) (by(3)) acru(cid:7)cialpreliminarystepconsistsindealingwithisomorphisms (Section5.1).Thenweprovetheforwardimplication(Section5.4). =dom′(u ∩1)=1∩u1◦=1∩u (by(3)) 5.1 Isomorphisms Theotherequationsin(6)followusing(5).Weget(7)asfollows. dom′(udom′(v))≥dom′(udom′(u◦uv ∩v)) Definition17([7,Section3]). A2p-algebraisaΣ⊤-algebrasatis- fyingtheaxioms(A1)-(A8)fromFigure4andtheaxioms(A9)-(A12) =dom′(u(1∩u◦uvv◦)) (by(3)) inFigure6.Wewrite⊢2p u =vwhentwotermsuandvarecon- ≥dom′(u ∩uvv◦) (by(AM)) gruentmodulothoseaxioms,orequivalently,whentheequation =1∩uvv◦u◦=dom′(uv) (by(3)) holdsinall2p-algebras. ≥1∩u(1∩vv◦)u◦ Notethatidempotency(A0)isnotincludedintheaxiomsof2p- =1∩u(1∩vv◦)(1∩vv◦)◦u◦ (by(6)) algebra.TW2isthefree2p-algebra;inparticular,wehave =dom′(udom′(v)) □ Theorem18([7,Corollary34]). Wehave⊢2pu =viffg(u)≃g(v). Wenowobservethateveryallegorywithtopisa2p-algebra. Theabovelawsalsoholdinallegorieswithtop.Equation(2)follows byinstantiatingvwith⊤in(3). Proposition19. If⊢2pu =vthen⊢All⊤u =v. Proof. It suffices to prove axioms (A9)-(A12) from Figure 6. Ax- 5 Graphtheoreticalcharacterisation iom(A9)isatrivialinstanceofidempotency.Axiom(A10)follows WedefineaclassofhomomorphismsonTW2graphs,thatwewill from(3)and(2),andAxiom(A12)from(4).ForAxiom(A11)we provetocharacteriseinequationsinAll⊤.Suchhomomorphisms, haveu⊤≥1∩u⊤andby(AM): denotedby⇀,arethosethatcanbedecomposedasasequence ofhomomorphismswhosesourceandtargetarebothinTW2and u⊤=1⊤∩u⊤≤(1∩u⊤⊤◦)⊤=dom(u)⊤ □ equateatmosttwovertices.Thisisthecaseforthefirsthomo- Corollary20. Ifg(u)≃g(v)then⊢ u =v. morphisminFigure1(onemustmergetheblackcirclesfirst,see All⊤ AppendixA),butnotforthesecondone:merginganytwover- Thisresultisfundamentalforthefollowingproofs:itallowsusto ticeswiththesameshapeinthegraphontherightyieldsagraph reasonuptoisomorphisms,andtofreelychoosethewaywewant containingK4asaminor.) toreadagivengraph.Recallforinstancethefivetermsdenoting WeletR∗denotethereflexive-transitiveclosureofarelationR. thesamegraphinFigure3;thankstotheabovecorollary,weknow thatthosefivetermsareprovablyequalinallegorieswithtop,so Definition15. Definethefollowingrelationsongraphs: thatwecanfreelyreplaceonebytheother. • G H ifG,H ∈ TW2 andthereisasurjectivehomomor- phi(cid:7)smh:G →H suchthathcollapsesatmosttwovertices; 5.2 Injectivehomomorphisms • G (cid:44)→H ifthereisaninjectivehomomorphismh:G →H; WriteG (cid:44)→v Hifthereexistsaninjectivehomomorphismwhichis • G ⇀H ifG ( ∪(cid:44)→)∗H; bijectiveonedgesandaddsexactlyonevertex(i.e.,suchthatthere • G ⇌H when(cid:7)G ⇀H andH ⇀G. isexactlyonevertexthatisnotinitsrange),andG (cid:44)→e H ifthere 5 LICS’18,July9–12,2018,Oxford,UnitedKingdom DamienPousandValeriaVignudelli existsaninjectivehomomorphismwhichisbijectiveonvertices k ∈g(w)andk′∈g(α).Byisomorphism,wecanassume andaddsexactlyoneedge(idem).Wehave thatk′istheinputofg(α).Theng(u)≃g(C[1∩⊤α⊤]), (cid:44)→=(cid:44)→∗(cid:44)→∗ where1correspondstovertexk,andg(v)≃g(C[1∩α]). v e Theresultfollowsfrom⊢ ⊤α⊤≥α. Itthussufficestoshowthat(cid:44)→v and(cid:44)→e yieldproofsinallegories b. g(u)hasexactlytwoconnAelcl⊤tedcomponentsrespectively withtop.Weexploittheresultaboutisomorphismstodoso. containingtheinputandtheoutput,andthereareαandβ Proposition21. Ifg(u)(cid:44)→v g(v)then⊢All⊤u ≥v. scuocnhcltuhdaetgb(yu)in≃dugc(αti⊤onβ)i.fLtihkeecinoltlhaepsperdevvioeurtsicceassek,,wke′caarne Proof. Observethatg(u)(cid:44)→v g(v)entailsg(u ∩⊤⊤)≃g(v),and eitherbothing(α)orbothing(β).Supposek ∈g(α)and thus⊢All⊤u ∩⊤⊤=vbyCorollary20.Wefinallyget k′ ∈ g(β).Byhypothesis,collapsingk andk′givesusa All⊤⊢u =u ∩⊤≥u ∩⊤⊤=v . □ gorfagp(αh)ga(vn)dikn′TisWc2o.nSnineccteevdetrotetxhekoisuctpountnoefctge(dβ)to,wtheedienrpivuet Proposition22. Ifg(u)(cid:44)→e g(v)then⊢All⊤u ≥v. thatgraphsg(α)[ι,k]andg(β)[k′,o]areinTW2.Hence, thereexistw,x s.t.g(α)[ι,k] ≃ g(w),g(β)[k′,o] ≃ g(x). Proof. Supposetheaddededgeislabelledbya,andwritev =C[a] Wehaveg(u)≃g(w⊤x)andg(v)≃g(wx),andtheresult byselectingthecorrespondingoccurrenceofainv(Remark11). followsby⊢ w⊤x ≥wx. Wehaveд(u)≃д(C[⊤]),so⊢All⊤u =C[⊤]byCorollary20.Weget 2. g(u) is a connAelclt⊤ed test. Since g(u) has at least two ver- All⊤⊢u =C[⊤]≥C[a]=vbymonotonicityofalloperations. □ tices,thereissomevertexk adjacenttotheinput,butdif- NotethatinadditiontoCorollary20,wearemakingacrucialuse ferentfromit.Thenthereissometermwsuchthatg(u)≃ ofthepresenceof⊤inthesyntaxintheabovetwoproofs.We g(dom(w))andg(u)[ι;k]≃g(w).Theexistenceofahomo- couldgetridofitwhenworkingwithconnectedgraphs,butthis morphismfromg(u)tog(v)impliesthatg(v)isatestas requires convoluted arguments (for instance, we can no longer well.Moreover,bythedefinitionofhomomorphism,h(k)is handleverticesandedgesseparatelyandinanarbitraryorder). eitheradjacenttotheinputing(v)ortheinputitself(incase theverticesidentifiedbythehomomorphismareexactlyk 5.3 Surjectivehomomorphisms andtheinputofg(v)).Inbothcases,thereisatermx such Likeaboveforinjectivehomomorphisms,fortwographsG,H ∈ thatg(v) ≃ g(dom(x))andg(v)[ι;h(k)] ≃ g(x).Thefunc- TW2 writeG v H if there exists a surjective homomorphism tionhisstillasurjectivehomomorphismfromg(w)tog(x) whichisbijecti(cid:7)veonedgesandequatesexactlytwovertices,and collapsingtwovertices,sincetheonlydifferencebetween G e Hifthereexistsasurjectivehomomorphismwhichisbijective g(dom(w))andg(w)isthattheoutputhasbeenrelocatedto on(cid:7)verticesandequatesexactlytwoedges.Wehave k,andanalogouslytheonlydifferencebetweeng(dom(x)) = = ∗ andg(x)isthattheoutputhasbeenrelocatedtoh(k).The v e graphg(w)hasthesamenumberofverticesandedgesas (cid:7) (cid:7) (cid:7) (Where v=isthereflexiveclosureof v.)Wenowshowthat v g(u),buthasinputdifferentfromoutput,sowecanapply and e y(cid:7)ieldproofsinallegorieswithto(cid:7)p.Thisiseasyforthelat(cid:7)ter, theinductivehypothesistog(w)andderive⊢All⊤ w ≥ x. butt(cid:7)heformerrelationrequiresamuchdeeperanalysis. Hence,⊢ dom(w)≥dom(x). All⊤ 3. g(u)isaconnectedgraphwithinputdifferentfromoutput, Proposition23. Ifg(u)(cid:7)e g(v)then⊢All⊤u ≥v. andisnotprime,i.e.,thereareu1,u2bothnotequivalentto1 Proof. Theonlydifferencebetweeng(u)andg(v)isthatthereare suchthatg(u)=g(u1)·g(u2).Letk,k′betheverticesmerged twoparalleledgeswiththesamelabelaing(u)thatarereplaced bythehomomorphism.Ifeitherk,k′arebothing(u1)or byasingleedgeaing(v).Letv′bethetermobtainedfromv by theyarebothing(u2)(possiblyincludingthecasewhenone replacingbya∩atheoccurrenceofacorrespondingtothissingle ofk,k′isthecheckpointbetweeng(u1)andg(u2)ing(u)), edgeing(v).Wehave⊢ v =v′byidempotency.Nowobserve wecanapplytheinductivehypothesis.Otherwise,k isin thatg(u)≃g(v′),sothaAtl⊢l⊤ u =v′byCorollary20. □ g(u1)andk′ ising(u2),andneitherofthemisthecheck- All⊤ pointbetweeng(u1)andg(u2).AsdiscussedinSection3, Proposition24. Ifg(u) v g(v)then⊢All⊤u ≥v. g(u)canbedecomposedasasequenceofprimecomponents (cid:7) Proof. Lethbethesurjectivehomomorphismfromg(u)tog(v)col- g(u1)·····g(un),whereeachcomponentiseitherapetalor lapsingexactlytwovertices.Weprovethestatementbyinduction aneye.W.l.o.g.,wecanassumethatk isinthefirstprime on|g(u)|,where|G|isthelexicographicproductof: component,andthatk′isinthelastprimecomponent(mod- ulothepresenceofpetalsequivalentto1).Ifitwerenotthe • thenumberofedgesandverticesofG, case,theinductivehypothesiscouldbeappliedasabove.We • 1ifGisatest,and0otherwise. considerdifferentcasesdependingonwhetherk,k′areina Weproceedbycasesonthestructureofg(u). petalorinaneye. 1. g(u)isadisconnectedgraph.ThenbyProposition10we a. Bothkandk′areinpetals.Sincekandk′canbemerged, havetwocases: andsincek′isconnectedtotheoutput,theoutputofthe a. g(u)hasaconnectedcomponentwhichcontainsneither firstpetalcanberelocatedtok.Analogously,theinput theinputnortheoutput.Hence,therearewandα such ofthelastpetalcanberelocatedtok′.Thenthereare thatg(u) ≃ g(w ∩⊤α⊤).Letk,k′bethetwocollapsed w,x,zs.t.g(u)≃g(w⊤x ∩z),asrepresentedbelow,with vertices.Ifk,k′ areeitherbothing(w)orbothing(α), ktheoutputofg(w)andk′theinputofg(x),andg(v)≃ wederivetheresultbytheinductivehypothesis.Suppose g(wx ∩z).Weconcludeby⊢ ⊤≥1. All⊤ 6 Allegories:decidabilityandgraphhomomorphisms LICS’18,July9–12,2018,Oxford,UnitedKingdom • • andbycollapsingkandk′wewouldhavethatg(v) hasK4asaminor. b. Bothkandk′areinaneye.Then(thestrongskeletonof) • k′isstrictlyinaneyeofg(w)havingasoutputor g(u)hasthefollowinggraphasaminor(theloweredge inputapropercheckpointofg(w).Theng(u)has asaminoroneofthefollowinggraphs: beingtheoneaddedbythedefinitionofstrongskeleton). k k′ k′ k′ k k WethusgetK4bycollapsingkandk′,whichcontradicts and,asinthepreviouscase,bycollapsingkandk′ thefactthatg(v)isthegraphofaterm. weobtainK4. c. kisinapetalandk′isinaeye.Weconsidertwocases: 4. g(u)isaneyenotreducedtoanedge.Theng(u)≃g(u1)∩ i. Supposethepetalandtheeyearecontiguous,i.e.,that g(u2)withbothg(u1)andg(u2)containingatleastoneedge. therearenoprimecomponentsbetweenthem(modulo Ifk,k′areinthesameparallelcomponentg(ui),thenwe thepresenceof1).Thenthepetalisnotequivalentto canapplytheinductivehypothesis.Otherwise,supposethat 1,otherwisekandk′wouldbeinthesamecomponent. theyarerespectivelying(u1)andg(u2).Wecanassumethat Wehaveg(u)≃g(αw ∩x),withk ∈g(α)andg(w ∩x) bothg(u1)andg(u2)haveatleastonepropercheckpoint, theeyecontainingk′,withk′strictlyinsideg(w)and sinceotherwisetherewouldbeawaytodecomposeg(u) g(x)containingatleastoneedge(thisdecomposition intoparallelcomponentssuchthatk,k′areinthesameone. ofaneyealwaysexistsbyProposition8). Wehavethreecases: • • • • Thenwehaveg(v)≃g(z∩x)withg(αw) v g(z)and • weconcludebytheinductivehypothesis. (cid:7) ii. Supposethepetalandtheeyearenotcontiguous.If • k,k′ are respectively proper checkpoints of g(u1) and thereareonlypetals(ofwhichatleastonenotequiv- g(u2).Thentherearew,w′,x,x′s.t.g(u)≃g(ww′∩xx′) alentto1)betweenthem,wecanmovethembyiso- andg(v)≃g((w ∩x)(w′∩x′)),andweuseAxiom(AD). morphismbeforethepetalcontainingk,andapplythe • kisstrictlyinthepetalofapropercheckpointofg(u)(or inductivehypothesis.Hence,supposethereisatleast symmetricallyfork′).Theng(u)hasasaminor oneeyebetweenthefirstandlastprimecomponentof k g(u).Wegetdifferentcasesdependingonwherekand k′arerespectivelylocatedinthepetalandintheeye. k′ A. Ifk doesnotcoincidewiththeinput,theng(u)has andbycollapsingkandk′weobtainK4. asaminor • kisstrictlyinaneyeofg(u1)havingasoutputorinputa k k′ propercheckpointofg(u1)(orsymmetricallyfork′).Then g(u)hasasaminoroneofthefollowinggraphs andbycollapsingkandk′wewouldhavethatg(v) k k hasK4asaminor,whichisacontradiction. B. kistheinputandtheeyecontainingk′hastwopar- k′ k′ allelcomponentsw,z,fork′∈g(w)andg(w)withat and,asabove,bycollapsingkandk′weobtainK4. leastonepropercheckpoint.Wehavethreecases: 5. Itremainstoconsiderthecasewheng(u)isaneyereduced • toanedge.Theng(u)≃g(a),g(v)≃g(a∩1)andtheresult • followsby⊢All⊤u ≥u ∩1. □ CombiningCorollary20andPropositions21,22,23,and24,we • k′ is a proper checkpoint of g(w). Then g(u) ≃ obtainthattherelation⇀issoundforallegorieswithtop: g(x(w1w2∩z))withk theinputofx andwithk′ Theorem25. Ifg(u)⇀g(v)then⊢ u ≥v. theoutputofw1,forg(w)≃g(w1w2).Bycollapsing All⊤ k,k′weobtaing(v)≃g((x ∩w1◦)z∩w2)andwe 5.4 Completeness deriveinAll⊤: FortheconverseofTheorem25,weintroduceanintermediatein- equationalpresentationofallegorieswithtop.Thisideawasalready x(w1w2∩z)≥(x ∩w1◦)((x ∩w1◦)◦w2∩z) sketchedin[12];wegivedetailshereforthesakeofcompleteness. ≥(x ∩w1◦)z∩w2 (by(AM’)) TheinequationaltheoryAll⊤≥isgeneratedbytheaxioms(A1)- (A8)inFigure4,whereu =visaderivedoperatordefinedasu ≤v andv ≤u,andtheaxiomsinFigure7.Atomicidempotencyisanax- • k′isstrictlyinapetalofg(w)withinputaproper iomschemeparameterisedbylettersa∈A.Thepointofthissystem checkpointofg(w).Theng(u)hasasaminor isthatitsaxiomsallcorrespondtosimplegraphhomomorphisms, k′ thatcaneasilybeseentobelongtotherelation⇀: k Lemma26. Forallaxiomsu ≥vofAll≥,wehaveg(u)⇀g(v). ⊤ 7 LICS’18,July9–12,2018,Oxford,UnitedKingdom DamienPousandValeriaVignudelli 6 Decidability u ≥u ∩v (leftinequality) Wenowshowthattherelation⇀isdecidable,andthatthereisa u ≥v ∩u (rightinequality) notionofnormalformforallegorieswithtop.Thekeyobservation 1∩1≥1 (1idempotency) isthatsurjectivehomomorphismscanalwaysbeappliedfirst. a∩a ≥a (atomicidempotency,foralla∈A) Lemma31. Wehavethefollowinginclusion:(cid:44)→ ⊆ (cid:44)→. u·v ∩x·w ≥(u ∩x)·(v ∩w) (separatedsemi-distributivity) (cid:7) (cid:7) (u ∩w·x◦)·v ≥u·(v ∩x)∩w (separatedmodularity) Proof. Leti :G (cid:44)→G′andh:G′ H.Thegraphhi(G)isK4-free, beingasubgraphofH,andthefu(cid:7)nctionд:G →hi(G),definedas hi,isasurjectivehomomorphismcollapsingatmosttwovertices. Figure7.Inequationalpresentationofallegorieswithtop(All⊤≥). Indeed,functionд istriviallysurjective,andeitherthevertices collapsedbyharebothini(G),inwhichcaseдcollapsesthem,orat leastoneofthecollapsedverticesisnotini(G),whichimpliesthat Proof. Axioms(A1)-(A8)fromFigure4aswellasidempotencyfor1 дisanisomorphism.Therefore,wehaveG hi(G).Sincehi(G) correspondtographisomorphisms.Inequalityaxiomscorrespond injectsinH,weconcludethatG (cid:44)→H. (cid:7) □ to injective homomorphisms, unlessv is a test andu is not. In (cid:7) suchacase,e.g.,forleftinequality,wehaveg(u) v g(u)∩1(cid:44)→ Asaconsequence,weobtainthefollowingcharacterisation,which g(u ∩v).Atomicidempotencycorrespondsto e.(cid:7)Separatedsemi- givesdecidability: distributivityandseparatedmodularitycorresp(cid:7)ondeitherto or to≃.E.g.,forseparatedsemi-distributivitywehave≃ifboth(cid:7)uvand Proposition32. WehaveG ⇀H iffG ∗(cid:44)→H. (cid:7) xaretestsorbothvandwaretests,andwehave v otherwise. □ Corollary33. Therelation⇀isdecidable. (cid:7) Notethatunrestrictedidempotency,semi-distributivityandmodu- Proof. ItsufficestodecidewhetherG ∗(cid:44)→H.Wehavethatthe laridentity(Axioms(A0),(AD)and(AM)inFigure4)couldnotbe sets{G′ |G ∗G′}and{H′ |H′(cid:44)→H(cid:7)}arefiniteandcomputable handledinsuchawaysincetheycorrespondtohomomorphisms (uptoisomo(cid:7)rphism);itsufficestotestwhethertheyintersect. □ potentiallyequatingmanyverticesandedges.Thattheyarenever- thelesscapturedbytherelation⇀isobtainedonlyaposteriori. Onecanactuallygetanon-deterministicpolynomialalgorithm: Byfurthershowingthat⇀is‘closedundercontexts’,wededuce guessasequenceG0,...,Gn ofgraphsobtainedfromG =G0by thatthesystemAll≥issoundfor⇀. mergingtwoverticesatatime,checkthatthesegraphsbelong ⊤ toTW2,computethegraphH′obtainedfromGn bymergingall Lemma27. Forallterm-contextsC,wehave paralleledgeswiththesamelabel(sothatGn e∗ H′)andcheck 1. ifg(u) g(v)theng(C[u]) g(C[v]); thatH′(cid:44)→H.Thelattertestcanbedoneinpoly(cid:7)nomialtimeonce 2. ifg(u)(cid:44)(cid:7)→g(v)theng(C[u])(cid:7)(cid:44)→g(C[v]). Gn andthusH′areknowntohaveboundedtreewidth[6,11,14]. Corollary34. TheequationaltheoryofAll⊤isinNP. Proof. ByinductiononC.Forthefirstitem,whenC =[·]∩w,if themergedverticesaretheinputandoutputofuandifwisatest 7 Normalforms thenwehaveg(C[u])≃g(C[v]),whichisaspecialcaseof . □ Whenstudyinghomomorphismequivalenceongraphs,oneoften (cid:7) usesthenotionofcore,thosegraphswhereeveryendomorphismis Theorem28. If⊢All≥ u ≥vtheng(u)⇀g(v). anisomorphism.Everygraphhasacore,whichisaminimalgraph ⊤ initsequivalenceclassmodulohomomorphismequivalence[17]. ItremainstoshowthattheinequationalpresentationAll⊤≥iscom- Onedefinesasimilarnotionhereforallegories,usingourrestricted pleteforallegorieswithtop.Westartbyprovingthat(unrestricted) formofhomomorphismequivalence(⇌). idempotencyisderivableinAll⊤≥: ThenormalformofagraphG,writtennf(G)isagraphwhichis minimalw.r.t.thenumberofverticesandedgesinitsequivalence Lemma29. Foralltermsu,wehave⊢All⊤≥ u ∩u =u. classmodulo⇌.Normalformsareuniqueuptoisomorphism: Proof. Weprove⊢All≥ u ∩u ≥ubyinductiononu.(Theconverse Proposition35. WehaveG ⇌H iff nf(G)≃nf(H). ⊤ inequalitytriviallyholdsbytheinequalityaxioms).Thebasecases Definethefollowing(computable)relation: aregivenbytheaxiomsofAll≥.Forseriescompositionwehave ⊤ ⊢All≥ uv ∩uv ≥(u ∩u)(v ∩v)byseparatedsemi-distributivity, G (cid:123)H ≜ G ∗H (cid:44)→G and⊤thenweconcludebytheinductivehypothesis. □ (cid:7) Proposition36. Therelation (cid:123) isaconfluentandterminating Theorem30. If⊢All⊤u ≥vthen⊢All⊤≥ u ≥v preorderandforallgraphsGwehaveG (cid:123)nf(G). Proof. That (cid:123) isapreorderfollowsfrom ∗ and(cid:44)→beingpre- Proof. Itsufficestoderivemodularityandsemi-distributivityfrom orders.Terminationfollowsfromtheobserva(cid:7)tionthatthesizeofa theirseparatedversions;thisfollowsfromLemma29. □ graphdecreasesalong (onemustofcourseforbidtrivialsteps). Confluenceisprovedb(cid:7)yinductiononthesumofthesizesofthe CombiningTheorems25,28,and30wefinallyobtainTheorem16. consideredgraphs,usingProposition32(seeAppendixC). □ 8 Allegories:decidabilityandgraphhomomorphisms LICS’18,July9–12,2018,Oxford,UnitedKingdom Gutierrezprovesasimilarresultinthecontextoffinitecategories 1∩1=1 (A9) withanepi-monofactorisationsystem[16,Chapter4.2].Onecannot reusehisresultdirectly:theinjective(resp.surjective)homomor- dom(u ∩v)=1∩u·v◦ (A10) phismsweuseherearenotexactlythemono(resp.epi)morphisms dom(u·v)=dom(u·dom(v)) (A13) ofthenaturalcategoryassociatedtotherelation⇀. dom(u)·(v ∩w)=dom(u)·v ∩w (A14) To illustrate this rewriting system, consider the four graphs depictedbelow.Wehighlightpairsofverticesthatcanpotentially bemergedbyrepresentingthemwiththesamesymbol,usingthe Figure8.Axiomsfor2pdom-algebras(with(A1,A2,A4-A8)). sameconventionasinFigure1forlabelsandorientationofedges. G4isthenormalformofthefourgraphs,andtherearethreeways Graphsforma2pdom-algebra:theaxiomsaresound.Toprove ofreachingitfromG1:directly,orbygoingthroughG2orG3. thattheyarecompleteforgraphisomorphisms,werelyonTheo- rem18andweprovethatevery2pdomalgebracanbeembedded =G1 (cid:123) G2= ina2palgebra.Combinedwiththeotherresultsfrom[7],thisalso yieldsthatconnectedK4-freegraphsformthefree2pdom-algebra. (cid:123) (cid:123) WefixaΣdom-algebra⟨X,·,∩,_◦,dom(_),1⟩intheremainder =G3 (cid:123) G4= ofthissection.WewriteT forthesetoftestsinX.Weconstruct Inthisexample,everyattempttocollapsetwoverticesresultsina thefollowingΣ⊤-algebra: graphinTW2.Thisisnotalwaysthecase,asshownbelow. Definition38. LetX bethesetX ⊎T2.Foru ∈X,wewriteufor uasanelementofX.Forα,β ∈T,wewriteα⋄βforthepair⟨α,β⟩ asanelementofX.WeturnX intoaΣ⊤-algebrabysetting: u·v ≜u·v u ∩v ≜u ∩v H1 H2 H3 (α⋄β)·(γ⋄δ)≜α⋄δ (α⋄β)∩(γ⋄δ)≜αγ⋄βδ (cid:7) (cid:7) H3isthenormalformofthosethreegraphs.Theuniquehomomor- (α⋄β)·v ≜α⋄dom(v◦β) (α⋄β)∩v ≜αvβ phismfromH1toH3canbefactorisedthroughthegraphH2 ∈TW2 obtainedbyfirstmergingtheverticesdepictedwithtriangles.Since u·(γ⋄δ)≜dom(uγ)⋄δ u ∩(γ⋄δ)≜γuδ Hno3t(cid:44)H→1 (cid:123)H1,Hw2e,sdinedceucHe2Hd1oe(cid:123)snoHt3e.mWbeedalsinoHha1v.eIfHin2st(cid:123)eadHw3e, btruyt (α⋄β)◦≜β⋄α 1≜1 tocollapsefirsttheverticesdepictedwithblackcirclesinH1,we u◦≜u◦ ⊤≜1⋄1 obtainagraphthatdoesnotbelongtoTW2. WhenX isthealgebraofconnectedgraphs,X intuitivelyrepre- 8 Conservativityarguments sentgraphswhereallverticesareconnectedeithertotheinputor totheoutput:anelementudenotesaconnectedgraph,whilean Wenowshowthattheresultspresentedintheprevioussections elementα⋄β denotesthedisconnectedgraphα⊤β. extendtopureallegories(withouttop).Wedosobyprovingthat Whencomposingtwo‘disconnectedelements’α⋄β andγ⋄δ All⊤isaconservativeextensionofAll,i.e.,thatforalltermsu,v inseries,wethrowawayacomponentthatshouldintuitivelybe inthesyntaxofallegories(i.e.,forall⊤-freeterms),⊢All⊤ u =v createdandwhichisnotconnectedtotheinputortotheoutput: ifandonlyif⊢ u =v.Consequently,theequationaltheoryof All βγ.ThismeansthatX cannotbethefree2p-algebra:whateverthe allegoriesisdecidableandTheorem16alsoholdsforAll. starting2pdom-algebraX,X alwayssatisfiesthelaw⊤u⊤=⊤. Weproveconservativitybyshowingthateveryallegoryem- Notehoweverthatthefunctionmappinganelementu ∈X tou bedsintoanallegorywithtop(Proposition44).Ithappensthatwe canfactorisethisconstructiontoshowinpassinghowtohandle isaninjectiveΣ-homomorphismfromX toX. isomorphismsofconnectedK4-freegraphs.Thisiswhatwedofirst. Lemma39. In2pdom,anelementuisatestiffdom(u)=u. Proofsinthissectionaremostlyequationalandofteninvolve manycases.Wepresentsketchestogiveintuitions;moredetails Proposition40. IfX isa2pdom-algebrathenX isa2p-algebra. canbeenfoundinAppendixD;fullproofsformalisedinCoqcan Proof. WemustshowthatX satisfiesallthe2paxioms(Figure6). bebrowsedonline[21]. Considertheassociativityofproduct(A4).Eachofthethreevari- ablesoccurringinthisaxiomcanbeeitherinX orinT2.Theproof 8.1 IsomorphismsofconnectedgraphsinTW2 istrivialwhenallelementsareinX.Weshowtworelevantcases. Asexplainedin[7],connectedK4-freegraphscorrespondtoterms ((α⋄β)·u)·(γ⋄δ)=(α⋄dom(u◦β))·(γ⋄δ) overthesignatureΣdom,where⊤isnolongerpresent,anddom() becomesaprimitiveoperation.Itwashoweverleftopenwhether =α⋄δ isomorphismsofsuchgraphscouldbefinitelyaxiomatisedover (α⋄β)·(u·(γ⋄δ))=(α⋄β)·(dom(uγ)⋄δ) thissyntax.Weanswerthisquestionbytheaffirmative. ((α⋄β)·u)·v =(α⋄dom(u◦β))·v Definition37. A2pdom-algebraisaΣdom-algebrasatisfyingthe =α⋄dom(v◦dom(u◦β)) axioms(A1-A8)fromFigure4except(A3),andtheaxiomsinFig- ure8.Wewrite⊢2pdomu =vwhentwotermsuandvarecongru- =α⋄dom(v◦u◦β) (by(A13)) entmodulothoseaxioms. (α⋄β)·(u·v)=(α⋄β)·uv □ 9

Description:
Allegories were introduced by Freyd and Scedrov; they form a frag- ment of Tarski's calculus of relations. We show that their equational theory is
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.