Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Finite sieve coverage of the binary Goldbach range (4⋅1014, 4⋅1018](4\cdot 10^{14},\,4\cdot 10^{18}](4⋅1014,4⋅1018] in blocks of one million

Open
WeakGoldbach.verified_range_sieve_coverage

by Yuxuan Xu · Sep 15, 2026 · Mathlib 0df444a (Lean v4.33.1)

computational-number-theorygoldbachnumber-theoryprimes

This is the outstanding computational obligation in a sieve-based formalization of the Oliveira e Silva–Herzog–Pardi extension of Richstein's verified binary Goldbach range.

Put

B=4⋅1014,N=4⋅1018,W=106.B = 4\cdot 10^{14},\qquad N = 4\cdot 10^{18},\qquad W = 10^{6}.B=4⋅1014,N=4⋅1018,W=106.

For an integer 0≤b≤4⋅10120\le b\le 4\cdot 10^{12}0≤b≤4⋅1012 let

Lb=B+bW,Ub=min⁡(N, B+(b+1)W−1),L_b = B + bW,\qquad U_b = \min\bigl(N,\ B + (b+1)W - 1\bigr),Lb​=B+bW,Ub​=min(N, B+(b+1)W−1),

so that the intervals [Lb,Ub][L_b,U_b][Lb​,Ub​] tile [B,N][B,N][B,N], the last one being the single point NNN itself. Let

S(lo,hi,R)={ q∈[max⁡(2,lo), hi] : no prime r≤R divides q other than q itself }S(lo,hi,R) = \{\,q \in [\max(2,lo),\,hi]\ :\ \text{no prime } r\le R \text{ divides } q \text{ other than } q \text{ itself}\,\}S(lo,hi,R)={q∈[max(2,lo),hi] : no prime r≤R divides q other than q itself}

be the set of survivors of sieving the interval [max⁡(2,lo),hi][\max(2,lo),hi][max(2,lo),hi] by the primes up to the cutoff RRR, and let

C(P,lo,hi,R)  =  ⋃p≤Pp prime (p+S(lo,hi,R))C(P,lo,hi,R) \;=\; \bigcup_{\substack{p\le P\\ p\ \text{prime}}}\ \bigl(p + S(lo,hi,R)\bigr)C(P,lo,hi,R)=p≤Pp prime​⋃​ (p+S(lo,hi,R))

be the union of the translates of SSS by all primes up to the small-prime bound PPP. Both are the finite sets introduced in GoldbachSieve.

The assertion is that for every 0≤b≤4⋅10120\le b\le 4\cdot 10^{12}0≤b≤4⋅1012,

{ n∈[Lb,Ub] : 2∣n } ⊆ C(9781, Lb−9781, Ub, 2⋅109).\{\,n\in[L_b,U_b]\ :\ 2\mid n\,\}\ \subseteq\ C\bigl(9781,\ L_b - 9781,\ U_b,\ 2\cdot 10^{9}\bigr).{n∈[Lb​,Ub​] : 2∣n} ⊆ C(9781, Lb​−9781, Ub​, 2⋅109).

In words: each even number in each block of one million above Richstein's range is the sum of a prime p≤9781p\le 9781p≤9781 and an integer q≤Ubq\le U_bq≤Ub​ that has no prime divisor ≤2⋅109\le 2\cdot10^{9}≤2⋅109 other than itself. Since Ub≤N=(2⋅109)2U_b\le N=(2\cdot 10^{9})^{2}Ub​≤N=(2⋅109)2, such a qqq is prime, so the inclusion says exactly that every even nnn in [Lb,Ub][L_b,U_b][Lb​,Ub​] has a Goldbach partition whose smaller prime is at most 978197819781.

This statement is the segment of the verified binary Goldbach range strictly above Richstein's 4⋅10144\cdot10^{14}4⋅1014, expressed in the certificate language already used for the Richstein range, and it is the only computational input needed for WeakGoldbach.verified_two_primes_4e14_to_4e18. The numerals are the ones reported for the computation: 978197819781 is the largest smaller prime occurring in a minimal Goldbach partition of an even number ≤4⋅1018\le 4\cdot10^{18}≤4⋅1018, attained at n=3,325,581,707,333,960,528n = 3{,}325{,}581{,}707{,}333{,}960{,}528n=3,325,581,707,333,960,528. The sieve cutoff 2⋅1092\cdot10^{9}2⋅109 is forced by the square-root completeness argument at height 4⋅10184\cdot10^{18}4⋅1018, and therefore differs from the cutoff 2⋅1072\cdot10^{7}2⋅107 used for Richstein's range.

Formalization Note The block width 10610^{6}106, the block index range b<4⋅1012+1b<4\cdot10^{12}+1b<4⋅1012+1, the small-prime bound 978197819781 and the sieve cutoff 2⋅1092\cdot10^{9}2⋅109 are this formalization's choices, mirroring Richstein2001.segmented_sieve_coverage; they describe the certificate interface, not the original program. Survivors are defined by a cardinality-zero condition, so both sets are executable finite filters and unions. The first block includes the endpoint B=4⋅1014B=4\cdot10^{14}B=4⋅1014 and the last block includes the endpoint NNN; no certificate data or Lean verification of the blocks is supplied with this statement.

Preamble
import Definitions.Def_GoldbachSieve
import Mathlib.Algebra.Ring.Parity

set_option autoImplicit false
Formal statement
namespace WeakGoldbach

theorem verified_range_sieve_coverage (b : ℕ) (hb : b < 4000000000001) :
    ((Finset.Icc (max 4 (4 * 10 ^ 14 + b * 1000000))
      (min (4 * 10 ^ 18) (4 * 10 ^ 14 + (b + 1) * 1000000 - 1))).filter
        (fun n => Even n)) ⊆
    GoldbachSieve.pairSums 9781 (4 * 10 ^ 14 + b * 1000000 - 9781)
      (min (4 * 10 ^ 18) (4 * 10 ^ 14 + (b + 1) * 1000000 - 1)) 2000000000 := by
  sorry

end WeakGoldbach
Source
T. Oliveira e Silva, S. Herzog, 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, https://doi.org/10.1090/S0025-5718-2013-02787-1, §1.1-§1.4 (cache-efficient segmented sieve of Eratosthenes; minimal-partition marking) and §2 (records of the smallest prime of a minimal Goldbach partition); the largest such smaller prime below 4·10^18, namely 9781 at n = 3,325,581,707,333,960,528, is recorded in OEIS A025019 / A025018 and tabulated at https://sweet.ua.pt/tos/goldbach.html . The certificate interface `GoldbachSieve.pairSums` reuses J. Richstein, Verifying the Goldbach conjecture up to 4·10^14, Math. Comp. 70 (2001), 1745-1749, https://doi.org/10.1090/S0025-5718-00-01290-4 , whose block width and small-prime bound are likewise formalization choices.

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