One of the most consistent philosophies throughout all of category theory is "It's all about the arrows." This is built into the very core of the theory, in that you don't even really need objects to define a category: they are in one-to-one correspondence with the identity arrows!
At a metaphorical level, an arrow in a category can be thought of some information that each of and "see" about the other. So for a fixed object , the collection of all arrows from is the total information about the category available to the object ; or dually, the set of all arrows to a fixed object is all information available in the category about the object . From this point of view, what more information could there be about a given object? Nothing. The category is all there is, and in the category the only data are the arrows.
But how does one formalize this idea?
The original inspiration: universal properties
First revisit our pantheon of objects with universal properties. Looking over these examples, a clear pattern emerges. In each case was have an object in a category that is characterized by a "universal property," which can always be expressed in the form of a bijection
that is "natural in ", where is some functor. This naturality, often stated but not articulated, is the formal embodiment of the idea that the bijection is defined "in the same way" for every , or at least "in a compatible way." What that means precisely is that for every arrow in we have a commutative diagram
This is exactly the diagram for a natural transformation.
Examples
For illustration, we recall some specific examples of universal properties.
Coequalizers of set maps
Suppose and are sets. Their disjoint union is the set characterized by the universal property that set maps are in natural bijection with pairs of set maps , . To put this into the above context, let be the functor that assigns:
to each set the set consisting of all pairs of set maps , ; and
to each set map the set map that takes each pair of set maps , the pair of set maps , .
Then there is a bijection that is natural in :
Quotients by normal subgroups
Let be a normal subgroup of a group . The quotient group , together with its projection morphism defined by , satisfies a universal property. Let be the functor that assigns to each group the set of group morphisms such that . Then there is a natural bijection
Under this bijection, each group morphism is sent to the group morphism .
Direct sums of abelian groups
If and are abelian groups, their direct sum is the abelian group . As a set, it consists of all pairs of formal sums with and . The operation is defined "component-wise": . (Although not common, one could reasonably argue that a different notation should be used for the formal sum symbol, such as .) One can verify that is an abelian group, and that it comes equipped with two injective group morphisms and . Moreover, there is a natural bijection between group morphisms from and pairs of groups morphisms , :
Under this bijection, each group morphism is sent to the pair of group morphisms , .
Free -modules
Let be a ring and be the usual forgetful functor. The free module construction takes each set and produces an -module . The function which sends each to the same element regarded as a formal -linear sum of elements of is an arrow . For any other -module , each function can be extended uniquely to a module morphism with .
In the current context, let be the functor that assigns to each -module the collection of set maps ; i.e., . Then there is a natural bijection
From objects to (hom) functors
We first notice that in every universal property, we are always characterizing morphisms from an object (or dually, to an object) in terms of a "natural" bijection with some other info. To make this functorial, consider the following:
Definition of hom functor
For each object in a given category , we can define a functor as follows:
For each object , we let .
For each arrow , we let be the set map that takes each morphism to the morphism .
It is also common to write for , but when doing so we will then also write for , rather than the awkward looking .
We should verify that is indeed a functor.
First note that for each identity arrow in we have is the set map that send each arrow to the arrow ; since is a category, we certainly have and so is the identity map on .
Next, for a pair of composable arrows and , we have
More formally, for each object (i.e., arrow ), we have
while
By the associativity of composition in these two are equal.
From the category to the functor category
For each object we have defined a functor , which is an object of the functor category Have we actually defined a functor ? To answer that, we need to specify what should do to arrows.
To that end, suppose is an arrow in . Each arrow from to in is a natural transformation . This is the data of a family of arrows , one for each object , satisfying the usual naturality condition. So let's consider the sets and .
Given an element (i.e., an arrow ), it's not exactly clear how we can use the arrow to produce an arrow , i.e., an element of .
However, there is an obvious way to take an element (i.e., an arrow ) and use the arrow to produce an arrow , namely by pre-composing with .
This defines a set map which (we hope) defines a natural transformation . However, this natural transformation is going "the wrong way." In the classical parlance, we would be describing a so-called contravariant functor from to . This language has generally (but not entirely) fallen out of favor and been replaced by the use of the opposite category construction.[1] In other words, we can use our construction above to define a (covariant) functor[2]
Note that the category has the same objects as the category , and each arrow in from an object to an object corresponds to an arrow in . Because of this, and in an effort to avoid confusion, we often denote arrows in by , where the corresponding arrow in is .
The hom functor
For a given category , we have defined a functor as follows:
For each object (which is the same as an object ), we have .
For each arrow in (which corresponds to an arrow in ), the natural transformation is defined by "pre-composition with ," i.e., for each the set map is given by sending each arrow to the arrow .
Note that the naturality of our supposedly natural transformation follows from the associativity of arrow composition. To see this, suppose is an arrow in and consider the diagram below:
Starting from the top-left, suppose , i.e., we have an arrow . Going over and down yields the arrow , while going down and then over yields the arrow . By associativity of arrow composition in , these two arrows are equal.
Was this a good idea?
If we hadn't been inspired by the myriad constructions objects with universal properties, this wouldn't seem like a great way to understand objects in a given category . Arbitrary functors can presumably be very complicated and difficult to comprehend, and so the category of all such functors is huge and mysterious, at least in comparison with the original category . It would seem impossible that useful knowledge about an object could be gained from studying the corresponding functor .
Following the general principle of "knowing an object by knowing the maps from it"[3], we should first examine what we can say about arrows from to other objects . In other words, we should examine natural transformation
And here we at last come to it, the great lemma of category theory:
Yoneda's Lemma
Suppose is an object of a category and is a functor. Then there is a bijection between the set of natural transformation and the set , given by sending each natural transformation to the element .
In other words, there is a bijection
We can upgrade this bijection to a full-on natural isomorphism between two functors, but for now let's examine the proof of this lemma.
First suppose is a natural transformation. This means that for every object we have a set map . In particular, by taking we have a set map . The domain of this set map is which contains (by the axioms of being category!) a unique identity arrow