It’s time to understand why the category of sheaves on a topological space acts like the category of sets in the following ways:

• It has finite colimits.

• It has finite limits.

• It is cartesian closed.

• It has a subboject classifier.

We summarize these four properties by saying the category of sheaves is an **elementary topos**. (In fact it’s better, since it has *all* limits and colimits.)

As a warmup, first let’s see why that the category of *presheaves* on a topological space is an elementary topos!

It’s actually just as easy to see something more general, which will come in handy later: the category of presheaves on *any* category is an elementary topos. Remember, given a category a **presheaf** on is a functor

A **morphism of presheaves** from to another presheaf

is a natural transformation

Presheaves on and morphisms between them form a **presheaf category**, which we call

or for short.

Presheaves on a topological space are just the special case where we take to be the poset of open subsets of So if you want a ‘geometrical’ intuition for presheaves on a category, you should imagine the objects of the category as being like open sets. This will come in handy later, when we talk about *sheaves* on a category.

But there is also another important intuition regarding presheaves. This is more of an ‘algebraic’ intuition. Starting from a category and building the presheaf category

is analogous to taking a set and building the set

of all functions from to the integers. is a commutative ring if we use pointwise addition and multiplication of functions as our ring operations. is an elementary topos—but this means we should think of an elementary topos as being a bit like a commutative ring. More precisely, it’s like a ‘categorified’ commutative ring, since it’s a category rather than merely a set.

There’s a one-to-one function

sending any element of to the characteristic function of that element. Similarly, there’s a full and faithful functor

sending any object to the presheaf This is called the **Yoneda embedding**. So, presheaf categories are a trick for embedding categories into elementary topoi!

In fact presheaf categories have *all* limits and colimits, so they are better than just elementary topoi: we will someday see they are examples of ‘Grothendieck topoi’. There are also other ways in which my story just now could be polished, but it would be a bit distracting to do so. Let’s get to work and study presheaf categories!

Today I’ll just talk about colimits and limits.

** Colimits in presheaf categories **

Presheaf categories have all colimits, and these colimits can be ‘computed pointwise’. What does this mean? Colimits are a lot like addition, and taking colimits of presheaves is a lot like how we add functions from a set to We just add their values at each point.

More precisely, say we have a diagram of presheaves on This is a functor

where is any small category, the ‘shape’ of our diagram. The colimit of should be a presheaf, and I’ll call this

How do we compute it? Well, notice that is a functor from to the category of functors from to So, we can change our viewpoint and think of it as a functor

I’m using the same name for this because I’m lazy! Note that for each object we get a functor

Since has colimits, we can take the colimit of this functor and get a set

But you can check that this set depends functorially on so it defines a functor from to which is our desired functor

Of course, you also have to check that this really *is* the colimit of our diagram of presheaves on

Mac Lane and Moerdijk refer the reader to Section V.3 of *Categories for the Working Mathematician* for a proof of this result, but I think it’s better to prove it yourself. That is, it seems less painful to follow your nose and do the obvious thing at each step than to wrap your brain around someone else’s notation. I guess this is only true if you’ve go the hang of the subject, but anyway:

**Puzzle.** Show in the above situation that depends functorially on and that the resulting functor is the colimit of the diagram

By the way, I can’t resist mentioning an important fact here: the category of presheaves on is the free category with all colimits on In other words, it not only has all colimits, it’s precisely what you’d get by taking and ‘freely’ throwing in all colimits. This is why I mentioned colimits first.

This fact is analogous to the fact that when is a finite set, is the free abelian group on The fact that we don’t need a finiteness condition when working with presheaves is one of those ways in which categories are nicer than sets.

### Limits in presheaf categories

Presheaf categories also have all limits, and these too can be ‘computed pointwise’. The argument is just like that for colimits, but now we use the fact that has all limits.

**Puzzle.** Given a diagram of presheaves on

show that depends functorially on and that the resulting functor is the limit of the diagram

### The category of graphs

It helps to understand some examples of what we’re doing here, and a nice example is the category of graphs. There’s a category that has two objects and , and just two morphisms

besides the identity morphisms. A presheaf on is what category theorists call a graph.

Why? Well, say we have such a presheaf

It consists of a set called the **the set of vertices** and a set called **the set of edges**, along with two functions

assigning to each edge its **source** and **target**. This is just what category theorists call a **graph**; graph theorists might call it a ‘directed multigraph’, and some other mathematicians would call it a ‘quiver’.

We will use to mean the **category of graphs**, namely the presheaf category

Note how the ‘op’ in the definition of presheaf turned the morphisms into functions The ‘op’ is more of a nuisance than a help in this example (at least so far): we had to make and go from to precisely to counteract the effect of this ‘op’.

Since colimits and limits are computed pointwise in a presheaf category, we can compute the colimit or limit of a diagram of graphs quite easily: we just take the colimit of the sets of vertices and the sets of edges separately, and the rest goes along for the ride.

**Puzzle.** Let the graph be the **walking vertex**: that is, the graph with just one vertex and no edges. Let be the **walking edge**: that is, the graph with one edge and two vertices, the source and target of that edge. Show that there are exactly two different morphisms

Compute the equalizer and coequalizer of

**Puzzle.** Show explicitly how to build any graph as a colimit of copies of the walking vertex and the walking edge. That is, show any graph is isomorphic to the colimit of some diagram in where the objects in this diagram are all copies of and/or