Now let's take a deeper look at adjoint functors - in our first look at these in [Lecture 47](https://forum.azimuthproject.org/discussion/2253/lecture-47-chapter-3-adjoint-functors/p1), I deliberately downplayed some technicalities. But we need to understand these to truly understand adjoints, and they're actually beautiful in their own right. One of these is the so-called 'hom-functor'
\[ \mathrm{hom}: \mathcal{C}^{\mathrm{op}} \times \mathcal{C} \to \mathbf{Set} \]
that every category \\(\mathcal{C}\\) comes born with. Some of you have [already figured out how this works](https://forum.azimuthproject.org/discussion/comment/19676/#Comment_19676). But let me explain it anyway.
Here are two important principles of category theory:
> **Every collection of things is eager to become the objects of a _category_.**
and
> **Every map sending things of one kind to things of another kind is eager to become a _functor_.**
But a category is more than a mere collection of objects, and a functor is more than a mere functor. A category, after all, needs _morphisms!_ And a functor must know what to do to morphisms!
True, there's a cheap way to make any set into a category. Just throw in the morphisms that are absolutely required: the identity morphisms! There's also a cheap way to make any function into a functor. But usually we want to do something more interesting.
Now, whenever you've got a category \\(\mathcal{C}\\), there's a set of morphisms from any object \\(x\\) to any object \\(y\\). This is called a **hom-set**, and people often write it as \\(\mathrm{hom}(x,y)\\). Fong and Spivak call it \\(\mathcal{C}(x,y)\\), and that's good because it reminds you which category \\(x\\) and \\(y\\) are objects of.
Anyway, the hom-functor is what we get when we think about hom-sets
using the principles I stated above.
A category \\(\mathcal{C}\\) has a collection of objects \\(\mathrm{Ob}(\mathcal{C})\\), and given any two of these we get a set of morphisms from the first to the second. So, there's a function
\[ \mathrm{hom} : \mathrm{Ob}(\mathcal{C}) \times \mathrm{Ob}(\mathcal{C}) \to \mathrm{Ob}(\mathbf{Set}) \]
sending any pair of objects \\( (c,c') \in \mathrm{Ob}(\mathcal{C}) \times \mathrm{Ob}(\mathcal{C}) \\) to the set \\( \mathcal{C}(c,c') \\) of morphisms from \\(c\\) to \\(c'\\). Note that a guy in \\(\mathrm{Ob}(\mathbf{Set})\\) is just a set!
But this function looks like it wants to become a functor
\[ \mathrm{hom} : \mathcal{C} \times \mathcal{C} \to \mathbf{Set}. \]
That doesn't quite work - but if we try, we'll see what goes wrong, and how to fix it.
First of all, what's \\(\mathcal{C} \times \mathcal{C}\\)? That actually works fine:
**Theorem.** For any categories \\(\mathcal{X}\\) and \\(\mathcal{Y}\\), there is a category \\(\mathcal{X} \times \mathcal{Y}\\) for which:
* An object is a pair \\( (x,y) \in \mathrm{Ob}(\mathcal{X}) \times \mathrm{Ob}(\mathcal{Y}) \\).
* A morphism from \\( (x,y) \\) to \\( (x',y') \\) is a pair of morphisms \\( f: x \to y'\\) and \\(g: y \to y'\\). We write this as \\( (f,g) : (x,y) \to (x',y') \\).
* We compose morphisms as follows:
\[ (f',g') \circ (f,g) = (f' \circ f, g' \circ g) .\]
* Identity morphisms are defined as follows:
\[ 1_{(x,y)} = (1_x, 1_y) .\]
**Proof.** Just check associativity and the right/left unit laws. \\( \qquad \blacksquare \\)
The problem is that we can't define our would-be functor
\[ \mathrm{hom} : \mathcal{C} \times \mathcal{C} \to \mathbf{Set} \]
on morphisms. We know what we want it to do to objects of \\(\mathcal{C} \times \mathcal{C}\\):
\[ \mathrm{hom}(c,c') = \mathcal{C}(c,c') .\]
But suppose we have a morphism in \\(\mathcal{C} \times \mathcal{C}\\), say
\[ (f,g) : (c,c') \to (d,d') \]
This should get sent to a morphism in \\(\mathbf{Set}\\), that is a function, called
\[ \mathrm{hom}(f,g) : \mathrm{hom}(c,c') \to \mathrm{hom}(d,d') \]
This function should take any morphism \\(h \in \mathrm{hom}(c,c')\\) and give a morphism in \\(\mathrm{hom}(d,d')\\). Can we accomplish this with what we have? Draw a diagram of everything:
\[
\begin{matrix}
& & h & & \\\\
& c & \rightarrow & c' &\\\\
f & \downarrow & & \downarrow & g\\\\
& d & \rightarrow & d' &\\\\
& & ? & & \\\\
\end{matrix}
\]
Can we get a morphism from \\(d\\) to \\(d'\\) from this?
_No!_
We can compose \\(h\\) with \\(g\\) just fine. But we can't compose it with \\(f\\), because \\(f\\) is pointing the wrong way!
So, we need to turn around an arrow, and for that we need the concept of an 'opposite category'.
**Theorem.** For any category \\(\mathcal{C}\\) there is a category \\(\mathcal{C}^{\text{op}}\\), called the **opposite** of \\(\mathcal{C}\\), for which:
* The objects of \\(\mathcal{C}^{\text{op}}\\) are the objects of \\(\mathcal{C}\\).
* A morphism \\(f : c \to c'\\) in \\(\mathcal{C}^{\text{op}}\\) is a morphism
\\(f : c' \to c\\) in \\(\mathcal{C}\\).
* The composite \\(g \circ f \\) of morphisms \\(f : c \to c'\\), \\(g: c' \to c''\\) in
\\(\mathcal{C}^{\text{op}}\\) is the composite \\(f \circ g\\) of the corresponding morphism \\(g : c'' \to c' \\), \\(f: c' \to c\\) in \\(\mathcal{C}\\).
* The identity morphism of an object \\(c\\) of \\(\mathcal{C}^{\text{op}}\\) is the same as its identity morphism in \\(\mathcal{C}\\).
**Proof.** Again, just check associativity and the left/right unit laws. These are facts that already hold in \\(\mathcal{C}\\); we're just turning them around backwards! \\( \qquad \blacksquare\\)
Now we can succeed in getting our hom-functor! It's really a functor
\[ \mathrm{hom} : \mathcal{C}^{\mathrm{op}} \times \mathcal{C} \to \mathbf{Set} . \]
We already know what we want it to do to objects:
\[ \mathrm{hom}(c,c') = \mathcal{C}(c,c') .\]
Now suppose have a morphism in \\(\mathcal{C}^{\text{op}} \times \mathcal{C}\\), say
\[ (f,g) : (c,c') \to (d,d') . \]
Thanks to the fiendishly clever 'op', this is the same as a morphism
\[ (f,g) : (d,c') \to (c,d') \]
in \\(\mathcal{C}\times \mathcal{C}\\). Our hom-functor should send this to a morphism in \\(\mathbf{Set}\\), namely a function
\[ \mathrm{hom}(f,g) : \mathrm{hom}(c,c') \to \mathrm{hom}(d,d') \]
This function should take any morphism \\(h \in \mathrm{hom}(c,c')\\) and give a morphism in \\(\mathrm{hom}(d,d')\\). Can we get this to work now? Again, draw everything we've got:
\[
\begin{matrix}
& & h & & \\\\
& d & \rightarrow & c &\\\\
f & \uparrow & & \downarrow & g\\\\
& c & \rightarrow & d' &\\\\
& & ? & & \\\\
\end{matrix}
\]
Can we get a morphism from \\(d\\) to \\(d'\\) from this?
_Yes!_
Just compose all the arrows and get
\[ g \circ h \circ f : d \to d'. \]
Now we're on the road to success. Of course we have to check that our would-be hom-functor really is a functor! But I'll let you do that:
**Puzzle 161.** Prove that for any category \\(\mathcal{C}\\) there is a functor, the **hom-functor**
\[ \mathrm{hom} : \mathcal{C}^{\mathrm{op}} \times \mathcal{C} \to \mathbf{Set} \]
that sends any object \\( (c,c') \\) of \\(\mathcal{C}^{\mathrm{op}} \times \mathcal{C}\\) to the set \\(\mathcal{C}(x,y)\\), and sends any morphism
\[ (f,g) : (c,c') \to (d,d') \]
in \\(\mathcal{C}^{\text{op}} \times \mathcal{C}\\) to the function
\[ \mathrm{hom}(f,g) : \mathrm{hom}(c,c') \to \mathrm{hom}(d,d') \]
that maps any \\(h \in \mathrm{hom}(c,c') \\) to \\( g \circ h \circ f \in \mathrm{hom}(d,d')\\).
You have to prove it preserves composition and identities!
**[To read other lectures go here.](http://www.azimuthproject.org/azimuth/show/Applied+Category+Theory#Chapter_3)**