Recall that it is possible to define an internalization of the set of natural numbers, called a natural numbers object (NNO), in any cartesian monoidal category (a category with finite products). In particular, the notion makes sense in a topos. But a topos supports intuitionistic higher-order logic, so once we have an NNO, it is also possible to repeat the usual construction of the integers, the rationals, and then finally the real numbers; we thus obtain an internalization of $\mathbb{R}$ in any topos with an NNO.
More generally, we can define a real numbers object (RNO) in any category with sufficient structure (somewhere between a cartesian monoidal category and a topos). Then we can prove that an RNO exists in any topos with an NNO (and in some other situations).
Let $\mathcal{E}$ be a Heyting category. (This means, in particular, that we can interpret full first-order intuitionistic logic using the stack semantics.)
A (located Dedekind) real numbers object in $\mathcal{E}$ is a ring object in $\mathcal{E}$ that satisfies (in the internal logic) the axioms of a Dedekind-complete linearly ordered Heyting field.
In detail:
A commutative ring object in $\mathcal{E}$ is an object $R$ equipped with morphisms $0\colon \mathbf{1} \to R$, ${-}\colon R \to R$, ${+}\colon R \times R \to R$, $1\colon \mathbf{1} \to R$, and ${\cdot}\colon R \times R \to R$ (where $\mathbf{1}$ is the terminal object of $\mathcal{E}$ and $\times$ is the product operation in $\mathcal{E}$) that make certain diagrams commute. (These diagrams may be found at ring object, in principle, although right now they're not there.)
Given a commutative ring object $R$ in $\mathcal{E}$, we define a binary relation $\#$ on $R$ (that is a subobject of $R \times R$) as
written in the internal language of $\mathcal{E}$. Then $R$ is a (Heyting) field object if $\#$ is a tight apartness relation; that is if the following axioms (in the internal language) hold:
A (linearly) ordered field object in $\mathcal{E}$ is a field object $R$ equipped with a binary relation $\lt$ such that the following axioms hold:
Given an ordered field object $R$ in $\mathcal{E}$, any object $\Gamma$ in $\mathcal{E}$, and subobjects $L$ and $U$ of $\Gamma \times R$, we say that $(L,U)$ is a Dedekind cut in $R$ (parametrised by $\Gamma$) if the following axioms hold:
An ordered field object $R$ in $\mathcal{E}$ is Dedekind complete if, given any object $\Gamma$ of $\mathcal{E}$ and any Dedekind cut $(L,U)$ in $R$ parametrised by $\Gamma$, there exists a morphism $x\colon \Gamma \to R$ such that
Finally, a real numbers object in $\mathcal{E}$ is a Dedekind-complete ordered field object.
In the last requirement, of Dedekind completeness, we postulate (under certain conditions) the existence of a morphism $x\colon \Gamma \to R$ satisfying certain properties.
This morphism is in fact unique.
Here is an explicit ‘external’ proof:
Suppose that $x, x'\colon \Gamma \to R$ both satisfy the required properties, and consider $x \# x'$, which is a subobject of $\Gamma$. By the strong connectedness of $\lt$, $x \# x'$ is contained in (factors through) $x \lt x' \vee x' \lt x$, which is the union of $x \lt x'$ and $x' \lt x$.
Now consider $x \lt x'$, and let $a$ be a generalised element of $\Gamma$. If $a$ belongs to (factors through) $x \lt x'$, or equivalently $(x(a), x'(a))$ belongs to $\lt$, it follows that $(a,x(a))$ belongs to $L$. Thus, $(x(a), x(a))$ also belongs to $\lt$, or equivalently $a$ belongs to $x \lt x$. By the strong irreflexivity of $\lt$, this is contained in $x \# x$; by the irreflexivity of $\#$, this is contained in $\bot$ (as a subobject of $\Gamma$). Since every $a$ that belongs to $x \lt x'$ belongs to $\bot$, $x \lt x'$ is contained in (and so equals as a subobject) $\bot$.
Similarly (either by swapping $x$ with $x'$ or by using $U$ instead of $L$), $x' \lt x$ is also $\bot$. Therefore, $x \# x'$ is $\bot$. By the tightness of $\#$, $x = x'$.
Here is an ‘internal’ proof, to be interpreted in the stack semantics of $\mathcal{E}$:
Suppose that $x, x'\colon R$ both satisfy the required properties, and suppose that $x \# x'$. By the strong connectedness of $\lt$, $x \lt x'$ or $x' \lt x$.
Now suppose that $x \lt x'$. It follows that $x$ belongs to $L$, so $x \lt x$. By the strong irreflexivity of $\lt$, $x \# x$; by the irreflexivity of $\#$, we have a contradiction.
Similarly (either by swapping $x$ with $x'$ or by using $U$ instead of $L$), $x' \lt x$ is also false. Therefore, $x \# x'$ is false. By the tightness of $\#$, $x = x'$.
In the definition of a Heyting field object, all of the axioms except the last are coherent and therefore make sense in any coherent category.
An object satisfying all but the last axiom of a field object is precisely a local ring object (so in particular an RNO is a local ring object).
…
It would be nice to say that a Heyting category with an RNO must have an NNO; after all, $\mathbb{N}$ is contained in $\mathbb{R}$. However, my only argument is impredicative; although I don’t know a specific example, there could be a Π-pretopos with an RNO but no NNO. However, the argument works for a geometric Heyting category or a topos. (In light of the constructions below, the existence of an RNO is therefore equivalent to the existence of an NNO in a topos.)
If $R$ is an RNO in an infinitary Heyting category or topos, then there is unique subobject $N$ of $R$ that is both a sub-rig object of $R$ and an NNO under the operations $0\colon \mathbf{1} \to N$ and $({-}) + 1\colon N \to N$.
…
We usually speak of the? RNO, if one exists. This is because any two RNOs in a Heyting category with an NNO are isomorphic, in an essentially unique way. (I can’t prove this without an NNO, although the previous theorem shows that we often have one.)
If $R$ and $R'$ are both RNOs in a Heyting category $\mathcal{E}$ with an NNO, then there is a unique isomorphism from $R$ to $R'$ that preserves the structures on them ($0$, $-$, $+$, $1$, $\cdot$, $\lt$).
…
We can construct a real numbers object in the following cases (presumably among others):
(Actually, (1) is a special case of (3), but the usual construction in (1) is not available in (3). Thus, we still have three different constructions to consider.)
Let $\mathcal{E}$ be an elementary topos with a natural numbers object $\mathbb{N}$. The Dedekind real numbers object of $\mathcal{E}$ is the object of all Dedekind cuts. To be more precise, we will need to make some auxiliary definitions.
We first construct an integers object as follows. Let $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 $\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 $(\pi_1 \circ a, \pi_2 \circ b), (\pi_2 \circ a, \pi_1 \circ b)\colon E \to \mathbb{N}$. A similar construction yields a rational numbers object $\mathbb{Q}$.
We denote by $\mathcal{P}(A)$ the power object of $A$ in $\mathcal{E}$. A Dedekind cut is a generalized element $(L, U)$ of $\mathcal{P}(\mathbb{Q}) \times \mathcal{P}(\mathbb{Q})$, satisfying the following conditions, expressed in the Mitchell–Bénabou language of $\mathcal{E}$ and interpreted under Kripke–Joyal semantics:
Non-degenerate:
Inward-closed:
Outward-open:
Located:
Mutually exclusive:
The relation $\lt$ on $\mathbb{Q}$ is the order relation constructed in the usual way. We define $\mathbb{R}$ to be the subobject of $\mathcal{P}(\mathbb{Q}) \times \mathcal{P}(\mathbb{Q})$ consisting of all Dedekind cuts as defined above.
Summary: construct a Cauchy real numbers object and use $WCC$ (weak countable choice) to prove that it is an RNO.
Note that any Boolean topos with an NNO satisfies $WCC$, so in all we have three different constructions available in that case.
Summary: modify the construction of a Cauchy real numbers object to use multi-valued Cauchy sequences.
The real numbers object in Set is the real line, the usual set of (located Dedekind) real numbers. Note that this is a theorem of constructive mathematics, as long as we assume that $Set$ is an elementary topos with an NNO (or more generally a Π-pretopos with NNO and either WCC or subset collection).
Let $X$ be a topological space, and $\mathrm{Sh}(X)$ its category of sheaves. It is well-known that $\mathrm{Sh}(X)$ is a Grothendieck topos (and so, a fortiori, an elementary topos), and the constant sheaf functor $\Delta\colon \mathbf{Set} \to \mathrm{Sh}(X)$ preserves finite limits and has the global section functor $\Gamma\colon \mathrm{Sh}(X) \to \mathbf{Set}$ as a right adjoint. (Hence, $\Delta$ and $\Gamma$ are the components of a geometric morphism $\mathrm{Sh}(X) \to \mathbf{Set}$.) The following claims are essentially immediate:
If $\mathbf{N}$ is the set of natural numbers, then $\Delta (\mathbf{N})$ must be an NNO in $\mathrm{Sh}(X)$, since $\Delta$ has a right adjoint.
If $\mathbf{Z}$ is the set of integers, then $\Delta (\mathbf{Z})$ is an integers object in $\mathrm{Sh}(X)$ (as defined above), since $\Delta$ preserves finite limits and colimits.
Similarly, if $\mathbf{Q}$ is the set of rational numbers, then $\Delta (\mathbf{Q})$ is a rational numbers object in $\mathrm{Sh}(X)$.
Thus, for every topological space $X$, the topos $\mathrm{Sh}(X)$ has a Dedekind real numbers object $\mathbb{R}$. Naïvely one might expect $\mathbb{R}$ to be isomorphic to the constant sheaf $\Delta(\mathbf{R})$, where $\mathbf{R}$ is the classical set of real numbers, but this turns out not to be the case. Instead, we have a rather more remarkable result:
A Dedekind real numbers object $\mathbb{R}$ in the topos $\mathrm{Sh}(X)$ is isomorphic to the sheaf of real-valued continuous functions on $X$.
See Mac Lane and Moerdijk (Chapter VI, §8).
This allows us to define various further constructions on $X$ in internal terms in $\mathrm{Sh}(X)$; for example, a vector bundle over $X$ is an internal projective $\mathbb{R}$-module.
It is also possible to define the notion of a Cauchy real number object and construct one in any $\Pi$-pretopos with an NNO, but as the internal logic in general lacks weak countable choice, these are usually inequivalent. (There is also potentially a difference between the classical Cauchy RNO and the modulated Cauchy RNO; see definitions at Cauchy real number, to be interpreted in the stack semantics.)
real number, real numbers object
Section D4.7 of
See also
Discussion in homotopy type theory is in section 11 of of