# Proof that $\sqrt{2}$ is irrational, using the prime factorization

I am trying to prove that $$\sqrt{2}$$ is irrational, assuming the fundamental theorem of arithmetic is true. Here is my attempt.

Suppose for the sake of contradiction $$\sqrt{2}$$ is rational, and write $$\sqrt{2} = \frac{a}{b}$$ for $$a,b \in \mathbb{Z}$$, $$b \neq 0$$, where $$a,b$$ have no common factors. As $$\left(\frac{a}{b}\right)^2 = \left(- \frac{a}{b}\right)^2$$, we can assume without loss of generality that $$a,b$$ are both nonnegative. By the fundamental theorem of arithmetic, there exist a unique prime factorization (up to ordering of factors) of $$a$$ and $$b$$. Let $$m$$ and $$n$$ be the number of prime factors, with multiplicity, of $$a$$ and $$b$$, respectively. Then $$2 = \frac{a^2}{b^2}$$, so $$2b^2 = a^2$$. As $$a$$ has $$m$$ prime factors, $$m^2$$ has $$2m$$ prime factors. Similarly, $$b^2$$ has $$2n$$ prime factors as $$b$$ has $$n$$ prime factors. Therefore, $$2b^2$$ has $$2n+1$$ prime factors. But $$2n+1$$ is odd and $$2m$$ are even, contradicting the fact that $$2b^2 = a^2$$ has a unique prime factorization. So $$2b^2 \neq a^2$$, and no such quotient of rationals exists.

I feel like there are a number of holes in this proof and things I could've said more succinctly. How does it look?

• Did you mean to write "as $a$ has $m$ prime factors, $a^2$ has $2m$ prime factors"? But that's not true. $2$ has $1$ prime factor, and so does $4$.
– lulu
Nov 12, 2021 at 20:49
• When you refer to the number of prime factors, you should make it clear you're counting the repetitions, like in $8=2^3$ only one prime factor 2, but because of power 3 there are 3 prime factors just with one counted 3 times. Nov 12, 2021 at 20:49
• I think you can salvage your proof if you just take greater care with what you write.
– lulu
Nov 12, 2021 at 20:51
• I quite like your proof. As others have said, people could interpret the sentence "$x$ has $y$ prime factors" as "$x$ has $y$ different prime factors" rather than assuming that repetition also counts - so maybe you can clarify that bit. Otherwise, it is quite elegant.
– user700480
Nov 12, 2021 at 22:02

It looks fine. Note than you technically do not need to count all prime factors of $$a,b$$ but only the exponent of $$2$$. (Your proof then basically relies on $$2b^2=a^2$$, so the exponent of $$2$$ on the right is even and on the left it’s odd).
But you can use the fundamental theorem more elegantly. Try to proof that any root of a positive integer is either integral or irrational. To do this take any rational number $$p/q$$ and try to deduce from the factorisations of $$p,q$$ when $$p/q$$ is integral, and when it isn’t. Then try to prove that $$p^2/q^2$$ (or even $$p^n/q^n$$) does not change anything about this property. (You can also trivially extend the FT to the rational numbers, giving each rational number a unique prime factorisation with arbitrary integral exponents.)
EDIT: Also you do not really need the FT for your prove. Suppose $$a,b$$ are coprime. Then $$2b^2=a^2$$ implies $$2|a$$ by the primality property $$p|ab\Leftrightarrow p|a\lor p|b$$. But then $$a=2c$$ and thus $$2b^2 = 4c^2$$, so $$b^2=2c^2$$. Thus $$2|b$$, which contradics $$a,b$$ coprime. This prove does not work for roots composite numbers though (it does work if the number is divided by some prime $$p$$, but not by $$p^2$$. So the FT gives us a much stronger result.