In mathematics, specifically in homology theory and algebraic topology, cohomology is a general term for a sequence of abelian groups defined from a co-chain complex. That is, cohomology is defined as the abstract study of cochains, cocycles, and coboundaries. Cohomology can be viewed as a method of assigning algebraic invariants to a topological space that has a more refined algebraic structure than does homology. Cohomology arises from the algebraic dualization of the construction of homology. In less abstract language, cochains in the fundamental sense should assign 'quantities' to the chains of 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 topologically invariant relation on chains, the range of applications of homology and cohomology theories has spread out over geometry and abstract algebra. The terminology tends to mask the fact that in many applications cohomology, a contravariant theory, is more natural than homology. 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 ƒ: X → Y composition with ƒ gives rise to a function F o ƒ on X. Cohomology groups often also have a natural product, the cup product, which gives them a ring structure. Because of this feature, cohomology is a stronger invariant than homology, as it can differentiate between certain algebraic objects that homology cannot.