Thursday, June 2, 2011

Regarding the square root of n

Have you ever caught yourself (assuming you like maths) proving that numbers like $\sqrt{2}$ or $\sqrt{5}$ etc. are irrationals. Here is, more or less, a general statement with the proof.

For $\forall n \in \mathbb{N}$ (natural numbers), either $\sqrt{n} \in \mathbb{N}$ or $\sqrt{n} \in \mathbb{I}$ (irrational numbers, i.e. real numbers minus rational numbers).

There are two possible cases:

1. If $n = p^2$, $p\in \mathbb{N}$ ⇒ $\sqrt{n}=p\in \mathbb{N}$

2. If $n \ne p^2$ or there is no such a $p \in \mathbb{N}$ that would satisfy $n = p^2$, then $\sqrt{n}$ is irrational.

Let's suppose the contrary, i.e. there $\exists p,q \in \mathbb{N}$ and $\gcd(p,q) = 1$ (greatest common divisor) so that
$$\sqrt{n}=\frac{p}{q}$$
This means that $n·q^2=p^2$. From $\gcd(p,q) = 1 \Rightarrow \gcd(p^2,q^2) = 1$.

From the Bézout’s theorem, there $\exists z,t \in \mathbb{Z}$ (integers) so that
$$z\cdot p^2 + t\cdot q^2 = 1 \iff\\ z\cdot n\cdot q^2 + t\cdot q^2 = 1 \iff\\ q^2 \cdot (z\cdot n + t) = 1$$ which means $q^2$ divides $1$, but this is possible only if $q = 1$. As a result $n = p^2$ - contradiction with our initial assumption.

This proves the statement.