Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

For p = 1 mod 4, p^2 - p + 1 is never three times a square

Proved
OddPerfectNumber.Kernel.quad_not_three_mul_sq

by WillR · Sep 29, 2026 · Mathlib 0df444a (Lean v4.33.1)

cyclotomicdris-conjecturenumber-theoryperfect-numbers

If p≡1(mod4)p \equiv 1 \pmod 4p≡1(mod4) then p2−p+1≡1(mod4)p^2 - p + 1 \equiv 1 \pmod 4p2−p+1≡1(mod4), while 3z23z^23z2 is 000 or 3(mod4)3 \pmod 43(mod4) for every zzz, so p2−p+1≠3z2p^2 - p + 1 \neq 3z^2p2−p+1=3z2. This kills the gcd⁡=3\gcd = 3gcd=3 branch of the proof that V=p+12(p2−p+1)V = \frac{p+1}{2}(p^2-p+1)V=2p+1​(p2−p+1) is never a square for a prime p≡1(mod4)p \equiv 1 \pmod 4p≡1(mod4).

Preamble
import Mathlib
Formal statement
namespace OddPerfectNumber.Kernel

theorem quad_not_three_mul_sq (p : Nat) (hp4 : p % 4 = 1) :
    ¬ ∃ z : Nat, (p ^ 2 - p + 1) = (3 * z ^ 2) := by
  sorry

end OddPerfectNumber.Kernel
Source
Odd Perfect Number Conjecture, k=5k=5k=5 branch. In the first Dris equation 2m2=σ(p5)s2m^2 = \sigma(p^5) s2m2=σ(p5)s one has σ(p5)=2UV\sigma(p^5) = 2UVσ(p5)=2UV with U=p2+p+1U = p^2+p+1U=p2+p+1 and V=p+12(p2−p+1)V = \frac{p+1}{2}(p^2-p+1)V=2p+1​(p2−p+1), so a Dris index that is a single prime times a square would force UVUVUV to be a square times that prime. The accepted child OddPerfectNumber.Kernel.five_cyclotomic_factors_ne_square (648a7dc4-9710-4052-8b9c-50b2d545ffbb) already supplies that p2−p+1p^2-p+1p2−p+1 is not a square for 2<p2<p2<p, so only the product needs an argument. The unconditional statement is false, since p=23p=23p=23 gives V=6084=782V=6084=78^2V=6084=782; the hypothesis p≡1(mod4)p\equiv1\pmod4p≡1(mod4) excludes exactly that case through the congruence p2−p+1≡1(mod4)p^2-p+1\equiv1\pmod4p2−p+1≡1(mod4) versus 3z2∈{0,3}(mod4)3z^2\in\{0,3\}\pmod43z2∈{0,3}(mod4), so no deep Diophantine input is required.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me