$\newcommand{\im}{\text{im}}\newcommand{\ker}{\text{ker}}\newcommand{\cok}{\text{coker}}\newcommand{\coim}{\text{coim}}$In this post, we'll generalize the notions of homology, cohomology, and exactness from contexts of differential geometry, algebra, or wherever else you've seen it to abelian categories.

## Exactness

Given some sequence of objects and morphisms

$$\ldots\to A\xrightarrow fB\xrightarrow gC\to\ldots$$

we say that the sequence is a **complex** at $B$ if $g\circ f=0$. If you come from a differential geometry context, you may be more familiar with the term *closed*. If a sequence is a complex everywhere, we call it a **chain complex**. We say that the sequence is **exact** at $B$ if $\ker g=\im f$ (more precisely, there exists a map $\im f\to B$ which is a kernel map of $g$). An exact sequence is a sequence that is exact everywhere. The following result shouldn't be surprising.

**Theorem**: If a sequence is exact at $B$, it is a complex at $B$.

**Proof**: As observed in the previous post, $f$ can be factored into a map $f^*:A\to\im f$ and a kernel map $k:\im f\to B$. So, $g\circ f=g\circ k\circ f^*$. $g\circ k=0$, so that completes the proof.

A **short exact sequence** is an exact sequence with $5$ terms, with the first and last being $0$ (essentially, replace the $\ldots$ with $0$ in the sequence above).

Basic Examples:

- The sequence

$$0\to A\xrightarrow fB$$

is exact iff $f$ is a monomorphism. In particular, if $B=0$, $A=0$. Likewise, the sequence

$$A\xrightarrow fB\to0$$

is exact iff $f$ is an epimorphism.

- A classic short exact sequence is defined for any non-trivial principal ideal $\langle k\rangle\subset R$, where $R$ is a commutative integral domain:

$$0\to R\xrightarrow{\times k}R\to R/\langle k\rangle\to0$$

We can generalize as follows: given any monomorphism $f:A\to B$ with cokernel $g:B\to C$, observe that $g$ is an epimorphism and $g\circ f=0$. Thus, the following is a short exact sequence:

$$0\to A\xrightarrow fB\xrightarrow gC\to0$$

## (Co)homology

Let's consider the following chain complex.

$$\ldots\to A\xrightarrow fB\xrightarrow gC\to\ldots$$

The **homology** of the sequence at $B$ is $\ker g/\im f$. There are several equivalent ways to characterize this (convince yourself of the equivalence of these notions via the lemmas of the *Abelian Categories* post.

- $\cok(\im f\to\ker g)$
- $\ker(\cok f\to\coim g)$
- $\im(\ker g\to \cok f)$

Thus, exactness is equivalent to the homology being trivial. We call the elements of $\ker g$ (assuming that category is concrete) **cycles** and the elements of $\im f$ **boundaries**, as the standard pedagogical example of homology is that of homology groups of simplicial complexes.

Generally, for sequences in which we are interested in homology, we index the objects decreasingly (i.e., $A_i\to A_{i-1}\to\ldots$), and define $H_i$ as the homology at $A_i$.

If the indexes are increasing, we call the homology the **cohomology**, and the cohomology at $A_i$ is denoted by $H^i$.

## Factoring long sequences

An infinite exact sequence is sometimes called a **long exact sequence** if it is infinite. Likewise, a chain complex is sometimes called long if it is infinite. Long sequences can be tough to deal with, so we try to factor long sequences into short ones.

Consider the following chain complex:

$$A^*:\qquad\ldots\xrightarrow{}A^{i-1}\xrightarrow{f^{i-1}}A^i\xrightarrow{f^i}A^{i+1}\xrightarrow{f^{i+1}}\ldots$$

We will construct short exact sequences which represent the data of the complex.

Let $k$ be the kernel of $f^i$, $f^*:A^i\to\im f^i$ the unique morphism satisfying $f^i=\im f\circ f^*$, and $g:X\to A^i$ some morphism such that $f^*\circ g=0$. Thus, $0=\im f\circ f^*\circ g=f^i\circ g$, so by kernel properties of $k$, there exists a unique $k^*$ such that $g=k\circ k^*$. Since this works for any $g$, this shows that $k$ is a kernel for $f^*$, so $\ker f^*=\ker f^i$. But, $k$ is a monomorphism, so $\im f^i=\ker f^i$. Thus, we have $\ker f^*=\im k$. These results are summarized in the diagram below:

As $k$ is monic and $f^*$ is epic, we have the following short exact sequence:

$$0\to\ker f^i\xrightarrow{k}A^i\xrightarrow{f^*}\im f^i\to0$$

This is an interesting short exact sequence, but it doesn't contain any information regarding the cocycle condition, as it only involves one morphism from the original chain complex. Let's construct another short exact sequence to encode that information.

Since $f^i\circ f^{i-1}=0$, if $k:\ker f^i\to A^i$ is the kernel of $f^i$ and $c:A^i\to\cok f^{i-1}$ is the cokernel of $f^{i-1}$, then there exists a unique $f^{i-1}_*:A^{i-1}\to\ker f^i$ and a unique $f^i_*:\cok f^{i-1}\to A^i$ such that $f^{i-1}=k\circ f^{i-1}_*$ and $f^i=f^i_*\circ c$. If $i:\im f^{i-1}\to A^i$ is the kernel of $c$ (and thus the image of $f^{i-1}$), then $f^i\circ i=f^i_*\circ c\circ i=f^i_*\circ0=0$. Thus, by the kernel properties of $k$, there exists a unique morphism $j:\im f^{i-1}\to\ker f^i$ such that $k\circ j=i$. Since $k,i$ are monic as they are kernels, so is $j$. These observations are summarized in the diagram below:

By the second basic example of a short exact sequence, the following sequence is a short exact sequence.

$$0\to\im f^{i-1}\xrightarrow j\ker f^i\to H^i(A^*)\to0$$

By duality, we also have the following short exact sequences:

$$0\to\im f^i\to A^{i+1}\to\cok f^i\to0$$$$0\to H^i(A^*)\to\cok f^{i-1}\to\im f^i\to0$$

If $A^*$ is exact at $A^i$, i.e., $H^i(A^*)=0$, then our exact sequences become$$0\to\ker f^i\to A^i\to\ker f^{i+1}\to0$$$$0\to\im f^{i-1}\xrightarrow{\text{id}}\ker f^i\to0$$The latter sequence has no content, so we are left with one short exact sequence.