Decorated cospans are a convenient formalism to deal with open networks, i.e. networks where some nodes are interpreted to be ‘inputs’ and some other to be ‘outputs’. In fact, a natural way to do such labelling is to specify some function assigning the set of inputs to those nodes in the network tasked with receiving them, and analogously, a function assigning to outputs those nodes which provide them. This is, morally, a cospan: the network is the vertex, and inputs and outputs are the feet. However, the two things sit in ‘different categories’: e.g., inputs and outputs may be sets of wires and sockets, while the network has a more complicated description. Nevertheless, the network is just a set of nodes with more information attached, namely the way those nodes are connected. The key insight here is that to specify inputs/outputs of the network, we don’t really care about this additional information. Hence we can use a ‘cospan of nodes’ (formally, a cospan in FinSet), and deal with the network structure later, as a decoration.
Surprisingly, this formalism naturally captures also other operations such as sequential and parallel composition of networks.
In a category with finite colimits (or even just pushouts) cospans can be composed in a natural way. In fact, given and , we get a new cospan by taking a pushout in the middle:
Therefore cospans form a compositional structure: a category where objects are the same of but morphisms from to are replaced by cospans with feet and . Since the pushout we choose to form the composite of two cospans is, in general, unique only up to unique isomorphism, we actually need to define a -category. Morphisms of cospans are given by any -morphism making the following commute
It is also customary to ignore the -structure and simply work with as a -category whose morphisms are isomorphism classes of cospans.
Let be a category with finite colimits, and
be a lax monoidal functor. A decorated cospan, or more precisely an -decorated cospan, is a pair . We shall call the element the decoration of the decorated cospan. A morphism of decorated cospans
is a morphism of cospans such that the following commutes:
i.e. .
The definition is due to Fong 2015, except there is allowed an arbitrary codomain, , and then a global element . The notion is equivalent, by composing with the global elements functor , which is always lax monoidal. Nonetheless the in use will indeed typically arise from global elements of some familiar category .
Given a cospan in , the empty decoration on is the unique map
where is inital in and denotes the universal morphism from such object.
(B. Fong 2015) There is a category of -decorated cospans, with objects the objects of and morphisms isomorphism classes of -decorated cospans. Composition in this category is given by the class of the pushout of two representatives:
along with the decoration
where and are decorations of the first and second cospan, respectively.
The identity morphism of an object in is simply equipped with the empty decoration on . The check that all relevant axioms are satisfied can be found in (B. Fong 2015, Appendix A)
The composition of decorations is the key construction of the decorated cospans formalisms. In fact, returning to the analogy with open networks, it constructs the composite network of a given ‘link’ of two networks. Hence the compositional structures of the cospans is leveraged to describe the compositional structure of a richer structure.
Notice that the empty decoration gives a canonical way to decorate any cospan on . Indeed, it can be shown this defines a wide functor , as the composition of two empty-decorated cospans is again empty-decorated.
In the presence of a braiding on (the ‘decorating category’), the category of decorated cospans becomes not just symmetric monoidal, but a full-blown hypergraph category.
(B. Fong, 2015) Let be a category with finite colimts, a braided monoidal category and a lax braided monoidal functor. Then we may equip with a symmetric monoidal and hypergraph structure, such that there is a wide embedding of hypergraph categories
We define the monoidal product of objects and of to be their coproduct in , and defined the monoidal product of decorated cospans and to be
The braiding in can be now used to show this product is indeed functorial. Finally, we choose associator, unitors and braiding to be the images of those in . The necessary checks are done in (B. Fong 2015, Appendix A).
The hypergraph structure is defined by equipping each object with the image of the special commutative Frobenius monoid specified by the hypergraph structure of . The fact that the ‘empty-decoration’ embedding is an hypergraph functor is evident.
If the monoidal unit of is the initial object, then each object admits only a decoration — the empty one. This implies and are isomorphic as hypergraph categories.
Decorated cospans were first defined by Brendan Fong:
Last revised on December 3, 2023 at 11:22:25. See the history of this page for a list of all contributions to it.