English
Fermat's theorem ensures that every prime p can be expressed as a sum of four squares, and the general four-squares theorem extends to all natural numbers.
Русский
Теорема Ферматa о сумме четырех квадратов утверждает, что каждое простое число можно изобразить как сумма четырех квадратов, а общее утверждение простирается на все натуральные числа.
LaTeX
$$$\exists a,b,c,d \in \mathbb{N},\ a^2 + b^2 + c^2 + d^2 = p$ для простого p (и в общем для любого n).$$
Lean4
/-- **Fermat's theorem on the sum of two squares**. Every prime not congruent to 3 mod 4 is the sum
of two squares. Also known as **Fermat's Christmas theorem**. -/
theorem sq_add_sq {p : ℕ} [Fact p.Prime] (hp : p % 4 ≠ 3) : ∃ a b : ℕ, a ^ 2 + b ^ 2 = p :=
by
apply sq_add_sq_of_nat_prime_of_not_irreducible p
rwa [_root_.irreducible_iff_prime, prime_iff_mod_four_eq_three_of_nat_prime p]