on X to sheaves on Y is left exact, but in general not right exact. The higher direct image sheaves Rif*E on Y are defined as the right derived functors of the functor f*. Another description is that Rif*E is the sheaf associated to the presheaf on Y. Thus, the higher direct image sheaves describe the cohomology of inverse images of small open sets in Y, roughly speaking. The Leray spectral sequence relates cohomology on X to cohomology on Y. Namely, for any continuous map f: X → Y and any sheaf E on X, there is a spectral sequence This is a very general result. The special case where f is a fibration and E is a constant sheaf plays an important role in homotopy theory under the name of the Serre spectral sequence. In that case, the higher direct image sheaves are locally constant, with stalks the cohomology groups of the fibers F of f, and so the Serre spectral sequence can be written as for an abelian group A. A simple but useful case of the Leray spectral sequence is that for any closed subset X of a topological space Y and any sheaf E on X, writing f: X → Y for the inclusion, there is an isomorphism As a result, any question about sheaf cohomology on a closed subspace can be translated to a question about the direct image sheaf on the ambient space. Finiteness of cohomology There is a strong finiteness result on sheaf cohomology. Let X be a compact Hausdorff space, and let R be a principal ideal domain, for example a field or the ring Z of integers. Let E be a sheaf of R-modules on X, and assume that E has "locally finitely generated cohomology", meaning that for each point x in X, each integer j, and each open neighborhood U of x, there is an open neighborhood V ⊂ U of x such that the image of Hj(U,E) → Hj(V,E) is a finitely generated R-module. Then the cohomology groups Hj(X,E) are finitely generated R-modules. For example, for a compact Hausdorff space X that is locally contractible (in the weak sense discussed above), the sheaf cohomology group Hj(X,Z) is finitely generated for every integer j. One case where the finiteness result applies is that of a constructible sheaf. Let X be a topologically stratified space. In particular, X comes with a