So far we have assumed that the halting problem is undecidable: \[ \probHALT = \setbuild{\encoding{M, w}}{M \text{ is a Turing machine that halts on } w} \] and used this to prove that other problems are undecidable using Turing reductions.
Two finite sets \(A\) and \(B\) are the same size if and only if we can find a bijection between them.
Recall: a bijection \(f: A \to B\)
is both one-to-one (injective) and onto (surjective).
Furthermore, \(|A| < |B|\) if and only if there is no onto function \(f: A \to B\).
(Equivalently, there is no injective function \(f: B \to A\).)
No onto function exists, so
\(|\{1, 2\}| < |\{3, 4, 5\}|\)
We can use this approach of comparing sizes by establishing correspondences to define what it means for one set to be smaller than another:
For any two sets \(A\) and \(B\), we say that \(|A| \ge |B|\) if and only if there exists an onto function \(f: A \to B\).
In the previous example, we can exhibit an onto function from \(\{3, 4, 5\}\) to \(\{1, 2\}\) to conclude \(|\{3, 4, 5\}| \ge |\{1, 2\}|\). \[ f(3) = 1, \quad f(4) = 2, \quad f(5) = 2. \]
But now we can apply the definition to compare infinite sets!
Can we find an onto function from \(\N\) to \(\Z\)?
We can find an onto function from \(\N\) to \(\Z\) by “zig-zagging” through the integers.
\[ \begin{aligned} \\ &0 \quad 1 \quad 2 \quad 3 \quad 4 \quad 5 \quad 6 \quad 7 \quad 8 \quad \cdots \\ \\ \cdots \quad -4 \quad -3 \quad -2 \quad -1 \quad &0 \quad 1 \quad 2 \quad 3 \quad 4 \quad \cdots\\ \end{aligned} \]
\[ \fragment{ f(n) = \begin{cases} -\frac{n}{2} & \text{ if } n \text{ is even.} \\ \left \lceil \frac{n}{2} \right \rceil & \text{ if } n \text{ is odd} \end{cases} } \]
Thus also \(|\N| \ge |\Z|\), and so \(|\N| = |\Z|\).
Let’s now consider the rational numbers \(\Q\). \[ \Q = \setbuild{\frac{n}{d}}{n \in \Z, d \in \N^+ } \]
It looks like there are way more of these!
We’ll start out with just the positive rationals \(\Q^+\).
Clearly \(|\Q^+| \ge |\N^+|\) since \(\N^+ \subsetneq \Q^+\), and thus \(|\Q^+| \ge |\N|\).
True or false: \(|\N^+| \ge |\N|\)?
Let’s now consider the rational numbers \(\Q\). \[ \Q = \setbuild{\frac{n}{d}}{n \in \Z, d \in \N^+ } \]
It looks like there are way more of these!
We’ll start out with just the positive rationals \(\Q^+\).
Clearly \(|\Q^+| \ge |\N^+|\) since \(\N^+ \subsetneq \Q^+\), and thus \(|\Q^+| \ge |\N|\).
The following won’t work: \[ \frac{1}{1}, \; \fragment{\frac{1}{2},} \; \fragment{\frac{1}{3},} \; \fragment{\frac{1}{4}, \; \cdots,} \; \fragment{\frac{2}{1},} \; \fragment{\frac{2}{2},} \; \fragment{\frac{2}{3}, \; \frac{2}{4}, \; \cdots,} \; \fragment{\frac{3}{1}, \; \frac{3}{2}, \; \frac{3}{3}, \; \cdots} \hspace{20em} \]
Larger numerators aren’t reached at any finite step! Numerator and denominator must change together!
Let’s now consider the rational numbers \(\Q\). \[ \Q = \setbuild{\frac{n}{d}}{n \in \Z, d \in \N^+ } \]
It looks like there are way more of these!
We’ll start out with just the positive rationals \(\Q^+\).
Clearly \(|\Q^+| \ge |\N^+|\) since \(\N^+ \subsetneq \Q^+\), and thus \(|\Q^+| \ge |\N|\).
1 | 2 | 3 | 4 | |
---|---|---|---|---|
1 | 1/1 | 2/1 | 3/1 | 4/1 |
2 | 1/2 | 2/2 | 3/2 | 4/2 |
3 | 1/3 | 2/3 | 3/3 | 4/3 |
4 | 1/4 | 2/4 | 3/4 | 4/4 |
Did our earlier enumeration of \(\Q\) correspond to a bijection?
We conclude that \(|(0, 1)| \ge |\R^+| \ge |\R|\) and so \(|(0, 1)| = |\R|\).