Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Statement of the cubic Pocklington criterion

Definition
LL_Decomp126b_lemma8_stmt

by sthubbar · Oct 29, 2026 · Mathlib 0df444a (Lean v4.33.1)

The proposition asserting: for all natural numbers N,R,F,s,rN,R,F,s,rN,R,F,s,r with N≥2N\ge2N≥2, F≥2F\ge2F≥2, FFF even, gcd⁡(R,F)=1\gcd(R,F)=1gcd(R,F)=1, NNN odd, N=RF+1N=RF+1N=RF+1, R=2Fs+rR=2Fs+rR=2Fs+r, r<2Fr<2Fr<2F and N<2F3N<2F^3N<2F3, if there exists a∈Za\in\mathbb Za∈Z with N∣aN−1−1N\mid a^{N-1}-1N∣aN−1−1 (stated as aN−1≡1(modN)a^{N-1}\equiv1\pmod NaN−1≡1(modN)) and gcd⁡(a(N−1)/p−1,N)=1\gcd(a^{(N-1)/p}-1,N)=1gcd(a(N−1)/p−1,N)=1 for every prime p∣Fp\mid Fp∣F, then NNN is prime if and only if s=0s=0s=0 or r2−8sr^2-8sr2−8s is not the square of an integer. Here (N−1)/p(N-1)/p(N−1)/p is natural-number division and aN−1a^{N-1}aN−1, a(N−1)/pa^{(N-1)/p}a(N−1)/p are integer powers.

Definition code
import Mathlib

namespace LL_Decomp126b

def lemma8_stmt : Prop := ∀ N R F s r : ℕ,
    2 ≤ N → 2 ≤ F → Even F → Nat.Coprime R F → Odd N →
    N = R * F + 1 → R = 2 * F * s + r → r < 2 * F → N < 2 * F ^ 3 →
    (∃ a : ℤ, Int.ModEq (N : ℤ) (a ^ (N - 1)) 1 ∧
      ∀ p : ℕ, p.Prime → p ∣ F → Int.gcd (a ^ ((N - 1) / p) - 1) N = 1) →
    (N.Prime ↔ s = 0 ∨ ¬ IsSquare ((r : ℤ) ^ 2 - 8 * s))

end LL_Decomp126b
Read-back

What the Lean code literally says, in plain math · claude-haiku

For naturals N,R,F,s,rN,R,F,s,rN,R,F,s,r, assume 2≤N2 \le N2≤N, 2≤F2 \le F2≤F, FFF even, gcd⁡(R,F)=1\gcd(R,F)=1gcd(R,F)=1, NNN odd, N=RF+1N=RF+1N=RF+1, R=2Fs+rR=2Fs+rR=2Fs+r, r<2Fr<2Fr<2F, N<2F3N<2F^3N<2F3. Assume also an integer aaa exists with aN−1≡1(modN)a^{N-1}\equiv 1 \pmod NaN−1≡1(modN) and gcd⁡ ⁣(a(N−1)/p−1, N)=1\gcd\!\left(a^{(N-1)/p}-1,\,N\right)=1gcd(a(N−1)/p−1,N)=1 for every prime p∣Fp \mid Fp∣F. Then NNN is prime if and only if s=0s=0s=0 or r2−8sr^2-8sr2−8s is not a perfect square in Z\mathbb{Z}Z.

The witness aaa ranges over all integers, including 000 and negative values. The division (N−1)/p(N-1)/p(N−1)/p is exact, because N−1=RFN-1=RFN−1=RF and p∣Fp \mid Fp∣F, so no truncation occurs. The oddness hypothesis is implied by FFF even and N=RF+1N=RF+1N=RF+1. The pair (s,r)(s,r)(s,r) is the quotient and remainder of RRR by 2F2F2F. The integer r2−8sr^2-8sr2−8s can be negative, and negative integers are not squares, so the right side holds whenever r2−8s<0r^2-8s<0r2−8s<0. When s=0s=0s=0 the right side is true for every rrr, so in that case the statement asserts that NNN is prime.

Human review
  • Endorsed by Shuze Chen · Oct 29, 2026

    Confirmed by the moderator at approval.

  • Endorsed by sthubbar · Oct 29, 2026

    Confirmed by the mission captain (proposal self-audit).

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 paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me