A sheaf is the best way of pack a "local" data together on a topological space. For example, a continuous function $f : X \to \mathbb R$ is determined by the restrictions $f_i : U_i \to \mathbb R$ if $\{U_i\}_{i \in I}$ is an open covering of $X$.

A motivating example : Here is an example I learned from George Elencwajg (on this website !) few years ago : let $g : U \to \mathbb C$ be an holomorphic function where $U \subset \mathbb C$ is open. If $g$ is nowhere vanishing, can we write $g = e^f$ for some holomorphic function $f : U \to \mathbb C$ ?

The answer is "no" when $U = \mathbb C^*, g = \text{id}$, else we would obtain a logarithm on $U$, which is well known not to exist.

However, if $U = \mathbb C$ the answer is yes. Locally it is clear that we can pick any logarithm on a little disk and then set $f = \text{log}(g)$. So it is a "global" problem, i.e solved by cohomology of sheaves (really, cohomology is why sheaves are useful).

I'll sketch the argument, if you are interested by more details the book by Forester introduces sheaf cohomology in a very concrete way.

Consider the sheaf $\mathcal O$ : by definition, it assign an abelian group to any open $U \subset \mathbb C$, and $\mathcal O(U)$ is the set of holomorphic function $f : U \to \Bbb C$. There is the sheaf of nowhere vanishing holomorphic function $\mathcal O^*$ and the sheaf of continuous functions $f : U \to \mathbb Z$, written $\mathbb{Z}$ also. Together we get an exact sequence of sheaves $$ 0 \to \mathbb Z \to \mathcal O \to \mathcal O^* \to 0$$

Here, an exact sequence means that there is a covering $U_i$ so that the induced sequence is exact for all $i$ :

$$ 0 \to \mathbb Z(U_i) \to \mathcal O(U_i) \to \mathcal O^*(U_i) \to 0$$

You can check that this sequence is indeed exact by taking $U_i$ a family of disks covering $\mathbb C$.

Now, an exact sequence does NOT mean that the sequence is exact when we apply it for any open $U$. This is precisely why we have no logarithm for $U = \mathbb C^*$ but we have a logarithm for $U = \mathbb C$. This is the whole point of cohomology.

So... what is sheaf cohomology ? This is a bit long to explain, so let's say that if $F$ is a sheaf of abelian groups on a space $X$, there exists abelian groups $H^k(X,F)$ for $k = 0,1, \dots$ with the following properties :

1) $H^0(X,F) = F(X)$ (after all, really this is what we are interested by) 2) for any exact sequence of sheaves $$ 0 \to F' \to F \to F'' \to 0$$ there is a "long exact sequence" $$ 0 \to H^0(X,F') \to H^0(X,F) \to H^0(F'') \to H^1(X,F') \to H^1(X,F) \to \dots $$

and other properties.

In particular, if $H^1(X,F') = 0$ then the map $H^0(X,F) \to H^0(X,F'')$ is surjective globally, but we only knew it locally ! This is a very strong statement and typical of the sheaf theory.

Back to our motivating example, by a non-trivial theorem, the group $H^1(X, \mathbb Z)$ (here $\mathbb Z$ is seen as a sheaf) is isomorphic to $H^1(X, \mathbb Z)$ (the ordinary singular cohomology group) ! In particular, since $\mathbb C$ is contractible now we see that our logarithm extends globally. On the other hand, $H^1(\mathbb C^*, \mathbb Z) \cong \mathbb Z$ so we see that the map $exp : H^0(\mathbb C^*, \mathcal O) \to H^0(\mathbb C^*, \mathcal O^*)$ has no reasons to be surjective.

A fun example : R. Penrose (yes the physicist !) proved that the impossible figures (like his famous triangle) are indeed impossible. Locally, it looks like they are possible but not globally. Once more, it looks like we might be able to prove that such figures do not exist using cohomology ... and this is indeed what he did ! For more informations, see "on the cohomology on impossible figures, Roger Penrose". (Remark : you will not see explicitely sheaf but really if you unpack his argument this is a steatement about sheaves.)


A sheaf is more like a function space, but taking topology into account to allow functions only defined on proper open subsets of the topological space.

It might help to think of the familiar example of $C(\mathbb{R})$, the space of continuous functions $f : \mathbb{R} \to \mathbb{R}$. Now, beyond this, in fact for any open subset $U$ of $\mathbb{R}$, we can form the space $C(U)$ of continuous functions $f : U \to \mathbb{R}$. Moreover, if $V \subseteq U$ with $V$ also open, then it's easy to take a continuous function $f : U \to \mathbb{R}$ and restrict it to a continuous function $f |_V : V \to \mathbb{R}$.

The observations that make this into a sheaf are then: suppose you have an open cover $\{ U_i : i \in I \}$ of $U$. Then it is almost trivial to check that if $f, g : U \to \mathbb{R}$ are two continuous functions, and for each $i$ we have $f |_{U_i} = g |_{U_i}$, then $f = g$. Moreover, if we have continuous functions $f_i : U_i \to \mathbb{R}$ which agree on overlaps, i.e. $f_i |_{U_i \cap U_j} = f_j |_{U_i \cap U_j}$, then we can construct a continuous function on the union $U$ of $U_i$ by gluing: for any $x \in U$, choose $i$ such that $x \in U_i$, and then define $f(x) = f_i(x)$. Then the overlap condition means that if multiple choices of $i$ are possible, it doesn't actually matter which $i$ we chose; and it is straightforward to check that $f$ is continuous.

This together means that we can consider $C(\mathbb{R})$ as being a sheaf on $\mathbb{R}$. Moreover, since we can add, multiply, etc. continuous functions, $C(\mathbb{R})$ in fact becomes a sheaf of rings of $\mathbb{R}$.


Going a bit further, we can give an intuition of what a "locally ringed space" means. In the case of $C(\mathbb{R})$, we can also assign to each continuous function $f : U \to \mathbb{R}$ a notion of "where $f$ is zero" in the obvious way, and this forms a relatively closed subset of $U$. Furthermore, if this zero set of $f$ is empty, that means that we can form an inverse $\frac{1}{f} : U \to \mathbb{R}$, and that is also continuous. Intuitively, the condition of a "locally ringed space" is just an encoding of the algebraic property that corresponds to this observation.


Now, the use of sheaves and locally ringed spaces in algebraic geometry intuitively is to form a space of "algebraic functions" on an algebraic variety, such that for example you can talk about the function $\frac{x-y}{x+y}$ defined on the Zariski open subset $\{ (x, y) \in \mathbb{A}^2 \mid x+y \ne 0 \}$.


A sheaf $F$ on a topological space is something that associates to every open set an object $F(U)$, e.g. an abelian group. Elements of $F(U)$ are usually called sections on U.

Furthermore,whenever you have $U \subset V$ there is an operator of restriction $| U: F(V) \to F(U)$. As the name suggests, you want that whenever $U \subset V \subset W$, if you first restrict to V and then to U you obtain the same result as if you directly restrict to U. The properties you require for operators of restriction depend on the structure on the objects you chose. For example, in case of abelian groups, they must be homorphisms.

With these data you get a presheaf. A sheaf has the additional glueing property, which is the following. Take an open $U$, and an open covering $U_{a}$ of $U$. Denote by $U_{ab}=U_a \cap U_b$. Now assign sections $s_a$ over $U_{a}$ such that $s_a | U_{ab} = s_b | U_{ab} $, i.e. they coincide on intersections. Then exist a unique $s$ over U which extends the $s_a$, i.e. $s | U_a = s_a $.

The simplest example is the following: associate to every open $U$ of a manifold, e.g. the 2-dimensional sphere, the set of $C^{\infty}$ functions from $U$ to $\mathbb{R}$. The restriction is the usual restriction, which furthermore preserve pointwise multiplication and addition. The glueing property is easily verified.

Let me now explain why you have heard of sheaves as "special functions". Indeed, suppose you want to define a "multifunction", for example $y= \pm \sqrt{1-x^2}$. It is not so comfortable to deal with them, so we make this trick.

Consider $\pi : X \times Y \to X$ which send $(x,y) \to x$. Convince yourself that assigning a function continous $f:X \to Y$ is the same as assigning a continuous section $s$ of $\pi$, i.e. $\pi s =1$.

In the example above, consider the subset $T \subset \mathbb{C} \times \mathbb{C}$ given by $T=\{x^2+y^2=1\}$ equipped with the projection $\pi$ on $x$. Now consider the sheaf $F(U) = \{s: U \to T: \pi s = 1\}$ of continous sections. You can verify the above axioms. Indeed, this sheaf has two different sections over every open set, which correspond to the choice of the sign. Thus it is in a certain sense a "multifunction".


An intuitive explanation would be as follows:

When one first discovers the concept of (co)homology, be it via De Rham cohomology or cellular/simplicial/singular homology, it is agreed from the beginning that there is a coefficient ring $R$, and the (co)homology ends up being a sequence of $R$-modules with invariance properties.

This sequence has nice properties, the modules are related to each other via cup/cap products, there is the universal coefficient theorem, Poincaré duality, which are going to be your favourite theorems in all maths for a while...

...until Poincaré duality fails! When you consider non-orientable manifolds for instance. What to do then? It turns out there is a version of Poincaré duality for non-orientable manifolds, but you have to take into account the first Stiefel-Whitney class. The idea of it is whenever the orientation is flipped along a closed curve, the flip acts on your ring of coefficients. In some sense, the coefficient ring is "alive", but in a somewhat discrete manner.

Now if you have more subtle purposes and want to capture local properties of your manifold, you may want your ring of coefficients to depend continuously on the location. This is exactly what sheaves do.