# Five lemma

In mathematics, especially homological algebra and other applications of abelian category theory, the **five lemma** is an important and widely used lemma about commutative diagrams.
The five lemma is not only valid for abelian categories but also works in the category of groups, for example.

The five lemma can be thought of as a combination of two other theorems, the **four lemmas**, which are dual to each other.

Consider the following commutative diagram in any abelian category (such as the category of abelian groups or the category of vector spaces over a given field) or in the category of groups.

The five lemma states that, if the rows are exact, *m* and *p* are isomorphisms, *l* is an epimorphism, and *q* is a monomorphism, then *n* is also an isomorphism.

The method of proof we shall use is commonly referred to as diagram chasing.^{[1]} We shall prove the five lemma by individually proving each of the two four lemmas.

To perform diagram chasing, we assume that we are in a category of modules over some ring, so that we may speak of *elements* of the objects in the diagram and think of the morphisms of the diagram as *functions* (in fact, homomorphisms) acting on those elements.
Then a morphism is a monomorphism if and only if it is injective, and it is an epimorphism if and only if it is surjective.
Similarly, to deal with exactness, we can think of kernels and images in a function-theoretic sense.
The proof will still apply to any (small) abelian category because of Mitchell's embedding theorem, which states that any small abelian category can be represented as a category of modules over some ring.
For the category of groups, just turn all additive notation below into multiplicative notation, and note that commutativity of abelian group is never used.

So, to prove (1), assume that *m* and *p* are surjective and *q* is injective.

Then, to prove (2), assume that *m* and *p* are injective and *l* is surjective.

The five lemma is often applied to long exact sequences: when computing homology or cohomology of a given object, one typically employs a simpler subobject whose homology/cohomology is known, and arrives at a long exact sequence which involves the unknown homology groups of the original object. This alone is often not sufficient to determine the unknown homology groups, but if one can compare the original object and sub object to well-understood ones via morphisms, then a morphism between the respective long exact sequences is induced, and the five lemma can then be used to determine the unknown homology groups.