In algebraic topology, chain complex and cochain complex are algebraic means of representing the relationships between the cycles and boundaries in various dimensions of a topological space.
More generally, homological algebra includes the study of chain complexes in the abstract, without any reference to an underlying space. In this case, chain complexes are studied axiomatically as algebraic structures.
Applications of chain complexes usually define and apply their homology groups (cohomology groups for cochain complexes); in more abstract settings various equivalence relations are applied to complexes (for example starting with the chain homotopy idea). Chain complexes are easily defined in abelian categories, also.
A chain complex is a sequence of abelian groups or modules ... A2, A1, A0, A−1, A−2, ... connected by homomorphisms (called boundary operators or differentials) dn : An→An−1, such that the composition of any two consecutive maps is the zero map: dn ∘ dn+1 = 0 (i.e., (dn∘dn+1)(a)=0n−1—the identity in An−1—for all a in An+1) for all n. They are usually written out as: