Part I · Numbers Chapter 6 of 60
Root two and the real numbers
The case of the square's diagonal: three independent expert reports prove that its length can't be written as a fraction. We look at how the Babylonians lived with it, what continued fractions are, and where the real numbers come from.
Builds on: 5 · Fractions
You will learn
- prove that √2, and in general √k when k isn't a perfect square, is irrational
- compute square roots the Babylonian way and expand numbers as continued fractions
- explain what the real numbers are and how algebraic numbers differ from transcendental ones
At the end of the last chapter we left a case open: the diagonal of a square with side $1$ has a length $d$ with $d^2 = 2$, but the Stern–Brocot tree, which contains every single fraction, can't find it. The path towards it goes down forever: $\frac32$, $\frac75$, $\frac{17}{12}$, $\frac{41}{29}$, closer and closer and never exact.
The suspicion is serious: it looks as though there is a length that can't be written as a fraction. For the ancient Greeks that was almost a crime against common sense. The Pythagoreans taught that "all is number", and by number they meant whole numbers and their ratios. In this chapter we'll run the investigation by the book: examine the evidence, commission three independent expert reports, hear the witnesses, and deliver a verdict after which the number line will never be the same.
The evidence: a square's diagonal
The oldest record of the inspection is Plato's dialogue Meno. Socrates draws a square in the sand and asks a slave boy to build a square with twice the area. The boy first doubles the side and gets a square four times as big. Then he tries a side one and a half times as long, and misses again. So Socrates draws the diagonal of the square and builds a square on it. This new square is made of four halves of the original, so its area is exactly twice as large.
For a square with side $1$, this means the square on the diagonal has area $2$, so the length of the diagonal is a number $d$ with $d^2 = 2$. Pythagoras' theorem (chapter 18) gives the same result, but we didn't even need it. This number is written $\sqrt2$.
Let's try to find a fraction $\frac mn$ with $m^2 = 2n^2$. Here are the best candidates with small denominators:
| $\frac mn$ | $\frac32$ | $\frac75$ | $\frac{17}{12}$ | $\frac{41}{29}$ | $\frac{99}{70}$ |
|---|---|---|---|---|---|
| $m^2$ | 9 | 49 | 289 | 1681 | 9801 |
| $2n^2$ | 8 | 50 | 288 | 1682 | 9800 |
Each time the miss is exactly one, first one way, then the other. There's also a pattern: each fraction comes from the one before by the rule $\frac mn \to \frac{m + 2n}{m + n}$. For example, $\frac75$ gives $\frac{7 + 10}{7 + 5} = \frac{17}{12}$.
Which fraction comes after $\frac{99}{70}$ in this sequence? Check how close its square is to two.
$\frac{99 + 2 \cdot 70}{99 + 70} = \frac{239}{169}$. Then $239^2 = 57{,}121$ and $2 \cdot 169^2 = 57{,}122$: a miss of one again, and $\frac{239}{169} \approx 1.4142012$ differs from $\sqrt2$ by less than two hundred-thousandths.
The search will never succeed, and that needs proving. Examples are powerless here: however many fractions we check, infinitely many remain unchecked. We need an argument that rules out all fractions at once.
An irrational number is a number on the number line (the length of a segment, say) that can't be written as a fraction $\frac pq$ with integers $p$ and $q$. The prefix "ir-" is a negation: not rational, "not a ratio".
The first report: parity
The most famous proof follows a scheme detectives use: assume the suspect is innocent and see where that leads. If it leads to an absurdity, the assumption was false.
Proof by contradiction: to prove a statement, assume it is false and derive a contradiction, something plainly impossible. Then the assumption is false and the statement is true.
There is no fraction $\frac mn$ whose square is $2$.
The idea: if such a fraction existed, it could be reduced to lowest terms, and we'll show that even then the numerator and denominator are both even.
Suppose such a fraction exists. Reduce it to lowest terms (chapter 5): $\sqrt2 = \frac mn$, where $m$ and $n$ have no common divisor except one. Square it: $m^2 = 2n^2$.
The right side is even, so $m^2$ is even. Then $m$ is even as well: the square of an odd number is odd, since $(2k + 1)^2 = 4k^2 + 4k + 1$. Write $m = 2k$. We get $4k^2 = 2n^2$, that is, $n^2 = 2k^2$. Now $n^2$ is even, and with it $n$.
Both $m$ and $n$ are even: they have the common divisor $2$. But we reduced the fraction to lowest terms! A contradiction: the assumption is false, and $\sqrt2$ is not a fraction.
The second report: prime factorization
The second report uses the main tool from the chapter on primes: every natural number can be broken into prime factors, and in only one way.
This report gives far more than the answer about $\sqrt2$.
If a natural number $k$ is not the square of an integer, then $\sqrt k$ is irrational. In other words, the square root of a natural number is either a whole number or irrational: it's never a non-integer fraction.
The idea: look at the powers in which primes occur on the two sides of $m^2 = k n^2$; they turn out to have different parity on the left and on the right.
Suppose the opposite: $\sqrt k = \frac mn$ with natural $m$ and $n$. Square it: $m^2 = k n^2$.
Factorize $m$ into primes: $m = p_1^{a_1} p_2^{a_2} \cdots p_s^{a_s}$. Then $m^2 = p_1^{2a_1} p_2^{2a_2} \cdots p_s^{2a_s}$: in a square every prime occurs to an even power. The same goes for $n^2$.
If every prime occurred in $k$ to an even power, $k = q_1^{2c_1} \cdots q_t^{2c_t}$ would be the square of $q_1^{c_1} \cdots q_t^{c_t}$. By assumption it isn't, so some prime $p$ occurs in $k$ to an odd power $c$. In the product $k n^2$ it occurs to the power $c + 2e$, where $2e$ is its power in $n^2$; this number is odd. But in $m^2$ the power of the same $p$ is even.
So the number $m^2 = k n^2$ has two different prime factorizations: in one $p$ occurs to an even power, in the other to an odd one. That contradicts the fundamental theorem of arithmetic: the factorization is unique. So $\sqrt k$ is not a fraction.
For $k = 2$ this is a second proof that $\sqrt2$ is irrational: two occurs in $m^2$ to an even power and in $2n^2$ to an odd one. And it shows at once that $\sqrt3$, $\sqrt5$, $\sqrt6$, $\sqrt{10}$ are irrational, while $\sqrt{49} = 7$.
Which of these numbers is rational?
$0.09 = \frac{9}{100} = \left(\frac{3}{10}\right)^2$, so $\sqrt{0.09} = 0.3$. For a fraction the rule is the same: the square root of $\frac ab$ in lowest terms is rational only if both $a$ and $b$ are perfect squares.
Identification is worth practising. The trainer shows a number and you decide whether it's rational; at level three the format is exam-style: out of four numbers, find the only rational one.
The third report: descending squares
The third report counts nothing but areas. It was invented by the American logician Stanley Tennenbaum in the mid-twentieth century and made famous by John Conway.
The idea: if $\sqrt2 = \frac mn$, then a square with side $m$ has the same area as two squares with side $n$. Put these squares into one drawing, and out of it comes the same kind of pair, only with smaller numbers. The proof rests on a single property of natural numbers.
There is no infinite decreasing chain of natural numbers $m_1 > m_2 > m_3 > \dots$
Each natural number in such a chain is at least $1$ less than the one before: $m_2 \le m_1 - 1$, $m_3 \le m_1 - 2$, and in general $m_{j+1} \le m_1 - j$. For $j = m_1$ we'd get $m_{j+1} \le 0$, but natural numbers are positive. So the chain breaks off within $m_1$ steps.
Now the proof itself, as a drawing. It all rests on one equation of areas.
The idea: from a pair $m$, $n$ with $m^2 = 2n^2$ the drawing by itself makes a pair of the same kind with smaller numbers, and natural numbers can't shrink forever.
This way of reasoning is called the method of infinite descent; Pierre de Fermat used it a great deal in the seventeenth century. Now let's test the drawing on real numbers: what happens with a nearly right fraction?
With nearly right fractions the descent honestly stops, and you can see why. Expand the brackets: $(2n - m)^2 - 2(m - n)^2 = 4n^2 - 4mn + m^2 - 2m^2 + 4mn - 2n^2 = 2n^2 - m^2$. So if $m^2 - 2n^2 = \pm 1$, the new pair has difference $\mp 1$: the error doesn't vanish but persists until the numbers get really small, at $\frac11$, where one square clearly isn't equal to two. For a genuine root the error would be zero, and there would be no bottom.
Notice that the descent is the sequence from the table at the start of the chapter, read backwards. The rule $\frac mn \to \frac{m + 2n}{m + n}$ leads up, to better and better approximations; the rule $\frac mn \to \frac{2n - m}{m - n}$ leads down.
The witnesses' statements
For the Greeks the discovery sounded different: not "this number isn't a fraction" but "these segments have no common measure". In the last chapter we looked for a common measure for two fractions and always found one. For the side and the diagonal of a square there isn't one.
Two segments are incommensurable if no segment fits a whole number of times into both of them. The ratio of the lengths of incommensurable segments is an irrational number.
If the side and the diagonal had a common measure, the side would be $n$ measures, the diagonal $m$ measures, and we'd get $\sqrt2 = \frac mn$. Euclid's algorithm with the rectangle cut into squares never finishes for such segments; we'll come back to this.
The real consequence of the discovery is less dramatic and far more important. Greek mathematicians separated magnitudes from numbers: lengths, areas and angles were studied by geometry, while "number" meant only whole numbers. Eudoxus built a theory of ratios that worked for incommensurable segments too, and it became Book V of Euclid's Elements. For almost two thousand years after that, geometry talked about lengths without calling them numbers.
Living without an answer
More than a thousand years before the Greeks, the Babylonians knew $\sqrt2$ with astonishing accuracy, and apparently weren't in the least bothered that it wasn't a fraction.
Yale University holds a clay tablet, YBC 7289, round and palm-sized, 3600–3800 years old. It shows a square with its diagonals. Beside the side is written $30$, and along the diagonal are numbers that in sexagesimal notation (remember the Babylonian hall of chapter 1?) mean
$$1;24,51,10 = 1 + \frac{24}{60} + \frac{51}{60^2} + \frac{10}{60^3} \approx 1.41421296,$$and below it $42;25,35$, the length of the diagonal when the side is $30$. The true $\sqrt2 = 1.41421356\dots$: the Babylonian value is off by less than one millionth. On a tape a kilometre long, that error is less than a millimetre.
How the Babylonians got such accuracy is unknown. There is a simple method often called Babylonian, although the first person to write it down was Heron of Alexandria in the first century AD. The idea is geometric. We need a square of area $2$. Take any rectangle of area $2$, with sides $x$ and $\frac2x$. If $x$ is too big, then $\frac2x$ is too small, and the side of the square we want lies between them. Take their average and you get a rectangle much more like a square.
The method converges very fast: the number of correct digits roughly doubles at each step, $1$, $3$, $6$, $12$, $24$. Here's why.
If $x_n > 0$, then $x_{n+1} - \sqrt2 = \dfrac{(x_n - \sqrt2)^2}{2x_n}$. So from $x_1$ on, all the approximations are at least $\sqrt2$, and at each step the error is roughly squared.
The idea: bring $x_{n+1} - \sqrt2$ to a common denominator and recognise a perfect square in the numerator.
By the formula, $x_{n+1} = \frac12\left(x_n + \frac2{x_n}\right) = \frac{x_n^2 + 2}{2x_n}$. Subtract $\sqrt2 = \frac{2\sqrt2\,x_n}{2x_n}$: we get $x_{n+1} - \sqrt2 = \frac{x_n^2 - 2\sqrt2\,x_n + 2}{2x_n}$. Since $2 = (\sqrt2)^2$, the numerator is $x_n^2 - 2 \cdot \sqrt2 \cdot x_n + (\sqrt2)^2 = (x_n - \sqrt2)^2$, the square of a difference. That's the formula.
A square is never negative and $2x_n > 0$, so $x_{n+1} \ge \sqrt2$ for any $x_n > 0$. And if $x_n$ is already close to $\sqrt2$, the denominator $2x_n \approx 2.8$, and the new error is roughly the square of the old one divided by $2.8$: an error of $10^{-3}$ turns into about $10^{-7}$, an error of $10^{-6}$ into $10^{-13}$.
Later it will turn out that this is a special case of Newton's method, which computers and calculators use to find roots today (chapter 27).
Make one step of the Babylonian method for $\sqrt3$, starting from $x_0 = 2$.
$x_1 = \frac12\left(2 + \frac32\right) = \frac74 = 1.75$. Check: $1.75^2 = 3.0625$, a little more than three, as it should be. The true $\sqrt3 \approx 1.732$.
Fingerprints: continued fractions
The decimal $\sqrt2 = 1.41421356\dots$ says nothing about the character of the number: the digits come in no visible order. There is a notation in which the character shows at once. It grows out of Euclid's algorithm.
Remember the rectangle cut into squares (chapter 4). From a $43 \times 30$ rectangle cut off $1$ square $30 \times 30$, from the leftover $30 \times 13$ cut off $2$ squares, from the leftover $13 \times 4$ cut off $3$ squares, and the last leftover $4 \times 1$ splits exactly into $4$ squares. The numbers $1, 2, 3, 4$ are written like this:
$$\frac{43}{30} = 1 + \cfrac{1}{2 + \cfrac{1}{3 + \cfrac{1}{4}}} = [1;\ 2,\ 3,\ 4].$$A continued fraction writes a number in the form $a_0 + \cfrac{1}{a_1 + \cfrac{1}{a_2 + \dots}}$, where $a_0$ is an integer and $a_1, a_2, \dots$ are natural numbers. For short one writes $[a_0;\ a_1,\ a_2,\ \dots]$, and the numbers $a_k$ are called the terms (or partial quotients: they are the quotients from Euclid's algorithm).
The continued fraction of a number is finite if and only if the number is rational.
The idea: for a fraction, building the continued fraction is exactly Euclid's algorithm, and that always stops.
Suppose the continued fraction is finite: $x = [a_0;\ a_1,\ \dots,\ a_k]$. Evaluate it from the bottom storey up. The last storey $a_k$ is an integer. If the storey below equals a fraction $\frac rs$, then the one above it equals $a + \frac1{r/s} = a + \frac sr = \frac{ar + s}{r}$, again a fraction. Climbing up like this to the top, we find that $x$ is a fraction.
Conversely, let $x = \frac pq$. The first step is division with remainder: $p = a_0 q + r_1$, $0 \le r_1 < q$, and $x = a_0 + \frac{r_1}{q}$. If $r_1 = 0$, we're done. Otherwise the next number is $\frac{q}{r_1}$, and we divide with remainder again: $q = a_1 r_1 + r_2$. These are the steps of Euclid's algorithm (chapter 4): the remainders $q > r_1 > r_2 > \dots \ge 0$ are decreasing natural numbers, and by the principle of descent they can't decrease forever, so some remainder becomes zero. There the continued fraction ends.
So for $\sqrt2$ the cutting never ends. But there's a pattern in it.
$\sqrt2 = 1 + \cfrac{1}{2 + \cfrac{1}{2 + \cfrac{1}{2 + \dots}}} = [1;\ 2,\ 2,\ 2,\ \dots]$.
The idea: after the first step the leftover repeats exactly.
The whole part of $\sqrt2$ is $1$, because $1 < \sqrt2 < 2$ ($1^2 < 2 < 2^2$). Cut off one square; the leftover is $\sqrt2 - 1$. Its reciprocal is $\frac1{\sqrt2 - 1} = \sqrt2 + 1$, since $(\sqrt2 - 1)(\sqrt2 + 1) = (\sqrt2)^2 - 1 = 1$. The whole part of $\sqrt2 + 1$ is $2$, and $\sqrt2 + 1 = 2 + (\sqrt2 - 1)$: the same leftover as one step earlier. So the next step repeats this one, and so does the one after: every term after the first is $2$.
If you cut the continued fraction off at some term, you get an ordinary fraction, called a convergent.
A convergent is the value of the continued fraction cut off at the $k$-th term. For $\sqrt2$ these are $1$, $\frac32$, $\frac75$, $\frac{17}{12}$, $\frac{41}{29}$, …, exactly the fractions we were trying out at the start of the chapter.
Any number can be approximated by a fraction with denominator $q$ to within $\frac1{2q}$: just take the nearest of $\frac0q, \frac1q, \frac2q, \dots$ Convergents do much better.
Let $\frac{p_k}{q_k}$ and $\frac{p_{k+1}}{q_{k+1}}$ be two consecutive convergents of $x$. Then $x$ lies between them, and $\left|x - \frac{p_k}{q_k}\right| \le \frac1{q_k q_{k+1}} \le \frac1{q_k^2}$, where from $k = 1$ on the last inequality is strict.
Proof
The idea: consecutive convergents have the same property as neighbours in the Stern–Brocot tree, and $x$ itself is their "weighted mediant".
Formulas. Set $p_{-1} = 1$, $q_{-1} = 0$, $p_0 = a_0$, $q_0 = 1$ and $p_k = a_k p_{k-1} + p_{k-2}$, $q_k = a_k q_{k-1} + q_{k-2}$. We prove that for any positive $t$ the continued fraction $[a_0;\ a_1,\ \dots,\ a_{k-1},\ t]$ equals $\frac{t p_{k-1} + p_{k-2}}{t q_{k-1} + q_{k-2}}$. For $k = 1$: $a_0 + \frac1t = \frac{t a_0 + 1}{t} = \frac{t p_0 + p_{-1}}{t q_0 + q_{-1}}$. From $k$ to $k + 1$: the fraction $[a_0;\ \dots,\ a_k,\ t]$ is $[a_0;\ \dots,\ a_{k-1},\ a_k + \frac1t]$, and by assumption it equals $\frac{(a_k + \frac1t) p_{k-1} + p_{k-2}}{(a_k + \frac1t) q_{k-1} + q_{k-2}}$. Multiply the numerator and denominator by $t$ and group: $\frac{t(a_k p_{k-1} + p_{k-2}) + p_{k-1}}{t(a_k q_{k-1} + q_{k-2}) + q_{k-1}} = \frac{t p_k + p_{k-1}}{t q_k + q_{k-1}}$. With $t = a_k$ this shows that $\frac{p_k}{q_k}$ is exactly the $k$-th convergent, and with $t = x_{k+1}$ (the number that stands in place of the term $a_{k+1}$ together with the whole tail) that $x = \frac{x_{k+1} p_k + p_{k-1}}{x_{k+1} q_k + q_{k-1}}$.
Neighbours. Substitute the formulas: $p_{k+1} q_k - p_k q_{k+1} = (a_{k+1} p_k + p_{k-1}) q_k - p_k (a_{k+1} q_k + q_{k-1}) = -(p_k q_{k-1} - p_{k-1} q_k)$. At each step the expression only changes sign, and at the start $p_0 q_{-1} - p_{-1} q_0 = -1$. So $|p_{k+1} q_k - p_k q_{k+1}| = 1$, and the distance between consecutive convergents is $\frac{|p_{k+1} q_k - p_k q_{k+1}|}{q_k q_{k+1}} = \frac1{q_k q_{k+1}}$.
Where $x$ lies. By the formula above, $x = \frac{x_{k+2} p_{k+1} + p_k}{x_{k+2} q_{k+1} + q_k}$, which is the mediant of $\frac{x_{k+2} p_{k+1}}{x_{k+2} q_{k+1}} = \frac{p_{k+1}}{q_{k+1}}$ and $\frac{p_k}{q_k}$, and a mediant lies between the two (the lemma on the mediant from chapter 5; its proof works for positive non-integers too). So $x$ is no further from $\frac{p_k}{q_k}$ than the next convergent is, that is, at most $\frac1{q_k q_{k+1}}$. Finally, $q_{k+1} = a_{k+1} q_k + q_{k-1} > q_k$ for $k \ge 1$, so $\frac1{q_k q_{k+1}} < \frac1{q_k^2}$. (For $k = 0$ and $a_1 = 1$ we get $q_1 = q_0 = 1$, and the bound is not strict: $\le 1$.)
The proof shows the main point: the larger the next term $a_{k+1}$, the larger $q_{k+1}$ and the more accurate $\frac{p_k}{q_k}$. The continued fraction of $\pi$ begins $[3;\ 7,\ 15,\ 1,\ 292,\ \dots]$. Cut it off before the $292$:
$$\pi \approx 3 + \cfrac{1}{7 + \cfrac{1}{15 + \cfrac11}} = \frac{355}{113} = 3.14159292\dots$$Six decimal places are correct, and the error is about $2.7 \cdot 10^{-7}$. To get closer to $\pi$ you need a denominator of at least $16{,}604$. This fraction was found in the fifth century by the Chinese astronomer and mathematician Zu Chongzhi, who called it the "close ratio"; the rougher $\frac{22}7$ he called the "approximate ratio".
What number is the continued fraction $[2;\ 3,\ 4]$? Give the answer in lowest terms.
Evaluate from the bottom storey: $3 + \frac14 = \frac{13}4$, then $2 + \frac{4}{13} = \frac{30}{13}$. Check with Euclid's algorithm: $30 = 2 \cdot 13 + 4$, $13 = 3 \cdot 4 + 1$, $4 = 4 \cdot 1$, terms $2, 3, 4$.
By the same logic, the number worst approximated by fractions is the one whose terms are all as small as possible, that is, equal to one:
$$\varphi = 1 + \cfrac{1}{1 + \cfrac{1}{1 + \dots}} = [1;\ 1,\ 1,\ \dots].$$Since the "tail" after the first one is the same number, $\varphi = 1 + \frac1\varphi$, that is, $\varphi^2 = \varphi + 1$. The positive solution of this equation is $\varphi = \frac{1 + \sqrt5}2 \approx 1.618$.
The golden ratio is the number $\varphi = \frac{1 + \sqrt5}2 \approx 1.618$, for which $\varphi^2 = \varphi + 1$. Its convergents are ratios of consecutive Fibonacci numbers: $\frac11, \frac21, \frac32, \frac53, \frac85, \frac{13}8, \dots$ These ratios are exactly why Euclid's algorithm runs slowest on Fibonacci numbers (chapter 4).
Incidentally, the path to a number in the Stern–Brocot tree of the last chapter is the same continued fraction spelled in letters. The path to $\sqrt2$ is R, LL, RR, LL, RR, …: one step right and then twos, the terms $[1;\ 2,\ 2,\ 2,\ \dots]$.
The verdict: the real numbers
The reports agree: $\sqrt2$ is not a fraction. Yet we can see the length of the diagonal, measure it as precisely as we like, compute as many of its digits as we want. There's only one way out: extend the very notion of number so that the length of every segment is a number.
Decimal notation suggests how. From the last chapter we know that the rational numbers are exactly those whose decimal expansion terminates or repeats. What if we allow any infinite decimal at all, including ones with no period?
A real number is a number written as an infinite decimal with a sign, for example $\sqrt2 = 1.41421356\dots$ or $\frac13 = 0.333\dots$ Terminating decimals are padded with zeros, and expansions like $0.4999\dots$ and $0.5000\dots$ count as the same number. All the real numbers together are written $\mathbb R$.
This definition isn't rigorous: it's unclear, for example, how to add two infinite expansions if carries can arrive "from infinity". The real numbers were built rigorously only in the second half of the nineteenth century, by Weierstrass, Dedekind and Cantor; that's in chapter 53. But the idea is already clear: every real number is a point of the number line, and conversely every point of the line corresponds to a number. The line no longer has holes.
Did it have holes when we used only fractions? There are a great many rational points on the line: however tiny the segment you search, you'll find fractions in it.
Between any two distinct real numbers $a < b$ there is a rational number.
The idea: walk along the line in steps of $\frac1q$ that are shorter than the interval $(a, b)$. Such a step can't jump over the whole interval, so some mark lands inside.
The length $b - a$ is positive. Choose a natural number $q$ so large that $\frac1q < b - a$; any $q > \frac1{b - a}$ will do. Mark on the line all the fractions $\frac kq$ with integer $k$, marks at equal spacing $\frac1q$.
Let $\frac pq$ be the first mark to the right of $a$, that is, the smallest integer $p$ with $\frac pq > a$. The previous mark $\frac{p - 1}q$ is not to the right of $a$: $\frac{p-1}q \le a$. Then $\frac pq = \frac{p - 1}q + \frac1q \le a + \frac1q < a + (b - a) = b$. So $a < \frac pq < b$.
Between any two distinct numbers $a < b$ there is also an irrational number.
The idea: take two fractions inside the interval and move from one towards the other by an irrational fraction of the way.
By the theorem, find a fraction $r$ with $a < r < b$, and then another fraction $s$ with $r < s < b$. Set $x = r + \frac{s - r}{\sqrt2}$. Since $0 < \frac1{\sqrt2} < 1$, the number $x$ lies strictly between $r$ and $s$, and so between $a$ and $b$. If $x$ were rational, then $\sqrt2 = \frac{s - r}{x - r}$ would be rational too, as a quotient of two non-zero fractions. But $\sqrt2$ isn't a fraction, so $x$ is irrational.
There are fractions next to every point, and yet at the point $\sqrt2$ itself there is no fraction. You can see this under a magnifying glass too.
The widget also shows how to understand an infinite decimal. Each tenfold zoom narrows the window containing $\sqrt2$ and fixes one more digit. A real number is what remains when the windows shrink forever: a single point.
The most unexpected fact hides here as well. Fractions are everywhere on the line, yet in a precise sense there are almost none of them. The rational numbers can be listed one after another, like the natural numbers, but the real numbers can't: there are more of them. How infinities can be compared at all is the subject of chapter 52. And in chapter 54 we'll see that all the rational points of a segment can be covered by intervals of total length less than any given number.
Especially dangerous: transcendental numbers
$\sqrt2$ has a mitigating circumstance. Although it isn't a fraction, it's easy to describe with whole numbers: it's a root of the equation $x^2 - 2 = 0$. The golden ratio is a root of $x^2 - x - 1 = 0$, and $\sqrt[3]{5}$ a root of $x^3 - 5 = 0$.
An algebraic number is a root of an equation $a_n x^n + \dots + a_1 x + a_0 = 0$ with integer coefficients, not all zero. Every fraction $\frac pq$ is algebraic: it's a root of $qx - p = 0$. A number that isn't algebraic is called transcendental.
Do transcendental numbers exist at all? The first examples were constructed by Joseph Liouville in 1844. In 1873 Charles Hermite proved that $e \approx 2.718$, the base of natural logarithms and the subject of chapter 29, is transcendental. And in 1882 Ferdinand von Lindemann proved that $\pi$ is transcendental too. (That $\pi$ is irrational Johann Lambert had shown back in 1761; transcendence is a much stronger statement.)
The number $\pi$ is transcendental.
The idea of the proof, and why the whole of it won't fit here
All transcendence proofs work in a similar way. You assume the number is a root of an equation with integer coefficients, and using that equation you build an integer about which you can show two things: it isn't zero, and yet its absolute value is less than one. No such integer exists, a contradiction. For $\pi$ this integer is built from values of the function $e^x$ at complex points and from cleverly chosen integrals, and the estimates need all the machinery of calculus. Even in a modern presentation it takes several pages relying on chapters 28, 29 and 34. A complete and accessible proof can be found, for example, in Ivan Niven's book Irrational Numbers.
Lindemann's result closed a problem people had wrestled with for more than two thousand years: to construct with compass and straightedge a square with the same area as a given circle. A circle of radius $1$ has area $\pi$, so the side of such a square would have to be $\sqrt\pi$. One more fact about constructions is needed.
Every length that can be constructed with compass and straightedge from a unit segment is an algebraic number.
The idea of the proof
Each new point of a construction is the intersection of two lines, a line and a circle, or two circles drawn through points already known. Written in coordinates, the intersection of lines is found from linear equations, and intersections with circles from quadratic ones. So all constructible numbers are obtained from one by addition, subtraction, multiplication, division and taking square roots. It remains to prove that such expressions are always roots of polynomials with integer coefficients: the roots are "removed" one at a time by squaring. This is done carefully in the language of fields and their extensions in chapter 43, which also proves that doubling the cube and trisecting an angle are impossible.
With compass and straightedge you can't construct a square whose area equals the area of a given circle.
The idea: if the construction existed, the equation for the side $\sqrt\pi$ would yield an equation for $\pi$ itself, contrary to Lindemann's theorem.
Take the radius of the given circle as the unit of length; then the circle's area is $\pi$. Suppose a square of area $\pi$ has been constructed; then its side $s = \sqrt\pi$ has been constructed too. By the lemma, $s$ is a root of some non-zero polynomial $P$ with integer coefficients: $P(s) = 0$.
Collect the even and odd powers in $P$ separately: $P(x) = A(x^2) + x \cdot B(x^2)$, where $A$ and $B$ are polynomials with integer coefficients (for example, $x^3 + 2x^2 + 5 = (2x^2 + 5) + x \cdot x^2$). Substitute $x = s$ and recall that $s^2 = \pi$: $A(\pi) + s \cdot B(\pi) = 0$, that is, $A(\pi) = -s \cdot B(\pi)$. Square it: $A(\pi)^2 = \pi \cdot B(\pi)^2$.
So $\pi$ is a root of the polynomial $Q(y) = A(y)^2 - y\,B(y)^2$ with integer coefficients. It isn't zero: if $B \ne 0$, the degree of $y\,B(y)^2$ is odd and the degree of $A(y)^2$ is even, so they can't cancel; and if $B = 0$, then $A \ne 0$ (otherwise $P = 0$) and $Q = A^2 \ne 0$. So $\pi$ is algebraic, which contradicts Lindemann's theorem.
The first part of the answer: with compass and straightedge, no. A square with the same area as a circle can't be constructed, because $\pi$ is transcendental (Lindemann, 1882). Back in 1775 the Paris Academy of Sciences, tired of "solutions", resolved to stop examining circle-squarings. But cutting a circle into pieces is another matter: why scissors won't do is explained in chapter 20, and the unexpected ending is in chapter 54.
Cantor found that "almost all" numbers are transcendental, yet proving that a particular number is transcendental is incredibly hard. It isn't even known whether $\pi + e$ is irrational. The case has been closed on only a few counts.
Where next
Now we have enough numbers: every point of the line has a name. But throughout this chapter we kept having to reason about numbers we didn't know. "Let $\sqrt2 = \frac mn$", and from then on we worked with the letters $m$ and $n$ as if they were numbers. The rule $\frac mn \to \frac{m + 2n}{m + n}$ gave $\frac32, \frac75, \frac{17}{12}, \frac{41}{29}, \frac{99}{70}, \frac{239}{169}$, and every time $m^2 - 2n^2$ came out as $\pm 1$. Six agreements in a row, but from the introduction we remember that a pattern can break at the seventh step.
Can we prove that this rule never fails, for all $m$ and $n$ at once? For that we need to learn to calculate with letters as confidently as with numbers: to expand brackets and check that one expression equals another for any values. That's what algebra is about, and it begins in chapter 7.