Introduction
A traditional axiomatic foundation of mathematics is set theory, in which all mathematical objects are ultimately represented by sets (even functions which map between sets). More recent work in category theory allows this foundation to be generalized using toposes; each topos completely defines its own mathematical framework. The category of sets forms a familiar topos, and working within this topos is equivalent to using traditional set theoretic mathematics. But one could instead choose to work with many alternative toposes. A standard formulation of the axiom of choice makes sense in any topos, and there are toposes in which it is invalid. Constructivists will be interested to work in a topos without the law of excluded middle. If symmetry under a particular group G is of importance, one can use the topos consisting of all G-sets.
It is also possible to encode an algebraic theory, such as the theory of groups, as a topos. The individual models of the theory, i.e. the groups in our example, then correspond to functors from the encoding topos to the category of sets that respect the topos structure.
Formal definition
When used for foundational work a topos will be defined axiomatically; set theory is then treated as a special case of topos theory. Building from category theory, there are multiple equivalent definitions of a topos. The following has the virtue of being concise, if not illuminating:
A topos is a category which has the following two properties:
- All limits taken over finite index categories exist.
- Every object has a power object.
From this one can derive that
- All colimits taken over finite index categories exist.
- The category has a subobject classifier.
- Any two objects have an exponential object.
- The category is cartesian closed.
In many applications, the role of the subobject classifier is pivotal, whereas power objects are not. Thus some definitions reverse the roles of what is defined and what is derived.
Explanation
A topos as defined above can be understood as a cartesian closed category for which the notion of subobject of an object has an elementary or first-order definition. This notion, as a natural categorical abstraction of the notions of subset of a set, subgroup of a group, and more generally subalgebra of any algebraic structure, predates the notion of topos. It is definable in any category, not just toposes, in second-order language, i.e. in terms of classes of morphisms instead of individual morphisms, as follows. Given two monics m, n from respectively Y and Z to X, we say that m ≤ n when there exists a morphism p: Y → Z for which np = m, inducing a preorder on monics to X. When m ≤ n and n ≤ m we say that m and n are equivalent. The subobjects of X are the resulting equivalence classes of the monics to it.
In a topos "subobject" becomes, at least implicitly, a first-order notion, as follows.
As noted above, a topos is a category C having all finite limits and hence in particular the empty limit or final object 1. It is then natural to treat morphisms of the form x: 1 → X as elements x ∈ X. Morphisms f: X → Y thus correspond to functions mapping each element x ∈ X to the element fx ∈ Y, with application realized by composition.
One might then think to define a subobject of X as an equivalence class of monics m: X' → X having the same image or range {mx| x ∈ X' }. The catch is that two or more morphisms may correspond to the same function, that is, we cannot assume that C is concrete in the sense that the functor C(1,-): C → Set is faithful. For example the category Grph of graphs and their associated homomorphisms is a topos whose final object 1 is the graph with one vertex and one edge (a self-loop), but is not concrete because the elements 1 → G of a graph G correspond only to the self-loops and not the other edges, nor the vertices without self-loops. Whereas the second-order definition makes G and its set of self-loops (with their vertices) distinct subobjects of G (unless every edge is, and every vertex has, a self-loop), this image-based one does not. This can be addressed for the graph example and related examples via the Yoneda Lemma as described in the Examples section below, but this then ceases to be first-order. Toposes provide a more abstract, general, and first-order solution.
As noted above a topos C has a subobject classifier Ω, namely an object of C with an element t ∈ Ω, the generic subobject of C, having the property that every monic m: X' → X arises as a pullback of the generic subobject along a unique morphism f: X → Ω, as per Figure 1. Now the pullback of a monic is a monic, and all elements including t are monics since there is only one morphism to 1 from any given object, whence the pullback of t along f: X → Ω is a monic. The monics to X are therefore in bijection with the pullbacks of t along morphisms from X to Ω. The latter morphisms partition the monics into equivalence classes each determined by a morphism f: X → Ω, the characteristic morphism of that class, which we take to be the subobject of X characterized or named by f.
All this applies to any topos, whether or not concrete. In the concrete case, namely C(1,-) faithful, for example the category of sets, the situation reduces to the familiar behavior of functions. Here the monics m: X' → X are exactly the injections (one-one functions) from X' to X, and those with a given image {mx| x ∈ X' } constitute the subobject of X corresponding to the morphism f: X → Ω for which f−1(t) is that image. The monics of a subobject will in general have many domains, all of which however will be in bijection with each other.
To summarize, this first-order notion of subobject classifier implicitly defines for a topos the same equivalence relation on monics to X as had previously been defined explicitly by the second-order notion of subobject for any category. The notion of equivalence relation on a class of morphisms is itself intrinsically second-order, which the definition of topos neatly sidesteps by explicitly defining only the notion of subobject classifier Ω, leaving the notion of subobject of X as an implicit consequence characterized (and hence namable) by its associated morphism f: X → Ω.
Further examples
If C is a small category, then the functor category SetC (consisting of all covariant functors from C to sets, with natural transformations as morphisms) is a topos. For instance, the category Grph of graphs of the kind permitting multiple directed edges between two vertices is a topos. A graph consists of two sets, an edge set and a vertex set, and two functions s,t between those sets, assigning to every edge e its source s(e) and target t(e). Grph is thus equivalent to the functor category SetC, where C is the category with two objects E and V and two morphisms s,t: E → V giving respectively the source and target of each edge.
The categories of finite sets, of finite G-sets (actions of a group G on a finite set), and of finite graphs are also toposes.
The Yoneda Lemma asserts that Cop embeds in SetC as a full subcategory. In the graph example the embedding represents Cop as the subcategory of SetC whose two objects are V' as the one-vertex no-edge graph and E' as the two-vertex one-edge graph (both as functors), and whose two nonidentity morphisms are the two graph homomorphisms from V' to E' (both as natural transformations). The natural transformations from V' to an arbitrary graph (functor) G constitute the vertices of G while those from E' to G constitute its edges. Although SetC, which we can identify with Grph, is not made concrete by either V' or E' alone, the functor U: Grph → Set2 sending object G to the pair of sets (Grph(V',G), Grph(E',G)) and morphism h: G → H to the pair of functions (Grph(V',h), Grph(E',h)) is faithful. That is, a morphism of graphs can be understood as a pair of functions, one mapping the vertices and the other the edges, with application still realized as composition but now with multiple sorts of generalized elements. This shows that the traditional concept of a concrete category as one whose objects have an underlying set can be generalized to cater for a wider range of toposes by allowing an object to have multiple underlying sets, that is, to be multisorted.