Elementary Topos and Set Theory
Elementary Topos and Set Theory
1 Introduction
As the prototypical category, Set has many properties which make it special amongst
categories. From the point of view of mathematical logic, one such property is that
Set has enough structure to “properly” formalise logic. However, we could ask what it
might mean to formalise logic in another category C. The notion of an (elementary)
topos distills the essential features of Set which allow us to do this.
Throughout this report, a boldface C will denote an arbitrary category (and later, a
topos). Objects of C are denoted by uppercase letters A, B, C, . . ., and morphisms by
lowercase f, g, h, . . .. We assume familiarity with basic category theory, but let us recall
some of the important categorical notions we will need.
f
B D
f
B D
1
Calling it the pullback is justified, since pullbacks are unique up to unique isomor-
phism. A useful fact is that if f is monic, its pullback k is monic too [Mac98, Ex.
III.4.5].
For example, the empty set ∅ is initial in Set, while any singleton set {∗} is terminal.
The trivial group {0} is both initial and terminal in Grp and Ab. Definitions 1.1 and
1.3 imply any map 1 → B is monic.
2 Subobject classifiers
Henceforth, we will assume that C has all finite limits and colimits. This implies that
C has an initial object 0 and terminal object 1, since they are the colimit and limit,
respectively, of the empty diagram. For X ∈ C, X n denotes the n-fold categorical
product.
The object 2 = {0, 1} in Set plays a very special role, in that for any set X, there is
a correspondence between subsets Y ⊆ X and characteristic functions χY : X → 2. In
more general categories, this idea is captured by the notion of a subobject classifier.
χf
B Ω
This definition can be recast in a more “categorical” way, using the intuition that Ω
determines a natural isomorphism between Hom(B, Ω) and the “subobjects” of B.
Remark 2.2. For B ∈ C, its subobjects Sub(B) are the monics f : A ,→ B for some A,
modulo isomorphisms of the domain, i.e. f : A ,→ B and f 0 : A0 ,→ B are equivalent if
there is invertible g : A → A0 making the following commute:
A
f
g g −1 B
f0
A0
2
g
A B
f
A0 B0
Sf (g)
g X
f0
A0
C/X has a terminal object idX : X → X. Now, if C has subobject classifier (Ω, t),
then C/X has subobject classifier π2 : Ω × X → X, the canonical projection from the
product, with truth map t̄ = t × idX : (id : X) → (π2 : Ω × X). To see this, a map
f : (a : A) → (b : B) is monic iff f : A → B is. In C, we get χf : B → Ω; then, the
composite χf ×b
∆B
B B2 Ω×X
is the character of f in C/X, where ∆B : B → B 2 is the diagonal.
Ω should be interpreted as an object containing all possible “truth values” for the
category C—we will develop this interpretation in Section 4.
3 Topoi
We are nearly ready to give the definition of a topos. We require the extra structure of
cartesian closure, meaning for any two objects A, B ∈ C, there is an object B A which
acts like the set of functions A → B. The formal definition follows.
Definition 3.1. The exponential of two objects A, B ∈ C is an object B A and a mor-
phism ev : B A × A → B, such that for any morphism g : C × A → B, there is unique
ḡ : C → B A making the following commute:
C C ×A
ḡ ḡ×idA g
BA B A ×A ev B
3
The prototypical example is in Set: B A = {f : A → B}, with ev(f, a) = f (a). As
with Definition 2.1, this has a more categorical interpretation—a natural isomorphism
Hom(C × A, B) ∼ = Hom(C, B A ). We could alternatively define B A as a representation
of the functor Hom(−×A, B) : C → Set; ev is recovered by mapping idB A through the
associated natural isomorphism (for C = B A ). Furthermore, if A is such that B A exists
for all B, then (−)A : C → C is a right adjoint to the product functor (−)×A : C → C.
Definition 3.2. A cartesian closed category (ccc) is one with all finite products and
exponentials. A ccc+ is a ccc with all finite limits and colimits.
Definition 3.3. An (elementary) topos (plural topoi or toposes) is a ccc+ with a sub-
object classifier.
We can verify Set is a ccc+ , hence a topos. Furthermore, we saw in Example 2.3 that
whenever C has a subobject classifier, so does C/X for any object X ∈ C. Even better,
whenever C is a topos, so is C/X. This fact is sometimes called the fundamental theorem
of topoi, and apart from showing that C/X has exponentials, the proof is straightforward
[MM92, §IV.7].
There are many more examples of topoi; a particularly important one is the functor
op
category SetC for any category C, whose objects are called presheaves on C. Topoi
can also be characterised by the existence of objects PX which act like the “power set”
of an object X.
A K
r 3
χ̄r ×idX
B ×X PX ×X
As always, the motivating example is in Set, where PX is the actual power set of
X, and 3 the usual membership relation. We have written 3 backwards to match the
definition of an exponential; we now expound the connection.
Theorem 3.5. A ccc+ C has a subobject classifier if and only if C has all power objects.
4
4 The internal logic of a topos
For A ∈ C, the definition of the product A2 = A×A gives the diagonal ∆ : A → A2 as
the unique map making the following commute:
π1 π2
A A2 A
∆
idA idA
A
This extends to n-fold products in the obvious way. More generally, suppose σ =
(m1 , . . . , mn ) is an n-tuple of positive integers, with d = max{mi : i ≤ n}. The diagonal
of signature σ is the unique map ∆σ : Ad → An making the following commute for each
i ≤ n: πi
An A
∆σ
π mi
Ad
The regular diagonals ∆ : A → An have signature (1, 1, . . . , 1).
Henceforth, let C be a topos. We introduced topoi on the promise that they would
allow a good formalisation of logic. In this section, we make good on that promise, by
showing how first-order logic can be internalised in a topos. Using exponentials, topoi
can also formalise higher-order logic—for simplicity, we will not explore this here.
We assume familiarity with basic first-order model theory, as in [Mar02; CK90]. In
particular, for L a language, L-terms and L-formulae have their usual definitions.
Definition 4.1. An L-structure M in C consists of the following data:
(i) An object M ∈ C called the support or domain;
5
(i) Each variable x has interpretation xM = idM : M → M .
(iii) A function term f (t1 , . . . , tn ) has interpretation [f (t1 , . . . , tn )]M the composite
(t1 ,...,tn )M fM
Md Mn M
The point of ∆σ is to ensure that variables shared between different terms are identified
with each other. Before giving interpretations of L-formulae, we need to define Boolean
connectives in a topos, which are maps Ωn → Ω, and quantifiers, which are maps ΩM →
Ω.
t ¬
1 Ω Ω
k
t×idΩ idΩ ×t
Ω2
Then, ∨ : Ω2 → Ω is the character of im k.1
π1
(iv) → : Ω2 → Ω is the character of the equaliser of Ω2 Ω.
∧
6
Definition 4.4 Quantifiers [Gol84, p. 245]. Fix an object M ∈ C.
! t
(i) By Definition 3.1, the composite M 1 Ω corresponds to a
map ā : 1 → Ω , implicitly using the natural isomorphism 1 × M ∼
M
= M . Then,
∀M : ΩM → Ω is the character of ā.
(ii) For L-terms t1 , . . . , tn and a relation symbol R ∈ L, the formula R(t1 , · · · , tn ) has
interpretation [R(t1 , . . . , tn )]M the composite
(t1 ,...,tn )M RM
Md Mn M
(iii) For an L-formula ϕ, the formula ¬ϕ has interpretation (¬ϕ)M the composite
ϕM ¬
Mn Ω Ω
7
Mn
a1 ×···×an ϕM
1 t Ω
The usual internal logic of a topos is intuitionistic logic, where the law of excluded
middle ϕ ∨ ¬ϕ ≡ > may fail. Definition 4.6 gives some insight into why this might be
the case. Just because ϕM 6= t doesn’t necessarily mean (¬ϕ)M = t; (¬ϕ)M could be
equal to some other “truth value” 1 → Ω.
Definition 4.7. The definition of the coproduct 1+1 gives a unique map k : 1+1 → Ω
making the following commute:
i1 i2
1 1+1 1
k
t f
Ω
A topos C is Boolean or classical if k is an isomorphism.
So a Boolean topos is one where the subobject classifier Ω is essentially the coproduct
t + f. These are exactly the topoi in which the law of excluded middle always holds,
i.e. the internal logic is classical. However, it must be emphasised that this is not the
general case.
Example 4.8. The arrow category Set→ is that whose objects are functions f : A → B
(in Set), and morphisms from f : A → B to g : C → D are commutative squares:
A C
f g
B D
Set→ forms a topos whose internal logic is three-valued. The three truth values have
a natural interpretation as a time-like logic: fixing a point in time t0 , the truth values
are always true (t), always false (f), and false before t0 , true afterwards (c). The truth
tables for the Boolean connectives are as follows (the row is the first argument).
∧ t c f ∨ t c f → t c f
t t c f t t t t t t c f
c c c f c t c c c t t f
f f f f f t c f f t t t
8
5 Categorical set theory
Having formalised model theory within a topos, we now turn to set theory. The reader
may have previously heard the vague assertion that “category theory can serve as an
alternative foundation for mathematics”. Here, we give one way to make this precise.
There is a key difference between material (classical) and structural (categorical) set
theory. In material set theory, sets are defined by their elements; for example, the sets
(A × A) × A and A × (A × A), although (naturally) isomorphic, are different since they
have different elements. Structural set theory is “set theory up to isomorphism”—any
two objects with an isomorphism between them should be considered “the same”.
In this section, we will examine which axioms of ZFC are true in a topos. Indeed,
Theorem 3.5 says exactly that any topos satisfies the power set axiom. Furthermore,
[Gol84, §4.8] shows how the existence of a subobject classifier can be construed as a
comprehension principle, hence any topos satisfies the axiom of comprehension.2
So what’s missing? General topoi do not have to be extensional: two distinct mor-
phisms could act the same with regards to composition.
Definition 5.1. An element of X ∈ C is a map x : 1 → X.
Definition 5.2. A topos is well-pointed if for every f, g : A → B, whenever f x = gx for
all elements x : 1 → A, then f = g.
So, a well-pointed topos is one satisfying extensionality. We still don’t have the ax-
iom of infinity—the category of finite sets is a well-pointed topos. To amend this, we
introduce an “infinite” object which behaves like the natural numbers.
z s
Definition 5.3. A natural numbers object (NNO) is a diagram 1 N N
c v
such that for every diagram 1 A A there is a unique arrow h : N →
A making the following commute: s
N N
z
1 h h
c
v
A A
Intuitively, we should think of N as analogous to the natural numbers, z : 1 → N as
analogous to the number zero, and s : N → N as analogous to the successor function.
Then, Definition 5.3 says that, given c ∈ A and v : A → A, we can define a map h : N → A
“by recursion”, i.e. h(0) = c, h(n + 1) = v(h(n)), and this gives a unique function h.3
What about the axiom of choice? The standard formulation is that for any collection
{Ai : i ∈ I} of sets, there is a sequence (ai )i∈I with each ai ∈ Ai . But an F indexed
collection {Ai : i ∈ I} is simply a surjective function f : A → I, where A = i∈I Ai ,
and a sequence (ai )i∈I is simply a function g : I → A. The requirement that ai ∈ Ai is
equivalent to saying that f g = idI . This leads to a categorical formulation:
2
The situation with regularity is complex; [Awo14] shows that any topos can be construed both as a
model of foundation, and as a model of anti-foundation. [Bau20] gives a good explanation.
3
Definition 5.3 does not claim that all functions h : N → A are defined this way.
9
Definition 5.4. A topos C satisfies the axiom of choice if any epi f : A → I in C has
a right inverse g : I → A, i.e. f g = idI .
At this stage, we have almost all of the ZFC axioms. The first attempt to axiomatise
mathematics with category theory was Lawvere’s ETCS. In modern language, ETCS
says the category of sets is a well-pointed topos with an NNO, satisfying the axiom of
choice. This is equiconsistent with BZC (bounded Zermelo with choice), which is ZFC
without replacement, and where comprehension is restricted to formulae having bounded
quantifiers.
To get the full strength of ZFC, we need to add replacement. [McL04, §8] shows one
way to do this. The language of categories has two sorts: objects X and morphisms
f , with symbols {source, range, ◦} of the appropriate signature. Suppose R(f, X) is a
predicate definable in this logic, and A ∈ C is such that for any x : 1 → A, there is
unique (up to isomorphism) Sx ∈ C with R(x, Sx ). Then, replacement asserts that
there is g : S → A such that every Sx is obtained from x by pullback along g:
Sx S
! g
x
1 A
The replacement axiom R asserts that this is true for every such predicate R(f, X)
and object A ∈ C. [McL04] shows that ETCS+R is equivalent to ZFC.
We can also formalise additional set theory axioms (such as large cardinal axioms) in
a topos. Since every set admits a bijection to a unique cardinal, from the point of view
of structural set theory, a cardinal is just a set. For objects X, Y ∈ C, we say X ≤ Y
if there is a monic X → Y , and say X < Y if not Y ≤ X. Then, we can give the usual
definitions of uncountable sets, limit cardinals, etc. For example, here is one way to
define inaccessible cardinals in a topos.
Definition 5.5.
(i) Objects X ∈ C induce discrete categories X̄ = {x : 1 → X}. X ∈ C is regular if
for every Y < X and diagram D : Ȳ → C with colimit Z, if Dy < X for all y ∈ Ȳ ,
then Z < X.
References
[Awo14] Steve Awodey et al. Relating first-order set theories, toposes and categories of
classes. Annals of Pure and Applied Logic 165(2), pp. 428–502, 2014.
[Bau20] Andrej Bauer. Answer to “When does a topos satisfy the axiom of regularity?”
url: https://mathoverflow.net/a/375548.
[CK90] C. C. Chang and H. J. Keisler. Model Theory. Elsevier, 1990.
10
[Gok97] Dmitry Gokhman. Subobject classifier and the category of actions. url: http:
//zeta.math.utsa.edu/~gokhman/ftp/courses/notes/topos.pdf.
[Gol84] Robert Goldblatt. Topoi: The Categorial Analysis of Logic. 2nd ed. Studies in
Logic and the Foundations of Mathematics 98, Elsevier, Amsterdam, 1984.
[Lei11] Tom Leinster. An informal introduction to topos theory. Publications of the
nLab 1(1), 2011.
[Lei14] Tom Leinster. Basic Category Theory. Cambridge Studies in Advanced Math-
ematics, Cambridge University Press, Cambridge, 2014.
[Mac98] Saunders Mac Lane. Categories for the Working Mathematician. 2nd ed. Grad-
uate Texts in Mathematics 5, Springer, New York, 1998.
[Mar02] David Marker. Model Theory: An Introduction. Graduate Texts in Mathemat-
ics 217, Springer-Verlag, New York, 2002.
[McL04] Colin McLarty. Exploring categorical structuralism. Philosophia Mathematica
12(1), pp. 37–53, 2004.
[MM92] Saunders Mac Lane and Ieke Moerdijk. Sheaves in Geometry and Logic. Uni-
versitext, Springer, New York, 1992.
[nLa] The nLab. url: https://ncatlab.org.
11