Structured versus Decorated Cospans
aa r X i v : . [ m a t h . C T ] J a n STRUCTURED VERSUS DECORATED COSPANS
JOHN C. BAEZ , , KENNY COURSER , AND CHRISTINA VASILAKOPOULOU A bstract . One goal of applied category theory is to understand open systems. We compare two ways ofdescribing open systems as cospans equipped with extra data. First, given a functor L : A → X , a ‘structuredcospan’ is a diagram in X of the form L ( a ) → x ← L ( b ). If A and X have finite colimits and L preserves them, itis known that there is a symmetric monoidal double category whose objects are those of A and whose horizontal1-cells are structured cospans. Second, given a pseudofunctor F : A → Cat , a ‘decorated cospan’ is a diagramin A of the form a → m ← b together with an object of F ( m ). Generalizing the work of Fong, we show that if A has finite colimits and F : ( A , + ) → ( Cat , × ) is symmetric lax monoidal, there is a symmetric monoidal doublecategory whose objects are those of A and whose horizontal 1-cells are decorated cospans. We prove that undercertain conditions, these two constructions become isomorphic when we take X = ∫ F to be the Grothendieckcategory of F . We illustrate these ideas with applications to electrical circuits, Petri nets, dynamical systemsand epidemiological modeling. C ontents
1. Introduction 12. Decorated cospans 33. Structured versus decorated cospans 104. Bicategorical and categorical aspects 155. Applications 186. Conclusions 26Appendix A. Definitions 26Appendix B. Checking a coherence law 31References 321. I ntroduction
An ‘open system’ is any sort of system that can interact with the outside world. Experience has shownthat open systems are nicely modeled using cospans [14, 18, 40]. A cospan in some category A is a diagramof this form: a m b i o We call m the apex , a and b the feet , and i and o the legs of the cospan. The apex describes the systemitself. The feet describe ‘interfaces’ through which the system can interact with the outside world. Thelegs describe how the interfaces are included in the system. If the category A has finite colimits, we cancompose cospans using pushouts: this describes the operation of attaching two open systems together inseries by identifying one interface of the first with one of the second. We can also ‘tensor’ cospans usingcoproducts: this describes setting open systems side by side, in parallel. Via these operations we obtain asymmetric monoidal double category with cospans in A as its horizontal 1-cells [13, 38].However, we often want the system itself to have more structure than its interfaces. This led Fong todevelop a theory of ‘decorated’ cospans [17]. Given a category A with finite colimits, a symmetric lax D epartment of M athematics , U niversity of C alifornia , R iverside CA, USA 92521 C entre for Q uantum T echnologies , N ational U niversity of S ingapore , S ingapore D epartment of M athematics , U niversity of P atras , G reece
265 04
E-mail address : [email protected], [email protected], [email protected] . monoidal functor F : ( A , + ) → ( Set , × ) can be used to equip the apex m of a cospan in A with some extradata: an element x ∈ F ( m ), which we call a decoration . Thus a decorated cospan is a pair: a m b , x ∈ F ( m ). i o Fong proved that there is a symmetric monoidal category with objects of A as its objects and equivalenceclasses of decorated cospans as its morphisms. Such categories were used to describe a variety of opensystems: electrical circuits, Markov processes, chemical reaction networks and dynamical systems [4, 5, 7].Unfortunately, many applications of decorated cospans were flawed. The problem is that while Fong’sdecorated cospans are good for decorating the apex m with an element of a set F ( m ), they are unable todecorate it with an object of a category. An example would be equipping a finite set m with edges makingits elements into the nodes of a graph. We would like the following ‘open graph’ to be a decorated cospanwhere the apex is the finite set m = { n , n , n , n } : • n • n • n • n e e e e e a b We might hope to do this using a symmetric lax monoidal functor F : ( FinSet , + ) → ( Set , × ) assigning toeach finite set m the set of all graphs with m as their set of nodes. But this hope is doomed, for reasonspainstakingly explained in [1, Section 5]. There is really a category of graphs with m as their set of nodes—and surprisingly, trying to treat this category as a mere set does not work, despite all the tricks one mighttry.Here we present a solution to this problem. Instead of basing the theory of decorated cospans on asymmetric lax monoidal functor F : ( A , + ) → ( Set , × ), we use a symmetric lax monoidal pseudofunctor F : ( A , + ) → ( Cat , × ). In Theorems 2.1 and 2.2, we use this data to construct a symmetric monoidal doublecategory F C sp in which: • an object is an object of A , • a vertical 1-morphism is a morphism of A , • a horizontal 1-cell from a to b is a decorated cospan: a m b , x ∈ F ( m ), i o • a 2-morphism is a map of decorated cospans : that is, a commutative diagram aa ′ m bb ′ m ′ x ∈ F ( m ) x ′ ∈ F ( m ′ ) i of gi ′ o ′ h together with a morphism τ : F ( h )( x ) → x ′ in F ( m ′ ).In fact another solution to the problem is already known: the theory of structured cospans [1, 14]. Givena functor L : A → X , a structured cospan is a cospan in X whose feet come from a pair of objects in A : L ( a ) x L ( b ) . This is another way of letting the apex have more structure than the feet. When A and X have finite colimitsand L preserves them, there is a symmetric monoidal double category L C sp ( X ) where: • an object is an object of A , • a vertical 1-morphism is a morphism of A , TRUCTURED VERSUS DECORATED COSPANS 3 • a horizontal 1-cell from a to b is a diagram in X of this form: L ( a ) x L ( b ) i o • a 2-morphism is a commutative diagram in X of this form: L ( a ) L ( b ) xL ( a ′ ) L ( b ′ ) x ′ oL ( f ) L ( g ) α ii ′ o ′ Many of the flawed applications of decorated cospans have been fixed using structured cospans [1,Section 6], but not every decorated cospan double category is equivalent to a structured cospan doublecategory. Here we give su ffi cient conditions for a decorated cospan double category to be equivalent—andin fact, isomorphic—to a structured cospan double category.Suppose A has finite colimits and F : ( A , + ) → ( Cat , × ) is a symmetric lax monoidal pseudofunctor.Then each category F ( a ) for a ∈ A becomes symmetric monoidal, and F becomes a pseudofunctor F : A → SymMonCat . Using the Grothendieck construction, F also gives an opfibration U : X → A where X = ∫ F .Let Rex be the 2-category of categories with finite colimits, functors preserving finite colimits, and naturaltransformations. We show that if F : A → SymMonCat factors through
Rex as a pseudofunctor, theopfibration U : X → A is also a right adjoint. From the accompanying left adjoint L : A → X , we constructa symmetric monoidal double category L C sp ( X ) of structured cospans. In Theorem 3.2 we prove that thisstructured cospan double category L C sp ( X ) is isomorphic to the decorated cospan double category F C sp .In fact, they are isomorphic as symmetric monoidal double categories.This result shows that under certain conditions, structured and decorated cospans provide equivalentways of describing open systems. We illustrate this with applications to electrical circuits, Petri nets, dy-namical systems, and epidemiological modeling. In particular, we describe a map from open Petri nets withrates to open dynamical systems that takes advantage of both structured and decorated cospans. Outline.
In Section 2, we construct the symmetric monoidal double category F C sp and we define maps be-tween decorated cospan double categories. In Section 3, we briefly review the structured cospans frameworkand prove that the double categorical versions of decorated cospans and structured cospans are isomorphicunder suitable conditions. In Section 4, we establish the isomorphism between structured and decoratedcospans at the level of bicategories and categories (via decategorification). Finally, in Section 5, we de-scribe applications, and show that open dynamical system can be described using decorated cospans but notstructured cospans. Conventions.
In this paper, we use a sans-serif font like C for categories, boldface like B for bicategoriesor 2-categories, and blackboard bold like D for double categories. For double categories with names havingmore than one letter, like C sp ( X ), only the first letter is in blackboard bold. In this paper, ‘double category’means ‘pseudo double category’, as in Definition A.3. A double category D has a category of objectsand a category of arrows, and we call these D and D despite the fact that they are categories. Verticalcomposition in our double categories is strictly associative, while horizontal composition need not be. Weuse ( C , ⊗ ) to stand for a monoidal or perhaps symmetric monoidal category with ⊗ as its tensor product. Acknowledgements.
We thank Daniel Cicala, Brendan Fong, and Joe Moeller for helpful conversations.The third author would like to thank the General Secretariat for Research and Technology (GSRT) and theHellenic Foundation for Research and Innovation (HFRI).2. D ecorated cospans
In this section we build symmetric monoidal double categories of decorated cospans, and then studythe functoriality of this construction. The definition of a lax monoidal pseudofunctor is recalled in Appen-dix A.1, and the definition of a double category is recalled in Definition A.3.In all that follows, when we say a category ‘has finite colimits’ we mean it is equipped with a choice ofcolimit for every finite diagram. Thus, if A has finite colimits it gives a cocartesian monoidal category ( A , + ):a symmetric monoidal category where the monoidal structure is given by the chosen binary coproducts and STRUCTURED VERSUS DECORATED COSPANS initial object. However, when we say a functor ‘preserves finite colimits’, it need only do this up to canonicalisomorphism, unless otherwise specified.
Theorem 2.1.
Let A be a category with finite colimits and F : ( A , + ) → ( Cat , × ) a lax monoidal pseudo-functor. Then there exists a double category F C sp in which • an object is an object of A , • a vertical 1-morphism is a morphism of A , • a horizontal 1-cell is an F -decorated cospan , that is, a diagram in A of the forma m b , i o together with a decoration x ∈ F ( m ) , • a 2-morphism is a map of F -decorated cospans , that is, a commutative diagram in A of the formaa ′ m bb ′ m ′ x ∈ F ( m ) x ′ ∈ F ( m ′ ) i of gi ′ o ′ h (1) together with a decoration morphism τ : F ( h )( x ) → x ′ in F ( m ′ ) .Proof. Take A to have finite colimits and let ( F , φ, φ ) : ( A , + ) → ( Cat , × ) be a lax monoidal pseudofunctor.We shall define the category of objects F C sp , the category of arrows F C sp , as well as the four structurefunctors which tie them together: the source and target functors S , T : F C sp → F C sp , the unit functor U : F C sp → F C sp , and the composition functor ⊙ : F C sp × F C sp F C sp → F C sp .The category of objects F C sp is simply A , whereas F -decorated cospans and maps between them formthe category of arrows F C sp . The (vertical) composition of two maps of F -decorated cospan is a m b x ∈ F ( m ) a ′ m ′ b ′ x ′ ∈ F ( m ′ ) a ′′ m ′′ b ′′ x ′′ ∈ F ( m ′′ ) if h o gi ′ f ′ h ′ o ′ g ′ i ′′ o ′′ = a m b x ∈ F ( m ) a ′′ m ′′ b ′′ x ′′ ∈ F ( m ′′ ) if ′ f h ′ h o g ′ gi ′′ o ′′ (2)where if τ : F ( h )( x ) → x ′ and τ ′ : F ( h ′ )( x ′ ) → x ′′ are the decoration morphisms, F ( h ′ h )( x ) ∼−→ F ( h ′ ) F ( h )( x ) F ( h ′ )( τ ) −−−−−→ F ( h ′ )( x ′ ) τ ′ −→ x ′′ (3)is the decoration of the composite, where the first isomorphism comes from pseudofunctoriality of F .The source and target functors S and T map an F -decorated cospan to the source and target of the cospanand a map of decorated cospans (1) to f and g respectively. The unit functor U maps an object a to a a a , ⊥ a : = φ −→ F (0) F (! a ) −−−→ F ( a ) a a (4)where ⊥ a ∈ F ( a ) is called the trivial decoration , and a vertical 1-morphism f : a → a ′ to aa ′ a aa ′ a ′ ⊥ a ∈ F ( a ) ⊥ a ′ ∈ F ( a ′ ) a a f f a ′ a ′ f together with the decoration morphism F ( f ) F (! a ) φ ( ∗ ) (cid:27) F (! a ′ ) φ ( ∗ ). Finally, the (horizontal) compositionfunctor ⊙ maps two composable F -decorated cospans M = ( a → m ← b , x ∈ F ( m )) , N = ( b → n ← c , y ∈ F ( n )) TRUCTURED VERSUS DECORATED COSPANS 5 to N ⊙ M , which as a cospan is their pushout in A over their shared foot, shown in dashed arrows here: a m b n cm + nm + b n i o i ′ o ′ ι m ι n v m v n ψ (5)equipped with the decoration y ⊙ x : = (cid:27) × x × y −−→ F ( m ) × F ( n ) φ m , n −−−→ F ( m + n ) F ( ψ ) −−−→ F ( m + b n )where ψ : m + n → m + b n is the natural map from the coproduct to the pushout. Moreover, given twohorizontally composable maps of F -decorated cospans α and β aa ′ m bb ′ m ′ x ∈ F ( m ) x ′ ∈ F ( m ′ ) b n cb ′ n ′ c ′ y ∈ F ( n ) y ′ ∈ F ( n ′ ) τ α : F ( h )( x ) → x ′ τ β : F ( h )( y ) → y ′ i o f gi ′ o ′ h i g h i ′ o ko ′ their composite β ⊙ α is the horizontal composite of the two cospans in A aa ′ m + b n cc ′ m ′ + b ′ n ′ y ⊙ x ∈ F ( m + b n ) y ′ ⊙ x ′ ∈ F ( m ′ + b ′ n ′ ) f kh + g h (6)together with the decoration morphism τ β ⊙ α : F ( h + g h )( y ⊙ x ) → ( y ′ ⊙ x ′ ) given by the diagram: ⇓ τ α × τ β (cid:27) × F ( m ) × F ( n ) φ h , h (cid:27) (cid:27) F ( m ′ ) × F ( n ′ ) F ( m + n ) F ( m ′ + n ′ ) F ( m + b n ) F ( m ′ + b ′ n ′ ) φ m , n φ m ′ , n ′ F ( ψ ) F ( ψ ) F ( h + g h ) F ( h + h ) x × yx ′ × y ′ F ( h ) × F ( h ) (7)where the middle isomorphism is (37) from pseudonaturality of φ and the right-hand side isomorphism isdue to pseudofunctoriality of F .The associator for horizontal composition is formed as follows: for three composable horizontal 1-cells M = ( a → m ← b , x ∈ F ( m )), M = ( b → m ← c , x ∈ F ( m )) and M = ( c → m ← d , x ∈ F ( m )) , the isomorphism ( M ⊙ M ) ⊙ M (cid:27) M ⊙ ( M ⊙ M ) is the isomorphism of cospans aa m + b ( m + c m ) dd ( m + b m ) + c m ( x ⊙ x ) ⊙ x ∈ F ( m + b ( m + c m )) x ⊙ ( x ⊙ x ) ∈ F (( m + b m ) + c m ) a d κ (cid:27) STRUCTURED VERSUS DECORATED COSPANS together with an isomorphism F ( κ )(( x ⊙ x ) ⊙ x ) (cid:27) ( x ⊙ ( x ⊙ x )) between the decorations F ( m ) × ( F ( m ) × F ( m )) F ( m ) × F ( m + m ) F ( m ) × F ( m + c m ) F ( m + ( m + c m )) F ( m + b ( m + c m )) F ( m + ( m + m )) F (( m + m ) + m )( F ( m ) × F ( m )) × F ( m ) F ( m + m ) × m F ( m + b m ) × F ( m ) F (( m + b m ) + m ) F (( m + b m ) + c m ) (35) (cid:27) × φ m , m α × F ( ψ ) φ m , m + m (37) (cid:27) φ m , m + cm F ( ψ ) (cid:27) F ( κ ) x × ( x × x ) F (1 + ψ ) F ( α )( x × x ) × x F ( ψ + (cid:27) φ m , m × φ m + m , m F ( ψ ) × φ m + bm , m F ( ψ ) (8)where α are the associators of Cat and A and κ is the canonical isomorphism between two colimits of thesame diagram in A .The right and left unitors are defined similarly: for example, for a horizontal 1-cell M = ( a → m ← b , x ∈ F ( m )), the isomorphism M ⊙ U a (cid:27) M is given by the canonical map of cospans κ : a + a m (cid:27) m alongwith this isomorphism between decorations: F (0) × F ( m ) F ( a ) × F ( m ) F ( a + m ) F ( a + a m ) F (0 + m )1 F ( m ) . φ × x (36) (cid:27) φ , m F (! a ) × (cid:27) φ a , m (cid:27) F ( ψ ) F ( κ ) ∼ F (! a + x (9)All the double category axioms can be verified using the fact that cospans in A form a double category and F is a lax monoidal pseudofunctor. (cid:3) The following result establishes that under the same assumptions as Theorem 2.1, the double category ofdecorated cospans is monoidal; it becomes symmetric when the lax monoidal pseudofunctor is. Monoidaland symmetric monoidal double categories are recalled in Definitions A.6 and A.7.
Theorem 2.2.
Let A be a category with finite colimits and let ( F , φ, φ ) : ( A , + ) → ( Cat , × ) be a symmetriclax monoidal pseudofunctor. Then the double category F C sp is symmetric monoidal, where the tensorproduct • of two objects a and b is their coproduct a + b in A , • of two vertical 1-morphisms f : a → b and f ′ : a ′ → b ′ is f + f ′ : a + a ′ → b + b ′ in A , • of two horizontal 1-cells ( a → m ← b , x ∈ F ( m )) and ( c → n ← d , y ∈ F ( n )) ism + na + c b + d , i + i o + o x ⊗ y : = φ m , n ( x , y ) ∈ F ( m + n ) (10) • of two 2-morphisms α and β is:aa ′ m bb ′ m ′ ⊗ = c n dc ′ n ′ d ′ τ α : F ( h )( x ) → x ′ in F ( m ′ ) τ β : F ( h ′ )( y ) → y ′ in F ( n ′ ) i o f gi ′ o ′ h i f ′ h ′ i ′ o g ′ o ′ a + ca ′ + c ′ m + n b + db ′ + d ′ m ′ + n ′ τ α ⊗ β : F ( h + h ′ )( φ m , n ( x , y )) → φ m ′ , n ′ ( x ′ , y ′ ) in F ( m ′ + n ′ ) i + i o + o f + f ′ g + g ′ i ′ + i ′ o ′ + o ′ h + h ′ with decoration morphism τ α ⊗ β given by the following diagram:F ( m ) × F ( n ) F ( m + n ) F ( m ′ ) × F ( n ′ ) F ( m ′ + n ′ ) φ m , n F ( h ) × F ( h ′ ) φ h , h ′ (cid:27) (37) F ( h + h ′ ) x × yx ′ × y ′ ⇓ τ α × τ β φ m ′ , n ′ Proof.
We first show that the categories of objects and arrows are symmetric monoidal, and that the sourceand target functors are symmetric strict monoidal. Indeed, the category of objects F C sp = A is symmetric TRUCTURED VERSUS DECORATED COSPANS 7 monoidal under the chosen binary coproducts in A . The category of arrows F C sp is also symmetricmonoidal, with tensor product as in (10) and monoidal unit I = (cid:18) ! −→ ! ←− , φ −→ F (0) F (! ) −−−→ F (0) (cid:19) where 0 is the initial object in A . By (4), this unit I is equal to U as required. In all that follows, we shallassume that F (! ) is the identity, so that I = (cid:18) ! −→ ! ←− , φ −→ F (0) (cid:19) . (11)This can always be achieved by replacing F by an equivalent normal pseudofunctor, namely one that strictlypreserves identity morphisms [34, Proposition 5.2]. We do this merely to reduce the size of our diagrams;the reader can reinsert the morphism F (! ) where needed.The associator for the monoidal structure in F C sp is formed as follows: for three objects M = ( a → m ← b , x ∈ F ( m )), M = ( a → m ← b , x ∈ F ( m )) and M = ( a → m ← b , x ∈ F ( m )), theisomorphism ( M ⊗ M ) ⊗ M (cid:27) M ⊗ ( M ⊗ M ) is the isomorphism of cospans( a + a ) + a a + ( a + a ) ( m + m ) + m ( b + b ) + b b + ( b + b ) m + ( m + m ) ( x ⊗ x ) ⊗ x ∈ F (( m + m ) + m ) x ⊗ ( x ⊗ x ) ∈ F ( m + ( m + m )) ( i + i ) + i ( o + o ) + o α (cid:27) α (cid:27) i + ( i + i ) o + ( o + o ) α (cid:27) together with the decoration isomorphism between F ( α )(( x ⊗ x ) ⊗ x ) (10) = F ( α )( φ m + m , m ( φ m , m ( x , x ) , x ))and x ⊗ ( x ⊗ x ) = φ m , m + m ( x , φ m , m ( x , x )) formed in the same way as the left two-piece part of (8). Forthe left and right unitors I ⊗ M (cid:27) M (cid:27) M ⊗ I for any M = ( a → m ← b , x ∈ F ( m )), we have isomorphismsof cospans0 + a + m + b F (0) × F ( m ) F (0 + m ) a m b F ( m ) a + m + b + F ( m ) × F (0) F ( m + + i ℓ (cid:27) ℓ (cid:27) + o ℓ (cid:27) φ × x φ , m i o xi + r (cid:27) r (cid:27) o + r (cid:27) x × φ φ m , with isomorphisms between decorations precisely given by (36). Finally, the braiding in F C sp is inheritedfrom that in A and F , with braiding β : M ⊗ M → M ⊗ M the cospan isomorphism a + a m + m b + b F ( m ) × F ( m ) F ( m + m ) a + a m + m b + b F ( m ) × F ( m ) F ( m + m ) i + i β (cid:27) β (cid:27) o + o β (cid:27) x × x φ m , m i + i o + o x × x φ m , m (12)together with the decoration isomorphism1 F ( m ) × F ( m ) F ( m + m ) F ( m ) × F ( m ) F ( m + m ) x × x x × x β φ m , m u a , b (cid:27) (38) F ( β ) φ m , m (13)All axioms for a symmetric monoidal category can be verified, and it is easy to see that with these structures,the source and target functors S , T : F C sp → F C sp are symmetric strict monoidal.Lastly, according to Definition A.6 we need to construct two globular 2-isomorphisms ( M ⊗ N ) ⊙ ( M ⊗ N ) ∼−→ ( M ⊙ M ) ⊗ ( N ⊙ N ) and U a + b ∼−→ U a ⊗ U b that express compatibility of the tensor product with STRUCTURED VERSUS DECORATED COSPANS horizontal composition and units. For any appropriate four decorated cospans M = (cid:18) a i −→ m o ←− b , x ∈ F ( m ) (cid:19) , M = (cid:18) b i −→ m o ←− c , x ∈ F ( m ) (cid:19) (14) N = a ′ i ′ −→ n o ′ ←− b ′ , y ∈ F ( n ) ! , N = b ′ i ′ −→ n o ′ ←− c ′ , y ∈ F ( n ) ! first tensoring M ⊗ N , M ⊗ N by (10) and then horizontally composing them by (5) gives ( m + n ) + b + b ′ ( m + n ) m + n m + n a + a ′ b + b ′ c + c ′ p i + i ′ o + o ′ i + i ′ o + o ′ F ( m ) × F ( n ) × F ( m ) × F ( n ) F ( m + n ) × F ( m + n ) F ( m + n + m + n ) F (( m + n ) + b + b ′ ( m + n )) ( x ⊗ y ) ⊙ ( x ⊗ y ) x × y × x × y φ m , n × φ m , n φ m + n , m + n F ( ψ ) (15)If we first horizontally compose M ⊙ M , N ⊙ N and then tensor the result, we obtain ( m + b m ) + ( n + b ′ n ) a + a ′ c + c ′ F ( m ) × F ( m ) × F ( n ) × F ( n ) F ( m + m ) × F ( n + n ) F ( m + b m ) × F ( n + b ′ n ) F (( m + b m ) + ( n + b ′ n )) ( x ⊙ x ) ⊗ ( y ⊙ y ) x × x × y × y φ m , m × φ n , n F ( ψ ) × F ( ψ ) φ m + bm , n + b ′ n (16)where the legs of the cospan are the sums of the dashed ones of the appropriate diagrams (5). Thus the(globular) cospan isomorphism is the canonical universal map between the colimit of the same diagramobtained in two di ff erent ways ˆ χ : ( m + n ) + b + b ′ ( m + n ) (cid:27) ( m + b m ) + ( n + b ′ n ), and the decorationisomorphism can be built in a similar way using coherent isomorphisms as follows: F ( m ) × F ( n ) × F ( m ) × F ( n ) F ( m + n ) × F ( m + n ) F ( m + n + m + n ) F ( m ) × F ( m ) × F ( n ) × F ( n ) F ( m + m + n + n ) F (( m + n ) + b + b ′ ( m + n )) F ( m + m ) × F ( n + n ) F ( m + b m ) × F ( n + b ′ n ) F (( m + b m ) + ( n + b ′ n )) × β × (cid:27) φ m , n × φ m , n φ m + n , m + n F ( ψ ) F (1 + β + x × y × x × y x × x × y × y φ m , m × φ n , n F ( ψ + ψ )(37) (cid:27) (cid:27) F (ˆ χ ) φ m + m , n + n F ( ψ ) × F ( ψ ) φ m + bm , n + b ′ n (17)where the left-hand side isomorphism (44) is spelled out in detail in Appendix B and combines the pseu-doassociativity (35) and braided monoidal structure (38) of the pseudofunctor F , and the right hand sideisomorphism follows from the universal property of colimits and pseudofunctoriality of F .Similarly, for the comparison isomorphism between the units U a + b and U a ⊗ U b , it is easy to see that ascospans they are both the identity 1 a + b : a + b → a + b ← a + b : 1 a + b , and there is a canonical isomorphismbetween their decorations F (0) F ( a + b ) F (0) × F (0) F ( a ) × F ( b ) F ( a + b ) φ (cid:27) φ × φ (cid:27) F (! a + b ) F (1) F (! a ) × F (! b ) φ , φ a , b where the top composite is ⊥ a + b by (4) and the bottom composite is φ a , b ( ⊥ a , ⊥ b ) by (10).It can be verified that with this structure, F C sp is indeed a symmetric monoidal double category, namelyall coherence laws are satisfied. In order to give the reader a sense of what these checks entail, we providea proof of the fact that the braiding is a transformation of double categories in Appendix B. (cid:3) There is an alternative proof of the above theorem when the hypothesis of Theorem 3.2 hold. In thiscase we show, in the proof of Theorem 3.2, that the decorated cospan double category F C sp is isomorphicto a certain double category L C sp ( ∫ F ) constructed using structured cospans. We also show that under thisisomorphism, all the symmetric monoidal structure of F C sp —the tensor product, associator, etc.—matchesthat of L C sp ( ∫ F ), which we have proved to obey the axioms of a symmetric monoidal double category (seeTheorem 3.1). It follows that F C sp is a symmetric monoidal double category. TRUCTURED VERSUS DECORATED COSPANS 9
Our construction gives not only decorated cospan double categories, but also maps between these: thatis, symmetric monoidal double functors, as in Definition A.4. Suppose we have two categories A , A ′ withfinite colimits and two symmetric lax monoidal pseudofunctors F : A → Cat and F ′ : A ′ → Cat . Then wecan obtain a map between their decorated cospan double categories, H : F C sp → F ′ C sp , from: • a functor H : A → A ′ that preserves finite limits, • a symmetric lax monoidal pseudofunctor ( E , φ, φ ) : Cat → Cat , • a natural isomorphism θ : EF ⇒ F ′ H : A Cat A ′ Cat . ⇓ θ FH EF ′ The induced double functor H : F C sp → F ′ C sp is defined as follows: • The image of an object a ∈ F C sp = A is the object H ( a ) ∈ F ′ C sp = A ′ . • The image of a vertical 1-morphism f : a → b is the vertical 1-morphism H ( f ) : H ( a ) → H ( b ).In other words, the object component H of the double functor H is the functor H . • The image of an F -decorated cospan M in F C sp is the F ′ -decorated cospan H ( M ) in F ′ C sp M = (cid:18) a i −→ m o ←− b , x ∈ F ( m ) (cid:19) H ( M ) = (cid:18) H ( a ) H ( i ) −−−→ H ( m ) H ( o ) ←−−− H ( b ) , ¯ x ∈ F ′ ( H ( m )) (cid:19) where¯ x : = φ −→ E ( ) E ( x ) −−−→ E ( F ( m )) θ m −−→ F ′ ( H ( m )) • The image of a map of decorated cospans α : M → N in F C sp is the map of F ′ -decorated cospans H ( α ) in F ′ C sp aa ′ m bb ′ n x ∈ F ( m ) x ′ ∈ F ( n ) H ( a ) H ( a ′ ) H ( m ) H ( b ) H ( b ′ ) H ( n ) θ m E ( x ) φ ∈ F ′ ( H ( m )) θ n E ( x ′ ) φ ∈ F ′ ( H ( n )) i of gi ′ o ′ h H ( i ) H ( o ) H ( f ) H ( g ) H ( i ′ ) H ( o ′ ) H ( h ) where a decoration morphism τ : F ( h )( x ) → x ′ is mapped to a decoration morphism as follows:1 F ( m ) F ( n ) ⇓ τ E (1) E ( F ( m )) E ( F ( n )) ⇓ E ( τ ) F ′ ( H ( m )) F ′ ( H ( n )) φ xx ′ F ( h ) θ m θ n F ′ ( H ( h )) E ( x ) E ( x ′ ) E ( F (( h )) Theorem 2.3.
Given two categories A and A ′ with finite colimits, two symmetric lax monoidal pseudo-functors F : A → Cat and F ′ : A ′ → Cat , a finite colimit preserving functor H : A → A ′ , a symmetric laxmonoidal pseudofunctor E : Cat → Cat and a natural isomorphism θ : EF ⇒ F ′ H as in the followingdiagram: A Cat A ′ Cat ⇓ θ FH EF ′ the triple ( H , E , θ ) induces a symmetric monoidal double functor H : F C sp → F ′ C sp as defined above.Proof. See [14, Theorem 4.2.1]. (cid:3)
This theorem should generalize to the case when θ is a pseudonatural equivalence, but the weaker versionsu ffi ces for our application in Section 5.4.
3. S tructured versus decorated cospans
In [1], the first two authors introduce the symmetric monoidal double category of structured cospans asa formalism to capture open networks. One of the main goals of this paper is to provide a monoidal doubleisomorphism between this double category and that of decorated cospans, described in detail in Section 2.We first recall the double category of structured cospans.
Theorem 3.1.
Given categories A and X with finite colimits and L : A → X a functor preserving finitecolimits, there is a symmetric monoidal double category L C sp ( X ) in which • an object is an object of A , • a vertical 1-morphism is a morphism of A , • a horizontal 1-cell from a to b is an L- structured cospan , that is, a diagram in X of the formL ( a ) x L ( b ) , i o • a 2-morphism is a map of L- structured cospans , that is, a commutative diagram in X of the formL ( a ) x L ( b ) L ( a ′ ) x ′ L ( b ′ ) . i oi ′ o ′ L ( f ) α L ( g ) Composition of horizontal 1-cells and 2-cells is done using pushouts in X , and the symmetric monoidalstructure is defined using finite coproducts in A and X : the tensor of two horizontal 1-cells isx x ′ x + x ′ ⊗ = L ( a ) L ( b ) L ( a ′ ) L ( b ′ ) L ( a + a ′ ) L ( b + b ′ ) i o i ′ o ′ i + i ′ o + o ′ (18) using that L preserves finite coproducts.Proof. This was proved in [1, Theorems 2.3 & 3.9], where all the structures are specified in detail. In fact,the double category structure only requires that X have pushouts, whereas the symmetric monoidal structurealso requires that X and A have finite coproducts and that L preserve these [14, Theorem 3.2.3]. (cid:3) The following theorem establishes an isomorphism between structured and decorated cospan doublecategories under certain conditions. Let
Rex be the 2-category of categories with finite colimits, functorspreserving finite colimits, and natural transformations. Let
SymMonCat be the 2-category of symmetricmonoidal categories, strong symmetric monoidal functors and natural transformations. Recall that for us acategory C ∈ Rex comes with a choice of finite colimits, so it gives a specific cocartesian monoidal category( C , + ), and this induces a 2-functor Rex → SymMonCat . Theorem 3.2.
Suppose A has finite colimits and F : ( A , + ) → ( Cat , × ) is a symmetric lax monoidal pseudo-functor. If the corresponding pseudofunctor F : A → SymMonCat factors through
Rex , then the symmetricmonoidal double categories F C sp of decorated cospans and L C sp ( ∫ F ) of structured cospans are isomor-phic, where L : A → ∫ F is a left adjoint of the induced Grothendieck opfibration U : ∫ F → A . The “corresponding pseudofunctor” comes from the so-called monoidal Grothendieck construction, andthe conditions of this theorem relate to the existence of colimits as well as left adjoints for opfibrations. Wefirst sketch the relevant underlying framework in detail, and then we proceed to the proof of the theorem.The basics of fibration theory needed for our purposes are recalled in Appendix A.2.In [37], the classical Grothendieck construction is generalized to the monoidal setting: given a (sym-metric) monoidal category A , there is a bijection between (symmetric) monoidal opindexed categories ,which are (symmetric) lax monoidal pseudofunctors F : ( A , ⊗ A ) → ( Cat , × ), and (symmetric) monoidalopfibrations , which are opfibrations U : X → A where X , A are (symmetric) monoidal, U is (symmetric)strict monoidal, and ⊗ X preserves cocartesian liftings. This bijection sends a monoidal opindexed cate-gory F : ( A , ⊗ A ) → ( Cat , × ) to the monoidal opfibration U : ∫ F → A . If the monoidal structure on A isin fact cocartesian, there is a further correspondence between these structures and ordinary pseudofunctors F : A → MonCat (or to
SymMonCat in the symmetric case).
TRUCTURED VERSUS DECORATED COSPANS 11
In fact, all these correspondences lift to 2-equivalences between appropriate 2-categories.
Lemma 3.3.
There is a 2-equivalence between the 2-categories of monoidal opfibrations and monoidalopindexed categories, and if the base is cocartesian monoidal, there is a 2-equivalence between theseand pseudofunctors into
MonCat . Similarly there is a 2-equivalence between symmetric monoidal opfi-brations and symmetric monoidal opindexed categories, and if the base is cocartesian monoidal, also a2-equivalence between these and pseudofunctors into
SymMonCat .Proof.
This was shown by Moeller and the third author [37, Theorems 3.13 & 4.2]. In summary, for acocartesian base A we have correspondenceslax monoidal pseudofunctors F : ( A , + ) → ( Cat , × ) m monoidal opfibrations U : ( X , ⊗ X ) → ( A , + ) m pseudofunctors F : A → MonCat
The second equivalence was observed earlier by Shulman [42]. Moreover, symmetric lax monoidal pseud-ofunctors correspond to symmetric monoidal opfibrations, and those to pseudofunctors into
SymMonCat .In more detail, if ( φ, φ ) is the lax monoidal structure of the pseudofunctor F as recalled in Appendix A.1,the induced monoidal structure on the total Grothendieck category X = ∫ F (Definition A.1) is given by (cid:16) a , x ∈ F ( a ) (cid:17) ⊗ X (cid:16) b , y ∈ F ( b ) (cid:17) = (cid:16) a + b , φ a , b ( x , y ) ∈ F ( a + b ) (cid:17) , I X = (cid:16) A , φ (cid:17) (19)If F is a symmetric lax monoidal pseudofunctor, the induced monoidal structure in ∫ F is symmetric via (cid:16) β a , b , ( u a , b ) x , y (cid:17) : (cid:0) a + b , φ a , b ( x , y ) (cid:1) ∼−→ (cid:0) b + a , φ b , a ( y , x ) (cid:1) where β is the canonical symmetry for A and u is the natural isomorphism of (38).Moreover, each fiber X a = F ( a ) obtains a monoidal structure via ⊗ a : F ( a ) × F ( a ) φ a , a −−→ F ( a + a ) F ( ∇ ) −−−→ F ( a ) , I a : φ −→ F (0) F (! a ) −−−→ F ( a ) (20)where ∇ is the fold map, which is symmetric when F is again via the components of u a , a . Also, eachreindexing functor f ! = F ( f ) obtains a strong monoidal structure with F ( a ) × F ( a ) F ( a + a ) F ( a ) F ( b ) × F ( b ) F ( b + b ) F ( b ) φ a , a F ( f ) × F ( f ) φ f , f (cid:27) (37) F ( ∇ ) F ( f + f ) (cid:27) F f φ b , b F ( ∇ ) (21) (cid:3) These 2-equivalences further restrict to the case when the Grothendieck category ( X , ⊗ X ) is specificallycocartesian monoidal itself, with coproducts built up from (19). In that case, opfibrations ( X , + ) → ( A , + )that strictly preserve coproducts and initial object bijectively correspond to pseudofunctors into the 2-category of cocartesian categories. For more details, see [37, Corollary 4.7] and the related discussion.Finally, we can further restrict to the setting of opfibrations that also preserve pushouts, and thus all finitecolimits, thanks to the following more general result. Lemma 3.4 ( Hermida ) . Suppose J is a small category and U : X → A is an opfibration where the base A has J -colimits. Then the following are equivalent:(1) all fibers have J -colimits, and the reindexing functors preserve them;(2) the total category X has J -colimits, and U preserves them.Moreover, if X has J -colimits and U preserves them, for any choice of J -colimits in A , they can be chosenin X in such a way that U strictly preserves them.Proof. See [28, Corollary 4.9], and for the final statement [28, Remark 4.11]. (cid:3)
The first part formulates the existence of colimits locally in each fiber, and if we let J range over allfinite categories it says that the corresponding pseudofunctor F : A → Cat lands in the sub-2-category
Rex .The second part formulates the existence of colimits globally in the total category ∫ F , and if we let J range over all finite categories it says that X has finite colimits and U preserves all finite colimits. As an example,suppose that A has pushouts and a Grothendieck opfibration U : ∫ F → A has fiberwise pushouts preservedby its reindexing functors. We can construct pushouts in ∫ F as follows:( a + b c , w )( a , x ) ( c , z )( b , y ) p f : b → a in A k : F ( f ) y → x in F ( a ) g : b → c in A ℓ : F ( g ) y → z in F ( c ) (22)where a + b c is defined using the pushout in A shown at left below, and w is formed as the pushout in thefiber F ( a + b c ) at the right below: a + b ca cb p v a v c f g wF ( v a ) x F ( v c ) zF ( v a )( F ( f )( y )) (cid:27) F ( v c )( F ( g )( y )) p F ( v a ) k F ( v c ) ℓ In a similar way we can construct the initial object and coproducts in ∫ F from those in the fibers, namely( a , x ) + ( b , y ) = ( a + b , F ( ι a ) x + F ( ι b ) y ) , ∫ F = (cid:0) A , F (0 A ) (cid:1) (23)where ι a : a → a + b and ι b : b → a + b are the sum inclusions in A and the sum on the second variable is inthe fiber F ( a + b ). Corollary 3.5.
Suppose A has finite colimits and F : ( A , + ) → ( Cat , × ) is a symmetric lax monoidal pseudo-functor for which the corresponding pseudofunctor F : A → SymMonCat from Lemma 3.3 factors through
Rex . Then ∫ F has all finite colimits and the induced opfibration U : ∫ F → A preserves them. Moreover wecan choose finite colimits in ∫ F so that U preserves them strictly.
Regarding the assumptions of the above corollary, notice that since A is cocartesian monoidal, the laxmonoidal pseudofunctor structure ( F , φ, φ ) gives rise to a specific symmetric monoidal structure on thefibers F ( a ) in terms of φ, φ , given explicitly by (20). Since we now ask that the pseudofunctor F : A → SymMonCat factors through
Rex , this fiberwise monoidal structure is required to be cocartesian, namely(20) gives coproducts and an initial object in each F ( a ).On a highly related note, in what follows we are also interested in the existence of a left adjoint L to aninduced monoidal opfibration. The following result provides su ffi cient conditions for that. Following Gray[24], we say a functor has a ‘left adjoint right inverse’ or lari if it has a left adjoint where the unit of theadjunction is the identity. Lemma 3.6 ( Gray ) . Let U : X → A be an opfibration. Then U has a lari if its fibers have initial objectsthat are preserved by the reindexing functors.Proof. This is [24, Proposition 4.4]. Suppose each fiber X a of the opfibration U has an initial object ⊥ a andthese objects are preserved (up to isomorphism) by the reindexing functors. Define L : A → X on objects a ∈ A by L ( a ) = ⊥ a . Given a morphism f : a → a ′ in A , define L ( f ) to be the composite ⊥ a Cocart( f , ⊥ a ) −−−−−−−−−→ f ! ( ⊥ a ) χ a −−→ ⊥ a ′ (24)where Cocart( f , ⊥ a ) is the cocartesian lifting of f to ⊥ a and χ a is the unique isomorphism between twoinitial objects in the fiber above a ′ . The functor L then becomes left adjoint to R with unit ι a : a → U ( L ( a ))being the identity, using the fact that U ( L ( a )) = U ( ⊥ a ) = a . (cid:3) We now have all the necessary background to formally construct an isomorphism between the doublecategory of decorated cospans and the double category of structured cospans, starting from a symmetric lax
TRUCTURED VERSUS DECORATED COSPANS 13 monoidal pseudofunctor F : ( A , + ) → ( Cat , × ) whose corresponding pseudofunctor F : A → SymMonCat factors through
Rex . Proof of Theorem 3.2.
Recall from Theorem 2.1 that the double category of decorated cospans F C sp hasobjects and vertical 1-morphisms as in A , while horizontal 1-cells are cospans a m b in A decoratedby an x ∈ F ( m ) and 2-morphisms are maps of cospans k : m → m ′ together with τ : ( Fk )( x ) → x ′ in F ( m ′ ).Since the corresponding pseudofunctor F : A → SymMonCat factors through
Rex , Corollary 3.5 im-plies that the Grothendieck construction gives rise to a category ∫ F with finite colimits, and we can choosethese in such a way that the corresponding opfibration U : ∫ F → A strictly preserves them. We do this inwhat follows.By Lemma 3.6, U has a left adjoint L : A → ∫ F with UL = A . Diagrammatically, F : A → Cat
7→ ∫ F A U A ∫ F L ⊥ U (25)describes the construction of the adjunction from the original F . Explicitly, the left adjoint picks the initialobject in the fiber of a , namely L ( a ) = ( a , ⊥ a ) which is expressed as F (! a ) ◦ φ ( ∗ ) according to (20) for( φ, φ ) the monoidal structure of F .As a left adjoint, this induced L preserves all colimits that exist between the categories A and ∫ F , whichhave finite colimits, so we can construct the double category of structured cospans L C sp ( ∫ F ) of Theo-rem 3.1. Its objects and vertical 1-morphisms are those of the category A (just as for F C sp ), whereas itshorizontal 1-cells are now cospans of the form L ( a ) ( m , x ) L ( b ) in the Grothendieck category ∫ F (see Definition A.1). Explicitly, they consist of two pairs of morphisms( a , ⊥ a ) i : a → m in A !: F ( i )( ⊥ a ) → x in F ( m ) −−−−−−−−−−−−−−−−−−−→ ( m , x ) o : b → m in A !: F ( o )( ⊥ b ) → x in F ( m ) ←−−−−−−−−−−−−−−−−−−− ( b , ⊥ b ) (26)with x ∈ F ( m ); recall that the reindexing functors F ( i ) , F ( o ) preserve all finite colimits across the fibers.Finally, the 2-morphisms of this double category in this context unravel as follows: ( a , ⊥ a ) ( m , x ) ( b , ⊥ b )( a ′ , ⊥ a ′ ) ( m ′ , x ′ ) ( b ′ , ⊥ b ′ ) i : a → m in A !: F ( i )( ⊥ a ) → x in F ( m ) f : a → a ′ in A χ a : F ( f )( ⊥ a ) (cid:27) ⊥ a ′ in F ( a ′ ) k : m → m ′ in A τ : F ( k )( x ) → x ′ in F ( m ′ ) o : b → m in A !: F ( o )( ⊥ b ) → x in F ( m ) g : b → b ′ in A χ b : F ( g )( ⊥ b ) (cid:27) ⊥ b ′ in F ( b ′ ) i ′ : a ′ → m ′ in A !: F ( i ′ )( ⊥ a ′ ) → x ′ in F ( m ′ ) o ′ : b ′ → m ′ in A !: F ( o ′ )( ⊥ b ′ ) → x ′ in F ( m ′ ) (27)where the outside vertical legs come from the definition of L on arrows (24). Explicitly, the commutativityof the above squares translates to the conditions k ◦ i = i ′ ◦ f and k ◦ o = o ′ ◦ g in A , and also to F ( k ◦ i )( ⊥ a ) (cid:27) Fk ( Fi ( ⊥ a )) Fk (!) −−−→ Fk ( x ) τ −→ x ′ = (28) F ( i ′ ◦ f )( ⊥ a ) (cid:27) Fi ′ ( F f ( ⊥ a )) Fi ′ ( χ a ) −−−−−→ Fi ′ ( ⊥ a ′ ) ! −→ x ′ in the fiber F ( m ′ ), by composition in the Grothendieck category (39). Since both morphisms emanatefrom the mapped initial object in F ( m ′ ) under the finite-colimit-preserving reindexing functors, they are theunique such into x ′ therefore this gives no extra conditions; similarly for the equality including o , o ′ .Building towards an isomorphism of the above described double categories, we now define a doublefunctor sending structured cospans to decorated cospans: E = ( E , E ) : L C sp ( ∫ F ) −→ F C sp . We set E : A → A to be the identity, and decree that E sends any L -structured cospan as in (26) to thedecorated cospan a i −→ m o ←− b with decoration x ∈ F ( m ), whereas E sends any map of L -structured cospans as in (27) to the map of F -decorated cospans given by a m ba ′ m ′ b ′ if k o gi ′ o ′ along with the morphism of decorations τ : F ( k )( x ) → x ′ in F ( m ′ ) coming from the middle arrow of(27). We then make E into double functor as in Definition A.4. First, both E and E are functorsthat appropriately commute with sources and targets. Second, we equip E with globular 2-isomorphisms E ( N ) ⊙ E ( M ) ∼−→ E ( N ⊙ M ) for any pair of composable horizontal 1-cells M = ( a , ⊥ a ) ( m , x ) ( b , ⊥ b )and N = ( b , ⊥ b ) ( n , y ) ( c , ⊥ c ) and U E ( m ) ∼−→ E ( U m ) for any object m of L C sp ( ∫ F ). Explicitly, E ( N ) ⊙ E ( M ) is given as in (5) via the pushout cospan and decoration m + b na b x × y −−→ F ( m ) × F ( n ) φ m , n −−−→ F ( m + n ) F ( ψ ) −−−→ F ( m + b n ) . (29)On the other hand, N ⊙ M computed as in (22) is( m + b n , F ( v m ) x + ( ⊥ m + bn ) F ( v n ) y )( m , x ) ( n , y )( a , ⊥ a ) ( b , ⊥ b ) ( c , ⊥ c ) (30)where v m , v n are the canonical maps into the pushout. Under E this is mapped to the cospan a m + b n b with decoration F ( v m ) x + F ( v n ) y in the fiber F ( m + b n ) – since a pushout over an initial object is just a sum.This decoration is canonically isomorphic to that of (29) due to the following diagram F ( m ) × F ( n ) F ( m + n ) F ( m + b n ) F ( m + b n ) × F ( m + b n ) F (( m + b n ) + ( m + b n )) F ( m + b n ) φ m , n F ( v m ) × F ( v n ) φ vm , vn (cid:27) F ( ψ ) (cid:27) F ( v m + v n ) φ m + bn , m + bn F ( ∇ ) (31)where the composite of the bottom two arrows is the coproduct + : F ( m + b n ) × F ( m + b n ) → F ( m + b n )as in (20). The left-hand isomorphism comes from pseudonaturality of φ as in (37), whereas the right-handisomorphism follows from universal properties and pseudofunctoriality of F . Thus, we have a globular2-isomorphism E ⊙ : E ( N ) ⊙ E ( M ) ∼−→ E ( N ⊙ M ).Finally, we construct a globular 2-isomorphism U E ( m ) ∼−→ E ( U m ). The identity horizontal 1-cell U m in L C sp ( ∫ F ) is ( m , ⊥ m ) ( m , ⊥ m ) ( m , ⊥ m ) with 1 m as the A -component and isomorphisms betweeninitial objects in the fibers. Thus E ( U m ) is the identity cospan in A together with the ‘initial decoration’ ⊥ m ∈ F ( m ), and so is U E ( m ) as in (4). It can be verified that with this structure, E satisfies the axioms of adouble functor.In fact, this double functor E : L C sp ( ∫ F ) → F C sp is bijective on objects and vertical 1-cells (triviallyas an identity functor), and is also bijective on horizontal 1-cells and on 2-morphisms. Indeed, for (26),the unique maps from the initial objects in the fibers provide no actual extra information, and similarly for2-cells all extra data in (27) is uniquely determined and (28) holds automatically as discussed above. As aresult, we have a double isomorphism L C sp ( ∫ F ) (cid:27) F C sp . (32)Since both double categories are symmetric monoidal under the running assumptions (Theorems 2.2and 3.1), we now show that this double isomorphism is a symmetric monoidal one, namely that E = ( E , E ) is a symmetric monoidal double functor as per Definition A.8. Indeed, E = id A is a symmet-ric monoidal functor trivially. For E , given two structured cospans M = ( a , ⊥ a ) → ( m , x ) ← ( b , ⊥ b ) and TRUCTURED VERSUS DECORATED COSPANS 15 M ′ = ( a ′ , ⊥ a ′ ) → ( m ′ , x ′ ) ← ( b ′ , ⊥ b ′ ) in L C sp ( ∫ F ), we compute the appropriate decorated cospans E ( M ) ⊗ E ( M ′ ) (10) = a + a ′ i + i ′ −−→ m + m ′ o + o ′ ←−−− b + b ′ with φ m , m ′ ( x , x ′ ) ∈ F ( m + m ′ ) E ( M ⊗ M ′ ) (18) = E (cid:16) ( a + a ′ , ⊥ a + a ′ ) → ( m + m ′ , F ( ι m ) x + F ( ι m ′ ) x ′ ) | {z } (23) ← ( b + b ′ , ⊥ b + b ′ ) (cid:17) = a + a ′ i + i ′ −−→ m + m ′ o + o ′ ←−−− b + b ′ with F ( ι m ) x + F ( ι m ′ ) x ′ ∈ F ( m + m ′ )The cospan part is equal, whereas we have an isomorphism between the decorations, F ( ι m ) x + F ( ι m ′ ) x ′ (cid:27) φ m , m ′ ( x , x ′ ), given in an analogous way to (31) as follows: F ( m ) × F ( m ′ ) F ( m + m ′ ) F ( m + m ′ ) × F ( m + m ′ ) F (( m + m ′ ) + ( m + m ′ )) F ( m + m ′ ) φ m , m ′ F ( ι m ) × F ( ι m ′ ) φ ι m ,ι m ′ (cid:27) (37) (cid:27) F ( ι m + ι m ′ ) φ m + m ′ , m + m ′ F ( ∇ ) (33)where the composite of the bottom two arrows is the coproduct operation in F ( m + m ′ ). We thus haveconstructed an isomorphism E ⊗ : E ( M ) ⊗ E ( M ′ ) ∼−→ E ( M ⊗ M ′ ) for each M , M ′ .Moreover, the monoidal unit I for L C sp ( ∫ F ) is mapped under E to the decorated cospan given in(11), so E strictly preserves the monoidal unit. It can be verified that with this structure, E is also asymmetric monoidal functor. For example, the associativity axiom ensuring that the two ways to go from E ( M ) ⊗ E ( M ′ ) ⊗ E ( M ′′ ) to E ( M ⊗ M ′ ⊗ M ′′ ) using the above structure isomorphisms are equal, can infact be deduced from the more general 2-equivalence between monoidal opfibrations and pseudofunctorsinto MonCat already discussed in [42, Theorem 2.7], for the induced global monoidal structure given by( φ, φ ) as discussed in Lemma 3.3. Moreover, the earlier associativity axiom for the double functor structureisomorphism E ⊙ can be deduced using the one for E ⊗ , by observing that (31) factors through (33) as follows F ( m ) × F ( n ) F ( m + n ) F ( m + n ) × F ( m + n ) F (( m + n ) + ( m + n )) F ( m + n ) F ( m + b n ) × F ( m + b n ) F (( m + b n ) + ( m + b n )) F ( m + b n ) φ m , n F ( ι m ) × F ( ι n ) F ( v m ) × F ( v n ) (cid:27) φ ι m ,ι n (cid:27) (cid:27) F ( ι m + ι n ) F ( ψ ) × F ( ψ ) φ ψ,ψ (cid:27) φ m + n , m + n F ( ∇ ) F ( ψ + ψ ) (cid:27) F ( ψ ) φ m + bn , m + bn F ( ∇ ) due to φ being a pseudonatural transformation, where v = ψ ◦ ι as in (5) and the bottom right isomorphismcomes from naturality of ∇ . Notice that the bottom two-part composite isomorphism is the induced strongmonoidal structure on the reindexing functor F ( ψ ) as in (21).In a similar way, the rest of the axioms of Definition A.8 hold: on the cospan level they are easy to verify,whereas on the decoration level they entail nontrivial calculations based on the structures involved. Inconclusion, the double isomorphism (32) is an isomorphism of symmetric monoidal double categories. (cid:3) In fact, a careful examination of the proof reveals that the assumptions of Theorem 3.2 could be weak-ened to state that the pseudofunctor F : A → SymMonCat factors through the 2-category
Cocart of co-cartesian monoidal categories. The reason is that when we compose two structured cospans as in (30), theapex of the composite cospan ends up being a sum in the second variable due to the definition of the leftadjoint functor L which forces the feet of all cospans to involve a fiberwise initial object. However, in themost interesting examples seen so far, when F factors through Cocart it also factors through
Rex .4. B icategorical and categorical aspects
While double categories are a natural context for studying cospans, bicategories are more familiar—andof course, categories are even more so! Luckily, all our results phrased in the language of double categorieshave analogues for bicategories and categories. We explain those here.As discussed for example by Shulman [43], any double category D has a horizontal bicategory , denoted D , in which: • objects are objects of D , • morphisms are horizontal 1-cells of D , • globular D , meaning 2-morphisms whose source and target ver-tical 1-morphisms are identities, • composition of morphisms is given by composition of horizontal 1-cells in D , • vertical and horizontal composition of 2-morphisms are given by vertical and horizontal composi-tion of 2-morphisms in D .The bicategory D has a decategorification , a category D in which: • objects are objects of D , • morphisms are isomorphism classes of morphisms of D .Thus, the double category F C sp of structured cospans constructed in Theorem 2.1 automatically gives riseto a bicategory F Csp , and a category F Csp . In Theorem 2.2 we gave conditions under which the doublecategory F C sp becomes symmetric monoidal. We would like the bicategory F Csp and the category F Csp to become symmetric monoidal under the same conditions, and indeed this is true.A double category is ‘fibrant’ if every vertical 1-morphism has a ‘companion’ and a ‘conjoint’—conceptsexplained in Definition A.10. Shulman (Theorem A.12) proved that when a double category D is fibrant,any symmetrical monoidal structure on D gives one on D . We can apply this to decorated cospans asfollows: Lemma 4.1.
The double category F C sp is fibrant.Proof. We show that any vertical 1-morphism f : a → b in F C sp has a companion and a conjoint. First,we can make this horizontal 1-cell ˆ f : a b b ⊥ b ∈ F ( b ) f where ⊥ b is the trivial decoration as in (4), into a companion of f using the following 2-morphisms: ab b bbb ⊥ b ∈ F ( b ) ⊥ b ∈ F ( b ) a a aa b b ⊥ a ∈ F ( a ) ⊥ b ∈ F ( b ) τ b = ⊥ b τ f : F ( f )( ⊥ a ) → ⊥ bf f
11 11 11 ff f where the decoration morphism τ f is the isomorphism given by the pseudofunctoriality of F : F (0) F ( a ) F ( b ) (cid:27) φ F (! a ) F (! b ) F ( f ) These 2-morphisms satisfy the equations (42) required of a companion, involving vertical (2) and horizontal(6) composition of 2-morphisms in this double category: a a a ⊥ a ∈ F ( a ) ab b bbb ⊥ b ∈ F ( b ) ⊥ b ∈ F ( b ) a a ab b b ⊥ a ∈ F ( a ) ⊥ b ∈ F ( b ) τ f : F ( f )( ⊥ a ) → ⊥ b τ b = ⊥ b τ f : F ( f )( ⊥ a ) → ⊥ b = f ff f
11 11 1 f f f abaa ab b bbb ⊥ b ∈ F ( b ) ⊥ b ∈ F ( b ) τ b = ⊥ b ⊥ a ∈ F ( a ) ⊥ b ∈ F ( b ) τ f : F ( f )( ⊥ a ) →⊥ b = ab b bb ⊥ b ∈ F ( b ) ⊥ a ∈ F ( a ) ⊥ b ∈ F ( b ) τ ρ ˆ f : ( ⊥ b ⊙⊥ a ) →⊥ b a b b ⊥ b ∈ F ( b ) τ λ ˆ f : ( ⊥ b ⊙⊥ b ) →⊥ b aaa f
11 1 1 f f f f f
11 111 f f Note that the right hand side of the first equation is U f , while the second equation involves the left and rightunitors for ⊙ , which may be found in (9): these are maps from a horizontal composite of two decoratedcospans to a single decorated cospan. The conjoint of f is given by this horizontal 1-cell ˇ f , which is justthe opposite of the companion above: b b a ⊥ b ∈ F ( b ). f Just as ˆ f obeys the equations required of a companion, ˇ f obeys the equations required of a conjoint withsimilar structure 2-morphisms to those of a companion above. (cid:3) Theorem 4.2.
Let A be a category with finite colimits and F : ( A , + ) → ( Cat , × ) a symmetric lax monoidalpseudofunctor. Then there exists a symmetric monoidal bicategory F Csp in which:(1) objects are those of A ,(2) morphisms are F-decorated cospans:a m b x ∈ F ( m ) , i o (3) a 2-morphism is a map of cospans in A a m bm ′ x ∈ F ( m ) x ′ ∈ F ( m ′ ) i oi ′ h o ′ together with a morphism τ : F ( h )( x ) → x ′ in F ( m ′ ) .Proof. This follows by applying Shulman’s result (Theorem A.12) to the fibrant symmetric monoidal dou-ble category F C sp . (cid:3) This symmetric monoidal bicategory F Csp generalizes the one constructed by the second author [13].We can decategorify F Csp to obtain a symmetric monoidal category generalizing the kind considered byFong [17]:
Corollary 4.3.
Let A be a category with finite colimits and F : ( A , + ) → ( Cat , × ) a symmetric lax monoidalpseudofunctor. Then there exists a symmetric monoidal category F Csp in which:(1) objects are those of A (2) morphisms are isomorphism classes of F-decorated cospans of A , where two F-decorated cospansa m b x ∈ F ( m ) i o a m ′ b x ′ ∈ F ( m ′ ) i ′ o ′ are isomorphic if and only if there exists an isomorphism f : m → m ′ in A such that followingdiagram commutes: a mm ′ b i ′ o ′ i of and there exists an isomorphism τ : F ( f )( x ) → x ′ in F ( m ′ ) . In Theorem 3.2 we gave conditions under which the symmetric monoidal double category of decorated cospans F C sp is isomorphic to the symmetric monoidal double category of structured cospans L C sp ( ∫ F ).We now show that under the same conditions we get an isomorphism of symmetric monoidal bicategories,and of categories. Theorem 4.4.
Suppose A has finite colimits and F : ( A , + ) → ( Cat , × ) is a symmetric lax monoidal pseud-ofunctor that factors through Rex as an ordinary pseudofunctor. Define the symmetric monoidal bicategory L Csp ( ∫ F ) as in Theorem 3.2. Then there is an isomorphism of symmetric monoidal bicategoriesF Csp (cid:27) L Csp ( ∫ F ) and of symmetric monoidal categories F Csp (cid:27) L Csp ( ∫ F ) . Proof.
Hansen and Shulman [27] showed that the passage from symmetric monoidal double categoriesto symmetric monoidal bicategories is functorial in a suitable sense. This implies that an isomorphismof symmetric monoidal double categories D (cid:27) D ′ gives an isomorphism of symmetric monoidal bicate-gories D (cid:27) D ′ . Since the process of decategorifying a bicategory merely discards 2-morphisms and takesisomorphism classes of 1-morphisms, the isomorphism of symmetric monoidal bicategories D (cid:27) D ′ inturn induces an isomorphism of symmetric monoidal categories D (cid:27) D ′ . Thus, the theorem follows fromTheorem 3.2. (cid:3)
5. A pplications
Thinking about systems and processes categorically dates back to early works by Lawvere [35], Bunge–Fiore [11], Joyal–Nielsen–Winskel [30], Katis–Sabadini–Walters [31] and others. Spivak and others haveused wiring diagrams and sheaves to capture compositional features of dynamical systems, [8, 41, 45].Another approach uses signal flow diagrams and other string diagrams [3, 9, 19] to understand systemsbehaviorally, following ideas of Willems [47].Decorated cospans were introduced by Fong [17, 18] to describe open systems as cospans equippedwith extra data. They were then applied to open electrical circuits [4], Markov processes [5], and chemicalreaction networks [7]. Unfortunately, some of these applications were marred by technical flaws, whichwere later fixed using structured cospans [1]. Here we explain how to also fix them using our new decoratedcospans, since they provide another solution to these problems. Below we compare the two approaches inapplications to graphs, electrical circuits, Petri nets, reaction networks and dynamical systems.In many cases, Theorem 3.2 shows that the structured and decorated cospan approaches are equivalent:Sections 5.1 to 5.3 illustrate this. However, in Section 5.4 we describe a map from ‘open Petri nets withrates’ to open dynamical systems. The former are conveniently described using structured cospans, whilethe latter can only be treated using decorated cospans. Here Theorem 3.2 serves as a bridge that lets usconnect the two formalisms.5.1.
Graphs.
One of the simplest kinds of network is a graph. For us a graph will be a pair of functions s , t : E → N where E and N are finite sets. We call elements of E edges and elements of N nodes . Thereis a category Graph where the objects are graphs and a morphism from the graph s , t : E → N to the graph s ′ , t ′ : E ′ → N ′ is a pair of functions f : E → E ′ , g : N → N ′ such that these diagrams commute: EE ′ NN ′ ss ′ f g EE ′ NN ′ . tt ′ f g TRUCTURED VERSUS DECORATED COSPANS 19
We can easily build a double category with ‘open graphs’ as horizontal 1-cells using the machineryof structured cospans, see [1, Section 5]. Let L : FinSet → Graph be the functor that assigns to a finiteset N the discrete graph on N : the graph with no edges and N as its set of vertices. Both FinSet and
Graph have finite colimits, and the functor L : FinSet → Graph is left adjoint to the forgetful functor R : Graph → FinSet that assigns to a graph G its underlying set of vertices R ( G ). Thus, using structuredcospans and appealing to Theorem 3.1, we get a symmetric monoidal double category L C sp ( Graph ) inwhich: • objects are finite sets, • a vertical 1-morphism from X to Y is a function f : X → Y , • a horizontal 1-cell from X to Y is an open graph from X to Y , meaning a cospan in Graph of thisform: L ( X ) G L ( Y ), i o • a 2-morphism is a commuting diagram in Graph of this form: L ( X ) G L ( Y ) L ( X ) G L ( Y ). I O I O L ( f ) α L ( g ) Here is an example of an open graph: • n • n • n • n e e e e e X Y
We can also build a double category with open graphs as horizontal 1-cells using decorated cospans. Forany finite set N , there is a category F ( N ) where: • an object is a graph structure on N : that is, a graph s , t : E → N , • a morphism from s , t : E → N to s ′ , t ′ : E ′ → N is a morphism of graphs that is the identity on N :that is, a function g : E → E ′ such that these diagrams commute: EE ′ N ss ′ g EE ′ N . tt ′ g In general, decorated cospans involve a pseudofunctor to
Cat , but in this example there is actually anhonest functor F : Set → Cat that assigns to a set N the above category F ( N ). Given a function f : M → N ,we define F ( f ) : F ( M ) → F ( N ) as the functor that maps any graph structure s , t : E → M to the graphstructure f s , f t : E → N .We can make F into a symmetric lax monoidal pseudofunctor F : ( FinSet , + ) → ( Cat , × ) by equippingit with suitable functors φ N , N ′ : F ( N ) × F ( N ′ ) → F ( N + N ′ ) , φ : → F ( ∅ ) . The functor φ is uniquely determined since F ( ∅ ) is the terminal category. More interesting is φ N , N ′ . Thisfunctor maps a pair of graph structures s , t : E → N and s ′ , t ′ : E ′ → N ′ to the graph structure s + s ′ , t + t ′ : E + E ′ → N + N ′ . In other words, it sends a pair of graph structures to their ‘disjoint union’. Surprisingly,though F is a functor, this choice of φ N , N ′ does not make F into a symmetric lax monoidal functor, but only asymmetric lax monoidal pseudofunctor, since it obeys the required laws only up to natural isomorphism, asin (35). See [1, Section 5] for a proof that these laws fail to hold on the nose. This fact is what necessitateda generalization of Fong’s original approach to decorated cospans.It is well known, and easy to check, that the Grothendieck category ∫ F is isomorphic to the category Graph . The other side of this observation is that the opfibration U : ∫ F → FinSet is isomorphic to the forgetful functor R : Graph → FinSet . In fact one can check that U : ∫ F → FinSet and R : Graph → FinSet are isomorphic as symmetric monoidal opfibrations, where all the categories involved are given cocartesianmonoidal structures.Starting from the symmetric lax monoidal pseudofunctor F : ( FinSet , + ) → ( Cat , × ), Theorem 2.2 givesus a symmetric monoidal double category F C sp in which: • objects are sets, • a vertical 1-morphism from X to X ′ is a function f : X → X ′ , • a horizontal 1-cell from X to Y is a pair X N Y G ∈ F ( N ) i o which can also be thought of as an open graph from X to Y , • a 2-morphism X N YX ′ Y ′ N ′ G ∈ F ( N ) G ′ ∈ F ( N ′ ) i of go ′ i ′ h is a commuting diagram in FinSet together with a morphism τ : F ( h )( G ) → G ′ in F ( N ′ ).We thus have two symmetric monoidal double categories: L C sp ( Graph ) obtained from structured cospansand F C sp obtained from decorated cospans. Each of these double categories has FinSet as its category ofobjects, open graphs as horizontal 1-cells, and maps of open graphs as 2-morphisms. This suggests that L C sp ( Graph ) and F C sp are isomorphic as symmetric monoidal double categories—and indeed this followsfrom Theorem 3.2.5.2. Circuits.
Structured and decorated cospans are a powerful tool for studying categories where themorphisms are electrical circuits—see [1, Section 6.1] and [2, 4]. The key idea is to use open graphs withlabeled edges to describe circuits, where the labels can stand for resistors with any chosen resistance, ca-pacitors with any chosen capacitance, or other circuit elements. The whole theory of open graphs discussedin the previous section can be recapitulated for labeled graphs. Since the abstract formalism works the sameway, we can be brief. Concrete applications of this formalism are discussed in the references.Fix a set L to serve as edge labels. Define an L - graph to be a graph s , t : E → N equipped with afunction ℓ : E → L . There is a category Graph L where the objects are L -graphs and a morphism from the L -graph L E s / / t / / ℓ o o N to the L -graph L E ′ s ′ / / t ′ / / ℓ ′ o o N ′ is a pair of functions f : E → E ′ , g : N → N ′ such that these diagrams commute: EE ′ NN ′ ss ′ f g EE ′ NN ′ tt ′ f g L EE ′ . ℓ f ℓ ′ There is a functor U : Graph L → FinSet that takes an L -graph to its underlying set of nodes. This has aleft adjoint L : FinSet → Graph L sending any set to the L -graph with that set of nodes and no edges. Both FinSet and
Graph L have colimits, and L preserves them.This sets the stage for structured cospans: Theorem 3.1 gives us a symmetric monoidal double category L C sp ( Graph L ) where a horizontal 1-cell is an open L - graph , also called an L - circuit : that is, a cospan in Graph L of this form: L ( X ) G L ( Y ). i o TRUCTURED VERSUS DECORATED COSPANS 21
For example, here is a L -circuit with L = (0 , ∞ ): • •• •• . .
71 9 . . . . X Y
The edges here represent wires, with the positive real numbers labeling them serving to describe the resis-tance of resistors on the wires. The elements of the sets X and Y represent ‘terminals’: that is, points wherewe allow ourselves to attach a wire from another circuit.We can now also describe L -circuits using our new approach to decorated cospans. There is a symmetriclax monoidal pseudofunctor F : ( FinSet , + ) → ( Cat , × ) such that for any finite set N , the category F ( N )has: • objects being L - graph structures on N : that is, L -graphs where the set of nodes is N , • morphisms being morphisms of L -graphs that are the identity on the set of nodes.This gives a symmetric monoidal double category F C sp , and using Theorem 3.2 we can show that this isisomorphic, as a symmetric monoidal double category, to L C sp ( Graph L ).5.3. Petri nets.
Petri nets are widely used as models of systems in engineering and computer science[20, 39]. Structured cospans have been used to define a symmetric monoidal double category of ‘open Petrinets’ [6], which lets us build large Petri nets out of smaller pieces. We can also use decorated cospansto create a double category of open Petri nets. Again this example is very similar to the example of opengraphs.A
Petri net is a pair of sets S and T and functions s , t : T → N [ S ]. Here S is the set of places , T is theset of transitions , and N [ S ] is the underlying set of the free commutative monoid on S . Each transitionthus has a formal sum of places as its source and target as prescribed by the functions s and t , respectively.Here is an example: HO α H O This Petri net has a single transition α with 2H + O as its source and H O as its target.There is a category
Petri with Petri nets as objects, where a morphism from the Petri net s , t : T → N [ S ]to the Petri net s ′ , t ′ : T ′ → N [ S ′ ] is a pair of functions f : T → T ′ , g : S → S ′ such that the followingdiagrams commute: T f (cid:15) (cid:15) s / / N [ S ] N [ g ] (cid:15) (cid:15) T ′ s ′ / / N [ S ′ ] T f (cid:15) (cid:15) t / / N [ S ] N [ g ] (cid:15) (cid:15) T ′ t ′ / / N [ S ′ ] . There is a functor R : Petri → Set sending any Petri net to its set of places, and this has a left adjoint L : Set → Petri sending any set S to the Petri net with S as its set of places and no transitions [6, Lemma11]. Since both Set and
Petri have finite colimits and L preserves them, Theorem 3.1 yields a symmetricmonoidal double category L C sp ( Petri ) in which: • objects are finite sets, • vertical 1-morphisms are functions, • horizontal 1-cells are open Petri nets , which are cospans in Petri of the form: L ( X ) P L ( Y ) i o • Petri of the form: L ( X ) L ( Y ) P L ( X ) L ( Y ). P O L ( f ) L ( g ) α I I O We can equivalently describe open Petri nets using decorated cospans. This works very much like theprevious examples. There is a symmetric lax monoidal pseudofunctor F : ( FinSet , + ) → ( Cat , × ) such thatfor any finite set S , the category F ( S ) has: • objects given by Petri nets whose set of places is S , • morphisms given by morphisms of Petri nets that are the identity on the set of places.This gives a symmetric monoidal double category F C sp , and using Theorem 3.2 we can show that this isisomorphic, as a symmetric monoidal double category, to L C sp ( Petri ).The machinery of structured cospans has been used to provide a semantics for open Petri nets [6]: asymmetric monoidal double functor from L C sp ( Petri ) to a symmetric monoidal double category of ‘opencommutative monoidal categories’. Presumably this double functor can equivalently be obtained using themachinery of decorated cospans, with the help of Theorem 2.3. However, it should be clear by now that sofar, in cases where either structured or decorated cospans can be used, structured cospans are simpler. Wenext turn to an example where decorated cospans are necessary.5.4.
Petri nets with rates.
In chemistry, population biology, epidemiology and other fields, modelers use‘Petri nets with rates’, where the transitions are labeled with positive real numbers called ‘rate constants’[25, 33, 46]. From any Petri net with rates one can systematically construct a dynamical system. Mathe-matical chemists have proved deep theorems relating the topology of Petri nets with rates to the qualitativebehavior of their dynamical systems [15].Pollard and the first author showed how to construct an open dynamical system from any open Petri netwith rates, thus defining a functor from a category with open Petri nets with rates as morphisms to one withopen dynamical systems as morphisms [7]. They used Fong’s original decorated cospans to do this. Later,structured cospans were used to promote the first of these categories to a double category [1, Section 6.16].Here we show that the second of these categories, with open dynamical systems as morphisms, cannot bemade into a double category using structured cospans. However, we can do it using decorated cospans.First, to briefly illustrate these ideas, here is an open Petri net with rates:
SI Rr r i i i o X Y
It is an open Petri net where the transitions are labeled with rate constants r , r >
0. Here is the corre-sponding open dynamical system: dS ( t ) dt = − r S ( t ) I ( t ) + I ( t ) + I ( t ) dI ( t ) dt = r S ( t ) I ( t ) − r I ( t ) + I ( t ) dR ( t ) dt = r I ( t ) − O ( t ) . (34)Here I ( t ) , I ( t ) , I ( t ) and O ( t ) are arbitrary smooth functions of time, which describe inflows and outflowsat the points i , i , i ∈ X and o ∈ Y . If we drop these inflow and outflow terms, we obtain a dynamicalsystem: an autonomous system of coupled nonlinear first-order ordinary di ff erential equations. In fact theseequations are a famous model of infectious disease, the ‘SIR model’, where S ( t ), I ( t ) and R ( t ) describe the TRUCTURED VERSUS DECORATED COSPANS 23 populations of susceptible, infected and recovered individuals, respectively. The inflow and outflow termsallow individuals to enter or leave the population. This in turn lets us couple the SIR model to other models,and build larger models from smaller pieces.Recently Halter and Patterson [26] implemented this idea in a software tool that makes it easy to buildepidemiological models using structured cospans. They used this to rebuild part of the COVID-19 modelthat the UK has been using to make policy decisions. The advantage of using structured or decoratedcospans is that one can build complex models from smaller pieces, so one can easily add or change parts,and better understand the e ff ects of doing this.Now we turn to the details. A Petri net with rates is a Petri net s , t : T → N [ S ] together with a function r : T → (0 , ∞ ) assigning to each transition τ ∈ T a positive real number called its rate constant . There is acategory Petri r whose objects are Petri nets with rates, where a morphism from(0 , ∞ ) T r o o t / / s / / N [ S ]to (0 , ∞ ) T ′ r ′ o o t ′ / / s ′ / / N [ S ′ ]is a morphism of the underlying Petri nets such that the following diagram also commutes:(0 , ∞ ) TT ′ frr ′ There is a functor R : Petri r → Set sending any Petri net with rates to its set of places, and this has a leftadjoint L : Set → Petri r sending any set S to the Petri net with S as its set of places and no transitions[1, Lemma 6.18]. Since Petri r has finite colimits [1, Lemma 6.19], it follows that there is a symmetricmonoidal double category L C sp ( Petri r ) where: • objects are finite sets, • vertical 1-morphisms are functions, • horizontal 1-cells are open Petri nets with rates , namely diagrams in Petri r of the form L ( X ) P L ( Y ), i o • Petri r of the form L ( X ) L ( Y ) P L ( X ) L ( Y ). P O L ( f ) L ( g ) α I I O We can equivalently describe open Petri nets with rates using decorated cospans. There is a symmetriclax monoidal pseudofunctor F : ( FinSet , + ) → ( Cat , × ) such that for any finite set S , the category F ( S )has: • objects given by Petri nets with rates whose set of places is S , • morphisms given by morphisms of Petri nets with rates that are the identity on the set of places.This gives a symmetric monoidal double category F C sp , and using Theorem 3.2 we can show that this isisomorphic, as a symmetric monoidal double category, to L C sp ( Petri r ).All this so far is very similar to the previous examples. More interesting is the symmetric monoidaldouble category of open dynamical systems. A dynamical system is a vector field from the perspectiveof a system of first-order ordinary di ff erential equations. A Petri net with rates gives a special sort ofdynamical system: an algebraic vector field on R n , meaning one where the components of the vector fieldare polynomials in the coordinates. We shall think of such a vector field as a special sort of function v : R n → R n . Using Fong’s original approach to decorated cospans, Pollard and the first author constructed a sym-metric monoidal category for which the morphisms are open dynamical systems [7, Theorem 17]. Thiscategory is constructed from a symmetric lax monoidal functor D : FinSet → Set such that: • D maps any finite set S to D ( S ) = { v : R S → R S | v is algebraic } . • D maps any function f : S → S ′ between finite sets to the function D ( f ) : D ( S ) → D ( S ′ ) given asfollows: D ( f )( v ) = f ∗ ◦ v ◦ f ∗ where the pullback f ∗ : R S ′ → R S is given by f ∗ ( c )( σ ) = c ( f ( σ ))while the pushforward f ∗ : R S → R S ′ is given by f ∗ ( c )( σ ′ ) = X { σ ∈ S : f ( σ ) = σ ′ } c ( σ ) . The functorality of D is proved in [7, Lemma 15] while the lax symmetric monoidal stucture is given inLemma 16 of that paper.Since every set gives a discrete category with that set of objects, we can reinterpret D as a symmetriclax monoidal pseudofunctor D : ( FinSet , + ) → ( Cat , × ) which happens to actually be a functor. ApplyingTheorem 2.2 we obtain a symmetric monoidal double category D C sp where: • objects are finite sets, • vertical 1-morphisms are functions, • a horizontal 1-cell from X to Y is an open dynamical system , that is, a cospan X S Y i o in FinSet together with an algebraic vector field v ∈ D ( S ), • a 2-morphism from X S Y , v ∈ D ( S ) i o to X ′ S ′ Y ′ v ′ ∈ D ( S ′ ) i ′ o ′ is a diagram X YSX ′ Y ′ S ′ of ghii ′ o ′ in FinSet such that D ( h )( v ) = v ′ .Next, we can define a symmetric monoidal double functor (cid:4) : F C sp → D C sp sending any open Petri net with rates to its corresponding open dynamical system. This was already definedat the level of categories by Pollard and the first author [7, Section 7], who called it ‘gray-boxing’. To boostthis result to the double category level we use Theorem 2.3, taking the square in that theorem to be FinSet
Cat
FinSet
Cat . ⇓ θ F D Here θ is a monoidal natural isomorphism given as follows. For any finite set S , θ S : F ( S ) → D ( S ) mapsany Petri nets with rates (0 , ∞ ) T r o o t / / s / / N [ S ] TRUCTURED VERSUS DECORATED COSPANS 25 to an algebraic vector field on R S , say v . This vector field is defined using a standard prescription takenfrom chemistry, called ‘the law of mass action’. Namely, for any c ∈ R s , we set v ( c ) = X τ ∈ T r ( τ ) ( t ( τ ) − s ( τ )) c s ( τ ) where c s ( τ ) = Y i ∈ S c is ( τ ) i and we think of t ( τ ) , s ( τ ) ∈ N [ S ] as vectors in R S . This formula is explained in the paper with Pollard,where it is also shown that θ defines a monoidal natural isomorphism between functors to ( Set , × ) [7,Theorem 18]. As such, it automatically becomes a monoidal natural isomorphism between the functors F , D : ( FinSet , + ) → ( Cat , × ). Thus, it defines a symmetric monoidal double functor (cid:4) : F C sp → D C sp .In applications, this double functor lets us turn an open Petri net with rates into an open dynamicalsystem as follows. Given a Petri net with rates P and defining v as above, we obtain a system of first-orderordinary di ff erential equations for a function c : R → R S called the rate equation : ddt c ( t ) = v ( c ( t )) . More generally, when P is part of an open Petri net with rates L ( X ) P L ( Y ), i o we get an open dynamical system called the open rate equation : ddt c ( t ) = v ( c ( t )) + i ∗ ( I ( t )) − o ∗ ( O ( t ))where I : R → R X and O : R → R X are arbitrary smooth functions describing inflows and outflows , respec-tively. Applying this prescription to the open Petri net with rates shown at the start of this section one getsthe di ff erential equations (34). Other examples are worked out in [7].We now show that the decorated cospan double category D C sp of open dynamical systems is not iso-morphic to a structured cospan double category via Theorem 3.2. Recall that in that theorem we start withthe data required to build a decorated cospan category, namely a symmetric lax monoidal pseudofunctor F : ( A , + ) → ( Cat , × ), and show that if the resulting pseudofunctor F : A → SymMonCat factors through
Rex , then the opfibration U : X = ∫ F → A has a left adjoint L : A → X . We then obtain an isomorphism be-tween decorated and structured cospan double categories, F C sp (cid:27) L C sp ( X ). We now show that in the caseat hand, where F = D , the opfibration U does not have a left adjoint. Thus, the conditions of Theorem 3.2do not hold in this case: F does not factor through Rex .Taking D as above, it is easy to see that in the category ∫ D • an object is a pair ( S , v ) where S is a finite set and v is an algebraic vector field v : R S → R S , • a morphism from ( S , v ) to ( S ′ , v ′ ) is a function f : S → S ′ such that v ′ = f ∗ ◦ v ◦ f ∗ .with the usual composition of functions. The forgetful functor U : ∫ D → FinSet acts as follows: • on objects, D ( S , v ) = S , • on morphisms, D ( f ) = f .To show that U does not have a left adjoint, we use the following well-known result: Lemma 5.1.
A functor U : A → X admits a left adjoint if and only if for every x ∈ X , the comma categoryx ↓ U has an initial object.
Because the empty set is initial in
FinSet , the comma category ∅ ↓ U is just ∫ D . This contains an object( ∅ , v ∅ ), where v ∅ is the only possible vector field on R ∅ , namely, the zero vector field. The only object in ∫ D with any morphisms to ( ∅ , v ∅ ) is ( ∅ , v ∅ ) itself, so no other object can be initial. However ( ∅ , v ∅ ) is notinitial either, because it has no morphisms to an object ( S , v ) unless v is the zero vector field on R S . Thusby Lemma 5.1, U does not have a left adjoint.
6. C onclusions
We have given conditions under which a decorated cospan double category is isomorphic to a structuredcospan double category, in Theorem 3.2. The converse question is also interesting: is every structuredcospan double category isomorphic to a decorated cospan double category? The answer is similar to theprevious one: yes, under certain conditions that let us pass from an appropriate functor L : A → X to anappropriate pseudofunctor F : A → Cat .Let us now sketch the story; details will appear in a forthcoming paper [12]. Suppose the conditions holdfor constructing the double category of structured cospans L C sp ( X ) as in Theorem 3.1. That is, suppose A and X have finite colimits and L : A → X preserves them. If L also has a right adjoint ‘left inverse’(meaning the unit is the identity) U : X → A , which moreover strictly preserves the chosen pushouts, it canbe shown that U is an opfibration. Consequently, U corresponds to a pseudofunctor F : A → Cat by theinverse Grothendieck construction, as in the first part of Theorem A.2. Furthermore, if U preserves finitecoproducts, F acquires the structure of a lax monoidal pseudofunctor F : ( A , + ) → ( Cat , × ) by the specialcase of the cocartesian monoidal Grothendieck construction discussed under Lemma 3.3. As a result, F nowhas enough structure to induce a double category of decorated cospans F C sp as in Theorem 2.2. Finally,it can be shown that the structured and decorated cospan double categories are isomorphic as symmetricmonoidal double categories: L C sp ( X ) (cid:27) F C sp .To give a better sense of how the pseudofunctor F : A → Cat is constructed: for each object a ∈ A , F ( a )is defined to be the fiber of U over a , namely the category of all objects in x ∈ X such that U ( x ) = a andmorphisms k : x → y such that U ( k ) = a . Given a morphism f : a → b , there is a functor F ( f ) : F ( a ) → F ( b ) that maps x ∈ F ( a ) to the following pushout: La Lbx x + La Lb in X a b in A L f ε x p f where ε x : LU ( x ) = L ( a ) → x is the counit of the adjunction L ⊣ U . The fact that U strictly preservespushouts is necessary to show that the pushout is mapped, via U , directly down to b .Even though for both Theorem 3.2 and the above result the conditions stated are only su ffi cient, theysuggest that with work we could establish this functorial picture:Lax monoidal pseudofunctors( A , + ) → ( Cat , × ) Symmetric monoidaldouble categoriesSpecial opfibrationsSpecial laris Finite colimit preservingfunctors A → X ≃ F → F C s p L → L C s p ( X ) with a natural isomorphism in the middle. The connection between opfibrations and laris goes back toGray’s Lemma 3.6, but we need to specialize it to a class suitable for both the structured and decoratedcospan constructions. This would imply that starting from an appropriate middle ground, these two con-structions are essentially the same. We leave such considerations for future work.A ppendix A. D efinitions
In this appendix, we gather some well-known concepts required to make the material self-contained, aswell as references to more detailed expositions.
TRUCTURED VERSUS DECORATED COSPANS 27
A.1.
Bicategories.
For standard 2-categorical material, we refer the reader to [32]. For monoidal 2-categories see [16], and for detailed definitions concerning monoidal bicategories see [21, 36, 44]. Briefly,a monoidal bicategory A comes with a pseudofunctor ⊗ : A × A → A and a unit object I that are associativeand unital up to coherent equivalence. A braided monoidal bicategory also comes with a pseudonaturalequivalence β a , b : a ⊗ b → b ⊗ a and appropriate invertible modifications obeying certain equations; it is sylleptic if there is an invertible modification 1 a ⊗ b ⇛ β b , a ◦ β a , b obeying its own equation, and symmetric if one further axiom holds.A lax monoidal pseudofunctor (called weak monoidal homomorphism in some earlier references) be-tween monoidal bicategories F : A → B is a pseudofunctor equipped with pseudonatural transformationswith components φ a , b : Fa ⊗ Fb → F ( a ⊗ b ) and φ : I → FI along with invertible modifications forassociativity and unitality with components( Fa ⊗ Fb ) ⊗ Fc F ( a ⊗ b ) ⊗ FcFa ⊗ ( Fb ⊗ Fc ) F (( a ⊗ b ) ⊗ c ) Fa ⊗ F ( b ⊗ c ) F ( a ⊗ ( b ⊗ c )) (cid:27) φ a , b ⊗ ∼ φ a ⊗ b , c ⊗ φ b , c ∼ φ a , b ⊗ c (35) Fa Fa ⊗ I Fa ⊗ FIF ( a ⊗ I ) ∼ ∼ ⊗ φ (cid:27) φ a , I Fa I ⊗ Fa FI ⊗ FaF ( I ⊗ a ) ∼ ∼ φ ⊗ (cid:27) φ I , a (36)subject to coherence conditions listed in [16, Definition 2]. In particular, pseudonaturality of the monoidalstructure means that it comes with isomorphisms of this form: Fa ⊗ Fb Fa ′ ⊗ Fb ′ F ( a ⊗ b ) F ( a ′ ⊗ b ′ ) F f ⊗ Fg φ a , b φ f , g (cid:27) φ a ′ , b ′ F ( f ⊗ g ) (37)natural in f and g . A braided lax monoidal pseudofunctor between braided monoidal bicategories comeswith an invertible modification with components Fa ⊗ Fb F ( a ⊗ b ) Fb ⊗ Fa F ( b ⊗ a ) φ a , b β Fa , Fb u a , b (cid:27) F ( β a , b ) φ b , a (38)subject to two axioms found e.g. in [16, Definition 14]. A sylleptic lax monoidal pseudofunctor satisfiesone extra condition and a symmetric lax monoidal pseudofunctor between symmetric monoidal bicate-gories is just a sylleptic one.A.2. Fibrations.
Basic material regarding the theory of fibrations can be found, for example, in [10, 24].Recall that a functor U : X → A is an opfibration if for every x ∈ X with U ( x ) = a and f : a → b in A ,there exists a cocartesian lifting of f to x , namely a morphism β in X with domain x with U ( β ) = f and thefollowing universal property: for any g : b → b ′ in A and γ : x → y ′ in X above the composite g ◦ f , thereexists a unique δ : y → y ′ such that U ( δ ) = g and γ = δ ◦ β as shown below y ′ (cid:21) (cid:21) x β / / (cid:22) (cid:22) γ ❡❡❡❡❡❡❡❡❡❡❡❡❡❡❡❡❡❡❡❡ y (cid:21) (cid:21) ∃ ! δ ❧❧❧❧❧ in X b ′ a f = U ( β ) / / g ◦ f = U ( γ ) ❡❡❡❡❡❡❡❡❡❡❡❡❡❡❡❡❡❡❡❡ b g ❦❦❦❦❦❦❦❦❦❦ in A The category X is called the total category and A is called the base category of the opfibration. For any a ∈ A , the fiber above a is the category X a consisting of all objects that map to a and vertical morphismsbetween them, i.e., morphisms mapping to 1 a .Assuming the axiom of choice, we may select a cocartesian lifting of each morphism f : a → b in A toeach x ∈ X a , denoted by Cocart( f , x ) : x → f ! ( x ), rendering U a so-called cloven opfibration. This choiceinduces reindexing functors f ! : X a → X b between the fibers, which by the lifting’s universal propertycome equipped with natural isomorphisms (1 a ) ! (cid:27) X a and ( f ◦ g ) ! (cid:27) f ! ◦ g ! . With the help of these, anycloven opfibration U : X → A gives a pseudofunctor F : A → Cat , where A is viewed as a 2-category withtrivial 2-morphisms, F ( a ) = X a for each object a ∈ A , and F ( f ) = f ! for each morphism f in A .In fact, there is a 2-equivalence between opfibrations and pseudofunctors induced by the so-called‘Grothendieck construction’. Let OpFib ( A ) denote the 2-subcategory of the slice 2-category Cat / A ofopfibrations over A , functors that preserve cocartesian liftings, and natural transformations with verticalcomponents. Definition A.1.
For any pseudofunctor F : A → Cat where A is a category viewed as a 2-category withtrivial 2-morphisms, the Grothendieck category ∫ F has • objects pairs ( a , x ∈ F ( a )) and • a morphism from ( a , x ∈ F ( a )) to ( b , y ∈ F ( b )) is a pair ( f : a → b , k : F ( f )( x ) → y ) ∈ A × F ( b ).The unit is (1 a : a → a , F (1 a )( x ) (cid:27) x ) and composition of ( f , k ) : ( a , x ) → ( b , y ) and ( g , ℓ ) : ( b , y ) → ( c , z ) is (cid:18) a f −→ b g −→ c , F ( g ◦ f ) x (cid:27) Fg ( F f ( x )) Fg ( k ) −−−−→ Fg ( y ) ℓ −→ z (cid:19) (39)This is an opfibered category over A via the obvious forgetful functor, with fibers ( ∫ F ) a = F ( a ) and rein-dexing functors f ! = F ( f ).The constructions sketched so far—the Grothendieck construction and the construction of a pseudofunc-tor into Cat from a cloven opfibration—are the two halves of the following equivalence.
Theorem A.2. (1) Every opfibration X → A gives rise to a pseudofunctor A → Cat .(2) Every pseudofunctor A → Cat gives rise to an opfibration ∫ F → A .(3) The above correspondences yield an equivalence of 2-categories [ A , Cat ] ps ≃ OpFib ( A ) where [ A , Cat ] ps is the 2-category of pseudofunctors from A to Cat , pseudonatural transformations,and modifications.Proof.
The idea goes back to Grothendieck; a proof can be found in, for example, [29, Section 1.10]. (cid:3)
A.3.
Double categories.
For double categories we follow the notation of our paper on structured cospans[1], which in turn follows that of Hansen and Shulman [27, 43]. Our double categories are always ‘pseudo’double categories, where composition of horizontal 1-cells is unital and associative only up to coherentisomorphism [22, 23, 42].
Definition A.3. A double category D consists of a category of objects D , a category of arrows D ,functors S , T : D → D , U : D → D , and ⊙ : D × D D → D called the source and target , unit and composition functors, respectively, such that S ( U A ) = A = T ( U A ) , S ( M ⊙ N ) = S ( N ) , T ( M ⊙ N ) = T ( M ) , and natural isomorphisms called the associator α L , M , N : ( L ⊙ M ) ⊙ N → L ⊙ ( M ⊙ N )and left and right unitors λ N : U T ( N ) ⊙ N → N , ρ N : N ⊙ U S ( N ) → N such that S ( α ) , S ( λ ) , S ( ρ ) , T ( α ) , T ( λ ) and T ( ρ ) are all identities, such that the standard coherence laws hold:the pentagon identity for the associator and the triangle identity for the left and right unitor. TRUCTURED VERSUS DECORATED COSPANS 29
Objects of D are called objects and morphisms of D are called vertical 1-morphisms . Objects of D are called horizontal 1-cells and morphisms of D are called . We can draw a 2-morphism a : M → N with S ( a ) = f , T ( a ) = g as follows: A BC D Mf ⇓ α gN We call M and N the horizontal source and target of a respectively, and call f and g its vertical sourceand target . A 2-morphism where f and g are identities is called globular . For example, the associator andunitors in a double category are globular 2-morphisms. Definition A.4.
Given double categories D and E , a double functor F : D → E consists of: • functors F : D → E and F : D → E such that S F = F S and T F = F T , and • for every composable pair of horizontal 1-cells M and N in D , a natural transformation F ⊙ : F ( N ) ⊙ F ( M ) → F ( N ⊙ M ) called the composite comparison and for every object a in D , a natural transfor-mation F U : U F ( a ) → F ( U a ) called the unit comparison . The components of each of these naturaltransformations are globular isomorphisms that must obey coherence laws analogous to those of amonoidal functor. Definition A.5.
Given double functors F , G : D → E , a double natural transformation α : F ⇒ G consistsof natural transformations α : F ⇒ G and α : F ⇒ G such that: • S ( α M ) = α S ( M ) and T ( α M ) = α T ( M ) for all horizontal 1-cells M of D , • α ◦ F ⊙ = G ⊙ ◦ ( α M ⊙ α N ) for all composable pairs M and N of horizontal 1-cells in D , and • α ◦ F U = G U ◦ α for all objects a of D .The double natural transformation α is a double natural isomorphism if both α and α are natural iso-morphisms.Let Dbl denote the 2-category of double categories, double functors and double transformations. Onecan check that
Dbl has finite products, and in any 2-category with finite products we can define a ‘pseu-domonoid’, which is a categorified analogue of a monoid [16]. For example, a pseudomonoid in
Cat is amonoidal category. We can also define symmetric pseudomonoids, which in
Cat are symmetric monoidalcategories.
Definition A.6. A monoidal double category is a pseudomonoid in Dbl , namely it is equipped with doublefunctors ⊗ : D × D → D , I : → D and invertible double transformations ⊗ ◦ (1 × ⊗ ) (cid:27) ⊗ ◦ ( ⊗ × ⊗ ◦ (1 × I ) (cid:27) (cid:27) ⊗ ◦ ( I ×
1) satisfying standard axioms.Explicitly, a monoidal double category is a double category D with: • monoidal structures on both D and D (each with tensor product denoted ⊗ , associator a , left unitor ℓ and right unitor r and unit object I ), such that U : D → D strictly preserves the unit objects and S , T : D → D are strict monoidal, • the structure of a double functor on ⊗ : that is, invertible globular 2-morphisms χ : ( M ⊗ N ) ⊙ ( M ⊗ N ) ∼−→ ( M ⊙ M ) ⊗ ( N ⊙ N ) µ : U A ⊗ B ∼−→ U A ⊗ U B obeying a list of equations that can be found after [27, Definition 2.10] and also [1, Definition A.5]. Definition A.7. A symmetric monoidal double category is a symmetric pseudomonoid in Dbl .Explicitly, a symmetric monoidal double category is a monoidal double category D such that: • D and D are symmetric monoidal categories, with braidings both denoted β . • The functors S and T are symmetric strict monoidal functors. • The following diagrams commute, expressing that the braiding is a transformation of double cate-gories: ( M ⊗ N ) ⊙ ( M ⊗ N )( M ⊙ M ) ⊗ ( N ⊙ N ) ( N ⊗ M ) ⊙ ( N ⊗ M )( N ⊙ N ) ⊗ ( M ⊙ M ) χ β ⊙ β χβ U A ⊗ U B U B ⊗ U A U A ⊗ B U B ⊗ A β µ U β µ (40) Definition A.8.
Given symmetric monoidal double categories D and E , a symmetric monoidal doublefunctor F : D → E is a double functor F together with invertible transformations F ⊗ : ⊗ ◦ ( F , F ) → F ◦ ⊗ and I E → F ◦ I D that satisfy the usual coherence axioms for a symmetric monoidal functor.Explicitly, a symmetric monoidal double functor is a double functor F : D → E such that: • F and F are symmetric monoidal functors, • we have equalities F S D = S E F and F T D = T E F of monoidal functors, and • the following diagrams commute, expressing that φ is a transformation of double categories: ( F ( M ) ⊗ F ( N )) ⊙ ( F ( M ) ⊗ F ( N ))( F ( M ) ⊙ F ( M )) ⊗ ( F ( N ) ⊙ F ( N )) F ( M ⊗ N ) ⊙ F ( M ⊗ N ) F (( M ⊗ N ) ⊙ ( M ⊗ N )) F ( M ⊙ M ) ⊗ F ( N ⊙ N ) F (( M ⊙ M ) ⊗ ( N ⊙ N )) χ F ⊗ ⊙ F ⊗ F ⊙ F ⊙ ⊗ F ⊙ F ( χ ) F ⊗ U F ( a ) ⊗ F ( b ) U F ( a ) ⊗ U F ( b ) U F ( a ⊗ b ) F ( U a ⊗ b ) F ( U a ) ⊗ F ( U b ) F ( U a ⊗ U b ) µ F U ⊗ F U F ( µ ) U F ⊗ F U F ⊗ (41) Definition A.9. An isomorphism of symmetric monoidal categories is a symmetric monoidal double func-tor F : D → E that has an inverse.A symmetric monoidal double functor is an isomorphism if it is bijective on objects, vertical 1-morphisms,horizontal 1-cells and 2-morphisms. Definition A.10.
Let D be a double category and f : A → B a vertical 1-morphism. A companion of f isa horizontal 1-cell ˆ f : A → B together with 2-morphisms A BB B ˆ ff U B ⇓ and A AA B U A f ˆ f ⇓ such that the following equations hold. A AA BB B f f U A U B ⇓⇓ b f = A AB B f fU A U B ⇓ U f and AA AB BBA B f U A ˆ f ˆ f ⇓ ⇓⇓ λ ˆ f ˆ f U B = A A BA B U A ˆ f f ⇓ ρ ˆ f (42)A conjoint of f , denoted ˇ f : B → A , is a companion of f in the double category obtained by reversing thehorizontal 1-cells, but not the vertical 1-morphisms, of D . Definition A.11.
We say that a double category is fibrant if every vertical 1-morphism has both a compan-ion and a conjoint.
Theorem A.12. [27, Theorem 1.1] If D is a fibrant monoidal double category, then its horizontal bicategory D is a monoidal bicategory. If D is braided or symmetric, then so is D . TRUCTURED VERSUS DECORATED COSPANS 31 A ppendix B. C hecking a coherence law
Here we show a sample check of a coherence law for the proof of Theorem 2.2. All relevant structurefor decorated cospans is as described in Theorems 2.1 and 2.2. The coherence law that we check says thatthis diagram commutes: ( M ⊗ N ) ⊙ ( M ⊗ N ) ( N ⊗ M ) ⊙ ( N ⊗ M )( M ⊙ M ) ⊗ ( N ⊙ N ) ( N ⊙ N ) ⊗ ( M ⊙ M ) β ⊙ β χχ β (43)where M , M , N , N are as in (14), χ is as described right below therein and β is the braiding defined as in(12) – although the letter β is also used for the braiding in A . First of all, if we only consider the underlyingcospans without their decorations, we obtain the following ‘flattened’ commutative diagram in A – whichverifies the corresponding axiom for the symmetric monoidal double category C sp ( A ): a + a ′ ( m + n ) + ( b + b ′ ) ( m + n ) c + c ′ a ′ + a ( n + m ) + ( b ′ + b ) ( n + m ) c ′ + ca ′ + a ( n + b ′ n ) + ( m + b m ) c ′ + ca + a ′ ( m + b m ) + ( n + b ′ n ) c + c ′ a ′ + a ( n + b ′ n ) + ( m + b m ) c ′ + c β β + β β β χ
11 ˆ χ β β β The top and the bottom cospans coincide, and ˆ χ is the canonical isomorphism by the universal property ofcolimits and the inwards pointing morphisms are natural maps from the each cospan’s feet to its apex. Itfollows that β ˆ χ = ˆ χ ( β + β β ) as the unique map between the involved colimits.Regarding decorations, each of the above four maps of cospans has an associated map, which we labelwith τ i for i = , , ,
4, between the corresponding decorations:( m + n ) + ( b + b ′ ) ( m + n ) ( x ⊗ y ) ⊙ ( x ⊗ y ) ∈ F (( m + n ) + b + b ′ ( m + n ))( n + m ) + ( b ′ + b ) ( n + m ) ( y ⊗ x ) ⊙ ( y ⊗ x ) ∈ F (( n + m ) + b ′ + b ( n + m ))( n + b ′ n ) + ( m + b m ) ( y ⊙ y ) ⊗ ( x ⊙ x ) ∈ F (( n + b ′ n ) + ( m + b m ))( m + b m ) + ( n + b ′ n ) ( x ⊙ x ) ⊗ ( y ⊙ y ) ∈ F (( m + b m ) + ( n + b ′ n ))( n + b ′ n ) + ( m + b m ) ( y ⊙ y ) ⊗ ( x ⊙ x ) ∈ F (( n + b ′ n ) + ( m + b m )) β + β β τ ˆ χ τ ˆ χ τ β τ and are explicitly appropriate isomorphisms of the form: τ : F ( β + β β )(( x ⊗ y ) ⊙ ( x ⊗ y )) → ( y ⊗ x ) ⊙ ( y ⊗ x ) τ : F ( ˆ χ )(( y ⊗ x ) ⊙ ( y ⊗ x )) → ( y ⊙ y ) ⊗ ( x ⊙ x ) τ : F ( ˆ χ )(( x ⊗ y ) ⊙ ( x ⊗ y )) → ( x ⊙ x ) ⊗ ( y ⊙ y ) τ : F ( β )(( x ⊙ x ) ⊗ ( y ⊙ y )) → ( y ⊙ y ) ⊗ ( x ⊙ x )Firstly, performing the (vertical) composition of χ and β of (43) gives the composite decoration τ τ com-puted by the formula (3) to be F ( β ˆ χ )(( x ⊗ y ) ⊙ ( x ⊗ y )) (cid:27) F ( β )( F ˆ χ )(( x ⊗ y ) ⊙ ( x ⊗ y )) F ( β )( τ ) −−−−−−→ F ( β )(( x ⊙ x ) ⊗ ( y ⊙ y )) τ −→ ( y ⊙ y ) ⊗ ( x ⊙ x ) Using the formulas for the involved decorations (15) and (16), as well as the decoration morphisms of χ (17) and β (13), we form: (cid:27) F ( m + n ) × F ( m + n ) u (cid:27) (38) (cid:27) (17) F ( m + m ) × F ( n + n ) F (( m + n ) + ( m + n )) F ( m + b m ) × F ( n + b ′ n ) F (( m + n ) + b + b ′ ( m + n )) F (( m + b m ) + ( n + b ′ n )) F ( m ) × F ( n ) × F ( m ) × F ( n ) F ( m ) × F ( m ) × F ( n ) × F ( n ) F ( n ) × F ( n ) × F ( m ) × F ( m ) F ( n + n ) × F ( m + m ) F ( n + b ′ n ) × F ( m + b m ) F (( n + b ′ n ) + ( m + b m )) x × y × x × y x × x × y × y y × y × x × x βφ m + n , m + n F ( ψ ) × F ( ψ ) F ( ψ ) × F ( ψ ) F ( ψ ) φ n + b ′ n , m + bm φ m + bm , n + b ′ n F (ˆ χ ) F ( β ) φ m , n × φ m , n φ n , n × φ m , m φ m , m × φ n , n × β × β F ( β ˆ χ ) For the other (vertical) composition of (43), that of β ⊙ β followed by χ , the composite decoration τ τ is F ( ˆ χ ( β + β β ))(( x ⊗ y ) ⊙ ( x ⊗ y )) (cid:27) F ( ˆ χ ) F ( β + β β )(( x ⊗ y ) ⊙ ( x ⊗ y )) F (ˆ χ )( τ ) −−−−−−→ F ( ˆ χ )( y ⊗ x ) ⊙ ( y ⊗ x ) τ −→ ( y ⊙ y ) ⊗ ( x ⊙ x ) Once again, using the tensor and composite formulas for decorations, as well the horizontal compositeformulas (7) for β ⊙ β , the above is explicitly given by the pasted isomorphism: F ( m + n ) × F ( m + n ) u × u (cid:27) (38) φβ,β (cid:27) (37) (cid:27)(cid:27) (17) (cid:27) F ( n + m ) × F ( n + m ) F (( m + n ) + ( m + n )) F (( n + m ) + ( n + m )) F (( m + n ) + b + b ′ ( m + n )) F (( n + m ) + b ′ + b ( n + m )) F ( m ) × F ( n ) × F ( m ) × F ( n ) F ( n ) × F ( m ) × F ( n ) × F ( m ) F ( n ) × F ( n ) × F ( m ) × F ( m ) F ( n + n ) × F ( m + m ) F ( n + b ′ n ) × F ( m + b m ) F (( n + b ′ n ) + ( m + b m )) x × y × x × y y × x × y × x y × y × x × x F ( β + β ) F ( β ) × F ( β ) φ m + n , m + n F ( ψ ) × F ( ψ ) φ n + m , n + m F ( ψ ) φ n + b ′ n , m + bm F ( ψ ) F ( β + β β ) F (ˆ χ ) φ m , n × φ m , n φ n , n × φ m , m φ n , m × φ n , m β × β × β × F (ˆ χ ( β + β β )) In order to verify that these two pasted isomorphisms are equal, we first of all need to expand the isomor-phism (17), whose left half part is explicitly written as follows (also found in [16, Page 125]): F ( m ) × F ( n ) × F ( m ) × F ( n ) F ( m + n ) × F ( m + n ) F ( m + n + m + n ) F ( m ) × F ( n + m ) × F ( n ) F ( m ) × F ( n + m + n ) F ( m ) × F ( m + n ) × F ( n ) F ( m ) × F ( m + n + n ) F ( m ) × F ( m ) × F ( n ) × F ( n ) F ( m + m ) × F ( n + n ) F ( m + m + n + n ) × u × (cid:27) (38) × φ × φ × φ × β × (cid:27) × φβ, (cid:27) (37) φ F (1 + β + φ ,β + (cid:27) (37) × φ × F ( β ) × × F ( β + φ × φ (cid:27) φ × φ × φ × φ φ (44)where the unnamed isomorphisms are appropriate composites of the pseudoassociativity of F (35). The factthat the two pasted 2-isomorphisms are equal now follows from lengthy pasted diagram calculations usingthe axioms of a sylleptic lax monoidal pseudofunctor [16, Definition 16].R eferences [1] J. C. Baez and K. Courser, Structured cospans, TheoryAppl.Categ. (2020), 1771–1822. Available as arXiv:1911.04630.[2] J. C. Baez, B. Coya and F. Rebro, Props in circuit theory, Theory Appl. Categ. (2018), 727–783. Available asarXiv:1707.08321.[3] J. C. Baez and J. Erbele, Categories in control, TheoryAppl.Categ. (2015), 836–881. Available as arXiv:1405.6881.[4] J. C. Baez and B. Fong, A compositional framework for passive linear networks, Theory Appl.Categ. (2018), 1158–1222.Available as arXiv:1504.05625.[5] J. C. Baez, B. Fong and B. S. Pollard, A compositional framework for Markov processes, Jour.Math.Phys. (2016), 033301.Available as arXiv:1508.06448.[6] J. C. Baez and J. Master, Open Petri nets, Math.Struct.Comput.Sci. (2020), 314–341. Available as arXiv:1808.05415.[7] J. C. Baez and B. S. Pollard, A compositional framework for chemical reaction networks, Rev.Math.Phys. (2017), 1750028.Available as arXiv:1704.02051.[8] G. Bakirtzis, C. H. Fleming and C. Vasilakopoulou, Categorical semantics of cyber-physical systems theory. Available asarXiv:2010.08003. TRUCTURED VERSUS DECORATED COSPANS 33 [9] Filippo Bonchi, Paweł Soboci´nski and Fabio Zanasi, A categorical semantics of signal flow graphs, in CONCUR 2014–Concurrency Theory, eds. P. Baldan and D. Gorla, Lecture Notes in Computer Science , Springer, Berlin, 2014, pp.435–450. Also available at http: // users.ecs.soton.ac.uk / ps / papers / sfg.pdf.[10] F. Borceux, HandbookofCategorical Algebra, vol. 2, Cambridge University Press, Cambridge, 1994.[11] M. Bunge and M. Fiore, Unique factorisation lifting functors and categories of linearly-controlled processes, Math. Struct.Comput.Sci. (2000), 137–163.[12] D. Cicala and C. Vasilakopoulou, On adjoints and fibrations. In preparation.[13] K. Courser, A bicategory of decorated cospans, TheoryAppl.Categ. (2017), 995–1027. Available as arXiv:1605.08100.[14] K. Courser, OpenSystems: aDoubleCategorical Perspective, Ph.D. thesis, Department of Mathematics, U. C. Riverside, 2020.Available as arXiv:2008.02394.[15] Gheorghe Craciun, Yangzhong Tang and Martin Feinberg, Understanding bistability in complex enzyme-driven reaction net-works, PNAS (2006), 8697–8702.[16] B. Day and R. Street, Monoidal bicategories and Hopf algebroids, Adv.Math. (1997), 99–157.[17] B. Fong, Decorated cospans, Theory Appl. Categ. (2015), 1096–1120. Available as arXiv:1502.00872.[18] B. Fong, TheAlgebraofOpenandInterconnected Systems, Ph.D. thesis, Computer Science Department, University of Oxford,2016. Available as arXiv:1609.05382.[19] B. Fong, P. Rapisarda and P. Sobocinski, A categorical approach to open and interconnected dynamical systems, in Proceedingsofthe31stAnnualACM / IEEESymposiumonLogicinComputerScience(LICS), IEEE, New York, 2016, pp. 1–10. Availableas arXiv:1510.05076.[20] C. Girault and R. Valk, Petri Nets for Systems Engineering: a Guide to Modeling, Verification, and Applications, Springer,Berlin, 2013.[21] R. Gordon, A. J. Power and R. Street, Coherence for tricategories, Mem.Amer.Math.Soc. , 1995.[22] M. Grandis and R. Par´e, Limits in double categories, Cah.Top.G´eom.Di ff . (1999), 162–220.[23] M. Grandis and R. Par´e, Adjoints for double categories, Cah.Top.G´eom.Di ff . (2004), 193–240.[24] J. Gray, Fibred and cofibred categories, in Proceedings of the Conference on Categorical Algebra: La Jolla 1965, eds. S.Eilenberg et al , Springer, Berlin, 1966, pp. 21–83.[25] P. J. Haas, StochasticPetriNets: Modelling,Stability,Simulation, Springer, Berlin, 2002.[26] M. Halter and E. Patterson, Compositional epidemiological modeling using structured cospans, 2020. Available athttps: // / blog / post / / / structured-cospans.[27] L. W. Hansen and M. Shulman, Constructing symmetric monoidal bicategories functorially. Available as arXiv:1910.09240.[28] C. Hermida, Some properties of Fib as a fibred 2-category, J.PureAppl.Alg. (1999), 83–109.[29] B. Jacobs, Categorical LogicandTypeTheory, Elsevier, Amsterdam, 1999.[30] A. Joyal, M. Nielsen and G. Winskel, Bisimulation from open maps, Inf.Comput. (1996), 164–185.[31] P. Katis, N. Sabadini and R. F. C. Walters, On the algebra of systems with feedback and boundary, Rendiconti del CircoloMatematico diPalermoSerieII (2000), 123–156.[32] G. M. Kelly and R. Street, Review of the elements of 2-categories, in Category Seminar, ed. G. M. Kelly, Lecture Notes inMathematics , Springer, Berlin, 1974, pp. 75–103.[33] I. Koch, Petri nets—a mathematical formalism to analyze chemical reaction networks, Mol.Inform. (2010), 838–843.[34] S. Lack and S. Paoli, 2-nerves for bicategories, K -Theory (2008), 153–175.[35] F. W. Lawvere, State categories and response functors, unpublished manuscript, 1986. Available at https: // tinyurl.com / state-categories.[36] P. McCrudden, Balanced coalgebroids, TheoryAppl.Categ. (2000), 71–147.[37] J. Moeller and C. Vasilakopoulou, Monoidal Grothendieck construction, TheoryAppl.Categ. (2020), 1159–1207. Availableas arXiv:1809.00727.[38] S. Niefield, Span, cospan, and other double categories, TheoryAppl.Categ. (2012), 729–742. Available as arXiv:1201.3789.[39] J. L. Peterson, Petri Net Theory and the Modeling of Systems , Prentice-Hall, New Jersey, 1981.[40] B. S. Pollard, Open Markov Processes and Reaction Networks, Ph.D. thesis, U. C. Riverside, 2017. Available asarXiv:1709.09743.[41] P. Schultz, D. Spivak and C. Vasilakopoulou, Dynamical systems and sheaves, Appl.Cat.Struct. (2020), 1–57. Available asarXiv:1609.08086.[42] M. Shulman, Framed bicategories and monoidal fibrations, Theory Appl. Categ. (2008), 650–738. Available asarXiv:0706.1286.[43] M. Shulman, Constructing symmetric monoidal bicategories. Available as arXiv:1004.0993.[44] M. Stay, Compact closed bicategories, TheoryAppl.Categ. (2016), 755–798. Available as arXiv:1301.1053.[45] D. Vagner, D. Spivak and E. Lerman, Algebras of open dynamical systems on the operad of wiring diagrams, Theory Appl.Categ.30