From 160d84f181e095fd33f0f0d8f31f261f4ef23761 Mon Sep 17 00:00:00 2001 From: Dylan Roy Date: Wed, 30 Sep 2026 19:11:13 -0500 Subject: [PATCH] Bound ideal Gaussian spectral tails with explicit open coupling Add exact rational tail envelopes and a source-bound replay certificate. The finite-polynomial to Gaussian low-mode coupling remains open. Authored by OpenAI/Codex under Dylan Roy's delegated authority. --- .github/workflows/periodic-h0-pilot.yml | 4 +- .../periodic_h0/CONFIRMATION_READINESS.md | 9 +- experiments/periodic_h0/GAUSSIAN_TAIL.md | 242 ++++++++++++++++++ experiments/periodic_h0/README.md | 21 +- experiments/periodic_h0/gaussian_tail.py | 107 ++++++++ .../periodic_h0/gaussian_tail_certificate.py | 142 ++++++++++ .../results/gaussian_tail1/CERTIFICATE.json | 1 + .../results/gaussian_tail1/RESULTS.md | 36 +++ .../results/gaussian_tail1/RUN.json | 1 + .../results/gaussian_tail1/RUN.sha256 | 1 + experiments/periodic_h0/test_gaussian_tail.py | 81 ++++++ .../test_gaussian_tail_certificate.py | 48 ++++ 12 files changed, 683 insertions(+), 10 deletions(-) create mode 100644 experiments/periodic_h0/GAUSSIAN_TAIL.md create mode 100644 experiments/periodic_h0/gaussian_tail.py create mode 100644 experiments/periodic_h0/gaussian_tail_certificate.py create mode 100644 experiments/periodic_h0/results/gaussian_tail1/CERTIFICATE.json create mode 100644 experiments/periodic_h0/results/gaussian_tail1/RESULTS.md create mode 100644 experiments/periodic_h0/results/gaussian_tail1/RUN.json create mode 100644 experiments/periodic_h0/results/gaussian_tail1/RUN.sha256 create mode 100644 experiments/periodic_h0/test_gaussian_tail.py create mode 100644 experiments/periodic_h0/test_gaussian_tail_certificate.py diff --git a/.github/workflows/periodic-h0-pilot.yml b/.github/workflows/periodic-h0-pilot.yml index 9773581e2..798ae551f 100644 --- a/.github/workflows/periodic-h0-pilot.yml +++ b/.github/workflows/periodic-h0-pilot.yml @@ -43,9 +43,11 @@ jobs: run: python -B -S experiments/periodic_h0/hessian_grid_certificate.py --verify experiments/periodic_h0/results/hessian1 - name: Replay exact integer H0 and independent connectivity witnesses run: python -B -S experiments/periodic_h0/exact_barcode_certificate.py --verify experiments/periodic_h0/results/exact_h0_1 + - name: Replay the ideal Gaussian spectral tail and conditional coupling boundary + run: python -B -S experiments/periodic_h0/gaussian_tail_certificate.py --verify experiments/periodic_h0/results/gaussian_tail1 - name: Execute the complete fixed pilot run: | python -B experiments/periodic_h0/run_pilot.py --output "$RUNNER_TEMP/periodic-h0-replay" python -B experiments/periodic_h0/run_pilot.py --verify "$RUNNER_TEMP/periodic-h0-replay/observations.json" - name: State scientific scope - run: echo 'Tests, exact finite-field barcode bounds and a fresh discrete periodic H0 pilot passed. Ideal Gaussian/infinite-field error control, coefficient confirmation and scientific acceptance remain separate.' >> "$GITHUB_STEP_SUMMARY" + run: echo 'Tests, exact finite-field barcode bounds, ideal Gaussian tail bounds and a fresh discrete periodic H0 pilot passed. Coupling the historical coefficients to the ideal ensemble, lifetime-law confirmation and scientific acceptance remain separate.' >> "$GITHUB_STEP_SUMMARY" diff --git a/experiments/periodic_h0/CONFIRMATION_READINESS.md b/experiments/periodic_h0/CONFIRMATION_READINESS.md index 325ca0917..7fcca5cc4 100644 --- a/experiments/periodic_h0/CONFIRMATION_READINESS.md +++ b/experiments/periodic_h0/CONFIRMATION_READINESS.md @@ -14,7 +14,8 @@ paired differences, finite-sample error, and the last refinement remain relevant | Certified numeric nodal input | [New seed34000 / 128² snapshot](NODAL_CERTIFICATE.md), every node independently enclosed | Nodal error and abstract finite-field diagram bound supplied for this snapshot only; historical samples and computed barcode endpoints remain uncertified | | Sharper finite-field spatial bound | [Hessian/grid certificate](HESSIAN_GRID.md), with a 256² derivative grid and a separate 1024² dyadic sample grid | Exact abstract-filtration error evaluated for deterministic new samples; no transfer of historical histogram counts | | Exact fine-grid H0 endpoints | [Integer barcode and independent connectivity verification](EXACT_H0.md) | One C38 grid and its frozen finite polynomial only; exact endpoints and deterministic bin-count sandwich | -| Infinite-field truncation | Variance diagnostics through mode64 in pilot32 | No uniform realized or probabilistic tail enclosure | +| Ideal infinite-field truncation | [Exact Gaussian shell/theta bound](GAUSSIAN_TAIL.md), including all modes beyond64 and the normalization correction | Uniform probabilistic tail supplied for the explicitly defined ideal field | +| Coupling the stored coefficients to the ideal field | Explicit low-mode sup-norm/coefficient contract in the same proof | rho remains unknown; no full-field probability or count bound for the frozen polynomial | | Lifetime range | Larger bins exhibit numerical stability; shortest bins still drift | No certified finite-lifetime range for the leading law | | Remainder | Source-bound qualitative O(1) theorem with its hypotheses | No applicable numerical remainder constant or cutoff supplied here | | Sampling precision | Eight coupled fields, with per-field counts and paired differences | Descriptive precision only; no simultaneous confidence claim | @@ -60,7 +61,9 @@ available and **before** its fields are observed. Its specification must record: No held-out seeds have been consumed by this delivery. Assigning a sample size or a pass threshold now would conceal missing analytic inputs. The barcode computation on the certified fine dyadic grid now has exact integer -endpoints and separate connectivity checks. The next scientific inputs are a -justified model, tail and remainder budget. +endpoints and separate connectivity checks. A quantified ideal-field tail is +now available. The next scientific inputs are a certified low-mode coupling +and a numerical remainder budget; neither is supplied by a historical seed +label or an ideal-tail probability alone. The finite-polynomial derivative input is now available. The source-bound manuscript and literature work can advance in parallel without waiting for that budget. diff --git a/experiments/periodic_h0/GAUSSIAN_TAIL.md b/experiments/periodic_h0/GAUSSIAN_TAIL.md new file mode 100644 index 000000000..c07e25153 --- /dev/null +++ b/experiments/periodic_h0/GAUSSIAN_TAIL.md @@ -0,0 +1,242 @@ +# From a finite polynomial to an ideal Gaussian field + +[Evaluated bounds](results/gaussian_tail1/RESULTS.md) · +[Exact finite barcode](EXACT_H0.md) · [Remaining inputs](CONFIRMATION_READINESS.md) + +This note supplies a uniform probabilistic bound for the omitted modes of a +specified ideal Gaussian field. It also states the additional coupling needed +to apply that bound to a certified finite polynomial. The stored PCG64/NumPy +coefficients have no such coupling certificate. Their total infinite-field +barcode error therefore remains unknown. No new random samples are used. + +## 1. Exact ensemble and normalization + +Set L=24, beta=pi²/L², alpha=2 beta, and + +``` +S_c,M = sum_{j=-M}^M exp(-c j²), S_c = sum_{j in Z} exp(-c j²). +R = {(x,y) in Z² : x>0 or (x=0 and y>0)}. +R_K = {k in R : ||k||_infinity <= K}. +``` + +On one probability space let A_0 and every A_k,B_k, k in R, be independent +standard real Gaussian variables. Define + +``` +F(x) = A_0/S_alpha + + sqrt(2)/S_alpha sum_{k in R} exp(-beta |k|²) + [A_k cos(2 pi k·x/L) + B_k sin(2 pi k·x/L)]. +``` + +For each derivative order the expected sum of absolute coefficient majorants +is finite, since polynomially weighted Gaussian-decay lattice sums converge. +Tonelli's theorem gives almost-sure absolute uniform convergence of each +derivative series. The intersection over integer derivative orders still has +probability one; F has a smooth version. Finite sums and their L² limits are +centered Gaussian and have covariance + +``` +E F(x)F(y) = sum_{k in Z²} exp(-alpha |k|²) exp(2 pi i k·(x-y)/L) + / S_alpha². +``` + +This has variance one. The Fourier coefficient of +`sum_{n in Z²} exp(-|h+Ln|²/2)` is +`(2 pi/L²) exp(-2 pi²|k|²/L²)`: integrate over a period, unfold to R², +and use the Gaussian Fourier integral. Dividing the periodized covariance by +its value at zero cancels the prefactor and gives the expression above. +This is the normalized periodized Bargmann–Fock covariance. The underlying +Fourier/Poisson identity is also given in +[DLMF §1.8(iv)](https://dlmf.nist.gov/1.8.iv); no external tail theorem is used. + +Let F_K retain the DC term and modes R_K with this infinite normalization. +Let F64,K use the **same ideal Gaussian variables**, but replace S_alpha by +S_alpha,64. Thus + +``` +F_K = gamma F64,K, gamma = S_alpha,64/S_alpha in (0,1). +``` + +The mathematical comparison ensemble follows the convention in +`experiment.py`: its denominator D64 is S_alpha,64², and its complex +coefficient is `exp(-beta |k|²)(A_k-iB_k)/(sqrt(2) S_alpha,64)`. +This identification of formulas does not certify the law or numerical +accuracy of the implementation. Changing the generator's maximum cutoff +also changes how it assigns random draws to modes; equal seed labels at +different maximum cutoffs do not establish a common coefficient bank. + +## 2. A simultaneous tail event + +There are exactly 4m representatives in the shell `||k||_infinity=m`. +For each pair define R_k=sqrt(A_k²+B_k²). Integrating the two-dimensional +Gaussian density in polar coordinates gives + +``` +Pr(R_k > v) = exp(-v²/2), v >= 0. +``` + +Fix integer K>=1 and t>0. On the event E_K,t, require simultaneously + +``` +R_k <= t+j, ||k||_infinity=K+1+j, j=0,1,2,... . +``` + +The countable union bound, and `(t+j)²/2 >= t²/2+t j`, imply + +``` +Pr(E_K,t^c) + <= sum_{j>=0} 4(K+1+j) exp(-(t+j)²/2) + <= eta_K,t + := 4 exp(-t²/2) [(K+1)/(1-exp(-t)) + exp(-t)/(1-exp(-t))²]. +``` + +The permissible probability upper bound is min(1,eta_K,t). This bound does +not use independence between different tail modes; independence of tail +variables from retained variables will matter for conditional statements. + +## 3. Uniform norm on that event + +The inequality `|A cos(theta)+B sin(theta)|<=sqrt(A²+B²)` holds at every x. +The exact shell identity is + +``` +sum_{k in R, ||k||_infinity=m} exp(-beta |k|²) + = exp(-beta m²) [S_beta,m + S_beta,m-1]. +``` + +For example, subtracting full square sums gives +`S_beta,m²-S_beta,m-1² = 2 exp(-beta m²)(S_beta,m+S_beta,m-1)`; +the half-plane contains one from each equal ± pair. Therefore on E_K,t, + +``` +||F-F_K||_infinity <= tau_K,t + := sqrt(2)/S_alpha sum_{m=K+1}^infinity + (t+m-K-1) exp(-beta m²) [S_beta,m+S_beta,m-1]. +``` + +This is a uniform bound on the whole continuous torus, not a grid-point +variance calculation. It holds with probability at least 1-min(1,eta_K,t). + +## 4. Infinite remainders, including modes beyond64 + +For c>0 and M>=0, successive ratios of exp(-c j²), j>=M+1, are at most +`q_c=exp(-c(2M+3))`. Hence the **two-sided** theta remainder satisfies + +``` +0 < S_c-S_c,M <= 2 exp(-c(M+1)²)/(1-q_c) = T_c,M. +``` + +For M>=K the part of the amplitude sum above M is bounded by + +``` +U_K,t,M = 2 S_beta exp(-beta(M+1)²) + [(t+M-K)/(1-q_beta) + q_beta/(1-q_beta)²]. +``` + +Indeed m=M+1+j gives weight t+M-K+j, and the exponential ratio is at most +q_beta^j. Use S_beta,m+S_beta,m-1<=2S_beta and sum the geometric series and +its first moment. The implementation sums shells through M=64 and includes +this positive infinite remainder. It uses upper bounds for numerator terms +and a lower bound for S_alpha. Nothing sets an omitted sum to zero. + +The normalization mismatch has the separate deterministic bound + +``` +1-gamma = (S_alpha-S_alpha,64)/S_alpha + <= T_alpha,64/S_alpha,64 = delta_norm. +``` + +Computing the numerator by a remainder formula avoids subtracting nearly +equal interval enclosures. For this model the evaluated delta_norm is less +than 3×10^-64. It is a relative multiplier, not itself a sample error. + +## 5. The additional coupling premise + +Let P be a specified real finite polynomial with cutoff K<=64 and certified +norm upper bound B_P. Suppose a comparison on the same probability space +supplies the pathwise premise + +``` +||F64,K-P||_infinity <= rho. +``` + +On E_K,t, the triangle inequality and F_K=gamma F64,K give + +``` +||F-P||_infinity + <= tau_K,t + gamma rho + (1-gamma)||P||_infinity + <= tau_K,t + rho + delta_norm B_P. +``` + +A sufficient coefficient-level premise for rho is + +``` +|A_0/S_alpha,64 - c_0| + + 2 sum_{k in R_K} |exp(-beta |k|²)(A_k-i B_k)/(sqrt(2) S_alpha,64)-z_k| + <= rho, +``` + +where `P=c_0+2 Re sum z_k exp(2 pi i k·x/L)`. This is an explicit +obligation, not an assertion that rounded pseudorandom coefficients meet it. + +If an event C establishing this premise is measurable with respect to the +retained Gaussian variables and Pr(C)>0, independence gives +`Pr(E_K,t | C)=Pr(E_K,t)>=1-min(1,eta_K,t)`. If C can depend on tail variables, +that conditional conclusion is unavailable. A separate bound Pr(C^c)<=p +would instead give an unconditional success bound at least 1-p-eta_K,t by +the union bound. We supply neither C nor p for the stored polynomial. +Conditioning a fixed polynomial on rho=0 is generally conditioning on a +probability-zero event and is not justified here. + +## 6. Consequence for a genuinely coupled barcode + +Assume an exact finite barcode Q already satisfies +`d_B(D(P),Q)<=epsilon_finite`. Uniform function error gives shifted sublevel +inclusions. The q-tame matching theorem and continuous finite-polyhedron +scope used in [APPROXIMATION.md](APPROXIMATION.md) apply to both smooth +functions on the torus. On the stated coupling and tail events, + +``` +d_B(D(F),Q) <= epsilon_finite + tau_K,t + rho + delta_norm B_P. +``` + +The endpoint-safe half-open bin sandwich from that note applies with this +total error; a clean upper count still requires a>2 epsilon_total. One +essential H0 class is separate and no longest finite bar is discarded. +This is a samplewise implication. A high-probability diagram bound alone +does not control an expected bar count on the exceptional event; an +appropriate count-moment/tail argument would be an additional input. + +The C39 object is one K24 rounded polynomial and a certified 1024² dyadic +barcode. Its finite error is available and B_P<16, but rho is not. The new +certificate records both rho and the full-field diagram bound as null. +The K32 examples illustrate a possible different ideal truncation; they +are not a certificate for an uncomputed K32 sample or the historical pilot. + +## 7. Arithmetic and replay boundary + +`finite_certificate.py` supplies the existing rational Machin bounds for pi +and integer square-root bounds. In `gaussian_tail.py`, exp(-x) is enclosed +for rational 0<=x<=4096 by reducing x=2^s y with y<=1/8. The alternating +Taylor polynomial P49(y) is a lower bound and P48(y) an upper bound. +Terms decrease in magnitude. Rounding the lower endpoint down and the +upper up to denominator 2^256 preserves enclosure. Repeated squaring, +with outward rounding after each square, encloses exp(-x). Zero is exact. +All endpoints remain nonnegative. Decay bounds use the lower pi endpoint +for upper exponentials and the upper pi endpoint for lower exponentials. +Every subsequent operation uses rational endpoint monotonicity. + +The certificate includes the exact rational shell sums, positive infinite +remainders, theta enclosures and probability bounds. Decimal display values +are rounded upward. Tests include direct independent alternating sums, +half-lattice shell identities, multiplicity checks, positive omitted-tail +checks, invalid-input/cached-type controls, and rejection of invented +coupling or scientific-promotion fields. The wrapper binds the unchanged +C39 certificate, original receipt and consumed sources before adding the +new result. Exact replay checks the displayed report as well as its hashes. + +The result closes this explicit ideal-field uniform-tail calculation. +It does not certify a random-number generator, the historical FFT arrays, +a persistence intensity coefficient, an asymptotic remainder window, +weighted-Palm event identification, higher homology or dimensions, or +independent human review. No novelty or priority claim is made. diff --git a/experiments/periodic_h0/README.md b/experiments/periodic_h0/README.md index 6781e5740..36e0df8ab 100644 --- a/experiments/periodic_h0/README.md +++ b/experiments/periodic_h0/README.md @@ -9,15 +9,22 @@ derivative bounds for the rounded Fourier coefficients of the eight refinement fields. Its [results](results/certificate8/RESULTS.md) provide a certified spatial interpolation budget. A [new nodal certificate](NODAL_CERTIFICATE.md) now bounds every numerical sample of one retained field on a 128² grid and combines that -error with its spatial budget. Historical samples, computed barcode endpoints -and the infinite-field tail retain their separate open obligations. +error with its spatial budget. Historical samples retain their separate +uncertified status. A [sharper Hessian/grid certificate](HESSIAN_GRID.md) recovers cancellation between Fourier modes and evaluates a smaller spatial budget on a 1024² grid. Its [compact result](results/hessian1/RESULTS.md) defines new exact dyadic samples by deterministic replay, avoiding a million-value data file. These -samples are distinct from the historical NumPy arrays; computed barcode -endpoints and lifetime-law confirmation remain open. +samples are distinct from the historical NumPy arrays. Their +[exact integer barcode](results/exact_h0_1/RESULTS.md) now supplies deterministic +bin bounds for the frozen finite polynomial. + +A new [Gaussian tail calculation](results/gaussian_tail1/RESULTS.md) bounds +the omitted modes of the ideal full field. At cutoff24, its uniform error is +at most 0.00130835 with failure probability below 1.27×10⁻¹². Applying that +result to our stored polynomial still requires a certified coefficient +coupling; the [proof](GAUSSIAN_TAIL.md) states the missing premise explicitly. This small experiment samples a truncated version of the periodized Gaussian field on a side-24 square torus and measures finite ordinary superlevel H₀ bars using GUDHI. It accompanies the [manuscript draft](../../docs/research-translation/20260930/MANUSCRIPT.md), [statement crosswalk](../../docs/research-translation/20260930/CROSSWALK.md) and [original protocol](../../docs/research-translation/20260930/EXPERIMENT.md). It is numerical evidence about the declared discretized ensemble, not a continuum certificate or a new mathematical acceptance. @@ -100,8 +107,10 @@ majorants for the specified rounded finite polynomials are supplied. One new grid have certified nodal bounds. The latter has a sharper spatial bound; its [exact barcode and finite-field bin bounds](results/exact_h0_1/RESULTS.md) are now supplied by an integer sweep and independent connectivity verification. -The relation to ideal Gaussian coefficients, an enclosed infinite-field spectral tail, a justified finite-lifetime -asymptotic window and numerical remainder constants remain open. Marginal +The [ideal Gaussian spectral tail](GAUSSIAN_TAIL.md) is now enclosed with an +explicit probability budget. The relation of the stored coefficients to that +ideal ensemble, a justified finite-lifetime asymptotic window and numerical +remainder constants remain open. Marginal one-standard-error bars do not include these errors. The coefficient is a float64 comparison value from a separate exact enclosure. This experiment does not estimate typed contacts, weighted-Palm events or candidate-minus-elder defects, diff --git a/experiments/periodic_h0/gaussian_tail.py b/experiments/periodic_h0/gaussian_tail.py new file mode 100644 index 000000000..3b4db91a6 --- /dev/null +++ b/experiments/periodic_h0/gaussian_tail.py @@ -0,0 +1,107 @@ +"""Exact arithmetic for a specified ideal Gaussian Fourier tail, not RNG certification.""" +from fractions import Fraction as Q +from functools import lru_cache +import finite_certificate as fc + +EXP_BITS = 256 + + +def _outward(lo, hi): + scale = 1 << EXP_BITS + a, b = lo*scale, hi*scale + return Q(a.numerator//a.denominator, scale), Q(-((-b.numerator)//b.denominator), scale) + + +@lru_cache(maxsize=2048, typed=True) +def exp_neg_bounds(x): + """Enclose exp(-x); alternating Taylor then outward rounded squaring.""" + fc.require(type(x) is Q and 0 <= x <= 4096, + 'Rational exponential argument in [0,4096] required') + if x == 0: + return Q(1), Q(1) + y, shifts = x, 0 + while y > Q(1,8): + y /= 2 + shifts += 1 + term, total = Q(1), Q(1) + for j in range(1,50): + term *= -y/j + total += term + # P49 is lower; P48 = P49 - term49 is upper. Terms decrease at y<=1/8. + lo, hi = _outward(total, total-term) + for _ in range(shifts): + lo, hi = _outward(lo*lo, hi*hi) + return lo, hi + + +def theta_tail_upper(c_lower, cutoff): + """Two-sided sum over |j|>cutoff; c_lower is positive and no larger than c.""" + fc.require(type(c_lower) is Q and c_lower > 0, 'Positive rational decay required') + fc.require(type(cutoff) is int and cutoff >= 0, 'Nonnegative integer cutoff required') + first = exp_neg_bounds(c_lower*(cutoff+1)**2)[1] + ratio = exp_neg_bounds(c_lower*(2*cutoff+3))[1] + fc.require(ratio < 1, 'Decay too small for this precision') + return 2*first/(1-ratio) + + +def _theta_partial(c_lo, c_hi, cutoff): + low = high = Q(1) + for j in range(1,cutoff+1): + low += 2*exp_neg_bounds(c_hi*j*j)[0] + high += 2*exp_neg_bounds(c_lo*j*j)[1] + return low, high + + +def tail_bound(cutoff, threshold): + """Side24 planar ideal-field shell event; fixed sum through M=64.""" + fc.require(type(cutoff) is int and 1 <= cutoff <= 64, 'Integer cutoff in [1,64] required') + fc.require(type(threshold) is Q and 1 <= threshold <= 16, + 'Rational Rayleigh threshold in [1,16] required') + pi_lo, pi_hi = fc.pi_bounds() + beta_lo, beta_hi = (pi_lo/24)**2, (pi_hi/24)**2 + alpha_lo, alpha_hi = 2*beta_lo, 2*beta_hi + a_lo, a_hi = _theta_partial(alpha_lo,alpha_hi,64) + a_tail = theta_tail_upper(alpha_lo,64) + b_lo, b_hi = _theta_partial(beta_lo,beta_hi,64) + b_tail = theta_tail_upper(beta_lo,64) + # Half-plane shell sum equals exp(-beta*m²)(S_beta,m+S_beta,m-1). + b_partial = [Q(1)] + for j in range(1,65): + b_partial.append(b_partial[-1]+2*exp_neg_bounds(beta_lo*j*j)[1]) + finite = sum(((threshold+m-cutoff-1)*exp_neg_bounds(beta_lo*m*m)[1] + *(b_partial[m]+b_partial[m-1]) for m in range(cutoff+1,65)),Q(0)) + q = exp_neg_bounds(beta_lo*131)[1] + remainder = 2*(b_hi+b_tail)*exp_neg_bounds(beta_lo*65**2)[1]*( + (threshold+64-cutoff)/(1-q)+q/(1-q)**2) + factor = fc.sqrt_bounds(Q(2))[1]/a_lo + r = exp_neg_bounds(threshold)[1] + failure = 4*exp_neg_bounds(threshold**2/2)[1]*( + (cutoff+1)/(1-r)+r/(1-r)**2) + tau = _outward(Q(0),factor*(finite+remainder))[1] + eta = min(Q(1),_outward(Q(0),failure)[1]) + loss = _outward(Q(0),a_tail/a_lo)[1] + return {'side':24, 'dimension':2, 'cutoff':cutoff, 'threshold':str(threshold), + 'summation_cutoff':64, 'tail_supremum_upper':str(tau), + 'tail_supremum_decimal_up':fc.decimal_up(tau,24), + 'failure_probability_upper':str(eta), + 'failure_probability_decimal_up':fc.decimal_up(eta,24), + 'normalization_loss_upper':str(loss), + 'normalization_loss_decimal_up':fc.decimal_up(loss,76), + 'finite_shell_sum_upper':str(finite), + 'infinite_remainder_upper':str(remainder), + 'theta_alpha_64_interval':[str(a_lo),str(a_hi)], + 'theta_alpha_infinite_interval':[str(a_lo),str(a_hi+a_tail)], + 'theta_beta_infinite_interval':[str(b_lo),str(b_hi+b_tail)], + 'theta_alpha_tail_upper':str(a_tail), + 'theta_beta_tail_upper':str(b_tail)} + + +def total_error(finite_error, tail, coupling_error, normalization_loss, polynomial_norm): + """Conditional deterministic sum. None means a missing premise, never zero.""" + for value in (finite_error,tail,normalization_loss,polynomial_norm): + fc.require(type(value) is Q and value >= 0, 'Nonnegative rational budget required') + if coupling_error is None: + return None + fc.require(type(coupling_error) is Q and coupling_error >= 0, + 'Nonnegative rational coupling error required') + return finite_error+tail+coupling_error+normalization_loss*polynomial_norm diff --git a/experiments/periodic_h0/gaussian_tail_certificate.py b/experiments/periodic_h0/gaussian_tail_certificate.py new file mode 100644 index 000000000..e4351133d --- /dev/null +++ b/experiments/periodic_h0/gaussian_tail_certificate.py @@ -0,0 +1,142 @@ +"""Replay a Gaussian tail bound; keep the finite-sample coupling premise missing.""" +import argparse +import hashlib +import platform +import re +import sys +from datetime import datetime, timezone +from fractions import Fraction as Q +from pathlib import Path +import finite_certificate as fc +import gaussian_tail as gt +import exact_barcode_certificate as bc + +BASE=Path(__file__).resolve().parent +FINITE_CERT='results/exact_h0_1/CERTIFICATE.json' +FINITE_RUN='results/exact_h0_1/RUN.json' +FINITE_SHA256='845dc940e1781e570d4a6614a00889f33b239274c00e367dc2af1e3b86906fb8' +FINITE_RUN_SHA256='e51fba013218e746c6845283312cd9ac1e688a8b960e9a2c577a097be5b54c45' +SOURCE_PATHS=tuple(sorted(set(bc.SOURCE_PATHS)|{ + 'gaussian_tail.py','gaussian_tail_certificate.py','GAUSSIAN_TAIL.md', + 'experiment.py',FINITE_CERT,FINITE_RUN,'results/exact_h0_1/RUN.sha256'})) +SCOPE=('Planar side24 ideal Gaussian omitted-mode probability bound and conditional ' + 'finite-polynomial coupling contract. Historical Gaussian sampling, ' + 'coefficient coupling, lifetime-law and held-out confirmation remain uncertified.') +identity=bc.identity + + +def certify(): + fc.require(identity(BASE/FINITE_CERT)['sha256']==FINITE_SHA256, + 'Not the frozen C39 exact barcode certificate') + fc.require(identity(BASE/FINITE_RUN)['sha256']==FINITE_RUN_SHA256, + 'Not the frozen C39 exact barcode receipt') + finite=bc.validate_directory(BASE/'results/exact_h0_1') + data=fc.load_json(BASE/'results/certificate8/COEFFICIENTS.json');fc.validate(data) + row=next(r for r in data['records'] if r['seed']==finite['seed']) + norm=abs(Q(row['dc'][0]))+sum((2*fc.sqrt_bounds(Q(a)**2+Q(b)**2)[1] + for _,_,a,b in row['modes']),Q(0)) + return {'schema_version':1,'scope':SCOPE, + 'model':'normalized periodized Bargmann-Fock on (R/24Z)^2 with ideal independent standard Gaussian coefficients', + 'arithmetic':'Fraction; Machin pi128; alternating exponential with dyadic256 outward squaring', + 'tail_bounds':[gt.tail_bound(k,Q(t)) for k in (24,32) for t in (6,8)], + 'finite_object':{'source_sha256':FINITE_SHA256,'seed_label':finite['seed'], + 'cutoff':data['cutoff'],'norm_upper':str(norm), + 'norm_decimal_up':fc.decimal_up(norm,24), + 'finite_polynomial_diagram_bound':finite['finite_polynomial_diagram_bound'], + 'coupling_error':None,'infinite_field_diagram_bound':None, + 'reason':'No certified relation between the stored dyadic coefficients and ideal Gaussian low modes.'}, + 'conditional_contract':'epsilon_total <= epsilon_finite + tau + rho + normalization_loss * norm(P)', + 'historical_gaussian_draw_certified':False,'lifetime_law_certified':False, + 'new_random_fields_sampled':0} + + +def verify(cert): + fc.require(fc.canonical_bytes(cert)==fc.canonical_bytes(certify()), + 'Gaussian tail certificate differs from exact replay') + return True + + +def render_report(cert): + lines=['# A quantified omitted-mode bound', '', + 'For the **ideal normalized Gaussian field on the side-24 square torus**,', + 'the following uniform tail bounds hold outside the stated probability budget.', + 'Every mode outside the cutoff is included, including modes beyond64.', '', + '| Square cutoff K | Rayleigh threshold t | Uniform tail at most | Failure probability at most |', + '|---|---|---|---|'] + for r in cert['tail_bounds']: + lines.append(f"| {r['cutoff']} | {r['threshold']} | {r['tail_supremum_decimal_up']} | {r['failure_probability_decimal_up']} |") + lines += ['', 'The table concerns the ideal field and its coupled ideal low modes.', + 'K32 is a possible future truncation, not the stored K24 polynomial.', + 'The infinite versus mode64 normalization loss is below **3 × 10⁻⁶⁴**.', '', + 'To connect a certified finite polynomial P to this field, additionally prove', + '`||F64,K - P||∞ <= rho` for the same low-mode Gaussian coefficients.', + 'Then the existing finite barcode bound composes with the tail as', '', + '`epsilon_total <= epsilon_finite + tau + rho + normalization_loss * ||P||∞`.', '', + 'The retained seed34000 polynomial has a certified norm upper bound of', + cert['finite_object']['norm_decimal_up']+'. Its coefficient-coupling error', + '**rho is still unknown**, so no full-field error or Gaussian probability is', + 'attached to its barcode. A missing premise remains null, not zero.', '', + '[Proof and exact conventions](../../GAUSSIAN_TAIL.md) ·', + '[Exact certificate](CERTIFICATE.json) · [Source receipt](RUN.json)', '', + '```sh', + 'python -B -S experiments/periodic_h0/gaussian_tail_certificate.py --verify experiments/periodic_h0/results/gaussian_tail1', + '```', '', SCOPE, ''] + return '\n'.join(lines) + + +def verify_directory(directory): + directory=Path(directory);r=fc.load_json(directory/'RUN.json') + fc.require(type(r) is dict and set(r)=={'schema_version','utc','python','platform','sources','outputs','scope'}, + 'Invalid receipt fields') + fc.require(type(r['schema_version']) is int and r['schema_version']==1 and r['scope']==SCOPE, + 'Invalid receipt version/scope') + fc.require(type(r['utc']) is str and re.fullmatch(r'\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{6}\+00:00',r['utc']) is not None, + 'Invalid receipt UTC') + stamp=datetime.fromisoformat(r['utc']) + fc.require(stamp.tzinfo==timezone.utc and stamp.isoformat(timespec='microseconds')==r['utc'],'Invalid receipt UTC') + for key in ('python','platform'): + fc.require(type(r[key]) is str and 00,'Invalid byte count') + fc.require(type(item['sha256']) is str and re.fullmatch('[0-9a-f]{64}',item['sha256']) is not None,'Invalid hash') + fc.require((directory/'RUN.sha256').read_bytes()==(identity(directory/'RUN.json')['sha256']+'\n').encode(), 'Receipt binding mismatch') + for name in SOURCE_PATHS: + fc.require(identity(BASE/name)==r['sources'][name], 'Source binding mismatch: '+name) + fc.require(identity(directory/'CERTIFICATE.json')==r['outputs']['CERTIFICATE.json'],'Output binding mismatch') + cert=fc.load_json(directory/'CERTIFICATE.json') + verify(cert) + fc.require((directory/'RESULTS.md').read_bytes()==render_report(cert).encode(),'Report mismatch') + return True + + +def produce(directory): + directory=Path(directory);fc.require(not directory.exists(),'Output must be a new directory') + cert=certify();directory.mkdir(parents=True) + (directory/'CERTIFICATE.json').write_bytes(fc.canonical_bytes(cert)) + r={'schema_version':1,'utc':datetime.now(timezone.utc).isoformat(timespec='microseconds'), + 'python':sys.version,'platform':platform.platform(),'scope':SCOPE, + 'sources':{name:identity(BASE/name) for name in SOURCE_PATHS}, + 'outputs':{'CERTIFICATE.json':identity(directory/'CERTIFICATE.json')}} + raw=fc.canonical_bytes(r);(directory/'RUN.json').write_bytes(raw) + (directory/'RUN.sha256').write_text(hashlib.sha256(raw).hexdigest()+'\n') + (directory/'RESULTS.md').write_text(render_report(cert)) + return cert + + +def main(): + p=argparse.ArgumentParser(description=__doc__) + g=p.add_mutually_exclusive_group(required=True) + g.add_argument('--verify',type=Path);g.add_argument('--produce',type=Path) + a=p.parse_args() + if a.verify: + verify_directory(a.verify) + print('Exact ideal Gaussian tail replay passed; frozen-sample coupling remains open.') + else: + produce(a.produce) + print('Ideal tail certificate produced; no Gaussian promotion of historical fields.') + + +if __name__=='__main__':main() diff --git a/experiments/periodic_h0/results/gaussian_tail1/CERTIFICATE.json b/experiments/periodic_h0/results/gaussian_tail1/CERTIFICATE.json new file mode 100644 index 000000000..93829f89a --- /dev/null +++ b/experiments/periodic_h0/results/gaussian_tail1/CERTIFICATE.json @@ -0,0 +1 @@ +{"arithmetic":"Fraction; Machin pi128; alternating exponential with dyadic256 outward squaring","conditional_contract":"epsilon_total <= epsilon_finite + tau + rho + normalization_loss * norm(P)","finite_object":{"coupling_error":null,"cutoff":24,"finite_polynomial_diagram_bound":"665473173472810196317045055624393869657279516680804628048808122397019836469590187643850197457025387056734910895985785064585440724942132613915359133544554422505902608754010903814479448184410923565832007/627057063764139831929324851379409869378845668175598843037877190478889006888518431438644711527536922839520331484815861906173161536477065546885468336421475511783984145060592245840032548652210559519683510272","infinite_field_diagram_bound":null,"norm_decimal_up":"15.810045844661777130197921","norm_upper":"168121244410939291221773941820374436395/10633823966279326983230456482242756608","reason":"No certified relation between the stored dyadic coefficients and ideal Gaussian low modes.","seed_label":34000,"source_sha256":"845dc940e1781e570d4a6614a00889f33b239274c00e367dc2af1e3b86906fb8"},"historical_gaussian_draw_certified":false,"lifetime_law_certified":false,"model":"normalized periodized Bargmann-Fock on (R/24Z)^2 with ideal independent standard Gaussian coefficients","new_random_fields_sampled":0,"schema_version":1,"scope":"Planar side24 ideal Gaussian omitted-mode probability bound and conditional finite-polynomial coupling contract. Historical Gaussian sampling, coefficient coupling, lifetime-law and held-out confirmation remain uncertified.","tail_bounds":[{"cutoff":24,"dimension":2,"failure_probability_decimal_up":"0.000001526934246675641069","failure_probability_upper":"88403453275290005410415351767226827811864065282392457962045150463495823/57896044618658097711785492504343953926634992332820282019728792003956564819968","finite_shell_sum_upper":"45677331074603806013838586040540654578336583790694381577737938315898589618593360719167943060678307282620400211539941004145991445541195926844915396802391/6703903964971298549787012499102923063739682910296196688861780721860882015036773488400937149083451713845015929093243025426876941405973284973216824503042048","infinite_remainder_upper":"101711591883316611015761122269773517673524128886862034006844777369056920471463484133179595958370364775713303159534181462244480673773379848979123715496475431625396911460519423286158045568103247754541180517225090666520120457068127171434455765655475287549536881082419363594653187753/2007241561216543340438709874187824363336241345145539695173942081043776213276921773764699143020663593792034386467369526930253316987851736087563940882509235287427880581467520446210417534305669660457008215961709021874629458449355661030551765266743600500651679744774348562412553515117727826098627955858029412352","normalization_loss_decimal_up":"0.0000000000000000000000000000000000000000000000000000000000000002779587451663","normalization_loss_upper":"16092711912291/57896044618658097711785492504343953926634992332820282019728792003956564819968","side":24,"summation_cutoff":64,"tail_supremum_decimal_up":"0.001006390726275545712889","tail_supremum_upper":"29133021196126361494899097977789980311443047619270212399399089860272168045/28948022309329048855892746252171976963317496166410141009864396001978282409984","theta_alpha_64_interval":["554332321593373350600024254108840706006103383803036290112330901321045551104657/57896044618658097711785492504343953926634992332820282019728792003956564819968","277166160796686675300012127054420353003310961078159583485723252703691322413911/28948022309329048855892746252171976963317496166410141009864396001978282409984"],"theta_alpha_infinite_interval":["554332321593373350600024254108840706006103383803036290112330901321045551104657/57896044618658097711785492504343953926634992332820282019728792003956564819968","15866642488345514948822287109917166189529890585760564575227707880583624686153146487550614632866576995698983081529159437431046180032871144204724007254034057/1657157278531185109733539836932561951162892759631277985800368085536162558664242028767847062828797958564029102579439494837357353996878930600676915312328704"],"theta_alpha_tail_upper":"152351410708999/57245958318787628119768661194259804661057693829487610699384011710316503148831","theta_beta_infinite_interval":["195986071814778171581292044025020120923365642436094195222533177100953403500765/14474011154664524427946373126085988481658748083205070504932198000989141204992","10144456579375138153784866819779818103825808563017485582914211005997796293234814021863337165859805275261705075005914773008960731369943861816408846320519221/749190880394052593158850483257632894404024199631004870216938464022175227826665857194028016651013160307309436587919157110988679252661843930594065002790912"],"theta_beta_tail_upper":"8400259077968342958217565511545509892494133572/103522219568362241057541761681289631010436383089151934120791474661531780037897","threshold":"6"},{"cutoff":24,"dimension":2,"failure_probability_decimal_up":"0.000000000001266858537724","failure_probability_upper":"73346098425553434266788819246027600000965924973611085489593571075/57896044618658097711785492504343953926634992332820282019728792003956564819968","finite_shell_sum_upper":"59382018970958567294043876852889584779690969312822722068067788194365239029825113278576793388746368016279790914878091539901571571455009178653774463142543/6703903964971298549787012499102923063739682910296196688861780721860882015036773488400937149083451713845015929093243025426876941405973284973216824503042048","infinite_remainder_upper":"106122469900064048940081707787850392908122084489230353260690905851582111909765576124912458410881778041308559212158668016809733180270618778611441108641081563838905399456984190128701663659099045859070713945956082994605761135435887407732105517976717274810591848562357193745973564035/2007241561216543340438709874187824363336241345145539695173942081043776213276921773764699143020663593792034386467369526930253316987851736087563940882509235287427880581467520446210417534305669660457008215961709021874629458449355661030551765266743600500651679744774348562412553515117727826098627955858029412352","normalization_loss_decimal_up":"0.0000000000000000000000000000000000000000000000000000000000000002779587451663","normalization_loss_upper":"16092711912291/57896044618658097711785492504343953926634992332820282019728792003956564819968","side":24,"summation_cutoff":64,"tail_supremum_decimal_up":"0.001308340741324926085092","tail_supremum_upper":"75747753936156133106112717996919789876617604440319226513502163643830192271/57896044618658097711785492504343953926634992332820282019728792003956564819968","theta_alpha_64_interval":["554332321593373350600024254108840706006103383803036290112330901321045551104657/57896044618658097711785492504343953926634992332820282019728792003956564819968","277166160796686675300012127054420353003310961078159583485723252703691322413911/28948022309329048855892746252171976963317496166410141009864396001978282409984"],"theta_alpha_infinite_interval":["554332321593373350600024254108840706006103383803036290112330901321045551104657/57896044618658097711785492504343953926634992332820282019728792003956564819968","15866642488345514948822287109917166189529890585760564575227707880583624686153146487550614632866576995698983081529159437431046180032871144204724007254034057/1657157278531185109733539836932561951162892759631277985800368085536162558664242028767847062828797958564029102579439494837357353996878930600676915312328704"],"theta_alpha_tail_upper":"152351410708999/57245958318787628119768661194259804661057693829487610699384011710316503148831","theta_beta_infinite_interval":["195986071814778171581292044025020120923365642436094195222533177100953403500765/14474011154664524427946373126085988481658748083205070504932198000989141204992","10144456579375138153784866819779818103825808563017485582914211005997796293234814021863337165859805275261705075005914773008960731369943861816408846320519221/749190880394052593158850483257632894404024199631004870216938464022175227826665857194028016651013160307309436587919157110988679252661843930594065002790912"],"theta_beta_tail_upper":"8400259077968342958217565511545509892494133572/103522219568362241057541761681289631010436383089151934120791474661531780037897","threshold":"8"},{"cutoff":32,"dimension":2,"failure_probability_decimal_up":"0.000002015504643440881766","failure_probability_upper":"233379493531531741435709537126993445703938105468610149789455881437839737/115792089237316195423570985008687907853269984665640564039457584007913129639936","finite_shell_sum_upper":"13402824796939613478802878066308102336939132158577832229816910351102383950486040377532322484292219973745276488000175190193402564102691408018609452987/6703903964971298549787012499102923063739682910296196688861780721860882015036773488400937149083451713845015929093243025426876941405973284973216824503042048","infinite_remainder_upper":"84068079816326859318478780197466016735132306477388756991460263438956154718255116166248146148324711713332278949036235243983470647784424130449854142918050902771362959474660355915983573204120055336423046802301121354177557743597086226243856756370507338505317011162668042989371682625/2007241561216543340438709874187824363336241345145539695173942081043776213276921773764699143020663593792034386467369526930253316987851736087563940882509235287427880581467520446210417534305669660457008215961709021874629458449355661030551765266743600500651679744774348562412553515117727826098627955858029412352","normalization_loss_decimal_up":"0.0000000000000000000000000000000000000000000000000000000000000002779587451663","normalization_loss_upper":"16092711912291/57896044618658097711785492504343953926634992332820282019728792003956564819968","side":24,"summation_cutoff":64,"tail_supremum_decimal_up":"0.000000295299183735264832","tail_supremum_upper":"8548327358695104150817239788651955465950910065083983088967594088172813/28948022309329048855892746252171976963317496166410141009864396001978282409984","theta_alpha_64_interval":["554332321593373350600024254108840706006103383803036290112330901321045551104657/57896044618658097711785492504343953926634992332820282019728792003956564819968","277166160796686675300012127054420353003310961078159583485723252703691322413911/28948022309329048855892746252171976963317496166410141009864396001978282409984"],"theta_alpha_infinite_interval":["554332321593373350600024254108840706006103383803036290112330901321045551104657/57896044618658097711785492504343953926634992332820282019728792003956564819968","15866642488345514948822287109917166189529890585760564575227707880583624686153146487550614632866576995698983081529159437431046180032871144204724007254034057/1657157278531185109733539836932561951162892759631277985800368085536162558664242028767847062828797958564029102579439494837357353996878930600676915312328704"],"theta_alpha_tail_upper":"152351410708999/57245958318787628119768661194259804661057693829487610699384011710316503148831","theta_beta_infinite_interval":["195986071814778171581292044025020120923365642436094195222533177100953403500765/14474011154664524427946373126085988481658748083205070504932198000989141204992","10144456579375138153784866819779818103825808563017485582914211005997796293234814021863337165859805275261705075005914773008960731369943861816408846320519221/749190880394052593158850483257632894404024199631004870216938464022175227826665857194028016651013160307309436587919157110988679252661843930594065002790912"],"theta_beta_tail_upper":"8400259077968342958217565511545509892494133572/103522219568362241057541761681289631010436383089151934120791474661531780037897","threshold":"6"},{"cutoff":32,"dimension":2,"failure_probability_decimal_up":"0.000000000001672247828251","failure_probability_upper":"96816534877873480473111175805366090386463620476105723014695168187/57896044618658097711785492504343953926634992332820282019728792003956564819968","finite_shell_sum_upper":"17561746199683764025028322416029685968919964462436658447774888991852557889872360514076688223430559400272559657018405643020745924648217889963603637811/6703903964971298549787012499102923063739682910296196688861780721860882015036773488400937149083451713845015929093243025426876941405973284973216824503042048","infinite_remainder_upper":"88478957833074297242799365715542891969730262079757076245306391921481346156557208157981008600836124978927535001660721798548723154281663060082171536062657034984871447471125122758527191295115853440952580231032113682263198421964846462541506508691749325766371978642605873140692058907/2007241561216543340438709874187824363336241345145539695173942081043776213276921773764699143020663593792034386467369526930253316987851736087563940882509235287427880581467520446210417534305669660457008215961709021874629458449355661030551765266743600500651679744774348562412553515117727826098627955858029412352","normalization_loss_decimal_up":"0.0000000000000000000000000000000000000000000000000000000000000002779587451663","normalization_loss_upper":"16092711912291/57896044618658097711785492504343953926634992332820282019728792003956564819968","side":24,"summation_cutoff":64,"tail_supremum_decimal_up":"0.000000386931068360802819","tail_supremum_upper":"44803556796324173087110504811899132320673986243015762883521385119224301/115792089237316195423570985008687907853269984665640564039457584007913129639936","theta_alpha_64_interval":["554332321593373350600024254108840706006103383803036290112330901321045551104657/57896044618658097711785492504343953926634992332820282019728792003956564819968","277166160796686675300012127054420353003310961078159583485723252703691322413911/28948022309329048855892746252171976963317496166410141009864396001978282409984"],"theta_alpha_infinite_interval":["554332321593373350600024254108840706006103383803036290112330901321045551104657/57896044618658097711785492504343953926634992332820282019728792003956564819968","15866642488345514948822287109917166189529890585760564575227707880583624686153146487550614632866576995698983081529159437431046180032871144204724007254034057/1657157278531185109733539836932561951162892759631277985800368085536162558664242028767847062828797958564029102579439494837357353996878930600676915312328704"],"theta_alpha_tail_upper":"152351410708999/57245958318787628119768661194259804661057693829487610699384011710316503148831","theta_beta_infinite_interval":["195986071814778171581292044025020120923365642436094195222533177100953403500765/14474011154664524427946373126085988481658748083205070504932198000989141204992","10144456579375138153784866819779818103825808563017485582914211005997796293234814021863337165859805275261705075005914773008960731369943861816408846320519221/749190880394052593158850483257632894404024199631004870216938464022175227826665857194028016651013160307309436587919157110988679252661843930594065002790912"],"theta_beta_tail_upper":"8400259077968342958217565511545509892494133572/103522219568362241057541761681289631010436383089151934120791474661531780037897","threshold":"8"}]} diff --git a/experiments/periodic_h0/results/gaussian_tail1/RESULTS.md b/experiments/periodic_h0/results/gaussian_tail1/RESULTS.md new file mode 100644 index 000000000..4fc6c7f12 --- /dev/null +++ b/experiments/periodic_h0/results/gaussian_tail1/RESULTS.md @@ -0,0 +1,36 @@ +# A quantified omitted-mode bound + +For the **ideal normalized Gaussian field on the side-24 square torus**, +the following uniform tail bounds hold outside the stated probability budget. +Every mode outside the cutoff is included, including modes beyond64. + +| Square cutoff K | Rayleigh threshold t | Uniform tail at most | Failure probability at most | +|---|---|---|---| +| 24 | 6 | 0.001006390726275545712889 | 0.000001526934246675641069 | +| 24 | 8 | 0.001308340741324926085092 | 0.000000000001266858537724 | +| 32 | 6 | 0.000000295299183735264832 | 0.000002015504643440881766 | +| 32 | 8 | 0.000000386931068360802819 | 0.000000000001672247828251 | + +The table concerns the ideal field and its coupled ideal low modes. +K32 is a possible future truncation, not the stored K24 polynomial. +The infinite versus mode64 normalization loss is below **3 × 10⁻⁶⁴**. + +To connect a certified finite polynomial P to this field, additionally prove +`||F64,K - P||∞ <= rho` for the same low-mode Gaussian coefficients. +Then the existing finite barcode bound composes with the tail as + +`epsilon_total <= epsilon_finite + tau + rho + normalization_loss * ||P||∞`. + +The retained seed34000 polynomial has a certified norm upper bound of +15.810045844661777130197921. Its coefficient-coupling error +**rho is still unknown**, so no full-field error or Gaussian probability is +attached to its barcode. A missing premise remains null, not zero. + +[Proof and exact conventions](../../GAUSSIAN_TAIL.md) · +[Exact certificate](CERTIFICATE.json) · [Source receipt](RUN.json) + +```sh +python -B -S experiments/periodic_h0/gaussian_tail_certificate.py --verify experiments/periodic_h0/results/gaussian_tail1 +``` + +Planar side24 ideal Gaussian omitted-mode probability bound and conditional finite-polynomial coupling contract. Historical Gaussian sampling, coefficient coupling, lifetime-law and held-out confirmation remain uncertified. diff --git a/experiments/periodic_h0/results/gaussian_tail1/RUN.json b/experiments/periodic_h0/results/gaussian_tail1/RUN.json new file mode 100644 index 000000000..551f454fe --- /dev/null +++ b/experiments/periodic_h0/results/gaussian_tail1/RUN.json @@ -0,0 +1 @@ +{"outputs":{"CERTIFICATE.json":{"bytes":15004,"sha256":"9284099183648476bbceb6ddc6cd54bb212713402b1b8c15a8684e237587c960"}},"platform":"macOS-15.7.4-arm64-arm-64bit","python":"3.11.16 (main, Sep 1 2026, 14:08:22) [Clang 22.1.3 ]","schema_version":1,"scope":"Planar side24 ideal Gaussian omitted-mode probability bound and conditional finite-polynomial coupling contract. Historical Gaussian sampling, coefficient coupling, lifetime-law and held-out confirmation remain uncertified.","sources":{"APPROXIMATION.md":{"bytes":17970,"sha256":"dae4e01b35602077442796a1150294cce3eb544f2d0c2297f8fa7aa6ab16caef"},"EXACT_H0.md":{"bytes":14491,"sha256":"a788b46b1ea5640661e2692b84816bb3acfd1bae5a1fd3083dd18d5d8ba19fff"},"FINITE_CERTIFICATE.md":{"bytes":9966,"sha256":"4c9991db82a94725a893526cf310bd84221b7787e704b649a94e161591efa7aa"},"GAUSSIAN_TAIL.md":{"bytes":9791,"sha256":"7a0ddc8d390dbc2b06e90731a49be8d4f36d6b8614168c17a05e9bdf818c8807"},"HESSIAN_GRID.md":{"bytes":8683,"sha256":"a6e7053da42e10f7fdf637c66e4948e62136e26e80a2d0d80bde9b822d052225"},"NODAL_CERTIFICATE.md":{"bytes":8477,"sha256":"6b39f935c66a129dc3661f464586912bc034bd46a47a8f96a9a3167c26601940"},"exact_barcode_certificate.py":{"bytes":10590,"sha256":"986da88dd703b4598ebf7782f874854124272ef6dbf67d7deb130972a86a217b"},"exact_h0.py":{"bytes":9089,"sha256":"48ee16f2316cb1a233594ed10466340aa321d553c2b888198fe86b4bd9052970"},"experiment.py":{"bytes":7020,"sha256":"affcefd3e3e0c44dbd312be25a5e8294ea270a9287db22fdc018d7aad99cb733"},"finite_certificate.py":{"bytes":14843,"sha256":"0674a2621dff6c040cbb24cc0b6e6df7847541ebc171ebdb28070afa05e04e6b"},"gaussian_tail.py":{"bytes":4688,"sha256":"07e55a62ed0bb6da6a9395762e2e0c033126f83b46abd48db4c24df710779db8"},"gaussian_tail_certificate.py":{"bytes":8456,"sha256":"a6855f836f04fe43aa3837f9d517237f09c0b886db3abb38a56fc3734d565631"},"hessian_grid_certificate.py":{"bytes":10447,"sha256":"3cc56eff4bfc3e648ad9ac74917db819288b606f7eddc5af5c24f8b835467690"},"hessian_grid_core.py":{"bytes":4304,"sha256":"0cd8cc11fc8c87893400b56153a5c8ce3e5aea9ec9e97df95b699a823aedc119"},"nodal_core.py":{"bytes":6388,"sha256":"a9b326664bb9f9fb9983491566cbf2030eaa0533f776ccd7a4f64ba809cc7b7e"},"results/certificate8/COEFFICIENTS.json":{"bytes":857299,"sha256":"f9703c9098bff546efda6eb8da6f012ac0e8f23b84b48cb2d997562d235faf71"},"results/exact_h0_1/CERTIFICATE.json":{"bytes":7635,"sha256":"845dc940e1781e570d4a6614a00889f33b239274c00e367dc2af1e3b86906fb8"},"results/exact_h0_1/RUN.json":{"bytes":2297,"sha256":"e51fba013218e746c6845283312cd9ac1e688a8b960e9a2c577a097be5b54c45"},"results/exact_h0_1/RUN.sha256":{"bytes":65,"sha256":"3d51e65e03a26bd2017a00ee601e4844e604c30bfb1795573b0fd8eec7fa44d5"},"results/hessian1/CERTIFICATE.json":{"bytes":25301,"sha256":"c46cfc061465b951968f675270b649cd6b61c1dc4989635a1c3c7a3f7a564519"},"results/hessian1/RUN.json":{"bytes":1573,"sha256":"3bea8119b5fc3b8aadf887b439d3032f7d88377771c338db44e320dfc60979e1"},"results/hessian1/RUN.sha256":{"bytes":65,"sha256":"ad4536f2bcfc15863af27f7f26176c30973beb4a87efaee95ca34410a0e7bb4b"}},"utc":"2026-10-01T00:01:36.180872+00:00"} diff --git a/experiments/periodic_h0/results/gaussian_tail1/RUN.sha256 b/experiments/periodic_h0/results/gaussian_tail1/RUN.sha256 new file mode 100644 index 000000000..86386896a --- /dev/null +++ b/experiments/periodic_h0/results/gaussian_tail1/RUN.sha256 @@ -0,0 +1 @@ +2bab16d8bb51c55f599d30ff119aba57bf31d24bcb5ce1192658e085a25a199c diff --git a/experiments/periodic_h0/test_gaussian_tail.py b/experiments/periodic_h0/test_gaussian_tail.py new file mode 100644 index 000000000..d90b5649e --- /dev/null +++ b/experiments/periodic_h0/test_gaussian_tail.py @@ -0,0 +1,81 @@ +"""Independent exact series, shell and scope controls for the Gaussian tail.""" +import importlib +import importlib.util +import unittest +from fractions import Fraction as Q +from math import factorial + + +class GaussianTailTests(unittest.TestCase): + def setUp(self): + self.assertIsNotNone(importlib.util.find_spec('gaussian_tail'), + 'Gaussian spectral-tail module is not implemented') + self.mod = importlib.import_module('gaussian_tail') + + def test_exponential_direct_series_enclosures(self): + # Independent, unreduced alternating series for inputs <=1. + for x in (Q(0), Q(1,1000), Q(1,8), Q(1,2), Q(1)): + lo, hi = self.mod.exp_neg_bounds(x) + lower = sum(((-x)**j/Q(factorial(j)) for j in range(120)), Q(0)) + upper = lower + x**120/Q(factorial(120)) + self.assertLessEqual(lo, lower) + self.assertGreaterEqual(hi, upper) + self.assertLess(hi-lo, Q(1,10**70)) + self.assertEqual(self.mod.exp_neg_bounds(Q(0)), (Q(1),Q(1))) + + def test_reduction_semigroup_and_tiny_values(self): + for x in (Q(3,2), Q(9), Q(70), Q(145)): + lo, hi = self.mod.exp_neg_bounds(x) + a,b = self.mod.exp_neg_bounds(x/2) + self.assertLessEqual(lo,b*b) + self.assertGreaterEqual(hi,a*a) + self.assertGreater(lo, 0) + self.assertLessEqual(hi,1/(1+x)) + lo,hi = self.mod.exp_neg_bounds(Q(145)) + self.assertLess(hi,Q(1,10**62)) + self.assertGreater(lo,Q(1,10**64)) + + def test_exponential_invalid_inputs(self): + for x in (True, 1, .5, '1/2', Q(-1)): + with self.subTest(x=x), self.assertRaises(ValueError): + self.mod.exp_neg_bounds(x) + + def test_half_lattice_shell_identity_and_probability_multiplicity(self): + # Exact toy weights q^(x²+y²): counts and identity do not depend on exp. + q = Q(1,2) + for m in range(1,9): + half = [(x,y) for x in range(m+1) for y in range(-m,m+1) + if (x>0 or y>0) and max(x,abs(y))==m] + self.assertEqual(len(half),4*m) + s = lambda n: sum((q**(j*j) for j in range(-n,n+1)),Q(0)) + self.assertEqual(sum((q**(x*x+y*y) for x,y in half),Q(0)), + q**(m*m)*(s(m)+s(m-1))) + p = self.mod.tail_bound(24,Q(8)) + e = self.mod.exp_neg_bounds(Q(32))[0] + # Even the first shell already contains 100 Rayleigh events. + self.assertGreaterEqual(Q(p['failure_probability_upper']),100*e) + self.assertLess(Q(p['failure_probability_upper']),Q(13,10**13)) + self.assertGreater(Q(p['tail_supremum_upper']),Q(0)) + self.assertGreater(Q(p['infinite_remainder_upper']),Q(0)) + + def test_theta_tail_excludes_no_infinite_modes(self): + for c in (Q(1,32),Q(1,3),Q(1)): + for m in (0,3,24): + b = self.mod.theta_tail_upper(c,m) + # Finite partial tail is a strict lower bound on the true tail. + lower = 2*sum((self.mod.exp_neg_bounds(c*j*j)[0] + for j in range(m+1,m+12)),Q(0)) + self.assertGreaterEqual(b,lower) + with self.assertRaises(ValueError): self.mod.tail_bound(True,Q(8)) + with self.assertRaises(ValueError): self.mod.tail_bound(24,8) + with self.assertRaises(ValueError): self.mod.tail_bound(24,Q(0)) + + def test_missing_coupling_never_becomes_zero_error(self): + self.assertIsNone(self.mod.total_error(Q(1),Q(2),None,Q(3),Q(4))) + self.assertEqual(self.mod.total_error(Q(1),Q(2),Q(5),Q(3),Q(4)),Q(20)) + for invalid in (True,'0',0.,Q(-1)): + with self.subTest(value=invalid), self.assertRaises(ValueError): + self.mod.total_error(Q(1),Q(2),invalid,Q(3),Q(4)) + + +if __name__ == '__main__': unittest.main() diff --git a/experiments/periodic_h0/test_gaussian_tail_certificate.py b/experiments/periodic_h0/test_gaussian_tail_certificate.py new file mode 100644 index 000000000..c83f12acc --- /dev/null +++ b/experiments/periodic_h0/test_gaussian_tail_certificate.py @@ -0,0 +1,48 @@ +"""Receipt and scientific-boundary controls for a probabilistic tail result.""" +import copy +import importlib +import importlib.util +import tempfile +import unittest +from fractions import Fraction as Q +from pathlib import Path +import finite_certificate as fc + + +class GaussianTailCertificateTests(unittest.TestCase): + def setUp(self): + self.assertIsNotNone(importlib.util.find_spec('gaussian_tail_certificate'), + 'Tail certificate wrapper is not implemented') + self.mod=importlib.import_module('gaussian_tail_certificate') + + def test_frozen_finite_object_is_not_probabilistically_promoted(self): + c=self.mod.certify() + self.assertEqual(len(c['tail_bounds']),4) + self.assertEqual(c['finite_object']['cutoff'],24) + self.assertEqual(c['finite_object']['seed_label'],34000) + self.assertIsNone(c['finite_object']['coupling_error']) + self.assertIsNone(c['finite_object']['infinite_field_diagram_bound']) + self.assertFalse(c['historical_gaussian_draw_certified']) + self.assertFalse(c['lifetime_law_certified']) + self.assertLess(Q(c['tail_bounds'][0]['normalization_loss_upper']),Q(3,10**64)) + for key,value in [('historical_gaussian_draw_certified',True),('lifetime_law_certified',True)]: + altered=copy.deepcopy(c);altered[key]=value + with self.assertRaises(ValueError):self.mod.verify(altered) + altered=copy.deepcopy(c);altered['finite_object']['coupling_error']='0' + with self.assertRaises(ValueError):self.mod.verify(altered) + + def test_new_directory_and_receipt_bindings(self): + with tempfile.TemporaryDirectory() as tmp: + d=Path(tmp)/'new';self.mod.produce(d) + self.assertTrue(self.mod.verify_directory(d)) + with self.assertRaises(ValueError):self.mod.produce(d) + c=fc.load_json(d/'CERTIFICATE.json');c['tail_bounds'][0]['tail_supremum_upper']='0' + (d/'CERTIFICATE.json').write_bytes(fc.canonical_bytes(c)) + # Rebinding a falsified output in the outer receipt is still rejected. + r=fc.load_json(d/'RUN.json');r['outputs']['CERTIFICATE.json']=self.mod.identity(d/'CERTIFICATE.json') + (d/'RUN.json').write_bytes(fc.canonical_bytes(r)) + (d/'RUN.sha256').write_text(self.mod.identity(d/'RUN.json')['sha256']+'\n') + with self.assertRaises(ValueError):self.mod.verify_directory(d) + + +if __name__=='__main__':unittest.main()