Small question about contravariant functors

60 Views Asked by At

I am new to Category Theory and it was recommended to me to start my understanding of basic concepts by reading $\textit{Basic Category Theory}$ by Tom Leinster.

But I am finding myself struggling a bit with the notion of $\textit{Contravariant Functor}$. In one of his many examples, namely $\textit{Example 1.2.11}$, it is meant to show that, given a topological space $X$ and $C(X)$, the ring of real-valued functions at X, $C$ corresponds to a contravariant functor from $\textbf{Top}$ to $\textbf{Ring}$.

However, the part that I am not understanding is why when we define a function $$ f:X \rightarrow Y $$ we induce a ring homomorphism $$ C(f):C(Y)\rightarrow C(X) $$ More particularly, I wish someone could give me some hints as to why $C(f)$ goes in the opposite direction from $f$.

Any help is really appreciated! Thank you in advance, for taking your time to read my question.

1

There are 1 best solutions below

0
On

Given topological spaces $X, Y$ and a continuous function $f : X \to Y$, given any real-valued function $\phi : Y \to \mathbb{R}$ we can produce a function $X \to \mathbb{R}$ by composing:

$$X \xrightarrow{f} Y \xrightarrow{\phi} \mathbb{R}$$

That is, we get the real valued function sending $x \in X$ to $\phi (f (x)) \in \mathbb{R}$.

This is an example of a much more general phenomenon:

Precomposing flips the direction of arrows, while postcomposing keeps it as it is

Another instance of this fact can be seen when you consider the following setup: fix any category $\mathcal{C}$ and an object $c : \mathcal{C}$ in it. We can cook up a functor $\mathbf{Y}_c : \mathcal{C} \to \mathbf{Set}$ into the category of sets by defining

$$\mathbf{Y}_c(a) := \mathbf{Hom}_{\mathcal{C}}[a, c]$$

using the hom-sets. Now, this functor is contravariant just as the one you described, and for the same exact reason: given a morphism $f : a \to a^\prime$ in $\mathcal{C}$, we want to produce a function between the hom-sets:

$$\mathbf{Y}_c(a^\prime) = \mathbf{Hom}_\mathcal{C}[a^\prime, c] \xrightarrow{f^*} \mathbf{Hom}_\mathcal{C}[a, c] = \mathbf{Y}_c(a)$$

The function $f^*$ is given in the same way: given $\phi : a^\prime \to c$, we produce

$$a \xrightarrow{f} a^\prime \xrightarrow{\phi} c$$

The functor $\mathbf{Y}_c$ is extremely important, by the way: it's called the Yoneda embedding of $c : \mathcal{C}$.

As you'll see later on, the assignment $c \mapsto \mathbf{Y}_c$ is actually a (covariant) functor itself (from $\mathcal{C}$ to the category of contravariant functors $\mathcal{C} \to \mathbf{Set}$ into the category of sets). This functor is the main player of a very important result in category theory: the Yoneda lemma.