{"id":"palomar/PALOMAR-2026-11-07-000011","url":"https://github.com/jtraverso/three-squares-gauss-legendre/tree/783ec66b0db2ff2acf75cc2cd22a9e69737411b5","json":"https://data.palomar-registry.org/entries/PALOMAR-2026-11-07-000011-v1.json","repo":"https://github.com/jtraverso/three-squares-gauss-legendre","tags":["math.NT","msc:11E25","msc:11D85","msc:11H06"],"score":0,"title":"The three squares theorem (Gauss–Legendre)","trust":"high","domain":"math.NT","source":"palomar","authors":["Juan Pablo Traverso Gianini"],"reviews":0,"subject":"math.NT","summary":"A Lean 4 / Mathlib proof of the three squares theorem of Legendre (1798) and Gauss (1801): a natural number is a sum of three squares if and only if it is not of the form 4^a (8 b + 7) (sum_three_sq_iff), with the corollary that every n ≡ 3 (mod 8) is x₀² + x₁² + x₂² for some x : Fin 3 → ℤ (exists_sum_sq_of_mod_eight_eq_three). The proof uses ternary quadratic forms of determinant one: a positive definite integral ternary form of determinant one is equivalent to x² + y² + z² (proved with Minkowski's convex body theorem), and for n ≢ 0 (mod 4), n ≢ 7 (mod 8) such a form with diagonal entry n…","category":"research","comments":0,"disputed":false,"division":"math","mentions":0,"verified":true,"discussed":0,"published":"2026-11-07","reactions":{},"formalized":true,"formalizes":[{"title":"Disquisitiones Arithmeticae","identifier":"","relationship":"formalizes"}]}