Profunctor

In category theory, a branch of mathematics, profunctors are a generalization of relations and also of bimodules.
Definition.
A profunctor (also named by the French school and module by the Sydney school) formula_1 from a category formula_2 to a category formula_3, written
is defined to be a functor
where formula_6 denotes the opposite category of formula_3 and formula_8 denotes the category of sets. Given morphisms formula_9 respectively in formula_10 and an element formula_11, we write formula_12 to denote the actions.
Using the cartesian closure of formula_13, the category of small categories, the profunctor formula_14 can be seen as a functor
where formula_16 denotes the category formula_17 of presheaves over formula_3.
A correspondence from formula_19 to formula_20 is a profunctor formula_21.
Profunctors as categories.
An equivalent definition of a profunctor formula_4 is a category whose objects are the disjoint union of the objects of formula_2 and the objects of formula_3, and whose morphisms are the morphisms of formula_2 and the morphisms of formula_3, plus zero or more additional morphisms from objects of formula_3 to objects of formula_2. The sets in the formal definition above are the hom-sets between objects of formula_3 and objects of formula_2. (These are also known as het-sets, since the corresponding morphisms can be called "heteromorphisms".) The previous definition can be recovered by the restriction of the hom-functor formula_31 to formula_32.
This also makes it clear that a profunctor can be thought of as a relation between the objects of formula_2 and the objects of formula_3, where each member of the relation is associated with a set of morphisms. A functor is a special case of a profunctor in the same way that a function is a special case of a relation.
Composition of profunctors.
The composite formula_35 of two profunctors
is given by
where formula_39 is the left Kan extension of the functor formula_40 along the Yoneda functor formula_41 of formula_3 (which to every object formula_43 of formula_3 associates the functor formula_45).
It can be shown that
where formula_47 is the least equivalence relation such that formula_48 whenever there exists a morphism formula_49 in formula_3 such that
The bicategory of profunctors.
Composition of profunctors is associative only up to isomorphism (because the product is not strictly associative in Set). The best one can hope is therefore to build a bicategory Prof whose
Properties.
Lifting functors to profunctors.
A functor formula_53 can be seen as a profunctor formula_54 by postcomposing with the Yoneda functor:
It can be shown that such a profunctor formula_56 has a right adjoint. Moreover, this is a characterization: a profunctor formula_4 has a right adjoint if and only if formula_58 factors through the Cauchy completion of formula_3, i.e. there exists a functor formula_53 such that formula_61.