[Math] Is the set of all irrational numbers countable

elementary-set-theoryproof-verification

Let us assume:
The countable union of countable sets is countable.
$\mathbb{R}$ is an uncountable set.
Any subset of a countable set is countable.

Let $\mathbb I = \{\, x\mid x\in \mathbb{R} \land x \notin \mathbb{Q} \,\}$

$\mathbb{I} \cup \mathbb{Q} = \mathbb{R}$ $\rightarrow$ The union of the rational and irrational real numbers is uncountable.

Let's show that $\mathbb{Z}$ is countable.
Define the function:
$f: \mathbb{N} \rightarrow \mathbb{Z}$ as

$f(x) =
\begin{cases}
\frac{x}{2}, & \text{if $x$ is even} \\
\frac{1-x}{2}, & \text{if $x$ is odd}
\end{cases}$

Now we must show that the function $f$ is bijective.
$1-1$:
Assume $f(x)=f(y)$ for some $x,y \in \mathbb{N}$

Assume $x$ and $y$ are even, $f(x)=f(y) \rightarrow \frac{x}{2}=\frac{y}{2} \rightarrow x=y$

Assume $x$ and $y$ are odd, $f(x)=f(y) \rightarrow \frac{1-x}{2}=\frac{1-y}{2} \rightarrow x=y$

Now assume $x$ is odd and $y$ is even, $f(x)=f(y) \rightarrow \frac{1-x}{2}=\frac{y}{2} \rightarrow \frac{-x}{2}= \frac{y}{2}-\frac{1}{2} \rightarrow -x=y$
which cannot be true since $x,y \in \mathbb{N}$. Similar case for $x$ is even and $y$ is odd.
The last two show that $x$ and $y$ must have the same parity.
So, for all possible cases, $f(x)=f(y) \rightarrow x=y$ which shows that $f$ is $1-1$.

Onto:
Suppose $w \in \mathbb{Z}$.
If $w \gt0$, then $2w$ is even and $f(2w)=\frac{2w}{2}=w$.
If $w \leq0$, then $1-2w$ is odd and $f(1-2w)=\frac{1-(1-2w)}{2}=w$.
In both cases, $w\in Rng(f) \rightarrow f$ maps onto $\mathbb{Z}$.

This implies that $\mathbb{Z}\approx \mathbb{N} \rightarrow \mathbb{Z}$ is countable.

Now that we know that $\mathbb{Z}$ is countable, we can show that $\mathbb{Q}$ is countable.

For each $n \in \mathbb{N}$, define $A_n$ to be the set

$A_n = \{\, \frac{m}{n}\mid m\in \mathbb{Z} \,\}$

Since $\mathbb{Z}$ is countable, each $A_n$ is countable.

So, $\forall q \in \mathbb{Q}, \exists n \in \mathbb{N} \mid q \in \mathbb{N}$

So, $\cup_{n \in \mathbb{N}}A_n =\mathbb{Q} \rightarrow \mathbb{Q}$ is countable.

Since, $\mathbb{I} \cup \mathbb{Q} = \mathbb{R}$, then $\mathbb{I}$ must be uncountable.

So, the set of irrational reals is not countable.

I am looking for input on this proof for a class.

Best Answer

It is definitely not true that $\Bbb Q\subset\Bbb Z$. You will have to show that $\Bbb Q$ is countable to prove this result. One way you can do that is to define the sets $$ A_n = \{\:n/k : \text{$k$ is a nonzero integer}\:\},\qquad\text{where $n\in\Bbb Z_{\ge0}$,} $$ each of which is countable. Then $\bigcup_n A_n$ is the countable union of countable sets and is equal to $\Bbb Q$.

Related Question