Wednesday, December 25, 2024

Fermat's Christmas theorem

1. On 25 Dec. 1640, P. de Fermat (1607-1665) wrote to Fr. Marin Mersenne about the two squares theorem for prime numbers, called Fermat's Christmas theorem.

Only some numbers can be written as the sum of two squares. P. de Fermat began a line of enquiry, founded on prime numbers, into which ones can be so written, on 25.12.1640; this can be considered the beginning of the modern higher arithmetic.

He stated in tbe letter that among (odd) primes, those (and, obviously, as shown below (art. 3), only those) of the form p = 1 (mod 4) can be so written (i. e., those primes which yield 1 as remainder/residue on dividing by 4).

e. g.: 

5 = 1 (mod 4).

5 =  1^2 + 2^2.

Such (odd) primes are called Pythagorean primes, since the sum of two squares is reminiscent of the Pythagoras theorem. (In contradistinction, we shall call (odd) primes of the form p = 3 (mod 4) as Gaussian primes (in Z), as explained in art. 5 below.)

Unlike 5; 3, 7, or 11 cannot be so written; 13 =  2^2 + 3^2 = 1 (mod 4).

2. For (odd) primes which can be so written, it is clear that they must be written as the sum of an odd square and an even square.

Odd squares are of the form x = 1 (mod 4); Even squares, of the form y = 0 (mod 4). Thus their sum is of the form z = 1 (mod 4).

Thus such sums are of the form z = 1 (mod 4), and only such primes can be so written.

What is not obvious is that all such primes can be so written. This is what P. de Fermat discovered and stated on 25.12.1640.

3. P. de Fermat did not give a demonstration of the propositon he had enunciated.

A complete demonstration of his Christmas theorem was given by L. Euler (1707-1783) only more than a century later, in two letters to C. Goldbach on 6.5.1747 and 12.4.1749, later published in two articles `De numeris qui sunt aggregata duorum quadratorum' [E228] and `Demonstratio theorematis Fermatiani omnem numerum primum formae 4n+1 esse summam duorum quadratorum' [E241].

J. L. Lagrange gave another demonstration in 1775 from his study of binary quadratic forms; C. F. Gauss gave a succinct version in art. 182 of his `Disquisitiones arithmeticae'.

4. A. Girard (1595-1632) had stated, in 1625, with no demonstrations, that the numbers that can be written as the sum of two squares are:

i.   2 = 1^2 + 1^2 (the even prime).
ii.  Squares. (N. B.: 0^2 is also permissible in the sum.)
iii. Primes of the form p = 1 (mod 4).
iv.  Products of such numbers.

5. Diophantus of Alexandria (fl. IIIrd century) showed (in his `Arithmetica') that if two numbers can be written as the sum of two squares, then so can be their product (and, in two different ways).

(a^2 + b^2) (c^2 + d^2) = |a+bi|^2 |c+di|^2
                                       = |(ac-bd) + (ad+bc)i|^2
                                       = (ac-bd)^2 + (ad+bc)^2

(a^2 + b^2) (c^2 + d^2) = |a+bi|^2 |d+ci|^2
                                       = |(ad-bc) + (ac+bd)i|^2
                                       = (ac+bd)^2 + (ad-bc)^2


C. F. Gauss in his second memoir on biquadratic {quartic} reciprocity, `Theoria residuorum biquadraticorum', 1832, discovered the ring Z[i] of Gaussian integers of the form a+bi (where a and b are integers, and i = \sqrt{-1} is adjoined to the integers Z to obtain Z[i]), and showed that unique factorisation (the fundamental theorem of arithmetic) holds. The Pythagorean primes in Z of the form p = 1 (mod 4) split into conjugate primes in the ring Z[i] (reflecting their being written as the sum of two squares); the Gaussian primes in Z of the form p = 3 (mod 4) remain inert (prime in Z[i] as well, reflecting the impossibility of their being written as the sum of two squares); these yielded a succinct development of the theorems of Girard and Fermat (R. Dedekind elucidated them in later writings). 

N. B.: Diophantus merely stated his identity, and gave no demonstration. I have written an anachronistic demonstration for his identity in the ring of Gaussian integers Z[i]. 

6. The even prime, 2, a prime in Z, splits in Z[i], as 2 = (1+i) (1-i) = (-1+i) (-1-i), and is thus composite in Z[i]; 1+i, 1-i, -1+i. -i-i, are the 4 Gaussian prime factors of 2 in Z[i]; these factorisations correspond to the sum of squares form 2 = 1^2 + 1^2.

The first Pythagorean prime, 5, a prime in Z, splits in Z[i], as 5 = (1+2i) (1-2i) = (2+i) (2-i), and is thus composite in Z[i]; 1+2i, 1−2i, −1+2i, −1−2i, 2+i, 2−i, −2+i, −2−i, are the 8 Gaussian prime factors of 5 in Z[i]; these factorisations correspond to the sum of squares form 5 = 1^2 + 2^2.

The first few (<= 1729) Pythagorean primes, i. e., of the form p = 1 (mod 4) are: 5, 13, 17, 29, 37, 41, 53, 61, 73, 89, 97, 101, 109, 113, 137, 149, 157, 173, 181, 193, 197, 229, 233, 241, 257, 269, 277, 281, 293, 313, 317, 337, 349, 353, 373, 389, 397, 401, 409, 421, 433, 449, 457, 461, 509, 521, 541, 557, 569, 577, 593, 601, 613, 617, 641, 653, 661, 673, 677, 701, 709, 733, 757, 761, 769, 773, 797, 809, 821, 829, 853, 857, 877, 881, 929, 937, 941, 953, 977, 997, 1009, 1013, 1021, 1033, 1049, 1061, 1069, 1093, 1097, 1109, 1117, 1129, 1153, 1181, 1193, 1201, 1213, 1217, 1229, 1237, 1249, 1277, 1289, 1297, 1301, 1321, 1361, 1373, 1381, 1409, 1429, 1433, 1453, 1481, 1489, 1493, 1549, 1553, 1597, 1601, 1609, 1613, 1621, 1637, 1657, 1669, 1693, 1697, 1709, 1721, ...

For the Pythagorean primes, the sum of squares representation is unique; and they have 8 Gaussian prime factors in Z[i], all corresponding to the sum of squares representation.

The first few (<= 1729) Gaussian primes in Z, i. e., of the form p = 3 (mod 4), are: 3, 7, 11, 19, 23, 31, 43, 47, 59, 67, 71, 79, 83, 103, 107, 127, 131, 139, 151, 163, 167, 179, 191, 199, 211, 223, 227, 239, 251, 263, 271, 283, 307, 311, 331, 347, 359, 367, 379, 383, 419, 431, 439, 443, 463, 467, 479, 487, 491, 499, 503, 523, 547, 563, 571, 587, 599, 607, 619, 631, 643, 647, 659, 683, 691, 719, 727, 739, 743, 751, 787, 811, 823, 827, 839, 859, 863, 883, 887, 907, 911, 919, 947, 967, 971, 983, 991, 1019, 1031, 1039, 1051, 1063, 1087, 1091, 1103, 1123, 1151, 1163, 1171, 1187, 1223, 1231, 1259, 1279, 1283, 1291, 1303, 1307, 1319, 1327, 1367, 1399, 1423, 1427, 1439, 1447, 1451, 1459, 1471, 1483, 1487, 1499, 1511, 1523, 1531, 1543, 1559, 1567, 1571, 1579, 1583, 1607, 1619, 1627, 1663, 1667, 1699, 1723, ...

For the Gaussian primes in Z, there are no sum of squares representations; and they have 4 Gaussian prime factors in Z[i], to wit, p. -p, pi, -pi.

These threefold kinds of Gaussian primes in Z[i], which are factors of the three kinds of primes in Z, are all of the Gaussian primes.

7. Demonstrations from constraints in the geometry of numbers were also discovered subsequently.