# What is a Functor? Definitions and Examples, Part 2

/*Continuing yesterday's list of examples of functors, here is...*

## Example #3: the chain rule

*together with*a basepoint $x_0$. (Just let $x_0$ be your favorite $n$-dimensional vector. Pick the zero-vector if you like). In this category the morphisms $\mathbb{R^n}\overset{f}{\longrightarrow}\mathbb{R}^m$ are the differentiable functions that preserve basepoints: if $y_0$ is the basepoint in $\mathbb{R}^m$ and $x_0$ is the basepoint in $\mathbb{R}^n$, then $f(x_0)=y_0$.

Let $\mathsf{M}$ be the category whose objects are positive integers and where a morphism $n\to m$ is an $m\times n$ matrix with real entries. In other words, there is an arrow from $n$ to $m$ for each such matrix. So here, composition of morphisms corresponds to matrix multiplication.

Define $D:\mathsf{E}\to\mathsf{M}$ as follows,

- on objects in $\mathsf{E}$: let $D$ send $\mathbb{R}^n$ to its dimension, $n$
- on morphisms in $\mathsf{E}$: let $D$ send a differentiable function $f:\mathbb{R}^n\to\mathbb{R}^m$ to its $m\times n$ Jacobian matrix, evaluated at $x_0\in\mathbb{R}^n.$

Now, is $D$ a functor? If so, then it must respect composition. Let's check this. Suppose $\mathbb{R}^m\overset{g}{\longrightarrow}\mathbb{R}^k$ is another basepoint-preserving differentiable function. Does the following equality hold?

Thanks to calculus, our $D$ is indeed a functor.

## Example #4: contravariant functors

*dual space of $V$*and is sometimes denoted $V^*$. What do you think this functor does to morphisms? That is, given a linear map $V\overset{f}{\longrightarrow} W$, how can we get a map $F(f)$ between $\text{hom}(V,\mathbb{k})$ and $\text{hom}(W,\mathbb{k})$?

Well, a map $F(f):\text{hom}(V,\mathbb{k})\to \text{hom}(W,\mathbb{k})$ would have to take a linear transformation $\varphi$ with domain $V$ and send it to one with domain $W$, and it would have to do it using $f:V\to W$ somehow. I'm not sure if there's a way to do this---the arrows simply don't line up.

*started*with a linear transformation on $W$, say $\varphi:W\to\mathbb{k}$, we

*could*obtain a linear transformation on $V$ by precomposing with $f$!

**pullback**, to be the function $f^*$ that takes a linear transformation $\varphi:W\to\mathbb{k}$ and sends it to $\varphi\circ f:V\to\mathbb{k}$, in other words, $f^*(\varphi)=\varphi\circ f$.

See how this assignment of $F$ reverses arrows?

*contravariant.*The "normal" functors (as defined yesterday) are then called

*covariant*. Formally, a

**contravariant functor**$F:\mathsf{C}^{op}\to\mathsf{D}$ (sometimes you'll see the "op" placed on the $\mathsf{C}$ to remind you, "Hey! this functor's contravariant!") has the same data and properties as a covariant functor, except that the composition property is now $F(f\circ g)=F(g)\circ F(f)$ whenever $f$ and $g$ are composable morphisms in $\mathsf{C}$.

## Example #5: representable functors

There is a contravariant functor $\mathscr{O}$ from $\mathsf{Top}^{op}$ to $\mathsf{Set}$ that associates to each topological space $X$ its set $\mathscr{O}(X)$ of open subsets. On morphisms, $\mathscr{O}$ takes a continuous function $f:X\to Y$ to $f^{-1}:\mathscr{O}(Y)\to\mathscr{O}(X)$ where $f^{-1}$ is a function sending an open set $U$ in $Y$ to the open set $f^{-1}(U)$ in $X$. (We know $f^{-1}(U)$ is open since $f$ is continuous!)

Now here's what's cool: it turns out that $\mathscr{O}$ is a very, very special kind of functor---it is *representable.* I won't go into the details here, but in short, for any category $\mathsf{C}$, a (covariant or contravariant) functor $F:\mathsf{C}\to\mathsf{Set}$ is said to be **representable** if there is an object $c$ in $\mathsf{C}$ so that for all objects $x$ in $C$, the elements of $F(x)$ are *really* maps $x\to c$ (or maps $c\to x$, depending on the "variance" of $F$). In this case we say $F$ is **represented by the object $c$.**

Friends, that's *precisely* the statement that $\mathscr{O}$ is a *representable* functor, represented by the one and only Sierpinski space! Who knew two little dots could be so special?

Pretty cool, huh?

I'd love to chat more about representability on the blog, but to do so, we first need to understand *natural transformations*. And that's what we'll do next week!

*References:*

*Category Theory in Context* by Emily Riehl