In mathematics, sheaf cohomology is the aspect of sheaf theory, concerned with sheaves of abelian groups, that applies homological algebra to make possible effective calculation of the global sections of a sheaf F. This is the main step, in numerous areas, from sheaf theory as a description of a geometric problem, to its use as a tool capable of calculating dimensions of important geometric invariants.
Its development was rapid in the years after 1950, when it was realised that sheaf cohomology was connected with more classical methods applied to the Riemann-Roch theorem, the analysis of a linear system of divisors in algebraic geometry, several complex variables, and Hodge theory. The dimensions or ranks of sheaf cohomology groups became a fresh source of geometric data, or gave rise to new interpretations of older work.
The approach of Čech cohomology 
The first version of sheaf cohomology to be defined was that based on Čech cohomology, in which the relatively small change was made of attributing to an open set U of a topological space X an abelian group F(U) that 'varies' with U, rather than an abelian group A that is fixed ahead of time. This means that cochains are easy to write down rather concretely; in fact the model applications, such as the Cousin problems on meromorphic functions, stay within fairly familiar mathematical territory. From the sheaf point of view, the Čech theory is the restriction to the theory of sheaves of locally constant functions with values in A. Within sheaf theory it is easy to see that 'twisted' versions, with local coefficients on which the fundamental group acts, are also subsumed — along with some very different sorts of more general coefficients.
One problem with that theory was that Čech cohomology itself fails to have good properties, unless X itself is well-behaved. This is not a difficulty in case X is something like a manifold; but embarrassing for applications to algebraic geometry, since the Zariski topology is in general not Hausdorff. The problem with the Čech theory manifests itself in the failure of the long exact sequence of cohomology groups associated to a short exact sequence of sheaves. This in practice is the basic method of attacking a calculation (i.e. to show how a given sheaf is involved with others in a short exact sequence, and draw consequences). The theory stood in this state of disarray only for a short while: Jean-Pierre Serre showed that the Čech theory worked, and on the other hand Alexandre Grothendieck proposed a more abstract definition that would build in the long exact sequence.
Definition by derived functors 
This functor is not an exact functor, a fact familiar in other terms from the theory of branch cuts (for example, in the case of the logarithm of a complex number: see exponential sequence). It is a left exact functor, and therefore has a sequence of right derived functors, denoted by
The existence of these derived functors is supplied by homological algebra of the abelian category of sheaves (and indeed this was a main reason to set up that theory). It depends on having injective resolutions; that is, in theory calculations can be done with injective resolutions, though in practice short and long exact sequences may be a better idea.
Because the derived functor can be computed by applying the functor to any acyclic resolution and keeping the cohomology of the complex, there are a number of other ways to compute cohomology groups. Depending on the concrete situation, fine, flasque, soft or acyclic sheaves are used to calculate concrete cohomology groups -- see injective sheaves.
Subsequently there were further technical extensions (for example in Godement's book), and areas of application. For example, sheaves were applied to transformation groups; as an inspiration to homology theory in the form of Borel-Moore homology for locally compact spaces; to representation theory in the Borel-Bott-Weil theorem; as well as becoming standard in algebraic geometry and complex manifolds.
The particular needs of étale cohomology were more about reinterpreting sheaf in sheaf cohomology, than cohomology, given that the derived functor approach applied. Flat cohomology, crystalline cohomology and successors are also applications of the basic model.
Euler characteristics 
The Euler characteristic of a sheaf is defined by
To make sense of this expression, which generalises the Euler characteristic as alternating sum of Betti numbers, two conditions must be fulfilled. Firstly the summands must be almost all zero, i.e. zero for for some . Further, rank must be some well-defined function from module theory, such as rank of an abelian group or vector space dimension, that yields finite values on the cohomology groups in question. Therefore finiteness theorems of two kinds are required.
In theories such as coherent cohomology, where such theorems exist, the value of χ(F) is typically easier to compute, from other considerations (for example the Hirzebruch-Riemann-Roch theorem or Grothendieck-Riemann-Roch theorem), than the individual ranks separately. In practice it is often H0(X,F) that is of most interest; one way to compute its rank is then by means of a vanishing theorem on the other Hi(X,F). This is a standard indirect method of sheaf theory to produce numerical results.
Relationship with singular cohomology 
Almost any reference on sheaves treats sheaf cohomology, for example:
- Griffiths, Phillip; Harris, Joseph (1994), Principles of algebraic geometry, Wiley Classics Library, New York: John Wiley & Sons, ISBN 978-0-471-05059-9, MR1288523, emphasizing the theory in the context of complex manifolds
- Hartshorne, Robin (1977), Algebraic Geometry, Berlin, New York: Springer-Verlag, ISBN 978-0-387-90244-9, OCLC 13348052, MR0463157, in the algebraic-geometric setting, i.e. referring to the Zariski topology
- Iversen, Birger (1986), Cohomology of sheaves, Universitext, Berlin, New York: Springer-Verlag, ISBN 978-3-540-16389-3, MR842190, in the topological setting
- The thread "Sheaf cohomology and injective resolutions" on MathOverflow