In mathematics, a chain complex is a generalization of an exact sequence. In a chain complex the image of one mapping does not have to be the kernel of the next, but the image must be contained in the kernel of the next. Equivalently, composition of mappings is always the zero map.
One example of chain complexes are the simplicial complexes of algebraic topology. The n-th module is the free module whose generators are the n-dimensional simplexes. The mapping is the one sending the simplex (a, a, ..., a[n]) to the sum of (-1)i (a, ..., a[i-1], a[i+1], ..., a[n]) from i = 0 to i = n. If we take the modules to be over a field, then the dimension is the number of "holes" of that dimension.