01 November 2012

On square roots of non-perfect-squares being irrational

I started reading baby Rudin for my commute recently and was intrigued by the fact that he proves square root of 2 is irrational then gives as an exercise to prove square root of 12 is irrational. Well, why not just prove that a square root of any non-perfect-square is irrational?

I must admit I couldn't finish the proof in my head on the way to work. It took the return trip to convince myself that I had a proof. So the problem is not as trivial as it seems after all.

Let N be a non-perfect-square number. Suppose there exist a rational number n/m such that (n/m)2 = N. In particular, such a rational number can be expressed in reduced terms so that gcd(n,m) = 1, so suppose that too. Let's start by noting that since N is not a perfect square, its prime factorization must have at least one prime number whose power is odd. Let this prime number be p, so that N = pkq for some odd integer k and some integer q whose prime factorization does not have p.

That means (n/m)2 = pkq, or equivalently, n2 = pkqm2. Thus pk divides n2. This implies pk divides n, since the set of integers is a unique factorization domain (if the prime factorization of n had j≠k as the power for p, then the prime factorization of n2 would have 2j as the power for p, but k is odd). So we can write n = pkr for some integer r, and n2 = p2kr2 = pkqm2. Therefore, pkr2 = qm2.

Remember that q was the prime factorization of N sans pk. So pk must divide m2. Again this implies pk divides m, but this contradicts our assumption gcd(n,m) = 1.