Certified Parity Sieves for the Open Case of Terai's Conjecture

Terai's conjecture concerns integer solutions to $x^2 + b^m = c^n$. It says that when $(a, b, c)$ is a Pythagorean triple ($a^2+b^2=c^2$, $a$ even), the only solution is the obvious one, $(x,m,n)=(a,2,2)$. Number theorists have proved it in pieces. Modular arithmetic settles it when $c \equiv 5 \pmod 8$ and $b$ or $c$ is a prime power. A theorem guaranteeing new prime factors in recurrence sequences settles certain prime-power bases. The case $c \equiv 1 \pmod 8$, and bases with several distinct prime factors, remain open. We propose to attack the open case triple by triple, with a machine-found, machine-checked argument. For each triple, a search procedure picks a small set of primes $p$ such that reducing the equation modulo those primes rules out every solution with $m$ or $n$ odd. Once both exponents are forced even, an existing factorization argument finishes the proof. Each finished case comes with a certificate that the Lean proof assistant checks.

The deliverable is a certified census of every primitive triple with $c \equiv 1 \pmod 8$ up to a large bound, together with a catalog of the triples where purely local (congruence) arguments provably fail. Those failures mark exactly where a future general proof needs non-local tools such as linear forms in logarithms. The census also gives the theorem-proving community a research-level number-theory benchmark built from real open-problem instances rather than competition exercises. We also argue, against a tempting cross-disciplinary suggestion, that set-theoretic forcing and large cardinals cannot bear on this problem. That negative result shapes the design.

Core Claim

The method that works for $c \equiv 5 \pmod 8$ in On Terai's conjecture has two steps. Congruences modulo 4 and 8, together with Jacobi symbols (a standard test of whether a number is a square modulo another), force $m$ and $n$ to be even. Writing $m=2k$, $n=2j$ then gives the factorization $(c^j-b^k)(c^j+b^k)=x^2$, which pins down the solution. Modulo 8 is simply the wrong modulus when $c \equiv 1 \pmod 8$.

Our claim is that for nearly every individual triple, some other finite set of primes does the parity-forcing job. For a prime $p$, the value $b^m \bmod p$ depends only on $m$ modulo the multiplicative order of $b$ mod $p$, and likewise for $c^n$. So each prime turns the equation into a finite table. The table says which pairs of exponent residues are compatible with $c^n - b^m$ being a square mod $p$. Intersecting such tables across several primes, after combining exponent residues by the Chinese remainder theorem, can eliminate every pair in which $m$ or $n$ is odd.

That elimination is a finite computation, so it serves as a certificate a proof assistant can verify by direct evaluation. The scientific questions are three. How often do such certificates exist? How small can they be made? Can a learned policy for choosing primes find them far more cheaply than blind enumeration?

What Set Theory Says This Cannot Be

The research file's own gap analysis suggests importing forcing or large cardinals to settle the $c \equiv 1 \pmod 8$ case. We reject this, and the reason constrains the whole proposal. For fixed $b, c$, the statement "every solution of $x^2+b^m=c^n$ equals $(a,2,2)$" has one unbounded "for all" over a decidable condition, so it is a $\Pi_1$ arithmetic statement. The full conjecture is $\Pi_1$ as well. Such statements have the same truth value in every forcing extension and in every inner model that shares the natural numbers. If the statement is false, a single counterexample refutes it in plain arithmetic.

Contrast this with the set-theoretic results in the file, where properties genuinely fail to transfer between models. Large cardinals need not be large in HOD forces a weakly homogeneous Souslin tree (an uncountable tree with no uncountable branch or antichain) to make a supercompact cardinal fail even weak compactness in HOD, the inner model of hereditarily ordinal-definable sets. 0^{♯} and elementary end extensions of 𝑉_{𝜅} shows weak compactness is not downward absolute in the presence of $0^\sharp$. Souslin trees and successors of singular cardinals uses Laver indestructibility to keep a supercompact cardinal while adding $\lambda^+$-Souslin trees.

These constructions all exploit statements of high logical complexity, the kind that can change between models. Even the lowest-level case in the file, On The Consistency of The Definable Tree Property on Alef-Symbol1, calibrates statements about $\omega_1$, not arithmetic. Their role here is to constrain: they show what preservation and destruction techniques act on, and Terai-type uniqueness is outside that range.

We turn this into a concrete deliverable for the "research silos" direction. Every benchmark item will carry its arithmetic complexity class, and we will test whether language-model assistants propose forcing-based strategies for $\Pi_1$ items. This is the specific cross-field mistake that Logic and Learning (Dagstuhl Seminar 19361) and the TAMC prefaces (TAMC) attribute to vocabulary silos.

Research Program

The first component is the certificate format and checker. For a triple $(a,b,c)$ and a finite set of primes $S$, the certificate lists, for each $p \in S$, the orders $o_p(b)$ and $o_p(c)$ and the set of surviving residue pairs. The checker confirms three things: that each surviving pair is consistent with the squares mod $p$, that the combined survivors all have $m$ and $n$ even, and that very small exponents are handled by direct evaluation. We will write the checker in Lean 4 and prove it sound once. The general "even exponents imply the trivial solution" step will be formalized once, following the factorization argument of On Terai's conjecture. Proof assistant work is therefore confined to two lemmas plus checking by direct evaluation, with no open-ended proof search.

The second component is the prime-selection policy. Its input is features of $(b, c, p)$: the orders, the factorization of $p-1$, and how many exponent pairs this prime would eliminate given the primes already chosen. We train it by imitation on certificates that exhaustive search finds for small triples, then refine it with a reward of negative certificate size. The policy only proposes primes, and Lean independently checks every certificate, so a wrong proposal can waste time but never yields a false theorem.

The third component is the failure catalog. For triples where no certificate exists within the bound on primes, we try to prove that local arguments cannot work at all. We do this by exhibiting an odd-exponent residue pair that survives at every prime up to the bound, and by looking for structural reasons a triple might escape every modulus. The comparison with the counterexample family built from the unit $7+4\sqrt{3}$ in A new conjecture concerning the Diophantine equation $x^2 + b^y = c^z$ is instructive. That paper shows that relaxing exponent constraints admits genuine solutions, and any similar near-solution would show up as a persistent local survivor. The surviving triples are then handed to the linear-forms-in-logarithms machinery of On the Terai--Jeśmanowicz conjecture. There it is a targeted finisher rather than a general tool.

Baselines

The naive reference point is enumeration of primes in increasing order. For each triple, we add the next prime to $S$ until the certificate closes or a budget of 64 primes and a fixed wall-clock limit is exhausted. This shows how much of the census is trivially easy. The proposal must beat it on certificate size and on time per triple at equal coverage.

The strongest hand-designed competitor is the classical exponential-Diophantine sieving heuristic. It prefers primes $p$ for which $o_p(b)$ and $o_p(c)$ are even and $p-1$ has only small prime factors, because such primes carry the most parity information. It gets the same budget, the same triples, and the same checker. The learned policy beats it only if it raises coverage at the fixed budget, or matches coverage with at least a third fewer primes on average. Both comparisons will be reported on triples with $c$ larger than anything seen in training.

The neural-prover baseline is a general neural theorem prover asked to prove individual census instances directly in Lean. The closest available is the class evaluated in RLMEval: Evaluating Research-Level Neural Theorem Proving, where DeepSeek-Prover-V2-7B reaches a 10.3% pass rate at 128 samples on research-level theorems and up to 32% on the FLT3 number-theory project. For competition-level context, HyperTree Proof Search for Neural Theorem Proving reports 58.6% on miniF2F-valid. We found no reported result on Lacuna for any neural prover on Terai or Terai–Jeśmanowicz instances. We will run the prover at 128 samples per instance, with the same Lean environment and the same two formalized lemmas available.

The ablation that isolates the key ingredient keeps the checker and the budget but replaces learned selection with uniformly random primes from the same candidate range. A second ablation drops the residue-elimination feature, to test whether the policy is doing more than counting how many pairs a prime removes.

Why not just…?

Why not just sharpen linear forms in logarithms? That route has been pushed hard. In On the Terai--Jeśmanowicz conjecture, applying Laurent–Mignotte–Nesterenko bounds improved the threshold only from $b \ge 30a$ to $b \ge 25.1a$, and it still required $b \equiv 3 \pmod 4$ and $a \equiv 2 \pmod 4$. Recurrence-based methods (The Diophantine equation $x^2 + b^y = c^z$) need a prime $b$ above $8 \times 10^6$ with a fixed residue. We do not discard these tools. We aim them only at the residual triples our sieve cannot close, where they face a much smaller problem.

Why not just ask a neural theorem prover? The evidence is unfavorable. PutnamBench reports that only 5 problems in total were solved across all its prover experiments. RLMEval reports the 10.3% research-level rate and observes that sampling more proofs does not overcome conceptual difficulty. We still run the prover baseline, because individual instances are concrete and the prover might find the parity trick unaided. If it covers a comparable fraction of the census, then the certificate machinery is unnecessary for small triples, and we will say so.

Why not just brute-force the prime choice without learning? This is the real threat. Sieving is cheap, and increasing-order or heuristic enumeration may close almost every triple within budget. The random and heuristic baselines settle the question directly. If the learned policy brings no gain in coverage or certificate size on held-out large triples, we drop it. The contribution then becomes the certified census and failure catalog, which remain valuable on their own because they decide the open residue class over an explicit range and isolate the triples that need global methods.

Why not just use forcing, as the cross-field gap suggests? The uniqueness statements are $\Pi_1$, so their truth cannot vary between forcing extensions or inner models. The Souslin-tree constructions of Large cardinals need not be large in HOD have no grip on them. We test this cross-field mistake empirically, as described below, rather than pursue it.

Proposed Experiments

The census covers all primitive triples $a=2st$, $b=s^2-t^2$, $c=s^2+t^2$ with $c \le 10^7$ and $c \equiv 1 \pmod 8$, stratified into three groups: $b$ a prime power, $b$ with exactly two distinct prime factors, and $b$ with three or more. The last group is the case A new conjecture concerning the Diophantine equation $x^2 + b^y = c^z$ leaves out of reach. The metrics are the fraction of triples certified, the mean and maximum certificate size, the Lean checking time, and the size and structure of the failure catalog.

The decisive sanity check runs the same pipeline on triples with $c \equiv 5 \pmod 8$ in which $b$ or $c$ is a prime power. Theorems 1 and 2 of On Terai's conjecture guarantee these, so coverage there must be 100%, using modulus 8 or something equivalent. Any shortfall points to a checker or search bug, not to mathematics.

The decisive scientific check is whether coverage in the open class stays near complete as $c$ grows and as the number of distinct prime factors of $b$ increases. A stable coverage curve would support a structural conjecture worth proving in general: that local parity obstructions always exist. A coverage curve that falls with $c$ would show that local methods are exhausted and point to the specific triples where global arguments must take over.

As a secondary benchmark, we release the certified instances in Lean, each tagged by logical complexity, in the cross-system spirit of miniF2F. Alongside them we release a small probe set of $\Pi_1$ arithmetic items mixed with genuinely set-theoretic items drawn from the HOD and Souslin-tree literature. On this probe set we measure how often language-model assistants propose forcing for the arithmetic items. This is a direct, quantitative test of the silo-crossing error the proposal is designed to avoid.