In any category , a span, roof, or correspondence, from an object to an object is a diagram
where is some other object of the category. (The word “correspondence” is also sometimes used for a profunctor.)
This diagram is called a ‘span’ because it looks like a little bridge; ‘roof’ is similar. The term ‘correspondence’ is prevalent in geometry and related areas; it comes about because a correspondence is a generalisation of a binary relation. Discussion of this terminology on the blog is here.
Note that a span with is just a morphism from to , while a span with is a morphism from to . So, a span can be thought of as a generalization of a morphism in which there is no longer any asymmetry between source and target.
A span in is called a co-span in . A cobordism is an example of a cospan in the category of smooth manifolds, and this nicely illustrates the symmetry between source and target.
If the category has pullbacks, we can compose spans. Namely, given a span from to and a span from to :
we can take a pullback in the middle:
and obtain a span from to :
This way of composing spans lets us define a 2-category with:
This is a weak 2-category has a nontrivial associator: composition of spans is not strictly associative, because pullbacks are defined only up to canonical isomorphism.
(Note that we must choose a specific pullback when defining the composite of a pair of morphisms in , if we want to obtain a bicategory as traditionally defined; this requires the axiom of choice. Otherwise we obtain a bicategory with ‘composites of morphisms defined only up to canonical iso-2-morphism’; such a structure can be modeled by an anabicategory or an opetopic bicategory?.)
A span that has a cocone is called a coquadrable span.
Let be a category with pullbacks and let be the 1-category of objects of and isomorphism class of spans between them as morphisms.
Then
Next assume that is a cartesian monoidal category. Then clearly naturally becomes a monoidal category itself, but more: then
See multispan.
The above list of facts about spans is described in
which discusses how spans naturally capture crucial aspects of quantum field theory.