Snake lemma: Let RR be a ring, and suppose a commutative diagram of RR-modules has rows

Commutative diagram0 \arrow[r] & A' \arrow[r, "i"] \arrow[d, "f'"] & A \arrow[r, "p"] \arrow[d, "f"] & A'' \arrow[r] \arrow[d, "f''"] & 0 \\ 0 \arrow[r] & B' \arrow[r, "j"] & B \arrow[r, "q"] & B'' \arrow[r] & 0

Then there is a homomorphism δ:ker⁡(f′′)→coker⁡(f′)\delta:\ker(f'')\to\operatorname{coker}(f'), the connecting homomorphism, such that the sequence

0→ker⁡(f′)→ker⁡(f)→ker⁡(f′′)→ δ coker⁡(f′)→coker⁡(f)→coker⁡(f′′)→00 \to \ker(f') \to \ker(f) \to \ker(f'') \xrightarrow{\ \delta\ } \operatorname{coker}(f') \to \operatorname{coker}(f) \to \operatorname{coker}(f'') \to 0

is exact. The maps other than δ\delta are induced by i,p,j,qi,p,j,q, and coker⁡(f′)=B′/im⁡(f′)\operatorname{coker}(f')=B'/\operatorname{im}(f') is the .

The name comes from the picture: the kernels sit above the rows, the cokernels below, and δ\delta snakes from ker⁡(f′′)\ker(f'') down to coker⁡(f′)\operatorname{coker}(f'):

Commutative diagram\begin{tikzcd} 0 \arrow[r] & \ker f' \arrow[r] \arrow[d] & \ker f \arrow[r] \arrow[d] & \ker f'' \arrow[d] \arrow[dddll, "\delta" description, rounded corners, to path={ -- ([xshift=2ex]\tikztostart.east) |- ($(\tikztostart)!0.5!(\tikztotarget)$) [near end]\tikztonodes -| ([xshift=-2ex]\tikztotarget.west) -- (\tikztotarget)}] & \\ 0 \arrow[r] & A' \arrow[r, "i"] \arrow[d, "f'" near start] & A \arrow[r, "p"] \arrow[d, "f" near start] & A'' \arrow[r] \arrow[d, "f''" near start] & 0 \\[1.2em] 0 \arrow[r] & B' \arrow[r, "j"] \arrow[d] & B \arrow[r, "q"] \arrow[d] & B'' \arrow[r] \arrow[d] & 0 \\ & \operatorname{coker} f' \arrow[r] & \operatorname{coker} f \arrow[r] & \operatorname{coker} f'' \arrow[r] & 0 \end{tikzcd}

The same statement holds in any , with and taken in the categorical sense.

Construction of the connecting homomorphism

Given x∈ker⁡(f′′)⊆A′′x\in \ker(f'')\subseteq A'':

  1. pick a∈Aa\in A with p(a)=xp(a)=x;
  2. since f′′(x)=0f''(x)=0, commutativity implies q(f(a))=0q(f(a))=0, hence f(a)∈im⁡(j)f(a)\in \operatorname{im}(j);
  3. choose b′∈B′b'\in B' with j(b′)=f(a)j(b')=f(a);
  4. define δ(x)\delta(x) to be the class of b′b' in coker⁡(f′)=B′/im⁡(f′)\operatorname{coker}(f')=B'/\operatorname{im}(f').

A standard diagram chase shows this is well-defined (independent of choices) and gives exactness.

The map δ\delta is natural in the diagram, and it is the prototype for the appearing in long exact sequences.

Examples
  1. Induced map on quotients: the “kernel–cokernel” exact sequence. Let g:M→M′g:M\to M' be an RR-linear map, and let N⊆MN\subseteq M, N′⊆M′N'\subseteq M' satisfy g(N)⊆N′g(N)\subseteq N'. Consider the commutative diagram with exact rows:
    0→N→M→M/N→0↓g∣N↓g↓g‾0→N′→M′→M′/N′→0\begin{array}{ccccccccc} 0 &\to& N &\to& M &\to& M/N &\to& 0\\ & & \downarrow g|_N & & \downarrow g & & \downarrow \overline g & & \\ 0 &\to& N' &\to& M' &\to& M'/N' &\to& 0 \end{array}
    The snake lemma produces the exact sequence
    0→ker⁡(g∣N)→ker⁡(g)→ker⁡(g‾)→δcoker⁡(g∣N)→coker⁡(g)→coker⁡(g‾)→0,0\to \ker(g|_N)\to \ker(g)\to \ker(\overline g)\xrightarrow{\delta} \operatorname{coker}(g|_N)\to \operatorname{coker}(g)\to \operatorname{coker}(\overline g)\to 0,
    which cleanly measures how kernels/cokernels change when passing to quotients.
  1. Boundary map in homology from a short exact sequence of complexes. Given a degreewise short exact sequence of
    0→C∙′→C∙→C∙′′→0,0\to C'_\bullet \to C_\bullet \to C''_\bullet \to 0,
    one applies the snake lemma to the diagram of cycles and boundaries in each degree to construct the connecting map
    ∂:Hn(C∙′′)⟶Hn−1(C∙′),\partial: H_n(C''_\bullet)\longrightarrow H_{n-1}(C'_\bullet),
    yielding the usual long exact sequence in . (This is the chain-complex analogue of .)
  1. Computing a boundary map concretely (multiplication on a quotient). Fix integers m,nm,n and consider the diagram
    0→Z→⋅mZ→Z/m→0↓⋅n↓⋅n↓⋅n0→Z→⋅mZ→Z/m→0\begin{array}{ccccccccc} 0&\to& \mathbb Z &\xrightarrow{\cdot m}& \mathbb Z &\to& \mathbb Z/m &\to& 0\\ && \downarrow \cdot n && \downarrow \cdot n && \downarrow \cdot n &&\\ 0&\to& \mathbb Z &\xrightarrow{\cdot m}& \mathbb Z &\to& \mathbb Z/m &\to& 0 \end{array}
    The connecting map δ:ker⁡(⋅n:Z/m→Z/m)→coker⁡(⋅n:Z→Z)≅Z/n\delta:\ker(\cdot n:\mathbb Z/m\to \mathbb Z/m)\to \operatorname{coker}(\cdot n:\mathbb Z\to \mathbb Z)\cong \mathbb Z/n sends a class x‾∈Z/m\overline{x}\in\mathbb Z/m with nx∈mZnx\in m\mathbb Z to the class of nxm\frac{nx}{m} in Z/n\mathbb Z/n. This is a concrete instance of how δ\delta encodes the failure of lifting across the diagram.