Given categories and objects , we let denote the category where we freely add an arrow to the disjoint union of and .
This can be achieved e.g. by taking the colimit of the following -shaped diagram:
where is the terminal category and contains two objects and a single nonidentity arrow .
Alternatively, we can consider the profunctor induced by the span (which is just the profunctor composition ).
It’s straightforward to check that .
Based on the construction, for any profunctor , the profunctor morphisms (functors that are identical on both and ) are uniquely determined by where they take the freely added arrow , and that can be any heteromorphism in .
Theorem. (Yoneda lemma for profunctors.) For any profunctor and objects we have a bijection
natural in both and .
It’s also straightforward to verify that, for profunctors , a functor that acts as the identity on both and , naturally corresponds to a natural transformation where are the hom functors of restricted to heteromorphisms (i.e. ), and vice-versa.
This way, involving our previous observation about , we can reformulate the above theorem as, for any functor we have
naturally in .
That clearly implies both the covariant and the contravariant versions of the original Yoneda lemma when applying it either with or with .
Presheaves as simple extensions
A presheaf on a category is a functor , so using can even condider it as a profunctor , which can be viewed as a left -module, or… as a simple right extension of by a single object (the object of ).
Similarly, a presheaf on the opposite category can be though of as a right -module, or as a simple left extension.
Definition. A category with object is a simple right extension of category if is a full(y embedded) subcategory of , , and is not the domain of any morphism besides its identity .
Examples. For any object we obtain a simple right extension by joining a new object and copying all the arrows as where . This extension category will be denoted by .
Observe that by construction, , so it’s just the hom functor seen as a profunctor where is embedded into as the new object .
We can also define the empty and the unique simple right extensions by prescribing that each contains exactly 0 or 1 elements, respectively.
Theorem. (Yoneda lemma for simple right extensions.)
Every simple right extension of is a colimit of simple extensions . (…..)