WorksMathematics
Saouter's primality criterion in Lean, a ladder constant, and a 25 rung route to odd Goldbach up to
Abstract
This note gives Lean proofs, with no hypothesis, of the primality criterion of Saouter's paper, Lemma 1 for every even , Theorems 1 and 2, and it records the reading of the constant on page 865 under which the formula agrees with the rest of the paper; separately, given the published even Goldbach computation to as an explicit hypothesis, a ladder of 25 Proth primes reaches in the Lean kernel. The binary Goldbach conjecture remains open and this note makes no progress on it. The ternary Goldbach theorem for all odd numbers is Helfgott's (arXiv:1312.7748), and it is not formalized here and not used.
Introduction and Main Statements
We formalize in Lean 4, with no hypothesis, Saouter’s Lemma 1 for every even and Theorems 1 and 2, record the reading of the constant on page 865 matching his ladder formula, and deduce ternary Goldbach up to from the published even Goldbach bound via a ladder of 25 Proth primes.
Theorem M (Main statements). (a) Lemma 1 of Saouter holds for every even , and Saouter’s Theorems 1 and 2 hold, in Lean with no hypothesis; (b) assuming every even integer from 4 to is a sum of two primes, every odd integer from 7 to is a sum of three primes, in Lean. See Theorems B, C and E for detail.
The binary Goldbach conjecture remains open, and this note makes no progress on it. The ternary Goldbach theorem for all odd numbers is Helfgott’s [2], arXiv:1312.7748, and it is not formalized here and not used.
To place the present formalization in the context of prior work, the primary references are Saouter’s own verification to [6] using the even Goldbach input from Sinisalo [7] and a prime ladder of about rungs, together with the subsequent work of Helfgott and Platt [3], who verified the ternary Goldbach conjecture up to , far past this range, by the same ladder idea with Proth primes. The range is therefore not a new result. What the entry supplies is a short kernel-checked derivation.
We state the exact scope and limits of this verification at the outset:
Saouter’s ladder of about rungs is not reverified; only the 100 values of Table 1 of [6] and the starting and ending primes (138412033 and 100000000209366024193) are checked in the Lean kernel.
The 25-rung route is a different ladder built on a larger even Goldbach input (, from Oliveira e Silva, Herzog, and Pardi [4]) and does not check Saouter’s computation.
In Saouter [6], the formula on page 865 reads as printed, and is read as with one digit 9 restored. The paper’s method, table, starting and ending primes, and result all stand.
| 232830553 | 3 | 3259628295 | 13 |
| 465661177 | 3 | 3492458899 | 3 |
| 698491779 | 5 | 3725289523 | 3 |
| 931322415 | 7 | 3958120159 | 3 |
| 1164153045 | 7 | 4190950765 | 3 |
| 1396983685 | 3 | 4423781383 | 3 |
| 1629814317 | 11 | 4656612025 | 3 |
| 1862644839 | 5 | 4889442663 | 5 |
| 2095475355 | 7 | 5122273297 | 3 |
| 2328305925 | 7 | 5355103933 | 3 |
| 2561136565 | 3 | 5587934515 | 3 |
| 2793967113 | 5 | 5820765157 | 3 |
| 3026797689 | 5 |
Table 1. The 25 Proth prime rungs and witness bases for Theorem E.
This note is for readers of Saouter’s paper and of later ladder computations, and for those who want the primality criterion in a form that a proof assistant accepts.
Saouter’s Method and Primality Criteria
In [6] (pages 863 to 866), Saouter verifies the odd Goldbach conjecture up to . The method on page 863 reduces the ternary problem on bounded intervals to the binary problem via a chain of primes: if is odd, is prime, and is a sum of two primes, then is a sum of three primes. Given the even Goldbach verification up to by Sinisalo [7], one exhibits a strictly increasing sequence of primes
such that , each consecutive step satisfies , and . With step size bounded by , at least primes are needed to reach .
To test primes rapidly at this scale without factoring in full, Saouter uses a special case of the primality criteria of Brillhart, Lehmer, and Selfridge [1]. We record the statements from page 864 of [6].
Lemma 1 (Saouter [6], page 864; from Theorem 5 of Brillhart, Lehmer, and Selfridge [1]). Let be odd with even, the factorization of known, and . Suppose an integer satisfies
for every prime dividing . Write with . If , then is prime if and only if or is not a perfect square.
Specializing to a power of 2 eliminates all odd prime factors of and reduces the Lucas-type hypotheses to a single modular exponentiation:
Theorem 1 (Saouter [6], page 864). Let with and odd, and suppose there is some integer with
Write with . Then is prime if and only if or is not a perfect square. The size condition of Lemma 1 holds since .
To avoid searching for a base at each candidate, Saouter fixes by restricting the residue class of modulo 10:
Lemma 2 (Saouter [6], page 864). A prime of the form satisfies
by Euler’s criterion and quadratic reciprocity.
Theorem 2 (Saouter [6], page 864). Let with , and odd, and suppose . Write with . Then is prime if and only if or is not a perfect square.
The ladder generation algorithm on page 864 of [6] proceeds as follows:
Start at , which is the least prime satisfying both ( odd) and .
From the current prime rung, step up by , which is the largest multiple of below .
Test the candidate for primality using Theorem 2; on a composite candidate, step down by repeatedly until a prime is reached.
In Section 4, page 865 of [6], the ending prime of the ladder is reported as
and Table 1 gives the initial 100 values of the parameter for the ladder primes, where the formula on page 865 reads .
Proposition A: The Formula Constant on Page 865
We begin by recording the arithmetic relationship between the formula as printed on page 865 and the candidate family defined on page 864.
Proposition A. Let
where is the formula as printed on page 865 of [6]. Then:
Since and , we have
so and the cofactor is odd for every natural number .
(2) At and , the formula gives
which are the starting and ending primes of [6], with odd.
(3) For the printed form , evaluation at gives the composite number
is never for any natural number , and .
(4) Every one of the 100 printed values of in Table 1 of [6] gives a prime , with largest consecutive step by script.
Proof. Since , direct multiplication yields
Consequently, for any natural number ,
Because , we have
and is odd.
Substituting into gives and
Substituting gives , which is odd, and
In contrast, for , the difference is constant:
Since is a multiple of , we have , which is never congruent to for any . At , . Finally, each of the 100 values for in Table 1 is checked prime in the Lean kernel via Theorem 2 (Table1Thm2.table1_prime_thm2), each consecutive step is below (Table1.table1_gaps), and by script the largest consecutive step is .
Thus the formula on page 865 is read with constant , with one digit 9 restored; note that is itself composite, as it is only the constant term corresponding to rather than a rung of the ladder (which starts at ). By script, 9 of the 100 values are prime, and a rerun of the paper’s algorithm starting from 138412033 reproduces Table 1 of [6] exactly. No other change to [6] is needed.
Formalization of the Primality Criteria in Lean
We now turn to the Lean formalization of Lemma 1, Theorems 1 and 2, Lemma 2, and the Table 1 checks. Note also that Lemma 8 of Ramaré and Saouter [5] restates Lemma 1 with the factor argument.
Theorem B (BLS.lemma1). Lemma 1 of § 2 holds for every even .
Proof. Let satisfy the hypotheses of Lemma 1. By Pocklington’s order argument applied to each prime power , the conditions and imply that the multiplicative order of modulo any prime factor of is divisible by . By Fermat’s little theorem, , which puts every prime factor of in the residue class . Since products of integers congruent to remain congruent to , every positive divisor of is congruent to . Moreover, since is even and , must be odd; because and is even, the remainder is also odd. Suppose first that is composite. Then factors as a product of two integers above 1,
with integers . Expanding the product gives
and dividing by yields
From the strict inequality , dividing by gives . Since , we have , so
Because is odd and is even, the term is even, whence is odd. Since is even and is odd, the weak inequality forces the strict inequality
Furthermore, since is odd, one of is even and the other is odd, so their product is even. We may therefore write
By uniqueness of the quotient and remainder in Euclidean division of by , we obtain
Consequently,
which is a perfect square.
Conversely, suppose that and for an integer . Since is odd, is odd, so is odd, which implies that is odd. Therefore and are both even, and
are integers satisfying
Since and , both and are strictly positive integers . Multiplying the factors and gives
which shows that is composite. Thus is prime if and only if or is not a perfect square. □
Theorem C. Saouter’s Theorem 1 (for both a natural base and an integer base), Lemma 2, and Theorem 2 (in both directions) hold in Lean with no hypothesis; Lemma 2 shows that the hypothesis on 5 holds for every prime , so the test rejects no prime of this class, and the form Thm2.theorem2_if keeps the hypothesis on 5 and replaces by , for the direction from the square test to primality. The Lean names are Thm1.theorem1, Thm1.theorem1_int, Paper.lemma2, Thm2.theorem2, and Thm2.theorem2_if.*
Proof. Let and with odd. Then , and the only prime dividing is . From the congruence , squaring both sides yields the Fermat condition
Moreover, for the unique prime divisor of , we have , so
because is odd. The size threshold of Lemma 1 is
so Lemma 1 applies directly to establish Theorem 1. For Lemma 2 (Paper.lemma2), if is prime, then is odd and . Since , quadratic reciprocity and Euler’s criterion give
Theorem 2 is Theorem 1 at . Lemma 2 shows that the hypothesis on 5 holds for every prime , so the test rejects no prime of this class. The form Thm2.theorem2_if keeps the hypothesis on 5 and replaces by , for the direction from the square test to primality. □
Deviation and Range Remark on the Final Prime. We record one point regarding the range of Theorem 2 as stated on page 864 of [6]. The ending prime of Saouter’s ladder is
so it lies outside the range stated in Theorem 2, as it must in order for the ladder to cross . However, it lies well below the Lemma 1 bound
so the primality criterion still applies. In Lean, Thm2.last_prime uses the wider form Thm2.theorem2_if with hypothesis . Specifically, for , the parameters are
and is not a square since it lies strictly between and .
Theorem D. All 100 rungs from Table 1 of [6], together with the starting prime 138412033 and the ending prime 100000000209366024193, are checked prime in the Lean kernel by the criterion of Theorem 2 using one modular power each. Among the 100 rungs of Table 1, 11 have and the rest have , by script. The 100 Table 1 rungs begin at 138412033, are strictly rising, and have every consecutive step strictly below , with largest step 399968829440 = 95360 · by script. The Lean names are Table1Thm2.table1_prime_thm2, Thm2.first_prime, Thm2.last_prime, Table1.table1_head, and Table1.table1_gaps.
Proof. Each rung is checked in the Lean kernel via decide +kernel applied to Theorem 2 (Table1Thm2.table1_prime_thm2, Thm2.first_prime, and Thm2.last_prime), and the ordering and step bounds on the 100 rungs are checked directly in Table1.table1_head and Table1.table1_gaps. □
The 25-Rung Proth Ladder to
Separately from the verification of Saouter’s criteria and Table 1, we construct a 25-rung ladder of Proth primes that derives the ternary Goldbach range up to from the published even Goldbach range .
Theorem E. Assuming every even integer from 4 to is a sum of two primes, every odd integer from 7 to is a sum of three primes. The Lean statement ProthLadder.ternaryGoldbachUpTo_1e20_of_even proves EvenGoldbachUpTo (4 * 10^18) → TernaryGoldbachUpTo (10^20), where the hypothesis EvenGoldbachUpTo (4 * 10^18) is passed as an explicit argument, never declared as an axiom, and it is not proved here.
Proof. We check the ladder primes by Proth’s theorem (Proth.proth): if , , and there is a natural number such that
then is prime.
We take , so each of the 25 rungs has the form
with and witness base as listed in Table 1. The starting rung in Table 1 is
and the ending rung is
Let . In Lean, the chain relation (Ladder.Step2, checked for our sequence in ProthLadder.rungs_chain) checks that, starting from 3 followed by the 25 rungs, each step strictly rises and has difference at most , with largest step
The reach lemma (ProthLadder.rungs_reach) checks that the ending rung plus satisfies
The single-interval covering step (Ladder.ternary_step) establishes that if is an odd prime, is odd, and
then is even and satisfies ; by EvenGoldbachUpTo , is a sum of two primes, so is a sum of three primes. Since each consecutive step in the chain is at most , and since is even and is odd, is odd, and , so the odd integers covered from continue directly after those covered from . Induction along the chain (Ladder.ternary_of_ladder2), starting at (which covers odd from to ), therefore covers every odd integer from 7 to . □
Sanity Instance and Rung Count Comparison. To confirm that the definitions and ladder induction have no hidden vacuity, the formalization includes a sanity instance with no hypothesis (ProthLadder.ternaryGoldbachUpTo_293_vacuity): applying the exact same ladder lemma with and prime rungs 97 and 193, where ProthLadder.evenGoldbachUpTo_100 is proved directly in the kernel, yields TernaryGoldbachUpTo 293 with nothing assumed.
The rung count comparison (with the second quotient in Paper.rung_count) is:
against
in Saouter [6].
This saving comes entirely from the larger even Goldbach input , which is the published computation of Oliveira e Silva, Herzog, and Pardi [4], and not from any new idea. The ladder structure is Saouter's [6] and the use of Proth primes is that of Helfgott and Platt [3], § 3.
Cited Input, Verification Status, and Data Availability
Differences from the source
We list the differences between the Lean formalization and [6]:
(a) the constant on page 865, read as in Proposition A;
(b) the last prime, as in the remark on the final prime;
(c) Lean states the base as a natural number and as an integer, the paper as an integer;
(d) the 25 rung ladder starts at 3 and uses steps at most , the paper starts at and asks steps below ;
(e) Lemma 2 is stated in ZMod p.
The Section 3 sentence “No other change” means no other change to the formula. In addition, in Lean and are the natural number quotient and remainder of by ; is natural division of by 2, exact since is even; IsSquare is taken over the integers, so a negative is not a square, matching “not a perfect square”; and the case of BLS.lemma1 is empty since does not hold.
Input Table
There is one cited input in Theorem E, and none elsewhere in this note. Table 2 records its bibliographic details, printed wording, normalization, and Lean representation. It is a computation, cited as such and never stated as proved.
| Field | Specification |
| Source | T. Oliveira e Silva, S. Herzog, and S. Pardi [4], Empirical verification of the even Goldbach conjecture and computation of prime gaps up to , Math. Comp. 83, no. 288, 2014, 2033 to 2060. |
| Printed statement | Abstract, page 2033: the conjecture is “confirmed to be true for all even numbers not larger than ”. |
| Normalization | Inclusive at , for all even integers with . |
| Lean form | EvenGoldbachUpTo N, defined as: for all , Even n, , , IsGoldbachSum n, instantiated at . |
| Role in Lean | Explicit hypothesis in ProthLadder.ternaryGoldbachUpTo_1e20_of_even; never an axiom. |
Table 2. External cited input used in Theorem E (and nowhere else).
Verification Status Table
Every claim in this note is classified into one of four categories: Kernel (checked by the Lean 4 kernel), Script (checked by external script and not used in any Lean proof), Hand (a statement checked by hand in this note and not in Lean), or Cited (external published computation). Table 3 gives the mapping.
| Claim or Component | Lean Module / Identifier or Reference | Status |
| Proposition A: identities for and , , , that is composite, , | Paper.Table1.printed_three_composite | Kernel |
| Proposition A: leastness of (text, not used in proofs); count that 9 of 100 values are prime; rerun of Saouter’s algorithm from 138412033 reproducing Table 1; largest Table 1 step ; count that 11 of the 100 Table 1 rungs have | External check scripts | Script |
| Theorem B: Saouter’s Lemma 1 for every even | BLS.lemma1 | Kernel |
| Theorem C: Saouter’s Theorem 1 (natural and integer base), Lemma 2, and Theorem 2 (both directions and form) | Thm1.theorem1, Thm1.theorem1_int, Paper.lemma2, Thm2.theorem2, Thm2.theorem2_if | Kernel |
| Theorem D: primality of all 100 Table 1 rungs, starting prime 138412033, and ending prime 100000000209366024193; ordering and step bound below | Table1Thm2.table1_prime_thm2, Thm2.first_prime, Thm2.last_prime, Table1.table1_head, Table1.table1_gaps | Kernel |
Theorem E: implication from EvenGoldbachUpTo (4 * 10 ^ 18) to TernaryGoldbachUpTo (10 ^ 20), Proth criterion, 25 rungs, chain, reach, ladder step, induction, sanity check to 293, and | ProthLadder.ternaryGoldbachUpTo_1e20_of_even, Proth.proth, Ladder.Step2, ProthLadder.rungs_chain, ProthLadder.rungs_reach, Ladder.ternary_step, Ladder.ternary_of_ladder2, ProthLadder.ternaryGoldbachUpTo_293_vacuity, ProthLadder.evenGoldbachUpTo_100, Paper.rung_count | Kernel |
| , by multiplication; ; | Checked by hand in this note | Hand |
| Even Goldbach verification up to (hypothesis of Theorem E) | Oliveira e Silva, Herzog, and Pardi [4] | Cited |
| Saouter’s full ladder of about rungs (with Sinisalo’s input [7]); Helfgott and Platt’s verification to [3]; Helfgott’s ternary Goldbach theorem [2] | [6], [7], [3], [2] (not reverified) | Cited |
Table 3. Verification status of all claims and components (categories: Kernel, Script, Hand, Cited).
The proofs printed in this note are written for the reader; the Lean proofs are the check.
Data Availability and Build Reproduction
All Lean names in this note are under the namespace GoldbachLean.Saouter1998. The Lean 4 formalization is publicly available under the Apache-2.0 license:
Repository: https://github.com/sthubbar/goldbach-lean
Folder:
entries/saouter1998Full commit hash:
39d1ce6db8b634233ed29c2aa3e3dcf1218400dcPalomar Registry listing:
PALOMAR-2026-11-02-000012version 1, available at https://palomar-registry.org/entry.html?id=PALOMAR-2026-11-02-000012&version=1 (note that Palomar is a listing and not peer review).Toolchain: Lean and Mathlib v4.35.0-rc3.
Build instruction: Running
lake buildinsideentries/saouter1998completes in 57 s in a cloud build with cached Mathlib.Audit file and foundations: All main statements are collected and compared in
ChallengeSaouter1998.lean, which exports 19 theorems. The proofs depend only on the Lean axiomspropext,Classical.choice, andQuot.sound. Every finite primality and arithmetic check usesdecide +kerneland nevernative_decide; each rung verification costs one modular power on numbers below .
Steve Hubbard designed the research program and directed this work. AI tools, Claude, Codex, Gemini and Antigravity, were used to write the Lean code and draft the text. AI agents also did the checks of the Lean against the source, and no human expert has reviewed the mathematics. The author takes full responsibility for the content.
References
- [1]J. Brillhart, D. H. Lehmer, and J. L. Selfridge, New primality criteria and factorizations of 2^m+1, Math. Comp. 29 (1975), no. 130, 620–647.DOI
- [2]H. A. Helfgott, The ternary Goldbach conjecture is true, arXiv:1312.7748, 2013.arxiv.org/abs/1312.7748
- [3]H. A. Helfgott and D. J. Platt, Numerical verification of the ternary Goldbach conjecture up to 8.875 · 10^30, Exp. Math. 22 (2013), 406–409.
- [4]T. Oliveira e Silva, S. Herzog, and S. Pardi, Empirical verification of the even Goldbach conjecture and computation of prime gaps up to 4 · 10^18, Math. Comp. 83 (2014), no. 288, 2033–2060.
- [5]O. Ramaré and Y. Saouter, Short effective intervals containing primes, J. Number Theory 98 (2003), 10–33.DOI
- [6]Y. Saouter, Checking the odd Goldbach conjecture up to 10^20, Math. Comp. 67 (1998), no. 222, 863–866, doi:10.1090/S0025-5718-98-00928-4.
- [7]M. K. Sinisalo, Checking the Goldbach conjecture up to 4 · 10^11, Math. Comp. 61 (1993), no. 204, 931–934.DOI