\subsubsection{What is the Karoubi envelope?}
\newcommand{\calC}{\mathcal{C}}
\newcommand{\calO}{\mathcal{O}}
\newcommand{\calI}{\mathcal{I}}

A {\em projection} is an endomorphism $p$ satisfying $p^2=p$. In many
contexts in mathematics, if $p$ is a projection then so is $1-p$, and
together these two projections decompose space as a direct sum of the
image of $p$ with the image of $1-p$. Thus a projection often gives rise
to a decomposition of space into pieces which are hopefully simpler.

The equation $p^2=p$ makes sense for an endomorphism in an arbitrary
category, so projections make sense in an arbitrary category. And if $p$
is a projection then so is $1-p$ in an arbitrary {\em additive} category.
But in a general (additive or not) category, ``the image of $p$'' (or of
$1-p$) may or may not make sense.

The {\em Karoubi envelope}\footnote{The Karoubi envelope construction
\cite{wiki:Karoubi-Envelope} was first described in \cite{MR0166240}, a
few years before Karoubi. It has previously been used in motivic
cohomology \cite{MR2104916}, in diagrammatic representation theory, e.g.
\cite{MR1403861}, and by the first author in an application to Khovanov
homology in \cite{karoubi}. The text of this section is lifted largely
verbatim from that paper.} of a category $\calC$ is a way of adding
objects and morphisms to $\calC$ so that every projection has an image
and so that if $p:\calO\to\calO$ is a projection and $\calC$ is additive,
then (with the proper interpretation) $\calO \Iso \im p\oplus\im (1-p)$.
Thus sometimes complicated objects can be simplified in the Karoubi
envelope of $\calC$, while in $\calC$ they may be indecomposable.

Let us turn to the formal definitions.

\begin{defn}
Let $\calC$ be a category. An endomorphism $p:\calO\to\calO$ of some
object $\calO$ in $\calC$ is called {\em a projection} if $p\circ p=p$.
The Karoubi envelope $\Kar{\calC}$ of $\calC$ is the category whose
objects are ordered pairs $(\calO, p)$ where $\calO$ is an object in
$\calC$ and $p:\calO\to\calO$ is a projection. If $(\calO_1, p_1)$ and
$(\calO_2, p_2)$ are two such pairs, the set of morphisms in
$\Kar{\calC}$ from $(\calO_1, p_1)$ to $(\calO_2, p_2)$ is the collection
of all $f:\calO_1\to\calO_2$ in $\calC$ for which $f=f\circ p_1=p_2\circ
f$. An object $(\calO, p)$ in $\Kar{\calC}$ may also be denoted by $\im
p$.\footnote{If you're worried about just introducing $\im p$ as
notation, when you already know a category-theoretic definition of
`image', don't be; this \emph{is} actually an image.}
\end{defn}

The composition of morphisms in $\Kar{\calC}$ is defined in the obvious
way (by composing the corresponding $f$'s). The identity automorphism of
an object $(\calO, p)$ in $\Kar{\calC}$ is $p$ itself. It is routine to
verify that $\Kar{\calC}$ is indeed a category. There is an obvious
embedding functor $\calI:\calO\mapsto(\calO,I)$ of $\calC$ into
$\Kar{\calC}$ and quite clearly, $\Hom{\Kar{\calC}}{\calI\calO_1}{
\calI\calO_2}=\Hom{\calC}{\calO_1}{\calO_2}$ for any pair of objects
$\calO_{1,2}$ in $\calC$. Thus we will simply identify objects in $\calC$
with their image via $\calI$ in $\Kar{\calC}$.

Below we will assume that $\calC$ is an additive category and that direct
sums of objects make sense in $\calC$. As in~\cite{Bar-Natan:Cobordisms},
there is no loss of generality in making these assumptions as formal sums
of morphisms and formal direct sums of objects may always be introduced.

\begin{lem}%
Let $p:\calO\to\calO$ be an endomorphism in $\calC$.
\begin{enumerate}
  \item If $p$ is a projection then so is $1-p$.
  \item In this case, $\calO \Iso \im p\oplus\im (1-p)$ in
  $\Kar{\calC}$.
\end{enumerate}
\end{lem}
\begin{proof}
\begin{enumerate}
  \item $(1-p)^2=1-2p+p^2=1-2p+p=1-p$ (sorry for the damage to the
  rainforest).
  \item The isomorphism $\calO\to\im p\oplus\im (1-p)$ is given by
  the $1\times 2$ matrix $\begin{pmatrix}p & 1-p\end{pmatrix}$.
  Its inverse is the $2\times 1$ matrix $\begin{pmatrix}p \\
  1-p\end{pmatrix}$. \qedhere
\end{enumerate}
\end{proof}

Observe that if $p$ is a projection on $\calO$ and $p'$ is a projection
on $\calO'$, then $\Hom{}{(\calO,p)}{(\calO',p')}$ may be naturally
identified with $p' \Hom{}{\calO}{\calO'} p$. In fact, even before taking
the Karoubi envelope, $\Hom{}{\calO}{\calO'}$ can be expressed as a
direct sum of $4$ `matrix entries', each obtained by pre-composing with
$p$ or $1-p$, and post-composing with $p'$ or $1-p'$.
