Natural transformation

Let $F$ and $G$ be functors from category $\mathscr{A}$ to category $\mathscr{B}$, a natural transformation $α: F → G$ is a family $(F(A) \stackrel{α_A}{→} G(A))_{A \in \mathscr{A}}$ of maps in $\mathscr{B}$ such that for every map $A \stackrel{f}{\rightarrow} A'$ in $\mathscr{A}$ , the square

commutes.

Note: $A$ and $A'$ are in $\text{ob}(\mathscr{A})$, $F(A)$, $F(A')$, $G(A)$ and $G(A')$ are in $\text{ob}(\mathscr{B})$.

We denote the natural transformation $\alpha$ as this diagram:

Example

For example:

Let $\mathscr{A} = \textbf{CRing}$ (commutative ring) and $\mathscr{B} = \textbf{Mon}$ (monoid), we can have

  • A functor $M_n$ which maps a commutative ring $R$ to a monoid $M_n(R)$, which its content is $n \times n$ matrix of $R$.
  • A functor $U$ which maps a commutative ring $R$ to a monoid $U(R)$, which observes $R$'s content makes a monoid under $\times$ operation.

For the family of function $det$ which calculates determinant of matrixes, and any ring homomorphism $f : R \to S$:

We can prove this diagram commutes, thus:

In other words, $det$ is a natural transformation.

In a more discrete case, take $R = \mathbb{Z}$ and $S = \mathbb{Z}/2\mathbb{Z}$, $f = \lambda x. x\ \text{mod}\ 2$

Say we have a matrix $X \in M_2(\mathbb{Z})$:

$$ x = \begin{pmatrix} 2 & 3\\ 1 & 4 \end{pmatrix} $$

We can covert it into:

$$ y = M_2(f)(x) = \begin{pmatrix} f(2) & f(3)\\ f(1) & f(4) \end{pmatrix} = \begin{pmatrix} 0 & 1\\ 1 & 0 \end{pmatrix} $$

Where $y \in M_2(\mathbb{Z}/2\mathbb{Z})$.

We can calculate $x$ and $y$'s det:

$$ det_{\mathbb{Z}}(x) = 5 $$

$$ det_{\mathbb{Z}/2\mathbb{Z}}(y) = -1\ \text{mod}\ 2 = 1 $$

It's obvious that $f(det_{\mathbb{Z}}(x)) = det_{\mathbb{Z}/2\mathbb{Z}}(y)$.

Functor category

Take functors as objects and natural transformations as arrows, we can see that functors between types can also be regarded as categories.

We denote such kind of categories built by functors from $\mathscr{A}$ to $\mathscr{B}$ as $[\mathscr{A}, \mathscr{B}]$ or $\mathscr{B}^{\mathscr{A}}$, read as functor category from $\mathscr{A}$ to $\mathscr{B}$.

Natural isomorphism

A natural isomorphism between functors from $\mathscr{A}$ to $\mathscr{B}$ is an isomorphism in $[\mathscr{A} , \mathscr{B}]$.

Or let $\alpha$ be a natural transformation between $F: \text{Functor<}\mathscr{A}, \mathscr{B}\text{>}$ and $G: Functor<\mathscr{A}, \mathscr{B}>$, $α$ is a natural isomorphism if and only if $α(A) : F(A) → G(A)$ is an isomorphism for all $A ∈ \mathscr{A}$. And it is an evidence of $F$ and $G$ are naturally isomorphic. Denoted as $F(A) \cong G(A)$ naturally in $A$.

Equivalence between categories

An equivalence between categories $\mathscr{A}$ and $\mathscr{B}$ consists of a pair of functors together with natural isomorphisms $$ η: 1_\mathscr{A} → G ◦ F $$ $$ ε: F ◦ G → 1_\mathscr{B}. $$

Note these two observes:

$$ G ◦ F \cong 1_\mathscr{A} $$

and

$$ F ◦ G \cong 1_\mathscr{B} $$

We denote it as $\mathscr{A} ≃ \mathscr{B}$.

Equivalence vs Isomorphism

Equivalence is a weaken form of isomorphism, isomorphism requires $G ◦ F = 1_\mathscr{A}$ and $F ◦ G = 1_\mathscr{B}$, and equivalence weaken the $=$ here to $\cong$, or in English, it weaken the equal between functors into isomorphisms between functors.

Example

Say we have two categories:

  • $\mathscr{C}$: has only one object $*$ and one mophism $id_*$.
  • $\mathscr{D}$: has only two object $A$ and $B$ two mophisms $id_A$ and $id_B$.

They are obviously not isomorphism with each other, but we can show they are equivalent with each other, say we can define functors:

  • $F : \mathscr{C} \to \mathscr{D}$ as $F_{obj}(*) = A$ and $F_{mop}(id_*) = id_A$
  • $G : \mathscr{C} \to \mathscr{D}$ as $G_{obj}(A) = *, G_{obj}(B) = *$ and $G_{mop}(id_A) = id_*, G_{mop}(id_B) = id_*$

Essentially surjective

A functor $F : \mathscr{A} → \mathscr{B}$ is essentially surjective on objects if for all $B ∈ \mathscr{B}$, there exists $A ∈ \mathscr{A}$ such that $F(A) \cong B$.

A functor is an equivalence if and only if it is full, faithful and essentially surjective on objects.