\section{Category Theory}
\label{sec:Category Theory}
Before we will introduce the two categories $\Ch{\Ab}$ and $\sAb$, we will first look at some basic category theory. If one is already familier with these concepts, he or she can skip this section. We will introduce the notions of categories, functors, isomorphims, natural transformations, equivalences and adjunctions.

\subsection{Categories}
\begin{definition}
	A \emph{category} $\cat{C}$ consists of a collection \emph{objects}, and for each two objects $A$ and $B$ in $\cat{C}$ there is a set of \emph{maps}  from $A$ to $B$, notated as $\Hom{\cat{C}}{A}{B}$, such that:
	\begin{itemize}
		\item \emph{(Identity)}
			$\id_A \in \Hom{\cat{C}}{A}{A}$ for all $A$ in $\cat{C}$,
		\item \emph{(Composition)}
			for any $f \in \Hom{\cat{C}}{A}{B}$ and $g \in \Hom{\cat{C}}{B}{C}$ we have $g \circ f \in \Hom{\cat{C}}{A}{C}$,
		\item \emph{(Associativity)}
			$f \circ (g \circ h) = (f \circ g) \circ h$, and
		\item \emph{(Identity law)}
			$\id_B \circ f = f = f \circ \id_A$ for all $f \in \Hom{\cat{C}}{A}{B}$.
	\end{itemize}
\end{definition}

Note that the collection of objects may be a proper class instead of a set, however we will notate $A \in \cat{C}$ if $A$ is an object of $\cat{C}$. And instead of writing $f \in \Hom{\cat{C}}{A}{B}$, we write $f: A \to B$.

As the notation suggests maps can be thought of as functions, which is also the case in many examples.

\begin{example}
	The category $\Set$ has as its objects sets, and as maps it has ordinary functions. Of course we then have the identity function $\id_X(x) = x$ and composition as usual.
\end{example}
\begin{example}
	The category $\Ab$ has as objects abelian groups, and the maps between two objects are exactly the grouphomomorphisms. We know that the identity function is indeed a grouphomomorphism, and composing two grouphomomorpisms, gives indeed a new grouphomomorphism.
\end{example}

In fact almost any mathematical structure can be described as a category, we have: $\cat{Ring}$ for rings, $\cat{Vect}$ for $\R$-vectorspaces, $\cat{Set_{fin}}$ for finite sets, $\cat{Poset}$ for posets, etc. Of course we would also like to express relations between categories, for example every abelian group is also a set. This idea can be formulated by the notion of a functor.

\begin{definition}
	A \emph{functor} $F$ between a category $\cat{C}$ and $\cat{D}$ consists of a function $F_0$ from the objects of $\cat{C}$ to the objects of $\cat{D}$ and a function $F_1$ from maps in $\cat{C}$ to maps in $\cat{D}$, such that:
	\begin{itemize}
		\item for $f: A \to B$, we have $F_1(f): F_0(A) \to F_0(B)$,
		\item $F_1(\id_A) = \id_{F_0(A)}$ and
		\item $F_1(f \circ g) = F_1(f) \circ F_1(g)$.
	\end{itemize}
	We normally do not write the index of $F_0$ or $F_1$, instead we wrtie $F$ for both functions.
\end{definition}
\todo{CT: contravariant functor}

\begin{exlemma}
	There is a category $\cat{Cat}$ with categories as objects, and functors as maps.
\end{exlemma}
\begin{proof}
	First we define the identity functor. Let $\cat{C}$ be a category, define $\id_\cat{C}(A) = A$ for any object $A \in \cat{C}$ and $\id_\cat{C}(f) = f$ for any map $f: A \to B$ in $\cat{C}$. Cleary we have $\id_\cat{C}(f) : \id_\cat{C}(A) \to \id_\cat{C}(B)$. Also $\id_\cat{C}(\id_A) = \id_A = \id_{\id_\cat{C}(A)}$ and $\id_\cat{C}(f \circ g) = f \circ g$. So indeed $\id_\cat{C}$ is a functor.

	Given a functors $F: \cat{C} \to \cat{D}$ and $G: \cat{D} \to \cat{E}$, we can define the composition $G \circ F$ on objects as $G \circ F(A) = G(F(A))$ and on maps as $G \circ F(f) = G(F(f))$. This again is a functor $G \circ F$, we will not spell out the details.

	The remaining requirements are the associativity and identity law. We also leave these to the reader.
\end{proof}

\subsection{Isomorphisms}
Given a category $\cat{C}$ and two objects $A, B \in \cat{C}$ we would like to know when those objects are regarded as the same, according to the category. This will be the case when there is an isomorphism between the two.

\begin{definition}
	A map $f: A \to B$ in a category $\cat{C}$ is an isomorphism if there is a map $g: B \to A$ such that:
	$$ f \circ g = \id_B \text{ and } g \circ f = \id_A.$$
\end{definition}

Isomorphisms in $\Ab$ are exactly the isomorphisms which we know, ie. the grouphomomorphisms which are both injective and surjective.
For example the cyclic group $\Z_4$ and the klein four-group $V_4$ are not isomorphic in $\Ab$, but if we regard only the sets $\Z_4$ and $V_4$, then they are (because there is a bijection). So it is good to note that whether two objects are isomorphic  really depends on the category we are working in.

\todo{CT: Equivalence / natro}
\todo{CT: Adjunction}
\todo{CT: Define free abelian group}
\todo{CT: Yoneda?}
\todo{CT: Hom-functor}
