# Can a functor be seen as a special case of a profunctor?

This is a conceptual question about category theory, more than a technical one. It has no practical purpose as far as I know, but it's been bugging me for ages.

The short version: a function can be seen as a special case of a relation, namely one in which every object in the domain is related to exactly one object in the codomain. Functors don't seem to be special cases of profunctors in the same sense. Is there some other, somewhat analogous, sense in which a functor can be seen as a special case of a profunctor?

The long version:

A profunctor can be seen as a particular type of functor: a profunctor $$\phi\colon A\nrightarrow B$$ is a functor $$\phi\colon A^\text{op}\times B \to \mathbf{Set}$$. (There seem to be multiple conventions about the order of $$A$$ and $$B$$ and where to put the $${}^\text{op}$$. I'm using this one.) For objects $$a\in\mathrm{Ob}(A), b\in\mathrm{Ob}(B)$$, one can think of $$\phi(a,b)$$ as something like a hom-set between $$a$$ and $$b$$, even though they're in different categories. The elements of $$\phi(a,b)$$ are sometimes called "heteromorphisms." The functoriality of $$\phi$$ essentially means that these heteromorphisms have to compose with the (homo)morphisms in the categories $$A$$ and $$B$$.

This leads to the view that profunctors are to functors as relations are to functions. We can think of a relation $$R$$ between sets $$S$$ and $$T$$ as a function $$R:S\times T\to \{0,1\}$$, which corresponds to the definition of a profunctor as a functor, and the definition of a profunctor can be seen as a categorification of this.

We can also think of $$R$$ as just a subset of the Cartesian product $$S\times T$$. The picture of profunctors in terms of heteromorphisms can be seen as a categorification of this view. From this view, we can also see a function as a special case of a relation: it's a relation in which every object in $$S$$ is related to exactly one object in $$T$$.

However, at this point the profunctors$$\leftrightarrow$$relations analogy seems to break down. It would be very nice if we could say, analogously, that a functor $$F\colon A\to B$$ is a profunctor in which every object of $$A$$ is related to exactly one object of $$B$$. However, it seems this can't work. Consider the following example:

If we want to express a functor that maps $$a\in\mathrm{Ob}(A)$$ to $$b_1\in \mathrm{Ob}(B)$$ then we should draw a heteromorphism $$h$$ from $$a$$ to $$b_1$$. But since heteromorphisms must compose with morphisms we are forced to also add a heteromorphism $$h{;}f$$, contradicting the idea that $$a$$ should be related to exactly one object in $$B$$.

The question is, is there some other way in which a functor can be seen as a special case of a profunctor, analogous to the way in which a function can be seen as a special case of a relation? If someone for some reason knew about profunctors (via the heteromorphism definiton) but didn't know what a functor was, could you given them a "categorical" definition of a functor in terms of profunctors?

• To answer the question in the title : yes, via the Yoneda lemma. If $F:A\to B$ is a functor, $\hom_B(F(-),-)$ is a profunctor, and I'd guess that this embeds functors fully faithfully into profunctors (probably with an $^{op}$). This does not, however answer your more precise question, which would amount to : how can we characterize categorically those profunctors among the general ones ? – Maxime Ramzi Jun 24 '20 at 11:31
• Note, though, that with this idea one can also encode functors $B\to A$ as profunctors from $A$ to $B$. Sometimes a profunctor is both a functor from $A$ to $B$ and one from $B$ to $A$, in which case it's essentially an adjunction (more precisely perhaps, a pair of adjoint functors) – Maxime Ramzi Jun 24 '20 at 11:34
• That's a very useful insight, thank you very much - I will think more about that. – Nathaniel Jun 24 '20 at 11:54

Yes: a profunctor $$P : \mathscr C \nrightarrow \mathscr D$$ is equivalent to to a functor precisely when $$P$$ has a right adjoint (in the bicategorical sense), assuming $$\mathscr D$$ is Cauchy-complete. One can check analogously that a relation $$p : C \nrightarrow D$$ (i.e. a $$(0, 1)$$-profunctor) has a right adjoint precisely when it is equivalent to a function, assuming the axiom of choice. There's more information on this correspondence on Wikipedia and the nLab.

• That sounds cool - so if I get this right you're saying that if I know the $2$-category of profunctors (not knowing what the inside-machinery of a profunctor is), then I can extract from it a notion of functor ? Do you know what happens when $\mathscr D$ is not Cauchy-complete, is there a similar story ? – Maxime Ramzi Jun 24 '20 at 13:38
• Yes, that's right. If $\mathscr D$ is not Cauchy-complete, then left adjoints correspond to semifunctors, which are the homomorphisms between semicategories (i.e. categories with units). The relevance of Cauchy-completion to semicateories is explained here. – varkor Jun 24 '20 at 14:48

Given a functor $$F:A\to B$$, we can define a category by freely adjoining 'base heteromorphisms' $$a\to F(a)$$ to the disjoint union $$A\sqcup B$$, while enforcing the squares $$\ \matrix{\quad a&\to&F(a)\qquad \\ \alpha\downarrow && \downarrow F(\alpha) \\ \quad x& \to &F(x)\qquad}\$$ to commute.
Observe that this just leads to the collage category of the profunctor $$F_*=(a,b)\mapsto \hom_B(F(a),\,b)$$, and that by construction, every base heteromorphism is a reflection arrow.
Dually, if we swap the direction of the base heteromorphisms but do the same construction, we'll arrive to a profunctor $$B\not\to A$$, namely $$F^*=(b,a)\mapsto\hom_B(b,\,F(a))$$ and the base heteromorphisms will be coreflection arrows.
If $$B$$ is a reflective subcategory of (the collage of) a profunctor $$U:A\not\to B$$, then $$U\cong F_*$$ for some functor $$F:A\to B$$ (namely, fix a reflection arrow for each object in $$A$$ and take their codomains).
If $$A$$ is a coreflective subcategory of the collage of $$U$$, then $$U\cong G^*$$ for some functor $$G:B\to A$$.
Moreover, if both happens, that means exactly that the profunctor itself is [or, encodes] an adjunction, namely $$F\dashv G$$.