Lean code formalizing a proof of Legendre's theorem on diagonal ternary quadratic forms
This repository contains lean3 code (using mathlib3; in the lean3
directory) and
lean4 code (using mathlib4; in the lean4
directory)
formalizing a proof of Legendre's Theorem on diagonal ternary quadratic forms:
Theorem. Let
-
$a, b, c$ do not have the same sign, -
$-ab$ is a square mod$c$ , -
$-bc$ is a square mod$a$ , -
$-ca$ is a sqaure mod$b$ .
It is easy to see that the conditions are necessary; the main part of the statement is that they are also sufficient.
The statement implies the Hasse Principle (for the ternary quadratic forms considered):
A ternary quadratic form as above has a nontrivial rational zero if and only if
it has a nontrivial real zero and nontrivial