One of my colleagues remarked that sets are an example of a topos; in other words that set theory can be generalized. Another of my colleagues immediately asked for another example of a topos. Here is one.
A topos is a cartesian closed category with extra structure. Consider the category Sets. A subset S ⊆ X can be described equivalently by the injection or as a characteristic function:
We can think of χS as taking values in the set of truth values, false and true, with 0 as false and 1 as true. We can also think of true as a morphism from the terminal object to the set of truth values:
We can recover S as the pullback of χS and :
And given a monomorphism , there is a unique χS such that the above square is a pullback.
A subobject classifier is a morphism such that every monomorphism is the pullback of along a unique morphism (the characteristic morphism) .
A cartesian closed category is a topos if and only if it has finite limits and a subobject classifier.
Since Sets has all finite limits, is cartesian closed and, as we have just shown, has a subobject classifier then it is a topos.
If this were the only example of a topos then topoi would not be particularly interesting which prompted my colleague’s question. Let us now come up with another example. The example is going to be the category of sheaves.
Let X be a topological space regarded as a category with a morphism from an open set V to an open set U if and only if V ⊆ U. A presheaf is a contravariant functor from this category to the category of sets, Sets.