snake lemma
The snake lemma is the small miracle from which long exact sequences spring. You start with a commutative diagram of two short exact sequences stacked on top of each other, joined by three vertical maps. The lemma says the kernels and cokernels of those three vertical maps assemble into one exact sequence — and crucially, a brand-new map appears, snaking diagonally from the rightmost kernel down to the leftmost cokernel, connecting two rows that had no direct link.
Precisely: given a commutative diagram with exact rows where the top row is A -> B -> C -> 0, the bottom row is 0 -> A' -> B' -> C', and the vertical maps are f : A -> A', g : B -> B', h : C -> C', there is an exact sequence ker f -> ker g -> ker h -> coker f -> coker g -> coker h. The map ker h -> coker f is the connecting homomorphism. If in addition A -> B is injective the sequence extends with 0 -> ker f on the left, and if B' -> C' is surjective it extends with coker h -> 0 on the right.
The connecting map is built by a diagram chase: lift an element of ker h to B, push it down to B', observe it lands in the image of A', and pull it back to A' modulo im f. The name comes from the S-shaped path this element traces through the diagram. Applied degreewise to a short exact sequence of complexes, the snake lemma produces exactly the connecting maps of the long exact sequence in homology.
The snake lemma holds in any abelian category, not just modules; the element-based diagram chase can be replaced by a purely arrow-theoretic argument or justified via the Freyd-Mitchell embedding theorem.