In category theory, a branch of mathematics, profunctors are a generalization of relations and also of bimodules.
A profunctor (also named distributor by the French school and module by the Sydney school)
, written is defined to be a functor where
denotes the opposite category of
denotes the category of sets.
to denote the actions.
is cartesian closed, the profunctor
denotes the category
{\displaystyle \mathrm {Set} ^{D^{\mathrm {op} }}}
An equivalent definition of a profunctor
is a category whose objects are the disjoint union of the objects of
, plus zero or more additional morphisms from objects of
The sets in the formal definition above are the hom-sets between objects of
(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
{\displaystyle \phi ^{\text{op}}\times \phi \to \mathbf {Set} }
This also makes it clear that a profunctor can be thought of as a relation between the objects of
, 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.
is the left Kan extension of the functor
along the Yoneda functor
associates the functor
{\displaystyle D(-,d):D^{\mathrm {op} }\to \mathrm {Set} }
is the least equivalence relation such that
whenever there exists a morphism
such that Equivalently, profunctor composition can be written using a coend 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 A functor
by postcomposing with the Yoneda functor: It can be shown that such a profunctor
Moreover, this is a characterization: a profunctor
factors through the Cauchy completion of