##### Tools

This site is devoted to mathematics and its applications. Created and run by Peter Saveliev.

# Category

A category ${\mathscr C}$ consists of

• a class $\text{Obj}({\mathscr C})$ of objects;
• a class $\text{Hom}({\mathscr C})$ of morphisms between some pairs of objects.

Morphisms are also called arrows, which emphasizes the point that they are not functions just as the objects aren't sets.

Each morphism $f$ has a unique source object $X \in \text{Obj}({\mathscr C})$ and target object $Y\in \text{Obj}({\mathscr C})$. We write $f: X \to Y$. We write $\text{Hom}_{\mathscr C}(X,Y)$ (or simply $\text{Hom}(X,Y)$ when there is no confusion about to which category it refers) to denote the the class of all morphisms from $X$ to $Y$.

For every three objects $X,Y,Z \in \text{Obj}({\mathscr C})$, there is binary operation $$\text{Hom}_{\mathscr C}(X, Y) × \text{Hom}_{\mathscr C}(Y, Z) \to \text{Hom}_{\mathscr C}(X,Z)$$ called composition of morphisms. The composition of $f : X \to Y$ and $g : Y \to Z$ is written as $gf: X \to Z$. The composition completes the commutative diagram: $$\newcommand{\ra}[1]{\!\!\!\!\!\xrightarrow{\quad#1\quad}\!\!\!\!\!} \newcommand{\da}[1]{\left\downarrow{\scriptstyle#1}\vphantom{\displaystyle\int_0^1}\right.} % \begin{array}{cccccccc} &X & \ra{f} & Y & \\ & & _{gf}\ddots & \da{g} & \\ & & & Z & \end{array}$$

We assume that the following axioms hold:

• (identity) for every object $X \in \text{Obj}({\mathscr C})$, there exists a morphism $\text{Id}_X \in \text{Hom}_{\mathscr C}(X,X)$, called the identity morphism for $X$, such that for every morphism $f : X \to Y$, we have

$$\text{Id}_Y f = f = f\text{Id}_X.$$

• (associativity) if $f : X \to Y, g : Y \to Z$ and $h : Z \to W$ then $h(gf) = (hg)f$, and

The axioms can be illustrated with diagrams. For the former, it's simply: $$\newcommand{\ra}[1]{\!\!\!\!\!\xrightarrow{\quad#1\quad}\!\!\!\!\!} \newcommand{\da}[1]{\left\downarrow{\scriptstyle#1}\vphantom{\displaystyle\int_0^1}\right.} % \begin{array}{cccccccc} &X & \ra{f} & Y \quad\quad\quad&X & \ra{f} & Y \\ & & _{f}\searrow& \da{\text{Id}_Y} \quad\quad\quad &\da{\text{Id}_X} & _{f}\nearrow& \\ & & & Y \quad\quad\quad&X & & & \end{array}$$ For the latter, it's a commutative diagram of commutative diagrams: $$\newcommand{\ra}[1]{\!\!\!\!\!\xrightarrow{\quad#1\quad}\!\!\!\!\!} \newcommand{\la}[1]{\!\!\!\!\!\xleftarrow{\quad#1\quad}\!\!\!\!\!} \newcommand{\da}[1]{\left\downarrow{\scriptstyle#1}\vphantom{\displaystyle\int_0^1}\right.} % \begin{array}{cccccccc} &X & \ra{f} & Y & & X & & Y \\ & & & \da{g} & \Rightarrow & & _{gf}\searrow & \\ &W & \la{h} & Z & & W & \la{h} & Z \\ \\ & & \Downarrow & & & & \Downarrow & \\ \\ &X & \ra{f} & Y & & X & & Y \\ & & _{hg}\swarrow & & \Rightarrow & \da{hgf} & & \\ &W & & Z & & W & & Z \end{array}$$

From these axioms, one can prove that there is exactly one identity morphism for every object.

Examples of categories with morphisms:

A functor ${\mathscr F}$ from category ${\mathscr C}$ to category ${\mathscr D}$ consists of two functions

• the first associates to each object $X$ in ${\mathscr C}$ an object ${\mathscr F}(X)$ in ${\mathscr D}$,
• the second associates to each morphism $f:X\rightarrow Y$ in ${\mathscr C}$ a morphism ${\mathscr F}(f):{\mathscr F}(X) \rightarrow {\mathscr F}(Y)$ in ${\mathscr D}$.

So, we have $${\mathscr F}:\text{Obj}({\mathscr C}) \rightarrow \text{Obj}({\mathscr D}),$$ and, if ${\mathscr F}(X)=U,{\mathscr F}(Y)=V$, we have $${\mathscr F}={\mathscr F}_{X,Y}:\text{Hom}_{\mathscr C}(X,Y) \rightarrow \text{Hom}_{\mathscr D}(U,V).$$ We assume that the following two conditions hold:

• ${\mathscr F}(\text{Id}_{X}) = \text{Id}_{{\mathscr F}(X)}$, for every object $X$ in ${\mathscr C}$;
• ${\mathscr F}(g f) = {\mathscr F}(g) {\mathscr F}(f)$, for all morphisms $f:X \rightarrow Y$, and $g:Y\rightarrow Z$.

Examples:

• a forgetful functor ${\mathscr F}:{\mathscr Top} \to {\mathscr Sets},{\mathscr Ab} \to {\mathscr Sets}$ etc,
• homology $H:{\mathscr Top} \to {\mathscr Ab}$.

Such a functor is called covariant as opposed to a contravariant functor ${\mathscr G}$ which will "reverse" the arrows, i.e., it has two functions as before but

• the second associates to each morphism $f:X\rightarrow Y$ in ${\mathscr C}$ a morphism ${\mathscr G}(f):{\mathscr G}(Y) \rightarrow {\mathscr G}(X)$ in ${\mathscr D}$.

So, if ${\mathscr G}(X)=U,{\mathscr G}(Y)=V$, we have: $${\mathscr G}={\mathscr G}_{X,Y}:\text{Hom}_{\mathscr C}(X,Y) \rightarrow \text{Hom}_{\mathscr D}(V,U).$$

Examples:

• dual space functor $D:{\mathscr Vec} \to {\mathscr Vec}$,
• cohomology $H^*:{\mathscr Top} \to {\mathscr Ab}$.

Suppose $${\mathscr F},{\mathscr G}: {\mathscr C} \to {\mathscr D}$$ are two functors between the categories ${\mathscr C}$ and ${\mathscr D}$. A relation between them $$\newcommand{\ra}[1]{\!\!\!\!\!\!\!\xrightarrow{\quad#1\quad}\!\!\!\!\!} \newcommand{\da}[1]{\left\downarrow{\scriptstyle#1}\vphantom{\displaystyle\int_0^1}\right.} % \begin{array}{cccccccccc} & & {\mathscr F}(X) \in {\mathscr D} \\ & ^{ {\mathscr F} } \nearrow & \\ X \in {\mathscr C}& & \updownarrow ?\\ & _{ {\mathscr G} } \searrow & \\ & & {\mathscr G}(X) \in {\mathscr D} \end{array}$$ would have to respect the way the morphisms of ${\mathscr C}$ correspond to the morphisms of ${\mathscr D}$ under these two functors. So, a natural transformation $$\eta: {\mathscr F} \to {\mathscr G}$$ between these two functors associates to every object $X$ in ${\mathscr C}$ a morphism $\eta_X : {\mathscr F}(X) \to {\mathscr G}(X)$ between objects of ${\mathscr D}$, such that for every morphism $f: X \to Y$ in ${\mathscr C}$ we have a commutative diagram: $$\newcommand{\ra}[1]{\!\!\!\!\!\!\!\xrightarrow{\quad#1\quad}\!\!\!\!\!} \newcommand{\da}[1]{\left\downarrow{\scriptstyle#1}\vphantom{\displaystyle\int_0^1}\right.} % \begin{array}{cccccccccc} {\mathscr F}(X) & \ra{{\mathscr F}(f)} & {\mathscr F}(Y) \\ \da{\eta_X} & & \da{\eta_Y} \\ {\mathscr G}(X) & \ra{{\mathscr G}(f)} & {\mathscr G}(Y) \end{array}$$ In other words, $$\eta_Y {\mathscr F}(f) = {\mathscr G}(f) \eta_X.$$

If both functors are contravariant, the horizontal arrows in this diagram are reversed.

Example. The isomorphism between a vector space $V$ and its dual $V^{*}$ is not natural (arrow are reversed) but between a vector space and its second $V^{**}$ dual is.