Showing that not all reals are algebraic using countability

abstract-algebraelementary-set-theoryproof-verificationreal-analysis

Definition: A number $z\in\mathbb{C}$ is said to be algebraic if there exist integers $a_0,a_1,\dots,a_n$ not all zero, such that
$$
a_nz^n+a_{n-1}z^{n-1}+\cdots+a_1z+a_0=0
$$

I want to show that not every real number is algebraic. I thought in a simple argument but don't feel it's right: if every real was algebraic, for any $x\in\mathbb{R}$ we can find a sequence of integers $(a_0, a_1,\dots,a_n)\in\mathbb{Z}^{n+1}$ such that the equality above holds for $z=x$. So we can define a function $f:\cup_{n\in\mathbb{N}}\mathbb{Z}^n\to\mathbb{R}$ that for each real associate a sequence of integers as described in the definition. So $f$ would be surjective, then once $\cup_{n\in\mathbb{N}}\mathbb{Z}^n$ is countable, so would be $\mathbb{R}$, a contradiction because $\mathbb{R}$ is uncountable. So not all real numbers are algebraic.

Is this line of reasoning right? Thanks in advance.

Best Answer

You’re pretty much there. Note that you use contradiction here, but there’s really no need:

Since $\bigcup_{n\in\mathbb{N}}\mathbb{Z}^n$ is countable, its image is countable. Moreover, the image must contain the set of algebraic numbers, and so algebraic numbers are countable. Since the reals are uncountable, the sets cannot be equal.

Fun note: this is a nice proof to see why algebraic numbers are measure zero in $\mathbb{R}$!