16 #3 Countability of the rational numbers forget
The rational numbers are countable: construct directly a surjection from the natural numbers to the rational numbers, using the representation \(k = 2^m(2n+1)\).
We use that the way of writing \(k\) as \(2^m(2n+1)\) is unique (Linj), but do not show that every \(k \neq 0\) can be so written.
16.1 Preparation
The representation of the form \(2^a(2b+1)\) is unique (Linj). By induction on \(a\): for 0, use parity; for \(a + 1\), divide by 2.
Linj …
\(a , b , c , d \in \mathbb{M} , 2 ^ a \cdot ( 2 \cdot b + 1 ) = 2 ^ c \cdot ( 2 \cdot d + 1 ) \Longrightarrow a = c , b = d\) \(\blacktriangleleft\) ↑0X ,⋅0X ,\(\mathbb{W}.\) ,\(0 \in \mathbb{M}\) ,𝕄0 ,INDC ,ℤ+16.2 Proof 1 (from the representation 2^m(2n+1))
word(ss,s) …
\(\stackrel{\rm S}\to\)→S. …
\(X \stackrel{\rm S}\to Y = \{ f \in X \to Y \mid \forall y \in Y . \exists x \, \langle x , y \rangle \in f \}\) Write a natural number \(k\) as \(2^m(2n+1)\) (the representation is unique = Linj), fix the sign of an integer by the parity of \(m\), and map \(k\) to the rational \(\pm i \div (n+1)\) (for \(m = 2i\), \(+\); for \(m = 2i+1\), \(-\)). Send \(k = 0\) to \(0 \div 1\).
Every rational number \(a \div b\) appears as a value: with \(b = n+1\): if \(a = i\), take \(m = 2i\); if \(a = -i\), take \(m = 2i+1\). So this correspondence is a surjection.
\(\exists f \, f \in \mathbb{M} \stackrel{\rm S}\to \mathbb{Q}\) \(\blacktriangleleft\) ax_s ,↑0X ,⋅0X ,\(\mathbb{W}.\) ,\(0 \in \mathbb{M}\) ,𝕄0 ,INDC ,ℤ+16.3 Proof 2 (from the Calkin–Wilf tree)
The rational numbers are countable: using the Calkin–Wilf tree (Stern's sequence fusc), construct a surjection from the natural numbers to the rational numbers.
16.4 Stern's sequence
\({\rm fusc}\) is assumed to be a function satisfying the following recurrence (its existence is not shown). It is the sequence continuing \(0, 1, 1, 2, 1, 3, 2, 3, 1, 4, \ldots\).
word(s,s)F …
\(\mathrm{fusc}\)fusc𝕄 …
\(\begin{cases} \mathrm{fusc} ( 0 ) = 0 \\ \mathrm{fusc} ( 1 ) = 1 \\ n \in \mathbb{M} \Longrightarrow \mathrm{fusc} ( 2 \cdot n ) = \mathrm{fusc} ( n ) \\ n \in \mathbb{M} \Longrightarrow \mathrm{fusc} ( 2 \cdot n + 1 ) = \mathrm{fusc} ( n ) + \mathrm{fusc} ( n + 1 ) \end{cases}\) The values of fusc are natural numbers, and nonzero if \(n \neq 0\) (strong induction on \(n\); for \(2k\) and \(2k+1\), the arguments \(k, k+1\) are less than \(n\)).
Lfusc …
\(n \in \mathbb{M} \Longrightarrow \mathrm{fusc} ( n ) \in \mathbb{M} , ( n \neq 0 \Longrightarrow \mathrm{fusc} ( n ) \neq 0 )\) \(\blacktriangleleft\) fusc𝕄 ,⋅0X ,\(\mathbb{W}.\) ,\(0 \in \mathbb{M}\) ,𝕄0 ,INDC ,ℤ+Calkin–Wilf: every \(a, b\) (\(b \neq 0\)) can be written, for some \(n\) and \(g\), as \(a = g\,{\rm fusc}(n)\), \(b = g\,{\rm fusc}(n+1)\).
Strong induction on \(a+b\): if \(a = 0\) then \(n = 0\). If \(b \le a\), go from \((a-b, b)\) to \(2n+1\); if \(a < b\), from \((a, b-a)\) to \(2n\) (following the Euclidean algorithm backwards).
LCW …
\(a , b \in \mathbb{M} , b \neq 0 \Longrightarrow \exists n , g \in \mathbb{M} . a = g \cdot \mathrm{fusc} ( n ) , b = g \cdot \mathrm{fusc} ( n + 1 )\) \(\blacktriangleleft\) fusc𝕄 ,⋅0X ,\(\mathbb{W}.\) ,\(0 \in \mathbb{M}\) ,𝕄0 ,INDC ,ℤ+16.5 Constructing the surjection from Calkin–Wilf
Reduction: if \(c \ne 0\), then \((c a) \div (c b) = a \div b\) (also with signs).
÷K …
\(a \in \mathbb{M} , b , c \in \mathbb{M} ^{\times} \Longrightarrow ( c \cdot a ) / ( c \cdot b ) = a / b , ( - ( c \cdot a ) ) / ( c \cdot b ) = ( - a ) / b\) \(\blacktriangleleft\) QR ,÷ℚ ,Ldiv ,⋅𝕄:D ,\(\mathbb{W}.\) ,AxℤMap an even number \(2n\) to \({\rm fusc}(n) \div {\rm fusc}(n+1)\) and an odd number \(2n+1\) to \(-{\rm fusc}(n) \div {\rm fusc}(n+1)\) (Calkin–Wilf enumeration with signs attached).
For a rational number \(\pm a \div b\), write \(a = g\,{\rm fusc}(n)\), \(b = g\,{\rm fusc}(n+1)\) by LCW and reduce, and it appears as a value; so this correspondence is a surjection.
\(\exists f \, f \in \mathbb{M} \stackrel{\rm S}\to \mathbb{Q}\) \(\blacktriangleleft\) ax_s ,fusc𝕄 ,÷K ,⋅0X ,\(\mathbb{W}.\) ,\(0 \in \mathbb{M}\) ,𝕄0 ,INDC ,ℤ+