The Structure of First-Order Causality
Game semantics describe the interactive behavior of proofs by interpreting formulas as games on which proofs induce strategies. Such a semantics is introduced here for capturing dependencies induced by quantifications in first-order propositional log…
Authors: Samuel Mimram (PPS)
The Structur e of First-Order Causality Samuel Mimram CNRS – Univ ersité P aris Diderot samuel.mim ram@pps.ju ssieu.fr Abstract Game semantics describe the interactive beha vior of pr oofs by interpreting formulas as g ames on which pr oofs induce str ategies. S uch a semantics is intr oduced her e for capturing dependencies in duced by quantificatio ns in first- or der pr oposition al logic. One of th e main d ifficulties th at has to be fac ed during the elabo ration of this kind of sema n- tics is to char acterize d efinable strate gies, that is str ategies which actually behave like a pr oof. This is usu ally d one by r estricting the mode l to strate gies satisfying subtle com- binatorial conditions, whose pr eservation under composi- tion is often difficult to show . Here , we present an original methodology to achieve this task, which requir es to co m- bine advan ced tools fr om ga me semantics, r ewriting theory and ca te gorical algebr a. W e intr oduce a diagrammatic pre- sentation of the monoid al cate gory of definable strate g ies of our model, by the means of generators an d r elations: th ose strate g ies can be generated fr o m a finite set of atomic strate- gies and the equality between str ategies admits a finite ax- iomatization, this equation al structure corresponding to a polarized variation o f the notion of bialgebra. This work thus bridges algebra and denotational semantics in or der t o r eveal the structure of depen dencies induced by first-or der quantifi ers, and lays the foundations for a mechanized a na- lysis of causality in pr ogramming languages. Denotationa l semantics were introduced to pr ovide use- ful abstract inv ariants of proo fs and programs modu lo cu t- elimination or r eduction . In particular , game sem antics, in- troduced in the nineties, have b een very successful in c ap- turing precisely the interac ti ve behavior of pr ograms. In these semantics, ev ery type is interp reted as a game (that is as a set of moves that can be play ed dur ing the gam e) together with th e rules of the game (forma lized by a partial order on the moves of the game in dicating the dependencies between them). Every move is to be played by one of the two play ers, called Pr opo nent and Opponent , who should be th ought respecti vely as t he progr am and its en viro nment. A pr ogram is ch aracterized by the sequen ces of moves that it can exchange with its en viron ment durin g an execution and thus d efines a str ategy reflecting the interactive behav- ior o f th e program inside the game specified by the type of the progra m. The notion of p ointer game , introduced b y Hyland and Ong [3], gave one of the fir st fully abstract models of PCF (a simp ly-typed λ -calcu lus extended with recursion , con- ditional branchin g and arithmetical constants). It h as re- vealed that PCF pro grams gener ate strategies with partial memory , called in nocent becau se they r eact to Opponen t moves according to their own view o f th e play . Innocen ce is in this setting th e main ing redient to ch aracterize d efinab le strategies, that is strategies which ar e the in terpretation of a PCF ter m, b ecause it describes the beh avior of the purely function al co re of the lang uage (i.e. λ -terms), which also correspo nds to proo fs in pr opositional logic. This semin al work has lead to an extremely su ccessful series of seman- tics: by relaxin g in various ways th e inno cence constraint on st rategies, it became sudden ly p ossible to generalize this characterizatio n to PCF pro grams extended with imper ativ e features such as references, control, non-deter minism, etc. Unfortu nately , these constraints are quite specific to game semantics and r emain difficult to link with other ar - eas of comp uter science or algebra. They are moreover very sub tle and combinato rial and thus sometimes difficult to work with. This w or k is a n attempt to find new ways to describe the behavior of proofs. Generating instead o f r estricting. In th is p aper, we intro- duce a ga me semantics capturing d ependen cies induced by quantifiers in first-order proposition al log ic, form ing a strict monoid al category called Games . I nstead of character iz- ing definable strategies of th e model by restricting to strate- gies satisfying particular conditions, we show here that we can e quiv alently use here a kin d of con verse app roach. W e show how to generate d efinable strategies b y giving a pre- sentation of th ose strategies: a finite set of definable strate- gies can be used to generate all definable strate gies by com- position and tensor ing, and the equ ality between strategies obtained this way can be finitely axiomatized. What we mea n p recisely by a presentation is a gen- eralization o f the usual notion of presentation o f a mo- noid to monoidal categor ies. For example, conside r th e 1 additive m onoid N 2 = N × N . It admits th e presenta- tion h p, q | qp = pq i , where p a nd q ar e two generators and q p = pq is a relation between two elements of the free monoid M o n { p, q } . This mean s that N 2 is isomorphic to the f ree mon oid M on the two gen erators, quo tiented by the smallest congruen ce ≡ (wrt multiplica tion) such th at q p ≡ pq . More generally , a (strict) monoidal category C (such as Games ) can be presented by a polygraph , con - sisting o f typed gener ators in dim ension 1 and 2 and rela- tions in dimension 3 , such that the category C is monoid ally equiv alent to the f ree m onoidal category on the generator s, quotiented by the congru ence gen erated by the relations. Reasoning locally . The usefuln ess of our constru ction is both theoretic a nd practical. It rev eals that the essential al- gebraic stru cture o f de penden cies induced by quantifier s is a polarized v ariatio n of the well-k nown structure of bialge bra, thus bridging gam e sem antics a nd algebra. It also proves very useful from a technical point o f view: this presentation allows us to reason locally about strategies. In particular, it enables u s to deduce a posterior i that th e strategies of the category Games are d efinable (o ne only needs to c heck that gener ators are definable) and that these strategies actu- ally co mpose, which is n ot trivial. Finally , the pr esentation giv es a fin ite description of the category , that we can hope to manipulate with a computer, paving the way for a series of new to ols to automate th e study o f semantics o f program - ming languages. A g ame semantics capturing first-order causalit y . Gam e semantics h as revealed that proofs in logic describ e particu - lar strategies to explore form ulas. Nam ely , a fo rmula A is a syn tactic tree expressing in which o rder its connectives must be introduced in cut-f ree pro ofs of A . In this sense, it can be seen as the ru les of a game whose moves corr espond to co nnectives. For instance, consider a formula of the fo rm ∀ x.P ⇒ ∀ y . ∃ z .Q (1) where P and Q are propo sitional f ormulas which may con- tain fre e variables. Wh en search ing f or a pr oof of (1), th e ∀ y quantification must be introduced before the ∃ z quan- tification, and the ∀ x quantification can be introduced in- depend ently . Here, introducing an e xistential quan tification should be th ought as playing a Propo nent move (the strat- egy gi ves a witness for which the fo rmula holds) and in tro- ducing an un i versal quan tification as playing an Oppon ent move (the strategy r eceiv es a term from its environment, for which it has to sh ow that the formula holds). So, th e game associated to th e for mula (1) will be the partial order on th e fir st-order quantificatio ns appearin g in the f ormula, depicted below (to be read fr om the top to the bottom): ∀ x ∀ y ∃ z T o un derstand exactly which depe ndencies induced by proof s are interesting , we sh all examine proof s of the for- mula ∃ x.P ⇒ ∃ y .Q , which induces the following game: ∃ x ∃ y By perm uting the order o f intro duction r ules, the pro of o f this formu la on th e left-hand side of π P ⊢ Q [ t/y ] P ⊢ ∃ y .Q ∃ x.P ⊢ ∃ y .Q π P ⊢ Q [ t/y ] ∃ x.P ⊢ Q [ t/y ] ∃ x.P ⊢ ∃ y .Q might be reorganize d as the proof on th e right-hand side if and only if the term t used in th e introduction r ule o f the ∃ y connective does not h av e x as free variable. If the variable x is free in t th en the ru le introducing ∃ y can only be used after the ru le intro ducing the ∃ x connective. In this ca se, it will be reflected by a causal dep endency in the strategy correspo nding to th e proof, depicted by an oriented wire: ∃ x ∃ y and we som etimes say that the move ∃ x justifies the move ∃ y . A simple further stud y o f p ermutability of in- troductio n rules o f first-or der quan tifiers shows that this is the o nly kind of rele vant dep endenc ies. These permutations of ru les wh ere the motiv ation for the introd uction of n on- alternating asynchro nous game sema ntics [12]. Howe ver , we focus here on cau sality and define strategies by the de- penden cies they induce on moves. W e thu s build a strict mono idal category whose ob jects are game s and whose morp hisms are strategies, in which we can interpret formu las and proof s in first-order pro posi- tional logic, and write Games for the subcategory o f de- finable strategies. This paper is de voted to the construction of a pr esentation fo r th is category . W e intro duce formally the notion of presentation of a mon oidal categor y in Sec- tion 1 and recall some useful classical a lgebraic structu res in Section 2. Th en, we give a presenta tion of the categor y of relations in Section 3 and extend th is presen tation to the category Games , that we define formally in Section 4. 1 Pr esentations o f monoidal categories For the lack o f space, we d on’t recall here the b asic def- initions in category theory , such as the definitio n of mon oi- dal categories. The interested read er can find a presentation of these concepts in MacLane’ s reference book [11]. Monoidal theo ries. A monoida l theory T is a strict m o- noidal category who se objects are the natur al inte ger s, such that the ten sor pro duct on obje cts is the addition of in - tegers. By an integer n , we mean here the finite or di- nal n = { 0 , 1 , . . . , n − 1 } and the add ition is gi ven b y m + n = m + n . An a lgebra F of a mo noidal theory T 2 in a strict monoida l category C is a strict m onoidal func- tor fr om T to C ; we write Alg C T for th e c ategory o f alge- bras f rom T to C and m onoidal n atural transformation s be- tween them. Mo noidal the ories are som etimes called PR O, this terminolo gy w as in troduce d b y Mac Lane in [1 0] as an abbreviation fo r “category w ith prod ucts”. Th ey ge neral- ize equational theories (or Lawere t heo ries [9]) in the sense that operations ar e ty ped an d can mo reover h av e multiple outputs as well as m ultiple inputs, and are no t n ecessarily cartesian b ut o nly monoidal. Presentations of monoidal categories. W e now recall the notion of presentation of a m onoida l category b y the means of typed 1- and 2-dimension al gen erators and relations. Suppose that we ar e giv en a set E 1 whose elements are called ato mic typ es . W e write E ∗ 1 for the f ree mo noid on the set E 1 and i 1 : E 1 → E ∗ 1 for the cor respond ing injec- tion; the pro duct of this monoid is written ⊗ . The elements of E ∗ 1 are called typ es . Supp ose m oreover that we are given a set E 2 , whose elemen ts are called generators , together with two f unctions s 1 , t 1 : E 2 → E ∗ 1 , which to ev ery gen- erator associate a type called respectively its sour ce and tar- get . W e call a signatur e such a 4-uple ( E 1 , s 1 , t 1 , E 2 ) : E 1 i 1 / / E ∗ 1 E 2 s 1 o o t 1 o o Every such sig nature ( E 1 , s 1 , t 1 , E 2 ) generates a free strict monoid al category E , who se objects are the elements of E ∗ 1 and whose mo rphisms are for mal co mposite and tensor produ cts of elements of E 2 , quotiented by suitable laws im- posing associati vity of composition and ten sor an d compat- ibility of c omposition with tensor, see [2]. If we wr ite E ∗ 2 for the mo rphisms of this c ategory and i 2 : E 2 → E ∗ 2 for the injection of th e gener ators into this category , we g et a diagram E 1 i 1 E 2 s 1 ~ ~ } } } } } } } } } } t 1 ~ ~ } } } } } } } } } } i 2 E ∗ 1 E ∗ 2 s 1 o o t 1 o o in Set together with a structure of monoid al category E on the graph E ∗ 1 E ∗ 2 s 1 o o t 1 o o where the morphisms s 1 , t 1 : E ∗ 2 → E ∗ 1 are the mo rphisms (uniqu e by un i versality of E ∗ 2 ) such that s 1 = s 1 ◦ i 2 and t 1 = t 1 ◦ i 2 . The size | f | o f a morphism f : A → B in E ∗ 2 is defined inductively by | id | =0 | f | =1 if f is a gener ator | f 1 ⊗ f 2 | = | f 1 | + | f 2 | | f 2 ◦ f 1 | = | f 1 | + | f 2 | In particular, a m orphism is of size 0 if and only if it is an identity . Our con structions are a particu lar case of Burr oni’ s po ly- graphs [2] (an d Street’ s 2- computad s [15]) wh o ma de pre- cise the sense in which the generated monoidal category is free on th e signature. In particular, the following notion of equationa l theory is a specializatio n of the definition of a 3-poly graph to th e case where there is only one 0-cell. Definition 1. A mo noidal equational theory is a 7-uple E = ( E 1 , s 1 , t 1 , E 2 , s 2 , t 2 , E 3 ) wher e ( E 1 , s 1 , t 1 , E 2 ) is a signatur e together with a set E 3 of relations and two morphisms s 2 , t 2 : E 3 → E ∗ 2 , as pic- tur ed in the diagram E 1 i 1 E 2 s 1 ~ ~ } } } } } } } } } } t 1 ~ ~ } } } } } } } } } } i 2 E 3 s 2 ~ ~ } } } } } } } } } } t 2 ~ ~ } } } } } } } } } } E ∗ 1 E ∗ 2 s 1 o o t 1 o o such that s 1 ◦ s 2 = s 1 ◦ t 2 and t 1 ◦ s 2 = t 1 ◦ t 2 . Every equation al theory defines a mo noidal category E = E / ≡ obtained from th e m onoidal category E gen- erated b y the signature ( E 1 , s 1 , t 1 , E 2 ) by q uotienting the morph isms by the con gruence ≡ gen erated by the relations of th e equ ational theo ry E : it is the smallest c ongru ence (wrt both comp osition and tenso ring) such that s 2 ( e ) ≡ t 2 ( e ) fo r ev ery element e of E 3 . W e say that a m onoidal equational theory E is a presentation of a strict monoidal categor y M when M is mono idally equiv alent to the categor y E gen er- ated by E . W e som etimes in formally say that an equatio nal theory has a gen erator f : A → B to me an that f is an element of E 2 such that s 1 ( f ) = A and t 1 ( f ) = B . W e also say that th e equational theory ha s a relation f = g to mean that there exists an element e of E 3 such that s 2 ( e ) = f and t 2 ( e ) = g . It is rem arkable that every mo noidal equational theory ( E 1 , s 1 , t 1 , E 2 , s 2 , t 2 , E 3 ) where th e set E 1 is r educed to only on e object { 1 } genera tes a monoid al category wh ich is a mono idal th eory ( N is the fre e monoid on one object), thus giving a notion of presentation of those cate go ries. Presented c ategorie s as models. Suppose that a strict monoid al category M is p resented b y an equation al the- ory E , generating a category E = E / ≡ . The proo f that E presents M can generally be decomp osed in tw o parts: 1. M is a model of the equatio nal theory E : there exists a functor e − from the categor y E to M . This amounts to checking that there exists a func tor F : E → M such that for all morphisms f , g : A → B in E , f ≡ g implies F f = F g . 2. M is a fully-co mplete mo del of the equatio nal theo ry E : th e functor e − is full and faithful. W e say that a m orphism f : A → B o f E r epr esents the morph ism e f : e A → e B of M . 3 Usually , the first point is a straightfo rward verification . Proving that the f unctor e − is full and faithful often r equires more w or k. In this paper, we use the method ology intro- duced by Burron i [2] and refined by Lafont [8]. W e first define can onical forms which are canon ical representatives of the equi valence classes of morphisms of E un der the con - gruenc e ≡ generated b y th e relations of E . Proving that ev ery m orphism is equal to a cano nical form ca n be done by ind uction on the size of th e morphisms. Then, we show that the fun ctor e − is full and faithful by showing that the canonical forms are in bijection with the morphisms of M . It should be noted that this is not the only techn ique to prove that an equation al theory pr esents a monoid al cate- gory . In p articular, Joyal and Street h av e used topo logi- cal method s [5] by gi ving a g eometrical construction of the category generated by a signatu re, in which morp hisms are equiv alence classes under continuou s defor mation of pro- gressiv e plan e diagrams (we give some more details abo ut those diagrams, also called string diagrams, l ater on). Th eir work is for examp le extended b y Baez and L angfor d in [1] to giv e a presentation of the 2-category of 2-tang les in 4 di- mensions. T he other g eneral methodology the author is aware of, is giv en by Lack in [6], by constructing elab- orate monoidal theories from simpler monoidal theories. Namely , a m onoidal theory can be seen as a mon ad in a particular span bicategory , and m onoidal theo ries can there- fore be “co mposed” given a distributiv e law b etween their correspo nding monads. W e ch ose not to use those metho ds because, e ven th ough the y can be very h elpful to build in tu- itions, they are difficult to fo rmalize and even m ore to mech - anize. String diagra ms. String diagrams provide a convenient way to rep resent an d m anipulate the morphisms in the cat- egory generated by a presentatio n. Given an object M in a strict mo noidal category C , a morphism µ : M ⊗ M → M can be drawn grap hically as a d evice with two inpu ts and one output of type M as follows: M µ M M or simply as M M M when it is c lear from the context which m orphism o f typ e M ⊗ M → M we are picturing (we sometimes ev en omit the source and target of the mor phisms). Similarly , the iden- tity id M : M → M (which we sometimes simply wr ite M ) can be pictured as a wire M M The tensor f ⊗ g of two morphisms f : A → B and g : C → D is o btained by p utting the diagr am corr espond- ing to f above the diag ram correspondin g to g . So, fo r in- stance, the morph ism µ ⊗ M can be drawn diag rammatically as M M M M M Finally , the co mposite g ◦ f : A → C o f two morphisms f : A → B and g : B → C can be drawn diag rammatically by putting the diagram correspo nding to g at the right of the diagram co rrespon ding to f an d “link ing the wires”. The diagram cor respond ing to the morp hism µ ◦ ( µ ⊗ M ) is thus M M M M Suppose that ( E 1 , s 1 , t 1 , E 2 ) is a signature. Every ele- ment f of E 2 such that s 1 ( f ) = A 1 ⊗ · · · ⊗ A m and t 1 ( f ) = B 1 ⊗ · · · ⊗ B n where th e A i and B i are eleme nts of E 1 , can be similar ly represented by a diagram A 1 B 1 A 2 B 2 . . . f . . . A m B n Bigger diag rams can be constructed fr om these diagrams by composin g and tensor ing the m, as expla ined ab ove. Joyal and Street ha ve shown in details in [5] that the category o f those diagram s, mo dulo co ntinuou s deform ations, is p re- cisely the f ree c ategory gen erated b y a signatur e (w hich they call a “tensor scheme”). For example, the equality ( M ⊗ µ ) ◦ ( µ ⊗ M ⊗ M ) = ( µ ⊗ M ) ◦ ( M ⊗ M ⊗ µ ) in the category C of the above examp le, which hold s becau se of the axioms satisfied in any m onoidal category , can be shown by continuo usly defo rming the diagr am on the left- hand side below in to the diagram on the right-han d side: M M M M M M = M M M M M M All the equalities satisfied in any monoid al category gen- erated by a signature have a similar geo metrical interp reta- tion. And conversely , any def ormation o f diagram s corre- sponds to an equality of mor phisms in monoid al categories. 2 Algebraic structur es In this section, we re call th e categorical fo rmulation of some well-k nown a lgebraic structu res. W e give those def- initions in the setting of a strict mono idal category which is not required to be symmetric. W e suppose that ( C , ⊗ , I ) 4 is a strict mon oidal category , fixed thr ougho ut the section. For the lack of space, we will only giv e grap hical represen- tations of axioms, b ut they can alw ays be refor mulated as commutative diagr ams. Symmetric o bjects. A symmetric ob ject of C is an object S together with a morphism γ : S ⊗ S → S ⊗ S called symmetry and pictured as S S S S (2) such that the two equalities = = hold (th e first equation is sometimes called the Y ang-Baxter equation for b raids). In particular, in a sym metric monoidal category , every object is canonically equipped with a struc- ture of symmetric object. Monoids. A mo noid ( M , µ, η ) in C is an o bject M tog ether with two morphisms µ : M ⊗ M → M and η : I → M called respectively multiplicatio n an d unit and pictured re- spectiv ely as M M M and M (3) satisfying the three equations = = = (4) A symmetric mon oid is a monoid which adm its a sym- metry γ : M ⊗ M → M ⊗ M which is compatible with the operation s of the mon oid in the sense that the equalities = = (5) are satisfied, as well as t he equ ations o btained by tu rning the diagrams upside-down. A commuta tive mono id is a sym- metric monoid such that the equality = is satisfied. I n particular, a commutative monoid in a sym- metric monoida l category is a commu tativ e mo noid whose symmetry correspo nds to the symmetry of the category: γ = γ M ,M . In this case, the equatio ns ( 5) can always be deduced from the naturality o f the sym metry of the monoi- dal category . A comonoid ( M , δ, ε ) in C is an object M togethe r with two morphisms δ : M → M ⊗ M and ε : M → I respectively drawn as M M M and M (6) satisfying dual coher ence diagrams. Similarly , the n otions symmetric como noid and coco mmutative com onoid can be defined by duality . The definition of a mo noid ca n be reform ulated inter- nally , in the langu age of equational theories: Definition 2. Th e equational theor y o f monoids M has one object 1 and two generators µ : 2 → 1 and η : 0 → 1 subject to the thr ee r elation s µ ◦ ( µ ⊗ id 1 ) = µ ◦ (id 1 ⊗ µ ) µ ◦ ( η ⊗ id 1 ) = id 1 = µ ◦ (id 1 ⊗ η ) (7) The equations (7) are the algebraic fo rmulation of the eq ua- tions ( 4). If we write M for the mo noidal c ategory gen- erated b y the equa tional theory M , th e algebras of M in a strict mo noidal category C are precisely its monoids: th e category Alg C M of algebras of the mon oidal theory M in C is mo noidally eq uiv alent to the category o f mon oids in C . Similarly , all the algebraic struc tures introduced in this sec- tion can be defined using algebraic theories. Bialgebras. A bialgebra ( B, µ, η , δ, ε , γ ) in C is an object B togeth er with four morphisms µ : B ⊗ B → B η : I → B δ : B → B ⊗ B ε : B → I and γ : B ⊗ B → B ⊗ B such that γ : B ⊗ B → B ⊗ B is a symmetry f or B , ( B , µ, η , γ ) is a symmetric m onoid a nd ( B , δ, ε, γ ) is a sym - metric comon oid. Th e mor phism γ is thu s p ictured as in (2), µ and η as in (3), and δ and ε as in (6). Tho se two stru ctures should be coherent, in the sense that the four equalities 5 = = = = should be satisfied. A bialgebr a is commu tative (resp. cocommutative ) when the in duced sy mmetric monoid ( B , µ, η , γ ) ( resp. symmet- ric como noid ( B , δ, ε, γ ) ) is co mmutative (resp . cocommu- tati ve), an d bicommutative when it is both comm utativ e and cocommu tativ e. A bialgebra is qualitative whe n the follo w- ing equality holds: = W e wr ite B for the eq uational theory of bicom mutative bialgebras and R for the equatio nal th eory o f qualitati ve bi- commutative bialgeb ras. Dual objects. An objec t L of C is said to be left du al to an object R when there exists two morphisms η : I → R ⊗ L and ε : L ⊗ R → I called respecti vely the unit and the coun it of the duality an d respectively pictured as R L and L R such that the two morphisms L L and R R are equ al to the identities on L and R respectively . W e write D for th e equ ational the ory associated to du al objects. 3 Pr esenting the category o f r elations W e no w introdu ce a presentation o f the cate gor y Rel of finite ord inals an d r elations, by refinin g p resentations of simpler categories. This resu lt is mention ed in Examples 6 and 7 of [ 4] and is proved in th ree different ways in [ 7], [1 4] and [6]. The metho dology ad opted here to b uild this presen - tation has the ad vantage of being simple to check (although very rep etiti ve) a nd can be extend ed to give th e presenta- tion of the categor y of g ames a nd strategies describ ed in Section 4 . F or the lack of sp ace, most of the p roofs h av e been om itted or only sketched; detailed proofs can be fou nd in the author’ s PhD thesis [13]. The simplicial ca tegory . The simplicial category ∆ is the monoid al theory wh ose morph isms f : m → n ar e the monoto ne fun ctions from m to n . It has been known fo r a long time that this category is closely related to the n otion of mono id, see [1 1] or [8] for examp le. This result can be formu lated as f ollows: Property 3. The mono idal cate gory ∆ is pres ented by th e equation al th eory of monoids M . In th is sense, the simplicial category ∆ impersona tes th e no- tion of mo noid. W e extend he re this result to more com plex categories. Multirelations. A mu ltir elation R between two fin ite sets A and B is a function R : A × B → N . It can be equiv alently be seen as a multiset whose elements ar e in A × B or as a matrix ov er N (or as a span in the category of finite sets). If R 1 : A → B and R 2 : B → C are two mul- tirelations, their composition is defined by R 2 ◦ R 1 ( a, c ) = X b ∈ B R 1 ( a, b ) × R 2 ( b, c ) . (this corresponds to the usual compo sition of matrices if we see R 1 and R 2 as matrice s over N ). The car dinal | R | o f a multirela tion R : A → B is the sum of its c oefficients. W e write MR el fo r the monoidal theory of multirelation s: its objects are finite o rdinals and morp hisms are multirela- tions b etween them . It is a strict sy mmetric mo noidal cate- gory with the tensor product ⊗ defined on o bjects and mor- phisms by d isjoint union, and thus a monoidal theory . In this catego ry , the object 1 can be equipped with the o bvi- ous bicom mutative bialgeb ra structure (1 , R µ , R η , R δ , R ε ) . For example, R µ : 2 → 1 is the multirela tion defined by R µ ( i, 0) = 1 for i = 0 o r i = 1 . W e now show that the cat- egory o f multirelation s is p resented by th e e quational th e- ory B of bicomm utativ e b ialgebras. W e write B / ≡ for th e monoid al categor y generated by B . For ev ery morph ism φ : m → n in B , where m > 0 , we define a morphism S φ : m + 1 → n by S φ = φ ◦ ( γ ⊗ id m − 1 ) (8) The stairs mor phisms are d efined inductively as either id 1 or S φ ′ where φ ′ is a stair , and are r epresented g raphically as . . . . . . The length of a stairs is defin ed as 0 if it is an identity , o r as the length of the stairs φ ′ plus one if it is of the form S φ ′ . 6 Morphisms φ which are pr ecanon ical forms are defined inductively: φ is eith er empty or . . . . . . . . . φ ′ . . . or . . . φ ′ . . . or . . . φ ′ . . . where φ ′ is a precanonical form. In this case, we write respectively φ as Z (the identity morphism id 0 ), as W i φ ′ (where i is th e length of the stairs in the morphism), as E φ ′ or as H φ ′ . Prec anonical forms φ are thu s the well form ed morph isms (whe re co mpositions respect typ es) generated by the following gr ammar: φ ::= Z | W i φ | E φ | H φ (9) It is easy to see that every non-identity morphism φ o f a category gen erated b y a mo noidal equation al theor y (such as B ) can be written as φ = φ ′ ◦ ( m ⊗ π ⊗ n ) , where π is a gene rator, thus allowing us to reason indu ctiv ely ab out morph isms, by c ase analysis on th e integer m and on the generato r π . Usin g this technique, we can prove that Lemma 4. Every mo rphism φ of B is equiv alent (wrt th e r elation ≡ ) to a pr ecan onical form. The canonical forms are precanon ical for ms wh ich are normal wrt the following r ewriting system: H W i = ⇒ W i +1 H H E = ⇒ E H W i W j = ⇒ W j W i when i < j (10) when co nsidered as words g enerated b y th e grammar (9). This rewriting system can easily b e shown to be terminating and confluent, and mo reover two m orphisms φ and ψ such that φ = ⇒ ψ can be shown to be e quiv alent. By Lemma 4, ev ery m orphism of B is therefore eq uiv alent to an unique canonical form. Lemma 5. Every multirelation R : m → n is r epr esented by an unique canonical form. Pr o of. W e prove by induction on m and on the cardin al | R | of R that R is r epresented by a precanon ical f orm. 1. If m = 0 then R is represen ted by the can onical fo rm H . . . H Z ( with n occurr ences of H ). 2. If m > 0 and for every j < n , R (0 , j ) = 0 then R is of the form R = R ε ⊗ R ′ and R is necessarily rep resented by a precanon ical fo rm E φ ′ where φ ′ is a precanonic al form r epresenting R ′ : ( m − 1) → n , obtained by induction hypothe sis. 3. Otherwise, R is ne cessarily represented by a precano n- ical fo rm of the form W k φ ′ , wh ere k is the gr eatest index such that R (0 , k ) > 0 and φ ′ is a pr ecanonical form, o btained by indu ction, represen ting the relation R ′ : m → n defin ed by R ′ ( i, j ) = ( R ( i, j ) − 1 if i = 0 and j = k , R ( i, j ) otherwise. It can be moreover shown that e very prec anonical for m rep- resenting R correspond s to such an en umeratio n of the co- efficients of R , that the precanonical fo rm constructed by the proo f above is can onical, and that it is the only way to obtain a precano nical form r epresenting R . Finally , we can dedu ce that Theorem 6. The category M Rel of multir elations is pre- sented by th e equ ational theo ry B of bico mmutative bialge- bras. Relations. The monoidal ca tegory Rel has finite ordinals as objects an d relations as mor phisms. This category c an be obtained from MRel by quo tienting the morphisms by the equiv alenc e relation ∼ on multirelatio ns such tha t two multirelations R 1 , R 2 : m → n are eq uiv alent wh en they have the same nu ll coefficients. W e can th erefore easily adapt the previous p resentation to show that Theorem 7. The cate gory Rel of r elation s is p r esented by the eq uationa l theory R o f qualitati ve bicommu tative bial- gebras. In particular, precano nical for ms are the same an d can onical forms are defined by adding the ru le W i W i = ⇒ W i to the rewriting sy stem (10). 4 A game semantics for first-order causality Suppose that we are gi ven a fixed first-ord er langu age L , that is a set of pro position symbo ls P, Q , . . . with given ar - ities, a set of function symbols f , g , . . . with given arities and a set of first-order variables x, y , . . . . T erms t and fo r - mulas A are respecti vely ge nerated b y the following gram- mars: t ::= x | f ( t, . . . , t ) A ::= P ( t, . . . , t ) | ∀ x.A | ∃ x.A (we only consider formulas witho ut connectives here). W e suppose that applicatio n of propo sitions a nd function s al- ways respec t arities. Formulas are considered m odulo re - naming of bo und variables and sub stitution A [ t/x ] of a free variable x by a term t in a formula A is defined as usual, av oiding captur e o f variables. I n the fo llowing, we some - times omit the arguments of proposition s when they are clear fr om th e context. W e also sup pose g i ven a set Ax of 7 axioms , that is p airs of pr opositions, which is reflexi ve, tra n- siti ve and closed under substitution. The logic associated to these formulas has the following inf erence rules: A [ t/x ] ⊢ B ∀ x.A ⊢ B ( ∀ -L) A ⊢ B A ⊢ ∀ x.B ( ∀ -R) (with x no t free in A ) A ⊢ B ∃ x.A ⊢ B ( ∃ -L) A ⊢ B [ t/x ] A ⊢ ∃ x.B ( ∃ -R) (with x not free in B ) ( P, Q ) ∈ Ax P ⊢ Q (Ax) A ⊢ B B ⊢ C A ⊢ C (Cut) Games and strategies. Games are defined as follows. Definition 8. A game A = ( M A , λ A , ≤ A ) consists of a set of moves M A , a polarization function λ A fr o m M A to {− 1 , +1 } which to every move m assoc iates its polar- ity , and a well-foun ded partial or der ≤ A on moves, called causality or justification . A move m is said to be a P r o - ponen t move when λ A ( m ) = +1 and an Oppo nent move otherwise. If A and B ar e tw o games, their tensor pr oduct A ⊗ B is defined by disjoint union on moves, po larities and cau sality , the opposite game A ∗ of the game A is obtained from A b y in verting p olarities and the arrow game A ⊸ B is defined by A ⊸ B = A ∗ ⊗ B . A game A is filiform when the associated partial order is total (we are mo stly interested in such games in the following). Definition 9 . A strategy σ on a game A is a partial or- der ≤ σ on the moves o f A which satisfies the two following pr operties: 1. polarity : for e very pair of moves m, n ∈ M A such that m < σ n , we have λ A ( m ) = − 1 and λ A ( n ) = + 1 . 2. acyclicity : the partial or de r ≤ σ is compatible with the partial or d er of the game, in the sense that the transi- tive closur e of their union is still a partial or der (i.e . is acyclic). The size | A | of a game A is the cardinal of M A and the size | σ | of a strategy σ : A is the cardin al of the relation ≤ σ . If σ : A ⊸ B an d τ : B ⊸ C are two strategies, their c om- posite τ ◦ σ : A ⊸ C is th e partial o rder ≤ τ ◦ σ on the mov es of A ⊸ C , defined as the restriction of the transitive closu re of the unio n ≤ σ ∪ ≤ τ of the partial orders ≤ σ and ≤ τ (con- sidered as re lations). The identity strategy id A : A ⊸ A on a game A is th e strategy such that f or every move m o f A we have m L ≤ id A m R if λ A ( m ) = − 1 and m R ≤ id A m L if λ A ( m ) = + 1 , wh ere m L (resp. m R ) is the instance of a move m in th e lef t-hand side (re sp. right-hand side) copy of A . Since co mposition of strategies is defined in the category of relations, we still hav e to ch eck th at the co mposite of two strategies σ and τ is actually a strategy . Th e preserva- tion by composition of the polarity con dition is imme diate. Howe ver , p roving that the relation ≤ τ ◦ σ correspo nding to the com posite strategy is acyclic is mo re difficult: a direct proof of this proper ty is combinator ial, leng thy and req uires global reasoning abou t strategies. For now , we d efine the category Games as the category who se o bjects are finite filiform games, a nd whose sets of morphisms are the small- est sets con taining the strategies on the game A ⊸ B as morph isms between two objects A and B and are mo reover closed under composition. W e will deduce at the end of the section, from its presentatio n, that strategies are in fact the only morphisms of this category . If A an d B are tw o games, the game A 4 B (to be read A before B ) is the game defined as A ⊗ B o n moves and polarities and ≤ A 4 B is the transitive closure o f the relation ≤ A ⊗ B ∪ { ( a, b ) | a ∈ M A and b ∈ M B } This operation is extended as a bifun ctor on strategies a s follows. If σ : A → B a nd τ : C → D are two strategies, the strategy σ 4 τ : A 4 C → B 4 D is defined as th e re- lation ≤ σ 4 τ = ≤ σ ⊎ ≤ τ . This bifun ctor induce s a mono idal structure ( Games , 4 , I ) on the category Games , where I denotes the empty game. W e write O for a game with only one Opponent move and P fo r a gam e with only on e Proponen t mov e. It can be easily remarked that finite filifo rm games A are gener ated by the following gr ammar A ::= I | O 4 A | P 4 A A strategy σ : A → B is r epresented graphically b y d raw- ing a line from a m ove m to a m ove n whenever m ≤ σ n . For example, the strategy µ P : P 4 P → P P P P is the strategy on the ga me ( O 4 O ) ⊗ P in which both Oppone nt move of the left- hand g ame j ustify the Proponent move of th e right-h and gam e. When a m ove does no t ju stify (or is not justified by) any other move, we dr aw a line en ded by a small circle. For example, the strategy ε P : P → I , drawn as P is the unique s trategy from P to the terminal object I . W ith these conv ention s, we intro duce n otations for some mo r- phisms which are depicted in Figure 1. 8 µ O : O 4 O → O µ P : P 4 P → P η O : I → O η P : I → P δ O : O → O 4 O δ P : P → P 4 P ε O : O → I ε P : P → I γ O : O 4 O → O 4 O γ P : P 4 P → P 4 P η OP : I → O 4 P ε OP : P 4 O → I γ OP : P 4 O → O 4 P respectively drawn as O O O P P P O P O O O P P P O P O O O O P P P P O P P O P O O P Figure 1. Generators of the strategies. A g ame semant ics. A fo rmula A is interpreted as a filiform game J A K by J P K = I J ∀ x.A K = O 4 J A K J ∃ x.A K = P 4 J A K A cut-free p roof π : A ⊢ B is interpr eted as a strategy σ : J A K ⊸ J B K whose causality par tial order ≤ σ is de- fined as follows. For every Proponen t move P in terpreting a quantifier introduced by a rule which is either A [ t/x ] ⊢ B ∀ x.A ⊢ B ( ∀ -L) or A ⊢ B [ t/x ] A ⊢ ∃ x.B ( ∃ -R) ev ery Opponent m ove O interp reting an universal quantifi- cation ∀ x o n the righ t-hand side of a sequent, or an exis- tential quantification ∃ x on the left-han d side of a sequent, is suc h that O ≤ σ P whene ver the variable x is free in the term t . For example, a proof P ⊢ Q [ t/z ] (Ax) P ⊢ ∃ z .Q ( ∃ -R) ∃ y .P ⊢ ∃ z .Q ( ∃ -L) ∃ x. ∃ y .P ⊢ ∃ z .Q ( ∃ -L) is interpreted respectively by the strategies P P P P P P P P P (11) when the free variables of t are { x, y } , { x } or ∅ . An equational theory of strategies. W e can now in tro- duce the eq uational theory which will be sh own to present the category Ga mes . Definition 1 0. The eq uational theo ry of strategies is the equation al theo ry G with two atomic types O a nd P a nd thirteen generators depicted in F igure 1 such that • the Oppon ent s tructure ( O, µ O , η O , δ O , ε O , γ O ) (12) is a bicommutative qualitative bialgebra, • the Pr o ponen t structur e ( P , µ P , η P , δ P , ε P , γ P ) , as well as the morphism γ OP , are deduced fr om the Oppon ent structur e (12) by composition with the du ality morphisms η OP and ε OP (for example η P = ( ε O 4 id P ) ◦ η OP ). W e write G / ≡ for the mo noidal category generated by G . It can be notice d that the gene rators µ P , η P , δ P , ε P , γ P and γ OP are su perfluou s in this presentatio n (since they can be dedu ced from the Opp onent structure and dua lity). How- ev er, removin g them would seriou sly comp licate the proo fs. W e can n ow proceed as in Sectio n 3 to show that the theory G introdu ced in Definition 10 presents the cate- gory Games . First, in the category Game s with the mo- noidal structure in duced by 4 , the o bjects O and P can be canonically equipped with thirteen morphisms as shown in Figure 1 in order to form a model of the theory G . Con versely , we need to intro duce a notio n of canon ical form for the morphisms o f G . Stairs are defined similarly as b efore, but are now con structed from the th ree k inds of polarized crossings γ O , γ P and γ OP instead of simply γ in (8). The n otion of pr ecanonic al form φ is now defined inductively as shown in Figure 2, wher e the object X is either O or P and φ ′ is a pr ecanonical fo rm. These ca ses correspo nd respectiv ely to the productions of the f ollowing grammar φ ::= Z | A i φ | B i φ | W X i φ | E X φ | H X φ By ind uction o n th e size of morphisms, it can be shown that ev ery morp hism o f G is equiv alent to a precano nical form and a notion of cano nical f orm can be defined by ad apting the re writing system (10) into a norm alizing rewriting sys- tem for precanonic al forms. Finally , a reasoning similar to Lemma 5 shows that canonical fo rms are in bijection with morph isms of the ca tegory Ga mes . Theorem 11. The monoidal category Games (with the 4 tensor pr o duct) is pr esented by the equatio nal theory G . 9 φ is either empty or P . . . . . . . . . φ ′ O . . . or O . . . . . . . . . φ ′ P . . . or X . . . . . . X . . . φ ′ . . . or X . . . φ ′ . . . or X . . . φ ′ . . . Figure 2. Precanonical forms f or strategies. As a direct consequen ce of this T heorem, we deduce that 1. the composite of tw o strategies, in the sense of De fini- tion 9 , is itself a strategy (in par ticular , the acyclicity proper ty is p reserved by composition), 2. the strategies o f Games are definab le (when the set Ax of axioms is reaso nable en ough) : it is enou gh to check that g enerators are defin able – for example, the fir st case of (11) shows that µ P is definable. 5 Conclusion W e have constructed a game semantics for first-o rder propo sitional lo gic and giv en a presentation o f the c at- egory Games of g ames a nd definable strategies. This has re vealed the essential structure of c ausality induced by quantifiers as we ll as provided tech nical too ls to show de- finability and composition of strategies. W e co nsider this work much more as a starting po int to bridge semantics and alg ebra than as a final result. The methodo logy presented here seems to b e very general and many tracks remain to be explored . Fir st, we would like to extend the p resentation to a game sema ntics for r icher logic systems, con taining co nnectives ( such as conju nction or disju nction). Whilst we d o no t expect essential techni- cal com plications, th is ca se is much more difficult to grasp and manipulate, since a presentation of such a seman tics would ha ve generators u p to d imension 3 (one dimension is add ed since games would be trees instead of lines) and correspo nding diag rams w ou ld now live in a 3 -dimension al space. It would also b e interesting to kn ow wheth er it is possible to orient the equ alities in the p resentations in or- der to obtain strongly n ormalizing rewriting systems for the algebraic structures d escribed in the p aper . Such rewriting systems are given in [8] – f or monoids an d comm utativ e monoid s for example – b ut fin ding a strongly norm alizing rewriting system pr esenting the theory of bialgeb ras is a dif - ficult problem [13 ]. Finally , some of the pr oofs (such as the proof o f Lem ma 4) are very re petitiv e and we believe that they co uld be m echanically checked o r automated. How- ev er, fin ding a good repr esentation of mor phisms, in o rder for a p rogram to be ab le to manipulate them, is a difficult task that we should address in subsequent works. Acknowledgements. I would like to than k my PhD su- pervisor Paul-And ré Melliès as well as John Baez, Alber t Burroni, Yves Guira ud, Martin Hy land, Yves Lafon t and François Métayer f or the li vely discussion we h ad, during which I learned so much. Refer ences [1] J. Baez and L. L angford. Higher-dimensiona l algebra IV : 2-tangles. Advances in Mathematics , 1 80(2):705–764 , 2003. [2] A. Burroni. H igher-dimen sional w ord problems with appli- cations to equational logic. TCS , 115(1):43–62 , 1993. [3] M. Hyland and L. Ong . On Full Abstraction for P CF: I, II, III. Information and Computation , 163(2):285–4 08, 20 00. [4] M. Hyland and J. Po wer . S ymmetric Mon oidal Sketches. In Pr oceedings of PPDP’00 , pages 280–28 8, 2000. [5] A. Jo yal and R. S treet. The Geom etry of Tensor Calculus , I. Advances in Mathematics , 88:55–1 13, 1991. [6] S. Lack. Composing PR OPs. Theory and Applications of Cate gories , 13(9):147–1 63, 2004. [7] Y . Lafont. Equational Reasoning with 2-Dimensio nal Dia- grams. T erm Rewriting , pages 170–195 , 19 95. [8] Y . Lafont. T owards an Algebraic T heory of Boolean Cir- cuits. J. Pur e Appl. Algebra , 184(2-3 ):257–310, 2003. [9] F . W . Lawvere. Functorial Semantics of Algebra ic Theories and Some Algebraic Pr oblems in the context of Functorial Semantics of Algebr aic Theories . PhD the sis, 1963. [10] S. MacLane. Categorical Algebra. Bulletin of the American Mathematical Society , 71:40–10 6, 1965. [11] S. MacLane. Cate gories for the Working Mathematician . Graduate T exts in Mathema tics. Springer V erlag, 1971. [12] P .-A. Melliès and S. Mimram. Asynchronous Games: Inno- cence without Alternation. I n Pr oceedings of CONCUR’05 , volume 4 703 of LN CS , pages 395–4 11. Springer, 2007. [13] S. Mimram. S émantique des jeux asynchr ones et réécriture 2-dimensionnelle . PhD thesis, 2008. [14] T . Pirashvili. On the P R OP Corresponding to Bialgebras. Cah. T op. Géom. Diff. Cat. , 4 3(3):221–239, 2002. [15] R. St reet. Limits i ndex ed by category-v alued 2-functors. J . Pur e Appl. Algebr a , 8(2):149–181 , 19 76. 10
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment