The proof that √2 is irrational is five lines long and it still bothers me
Proof by contradiction, a legend about a drowned mathematician, and why my code can never store the diagonal of a square.
Tushar PawarDropper Sample
1 Sept 2026 · 4 min read

Photo: Lucasbosch · CC BY-SA 3.0 · via Wikimedia Commons
Last month I was sitting in the library after a bad mock, too fried for another problem, and I picked up an old maths book somebody had left on the table. It had the proof that is irrational. I knew the result from school (it's in the class 10 NCERT), but I'd only memorised it. This time I read it slowly and I think it's one of the best things I've ever seen in maths. So here it is, along with the parts where I got stuck.
The claim
cannot be written as a fraction of two whole numbers. That's what "irrational" means.
You can't test every fraction, because there are infinitely many. So you don't hunt for the fraction. You assume one exists and see what breaks. That's proof by contradiction.
The proof
Assume , where and are positive integers with no common factor. We can always cancel a fraction down until that's true, and this setup is the important part.
- Square both sides: , so .
- So is even. If were odd, would be odd (odd times odd is odd). So must be even: for some integer .
- Substitute: , so , so .
- So is even, and by the same argument as step 2, is even.
- Now both and are even. They share the factor 2. That contradicts "no common factor".
The assumption led to nonsense, so it was false: is irrational. ∎
I stared at it for ten minutes trying to find the trick, and there isn't one. The trick is the very first line, "lowest terms". The contradiction only appears because we insisted the fraction was already fully simplified.
Where I got stuck: why doesn't this prove √4 is irrational?
Try the same steps on . You get , which just says . That's a perfectly fine fraction () and nothing contradicts anything. The proof for 2 works because forces both and to be even. With 4 you only learn that is twice .
It generalises, and primes are the reason
For : , so divides . The key step is that if a prime divides , it must divide . This works for primes (it's why the proof is written for 2 and 3 and 5 but we'd need more care for 6 or 10). Then , so , so , so divides as well. Contradiction again.
The full version: for a positive integer , is irrational unless is a perfect square. The cleanest proof uses prime factorisation: in , every prime appears an even number of times on the left side (squares do that), so every prime in must also appear an even number of times, which means is a perfect square.
The legend
The story goes that this was discovered in the school of Pythagoras, where the belief was that everything is a ratio of whole numbers, and that the person who proved otherwise was thrown overboard. Historians aren't sure it happened or who the person was, so I treat it as a great story and not a fact. What is solid is that the ancient Greeks knew the diagonal of a square of side 1 has no whole-number ratio with its side. By Pythagoras's theorem that diagonal is . The simplest shape you can draw, and its diagonal is a number no fraction can name.
And in code
>>> import math
>>> math.sqrt(2)
1.4142135623730951
>>> math.sqrt(2) ** 2
2.0000000000000004
>>> 0.1 + 0.2
0.30000000000000004
A computer stores numbers with a finite number of bits, so gets rounded to the nearest value it can represent. Squaring that gives something a hair away from 2. (The 0.1 case is different. It's rational, but its binary expansion goes on forever, like 1/3 does in decimal, so it also can't be stored exactly.) Floating point is a polite lie we all agree to live with.
A cute bonus
Can an irrational number raised to an irrational power be rational? Take . Either is rational, in which case we're done with . Or is irrational, in which case take and :
which is rational. Either way the answer is yes, and the proof never even tells us which case is true. (It's actually known that is irrational, but that needs much heavier machinery to prove.)
I think this is why I like maths. It's one of the only places where you can be completely sure, and it fits on a page.
12 responses
Sign in to join the conversation.
[+][–]Arjun Nair12thSample· 1mo ago
Step 2 is the quiet hero. "If is divisible by a prime, is too" is the whole thing, and it fails for composite numbers, which is exactly why your √4 check fails to contradict. Nice write-up. The √2^√2 bonus is my favourite non-constructive proof of all time.
[+][–]Ishaan Bose11thSample· 1mo ago
so since √2 is irrational that means its decimal never ends, right? and the reverse should also be true, if a decimal never ends it's irrational. like 0.333... never ends so it must be irrational too?
[+][–]Kabir Joshi11thSample· 1mo ago
The first part is fine, the "reverse" isn't. Irrational means the decimal never ends and never repeats a pattern. 0.333... never ends but it repeats forever, and it equals 1/3, so it's rational. Every fraction gives either a terminating decimal or a repeating one. Irrational numbers like √2 or π never settle into a repeating pattern.
[+][–]Ishaan Bose11thSample· 1mo ago
ahh okay that makes sense, never ends AND no pattern. noted
[+][–]Rohan Sharma11thSample· 1mo ago
me trying to find √2 as a fraction: 1414/1000, 14142/10000... "close enough" the proof: "no"
[+][–]Vivek Mishra12thSample· 1mo ago
I read this twice. Step 2 I understood only after I wrote some odd numbers: 3 squared is 9, 5 squared is 25, 7 squared is 49. Always odd. So if p squared is even, p cannot be odd. Is it okay to understand a proof by writing small examples? Sometimes I feel that it is not "real" maths.
[+][–]Tushar PawarDropperSample· 1mo agoAuthor
Totally okay. That's how I got it too. Examples are how you find out why a step is true. The proof is then the version that works for all numbers, not just the ones you tried. Both parts are real maths.
[+][–]Aman YadavDropperSample· 1mo ago
Five lines. Got it on first read. The √2^√2 thing took me three reads. Good one.
[+][–]Ananya Reddy11thSample· 1mo ago
Very clear. One doubt though. Is π irrational for the same reason, like a "never repeats" thing? How do we actually know?
[+][–]Tushar PawarDropperSample· 1mo agoAuthor
It's true, but the proof is harder. There's no simple divisibility trick like with √2. It was first proved in the 1760s using calculus and infinite series, and the argument is much longer. "The digits don't seem to repeat" isn't a proof, since we can only ever look at finitely many digits. That's the difference between looking for a pattern and proving there isn't one.
[+][–]Harsh Gupta12thSample· 1mo ago
my relationship with √2: irrational. my relationship with step 5: also irrational. but ok this was fun
[+][–]Dev Agarwal12thSample· 1mo ago
Business-brain takeaway: "assume the opposite and see what breaks" is also a decent way to test a startup idea 😅 Assume it works, then ask which assumption has to be true, then check if that's even possible.





