Natural transformations in $\textbf{Set}$

I am trying to understand the concept of a natural transformation by considering the following example, an exercise from Mac Lane's Categories for the working mathematician (p. 18, ex. 1):

Let $S$ be a fixed set and denote by $X^S$ the set of all functions $S\to X$. Show that $X\mapsto X^S$ is the object function of a functor $\textbf{Set}\to \textbf{Set}$ and that evaluation $e_X:X^S\times S\dot{\to} X$, defined by $e(h,s)=h(s)$, the value of the function $h$ at $s\in S$, is a natural transformation.

I am having problems with both parts of the question. First of all, I am not sure how to show that $X\mapsto X^S$ is the object function. I need to check the two axioms of a functor, the identity property is easy, since for any functor $T:\mathbf{Set}\to\mathbf{Set}$ and a set $A$ we can define $T(\mathrm{id}_A)=\mathrm{id}_{A^S}$. I also need to show that for any composite of morphisms $g\circ f$ we have $$T(g\circ f)=Tg\circ Tf$$ Given a function $f:A\to B$, how to define a function $Tf:A^S\to B^S$? Suppose that $h:S\to A$ is an element of $A^S$, can I define the image of $h$ under $Tf$ to be the function $g=f\circ h$? Does $T$ then satisfy the composition axiom?

Another problem is that a natural transformation is defined for two functors, whereas here I am only given one. What is the second functor?

• I think this needs to be true for any two functors $\mathbf{Set}\to\mathbf{Set}$. – Jimmy R Jun 9 '13 at 16:04

As you write, you should define $T(f)(h)=f \circ h$ for a function $f: A \rightarrow B$ and $h \in T(A)=A^S$. Then $T(f \circ g)(h)=(f \circ g) \circ h=f \circ (g \circ h)=T(f)(T(g)(h))$. Also, $T(1)=1$ (where $1$ is the identity on $A$).

The other functor is simply the identity $1$, and you are to check that evaluation is a natural transformation from $T$ to $1$.

• Thanks for your answer, I have one further question. A natural transformation is supposed to be a function $X^S\to X$, but here $e_X:X^S\times S\to X$, given a function $S\to X$ is it sent just to $X$ by $e_X$? – Jimmy R Jun 9 '13 at 16:33
• I interpreted you to mean for a fixed $s \in S$. But it is also possible to show that the map $X^S \times S \rightarrow X$ is a natural transformation from the product functor $(X,S) \mapsto X^S \times S$ to the functor $(X,S) \mapsto X$. I am not sure what is being asked for in the book, because I haven't read it. – Stephen Jun 9 '13 at 18:39
• @Steve : the asked natural transformation is not from $T$ to $1$ but from $-^S \times S$ to $1$. – Pece Jun 10 '13 at 11:07
• @Pece, Thanks for the information---at the moment, it still seems ambiguous (only looking at what is written by the OP). What page of MacLane is this on? – Stephen Jun 10 '13 at 13:40
• @Steve I don't have the MacLane here, but it can not be anything else : $S$ is a fixed set and the collection $(e_X)$ is formed of morphism from $X^S \times S$ to $X$. Plus, as I explained in my anwser, the evaluation is the counit of the adjunction $- \times S \dashv -^S$, so it is a common exercise to show the naturality of evaluation. – Pece Jun 10 '13 at 15:31

Concerning the further question. You have now shown that $-^S$ determines a functor $T \colon \mathbf{Sets} \to \mathbf{Sets}$. As you might know, the application $X \mapsto X \times S, f \mapsto (f,1_S)$ determines also a functor $U \colon \mathbf{Sets} \to \mathbf{Sets}$.

The question is then to show that the collection $(e_X)_{X \in \mathrm{Ob}\,\mathbf{Sets}}$ is a natural transformation from the functor $U\circ T$ and the identity functor $1 \colon \mathbf{Sets} \to \mathbf{Sets}$.

To understand what truely happens here, you might want to check the notion of adjunction. The functor $T$ is the right adjoint of $U$ (denoted $U \dashv T$), and the natural transformation $e$ of evaluation is then the counit of this adjunction.