Skip to content

Instantly share code, notes, and snippets.

@jimblandy
Last active October 14, 2021 17:59
Show Gist options
  • Save jimblandy/b1d5cd035b0794b652425db486a07aa8 to your computer and use it in GitHub Desktop.
Save jimblandy/b1d5cd035b0794b652425db486a07aa8 to your computer and use it in GitHub Desktop.
Proof that the square root of two is irrational

Prep questions:

  • Suppose x is even. If we multiply it by something, is the product always even, always odd, or does it depend?
  • Suppose x is even. Is x^2 always even, always odd, or does it depend?
  • Suppose x is odd. Is x^2 always even, always odd, or does it depend?
  • Suppose p/q is a fraction in lowest terms. Can both the top and bottom be even? Can they both be odd? Can one be even, and one odd?
  • What happens when we square a fraction?
  • What happens when we square a product, say, pq?

Rules:

  • "x is even" means "For some integer k, x = 2k."
  • Squaring an even number always gives another even number.
  • Squaring an odd number always gives another odd number.
  • Squaring a fraction is the same as squaring its top and bottom.

Suppose sqrt(2) was some fraction p/q, where p and q are integers.

We can assume this is in lowest terms: p and q have no common factors. In particular, p and q can't both be even.

  • So 2 = p^2 / q^2.
  • So 2 q^2 = p^2
  • So p^2 is even.
  • So p must be even. Suppose it is 2k for some k.
  • So 2 q^2 = (2k)^2 = 4 k^2
  • So q^2 = 2 k^2
  • So q^2 is even.
  • So q is even.

But, if p and q are both even, then p/q wasn't in lowest terms, as we assumed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment