Previously: Presheaves and Topology.
In all branches of science we sooner or later encounter the global vs. local duality. Topology is no different.
In topology we have the global definition of continuity: counter-images of all open sets are open. But we perceive a discontinuity as a local jump. How are the two pictures related, and can we express this topologically, that is without talking about sizes and distances?
All we have at our disposal are open sets, so exactly what properties of open sets are the most relevant? They do form a (thin) category with inclusions as arrows, but so does any set of subsets. As it turns out open sets can be stitched together to create coverings. Such coverings let us zoom in on finer and finer details, thus creating the bridge between the global and the local picture.
Open sets are plump–they can easily fill the bulk of space. They are also skinless, so they can’t touch each other without some overlap. That makes them perfect for constructing covers.
Covering, unlike tiling, requires overlapping. To create a leak-free roof, you need your tiles to overlap. The idea is that, if we were defining functions over a tiling, it would be possible for them to make sudden jumps at tile boundaries. Open coverings overlap, so such functions have to flow continuously.

An open cover of a set is a family of open sets
such that
is their union:
Here is a set used for indexing the family.
If we have a continuous function defined over
, then all its restrictions
are also continuous (this follows from the condition that an intersection of open sets is open). Thus going from global to local is easy.
The converse is more interesting. Suppose that we have a family of functions , one per each open set
, and we want to reconstruct the global function
defined over the set
covered by
‘s. This is only possible if the individual functions agree on overlaps.
Take two functions: defined over
, and
defined over
. If the two sets overlap, each of the functions can be restricted to the overlap
. We want these restrictions to be equal:

If all individual continuous functions agree on the overlaps then they uniquely determine a global continuous function defined over the whole set
. You can stitch or collate functions that are defined locally.
In the language of category theory we talk about functions in bulk. We define a functor–a presheaf –that maps all open sets to sets of continuous functions. In this language, to an open cover
corresponds a family of functions
that are members of the individual sets
. Every such selection forms a giant
-indexed tuple, that is an element of the cartesian product:
Similarly, we can gather functions that are defined over the intersections of sets into a product:
(Notice that every empty intersection corresponds to a single trivial function that we call absurd in Haskell.)
Set inclusions generate function restrictions. In particular, for every intersection we have a pair of restrictions:

These restrictions can be seen as functions between sets:
If all such restrictions are pairwise equal, we call a matching family, and for every such matching family there is a unique element
such that
, for all
.
These pairs of restrictions define two mappings between our big products:
Think of each function as acting on a tuple and producing a matrix indexed by elements of
:
Our matching condition can be expressed in the language of category theory by saying that the following diagram is an equalizer of and
(the two parallel arrows):
Here is defined as mapping a function
to a tuple of its restrictions
. These restrictions are then required to match when further restricted by
and
to all possible intersections.
A presheaf is called a sheaf if, for every open covering
, a matching family
uniquely determines the element of
of the equalizer above. This element corresponds to the function
that is the result of stitching of individual functions.
Notice that, even though we tried to use the categorical language as much as possible, we still had to rely on the language of sets to define coverings. To abstract away from set theory and traditional topology, we need to talk about sites.
Next: Coverages and Sites .







