Diagram chasing is a method of mathematical proof used especially in homological algebra. Homological algebra studies, in particular, the homology of chain complexes in abelian categories – therefore the name. From a modern perspective, homological algebra is the study of algebraic objects, (such as groups, rings or Lie algebras, or sheaves of such objects), by ‘resolving them’, replacing them by more stable objects whose homotopy category is the derived category of an abelian category. Given a commutative diagram, a proof by diagram chasing involves the formal use of the properties of the diagram, such as injective or surjective maps, or exact sequences. A syllogism is constructed, for which the graphical display of the diagram is just a visual aid. It follows that one ends up "chasing" elements around the diagram, until the desired element or result is constructed or verified. Examples of proofs by diagram chasing include those typically given for the Snake Lemma, Four Lemma, Five Lemma, Nine Lemma, and Zig-Zag Lemma.

Definition 1 An exact sequence is a sequence, either finite or infinite, of objects and morphisms between them such that the image of one morphism equals the kernel of the next.

Definition 2 A short exact sequence is a finite sequence of objects and morphisms between them such that the image of one morphism equals the kernel of the next.

Definition 3 A long exact sequence is an infinite sequence of objects and morphisms between them such that the image of one morphism equals the kernel of the next.

Formally, an exact sequence is a sequence of maps

\displaystyle  \alpha_{i}:A_{i}\rightarrow A_{i+1}

between a sequence of spaces {A_{i},} which satisfies

\displaystyle  im(\alpha_{i})=\ker(\alpha_{i+1}),

where {im} denotes the image and {\ker} the group kernel. That is, {a\in A_{i},\alpha_{i}(a)=0} iff {a=\alpha_{i-1}(b)} for some {b\in A_{i-1}}. It follows that {\alpha_{i+1}\circ\alpha_{i}=0.} The notion of exact sequence makes sense when the spaces are groups, modules, chain complexes, or sheaves. The notation for the maps may be suppressed and the sequence written on a single line as

\displaystyle  \cdots\rightarrow A_{i-1}\rightarrow A_{i}\rightarrow A_{i+1}\rightarrow\cdots.

  1. A short exact sequence:

    \displaystyle  0\rightarrow A\rightarrow B\rightarrow C\rightarrow0.

    beginning and ending with zero, meaning the zero module {\{0\}}.

  2. A long exact sequence:

    \displaystyle  \cdots\rightarrow A\rightarrow B\rightarrow C\rightarrow\cdots.

Special information is conveyed when one of the spaces is the zero module. For instance, the sequence

\displaystyle  0\rightarrow A\rightarrow B

is exact iff the map is injective. Similarly,

\displaystyle  A\rightarrow B\rightarrow0

is exact iff the map is surjective.

In homological algebra, given a short exact sequence {0\rightarrow M'\rightarrow M\rightarrow M''\rightarrow0} of {G}-modules, there is a canonical long exact sequence

\displaystyle  0\rightarrow H^{0}(G,M')\rightarrow\cdots\rightarrow H^{i}(G,M'')\stackrel{\delta_{i}}{\rightarrow}H^{i+1}(G,M')\rightarrow \\ H^{i+1}(G,M)\rightarrow H^{i+1}(G,M'')\cdots,

where the {\delta_{i}} are certain "connecting homomorphisms" (or "snake maps"). This can be deduced from the Snake Lemma. For the proof the latter, one can engage in "diagram chasing". One can see, in the movie It’s My Turn (1980) a proof given for the Snake Lemma using diagram chasing. To define {\delta}: given {x''\in\ker(\gamma)\subseteq C}, lift {x}" to {B}, push it into {B'} by {\beta}, then check that the image has a preimage in {A'}. Then verify that the result is well-defined, et cetera.

Lemma 1 (Snake Lemma) Given the commuting diagram

in which the rows are exact, there is a canonical map {\delta:\ker(\gamma)\rightarrow coker(\alpha)}, induced by {\delta x''=f'^{-1}\circ\beta\circ g^{-1}x''} such that the sequence

\displaystyle  0\rightarrow\ker(\alpha)\rightarrow\ker(\beta)\rightarrow\ker(\gamma)\stackrel{\delta}{\rightarrow} coker(\alpha)\rightarrow coker(\beta)\rightarrow \\ coker(\gamma)\rightarrow0

is exact.

Proof: Suppose we are given a commutative diagram

with exact rows. We wish to prove that the sequence

\displaystyle  0\rightarrow\ker(\alpha)\rightarrow\ker(\beta)\rightarrow\ker(\gamma)\rightarrow coker(\alpha)\rightarrow coker(\beta)\rightarrow \\ coker(\gamma)\rightarrow0

is exact.

First we claim that if any square

is commutative, then there are well-defined morphisms {\ker(\varphi)\rightarrow\ker(\psi)} and { coker(\varphi)\rightarrow coker(\psi)}. For example, if {x\in\ker(\varphi)}, then the square

must commute, and so the image of {x} in the top row must be in {\ker(\psi)}. The proof of the claim for cokernels is similar. Thus we have two sequences,

\displaystyle  0\rightarrow\ker(\alpha)\rightarrow\ker(\beta)\rightarrow\ker(\gamma){\ and\ } coker(\alpha)\rightarrow coker(\beta)\rightarrow \\ coker(\gamma)\rightarrow0,

each of which inherits being a complex from the original diagram.

Suppose {x\in\ker(\beta)} is sent to {0\in\ker(\gamma)}. By exactness, {x} has a preimage {x'\in A}. Because the diagram

is commutative and the bottom morphism is injective, {y'=0} and so {x'\in\ker(\alpha)}. So the sequence

\displaystyle  0\rightarrow\ker(\alpha)\rightarrow\ker(\beta)\rightarrow\ker(\gamma)

is exact. The proof of the claim for the cokernel sequence is similar.

So now all we need to do is find a connecting morphism {\ker(\gamma)\rightarrow coker(\alpha)} such that the resulting sequence is exact at both of those points.

Suppose {x''\in\ker(\gamma)}. Then {x''} has at least one preimage in {B}. So let {x} and {\widehat{x}} be preimages of {x''}. Thus {\widehat{x}-x\mapsto0} and so by exactness has a preimage {x'\in A}. By commutativity of the diagram, {\beta(x)} has a preimage {y'}, which is unique by injectivity of the morphism {A'\rightarrow B'}. But we know that the square

is commutative. We wish to define {\ker(\gamma)\rightarrow coker(\alpha)} by {x''\mapsto y'+im(\alpha)}. Observe that

\displaystyle  y'+\alpha(x')\mapsto\beta(x)+\beta(\widehat{x}-x)=\beta(\widehat{x}),

and so the choice of preimage of {x''} does not affect which cokernel element we ultimately select. So now we have our connecting morphism. By applying this definition we see that

\displaystyle  \ker(\beta)\rightarrow\ker(\gamma)\rightarrow coker(\alpha)\rightarrow coker(\beta)

is a complex.

Suppose {x''\in\ker(\gamma)} is sent to {0} by the connecting morphism. Thus we have a diagram

which is commutative. Let {\widehat{x}} be the image of {x'} under the morphism {A\rightarrow B}. Exactness of the diagram implies that {x-\widehat{x}} is a preimage of {x''}. But {\beta(x-\widehat{x})=0}. So the kernel-cokernel sequence is exact at {\ker(\gamma)}. The proof that it is exact at {coker(\alpha)} is similar.