The Yoneda lemma is a result in category theory.
Let be a locally small category, and let be a functor from to Set, the category of sets. Let denote the functor that sends every object to and that takes the arrow to the function given by . In other words, is the hom functor . Then there exists a bijection between the set of natural transformations from to and the set . In symbols,
Let be a natural transformation. Then for each object of , gives us an arrow in the category Set, i.e., a function , such that the diagram commutes for any arrow in . In particular, we have But is the map from to . We thus have Thus for every object of , the morphism is uniquely determined by the element . Thus the map is an injection from to .
It thus remains to be shown that for any , the maps for every object of define a natural transformation. But this is true, as for any objects and of , any morphism of , and any element of , we have since is a functor. Thus the diagram commutes, so is a natural transformation, as desired.
Therefore the map is a bijection between and , as desired.
If we replace the category with its opposite category , then we get the following result: if is a contravariant functor from to Set, then for every object of . This dual statement is also sometimes known as the Yoneda lemma.