In these notes I construct the real numbers as the formal limits of Cauchy sequences of rationals. This is a bit tricky to get right compared to the construction by Dedekind cuts, because there’s a risk of circular definitions. But if you get it right, then you kill many birds with one stone, since you end up naturally developing the theory of metric space completions as well, which will be used over and over again in building analysis.

There is a moment where one can use the axiom of choice to make the proof a bit easier. In particular, one needs the axiom of choice to prove that every metric space completion is complete. But I don’t use it. It’s not necessary for the case of the reals, because we can show that there exist choice functions which select a canonical Cauchy sequence from any equivalence class of rational Cauchy sequences. Which I think is valuable in its own right, since if this didn’t exist, then you could define reals but it wouldn’t always be possible to actually calculate with them.


Construction of the reals

Metric spaces

We say $(X, d)$ is a metric space when $d$ satisfies:

  1. $d(x, x) = 0$.
  2. $d(x, y) \geq 0$.
  3. $d(x, z) \leq d(x, y) + d(y, z)$.

Proposition. $|d(x, z) - d(y, z)| \leq d(x, y)$.

Proof. This reduces to the following case by symmetry: $d(x, z) - d(y, z) \leq (d(x, y) + d(y, z)) - d(y, z) \leq d(x, y)$. $\square$

Proposition. $({\mathbb Q}, |\cdot|)$ is a metric space.

Remark: This definition allows $d$ to be either rational or real-valued. It just needs to have the algebraic and order structure to support the three axioms. The following proofs will go through regardless of whether its codomain is rational or real.


Cauchy sequences, limits, and formal limits

We say a sequence $x: {\mathbb N} \to X$, which we write as $(x_1, x_2, \dots)$ or $(x_n)$, is Cauchy if

$$(\forall k \geq 1)(\exists N \geq 1)(\forall n \geq N) : d(x_N, x_n) < 1/k$$

We denote the space of Cauchy sequences by

$$\mathrm{Cauchy}(X, d) := \{(x_n): {\mathbb N} \to X \mid \text{$(x_n)$ is Cauchy}\}$$

We call a metric space proper if $x \neq y \implies d(x, y) > 0$. In a proper metric space, we call a point $x^* \in X$ the limit of $(x_n)$, in which case we write $\lim x_n = x^*$, if

$$(\forall k \geq 1)(\exists N \geq 1) (\forall n \geq N) : d(x_n, x^*) < 1/k$$

If $(x_n)$ and $(y_n)$ are Cauchy such that $\lim d(x_n, y_n) = 0$, then we call them equivalent and write $(x_n) \sim_d (y_n)$.

Proposition. Sequences which are not Cauchy cannot have limits. In a proper metric space, limits are unique, and equivalent sequences cannot have distinct limits.

Define the formal limit of a sequence to be either $\overline{\lim}x_n := \lim x_n$ if it exists, or else its equivalence class $\overline{\lim} x_n := \{(y_n) \in \mathrm{Cauchy}(X, d) \mid (x_n) \sim_d (y_n)\}$. We denote the space of formal limits by

$$\mathrm{Complete}(X, d) := \{\overline{\lim} x_n \mid (x_n) \in \mathrm{Cauchy}(X, d)\}$$

Proposition. If $(x_n)$ is not Cauchy, then $\overline{\lim} x_n = \varnothing$.

Proposition. $X \subset \mathrm{Complete}(X, d)$.

Proposition. $\overline{\lim} x_n = \overline{\lim} y_n \iff (x_n) \sim_d (y_n)$.


Extending the metric codomain structure to its own completion

Let $(x_n)$ and $(y_n)$ be Cauchy sequences from the codomain of $d$ under absolute value metric. Then we extend $+$ and $<$ to their formal limits via:

\begin{equation*} \begin{array}{ll} \overline{\lim}x_n + \overline{\lim}y_n \quad= &\overline{\lim}(x_n + y_n) \\ \overline{\lim}x_n < \overline{\lim}y_n \iff &(\exists k \geq 1)\lim1\{x_n \leq y_n - 1/k\} = 1 \\ |\overline{\lim}x_n| \quad\quad\quad\quad\,\,=&\overline{\lim}|x_n| \\ \end{array} \end{equation*}

Proposition. $\overline{\lim}x_n + \overline{\lim}y_n$ is well-defined.

Proof. Let $(a_n) \sim_{|\cdot|} (x_n)$ and $(b_n) \sim_{|\cdot|} (y_n)$ be equivalent. Then we have

\begin{align*} \lim |(a_n + b_n) - (x_n + y_n)| &= \lim |(a_n - x_n) + (b_n - y_n)| \\ &\leq \lim |a_n - x_n| + \lim |b_n - y_n| \\ &= 0 + 0 = 0 \end{align*}

where we used the continuity of $+$ with respect to $|\cdot|$. This implies that $(a_n + b_n) \sim_{|\cdot|} (x_n + y_n)$ are also equivalent so we are done. $\square$

Proposition. $\overline{\lim}x_n < \overline{\lim}y_n$ is well-defined.

Proof. Let $(a_n) \sim_{|\cdot|} (x_n)$ and $(b_n) \sim_{|\cdot|} (y_n)$ be equivalent. Assume that $\overline{\lim}a_n < \overline{\lim}b_n$, so there exists $k \geq 1$ such that $\lim1\{a_n < b_n - 1/k\} = 1$. Let $N \geq 1$ be such that $n \geq N$ implies three conditions: First, $1\{a_n < b_n - 1/k\} > 1-1/2$, which immediately implies $a_n < b_n - 1/k$ since $1\{\dots\} \in \{0, 1\}$. Second, $|a_n - x_n| < 1/3k$, and third, $|b_n - y_n|< 1/3k$. Putting these together yields

\begin{align*} x_n &\leq a_n + |x_n - a_n| \\ &< a_n + 1/3k \\ &< (b_n - 1/k) + 1/3k \\ &= b_n - 2/3k \\ &\leq y_n + |b_n - y_n| - 2/3k \\ &\leq y_n + 1/3k - 2/3k \\ &\leq y_n - 1/3k \end{align*}

so that $x_n < y_n - 1/3k$ for every $n \geq N$. Therefore $\overline{\lim} x_n < \overline{\lim} y_n$ as well, so we are done. $\square$

Proposition. If $x_n \leq y_n$ for all $n \geq 1$, then $\overline{\lim} x_n \leq \overline{\lim} y_n$.

Proof. If there exists $k \geq 1$ such that $x_n < y_n - 1/k$ for all $n$, then we are done. Otherwise, for every $k \geq 1$ there exists $N$ such that $n \geq N$ implies that $|x_n - y_n| = (y_n - x_n) \leq 1/k$. Therefore $\lim |x_n - y_n| = 0$, therefore $(x_n) \sim_{|\cdot|} (y_n)$, hence $\overline{\lim} x_n = \overline{\lim} y_n$. $\square$

Proposition. $|\overline{\lim}x_n|$ is well-defined.

Proof. Let $(a_n) \sim_{|\cdot|} (x_n)$. Then $||a_n| - |x_n|| \leq |a_n - x_n|$ implies that $\lim ||a_n| - |x_n|| = 0$, that is, $(|a_n|) \sim_{|\cdot|} (|x_n|)$, so that $|\overline{\lim}x_n| = |\overline{\lim}a_n|$. $\square$

Proposition. If $\lim x_n$ and $\lim y_n$ exist, then we have

\begin{equation*} \begin{array}{ll} \overline{\lim}x_n + \overline{\lim}y_n \quad= &\lim x_n + \lim y_n \\ \overline{\lim}x_n < \overline{\lim}y_n \iff & \lim x_n < \lim y_n \\ |\overline{\lim}x_n| \quad\quad\quad\quad\,\,=& |\lim x_n| \end{array} \end{equation*}

We have established that the structures $(<, +, |\cdot|)$ equipped by the metric’s codomain can be extended to formal limits of that codomain while preserving the usual properties, making the completion of the metric codomain another valid metric codomain.


Metric extension to Cauchy and Complete

We extend the distance metric to $\mathrm{Cauchy}(X, d)$ and $\mathrm{Complete}(X, d)$ via formal limits in the metric codomain:

$$d((x_n), (y_n)) := \overline{\lim} d(x_n, y_n)$$
$$d(\overline{\lim}x_n, \overline{\lim}y_n) := \overline{\lim} d(x_n, y_n)$$

Lemma. The latter is well-defined.

Proof. Let $(a_n) \sim_d (x_n)$ and $(b_n) \sim_d (y_n)$ be equivalent. Then

\begin{align*} d(x_n, y_n) - d(a_n, b_n) &\leq d(x_n, a_n) + d(a_n, b_n) + d(b_n, y_n) - d(a_n, b_n) \\ &= d(x_n, a_n) + d(b_n, y_n) \end{align*}

which by symmetry proves that

\begin{align*} \lim |d(x_n, y_n) - d(a_n, b_n)| &\leq \lim |d(x_n, a_n) + d(y_n, b_n)| \\ &= \lim d(x_n, a_n) + \lim (y_n, b_n) \\ &= 0 + 0 = 0. \end{align*}

So $(d(a_n, b_n)) \sim_{|\cdot|} (d(x_n, y_n))$ are equivalent with respect to $|\cdot|$. $\square$

Lemma. $d((x_n), (y_n)) \neq \varnothing$.

Proof. To prove that the equivalence class is not null we must show that $(d(x_n, y_n))$ is Cauchy. To that end let $k \geq 1$ be arbitrary. Then there exists $N_1, N_2$ such that $n \geq N_1 \implies d(x_N, x_n) < 1/2k$ and $n \geq N_2 \implies d(y_N, y_n) < 1/2k$ So take $N = \max(N_1, N_2)$, then we have

\begin{align*} |d(x_N, y_N) - d(x_n, y_n)| &\leq |d(x_N, y_N) - d(x_N, y_n)| + |d(x_N, y_n) - d(x_n, y_n)| \\ &\leq d(y_N, y_n) + d(x_N, x_n) \\ &< 2 \cdot 1/2k \\ &= 1/k \end{align*}

$\square$

Lemma. Let $(x_n), (y_n), (z_n) \in \mathrm{Cauchy}(X, d)$. Then

$$d((x_n), (z_n)) \leq d((x_n), (y_n)) + d((y_n), (z_n)).$$

Proof.

\begin{align*} d((x_n), (z_n)) &= \overline{\lim} d(x_n, z_n) \\ &\leq \overline{\lim} (d(x_n, y_n) + d(y_n, z_n)) \\ &= \overline{\lim} d(x_n, y_n) + \overline{\lim} d(y_n, z_n) \end{align*}

where we used the propositions proved earlier. $\square$

Theorem. Both $(\mathrm{Cauchy}(X, d), d)$ and $(\mathrm{Complete}(X, d), d)$ are metric spaces. The latter is proper.

Proof. Use the lemmas. $\square$

Proposition. $(\mathrm{Complete}(X, d), d) \cong (\mathrm{Cauchy}(X, d)/\{d = 0\}, d)$.


Completeness

Definition. We call $(X, d)$ complete if every Cauchy sequence has a limit, that is:

$$(x_n) \in \mathrm{Cauchy}(X, d) \implies \overline{\lim} x_n \in X$$

Theorem. $(\mathrm{Cauchy}(X, d), d)$ is complete.

Proof. Let $((x_{m,n})): {\mathbb N} \to ({\mathbb N} \to X)$ be any Cauchy sequence of Cauchy sequences. And define

$$M_k := \min\{M \geq 1 \mid m \geq M \implies d((x_{M,n}), (x_{m,n})) < 1/k\}$$
$$N_m(k) := \max\Big(N_{m-1}(k), \min\{N \geq 1 \mid n \geq N \implies d(x_{m,N}, x_{m,n}) < 1/k\}\Big)$$

to be the $k$-convergence time of the outer sequence and the slowest $k$-convergence time of all the inner sequences up to $(x_{m,n})$. And define

$$y_k := x_{M_k, N_{M_k}(k)}$$

to be the “time of $k$-convergence in that inner sequence which is itself the time of $k$-convergence in the outer sequence.”

We first prove that $(y_k)$ is Cauchy. Let $k \geq 1$ be arbitrary and define $n := N_{M_{k+j}}(k+j)$, and $m := M_{k+j}$. Then $n \geq N_{M_{k+j}}(k) \geq N_{M_k}(k)$ and $m \geq M_k$, so that:

\begin{align*} d(y_k, y_{k+j}) &= d(x_{M_k, N_{M_k}(k)}, x_{M_{k+j}, N_{M_{k+j}}(k+j)}) \\ &= d(x_{M_k, N_{M_k}(k)}, x_{m, n}) \\ &\leq d(x_{M_k, N_{M_k}(k)}, x_{M_k, n}) + d(x_{M_k, n}, x_{m, n}) \\ &< 1/k + d(x_{M_k, n}, x_{m, n}) \end{align*}

Now let $n’ \geq N_{M_{k+j}}(k) \geq N_{M_k}(k)$ be such that $d(x_{M_k,n’}, x_{m,n’}) < 2/k$, which must exist because by assumption $\lim_{n’ \to \infty} d(x_{M_k,n’}, x_{m,n’}) \leq 1/k$. Then we have:

\begin{align*} d(x_{M_k, n}, x_{m, n}) &\leq d(x_{M_k,n}, x_{M_k,n'}) + d(x_{M_k,n'},x_{m,n'}) + d(x_{m,n'},x_{m,n}) \\ &\leq 1/k + 1/k + 1/k \\ &= 3/k \end{align*}

We have shown that $d(y_k, y_{k+j}) \leq 4/k$, thus $n \geq 4k \implies d(y_{4k}, y_n) \leq 1/k$, so that $(y_n)$ is Cauchy. To show that it is a limit of $((x_{m,n}))$ in the Cauchy sequence distance metric, observe that for any $k$, $m \geq M_k$ implies

\begin{align*} d((y_j), (x_{m,j})) &= \lim_{j \to \infty} d(y_j, x_{m,j}) \\ &\leq \lim_{j \to \infty} \Big(d(y_j, y_k) + d(y_k, x_{m,N_m(k)}) + d(x_{m,N_m(k)}, x_{m,j})\Big) \\ &\leq 4/k + d(x_{M_k, N_{M_k}(k)}, x_{m,N_m(k)}) + \lim_{j \to \infty} d(x_{m,N_m(k)}, x_{m,j}) \\ &< 4/k + 3/k + 1/k \\ &= 8/k. \end{align*}

where $\lim_{j \to \infty}$ should be interpreted as a formal limit. Therefore $\lim_{m \to \infty} d((y_j), (x_{m,j})) = 0$. $\square$


Theorem. If there exists a choice function from $\mathrm{Cauchy}(X, d)/\sim_d$ to $\mathrm{Cauchy}(X, d)$, then $(\mathrm{Complete}(X, d), d)$ is complete.

Proof. Let $\sigma$ be such a choice function. Let $(y_m) \in \mathrm{Cauchy}(\mathrm{Cauchy}(X, d)/\sim_d, d)$ be an arbitrary Cauchy sequence of Cauchy equivalence classes. Let $(x_{m,n}) = \sigma(y_m) \in \mathrm{Cauchy}(X, d)$ be the chosen representative from each class. We have proved that $\mathrm{Cauchy}(X, d)$ is complete, so there exists a limit $(x_n)^* := \lim_{m \to \infty} (x_{m,n})$ in $\mathrm{Cauchy}(X, d)$. And the equivalence class of $(x_n)^*$ is the limit of $(y_n)$ in $\mathrm{Cauchy}(\mathrm{Cauchy}(X, d)/\sim_d, d)$, so we have proved that $\mathrm{Cauchy}(\mathrm{Cauchy}(X, d)/\sim_d, d)$ is complete, which is isomorphic to $(\mathrm{Complete}(X, d), d)$. $\square$


Remark: All of the proofs so far go through if $d$ is either rational-valued or real-valued, or even the formal limits thereof (which we will see are the reals).


The real numbers

Definition. ${\mathbb R} := \mathrm{Complete}({\mathbb Q}, |\cdot|)$.

By an earlier proposition we have ${\mathbb Q} \subset {\mathbb R}$. We equip ${\mathbb R}$ with the extensions of $<, +, |\cdot|$ defined earlier, which we already showed satisfy their usual properties.

Proposition. ${\mathbb R} \neq {\mathbb Q}$.

Completeness of the reals

Theorem. $(\mathbb R, |\cdot|)$ is complete.

Proof. We must show that there exists a choice function for the equivalence classes of $\mathrm{Cauchy}({\mathbb Q}, |\cdot|)$.

For any $(x_n) \in \mathrm{Cauchy}({\mathbb Q}, |\cdot|)$, let $(q_m): {\mathbb N} \to {\mathbb Q}$ be the lower dyadic approximation sequence for $\overline{\lim} x_n$:

$$q_m = K + \sum_{j=1}^m b_j2^{-j}$$
$$K := \max\left\{K \in {\mathbb Z} \mid (\forall k \geq 1)(\exists N)(\forall n \geq N) : x_n \geq K - \tfrac1k\right\}$$
$$b_m := \max\Big\{b_m \in \{0, 1\} \mid (\forall k \geq 1) (\exists N)(\forall n \geq N) : x_n \geq \left(q_{m-1} + b_m2^{-m}\right) - \tfrac1k\Big\}$$

so that $K \in {\mathbb Z}$, $b_j \in \{0, 1\}$, and $\sum_{j=1}^\infty 1\{b_j = 0\} = \infty$.

It remains to show that $(q_m)$ is Cauchy and $(x_n) \sim_{|\cdot|} (q_m)$. [Further details omitted] $\square$

Corollary. For any metric space $(X, d)$, where $d$ is either rational or real-valued, the extension of $d$ to $\mathrm{Cauchy}(X, d)$ or $\mathrm{Complete}(X, d)$ is real-valued.

Least upper bound property

We will prove the greatest lower bound property instead which is equivalent.

Theorem. Let $A \subset [0, 1]$. Then the set of lower bounds $L := \{x \in [0, 1] \mid \forall y \in A : y \geq x\}$ has a maximum.

Proof. Define the sequence $(a_n)$ via

\begin{align*} a_0 &:= 0 \\ a_{n+1} &= \begin{cases} a_n + 2^{-(n+1)} & \text{if $a_n + 2^{-(n+1)} \in L$} \\ a_n & \text{else} \end{cases} \end{align*}

It’s clear that $a_n \in L$ for all $n$, and $(a_n)$ is a Cauchy sequence since $|a_{N+m} - a_N| \leq \sum_{i=1}^m 2^{-N+i} < 2^{-N}$. So by the completeness of ${\mathbb R}$ there exists $a^* := \lim a_n \in {\mathbb R}$, which we will show is the greatest lower bound.

Suppose for contradiction that there exists $b^* \in L$ such that $b^* > a^*$. Let $(b_n)$ be the canonical Cauchy sequence corresponding to $b^*$, as described in the previous theorem. Then we must have $(a_n) \neq (b_n)$, so let $n \geq 1$ be an index where $a_n \neq b_n$.

Both sequences are nondecreasing and satisfy $x_{n+1} - x_n \in \{0, 2^{-(n+1)}\}$. This implies that $x_m \leq x_m + 2^{-n}$ for all $m \geq n$.

Suppose that $a_n > b_n$. We had $a_{n-1} = b_{n-1}$, so we must have $b_n = b_{n-1} = a_{n-1}$ and $a_n = a_{n-1} + 2^{-n}$. But this yields $a_m \geq a_n = a_{n-1} + 2^{-n} \geq b_m$ for every $m \geq n$, which implies $\lim a_m \geq \lim b_m$, which contradicts our assumption.

Therefore it must be the case that $a_n < b_n$, and $a_n = a_{n-1}$ and $b_n = a_{n-1} + 2^{-n}$. But the monotonicity of $(b_n)$ implies that $b_n \leq b^*$, so that in particular, $b_n \in L$. But this contradicts our construction of $(a_n)$, since in this case, $b_n = a_{n-1} + 2^{-n}$ should have been equal to the next iterate $a_n$.

Both cases contradict the assumptions, so we must conclude that we cannot select $b^* \in L$ such that $b^* > a^*$. Therefore $a^*$ is the greatest lower bound. $\square$

Proposition. $([a, b], <, +, |\cdot|) \cong ([0, 1], <, +, |\cdot|)$ for every $a, b \in {\mathbb R}$ s.t. $a < b$.

Proposition. $\sup A = -\inf(-A)$