The fundamental premise of category theory is that it’s possible to fully capture the nature of objects by describing their interactions with other objects of the same type. Those interactions are encoded using morphisms: arrows between objects.
What about categories themselves? We define a category by describing its internals: objects and arrows. But true to the categorical credo, we should be able to capture the essence of a category by describing its interactions with other categories. (Small) categories are objects in the category of categories , with functors as morphisms.
In fact has even more structure: functors between any two categories form a functor category, with natural transformations as morphisms. This makes
a 2-category, with categories as 0-cells, functors as 1-cells, and natural transformations as 2-cells.
With this much structure, we can define a lot of categorical constructions. In particular, we can define adjunctions as pairs of functors equipped with the unit and counit natural transformations. We can also define monads as endofunctors equipped with the unit and multiplication natural transformations, and so on.
However, there are some categorical constructions that force us to look at the internals of categories. In particular, anything that involves representable functors cannot be defined without talking about hom-sets, which are internal to categories. In particular there are things like (weighted) limits or pointwise Kan extensions that rely on representability.
We somehow need to incorporate the information about hom-sets into the fabric of of the 2-category . At the minimum, we need to identify the hom-functors:
Such functors of mixed variance are called profunctors and, in general, they can go between different categories, as in . In fact, profunctors can be considered arrows in the category
. Not only that,
is itself a bicategory, whose 0-cells are (small) categories, 1-cells are profunctors, and 2-cells are natural transformations between profunctors. Composition of profunctors is defined using the coend formula:
What is important is that the hom-functor is the identity profunctor with respect to this composition. It means that we have a way of talking about hom-sets and representables without peeking inside individual categories.
The usual categorical laws, associativity and identity, are only satisfied up to isomorphism (that is up to invertible 2-cells), hence is called a bicategory and not a 2-category, whose laws are satisfied on the nose.
These two categories, the 2-category and the bicategory
can be combined into a single double category, which we’ll call
. The 0-cells are the usual categories; but now we have two kinds of arrows: the vertical ones are functors, and the horizontal ones are profunctors. What glues them together are the 2-cells.
Here’s a 2-cell that combines two (vertical) functors and
with two (horizontal) profunctors
and
.
In our double category , this 2-cell is implemented as a natural transformation, whose component at the pair of objects
is a function:
It’s a member of the set of natural transformations, which can be written as an end:
The profunctor is sometimes called the restriction of
along
and
.
In an abstract double category, a 2-cell is just something that says that the particular four arrows in this configuration are related.
The same diagram can be transformed into a string diagram. Here, the 0-cells are the four areas, 1-cells form boundaries between those areas, and a 2-cell is a node connecting the four subdivisions:
We encode identity 1-cells in string diagrams by simply omitting the corresponding lines/arrows.
2-cells can be composed both horizontally and vertically by gluing them along identical edges.
In , horizontal composition of 2-cells corresponds to the (vertical) composition of natural transformations between profunctors (we’ll write this composition as a juxtaposition, as in
, in diagram order).
The identity 2-cell at a profunctor is just an identity natural transformation:
Vertical gluing of string diagrams results is a natural transformation between composite profunctors. For instance this diagram:
is a composition of two natural transformation:
whose component is a function:
By co-continuity of the coend, this is isomorphic to:
and is implemented by composing the product with the appropriate injection into the coend.
The unit of vertical composition at a functor in
is a 2-cell:
which is a natural transformation implementing the functoriality of
.
Companion and Conjoint
Given a functor we can construct two representable profunctors, the companion and the conjoint.
The companion is denoted by . In
, it is the profunctor generated by the following hom-functor:
A conjoint, which is denoted by , is defined in
as:
In these definitions we have used the hom-sets explicitly, something we were trying to avoid. We should therefore try to define the companions and the conjoints abstractly by listing their properties.
Companion
In a string diagram, the companion of a vertical arrow is represented by a left-pointing horizontal arrow:
It is equipped with two 2-cells called the unit and the counit (the subscript stands for comPanion):
Indeed, using the rules for reading string diagrams in , the unit corresponds to a natural transformation:
which just expresses the functoriality of . The (invisible) horizontal line on the left stands for the identity profunctor
.
The counit in :
is trivially instantiated by the identity natural transformation.
There are two ways we can compose these two 2-cells. Both of them should result in some kind of identities. For instance, this is the horizontal composition:
where is the identity at
which, in
is a functorial action of
on the hom-set.
Similarly, vertical composition gives us:
Conjoint
The conjoint of is represented by the right-pointing horizontal arrow:
In , the conjoint is the representable profunctor:
The conjoint is related to the original functor by its unit and counit 2-cells:
(here, the subscript stands for conJoint). Their two compositions produce identity 2-cells:
Adjunction
We can also compose units with units and counits with counits by connecting the functor arrows:
These diagrams can be interpreted as the unit and counit of the adjunction :
In , the profunctor composition is given by the coend, so we get, for the unit:
We use the Yoneda reduction to eliminate the coend:
The unit is then instantiated by the functoriality of .
The counit is:
By co-continuity of the coend, this is isomorphic to:
which is inhabited by the composition of hom-sets.
The Big Picture
We’ve seen how to combine the 2-category with the bicategory
into one double category
. In this double category every vertical arrow has a horizontal companion and every companion has a conjoint. A double category with this kind of structure is called a proarrow equipment. It has just enough structure to define abstractly such categorical constructions as weighted limits or pointwise Kan extensions. We can then apply those constructions to other double categories, without having to repeat ourselves.
One immediate application is to enriched categories and enriched profunctors, which form a proarrow equipment . Or we can consider a simpler case of the double category of sets and relations. We can also add more structure to the categories in question, for instance by considering monoidal categories; or even go meta, and study the double category of double categories
.










