# Rigorous arithmetic and replay

The `certify.py` module gives rigorous **finite** zero counts, critical-line zero enclosures, and a complete zero-form enclosure on a specified finite Gaussian span. It does not prove or refute the unrestricted Riemann Hypothesis. Its numerical trust base is FLINT's Arb/Acb ball arithmetic; its analytic trust base is the stated standard zeta properties, argument principle, intermediate value theorem, and the unconditional zero-count estimate cited below. This is an independently replayable numerical proof transcript, not a proof-assistant derivation of FLINT or those theorems.

## Tested versions and invocation

Native validation uses `python-flint==0.9.0`, linked to FLINT **3.6.0**. The browser package selected for separate browser validation is `python-flint==0.8.0` under Pyodide 0.29.5. API compatibility is intentional; browser success must be established by execution, not inferred from the native results.

From the repository root:

```sh
.venv/bin/python -B -m unittest discover -s research/riemann-2026-10-14 -p test_certify.py -v
printf '%s' '{"height":"100","precision_bits":192}' | .venv/bin/python research/riemann-2026-10-14/certify.py finite_zeros --output research/riemann-2026-10-14/evidence/certification-zeros-100.json
.venv/bin/python research/riemann-2026-10-14/certify.py replay --input research/riemann-2026-10-14/evidence/certification-zeros-100.json
printf '%s' '{"sigma":"1/4","frequencies":["0","14","21"],"height":"100","precision_bits":192}' | .venv/bin/python research/riemann-2026-10-14/certify.py gaussian_matrix --output research/riemann-2026-10-14/evidence/certification-gaussian.json
.venv/bin/python research/riemann-2026-10-14/certify.py replay --input research/riemann-2026-10-14/evidence/certification-gaussian.json
```

Use `dispatch(payload)` in the browser worker. Operations are `backend`, `zeta_ball`, `rectangle`, `finite_zeros`, `gaussian_matrix`, and `replay`. Numeric inputs are exact decimal or rational **strings**; binary floating inputs are rejected. `gaussian_matrix` optionally accepts `coefficients: [["real","imaginary"], ...]` with one exact pair per frequency. It returns `quadratic_form_enclosure` and `quadratic_form_sign`, retaining every mixed contribution. The separately labelled `diagonal_only_changed_calculation` is never substituted for the complete form. Replay validates the coefficients and recomputes both enclosures. The `replay` payload contains a `cert` object. Missing FLINT or unresolved computation returns `status: inconclusive`. A finite output ball enclosing zero is explicitly **not** an existence claim.

Limits: 80–512 bits, height at most 200, at most 30,000 contour segments and subdivision depth 28; replay normally adds 32 bits, so request at most 480 bits if this default replay is wanted. The Gaussian dimension is at most six. Worker cancellation must terminate the worker: the Python wrapper cannot interrupt a long-running C call. Native callers should use an external process timeout for untrusted/new searches. The tested certificates below take seconds rather than minutes on the validation host.

## Every radius survives export

Each real ball is serialized as exact dyadic midpoint and nonnegative radius: `[integer mantissa, binary exponent]`. Its exact interval is `(m ± r)`, with each component interpreted as mantissa times a power of two. Complex balls retain both real and imaginary intervals. Display strings are convenience only. Input radii are preserved through evaluation; decimal points are parsed as exact rationals and rounded outward by FLINT.

Replay computes from the original inputs and compares exact rational endpoints with the recorded bounds. It checks contour geometry, all image covers, winding, pole correction, count saturation and xi signs; the Gaussian replay additionally recomputes matrix intervals, the tail, and the principal determinants. Hashes are not used as validity evidence. Replacing a count, removing a root, shifting a contour endpoint, falsifying an image box, or understating the tail is rejected by tests.

## Independent argument-principle counter

Let R be a closed counterclockwise rectangle with rational vertices. Subdivide its four edges into rational segments. For each segment L, evaluate zeta on a complex **input rectangle containing the whole segment**, obtaining a rigorous rectangular image enclosure B. Add rational approximations to zeta at the two endpoints to B's convex rectangular hull. Reject or subdivide until every B is finite and excludes the origin. A small explicit outward padding allows stable replay across algorithms and precisions.

The actual image arc zeta(L) and the polygon chord lie in the same convex B, which avoids zero. Their straight homotopy is therefore zero-free. Adjacent homotopies agree at their shared endpoints. Thus the image of the full contour has exactly the winding number of the closed rational polygon. The code calculates that integer using exact rational ray crossings, without sampled arguments, floating phases, or unwrapping assumptions.

Zeta has one simple pole, at 1. For a zero-free boundary that avoids this pole,

\[
  Z_R = \operatorname{wind}(\zeta(\partial R),0) + \mathbf1_{\{1\in\operatorname{int}R\}}.
\]

Here Z_R counts **all** zeros inside R, including multiplicity. Boundary zeros are not admitted: a contour cover containing zero is subdivided or reported inconclusive. A direct rectangle may contain trivial zeros; their existence is not an RH counterexample. A positive count in a rectangle wholly within the nontrivial strip and whose closed real interval excludes 1/2 would constitute an off-line-zero certificate. No such rectangle has been found here.

Replay re-evaluates every arc. Higher-precision interval dependency bounds need not nest; if a re-evaluated arc ball is wider than its recorded cover, replay subdivides that arc and verifies that the new covers fit. It never merely checks overlap.

## Finite critical-line completeness

`finite_zeros(T)` first counts all zeros in `(-1,2) × (-T,T)` by the independent contour construction. The standard zeta zero locations (trivial zeros at negative even integers; all other zeros in `0<Re(s)<1`; no real nontrivial zeros) mean this contains precisely the nontrivial zeros with `|Im(s)|<T`. There are no boundary zeros by the image-cover proof. Conjugation symmetry divides the total into equal positive- and negative-height counts.

Only then is `acb.zeta_zero(k)` used to propose candidate ordinates. For each one, a rational interval `(a_k,b_k)` is enlarged around the candidate, and the code rigorously evaluates

\[
 \xi(\tfrac12+it)=\tfrac12s(s-1)\pi^{-s/2}\Gamma(s/2)\zeta(s),\qquad s=\tfrac12+it
\]

at both endpoints. This is a continuous **real** function for real t, by the functional equation and conjugation. Opposite signs establish an actual critical-line zero by the intermediate value theorem. The code checks disjoint intervals, positive lower endpoints, and upper endpoints strictly less than T. If their number equals the all-zero count with multiplicity, every zero in the region is among them and is simple. The proof uses neither an assumption that line searching is complete nor the candidate routine's ordering as a completeness theorem.

The replay performs this proof using the recorded rational intervals; it does **not** call `zeta_zero` and does not need to trust its candidate indexing.

## Audit of FLINT zero routines

[python-flint 0.9.0's binding](https://github.com/flintlib/python-flint/blob/0.9.0/src/flint/types/acb.pyx) forwards `zeta_zero` to FLINT. The [FLINT 3.6.0 implementation](https://github.com/flintlib/flint/blob/v3.6.0/src/acb_dirichlet/zeta_zeros.c) obtains Hardy Z ordinates and sets the real coordinate to exactly 1/2. It is therefore not an arbitrary complex zero isolator.

The [FLINT 3.6.0 isolation source](https://github.com/flintlib/flint/blob/v3.6.0/src/acb_dirichlet/isolate_hardy_z_zero.c) uses Gram/Rosser ranges and Turing machinery; its introductory algorithm comment says that a counterexample can cause an infinite loop while searching for the required line sign changes. A returned result and a nonterminating search have different meanings. The published [`zeta_nzeros` contract](https://flintlib.org/doc/acb_dirichlet.html) counts all positive-height zeros with multiplicity, but this module uses its own contour count and does not call it for completeness. The independent count and replay also avoid importing the low-index Gram/Rosser tables as proof premises.

[Arb/Acb numeric documentation](https://python-flint.readthedocs.io/en/latest/acb.html) defines rectangular complex ball enclosures. The `[midpoint,radius]` serialization is read from exact dyadic components, rather than from truncated formatted decimals.

## Complete Gaussian zero-form certification

Take common real sigma > 0, real frequencies t_j, and

\[
 G_j(s)=s(s-1)\sqrt{2\pi}\sigma
 \exp\left(\frac{\sigma^2}{2}(s-\tfrac12-it_j)^2\right).
\]

The target is the full reflected form

\[
 K_{ij}=\sum_\rho G_j(\rho)\overline{G_i(1-\bar\rho)}.
\]

This pairing is retained for the **unknown** zeros beyond T. For this particular family, direct algebra gives `G_i(1-conj(s))=conj(G_i(s))`. Pairing rho with `1-conj(rho)` in the full multiset makes K real symmetric, even if zeros outside the verified region are off-line. Absolute convergence follows from the bound below. On the finitely verified line zeros only, the summand is the product of two real values

\[
G_j(\tfrac12+i\gamma)=-(\gamma^2+\tfrac14)\sqrt{2\pi}\sigma
 e^{-\sigma^2(\gamma-t_j)^2/2}.
\]

These are computed on the **whole** certified ordinate interval, for both signs of gamma. Mixed entries are retained. The omitted tail is bounded uniformly on the full critical strip.

Put M=max_j |t_j| and, for u≥T>M,

\[
 F(u)=2\pi\sigma^2 e^{\sigma^2/4}(u^2+1)^2
       e^{-\sigma^2(u-M)^2}.
\]

For rho=beta+i gamma with 0<beta<1,

\[
 |G_j(\rho)\overline{G_i(\rho^*)}|
 \le 2\pi\sigma^2(\gamma^2+1)^2
 e^{\sigma^2(\beta-1/2)^2-
    \frac{\sigma^2}{2}[(\gamma-t_j)^2+(\gamma-t_i)^2]}
 \le F(|\gamma|).
\]

No RH premise occurs in this bound. It keeps beta throughout the estimate.

The unconditional [Hasanalizade–Shen–Wong, *Counting zeros of the Riemann zeta function*, Corollary 1.2](https://arxiv.org/pdf/2107.06506) gives, for u≥e,

\[
\left|N(u)-\frac{u}{2\pi}\log\frac{u}{2\pi e}\right|
 \le .1038\log u+.2573\log\log u+9.3675.
\]

For u≥10 this implies `N(u)≤u log u`: use pi>3, log log u≤log u, .1038+.2573<1/2, 9.3675<10<5 log u, then `u/6+11/2≤u`. This deliberately weak consequence is enough. It counts all zeros with multiplicity. We use this corrected source rather than relying on the older Trudgian parameter estimates identified as problematic in the paper's footnote 2.

Set

\[
\lambda=2\sigma^2(T-M)-4/T,\qquad \mu=2/(T+1).
\]

Require T≥10 and lambda>mu, checked with balls. Since

\[
 (\log F)'(u)=4u/(u^2+1)-2\sigma^2(u-M)\le-\lambda,
\]

we have `F(T+k)≤F(T)e^{-lambda k}`. The number of positive-height zeros in the k-th unit bin is at most `N(T+k+1)`. Also

\[
 (T+k+1)\log(T+k+1)\le(T+1)\log(T+1)e^{\mu k},
\]

because the logarithmic derivative of `u log u` is at most `2/u` for u≥e. Summing these bin bounds and using conjugation for negative heights yields the rigorous entrywise remainder

\[
 B=\frac{2F(T)(T+1)\log(T+1)}{1-e^{-\lambda+\mu}}.
\]

The numerator, denominator, exponentials, logarithms and upper bound are computed with balls. The resulting matrix enclosure includes both finite-zero interval errors and this full tail. It also includes an explicit small outward replay margin `(1+|K_ij|)2^{-floor(bits/3)}`. For dimension d the tail's spectral norm is at most dB. The code proves positive definiteness using strictly positive interval lower bounds on every leading principal determinant (Sylvester's criterion). This is stronger than checking the signs of diagonal entries or floating eigenvalues, and covers arbitrary complex coefficient vectors on the supplied span.

For sigma=1/4, frequencies (0,14,21), T=100, 192-bit generation, native execution obtains:

- 29 positive-height zeros, exhausted by disjoint sign-change enclosures;
- each omitted matrix entry bounded by approximately `1.4740064359260858 × 10^-159`;
- strictly positive leading principal determinants enclosing approximately `0.118667791978489123`, `1357.66127938272432`, and `133974898.877588558`.

These are computed outputs, not hardcoded targets. Exact radii and reproducible inputs are in the JSON certificate. The full **three-dimensional Gaussian span** is therefore positive definite, conditional only on the explicitly stated analytic theorems and ball-arithmetic implementation. It does not imply positivity for every Weil test function, density with a uniform controlled passage to the limit, or RH. The equality of this zero form with the full arithmetic form requires the Gaussian admissibility and explicit-formula derivations in the manuscript. This module does not certify the separate real-place quadrature and prime sum; it certifies the complete zero form with its unconditional tail.

## Evidence and interpretation

`certification-zeros-100.json`, `certification-gaussian.json`, and `certification-gaussian-coefficients.json` contain complete replayable transcripts. The coefficient example uses (1+i, -1/3+i/7, 1/10-2i/5); its complete quadratic form differs from the diagonal-only changed calculation. The native 19-test suite includes exact complex coefficients, zero coefficients, duplicate basis vectors, pole corrections, trivial zeros, positive/negative-height local rectangles, boundary-zero rejection, seeded random rectangles with known pole/trivial-zero counts, and deliberately malformed or altered certificates. `certification-validation.json` records native version, generation and replay outcomes, and the mathematical scope. Run the test suite and replay after dependency changes. A browser structural check without reevaluating the zeta and xi balls would be insufficient; the site must run the FLINT worker for mathematical replay.
