In mathematics, a sheaf (pl.: sheaves) is a tool for systematically tracking data (such as sets, abelian groups, rings) attached to the open sets of a topological space and defined locally with regard to them. For example, for each open set, the data could be the ring of continuous functions defined on that open set. Such data is well behaved in that it can be restricted to smaller open sets, and also the data assigned to an open set is equivalent to all collections of compatible data assigned to collections of smaller open sets covering the original open set (intuitively, every piece of data is the sum of its parts).
The field of mathematics that studies sheaves is called sheaf theory.
Sheaves are understood conceptually as general and abstract objects. Their correct definition is rather technical. They are specifically defined as sheaves of sets or as sheaves of rings, for example, depending on the type of data assigned to the open sets.
There are also maps (or morphisms) from one sheaf to another; sheaves (of a specific type, such as sheaves of abelian groups) with their morphisms on a fixed topological space form a category. On the other hand, to each continuous map there is associated both a direct image functor, taking sheaves and their morphisms on the domain to sheaves and morphisms on the codomain, and an inverse image functor operating in the opposite direction. These functors, and certain variants of them, are essential parts of sheaf theory.
Due to their general nature and versatility, sheaves have several applications in topology and especially in algebraic and differential geometry. First, geometric structures such as that of a differentiable manifold or a scheme can be expressed in terms of a sheaf of rings on the space. In such contexts, several geometric constructions such as vector bundles or divisors are naturally specified in terms of sheaves. Second, sheaves provide the framework for a very general cohomology theory, which encompasses also the "usual" topological cohomology theories such as singular cohomology. Especially in algebraic geometry and the theory of complex manifolds, sheaf cohomology provides a powerful link between topological and geometric properties of spaces. Sheaves also provide the basis for the theory of Dmodules, which provide applications to the theory of differential equations. In addition, generalisations of sheaves to more general settings than topological spaces, such as Grothendieck topology, have provided applications to mathematical logic and to number theory.
In many mathematical branches, several structures defined on a topological space (e.g., a differentiable manifold) can be naturally localised or restricted to open subsets : typical examples include continuous realvalued or complexvalued functions, times differentiable (realvalued or complexvalued) functions, bounded realvalued functions, vector fields, and sections of any vector bundle on the space. The ability to restrict data to smaller open subsets gives rise to the concept of presheaves. Roughly speaking, sheaves are then those presheaves, where local data can be glued to global data.
See also: Presheaf (category theory) 
Let be a topological space. A presheaf of sets on consists of the following data:
The restriction morphisms are required to satisfy two additional (functorial) properties:
Informally, the second axiom says it does not matter whether we restrict to W in one step or restrict first to V, then to W. A concise functorial reformulation of this definition is given further below.
Many examples of presheaves come from different classes of functions: to any , one can assign the set of continuous realvalued functions on . The restriction maps are then just given by restricting a continuous function on to a smaller open subset , which again is a continuous function. The two presheaf axioms are immediately checked, thereby giving an example of a presheaf. This can be extended to a sheaf of holomorphic functions and a sheaf of smooth functions .
Another common class of examples is assigning to the set of constant realvalued functions on . This presheaf is called the constant presheaf associated to and is denoted .
Given a presheaf, a natural question to ask is to what extent its sections over an open set are specified by their restrictions to open subsets of . A sheaf is a presheaf whose sections are, in a technical sense, uniquely determined by their restrictions.
Axiomatically, a sheaf is a presheaf that satisfies both of the following axioms:
In both of these axioms, the hypothesis on the open cover is equivalent to the assumption that .
The section whose existence is guaranteed by axiom 2 is called the gluing, concatenation, or collation of the sections s_{i}. By axiom 1 it is unique. Sections and satisfying the agreement precondition of axiom 2 are often called compatible; thus axioms 1 and 2 together state that any collection of pairwise compatible sections can be uniquely glued together. A separated presheaf, or monopresheaf, is a presheaf satisfying axiom 1.^{[2]}
The presheaf consisting of continuous functions mentioned above is a sheaf. This assertion reduces to checking that, given continuous functions which agree on the intersections , there is a unique continuous function whose restriction equals the . By contrast, the constant presheaf is usually not a sheaf as it fails to satisfy the locality axiom on the empty set (this is explained in more detail at constant sheaf).
Presheaves and sheaves are typically denoted by capital letters, being particularly common, presumably for the French word for sheaf, faisceau. Use of calligraphic letters such as is also common.
It can be shown that to specify a sheaf, it is enough to specify its restriction to the open sets of a basis for the topology of the underlying space. Moreover, it can also be shown that it is enough to verify the sheaf axioms above relative to the open sets of a covering. This observation is used to construct another example which is crucial in algebraic geometry, namely quasicoherent sheaves. Here the topological space in question is the spectrum of a commutative ring , whose points are the prime ideals in . The open sets form a basis for the Zariski topology on this space. Given an module , there is a sheaf, denoted by on the Spec , that satisfies
There is another characterization of sheaves that is equivalent to the previously discussed. A presheaf is a sheaf if and only if for any open and any open cover of , is the fibre product . This characterization is useful in construction of sheaves, for example, if are abelian sheaves, then the kernel of sheaves morphism is a sheaf, since projective limits commutes with projective limits. On the other hand, the cokernel is not always a sheaf because inductive limit not necessarily commutes with projective limits. One of the way to fix this is to consider Noetherian topological spaces; every open sets are compact so that the cokernel is a sheaf, since finite projective limits commutes with inductive limits.
Any continuous map of topological spaces determines a sheaf on by setting
Any such is commonly called a section of , and this example is the reason why the elements in are generally called sections. This construction is especially important when is the projection of a fiber bundle onto its base space. For example, the sheaves of smooth functions are the sheaves of sections of the trivial bundle. Another example: the sheaf of sections of
is the sheaf which assigns to any the set of branches of the complex logarithm on .
Given a point and an abelian group , the skyscraper sheaf is defined as follows: if is an open set containing , then . If does not contain , then , the trivial group. The restriction maps are either the identity on , if both open sets contain , or the zero map otherwise.
On an dimensional manifold , there are a number of important sheaves, such as the sheaf of times continuously differentiable functions (with ). Its sections on some open are the functions . For , this sheaf is called the structure sheaf and is denoted . The nonzero functions also form a sheaf, denoted . Differential forms (of degree ) also form a sheaf . In all these examples, the restriction morphisms are given by restricting functions or forms.
The assignment sending to the compactly supported functions on is not a sheaf, since there is, in general, no way to preserve this property by passing to a smaller open subset. Instead, this forms a cosheaf, a dual concept where the restriction maps go in the opposite direction than with sheaves.^{[3]} However, taking the dual of these vector spaces does give a sheaf, the sheaf of distributions.
In addition to the constant presheaf mentioned above, which is usually not a sheaf, there are further examples of presheaves that are not sheaves:
One of the historical motivations for sheaves have come from studying complex manifolds,^{[4]} complex analytic geometry,^{[5]} and scheme theory from algebraic geometry. This is because in all of the previous cases, we consider a topological space together with a structure sheaf giving it the structure of a complex manifold, complex analytic space, or scheme. This perspective of equipping a topological space with a sheaf is essential to the theory of locally ringed spaces (see below).
One of the main historical motivations for introducing sheaves was constructing a device which keeps track of holomorphic functions on complex manifolds. For example, on a compact complex manifold (like complex projective space or the vanishing locus in projective space of a homogeneous polynomial), the only holomorphic functions
are the constant functions.^{[6]}^{[7]} This means there exist two compact complex manifolds which are not isomorphic, but nevertheless their ring of global holomorphic functions, denoted , are isomorphic. Contrast this with smooth manifolds where every manifold can be embedded inside some , hence its ring of smooth functions comes from restricting the smooth functions from . Another complexity when considering the ring of holomorphic functions on a complex manifold is given a small enough open set , the holomorphic functions will be isomorphic to . Sheaves are a direct tool for dealing with this complexity since they make it possible to keep track of the holomorphic structure on the underlying topological space of on arbitrary open subsets . This means as becomes more complex topologically, the ring can be expressed from gluing the . Note that sometimes this sheaf is denoted or just , or even when we want to emphasize the space the structure sheaf is associated to.
Another common example of sheaves can be constructed by considering a complex submanifold . There is an associated sheaf which takes an open subset and gives the ring of holomorphic functions on . This kind of formalism was found to be extremely powerful and motivates a lot of homological algebra such as sheaf cohomology since an intersection theory can be built using these kinds of sheaves from the Serre intersection formula.
Morphisms of sheaves are, roughly speaking, analogous to functions between them. In contrast to a function between sets, which is simply an assignment of outputs to inputs, morphisms of sheaves are also required to be compatible with the localglobal structures of the underlying sheaves. This idea is made precise in the following definition.
Let and be two sheaves of sets (resp. abelian groups, rings, etc.) on . A morphism consists of a morphism of sets (resp. abelian groups, rings, etc.) for each open set of , subject to the condition that this morphism is compatible with restrictions. In other words, for every open subset of an open set , the following diagram is commutative.
For example, taking the derivative gives a morphism of sheaves on : Indeed, given an (times continuously differentiable) function (with in open), the restriction (to a smaller open subset ) of its derivative equals the derivative of .
With this notion of morphism, sheaves of sets (resp. abelian groups, rings, etc.) on a fixed topological space form a category. The general categorical notions of mono, epi and isomorphisms can therefore be applied to sheaves.
A morphism of sheaves on is an isomorphism (resp. monomorphism) if and only if there exists an open cover of such that are isomorphisms (resp. injective morphisms) of sets (resp. abelian groups, rings, etc.) for all . These statements give examples of how to work with sheaves using local information, but it's important to note that we cannot check if a morphism of sheaves is an epimorphism in the same manner. Indeed the statement that maps on the level of open sets are not always surjective for epimorphisms of sheaves is equivalent to nonexactness of the global sections functor — or equivalently, to nontriviality of sheaf cohomology.
Main article: Stalk (sheaf) 
The stalk of a sheaf captures the properties of a sheaf "around" a point , generalizing the germs of functions. Here, "around" means that, conceptually speaking, one looks at smaller and smaller neighborhoods of the point. Of course, no single neighborhood will be small enough, which requires considering a limit of some sort. More precisely, the stalk is defined by
the direct limit being over all open subsets of containing the given point . In other words, an element of the stalk is given by a section over some open neighborhood of , and two such sections are considered equivalent if their restrictions agree on a smaller neighborhood.
The natural morphism takes a section in to its germ at . This generalises the usual definition of a germ.
In many situations, knowing the stalks of a sheaf is enough to control the sheaf itself. For example, whether or not a morphism of sheaves is a monomorphism, epimorphism, or isomorphism can be tested on the stalks. In this sense, a sheaf is determined by its stalks, which are a local data. By contrast, the global information present in a sheaf, i.e., the global sections, i.e., the sections on the whole space , typically carry less information. For example, for a compact complex manifold , the global sections of the sheaf of holomorphic functions are just , since any holomorphic function
is constant by Liouville's theorem.^{[6]}
It is frequently useful to take the data contained in a presheaf and to express it as a sheaf. It turns out that there is a best possible way to do this. It takes a presheaf and produces a new sheaf called the sheafification or sheaf associated to the presheaf . For example, the sheafification of the constant presheaf (see above) is called the constant sheaf. Despite its name, its sections are locally constant functions.
The sheaf can be constructed using the étalé space of , namely as the sheaf of sections of the map
Another construction of the sheaf proceeds by means of a functor from presheaves to presheaves that gradually improves the properties of a presheaf: for any presheaf , is a separated presheaf, and for any separated presheaf , is a sheaf. The associated sheaf is given by .^{[8]}
The idea that the sheaf is the best possible approximation to by a sheaf is made precise using the following universal property: there is a natural morphism of presheaves so that for any sheaf and any morphism of presheaves , there is a unique morphism of sheaves such that . In fact is the left adjoint functor to the inclusion functor (or forgetful functor) from the category of sheaves to the category of presheaves, and is the unit of the adjunction. In this way, the category of sheaves turns into a Giraud subcategory of presheaves. This categorical situation is the reason why the sheafification functor appears in constructing cokernels of sheaf morphisms or tensor products of sheaves, but not for kernels, say.
If is a subsheaf of a sheaf of abelian groups, then the quotient sheaf is the sheaf associated to the presheaf ; in other words, the quotient sheaf fits into an exact sequence of sheaves of abelian groups;
(this is also called a sheaf extension.)
Let be sheaves of abelian groups. The set of morphisms of sheaves from to forms an abelian group (by the abelian group structure of ). The sheaf hom of and , denoted by,
is the sheaf of abelian groups where is the sheaf on given by (note sheafification is not needed here). The direct sum of and is the sheaf given by , and the tensor product of and is the sheaf associated to the presheaf .
All of these operations extend to sheaves of modules over a sheaf of rings ; the above is the special case when is the constant sheaf .
Main article: Image functors for sheaves 
Since the data of a (pre)sheaf depends on the open subsets of the base space, sheaves on different topological spaces are unrelated to each other in the sense that there are no morphisms between them. However, given a continuous map between two topological spaces, pushforward and pullback relate sheaves on to those on and vice versa.
The pushforward (also known as direct image) of a sheaf on is the sheaf defined by
Here is an open subset of , so that its preimage is open in by the continuity of . This construction recovers the skyscraper sheaf mentioned above:
where is the inclusion, and is regarded as a sheaf on the singleton (by .
For a map between locally compact spaces, the direct image with compact support is a subsheaf of the direct image.^{[9]} By definition, consists of those whose support is proper map over . If is proper itself, then , but in general they disagree.
The pullback or inverse image goes the other way: it produces a sheaf on , denoted out of a sheaf on . If is the inclusion of an open subset, then the inverse image is just a restriction, i.e., it is given by for an open in . A sheaf (on some space ) is called locally constant if by some open subsets such that the restriction of to all these open subsets is constant. On a wide range of topological spaces , such sheaves are equivalent to representations of the fundamental group .
For general maps , the definition of is more involved; it is detailed at inverse image functor. The stalk is an essential special case of the pullback in view of a natural identification, where is as above:
More generally, stalks satisfy .
For the inclusion of an open subset, the extension by zero of a sheaf of abelian groups on is defined as
For a sheaf on , this construction is in a sense complementary to , where is the inclusion of the complement of :
These functors are therefore useful in reducing sheaftheoretic questions on to ones on the strata of a stratification, i.e., a decomposition of into smaller, locally closed subsets.
In addition to (pre)sheaves as introduced above, where is merely a set, it is in many cases important to keep track of additional structure on these sections. For example, the sections of the sheaf of continuous functions naturally form a real vector space, and restriction is a linear map between these vector spaces.
Presheaves with values in an arbitrary category are defined by first considering the category of open sets on to be the posetal category whose objects are the open sets of and whose morphisms are inclusions. Then a valued presheaf on is the same as a contravariant functor from to . Morphisms in this category of functors, also known as natural transformations, are the same as the morphisms defined above, as can be seen by unraveling the definitions.
If the target category admits all limits, a valued presheaf is a sheaf if the following diagram is an equalizer for every open cover of any open set :
Here the first map is the product of the restriction maps
and the pair of arrows the products of the two sets of restrictions
and
If is an abelian category, this condition can also be rephrased by requiring that there is an exact sequence
A particular case of this sheaf condition occurs for being the empty set, and the index set also being empty. In this case, the sheaf condition requires to be the terminal object in .
Main articles: Ringed space and Sheaf of modules 
In several geometrical disciplines, including algebraic geometry and differential geometry, the spaces come along with a natural sheaf of rings, often called the structure sheaf and denoted by . Such a pair is called a ringed space. Many types of spaces can be defined as certain types of ringed spaces. Commonly, all the stalks of the structure sheaf are local rings, in which case the pair is called a locally ringed space.
For example, an dimensional manifold is a locally ringed space whose structure sheaf consists of functions on the open subsets of . The property of being a locally ringed space translates into the fact that such a function, which is nonzero at a point , is also nonzero on a sufficiently small open neighborhood of . Some authors actually define real (or complex) manifolds to be locally ringed spaces that are locally isomorphic to the pair consisting of an open subset of (resp. ) together with the sheaf of (resp. holomorphic) functions.^{[10]} Similarly, schemes, the foundational notion of spaces in algebraic geometry, are locally ringed spaces that are locally isomorphic to the spectrum of a ring.
Given a ringed space, a sheaf of modules is a sheaf such that on every open set of , is an module and for every inclusion of open sets , the restriction map is compatible with the restriction map : the restriction of fs is the restriction of times that of for any in and in .
Most important geometric objects are sheaves of modules. For example, there is a onetoone correspondence between vector bundles and locally free sheaves of modules. This paradigm applies to real vector bundles, complex vector bundles, or vector bundles in algebraic geometry (where consists of smooth functions, holomorphic functions, or regular functions, respectively). Sheaves of solutions to differential equations are modules, that is, modules over the sheaf of differential operators. On any topological space, modules over the constant sheaf are the same as sheaves of abelian groups in the sense above.
There is a different inverse image functor for sheaves of modules over sheaves of rings. This functor is usually denoted and it is distinct from . See inverse image functor.
Finiteness conditions for module over commutative rings give rise to similar finiteness conditions for sheaves of modules: is called finitely generated (resp. finitely presented) if, for every point of , there exists an open neighborhood of , a natural number (possibly depending on ), and a surjective morphism of sheaves (respectively, in addition a natural number , and an exact sequence .) Paralleling the notion of a coherent module, is called a coherent sheaf if it is of finite type and if, for every open set and every morphism of sheaves (not necessarily surjective), the kernel of is of finite type. is coherent if it is coherent as a module over itself. Like for modules, coherence is in general a strictly stronger condition than finite presentation. The Oka coherence theorem states that the sheaf of holomorphic functions on a complex manifold is coherent.
In the examples above it was noted that some sheaves occur naturally as sheaves of sections. In fact, all sheaves of sets can be represented as sheaves of sections of a topological space called the étalé space, from the French word étalé [etale], meaning roughly "spread out". If is a sheaf over , then the étalé space (sometimes called the étale space) of is a topological space together with a local homeomorphism such that the sheaf of sections of is . The space is usually very strange, and even if the sheaf arises from a natural topological situation, may not have any clear topological interpretation. For example, if is the sheaf of sections of a continuous function , then if and only if is a local homeomorphism.
The étalé space is constructed from the stalks of over . As a set, it is their disjoint union and is the obvious map that takes the value on the stalk of over . The topology of is defined as follows. For each element and each , we get a germ of at , denoted or . These germs determine points of . For any and , the union of these points (for all ) is declared to be open in . Notice that each stalk has the discrete topology as subspace topology. Two morphisms between sheaves determine a continuous map of the corresponding étalé spaces that is compatible with the projection maps (in the sense that every germ is mapped to a germ over the same point). This makes the construction into a functor.
The construction above determines an equivalence of categories between the category of sheaves of sets on and the category of étalé spaces over . The construction of an étalé space can also be applied to a presheaf, in which case the sheaf of sections of the étalé space recovers the sheaf associated to the given presheaf.
This construction makes all sheaves into representable functors on certain categories of topological spaces. As above, let be a sheaf on , let be its étalé space, and let be the natural projection. Consider the overcategory of topological spaces over , that is, the category of topological spaces together with fixed continuous maps to . Every object of this category is a continuous map , and a morphism from to is a continuous map that commutes with the two maps to . There is a functor
sending an object to . For example, if is the inclusion of an open subset, then
and for the inclusion of a point , then
is the stalk of at . There is a natural isomorphism
,
which shows that (for the étalé space) represents the functor .
is constructed so that the projection map is a covering map. In algebraic geometry, the natural analog of a covering map is called an étale morphism. Despite its similarity to "étalé", the word étale [etal] has a different meaning in French. It is possible to turn into a scheme and into a morphism of schemes in such a way that retains the same universal property, but is not in general an étale morphism because it is not quasifinite. It is, however, formally étale.
The definition of sheaves by étalé spaces is older than the definition given earlier in the article. It is still common in some areas of mathematics such as mathematical analysis.
Main article: Sheaf cohomology 
In contexts where the open set is fixed, and the sheaf is regarded as a variable, the set is also often denoted
As was noted above, this functor does not preserve epimorphisms. Instead, an epimorphism of sheaves is a map with the following property: for any section there is a covering where
of open subsets, such that the restriction are in the image of . However, itself need not be in the image of . A concrete example of this phenomenon is the exponential map
between the sheaf of holomorphic functions and nonzero holomorphic functions. This map is an epimorphism, which amounts to saying that any nonzero holomorphic function (on some open subset in , say), admits a complex logarithm locally, i.e., after restricting to appropriate open subsets. However, need not have a logarithm globally.
Sheaf cohomology captures this phenomenon. More precisely, for an exact sequence of sheaves of abelian groups
(i.e., an epimorphism whose kernel is ), there is a long exact sequence
There are several different ways of constructing sheaf cohomology. Grothendieck (1957) introduced them by defining sheaf cohomology as the derived functor of . This method is theoretically satisfactory, but, being based on injective resolutions, of little use in concrete computations. Godement resolutions are another general, but practically inaccessible approach.
Especially in the context of sheaves on manifolds, sheaf cohomology can often be computed using resolutions by soft sheaves, fine sheaves, and flabby sheaves (also known as flasque sheaves from the French flasque meaning flabby). For example, a partition of unity argument shows that the sheaf of smooth functions on a manifold is soft. The higher cohomology groups for vanish for soft sheaves, which gives a way of computing cohomology of other sheaves. For example, the de Rham complex is a resolution of the constant sheaf on any smooth manifold, so the sheaf cohomology of is equal to its de Rham cohomology.
A different approach is by Čech cohomology. Čech cohomology was the first cohomology theory developed for sheaves and it is wellsuited to concrete calculations, such as computing the coherent sheaf cohomology of complex projective space .^{[11]} It relates sections on open subsets of the space to cohomology classes on the space. In most cases, Čech cohomology computes the same cohomology groups as the derived functor cohomology. However, for some pathological spaces, Čech cohomology will give the correct but incorrect higher cohomology groups. To get around this, JeanLouis Verdier developed hypercoverings. Hypercoverings not only give the correct higher cohomology groups but also allow the open subsets mentioned above to be replaced by certain morphisms from another space. This flexibility is necessary in some applications, such as the construction of Pierre Deligne's mixed Hodge structures.
Many other coherent sheaf cohomology groups are found using an embedding of a space into a space with known cohomology, such as , or some weighted projective space. In this way, the known sheaf cohomology groups on these ambient spaces can be related to the sheaves , giving . For example, computing the coherent sheaf cohomology of projective plane curves is easily found. One big theorem in this space is the Hodge decomposition found using a spectral sequence associated to sheaf cohomology groups, proved by Deligne.^{[12]}^{[13]} Essentially, the page with terms
the sheaf cohomology of a smooth projective variety , degenerates, meaning . This gives the canonical Hodge structure on the cohomology groups . It was later found these cohomology groups can be easily explicitly computed using Griffiths residues. See Jacobian ideal. These kinds of theorems lead to one of the deepest theorems about the cohomology of algebraic varieties, the decomposition theorem, paving the path for Mixed Hodge modules.
Another clean approach to the computation of some cohomology groups is the Borel–Bott–Weil theorem, which identifies the cohomology groups of some line bundles on flag manifolds with irreducible representations of Lie groups. This theorem can be used, for example, to easily compute the cohomology groups of all line bundles on projective space and grassmann manifolds.
In many cases there is a duality theory for sheaves that generalizes Poincaré duality. See Grothendieck duality and Verdier duality.
The derived category of the category of sheaves of, say, abelian groups on some space X, denoted here as , is the conceptual haven for sheaf cohomology, by virtue of the following relation:
The adjunction between , which is the left adjoint of (already on the level of sheaves of abelian groups) gives rise to an adjunction
where is the derived functor. This latter functor encompasses the notion of sheaf cohomology since for .
Image functors for sheaves 

direct image f_{∗} 
inverse image f^{∗} 
direct image with compact support f_{!} 
exceptional inverse image Rf^{!} 

Base change theorems 
Like , the direct image with compact support can also be derived. By virtue of the following isomorphism parametrizes the cohomology with compact support of the fibers of :
This isomorphism is an example of a base change theorem. There is another adjunction
Unlike all the functors considered above, the twisted (or exceptional) inverse image functor is in general only defined on the level of derived categories, i.e., the functor is not obtained as the derived functor of some functor between abelian categories. If and X is a smooth orientable manifold of dimension n, then
This computation, and the compatibility of the functors with duality (see Verdier duality) can be used to obtain a highbrow explanation of Poincaré duality. In the context of quasicoherent sheaves on schemes, there is a similar duality known as coherent duality.
Perverse sheaves are certain objects in , i.e., complexes of sheaves (but not in general sheaves proper). They are an important tool to study the geometry of singularities.^{[16]}
Another important application of derived categories of sheaves is with the derived category of coherent sheaves on a scheme denoted . This was used by Grothendieck in his development of intersection theory^{[17]} using derived categories and Ktheory, that the intersection product of subschemes is represented in Ktheory as
where are coherent sheaves defined by the modules given by their structure sheaves.
Main articles: Grothendieck topology and Topos 
André Weil's Weil conjectures stated that there was a cohomology theory for algebraic varieties over finite fields that would give an analogue of the Riemann hypothesis. The cohomology of a complex manifold can be defined as the sheaf cohomology of the locally constant sheaf in the Euclidean topology, which suggests defining a Weil cohomology theory in positive characteristic as the sheaf cohomology of a constant sheaf. But the only classical topology on such a variety is the Zariski topology, and the Zariski topology has very few open sets, so few that the cohomology of any Zariskiconstant sheaf on an irreducible variety vanishes (except in degree zero). Alexandre Grothendieck solved this problem by introducing Grothendieck topologies, which axiomatize the notion of covering. Grothendieck's insight was that the definition of a sheaf depends only on the open sets of a topological space, not on the individual points. Once he had axiomatized the notion of covering, open sets could be replaced by other objects. A presheaf takes each one of these objects to data, just as before, and a sheaf is a presheaf that satisfies the gluing axiom with respect to our new notion of covering. This allowed Grothendieck to define étale cohomology and ℓadic cohomology, which eventually were used to prove the Weil conjectures.
A category with a Grothendieck topology is called a site. A category of sheaves on a site is called a topos or a Grothendieck topos. The notion of a topos was later abstracted by William Lawvere and Miles Tierney to define an elementary topos, which has connections to mathematical logic.
The first origins of sheaf theory are hard to pin down – they may be coextensive with the idea of analytic continuation^{[clarification needed]}. It took about 15 years for a recognisable, freestanding theory of sheaves to emerge from the foundational work on cohomology.
At this point sheaves had become a mainstream part of mathematics, with use by no means restricted to algebraic topology. It was later discovered that the logic in categories of sheaves is intuitionistic logic (this observation is now often referred to as Kripke–Joyal semantics, but probably should be attributed to a number of authors).