Serre's *A Course in Arithmetic* gives essentially the following proof of the three-squares theorem, which says that an integer $a$ is the sum of three squares if and only if it is not of the form $4^m (8n + 7)$ : first one shows that the condition is necessary, which is straightforward. To show it is sufficient, a lemma of Davenport and Cassels, using Hasse-Minkowski, shows that $a$ is the sum of three *rational* squares. Then something magical happens:


Let $C$ denote the circle $x^2 + y^2 + z^2 = a$. We are given a rational point $p$ on this circle. Round the coordinates of $p$ to the closest integer point $q$, then draw the line through $p$ and $q$, which intersects $C$ at a rational point $p'$. Round the coordinates of $p'$ to the closest integer point $q'$, and repeat this process. A straightforward calculation shows that the least common multiple of the denominators of the points $p'$, $p''$, ... are strictly decreasing, so this process terminates at an integer point on $C$.


Bjorn Poonen, after presenting this proof in class, remarked that he had no intuition for why this should work. Does anyone have a reply? 


Edit: Let me suggest a possible reformulation of the question as follows. Complete the analogy: Hensel's lemma is to Newton's method as this technique is to \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_.



Intuition for the last step in Serre's proof of the three-squares theorem
The intuition for this method of passing from a rational solution to an integral solution seems pretty simple to me: passing from a rational solution to a nearby integral point (not necessarily a solution) is passing to a point whose denominators are 1, so you can anticipate that when you intersect the line through your rational solution and the nearby integral point with whatever curve or surface contains your solutions, the second intersection point on that line will have *denominators that have moved closer to 1*. That is, connecting a rational solution with some integral point will spit out a new solution whose denominators are somewhere between the denominators of your solution and the denominators of the integral point you used to produce the line.


Of course intuition is one thing and checking the details is another: you choose the integral point nearby and the math has to work out to show the denominators really get smaller in the second solution you produce. For instance, this method of proving the 3-square theorem goes through without a problem for a similar 2-square theorem (if an integer is a sum of two rational squares than it's a sum of two integral squares by the same method, replacing the sphere $x^2 + y^2 + z^2 = a$ with the circle $x^2 + y^2 = a$). But this intuitive way of creating an integral solution from a rational solution breaks down if you apply it to the 4-square theorem: the inequalities in the proof just barely fail to work (sort of like doing division with remainder and finding the remainder is as big as the divisor instead of smaller).


The intuition also breaks down if you slightly change the expression $x^2 + y^2$ (sticking to two variables). Consider $x^2 + 82y^2 = 2$ and the rational solution $(4/7,1/7)$. Its nearest integral point in the plane is $(1,0)$, and the line through these intersects the ellipse in $(16/13,-1/13)$, so the denominator has gone up. There actually are no integral solutions to $x^2 + 82y^2 = 2$. Or if we take $x^3 + y^3 = 13$ and the rational solution $(2/3,7/3)$, its nearest integral point in the plane is $(1,2)$, the line through these meets the curve again in $(7/3,2/3)$, whose nearest integral point in the plane is $(2,1)$, the line through them meets the curve in $(2/3,7/3),\ldots$


A few years ago when I was giving some lectures on the method of descent, I worked out some examples of this geometric "three-square" theorem (start with an equation $a = x^2 + y^2 + z^2$ where $a$ is an integer and $x, y,$ and $z$ are rational and produce in a few steps an equation where $x, y,$ and $z$ are integral) and I noticed in my initial examples that the denominators in each new step did not merely drop, but dropped as factors, e.g., if the common denominator at first was 15 then at the next step it was 5 and then 1. Maybe the denominators always decrease through factors like this? Nope, eventually I found a case where they don't: if you start with


$$
13 = (18/11)^2 + (15/11)^2 + (32/11)^2
$$


then the integral point nearest $(18/11,15/11,32/11)$ is $(2,1,3)$ and the line through these two points meets the sphere $13 = x^2 + y^2 + z^2$ in the new point $(2/3,7/3,8/3)$, so the denominator has fallen from 11 to 3, which is not a factor. (At the next step you will terminate in the integral solution $(0,3,2)$.)


