Today I Learned

(back up to December)

December 27th

Today I learned a proof of Fermat's Christmas theorem, from continued fractions. I think this proof is intended to give the Minkowski argument without ever saying the word "Minkowski,'' but I found it amusing that this argument exists at all.

We are given some positive (rational) prime $p\equiv1\pmod4,$ and we want to express $p$ as the sum of two squares. Note Euler's criterion gives us an $i\in\FF_p$ such that $i^2\equiv-1\pmod p.$ The key is to look at the continued fraction convergents of $-\frac ip.$ Note that because $\floor{\sqrt p} \lt p,$ there exists a pair of consecutive convergents $\frac ab$ and $\frac{a'}{b'}$ with $b\le\floor{\sqrt p} \lt b'.$ This implies\[\left|\frac ip-\frac ab\right|\le\frac1{bb'} \lt \frac1{b\sqrt p}.\]However, we can write this error as\[\left|\frac ip-\frac ab\right|=\frac1{b\sqrt p}\cdot\frac{|ib-ap|}{\sqrt p}.\]The above inequality on the error term then tells us that $c:=|ib-ap| \lt \sqrt p.$ By construction $b\equiv ic,$ so $p\mid b^2+c^2.$ (We see $c\ne0$ because $p\nmid i,b$ implies $p\nmid ib$ and $p\nmid c.$) However, bounding says that we must have $0 \lt b^2+c^2 \lt 2p,$ forcing $b^2+c^2=p,$ which is the construction we wanted.

I find this proof somewhat mysterious. It feels like the Minkowski proof, where we make a lattice of points $(x,y)\in\ZZ^2$ satisfying $x\equiv iy\pmod p$ and then search for a nonzero lattice point sufficiently close to the origin. Namely, these proofs have the same finish. What we seem to be saying is that for $x=iy-kp$ can actually be found because $\frac ky$ is a good rational approximation for $\frac ip.$ Indeed,\[\left|\frac ip-\frac ky\right|=\frac x{py}.\]If we say without loss of generality that $0 \lt x \lt y \lt \sqrt p,$ this error term is upper-bounded by $\frac1p$ while $y \lt \sqrt p,$ meaning that this rational approximation at least hits the Dirichlet approximation bound. I guess this suggests a continued fraction proof, though it does prove that one should exist—we need an error term of $2p$ from our $y$ to hit the continued fraction proof.