Theorems · Theorem · number theory
Nat.eq_sq_add_sq_iff
∀ {n : ℕ}, (∃ x y, n = x ^ 2 + y ^ 2) ↔ ∀ q ∈ n.primeFactors, q % 4 = 3 → Even (padicValNat q n)A (positive) natural number n is a sum of two squares if and only if the exponent of
every prime q such that q % 4 = 3 in the prime factorization of n is even.
(The assumption 0 < n is not present, since for n = 0, both sides are satisfied;
the right-hand side holds, since padicValNat q 0 = 0 by definition.)
- Defined in
- Mathlib.NumberTheory.SumTwoSquares
- Cited by
- 0 results in Mathlib
- Foundations
- Depth 153 from the axioms · uses propext, Classical.choice, Quot.sound
Around this declaration
Dashed lines are statement dependencies; solid lines are citations in proofs.
Cites18
Mathlib declarations this one mentions in its statement or cites explicitly in its proof. Plumbing is filtered out.
- DFunLike.coeproof · cited by 62,936
- Finsetstatement · cited by 13,712
- Factproof · cited by 2,726
- Nat.Primeproof · cited by 2,059
- Evenstatement and proof · cited by 444
- Nat.factorizationproof · cited by 215
- IsSquareproof · cited by 132
- Nat.primeFactorsstatement and proof · cited by 129
- Squarefreeproof · cited by 112
- padicValNatstatement and proof · cited by 106
- Nat.prime_of_mem_primeFactorsproof · cited by 29
- Dvd.intro_leftproof · cited by 20
Cited by0
Results whose statement or proof uses this declaration.
Nothing cites this yet.