Profunctor

From HandWiki

In category theory, a branch of mathematics, profunctors are a generalization of relations and also of bimodules.

Definition

A profunctor (also named distributor by the French school and module by the Sydney school) [math]\displaystyle{ \,\phi }[/math] from a category [math]\displaystyle{ C }[/math] to a category [math]\displaystyle{ D }[/math], written

[math]\displaystyle{ \phi \colon C\nrightarrow D }[/math],

is defined to be a functor

[math]\displaystyle{ \phi \colon D^{\mathrm{op}}\times C\to\mathbf{Set} }[/math]

where [math]\displaystyle{ D^\mathrm{op} }[/math] denotes the opposite category of [math]\displaystyle{ D }[/math] and [math]\displaystyle{ \mathbf{Set} }[/math] denotes the category of sets. Given morphisms [math]\displaystyle{ f\colon d\to d', g\colon c\to c' }[/math] respectively in [math]\displaystyle{ D, C }[/math] and an element [math]\displaystyle{ x\in\phi(d',c) }[/math], we write [math]\displaystyle{ xf\in \phi(d,c), gx\in\phi(d',c') }[/math] to denote the actions.

Using the cartesian closure of [math]\displaystyle{ \mathbf{Cat} }[/math], the category of small categories, the profunctor [math]\displaystyle{ \phi }[/math] can be seen as a functor

[math]\displaystyle{ \hat{\phi} \colon C\to\hat{D} }[/math]

where [math]\displaystyle{ \hat{D} }[/math] denotes the category [math]\displaystyle{ \mathrm{Set}^{D^\mathrm{op}} }[/math] of presheaves over [math]\displaystyle{ D }[/math].

A correspondence from [math]\displaystyle{ C }[/math] to [math]\displaystyle{ D }[/math] is a profunctor [math]\displaystyle{ D\nrightarrow C }[/math].

Profunctors as categories

An equivalent definition of a profunctor [math]\displaystyle{ \phi \colon C\nrightarrow D }[/math] is a category whose objects are the disjoint union of the objects of [math]\displaystyle{ C }[/math] and the objects of [math]\displaystyle{ D }[/math], and whose morphisms are the morphisms of [math]\displaystyle{ C }[/math] and the morphisms of [math]\displaystyle{ D }[/math], plus zero or more additional morphisms from objects of [math]\displaystyle{ D }[/math] to objects of [math]\displaystyle{ C }[/math]. The sets in the formal definition above are the hom-sets between objects of [math]\displaystyle{ D }[/math] and objects of [math]\displaystyle{ C }[/math]. (These are also known as het-sets, since the corresponding morphisms can be called heteromorphisms.[1]) The previous definition can be recovered by the restriction of the hom-functor [math]\displaystyle{ \phi^\text{op}\times \phi \to \mathbf{Set} }[/math] to [math]\displaystyle{ D^\text{op}\times C }[/math].

This also makes it clear that a profunctor can be thought of as a relation between the objects of [math]\displaystyle{ C }[/math] and the objects of [math]\displaystyle{ D }[/math], 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 [math]\displaystyle{ \psi\phi }[/math] of two profunctors

[math]\displaystyle{ \phi\colon C\nrightarrow D }[/math] and [math]\displaystyle{ \psi\colon D\nrightarrow E }[/math]

is given by

[math]\displaystyle{ \psi\phi=\mathrm{Lan}_{Y_D}(\hat{\psi})\circ\hat\phi }[/math]

where [math]\displaystyle{ \mathrm{Lan}_{Y_D}(\hat{\psi}) }[/math] is the left Kan extension of the functor [math]\displaystyle{ \hat{\psi} }[/math] along the Yoneda functor [math]\displaystyle{ Y_D \colon D\to\hat D }[/math] of [math]\displaystyle{ D }[/math] (which to every object [math]\displaystyle{ d }[/math] of [math]\displaystyle{ D }[/math] associates the functor [math]\displaystyle{ D(-,d) \colon D^{\mathrm{op}}\to\mathrm{Set} }[/math]).

It can be shown that

[math]\displaystyle{ (\psi\phi)(e,c)=\left(\coprod_{d\in D}\psi(e,d)\times\phi(d,c)\right)\Bigg/\sim }[/math]

where [math]\displaystyle{ \sim }[/math] is the least equivalence relation such that [math]\displaystyle{ (y',x')\sim(y,x) }[/math] whenever there exists a morphism [math]\displaystyle{ v }[/math] in [math]\displaystyle{ D }[/math] such that

[math]\displaystyle{ y'=vy \in\psi(e,d') }[/math] and [math]\displaystyle{ x'v=x \in\phi(d,c) }[/math].

Equivalently, profunctor composition can be written using a coend

[math]\displaystyle{ (\psi\phi)(e,c)=\int^{d\colon D}\psi(e,d)\times\phi(d,c) }[/math]

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

  • 0-cells are small categories,
  • 1-cells between two small categories are the profunctors between those categories,
  • 2-cells between two profunctors are the natural transformations between those profunctors.

Properties

Lifting functors to profunctors

A functor [math]\displaystyle{ F \colon C\to D }[/math] can be seen as a profunctor [math]\displaystyle{ \phi_F \colon C\nrightarrow D }[/math] by postcomposing with the Yoneda functor:

[math]\displaystyle{ \phi_F=Y_D\circ F }[/math].

It can be shown that such a profunctor [math]\displaystyle{ \phi_F }[/math] has a right adjoint. Moreover, this is a characterization: a profunctor [math]\displaystyle{ \phi \colon C\nrightarrow D }[/math] has a right adjoint if and only if [math]\displaystyle{ \hat\phi \colon C\to\hat D }[/math] factors through the Cauchy completion of [math]\displaystyle{ D }[/math], i.e. there exists a functor [math]\displaystyle{ F \colon C\to D }[/math] such that [math]\displaystyle{ \hat\phi=Y_D\circ F }[/math].

References

  1. heteromorphism