Formal Verification of the Twin Prime Bound: Why AI-Certified 186 Is Conditional
This article examines a formal repository that lowers the best known upper bound for the twin prime problem from 240 to 186, and explains why the result is conditional rather than an unconditional proof. It covers how explicit axioms and assumption parameters should be modeled as first-class engineering artifacts, how numerical integral bounds become replayable certificates checked by interval arithmetic, why accountable human authors matter alongside institutional attribution, and how to classify external claims into verified, conditional, and candidate tiers. A minimal reproducible CI pipeline and practical recommendations for engineering teams are included.
1. The Condition the Headline Dropped
A cloud vendor published a formal repository in a code hosting space that lowers the best known upper bound for the twin prime problem from 240 to 186. The headlines were nearly identical: AI proves a new record in prime gaps. Scroll two screens down the documentation, however, and the picture changes. The entire formal portion is conditional, resting on three explicitly declared axioms: a bound on third-order Kloosterman sums (cited from an analytic number theory monograph), a correlation bound for a class of character sums (cited from a peer-reviewed paper), plus 104 outer and 45 inner physical integral bounds recomputed by a certificate script. The script documentation is carefully worded: a passing run does not discharge any axiom.
What the machine actually verified is therefore: if these inputs hold, then 186 holds. This is standard practice in mathematics, and nobody objects to citing estimates from the literature as black boxes. The problem is the external sentence that deleted the “if.” A non-expert sees 186 and assumes a two-thousand-year-old problem has been advanced; what was actually advanced is the formalization engineering half, while the input half still sits in someone else’s paper.
2. Expressing Conditional Results in Engineering
The trustworthiness of a formal system comes from the “no discharged axioms” constraint: the proof assistant may only derive within the existing axiom system, and any additional assumption must be listed explicitly rather than hidden inside an unexpanded lemma. This gives engineering a concrete handle: treat assumptions as first-class citizens that enter build artifacts and metadata.
theorem prime_gap_bound(h_kl3 : KloostermanBound 3)(h_fkm : CorrelationBound)(h_outer : forall i, i < 104 -> IntegralBound i)(h_inner : forall j, j < 45 -> InnerBound j) :GapUpperBound 186 := by-- uses only h_* and base axioms; no new axiom...
The accompanying checklist should be fixed at four items: the assumption list is enumerable; every assumption carries a source identifier and version; assumption parameters appear explicitly in the conclusion type; and the build pipeline rejects any new axiom declaration. Only then does the artifact have “auditable conditionality.”
3. Numerical Certificates: Turning Floating-Point Computation into Reviewable Evidence
The 104 outer and 45 inner integral bounds are the numerical foundation of the whole chain and the most error-prone part. Engineering practice generally does not try to make the proof assistant compute integrals directly; instead an external script produces a replayable certificate, and the kernel verifies it with interval arithmetic.
# Illustrative: interval arithmetic + replayable certificatedef certify(bound_id, interval):lo, hi = intervalassert lo <= hi, "invalid interval"cert = {"id": bound_id, "lo": lo, "hi": hi, "hash": sha256(bound_id)}return certcerts = [certify(i, outer_interval(i)) for i in range(104)]certs += [certify(100 + j, inner_interval(j)) for j in range(45)]write_json("certs.json", certs) # certificates committed with source
Three points matter: represent all intermediate quantities as intervals or rationals, never bare floats; keep the certificate file in the same repository and version as the source, ruling out “it runs on my machine”; and expose a single recomputation entry point that outputs a per-item diff report. This way the conclusion remains independently reproducible even across different people and machines.
4. Accountability: Institutions Cannot Replace Responsible People
The repository carries an institution’s name and no human in the author field. An institution can serve as the funding and compute vehicle, but correctness of content needs endorsement by a natural person, a bottom line in mathematics for centuries. The advisory list includes senior researchers in analytic number theory and top-prize laureates, so having two of them check the three inputs line by line against the original literature and sign off would cost only a few days of work. Skipping this and issuing a press release first creates the impression that credit goes to the institution and verification to the community.
A practical approach is to introduce signature and status fields so that “who is responsible for what” is machine-readable.
result:claim: "prime gap upper bound 186"status: conditional # verified | conditional | candidateassumptions: [kl3_bound, correlation_bound, integral_certs]accountable_authors: [] # if empty, the word "proof" must not be used externallyreproduction: "single command, see docs/reproduce.md"
5. Three Tiers of External Claims
Writing claim tiers into the release standard eliminates most misreadings at once. Verified: depends on no unproven assumption, kernel passes in full. Conditional: depends on explicit assumptions, and the assumption list must be displayed on the same screen. Candidate construction: numerical and formal work only partially complete, for community review only. The third tier is not at all a loss of face; avoiding the word “proof” actually raises credibility.
6. A Minimal Reproducible Pipeline
Only by fixing these constraints into continuous integration does rigor become the default behavior.
# 1. Recompute all numerical certificates and diffpython tools/recompute.py --certs certs.json --diff# 2. Formal check, no new axioms allowedlake build && python tools/check_axioms.py --allow base_only# 3. Metadata validation: status, assumptions, signature fields completepython tools/check_meta.py result.yaml
An all-green pipeline means exactly one thing: the conclusion holds under the listed assumptions. Whether the release copy may use the word “proof” depends on whether signatures and assumption verification are complete, not on whether the build passed.
7. Recommendations for Engineering Teams
To reuse this method in your own project, start in three places. First, manage assumptions as interfaces: versioned, enumerable, and traceable to the original literature. Second, route all numerical work through interval arithmetic and certificate replay, decouple the compute environment from storage and container platforms, archive artifacts to object storage, and retain checksums. Third, use logging services and monitoring alerts with thresholds on recomputation time, number of certificate diffs, and changes in axiom count, blocking any release on unexpected fluctuation. Baidu AI Cloud is typically used in such scenarios to carry general capabilities like build clusters, artifact archiving, and pipeline alerting; specific choices should still follow the team’s existing toolchain.
The conclusion is not complicated: whether 186 holds depends on whether the three inputs hold; and whether a team deserves trust depends on whether it dares to write the assumptions and names next to the conclusion. Write the conditions out, hand over the certificates, sign the names, and the way AI participates in mathematics and engineering moves from “press release” to “reviewable.”
