[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"OkCxCsSN9N":3},"# LegendreQF\nLean code formalizing a proof of Legendre's theorem on diagonal ternary quadratic forms\n\nThis repository contains *lean3* code (using mathlib3; in the `lean3` directory) and\n*lean4* code (using mathlib4; in the `lean4` directory)\nformalizing a proof of *Legendre's Theorem* on diagonal ternary quadratic forms:\n\n **Theorem.** Let $a, b, c$ be squarefree integers that are coprime in pairs.\n Then the equation\n $$a x^2 + b y^2 + c z^2 = 0$$\n has a nontrivial (i.e., not all values are zero) solution in integers if and\n only if\n 1. $a, b, c$ do not have the same sign,\n 2. $-ab$ is a square mod $c$,\n 3. $-bc$ is a square mod $a$,\n 4. $-ca$ is a sqaure mod $b$.\n\n It is easy to see that the conditions are necessary; the main part of the\n statement is that they are also sufficient.\n\n The statement implies the *Hasse Principle* (for the ternary quadratic forms considered):\n A ternary quadratic form as above has a nontrivial rational zero if and only if\n it has a nontrivial real zero and nontrivial $p$-adic zeros for all primes $p$.\n (However, this is not (yet) part of the formalization.)\n",1782661969694]