Previously: Profunctor Equipment in Haskell.
The major advantage of string diagrams is that they provide surpisingly natural language for complex diagram manipulations. The fact that two traditional diagrams are equal can be often described as a permission to bend, yank, or pinch strings in particular ways. They provide visual and often tactile clues to our senses. This is even more helpful in the context of double categories and equipments.
Yanking
Consider the definition of a companion from the previous installment. It’s a horizontal arrow that is somehow related to a vertical arrow
. There are two 2-cells that illustrate this relation, but it’s not clear what their meaning is or how to use them.
It’s only when you start composing these cells that the computational aspect of companions emerges. The first condition is that the horizontal composite result in the identity . Diagrammatically, we have:
You can visualize this as yanking the ends of the two arrows and letting the beads fall down.
The same trick can be done with vertical composition. The equation, , is illustrated by the following diagrams:
This time we yank the arrows horizontally.
The two equalites for the conjoint arrows have analogous graphical interpretation resulting it this general rule that is valid in any proarrow equipment:
Any zig-zag in which the arrows flow in one direction and vertical arrows point downwards can be yanked.
The Spider Lemma
The yanking identities let us prove a very powerful lemma, which lets us bend arrows in many diagrams. The so called spider lemma states that the two diagrams below are isomorphic.
To prove it, we fist etablish two mappings: To get from the left diagram to the right one, we top it (vertically precompose) with the unit of the conjoint and the unit of the companion. This bends the arrows and
and turns them into
and
. Then we shove the two counits below it (vertically postcompose), to bend the arrows
and
.
To get from the right diagram to the left one, we do the analogous trick with horizontal pre/post composition. Finally, we prove that the two mappings are the inverse of each other by composing them and applying the yanking identities.
This is the spider lemma in its full glory, but we often specialize it to situations when one or more vertical arrows are identities. Then it lets us bend the remaining arrows.
Cartesian Squares
The workhorse of category theory is the universal construction. You define a new gadget by specifying its shape, and then pick the one through which all those shapes uniquely factor through. This is, for instance, how a categorical product is defined: The shape is a span with two fixed objects at its ends and a central object with arrows towards those objects. The product is the span through which all other spans factor through.
The same idea works in a double category, except that now we want to view it through string diagrams. We’ll illustrate it with the definition of a cartesian square.
Given a horizontal arrow and two vertical arrows
and
, a cartesian square defines a horizontal arrow
also called a restriction of
along
and
. In the profunctor equipment
, this restriction is given by the hom-functor:
Since we want to avoid mentioning hom-sets, we’ll use a universal construction instead. Here’s the shape we are going to study:
We are given four 0-cells (the four areas), two vertical 1-cells and
, and one horizontal cell
. We want to find the universal one of
and
. To this end we replace
with a generic horizontal arrow
, together with two new vertical arrows
and
that, just like
and
before, are equipped with a 2-cell
(see the left diagram below).
The universal condition states that any such shape can be uniquely factored out through the cartesian square (see the right diagram below).
Visually, we are splitting the bead representing into two separate beads, the right one being the universal one. Or you may interpret it, right to left, as pinching together the two beads into one.
Most universal constructions in a double category look like this. You may easily figure out the definition of the opcartesian square by extending it on the right instead of on the left.
In , this universal condition is a tautology, but in other double categories it may have computational meaning. It can be used, for instance, to compute a 2-cell
from
to
over a pair of 1-cells
, given the corresponding cartesian square
. All we need is to find a suitable
from
to
over the composite
.






Leave a Reply