Generated by scripts/make_context.py. Do not edit by hand — regenerate.
This file carries facts extracted from the source: the public API, the document index, the script index, test counts. Judgment — house rules, naming traps, derived conventions, honest-scope policy — lives in AGENTS.md and is written by hand. Read both.
What this repository is
A computational laboratory for the Riemann zeta function: an instrument for building intuition and verified numerics about the Riemann Hypothesis. It is not a proof attempt, and nothing computed here is evidence for RH (docs/08-why-it-is-hard.md). The organising chain:
theta is the heat kernel on a circle
-> Poisson summation gives theta(1/x) = sqrt(x) theta(x)
-> the Mellin transform gives xi(s) = xi(1-s)
-> whose mirror axis is Re(s) = 1/2
-> the explicit formula rebuilds primes from the zeros
-> the same heat flow applied to Xi gives de Bruijn-Newman Lambda,
where RH <=> Lambda = 0 and Lambda >= 0 is a theoremPackage API (zeta/)
zeta/core.py — Foundational special functions for the Riemann zeta laboratory.
1354 lines
Constants: DPS_DEFAULT, DATA_DIR, HEAT_DIFFUSIVITY
zeta(s, dps: int = DPS_DEFAULT)— Riemann zeta function ζ(s), valid on the whole plane (pole at s = 1).eta(s, dps: int = DPS_DEFAULT)— Dirichlet eta (alternating zeta) functionzeta_via_eta(s, dps: int = DPS_DEFAULT)— ζ(s) recovered from the alternating series:euler_maclaurin_suggest_N(s, dps: int = DPS_DEFAULT, M: int = 20) -> int— A safe truncation point N for :func:zeta_euler_maclaurin.zeta_euler_maclaurin(s, N: int = 20, M: int = 20, dps: int = DPS_DEFAULT)— Hand-rolled Euler–Maclaurin continuation of ζ to the whole s-plane.theta(x, dps: int = DPS_DEFAULT, terms: int | None = None)— Jacobi theta (θ₃-type) function on the positive real axis:omega(x, dps: int = DPS_DEFAULT, terms: int | None = None)— Riemann's ω(x) = Σ_{n≥1} e^{−π n² x} = (θ(x) − 1)/2, x > 0.theta_modular_defect(x, dps: int = DPS_DEFAULT)— θ(1/x) − √x · θ(x), which is identically 0 for x > 0.theta_heat(x, t, terms: int | None = None, dps: int = DPS_DEFAULT)— Heat kernel on the circle ℝ/ℤ, spectral (Fourier) form:theta_heat_gaussian(x, t, terms: int | None = None, dps: int = DPS_DEFAULT)— Heat kernel on ℝ/ℤ, real-space (periodised Gaussian) form:theta_heat_poisson_defect(x, t, dps: int = DPS_DEFAULT)— theta_heat(x,t) − theta_heat_gaussian(x,t): Poisson summation, checked.theta_heat_residual(x, t, h = None, dps: int = DPS_DEFAULT, diffusivity = None)— Numerically verify the heat equation obeyed by :func:theta_heat:completed_zeta(s, dps: int = DPS_DEFAULT)— Λ(s) = π^{−s/2} Γ(s/2) ζ(s), the "completed" zeta.xi(s, dps: int = DPS_DEFAULT)— Riemann's ξ function — entire, with ξ(s) = ξ(1−s):Xi(t, dps: int = DPS_DEFAULT, tol_digits: int = 8)— Ξ(t) = ξ(½ + it), which is real for real t.functional_equation_defect(s, dps: int = DPS_DEFAULT)— ξ(s) − ξ(1−s), identically zero: Riemann's functional equation.rs_theta(t, dps: int = DPS_DEFAULT)— Riemann–Siegel theta functionZ(t, dps: int = DPS_DEFAULT, tol_digits: int = 8)— Hardy's functionhardy_Z_sign_changes(t0, t1, n_samples: int, dps: int = 15, cache: bool = True) -> list[tuple[float, float]]— Bracket the sign changes of Hardy's Z on [t0, t1].mellin_gamma_zeta(s, dps: int = DPS_DEFAULT, regularized: bool = True, n_subtract: int | None = None)— Compute, numerically, the Mellin (Laplace-type) integralmellin_gamma_zeta_defect(s, dps: int = DPS_DEFAULT, regularized: bool = True)— ∫_0^∞ x^{s−1}/(e^x−1) dx − Γ(s)·ζ(s). Identically zero.theta_mellin_xi(s, dps: int = DPS_DEFAULT)— Riemann's theta–Mellin representation of the completed zeta:theta_mellin_xi_defect(s, dps: int = DPS_DEFAULT)— theta_mellin_xi(s) − π^{−s/2}Γ(s/2)ζ(s). Identically zero.
zeta/zeros.py — Locating and counting the non-trivial zeros of the Riemann zeta function.
796 lines
Constants: DATA_DIR, THETA_ARGMIN
rs_theta(t, dps: int = 30) -> mpf— Riemann–Siegel theta function.Z(t, dps: int = 30) -> mpf— Hardy's function Z(t) = e^{i θ(t)} ζ(1/2 + i t).gram_point(n: int, dps: int = 30) -> mpf— The n-th Gram point g_n: the unique t > 7 with θ(t) = n·π.gram_points(n0: int, n1: int, dps: int = 30) -> list[mpf]— Gram points g_{n0}, …, g_{n1} — the range is inclusive at both ends.zeros_by_sign_change(t0, t1, n_samples: int | None = None, dps: int = 25) -> list[mpf]— Ordinates of the zeros of Hardy's Z in [t0, t1], found by bracketing.S_of_T(T, dps: int = 25) -> mpf— The fluctuating term S(T) = N(T) − 1 − θ(T)/π = (1/π) arg ζ(1/2 + iT).N_of_T(T, dps: int = 25) -> int— Exact number of zeros ρ = β + iγ of ζ with 0 < γ < T (with multiplicity).riemann_von_mangoldt(T) -> float— Main term of the Riemann–von Mangoldt formula,gram_law_violations(n0: int, n1: int, dps: int = 25) -> list[int]— Gram indices n in [n0, n1] (inclusive) where Gram's law fails.first_n_zeros(n: int, cache: bool = True, dps: int = 30) -> list[mpf]— The first n zero ordinates γ_1 < γ_2 < … < γ_n, in increasing order.zeros_from_scratch(n: int, dps: int = 25, verify: bool = True) -> list[mpf]— The first n zero ordinates using only sign changes of Z and a Gram walk.verify_rh_up_to(T, verbose: bool = False, dps: int = 25, max_samples: int = 200001) -> dict— Verify that every zero of ζ with 0 < γ < T is simple and on the line.
zeta/explicit.py — zeta.explicit — the explicit formula: primes reconstructed from the zeros.
879 lines
Constants: LI2
mangoldt(n: int) -> float— Von Mangoldt functionpsi_true(x: float) -> float— Chebyshev's second functiontheta_cheb(x: float) -> float— Chebyshev's first functionpi_true(x: float) -> int— Exact prime-counting function π(x) = #{ p prime : p ≤ x }.psi_staircase(x_grid: Sequence[float] | np.ndarray) -> np.ndarray— ψ(x) on a whole grid (vectorised) — the exact staircase to plot underneathli(x: float, offset: bool = False) -> float— Logarithmic integral. Both conventions are exposed.Li(x: float) -> float— Offset (Gauss) logarithmic integral Li(x) = ∫₂^x dt/log t = li(x) − li(2).R(x: float, terms: int | None = None, dps: int = 30) -> float— Riemann's prime-counting approximationfirst_zeros(n: int, dps: int = 25, cache: bool = True) -> np.ndarray— Ordinates γ₁ < γ₂ < … < γ_n of the first `n` nontrivial zeros ρ = ½ + iγ.as_gammas(zeros: int | Iterable[float] | Iterable[complex] | np.ndarray) -> np.ndarray— Normalise the several ways one may hand over "the zeros" into a sorted arraypsi_curve(x_grid: Sequence[float] | np.ndarray, zeros: int | Iterable[float] | np.ndarray, include_trivial: bool = True, chunk: int = 4096) -> np.ndarray— Vectorised :func:psi_from_zeros— the reconstructed staircase on a grid:psi_from_zeros(x: float, zeros: int | Iterable[float] | np.ndarray, include_trivial: bool = True) -> float— Von Mangoldt's explicit formula for Chebyshev's ψ (x > 1):J_from_zeros(y: float, zeros: int | Iterable[float] | np.ndarray, include_tail: bool = True, dps: int = 30) -> float— Riemann's explicit formula for the weighted prime counterpi_from_zeros(x: float, zeros: int | Iterable[float] | np.ndarray, terms: int | None = None, form: Literal['mobius', 'R'] = 'mobius', dps: int = 30) -> float— Riemann's formula for π(x), driven entirely by the zeros:prime_spectrum(zeros: int | Iterable[float] | np.ndarray, u_grid: Sequence[float] | np.ndarray, window: str | Callable[[np.ndarray], np.ndarray] | None = 'gauss', normalize: bool = True, chunk: int = 2048) -> np.ndarray— "The music of the primes" — the dual of the explicit formula: read thespectrum_peaks(u_grid: np.ndarray, spectrum: np.ndarray, n_peaks: int = 12, prominence: float | None = None) -> list[dict]— Locate the tallest peaks of a :func:prime_spectrumand identify them.convergence_table(x: float, zeros: int | Iterable[float] | np.ndarray, counts: Sequence[int] = (0, 1, 10, 50, 100, 200, 500), include_trivial: bool = True) -> list[dict]— How fast do the zeros rebuild ψ(x)?
zeta/statistics.py — Zero statistics of ζ(s) and the random-matrix (GUE) connection.
1131 lines
riemann_siegel_theta(t: ArrayLike) -> NDArray[np.float64]— Riemann–Siegel theta functionriemann_siegel_z(t: ArrayLike, k_terms: int = 3, chunk: int = 20000) -> NDArray[np.float64]— Hardy's Z-function via the Riemann–Siegel formula (vectorised, float64).zero_ordinates(n: int | None = None, *, t_max: float = 10000.0, use_cache: bool = True, source: str = 'auto') -> NDArray[np.float64]— Ordinates γₙ > 0 of the non-trivial zeros ρ = 1/2 + iγₙ, ascending.unfold(gammas: ArrayLike) -> NDArray[np.float64]— Rescale ordinates to unit mean spacing: γ̃ₙ = θ(γₙ)/π.nearest_neighbour_spacings(gammas: ArrayLike) -> NDArray[np.float64]— Consecutive spacings sₙ = γ̃ₙ₊₁ − γ̃ₙ of the unfolded ordinates.wigner_surmise_gue(s: ArrayLike) -> NDArray[np.float64]— Wigner surmise for β = 2 (GUE) nearest-neighbour spacings:wigner_surmise_gue_cdf(s: ArrayLike) -> NDArray[np.float64]— CDF of the GUE Wigner surmise.poisson_spacing(s: ArrayLike) -> NDArray[np.float64]— Spacing density of uncorrelated levels of unit mean density:poisson_spacing_cdf(s: ArrayLike) -> NDArray[np.float64]— CDF F(s) = 1 − e^{−s} of the Poisson (uncorrelated) spacing law.gue_gap_probability(s: ArrayLike) -> NDArray[np.float64]— E(0;s): probability that an interval of length s of the unit-density GUEgue_spacing_exact(s: ArrayLike) -> NDArray[np.float64]— Exact GUE nearest-neighbour spacing density (the Gaudin distribution).gue_spacing_exact_cdf(s: ArrayLike) -> NDArray[np.float64]— CDF of the exact GUE (Gaudin) spacing law.montgomery_prediction(r: ArrayLike) -> NDArray[np.float64]— Montgomery's pair-correlation function (= GUE / sine-kernel two-point):pair_correlation(gammas: ArrayLike, r_max: float = 3.0, bins: int = 60) -> tuple[NDArray[np.float64], NDArray[np.float64]]— Empirical pair correlation of the unfolded zeros.form_factor(gammas: ArrayLike, tau_grid: ArrayLike, smooth: int = 0) -> NDArray[np.float64]— Spectral form factor of the unfolded zeros,gue_eigenvalues(n: int, seed: int | None = None) -> NDArray[np.float64]— Eigenvalues of one n×n matrix drawn from the Gaussian Unitary Ensemble.unfold_gue(eigenvalues: ArrayLike, n: int) -> NDArray[np.float64]— Unfold GUE eigenvalues with the exact integrated semicircle law.level_repulsion_report(gammas: ArrayLike) -> dict[str, Any]— Kolmogorov–Smirnov the empirical spacings against GUE and against Poisson.compare_to_random_matrix(n_zeros: int = 10000, seed: int = 0, *, matrix_size: int = 800, bins: int = 60, s_max: float = 4.0, gammas: ArrayLike | None = None) -> dict[str, Any]— The headline experiment: zeta zeros vs an actual random GUE matrix.
zeta/moments.py — External data and finite estimators for the moments programme.
1523 lines
Constants: ODLYZKO_TABLES
class ZeroTableError— Raised when an external zero table fails structural validation.class MomentError— Raised when moment samples or a scorecard fail their stated contract.class OdlyzkoTableSpec— Pinned public metadata for one table on Odlyzko's official page.class ExternalZeroTable— A validated table represented as `base + offsets` in decimal.class CriticalLineSampleTable— A checked, provenance-carrying table of sampled `abs(zeta)` values.class MomentEstimate— One finite, provenance-carrying critical-line moment estimate.class MomentReference— Leading-order reference for the `2k`-th zeta moment.class MomentPolynomial— The full degree-`k^2moment polynomialP_k`.class MomentScore— One row of a :class:MomentScorecard.class MomentScorecard— Theorem-calibrated comparison of finite measurements and references.load_lmfdb_zeros(path: str | Path, *, expected_count: int | None = None, expected_first_index: int | None = None, expected_sha256: str | None = None, source_url: str = 'https://www.lmfdb.org/zeros/zeta/') -> ExternalZeroTable— Load an LMFDB plain-text export containing `index ordinate` rows.load_odlyzko_zeros(path: str | Path, *, table_id: str | None = None, expected_sha256: str | None = None) -> ExternalZeroTable— Load one of the six text tables listed on Odlyzko's official page.load_critical_line_samples(path: str | Path, *, table: ExternalZeroTable, error_kind: Literal['bound', 'estimate'], value_source: str, source_url: str, expected_count: int | None = None, expected_sha256: str | None = None) -> CriticalLineSampleTable— Load `offset abs_zeta absolute_error` rows for one zero window.estimate_moment(table: ExternalZeroTable, *, k: int, sample_offsets: Sequence[Decimal | str | int], abs_zeta_values: Sequence[Decimal | str | int], absolute_value_errors: Sequence[Decimal | str | int] | Decimal | str | int, error_kind: Literal['bound', 'estimate'], value_source: str, dps: int = 60) -> MomentEstimate— Estimate a finite `2k`-th moment on an imported-zero window.estimate_moment_from_samples(table: ExternalZeroTable, samples: CriticalLineSampleTable, *, k: int, dps: int = 60) -> MomentEstimate— Estimate one moment from a loaded, digest-linked sample table.moment_reference(k: int, *, prime_cutoff: int = 100000, dps: int = 50) -> MomentReference— Return the leading reference for the second through eighth moments.moment_polynomial(k: int, *, dps: int = 50) -> MomentPolynomial— Return the full CFKRS moment polynomial for `k=1,2,3,4`.leading_moment_mean(reference: MomentReference, interval_start: Decimal | str | int, interval_end: Decimal | str | int, *, dps: int = 50) -> Decimal— Average the leading density over `[A,B]` for normalization.moment_polynomial_mean(polynomial: MomentPolynomial, interval_start: Decimal | str | int, interval_end: Decimal | str | int, *, dps: int = 50) -> Decimal— Average `P_k(log(t/(2*pi)))over[A,B]`.moment_scorecard(estimates: Sequence[MomentEstimate], *, calibration_relative_tolerance: Decimal | str | int, references: Mapping[int, MomentReference] | None = None, polynomials: Mapping[int, MomentPolynomial] | None = None, prime_cutoff: int = 100000, dps: int = 50) -> MomentScorecard— Compare finite estimates with full moment polynomials behind a theorem gate.
zeta/heatflow.py — Heat flow on the Riemann Ξ function and the de Bruijn–Newman constant.
1431 lines
Constants: DEFAULT_DPS, H0_RELATION, PHI_STRIP
Xi_reference(T: Any, backend: str = 'auto') -> Any— Ξ(T) = ξ(1/2 + iT), real for real T.xi_backend_report(T_values: Sequence[Any] | None = None, dps: int = 40) -> dict[str, Any]— Compare `Xi_reference(siblingzeta.core`) against the local ξ.Phi(u: Any, terms: int | None = None, dps: int = DEFAULT_DPS) -> Any— Φ(u) = Σ_{n≥1} (2π²n⁴ e^{9u} − 3π n² e^{5u}) · exp(−π n² e^{4u}).Phi_is_even_defect(u: Any, dps: int = DEFAULT_DPS, relative: bool = False) -> Any— |Φ_series(u) − Φ_series(−u)| for the unfolded series (1) — 0 exactly.recommended_dps(z_max: float, digits: int = 15) -> int— Working precision needed for `digits` significant digits of H_t up to z_max.H_t(z: Any, t: Any = 0, dps: int = DEFAULT_DPS, quad: str = 'cached') -> Any— H_t(z) = ∫₀^∞ e^{t u²} Φ(u) cos(z u) du.H0_vs_Xi(z_values: Sequence[Any] | None = None, dps: int = 40) -> dict[str, Any]— Determine and verify the constants in H₀(z) = c · Ξ(a z).heat_equation_residual(z: Any, t: Any = 0, h: Any = None, dps: int = DEFAULT_DPS) -> Any— |∂H/∂t + ∂²H/∂z²| for H_t(z), by central differences.zeros_of_H_t(t: Any, z_min: Any, z_max: Any, n_samples: int | None = None, dps: int | None = None) -> list[Any]— Real zeros of H_t on [z_min, z_max], by sign change plus bracketed refinement.zero_gap_statistics(t: Any, z_min: Any = 20.0, z_max: Any = 105.0, dps: int | None = None) -> dict[str, Any]— Spacing statistics of the real zeros of H_t on [z_min, z_max].track_zeros(t_values: Sequence[float], z_max: float = 105.0, n_zeros: int = 10, dps: int | None = None, use_cache: bool = True) -> dict[str, Any]— Follow the first `n_zeros` positive real zeros of H_t as t varies.lambda_facts() -> dict[str, Any]— Rigorous bounds and statements about the de Bruijn–Newman constant Λ.polynomial_heat_flow(roots: Sequence[float], t_values: Sequence[float], ode_steps_per_unit_t: int = 4000) -> dict[str, Any]— The whole Λ story in miniature: heat flow on a real polynomial.
zeta/weil.py — The Riemann–Weil explicit formula as a computable object, and Weil positivity.
970 lines
Constants: GAMMA1
gaussian_pair(a) -> tuple[Callable, Callable]— Gaussian pair `h(r) = exp(-a r²),g(u) = e^{-u²/4a} / (2√(πa))`.fejer_pair(b) -> tuple[Callable, Callable]— Fejér pair `h(r) = (sin(br)/(br))²with triangle partnerg`.legendre_pair(n: int) -> tuple[Callable, Callable]— Shifted-triangle pair localising the prime sum to a Legendre interval.autocorrelation_pair(coeffs: Sequence, spacing = 2.0, sigma = 0.35) -> tuple[Callable, Callable]— Positive-type pair from an explicit autocorrelation, h = |f̂|².explicit_formula_sides(h, g, gamma_max: float = 10000.0, n_max: int | None = None, dps: int = 25) -> dict— Evaluate both sides of the Riemann–Weil explicit formula independently.weil_functional(h, g, n_max: int | None = None, dps: int = 25) -> mpf— THE object: Weil's functional W(h), evaluated from the arithmetic side.positivity_probe(family = 'gaussian', n_points: int = 5, param_range: tuple[float, float] | None = None, dps: int = 20, n_max: int | None = None) -> list[dict]— Scan a parametrised family of positive-type pairs; report W and margin.near_tightness_report(gaussian_a: Sequence[float] = (0.02, 0.05, 0.08, 0.12, 0.16, 0.2), fejer_b: Sequence[float] = (1.0, 1.5, 2.0, 2.5), dps: int = 40, include_fejer: bool = True) -> dict— Which test functions bring W closest to 0, and what controls it.
zeta/epstein.py — The counterexample battery: Davenport-Heilbronn, gate #3 made computational.
1231 lines
Constants: KAPPA_REF, OFFLINE_ZERO_RE, OFFLINE_ZERO_IM
chi5(n: int)— The Dirichlet character mod 5 with chi(2) = i.L_chi(s, conjugate: bool = False, dps: int = DPS_DEFAULT)— L(s, chi) for the mod-5 character of :func:chi5, via Hurwitz zeta:kappa(dps: int = DPS_DEFAULT)— The Davenport-Heilbronn constant kappa, derived numerically as thedh_f(s, dps: int = DPS_DEFAULT)— The Davenport-Heilbronn function f(s) — entire, functional equationdh_coefficient(n: int, dps: int = DPS_DEFAULT)— The n-th Dirichlet coefficient a_n of f(s) = sum a_n n^{-s}.completed_dh(s, dps: int = DPS_DEFAULT)— F(s) = (pi/5)^{-(s+1)/2} Gamma((s+1)/2) f(s): the completed function,dh_functional_equation_defect(s, dps: int = DPS_DEFAULT)— F(s) - F(1-s), identically zero: the Davenport-Heilbronn functionaldh_mean_value_defect(s0, radius = 0.25, dps: int = DPS_DEFAULT)— Numerical no-pole certificate: (circle average of f) - f(s0).dh_theta(t, dps: int = DPS_DEFAULT)— The Riemann-Siegel-theta analogue for f:Z_dh(t, dps: int = DPS_DEFAULT, tol_digits: int = 8)— The Hardy-Z analogue for f: Z_f(t) = e^{i theta_f(t)} f(1/2 + it).zeros_on_line(t0, t1, n_samples: int | None = None, dps: int = 15) -> int— Sign-change count of Z_f on [t0, t1]: a lower bound for the numbercount_zeros_box(s0, s1, dps: int = 20, fn = None, step = None) -> int— Argument-principle count of zeros (with multiplicity) of f — or of anyfind_offline_zero(t_lo = 60.0, t_hi = 100.0, window = 8.0, dps: int = DPS_DEFAULT, sigma_lo = -1.0, sigma_hi = 2.0, min_offline = 0.05, residual = '1e-25')— Locate, verify, and return an off-critical-line zero of f.epstein_reduced_forms(discriminant: int) -> tuple[tuple[int, int, int], ...]— Reduced positive-definite forms `(a, b, c)` of the given discriminant.epstein_representation_count(n: int, form: tuple[int, int, int]) -> int— Dirichlet coefficient of `zeta_Q: the number of(m, k) != (0, 0)`epstein_completed(s, form: tuple[int, int, int], dps: int = DPS_DEFAULT)— `Lambda_Q(s) = (sqrt(d)/pi)^s Gamma(s) zeta_Q(s)withd = |D|/4`.epstein_zeta(s, form: tuple[int, int, int], dps: int = DPS_DEFAULT)— `zeta_Q(s) = sum_{(m,k) != 0} Q(m,k)^{-s}, continued to alls`.epstein_functional_equation_defect(s, form: tuple[int, int, int], dps: int = DPS_DEFAULT)— `Lambda_Q(s) - Lambda_Q(1-s)`, which is structurally zero here.epstein_class_group_defect(s, discriminant: int, dps: int = DPS_DEFAULT)— Measured defect of `sum_Q zeta_Q(s) = w * zeta(s) * L(s, chi_D)`.Z_epstein(t, form: tuple[int, int, int], dps: int = DPS_DEFAULT)— The Hardy-style real function `Lambda_Q(1/2 + it)`.epstein_interface(form: tuple[int, int, int], dps: int = DPS_DEFAULT) -> dict— The zeta-like interface for an Epstein zeta (see :func:zeta_interface).zeta_interface(dps: int = DPS_DEFAULT) -> dict— The zeta-like interface for zeta itself (via :mod:zeta.core):dh_interface(dps: int = DPS_DEFAULT) -> dict— The same interface for the Davenport-Heilbronn function (seeclaim_functional_equation(iface: dict) -> bool— Claim: "the completed function satisfies F(s) = F(1-s)" — measured asclaim_multiplicativity(iface: dict) -> bool— Claim: "the Dirichlet coefficients are multiplicative:battery(claim_fn, dps: int = DPS_DEFAULT, forms: tuple[tuple[int, int, int], ...] = ((2, 1, 3), (1, 1, 6))) -> dict— Evaluate a claimed structural property against zeta, the Davenport-Heilbronn
zeta/li.py — Li's criterion and Jensen polynomials — the real-rootedness lane.
1409 lines
Constants: DATA_DIR, GAMMA1, RADIUS_MAX, ZERO_DPS
li_closed_form_lambda1(dps: int = DPS_DEFAULT) -> mpf— λ₁ in closed form: 1 + γ/2 − log(4π)/2 = 0.023095708966121033814…li_coefficients(n_max: int, method: str = 'cauchy', dps: int = DPS_DEFAULT, n_zeros: int = 1000, radius: Any = '0.5', cache: bool = True, zero_dps: int | None = None) -> list[mpf]— The Li coefficients λ_1 … λ_{n_max} (a list of length `n_max`).li_coefficient(n: int, method: str = 'cauchy', dps: int = DPS_DEFAULT, n_zeros: int = 1000, radius: Any = '0.5', zero_dps: int | None = None) -> mpf— A single Li coefficient λ_n. See :func:li_coefficientsfor the maths.li_generating_function_defect(n: int, dps: int = DPS_DEFAULT, radius = '0.4') -> mpf— λ_n from the generating function minus λ_n from the literal definition.li_asymptotic(n: int) -> float— The RH-predicted growth of λ_n, as a plain float:li_positivity_scan(n_max: int, method: str = 'cauchy', dps: int = DPS_DEFAULT, n_zeros: int = 1000, radius: Any = '0.5') -> list[dict]— Tabulate λ_n for n = 1 … n_max with its distance from the RH boundary.xi_taylor_coefficients(n_max: int, dps: int = DPS_DEFAULT, method: str = 'integral', cache: bool = True) -> list[mpf]— The coefficients γ(0) … γ(n_max) of the Jensen-polynomial sequence:jensen_polynomial(d: int, n: int, dps: int = DPS_DEFAULT, gammas: Sequence | None = None, normalise: bool = False) -> list[mpf]— Coefficients of the Jensen polynomialis_hyperbolic(poly_coeffs: Sequence, dps: int = DPS_DEFAULT, method: str = 'both', tol: float | None = None) -> dict— Is a real polynomial hyperbolic — i.e. are all of its roots real?hyperbolicity_scan(d_max: int, n_max: int, dps: int = DPS_DEFAULT, method: str = 'roots', d_min: int = 1) -> list[dict]— The (d, n) hyperbolicity table — "the infinite Routh table", made finite.jensen_roots_vs_gue(d: int, n: int, dps: int = DPS_DEFAULT, gammas: Sequence | None = None) -> dict— Compare the roots of J^{d,n} with the roots of the Hermite polynomial H_d.
zeta/finitefield.py — The blueprint universe: curves over finite fields, where RH is a THEOREM.
1295 lines
legendre_symbol(a: int, p: int) -> int— The Legendre symbol `(a|p)` in {-1, 0, +1}, by Euler's criterion.quadratic_nonresidue(p: int) -> int— The least `nin2 <= n < pwith(n|p) = -1`.fp2_mul(u: tuple[int, int], v: tuple[int, int], p: int, n: int) -> tuple[int, int]— Multiply in `F_{p^2} = F_p[t]/(t^2 - n)`.discriminant(a: int, b: int, p: int) -> int— The discriminant `Delta = -16(4a^3 + 27b^2)ofy^2 = x^3+ax+b`, mod p.is_singular(a: int, b: int, p: int) -> bool— `Truewheny^2 = x^3 + ax + b` is singular over F_p.count_points(a: int, b: int, p: int) -> int— `N_1 = #E(F_p)`, including the point at infinity.count_points_bruteforce(a: int, b: int, p: int) -> int— `N_1by literal enumeration of allp^2pairs(x, y)` in F_p^2.trace_of_frobenius(a: int, b: int, p: int) -> int— `a_p = p + 1 - N_1`, the trace of Frobenius on the curve.zeta_numerator(a: int, b: int, p: int) -> list[int]— The numerator `P(T) = 1 - a_p T + p T^2as coefficients[1, -a_p, p]`.frobenius_eigenvalues(a: int, b: int, p: int, dps: int = DPS_DEFAULT) -> tuple[mpmath.mpc, mpmath.mpc]— The Frobenius eigenvalue pair `(alpha, alphabar)`.zeta_function_values(a: int, b: int, p: int, T, dps: int = DPS_DEFAULT)— `Z(T) = (1 - a_p T + p T^2) / ((1 - T)(1 - p T))evaluated atT`.zeta_functional_equation_defect(a: int, b: int, p: int, T, dps: int = DPS_DEFAULT)— `|Z(1/(pT)) - Z(T)|` — the curve's functional equation, as a defect.zeta_log_series_defect(a: int, b: int, p: int, n_max: int = 60, T = None, dps: int = DPS_DEFAULT)— `|Z(T) - exp(sum_{n<=n_max} N_n T^n / n)|at a smallT`.hasse_check(a: int, b: int, p: int) -> dict[str, Any]— RH for E in its counting form: `|a_p| <= 2 sqrt(p)`.critical_line_check(a: int, b: int, p: int, dps: int = DPS_DEFAULT) -> dict[str, Any]— RH for E in its critical-line form: the numerator roots have Re(s) = 1/2.frobenius_power_traces(a: int, b: int, p: int, n_max: int) -> list[int]— `[t_1, ..., t_{n_max}]witht_n = alpha^n + alphabar^n`, exact integers.point_counts_over_extensions(a: int, b: int, p: int, n_max: int) -> list[int]— `[N_1, ..., N_{n_max}]withN_n = #E(F_{p^n})`, exact integers.count_points_fp2(a: int, b: int, p: int, method: str = 'table') -> int— `N_2 = #E(F_{p^2})` by brute-force enumeration over F_{p^2}.random_curve(p: int, rng: random.Random | None = None) -> tuple[int, int]— A uniformly random nonsingular `(a, b)` over F_p (rejection sampling).curve_survey(p_list: Sequence[int] | Iterable[int] = (5, 13, 101, 1009), n_curves_per_p: int = 12, seed: int = 20260801, dps: int = DPS_DEFAULT) -> list[dict[str, Any]]— Sweep many curves over many primes and check RH on each one.survey_summary(rows: Sequence[dict[str, Any]]) -> dict[str, Any]— Reduce :func:curve_surveyrows to the headline numbers.traces_mod_p(p: int) -> np.ndarray— `a_pfor *every* nonsingular curvey^2 = x^3+ax+b` over F_p.sato_tate_histogram(p: int, n_bins: int = 20, cache: bool = True) -> dict[str, Any]— The vertical Sato-Tate law: `a_p / (2 sqrt p)` over ALL curves mod p.gauss_trace(p: int) -> int— `a_pfory^2 = x^3 - x` from Gauss, with no point counting at all.weil_conjecture_facts() -> dict[str, Any]— The theorems this module exercises, and the gap to RH over `Z`.
zeta/criteria.py — Four equivalence faces of the Riemann Hypothesis, made executable.
1625 lines
Constants: DATA_DIR, MERTENS_PINNED, BD_CONSTANT, ROBIN_THRESHOLD, ROBIN_EXCEPTIONS, ZETA_PRIME_ZEROS_PINNED
mobius(n: int) -> int— The Mobius function mu(n), by trial-division factorisation.mobius_sieve(limit: int, use_cache: bool = True) -> np.ndarray— `mu(0..limit)as anint8` array, by a vectorised sieve.mertens_array(limit: int, use_cache: bool = True) -> np.ndarray— `M(0..limit)as anint32array,M(x) = sum_{n <= x} mu(n)`.mertens_M(x, use_cache: bool = True) -> int— The Mertens function `M(x) = sum_{n <= x} mu(n)` at a single point.mertens_ratio(x, use_cache: bool = True) -> float— `M(x)/sqrt(x)` -- the quantity the Mertens conjecture bounded by 1.mertens_ratio_extremes(limit: int = 10 ** 6, x_min: int = 1, use_cache: bool = True) -> dict[str, Any]— Extremes of `M(x)/sqrt(x)overx_min <= x <= limit`.mertens_facts() -> dict[str, str]— The Mertens face in words, with each claim labelled.baez_duarte_basis(k: int, x, dps: int = DPS_DEFAULT)— `A_k(x) = {1/(k x)} - (1/k) {1/x}on (0, 1) -- i.e.rho_{1/k}`.baez_duarte_gram(N: int, dps: int = 50, use_cache: bool = True)— The Gram matrix `G[a][b] = <A_{j}, A_{k}>for j, k in2..N`.baez_duarte_rhs(N: int, dps: int = 50)— `b_k = <1, A_k> = (log k)/kfor k = 2..N, as anmp.matrix`.baez_duarte_d2(N: int, dps: int = 50, use_cache: bool = True, with_condition: bool = True) -> dict[str, Any]— The Baez-Duarte residual `d_N^2` -- the linear-algebra face of RH.baez_duarte_table(N_values: Sequence[int], dps: int = 50, use_cache: bool = True) -> list[dict[str, Any]]— `d_N^2for several N, with the ratio to the conjecturedC/log N`.divisor_sigma(n: int) -> int— `sigma(n)`, the sum of the divisors of n, exactly (a Python int).sigma_sieve(limit: int) -> np.ndarray— `sigma(0..limit)as anint64` array (divisor-sum sieve).harmonic_number(n: int, dps: int = DPS_DEFAULT)— `H_n = 1 + 1/2 + ... + 1/n, viapsi(n+1) + gamma`.robin_ratio(n: int, dps: int = DPS_DEFAULT)— `sigma(n) / (n log log n)` -- Robin's ratio.robin_ratio_from_log(log_n, sigma_over_n, dps: int = DPS_DEFAULT)— Robin's ratio from `log nandsigma(n)/n`.lagarias_ratio(n: int, dps: int = DPS_DEFAULT)— `sigma(n) / (H_n + exp(H_n) log H_n)` -- Lagarias' elementary form.lagarias_ratio_from_log(log_n, sigma_over_n, dps: int = DPS_DEFAULT)— Lagarias' ratio from `log nandsigma(n)/n`, for astronomical n.robin_violations(limit: int = 20000) -> list[int]— Every `3 <= n <= limitwithsigma(n) >= e^gamma n log log n`.lagarias_violations(limit: int = 20000) -> list[int]— Every `1 <= n <= limitwithsigma(n) > H_n + exp(H_n) log H_n`.colossally_abundant(steps: int = 200, dps: int = DPS_DEFAULT, max_prime: int = 10 ** 5) -> list[dict[str, Any]]— The first `steps` colossally abundant numbers, generated greedily.superabundant_candidates(max_log_n: float = 60.0) -> Iterator[tuple[int, ...]]— Exponent patterns of every superabundant-shaped n with log n <= bound.robin_search(max_log_n: float = 60.0, ca_steps: int = 500, dps: int = DPS_DEFAULT) -> dict[str, Any]— Search the only plausible violators of Robin's inequality above 5040.zeta_prime(s, dps: int = DPS_DEFAULT)— `zeta'(s)`, the derivative of the Riemann zeta function.zeta_prime_zeros(t_min = 1, t_max = 60, sigma_min = '0.001', sigma_max = 6, dps: int = 25, count_dps: int = 15, step = '0.4', max_depth: int = 16, use_cache: bool = True) -> dict[str, Any]— Every zero of `zeta'` in the rectangle, with a counting cross-check.speiser_scan(t_max = 60, t_min = 1, sigma_max = 6, sigma_min = '0.001', dps: int = 25, count_dps: int = 15, step = '0.4', use_cache: bool = True) -> dict[str, Any]— Speiser's criterion, executed on a window.criteria_report(mertens_limit: int = 10 ** 6, bd_N: int = 20, bd_dps: int = 50, robin_max_log_n: float = 40.0, robin_ca_steps: int = 200, speiser_t_max: float = 40.0) -> dict[str, Any]— All four faces in one dict -- the module's `battery`.
zeta/rigor.py — Certified computation: enclosures instead of estimates.
2004 lines
Constants: DATA_DIR, BACKEND, BACKEND_REASON
available_backends() -> list[str]— Names of every ball-arithmetic backend importable in this interpreter.enclose_Z(t, prec_bits: int = 128, backend: str | None = None) -> tuple— A rigorous enclosure `(lo, hi)of Hardy's Z(t):lo ≤ Z(t) ≤ hi`.enclose_rs_theta(t, prec_bits: int = 128, backend: str | None = None) -> tuple— A rigorous enclosure `(lo, hi)` of the Riemann–Siegel phase θ(t).proven_sign(t, prec_bits: int = 64, max_escalations: int = 6, backend: str | None = None) -> int— +1 or −1 if the sign of Z(t) is proven; 0 if it cannot be decided.certified_sign_changes(t0, t1, n_samples: int | None = None, prec_bits: int = 64, max_escalations: int = 6, backend: str | None = None) -> dict— Count sign changes of Z on [t0, t1] using proven signs only.certified_zero_count(T, prec_bits: int = 192, max_segments: int = 4096, backend: str | None = None, cross_check: bool = True) -> dict— Certified N(T) = #{ρ : ζ(ρ) = 0, 0 < Im ρ < T} by the argument principle.verify_rh_certified(T, prec_bits: int = 64, count_prec_bits: int = 192, n_samples: int | None = None, max_samples: int = 200001, max_escalations: int = 8, backend: str | None = None, compare_floating: bool = True, cache: bool = True, verbose: bool = False) -> dict— Rigorous counterpart of :func:zeta.zeros.verify_rh_up_to.enclosure_width_report(t_values: Sequence, prec_bits_list: Sequence[int], backend: str | None = None) -> list[dict]— How the enclosure width of Z(t) shrinks with working precision.certified_gaussian_pair(a) -> tuple— Ball-valued Gaussian pair `h(r) = exp(-a r²)` for the certified W(h).certified_fejer_pair(b) -> tuple— Ball-valued Fejér pair `h(r) = (sin br / br)²` for the certified W(h).certified_autocorrelation_pair(coeffs, spacing = 2, sigma = '0.35') -> tuple— Ball-valued positive-type pair from an autocorrelation, h = |f̂|².enclose_weil_functional(h_cert: Callable, g_cert: Callable, n_max: int | None = None, R: int | None = None, prec_bits: int = 192, backend: str | None = None, cross_check: bool = True) -> dict— Rigorous enclosure of the Weil functional W(h) = pole + arch + prime.
zeta/inverse.py — Inverse spectral theory: the Wu–Sprung potential, and what it cannot show.
472 lines
Constants: DATA_DIR, TWO_PI
abel_reconstruct(nbar_prime: Callable[[np.ndarray], np.ndarray], V_values: np.ndarray, E0: float, n_quad: int = 400) -> np.ndarray— x(V) = ∫_{E₀}^{V} N̄′(E)/√(V−E) dE for each V in `V_values`.harmonic_calibration(n_eigs: int = 12, grid_n: int = 6000) -> dict[str, Any]— Calibrate both directions on the harmonic oscillator, where truth is exact.wu_sprung_potential(V_max: float = 120.0, n_grid: int = 1600, ordinates: Sequence[float] | None = None, delta: float = 2.5, source: str = 'zeta') -> dict[str, Any]— The (half-)potential as monotone samples x(V), V ∈ [E₀, V_max].schrodinger_eigenvalues(V: Callable[[np.ndarray], np.ndarray], L: float, n_grid: int = 8000, k: int = 30, vectors: bool = False)— Lowest k eigenpairs of −ψ″ + V(x)ψ on [−L, L], Dirichlet ends.dh_online_ordinates(t_max: float = 120.0, cache: bool = True, coarse_step: float = 0.05) -> list[float]— Ordinates of Z_dh sign changes on (1, t_max], bisected to ~1e-12.spectrum_report(source: str = 'zeta', n_eigs: int = 25, n_ordinates: int = 60, delta: float = 2.5, V_max: float | None = None, n_grid: int = 8000) -> dict[str, Any]— Reconstruct the potential (smooth and fractal), forward-solve both,
zeta/quasicrystal.py — The zero measure as a crystalline (atomic) Fourier object — and the one
279 lines
Constants: PRIME_POWERS, COMPOSITES
zero_measure_transform(ordinates: Sequence[float], A: float)— Return u ↦ Σ_{γ>0} e^{−γ²/2A²} cos(γu) for the given ordinates.predicted_atom_constant(A: float) -> float— c = −A/(2√(2π)): the derived height of the log-n atom per unit Λ(n)/√n.atom_table(ordinates: Sequence[float], A: float, integers: Iterable[int] = PRIME_POWERS) -> dict[str, Any]— Measured atom heights at log n against the derived prediction.euler_signature_report(ordinates: Sequence[float], A: float | None = None) -> dict[str, Any]— Quantify the silence at composite non-prime-powers.dh_log_derivative_coefficients(n_max: int = 32, dps: int = 30) -> list[float]— b_n with −f′/f(s) = Σ_{n≥1} b_n n^{−s}, for the DH function f.dh_dirichlet_defect(s: complex = 3.0, n_max: int = 400, n_ref: int = 3000, dps: int = 30) -> float— |Σ b_n n^{−s} − (−f′/f)(s)|, the cross-check on the recursion.crystallinity_battery(n_zeta_zeros: int = 1000, dh_t_max: float = 120.0, n_coeff: int = 24) -> dict[str, Any]— The gate: does the atomic structure separate ζ from Davenport–Heilbronn?
zeta/factorization.py — Gate 4, made into a number: a decision statistic for the Euler product.
306 lines
Constants: DEFAULT_N_MAX, ZERO_THRESHOLD, KAPPA_REF
periodic_coefficients(values: Sequence[float], n_max: int = DEFAULT_N_MAX) -> np.ndarray— aₙ from one period, indexed 1..n_max (index 0 unused).log_derivative_coefficients(a: Sequence[float], n_max: int = DEFAULT_N_MAX) -> np.ndarray— bₙ with −f′/f = Σ bₙn^{−s}, by Dirichlet convolution.factorization_defect(a: Sequence[float], n_max: int = DEFAULT_N_MAX) -> float— D(f): composite-supported energy of −f′/f over prime-power energy.euler_product_panel(n_max: int = DEFAULT_N_MAX) -> dict[str, dict[str, Any]]— D for a panel of functions whose factorization status is known.null_distribution(n_samples: int = 400, seed: int = 7, n_max: int = DEFAULT_N_MAX) -> dict[str, Any]— D for random real sequences with Davenport–Heilbronn's shape.factorization_report(n_max: int = DEFAULT_N_MAX, n_samples: int = 400, seed: int = 7) -> dict[str, Any]— Panel + null + where Davenport–Heilbronn sits inside the null.dh_family_coefficients(t: float, n_max: int = DEFAULT_N_MAX) -> np.ndarray— The one-parameter family aₙ = [1, t, −t, −1, 0], periodic mod 5.kappa_landscape(t_values: Sequence[float] | None = None, n_max: int = DEFAULT_N_MAX) -> dict[str, Any]— D along the DH family, and whether κ sits anywhere distinguished on it.
zeta/detector.py — Detecting off-line zeros without solving for them — the position-sensitive gate.
364 lines
Constants: DEFAULT_WIDTH, DEFAULT_N_MAX, DATA_DIR
bump_pair(c, a = DEFAULT_WIDTH) -> tuple[Callable, Callable]— The even bump h centred at ±c, with its exact Fourier partner g.archimedean_bracket(r, source: str = 'zeta')— 2·Re(Λ_∞′/Λ_∞)(½+ir) — derived from each function's gamma factor.arithmetic_side(c, source: str = 'zeta', a = DEFAULT_WIDTH, n_max: int = DEFAULT_N_MAX) -> Any— arch + pole − 2Σ b_n n^{−1/2} g(log n). Uses no zeros whatsoever.online_zero_side(c, source: str = 'zeta', a = DEFAULT_WIDTH) -> Any— Σ over the ON-LINE ordinates of h(γ) + h(−γ).offline_residue(c, source: str = 'zeta', a = DEFAULT_WIDTH, n_max: int = DEFAULT_N_MAX) -> dict[str, Any]— The statistic: what the on-line zeros fail to account for.residue_scan(c_values: Sequence[float], source: str = 'zeta', a = DEFAULT_WIDTH) -> dict[str, Any]— Residue across a range of centres — the peak localizes an off-line zero.recover_distance_from_line(residue: float, a = DEFAULT_WIDTH) -> float— |β − ½| from the peak height, inverting ≈ 4·exp(a(β−½)²).online_list_is_complete(t0: float, t1: float, dps: int = 15, method: str = 'sign_changes') -> dict[str, Any]— Cross-check the cached DH on-line ordinates against a second count.detector_battery(a = DEFAULT_WIDTH) -> dict[str, Any]— ζ silent, Davenport–Heilbronn spiking at its off-line zero.
zeta/leeyang.py — Newman's Lee–Yang program, made computational — and its battery verdict.
251 lines
Constants: DEFAULT_PROBES
free_energy_normalization(h_values: Sequence[float] = (0.0, 0.5, 1.2), dps: int = 25) -> dict[str, Any]— Measure the constant c in ∫Φ(u)e^{hu}du = c·ξ(½+h/2).log_xi_third_derivative(w: float, source: str = 'zeta', step: float = 0.05, dps: int = 40) -> float— G‴(w) for G(w) = log ξ(½+w), or the Davenport–Heilbronn analogue.ghs_defect(w: float, source: str = 'zeta', **kw) -> float— The GHS defect: G‴(w). GHS is the assertion that this is ≤ 0.ghs_zero_sum(w: float, n_zeros: int = 2000) -> float— G‴(w) = −4w Σ_γ (3γ²−w²)/(γ²+w²)³ — the Hadamard route, assuming RH.ghs_scan(probes: Sequence[float] = DEFAULT_PROBES, source: str = 'zeta', **kw) -> dict[str, Any]— Evaluate the GHS defect across probe points and report any violation.phi_log_concavity(u_values: Sequence[float] = (0.0, 0.2, 0.5, 0.8, 1.0, 1.3), step: float = 0.01, dps: int = 40) -> dict[str, Any]— (log Φ)″ at the given points; negative everywhere means log-concave.ghs_battery(probes: Sequence[float] = DEFAULT_PROBES) -> dict[str, Any]— Run GHS on ζ and on Davenport–Heilbronn: does the inequality separate them?
zeta/relations.py — Integer-relation probes on the zero ordinates — the ℚ-independence face.
233 lines
pslq_sanity(dps: int = 60) -> dict[str, Any]— Validate the instrument: PSLQ must recover a planted relation exactly.zero_relation_search(n_zeros: int = 12, max_coeff: int = 10 ** 6, dps: int | None = None, max_steps: int = 2 * 10 ** 5) -> dict[str, Any]— Search for an integer relation among the first `n_zeros` ordinates.constants_relation_search(n_zeros: int = 6, max_coeff: int = 10 ** 4, dps: int | None = None, max_steps: int = 2 * 10 ** 5) -> dict[str, Any]— Search for relations linking ordinates to the classical constants.confirm_relation(relation: Sequence[int], n_zeros: int, dps: int) -> dict[str, Any]— Recompute the ordinates from scratch at `dps` and test a candidate.
zeta/synthesis.py — The prime signal as additive synthesis, and the power its partials carry.
181 lines
Constants: MEAN_POWER_CLOSED_FORM
closed_form_power() -> float— Σ_ρ 1/(ρ(1−ρ)) = 2 + γ_Euler − log 4π.prime_signal(N: int = 10 ** 6, n_samples: int = 200000, u_min: float = 2.0)— Sample S(u) = (ψ(e^u) − e^u)/e^{u/2} on a uniform log-time grid.mean_power_prime_side(N: int = 10 ** 6, n_samples: int = 200000, u_start: float = 6.0) -> dict[str, Any]— Average of S(u)² over log-time, from the prime side only.mean_power_zero_side(n_zeros: int = 1000) -> dict[str, Any]— 2·Σ_{γ>0} 1/(¼+γ²) over cached ordinates, plus a density tail estimate.power_report(N: int = 10 ** 6, n_zeros: int = 1000, n_samples: int = 200000) -> dict[str, Any]— All three routes to P, with their pairwise gaps.
zeta/plots.py — Publication-quality matplotlib figures for every part of the zeta laboratory.
1671 lines
plot_zeta_critical_line(t_max: float = 50.0, n_points: int = 1600, save_path: str | None = None, dpi: int = 160) -> Figure— Re ζ, Im ζ and |ζ| along the critical line s = ½ + it, zeros marked.plot_hardy_Z(t_max: float = 100.0, save_path: str | None = None, dpi: int = 160) -> Figure— Hardy's Z(t) = e^{iθ(t)} ζ(½+it), its sign changes, and the Gram points.plot_zeta_domain_coloring(re_range: tuple[float, float] = (-7.5, 4.5), im_range: tuple[float, float] = (-3.0, 45.0), nx: int = 360, ny: int = 560, save_path: str | None = None, dpi: int = 160, cache: bool = True) -> Figure— Domain colouring (phase portrait) of ζ(s) over the critical strip.plot_theta_modularity(x_min: float = 0.15, x_max: float = 6.0, n_points: int = 300, n_defect: int = 90, save_path: str | None = None, dpi: int = 160) -> Figure— θ(1/x)/√x laid over θ(x): Jacobi's modular relation, then its defect.plot_theta_heat_evolution(times: Sequence[float] = (0.0008, 0.002, 0.005, 0.012, 0.03, 0.08), n_points: int = 481, save_path: str | None = None, dpi: int = 160) -> Figure— The heat kernel Θ(x,t) on the circle ℝ/ℤ at several times — the PDE picture.plot_explicit_formula(x_max: float = 100.0, zero_counts: Sequence[int] = (0, 10, 100, 500), n_points: int = 2400, save_path: str | None = None, dpi: int = 160) -> Figure— Chebyshev's ψ staircase versus von Mangoldt's explicit formula.plot_prime_spectrum(n_zeros: int = 500, x_max: float = 50.0, n_points: int = 6000, window: str = 'gauss', save_path: str | None = None, dpi: int = 160) -> Figure— "The music of the primes": the zero-side spike train D(u) = −2Σ w(γ)cos(γu).plot_spacing_histogram(t_max: float = 10000.0, bins: int = 40, save_path: str | None = None, dpi: int = 160) -> Figure— Nearest-neighbour spacings of the unfolded zeros vs GUE and Poisson.plot_pair_correlation(t_max: float = 10000.0, r_max: float = 3.0, bins: int = 60, save_path: str | None = None, dpi: int = 160) -> Figure— Empirical pair correlation of the zeros vs Montgomery's R₂(r) = 1 − (sin πr/πr)².plot_zero_counting(t_max: float = 200.0, save_path: str | None = None, dpi: int = 160) -> Figure— The zero-counting staircase N(T) vs the Riemann–von Mangoldt law, and S(T).plot_heatflow_trajectories(t_values: Sequence[float] = (-0.4, -0.2, 0.0, 0.2, 0.4, 0.6), n_zeros: int = 10, z_max: float = 105.0, save_path: str | None = None, dpi: int = 160) -> Figure— Zeros of H_t under the backward heat flow — the de Bruijn–Newman picture.plot_polynomial_root_repulsion(roots: Sequence[float] = (-3.0, -1.0, 0.5, 2.0, 4.5), t_min: float = -1.1, t_max: float = 0.7, n_t: int = 181, save_path: str | None = None, dpi: int = 160) -> Figure— The Λ story in miniature: heat flow on a real polynomial's roots.plot_weil_positivity(gaussian_points: int = 7, fejer_points: int = 5, dps: int = 20, save_path: str | None = None, dpi: int = 160) -> Figure— The Weil functional W(h) over positive-type families: ≥ 0, and why barely.plot_offline_zero(re_range: tuple[float, float] = (-0.75, 1.75), im_range: tuple[float, float] = (83.0, 88.5), nx: int = 240, ny: int = 340, save_path: str | None = None, dpi: int = 160, cache: bool = True) -> Figure— Phase portrait of Davenport–Heilbronn's f around its OFF-line zero.plot_certified_enclosures(t_min: float = 10.0, t_max: float = 40.0, n_points: int = 260, band_bits: Sequence[int] = (12, 16, 20), width_bits: Sequence[int] = (8, 16, 32, 64, 128, 256), width_t: Sequence[float] = (30.0, 100.0), backend: str | None = None, save_path: str | None = None, dpi: int = 160) -> Figure— Rigorous enclosures of Z(t): the bands are theorems, and they shrink with precision.plot_li_coefficients(n_max: int = 200, dps: int = 25, save_path: str | None = None, dpi: int = 160) -> Figure— Li's criterion in a picture: λ_n ≥ 0, and the growth RH predicts.plot_jensen_roots(d_values: Sequence[int] = (2, 3, 4, 6, 8, 10, 12), n: int = 1, n_compare: int = 12, dps: int = 30, save_path: str | None = None, dpi: int = 160) -> Figure— The roots of the Jensen polynomials J^{d,n} — all real, all on the line.plot_finite_field_rh(primes: Sequence[int] = (13, 101, 503, 1009), dps: int = 25, save_path: str | None = None, dpi: int = 160) -> Figure— RH where it is a THEOREM: Frobenius eigenvalues on the circle |α| = √p.plot_sato_tate(p_values: Sequence[int] = (503, 4001), n_bins: int = 20, save_path: str | None = None, dpi: int = 160) -> Figure— a_p/(2√p) over ALL curves mod p, against the semicircle (2/π)√(1−x²).plot_mertens(limit: int = 10 ** 6, x_min: int = 100, n_points: int = 4000, save_path: str | None = None, dpi: int = 160) -> Figure— M(x)/√x — the random walk that made a false conjecture look true.
zeta/adele.py — The Adele Ring and Ideles as Computational Objects.
213 lines
class PAdic— A computational representation of a p-adic number over Q_p.class Adele— A computational representation of an Adele over Q.class Idele— A computational representation of an Idele over Q.check_product_formula(q: Union[int, Fraction], primes: list[int]) -> float— Artin's Product Formula: For any non-zero rational q, the product oflocal_zeta_factor(p: int, s: complex) -> complex— Computes Tate's local zeta integral Z(f, s) over Q_p^*.global_euler_product(s: complex, primes: list[int]) -> complex— Computes the partial global zeta function over a set of places (primes)padic_fractional_part(p: int, q: Union[int, Fraction]) -> float— Computes the p-adic fractional part {x}_p.padic_additive_character(p: int, q: Union[int, Fraction]) -> complex— The canonical additive character for Q_p: e_p(x) = exp(-2 * pi * i * {x}_p).adelic_additive_character(adele: Adele) -> complex— The canonical global additive character on the Adeles:
zeta/detectors.py — Detector strength: how large a violation of RH would have to be to be seen.
179 lines
lesion_li_lambda(n: int, delta: float, T: float, dps: int = DPS_DEFAULT) -> mpmath.mpf— Computes the contribution to Li's lambda_n from a synthetic zero quadlesion_weil_gaussian(a: float, delta: float, T: float, dps: int = DPS_DEFAULT) -> mpmath.mpf— Computes the contribution to Weil's W(h) for the Gaussian family h(r) = exp(-a r^2)lesion_weil_fejer(b: float, delta: float, T: float, dps: int = DPS_DEFAULT) -> mpmath.mpf— Computes the contribution to Weil's W(h) for the Fejer family h(r) = (sin(b r) / (b r))^2weil_gaussian_deepest_dip(delta: float, T: float, dps: int = DPS_DEFAULT)— The most negative Weil signal the Gaussian family can extract from a lesion.li_lesion_growth_rate(delta: float, T: float, dps: int = DPS_DEFAULT) -> mpmath.mpf— `max_j |1 - 1/rho_j|` over the lesion quad — Li's exponential growth rate.li_lesion_doubling_n(delta: float, T: float, dps: int = DPS_DEFAULT) -> mpmath.mpf— The `nat which the lesion's Li signal doubles:log 2 / log(rate)`.
zeta/spectral_gate.py — Falsifiers for a claimed spectral realisation of the Riemann zeros.
496 lines
Constants: STABILITY_TOLERANCE, TARGET_TOLERANCE, ABLATION_TOLERANCE, PERMUTATION_TOLERANCE, FIRST_ORDINATES, GROWTH_RATIO_TOLERANCE, COUNT_PREDICTION_TOLERANCE
class SpectralVerdict— Outcome of the three pre-declared falsifiers.class CountingVerdict— Outcome of the counting falsifiers for a cokernel-dimension model.positive_frequencies(matrix: np.ndarray, count: int) -> np.ndarray— The `count` smallest positive imaginary parts of the spectrum.stability_defect(construct: Callable[[int, Sequence[int]], np.ndarray], primes: Sequence[int], basis_size: int, count: int = 3) -> float— Relative drift of the lowest frequencies between `Nand2N`.target_defect(matrix: np.ndarray, count: int = 3) -> tuple[float, tuple[float, ...]]— Largest relative error of the lowest frequencies against the ordinates.ablation_defect(construct: Callable[[int, Sequence[int]], np.ndarray], primes: Sequence[int], decoys: Sequence[int], basis_size: int, count: int = 3) -> float— Relative spectral change when the primes are swapped for `decoys`.permutation_defect(construct: Callable[[int, Sequence[int]], np.ndarray], primes: Sequence[int], basis_size: int, count: int = 3, trials: int = 3, seed: int = 20260805) -> float— Largest relative spectral change when the prime list is reordered.spectral_gate(construct: Callable[[int, Sequence[int]], np.ndarray], primes: Sequence[int], decoys: Sequence[int], basis_size: int, count: int = 3) -> SpectralVerdict— Run all four falsifiers and report which, if any, fired.count_growth_ratio(count: Callable[[float, Sequence[int]], int], primes: Sequence[int], base_cutoff: float) -> float— Increment ratio across geometric cutoffs, which must be `2`.count_prediction_defect(count: Callable[[float, Sequence[int]], int], primes: Sequence[int], cutoffs: Sequence[float]) -> float— Calibrate `dim = a log(Lambda) + b` on all but the last cutoff, predict it.count_ablation_defect(count: Callable[[float, Sequence[int]], int], primes: Sequence[int], decoys: Sequence[int], cutoff: float) -> float— Relative change in the resolved count when the primes become decoys.count_permutation_defect(count: Callable[[float, Sequence[int]], int], primes: Sequence[int], cutoff: float, trials: int = 3, seed: int = 20260805) -> float— Relative change in the count when the same primes are reordered.counting_gate(count: Callable[[float, Sequence[int]], int], primes: Sequence[int], decoys: Sequence[int], cutoffs: Sequence[float]) -> CountingVerdict— Run the counting falsifiers on a cokernel-dimension model.
zeta/surrogate.py — Null-model surrogates for the critical-line value distribution.
491 lines
class IntervalStatistics— Concentration and block dispersion for one moment order on one grid.primes_up_to(limit: int) -> np.ndarray— Return every prime `p <= limitas anint64` array.field_variance(primes: np.ndarray) -> float— Exact variance of `X:(1/2) sum 1/p` over the supplied primes.exact_intensity_moment(k: int, primes: np.ndarray) -> float— Exact `E[exp(2k X)] = prod_p I_0(2k p^{-1/2})`.sample_field(ts: np.ndarray, primes: np.ndarray, *, seed: int, max_elements: int = 20000000) -> np.ndarray— Sample `X(t)onts` for one draw of the phases.sample_intensity(ts: np.ndarray, primes: np.ndarray, *, seed: int, max_elements: int = 20000000) -> np.ndarray— Surrogate for `|zeta(1/2+it)|^2:exp(2 X(t))`.variance_defect(primes: np.ndarray, *, seed: int, samples: int = 200000, span: float = 5000.0) -> float— Relative defect between sampled variance of `Xand(1/2) sum 1/p`.intensity_moment_defect(k: int, primes: np.ndarray, *, seed: int, samples: int = 200000, span: float = 5000.0) -> float— Relative defect between a sampled mean of `exp(2kX)` and the exact moment.covariance_profile(primes: np.ndarray, lags: np.ndarray) -> np.ndarray— Exact `Cov(X(t), X(t+tau)) = (1/2) sum_p cos(tau log p) / p` per lag.euler_field_variance(primes: np.ndarray, *, terms: int = 200) -> float— Exact `Var log|Z|` for the full random Euler product.euler_intensity_moment(k: int, primes: np.ndarray, *, terms: int = 200) -> float— Exact `E[|Z|^{2k}] = prod_p sum_m d_k(p^m)^2 p^{-m}` for the Euler product.sample_euler_log_field(ts: np.ndarray, primes: np.ndarray, *, seed: int, max_elements: int = 20000000) -> np.ndarray— Sample `log|Z(t)|` for the full random Euler product.sample_euler_intensity(ts: np.ndarray, primes: np.ndarray, *, seed: int, max_elements: int = 20000000) -> np.ndarray— Surrogate for `|zeta(1/2+it)|^2` from the full random Euler product.cue_moment(k: int, dimension: int) -> float— Exact `E|Lambda_N(theta)|^{2k}` for the CUE characteristic polynomial.sample_cue_eigenangles(dimension: int, matrices: int, *, seed: int) -> np.ndarray— Eigenangles of `matrices` independent Haar-distributed unitaries.sample_cue_log_field(dimension: int, matrices: int, points_per_gap: int, *, seed: int) -> np.ndarray— `log|Lambda_N|on a uniform grid spanningmatrices` independent draws.sample_cue_intensity(dimension: int, matrices: int, points_per_gap: int, *, seed: int) -> np.ndarray— `|Lambda_N|^2on the concatenated grid; the CUE analogue of|zeta|^2`.interval_statistics(values: np.ndarray, spacing: float, *, blocks: int = 8, top_fraction: float = 0.01, orders: tuple[int, ...] = (1, 2, 3, 4)) -> tuple[IntervalStatistics, ...]— Concentration and block statistics for `values^k` on a uniform grid.
Discovery layer API (ontology/) — the conjecture factory
A domain-agnostic pipeline that generates candidate observations from the laboratory's computed objects, screens them, and logs the whole funnel so the conversion rate per generator can be measured. schema, registry, ledger, funnel, metrics and historical_cases name no quantity the laboratory computes and import nothing from zeta — the seam is enforced by tests. knownness is the documented one-step-less-strict module (it knows general mathematics, not this subject). Everything that names the subject lives in ontology/domains/. Design and honest limits: ontology/README.md. Operator console: scripts/13_discovery_run.py. The ledger it writes (conjectures/) is gitignored: a private notebook of unreviewed leads, and nothing in it is evidence for anything. An empty conjectures/ in a fresh clone is that rule working, not a fault — scripts/ledger_sync.sh shares one ledger across machines through a separate private repo, never this tree.
ontology/schema.py — ontology.schema — the ontology of the discovery funnel.
1833 lines
Constants: SCHEMA_MAJOR, SCHEMA_MINOR, SCHEMA_VERSION, SCHEMA_HISTORY, DEFAULT_DEDUP_DIGITS, MIN_INDEX_SPAN, MIN_WINDOWS, MIN_WINDOW_POINTS, MIN_WITNESSES, MAX_ARGUMENT_CHARS, RELATION_OPS, LIMIT_POINTS, DIRECTIONS, PRECISION_KINDS, KIND_RULES, TERMINAL_STATUSES, REOPENABLE_STATUSES, REQUIRED_SURVIVAL_CHECKS
class SchemaError— Base class for every error raised by this module.class ValidationError— A record is malformed: it violates the ontology's own rules.class CandidateKind— The five shapes an observation may take. Five, and no more.class CandidateRelation— The two graph relations a candidate may assert about another.class VerdictStatus— Six states. Four of them are ways of saying "nothing here".class InconclusiveReason— Closed vocabulary: why the work decided nothing.class Verdict— What the funnel concluded, and the evidence that earns the conclusion.class Precision— How much arithmetic was bought. `effort_digits` makes kinds comparable.class Provenance— Everything needed to re-derive the observation months later.class CandidateLink— One non-identity graph edge from a candidate to another candidate.class Candidate— One observation, with its identity, its support and its fate.class KnownEntry— One entry of a domain-supplied catalogue of things already established.canonical_claim(kind: 'CandidateKind | str', claim: Mapping[str, Any], digits: int = DEFAULT_DEDUP_DIGITS) -> str— The exact byte string that is hashed to give a candidate its identity.content_hash(kind: 'CandidateKind | str', claim: Mapping[str, Any], digits: int = DEFAULT_DEDUP_DIGITS) -> str— Stable content id: `cand-` + 128 bits of SHA-256 over the claim.same_claim(left: 'Candidate | Mapping[str, Any]', right: 'Candidate | Mapping[str, Any]', digits: int | None = None) -> bool— Do two candidates assert the same thing?required_claim_keys(kind: CandidateKind | str) -> frozenset[str]— The claim keys a candidate of this kind must carry.allowed_claim_keys(kind: CandidateKind | str) -> frozenset[str]— Required plus optional claim keys. Anything else is refused.kind_reasons(kind: CandidateKind | str, claim: Mapping[str, Any], evidence: Mapping[str, Any] | None = None) -> tuple[str, ...]— Why `kind` refuses this payload. Empty tuple means it accepts.accepts(kind: CandidateKind | str, claim: Mapping[str, Any], evidence: Mapping[str, Any] | None = None) -> bool— Does `kind` accept this payload? The decision procedure, as a bool.classify(claim: Mapping[str, Any], evidence: Mapping[str, Any] | None = None) -> CandidateKind | None— The unique kind that accepts this payload, or `None` if there is none.claim_keys(kind: CandidateKind | str, claim: Mapping[str, Any]) -> tuple[str, ...]— The identity strings of a claim, used by the already-known matcher.verdict_reasons(verdict: Verdict) -> tuple[str, ...]— Entry criteria for each status. Empty tuple means the status is earned.validate_verdict(verdict: Verdict) -> None— Raise :class:ValidationErrorunless the verdict earns its status.git_revision(start: str | Path | None = None, timeout: float = 5.0) -> tuple[str | None, bool | None, str]— `(revision, dirty, source)for the checkout containingstart`.validate_provenance(provenance: Provenance) -> None— Raise unless the record could actually be replayed by a stranger.capture_provenance(*, generator: str, generator_version: str, lab_object: str, parameters: Mapping[str, Any] | None = None, precision: Precision | None = None, seed: int | None = None, stochastic: bool = False, duration_s: float | None = None, runtime: Mapping[str, str] | None = None, repo_path: str | Path | None = None) -> Provenance— Build a :class:Provenance, filling in revision, time and interpreter.candidate_reasons(candidate: Candidate) -> tuple[str, ...]— Every way in which `candidate` violates the ontology.validate_claim(kind: CandidateKind | str, claim: Mapping[str, Any], evidence: Mapping[str, Any] | None = None) -> None— Raise unless `kind` accepts this payload.validate_candidate(candidate: Candidate) -> None— Raise :class:ValidationErrorlisting every violation, or return.latest_by_id(candidates: Iterable[Candidate]) -> dict[str, Candidate]— Collapse an append-only log: the last record for an id wins.match_known(candidate: Candidate, catalogue: Iterable[KnownEntry], *, decided_by: str = 'match_known', decided_by_version: str = '1.0') -> Verdict | None— A `known` verdict if the catalogue already contains this observation.to_dict(candidate: Candidate) -> dict[str, Any]— A plain, JSON-ready mapping. Key order is stable for readable diffs.from_dict(record: Mapping[str, Any], *, verify_id: bool = True) -> Candidate— Rebuild a candidate, refusing anything malformed.migrate_record(record: Mapping[str, Any]) -> Mapping[str, Any]— Bring a stored record up to the current schema, or refuse it.to_json(candidate: Candidate, *, indent: int | None = None) -> str— One candidate as JSON text (`indent=None` gives a single JSONL line).from_json(text: str, *, verify_id: bool = True) -> Candidate— Parse one candidate from JSON text.dumps_jsonl(candidates: Iterable[Candidate]) -> str— Candidates as JSONL text: one record per line, append-friendly.loads_jsonl(text: str, *, verify_id: bool = True) -> list[Candidate]— Parse JSONL text, naming the line number of the first bad record.append_jsonl(path: str | Path, candidate: Candidate) -> None— Append one record. The log is never rewritten; the last id wins.read_jsonl(path: str | Path, *, verify_id: bool = True) -> list[Candidate]— Read a whole log. Missing files read as an empty log, not an error.write_jsonl(path: str | Path, candidates: Iterable[Candidate]) -> int— Replace a log wholesale; returns the number of records written.iter_jsonl(path: str | Path, *, verify_id: bool = True) -> Iterator[Candidate]— Stream a log one record at a time (large logs need not fit in memory).
ontology/registry.py — ontology.registry — the plug-in seam.
499 lines
Constants: SCREEN_COSTS, KNOWN_CHECK
class RegistryError— Base class for every error raised by this module.class DomainError— A domain, or one of its plug-ins, does not honour the interface.class ScreenResult— One screen's opinion of one candidate.class Generator— A lead source: it turns computed objects into candidate observations.class Screen— A killer: it removes candidates, or admits that it could not.class KnownnessDetector— The already-known gate: the cheapest and likeliest way to be right.class BaseGenerator— Convenience base for :class:Generator. Subclasses set name/version.class BaseScreen— Convenience base for :class:Screen. Subclasses set name/cost/checks.class BaseKnownnessDetector— Convenience base for :class:KnownnessDetector.class Domain— Everything the funnel needs to know about a subject, and nothing more.domain_reasons(domain: Domain) -> tuple[str, ...]— Every way `domain` violates the plug-in interface, in one pass.validate_domain(domain: Domain) -> None— Raise :class:DomainErrorlisting every interface violation, or return.register_domain(domain: Domain, *, replace: bool = False) -> Domain— Put `domain` in the table under its own name.get_domain(name: str) -> Domain— Fetch a registered domain, naming the alternatives if it is absent.list_domains() -> tuple[str, ...]— The registered domain names, sorted.unregister_domain(name: str) -> None— Remove one domain; a no-op if it was never registered.clear_registry() -> None— Empty the table. Exists for tests; nothing else should need it.
ontology/ledger.py — ontology.ledger — the append-only log the whole funnel is measured from.
389 lines
Constants: LOCKING, LEDGER_ENV_VAR, RUN_RECORD_TYPE, DEFAULT_LEDGER_DIR, DEFAULT_LEDGER_PATH
class LedgerError— The log could not be read or written.class LedgerView— An immutable snapshot: what the metrics layer is handed.class Ledger— An append-only store of candidates plus the funnel runs that made them.default_ledger_path() -> Path— The default candidate log, honouring :data:LEDGER_ENV_VAR.runs_path_for(path: str | Path) -> Path— The run stream that sits beside a candidate log.
ontology/funnel.py — ontology.funnel — the pipeline, and the accounting that justifies it.
1117 lines
Constants: FUNNEL_VERSION, STAGES, VERDICT_DISPOSITIONS, FUNNEL_ONLY_DISPOSITIONS, DISPOSITIONS
class FunnelError— The pipeline could not honour its own invariants.class Outcome— Where one candidate left the funnel, and how.class GeneratorReport— One generator invocation — including the ones that yielded nothing.class StageTally— How many candidates entered a stage, and how many it removed.class ScreenTally— How often one screen was consulted, what it cost and what it killed.class FunnelRun— The whole record of one pass through the pipeline.default_proof_gap(screens: Sequence[str], effort: float) -> str— The proof gap the funnel writes when nothing killed a candidate.run_funnel(domain: 'Domain | str', stages: Iterable[str] | None = None, limit: int | None = None, ledger: 'Ledger | str | Path | None' = None, dry_run: bool = False, *, context: Mapping[str, Any] | None = None, reopen: Iterable[str] = (), checkpoint: bool = True, run_id: str | None = None) -> FunnelRun— Run one pass of the discovery pipeline and record all of it.
ontology/metrics.py — ontology.metrics — conversion analytics over the ledger.
1144 lines
Constants: LITERATURE_STATUS_ORDER
class StageStat— One stage, aggregated over every run in the ledger.class FunnelReport— Counts and rates at every stage, over the whole ledger.class GeneratorStat— One lead source, and what its output actually turned into.class KnownnessBreakdown— What a generator's `known` verdicts actually matched.class ScreenStat— One screen or detector: how often, how long, how much it killed.class CostReport— Wall time by stage and by screen: where the compute actually went.class TimeBucket— One period of the log: what ran, what came out.rate(numerator: float, denominator: float) -> float | None— `numerator / denominator, orNone` when the denominator is empty.funnel_report(ledger: 'Ledger | LedgerView | str | Path | None' = None) -> FunnelReport— Counts and rates at every stage of the funnel, over the whole ledger.generator_scorecard(ledger: 'Ledger | LedgerView | str | Path | None' = None) -> tuple[GeneratorStat, ...]— Per generator: what it produced, what became of it, and what it cost.knownness_breakdown(ledger: 'Ledger | LedgerView | str | Path | None' = None) -> tuple[KnownnessBreakdown, ...]— Per generator: the `known` verdicts, split by literature status.stage_costs(ledger: 'Ledger | LedgerView | str | Path | None' = None) -> CostReport— Wall time by stage and by screen, aggregated over the ledger.time_series(ledger: 'Ledger | LedgerView | str | Path | None' = None, *, bucket: str = 'day') -> tuple[TimeBucket, ...]— The funnel over time, bucketed by the run's start timestamp.render_text(ledger: 'Ledger | LedgerView | str | Path | None' = None, *, bucket: str = 'day') -> str— Every table in this module, as one readable console report.
ontology/knownness.py — ontology.knownness — the gate that catches the dominant outcome.
1751 lines
Constants: KNOWNNESS_VERSION, FLOAT64_DIGITS, DEFAULT_BASIS, DEFAULT_BASE_DIGITS, DEFAULT_ESCALATED_DIGITS, DEFAULT_GUARD_DIGITS, DEFAULT_MAX_TERMS, DEFAULT_MAXCOEFF, DEFAULT_MIN_SURPLUS_DIGITS, FACT_STATUSES, GENERAL_FACTS, KNOWN_FACTS, NOT_RECOGNISED_OFFLINE, FORBIDDEN_LABEL_WORDS, OFFLINE_BACKEND
class KnownnessError— A misuse of this module's own contracts (not a failed match).class BasisConstant— One element of the basis an integer-relation search works over.class IdentificationConfidence— How much the escalation actually established. Three states, no score.class Identification— One candidate closed form, with the measurements that judge it.class IdentificationReport— The outcome of a closed-form search, including what it refused.class FactMatch— Why a candidate was judged already known, and by which entry.class KnownFact— One citable thing the laboratory, or the literature, already knows.class KnownFactRegistry— A curated table of established results, keyed by id.class LiteratureStatus— Three states, and the distinction between the last two is the point.class LiteratureResult— What a literature lookup established — including that it did not run.class LiteratureBackend— The interface a real (networked) lookup would implement.class OfflineLiteratureBackend— The default: no network, therefore no lookup, therefore no conclusion.class Knownness— The gate's two possible answers. Neither of them is "new".class KnownnessReport— Everything the gate concluded, and everything it declined to conclude.basis_by_name(basis: Sequence[BasisConstant] = DEFAULT_BASIS) -> dict[str, BasisConstant]— Name -> element. Names are unique within a basis; a clash is an error.safe_eval_expression(expression: str, dps: int) -> Any— Evaluate a closed-form expression string at `dps` digits, safely.identify_constant(value: Any = None, *, provider: Callable[[int], Any] | None = None, known_digits: int | None = None, base_digits: int = DEFAULT_BASE_DIGITS, escalated_digits: int = DEFAULT_ESCALATED_DIGITS, guard_digits: int = DEFAULT_GUARD_DIGITS, basis: Sequence[BasisConstant] = DEFAULT_BASIS, max_terms: int = DEFAULT_MAX_TERMS, maxcoeff: int = DEFAULT_MAXCOEFF, min_surplus_digits: float = DEFAULT_MIN_SURPLUS_DIGITS, cross_check: bool = True, max_provisional: int = 12) -> IdentificationReport— Is `value` a recognisable closed form? Offline, and with escalation.closed_form(value: Any = None, **kwargs) -> str | None— The confirmed closed form of `value, orNone. See :func:identify_constant`.default_fact_matcher(candidate: Candidate, fact: KnownFact) -> FactMatch | None— The matcher used when an entry supplies none.check_literature(candidate: Candidate, backend: LiteratureBackend | None = None) -> LiteratureResult— Ask the literature about `candidate. Offline, the answer isUNKNOWN`.funnel_label(label: str) -> str— Return `label` if a funnel may use it; raise if it claims novelty.screen_known(candidate: Candidate, *, facts: KnownFactRegistry | None = None, literature: LiteratureBackend | None = None, value_provider: Callable[[int], Any] | None = None, identify: bool = True, decided_by: str = 'ontology.knownness.screen_known', **identify_kwargs) -> KnownnessReport— The already-known gate: catalogue, then closed form, then literature.
ontology/historical_cases.py — ontology.historical_cases — the falsification test for the ontology itself.
745 lines
Constants: HISTORY_VERSION, MODES, IMPOSSIBLE_DISPOSITIONS, KILLING_DISPOSITIONS
class HistoryError— A case, or a replay of one, does not honour this module's contract.class HistoricalOutcome— What later work established about a claim. Five states, no shading.class HistoricalCase— One settled claim, the evidence behind it, and the answer history gave.class CaseGenerator— A lead source that emits exactly one recorded observation.class NullKnownnessDetector— A catalogue that runs, consults nothing, and recognises nothing.class CaseReplay— What the pipeline did with one case, in one mode.class CaseResult— Whether the pipeline reproduced history for one case, and why not.case_reasons(case: HistoricalCase) -> tuple[str, ...]— Every way `case` fails this module's standard. Empty means usable.validate_case(case: HistoricalCase) -> None— Raise :class:HistoryErrorlisting every violation, or return.register_case(case: HistoricalCase, *, replace: bool = False) -> HistoricalCase— Put `case` in the process-wide table under its key.get_case(key: str) -> HistoricalCaselist_cases() -> tuple[str, ...]unregister_case(key: str) -> Noneclear_cases() -> None— Empty the table. Exists for tests; nothing else should need it.case_domain(case: HistoricalCase, domain: Domain, mode: str = 'full') -> Domain— `domain`'s screens and catalogue, driven by one case's observation.replay(case: HistoricalCase, domain: Domain, *, mode: str = 'full', ledger: Ledger | str | Path) -> CaseReplay— Run one case through `domain`'s pipeline and report where it left.check_case(case: HistoricalCase, full: CaseReplay, uncatalogued: CaseReplay | None = None) -> CaseResult— Compare what the pipeline did against what history settled.gate_dependence(result: CaseResult) -> bool— Was the correct answer carried entirely by the already-known gate?run_case(case: HistoricalCase, domain: Domain, *, ledger_dir: str | Path, modes: Iterable[str] = MODES) -> CaseResult— Replay one case in each requested mode and adjudicate the result.run_history(cases: Iterable[HistoricalCase], domain: Domain, *, ledger_dir: str | Path, modes: Iterable[str] = MODES) -> tuple[CaseResult, ...]— Every case, in registration order.render_text(results: Sequence[CaseResult]) -> str— A one-screen report. Failures are printed in full, never summarised.
ontology/01_f1_geometry.py — Discovery Lab 1: The F1 Geometry Engine
106 lines
class ClosedOrbit— Represents a prime number as a closed orbit in our dynamical system.class F1Space— The hypothetical geometric space under Z.class Cohomology— The infinite-dimensional cohomology space H^1.gate_1_check(space: F1Space, cohomology: Cohomology)— Gate 1: The trace formula must equate the geometric orbits (primes)
ontology/02_acoustic_f1_matrix.py — Discovery Lab 2: The Acoustic Matrix of F1 (The Primordial Instrument)
96 lines
Constants: NOTE_NAMES
midi_to_note_name(midi_val)map_spectrum_to_music(freqs, base_midi = 40)is_prime(n)get_primes(limit)build_arithmetic_laplacian(N)— Builds the Laplacian matrix for the integer multiplication graph up to N.
ontology/03_inverse_spectral_geometry.py — Discovery Lab 3: Inverse Spectral Geometry
87 lines
build_symmetric_matrix(params, N)— Reconstruct a symmetric N x N matrix from its upper triangular elements.spectral_loss(params, N, target_eigenvalues)— Computes how far the current matrix's eigenvalues are from the Riemann zeros.forge_instrument(num_zeros = 15)
ontology/04_transcendental_matrix.py — Discovery Lab 4: The Transcendental Antisymmetric Matrix
69 lines
is_prime(n)get_primes(limit)build_antisymmetric_matrix(N)— Builds an antisymmetric matrix where M_{u, v} = ln(p) and M_{v, u} = -ln(p)
ontology/05_berry_keating_grid.py — Discovery Lab 5: The Berry-Keating Grid
89 lines
get_primes(limit)build_xp_operator(grid)— Builds the discretized H = -i(x d/dx + 1/2) operator on a given 1D grid.analyze_spectrum(M, title)
ontology/06_the_polya_hilbert_prototype.py — Discovery Lab 6: The Polya-Hilbert Prototype
79 lines
is_prime(n)get_primes(limit)build_polya_hilbert_operator(N)
ontology/07_the_imposter_gauntlet.py — Discovery Lab 7: The Imposter Gauntlet
56 lines
test_dh_embedding(N)
ontology/08_riemann_beats_audio.py — Discovery Lab 8: The Acoustic Interference of the Riemann Zeros
56 lines
generate_riemann_audio(num_zeros = 20, duration = 5.0, sample_rate = 44100)
ontology/09_hermite_prime_waves.py — Discovery Lab 9: Hermite-Prime Wave Zero Detector
107 lines
von_mangoldt(n)Z_candidate(xi, a, n_degree, B, c = 1.0, C_0 = 0.0)— Evaluates the fully anchored Hermite wave zero detector.scan_for_zeros()
ontology/10_geometric_dust_torus.py — Discovery Lab 10: Geometric Dust Torus (Symphony of Polygons)
116 lines
geometric_dust(n)— Area remainder between a circle of radius n and an inscribed regular n-gon.torus_laplacian(N, dx = 1.0)— Constructs the discrete Laplacian on an N x N periodic grid.torus_distance_sq(t1, t2, target_t1, target_t2)— Squared geodesic distance on [0, 2pi) x [0, 2pi) torus.build_dust_potential(N, M, sigma = 0.5)— Builds a potential V on the torus using Phase Embedding.evaluate_geometric_rh()
ontology/11_quantum_chaos_gue.py — Discovery Lab 11: Quantum Chaos & The Music of the Primes
87 lines
wigner_surmise_gue(s)— The GUE spacing distribution (Wigner surmise approx).generate_gue_eigenvalues(N)— Generate eigenvalues of a random NxN GUE matrix.normalize_spacings(eigenvalues)— Normalize spacings so the mean spacing is 1.plot_quantum_chaos()
ontology/13_dirichlet_polya_hilbert.py — Discovery Lab 13: The Dirichlet Polya-Hilbert Operator
118 lines
get_zeta_coefficient(n)get_dh_coefficient(n)— Dirichlet coefficients for the Davenport-Heilbronn function.build_dirichlet_xp_operator(N, coefficient_func)— Builds the H = x p operator on the divisor graph up to N,analyze_spectrum(M, title)
ontology/14_hunting_ln2.py — Discovery Lab 14: Hunting Down the ln(2) Artifact
84 lines
is_prime(n)get_primes(limit)build_matrix(N, use_smooth_boundary = False)report_degeneracy(M, title)
ontology/15_fixing_the_density.py — Discovery Lab 15: Fixing the Density of States
72 lines
build_sierra_townsend_matrix(N, p_min, p_max)— Builds the modified Berry-Keating matrix H = x(p + 1/p)analyze_density(H, title)
ontology/16_adelic_acoustic_absorber.py — Discovery Lab 16: The Adelic Acoustic Absorber
97 lines
is_prime(n)get_primes(limit)calculate_reflection(k, primes, N_limit)— Calculates the Bragg reflection amplitude R(k) for wavenumber k.
ontology/scout.py — `ontology.scout` — the literature scout: passages, never verdicts.
308 lines
Constants: MAX_HITS_PER_CORPUS, DEFAULT_CORPORA
class ScoutError— A scout invocation that cannot mean anything.class CorpusSpec— One searchable corpus: a name a report can cite, and where it lives.class SourceHit— One candidate passage. A passage is a lead, not a finding.class ScoutReport— What was searched, what was absent, and every passage located.class LocalCorpusBackend— The scout as a :func:ontology.knownness.check_literaturebackend.search_corpora(terms, corpora: tuple[CorpusSpec, ...] = DEFAULT_CORPORA) -> ScoutReport— Search every available corpus for files containing all terms.
ontology/scout_online.py — `ontology.scout_online` — the scout's networked half: OEIS and arXiv.
345 lines
Constants: MIN_SEQUENCE_TERMS
class OeisBackend— OEIS, with `FOUND` reserved for content-verified sequence matches.class ArxivBackend— arXiv as a lead generator. It has no route to `FOUND` on purpose.class ZbMathBackend— zbMATH Open as a lead generator. No credentials, and no `FOUND`.
ontology/domains/zeta_domain.py — ontology.domains.zeta_domain — the only module that knows what is studied.
3617 lines
Constants: DOMAIN_NAME, DOMAIN_VERSION, DEFAULT_DPS, DEFAULT_SEED, UNCERTAINTY_GUARD, GUARD_DIGITS, ROUTES, MERTENS_GRID, ZERO_HEIGHT_GRID, ZERO_SCAN_HEIGHT, PSLQ_BASIS, FINITE_FIELD_PRIMES, PREDICATE_TURAN, PREDICATE_FUNCTIONAL_EQUATION, PREDICATE_HASSE, RANGE_TOLERANCE, RANGE_RULES, TRIVIALITY_RULES, BATTERY_CLAIMS, ZETA_FACTS, FACT_REGISTRY, DOMAIN
class Route— How to recompute one recorded quantity from scratch.class ConstantsGenerator— Harvest computed constants as closed-form candidates.class AsymptoticsGenerator— Fit growth rates of computed sequences in two or more windows.class RelationsGenerator— Look for simple relations between pairs of computed quantities.class ExtremalGenerator— Record holders, each with the runner-up that makes the record falsifiable.class FiniteFieldGenerator— Quantities from curves over finite fields, where RH is a theorem.class StructuralGenerator— Universal claims over enumerated families, each with a failing control.class LegendreWeilGenerator— Mine the Riemann–Weil explicit formula localised to Legendre intervals.class NumericSanityScreen— Cheap arithmetic sanity: finiteness, and the ranges a theorem pins.class PrecisionStabilityScreen— The single most valuable cheap screen: does the number survive a bump?class TrivialityScreen— Does the claim follow, in one line, from an identity already in the lab?class HighPrecisionScreen— Expensive re-derivation: recompute at roughly twice the working precision.class IndependentMethodScreen— Cross-check by a second route that shares nothing but the object itself.class CounterexampleBatteryScreen— The standing test: route every structural claim through the battery.class CatalogueDetector— The already-known gate for this laboratory.build_domain() -> Domain— Assemble the domain. Called once at import; re-callable in tests.
ontology/domains/zeta_history.py — ontology.domains.zeta_history — settled claims, replayed against the funnel.
906 lines
Constants: GENERATOR, GENERATOR_VERSION, SEED, GUARD_DIGITS, GAUSS_WINDOWS, MONTGOMERY_N_ZEROS, MONTGOMERY_R_MAX, MONTGOMERY_BINS, MERTENS_LIMIT, MERTENS_CHECKPOINTS, MERTENS_CONTROLS, LI_N_MAX, LI_DPS, LI_CONTROL_ZERO, COINCIDENCE_DIGITS, COINCIDENCE_BASIS, HONEST_TWIN_DPS, HONEST_TWIN_UNCERTAINTY, HISTORICAL_CASES, REGISTERED
gauss_prime_count_windows() -> tuple[dict[str, Any], ...]— The fitted windows, with the raw block counts kept in the record.build_gauss_prime_counting() -> Candidate— pi(x) ~ Li(x), as an asymptotic candidate built from block counts.build_montgomery_pair_correlation() -> Candidate— The empirical pair correlation against 1 - (sin(pi r)/(pi r))^2.build_mertens_conjecture() -> Candidate— |M(x)| < sqrt(x) over the range a computation can reach.build_li_criterion() -> Candidate— lambda_n >= 0 over the range a computation can reach.pslq_coincidence(digits: int = COINCIDENCE_DIGITS) -> dict[str, Any]— Run the hunt at `digits` digits and return the coincidence it finds.build_low_precision_coincidence() -> Candidate— A constant candidate whose value is the coincidence, not the quantity.build_honest_twin() -> Candidate— The same quantity, measured honestly. The suite's positive control.register_all(*, replace: bool = True) -> tuple[HistoricalCase, ...]— Put every case in the process-wide table. Idempotent by default.
Falsification harness API (harness/) — the referee
The falsification protocol with the subject factored out. Four instrument roles — rivals (share the structure, lack the property), decoys (ablation), surrogates (null control) and lesions (detector power) — bundled into a Battery; a Department is a battery plus a door plus reference claims whose verdicts are known. The admission rule is no department without a battery: one with no rival, with neither decoy nor surrogate, or with no lesion is refused, because it could never fail. protocol.py is domain-agnostic under the same three seam tests as ontology/schema.py; the subject lives only in harness/departments/. tests/test_department_conformance.py is parametrized over the registered departments, so adding one adds its audit. Design: harness/README.md.
harness/protocol.py — `harness.protocol` — four instrument roles, one battery, one department.
923 lines
class HarnessError— Base class for every refusal this module issues.class BatteryError— A battery is malformed, or is one that could not fail.class DepartmentError— A department is malformed, or its name is already taken.class Subject— Something a claim can be evaluated against.class Decoy— A substitution that keeps the shape and removes the substance.class Surrogate— A generator of observations that carry no substantive input.class Lesion— A planted, known violation, used to measure a detector's power.class NamedDetector— A detector the department stakes its power measurements on.class Battery— The instruments entitled to kill a department's claims.class BatteryVerdict— Outcome of running one claim against the target and every rival.class AblationVerdict— Outcome of swapping the substantive input for each decoy.class NullVerdict— Outcome of comparing an observed statistic against the null models.class PowerVerdict— Outcome of showing a detector a set of planted violations.class NullBandVerdict— Outcome of comparing an observed statistic against many draws fromclass DetectorVerdict— Power and specificity of one named detector, measured together.class ReferenceClaim— A claim whose verdict is already known, kept as a calibration.class Department— A body of work with a subject, a referee, and a way in.battery_reasons(battery: Battery) -> tuple[str, ...]— Every reason `battery` is not usable, in one pass.validate_battery(battery: Battery) -> None— Raise :class:BatteryErrorlisting every problem, or return quietly.department_reasons(department: Department) -> tuple[str, ...]— Every reason `department` is not admissible, in one pass.validate_department(department: Department) -> None— Raise :class:DepartmentErrorlisting every problem, or return quietly.register_department(department: Department, *, replace: bool = False) -> Department— Validate and record `department` under its name.get_department(name: str) -> Departmentlist_departments() -> tuple[str, ...]unregister_department(name: str) -> Noneclear_departments() -> Nonerun_battery(battery: Battery, claim: ClaimOutcome, *, name: str = '') -> BatteryVerdict— Evaluate `claim` against the target and every rival.run_ablation(battery: Battery, measure: Callable[[Any], float], *, tolerance: float, payload: Any = None, name: str = '') -> AblationVerdict— Measure on the target, then on the target with each decoy substituted.run_nulls(battery: Battery, statistic: Callable[[Any], float], *, tolerance: float, observed: float | None = None, name: str = '') -> NullVerdict— Compare the observed statistic against one draw from each surrogate.run_power(battery: Battery, detector: Callable[[Any], Any], *, payload: Any = None, name: str = '') -> PowerVerdict— Show `detector` every planted violation and record what it noticed.run_null_band(battery: Battery, statistic: Callable[[Any], float], *, draws: int, observed: float | None = None, name: str = '') -> NullBandVerdict— Compare the observed statistic against `draws` samples per surrogate.run_detector(battery: Battery, detector: NamedDetector, *, payload: Any = None) -> DetectorVerdict— Measure one declared detector's power and specificity.
harness/demo.py — `python -m harness.demo` — the whole architecture, in one run.
174 lines
main(argv: list[str] | None = None) -> int
harness/graveyard.py — `harness.graveyard` — killed results as first-class records.
121 lines
class GraveyardError— A grave that cannot say how its occupant died.class KilledResult— One withdrawn result, with everything a reader needs to trust the kill.unguarded(graves: tuple[KilledResult, ...]) -> tuple[str, ...]— Every grave nothing now guards, one sentence each.
harness/guards.py — `harness.guards` — detection power as a record, not a feeling.
152 lines
class GuardRecordError— A guard record that claims more or less than its fields carry.class GuardRecord— One guard, its intended lesion, and whether its power was ever shown.undemonstrated(records: tuple[GuardRecord, ...]) -> tuple[str, ...]— The guards whose power nobody has shown — the offensive's worklist.dead_guards(records: tuple[GuardRecord, ...]) -> tuple[str, ...]— Guards demonstrated not to fire on their own lesion.offensive_worklist(records: tuple[GuardRecord, ...]) -> tuple[str, ...]— Every open item the ledger implies, one disputable sentence each.
harness/independence.py — `harness.independence` — verification independence as declared structure.
228 lines
class IndependenceError— A path or comparison that cannot be measured as declared.class VerificationPath— One route from input to verdict, as an ordered tuple of named layers.class IndependenceReport— What two declared paths share, where, and what that bounds.compare(a: VerificationPath, b: VerificationPath) -> IndependenceReport— Measure what two declared paths actually duplicate.agreement_bounds(report: IndependenceReport) -> tuple[str, ...]— Every reason an agreement between the two paths is bounded evidence.
harness/integrity.py — `harness.integrity` — the referee, refereed.
1560 lines
Constants: PASS, FAIL, UNKNOWN, CALIBRATED, DETECTOR_INADEQUATE, UNMEASURED, CONTAMINATED, HOLLOW, GRADES, SHAM_MODES, AUDIT_BLIND_SPOTS
class CheckResult— One named integrity check: what was measured and what it showed.class ShamMode— One known way a structurally valid battery can be hollow.class IntegrityReport— Every integrity check run against one department, with its grade.class ClaimReport— One claim outcome, permanently paired with its battery's integrity.payloads_same(before: Any, after: Any) -> bool— Structural equality across the payload shapes departments actually use.audit_department(department: Department) -> IntegrityReport— Run every integrity check against `department` and grade the result.report_claim(department: Department, claim: ClaimOutcome, *, name: str = '') -> ClaimReport— Run `claim` through the department's battery and pair the outcome
harness/new_department.py — `python -m harness.new_department <name>` — scaffold a department honestly.
215 lines
scaffold(name: str, *, root: Path = _REPO_ROOT) -> list[Path]— Write the three files; refuse to overwrite anything that exists.main(argv: list[str] | None = None) -> int
harness/preregistration.py — `harness.preregistration` — contamination as a derived fact, not a declaration.
328 lines
Constants: DIGEST_PREFIX, EVIDENCE_VISIBLE_AT_FREEZE, CRITERIA_DRIFT
class Preregistration— Criteria frozen at a stated moment, with what was already visible then.class Divergence— What the record says about itself, beside what its artifacts say.digest(obj: Any) -> str— Stable content digest: `sha256:` over canonical JSON.derived_findings(prereg: Preregistration, *, criteria_applied: Any, evidence_digest: str) -> tuple[tuple[str, str], ...]— Every contamination finding derivable from the artifacts, as (key, prose).derived_contamination_reasons(prereg: Preregistration, *, criteria_applied: Any, evidence_digest: str) -> tuple[str, ...]— The prose of :func:derived_findings, in the `*_reasons()` house shape.declared_vs_derived(provenance: Provenance | None, prereg: Preregistration, *, criteria_applied: Any, evidence_digest: str) -> Divergence— Put the declaration and the derivation side by side.
harness/promotion.py — `harness.promotion` — the integrity grade made enforcing instead of advisory.
772 lines
Constants: ALLOW, BLOCK, POLICY_VERSION, NAIVE_POLICY_VERSION, REQUIRED_GRADE, REQUIRED_CLAIM_STATUS, CHECKS
class PromotionError— A misuse of the boundary: a bad identifier, or a reach past the door.class ReasonCode— Closed, stable, machine-readable. A reason is not a sentence.class Decision— One crossing, decided, with everything needed to re-derive it.class NaiveGate— :func:naive_decideas an object, so a test can parametrize over gates.class Boundary— Four directories, one door.class ProducerView— A handle exposing only :meth:submit.decide(claim_report: ClaimReport, *, prereg: Preregistration, criteria_applied: Any, evidence_digest: str, current_evidence_digest: str, claim_id: str, producer_id: str, verifier_id: str, requested_scope: str, now: str = '') -> Decision— Decide one crossing, running every check and reporting all findings.recheck(claim_report: ClaimReport, *, only: ReasonCode, **kwargs) -> Decision— Run the single check that produces `only`, and nothing else.naive_decide(claim_report: ClaimReport, *, provenance: Provenance | None, claim_id: str, now: str = '') -> Decision— The gate this one has to beat: reads declarations, recomputes nothing.audit(boundary: Boundary) -> tuple[str, ...]— Reconcile `promoted/` against the decision log. Every discrepancy, once.
harness/provenance.py — `harness.provenance` — independence and contamination as declared data.
178 lines
class Provenance— Who authored a battery's content, when, and under what conditions.contamination_reasons(provenance: Provenance) -> tuple[str, ...]— Every declared contamination, in one pass.dependence_reasons(provenance: Provenance) -> tuple[str, ...]— Every declared dependence between the evidence and what it checks.undeclared_fields(provenance: Provenance) -> tuple[str, ...]— The tri-state fields nobody has declared, so silence stays visible.
harness/review.py — `harness.review` — the standing adversarial review: two attacks per claim.
200 lines
Constants: WHITEBOX_CHECKLIST, THE_QUESTION
class ReviewError— A review record that cannot mean what it claims.class ClaimUnderReview— A promising result, packaged for attack.class AttackBrief— One attacker's packet. `materials` is everything they may read.class AttackOutcome— What one attack found. Recording is not resolving.generate_briefs(claim: ClaimUnderReview) -> tuple[AttackBrief, AttackBrief]— The two attacks, generated deterministically from one record.standing_reasons(claim: ClaimUnderReview, outcomes: tuple[AttackOutcome, ...]) -> tuple[str, ...]— Everything still missing before this claim's review is standing.
harness/shams.py — `harness.shams` — planted corruptions of batteries, for measuring the audit.
384 lines
with_constant_detector(department: Department, *, value: bool = True) -> Department— Replace every declared detector with one that always answers `value`.with_target_as_rival(department: Department) -> Department— Replace every rival with the target wearing the rivals' names.with_inert_lesions(department: Department) -> Department— Make every lesion an identity: violations that were never planted.without_hardest_lesion(department: Department) -> Department— Silently drop the smallest-magnitude lesion — the one the detectorswith_leaked_label(department: Department, *, key: str = 'virtual_tell') -> Department— Give every rival's payload a key the target's payload lacks — thewith_distant_rivals(department: Department) -> Department— Move every rival far from the target while keeping the key set.with_detector_as_claim(department: Department) -> Department— Replace the declared detectors with the distinguishing claim, negated.with_agreeable_absent_fields(department: Department) -> Department— Give the target a payload that answers fields nobody declared.with_vacuous_calibration(department: Department) -> Department— Replace the reference claims with a shape-valid pair that cannot earn
harness/departments/compiler_department.py — `harness.departments.compiler_department` — department #3: LLVM IR rewrites.
398 lines
Constants: DEPARTMENT_NAME, DEPARTMENT_VERSION, FULL_DOMAIN, SURROGATE_SEEDS, TARGET, RIVALS, DECOYS, SURROGATES, LESIONS, DETECTORS, BATTERY, REFERENCE_CLAIMS, DEPARTMENT
class RewriteSubject— A subject whose payload is one proposed rewrite.class InputSetDecoy— Replace a set of test inputs with a same-sized set that covers nothing.class UnguidedMutationSurrogate— One candidate rewrite drawn from unguided mutation of the target's source.class PlantedDefect— Wrap a :class:compiler.catalog.LesionSpecas a harness lesion.agreement_over(transformation: catalog.Transformation)— A measure of agreement as a function of the input set, for ablation.concrete_detector(transformation: Any) -> bool— Fires when the exhaustive concrete run notices a disagreement.model_detector(transformation: Any) -> bool— Fires when the poison-aware model finds a refinement violation.
harness/departments/croniter_department.py — Department #4: cron schedule semantics — the first foreign-domain subject.
534 lines
Constants: PROBES, DEFAULT_RAISE_EXPR, RANGE_EXPECTED, TARGET, RIVALS, LESIONS, DETECTORS, REFERENCE_CLAIMS, BATTERY, DEPARTMENT
accepts_union_flag(schedule) -> bool— Fires when the implementation accepts the day_or_union API at all.matches_independent_oracle(schedule) -> bool— Fires when every union-mode probe equals the calendar oracle exactly.probe_distinguishing_power(exprs) -> float— How many of `exprs` separate the target from the sharpest rival.oracle_agreement(dates) -> float— Share of the first union probe's oracle dates reproduced by `dates`.oracle_mismatch_detector(source: str) -> bool— Fires when an implementation's bounded fingerprint deviates from frozen.
harness/departments/finitefield_department.py — `harness.departments.finitefield_department` — department #2.
584 lines
Constants: DEPARTMENT_NAME, DEPARTMENT_VERSION, P, CURVE_A, CURVE_B, N_MAX, RIVAL_TRACES, LESION_TRACES, TARGET, RIVALS, DECOYS, SURROGATES, LESIONS, DETECTORS, BATTERY, REFERENCE_CLAIMS, DEPARTMENT
class CurveSubject— The genuine article: counts of a real curve, recomputed per call.class CounterfeitSubject— A rival: the same count-shape with the property removed.class CountDecoy— A substitution acting on a sequence of counts.class AngleSurrogate— Normalised Frobenius traces drawn from an angle law, no curve anywhere.class OffCircleLesion— Append one counterfeit profile to a survey of genuine ones.counterfeit_counts(trace: int, p: int, n_max: int) -> tuple[int, ...]— Counts of nothing: the Lefschetz formula run on an inadmissible trace.claim_functional_equation(payload: dict) -> bool— Self-duality: the counts follow a degree-2 Lefschetz recursion with αβ = p.claim_hasse_bound(payload: dict) -> bool— RH for the curve: both Frobenius roots on |α| = sqrt(p), i.e. a² ≤ 4p.
harness/departments/graveyard_ledger.py — The repository's graveyard — the opening graves, entered from the records.
74 lines
Constants: GRAVES
harness/departments/guard_ledger.py — The repository's guard ledger — the guard offensive's opening entries.
229 lines
Constants: GUARDS
harness/departments/referee_department.py — Department #5: the referee itself — batteries as subjects, audited like one.
689 lines
Constants: DEPARTMENT_NAME, DEPARTMENT_VERSION, SPECIMEN, TARGET, RIVALS, DECOYS, SURROGATE_SEEDS, SURROGATES, LESIONS, DETECTORS, BATTERY, REFERENCE_CLAIMS, DEPARTMENT
build_specimen() -> Department— The target: a calibrated department in the toy domain.build_sham_431cc74() -> Department— The sham battery commit `431cc74` replaced — reconstructed.claim_validates_structurally(bundle: Department) -> bool— Fires when the bundle passes structural admission.claim_audits_calibrated(bundle: Department) -> bool— Fires when the full integrity audit grades the bundle CALIBRATED.integrity_pass_count(bundle: Department) -> float— The ablation/null statistic: how many audit checks pass on the bundle.random_bundle(seed: int) -> Department— A structurally plausible department assembled with zero calibrationintegrity_flags(bundle: Department) -> bool— The department's detector: fires when the audit grade is not CALIBRATED.
harness/departments/review_ledger.py — The repository's standing-review ledger — real claims, real attacks.
85 lines
Constants: CLAIMS, OUTCOMES
harness/departments/stateval_department.py — Department #6: statistical model evaluation — claims about distributions.
716 lines
Constants: DEPARTMENT_NAME, DEPARTMENT_VERSION, N_FEATURES, W_TRUE, NOISE_SCALE, N_ROWS, RIDGE_LAMBDA, FRESH_SEEDS, FRESH_MARGIN, LESION_FRACTIONS, TARGET, RIVALS, SURROGATES, CLEAN_PROTOCOL, LESIONS, GAP_THRESHOLD, DETECTORS, BATTERY, REFERENCE_CLAIMS, DEPARTMENT
draw_dataset(seed: int, *, rows: int = N_ROWS, signal: bool = True)— One draw of the task: features, targets. `signal=False` removes theridge_fit(X: np.ndarray, y: np.ndarray) -> np.ndarray— Closed-form ridge weights — the genuine candidate's recipe.mean_predictor_mse(y_train: np.ndarray, y_eval: np.ndarray) -> float— The honest reference baseline: predict the training mean.oracle_fresh_mean_mse(seed: int) -> float— The department's oracle: the mean predictor's mse on a fresh draw.claim_reports_improvement(payload: dict) -> bool— Fires when the pair's own protocol reports any improvement at all.claim_improves_when_fresh(payload: dict) -> bool— Fires when the candidate beats the honest oracle on every fresh draw.gap_detector(protocol: dict) -> bool— Fires when reported improvement exceeds fresh improvement by moreoverlap_scan(protocol: dict) -> bool— Fires when any evaluation row is literally present in the training
harness/departments/zeta_department.py — `harness.departments.zeta_department` — department #1, and the reference wiring.
547 lines
Constants: DEPARTMENT_NAME, DEPARTMENT_VERSION, DPS, EPSTEIN_FORMS, LESION_HEIGHT, LESION_DELTAS, TARGET, RIVALS, DECOYS, SURROGATES, LESIONS, LI_PROJECTION_THRESHOLD, DETECTORS, BATTERY, REFERENCE_CLAIMS, DEPARTMENT, RIGOR_SHARED_LAYERS, RIGOR_SHARED_TAIL, RIGOR_BACKEND_PATHS
class InterfaceSubject— A subject whose payload is one of `zeta.epstein`'s interface dicts.class PrimeDecoy— A substitution acting on a sequence of primes.class IntensitySurrogate— A null model producing an intensity array on a fixed grid.class OffLineLesion— Plant a symmetric quadruple of zeros off the critical line.li_projection_deviation(zeros) -> float— max_n |λ_n(multiset) − λ_n(its on-line projection)|.li_projection_detector(zeros) -> bool— Fires when the Li multiset deviates from its on-line projection.off_line_scan(zeros) -> bool— Fires when any zero in the multiset sits off the critical line.
Research dossiers API (dossier/) — a probe, not a department
An experiment in representing mathematical research state — intent, definitions, provenance, evidence, failed attempts, proof obligations and verification status — so that an agent can resume rigorous work. One schema, one worked example, one CLI (scripts/50_dossier.py). Two ideas are under test: intent is data (what an object is for, stated before any formula, plus what it is most likely to be confused with), and "verified" is four independent things (numeric agreement, enclosure arithmetic, the published record, a proof kernel) which status.py refuses to collapse — Support.__bool__ raises rather than let a caller write if support:. Registered in no department and given no door, because a dossier has no rivals of its own: see docs/19-research-dossiers.md SS6. Design: dossier/README.md.
dossier/status.py — `dossier.status` — four kinds of support, kept apart on purpose.
227 lines
Constants: AXES
class NumericStatus— Did a floating point or arbitrary-precision computation agree?class CertifiedStatus— Did every step carry an enclosure?class LiteratureStatus— What does the published record say?class FormalStatus— What has a proof kernel accepted?class AxisRecord— One axis: its status, what produced it, and where to look.class Support— The four axes together, with no way to reduce them to one.support_reasons(support: Support) -> tuple[str, ...]— Every reason `support` is malformed, in one pass.
dossier/schema.py — `dossier.schema` — what an AI agent needs in order to resume rigorous work.
342 lines
Constants: SCHEMA_VERSION
class DossierError— A dossier is malformed.class Confidence— How settled is this piece — not how true, how settled here.class Intent— What the object is for, stated before any formula.class Definition— The preferred definition, and the convention decisions inside it.class RejectedAlternative— A definition that was tried and put down, with the reason.class SemanticObligation— A property the definition must have to be the intended object.class Dependency— Something this object is defined in terms of.class OpenQuestion— What is not settled, and what would settle it.class Dossier— The research state of one mathematical object.dossier_id(dossier: Dossier) -> str— A stable id for the identity of the object, not its research state.dossier_reasons(dossier: Dossier) -> tuple[str, ...]— Every reason `dossier` is not usable, in one pass.validate_dossier(dossier: Dossier) -> None— Raise :class:DossierErrorlisting every problem, or return quietly.
dossier/report.py — `dossier.report` — the readable status report.
147 lines
render_short(dossier: Dossier) -> str— One line per axis, for a listing. Still all four.render_text(dossier: Dossier) -> str— The full report, in the order an agent resuming cold needs it.
dossier/subjects/hardy_z.py — The Hardy Z dossier — the one worked example.
443 lines
Constants: DOSSIER_NAME, SAMPLE_TS, DEFINITION_AGREEMENT_DEFECT
Z_via_completed(t, dps: int = 30)— Hardy's Z by the completed-zeta route, with no branch of log Gamma.build() -> Dossier— Assemble the dossier. Pure data — no computation runs here.
Documents (docs/)
00-orientation.md— 00 — Orientation01-sums-integrals-and-continuation.md— 01 — Sums, Integrals, and Continuation02-theta-heat-and-modularity.md— 02 — Theta, the Heat Equation, and Modularity03-functional-equation.md— 03 — Riemann's Functional Equation, Derived Line by Line04-explicit-formula.md— 04 — The Explicit Formula: Zeros ↔ Primes05-de-bruijn-newman.md— 05 — The de Bruijn–Newman Constant: Running Heat Flow on Zeta06-hilbert-polya-and-gue.md— 06 — Hilbert–Pólya, Berry–Keating, and the GUE07-equivalences-and-criteria.md— 07 — Equivalences and Criteria08-why-it-is-hard.md— 08 — Why It Is Hard: An Honest Failure Catalogue09-new-ontologies.md— 09 — New Ontologies: What "RH Needs New Mathematics" Actually Means10-trace-formulas-and-connes.md— 10 — Trace Formulas and the Connes Program11-f1-and-the-missing-geometry.md— 11 — F1 and the Missing Geometry12-how-hard-problems-die.md— 12 — How Hard Problems Die: A Kill Board13-moments.md— 13 — Moments: External Windows, Finite Estimates, Honest Scorecards14-how-new-mathematics-gets-invented.md— 14 — How New Mathematics Gets Invented15-the-f1-discovery-engine.md— 15 — The F1 Discovery Engine16-poisson-cokernel-plan.md— Poisson-Summation Cokernel: Implementation Blueprint17-the-falsification-harness.md— 17 — The falsification harness: how five claims died in one day18-five-longshots.md— 18 — Five longshots, run to their walls19-research-dossiers.md— 19 — Research dossiers: an experiment in AI-native mathematical state20-verification-integrity.md— 20 — Verification integrity: the referee, refereed21-forward-deployed-verification.md— 21 — Forward-deployed verification: can a report refuse a crossing?22-detector-strength-findings.md— Computational Alarm Systems for the Riemann Hypothesis:23-rival-distance-and-detector-independence.md— 23 — Rival distance and detector independence: closing two declared blind spots24-the-local-positivity-attempt.md— 24 — The local positivity attempt, run to its wall25-the-director-run.md— 25 — The director run: the laboratory pointed at itself26-the-adopted-builds.md— 26 — The adopted builds: the decision of 2026-08-11, made runnable27-state-of-the-transplant.md— 27 — State of the transplant: what is kernel-checked, what is refuted, what is open
Runnable demos (scripts/)
scripts/01_verify_functional_equation.py— Numerically walk Riemann's theta -> functional-equation derivation.scripts/02_find_zeros.py— Find every non-trivial zero of ζ(s) up to height T, from scratch, andscripts/03_primes_from_zeros.py— THE SHOWSTOPPER: reconstruct the primes from the zeros of ζ(s).scripts/04_gue_statistics.py— Zero-spacing statistics of ζ vs random-matrix theory (the GUE) vs Poisson.scripts/05_heat_flow.py— Heat flow on the Riemann Ξ function: watch the zeros move, and thescripts/06_tour.py— One command, the whole story: a guided tour of the Riemann zeta laboratory.scripts/07_weil_positivity.py— The Riemann–Weil explicit formula, balanced live — then Weil positivity probed.scripts/08_wrong_shape_zeta.py— The counterexample show: perfect zeta-shaped symmetry, and a zero OFF the line.scripts/09_certified_verification.py— Certified RH verification: the difference between "we measured" and "we proved".scripts/10_li_and_jensen.py— Li's criterion and the Jensen polynomials: RH as positivity, RH as real-rootedness.scripts/11_finite_field_rh.py— The universe where RH is a THEOREM — curves over finite fields, checked by counting.scripts/12_equivalence_faces.py— Four exact equivalences of RH, all four run, on one dashboard.scripts/13_discovery_run.py— The conjecture factory: run the discovery funnel and print what it converted.scripts/14_moment_experiment.py— Critical-line moments from locally computed values, and where they can be tested.scripts/15_null_control.py— Run the finite-height concentration statistics against a null model.scripts/16_repulsion_floor.py— Level repulsion in the zeta zeros: the small-gap tail, against two models.scripts/17_f1_fingerprints.py— The q -> 1 limit: combinatorial shadows of geometry over a finite field.scripts/18_dh_li_coefficients.py— Li coefficients for the Davenport-Heilbronn function — a detector control.scripts/19_dh_weil_positivity.py— Weil Positivity against Davenport-Heilbronnscripts/20_music_of_the_primes.py— The Music of the Zeros: Mapping Deninger's Frequencies to the Fretboardscripts/21_detector_strength_audit.py— Detector-Strength Audit: The Mertens Alarm against Davenport-Heilbronnscripts/22_gate_1_harness.py— Gate 1 Harness: The Classical Physics Batteryscripts/23_gate_3_battery.py— Gate 3 Harness: The Counterexample Batteryscripts/24_detector_power.pyscripts/25_adelic_product_formula.py— Demonstration of Artin's Product Formula over the Adeles.scripts/26_tates_thesis.py— Demonstration of Tate's Thesis and the Idelic Global Zeta Function.scripts/27_adelic_fourier_character.py— Demonstration of the Adelic Additive Character and Pontryagin Duality.scripts/30_connes_spectral_matrix.py— Spectral Discretization of the Connes Scaling Operator.scripts/31_spectral_falsifiers.py— Demonstrate that the spectral falsifiers actually fire.scripts/32_poisson_cokernel_matrix.py— Script 32: Poisson-Summation Cokernel Matrix (with p-adic tensor factors)scripts/40_legendre_weil.py— Landau Problem 1: Legendre's Conjecture via the Explicit Formulascripts/41_twin_prime_gue.py— Script 41: The GUE Twin Prime Predictorscripts/50_dossier.py— Validate research dossiers and print their status.scripts/60_rung3_generate.py— Generate the rung-3 certificate Lean files from a plan JSON.scripts/61_rung3_mirror.py— Bit-exact Fraction mirror of the ZetaLean rational interval arithmetic.scripts/70_lab_state.py— 70_lab_state.py — the read-only research-state view, rendered from artifacts.scripts/make_context.py— Regenerate the machine-readable knowledge index for this repository.scripts/make_figures.py— Generate every figure of the zeta laboratory into `figures/`.scripts/mathlib_gaps.py— Which of Mathlib's 1000 famous theorems are still unformalized.scripts/science_preflight.py— Preflight for a session running this lab from an outside environment.scripts/ledger_sync.sh— Sync the private discovery ledger between machines.
Tests (tests/)
1768 test functions across 68 files (the collected count differs where tests are parametrised):
tests/test_adele.py— 4tests/test_claim_attribution.py— 6tests/test_compiler_candidate.py— 32tests/test_core.py— 97tests/test_criteria.py— 75tests/test_department_conformance.py— 19tests/test_detector.py— 11tests/test_detectors.py— 4tests/test_discovery_funnel.py— 89tests/test_discovery_historical_validation.py— 48tests/test_discovery_knownness.py— 102tests/test_discovery_schema.py— 62tests/test_discovery_zeta_domain.py— 83tests/test_docs_numbering.py— 4tests/test_doors.py— 4tests/test_dossier_hardy_z.py— 22tests/test_dossier_schema.py— 37tests/test_epstein.py— 43tests/test_explicit.py— 45tests/test_factorization.py— 13tests/test_finitefield.py— 53tests/test_frontier_math_clean_kill.py— 6tests/test_graveyard.py— 7tests/test_guard_ledger.py— 10tests/test_harness_croniter_department.py— 11tests/test_harness_demo.py— 5tests/test_harness_finitefield_department.py— 12tests/test_harness_independence.py— 17tests/test_harness_integrity.py— 20tests/test_harness_promotion.py— 48tests/test_harness_protocol.py— 49tests/test_harness_referee_department.py— 12tests/test_harness_stateval_department.py— 12tests/test_harness_zeta_department.py— 9tests/test_heatflow.py— 38tests/test_hunt_probe_discipline.py— 7tests/test_huntspec.py— 16tests/test_inverse.py— 8tests/test_lab_state.py— 1tests/test_leeyang.py— 7tests/test_li.py— 56tests/test_meta_ledger.py— 24tests/test_moments.py— 26tests/test_o9_leaves_kernel.py— 6tests/test_plots.py— 13tests/test_proof_adapter.py— 10tests/test_quasicrystal.py— 9tests/test_reading_of_record.py— 2tests/test_relations.py— 7tests/test_repo_hygiene.py— 7tests/test_review.py— 11tests/test_rigor.py— 54tests/test_rigor_weil.py— 17tests/test_rogue_lab_controls.py— 7tests/test_rung3_mirror.py— 9tests/test_scout.py— 12tests/test_scout_online.py— 15tests/test_script_13_discovery_run.py— 33tests/test_script_14_moment_experiment.py— 26tests/test_site.py— 1tests/test_spectral_gate.py— 14tests/test_statistics.py— 54tests/test_surrogate.py— 23tests/test_synthesis.py— 6tests/test_telemetry.py— 71tests/test_weil.py— 44tests/test_zeros.py— 58tests/test_zeta23ext_imports.py— 5
.venv/bin/python -m pytest -q -m 'not slow' # fast tier
.venv/bin/python -m pytest -q # everythingGround truth for quick assertions
| quantity | value |
|---|---|
| ζ(2) | π²/6 = 1.6449340668482264… |
| ζ(0), ζ(−1) | −1/2, −1/12 |
| γ₁, γ₂, γ₃ | 14.134725141734694, 21.022039638771555, 25.010857580145689 |
| N(100) | 29 zeros with 0 < γ < 100 |
| Ξ(0) | 0.4971207781… |
| λ₁ (Li) | 1 + γ/2 − log(4π)/2 = 0.0230957089661… |
| Λ (de Bruijn–Newman) | 0 ≤ Λ < 0.2; RH ⟺ Λ = 0 |
| θ(1/x) − √x·θ(x), ξ(s) − ξ(1−s) | 0 to working precision (~1e−30 at dps 30) |
Identities are exposed as measured defect functions rather than assumed; mpmath's zetazero / siegelz / grampoint / nzeros and Arb are used as independent oracles against the hand-rolled machinery.