• Aucun résultat trouvé

Stochastic mechanics of graph rewriting

N/A
N/A
Protected

Academic year: 2021

Partager "Stochastic mechanics of graph rewriting"

Copied!
12
0
0

Texte intégral

(1)

HAL Id: hal-01429645

https://hal.archives-ouvertes.fr/hal-01429645

Submitted on 12 Jan 2017

HAL

is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L’archive ouverte pluridisciplinaire

HAL, est

destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

Stochastic mechanics of graph rewriting

Nicolas Behr, Vincent Danos, Ilias Garnier

To cite this version:

Nicolas Behr, Vincent Danos, Ilias Garnier. Stochastic mechanics of graph rewriting. 31st Annual

ACM/IEEE Symposium on Logic in Computer Science, 2016, New-York City, United States. pp.46 -

55, �10.1145/2933575.2934537�. �hal-01429645�

(2)

banner above paper title

Stochastic mechanics of graph rewriting

Nicolas Behr

University of Edinburgh LFCS [email protected]

Vincent Danos

Ecole Normale Sup´erieure de Paris´ D´epartement d’informatique

[email protected]

Ilias Garnier

University of Edinburgh LFCS [email protected]

Abstract

We propose an algebraic approach to stochastic graph-rewriting which extends the classical construction of the Heisenberg-Weyl algebra and its canonical representation on the Fock space. Rules are seen as particular elements of an algebra of ‘diagrams’ (the di- agram algebraD). Diagrams can be thought of as formal computa- tional traces represented in partial time. They span a vector space which carries a natural filtered Hopf algebra structure. Diagrams can be evaluated to normal diagrams (each corresponding to a rule) and generate an associative unital (non-commutative)˚-algebra of rules (the rule algebraR). Evaluation becomes a morphism of uni- tal associative algebras which maps general diagrams inDto nor- mal ones inR. In this algebraic reformulation, usual distinctions between graph observables (real-valued maps on the set of graphs defined by counting subgraphs), and rules disappear. Instead, natu- ral algebraic substructures ofRarise: formal observables are seen as rules with equal left and right hand sides and form a commutative subalgebra, the ones counting subgraphs forming a sub-subalgebra of identity rules. Actual graph-rewriting (of the DPO type) is recov- ered as a canonicalrepresentationof the rule algebra as linear op- erators over the vector field generated by (isomorphism classes of) finite graphs. The construction of the representation is in close anal- ogy and subsumes the classical (multi-type bosonic) Fock space representation of the Heisenberg-Weyl algebra.

This subtle shift of point of view (away from its canonical repre- sentation to the rule algebra itself) has far-reaching and unexpected consequences. We find that natural variants of the evaluation mor- phism map give rise to concepts of graph transformations hitherto not considered (these will be described in a separate paper, as in this extended abstract we limit ourselves to the simplest concept namely that of DPO-rewriting). We prove very simply a DPO version of the jump-closure theorem, namely that the sub-space of represen- tations of formal graph observables closed under the action of any rule set. From this new jump-closure result follows that for any set of rulesR, one can derive a formal and self-consistent Kolmogorov backward equation for (representations) of formal observables.

1. Introduction

Graphs and derivatives (colored graphs, nested graphs, site graphs etc.) are basic components in the modern toolkit of modeling. They appear in varied situations such as the study of epidemics, so-

[Copyright notice will appear here once ’preprint’ option is removed.]

cial dynamics of opinions, ad hoc networks, spin glasses (Gleeson 2013), and also combinatorial chemical reaction networks (Danos et al. 2007). Oftentimes, one has competing rewiring operations orruleswhich locally remodel the graph and, thus, naturally de- fine a Markovian process on the discrete set of graphs. This is the situation we are interested in this paper. Our specific goal is to es- tablish a new route to the study of these models. Traditionally one uses graph transformation systems (Heindel 2009) and the notion of rule and rule application. Here we posit as our primary object a notion of rule diagram. Such diagrams can be seen as formal composition of rules in ‘true concurrency’ style. Operationally, di- agrams can also be understood as neighbourhoods of realizations of processes of interest (and might be seen as specific closed sets in the Skorokod topologies used in Ref. (Gupta et al. 2004)). We put together a formalism to represent such diagrams and their evalua- tions. With this algebraification of rule composition, the world of rules becomes autonomous - rules can be formally composed using the diagram algebra and then evaluated to (linear combination of) rules by means of a specific evaluation mechanism. Four different variants of evaluation appear and we restrict here to the simplest form (but see below). The net result is that rules form a unital as- sociative algebraR, while (formal) graph observables are just spe- cial rules which form a commutative subalgebra ofR. The vector space of finite graphs comes back in the picture as the carrier of a natural representation of the rule algebra. Actual graph rewriting is now seen as the induced action and we recover DPO-type rewriting (no implicit edge-deletion is allowed when deleting a node). Other evaluation strategies allow to recover the SPO-type and two new types appear (by time-symmetry). There is no reason in our anal- ysis to prefer DPO-rewriting other than that it allows for shortcuts in the construction ofR. Other variants are perfectly workable and we will work them out in another paper.

Ideas presented here are somewhat anticipated in Lowe’s 1993 paper on the concept of rule composition (Lowe 1993) for SPO- rewriting. Diagrams themselves are implicit in Hayman’s recent construction on traces. But, it is only by decoupling the algebra of rule from its representations that we can operationalise these ideas and develop an efficient and versatile combinatorial frame- work for quantitative graph-rewriting. Indeed, our construction em- bodies a combinatorial engine for accurate handling of the many counting situations which arise in the manipulation of graph rewrit- ing systems. In particular, a special case of this construction is that of discrete typed graphs (no edges):R then boils down to the Heisenberg-Weyl algebra, andR’s representation to the tra- ditional interpretation on this algebra as acting on the multi-type Fock space. Our combinatorial engine thus subsumes analytic com- binatorics on the Fock space (Blasiak et al. 2007). Another type of combinatorial work we can put our engine to use is the deriva- tion of the formal forward equation for graph observables. These equations are widely used in the study of stochastic graph models and often use ad hoc counting arguments. A recent example can be

(3)

found in Ref. (Basak et al. 2015, p21). The derivation relies on a re-derivation of the jump-closure theorem (Danos et al. 2014). Not only do we find a much cleaner derivation but it also generalises in a straightforward manner to obtain a compact formula for the case of correlators of observables (aka multivariate moments). Besides, and this is a more subtle difference, as said, we derive jump-closure for DPO-rewriting which is more intricate than the SPO-version obtained earlier.

2. Preliminaries

Relations. We will work with relations over finite sets. The set of relations between the setsAandBwill be denoted byRelpA, Bq.

The set of one-to-one relations between A and B (aka partial maps from A to B) will be denoted by either Rel11pA, Bq or AáBdepending on the context. The domain and codomain of a relationrare defined asdomprq “ ta| pa, bq Pruandcodprq “ tb| pa, bq Pru.rPRelpA, Bqinduces a functionrr s:℘pAq Ñ

℘pBq where rrUs fi tb| DuPU.pu, bq Prufor U Ď A. The identity relation overAwill be notedidAPRelpA, Aq. Sequential composition of relations r P RelpA, Bq and s P RelpB, Cq will be denoted by r;s P RelpA, Cq. The Kleene closure of r P RelpA, Aq will be denoted by r˚ P RelpA, Aq. We use r` as a notation for r;r˚. If r P RelpA, Bq, we denote by r´1 P RelpB, Aqthe inverse relation. The equivalence relation generated byrPRelpA, Aqwill be notedclprq.

Graphs. We will use exclusively directed multigraphs, however we insist on the fact that all these developments hold in the setting of colored or undirected graphs (Behr et al. 2016). Graphs will be represented as tuplesG “ pV, E, s, tqwhereV andEare finite sets of respectively vertices and edges, ands, t:E ÑV are the maps associating edges to their source and target vertices. When we allowsandtto be partial maps, we call the graphpartial. An edgee such thatspeq ortpeq is undefined isdangling. IfGis a partial graph, we denote bytotalpGqthe largest total subgraph of G, i.e. the graph where all dangling edges ofGare removed. The connected component relationccpGq ĎV ˆV is the equivalence relation generated bytpspeq, tpeqq |ePEu. Given a pair of equiv- alence relations„V,„Eon respectivelyV andE, Apartial injec- tive morphism of graphsfrompV, E, s, tqtopV1, E1, s1, t1qis a pair of one-to-one relationspfV : Rel11pV, V1q, fE : Rel11pE, E1q such thatfE;s1“s;fV fV˝s“s1˝fEwheneversands1˝fEare defined (and similarly fort). isomorphismspfV, fEqis anisomor- phismwheneverfV andfEare bijections. The set of isomorphism classes of finite graphs will be denotedG.

3. The rule diagram & rule algebra

We introducerule diagrams, a syntax for truly concurrent traces of graph rewriting systems. Moreover, these diagrams admit a no- tion of composition which encompasses the usual notion of match- ing together with a notion of normalization which implements rewriting. These diagrams and their normal forms spanalgebras which, in the next sections, will be the basis for an interpretation of stochastic graph rewriting systems asrepresentations.

Polarized discrete diagrams. Rule diagrams and their reduction semantics are defined in terms of simplerpolarized discrete dia- grams(pdds), that correspond to traces of set rewriting ((Heindel 2009), Sec. 2) processes. We will denote the set of discrete dia- grams, defined below, byD0.

Definition 1(Polarized discrete diagram). A pdd is a tupled “ pi, o, r, mqwherei, oare finite, disjointinputandoutputsets and r P Rel11pi, oq, m P Rel11po, iqwill be respectively called the ruleand the match relations. We require the pdd to beacyclic;

formally, this corresponds to requiring thatidiX pr;mq` “ ∅ and symmetrically,idoX pm;rq`“∅. A pdd isnormalwhenever m“∅.

The input and output sets should be thought of as vertices on which some finite set of rules operate. These rules (grouped in the rule relation) are themselves strung together along the match rela- tion. Pdds admit a simple graphical syntax that we now illustrate on small examples. In the pictures to follow, elements ofiwill be de- picted as˝, elements ofoas‚, the rule relation as dotted arrows and the match relation as full arrows. The acyclicity of pdds induces a partial order on elements that we will interpret as the global arrow of time; the diagrams will be displayed vertically with the time go- ing upwards. Besides the empty pdddtu“ p∅,∅,∅,∅q, the simplest examples correspond to thecreation,annihilationandpreservation of a vertex, corresponding respectively to normal pddsdc, da, dp:

‚ ‚

dc

˝ da

˝ dp

OO (1)

concretely given by dc “ p∅,t‚u,∅,∅q, da “ pt˝u,∅,∅,∅q and dp “ pt˝u,t‚u,tp˝,‚qu,∅q. A rule that matches a ver- tex and creates another one can be presented as the pddd1 “ pt˝0u,t‚1,‚2u,tp˝0,‚2qu,∅q, displayed here:

12

˝0 r

<< (2)

As an illustration of a non-normal pdd, we can compose (as will be made precise in Prop. 5) two instances of the previous pdd, for examplematchingthe top instance’s input to‚2:

45

˝3 r

<<

12

OOm

˝0 r

<<

(3)

This last pdd corresponds concretely to:

d2“ pt˝03u,t‚1,‚2,‚4,‚5u,tp˝0,‚2q,p˝3,‚5qu,tp‚23quq These examples hint at the fact that pdds are composed of an union of alternating sequences of elements ofiand o(as the sequence p˝0,‚23,‚5q in Fig. 3), corresponding to the history (that we callworldline) of some element during the rewriting process. This trivial consequence of the choice of one-to-one relations for the rule and match relations together with acyclicity of pdds is pivotal in the definition (to follow) of rule diagrams.

Definition 2(Worldlines). Letd“ pi, o, r, mqbe a pdd. We define the worldline relation

ωpdq Ď piYoq ˆ piYoq ωpdq “ clprYmq

Informally, ωpdqrtxus is the connected component ofxin d seen as a bipartite graph. However, the one-to-oneness and acyclic- ity conditions place some constraints:

Lemma 3. Letd“ pi, o, r, mqbe a pdd andx, yPiYosuch that px, yq Pωpdq. Then:

x, yPi ñ px, yq P pr;mq˚Y pr;mq˚´1 x, yPo ñ px, yq P pm;rq˚Y pm;rq˚´1 xPi, yPo ñ px, yq Pr;pm;rq˚Yr;pm;rq˚´1 xPo, yPi ñ px, yq Pm;pr;mq˚Ym;pr;mq˚´1

(4)

Proof. This is a trivial consequence of acyclicity and the fact that r,mare one-to-one.

A pdd also has a natural notion of interface, corresponding to those parts ofiandothat are not matched:

Definition 4 (Interface of a pdd, diagram matches). Let d “ pi, o, r, mq be a pdd. We define its input interface by Ipdq fi izcodpmq and itsoutput interface byOpdq fi ozdompmq. The set of diagram matchesfromd P D0 to d1 P D0 is defined by M0pd, d1qfiRel11pOpdq,Ipd1qq.

Using the diagramd2of Fig. 3 as an example, we haveIpd2q “ t˝0uwhileOpd2q “ t‚1,‚4,‚5u. Pdds admit a straightforward notion of composition by concatenation along a match relation on their interfaces.

Proposition 5 (Associative composition). Consider two disjoint pddsd “ pi, o, r, mq,d1 “ pi1, o1, r1, m1qand a diagram match nPM0pd, d1q. Let us denote bydBnd1(or equivalentlyd1Cnd) the tuple

piYi1, oYo1, rYr1, mYm1Ynq

We have that (i)dBnd1 is a pdd and (ii) the resulting notion of composition is associative: there is a bijection αd,d1,d2 from the set pn, n1q |nPM0pd, d1q, n1PM0pdBnd1, d2q(

to the set pw, w1q |w1PM0pd1, d2q, wPM0pd, d1Bw1d2q(

that ver- ifies, for allpw, w1q “αd,d1,d2pn, n1q,

pdBnd1qBn1d2“dBwpd1Bw2d2q

Proof. (i)By disjointness ofdandd1,rYr1is one-to-one. Observe that by definition of interfaces,mYm1andnhave disjoint support and are by assumption one-to-one, thereforemYm1Ynis one-to- one.(ii)LetpdBnd1qBn1d2be a composite. By definition,OpdBn d1q “Opd1qZpOpdqzdompnqq, thereforen1uniquely decomposes asn1 “ n10Zn11 wheren10 P Rel11pOpdqzdompnq,Ipd2qqand n11 P Rel11pOpd1q,Ipd2qq. One then obtains the sought identity by settingw“nYn10andw1 “n11. The converse computation yields the claimed bijection.

The diagramd2in Fig. 3 corresponds to the composition ofd1

withd11“ pt˝3u,t‚4,‚5u,tp˝3,‚5qu,∅qalong the match relation m“ tp‚23qu.

Observe that acyclicity and one-to-oneness of the relationsrand mimply trivially that worldline equivalence classes have at most a singleton intersection with either the input or output interface of a pdd. This motivates the definition of theboundary relations, which relate elements of a pdd with the interfaces through the worldline relation:

Definition 6(Boundary relations). Letd “ pi, o, r, mqbe given.

We define theinput boundary relationIωpdqand theoutput bound- ary relationOωdq:

Iωpdq P Rel11piYo,Ipdqq Iωpdq “ ωpdq;idIpdq

Oωpdq P Rel11piYo,Opdqq Oωpdq “ ωpdq;idOpdq

The notion of normalization that we apply to pdds corresponds to taking the trace of the worldline relation against the interface of a diagram.

Definition 7 (Normalization). We define the normalization map B0:D0ÑD0by

B0pdq “ pIpdq,Opdq,Iωpdq´1;Oωpdq,∅q

Clearly, fordnormal one hasB0pdq “d. The following lemma lists some properties of normalization:

Lemma 8. LetdandB0pdqbe as in Def. 7. One has that (i)Ipdq “ IpB0pdqqand Opdq “ OpB0pdqq, and (ii) Iωpdq´1;Oωpdq “ IωpB0pdqq´1;OωpB0pdqq.

Proof. (i)is a trivial consequence of having an empty match rela- tion inB0pdq. As for(ii), we clearly have the inclusion

Iωpdq´1;Oωpdq ĚIωpB0pdqq´1;OωpB0pdqq

The converse inclusion proceeds easily by using the first point and unfolding Def. 2, 6 and 7.

Normalization is compatible with composition:

Proposition 9. Letd, d1PD0. (i)M0pd, d1q “M0pBpdq,Bpd1qqq and (ii)@nPM0pd, d1q,B0pdBnd1q “ B0pB0pdqBnB0pd1qq.

Proof. (i)By Lemma 8, interfaces are preserved by reduction there- foreM0pd, d1q “M0pB0pdq,B0pd1qq.(ii)It is sufficient to check equality of the reduced rule relation. Observe thatIpdBnd1q “ Ipdq ZIpd1qzcodpnqandOpdBnd1q “Opd1q ZOpdqzdompnq.

For the left hand side, we obtain

A “ IωpdBnd1q´1;OωpdBnd1q

“ idIpdBnd1q;ωpdBnd1q;idOpdBnd1q

Splitting the input interfaces according tonand simplifying using Lemma 3:

A “ idIpdq;ωpdBnd1q;idOpdBnd1q

Z idIpd1qzcodpnq;ωpdBnd1q;idOpdBnd1q

“ idIpdq;ωpdBnd1q;idOpdBnd1q

Z idIpd1qzcodpnq;r1;pm1;r1q˚;idOpd1q

Splitting the output interfaces according tonand simplifying:

A“ idIpdq;ωpdBnd1q;idOpd1q

Z idIpdq;ωpdBnd1q;idOpdqzdompnq

Z idIpd1qzcodpnq;r1;pm1;r1q˚;idOpd1q

“ idIpdq;r;pm;rq˚;n;r1;pm1;r1q˚;idOpd1q

Z idIpdq;r;pm;rq˚;idOpdqzdompnq

Z idIpd1qzcodpnq;r1;pm1;r1q˚;idOpd1q

For the right hand side, lettingd“ B0pdqBnB0pd1q, we have:

B“Iωpdq´1;Oωpdq

Unfolding and using that interfaces are preserved, we derive:

B “ idIpdq;ωpdq;idOpdq

“ idIpB0pdqBnB0pd1qq;ωpdq;idOpB0pdqBnB0pd1qq

“ idIpdBnd1q;ωpdq;idOpdBnd1q

Splitting the input and output interfaces according tonand simpli- fying,

B “ idIpdq;ωpdq;idOpd1q

Z idIpdq;ωpdq;idOpdqzdompnq

Z idIpd1qzcodpnq;ωpdq;idOpd1q

Let us denote by resp.B0prq fi Iωpdq´1;Oωpdq andB0pr1q fi Iωpdq´1;Oωpdq the rule relations of resp.B0pdq andB0pd1q. By definition,

ωpdq “clpB0prq Y B0pr1q Ynq and we have by further simplifications:

B0prq “ Iωpdq´1;Oωpdq “ idIpdq;ωpdq;idOpdq

“ r;pm;rq˚

B0pr1q “ Iωpd1q´1;Oωpd1q “ idIpd1q;ωpd1q;idOpd1q

“ r1;pm1;r1q˚

Substituting these equations and performing some more trivial sim- plifications, one obtains the equality.

(5)

During the construction of the rule and rule diagram algebras, diagrams will only be considered up to isomorphisms, defined as follows:

Definition 10(Isomorphism of pdds). Letd, d1PD0be such that d“ pi, o, r, mqandd1 “ pi1, o1, r1, m1q. An isomorphism fromd tod1is a pair of bijectionsf “ pfi :iÑi1, fo :oÑo1qsuch thatp˝1,‚2q P r ô pfi1q, fop‚2qq Pr1andp‚21q P m ô pfop‚2q, fi1qq Pm1. This will be denoted byf:d–d1. Rule diagrams. Arule diagramis a suitable coupling of a pair of pdds supported by respectively a set of vertices and a set of edges.

The set of rule diagrams will be denoted byD.

Definition 11(Rule diagram). Arule diagramis a tuple d“ pdV, dE, si, ti, so, toq

wheredV “ piV, oV, rV, mVqanddE “ piE, oE, rE, mEqare pdds verifying conditions1to5below.

1.Gipdq fi piV, iE, si, tiq and Gopdq fi poV, oE, so, toq are graphs;

2.prV, rEqis a partial graph morphism fromGipdqtoGopdq;

1. and 2. are summarized in the following diagram, where the horizontal components are graphs and the vertical onespdds:

iV rV

''oV

mV

gg

iE si

JJ

ti

TT

rE

''oE

mE

gg

so

JJ

to

TT

Further, we require the following.

3.d must fulfill the delayed morphismcondition: letting s “ siYso, one has

pe, e1q PωpdEq ñ pspeq, spe1qq PωpdVq and similarly fort“tiYto.

4. We ask the diagrams to beglobally acyclic. Let r1V fi ccpGipdqq;rV;ccpGopdqq be the rule relation up tocc. We require:

idoV X pmV;r1Vq`“∅ For the scope of this paper, we add the following:

5.dverifies thetotalitycondition:

idIpdEq;si;IωpdVq and idOpdEq;so;OωpdVq are total functions from resp.IpdEqtoIpdVqandOpdEqto OpdVq; and similarly forti, to.

A rule diagram isnormalwheneverdV anddEare normal pdds.

The set of normal rule diagrams will be denotedNpDq.

Observe that a normal diagram is isomorphic to arulein the graph rewriting sense (Heindel 2009).

Definition 12 (Rule associated to a normal diagram). Let d P NpDq. By definition,r “ prV, rEqis a partial injective graph morphism fromGipdqtoGopdq. Theruleassociated todwill be denoted byGopdqðùr Gipdq. Conversely, any ruleg1ðùr ginduces trivially a normal diagram.

Let us discuss the conditions listed in Def. 11. Thedelayed mor- phismcondition ensures that reduction can be properly defined on

rule diagrams. Global acyclicity allows to have a sequential inter- pretation of rule diagrams as stackings of rules: in this sense, it is a “correctness” criterion. However, it is not required for having a well-defined reduction. Finally, thetotalitycondition is a simpli- fying assumption we make for the scope of this paper: it enforces that the source and target maps in any normalized diagram are total functions (i.e. that the corresponding notion of graph rewriting is DPO (Heindel 2009)). An account of more general types of rewrit- ing is available in a preprint (Behr et al. 2016). Examples of dia- grams that do not verify totality and global acyclicity are available in Sec. A of the appendix. As a first example, we consider a normal diagram corresponding to a rule which acts identically on an edge.

We use the same pictural conventions as for pdds for vertices and we use˛to denote input edges and˛for output edges.

2 sđo ˛b t§o3

˝0 rV OO

˛a rE

OO

sđi §

ti ˝1 rV

OO (4)

The concrete representation for this diagram isd“ pdV, dE, si, ti, so, toqwithdV “ pt˝01u,t‚2,‚3u,tp˝0,‚2q,p˝1,‚3qu,∅qfor vertices,dE“ pt˛au,t˛bu,tp˛abqu,∅qfor edges and the obvi- ous maps forsi, ti, so, to. This type of diagram, made up of only one identity rule for some arbitrary graph, will be called in the fol- lowing anobservable(here, the graph is reduced to a single edge, we therefore call the corresponding diagram anedge observable).

Rule diagrams have a straightforward notion of isomorphism:

Definition 13(Isomorphism of rule diagrams). Letd“ pdV, dE, si, ti, so, toqandd1 “ pd1V, d1E, s1i, t1i, s1o, t1oqbe rule diagrams.

An isomorphism fromdtod1is a pair of discrete diagram isomor- phisms (Def. 10)

fV : dV –d1V fE : dE–d1E fV “ pfV,i, fV,oq fE “ pfE,i, fE,oq such thatpfV,i, fE,iqis a graph isomorphism fromGipdqtoGipd1q andpfV,o, fE,oq is a graph isomorphism fromGopdq toGopd1q.

The set of isomorphism classes of rule diagrams will be noted D. Isomorphism classes of normal rule diagrams will be noted NpDq.

Normalization of rule diagrams is defined as the componentwise normalization of the vertices and edges pdds.

Definition 14(Normalization of rule diagrams). Let us consider a rule diagramd “ pdV, dE, si, ti, so, toq. We define its normal form asBpdqfipB0pdVq,B0pdEq,s¯i,t¯i,s¯o,¯toqwhere

¯

sifiidIpdEq;si;IωpdVq s¯o fiidOpdEq;so;OωpdVq and similarly for¯ti,¯to.

The following proposition states that normalization preserves the structure of rule diagrams.

Proposition 15. (i) Normalization is a functionB:D ÑNpDq and (ii)B ˝ B “ B.

Proof. (i) Let us show that the conditions listed in Def. 11 are verified byBpdq.

1. Totality directly impliesGipBpdqqandGopBpdqqare graphs.

2. Injectivity is trivial. Letpei, eoq PIpdEq ˆOpdEq, then by the delayed morphism condition,psipeiq, sopeoqq P ωpdVqthere- forep¯sipeiq,s¯opeoqq PωpdVq. By Def. 7, this pair of vertices is trivially in the reduced rule relation. The same argument goes forti, to.

3. By the previous point and using that the match relation is empty, the delayed morphism condition is trivially verified.

(6)

4. Trivial by emptyness of the match relation ofBpdq.

5. Totality is by construction.

Normality ofBpdqas well as(ii)are trivial.

As for pdds, rule diagrams admit a notion of binary composition along a match:

Definition 16(Composition). Consider two disjoint rule diagrams d “ pdV, dE, si, ti, so, toq;

d1 “ pd1V, d1E, s1i, t1i, s1o, t1oq and a pair of matches on respectively vertices and edges

n“ pnV, nEq PM0pdV, d1Vq ˆM0pdE, d1Eq Whenever the object defined by

dBnd1“ pdVBnVd1V, dEBnEd1E, siYs1i, tiYt1i, soYs1o, toYt1oq is a valid rule diagram (i.e.dBnd1PD), we call it the composition ofdandd1alongn. This object might equivalently be denoted by d1Cnd.

The reader might be unsatisfied seeing that we need to refer to the definition of rule diagrams to carve out the set of allowed composites of such diagrams. Before adressing this problem, let us give a few examples of composites. The diagram to the left of Fig. 11 provides an example of composition of an edge observable with a “vertex annihilation” diagramda. The following example corresponds to a vertex observable precomposed and postcomposed with edge observables.

8 đ ˛d § ‚9

˝6

OO

˛c §

ti

đ

OO

˝7

OO

5

OO

˝4

OO

2

OO

˛b t§o đ

OO

3

OO

˝0

OO

˛a

OO

đ § ˝1

OO

(5)

This example highlights in a striking way the “delayed mor- phism” condition: here, p˛bcq are in the match relation but ptobq, ticqq are not. This makes the following proposition, which characterizes the admissible matches, not totally trivial. As a side note, the totality condition only appears here as a simplifying assumption.

Proposition 17(Admissible matches). Letd, d1, nbe as in Def. 16.

dBnd1is a rule diagram if and only if (i)nis a partial injective morphism of graphs fromGopBpdqqtoGipBpd1qqand (ii)dBnd1 verifies the totality condition. Such anwill be calledadmissible.

We denote the set of admissible matches fromdtod1byMpd, d1q.

Proof. AssumedBnd1PDwithn“ pnV, nEq. First, observe that this implies trivially thatdBnd1PDverifies the totality condition.

Now observe that by construction,nV P Rel11pOpdVq,Ipd1Vqq andnE P Rel11pOpdEq,Ipd1Eqq. Considere, e1such thate1 “ nEpeq. We have to prove thatn is a partial injective morphism of graphs from GopBpdqq to GipBpd1qq (see Prop. 15 for their definitions), i.e. thatnVp¯sopeqq “s¯1ipe1q.

By definition of reduction,psopeq,¯sopeqq P ωpdVq and sym- metrically,ps1ipe1q,s¯1ipe1qq Pωpd1Vq; while the delayed morphism property (dmp) ensures that psopeq, s1ipe1qq P ωpdV BnV d1Vq.

Sincedandd1are disjoint andnis by assumption one-to-one, this

is only possible ifnVp¯sopeqq “s¯1ipe1qis verified. Mirroring this argument fort, t1yields the result thatnis a partial injective mor- phism of graphs.

Conversely, assumenis as stated. We only prove thatdBnd1 verifies the dmp (the other defining properties of rule diagrams are easily verified). It is enough to exhibit the dmp for a pair of edgespe, e1qwithein dande1 P d1, as otherwise it is satisfied by assumption. Assume thatpe, e1q P ωpdE BnE d1Eq. Using one-to-oneness and acyclicity of pdds, we obtain that pe, e1q P ωpdEq;nE;ωpd1Eq. Therefore, there exists eo P OpdEq, e1i P Ipd1Eq such thatpe, eoq P ωpdEq, pe1i, e1q P ωpd1Eq ande1i “ nEpeOq; and one can apply the dmp on pe, eoq and pe1i, e1q, by assumption. The goal is reduced to proving thatpsopeoq, s1ipe1iqq P ωpdV BnV d1Vq. Sincedandd1are disjoint, this can only be if the vertices related byωpdVqin the interface are related throughnV, i.e. it is enough to prove that

pso;ωpdVq;idOpdVq;nVqpeoq “ psi;ωpd1Vq;idIpd1Vqqpe1iq which by definition of¯sands¯1corresponds to havingnVp¯sopeoqq “ s¯1ipe1iq. Since eo is an edge of GopBpdqq and e1i is an edge of totalpGipBpd1qqq, nVp¯sopeoqq “ s¯1ipe1iq. The exact same argu- ment for the target mapsto, t1iconcludes the proof.

The associativity of composition of pdds lifts to rule diagrams:

Proposition 18. Letd, d1, d2PD. There exists a bijectionαd,d1,d2

from the set pn, n1q |nPMpd, d1q, n1PMpdBnd1, d2q( to the set pw, w1q |w1PMpd1, d2q, wPMpd, d1Bw1d2q(

that veri- fies, for allpw, w1q “αd,d1,d2pn, n1q,

pdBnd1qBn1d2“dBwpd1Bw2d2q

Proof.The source and target maps si, ti, so, to of a triple com- posite are given by the union of the corresponding data from each component, independently of the chosen matches. Therefore, it is enough to apply Prop. 5 to conclude.

Remark 19. The rule diagramd“ pdtu, dtu,∅,∅,∅,∅qacts as a neutral element for the composition:dBd1“d1Bd“d1.

Moreover, normalization respects composition:

Proposition 20. Letd, d1 P Dandn P Mpd, d1q. One has (i) nPMpBpdq,Bpd1qqand (ii)BpdBnd1q “ BpBpdqBnBpd1qq.

Proof. (i)Using the assumptionn P Mpd, d1q, by Prop. 17,nis an injective morphism of graphs fromGopBpdqqtoGipBpd1qqand thereforen PMpBpdq,Bpd1qq. The proof of(ii)follows the same pattern as the proof of Prop. 9.

The rule diagram & rule algebra. P dds and rule diagrams span vector spaces that admit, thanks to the composition oper- ation, the structure ofalgebras In the following, we denote by pspanpXq,`,¨q the formal vector space of finite linear combi- nations with real coefficients over a setX wherev`v1 is the pointwise addition andλ¨v is the scalar multiplication. We let δ : X Ñ spanpXqbe the map associatingx P X to the basis vectorδpxq. However, where the context allows it, we will dropδ and denote a basis element by its index inX. In the remainder of this paper, we will only deal explicitly with isomorphism classes of combinatorial structures where required.

Definition 21 (Vector space of rule diagrams and normal rule diagrams). We denote theR-vector space spanned byDbyD“ pspanpDq,`,¨q. SinceNpDq ĎD, there exists a subvector space ofDspanned by (isomorphism classes of) normal diagrams which will be denoted byR, together with a canonical inclusion ψ:RãÑD“idR.

(7)

Dadmits an algebra structure induced by diagram composition.

Let us define the product.

Definition 22(Product inD). Letδpdq, δpd1q P D be two basis vectors ford, d1PD. We define their product as:

δpd1q ˚Dδpdqfi ÿ

nPMpd,d1q

δpd1C

ndq This extends to arbitrary elements ofDby linearity:

˜ ÿ

d1

βd1δpd1q

¸

˚D

˜ ÿ

d

αdδpdq

¸ fiÿ

d,d1

αdβd1δpd1q ˚Dδpdq Theorem 23. ˚D makesD into an associative algebra with unit 1D“1¨δpdq. We callpD,˚D,1Dqtherule diagram algebra.

Proof. Bilinearity of˚D is straightforward. Let us prove associa- tivity. Clearly it is enough to consider basis vectors. We have:

pδpd2q ˚Dδpd1qq ˚Dδpdq

“ ÿ

n1PMpd1,d2q

δpd2C

n1

d1q ˚Dd

“ ÿ

n1PMpd1,d2q

ÿ

nPMpd,d2Cn1d1q

δppd2C

n1

d1qC

ndq Applying Prop. 18, we can rewrite the last equation as

ÿ

wPMpd,d1q

ÿ

w1PMpd1Cwd,d1q

δpd2C

w1

pd1C

wdqq

Let us check the unit law. Observe that for alldPD,∅is the only element inMpd, dqand inMpd, dq, therefore

δpdq ˚Dδpdq “dB

d“d“dB

d“δpdq ˚Dδpdq This lifts trivially to arbitrary vectors.

The normalization map extends by linearity to a linear map from DtoRthat we call thereduction map.

Definition 24(Reduction map). The functionϕ¯defined on basis vectors as

¯

ϕpδpdqq “ δpBpdqq ifBpdq PNpDq,

“ 0¨δpdq otherwise extends straightforwardly to a linear mapϕ¯:D ÑR.

The unital associative algebra structure onD can be pushed forward toRby composing normal diagrams and normalizing back their composition.

Definition 25(Product inR). Letv, v1 P R be given. We define their product as:

v1˚Rvfiϕ¯`

ψpv1q ˚Dψpvq˘

Theorem 26. (i)ϕ¯is a homomorphism of algebras frompD,˚Dq to pR,˚Rq; (ii)˚R makes R into an associative algebra with unit1R“1¨dandϕ¯is a homomorphism of associative unital algebras. We callpR,˚R,1Rqtherule algebra.

Proof. (i)By bilinearity of˚R and˚D, it is enough to consider basis vectors. We have to proveϕpδpd¯ 1q ˚Dδpdqq “ϕpδpd¯ 1qq ˚R

¯

ϕpδpdqq. Unfolding the definition of˚R, we get:

¯

ϕpδpd1qq ˚Rϕpδpdqq “¯ ϕ¯`

ψpϕpδpd¯ 1qqq ˚Dψpϕpδpdqqq¯ ˘ therefore, the goal reduces to proving

¯

ϕpδpd1q ˚Dδpdqq “ϕ¯`

ψpϕpδpd¯ 1qqq ˚Dψpϕpδpdqqq¯ ˘ Let us proceed by case analysis. AssumeBpdq RNpDqorBpd1q R NpDq. Then point 2. of Prop. 20 imply that both sides reduce to

0¨δand the equality holds. Now, assume thatBpdq,Bpd1q PNpDq.

Thenψpϕpδpdqqq “¯ δpBpdqqandψpϕpδpdqqq “¯ δpBpd1qq, and it is sufficient to prove thatϕpδpd¯ 1Dδpdqq “ϕ¯`

δpBpd1qq ˚DδpBpdqq˘ , which boils down to point 1. of Prop. 20.(ii)The unit part is trivial.

As for associativity, it suffices to apply the homomorphism prop- erty toϕpψpxq ˚¯ D ψpyq ˚D ψpzqqin the two possible ways to obtain the sought equality.

An important subalgebra ofRis that ofobservables, which will be denoted byO. Its elements are (linear combinations of) normal diagramsg1ðùr gwheregandg1are isomorphic. In a slight abuse of notation, we will note thisg ðùr g. The particular case where ris an isomorphism from gto g1 will be denoted g ðù g- as we will see these correspond (via the representation to be defined below) to function on graphs counting the number of matches for a given graph. Ifris not an iso, but simply a injective morphism, then we are only counting such matches where nodes deleted by r(and recreated subsequently) are sent to nodes of same degree in the target graph. To stress the difference between true identities and general obervables we will sometimes explicitly call the latter ones

‘thin’ identities.

In the following, we will work directly with representatives, without loss of generality.

Proposition 27. The familyOfitgðùr gugPGis a commutative subalgebra ofR.

Proof.Commutativity ofOis easy. Letd“gðùr g,d1“g1 r

1

ðùg1 andn “ pnV, nEq P Mpd, d1qbe given as in Def. 16. By Prop.

17,n is an partial graph morphism from g to g1. Let us write d “ dBnd1. We prove that there is a graph isomorphism from Ipdq “ GipBpdqqto Opdq “ GopBpdqq. Let e be an edge of Ipdq. By assumption,ehas an imagee1inOpdqthrough a graph isomorphismσd.

1. Assumee1 P dompnEq, thensope1qand tope1q are inIpd1q (sincenis a graph morphism) and we conclude easily to.

2. Assumee1 RdompnEq. Thene1 POpdq. The only nontrivial case is wheneversope1qortope1qoverlapsdompnVq, in which case we use the totality hypothesis to rule out the possibility ofsope1q,tope1qbeing deleted ind1:sope1q,tope1qare related through the match relation ofd1toOpd1q.

The case of isolated vertices is treated similarly. All in all, this prove thatIpdqinjects inOpdq. Reversing the same argument con- cludes to the existence of an isomorphism. Therefore, thin observ- ables form a subalgebra.

4. Representation

LetG fispanpGqbe the vector space spanned by isomorphism classes of graphs. We construct arepresentation(that is, a homo- morphism of unital associative algebras) of the algebraRto the al- gebraEndpGqof endomorphisms over the vector spaceG. In Sec.

5, we will show how this representation implements mass-action stochastic graph rewriting. In this section, we proceed by(i)con- structing a linear mapρ:R ÑEndpGqand(ii)proving thatρis indeed a homomorphism. The whole construction is in close anal- ogy to the representation theory of the Heisenberg-Weyl algebra.

We will therefore use notations drawn from quantum mechanics:

elements ofGwill be denoted by|vyforvPG.Gadmits (by def- inition ofspan) a Hamel basis constituted of linear combinations of the form1¨δpgqfor eachgPG. We will denote these by|gy.

Among all elements ofG, we distinguish the vector correspond- ing to the (trivial isomorphism class of the) empty graph:|∅y; it is is the counterpart of thevacuum vectorin the construction of the

(8)

bosonic Fock space representation for the Heisenberg-Weyl algebra (Blasiak et al. 2007) and it will play a similar role here.

Constructing the representation. The representation map ρ : R ÑEndpGqmust satisfy(i)linearity and(ii)for allv, v1 P ρ, the equationρpv1˚Rvq “ρpv1qρpvq. It is sufficient to defineρon a basis ofRand then extend it by linearity; similarly, an operator inEndpGqis entirely characterized by its action on basis vectors

|gy. In the following, we will use the notationg1 ðùr gfor normal diagrams seen as rules, as in Def. 12. We will omitδand simply writeρpg1ðùr gqwhere unambiguous.

Definition 28(Representation map).

ρpg1ðùr gq |∅y fi

" ˇ ˇg1D

ifg“∅ 0¨ |∅y else ρpg1ðùr gqˇ

ˇg2‰∅D

fi ρpg1ðùrRg2ðù∅q |∅y This extends to a linear operatorρ:R ÑEndpGq. Note that the first definition implies the equation|gy “ρpgðù∅q |∅yfor all gPG. We have:

Theorem 29. ρis a homomorphism of unital algebras.

Proof. Letd, d1 P NpDq be given. By linearity, it suffices to proveρpd1˚Rdq “ρpd1qρpdqandρp1Rq “1EndpGq. It is enough to test these equalities on basis vectors ofG. By definition ofρ, we trivially have

ρp1Rq |∅y “ρpdq |∅y “ρp∅ðù∅q |∅y “ |∅y

Let us test the homomorphism property on|∅y: ifdis not of the formd“gðù∅thenρpd1qρpdq |∅y “0¨ |∅y. Since@n,Ipdq Ď IpdBnd1q, one also hasρpd1˚Rdq |∅y “0¨ |∅yand the equality holds. Assume now thatdis of the formgðù∅. Then by definition, ρpd1qρpg ðù ∅q |∅y “ ρpd1q |gy “ ρpd1˚Rg ðù ∅q |∅y. Let us proceed to the case of a basis vector|g‰∅y. We have thanks to the previous resultρp1Rq |gy “ρp1R˚g ðù∅q |∅y “ |gy. Finally, using the previous results together with the associativity of˚R,

ρpd1˚Rdq |gy “ ρpd1˚RRgðù∅q |∅y

“ ρpd1qρpd˚Rgðù∅q |∅y

“ ρpd1qρpdq |gy

The following result will be useful in constructing a stochastic dynamics.

Lemma 30. ρranges in row-finite operators.

Proof. It is enough to considerd “ f1 ðùr f. We have to prove that for allh, there are finitely many|gysuch thatpρpdq |gyqhis nonzero, i.e. such that

ρpf1ðùrRgðù∅q |∅y

has a strictly positive component in |hy. But sinceh is a finite graph, there are only finitely manygandnsuch that

Bpf1ðùr fCngðù∅q “hðù∅

5. Stochastic mechanics of graph rewriting

Stochastic mechanics in a nutshell. We are interested in describ- ing the time evolution of a probability distribution supported by G. As these are not necessarily finitely supported, they do not fit inG “spanpGq. Therefore, we define our space ofstatesto be the real Fr´echet spaceGˆfipRG, } }k(

kPNqof all real sequences indexed byGwith seminorms}f}k fi|fpgkq|.Gis a subspace

ofG. The convex subset of subprobability statesP robĂGˆcon- tains all statesψ P Gˆthat are i)positive, i.e.@x P X, ψpxq ě0 and ii)subnormalized, i.e.ř

xψpxq ď1. Substochastic operators, denoted byStoch, are those operatorsAPEndpVqwhich verify ApP robq ĎP rob.

A stochastic dynamics in our setting will be a continuous-time Markov chain that will be given by anHamiltonianH PEndpGq.

We require this operator to beinfinitesimal stochastic, which means thatH “ phxyqx,yPX verifies i)hxx ď 0for allx, ii)hxy ě0 for all x ‰ y and iii) ř

xhxy “ 0 for all y. The stochastic dynamics induced by a Hamiltonian is a semigroupP :r0,8q Ñ StochpGqof substochastic operators (i.e.PpsqPptq “Pps`tq for all s, t ě 0) which is the pointwise minimal non-negative solution of the (backwards)master equation:

dP

dt “HP (6)

Given an initial stateψ, the corresponding trajectory is given by tÞÑPptqψ. See Norris (Norris 1998) for a thorough treatment of the subject. Note that the above only makes formal sense whenever HPEndpGqcan be interpreted as an element ofEndpGq. In thisˆ paper, as a consequence of Lemma 30, it will be by construction always the case:

Lemma 31. For allH P EndpGqif H is row-finite thenH P EndpGq.ˆ

Proof.Operators inEndpGqmust map finite linear combinations to finite linear combinations, therefore they must be column-finite.

If such an operator is moreover row-finite, its application is trivially well-defined on all elements ofG.ˆ

The projection. It will be useful to integrate elements ofGˆagainst the counting measure. In analogy with the notations of quantum mechanics, we call this theprojectionand denote this linear (par- tial) operation by

x| : GˆáR x| “ vPGˆÞÑř

gvpgq Hamiltonians verify the following special property:

Lemma 32. IfHPEndpGqis infinitesimal stochastic,x|H “0.

Proof.By condition(iii)of the definition of infinitesimal stochastic operators, columns vectorsH|gyofHsum to zero.

Operators for graph observables. The quantities of interest in stochastic graph rewriting-based models are “graph-counting ob- servables”. They correspond to the number of occurrences of some subgraph isomorphic to a patternhin the graph being rewritten, say g– in other words, the number of injections fromhtog, denoted byrh;gs. In our setting, these quantities are computed by graph- counting operators. Agraph observablefor a patternhPGis an operatorOhPEndpGqwhich verifies

Oh|gy “ rh;gs |gy (7) i.e. every basis vector|gyis an eigenvector with eigenvaluerh;gs.

Note that one could take this as a definition. However, it will be useful to express these operators in terms of the representations of the elements of the subalgebra of thin graph observablesO (see Prop. 27):

Ohfiρphðrùh hqfor somerh

Let us verify that this matches Eq. 7:

ρphðrhùhq |gy “ ρphðrùh hqρpgðù∅q |∅y

“ ρphðrùhRgðù∅q |∅y (8)

Références

Documents relatifs

Analysis of the personal social networks of 250 inhabitants of this city, supplemented by data from qualitative interviews, brings to light four different ideal types of

In a second period – ‘the normal period’- our observations indicate that following the rules consists in translating the abstract rules into concrete reference points, and adding

Delano¨e [4] proved that the second boundary value problem for the Monge-Amp`ere equation has a unique smooth solution, provided that both domains are uniformly convex.. This result

We prove that arbitrary actions of compact groups on finite dimensional C ∗ -algebras are equivariantly semiprojec- tive, that quasifree actions of compact groups on the Cuntz

We could have defined the head and tail of D as a pair of drags whose head contains all maximal roots, is cyclic, and its composition with the tail by a directed switchboard is the

⊓ ⊔ In the following, we establish a precise relation between the notion of proof as rewriting path (in a deep inference deductive system) and the notion of proof as a

Support for parsing ontologies with description graphs and description graph rules is available in an extension of the OWL API 7 and HermiT can be used for reasoning with

On s’intéresse à l’étude de ces équations le cas où les coefficients ne vérifient pas la condition de Lipschits ; précisément dans le cas où les coefficients sont