The Riemann–Roch theorem is an important theorem in mathematics, specifically in complex analysis and algebraic geometry, for the computation of the dimension of the space of meromorphic functions with prescribed zeros and allowed poles. It relates the complex analysis of a connected compact Riemann surface with the surface's purely topological genus g, in a way that can be carried over into purely algebraic settings. Initially proved as Riemann's inequality by , the theorem reached its definitive form for Riemann surfaces after work of Riemann's short-lived student . It was later generalized to algebraic curves, to higher-dimensional varieties and beyond. Preliminary notions A Riemann surface is a topological space that is locally homeomorphic to an open subset of , the set of complex numbers. In addition, the transition maps between these open subsets are required to be holomorphic. The latter condition allows one to transfer the notions and methods of complex analysis dealing with holomorphic and meromorphic functions on to the surface . For the purposes of the Riemann–Roch theorem, the surface is always assumed to be compact. Colloquially speaking, the genus of a Riemann surface is its number of handles; for example the genus of the Riemann surface shown at the right is three. More precisely, the genus is defined as half of the first Betti number, i.e., half of the -dimension of the first singular homology group with complex coefficients. The genus classifies compact Riemann surfaces up to homeomorphism, i.e., two such surfaces are homeomorphic if and only if their genus is the same. Therefore, the genus is an important topological invariant of a Riemann surface. On the other hand, Hodge theory shows that the genus coincides with the -dimension of the space of holomorphic one-forms on , so the genus also encodes complex-analytic information about the Riemann surface. A divisor is an element of the free abelian group on the points of the surface. Equivalently, a divisor is a finite linear combination of points of the surface with integer coefficients. Any meromorphic function gives rise to a divisor denoted defined as where is the set of all zeroes and poles of , and is given by The set is known to be finite; this is a consequence of being compact and the fact that the zeros of a (non-zero) holomorphic function do not have an accumulation point. Therefore, is well-defined. Any divisor of this form is called a