natural numbers object

Natural numbers object


Recall that a topos is a category that behaves likes the category Set of sets.

A natural numbers object (NNO) in a topos is an object that behaves in that topos like the set \mathbb{N} of natural numbers does in Set; thus it provides a formulation of the “axiom of infinity” in structural set theory (such as ETCS). The definition is due to William Lawvere.


In a topos or cartesian closed category

A natural numbers object in a topos (or any cartesian closed category) EE with terminal object 11 is

  • an object \mathbb{N} in EE

  • equipped with

  • such that

    • for every other diagram 1qAfA1 \stackrel{q}{\to}A \stackrel{f}{\to} A

    • there is a unique morphism u:Au : \mathbb{N} \to A such that

1 z s q u u A f A \array{ 1 &\stackrel{z}{\to}& \mathbb{N} &\stackrel{s}{\to}& \mathbb{N} \\ & {}_q\searrow & \downarrow^{u} && \downarrow^{u} \\ && A &\stackrel{f}{\to} & A }

All this may be summed up by saying that a natural numbers object is an initial algebra for the endofunctor X1+XX \mapsto 1 + X (the functor underlying the “maybe monad”). Equivalently, it is an initial algebra for the endo-profunctor Hom E(1,=)×Hom E(,=)Hom_E(1,=) \times Hom_E(-,=).

By the universal property, the natural numbers object is unique up to isomorphism.

In a general category with finite products

Note that this definition actually makes sense in any category EE having finite products. However, if EE is not cartesian closed, then it is better to explicitly assume a stronger version of this definition “with parameters” (which follows automatically when EE is cartesian closed, such as when EE is a topos). What this amounts to is demanding that (,z,s)(\mathbb{N}, z, s) not only be a natural numbers object (in the above, unparametrized sense) in EE, but that also, for each object AA, this is preserved by the cofree coalgebra functor into the Kleisli category of the comonad XA×XX \mapsto A \times X (which may be thought of as the category of maps parametrized by AA). (Put another way, the finite product structure of EE gives rise to a canonical self-indexing, and we are demanding the existence of an (unparametrized) NNO within this indexed category, rather than just within the base EE).

To be explicit:


In a category with finite products, a parametrized natural numbers object is an object NN together with maps z:1Nz: 1 \to N, s:NNs: N \to N such that given any objects AA, XX and maps f:AXf: A \to X, g:XXg: X \to X, there is a unique map ϕ f,g:A×NX\phi_{f, g}: A \times N \to X making the following diagram commute:

A z!,1 A N×A s×1 A N×A f ϕ f,g ϕ f,g X g X\array{ A & \stackrel{\langle z \circ !, 1_A\rangle}{\to} & N \times A & \stackrel{s \times 1_A}{\leftarrow} & N \times A \\ & \mathllap{f} \searrow & \downarrow \mathrlap{\phi_{f, g}} & & \downarrow \mathrlap{\phi_{f, g}} \\ & & X & \underset{g}{\leftarrow} & X }

The functions which are constructable out of the structure of a category with finite products and such a “parametrized NNO” are precisely the primitive recursive ones. Specifically, the unique structure-preserving functor from the free such category FF into Set yields a bijection between Hom F(1,)Hom_F(1, \mathbb{N}) and the actual natural numbers, as well as surjections from Hom F( m,)Hom_F(\mathbb{N}^m, \mathbb{N}) onto the primitive recursive functions of arity mm for each finite mm. With cartesian closure, however, this identification no longer holds, since non-primitive recursive functions (such as the Ackermann function) become definable as well.

In type theory

For the moment see at inductive type the section Examples - Natural numbers

Finite colimit characterization

In a topos, the natural numbers object \mathbb{N} is uniquely characterized by the following colimit conditions due to Peter Freyd:


In a topos, a triple (,0:1,s:)(\mathbb{N}, 0: 1 \to \mathbb{N}, s: \mathbb{N} \to \mathbb{N}) is a natural numbers object if and only if

  1. The morphism (0,s):1+(0, s): 1 + \mathbb{N} \to \mathbb{N} is an isomorphism;

  2. The diagram

    1s1\mathbb{N} \stackrel{\overset{s}{\to}}{\underset{1}{\to}} \mathbb{N} \to 1

    is a coequalizer.

The necessity of the first condition holds in any category with binary coproducts and a terminal object, and the necessity of the second holds in any category whatsoever.

Proof of theorem 1: necessity

For a category CC with binary coproducts and 1, the natural numbers object can be equivalently described as an initial algebra structure (0,s):1+(0, s): 1 + \mathbb{N} \to \mathbb{N} for the endofunctor F(c)=1+cF(c) = 1 + c defined on CC. Then condition 1 is a special case of Lambek's theorem, that the algebra structure map of an initial algebra is an isomorphism.

As for condition 2, given f:Xf: \mathbb{N} \to X such that f=fsf = f \circ s, the claim is that ff factors as

!1xX\mathbb{N} \overset{!}{\to} 1 \overset{x}{\to} X

for some unique xx, in fact for x=f(0)x = f(0). Uniqueness is clear since !:1!: \mathbb{N} \to 1, being a retraction for 0:10: 1 \to \mathbb{N}, is epic. On the other hand, substituting either ff or f(0)!f(0) \circ ! for gg in the diagram

1 0 s f(0) g g X 1 X X\array{ 1 & \overset{0}{\to} & \mathbb{N} & \overset{s}{\to} & \mathbb{N} \\ & ^\mathllap{f(0)} \searrow & \downarrow ^g & & \downarrow ^g \\ & & X & \underset{1_X}{\to} & X }

this diagram commutes, so that f=f(0)!f = f(0) \circ ! by the uniqueness clause in the universal property for \mathbb{N}.

Proof of theorem 1: sufficiency

Here we just give an outline, referring to (Johnstone), section D.5.1, for full details. Let NN be an object satisfying the two colimit conditions of Freyd. First one shows (see the lemma 1 below) that NN has no nontrivial FF-subalgebras. Next, let AA be any FF-algebra, and let i:BN×Ai: B \to N \times A be the intersection of all FF-subalgebras of N×AN \times A. One shows that π 1i:BN\pi_1 \circ i: B \to N is an (FF-algebra) isomorphism. Thus we have an FF-algebra map f:NAf: N \to A. If g:NAg: N \to A is any FF-algebra map, then the equalizer of ff and gg is an FF-subalgebra of NN, and therefore NN itself, which means f=gf = g.


Let FF be the endofunctor F(X)=1+XF(X) = 1+X. If NN satisfies Freyd’s colimit conditions, then any FF-subalgebra of NN is the entirety of NN.


Following (Johnstone), we may as well show that the smallest FF-subalgebra NN' of NN (the internal intersection of all FF-subalgebras) is all of NN. Let SN×NS \hookrightarrow N \times N be the union of the relation R=1,s:NN×NR = \langle 1, s \rangle: N \to N \times N and its opposite, so that SS is a symmetric relation. Working in the Mitchell-Bénabou language, one may check directly that the following formula is satisfied:

x,y:N(x,yS)((xN)(yN))\forall x, y: N (\langle x, y \rangle \in S) \Rightarrow ((x \in N') \Leftrightarrow (y \in N'))

Let us say a term ww of type PNP N is SS-closed if the formula

x,y:N(x,yS)((x[w])(y[w]))\forall x, y: N (\langle x, y \rangle \in S) \Rightarrow ((x \in [w]) \Leftrightarrow (y \in [w]))

is satisfied. Now define a relation TT on NN by the subobject

{x,yN×N:w:PN(wisSclosed)((x[w])(y[w])).\{\langle x, y \rangle \in N \times N: \forall w: P N (w \; is \; S closed) \Rightarrow ((x \in [w]) \Leftrightarrow (y \in [w])).

Observe that TT is an equivalence relation that contains SS and therefore RR. It therefore contains the kernel pair of the coequalizer of 11 and ss; since this coequalizer is by assumption N1N \to 1, the kernel pair is all of N×NN \times N. Also observe that since NN' is SS-closed by definition, it is TT-closed as well, and we now conclude

x,yN:(xN)(yN)\forall x, y \in N: (x \in N') \Leftrightarrow (y \in N')

so that, putting y=0:1Ny = 0: 1 \to N', we conclude that xNxNx \in N \Rightarrow x \in N', i.e., that NN' is all of NN.


A slightly alternative proof of sufficiency uses the theory of well-founded coalgebras, as given here. If NN is a fixpoint of the functor F(X)=1+XF(X) = 1+X, regarded as an FF-coalgebra, then the internal union of well-founded subcoalgebras of NN is a natural numbers object \mathbb{N}. Then the subobject N\mathbb{N} \hookrightarrow N can also be regarded as a subalgebra; by the lemma, it is all of NN. Thus NN is a natural numbers object.


In a sheaf topos

In any Grothendieck topos E=Sh(C)E = Sh(C) the natural numbers object is given by the constant sheaf on the set of ordinary natural numbers, i.e. by the sheafification of the presheaf C opSetC^{op} \to Set that is constant on the set \mathbb{N}.

There are interesting cases in which such sheaf toposes contain objects that look like they ought to be natural numbers objects but do not satisfy the above axioms: for instance some of the models described at Models for Smooth Infinitesimal Analysis are sheaf toposes that contain besides the standard natural number object a larger object of smooth natural numbers that has generalized elements which are “infinite natural numbers” in the sense of nonstandard analysis.


Transfer along inverse images


Natural number objects are preserved by inverse images:

let f=(f *f *):f *f *f = (f^* \dashv f_*) : \mathcal{E} \underoverset{f_*}{f^*}{\leftrightarrows} \mathcal{F} be a geometric morphism of toposes. If \mathbb{N} \in \mathcal{F} is a natural numbers object, then its inverse image f *f^* \mathbb{N} is a natural numbers object in \mathcal{E}.

(Johnstone, lemma A.4.1.14). Of course, by the finite colimit characterization, we need only the fact that inverse images, being left adjoints, preserve finite colimits.


If \mathcal{E} is a sheaf topos, then there is a unique geometric morphism (ΔΓ):ΓΔSet(\Delta \dashv \Gamma): \mathcal{E} \underoverset{\Gamma}{\Delta}{\leftrightarrows} Set, the global section geometric morphism, with the inverse image being the locally constant sheaf functor, it follows that

Δ()Δ( n:1) n:NΔ1 n:1, \Delta(\mathbb{N}) \cong \Delta(\sum_{n: \mathbb{N}} 1) \cong \sum_{n: N} \Delta 1 \cong \sum_{n: \mathbb{N}} 1,

with the evident successor and constant 00, is the natural nunbers object in \mathcal{E}.


If \mathcal{E} is a topos and XX \in \mathcal{E} an object, then the slice topos sits by an etale geometric morphism over \mathcal{E}

/XX *X *, \mathcal{E}_{/X} \stackrel{\overset{X^*}{\leftarrow}}{\underset{X_*}{\to}} \mathcal{E} \,,

where the inverse image form the product with XX. Hence for \mathbb{N} \in \mathcal{E} a natural numbers object, the projection (X×X)(X \times \mathbb{N} \to X) is a natural numbers object in /X\mathcal{E}_{/X}.

Relation to object of integers

Given a natural numbers object \mathbb{N} in a pretopos, we can construct an integers object as follows. Let a,b:E×a, b\colon E \to \mathbb{N} \times \mathbb{N} be the kernel pair of the addition map +:×{+}\colon \mathbb{N} \times \mathbb{N} \to \mathbb{N}, and let π 1,π 2:×\pi_1, \pi_2\colon \mathbb{N} \times \mathbb{N} \to \mathbb{N} be the product projections. We define \mathbb{Z} to be the coequalizer of the congruence (π 1a,π 2b),(π 2a,π 1b):E×(\pi_1 \circ a, \pi_2 \circ b), (\pi_2 \circ a, \pi_1 \circ b)\colon E \to \mathbb{N} \times \mathbb{N}. A similar construction yields a rational numbers object \mathbb{Q}.

For a real numbers object, rather more care is needed; see real numbers object.


Revised on July 17, 2014 08:09:26 by Urs Schreiber (