In mathematics, specifically in homology theory and algebraic topology, cohomology is a general term for a sequence of abelian groups associated to a topological space, often defined from a cochain complex. Cohomology can be viewed as a method of assigning richer algebraic invariants to a space than homology. Some versions of cohomology arise by dualizing the construction of homology. In other words, cochains are functions on the group of chains in homology theory.
From its beginning in topology, this idea became a dominant method in the mathematics of the second half of the twentieth century. From the initial idea of homology as a method of constructing algebraic invariants of topological spaces, the range of applications of homology and cohomology theories has spread throughout geometry and algebra. The terminology tends to hide the fact that cohomology, a contravariant theory, is more natural than homology in many applications. At a basic level, this has to do with functions and pullbacks in geometric situations: given spaces X and Y, and some kind of function F on Y, for any mapping f : X → Y, composition with f gives rise to a function F∘f on X. The most important cohomology theories have a product, the cup product, which gives them a ring structure. Because of this feature, cohomology is usually a stronger invariant than homology.
Singular cohomology is a powerful invariant in topology, associating a graded-commutative ring to any topological space. Every continuous map f: X → Y determines a homomorphism from the cohomology ring of Y to that of X; this puts strong restrictions on the possible maps from X to Y. Unlike more subtle invariants such as homotopy groups, the cohomology ring tends to be computable in practice for spaces of interest.