aa r X i v : . [ m a t h . C T ] J a n CATEGORIES OF NETS
JOHN C. BAEZ, FABRIZIO GENOVESE, JADE MASTER, AND MICHAEL SHULMAN
Abstract.
We present a unified framework for Petri nets and various variants,such as pre-nets and Kock’s whole-grain Petri nets. Our framework is basedon a less well-studied notion that we call Σ-nets, which allow finer control overwhether tokens are treated using the collective or individual token philosophy.We describe three forms of execution semantics in which pre-nets generatestrict monoidal categories, Σ-nets (including whole-grain Petri nets) generatesymmetric strict monoidal categories, and Petri nets generate commutativemonoidal categories, all by left adjoint functors. We also construct adjunctionsrelating these categories of nets to each other, in particular showing that allkinds of net can be embedded in the unifying category of Σ-nets, in a way thatcommutes coherently with their execution semantics. Introduction
A Petri net is a seemingly simple thing:It consists of “places” (drawn as circles) and “transitions” (drawn as boxes), withdirected edges called “arcs” from places to transitions and from transitions to places.The idea is that when we use a Petri net, we place dots called “tokens” in the places,and then move them around using the transitions:Thanks in part to their simplicity, Petri nets are widely used in computer science,chemistry, biology and other fields to model systems where entities interact andchange state [18, 30].Ever since the work of Meseguer and Montanari [28], parallels have been drawnbetween Petri nets and symmetric strict monoidal categories (SSMCs). Intuitively,a Petri net can be interpreted as a presentation of such a category, by using its placesto generate a monoid of objects, and its transitions to generate the morphisms. Anobject in the SSMC represents a “marking” of the net—a given placement of tokensin it—while a morphism represents a “firing sequence”: a sequence of transitionsthat carry markings to other markings. One of the advantages of this “execution
Date : January 13, 2021. semantics” for a net is that it can be compositionally interfaced to other structuresusing monoidal functors.However, the apparent simplicity of Petri nets hides many subtleties. There arevarious ways to make the definition of Petri net precise. For example: is therea finite set of arcs from a given place to a given transition (and the other wayaround), or merely a natural number? If there is a finite set, is this set equippedwith an ordering? Furthermore, what is a morphism between Petri nets? A widevariety of answers to these questions have been explored in the literature.Different answers are good for different purposes. In the “individual token phi-losophy”, we allow a finite set of tokens in each place, and tokens have their ownindividual identity. In the “collective token philosophy”, we merely allow a naturalnumber of tokens in each place, so it means nothing to switch two tokens in thesame place [19].Moreover, the idea of using SSMCs to represent net semantics, albeit intuitive,presents subtleties of its own. There has been a great deal of work on this subject[2, 8, 12, 17, 16, 27, 31, 32, 33]. Nevertheless, we still lack a general answer describingthe relations between nets and SSMCs.2.
Dramatis personæ
Our goal is to bring some order to this menagerie. Our attitude is that thoughthere may be multiple kinds of Petri net, each should freely generate a monoidalcategory of an appropriate sort, and these processes should be left adjoint functors.Furthermore, in practical applications we want this functor to be as easy to computeas possible [16]. Finally, the different categories of nets should be related to eachother by functors that are coherent with known functors between categories ofmonoidal categories of different sorts.More specifically, we will consider three kinds of monoidal categories, and threecorresponding categories of nets:
StrMC SSMC CMCPreNet Σ - net Petri On the top row we have: • StrMC , with strict monoidal categories as objects and strict monoidal func-tors as morphisms. • SSMC , with symmetric strict monoidal categories as objects and strictsymmetric monoidal functors as their morphisms. A symmetric strictmonoidal category is a symmetric monoidal category whose monoidalstructure is strictly associative and unital; its symmetry may not be theidentity. • CMC , with commutative monoidal categories as objects and strict symmet-ric monoidal functors as morphisms. A commutative monoidal cate-gory is a symmetric strict monoidal category where the symmetry is theidentity.
ATEGORIES OF NETS 3
These three kinds of monoidal categories are freely generated by three kinds of nets,on the bottom row of the diagram: • PreNet , with pre-nets as objects. A pre-net consists of a set S of places ,a set T of transitions , and functions T s,t −→ S ∗ × S ∗ , where S ∗ is theunderlying set of the free monoid on S . We describe the category PreNet ,and its adjunction with
StrMC , in Section 4. These ideas are due to Bruni,Meseguer, Montanari and Sassone [8]. • Σ - net , with Σ-nets as objects. A Σ-net consists of a set S and a discreteopfibration T → P S × P S op , where P S is the free symmetric strict monoidalcategory generated by a set of objects S and no generating morphisms. Wedescribe the category Σ - net in Section 5, and its adjunction with SSMC inTheorem 7.3. • Petri , with Petri nets as objects. A
Petri net , as we will use the term,consists of a set S , a set T , and functions T s,t −→ N [ S ] × N [ S ], where N [ S ]is the free commutative monoid on S . We describe the category Petri , andits adjunction with
CMC , in Section 3. This material can be found in someof our earlier work [2, 27].These three notions of net obviously have a similar flavor. Their parallel relation-ships to the three notions of monoidal category is made even clearer when we notethat regarded as discrete categories, S ∗ and N [ S ] are respectively the free monoidalcategory and the free commutative monoidal category generated by S , and thatevery functor between discrete categories is a discrete opfibration.Besides the three adjunctions between the categories on the top row and those onthe bottom row, in which the left adjoints point upward, there are also adjunctionsrunning horizontally across the diagram: adjoint pairs in the top row and bottomright and an adjoint triple in the bottom left, with left adjoints drawn above theirright adjoints. In Section 7, we examine these adjunctions in detail.Of particular importance are the right adjoint mapping Petri nets to Σ-nets, andthe left adjoint mapping pre-nets to Σ-nets. We think of these as “embedding” thecollective token world (Petri nets) and the individual token world (pre-nets) intothe unifying context of Σ-nets. In the case of Petri nets, the functor is literally anembedding (i.e., fully faithful), and since it is a right adjoint it preserves all limits(though not all colimits). In the case of pre-nets, the functor is faithful but not full;but it is an equivalence onto a slice category of Σ - net , and preserves all colimitsand all connected limits (such as pullbacks). These embeddings also respect themost common categorical semantics: in Section 7 we will show that the left adjoints PreNet → SSMC and
Petri → CMC both factor through Σ - net .The images of pre-nets and Petri nets in Σ-nets have a large intersection, con-sisting of those nets in which no places are ever duplicated in the inputs or outputsof any transition. These are the nets for which there is no difference between theindividual and collective token philosophies. As we shall see, general Σ-nets allowmore fine-grained control than either pre-nets or Petri nets: for example, some tran-sitions may obey the individual token philosophy while others obey the collectivetoken philosophy.Our work is closely related to that of Kock [21]. He refers to Σ-nets as “digraph-ical species”, and sketches a proof, different from ours, that there is an adjunctionrelating them to SSMC . But his focus is on a fourth notion of net: “whole-grainPetri nets”. He sketches a proof that these are the image of pre-nets inside Σ-net,
JOHN C. BAEZ, FABRIZIO GENOVESE, JADE MASTER, AND MICHAEL SHULMAN which we detail in Section 8 (so that in particular, whole-grain Petri nets also gen-erate symmetric strict monoidal categories); but he has nothing to say about theirrelationship to Petri nets as traditionally conceived.3.
Petri Nets
Symmetric monoidal categories are a general algebraic framework to representprocesses that can be performed in sequence and in parallel. Because Petri netsrepresent schematics for such processes, we expect them to freely generate symmet-ric monoidal categories. In fact they generate a special sort of symmetric monoidalcategories: commutative ones.
Definition 3.1.
Let
Petri be the category where: • An object is a
Petri net : a pair of functions T s,t −→ N [ S ], where N [ S ]denotes the underlying set of the free commutative monoid on S . • A morphism from T s ,t −−−→ N [ S ] to T s ,t −−−→ N [ S ] is a pair of functions f : S → S , g : T → T such that the following diagram commutes: N [ S ] T N [ S ] N [ S ] T N [ S ] N [ f ] gs t N [ f ] s t where N [ f ] denotes the unique monoid homomorphism extending f . Definition 3.2. A commutative monoidal category is just a commutativemonoid object in Cat . Equivalently, it is a strict monoidal category ( C, ⊗ , I ) suchthat for all objects a and b and morphisms f and g in Ca ⊗ b = b ⊗ a and f ⊗ g = g ⊗ f. A morphism of commutative monoidal categories is a strict monoidal functor. Wewrite
CMC for the category of commutative monoidal categories and such mor-phisms between them.A commutative monoidal category can be seen as a particularly strict sort of sym-metric monoidal category. Ordinarily, symmetric monoidal categories are equippedwith “symmetry” isomorphisms σ x,y : x ⊗ y ∼ −→ y ⊗ x for every pair of objects x and y . In a commutative monoidal category x ⊗ y is equal to y ⊗ x , so we can — and henceforth will — make it symmetric by choosing σ x,y to be the identity for all x and y . Any morphism of commutative monoidalcategories then becomes a strict symmetric monoidal functor.The following adjunction shows that Petri nets are the right sort of generatingdata for commutative monoidal categories. Proposition 3.3.
There is an adjunction
Petri CMC F Petri U Petri
ATEGORIES OF NETS 5 whose left adjoint sends a Petri net P to the commutative monoidal category F Petri ( P ) where: • Objects are markings of P , i.e., elements of the free commutative monoidon its set of places. • Morphisms are generated inductively by the following rules: – for each place s there is an identity s : s → s – for each transition τ of P , there is a morphism going from its sourceto its target – for every pair of morphisms f : x → y and f ′ : x ′ → y ′ , there is amorphism f ⊗ f ′ : x ⊗ x ′ → y ⊗ y ′ – for every pair of composable morphisms f : x → y and g : y → z , thereis a morphism g ◦ f : x → z and quotiented to satisfy the axioms of a commutative monoidal category.Proof. This is a special case of [27, Theorem 5.1]. See also [2, Lemma 9]. (cid:3)
As noted in Section 1, we view this construction as associating to each net amonoidal category of its “executions”. The objects of this category are markingsthat accord with the collective token philosophy: for instance, if p and q are places,the object 2 p + 3 q has two tokens on p and three tokens on q , but no way todistinguish between the former two tokens or between the latter three. Similarly,the morphisms in this category are equivalence classes of firing sequences. Thisinterpretation is particularly captivating if we represent morphisms in a monoidalcategory using string diagrams.However, the equivalence relation on firing sequences that determines when twodefine the same morphism is very coarse when we take the commutative monoidalcategory freely generated by a Petri net. Indeed, if f, g : x → x are morphisms in acommutative monoidal category, the following sequence of equations holds: fgx xx x = fgxx xx = fgxx x x = fg xx x x These equations imply that given any two firing sequences f and g that start andend at some marking x , the commutative monoidal category cannot distinguishwhether they act independently or whether f acts on the tokens already processedby g . When x is the tensor unit, the equations above hold in any symmetricmonoidal category. But in a commutative monoidal category, the above equationshold for any object x . 4. Pre-nets
The shortcomings of commutative monoidal categories we presented in the lastsection are overcome by using symmetric monoidal categories where the symmetriesare not necessarily identity morphisms. One popular approach first builds monoidalcategories and then freely adds symmetries. In 1991 Joyal and Street [20] introduced“tensor schemes”, which can be used to describe free strict monoidal categories. In2001, essentially the same idea was introduced by Bruni, Meseguer, Montanari andSassone [8] under the name “pre-nets”. However, for these authors, the use of pre-nets to describe free strict monoidal categories was just the first stage of a procedureto obtain free symmetric strict monoidal categories. We recall this procedure now.
JOHN C. BAEZ, FABRIZIO GENOVESE, JADE MASTER, AND MICHAEL SHULMAN
Definition 4.1.
Let
PreNet be the category where: • An object is a pre-net : a pair of functions T s,t −→ S ∗ , where S ∗ is theunderlying set of the free monoid on S . • A morphism from T s ,t −−−→ S ∗ to T s ,t −−−→ S ∗ is a pair of functions f : S → S , g : T → T such that the following diagram commutes, where f ∗ denotes the unique monoid homomorphism extending f : S ∗ T S ∗ S ∗ T S ∗ f ∗ gs t f ∗ s t Graphically, a pre-net looks very similar to a Petri net, and we follow the conventionof [4] by decorating arcs with numbers to indicate their input/output order in atransition, as in:
This denotes that the place in the top left is used as the first and third input of thetransition, while the place in the bottom right is the second input. For the outputplace, no decorations are needed as the ordering is unambiguous.Pre-nets give rise to strict monoidal categories as follows.
Proposition 4.2.
There is an adjunction
PreNet StrMC F PreNet U PreNet whose left adjoint sends a pre-net Q to the strict monoidal category where: • Objects are elements of the free monoid on the set of places. • Morphisms are generated inductively by the following rules: – for each place s there is an identity s : s → s – for each transition τ of P , there is a morphism going from its sourceto its target – for every pair of morphisms f : x → y and f ′ : x ′ → y ′ , there is amorphism f ⊗ f ′ : x ⊗ x ′ → y ⊗ y ′ – for every pair of composable morphisms f : x → y and g : y → z , thereis a morphism g ◦ f : x → z and quotiented to satisfy the axioms of a strict monoidal category.Proof. This is [27, Prop. 6.1]. (cid:3)
The above adjunction can be composed with one defined in Proposition 7.1 toobtain an adjunction between pre-nets and strict symmetric monoidal categories:
PreNet StrMC SSMC . F PreNet F StrMC U PreNet U StrMC
ATEGORIES OF NETS 7
The composite adjunction
PreNet SSMC F ∗ U ∗ is used to obtain the categorical operational semantics of pre-nets under the indi-vidual token philosophy. This adjunction was first presented by Bruni, Meseguer,Montanari, and Sassone [8] with codomain a full subcategory of SSMC and waslater refined to above form in [27].This composite adjunction has also been used to give a categorical semantics forPetri nets [7, 8, 31]. For this, given a Petri net P , one first chooses a pre-net Q having P as its underlying Petri net, and the forms the symmetric strict monoidalcategory F ∗ ( Q ). However this semantics is not functorial, thanks to the arbitrarychoice involved.The category PreNet is better behaved than
Petri . The latter is not even cartesianclosed, for essentially the same reasons described in [10, 26], but the former iscartesian closed, and even a topos:
Proposition 4.3.
The category
PreNet is equivalent to a presheaf category.Proof.
It suffices to construct a category C so that functors from C to Set are thesame as pre-nets. Let C have an object p , and for every pair of natural numbers( n, m ), let C contain an object t ( m, n ). Here p stands for ‘places’, while t ( m, n )stands for ‘transitions with m inputs and n outputs’. Besides identity morphisms, C contains m morphisms s i : t ( m, n ) → p representing the source maps and n morphisms t j : t ( m, n ) → p representing the target maps. Composition in C istrivial.A pre-net T ( s,t ) −−−→ S ∗ × S ∗ can be identified with the functor C → Set that sends p to the set of places S , sends the object t ( m, n ) to the subset of T consisting oftransitions with m inputs and n outputs, and sends the morphisms s i , t j : t ( m, n ) → p to the functions that map each transition to its i -th input and j -th output. Amorphism of pre-nets ( f, g ) can then be identified with a natural transformationbetween such functors, with the p -component given by g and with the t ( m, n )-components given by the restrictions of f to the set of transitions with m inputs and n outputs. Naturality follows from the commutative diagrams in Definition 4.1. (cid:3) One downside of pre-nets is that ordering the inputs and outputs of transitionsseems artificial in many applications where Petri nets are heavily used [16, 35].This ordering also greatly restricts the available morphisms between pre-nets. Forexample, there is no morphism between the following pre-nets:
312 123 even though there is a morphism between their underlying Petri nets, in which theordering information has been forgotten.Furthermore, in the symmetric strict monoidal category F ∗ ( P ) coming from apre-net P , none of the symmetries σ x,y : x ⊗ y → y ⊗ x are identities, except when JOHN C. BAEZ, FABRIZIO GENOVESE, JADE MASTER, AND MICHAEL SHULMAN x or y is the unit object. Perhaps more importantly, if a transition in the pre-net F ∗ ( P ) gives a morphism t : x ⊗ · · · ⊗ x m → y ⊗ · · · ⊗ y n , where x i , y j are objects coming from places of P , the composite of t with symme-tries that permute the inputs x i and outputs y j is only equal to f if both thesepermutations are the identity.Thus, the SSMCs obtained from pre-nets exemplify an extreme version of theindividual token philosophy. Not only does each token have its own individualidentity, switching two tokens before or after executing the morphism correspondingto a transition always gives a different morphism.5. Σ -nets We have seen that Petri nets generate symmetric monoidal categories naturallysuited to the collective token philosophy, where the identity of individual tokensdoes not matter at all, so switching two never has an effect. On the other hand,we have just seen that pre-nets generate symmmetric monoidal categories suited toan extreme version of the individual token philosophy, in which switching tokens always has an effect.Now we introduce a new kind of nets, called Σ-nets, which in some sense liebetween these two extremes. In a Σ-net, one has control over which permutationsof the input or output of a transition alter the morphism it defines and which donot. This finer ability to control the action of permutations allow Σ-nets to behaveeither like Petri nets or pre-nets—or in a mixed way.
Lemma 5.1.
There is a forgetful functor Q : SSMC → Set that sends a symmetric strict monoidal category to its set of objects and sends astrict symmetric monoidal functor to its underlying function on objects. Q has aleft adjoint P : Set → SSMC that sends a set S to the symmetric strict monoidal category P S having (possiblyempty) words in S as objects, and permutations as morphisms.Proof. See Sassone [31, Sec. 3] or Gambino and Joyal [14, Sec. 3.1]. (cid:3)
Definition 5.2.
A Σ-net is a set S together with a functor N : P S × P S op → Set . A morphism between Σ-nets
P S × P S op1 N −→ Set and
P S × P S op2 M −→ Set is a pair( g, α ) where g : S → S is a function and α is a natural transformation filling thefollowing diagram: P S × P S op1
Set .P S × P S op2
P g × P g op NMα
ATEGORIES OF NETS 9
This defines the category Σ - net .The definition of Σ-net may seem unintuitive, but it is easily explained. Suppose N : P S × P S op → Set is a Σ-net. We call S its set of places . Objects of P S arewords of places. Given m, m ′ ∈ P S , we call an element of N ( m, m ′ ) a transition with source m and target m ′ . In Theorem 7.7 we describe how to freely generatea symmetric strict monoidal category C from the Σ-net N . In this construction,the transitions of N give morphisms that generate all the morphisms in C .More precisely: the objects of C are words of places. The tensor product ofobjects is given by concatenation of words, and the symmetry in C acts by permut-ing places in a word. Each transition t ∈ N ( m, m ′ ) gives a morphism t : m → m ′ in C , and all other morphisms are generated by composition, tensor product andsymmetries.Given a transition t ∈ N ( m, m ′ ), the action of the functor N : P S × P S op → Set on morphisms describes what happens to the corresponding morphism t : m → m ′ when we permute the places in its source and target: it gets sent to some othertransition (possibly the same one). We say two transitions t ∈ N ( m, m ′ ) and u ∈ N ( n, n ′ ) are in the same transition class if and only if there exists a morphism σ : ( m, m ′ ) → ( n, n ′ ) in P S × P S op such that N ( σ )( t ) = u. Example . There is a Σ-net N with just two places, say p and q , and just twotransitions, t ∈ N ( pq, ǫ ) and t ∈ N ( qp, ǫ ), where ǫ stands for the empty word.There are two morphisms in P S × P S op with domain ( pq, ǫ ), namely the identityand the swap ( pq, ǫ ) → ( qp, ǫ ). Since there is a unique function between any twosingleton sets, N of this swap must map t to t . Thus, both t and t lie in thesame transition class, and this Σ-net has just one transition class. Example . Now consider a Σ-net M with just two places p and q and exactlyfour transitions, with M ( pq, ǫ ) = { t , u } and M ( qp, ǫ ) = { t , u } . We set M ofthe swap ( pq, ǫ ) → ( qp, ǫ ) to act as the function { t , u } → { t , u } sending t to t and u to u . This Σ-net has exactly two transition classes: t and t represent onetransition class, and u and u represent the other. Note that if we instead definethe action of M on the swap to send t to u and t to u , then we would still havetwo transition classes; in fact this would be an isomorphic Σ-net.Examples 5.3 and 5.4 illustrate the situation when no place occurs more thanonce in the source or target of any transition. In this case, any two nonempty valuesof the functor N will be related by at most one morphism in P S × P S op , and thefunctorial action of N on such a morphism provides a way to canonically identifytheir values. Example . Next consider a net O with one place p and one transition, namely t ∈ O ( pp, ǫ ). There are still two morphisms in P S × P S op with domain ( pp, ǫ ),the identity and the swap, but now both have ( pp, ǫ ) as codomain as well. Thereis still only one transition class, but now t is mapped to itself by both morphisms( pp, ǫ ) → ( pp, ǫ ), the identity and the swap.Given a group G acting on a set X , the isotropy group of x ∈ X is thesubgroup of G consisting of elements that map x to itself. Thus, in Example 5.5,unlike Example 5.4, we are seeing a transition with a nontrivial isotropy group. In fact, because permutations act trivially on all transitions, the Σ-net of Example 5.5belongs to the image of Petri under the functor G pet : Petri → Σ - net described inProposition 7.4. Example . Next consider a Σ-net Q with one place p and precisely two transitionswith Q ( pp, ǫ ) = { t , t } . Suppose that Q of the identity ( pp, ǫ ) → ( pp, ǫ ) actsas the identity function (as it must), while Q of the swap acts by t t and t t . Then t and t represent the same transition class, so there is onceagain only one transition class. The isotropy groups of t and t are trivial. Infact, because permutations act freely on the transitions in every transition class,this Σ-net belongs to the image of PreNet under the functor F pre : PreNet → Σ - net described in Theorem 7.3. Example . Now let us give an example blending features from Examples 5.5and 5.6. For this, we create a Σ-net R that has one place p and three transitions t , t , u ∈ R ( pp, ǫ ), such that t and t are order-sensitive while u is not. This Σ-netmaps ( ss, ǫ ) to { t , t , u } and everything else to the empty set. The action of theswap automorphism of ( ss, ǫ ) switches t , t and fixes u . As a result, this Σ-net hastwo transition classes: t , t are both representatives of one transition class, while u represents the other. This Σ-net is not in the image of G pet : Petri → Σ - net or F pre : PreNet → Σ - net ; it mixes the two worlds.There is a graphical way to represent a Σ-net: we draw it in three dimensions,where a transition class is depicted like a tank containing all the permutations thatact trivially on an arbitrarily chosen transition in this transition class. Below, youcan see two examples of Σ-nets:The left one is Example 5.5, where the identity and the swap both act trivially.The right one is Example 5.6, where only the identity acts trivially. The Σ-nets ofExamples 5.3 and 5.7 are instead:Note that although each transition class is a set of transitions, and each tankrepresents a single transition class, the pictures inside that tank do not representthe transitions in that class. Rather, these pictures represent the isotropy group of a single arbitrarily chosen transition that belongs to the class in question. Thenumber of transitions and the size of the isotropy group are inversely related: theirproduct is the cardinality of the total symmetry group with the given inputs andoutputs. In the simple examples drawn above, this total symmetry group is S : ATEGORIES OF NETS 11 thus when a transition class contains one transition this transition has isotropygroup S , and when it contains two transitions, each has trivial isotropy group.Albeit intuitive, this graphical formalism quickly becomes disadvantageous forlarge nets. In this case, we can instead draw our nets as we usually draw Petri nets,and decorate the transitions with the relevant isotropy groups—and when this groupis trivial, we can omit it. In this style of drawing, the nets of Examples 5.5 and 5.6look as follows: S Perspectives on the category Σ -net The definition of Σ-nets in Section 5 gives what may be called a “profunctorial”perspective: a Σ-net is a functor from
P S × P S op to Set , which is the same as aprofunctor from
P S to itself. This perspective will be useful in constructing theadjunction between Σ - net and SSMC in Theorem 7.7. However, there are otherperspectives on Σ-nets, leading to two alternative descriptions of Σ - net , useful forother purposes.6.1. The presheaf perspective.Theorem 6.1. Σ - net is equivalent to a presheaf category.Proof. We construct a category D so that functors from D to Set can be identifiedwith Σ-nets. To construct D , we take the category C from Proposition 4.3 andthrow in extra automorphisms of each object t ( m, n ), making its automorphismgroup S m × S n . For a source map s i : t ( m, n ) → p and an automorphism ( σ, τ ) ∈ S m × S n , we set the composite s i ◦ ( σ, τ ) equal to s σ ( i ) . Similarly, for a targetmap t j : t ( m, n ) → p , we set the composite t j ◦ ( σ, τ ) equal to t τ ( j ) . Then, for eachΣ-net N : P S × P S op → Set , there is a corresponding functor ν : D → Set definedas follows. It sends the object p ∈ D to the set of places of N . It sends each object t ( m, n ) ∈ D to the disjoint union of the sets N ( a, b ) over all a ∈ P S with length m and b ∈ P S with length n . It sends the morphisms s i , t j : t ( m, n ) → p to thefunctions that a map any transition to its i th input and j th output. Finally, thisfunctor ν sends the permutations ( σ, τ ) to the natural actions of the symmetricgroup on the transitions of N . For a morphism of Σ-nets ( g, α ) : N → N ′ , there isa natural transformation between their functors whose p -component is given by g and whose t ( m, n )-components are given by disjoint unions of the components of α .One can check that the resulting functor from Σ - net to Set D is an equivalence. (cid:3) Theorem 6.1 fills an important gap between Petri nets and graphs. Indeed,whereas the category of graphs and their morphisms is a presheaf category, thecategory
Petri is not. Theorem 6.1 has a lot of nice consequences, such as: • Σ - net is complete and cocomplete. This is particularly important sincemany compositional approaches to Petri nets rely on colimits; for example,composition of open Petri nets is done using pushouts (see Section 9), whiletensoring them is done using coproducts [2]. • Σ - net is a topos, and thus an adhesive category [24], so it admits a theory ofdouble pushout rewriting [23]. This is relevant as double pushout rewriting is a widely used technique to transform graph-like structures in the litera-ture [13]. The internal logic of toposes is very rich, and understanding itsimplications for Σ-nets is an interesting direction for future work.The category D in Theorem 6.1 is equivalent to Kock’s category of “elemen-tary graphs” [21, 1.8]. Thus, Σ - net is equivalent to his category of “digraphicalspecies” [21, 1.14].6.2. The groupoidal perspective.
The profunctorial and presheaf perspectiveshighlight the transitions of a Σ-net over its transition classes. Sometimes, how-ever, we want to work directly with the transition classes; we now describe a thirdperspective that permits this.Firstly, it is well-known [25, Theorem 2.1.2] that a functor N : P S × P S op → Set is equivalent to a discrete opfibration T → P S × P S op . In addition to this, amorphism of Σ-nets is equivalently a commutative square T T P S × P S op1
P S × P S op2 gP f × P f op Note that this looks much more similar to the definitions of the categories
PreNet and
Petri . The set of objects of T here is the disjoint union of the sets N ( p, p ′ ),i.e., the transitions rather than the transition classes. The transition classes arethe isomorphism classes of the groupoid T . To contract these down to singleobjects, we can replace it by an equivalent groupoid that is skeletal , i.e., thereare no morphisms x → y for objects x = y , or equivalently each isomorphism classcontains exactly one object. After such a replacement the functor T → P S × P S op is no longer a discrete opfibration, but it is still faithful; and we now have to allowthe morphisms to commute only up to isomorphism. Theorem 6.2.
The category of Σ -nets is equivalent to the following category: • Its objects are faithful functors T → P S × P S op , where S is a set and T is a skeletal groupoid. • Its morphisms are squares that commute up to specified isomorphism T T P S × P S op1
P S × P S op2 g ∼ = θP f × P f op modulo the equivalence relation that two such morphisms ( f, g, θ ) and ( f ′ , g ′ , θ ′ ) are considered equal if f = f ′ and there is a natural isomorphism φ : g ∼ == ⇒ g ′ such that gg ′ gP f × P f op P f × P f op T T = T T ∼ = θ ′ ∼ = θ ⇒ φP S × P S op1
P S × P S op2
P S × P S op1
P S × P S op2
ATEGORIES OF NETS 13
Note that since T → P S × P S op2 is faithful, such a φ is unique if it exists.Thus, the category described in the theorem is in fact equivalent to the evident2-category having as 2-morphisms natural isomorphisms φ as above. Proof.
Define a category P as in the theorem, but where the objects allow T to beany groupoid. Then there is a functor Σ - net → P , since discrete opfibrations arefaithful and strictly commutative squares also commute up to isomorphism. Thisfunctor is faithful, since if θ and θ ′ are identities so is φ , by the faithfulness of T → P S × P S op2 . Moreover, any morphism in P whose target T → P S × P S op2 is a discrete opfibration has a representative that commutes strictly, since we canlift the isomorphism θ to an isomorphism φ with θ ′ an identity. Thus, the functor Σ - net → P is also full.Let the pseudo slice 2-category over a groupoid B be the 2-category withgroupoids over B as objects, triangles commuting up to natural isomorphism A A ′ ∼ = θ B g as morphisms, and the evident 2-morphisms [29, Definition 3.2]. Any groupoid over B is equivalent, in the pseudo slice 2-category of B , to a fibration [36, Theorem 6.7],which in the groupoid case is the same as an opfibration. If f : A → B is faithfulthen this opfibration will be as well, so f is equivalent to a discrete opfibration.Since equivalences in the pseudo slice 2-category yield isomorphisms in P , thefunctor Σ - net → P is also essentially surjective, and hence an equivalence.The category described in the theorem is a full subcategory of P , so it sufficesto show that every object of P is isomorphic to one where T is skeletal. Butany groupoid is equivalent to a skeletal one, and such an equivalence preservesfaithfulness and yields an isomorphism in P . (cid:3) Note that the construction in the final paragraph taking a groupoid to a skeletalone preserves connected components, while in the output each connected componenthas exactly one object. Thus, in the representation described in Theorem 6.2 theobjects of the groupoid T really are precisely the transition classes. Since thetransition classes of a Σ-net correspond to the transitions of a Petri net, we canthink of a Σ-net as a Petri net together with, for each transition, (1) a lifting of itssource and target multisets to words, and (2) an isotropy group that acts faithfullyon those words, i.e., maps injectively to the subgroup of Σ m × Σ n that fixes bothof those words. Example . If we start from a transition in a Petri net t : 3 a + 2 b → c , then wecould lift it to a transition in a Σ-net by defining t : aaabb → cccc and equipping itwith any subgroup of Σ × Σ × Σ , which describes the “degree of collectivization”of t . If the isotropy group is trivial, then our Σ-net behaves like a pre-net—tokensare “fully individualized”—whereas if it is as large as possible then it behaves asa Petri net—tokens are “fully collectivized”. This idea is heavily used in the nextsection to describe the adjunctions between Petri , PreNet and Σ - net . Description of the adjunctions
Now we describe in detail all the adjunctions between the categories in play. Weagain include the diagram of Section 2, but now with most of the functors labeled.(1)
StrMC SSMC CMCPreNet Σ - net Petri F StrMC U PreNet U StrMC F SSMC U Σ - net U Petri U SSMC F PreNet F pre H pre F Σ - net F pet F Petri G pet The adjunctions in the top row can be constructed using standard tools, such asthe adjoint functor theorem or the adjoint lifting theorem.
Proposition 7.1.
There is an adjunction
StrMC SSMC . F StrMC ⊥ U StrMC
Here, U StrMC freely adds symmetries to a strict monoidal category, while U StrMC sends any symmetric strict monoidal category to its underlying strict monoidalcategory.
Proposition 7.2.
There is an adjunction
SSMC CMC . F SSMC ⊥ U SSMC F SSMC takes a symmetric strict monoidal category and imposes a law saying that allsymmetries are identity morphism, while U SSMC sends any commutative monoidalcategory to its underlying symmetric strict monoidal category.The adjunction between
Petri and
CMC was recalled in Proposition 3.3, whilethat between
PreNet and
StrMC was recalled in Proposition 4.2. We now cover themiddle column and bottom row of the diagram, which are new.
Theorem 7.3.
There is a triple of adjoint functors
PreNet Σ - net . F pre H pre G pre Proof.
For this proof it is most convenient to work with the presheaf perspective. Inthe proof of Proposition 4.3 we described a category C such that PreNet ∼ = [ C , Set ]and in the proof of Theorem 6.1 we described a category D such that Σ - net ∼ =[ D , Set ]. Recall that D is built by starting with the objects and morphisms of C and adding new morphisms and equations. The inclusion gives a functor i : C → D which induces a functor Σ - net ∼ = [ D , Set ] ( − ) ◦ i −−−→ [ C , Set ] ∼ = PreNet given by precomposition with i . The composite functor above is the forgetful func-tor G pre . Therefore G pre has a left adjoint F pre : PreNet → Σ - net given by left Kan ATEGORIES OF NETS 15 extension along i and a right adjoint H pre : PreNet → Σ - net given by right Kanextension along i . (cid:3) Let us spell out what the functors F pre , G pre , H pre do in detail, making use ofour graphical representation. F pre constructs tanks.: For this functor we work in the groupoid repre-sentation of Σ-nets. A pre-net T ( s,t ) −−−→ S ∗ × S ∗ is sent to the Σ-net T F pre ( s,t ) −−−−−→ P S × P S op , where T denotes the discrete groupoid having T as underlying set of objects. Since T is discrete, the functor F pre ( s, t )only needs to be defined on objects, which we do by taking the composite T ( s,t ) −−−→ S ∗ × S ∗ → P S × P S op using the fact that S ∗ is the set of objects of P S . A morphism of pre-nets ( f, g ) : ( s , t ) → ( s , t ) induces a morphism of Σ-nets: g : T → T lifts to a morphism between discrete groupoids and f : S → S lifts to afunctor P S × P S op1 → P S × P S op2 . The relevant square as in Theorem 6.2commutes strictly. F pre takes a pre-net and builds from it a Σ-net with trivial isotropygroups. Graphically, this amounts to enclosing every transition of the givenpre-net in a tank: F pre In particular, the transition classes of F pre ( N ) are the transitions of N ,and each such class contains as many transitions as possible. G pre explodes tanks.: For this functor we work in the profunctor represen-tation. A Σ-net
P S × P S op N −→ Set is sent to the pre-net having S as itsset of places and the disjoint union of all sets N ( a, b ), for any a, b objects of P S , as its set of transitions. For each transition, input and output placesare defined using the inverse image of N . That is, the transitions of G pre N are the transitions of N , with their grouping into classes and their isotropygroups forgotten.We can give a different interpretation of this using the groupoid per-spective. Suppose T N −→ P S × P S op is a Σ-net. Then for each object t of T such that N ( t ) is a pair of strings of length m and m there will be S m × S n / hom T ( t, t ) transitions in G pre N , where S n denotes the group ofpermutations over a string of n elements. Graphically, this is representedby “exploding” a tank with m inputs and n outputs and introducing m ! n ! /k pre-net transitions, where k is the number of elements in the tank. G pre In the image above, we see the behavior of G pre on a Σ-net having a tran-sition with trivial isotropy group, while in the image below G pre is used ona Σ-net having a transition with 2-element isotropy group. G pre H pre matches transitions.: While F pre builds as many tanks as we can getfrom a pre-net’s transitions, H pre bundles pre-net transitions sharing thesame inputs/outputs modulo permutations, whenever they complete theircorresponding symmetry groups. For instance, in the figure below transi-tions x and y complete the permutation group S × S , and hence they giverise to the tank denoted with h x, y i . The same happens for transitions x and z , giving rise to tank h x, z i . x y z H pre h x , y i h x , z i The following pre-net does not have enough transitions to complete thesymmetry group of its inputs/outputs. As such, H pre cannot match thistransition with anything, and does not produce any tank. H pre In the following case, the pre-net has a repeated input. H pre is then able tomatch the transtion with itself, producing a maximally commutative tank. H pre Looking at these examples, we see that in general the transitions of N donot correspond directly to either the transitions of H pre ( N ) or the transitionclasses of H pre ( N ). Proposition 7.4.
There is an adjunction Σ - net Petri . F pet G pet Proof.
Note first that
Petri is by definition precisely the comma category (
Set ↓ ( N [ − ] × N [ − ])). Similarly, if we identify a Σ-net with a functor N : P S × P S op → Set
ATEGORIES OF NETS 17 and thereby with a discrete opfibration N → P S × P S op , then Σ - net becomesidentified with the full subcategory of the comma category ( Cat ↓ ( P ( − ) × P ( − ) op ))consisting of the discrete opfibrations.Now note that Set is a reflective full subcategory of
Cat , with reflector π thattakes the set of connected components of a category. Moreover, we have π ( P S × P S op ) ∼ = N [ S ] × N [ S ]. Thus, Lemma 7.5, proven below (and applied with D = Cat , C = E = Set , and K = P ( − ) × P ( − ) op ), shows that we have an adjunction( Cat ↓ ( P ( − ) × P ( − ) op )) ( Set ↓ ( N [ − ] × N [ − ])) = Petri FG in which the left adjoint F applies π to both domain and codomain, and theright adjoint G pulls back along the unit P S × P S op → N [ S ] × N [ S ]. Therefore,it suffices to observe that this right adjoint takes values in discrete opfibrations,hence in Σ - net . (cid:3) Lemma 7.5.
Let E be a reflective subcategory of D , with reflector π : D → E , andlet K : C → D be a functor where D has pullbacks. Then there is an adjunction ( D ↓ K ) ( E ↓ ( π ◦ K )) . FG Proof.
Let η X : X → πX denote the unit of the reflection. Then for any f : S → S in C , we have η KS ◦ Kf = πKf ◦ η KS by naturality; we denote this common mapby η f . Now there is a profunctor between ( D ↓ K ) and ( E ↓ ( π ◦ K )) defined to take T → KS and T → πKS (where T ∈ D and T ∈ E ) to the set of pairs ( f, g )where f : S → S in C and g : T → T in D make the following square commute: T T KS πKS . gη f This profunctor is representable on both sides, because any such square factorsuniquely in both of the following ways: T πT T KS πKS πKS η T η KS πKf T • T KS KS πKS . y Kf η KS On the left, the factorization is by the universal property of η T , while on the right itis by the universal property of the pullback. Therefore, there is an adjunction F ⊣ G as desired, where F takes T → KS to πT → πKS , and G takes T → πKS tothe pullback of T to KS . (cid:3) Note that by construction, this adjunction is a reflection, i.e., the right adjoint G pet is fully faithful. We can illustrate the action of F pet and G pet with examples. F pet deflates tanks.: In the groupoid perspective, this functor takes a Σ-net T N −→ P S × P S op and maps it to the Petri net having the underlyingset of objects of T as transitions, S as places, and input/output functionsinduced by the mapping on objects of N . The action on a morphism ( g, f ) is obtained by restricting the functor g to its mapping on objects. Graphically, F pet just deflates tanks, replacing each tank by a single transition: F pet −−−→ F pet −−−→ In particular, the transitions of F pet ( N ) are the transition classes of N . G pet builds tanks as big as possible.: Petri nets are mapped under G pet to corresponding Σ-nets that have the largest isotropy groups possible.Consider a transition t in a Petri net N . Its inputs and outputs will be acouple of unordered strings of length n, m , respectively. Pick any orderingfor these strings, and call them a, b , respectively. Finally, let G t be thesubgroup of S n × S m that fixes the pair of strings ( a, b ). N is mapped to a Σ-net T G pet N −−−−→ P S × P S op whose groupoid T hastransitions of N as objects and, for each t in T , G t as its group of endomor-phisms. N maps t to the ordering ( a, b ) we have chosen before. It can beseen that picking different orderings of the input/output of each transitiongives isomorphic results.Graphically, out of each Petri net we build a corresponding Σ-net thathas its tanks as full as possible: G pet Thus, the transition classes of G pet ( N ) are the transitions of N . Remark . Note that F pre and G pet both build a Σ-net whose transition classesare the transitions of a pre-net or Petri net. On the other hand, G pre and F pet are“dual”, in that they build a pre-net or Petri net whose transitions are, respectively,the transitions or the transition classes of a Σ-net. In particular, the composite F pet ◦ F pre preserves transitions: it is the functor PreNet → Petri that simplyforgets the ordering of inputs and outputs. Its right adjoint G pre ◦ G pet explodeseach transition of a Petri net into as many transitions of a pre-net as possible,giving its inputs and outputs all possible orderings.The last adjunction to construct is the one in the middle column: ATEGORIES OF NETS 19
Theorem 7.7.
There is an adjunction Σ - net SSMC . F Σ - net ⊥ U Σ - net Two proofs of Theorem 7.7 were sketched by Kock [21, §§ Q : these two propositions followby taking Q to be the theory of commutative monoids and the theory of monoids,respectively. In that proof, an adjunction between Q -nets and Q -categories (i.e., Q -algebras in Cat ) was obtained as the composite of two adjunctions where theintermediate category consists of Q -graphs: graphs internal to the category of Q -algebras. Note that these Q -graphs have operations coming from the Lawvere the-ory Q , which act both on vertices and edges, but they lack the ability to composeedges (i.e., morphisms) that one has in a Q -category.Our desired adjunction here is not a special case of [27, Theorem 5.1], since thesymmetries in a symmetric monoidal category cannot be represented by a structureon the object set alone. However, we can perform a similar factorization througha category containing only the monoidal operations. We begin by reducing theproblem from strict symmetric monoidal categories to (colored) props. Definition 7.8. A (colored) prop consists of a set S , a strict symmetric monoidalcategory B , and a strict symmetric monoidal functor i : P S → B that is bijective onobjects. A morphism of props consists of a function S → S ′ and a strict symmetricmonoidal functor B → B ′ making the evident square commute. We denote thecategory of props by PROP . Lemma 7.9.
There is an adjunction
PROP SSMC . F ⊥ U Proof.
For a prop (
S, B, i ) we define F ( S, B, i ) = B . And for a strict symmetricmonoidal category B , we let S be the set of objects of B , so that we have a strictsymmetric monoidal functor P S → B . Now we factor this functor as a bijective-on-objects functor i : P S → B ′ followed by a fully faithful one p : B ′ → B . Then B ′ can be given a symmetric strict monoidal structure making both i and p strictsymmetric monoidal functors, and we define U ( B ) = ( S, B ′ , i ). (cid:3) Therefore, it will suffice to construct an adjunction between Σ - net and PROP .We work with the profunctor representation of Σ-nets. Let U : PROP → Σ - net bethe functor sending ( S, B, i ) to (
S, N ) where N ( a , a ) = hom B ( i ( a ) , i ( a )). Thisis the functor we aim to construct a left adjoint of. As in [27], we do this “fiberwise”for a fixed A , then piece the fiberwise adjunctions together. Lemma 7.10.
We have a commutative triangle Σ - net PROPSet U in which the two diagonal functors are split fibrations and U is cartesian. Proof.
The two diagonal functors send (
S, N ) to S and ( S, B, i ) to S , respectively.To show the left-hand diagonal functor is a split fibration, let ( S, H ) ∈ Σ - net and g : S ′ → S ; then ( S ′ , N ◦ ( P g × P g op )) is the domain of a cartesian lifting. Forthe right-hand functor, given ( S, B, i ) ∈ PROP and g : S ′ → S , the composite i ◦ g : P S ′ → B may no longer be bijective on objects, but we can factor it as abijective-on-objects functor i ′ : P S ′ → B ′ followed by a fully faithful one g ′ : B ′ → B . These are both again strict symmetric monoidal functors, and the induced map( S ′ , B ′ , i ′ ) → ( S, B, i ) is cartesian. Finally, U is cartesian by construction, since g ′ is fully faithful. (cid:3) Let U ,S : Σ - net S → PROP S denote the restriction of U to the fibers over aparticular set S . We will construct a left adjoint F ,S of this functor, then piecethese together fiberwise.Following the proof of [27], we need to decompose the structure of a prop withobject set S into the “monoidal piece” and the “composition piece”. This can beaccomplished as follows. Batanin and Markl [6] define a duoidal category to bea category C with two monoidal structures ( ⋆, J ) and ( ⋄ , I ) and additional naturalmorphisms I → J I → I ⋆ I J ⋄ J → J ( A ⋆ B ) ⋄ ( C ⋆ D ) → ( A ⋄ C ) ⋆ ( B ⋄ D )satisfying axioms that say ( ⋆, J ) is a pseudomonoid structure on ( C , ⋄ , I ) in the 2-category of lax monoidal functors. It is ⋄ -symmetric if ⋄ is a symmetric monoidalstructure and the above maps commute with the symmetry in an evident way.In a duoidal category, the monoidal structure ⋆ lifts to a monoidal structure onthe category of ⋄ -monoids. A ⋆ -monoid in this monoidal category of ⋄ -monoidsis called a duoid . Similarly, if the duoidal category is ⋄ -symmetric, then ⋆ liftsto the category of commutative ⋄ -monoids, and a monoid therein is called a ⋄ -commutative duoid . Lemma 7.11.
There is a ⋄ -symmetric duoidal structure on Σ - net S whose categoryof ⋄ -commutative duoids is equivalent to PROP S .Proof. Note that Σ - net = Prof ( P S, P S ) is the hom-category of
P S in the bicat-egory
Prof of categories and profunctors. Since this is an endo-hom-category ina bicategory, it has a monoidal structure given by composition in
Prof , which wecall ⋆ (thus J is the hom-functor of A ). The monoidal structure ⋄ is given byconvolution:( H ⋄ K )( x, z ) = Z a,b,c,d P S ( x, ab ) × H ( a, c ) × K ( b, d ) × P S ( cd, z ) . with I ( x, y ) = P S ( x, ǫ ) × P S ( ǫ, y ).A ⋆ -monoid is a monad on P S in the bicategory
Prof , which is well-known to beequivalent to a category B with a bijective-on-objects functor P S → B . Applyingthe Yoneda lemma, we find that a ⋄ -monoid structure on such a B consists ofmorphisms B ( a, c ) × B ( b, d ) → B ( ab, cd )that are suitably compatible. This extends the monoidal structure of P S to thearrows of B (it is already defined on the objects of B since they are the same asthe objects of A ). Compatibility with the duoidal exchange morphism says that ATEGORIES OF NETS 21 this action is functorial, while compatibility with the map J ⋄ J → J says that itextends the functorial action of the monoidal structure on P S . The associativityand unitality of a ⋄ -monoid says B has a strict monoidal structure and the functor P S → B is strict monoidal. Finally, the symmetry of ⋄ switches H and K and com-poses with the symmetry isomorphisms in P S on either side; thus ⋄ -commutativityof a duoid makes B a symmetric strict monoidal category and P S → B a strictsymmetric monoidal functor. (cid:3) In fact, an analogous result holds with
P S replaced by any symmetric monoidalcategory. A more abstract construction of this duoidal structure was given byGarner and L´opez Franco [15, Proposition 51], while the identification of its duoidsfollows from their Proposition 49 and the remarks after Proposition 54. Note thatthe adjective “commutative” in [15] is used with a different meaning than ours;we repeat that for us, “ ⋄ -commutative” simply means that the monoid structurewith respect to ⋄ is commutative in the ordinary sense for a monoid object in asymmetric monoidal category.Note that both monoidal structures ⋆ and ⋄ of Σ - net S preserve colimits in eachvariable. We can now work at a higher level of abstraction. Lemma 7.12.
For any cocomplete ⋄ -symmetric duoidal category C such that ⋆ and ⋄ preserve colimits in each variable, the forgetful functor ⋄ : CommDuoid ( C ) → C has a left adjoint.Proof. Recall that free commutative monoids exist in any cocomplete monoidalcategory whose tensor product preserves colimits in each variable, given by
F X = a n X ⋄ n / Σ n where X ⋄ n / Σ n denotes the n th tensor power of X quotiented by the action ofthe n th symmetric group. Indeed, commutative monoids are monadic over such acategory. Thus, the category of commutative ⋄ -monoids in our C is monadic over C . Moreover, since ⋄ preserves colimits in each variable, by standard arguments itpreserves reflexive coequalizers and sequential colimits in both variables together.Thus X X ⋄ n also preserves reflexive coequalizers and sequential colimits, henceso does the functor F and thus the monad for commutative ⋄ -monoids. It followsthat reflexive coequalizers and sequential colimits in the category of commutative ⋄ -monoids are computed as in C , and therefore are preserved in each variable bythe lifted tensor product ⋆ . Therefore, by [22], the free ⋆ -monoid on a commutative ⋄ -monoid exists. Composing these two free constructions, we find that free ⋄ -commutative duoids exist. (cid:3) Lemma 7.13.
There is an adjunction Σ - net PROP . F ⊥ U Proof.
By Lemmas 7.11 and 7.12, each fiber functor U ,S has a left adjoint F ,S ; thusit remains to piece these adjoints together. Suppose ( S ′ , N ) ∈ Σ - net and ( S, B, i ) ∈ PROP . By Lemma 7.10, a morphism ( S ′ , N ) → U ( S, B, i ) is equivalently given by a function g : S ′ → S and a morphism ( S ′ , N ) → U ,S ′ ( S ′ , B ′ , i ′ ) in Σ - net S ′ , where P S ′ i ′ −→ B ′ g ′ −→ B is the factorization of i ◦ P g as a bijective-on-objects functorfollowed by a fully faithful one. But the latter morphism is equivalently a morphism F ,S ′ ( S ′ , N ) → ( S ′ , B ′ , i ′ ) in PROP S ′ , hence a morphism F ,S ′ ( S ′ , N ) → ( S, B, i ) in
PROP . Thus, defining F ( S ′ , N ) = F ,S ′ ( S ′ , N ) yields a left adjoint to U . (Notethat it is unnecessary to ask whether F is cartesian.) (cid:3) Proof of Theorem 7.7.
Combining Lemmas 7.9 and 7.13 we obtain the compositeadjunction: Σ - net PROP SSMC . F ⊥ F ⊥ U U (cid:3) We end this section by considering the commutativity properties of the squaresin eq. (1).
Proposition 7.14.
There is a natural isomorphism G pre ◦ U Σ - net ∼ = U PreNet ◦ U StrMC .Therefore, there is also a natural isomorphism F StrMC ◦ F PreNet ∼ = F Σ - net ◦ F pre .Proof. With our precise definitions, the first isomorphism is actually a strict equal-ity: both functors take a symmetric strict monoidal category C to the pre-net whoseplaces are the objects of C and whose transitions from a word p to a word q arethe morphisms in C from the tensor product of p to the tensor product of q . Thesecond isomorphism follows by passage to left adjoints. (cid:3) Recalling from Section 4 that the composite F StrMC ◦ F PreNet has been used togive a categorical semantics for pre-nets, we see that this semantics factors throughΣ-nets.
Proposition 7.15.
There is a natural isomorphism G pet ◦ U Petri ∼ = U Σ - net ◦ U SSMC .Therefore, there is also a natural isomorphism F SSMC ◦ F Σ - net ∼ = F Petri ◦ F pet .Proof. Again, the first isomorphism is a strict equality: both functors take a com-mutative monoidal category C to the Σ-net whose places are the objects of C andwhose transitions from p to q are the morphisms in C from the tensor product of p tothe tensor product of q , with symmetries acting trivially. The second isomorphismfollows by passage to left adjoints. (cid:3) Though analogous to Proposition 7.14, Proposition 7.15 does not imply that thecategorical semantics of Petri nets factors through Σ-nets. However, that is alsotrue:
Proposition 7.16.
There is a natural isomorphism F Petri ∼ = F SSMC ◦ F Σ - net ◦ G pet .Proof. Let N be a Petri net and C a commutative monoidal category; since G pet is fully faithful we have natural isomorphisms Petri ( N, U
Petri ( C )) ∼ = Σ - net ( G pet ( N ) , G pet ( U Petri ( C ))) ∼ = Σ - net ( G pet ( N ) , U Σ - net ( U SSMC ( C ))) ∼ = SSMC ( F Σ - net ( G pet ( N )) , U SSMC ( C )) ∼ = CMC ( F SSMC ( F Σ - net ( G pet ( N ))) , C ) . Thus F SSMC ◦ F Σ - net ◦ G pet is left adjoint to U Petri , hence isomorphic to F Petri . (cid:3) ATEGORIES OF NETS 23 Relation to whole-grain Petri nets
We now clarify the relation of our work to Kock’s “whole-grain Petri nets” [21].We show that a whole-grain Petri net can be thought of as a special sort of Σ-net:one that is free on a pre-net. We first recall Kock’s definition:
Definition 8.1. A whole-grain Petri net is a diagram S I T O S in which the fibers of the functions I → T and O → T are finite. A morphism ofwhole-grain Petri nets, sometimes called an etale map , is a diagram S I T O SS ′ I ′ T ′ O ′ S ′ y x This defines the category
WGPet . Theorem 8.2.
The category
WGPet is equivalent to the full image of F pre : PreNet → Σ - net . In other words, there are functors PreNet WGPet Σ - net Z Z such that Z is essentially surjective, Z is fully faithful, and the composite Z ◦ Z is isomorphic to F pre .Proof. Given a pre-net s, t : T → S ∗ × S ∗ , let I be the set of transitions u ∈ T equipped with a choice of an element of s ( u ), and define O similarly using t ( u ).There are forgetful functions I → T and O → T , and maps I → S (resp. O → S )that select the chosen element of s ( u ) (resp. t ( u )). This defines a whole-grain Petrinet Z ( s, t ). Note that the fibers of I → T and O → T are not just finite butequipped with a linear ordering, and the morphisms in the image of Z (which isfaithful) are precisely those that preserve these orderings.To see that Z is essentially surjective, given a whole-grain Petri net N we chooselinear orderings on each fiber of the maps I → T and O → T . These orderingsassociated each element of T to two elements of S ∗ , yielding a pre-net whose imageunder Z is isomorphic to N .Now, given a whole-grain Petri net S ← I → T ← O → S , we define a Σ-net inthe presheaf perspective. Its set of places is S , and its ( m, n )-transitions are ele-ments u ∈ T equipped with a linear ordering on the fibers of I and O over u , whichwe require to have m and n elements respectively. These linear orderings enableus to define the source and target maps picking out places, while the permutationsact on the linear orderings. This defines the functor Z .Note that the set T in a whole-grain Petri net N is naturally isomorphic tothe set of transition classes of Z ( N ). Thus, to show that Z is fully faithful itremains to show that a morphism α : Z ( N ) → Z ( N ′ ) uniquely determines themaps I → I ′ and O → O ′ . Given i ∈ I lying over t ∈ T , choose any ordering onthe fibers over t , in which i appears as the k th element of its fiber. This choicedetermines a transition ˆ t of Z ( N ), and hence a transition α (ˆ t ) of Z ( N ′ ), whichis an element ˇ α (ˆ t ) of T ′ with ordered fibers. Then the function I → I ′ can andmust send i to the k th element of the I -fiber over ˇ α (ˆ t ). This is independent of the choice of ordering because α commutes with the permutation actions, and it isstraightforward to check that it indeed defines a morphism N → N ′ .Finally, the composite Z ◦ Z preserves the set of places and replaces each ( m, n )-transition by m ! n ! transitions with free permutation action; but this is the sameas F pre . (cid:3) Another construction of the functor Z appears in [21], as a restricted Yonedaembedding or “nerve”. Recall the categories C and D from Proposition 4.3 and The-orem 6.1. In fact D is the full image of the composite of the Yoneda embedding C ֒ → [ C op , Set ] ≃ PreNet with Z : PreNet → WGPet ; we can then define Z as thecomposite WGPet → [ WGPet op , Set ] → [ D op , Set ] ≃ Σ - net .9. Open nets
Various kinds of “open” nets have been proposed, which allow one to build netsby gluing together smaller open nets [3, 5, 9, 34]. In earlier work we introduceda symmetric monoidal double category of open Petri nets, where composing openPetri nets is done by identifying places [2]. For example, here is an open Petri netwith one transition: X Y In addition to a Petri net, it consists of sets X and Y and arbitrary functions fromthese sets into the set of places. These indicate places at which tokens could flowin or out. We may write this open Petri net as P : X → Y for short.Given another open Petri net Q : Y → Z : Y Z we can compose it with P and obtain the following open Petri net Q ◦ P : X → Z : X Z We can also tensor open Petri nets, putting them side by side “in parallel”.This might suggest that open Petri nets should be the morphisms of a symmetricmonoidal category. However, composition of open Petri is not strictly associative,and there are very interesting maps between open Petri nets. To get a feeling forthese, there is a morphism from this open Petri net: αα ′ AA ′ BX ′ Y to this one: αA BX Y ATEGORIES OF NETS 25 mapping both primed and unprimed entities to the corresponding unprimed ones.This particular morphism maps an open Petri net onto a simpler one. There are alsomorphisms that include open Petri nets into more complicated ones. For example,the above morphism has two right inverses: two ways to include the bottom openPetri net into the top one.Given that we can compose open Petri net but also compose maps between them,it is natural to formalize them using a symmetric monoidal double category, whichwe call O pen Petri . To construct this one can use the following result on ‘structuredcospans’ [1, 11], which we state in summary form:
Lemma 9.1. ( [1, Thm. 3.9] ) Let X be a category with finite colimits. Given a leftadjoint L : Set → X , there is a symmetric monoidal double category O pen ( X ) suchthat: • objects are sets, • vertical 1-morphisms are functions, • a horizontal 1-cell from a ∈ Set to b ∈ Set is a cospan in X of this form: La x Lb . • a 2-morphism is a commutative diagram in X of this form: La LbxLa ′ Lb ′ . x ′ Lf Lgh
Composition of vertical 1-morphisms is composition of functions. Composition ofhorizontal 1-cells is composition of cospans in X via pushout. Horizontal composi-tion of 2-morphisms is also done via pushout, vertical composition of 2-morphismsis done via composition in X , and the tensor product and symmetry are definedusing chosen coproducts in Set and X . We obtain the symmetric double category O pen ( Petri ) by applying this resultto the functor L : Set → Petri that is left adjoint to the functor sending any Petrinet to its set of places.The same sort of construction gives symmetric monoidal double categories of‘open’ versions of all our favorite kinds of nets and categories. Moreover, the con-struction in Lemma 9.1 is functorial in the following sense:
Lemma 9.2. ( [1, Thm. 4.2] ) Suppose X and X ′ have finite colimits and this triangleof finitely cocontinuous functors commutes up to natural isomorphism: Set XX ′ . ⇒ φ L FL ′ Then there a symmetric monoidal double functor O pen ( F ) : O pen ( X ) → O pen ( X ′ ) that acts as follows on 2-morphisms: La x LbLa ′ x ′ Lb ′ i oi ′ o ′ LghLf L ′ a F x L ′ bL ′ c F y L ′ d . F i ◦ φ a F o ◦ φ b F i ′ ◦ φ a ′ F o ′ ◦ φ b ′ L ′ f F h L ′ g It can be checked that given two composable triangles of the above sort:
Set XX ′ ⇒ φ ⇒ φ ′ X ′′ L FL ′ F ′ L ′′ we have O pen ( F ′ ◦ F ) = O pen ( F ′ ) ◦ O pen ( F ) . Furthermore, isomorphic triangles give isomomorphic symmetric monoidal doublefunctors, so we obtain the following result:
Theorem 9.3.
There is a diagram of symmetric monoidal double functors O pen ( StrMC ) O pen ( SSMC ) O pen ( CMC ) O pen ( PreNet ) O pen ( Σ - net ) O pen ( Petri ) O pen ( F StrMC ) O pen ( F SSMC ) O pen ( F PreNet ) O pen ( F pre ) O pen ( F Σ - net ) O pen ( G pre ) O pen ( F pet ) O pen ( F Petri ) where we get each arrow from one of the left adjoints in eq. (1) using Lemma 9.2,and the squares built from arrows going up or right commute up to 2-isomorphism. Conclusion and future work
In this work we have systematized the theory of Petri nets, their variants, andtheir categorical semantics. To this end, we have shown that the notion of Σ-net,almost absent from standard Petri net literature, is in fact central. Our frameworkgives a consistent view of the relations between these interacting notions of netin terms of adjunctions, such that the most important adjunctions present in theliterature can be recovered as composites of our fundamental ones.Our work makes substantial use of tools from homotopy theory and relatedfields, such as groupoids and fibrations. We believe this will open up exciting newdirections of research in the study of distributed systems and network theory ingeneral.
ATEGORIES OF NETS 27
In fact, the relationships between the various notions of net in our work haveanalogues in topology. On one hand, a manifold can always be given “local coor-dinates”, but it is too restrictive to ask that such coordinates be preserved strictlyby maps between manifolds. Such coordinates can be regarded as analogous to theorderings on sources and targets in a pre-net. On the other hand, when a groupacts on a manifold, the quotient topological space may no longer be a manifold,but has singularities at points of non-free action. This “coarse moduli space” canbe regarded as analogous to a Petri net, where symmetry information has beenlost. Kock’s whole-grain Petri nets are analogous to abstract manifolds themselves:they are free of undesirable “coordinates”, but neither can they have singularities.Finally, our Σ-nets play the role of orbifolds , coordinate-free manifold-like struc-tures that retain the information of “isotropy groups” at singular points, yieldinga better-behaved notion of quotient.
Acknowledgements
The second author was supported by the project MIUR PRIN 2017FTXR7S“IT-MaTTerS” and by the Lest intervention group.The fourth author was supported by The United States Air Force Research Lab-oratory under agreement number FA9550-15-1-0053. The U.S. Government is au-thorized to reproduce and distribute reprints for Governmental purposes notwith-standing any copyright notation thereon. The views and conclusions containedherein are those of the author and should not be interpreted as necessarily rep-resenting the official policies or endorsements, either expressed or implied, of theUnited States Air Force Research Laboratory, the U.S. Government, or CarnegieMellon University.
References [1] J. C. Baez and K. Courser, Structured cospans. Available as arXiv:1911.04630. (Referred toon page 25.)[2] J. C. Baez and J. Master, Open Petri nets,
Math. Str. Comp. Sci. (2020), 314–341.(Referred to on page 2, 3, 5, 11, 24.)[3] P. Baldan, F. Bonchi, F. Gadducci and G. V. Monreale, Modular encoding of synchronousand asynchronous interactions using open Petri nets, Sci. Comp. Prog. (2015), 96–124.(Referred to on page 24.)[4] P. Baldan, R. Bruni, U. Montanari, Pre-Nets, read arcs and unfolding: a functorial pre-sentation, in
Recent Trends in Algebraic Development Techniques , Springer, Berlin, 2003,pp. 145–164. (Referred to on page 6.)[5] P. Baldan, A. Corradini, H. Ehrig, and R. Heckel, Compositional semantics for open Petrinets based on deterministic processes,
Math. Str. Comp. Sci. (2005), 1–35. (Referred toon page 24.)[6] M. Batanin and M. Markl, Centers and homotopy centers in enriched monoidal categories, Adv. Math. (2012), 1811—1858. Available as arXiv:1109.4084. (Referred to on page 20.)[7] R. Bruni, J. Meseguer, U. Montanari and V. Sassone, Functorial semantics for Petri nets underthe individual token philosophy, Electron. Notes Theor. Comput. Sci. (1999). (Referredto on page 7.)[8] R. Bruni, J. Meseguer, U. Montanari and V. Sassone, Functorial models for Petri nets, Information and Computation (2001), 207–236. (Referred to on page 2, 3, 5, 7.)[9] R. Bruni, H. C. Melgratti, U. Montanari and P. Soboci´nski, A connector algebra for C/E andP/T nets’ interactions,
Log. Meth. Comp. Sci. (2013), 1–65. Available as arXiv:1307.0204.(Referred to on page 24.)[10] E. Cheng, A direct proof that the category of 3-computads is not cartesian closed. Availableas arXiv:1209.0414. (Referred to on page 7.) [11] K. Courser, Open Systems: a Double Categorical Perspective , Ph.D. thesis, U. C. Riverside,2020. Available as arXiv:2008.02394. (Referred to on page 25.)[12] P. Degano, J. Meseguer and U. Montanari, Axiomatizing net computations and pro-cesses, in
Logic in Computer Science, 1989
Switching and Automata Theory, 1973. SWAT’08. IEEE Conference Record of 14th AnnualSymposium , IEEE, 1973, pp. 167–180. (Referred to on page 12.)[14] N. Gambino and A. Joyal, On operads, bimodules and analytic functors,
Memoirs AMS ,2017. Available as arXiv:1405.7270. (Referred to on page 8.)[15] R. Garner and I. L´opez Franco, Commutativity,
Jour. Pure Appl. Algebra (2016), 1707–1751. Available as arXiv:1507.08710. (Referred to on page 21.)[16] F. Genovese, A. Gryzlov, J. Herold, M. Perone, E. Post and A. Videla, Computational Petrinets: adjunctions considered harmful. Available as arXiv:1904.12974. (Referred to on page 2,7.)[17] F. Genovese and J. Herold, Integer Petri nets are compact closed categories,
Electron. Proc.Theor. Comput. Sci. (2019), 127–144. Available as arXiv:1805.05988. (Referred to onpage 2.)[18] C. Girault and R. Valk,
Petri Nets for Systems Engineering: a Guide to Modeling, Verifica-tion, and Applications , Springer, Berlin, 2013. (Referred to on page 1.)[19] R. J. van Glabbeek and G. D. Plotkin, Configuration structures, event structures and Petrinets,
Theoretical Computer Science (2009), 4111–4159. Available as arXiv:0912.4023.(Referred to on page 2.)[20] A. Joyal and R. Street. The geometry of tensor calculus, I.
Adv. Math. (1991), 55–112.(Referred to on page 5.)[21] J. Kock, Elements of Petri nets and processes. Available as arXiv:2005.05108. (Referred toon page 3, 12, 19, 23, 24.)[22] S. Lack, Note on the construction of free monoids, Appl. Cat. Str. (2010), 17–29. Availableas arXiv:0802.1946. (Referred to on page 21.)[23] S. Lack and P. Soboci´nski, Adhesive categories, in International Conference on Foundations ofSoftware Science and Computation Structures , Springer, Berlin, 2004, pp. 273–288. (Referredto on page 11.)[24] S. Lack and P. Soboci´nski, Toposes are adhesive, in
International Conference on Graph Trans-formations , Lecture Notes in Computer Science , Springer, Berlin, 2006, pp. 184–198.(Referred to on page 11.)[25] F. Loregian and E. Riehl, Categorical notions of fibration. Available as arXiv:1806.06129.(Referred to on page 12.)[26] M. Makkai and M. Zawadowski, The category of 3-computads is not cartesian closed,
J. PureAppl. Alg. (2008), 2543–2546. (Referred to on page 7.)[27] J. Master, Petri nets based on Lawvere theories,
Math. Struct. Comp. Sci. (2020), 833–864.Available as arXiv:1904.09091. (Referred to on page 2, 3, 5, 6, 7, 19, 20.)[28] J. Meseguer and U. Montanari, Petri nets are monoids, Information and Computation (1990), 105–155. (Referred to on page 1.)[29] E. Palmgren, Groupoids and local cartesian closure, Uppsala Univer-sity Department of Mathematics Technical Report ∼ palmgren/gpdlcc.pdf. (Referred to on page 13.)[30] J. L. Peterson, Petri Net Theory and the Modeling of Systems , Prentice–Hall, New Jersey,1981. (Referred to on page 1.)[31] V. Sassone, Strong concatenable processes: an approach to the categoryof Petri net computations,
BRICS Report Series , Dept. of Computer Sci-ence, U. Aarhus, 1994. Available at https://tidsskrift.dk/brics/article/view/21610/19059. (Referred to on page 2, 7, 8.)[32] V. Sassone, On the category of Petri net computations, in
CAAP’92: 17th Colloquiumon Trees in Algebra and Programming , Lecture Notes in Computer Science , Springer,Berlin, 1992. Available at https://eprints.soton.ac.uk/261951/1/strong-conf.pdf. (Referred toon page 2.)
ATEGORIES OF NETS 29 [33] V. Sassone, An axiomatization of the algebra of Petri net concaten-able processes,
Theor. Comput. Sci. (1996), 277–296. Available athttps://eprints.soton.ac.uk/261820/1/P-of-N-Off.pdf. (Referred to on page 2.)[34] V. Sassone and P. Soboci´nski, A congruence for Petri nets,
Elec-tron. Notes Theor. Comput. Sci. (2005), 107–120. Available athttps://eprints.soton.ac.uk/262302/1/petriCongPNGToff.pdf. (Referred to on page 24.)[35] Statebox Team, The mathematical specification of the Statebox language. Available asarXiv:1906.07629. (Referred to on page 7.)[36] N. P. Strickland, K ( n )-local duality for finite groups and groupoids, Topology (2000),733–772. (Referred to on page 13.) Department of Mathematics, U. C. Riverside, Riverside, California 92521
Email address : [email protected] Department of Informatics, University of Pisa, Pisa, Italia 56127
Email address : [email protected] Department of Mathematics, U. C. Riverside, Riverside, California 92521
Email address : [email protected] Department of Mathematics, University of San Diego, San Diego, California 92110
Email address ::