Monday, August 3, 2009

Natural Question: Morphisms of Functors?

By now I hope the reader sees the waltz that goes on here: we introduced objects, then asked about mappings between them. We introduced categories, and morphisms between them (functors). We now ask "Well, what about functors, can we have morphisms between them?"

(The very clever reader who asks "Wait, what about morphisms of morphisms?" We may get to this, it's basically the notion of comma categories, or slice categories. If I recall correctly, the two are the same. We'll get into it some more before covering the notion of universal arrows.)

The recommended reading this time includes some Youtube lectures by the Catsters:

Now there are many different ways to present natural transformations, because it's not so simple as it seems. We introduced functors in two ways: as a way to encode a mathematical process, and as a generalization of assigning information to each object of the domain. We have thus two different ways to present morphisms of functors.

Homotopy Analogy

How can we have a mapping of one process to another? This intuition is hard to grasp, personally I want to jump all over the idea of homotopy deformation. But recall a homotopy deformation takes two paths $\gamma_{1},\gamma_{2}:I\to\mathbb{C}$ where $I$ is an interval, and deforms one into the other. More precisely:

$H:I\times[0,1]\to\mathbb{C}$

The problem is that we need some category theoretic analog to: the product $\times$ and the unit interval. I'll cheat and give the answer: we have some notion of the product of categories, and the category theoretic interval is our beloved 2. We set up the diagram describing the product category $C\times\mathbf{2}$:



\begin{diagram}
C\times{1} &\qquad&\qquad& x       &\rTo^{(f,1)} & y\\
           &\qquad&\qquad& \uTo    &             & \uTo\\
C\times{0} &\qquad&\qquad& x       &\rTo_{(f,0)} & y
\end{diagram}

We treat the objects of this category as an ordered pair $(0,x)$ and $(1,x)$. For all practical purposes, $C\times\mathbf{2}$ behaves like two copies of $C$: $C\times{0}$ and $C\times{1}$. We have arrows joining the first to the second, as we have demonstrated in our diagram.

Here the functors $T_{0},T_{1}:C\to{C\times\mathbf{2}}$ ("bottom" and "top", respectively) are defined for each arrow $f$ of $C$ by $T_{0}(f)=(f,0)$ and $T_{1}(f)=(f,1)$.

Let $\downarrow$ denote the unique non-identity arrow $0\to{1}$ in 2. We can define a transformation between $T_0,T_1:C\to{C\times\mathbf{2}}$ by

$\mu:T_{0}\to{T_{1}},\quad \mu(c)=(c,\downarrow)$

for any object $c$. It maps "bottom" to "top" and is clearly "natural". This $\mu$ mapping is the skeleton of the "homotopy deformation" of processes. It's specifically something called a "universal natural transformation" from $C$. (Remark: the term "universal" means that we factor everything through it. We'll show what this means.)

Let $S,T:C\to{B}$ be functors. There is a unique functor $F:C\times\mathbf{2}\to B$ with $(F\circ{}\mu):C\to{B}$ identified as the "homotopy deformation" of $S\Rightarrow{T}$. (Notation: for our "homotopy deformation" of processes, we denote it with a special arrow $\Rightarrow{}$.)

Now what exactly is going on here? We basically identify acting on the "top" with $F$ as being "the same" as acting on $C$ by $S$; and we similarly identify acting on the "bottom" with $F$ as being "the same" as acting on $C$ by $T$. Now the question arises: what about acting on $(c,\downarrow)$? How does this behave?

$F$ acts on $(c,\downarrow)$ in precisely the homotopic way we envisioned. It "deforms" the "top" into the "bottom". Such a deformation is usually dubbed a "natural transformation" and denoted by the special arrow $S\Rightarrow{T}$. Note that the domain and codomain of natural transformations are functors. Specifically functors which have the same domain and codomain.

We see explicitly, for $f:c\to{c^{\prime}}$,

  1. $F(f,0)=S(f)$,
  2. $F(f,1)=T(f)$,
  3. $F(f,\downarrow)=T(f)\circ[(F\circ\mu)(c)]=[(F\circ\mu)(c^{\prime})]\circ S(f)$.
This is precisely the behavior describing a natural transformation $(F\circ\mu)$.

The reader interested in this "homotopy" presentation of natural transformations can refer to

  • The Catsters "Natural transformations 1" Youtube lecture (2007)
  • Saunders Mac Lane, Categories for the Working Mathematician Graduate Texts in Mathematics (vol 5) Springer-Verlag, Second Edition (1998); specifically the end of the section on products of categories (page 39 of my copy)
Sadly I haven't seen any other material on this presentation of natural transformations in this "homotopic way".

Morphisms of (Pre-)Sheaves

We have presented functors with the notion of generalizing vector fields to categories previously. A functor (presheaf really) "assigns" to each object of its domain some information, a mathematical object in the codomain, in a "consistent way".

The question that presents itself now is: we have assigned information in one way $S:C\to{B}$ and in another way $T:C\to{B}$. Is there a way to relate these two assignments?

Now there is a weakness with this motivation, consider the following situation: we have a vector and we can obtain a scalar (its norm). If we have the functor $S:C\to\mathbf{Vect}$ (where Vect is the category of vector spaces with morphisms be linear transformations) and $T:C\to\mathbf{Set}$, a "morphism" of these functors $\|\cdot\|:S\Rightarrow{T}$ done "in the obvious way" isn't a natural transformation. Why not? Because the codomains of $S$ and $T$ are different! But turning a vector into a scalar via the norm is really quite a natural thing to do!

But that's the wrong way to think of "naturally transforming $S$ into $T$". What we should instead do is consider the following situation, let $S,T:C\to\mathbf{Vect}$. They assign to each object of $C$ a vector space. Each morphism of $C$ becomes a linear transformation. However, the linear transformations are projections onto subspaces. This is the only way we could get the restriction morphism demand of the presheaf functor to work out.

The natural transformation then is subject to the condition that this morphism-of-sheaves is compatible with restrictions. In other words, we restrict then change the method of assigning information is the same as changing the method of assigning information then restricting. This is the same as demanding the following commutes:

\begin{diagram}
G(u)             && \rTo^{\varphi_{u}} && F(u) \\
\dTo^{res_{v,u}} &&                    && \dTo_{res_{v,u}}\\
G(v)             &&\rTo_{\varphi_{v}}  && F(v)
\end{diagram}

In the immortal infallible words of wikipedia:

Heuristically speaking, a morphism of sheaves is analogous to a function between them. However, because sheaves contain data relative to every open set of a topological space, a morphism of sheaves is defined as a collection of functions, one for each open set, which satisfy a compatibility condition.

The interested reader can peruse a variety of references on the material:

Formal Considerations

We've given two approaches motivating the notion of natural transformations (or "morphisms of functors"). We should, being good mathematicians, define what a natural transformation is precisely.

Definition 1. Given two functors $F,G:C\to{D}$, a "Natural Transformation" $\tau:F\Rightarrow{G}$ consists of
  • a function $\tau$ mapping each object $x\in{C}$ to a morphism $\tau_{x}:F(x)\to{G(x)}$
such that
  • for any morphism $f:x\to{y}$ in $C$, the following diagram commutes:
    \begin{diagram}
F(x)             && \rTo^{F(f)} && F(y) \\
\dTo^{\tau_{x}}  &&             && \dTo_{\tau_{y}}\\
G(x)             &&\rTo_{G(f)}  && G(y)
\end{diagram}

(Note the notation: we use $\Rightarrow$ instead of $\to$ to indicate we're working with a natural transformation!)

What this effectively does is it "compares" (well, "relates") two different ways of assigning information in a "natural way". This is what both the homotopy approach and presheaf approach tells us, just in a more intuitive way.

Since a natural transformation "is-a" morphism (sort of), we can have an isomorphism. But we don't call it just that. We give it the adjective "natural" to indicate it's really a natural transformation with an "inverse". More precisely:

Definition 2. Let $F,G:C\to{D}$ be functors, a "natural isomorphism" consists of
  • a natural transformation $\alpha:F\Rightarrow{G}$
equipped with
  • a unique natural transformation $\beta:G\Rightarrow{F}$
such that
  • $\beta\circ\alpha=1_{F}$ and $\alpha\circ\beta=1_{G}$.

It's not uncommon to see this written as $\alpha:F\cong{G}$.

We Can "Compose" Natural Transformations With Functors

It's important to make a note here that I haven't really seen in e.g. Mac Lane's Categories for the Working Mathematician, but it's used all the time. We can "compose" natural transformations with functors "in the obvious way".

The only place that I have actually seen explicitly spell this out, shockingly enough, is Wikipedia(!):

If η : F ⇒ G is a natural transformation between functors F, G : C → D, and H : D → E is another functor, then we can form the natural transformation Hη : H∘F ⇒ H∘G by defining

$ (H \eta)_X = H_{\eta_X}. $

If on the other hand K : B → C is a functor, the natural transformation ηK : F∘K ⇒ G∘K is defined by

$ (\eta K)_X = \eta_{K(X)}.\, $
Source: Wikipedia, Natural Transformations.

No comments:

Post a Comment