This method accompanies section 5.3 of the particle-geometry case. The sole observed anchor is the electron. All ten other included masses are scored, and absolute and ratio constraints form one joint event. The reported quantities are retrospective reference-distribution coverage under the fixed prescription.

1. The question and the retained model

An approximate numerical formula can match some masses much more tightly than others. This test preserves each achieved accuracy separately. Ratios add another distinction. If two predictions have similar signed offsets, much of their common offset cancels in the ratio. Allowing those two errors to move independently to opposite sides of their absolute bands can spoil the ratio even though both absolute tests still pass.

This calculation therefore asks one joint question: how much of a declared reference distribution satisfies every individual absolute-accuracy bound and every within-family ratio-accuracy bound, under at least one permitted complete placement and jointly chosen integer tuple? The same masses enter both kinds of bound, so their acceptance regions are integrated together. Their probabilities are never multiplied as independent evidence.

The maintained count and mass prediction are

C(n,d)=(n+d−1d),P(n,d)=meadC(n,d),n≥1,(1) C(n,d)=\binom{n+d-1}{d},\qquad P(n,d)=m_e a_d C(n,d),\qquad n\ge1, \tag{1} (a2,a3,a4,a6,a10)=(2890,327,48/715,118564,118564).(2) (a_2,a_3,a_4,a_6,a_{10})= \left(\sqrt{2890},\sqrt{32\sqrt7}, \frac{\sqrt{48/\sqrt7}}{15},\frac1{18564},\frac1{18564}\right). \tag{2}

The dimensionless coefficients and reference counts are fixed throughout. In the equivalent sector-coefficient notation,

g22=1445/2,g33=87,g44=12/7,g66=g10,10=1/4, g_{22}=1445/2,\quad g_{33}=8\sqrt7,\quad g_{44}=12/\sqrt7,\quad g_{66}=g_{10,10}=1/4, μd=meCd⋆gdd/g66,(C2⋆,C3⋆,C4⋆,C6⋆)=(1,1,15,18564),μ10=μ6.(3) \mu_d=\frac{m_e}{C_d^\star}\sqrt{g_{dd}/g_{66}},\quad (C_2^\star,C_3^\star,C_4^\star,C_6^\star)=(1,1,15,18564),\quad \mu_{10}=\mu_6. \tag{3}

The last equality retains the shared charged-lepton fundamental. It is a separate premise about the common kind and normalization, not a consequence of equal g coefficients alone. The coefficient law remains a maintained numerical proposal whose physical derivation is open.

The blocks W/Z/Higgs, down/strange, up/charm/top, electron/muon and tau must occupy distinct permitted depths. All 120 permutations over {2,3,4,6,10} are considered before imposing the exact electron reference and common lepton scale. These equations force electron/muon to depth six with n_e=13 and tau to depth ten. At the other depths the exact electron equation has no positive integer solution. The remaining admissible placements are the six permutations of the first three blocks over depths two, three and four. This is the maintained explicit alternative rule; no new rule for moving coefficients or refitting scales is invented.

All ten nonanchor masses, including W, down and up, remain randomized scored targets. No extra anchor is introduced. Bottom retains its unresolved ordinary-integer exception and is not scored. Neutrino absolute masses require a separate calibration and are also outside this test. A massless photon does not enter positive-mass logarithms. These exclusions state the present empirical scope; they are not additional successes.

The physical project still uses one field on infinite-dimensional physical spacetime, with matter occupying up to ten spatial directions and all remaining directions unbound for every particle. The mass-list integration below is statistical bookkeeping, not a new physical manifold or a probability law for electron position. The deterministic electron trajectories and absence of mediator particles are unchanged. No physical amplitude is fitted.

2. Exact empirical inputs and the observed bounds

The calculation retains the archived central values in the new particle-geometry case. It does not silently replace them with a later empirical compilation. The mass and quoted-error inputs in data.json are identical to those already checked against the 2024 PDG boson, lepton and quark summaries.

Label Archived mass, MeV/c² Quoted half-width, MeV/c² Maintained (d,n)
Electron, fixed 0.51099895000 0.00000000015 (6,13)
W 80369.2 13.3 (2,76)
Z 91188.0 2.0 (2,81)
Higgs 125200.0 110.0 (2,95)
Down 4.70 0.07 (3,1)
Strange 93.5 0.8 (3,4)
Up 2.16 0.07 (4,3)
Charm 1273.0 4.6 (4,20)
Top 172570.0 290.0 (4,72)
Muon 105.6583755 0.0000023 (6,35)
Tau 1776.93 0.09 (10,23)

The light-quark values are MS-bar parameters at 2 GeV; charm is the MS-bar value at its own mass scale. Those quark half-widths are quoted at 90% confidence. The top value is the direct event-kinematic average. This is not a set of identical, independent Gaussian rest-mass measurements, and no such likelihood is constructed.

For each nonanchor label, define its signed logarithmic residual under the maintained assignment:

ri=log⁡(Pi∗/Mi),δi=∣ri∣,ηij=∣rj−ri∣.(4) r_i=\log(P_i^*/M_i),\qquad \delta_i=|r_i|,\qquad \eta_{ij}=|r_j-r_i|. \tag{4}

A positive r means that the formula prediction is too high; a negative r means it is too low. The absolute bound delta preserves that mass's achieved proximity. The ratio bound eta preserves the achieved proximity of P_j/P_i to M_j/M_i, because the logarithmic ratio residual is r_j−r_i.

The primary bounds use these actual central residuals without uncertainty floors. Published errors are documented to explain empirical meaning; they are not silently substituted by max(residual,error). This choice evaluates the achieved numerical accuracies. It should not be confused with claiming that all predictions agree within experimental errors. Some central offsets are much larger than their quoted errors, while a central coincidence can also be tighter than a measurement's precision.

The independent chain widths used in the integration are shown below. The first width in each block is an absolute bound; the others are adjacent ratio bounds. All values are dimensionless logarithmic errors.

Label Absolute bound delta_i Chain coordinate and half-width
W 0.0001234313639 e_W: 0.0001234313639
Z 0.0004607798971 e_Z − e_W: 0.0003373485332
H 0.0005283118385 e_H − e_Z: 6.753194134e-05
down 0.0003952363726 e_down: 0.0003952363726
strange 0.005728582348 e_strange − e_down: 0.005333345975
up 0.007627002919 e_up: 0.007627002919
charm 0.009290975172 e_charm − e_up: 0.001663972253
top 0.02175172983 e_top − e_charm: 0.01246075466
muon 1.730021744e-05 e_muon: 1.730021744e-05
tau 0.0006441478765 e_tau − e_muon: 0.000626847659

Full high-precision signed residuals, absolute bounds and pair bounds are saved in thresholds.json. Rounded values in prose do not define the numerical acceptance test.

3. The joint event, including all allowed rungs

Let x_i=log(M_i^reference/m_e). For a candidate placement pi and index tuple n, write

si=log⁡(adiC(ni,di)),ei=si−xi.(5) s_i=\log\bigl(a_{d_i}C(n_i,d_i)\bigr),\qquad e_i=s_i-x_i. \tag{5}

A reference spectrum passes exactly when there exists one complete admissible placement and one joint rung tuple for which

∣ei∣≤δifor every nonanchor label,∣ej−ei∣≤ηijfor every within-family pair.(6) |e_i|\le\delta_i\quad\hbox{for every nonanchor label}, \qquad |e_j-e_i|\le\eta_{ij}\quad\hbox{for every within-family pair}. \tag{6}

The electron residual is zero. Its ratios with muon and tau duplicate their respective absolute constraints; they are not counted a second time. Tau/muon provides a further joint strip. The boson triple and up-type triple retain all their pair strips, including the algebraically dependent long ratios. Redundancy in one joint event is harmless; multiplying redundant probabilities would not be.

All allowed indices are available in both actual and reference comparisons. Repeated indices are permitted, consistently with the maintained conservative alternative class. Independent nearest-rung choices are insufficient for this event. A non-nearest choice can be inside its absolute band and preserve a ratio that the nearest choice spoils. The algorithm counts every jointly admissible tuple, including overlapping bands and non-nearest choices.

The maintained observed tuple satisfies equation (6) by construction, generally on its boundary. The inherited exact nearest-rung certificates show it uniquely minimizes each individual absolute error at its maintained depth, while the fixed prescription excludes different complete placements at those achieved absolute accuracies. This does not establish that the observed thresholds were chosen independently of the data.

3.1 An exact simplification specific to this residual vector

The actual W/Z/Higgs, down/strange and up/charm/top residuals are positive and increase in their mass order. The muon/tau residuals are negative with increasing magnitude. These sign and order facts are checked numerically at high precision, rather than assumed for a generic spectrum.

For a block listed in its mass order, define independent integration coordinates

z1=e1,z2=e2−e1,z3=e3−e2when the block has three members,(7) z_1=e_1,\qquad z_2=e_2-e_1,\qquad z_3=e_3-e_2\quad\hbox{when the block has three members}, \tag{7}

with half-widths

h1=δ1,h2=η12,h3=η23.(8) h_1=\delta_1,\qquad h_2=\eta_{12},\qquad h_3=\eta_{23}. \tag{8}

For these actual residuals, equation (6) is exactly equivalent to |z_j|≤h_j. The short strips are already required by (6). Conversely, their half-widths telescope: h_1+h_2=delta_2 and h_1+h_2+h_3=delta_3. Triangle inequalities then recover every absolute bound and every longer pair strip. The same argument works for the negative lepton residuals because the bounds are absolute differences.

The transformation is triangular with determinant one. Thus a fixed placement/rung tuple gives a translated acceptance box with volume

V=∏j=110(2hj)=1.0409457956707493×10−29(9) V=\prod_{j=1}^{10}(2h_j) =1.0409457956707493\times10^{-29} \tag{9}

in the ten logarithmic integration variables. These are one numerical coordinate per scored mass, not ten added physical dimensions. Using this volume alone would still overcount overlaps and ignore the allowed window and ordering; those are handled next.

4. Reference distribution and certified index domains

Keep the electron fixed. Draw the ten nonanchor log mass ratios independently on [0,L], L=log R, then sort within WZH, down/strange, up/charm/top and the muon/tau pair. The resulting density on the ordered domain D is

ρ(x)=3! 2! 3! 2!L10 1D(x)=144L101D(x).(10) \rho(x)=\frac{3!\,2!\,3!\,2!}{L^{10}}\,\mathbf1_D(x) =\frac{144}{L^{10}}\mathbf1_D(x). \tag{10}

Here D imposes 0≤x_i≤L and the six adjacent within-block ordering inequalities. Cross-family ordering is not imposed. This is a declared comparison ensemble, not a physical prediction for the distribution of masses or an exhaustive model of all alternatives to IDWT.

Three branches were declared before the calculation:

  1. R=10^6 with the historical index cap n≤100.
  2. R=10^6 with every rung whose absolute band intersects the window.
  3. R=10^7 with every such rung.

The cap of 100 is historical and post hoc, without a demonstrated physical selection mechanism. For complete-window branches, label i at depth d can contribute only if

−δi≤log⁡(adC(n,d))≤L+δi.(11) -\delta_i\le\log(a_d C(n,d))\le L+\delta_i. \tag{11}

Strict monotonicity gives finite lower and upper index limits. The code finds them individually for every permitted label/depth pair. The largest required upper limits are 194 and 616 in the two windows. These are completeness bounds for the stated event and mass windows, not claims that arbitrary finite caps exhaust an unspecified infinite problem.

There are no new coefficient choices for other depths. Depth five lacks an independently supplied absolute unit in this prescription; adding one or changing a family scale would change the test. The independent geometric depth selector is not multiplied into the numerical coverage.

5. Direct integration of the rare union

Sampling arbitrary reference spectra until a fraction near 10^-20 passes would be infeasible. Instead, sample directly from the component acceptance boxes and correct for how often their union is counted. This is importance sampling: the sampling distribution is chosen to visit the region being measured, with its density accounted for exactly.

For each placement pi and label, retain its list of all rungs satisfying (11) and the branch's cap. Let Q_pi be the product of the ten list sizes and Q=sum_pi Q_pi. Every tuple's untruncated box has volume V. Choose pi with probability Q_pi/Q, choose its ten rung indices uniformly from their lists, and draw each z_j uniformly from [−h_j,h_j]. Recover the residuals by cumulative sums within each block and set x_i=s_i−e_i.

At any point x, let K(x) be the number of all component boxes that contain it, summed over every admissible placement and rung tuple. The sampling density is K(x)/(QV). Therefore the desired union coverage is exactly

p=144QVL10E ⁣[1D(X)K(X)].(12) p=\frac{144QV}{L^{10}} \mathbb E\!\left[\frac{\mathbf1_D(X)}{K(X)}\right]. \tag{12}

Points outside the mass window or prescribed ordering contribute zero. Points covered by several tuples receive weight 1/K, so they are not counted several times. The same correction handles overlap between different assignments. This is not a Poisson approximation or an assumption that fitting events are independent.

5.1 Counting every containing tuple

For each family, find every first-label rung inside its absolute band. For each such residual, find every second-label rung within the required adjacent residual-difference strip. For three-member blocks, count every third-label rung in its strip relative to each second residual. Binary searches on increasing rung centers make these path counts efficient.

Multiply the four family counts within each fixed placement, then sum across the six placements. This gives K exactly for the stated finite rung lists, subject to the explicitly tested numerical comparisons. Small controls compare it with direct enumeration of all rung tuples and all pair constraints. No nearest-rung shortcut is used.

The actual sampled multiplicities reached 2, 6 and 41 in the three branches, respectively. Thus overlap correction is material, particularly in the wider window. A saved actual reference example in the n≤100 branch admits a depth-two up-family tuple (6,81,97), while no complete assignment using its independently nearest rungs satisfies the full joint event. The corresponding log mass list and all ten jointly feasible indices are retained in results.json for direct checking.

6. Sampling uncertainty and numerical arithmetic

Each branch uses a fixed one million component-box draws, with seeds 2026103101, 2026103102 and 2026103103. The sample budget is not stopped or changed when a desired probability appears.

Two estimates are retained. The weighted mean of I_D/K directly estimates equation (12). A second estimate independently thins each in-domain draw with probability 1/K. These thinned indicators are Bernoulli trials with success probability theta=E[I_D/K], enabling a simple finite-sample concentration bound.

For observed success fraction q and trial value theta, define the Bernoulli divergence

D(q∥θ)=qlog⁡(q/θ)+(1−q)log⁡((1−q)/(1−θ)).(13) D(q\Vert\theta)=q\log(q/\theta) +(1-q)\log\bigl((1-q)/(1-\theta)\bigr). \tag{13}

Inverting N D(q||theta)≤log(2/alpha), with alpha=0.01/3 for each fixed run, gives conservative Chernoff intervals. Their simultaneous sampling coverage is at least 99% across the three declared branches by a union bound. This is a statistical sampling guarantee for the fixed event, not a statement about empirical mass uncertainties or historical model selection. The interval is constructed from the thinned Bernoulli estimator; the lower-variance weighted estimate is also displayed but is not assigned an unjustified binomial formula.

The centers and half-widths are computed at 80 decimal digits and their float conversions checked against that calculation. An additional arithmetic guard uses epsilon=10^-11 in log coordinates, comfortably larger than the checked conversion differences below 10^-13. The sum of expanded-minus-contracted component-box volumes bounds a possible box-boundary shift. A further union-of-slabs bound handles the 20 window faces and six ordering faces. With B=144QV/L^10 and h_min the smallest half-width, the added probability guard is

bnum=B[∏j(1+ϵ/hj)−∏j(1−ϵ/hj)+26ϵ/hmin⁡].(14) b_{\rm num}=B\left[ \prod_j(1+\epsilon/h_j)-\prod_j(1-\epsilon/h_j) +26\epsilon/h_{\min}\right]. \tag{14}

The first terms compare expanded and contracted box volumes; the last term uses the bounded marginal density of each linear coordinate on a uniform-increment box. The stated guard is conditional on the finite arithmetic errors staying within epsilon. This is high-precision checking plus a conservative perturbation bound, not formal directed-rounding interval arithmetic. The numerical guard is reported separately and enlarges each displayed interval.

7. Completed results

Electron-only reference window Index domain Weighted coverage estimate Simultaneous sampling interval enlarged by numerical guard
1…10^6 electron masses Every relevant rung; n≤194 suffices 2.83743×10^-20 [2.67360, 2.98227]×10^-20
1…10^7 electron masses Every relevant rung; n≤616 suffices 7.32835×10^-18 [6.70999, 7.71839]×10^-18

For the two complete-window branches, the thinned counts are 4,864 and 3,066 from one million proposal draws each. Their point estimates are 2.82548×10^-20 and 7.20423×10^-18. Displayed interval endpoints are rounded outward. These are thousands of direct importance-sampling successes, not a claim inferred from zero rare hits in an ordinary random-spectrum simulation.

For the complete-window branches, the numerical guards are approximately 9.76×10^-23 and 3.95×10^-20. The main source of displayed interval width is sampling uncertainty. All counts, component volumes, proposal normalizations, multiplicity histograms, seeds, certificates and run versions are retained in results.json.

The increase in coverage in the wider window is real for this ensemble: higher-index rungs become denser. Both main results retain every relevant higher-index alternative, without independently retuning any scale. A declared finite-cap control, retained only in the reproducibility results, gives 4.82016×10^-21 at n≤100 and R=10^6, with outward-rounded guarded interval [4.628,5.034]×10^-21; it is not the complete-window headline.

7.1 What the joint coverage does and does not say

The event preserves ten unequal absolute bounds and the ratio cancellations simultaneously. Under the same underlying reference distribution and complete assignment/index search, adding an acceptance requirement can only reduce or leave unchanged the union of acceptable mass lists. A looser bound therefore still constrains the joint event; it does not weaken the tight bounds on other labels. Every mass contributes through the same joint acceptance geometry.

The down and up bounds retain their central numerical closeness rather than enlarging it to their larger measurement widths. The reference distribution is the stated full log-mass window. These are explicit choices defining the event, not a measurement-likelihood analysis.

The conditional conclusion is that the supplied numerical prescription reproduces the selected central masses and their within-family ratios in a very small region of this declared reference distribution, even after all permitted complete assignments and relevant rung choices are admitted. The result supports investigating the organized numerical pattern under its stated constraints.

It is not a global discovery probability. The coefficients, reference counts, family choices and exclusions were developed with the masses known, and the ten absolute and ratio tolerances are explicitly taken from the observed residual vector. Their full historical selection process has not been randomized or penalized here. Nor does the calculation prove precision agreement with every experimental mass, resolve quark mass-scheme interpretation, explain bottom, set the neutrino absolute scale or derive sustained particle solutions.

Spin, charge, color and depth-selection constructions remain separate conditional mathematics. Shared premises can make their compatibility interesting, but those results are not independent probability factors to multiply into equation (12).

8. Reproduction and verification

Save the three files below together. The calculation requires Python, NumPy and mpmath. Run python joint-coverage.py, then python check-certificates.py. In the project checkout, use the shared capped compute runner. The first script regenerates thresholds and results from the exact decimal inputs; the second checks domain certificates and saved joint-rung witnesses. The main computation used fixed seeds 2026103101, 2026103102 and 2026103103 and one million proposal draws per branch. No simulation is rerun by this editorial integration.

The author calculation passed 480 controls and 370 additional certificate/witness checks. Independent review checks the event, normalization, all-rung multiplicity, finite-domain certificates and confidence construction. Finite checks support these stated identities and algorithms; their number is not a count of independent physical predictions.

data.json

{
  "benchmark": "Maintained new case, archived PDG 2024 central values; MeV/c^2",
  "electron_anchor_fixed": true,
  "particles": {
    "electron": {"mass_MeV":"0.51099895000", "quoted_error_MeV":"0.00000000015", "source":"leptons", "page":1},
    "muon": {"mass_MeV":"105.6583755", "quoted_error_MeV":"0.0000023", "source":"leptons", "page":1},
    "tau": {"mass_MeV":"1776.93", "quoted_error_MeV":"0.09", "source":"leptons", "page":2},
    "W": {"mass_MeV":"80369.2", "quoted_error_MeV":"13.3", "source":"gauge-higgs-bosons", "page":1},
    "Z": {"mass_MeV":"91188.0", "quoted_error_MeV":"2.0", "source":"gauge-higgs-bosons", "page":2},
    "H": {"mass_MeV":"125200.0", "quoted_error_MeV":"110.0", "source":"gauge-higgs-bosons", "page":4},
    "down": {"mass_MeV":"4.70", "quoted_error_MeV":"0.07", "source":"quarks", "page":1, "confidence":"90 percent quoted", "definition":"MSbar at 2 GeV"},
    "strange": {"mass_MeV":"93.5", "quoted_error_MeV":"0.8", "source":"quarks", "page":1, "confidence":"90 percent quoted", "definition":"MSbar at 2 GeV"},
    "up": {"mass_MeV":"2.16", "quoted_error_MeV":"0.07", "source":"quarks", "page":1, "confidence":"90 percent quoted", "definition":"MSbar at 2 GeV"},
    "charm": {"mass_MeV":"1273.0", "quoted_error_MeV":"4.6", "source":"quarks", "page":1, "confidence":"90 percent quoted", "definition":"MSbar at its own MSbar mass"},
    "top": {"mass_MeV":"172570.0", "quoted_error_MeV":"290.0", "source":"quarks", "page":2, "definition":"direct event-kinematic mass average"}
  },
  "external_sources": {
    "leptons":"https://pdg.lbl.gov/2024/tables/rpp2024-sum-leptons.pdf",
    "quarks":"https://pdg.lbl.gov/2024/tables/rpp2024-sum-quarks.pdf",
    "gauge-higgs-bosons":"https://pdg.lbl.gov/2024/tables/rpp2024-sum-gauge-higgs-bosons.pdf"
  },
  "scope":"Quoted errors are retained as published, not converted into a common Gaussian likelihood. Their rectangular envelope is not a joint confidence region. Bottom and neutrinos are not scored."
}

joint-coverage.py

"""Observed absolute-and-ratio accuracy union; run with agent-compute.py only."""
from pathlib import Path
from itertools import permutations,product
from math import comb,factorial
import json,hashlib,platform,time
import numpy as np
import mpmath as mp

ROOT=Path(__file__).resolve().parent
mp.mp.dps=80
DATA=json.loads((ROOT/'data.json').read_text())
NAMES=('W','Z','H','down','strange','up','charm','top','muon','tau')
GROUPS=((0,1,2),(3,4),(5,6,7),(8,9))
PERMS=list(permutations((2,3,4)))
DEPTHS=[p+(6,10) for p in PERMS]
MAINTAINED_N=(76,81,95,1,4,3,20,72,35,23)
MAINTAINED_D=(2,2,2,3,3,4,4,4,6,10)
MASSES=[mp.mpf(DATA['particles'][name]['mass_MeV']) for name in NAMES]
ME=mp.mpf(DATA['particles']['electron']['mass_MeV'])
A={2:mp.sqrt(2890),3:mp.sqrt(32*mp.sqrt(7)),4:mp.sqrt(48/mp.sqrt(7))/15,6:mp.mpf(1)/18564,10:mp.mpf(1)/18564}
OBS=[mp.log(ME*A[d]*comb(n+d-1,d)/mass) for n,d,mass in zip(MAINTAINED_N,MAINTAINED_D,MASSES)]
DELTA=[abs(e) for e in OBS]
H=[mp.mpf(0)]*10
for g in GROUPS:
 H[g[0]]=DELTA[g[0]]
 for i,j in zip(g,g[1:]):H[j]=abs(OBS[j]-OBS[i])
V=mp.fprod(2*h for h in H)
DENSITY_FACTOR=mp.mpf(144)
CHECKS=[]
def ck(name,condition):
 if not condition:raise AssertionError(name)
 CHECKS.append(name)

def label_depths(p):return (p[0],)*3+(p[1],)*2+(p[2],)*3+(6,10)
def center(n,d):return mp.log(A[d]*comb(n+d-1,d))
def candidate_lists(decades,cap):
 L=mp.mpf(decades)*mp.log(10);lists={};cert=[]
 for i in range(10):
  ds=(6,) if i==8 else (10,) if i==9 else (2,3,4)
  for d in ds:
   n=1;vals=[];ids=[]
   while center(n,d)-DELTA[i]<=L:
    s=center(n,d)
    if s+DELTA[i]>=0 and (cap is None or n<=cap):vals.append(s);ids.append(n)
    n+=1
   ck(f'upper cap certificate {decades} {cap} {i} {d}',center(n,d)-DELTA[i]>L)
   ck(f'preceding cap certificate {decades} {cap} {i} {d}',center(n-1,d)-DELTA[i]<=L)
   cert.append(dict(label=NAMES[i],depth=d,last_relevant=n-1,retained=len(vals),first_retained=ids[0],last_retained=ids[-1]))
   arr=np.asarray([float(v) for v in vals]);nums=np.asarray(ids,dtype=np.int64)
   ck(f'float center rounding {decades} {cap} {i} {d}',max(abs(mp.mpf(float(x))-v) for x,v in zip(arr,vals))<mp.mpf('1e-13'))
   lists[i,d]=(arr,nums,vals)
 return L,lists,cert

def count_group(x,arrays,h):
 """Count ALL rung paths, using closed successive-error intervals."""
 n=len(x);out=np.zeros(n,dtype=np.int64)
 lo=np.searchsorted(arrays[0],x[:,0]-h[0],side='left')
 hi=np.searchsorted(arrays[0],x[:,0]+h[0],side='right')
 for off in range(int(np.max(hi-lo,initial=0))):
  inds=np.flatnonzero(lo+off<hi)
  e1=arrays[0][lo[inds]+off]-x[inds,0]
  lo2=np.searchsorted(arrays[1],x[inds,1]+e1-h[1],side='left')
  hi2=np.searchsorted(arrays[1],x[inds,1]+e1+h[1],side='right')
  if x.shape[1]==2:
   out[inds]+=hi2-lo2;continue
  for off2 in range(int(np.max(hi2-lo2,initial=0))):
   good=np.flatnonzero(lo2+off2<hi2);jj=inds[good]
   e2=arrays[1][lo2[good]+off2]-x[jj,1]
   lo3=np.searchsorted(arrays[2],x[jj,2]+e2-h[2],side='left')
   hi3=np.searchsorted(arrays[2],x[jj,2]+e2+h[2],side='right')
   out[jj]+=hi3-lo3
 return out

def multiplicity(x,lists):
 counts={}
 for gi,g in enumerate(GROUPS):
  ds=(None,) if gi==3 else (2,3,4)
  for d in ds:
   arrays=[lists[i,(6 if i==8 else 10) if d is None else d][0] for i in g]
   counts[gi,d]=count_group(x[:,g],arrays,[float(H[i]) for i in g])
 total=np.zeros(len(x),dtype=np.int64)
 for p in PERMS:total+=counts[0,p[0]]*counts[1,p[1]]*counts[2,p[2]]*counts[3,None]
 return total

def nearest_all_passes(x,lists):
 out=np.zeros(len(x),dtype=bool)
 for p in PERMS:
  es=np.empty_like(x)
  for i,d in enumerate(label_depths(p)):
   arr=lists[i,d][0];k=np.searchsorted(arr,x[:,i]);low=np.clip(k-1,0,len(arr)-1);high=np.clip(k,0,len(arr)-1)
   choose=np.where(abs(arr[low]-x[:,i])<=abs(arr[high]-x[:,i]),low,high)
   es[:,i]=arr[choose]-x[:,i]
  yes=np.all(abs(es)<=np.asarray([float(v) for v in DELTA]),axis=1)
  for g in GROUPS:
   for i,j in zip(g,g[1:]):yes&=abs(es[:,j]-es[:,i])<=float(H[j])
  out|=yes
 return out

def bernoulli_kl_interval(successes,N,alpha):
 # Chernoff tail inversion: each wrong-side tail <= alpha/2.
 q=mp.mpf(successes)/N;c=mp.log(2/mp.mpf(alpha))/N
 def kl(p):
  if p<=0:return mp.mpf(0) if q==0 else mp.inf
  if p>=1:return mp.mpf(0) if q==1 else mp.inf
  return (q*mp.log(q/p) if q else 0)+((1-q)*mp.log((1-q)/(1-p)) if q<1 else 0)
 if q==0:low=mp.mpf(0)
 else:
  a=mp.mpf(0);b=q
  for _ in range(200):
   m=(a+b)/2
   if kl(m)>c:a=m
   else:b=m
  low=(a+b)/2
 if q==1:high=mp.mpf(1)
 else:
  a=q;b=mp.mpf(1)
  for _ in range(200):
   m=(a+b)/2
   if kl(m)>c:b=m
   else:a=m
  high=(a+b)/2
 return low,high

def basic_checks():
 ck('ordered-null density factor',factorial(3)*factorial(2)*factorial(3)*factorial(2)==144)
 for gi,g in enumerate(GROUPS):
  sg=1 if gi<3 else -1
  ck(f'observed residual sign group {gi}',all(sg*OBS[i]>0 for i in g))
  ck(f'observed residual absolute order group {gi}',all(DELTA[i]<DELTA[j] for i,j in zip(g,g[1:])))
  for k,i in enumerate(g):ck(f'chain sums to absolute bound {i}',abs(sum(H[j] for j in g[:k+1])-DELTA[i])<mp.mpf('1e-70'))
  for k,i in enumerate(g):
   for j in g[k+1:]:
    ck(f'pair strip telescopes {i} {j}',abs(abs(OBS[j]-OBS[i])-(DELTA[j]-DELTA[i]))<mp.mpf('1e-70'))
 # The triangular residual transform has unit diagonal; test exact determinant.
 import sympy as sp
 B=sp.eye(10)
 for g in GROUPS:
  for i,j in zip(g,g[1:]):B[j,i]=-1
 ck('exact residual-chain Jacobian determinant one',B.det()==1)
 # Independent small brute-force all-tuple count, including coincident rungs.
 rng=np.random.default_rng(347913)
 for dim in (2,3):
  for case in range(30):
   arrays=[np.sort(rng.uniform(-1,1,4)) for _ in range(dim)]
   h=rng.uniform(.1,.8,dim);x=rng.uniform(-1,1,(8,dim))
   got=count_group(x,arrays,h)
   brute=[]
   for point in x:
    count=0
    for values in product(*arrays):
     es=np.asarray(values)-point
     if abs(es[0])<=h[0] and all(abs(es[j]-es[j-1])<=h[j] for j in range(1,dim)):count+=1
    brute.append(count)
   ck(f'all-rung path count versus brute force {dim} {case}',np.array_equal(got,brute))
 # Concrete non-nearest example: first residual0.1; nearest second residual-0.01
 # fails width0.02, whereas second residual0.11 succeeds.
 ex=count_group(np.array([[0.,0.]]),[np.array([.1]),np.array([-.01,.11])],[.11,.02])
 ck('non-nearest jointly feasible rung retained',ex[0]==1 and abs(-.01-.1)>.02 and abs(.11-.1)<.02)
 ck('duplicate-component inverse multiplicity identity',sp.Rational(6,3)==sp.Rational(12,6))
 for n in (0,10,100):
  lo,hi=bernoulli_kl_interval(n,100,mp.mpf('.01'))
  ck(f'KL interval covers observed proportion {n}',lo<=mp.mpf(n)/100<=hi)


def calibrate(decades,cap,N,seed):
 start=time.monotonic();L,lists,cert=candidate_lists(decades,cap)
 counts=[int(np.prod([len(lists[i,d][0]) for i,d in enumerate(label_depths(p))],dtype=object)) for p in PERMS]
 Q=sum(counts);weights=np.array([c/Q for c in counts]);hf=np.asarray([float(h) for h in H])
 ck('float widths '+str((decades,cap)),max(abs(mp.mpf(float(v))-h) for v,h in zip(hf,H))<mp.mpf('1e-13'))
 rng=np.random.default_rng(seed);valid_total=hits=0;weighted=0.;squared=0.;hist={};witness=None;nearest_fail_count=0
 for offset in range(0,N,20000):
  batch=min(20000,N-offset);which=rng.choice(len(PERMS),size=batch,p=weights)
  centers=np.empty((batch,10));indices=np.empty((batch,10),dtype=np.int64)
  for ip,p in enumerate(PERMS):
   rows=np.flatnonzero(which==ip)
   for i,d in enumerate(label_depths(p)):
    arr,nums,_=lists[i,d];k=rng.integers(0,len(arr),size=len(rows));centers[rows,i]=arr[k];indices[rows,i]=nums[k]
  increments=rng.uniform(-1,1,(batch,10))*hf
  residual=np.empty_like(increments)
  for g in GROUPS:residual[:,g]=np.cumsum(increments[:,g],axis=1)
  x=centers-residual
  good=np.all((x>=0)&(x<=float(L)),axis=1)
  for g in GROUPS:
   for i,j in zip(g,g[1:]):good&=x[:,i]<=x[:,j]
  ix=np.flatnonzero(good);xx=x[ix];K=multiplicity(xx,lists)
  ck(f'proposal point has a containing tuple {decades} {cap} batch{offset}',np.all(K>=1))
  valid_total+=len(ix)
  if len(ix):
   values,ns=np.unique(K,return_counts=True)
   for value,num in zip(values,ns):hist[int(value)]=hist.get(int(value),0)+int(num)
   inv=1./K;weighted+=float(inv.sum());squared+=float((inv*inv).sum());hits+=int(np.sum(rng.random(len(K))<inv))
   if witness is None:
    bad=~nearest_all_passes(xx,lists)
    if np.any(bad):
     jj=int(np.flatnonzero(bad)[0]);kk=ix[jj]
     witness=dict(log_mass_ratios=x[kk].tolist(),proposal_placement=PERMS[int(which[kk])],
                  jointly_feasible_indices=indices[kk].tolist(),proposal_residuals=residual[kk].tolist(),multiplicity=int(K[jj]))
   nearest_fail_count+=0 # No exhaustive nearest-failure rate is claimed.
  if offset%200000==0:print('progress',decades,cap,offset+batch,'valid',valid_total,'thinned hits',hits,flush=True)
 # Three fixed runs: union-bound adjustment gives simultaneous confidence >=99%.
 alpha=mp.mpf('.01')/3;low,high=bernoulli_kl_interval(hits,N,alpha)
 norm=DENSITY_FACTOR*Q*V/L**10
 # Conservative arithmetic guard around component half-widths/centers and 26
 # ordered-window faces. Actual MP-to-float errors were checked <1e-13;
 # epsilon1e-11 also allows arithmetic rounding in differences and sample maps.
 eps=mp.mpf('1e-11')
 box_guard=mp.fprod(1+eps/h for h in H)-mp.fprod(1-eps/h for h in H)
 domain_guard=26*eps/min(H)
 guard=norm*(box_guard+domain_guard)
 out=dict(decades=decades,index_cap=cap or max(c['last_relevant'] for c in cert),complete_window=cap is None,
  draws=N,seed=seed,component_counts=counts,total_components=Q,component_volume=V,normalization=norm,
  ordered_window_hits=valid_total,thinned_hits=hits,weighted_estimate=norm*mp.mpf(weighted)/N,
  bernoulli_estimate=norm*hits/N,sampling_interval=[norm*low,norm*high],
  simultaneous_confidence_at_least='0.99 for the three declared branches by Chernoff and union bound',
  numerical_guard=guard,guarded_interval=[max(0,norm*low-guard),norm*high+guard],
  arithmetic_guard_epsilon=eps,arithmetic_guard_scope='Conservative analytic slab/box perturbation bound, conditional on finite floating-point error staying within epsilon; high precision center and width checks pass. Not directed-rounding formal arithmetic.',
  multiplicity_histogram=hist,non_nearest_witness=witness,cap_certificates=cert,
  elapsed_seconds=time.monotonic()-start)
 print('RESULT',json.dumps(serial({k:out[k] for k in ('decades','index_cap','weighted_estimate','bernoulli_estimate','guarded_interval','ordered_window_hits','thinned_hits','numerical_guard')})),flush=True)
 return out

def serial(x):
 if isinstance(x,mp.mpf):return mp.nstr(x,55)
 if isinstance(x,dict):return {str(k):serial(v) for k,v in x.items()}
 if isinstance(x,(tuple,list)):return [serial(v) for v in x]
 return x

def main():
 basic_checks()
 threshold=dict(absolute_bounds={name:DELTA[i] for i,name in enumerate(NAMES)},
  signed_observed_residuals={name:OBS[i] for i,name in enumerate(NAMES)},
  chain_halfwidths={name:H[i] for i,name in enumerate(NAMES)},
  all_pair_bounds=[dict(first=NAMES[i],second=NAMES[j],bound=abs(OBS[j]-OBS[i])) for g in GROUPS for k,i in enumerate(g) for j in g[k+1:]],
  empirical_width_floors_applied=False,coverage_not_global_pvalue=True)
 (ROOT/'thresholds.json').write_text(json.dumps(serial(threshold),indent=2)+'\n')
 result=dict(event='All absolute bounds AND all within-family ratio strips; all allowed rung tuples and six assignments; sole electron anchor',
  thresholds=threshold,branches=[],versions=dict(python=platform.python_version(),numpy=np.__version__,mpmath=mp.__version__),
  code_sha256=hashlib.sha256(Path(__file__).read_bytes()).hexdigest(),data_sha256=hashlib.sha256((ROOT/'data.json').read_bytes()).hexdigest())
 for dec,cap,seed in ((6,100,2026103101),(6,None,2026103102),(7,None,2026103103)):
  result['branches'].append(calibrate(dec,cap,1000000,seed))
  result['checks']=CHECKS;result['check_count']=len(CHECKS)
  (ROOT/'results.json').write_text(json.dumps(serial(result),indent=2)+'\n')
 print('COMPLETE',len(CHECKS),'checks',flush=True)
if __name__=='__main__':main()

check-certificates.py

"""Small exact cap certificates and direct all-pair witness checks; capped execution."""
from pathlib import Path
from fractions import Fraction as F
from itertools import product,permutations
from math import comb
import json,hashlib
import mpmath as mp
mp.mp.dps=80
R=Path(__file__).resolve().parent
z=json.loads((R/'results.json').read_text());data=json.loads((R/'data.json').read_text())
names=('W','Z','H','down','strange','up','charm','top','muon','tau');groups=((0,1,2),(3,4),(5,6,7),(8,9))
ns=(76,81,95,1,4,3,20,72,35,23);ds=(2,2,2,3,3,4,4,4,6,10)
A={2:F(2890**2),3:F(7168),4:F(256,39375),6:F(1,18564**4),10:F(1,18564**4)}
a={2:mp.sqrt(2890),3:mp.sqrt(32*mp.sqrt(7)),4:mp.sqrt(48/mp.sqrt(7))/15,6:mp.mpf(1)/18564,10:mp.mpf(1)/18564}
me=F(data['particles']['electron']['mass_MeV']);mass=[F(data['particles'][name]['mass_MeV']) for name in names]
obs4=[(me/m)**4*A[d]*comb(n+d-1,d)**4 for m,n,d in zip(mass,ns,ds)]
# Independently reconstruct residual thresholds from exact fourth powers.
r=[mp.log(mp.mpf(v.numerator)/v.denominator)/4 for v in obs4];delta=[abs(v) for v in r]
checks=[]
def ck(name,b):
 if not b:raise AssertionError(name)
 checks.append(name)
for i,name in enumerate(names):ck('threshold reconstructed from rational fourth power '+name,abs(r[i]-mp.mpf(z['thresholds']['signed_observed_residuals'][name]))<mp.mpf('1e-54'))
for bi,b in enumerate(z['branches']):
 limit=10**b['decades']
 for c in b['cap_certificates']:
  i=names.index(c['label']);d=c['depth'];n=c['last_relevant'];v=max(obs4[i],1/obs4[i]);lower=1/v
  ck(f'exact last window rung {bi} {i} {d}',A[d]*comb(n+d-1,d)**4<=limit**4*v)
  ck(f'exact first excluded upper rung {bi} {i} {d}',A[d]*comb(n+d,d)**4>limit**4*v)
  k=c['first_retained'];ck(f'exact first lower-window rung {bi} {i} {d}',A[d]*comb(k+d-1,d)**4>=lower)
  if k>1:ck(f'exact preceding lower exclusion {bi} {i} {d}',A[d]*comb(k+d-2,d)**4<lower)
  ck(f'finite-domain list length {bi} {i} {d}',c['retained']==min(n,b['index_cap'])-k+1)
 # Independently enumerate all absolute-band candidates and ALL pair strips at
 # a real sampled non-nearest witness. No residual-chain shortcut is used.
 w=b['non_nearest_witness'];ck(f'non-nearest witness exists {bi}',w is not None)
 x=[mp.mpf(str(v)) for v in w['log_mass_ratios']]
 ck(f'witness window {bi}',all(0<=v<=mp.log(limit) for v in x))
 ck(f'witness ordered {bi}',all(x[i]<=x[j] for g in groups for i,j in zip(g,g[1:])))
 total=0;any_nearest=False;assignment_counts=[]
 for p in permutations((2,3,4)):
  depth=(p[0],)*3+(p[1],)*2+(p[2],)*3+(6,10)
  candidates=[];near=[]
  for i,d in enumerate(depth):
   vals=[(n,mp.log(a[d]*comb(n+d-1,d))-x[i]) for n in range(1,b['index_cap']+1)]
   near.append(min(vals,key=lambda t:abs(t[1]))[1])
   candidates.append([e for n,e in vals if abs(e)<=delta[i]])
  good_near=all(abs(e)<=d for e,d in zip(near,delta))
  for g in groups:
   for ii,i in enumerate(g):
    for j in g[ii+1:]:good_near=good_near and abs(near[j]-near[i])<=abs(r[j]-r[i])
  any_nearest=any_nearest or good_near
  q=1
  for g in groups:
   num=0
   for es in product(*(candidates[i] for i in g)):
    if all(abs(es[v]-es[u])<=abs(r[g[v]]-r[g[u]]) for u in range(len(g)) for v in range(u+1,len(g))):num+=1
   q*=num
  total+=q;assignment_counts.append(q)
 ck(f'direct all-pair multiplicity agrees {bi}',total==w['multiplicity'])
 ck(f'all independent-nearest assignments fail witness {bi}',not any_nearest)
 ck(f'weighted estimate within guarded interval {bi}',mp.mpf(b['guarded_interval'][0])<=mp.mpf(b['weighted_estimate'])<=mp.mpf(b['guarded_interval'][1]))
 b['independent_witness_assignment_counts']=assignment_counts
out=dict(check_count=len(checks),checks=checks,witness_assignment_counts=[b['independent_witness_assignment_counts'] for b in z['branches']],
    checked_results_sha256=hashlib.sha256((R/'results.json').read_bytes()).hexdigest(),code_sha256=hashlib.sha256(Path(__file__).read_bytes()).hexdigest())
(R/'certificate-results.json').write_text(json.dumps(out,indent=2)+'\n')
print(json.dumps(dict(check_count=len(checks),witness_assignment_counts=out['witness_assignment_counts']),indent=2))