diff --git a/.github/workflows/c8-window-coefficient-planar.yml b/.github/workflows/c8-window-coefficient-planar.yml new file mode 100644 index 000000000..d3102c319 --- /dev/null +++ b/.github/workflows/c8-window-coefficient-planar.yml @@ -0,0 +1,85 @@ +name: C8 window coefficient planar + +'on': + pull_request: + paths: + - 'frontiers/c8_window_coefficient_planar_20260930/**' + - '.github/workflows/c8-window-coefficient-planar.yml' + - 'imports/lifetime_parent_20260925/UNIFORM_MATRIX_CAP_AND_LIFETIME.md' + - 'coefficients/side24_v1/PROOF.md' + - 'coefficients/side24_v1/ENCLOSURE.json' + workflow_dispatch: + +permissions: + contents: read + +jobs: + certify-and-reject-mutants: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 + with: + persist-credentials: false + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 + with: + python-version: '3.11.16' + - name: Verify sources and pins, replay both modes, reject mutants + env: + PYTHONDONTWRITEBYTECODE: '1' + run: | + set -euo pipefail + python -B -S - <<'PY' + import concurrent.futures, hashlib, json, pathlib, subprocess, sys + root = pathlib.Path('frontiers/c8_window_coefficient_planar_20260930').resolve() + manifest_doc = json.loads((root / 'SOURCE_FILES.json').read_text()) + manifest = manifest_doc['files'] + present = sorted(p.name for p in root.iterdir()) + expected_names = sorted([e['path'] for e in manifest] + ['SOURCE_FILES.json']) + if present != expected_names: + raise ValueError('packet tree differs from manifest: ' + repr(present)) + for entry in manifest: + path = root / entry['path'] + if pathlib.PurePosixPath(entry['path']).name != entry['path'] or path.is_symlink(): + raise ValueError('flat regular source required: ' + entry['path']) + data = path.read_bytes() + if len(data) != entry['bytes'] or hashlib.sha256(data).hexdigest() != entry['sha256']: + raise ValueError('source identity mismatch: ' + entry['path']) + # main-resident pins: the consumed sources must be the cited bytes + for pin in manifest_doc['pins_on_main']: + if not pin.get('workflow_checked'): + continue + p = pathlib.Path(pin['path']) + if p.is_symlink() or not p.is_file(): + raise ValueError('pinned source missing: ' + pin['path']) + data = p.read_bytes() + blob = hashlib.sha1(b'blob %d\0' % len(data) + data).hexdigest() + if blob != pin['git_blob']: + raise ValueError('pinned source drifted: ' + pin['path'] + ' ' + blob) + # the SIDE24 enclosure quoted inside the script must be the one on main + enc = json.loads(pathlib.Path('coefficients/side24_v1/ENCLOSURE.json').read_text())['dimensions']['2'] + src = (root / 'window_coefficient.py').read_text() + if ('"%s", "%s"' % (enc['lower'], enc['upper'])) not in src: + raise ValueError('SIDE24 d = 2 enclosure quoted in the script differs from ENCLOSURE.json') + script = str(root / 'window_coefficient.py') + expected = (root / 'RESULTS.json').read_bytes() + mutants = ['no-owen', 'mean-sign', 'slope', 'gamma-shape', 'image-dropped', 'shell-count', 'tail-dropped', 'prefactor', 'd3-cross', 'window-swap'] + def mutant_rc(args): + flags, m = args + return m, flags, subprocess.run([sys.executable, *flags, script, '--mutant', m], + capture_output=True, timeout=1500).returncode + for flags in (['-B', '-S'], ['-B', '-O', '-S']): + out = subprocess.run([sys.executable, *flags, script], + check=True, capture_output=True, timeout=1500).stdout + if out != expected: + raise RuntimeError('output differs from RESULTS.json under ' + ' '.join(flags)) + doc = json.loads(out) + if not (doc['passed'] and len(doc['checks']) == 14 and all(doc['checks'].values())): + raise RuntimeError('certification did not pass under ' + ' '.join(flags)) + with concurrent.futures.ThreadPoolExecutor(max_workers=4) as pool: + for m, fl, rc in pool.map(mutant_rc, [(flags, m) for m in mutants]): + if rc != 1: + raise RuntimeError('mutant ' + m + ' not rejected under ' + ' '.join(fl)) + print(json.dumps({'scientific_effect': 'NONE', 'mathematical_acceptance': False, 'certified_enclosures': True, 'C8': 'OPEN'})) + PY + git diff --exit-code diff --git a/frontiers/c8_window_coefficient_planar_20260930/NOTE.md b/frontiers/c8_window_coefficient_planar_20260930/NOTE.md new file mode 100644 index 000000000..8d73ae387 --- /dev/null +++ b/frontiers/c8_window_coefficient_planar_20260930/NOTE.md @@ -0,0 +1,307 @@ +# The compact-window coefficient `c_{B,K}` in the plane: exact factorization, closed forms and certified values on the C8 band + +**Object:** `CL-C8-WINDOW-COEFFICIENT-PLANAR-20260930-v1`. **Author lane:** Anthropic / Claude (Claude Code +`session_017Mi3hxjaxV45x6zo6o1ee3`). **Kind:** certified numerical constant with its exact reduction: interval arithmetic over +`decimal` (60 digits, directed rounding), fractional powers by exact integer roots, every series with an explicit remainder +or a bracket by consecutive partial sums. **Scientific effect:** NONE. No register, catalog, GRAPH or STATUS change; catalog +entry C8 (`reviews/candidates_pending_20260928/CANDIDATES.md`) stays OPEN: this note supplies a second of its listed +constants, `c_{B,K}`, in `d = 2`, on the band declared by Math-#195 and on a few other windows, and none of `C`, `r_*`, +`c_{d,L}` (Math-#195 supplies `z_*`). Scope claimed on Math-#195 (comment 5915784573). + +## 0. Statement + +Let `f` be the unit-variance stationary Gaussian field on the torus `R^2 / (L Z^2)` with the parent kernel +`K_L(z) = sum_n exp(-|z + Ln|^2/2) / sum_n exp(-|Ln|^2/2)` ([LP] section 1), `B = [b_-, b_+]` a birth window and +`K = [k_-, k_+]` a gap window, compact and of positive length with a positive gap floor: `-inf < b_- < b_+ < inf` and +`0 < k_- < k_+ < inf` ([LP] Theorem B's hypothesis, lines 16 and 37 of the pinned [LP]; windows outside it are treated in +section 8). [LP] Theorem B gives `nu_cand(ell) ~ c_{B,K} ell^(-1/3)` and +`nu_eld(ell) ~ c_{B,K} ell^(-1/3)` for the pairs with birth in `B` and scaled gap in `K`, with `c_{B,K}` the Gaussian integral +(11.3). Everything below is about that integral; the theorem is consumed at its stated scope and not revalidated. + +**Theorem W (exact factorization, reference kernel).** For the Euclidean kernel `exp(-|z|^2/2)` in `d = 2`, + + c_{B,K} = c_{2,ref} F_B G_K, c_{2,ref} = 2 Gamma(7/6) (3/2)^(1/3) / (3 sqrt3 pi^(3/2)), + + G_K = P(7/6, 12 k_+^2) - P(7/6, 12 k_-^2) (P the regularized lower incomplete gamma function), + + F_B = Psi(b_+ sqrt(3/2)) - Psi(b_- sqrt(3/2)), + Psi(x) = Phi(x) - 2 T(x, 1/sqrt3) - (1/2) x phi(x) Phi(x/sqrt3) - (sqrt3 / (4 pi)) exp(-2x^2/3), + +`T` Owen's T-function, `Psi(-inf) = 0`, `Psi(+inf) = 1`. In particular + + F_{[-beta, beta]} = erf(beta sqrt3/2) - beta sqrt3 exp(-3 beta^2/4) / (4 sqrt pi), F_{[0, inf)} = 2/3 + sqrt3/(4 pi), + +and the gap-mark density is `k^(4/3) exp(-12 k^2)`, normalized, with mode `k = sqrt2/6`. + +**Certified values.** `c_{2,ref} = 0.07340691930603427103013596295777405001766424468433...` (enclosure width below `1e-55`; +it lies inside SIDE24's `[0.07340691930603427103, 0.07340691930603427104]` for `c_{2,24}`, rule SIDE24_CONSISTENT), and on +the C8 band of Math-#195, `B = [0, 1]`, `K = [1/2, 2]`: + + F_B = 0.48264345641927413020434204645556992729..., G_K = 0.06737173342564166734884441847440277343..., + c_{B,K} (reference) = 0.0023869380211529483091019117..., c_{B,K} / c_{2,ref} = 0.0325165262..., + c_{B,K} (torus, every L >= 10, every frame) in [0.00238693802093000833, 0.00238693802137588829], + c_{B,K} (torus, L = 24) = 0.0023869380211529483091019117... (agrees with the reference to the printed digits). + +So the C8 band carries `48.26 %` of the birth mass and `6.74 %` of the gap mass of the leading coefficient, `3.25 %` in all. +Section 6 tabulates five windows and the two factors separately; section 4 gives the `d = 3` reference closed form. + +## 1. The object + +Write, in an orthonormal frame `(u, w)`, `G = grad f`, `V = (f_uu, f_uw)`, `A = f_ww`, `t = f_uuu`. [LP] (11.3) with the +section 15 factorization `pi_0 = p_{(f,V)}(b, 0) p_G(0) phi_tau(12k)`, `z_0 = 36 k^2 E[A^2 1{A<0} | f = b, V = 0]`, +`tau^2 = Var(t | G = 0)`, reads + + c_{B,K} = 144 int_{S^1} p_G(0) p_V(0) I_B(u) J_K(u) dsigma(u), + I_B(u) = int_B p_{f|V=0}(b) E[A^2 1{A<0} | f = b, V = 0] db, J_K(u) = int_K k^(4/3) phi_tau(12 k) dk, (1.1) + +where `p_{(f,V)}(b, 0) = p_V(0) p_{f|V=0}(b)` is the ordinary disintegration of a centred Gaussian vector. Odd and even +derivatives are independent for any even kernel, so `(G, t)` is independent of `(f, V, A)` and (1.1) is exactly [LP]'s +integral restricted to `B x K`; with `B = R`, `K = (0, inf)` it is `c_{2,L}` of (15.2). Section 15 evaluates the full gap +integral (`144 int_0^inf k^(4/3) phi_tau(12k) dk = Gamma(7/6) tau^(4/3) / (24^(1/3) sqrt pi)`) and the full birth integral +(`p_V(0) D_u`); the window keeps both integrals finite and this note evaluates them. + +## 2. Reference kernel: conditional laws and closed forms + +**Covariances.** For `K(z) = exp(-|z|^2/2)`, `Cov(d^a f, d^b f) = (-1)^|a| d^(a+b) K(0)`, and the even derivatives of the +Gaussian at zero are `(-1)^n (2n-1)!!` per axis: `Var f = 1`, `Cov(G) = I`, `Var t = 15`, `Cov(t, f_u) = -3`, +`Cov(f, f_uu) = Cov(f, f_ww) = -1`, `Var f_uu = Var f_ww = 3`, `Cov(f_uu, f_ww) = 1`, `Var f_uw = 1`, all other entries of +the 3-jet zero (SIDE24 section 1). Hence `p_G(0) = 1/(2 pi)`, `tau^2 = 15 - 9 = 6`, `Cov(V) = diag(3, 1)`, +`p_V(0) = 1/(2 pi sqrt3)`. + +**Conditioning on `V = 0`.** `(f, A)` given `V = 0` is centred with covariance +`[[1, -1], [-1, 3]] - [[-1, 0], [1, 0]] diag(1/3, 1) [[-1, 1], [0, 0]] = [[2/3, -2/3], [-2/3, 8/3]]`: `f | V = 0 ~ N(0, 2/3)` +and `A | V = 0 ~ N(0, 8/3)` (SIDE24's `A = Q + sqrt(2/3) Z`, `Q ~ N(0, 2)`). **Conditioning further on `f = b`:** +`A | f = b, V = 0 ~ N(alpha b, s^2)` with `alpha = (-2/3)/(2/3) = -1`, `s^2 = 8/3 - (2/3)^2/(2/3) = 2`. This is the +contact law `A_0 ~ N(-b, 2)` of [LP] (5.4) as quoted in Math-#195 section 1; `E[A^2 1{A<0} | V = 0] = (8/3)/2 = 4/3 = D_1`. + +**The birth integrand.** With `X` standard normal and `t = b/sqrt2`, +`E[A^2 1{A<0} | f = b, V = 0] = 2 E[(X - t)^2 1{X < t}] = 2[(1 + t^2) Phi(t) + t phi(t)]`, i.e. +`m_{2,b} = (b^2 + 2) Phi(b/sqrt2) + sqrt2 b phi(b/sqrt2)` (Math-#178 section 1 in the same words). Substituting +`b = sigma x`, `sigma = sqrt(2/3)`, and `Phi(b/sqrt2) = Phi(x/sqrt3)`: + + I_B = 2 int_{x_-}^{x_+} phi(x) [ (1 + x^2/3) Phi(x/sqrt3) + (x/sqrt3) phi(x/sqrt3) ] dx, x_+- = b_+- sqrt(3/2). (2.1) + +**Three Gaussian primitives.** For `0 < a <= 1`, `rho^2 = 1 + a^2`, with `T` Owen's function +`T(h, a) = (1/2 pi) int_0^a exp(-h^2 (1+x^2)/2) / (1+x^2) dx` (so that `int_{-inf}^h phi(x) Phi(ax) dx = Phi(h)/2 - T(h, a)`, +Owen 1956; `T(0, a) = arctan(a)/(2 pi)`, `T(+-inf, a) = 0`, `T` even in `h`): + + G_0(x) := int_{-inf}^x phi Phi(a .) = Phi(x)/2 - T(x, a), + G_1(x) := int_{-inf}^x t phi Phi(a t) dt = -phi(x) Phi(ax) + (a / (rho sqrt(2 pi))) Phi(rho x), + G_2(x) := int_{-inf}^x t^2 phi Phi(a t) dt = G_0(x) - x phi(x) Phi(ax) - (a / (2 pi rho^2)) exp(-rho^2 x^2/2), + G_3(x) = -x^2 phi(x) Phi(ax) + (a/2 pi) [ -(x/rho^2) exp(-rho^2 x^2/2) + (sqrt(2 pi)/rho^3) Phi(rho x) ] + 2 G_1(x), + G_4(x) = -x^3 phi(x) Phi(ax) - (a/2 pi) (x^2/rho^2 + 2/rho^4) exp(-rho^2 x^2/2) + 3 G_2(x), + +by `t^n phi = -(t^(n-1) phi)' + (n-1) t^(n-2) phi`, integration by parts and `phi(t) phi(at) = exp(-rho^2 t^2/2)/(2 pi)`; +the limits at `+inf` are `1/2, a/(rho sqrt(2 pi)), 1/2, a/(rho^3 sqrt(2 pi)) + 2a/(rho sqrt(2 pi)), 3/2` (Stein's identity +checks `G_3(inf)`). Since `int a x phi(x) phi(ax) dx = -(a / (2 pi rho^2)) exp(-rho^2 x^2/2)`, (2.1) gives, with `a = 1/sqrt3`, +`rho^2 = 4/3`, + + I_B = 2 [ Psi_a(x_+) - Psi_a(x_-) ], Psi_a(x) = G_0(x) + a^2 G_2(x) - (a / (2 pi rho^2)) exp(-rho^2 x^2/2), + Psi_a(x) = rho^2 [Phi(x)/2 - T(x, a)] - a^2 x phi(x) Phi(ax) - (a/2 pi) exp(-rho^2 x^2/2), + +and `F_B := I_B / D_1 = (3/2) [Psi_a(x_+) - Psi_a(x_-)]` is the `Psi` of Theorem W: +`(3/2)(4/3)[Phi/2 - T] = Phi - 2T`, `(3/2)(1/3) x phi Phi = x phi Phi/2`, `(3/2)(1/(2 pi sqrt3)) = sqrt3/(4 pi)`. +`Psi(+inf) - Psi(-inf) = 1` recovers `D_1 = 4/3` (rule D1_EXACT). For a symmetric window the `T` terms cancel (`T` is +even), `Phi(y) + Phi(-y) = 1` collapses the `x phi Phi` terms to `-(1/2) beta' phi(beta')`, `beta' = beta sqrt(3/2)`, and the +exponential terms cancel: `F_{[-beta,beta]} = erf(beta sqrt3/2) - beta sqrt3 exp(-3 beta^2/4)/(4 sqrt pi)` (rule +SYMMETRIC_CLOSED_FORM). At `x = 0`, `T(0, 1/sqrt3) = (pi/6)/(2 pi) = 1/12`, so `Psi(0) = 1/3 - sqrt3/(4 pi)` and +`F_{[0, inf)} = 2/3 + sqrt3/(4 pi) = 0.80449889...` (rule HALF_LINE_EXACT): births above the mean carry four fifths of the +coefficient, because `m_{2,b}` increases in `b`. + +**The gap integral.** With `s = 72 k^2/tau^2` (`= 12 k^2` at `tau^2 = 6`), + + J_K = tau^(4/3) 72^(-7/6) [ gamma(7/6, s_+) - gamma(7/6, s_-) ] / (2 sqrt(2 pi)), (2.2) + +`gamma` the lower incomplete gamma function; `144 J_(0,inf) = Gamma(7/6) tau^(4/3)/(24^(1/3) sqrt pi)` is [LP]'s +evaluation, and `G_K := J_K / J_(0,inf) = P(7/6, s_+) - P(7/6, s_-)`. The gap density `k^(4/3) exp(-12 k^2)` has its mode +at `24 k^2 = 4/3`, `k = sqrt2/6 = 0.2357`, and `P(7/6, 3) = 0.9326...`: at a fixed lifetime, `93 %` of the leading +coefficient comes from scaled gaps `k < 1/2`, that is from pairs at radius `r = (ell/k)^(1/3) > (2 ell)^(1/3)`. + +**Assembly.** `144 . 2 pi . (1/2 pi) (1/(2 pi sqrt3)) . (4/3) F_B . 6^(2/3) 72^(-7/6) Gamma(7/6) G_K / (2 sqrt(2 pi))` +`= [2 Gamma(7/6) (3/2)^(1/3) / (3 sqrt3 pi^(3/2))] F_B G_K`, using `144 . 72^(-7/6) 6^(2/3) / (2 sqrt(2 pi)) = 6^(2/3) / (24^(1/3) sqrt pi)` +and `6^(2/3)/24^(1/3) = (3/2)^(1/3)`; the bracket is SIDE24 (1) at `d = 2`, `D_1 = 4/3`. The script evaluates both sides +independently (the closed form of Theorem W, and the pipeline (1.1) from the covariance entries) and requires them to +intersect on every window (rule FACTORIZATION_AND_TRANSFER). + +## 3. Torus kernel: one enclosure for every `L >= 10` and every frame + +**Image bound.** For a unit-direction contraction of order `q <= 6` of `phi(x) = exp(-|x|^2/2)`, the product rule gives +`|D^q phi(x)| <= phi(x) sum_j q! |x|^(q-2j) / (2^j j! (q-2j)!) <= 76 |x|^6 phi(x)` for `|x| >= 1` (`1 + 15 + 45 + 15 = 76` +at `q = 6` dominates the lower orders) and `|D^q phi(0)| <= 15` (SIDE24 section 2). In `d = 2` the shell `|n|_inf = j` +holds `8 j` lattice points with `j^2 <= |n|^2 <= 2 j^2`, so `sum_{n != 0} |n|^6 exp(-L^2 |n|^2/2) <= 64 sum_j j^7 exp(-L^2 j^2/2) +<= 128 exp(-L^2/2)`, successive shell terms having ratio at most `2^7 exp(-3L^2/2) < 1/2` for `L >= 10`. Writing +`K_L = [phi + sum_{n != 0} phi(. + Ln)] / S`, `S = 1 + sum_{n != 0} exp(-L^2|n|^2/2) >= 1`, every unit-direction contraction +satisfies + + |D^q K_L(0) - D^q phi(0)| <= E_L := 128 (76 L^6 + 15) exp(-L^2/2), E_10 ≈ 1.876e-12, E_24 ≈ 1.558e-113. (3.1) + +`E_L` decreases in `L`, so the box "each entry within `E_10` of its reference value" contains the 3-jet covariance of `K_L` +for every `L >= 10` and every frame `(u, w)` (the entries `Cov(d^a f, d^b f) = (-1)^|a| d^(a+b) K_L(0)` are exactly such +contractions; `Var f = 1` is exact by the normalization). + +**Interval evaluation.** The class `Planar(E)` in the script takes the fifteen entries as intervals `[v - E, v + E]`, +forms `p_G(0) = (2 pi)^-1 det(Cov G)^(-1/2)`, `tau^2 = Var t - c^T Cov(G)^-1 c`, `p_V(0)`, the Schur complement of `V` in +`(f, A)`, `alpha`, `s^2`, `sigma^2 = Var(f | V = 0)`, then `I_B` through the primitives of section 2 with the interval slope +`a = -alpha sigma / s` (Owen's series and `arctan` take interval arguments) and `J_K` through (2.2) with the interval +`tau^2`. Every quantity is a function of `u` through the entries only, so the interval computed for one box bounds the +integrand for every `u`; with `|S^1| = 2 pi` this encloses `c_{B,K}` of (1.1) for every `L >= 10` (`E = E_10`) and, more +sharply, for `L = 24` (`E = E_24`). At `E = 0` the same code reproduces the reference (rule FACTORIZATION_AND_TRANSFER: +the `L >= 10` enclosure contains the reference one and is at least ten times wider; the `L = 24` enclosure intersects it). +The `L >= 10` relative half-width is `2.7e-11` (about fourteen times `E_10`, the condition of the conditional-covariance +formulas); the `L = 24` enclosure is arithmetic-limited (`1e-55`). + +**Relation to the SIDE24 records.** On the full window the `L = 24` enclosure lies inside SIDE24's interval for `c_{2,24}` +(rule SIDE24_CONSISTENT); SIDE24 (4) bounds `|c_{2,24}/c_{2,ref} - 1| < 1e-106` and the remainder record's Theorem R +(candidate) identifies the correction as `P_2(24) e^-288 = -6.5e-119`; the transfer here (`E_24 = 1.6e-113` per entry) is +consistent with both and weaker than the second. Its point is the window: it applies to `c_{B,K}`, where the scaling +argument of SIDE24 section 4 does not (the birth window breaks the homogeneity of the cone moment). + +## 4. The `d = 3` reference expression + +For the Euclidean kernel in `d = 3`, `A | f = b, V = 0 = -b I + Q` with `Q` the `2 x 2` matrix of SIDE24 section 1 +(independent diagonal entries of variance `2`, off-diagonal of variance `1`; same computation as section 2, the +conditioning on `f = b` removing exactly the shared `sqrt(2/3) Z` shift). Write `Q = [[s + x, y], [y, s - x]]`, +`s, x, y ~ N(0, 1)` independent, `R^2 = x^2 + y^2 ~ Exp(1/2)`: `det A = (s - b)^2 - R^2`, and `A < 0` iff `s - b < -R`. +SIDE24's Rayleigh integral `int_0^w (w - z)^2 e^(-z/2) dz/2 = w^2 - 4w + 8 - 8 e^(-w/2) =: g(w)` gives +`m_{3,b} := E[det(A)^2 1{A<0}] = int_{-inf}^b g((s-b)^2) phi(s) ds = int_0^inf g(v^2) phi(v - b) dv`, and with the +truncated moments `int_0^inf v^n phi(v - b) dv` (`n <= 4`) and `int_0^inf exp(-v^2/2) phi(v - b) dv = exp(-b^2/4) Phi(b/sqrt2)/sqrt2`, + + m_{3,b} = (b^3 + b) phi(b) + (b^4 + 2 b^2 + 7) Phi(b) - 4 sqrt2 exp(-b^2/4) Phi(b/sqrt2). (4.1) + +Its mean over `b ~ N(0, 2/3)` is `(1/2)(3 . 4/9 + 2 . 2/3 + 7) - 2 sqrt2 (1 + 1/3)^(-1/2) = 29/6 - sqrt6 = D_2`, SIDE24's +cone moment, so the window factor `F^(3)_B = int_B phi_{2/3}(b) m_{3,b} db / D_2` integrates to one (rule D2_EXACT; the +script also checks (4.1) against the direct double integral in floating point). The three pieces of `int_B phi_{2/3} m_{3,b}` +are elementary through the primitives of section 2: `int phi_{2/3}(b) (b^3 + b) phi(b) db = -(2 b^2/5 + 18/25) exp(-5 b^2/4) / (2 pi sigma)`; +`int phi_{2/3}(b) (b^4 + 2 b^2 + 7) Phi(b) db = sigma^4 G_4 + 2 sigma^2 G_2 + 7 G_0` at `x = b/sigma` with slope `a = sigma`; +`int phi_{2/3}(b) 4 sqrt2 exp(-b^2/4) Phi(b/sqrt2) db = (4/sigma) G_0(sqrt2 b; 1/2)`. The gap factor is the same `G_K` +(`tau^2 = 6` in every dimension for the reference kernel), and `c^(3)_{B,K} = c_{3,ref} F^(3)_B G_K` with `c_{3,ref}` SIDE24 +(1) at `d = 3`. **No torus transfer is made in `d = 3`:** under the perturbed entries the conditional mean of `A` is no +longer a multiple of the identity and the truncated cone moment has no closed form; a Lipschitz bound in the mean and the +density sandwich of SIDE24 section 4 would give one and are left for a later record. + +## 5. Exhaustion: what a window leaves out + +`1 - G_K = P(7/6, 12 k_-^2) + Q(7/6, 12 k_+^2)`, `Q = 1 - P`, with the elementary bounds below. Both `P` bounds and the +lower `Q` bound hold for `s > 0`; the upper `Q` bound needs `s > 1/6`, where its denominator is positive. Every use in this +packet has `s = 12 k_+^2 >= 48`. + + e^-s s^(7/6) / Gamma(13/6) <= P(7/6, s) <= s^(7/6) / Gamma(13/6), + s^(1/6) e^-s / Gamma(7/6) <= Q(7/6, s) <= s^(1/6) e^-s / (Gamma(7/6) (1 - 1/(6s))), + +from `e^-s <= e^-t <= 1` on `[0, s]` and `t^(1/6) <= s^(1/6) exp((t - s)/(6s))` on `[s, inf)`. So the small-gap cut costs +`12^(7/6) k_-^(7/3) / Gamma(13/6) (1 + O(k_-^2))`, the large-gap cut `(12 k_+^2)^(1/6) e^(-12 k_+^2)/Gamma(7/6)`. +For the birth window, `m_{2,b} <= b^2 + 2` for every `b` (Mills' ratio for `b > 0`) and `(Q - b)^2 <= Q^2` on `{Q < b <= 0}` +give + + 1 - Psi(x) <= 2 Phi_bar(x) + x phi(x)/2 (x > 0), Psi(x) <= (3/2) Phi(x) (x <= 0), x = b sqrt(3/2), + +Gaussian rates `exp(-3 b^2/4)` on both sides; the symmetric closed form gives the exact loss +`erfc(beta sqrt3/2) + beta sqrt3 exp(-3 beta^2/4)/(4 sqrt pi)`. Rule EXHAUSTION_BOUNDS checks the certified values against +each bound with margin. These are the rates at which `c_{B,K}` increases to `c_{2,L}` along exhausting windows ([LP] +section 13). + +## 6. Values (`RESULTS.json`) + +Birth factor `F_B` (`d = 2`) and `F^(3)_B` (`d = 3`, reference), gap factor `G_K` (both dimensions): + +| `B` | `F_B` (`d = 2`) | `F^(3)_B` (`d = 3`, ref.) | `K` | `G_K` | +|---|---|---|---|---| +| `[0, 1]` (C8 band) | `0.482643456419274130...` | `0.346198792034071727...` | `[1/2, 2]` (C8 band) | `0.067371733425641667...` | +| `[-1/2, 1/2]` | `0.358442197996678535...` | `0.156521520040231396...` | `[1, 3/2]` | `0.0000101517691908456...` | +| `[-1, 1]` | `0.663928895976061762...` | `0.391483956900814659...` | `[1/4, 4]` | `0.549058584986557263...` | +| `[-2, 2]` | `0.961368034899749630...` | `0.866952146414130272...` | `[1/10, 10]` | `0.926964889761576745...` | +| `[-3, 3]` | `0.998903294460189530...` | `0.993299304898946068...` | `[1/2, inf)` | `0.067371733425641667...` | +| `[0, inf)` | `0.804498890522114679...` | `0.953797733717050929...` | `[1, inf)` | `0.0000101517727209572...` | +| `(-inf, 0]` | `0.195501109477885320...` | `0.046202266282949070...` | `(0, inf)` | `1` | + +All enclosure widths are below `1e-50`. Coefficients (reference closed form; torus `L >= 10` enclosure; `d = 3` reference): + +| window | `c_{B,K}` reference (`d = 2`) | fraction of `c_{2,ref}` | torus `L >= 10`, every frame | `c^(3)_{B,K}` reference | +|---|---|---|---|---| +| W1 `B=[0,1] K=[1/2,2]` | `0.00238693802115294830910...` | `0.0325165` | `[0.00238693802093000833, 0.00238693802137588829]` | `0.000974382366024250...` | +| W2 `B=[-1,1] K=[1/2,2]` | `0.00328349448038652830503...` | `0.0447300` | `[0.00328349448011528868, 0.00328349448065776793]` | `0.00110183822983417...` | +| W3 `B=[-2,2] K=[1/4,4]` | `0.03874764950788533309909...` | `0.5278474` | `[0.03874764950590828641, 0.03874764950986237979]` | `0.0198856576593802...` | +| W4 `B=[-3,3] K=[1/10,10]` | `0.06797101083534825121205...` | `0.9259483` | `[0.06797101083232680835, 0.06797101083836969407]` | `0.0384653388278856...` | +| W5 `B=[-1/2,1/2] K=[1,3/2]` | `2.6711474686063351637e-7` | `3.63882e-6` | `[2.67114746807e-7, 2.67114746914e-7]` | `6.6380716823e-8` | +| full | `0.07340691930603427103013...` | `1` | `[0.07340691930405245284, 0.07340691930801608922]` | `0.0417759318405983433...` | + +The `L = 24` enclosures agree with the reference column to every printed digit (`RESULTS.json`, `c_torus_L_24`); the `d = 3` +fractions are `0.0233`, `0.0264`, `0.4760`, `0.9208`, `1.59e-6`, `1`. `Gamma(7/6) = 0.92771933363003920070834948253462...`, +`c_{3,ref} = 0.04177593184059834334293666542857...` (SIDE24's `d = 3` interval contains it). + +## 7. Rules, mutants, verification + +`python3 -B -S window_coefficient.py` (also `-B -O -S`; eleven seconds) prints `RESULTS.json` and exits `0` only if all +fourteen rules hold: FLOAT_INSIDE (independent floating quadratures of the birth and gap factors, `m_{3,b}` by the direct +double integral, Owen's `T` by its defining integral, `math.gamma(7/6)`, all within `1e-9` of the enclosures); WIDTHS +(`1e-40` for the reference, `d = 3` and `L = 24` enclosures, `1e-10` for `L >= 10`); D1_EXACT (`4/3`, and both factors +equal to one on the full window); D2_EXACT (`29/6 - sqrt6`); HALF_LINE_EXACT (`2/3 + sqrt3/(4 pi)`); +SYMMETRIC_CLOSED_FORM; FACTORIZATION_AND_TRANSFER (closed form against pipeline on every window, `L >= 10` contains +the reference and is wider, `L = 24` intersects it); SIDE24_CONSISTENT; IMAGE_BOUND (`E_10 in (1.8e-12, 1.95e-12)`, +`0 < E_24 < 1e-112`); MONOTONE (nested windows, positive half-lines); EXHAUSTION_BOUNDS; TRUNCATION_NESTING (Owen's +series with half the terms, `erf` and `gamma(7/6, .)` stopped at the first admissible tail bound, `Gamma(7/6)` split at +`X = 90` instead of `120`: every coarse enclosure intersects the fine one and is wider); LIBRARY_EXACT (the decimal +module's `exp` and `sqrt`, and the interval negation, against exact rational brackets at six arguments: `e^-q` as +`(e^(-q/64))^64` from the rational series, `sqrt q` from an integer root); PINNED (fifty leading digits of `pi`, +`Gamma(7/6)`, `c_{2,ref}`, `F_{[0,1]}`, `G_{[1/2,2]}`). Mutants (`--mutant`, each must exit `1`): `no-owen` (`T := 0`), +`mean-sign` (`alpha -> -alpha` in the pipeline), `slope` (`a` scaled by `11/10`), `gamma-shape` (`P(4/3, .)` for the window), +`image-dropped` (`E_L := 0`), `shell-count` (`64` for `128`), `tail-dropped` (series stopped early with no tail), +`prefactor` (`72` for `144`), `d3-cross` (the `exp(-b^2/4) Phi(b/sqrt2)` term halved), `window-swap` (endpoints +exchanged). The workflow `c8-window-coefficient-planar.yml` replays the manifest, the three main-resident pins, checks that +the SIDE24 interval quoted in the script is the one in `ENCLOSURE.json`, runs both interpreter modes byte for byte against +`RESULTS.json` and the ten mutants in each, on a clean tree. Timing goes to `stderr`; the floating controls enter the pinned +output rounded to ten significant digits. + +Rule LIBRARY_EXACT exists because this packet's first draft negated interval endpoints with the Decimal unary minus, which +rounds to the thread's default 28-digit context; `exp(-x)` at a 60-digit `x` was then wrong beyond the 28th digit while every +other rule passed. Negation is now the exact `copy_negate`, every arithmetic step names its context, and the rule detects +the old behaviour at `1e-28`. The interval class is the one of Math-#190, where the operation is never applied to a long +endpoint (its outputs are byte-identical under the repaired class); Math-#190 v1.3 carries the same repair, rule and a +mutant reinstating the old negation. + +## 8. What this does not do + +Not a proof or review of [LP] Theorem B or C: the identity of (1.1) with the leading coefficient of the compact-window +lifetime density is [LP]'s, consumed at its scope, and its D1 dependencies (Math-#194, Math-#196) are untouched. Windows outside +Theorem B's hypothesis are coefficient integrals (1.1) only: a gap window touching `k = 0` or `inf` (the tabulated `[1/2, inf)`, +`[1, inf)` and `(0, inf)`), an unbounded `B` (`[0, inf)`, `(-inf, 0]`, `R`), and a singleton window (`b_- = b_+` or `k_- = k_+`, where (1.1) is zero and does +not inherit Theorem B's positive coefficient; none is tabulated). Theorem B's asymptotic statement is not extended to them; the +full window is [LP] (15.2)'s `c_{2,L}`. Not a value +of `C`, `r_*`, `c_{d,L}` for `d >= 3`, or of any finite-radius quantity; not an enclosure of the torus coefficient in +`d = 3`; nothing about `p_r`, the elder selection or the boundary layer. The windows are declared, not optimized. No +register, catalog, GRAPH or STATUS change; C8 stays OPEN. Same GitHub account as every lane; zero +organizational-independence credit. Claude reads of this packet count for nothing; the author will not merge. + +## 9. Provenance + +Pins on `main 3e0a91b` ([LP] `dfed3b8d`, SIDE24 `PROOF.md` `44b66f04`, `ENCLOSURE.json` `57af39a0`) verified by the +workflow; read, not pinned: the SIDE24 remainder record (`0bcf0a6f`) and the C8 catalog entry (`02455f05`); unmerged +companion Math-#195 at `16da75f` (`NOTE.md` `a8b1f71d`) for the band and the quoted (5.4). `SOURCE_FILES.json` fingerprints +the packet. Owen's series for `T(h, a)`, `T = (1/2 pi)[arctan a - sum_j (-1)^j a^(2j+1)/(2j+1) . P(Poisson(h^2/2) > j)]` +(Owen 1956, equation 2.3), is used with the bracket by consecutive partial sums (the terms alternate and decrease for each +fixed `(h, a)`, `a <= 1`). No external numerical library is used. + +## 10. Revisions + +- **v1.1 (reporting only; the pattern of finding C41-205-C-01 on Math-#205, found here by the author's containment audit).** The upper + endpoints of the `L >= 10` torus intervals in section 0 and in the section 6 coefficient table had been truncated instead of + rounded up. The displayed intervals therefore did not contain the certified intervals of `RESULTS.json`. + - Every displayed interval is now rounded outward: lower endpoints down, upper endpoints up, at the displayed precision. + - An exact containment audit against `RESULTS.json` passes for every bracketed interval in this note, and every `...`-terminated + digit string is a common prefix of a certified interval's endpoints. + - The image-bound values of section 3 are stated as approximations. + + `window_coefficient.py` (blob `43b4f51b`, pinned by Math-#205 and reviewed by C41 in review 5373681556), `RESULTS.json`, every + certified value, the rules and the mutants are unchanged. +- **v1.2 (window hypothesis; NOTE only).** Section 0 said only `0 < k_-`. [LP] Theorem B assumes compact windows of positive length + with a positive gap floor (lines 16 and 37 of the pinned [LP]): `-inf < b_- < b_+ < inf` and `0 < k_- < k_+ < inf`. Section 0 now + states that hypothesis, and section 8 classes the windows outside it (zero-touching or infinite gap windows, unbounded `B`, + singleton windows) as coefficient integrals only. The same wording defects were found on Math-#213 by Codex (thread 4151593177) and + on Math-#205 by C43 (review 5377957341, finding C43-205-H-01), and are repaired in every packet of the series. Every tabulated + window with a Theorem B reading has positive length, so no value changes. `window_coefficient.py` (blob `43b4f51b`), `RESULTS.json`, + the rules and the mutants are unchanged. +- **v1.2.1 (qualifier; NOTE only).** Section 5 gave one qualifier, `s > 0`, for all four bounds on `P(7/6, s)` and + `Q(7/6, s)`. The upper `Q` bound has denominator `1 - 1/(6s)` and needs `s > 1/6`; the other three hold for `s > 0`. Section 5 + now states the two domains separately (finding C197-C-01, GPT-5.6 Sol review 5402270651). Every certified use has + `s = 12 k_+^2 >= 48`, so no rule, value or window changes. `window_coefficient.py` (blob `43b4f51b`), `RESULTS.json`, the rules + and the mutants are unchanged. diff --git a/frontiers/c8_window_coefficient_planar_20260930/RESULTS.json b/frontiers/c8_window_coefficient_planar_20260930/RESULTS.json new file mode 100644 index 000000000..95443edfc --- /dev/null +++ b/frontiers/c8_window_coefficient_planar_20260930/RESULTS.json @@ -0,0 +1,454 @@ +{ + "object": "CL-C8-WINDOW-COEFFICIENT-PLANAR-20260930-v1", + "scientific_effect": "NONE", + "certified": true, + "mutant": null, + "passed": true, + "checks": { + "FLOAT_INSIDE": true, + "WIDTHS": true, + "D1_EXACT": true, + "D2_EXACT": true, + "HALF_LINE_EXACT": true, + "SYMMETRIC_CLOSED_FORM": true, + "FACTORIZATION_AND_TRANSFER": true, + "SIDE24_CONSISTENT": true, + "IMAGE_BOUND": true, + "MONOTONE": true, + "EXHAUSTION_BOUNDS": true, + "TRUNCATION_NESTING": true, + "LIBRARY_EXACT": true, + "PINNED": true + }, + "constants": { + "pi": [ + "3.14159265358979323846264338327950288419716939937510582097457", + "3.14159265358979323846264338327950288419716939937510582097528" + ], + "Gamma(7/6)": [ + "0.927719333630039200708349482534621018566466519145475576700351", + "0.927719333630039200708349482534621018566466519145475576939062" + ], + "(3/2)^(1/3)": [ + "1.14471424255333186780804221193967700891590692078793107209905", + "1.14471424255333186780804221193967700891590692078793107209906" + ], + "c_2_ref": [ + "0.0734069193060342710301359629577740500176642446843326718327112", + "0.0734069193060342710301359629577740500176642446843326718516298" + ], + "c_3_ref": [ + "0.0417759318405983433429366654285755564666815196610447378743467", + "0.0417759318405983433429366654285755564666815196610447378851238" + ], + "D_2": [ + "2.38384359055015523513604925862744194136738585267666320490062", + "2.38384359055015523513604925862744194136738585267666320490067" + ], + "E_10": [ + "1.87628822241927002839148543124729860590596995566066879593184E-12", + "1.87628822241927002839148543124729860590596995566066879593189E-12" + ], + "E_24": [ + "1.55768710432729157541591673725251489408951875282606475491013E-113", + "1.55768710432729157541591673725251489408951875282606475491015E-113" + ], + "reference_pipeline": { + "p_G(0)": [ + "0.159154943091895335768883763372514362034459645740456448747647", + "0.159154943091895335768883763372514362034459645740456448747690" + ], + "p_V(0)": [ + "0.0918881492369653415852210830521615735662310800611067754665492", + "0.0918881492369653415852210830521615735662310800611067754665730" + ], + "tau^2": [ + "6", + "6" + ], + "Var(f|V=0)": [ + "0.666666666666666666666666666666666666666666666666666666666666", + "0.666666666666666666666666666666666666666666666666666666666667" + ], + "alpha": [ + "-1.00000000000000000000000000000000000000000000000000000000001", + "-0.999999999999999999999999999999999999999999999999999999999998" + ], + "s^2": [ + "1.99999999999999999999999999999999999999999999999999999999999", + "2.00000000000000000000000000000000000000000000000000000000001" + ], + "a": [ + "0.577350269189625764509148780501957455647601751270126876018590", + "0.577350269189625764509148780501957455647601751270126876018619" + ], + "D_1": [ + "1.33333333333333333333333333333333333333333333333333333333332", + "1.33333333333333333333333333333333333333333333333333333333335" + ] + }, + "torus_L_ge_10_pipeline": { + "tau^2": [ + "5.99999999993620620043746318243520127092383944152174612410433", + "6.00000000006379379956205099443068289540744958018487295249852" + ], + "Var(f|V=0)": [ + "0.666666666663956472567600441931982432205375759490414612650934", + "0.666666666669376860765712681367591373688073400200114656643882" + ], + "alpha": [ + "-1.00000000001094501463084175886710069161437906864268741581522", + "-0.999999999989054985369247230475098717306286308708475500564920" + ], + "s^2": [ + "1.99999999998353035893643784881342842529532600769891002725696", + "2.00000000001646964106340242672621375314003526720983295383081" + ], + "a": [ + "0.577350269179755920971014469056138662564835832595451714046299", + "0.577350269199495608047463140857588123070738210606669274860559" + ] + } + }, + "birth_factor_d2": { + "B=[0,1] K=[0,inf]": [ + "0.482643456419274130204342046455569927291409037261634206304897", + "0.482643456419274130204342046455569927291409037261634206305485" + ], + "B=[-1,1] K=[0,inf]": [ + "0.663928895976061762717317046407613150044614501923424358067861", + "0.663928895976061762717317046407613150044614501923424358068706" + ], + "B=[-2,2] K=[0,inf]": [ + "0.961368034899749630361356986521550171704080172374964806002139", + "0.961368034899749630361356986521550171704080172374964806003061" + ], + "B=[-3,3] K=[0,inf]": [ + "0.998903294460189530893416070655534050708915929896394013240177", + "0.998903294460189530893416070655534050708915929896394013240906" + ], + "B=[-1/2,1/2] K=[0,inf]": [ + "0.358442197996678535188843520904169305195076569298745086647850", + "0.358442197996678535188843520904169305195076569298745086648281" + ], + "B=[0,inf] K=[0,inf]": [ + "0.804498890522114679044498291244909027016013286758326829866431", + "0.804498890522114679044498291244909027016013286758326829866588" + ], + "B=[-inf,0] K=[0,inf]": [ + "0.195501109477885320955501708755090972983986713241673170133412", + "0.195501109477885320955501708755090972983986713241673170133569" + ], + "B=[-inf,inf] K=[0,inf]": [ + "1", + "1" + ] + }, + "birth_factor_d3_reference": { + "B=[0,1] K=[0,inf]": [ + "0.346198792034071727129720724651084304927686716063723499474705", + "0.346198792034071727129720724651084304927686716063723499476462" + ], + "B=[-1,1] K=[0,inf]": [ + "0.391483956900814659103354232937101800571780379194523060847778", + "0.391483956900814659103354232937101800571780379194523060850329" + ], + "B=[-2,2] K=[0,inf]": [ + "0.866952146414130272672777763387197228415467480447458119616856", + "0.866952146414130272672777763387197228415467480447458119619497" + ], + "B=[-3,3] K=[0,inf]": [ + "0.993299304898946068171865525353353854842261808370909406605101", + "0.993299304898946068171865525353353854842261808370909406607351" + ], + "B=[-1/2,1/2] K=[0,inf]": [ + "0.156521520040231396072393838857240132245841156737994212895870", + "0.156521520040231396072393838857240132245841156737994212897637" + ], + "B=[0,inf] K=[0,inf]": [ + "0.953797733717050929943324920145130749895702338311747743575500", + "0.953797733717050929943324920145130749895702338311747743575995" + ], + "B=[-inf,0] K=[0,inf]": [ + "0.0462022662829490700566750798548692501042976616882522564240307", + "0.0462022662829490700566750798548692501042976616882522564244651" + ], + "B=[-inf,inf] K=[0,inf]": [ + "0.999999999999999999999999999999999999999999999999999999999970", + "1.00000000000000000000000000000000000000000000000000000000003" + ] + }, + "gap_factor": { + "B=[-inf,inf] K=[1/2,2]": [ + "0.067371733425641667348844418474402773431540422159891980011888", + "0.067371733425641667348844418474402773431540422159891980510232" + ], + "B=[-inf,inf] K=[1/4,4]": [ + "0.549058584986557263897063230087807397588045127124348013681756", + "0.549058584986557263897063230087807397588045127124348014058577" + ], + "B=[-inf,inf] K=[1/10,10]": [ + "0.926964889761576745209223993955897168714469180772854921726357", + "0.926964889761576745209223993955897168714469180772854922021551" + ], + "B=[-inf,inf] K=[1,3/2]": [ + "0.000010151769190845695720764137506279454502805037603198589150", + "0.000010151769190845695720764137506279454502805037603199105620" + ], + "B=[-inf,inf] K=[1/2,inf]": [ + "0.067371733425641667351782983740838050065730017167022536927218", + "0.067371733425641667351782983740838050065730017167022537681988" + ], + "B=[-inf,inf] K=[1,inf]": [ + "0.000010151772720957222577695215976077723566142870984026766891", + "0.000010151772720957222577695215976077723566142870984027539106" + ], + "B=[-inf,inf] K=[0,inf]": [ + "0.999999999999999999999999999999999999999999999999999999742690", + "1.00000000000000000000000000000000000000000000000000000025731" + ] + }, + "windows": [ + { + "window": "W1 (Math-#195 C8 band)", + "label": "B=[0,1] K=[1/2,2]", + "c_ref_closed_form": [ + "0.00238693802115294830910191174815811259945953287870981607041206", + "0.00238693802115294830910191174815811259945953287870981608868617" + ], + "c_ref_pipeline": [ + "0.00238693802115294830910191174815811259945953287870981607952763", + "0.00238693802115294830910191174815811259945953287870981607957055" + ], + "c_torus_L_ge_10": [ + "0.00238693802093000833306556850187113391514154121382235185541709", + "0.00238693802137588828515253852325300294969554258498402283462494" + ], + "c_torus_L_24": [ + "0.00238693802115294830910191174815811259945953287870981607952664", + "0.00238693802115294830910191174815811259945953287870981607957104" + ], + "fraction_of_c_2_ref": [ + "0.0325165262855096382792433353896868950333248293602701708817624", + "0.0325165262855096382792433353896868950333248293602701711223246" + ], + "c3_ref_closed_form": [ + "0.000974382366024250462471056546784220686368296122179707362638252", + "0.000974382366024250462471056546784220686368296122179707370102007" + ], + "fraction_of_c_3_ref": [ + "0.0233240127291986383785705280424892793574491580395614406229117", + "0.0233240127291986383785705280424892793574491580395614407955563" + ] + }, + { + "window": "W2", + "label": "B=[-1,1] K=[1/2,2]", + "c_ref_closed_form": [ + "0.00328349448038652830503281979285713298158514005642634751720787", + "0.00328349448038652830503281979285713298158514005642634754234607" + ], + "c_ref_pipeline": [ + "0.00328349448038652830503281979285713298158514005642634752974737", + "0.00328349448038652830503281979285713298158514005642634752980651" + ], + "c_torus_L_ge_10": [ + "0.00328349448011528868430297738967158884176760507872921354032614", + "0.00328349448065776792577811248260744465653432839930227894577537" + ], + "c_torus_L_24": [ + "0.00328349448038652830503281979285713298158514005642634752974621", + "0.00328349448038652830503281979285713298158514005642634752980695" + ], + "fraction_of_c_2_ref": [ + "0.0447300405932798097536288489300011168721084904691904960467211", + "0.0447300405932798097536288489300011168721084904691904963776431" + ], + "c3_ref_closed_form": [ + "0.00110183822983417559227488327247458245089634654946010030758751", + "0.00110183822983417559227488327247458245089634654946010031602917" + ], + "fraction_of_c_3_ref": [ + "0.0263749527847370768511830992317694976892736730900694815548994", + "0.0263749527847370768511830992317694976892736730900694817501651" + ] + }, + { + "window": "W3", + "label": "B=[-2,2] K=[1/4,4]", + "c_ref_closed_form": [ + "0.0387476495078853330990944074758335935429073960236041303980320", + "0.0387476495078853330990944074758335935429073960236041304346481" + ], + "c_ref_pipeline": [ + "0.0387476495078853330990944074758335935429073960236041304161787", + "0.0387476495078853330990944074758335935429073960236041304165008" + ], + "c_torus_L_ge_10": [ + "0.0387476495059082864122413221879862960661538973259378810381438", + "0.0387476495098623797860159479133872893972320587771530308724204" + ], + "c_torus_L_24": [ + "0.0387476495078853330990944074758335935429073960236041304161680", + "0.0387476495078853330990944074758335935429073960236041304165100" + ], + "fraction_of_c_2_ref": [ + "0.527847372893363732109523464742928827221572479181970571445284", + "0.527847372893363732109523464742928827221572479181970571808055" + ], + "c3_ref_closed_form": [ + "0.0198856576593802694157298186674110934904986498958104283087270", + "0.0198856576593802694157298186674110934904986498958104283275654" + ], + "fraction_of_c_3_ref": [ + "0.476007518761200982601259773239378310671673447326693808615962", + "0.476007518761200982601259773239378310671673447326693808944099" + ] + }, + { + "window": "W4", + "label": "B=[-3,3] K=[1/10,10]", + "c_ref_closed_form": [ + "0.0679710108353482512120527646190238090488676102917919155925355", + "0.0679710108353482512120527646190238090488676102917919156317484" + ], + "c_ref_pipeline": [ + "0.0679710108353482512120527646190238090488676102917919156113819", + "0.0679710108353482512120527646190238090488676102917919156129008" + ], + "c_torus_L_ge_10": [ + "0.0679710108323268083572236889563807391164774030184369438387178", + "0.0679710108383696940669737481785466177785844982045825852153091" + ], + "c_torus_L_24": [ + "0.0679710108353482512120527646190238090488676102917919156113579", + "0.0679710108353482512120527646190238090488676102917919156129183" + ], + "fraction_of_c_2_ref": [ + "0.925948282231765423197339710629572495756010512343767172008919", + "0.925948282231765423197339710629572495756010512343767172304466" + ], + "c3_ref_closed_form": [ + "0.0384653388278856051588096728419323529925748872628528449003559", + "0.0384653388278856051588096728419323529925748872628528449226157" + ], + "fraction_of_c_3_ref": [ + "0.920753580665902349943443707925549740321422262166540404523324", + "0.920753580665902349943443707925549740321422262166540404818627" + ] + }, + { + "window": "W5", + "label": "B=[-1/2,1/2] K=[1,3/2]", + "c_ref_closed_form": [ + "2.67114746860633516374560543036739171776297705071044034669885E-7", + "2.67114746860633516374560543036739171776297705071057624168707E-7" + ], + "c_ref_pipeline": [ + "2.67114746860633516374560543036739171776297705071050805069292E-7", + "2.67114746860633516374560543036739171776297705071050853767754E-7" + ], + "c_torus_L_ge_10": [ + "2.67114746807324830608435025505085471918899146216595139804375E-7", + "2.67114746913942202149484450097301994356243549297923040250202E-7" + ], + "c_torus_L_24": [ + "2.67114746860633516374560543036739171776297705071050805097547E-7", + "2.67114746860633516374560543036739171776297705071050853569325E-7" + ], + "fraction_of_c_2_ref": [ + "0.00000363882246232169390885151522599364967078991454021048905734174", + "0.00000363882246232169390885151522599364967078991454021067418198813" + ], + "c3_ref_closed_form": [ + "6.63807168231337686204000699240103751130764859282368826680113E-8", + "6.63807168231337686204000699240103751130764859282402597966307E-8" + ], + "fraction_of_c_3_ref": [ + "0.00000158897034484875822682393666632741554485958224902977317009189", + "0.00000158897034484875822682393666632741554485958224902985400877929" + ] + }, + { + "window": "FULL", + "label": "B=[-inf,inf] K=[0,inf]", + "c_ref_closed_form": [ + "0.0734069193060342710301359629577740500176642446843326718138228", + "0.0734069193060342710301359629577740500176642446843326718705182" + ], + "c_ref_pipeline": [ + "0.0734069193060342710301359629577740500176642446843326718326893", + "0.0734069193060342710301359629577740500176642446843326718516507" + ], + "c_torus_L_ge_10": [ + "0.0734069193040524528425066456233433118683569751567442924689061", + "0.0734069193080160892178158332713297376538347699357390195446541" + ], + "c_torus_L_24": [ + "0.0734069193060342710301359629577740500176642446843326718326786", + "0.0734069193060342710301359629577740500176642446843326718516612" + ], + "fraction_of_c_2_ref": [ + "0.999999999999999999999999999999999999999999999999999999742690", + "1.00000000000000000000000000000000000000000000000000000025731" + ], + "c3_ref_closed_form": [ + "0.0417759318405983433429366654285755564666815196610447378635960", + "0.0417759318405983433429366654285755564666815196610447378958745" + ], + "fraction_of_c_3_ref": [ + "0.999999999999999999999999999999999999999999999999999999742660", + "1.00000000000000000000000000000000000000000000000000000025735" + ] + } + ], + "float_reference_10sig": { + "birth_factor_d2": { + "B=[0,1] K=[0,inf]": "0.4826434564", + "B=[-1,1] K=[0,inf]": "0.663928896", + "B=[-2,2] K=[0,inf]": "0.9613680349", + "B=[-3,3] K=[0,inf]": "0.9989032945", + "B=[-1/2,1/2] K=[0,inf]": "0.358442198", + "B=[0,inf] K=[0,inf]": "0.8044988905", + "B=[-inf,0] K=[0,inf]": "0.1955011095", + "B=[-inf,inf] K=[0,inf]": "1" + }, + "birth_factor_d3_reference": { + "B=[0,1] K=[0,inf]": "0.346198792", + "B=[-1,1] K=[0,inf]": "0.3914839569", + "B=[-2,2] K=[0,inf]": "0.8669521464", + "B=[-3,3] K=[0,inf]": "0.9932993049", + "B=[-1/2,1/2] K=[0,inf]": "0.15652152", + "B=[0,inf] K=[0,inf]": "0.9537977337", + "B=[-inf,0] K=[0,inf]": "0.04620226628", + "B=[-inf,inf] K=[0,inf]": "1" + }, + "gap_factor": { + "B=[-inf,inf] K=[1/2,2]": "0.06737173343", + "B=[-inf,inf] K=[1/4,4]": "0.549058585", + "B=[-inf,inf] K=[1/10,10]": "0.9269648898", + "B=[-inf,inf] K=[1,3/2]": "1.015176919e-05", + "B=[-inf,inf] K=[1/2,inf]": "0.06737173343", + "B=[-inf,inf] K=[1,inf]": "1.015177272e-05", + "B=[-inf,inf] K=[0,inf]": "1" + }, + "Gamma(7/6)": "0.9277193336", + "owen_T": { + "h=0 a=1/2": "0.07379180883", + "h=1 a=1/2": "0.04306469112", + "h=3/2 a=1/2": "0.02200645633", + "h=2 a=4/5": "0.01063195814", + "h=5/2 a=1": "0.003085552691" + } + }, + "exact_relations": { + "factorization": "c_{B,K} = c_{2,ref} F_B G_K for the reference kernel; c_{2,ref} = 2 Gamma(7/6) (3/2)^(1/3) / (3 sqrt3 pi^(3/2))", + "G_K": "P(7/6, 12 k_+^2) - P(7/6, 12 k_-^2)", + "F_B": "Psi(b_+ sqrt(3/2)) - Psi(b_- sqrt(3/2)); Psi(x) = Phi(x) - 2 T(x, 1/sqrt3) - x phi(x) Phi(x/sqrt3)/2 - sqrt3 exp(-2x^2/3)/(4 pi)", + "F_symmetric": "F_{[-beta,beta]} = erf(beta sqrt3/2) - beta sqrt3 exp(-3 beta^2/4)/(4 sqrt pi)", + "F_half_line": "F_{[0,inf)} = 2/3 + sqrt3/(4 pi)", + "m_3_b": "(b^3 + b) phi(b) + (b^4 + 2 b^2 + 7) Phi(b) - 4 sqrt2 exp(-b^2/4) Phi(b/sqrt2); E_b m_{3,b} = 29/6 - sqrt6", + "image_bound": "E_L = 128 (76 L^6 + 15) exp(-L^2/2), d = 2, L >= 10", + "exhaustion": "1 - G_K = P(7/6, 12 k_-^2) + Q(7/6, 12 k_+^2) with exp(-s) s^(7/6)/Gamma(13/6) <= P(7/6, s) <= s^(7/6)/Gamma(13/6) and s^(1/6) e^-s/Gamma(7/6) <= Q(7/6, s) <= s^(1/6) e^-s/(Gamma(7/6)(1 - 1/(6s))); 1 - Psi(x) <= 2 Phi_bar(x) + x phi(x)/2 (x > 0); Psi(x) <= (3/2) Phi(x) (x <= 0)" + } +} diff --git a/frontiers/c8_window_coefficient_planar_20260930/SOURCE_FILES.json b/frontiers/c8_window_coefficient_planar_20260930/SOURCE_FILES.json new file mode 100644 index 000000000..775641bb3 --- /dev/null +++ b/frontiers/c8_window_coefficient_planar_20260930/SOURCE_FILES.json @@ -0,0 +1,112 @@ +{ + "schema": 1, + "object": "CL-C8-WINDOW-COEFFICIENT-PLANAR-20260930-v1", + "scientific_effect": "NONE", + "certified": true, + "review_status": "AUTHOR_SIDE_CERTIFIED_CONSTANT_NONAUTHOR_READS_OPEN", + "disposition": "CERTIFIED_ENCLOSURES_OF_THE_STATED_EXPRESSION_NO_REGISTER_CHANGE_C8_STAYS_OPEN", + "declarative": true, + "executed": false, + "base": "3e0a91b69892b9717564c592e7a966492a81566a", + "claim": "https://github.com/d6g8k5htny-coder/Math-/pull/195#issuecomment-5915784573", + "pins_on_main": [ + { + "label": "LP", + "path": "imports/lifetime_parent_20260925/UNIFORM_MATRIX_CAP_AND_LIFETIME.md", + "git_blob": "dfed3b8d318a3ab1950957f393307733a4bef3f2", + "role": "section 1 model and Theorem B; (11.3) the compact coefficient; section 15 the (f, V_u, A_u) / (G, t_u) factorization and the gamma integral; (5.4) contact law", + "workflow_checked": true + }, + { + "label": "S24", + "path": "coefficients/side24_v1/PROOF.md", + "git_blob": "44b66f04f89fcd87383b3603fa69f1feb64cdddd", + "role": "section 1 reference covariances, tau^2 = 6, p_G p_V = (2 pi)^-d / sqrt3, cone law A = Q + sqrt(2/3) Z I_m, D_1 = 4/3, D_2 = 29/6 - sqrt6, formula (1); section 2 image bound (2) whose d = 2 form is rederived in NOTE section 3", + "workflow_checked": true + }, + { + "label": "ENC", + "path": "coefficients/side24_v1/ENCLOSURE.json", + "git_blob": "57af39a05e14ed0ba8ebc00a9b4aca4dffb067c7", + "role": "the d = 2 enclosure [0.07340691930603427103, 0.07340691930603427104] quoted in the script for rule SIDE24_CONSISTENT", + "workflow_checked": true + } + ], + "read_not_pinned": [ + { + "path": "coefficients/side24_remainder_20260929/PROOF.md", + "git_blob_at_base": "0bcf0a6f5a608ce369e769103cd07fe71e0da844", + "role": "Theorem R (candidate): c_{2,24}/c_{2,ref} - 1 = P_2(24) e^-288 + O(10^-216); consistent with, and sharper than, the L = 24 transfer here" + }, + { + "path": "reviews/candidates_pending_20260928/CANDIDATES.md", + "git_blob_at_base": "02455f0561d51990e1486e5d4fbb4229c8a34f5a", + "role": "catalog entry C8 listing c_{B,K} among the constants not supplied; C8 stays OPEN" + } + ], + "unmerged_companion": { + "label": "C8-Z", + "pr": 195, + "head": "16da75fe21a91181e24b1bfc2d7bcdab599694c8", + "files": [ + { + "path": "frontiers/c8_normalizer_floor_planar_20260930/NOTE.md", + "git_blob": "a8b1f71dba5ee3930396423b5799efaab3ae1c62", + "role": "the declared C8 band b in [0, 1], k in [1/2, 2] (window W1 here) and the quoted contact law (5.4); z_* only, no c_{B,K}" + } + ], + "workflow_checked": false + }, + "revisions": [ + { + "version": "v1.1", + "finding": "author containment audit (the pattern of C41-205-C-01 on Math-#205)", + "review_context": "https://github.com/d6g8k5htny-coder/Math-/pull/205#pullrequestreview-5373681438", + "change": "NOTE.md only: the L >= 10 torus intervals of section 0 and the section 6 coefficient table rounded outward (upper endpoints had been truncated downward); image-bound values stated as approximations", + "unchanged": [ + "window_coefficient.py", + "RESULTS.json" + ] + }, + { + "version": "v1.2", + "finding": "window hypothesis wording (Codex thread 4151593177 on Math-#213; C43-205-H-01 on Math-#205)", + "review": "https://github.com/d6g8k5htny-coder/Math-/pull/205#pullrequestreview-5377957341", + "change": "NOTE.md only: section 0 states [LP] Theorem B hypothesis as compact windows of positive length, -inf < b_- < b_+ < inf and 0 < k_- < k_+ < inf (pinned [LP] lines 16 and 37); section 8 classes zero-touching or infinite gap windows, unbounded B and singleton windows as coefficient integrals only", + "unchanged": [ + "window_coefficient.py", + "RESULTS.json" + ] + }, + { + "version": "v1.2.1", + "finding": "C197-C-01 (wording only): the Q(7/6, s) upper bound needs s > 1/6, not s > 0", + "review": "https://github.com/d6g8k5htny-coder/Math-/pull/197#pullrequestreview-5402270651", + "change": "NOTE.md only: section 5 states the domains separately (both P bounds and the lower Q bound for s > 0; the upper Q bound for s > 1/6); every certified use has s = 12 k_+^2 >= 48", + "unchanged": [ + "window_coefficient.py", + "RESULTS.json" + ] + } + ], + "files": [ + { + "path": "NOTE.md", + "bytes": 25754, + "sha256": "6484a79daf4232b5a5e4e92ab9857be54ee386fdf8d6a6c19a476b224da25d13", + "git_blob": "8d73ae387e69ca13bca73b4926a9b884248b3f24" + }, + { + "path": "RESULTS.json", + "bytes": 17646, + "sha256": "012b3f48d4029c4c1f3d75bd151c0d252144f5bf64d1f43ac2d8fddf1295c2b8", + "git_blob": "95443edfcfb8466a31e93b16fae9c19bada77e86" + }, + { + "path": "window_coefficient.py", + "bytes": 36726, + "sha256": "efdc6e23a00fe95f26a9cd7e478d92aceab857e3c4eaaefa11a2ba5c2faf1e3a", + "git_blob": "43b4f51ba0e29c38468c40b4648f683848a3b218" + } + ] +} diff --git a/frontiers/c8_window_coefficient_planar_20260930/window_coefficient.py b/frontiers/c8_window_coefficient_planar_20260930/window_coefficient.py new file mode 100644 index 000000000..43b4f51ba --- /dev/null +++ b/frontiers/c8_window_coefficient_planar_20260930/window_coefficient.py @@ -0,0 +1,821 @@ +"""Compact-window coefficient c_{B,K} of [LP] Theorem B in the plane: exact factorization, closed forms, certified values. + +Standard library only. Run from anywhere: python -B -S window_coefficient.py [--mutant NAME] +Every printed interval [lo, hi] is a rigorous enclosure: interval arithmetic over `decimal` with directed rounding (exp and +sqrt are correctly rounded by the decimal module and widened by two units in the last place), pi from Machin's formula +with the alternating-series bracket, fractional powers from exact integer roots, erf and the lower incomplete gamma +function from their positive series with a geometric tail bound, Owen's T and arctan from alternating series bracketed by +consecutive partial sums. Nothing is fitted, sampled or extrapolated. + +Object certified ([LP] = imports/lifetime_parent_20260925/UNIFORM_MATRIX_CAP_AND_LIFETIME.md, (11.3) with the section 15 +factorization, at d = 2): + + c_{B,K} = 144 int_{S^1} p_G(0) p_V(0) [ int_B p_{f|V=0}(b) E[A^2 1{A<0} | f=b, V=0] db ] [ int_K k^(4/3) phi_tau(12k) dk ] dsigma(u), + +with G = grad f, V = (f_uu, f_uw), A = f_ww, tau^2 = Var(f_uuu | G=0), all in the frame (u, w), w = u^perp. For the +Euclidean reference kernel exp(-|z|^2/2): p_G(0) = 1/(2 pi), p_V(0) = 1/(2 pi sqrt3), f | V=0 ~ N(0, 2/3), +A | f=b, V=0 ~ N(-b, 2) (derived in NOTE section 2 from the jet covariances; it is the contact law [LP] (5.4) +as quoted in Math-#195 section 1), tau^2 = 6, and the coefficient factorizes exactly: + + c_{B,K} = c_{2,ref} F_B G_K, c_{2,ref} = 2 Gamma(7/6) (3/2)^(1/3) / (3 sqrt3 pi^(3/2)) (SIDE24 (1), d = 2) + G_K = P(7/6, 12 k_+^2) - P(7/6, 12 k_-^2) (regularized lower incomplete gamma) + F_B = Psi(b_+ sqrt(3/2)) - Psi(b_- sqrt(3/2)), + Psi(x) = Phi(x) - 2 T(x, 1/sqrt3) - (1/2) x phi(x) Phi(x/sqrt3) - (sqrt3/(4 pi)) exp(-2x^2/3) (T = Owen's function). + +For the torus kernel K_L (side L >= 10) every covariance entry of the 3-jet in any frame lies within +E_L = 128 (76 L^6 + 15) exp(-L^2/2) of its reference value (NOTE section 3); the same formulas are evaluated over those +entry intervals, so one enclosure covers every frame and every L >= 10, and a sharper one L = 24. The reference expression +in d = 3 (SIDE24 reference law A = -b I + Q, Q the 2x2 GOE with diagonal variance 2) is enclosed through the closed form + + m_{3,b} = (b^3 + b) phi(b) + (b^4 + 2b^2 + 7) Phi(b) - 4 sqrt2 exp(-b^2/4) Phi(b/sqrt2), + +whose Gaussian mean over b ~ N(0, 2/3) is D_2 = 29/6 - sqrt6 (SIDE24 section 1), a rule below. +The theorems behind (11.3) are consumed at their stated scopes; this script certifies arithmetic. Scientific effect: NONE. +""" +import argparse +import json +import math +import sys +import time +from decimal import Decimal, Context, ROUND_FLOOR, ROUND_CEILING, ROUND_HALF_EVEN, setcontext +from fractions import Fraction as Fr + +MUTANTS = ("no-owen", "mean-sign", "slope", "gamma-shape", "image-dropped", "shell-count", "tail-dropped", "prefactor", + "d3-cross", "window-swap") +MUT = None + +PREC = 60 +CF = Context(prec=PREC, rounding=ROUND_FLOOR, Emin=-9999999, Emax=9999999) +CC = Context(prec=PREC, rounding=ROUND_CEILING, Emin=-9999999, Emax=9999999) +CE = Context(prec=PREC, rounding=ROUND_HALF_EVEN, Emin=-9999999, Emax=9999999) +# Every arithmetic step below names one of the three contexts. Operator syntax on Decimals (unary minus, int * Decimal, +# Decimal - Decimal) rounds to the thread's current context, whose default precision is 28: that would silently shorten a +# 60-digit endpoint. The current context is therefore widened as a safety net, and rule LIBRARY_EXACT compares exp and +# sqrt of the decimal module, and the negation, against exact rational brackets. +setcontext(Context(prec=2 * PREC + 20, rounding=ROUND_HALF_EVEN, Emin=-9999999, Emax=9999999)) +ZERO, ONE, HALF = Decimal(0), Decimal(1), Decimal("0.5") +INF = math.inf +ROOT_DIGITS = 70 +SIDE24_D2 = ("0.07340691930603427103", "0.07340691930603427104") # coefficients/side24_v1/ENCLOSURE.json, dimensions.2 +PINNED = { + "c_2_ref": "0.0734069193060342710301359629577740500176642446843", + "F|[0,1]": "0.4826434564192741302043420464555699272914090372616", + "G|[1/2,2]": "0.0673717334256416673488444184744027734315404221598", + "Gamma(7/6)": "0.9277193336300392007083494825346210185664665191454", + "pi": "3.14159265358979323846264338327950288419716939937510", +} + + +def ulp(x): + if x == 0: + return Decimal(1).scaleb(-PREC - 30) + return Decimal(1).scaleb(x.adjusted() - PREC + 1) + + +class Iv: + """Closed interval [lo, hi] of Decimals; every operation encloses the exact result.""" + __slots__ = ("lo", "hi") + + def __init__(self, lo, hi=None): + if hi is None: + hi = lo + if lo > hi: + raise ValueError("empty interval") + self.lo, self.hi = lo, hi + + @staticmethod + def frac(q): + q = Fr(q) + n, d = Decimal(q.numerator), Decimal(q.denominator) + return Iv(CF.divide(n, d), CC.divide(n, d)) + + @staticmethod + def of(x): + return x if isinstance(x, Iv) else Iv.frac(x) + + def __add__(a, b): + b = Iv.of(b) + return Iv(CF.add(a.lo, b.lo), CC.add(a.hi, b.hi)) + __radd__ = __add__ + + def __neg__(a): + return Iv(a.hi.copy_negate(), a.lo.copy_negate()) # exact: unary minus would round to the default context + + def __sub__(a, b): + b = Iv.of(b) + return Iv(CF.subtract(a.lo, b.hi), CC.subtract(a.hi, b.lo)) + + def __rsub__(a, b): + return Iv.of(b) - a + + def __mul__(a, b): + b = Iv.of(b) + c = [(x, y) for x in (a.lo, a.hi) for y in (b.lo, b.hi)] + return Iv(min(CF.multiply(x, y) for x, y in c), max(CC.multiply(x, y) for x, y in c)) + __rmul__ = __mul__ + + def __truediv__(a, b): + b = Iv.of(b) + if b.lo <= 0 <= b.hi: + raise ZeroDivisionError("interval division by an interval containing 0") + c = [(x, y) for x in (a.lo, a.hi) for y in (b.lo, b.hi)] + return Iv(min(CF.divide(x, y) for x, y in c), max(CC.divide(x, y) for x, y in c)) + + def __rtruediv__(a, b): + return Iv.of(b) / a + + def sq(a): + if a.lo <= 0 <= a.hi: + return Iv(ZERO, max(CC.multiply(a.lo, a.lo), CC.multiply(a.hi, a.hi))) + return a * a + + def exp(a): + lo, hi = CE.exp(a.lo), CE.exp(a.hi) + return Iv(max(ZERO, CF.subtract(lo, CC.multiply(Decimal(2), ulp(lo)))), CC.add(hi, CC.multiply(Decimal(2), ulp(hi)))) + + def sqrt(a): + if a.lo < 0: + raise ValueError("sqrt of an interval with negative part") + lo, hi = CE.sqrt(a.lo), CE.sqrt(a.hi) + return Iv(max(ZERO, CF.subtract(lo, CC.multiply(Decimal(2), ulp(lo)))), CC.add(hi, CC.multiply(Decimal(2), ulp(hi)))) + + def width(a): + return CC.subtract(a.hi, a.lo) + + def contains(a, x): + x = Iv.of(x) + return a.lo <= x.lo and x.hi <= a.hi + + def intersects(a, b): + return a.lo <= b.hi and b.lo <= a.hi + + def mag(a): + return max(abs(a.lo), abs(a.hi)) + + def mid_float(a): + return float((a.lo + a.hi) / 2) + + def pair(a): + return [str(a.lo), str(a.hi)] + + +def hull(a, b): + return Iv(min(a.lo, b.lo), max(a.hi, b.hi)) + + +# ---------------- rigorous constants and special functions +def inroot(N, n): + """floor(N ** (1/n)) for integers N >= 0, n >= 1: integer Newton iteration started above the root.""" + if N < 2: + return N + x = 1 << ((N.bit_length() + n - 1) // n) + while True: + y = ((n - 1) * x + N // pow(x, n - 1)) // n + if y >= x: + break + x = y + if not (pow(x, n) <= N < pow(x + 1, n)): + raise ValueError("integer root failed") + return x + + +def root_frac(q, n): + """Rigorous bracket of q ** (1/n) for a positive rational q, width 10^-ROOT_DIGITS.""" + q = Fr(q) + if q <= 0: + raise ValueError("root of a nonpositive number") + p, d = q.numerator, q.denominator + scale = 10 ** ROOT_DIGITS + r = inroot(p * d ** (n - 1) * scale ** n, n) + den = d * scale + return Iv(Iv.frac(Fr(r, den)).lo, Iv.frac(Fr(r + 1, den)).hi) + + +def root_iv(x, n): + """x ** (1/n) for an interval x > 0 (monotone: endpoint brackets).""" + return Iv(root_frac(Fr(x.lo), n).lo, root_frac(Fr(x.hi), n).hi) + + +def pi_interval(): + def atan_inv(n, terms): + x = Fr(1, n) + partial, sums = Iv(ZERO), [] + for m in range(terms + 2): + t = Iv.frac(x ** (2 * m + 1) / (2 * m + 1)) + partial = partial + t if m % 2 == 0 else partial - t + sums.append(partial) + return hull(sums[-1], sums[-2]) # alternating series with decreasing terms + return atan_inv(5, 44) * 16 - atan_inv(239, 22) * 4 + + +PI = pi_interval() +SQRT2 = Iv.frac(2).sqrt() +SQRT3 = Iv.frac(3).sqrt() +SQRT2PI = (2 * PI).sqrt() +SQRTPI = PI.sqrt() +TINY = Decimal(10) ** (-PREC - 8) + + +def erf_point(x, coarse=False): + """erf(x) at a Decimal point: (2/sqrt pi) exp(-x^2) sum_n 2^n x^(2n+1)/(2n+1)!!, positive terms; once the term ratio + 2x^2/(2n+3) is at most 1/2 the omitted tail is at most twice the first omitted term. coarse=True stops at that point + (a valid, wider enclosure used by TRUNCATION_NESTING); the production run continues until the tail is negligible.""" + tail = MUT != "tail-dropped" + coarse = coarse or not tail + if x < 0: + return -erf_point(-x, coarse) + if x == 0: + return Iv(ZERO) + X = Iv(x) + x2 = X * X + t, S, n = X, Iv(ZERO), 0 + while True: + S = S + t + ratio = x2 * 2 / (2 * n + 3) + t = t * ratio + n += 1 + if ratio.hi <= HALF and (coarse or t.hi < S.lo * TINY): + break + if n > 200000: + raise RuntimeError("erf series did not converge") + rest = Iv(ZERO, CC.multiply(Decimal(2), t.hi)) if tail else Iv(ZERO) + return (S + rest) * (-x2).exp() * 2 / SQRTPI + + +def erf_iv(x, coarse=False): + return Iv(erf_point(x.lo, coarse).lo, erf_point(x.hi, coarse).hi) + + +def Phi(x): + return (1 + erf_iv(x / SQRT2)) / 2 + + +def Phi_bar(x): + return (1 - erf_iv(x / SQRT2)) / 2 + + +def phi(x): + return (-(x.sq()) / 2).exp() / SQRT2PI + + +def atan_iv(a, N=90): + """arctan(a) for an interval 0 <= a <= 1: halve the argument, then the alternating series bracketed by consecutive + partial sums (for each fixed argument the terms decrease, so the value lies between them).""" + a1 = a / (1 + (1 + a.sq()).sqrt()) + a1sq, p, S, prev = a1.sq(), a1, Iv(ZERO), None + for n in range(N + 1): + t = p / (2 * n + 1) + prev = S + S = S + t if n % 2 == 0 else S - t + p = p * a1sq + return 2 * hull(prev, S) + + +def owen_T(h, a, N=160, bracket=True): + """Owen's T(h, a) = (1/2 pi) int_0^a exp(-h^2 (1+x^2)/2)/(1+x^2) dx for 0 <= a <= 1, by Owen's series + T = (1/2 pi)[arctan a - sum_j c_j a^(2j+1)], c_j = (-1)^j/(2j+1) [1 - exp(-h^2/2) sum_{i<=j} (h^2/2)^i/i!]. + The bracket is P(Poisson(h^2/2) > j), decreasing in j, so for fixed (h, a) the terms alternate with decreasing size and + the sum lies between consecutive partial sums; interval evaluation of both encloses it for every point of the intervals.""" + if MUT == "no-owen": + return Iv(ZERO) + h2 = h.sq() / 2 + e = (-h2).exp() + pois, term, apow, a2 = Iv(ONE), Iv(ONE), a, a.sq() + S, prev = Iv(ZERO), None + for j in range(N + 1): + if j > 0: + term = term * h2 / j + pois = pois + term + cj = apow / (2 * j + 1) * (1 - e * pois) + prev = S + S = S + cj if j % 2 == 0 else S - cj + apow = apow * a2 + val = hull(prev, S) if bracket else S + return (atan_iv(a) - val) / (2 * PI) + + +def owen_T_eval(h, a): + if MUT == "tail-dropped": + return owen_T(h, a, N=6, bracket=False) + return owen_T(h, a) + + +def SHAPE(): + """Shape parameter of the gap-window incomplete gamma factor (mutant gamma-shape perturbs it).""" + return Fr(4, 3) if MUT == "gamma-shape" else Fr(7, 6) + + +def gamma_lower_point(x, a, coarse=False): + """gamma(a, x) = int_0^x s^(a-1) e^-s ds = x^a e^-x sum_n x^n/(a (a+1) ... (a+n)), positive terms; once the term ratio + x/(a+n) is at most 1/2 the omitted tail is at most twice the first omitted term. x a Decimal point >= 0, a = 7/6 or 4/3.""" + tail = MUT != "tail-dropped" + coarse = coarse or not tail + if x == 0: + return Iv(ZERO) + X = Iv(x) + t, S, n = Iv.frac(1 / a), Iv(ZERO), 0 + while True: + S = S + t + n += 1 + ratio = X / Iv.frac(a + n) + t = t * ratio + if ratio.hi <= HALF and (coarse or t.hi < S.lo * TINY): + break + if n > 200000: + raise RuntimeError("incomplete gamma series did not converge") + rest = Iv(ZERO, CC.multiply(Decimal(2), t.hi)) if tail else Iv(ZERO) + xa = X * root_frac(Fr(x), 6) if a == Fr(7, 6) else X * root_frac(Fr(x), 3) # x^a + return xa * (-X).exp() * (S + rest) + + +def gamma_lower(x, a, coarse=False): + """gamma(a, x) for an interval x >= 0 or x = INF (monotone in x).""" + if isinstance(x, float): + return GAMMA[a] + return Iv(gamma_lower_point(x.lo, a, coarse).lo, gamma_lower_point(x.hi, a, coarse).hi) + + +def gamma_complete(a, X=Decimal(120)): + """Gamma(a) = gamma(a, X) + Gamma(a, X), 1 < a < 2, with X^(a-1) e^-X <= Gamma(a, X) <= X^(a-1) e^-X / (1 - (a-1)/X).""" + low = gamma_lower_point(X, a) + xa1 = root_frac(Fr(X), 6) if a == Fr(7, 6) else root_frac(Fr(X), 3) + up = xa1 * (-Iv(X)).exp() + return low + Iv(up.lo, (up / (1 - Iv.frac(a - 1) / Iv(X))).hi) + + +GAMMA = {Fr(7, 6): gamma_complete(Fr(7, 6)), Fr(4, 3): gamma_complete(Fr(4, 3))} +GAMMA76 = GAMMA[Fr(7, 6)] +CBRT32 = root_frac(Fr(12), 3) / 2 # (3/2)^(1/3) = 12^(1/3)/2 +C72 = 1 / (72 * root_frac(Fr(72), 6)) # 72^(-7/6) +SIGMA_REF = Iv.frac(Fr(2, 3)).sqrt() # sd of f | V=0 for the reference kernel +D2_EXACT = Iv.frac(Fr(29, 6)) - Iv.frac(6).sqrt() # SIDE24 cone moment m = 2 +C2_REF = 2 * GAMMA76 * CBRT32 / (3 * SQRT3 * PI * SQRTPI) # SIDE24 (1), d = 2, D_1 = 4/3 +C3_REF = GAMMA76 * CBRT32 * D2_EXACT / (2 * SQRT3 * PI * PI * SQRTPI) # SIDE24 (1), d = 3 + + +# ---------------- the Gaussian integrals int_{-inf}^x t^n phi(t) Phi(a t) dt, n <= 4, and their limits +def G_finite(x, a): + rho2 = 1 + a.sq() + rho = rho2.sqrt() + Phx, phx, Phax = Phi(x), phi(x), Phi(a * x) + T = owen_T_eval(x, a) + Erho = (-(rho2 * x.sq()) / 2).exp() + Phrx = Phi(rho * x) + x2 = x.sq() + G0 = Phx / 2 - T + G1 = -phx * Phax + a / (rho * SQRT2PI) * Phrx + G2 = G0 - x * phx * Phax - a / (2 * PI * rho2) * Erho + G3 = -x2 * phx * Phax + a / (2 * PI) * (-(x / rho2) * Erho + SQRT2PI / (rho2 * rho) * Phrx) + 2 * G1 + G4 = -x * x2 * phx * Phax - a / (2 * PI) * (x2 / rho2 + 2 / rho2.sq()) * Erho + 3 * G2 + return [G0, G1, G2, G3, G4] + + +def G_limit(a, sign): + if sign < 0: + return [Iv(ZERO)] * 5 + rho2 = 1 + a.sq() + rho = rho2.sqrt() + g1 = a / (rho * SQRT2PI) + return [Iv.frac(Fr(1, 2)), g1, Iv.frac(Fr(1, 2)), a / (rho2 * rho * SQRT2PI) + 2 * g1, Iv.frac(Fr(3, 2))] + + +def G_at(x, a): + """x an interval or +-INF.""" + if isinstance(x, float): + return G_limit(a, 1 if x > 0 else -1) + return G_finite(x, a) + + +# ---------------- planar 3-jet pipeline for a covariance whose entries are within E of the reference values +class Planar: + """Frame (u, w): odd block (f_u, f_w, f_uuu) independent of the even block (f, f_uu, f_uw, f_ww) for any even kernel. + Reference entries: Var f = 1; Var f_u = Var f_w = 1; Var f_uuu = 15, Cov(f_uuu, f_u) = -3; Cov(f, f_uu) = Cov(f, f_ww) = -1; + Var f_uu = Var f_ww = 3, Cov(f_uu, f_ww) = 1, Var f_uw = 1; all other entries 0. Each entry other than Var f = 1 is + widened by +-E (E = 0: the reference kernel itself).""" + + def __init__(self, E): + E = Iv.of(E) + def ent(v): + return Iv.frac(v) + Iv(-E.hi, E.hi) + g11, g22, g12 = ent(1), ent(1), ent(0) + detG = g11 * g22 - g12.sq() + self.pG = 1 / (2 * PI * detG.sqrt()) + c1, c2, t66 = ent(-3), ent(0), ent(15) + self.tau2 = t66 - (c1.sq() * g22 - 2 * c1 * c2 * g12 + c2.sq() * g11) / detG + v11, v22, v12 = ent(3), ent(1), ent(0) # Sigma_V for V = (f_uu, f_uw) + detV = v11 * v22 - v12.sq() + self.pV = 1 / (2 * PI * detV.sqrt()) + def q(x, y): # x^T Sigma_V^{-1} y + return (x[0] * y[0] * v22 - (x[0] * y[1] + x[1] * y[0]) * v12 + x[1] * y[1] * v11) / detV + cf = (ent(-1), ent(0)) # Cov(f, V) + cA = (ent(1), ent(0)) # Cov(f_ww, V) + self.sig2 = 1 - q(cf, cf) # Var(f | V=0) + covfA = ent(-1) - q(cf, cA) # Cov(f, A | V=0) + varA = ent(3) - q(cA, cA) # Var(A | V=0) + self.alpha = covfA / self.sig2 # A | f=b, V=0 has mean alpha b + if MUT == "mean-sign": + self.alpha = -self.alpha + self.s2 = varA - covfA.sq() / self.sig2 # and variance s^2 + self.sig = self.sig2.sqrt() + self.s = self.s2.sqrt() + self.a = -self.alpha * self.sig / self.s # slope of Phi in the b-integral after b = sig x + if MUT == "slope": + self.a = self.a * Iv.frac(Fr(11, 10)) + self.D1 = (self.s2 + self.alpha.sq() * self.sig2) / 2 # E[A^2 1{A<0} | V=0] = Var(A|V=0)/2 + self.tau43 = root_iv(self.tau2.sq(), 3) # tau^(4/3) + self.rho2 = 1 + self.a.sq() + + def psi(self, x): + """int_{-inf}^x phi(t) [(1 + a^2 t^2) Phi(a t) + a t phi(a t)] dt (b-integral kernel after b = sig x, divided by s^2).""" + if isinstance(x, float): + return self.rho2 / 2 if x > 0 else Iv(ZERO) + G = G_finite(x, self.a) + return G[0] + self.a.sq() * G[2] - self.a / (2 * PI * self.rho2) * (-(self.rho2 * x.sq()) / 2).exp() + + def xval(self, b): + return b if isinstance(b, float) else Iv.frac(b) / self.sig + + def b_integral(self, B): + """int_B p_{f|V=0}(b) E[A^2 1{A<0} | f=b, V=0] db.""" + lo, hi = B + if MUT == "window-swap": + lo, hi = hi, lo + return self.s2 * (self.psi(self.xval(hi)) - self.psi(self.xval(lo))) + + def k_integral(self, K): + """int_K k^(4/3) phi_tau(12 k) dk = tau^(4/3) 72^(-7/6) [gamma(7/6, 72 k_+^2/tau^2) - gamma(7/6, 72 k_-^2/tau^2)] / (2 sqrt(2 pi)).""" + lo, hi = K + def s(k): + return k if isinstance(k, float) else 72 * Iv.frac(k * k) / self.tau2 + a = SHAPE() + return self.tau43 * C72 * (gamma_lower(s(hi), a) - gamma_lower(s(lo), a)) / (2 * SQRT2PI) + + def coefficient(self, B, K): + pref = 72 if MUT == "prefactor" else 144 + return pref * 2 * PI * self.pG * self.pV * self.b_integral(B) * self.k_integral(K) + + +# ---------------- reference closed forms (independent code path) +def Psi_ref(x): + """Psi(x) = Phi(x) - 2 T(x, 1/sqrt3) - x phi(x) Phi(x/sqrt3)/2 - sqrt3/(4 pi) exp(-2x^2/3); Psi(-inf) = 0, Psi(inf) = 1.""" + if isinstance(x, float): + return Iv(ONE) if x > 0 else Iv(ZERO) + a = 1 / SQRT3 + return Phi(x) - 2 * owen_T_eval(x, a) - x * phi(x) * Phi(x / SQRT3) / 2 - SQRT3 / (4 * PI) * (-(x.sq()) * 2 / 3).exp() + + +def x_ref(b): + return b if isinstance(b, float) else Iv.frac(b) / SIGMA_REF + + +def F_ref(B): + lo, hi = B + if MUT == "window-swap": + lo, hi = hi, lo + return Psi_ref(x_ref(hi)) - Psi_ref(x_ref(lo)) + + +def F_ref_symmetric(beta): + """Symmetric window B = [-beta, beta]: F = erf(beta sqrt3/2) - beta sqrt3 exp(-3 beta^2/4)/(4 sqrt pi).""" + beta = Iv.frac(beta) + return erf_iv(beta * SQRT3 / 2) - beta * SQRT3 * (-(beta.sq()) * 3 / 4).exp() / (4 * SQRTPI) + + +def P_reg(s): + """Regularized lower incomplete gamma P(7/6, s) (s an interval >= 0 or INF).""" + a = SHAPE() + return gamma_lower(s, a) / GAMMA76 + + +def G_ref(K): + lo, hi = K + def s(k): + return k if isinstance(k, float) else 12 * Iv.frac(k * k) + return P_reg(s(hi)) - P_reg(s(lo)) + + +def F3_ref(B): + """d = 3 reference window factor: int_B phi_{2/3}(b) m_{3,b} db / D_2 with + m_{3,b} = (b^3 + b) phi(b) + (b^4 + 2 b^2 + 7) Phi(b) - 4 sqrt2 exp(-b^2/4) Phi(b/sqrt2).""" + lo, hi = B + if MUT == "window-swap": + lo, hi = hi, lo + sig = SIGMA_REF + def term_i(b): # int phi_{2/3}(b) (b^3 + b) phi(b) db = -(2b^2/5 + 18/25) exp(-5b^2/4) / (2 pi sig) + if isinstance(b, float): + return Iv(ZERO) + b = Iv.frac(b) + return -(b.sq() * 2 / 5 + Iv.frac(Fr(18, 25))) * (-(b.sq()) * 5 / 4).exp() / (2 * PI * sig) + def term_ii(b): # int phi_{2/3}(b) (b^4 + 2 b^2 + 7) Phi(b) db, b = sig x + G = G_at(b if isinstance(b, float) else Iv.frac(b) / sig, sig) + return sig.sq().sq() * G[4] + 2 * sig.sq() * G[2] + 7 * G[0] + def term_iii(b): # int phi_{2/3}(b) 4 sqrt2 exp(-b^2/4) Phi(b/sqrt2) db = (4/sig) G_0(sqrt2 b; 1/2) + G = G_at(b if isinstance(b, float) else Iv.frac(b) * SQRT2, Iv.frac(Fr(1, 2))) + return 4 / sig * G[0] + cross = Iv.frac(Fr(1, 2)) if MUT == "d3-cross" else Iv(ONE) + total = (term_i(hi) - term_i(lo)) + (term_ii(hi) - term_ii(lo)) - cross * (term_iii(hi) - term_iii(lo)) + return total / D2_EXACT + + +# ---------------- image bound for the torus kernel (NOTE section 3) +def image_bound(L): + """E_L = 128 (76 L^6 + 15) exp(-L^2/2): every unit-direction contraction of D^q K_L(0) - D^q phi(0), q <= 6, in absolute + value (d = 2, L >= 10; shells |n|_inf = j carry 8 j points, |n|^6 <= 8 j^6, successive shell terms ratio < 1/2).""" + if MUT == "image-dropped": + return Iv(ZERO) + shells = 64 if MUT == "shell-count" else 128 + L = Fr(L) + return Iv.frac(shells * (76 * L ** 6 + 15)) * (-Iv.frac(L * L / 2)).exp() + + +# ---------------- floating-point controls (independent formulas; not part of the certificate) +def simpson(f, lo, hi, n=4000): + h = (hi - lo) / n + s = f(lo) + f(hi) + for i in range(1, n): + s += (4 if i % 2 else 2) * f(lo + i * h) + return s * h / 3 + + +def fPhi(x): + return 0.5 * (1 + math.erf(x / math.sqrt(2))) + + +def fphi(x): + return math.exp(-x * x / 2) / math.sqrt(2 * math.pi) + + +def fclip(b, sign): + return (12.0 * sign) if isinstance(b, float) else float(b) + + +def F2_float(B): + def m2(b): # Math-#178/#195: m_{2,b} = (b^2 + 2) Phi(b/sqrt2) + b sqrt2 phi(b/sqrt2) + return (b * b + 2) * fPhi(b / math.sqrt(2)) + b * math.sqrt(2) * fphi(b / math.sqrt(2)) + sig = math.sqrt(2 / 3) + lo, hi = fclip(B[0], -1), fclip(B[1], 1) + return 0.75 * simpson(lambda b: math.exp(-b * b / (2 * sig * sig)) / (sig * math.sqrt(2 * math.pi)) * m2(b), lo, hi) + + +def m3_float(b): # direct double integral: int_0^inf g(v^2) phi(v - b) dv, g from the Rayleigh integral + def g(w): + return w * w - 4 * w + 8 - 8 * math.exp(-w / 2) + return simpson(lambda v: g(v * v) * fphi(v - b), 0.0, 14.0 + abs(b), 1200) + + +def F3_float(B): + sig = math.sqrt(2 / 3) + lo, hi = fclip(B[0], -1), fclip(B[1], 1) + D2 = 29 / 6 - math.sqrt(6) + return simpson(lambda b: math.exp(-b * b / (2 * sig * sig)) / (sig * math.sqrt(2 * math.pi)) * m3_float(b), lo, hi, 1600) / D2 + + +def G_float(K): + lo = float(K[0]) ** (1 / 3) + hi = (6.0 if isinstance(K[1], float) else float(K[1])) ** (1 / 3) + full = 0.5 * 12 ** (-7 / 6) * math.gamma(7 / 6) + return simpson(lambda u: 3 * u ** 6 * math.exp(-12 * u ** 6), lo, hi) / full # k = u^3 + + +def owen_float(h, a): + return simpson(lambda x: math.exp(-h * h * (1 + x * x) / 2) / (1 + x * x), 0.0, a) / (2 * math.pi) + + +# ---------------- main +def fmt10(x): + return "%.10g" % x + + +def within(iv, fv, tol): + """The float control fv lies within tol of the enclosure iv (exact comparisons through CE).""" + f, t = Decimal(repr(fv)), Decimal(repr(tol)) + return CE.subtract(iv.lo, f) <= t and CE.subtract(f, iv.hi) <= t + + +def library_exact(): + """exp and sqrt of the decimal module, and the interval negation, against exact rational brackets: e^-q by the + rational series of e^(-q/64) raised to the 64th power (alternating tail below the last term), sqrt by an integer root.""" + ok = True + args = [Fr(48) - Fr(51035039649098175696, 10 ** 29), Fr(3), Fr(120), Fr(1, 2), Fr(288), Fr(5, 7)] + for q in args: + g = -q / 64 + parts = [] + term, ssum = Fr(1), Fr(0) + for k in range(0, 60): + ssum += term + parts.append(ssum) + term = term * g / (k + 1) + lo, hi = min(parts[-1], parts[-2]), max(parts[-1], parts[-2]) # alternating series with decreasing terms + exact = Iv(Iv.frac(lo ** 64).lo, Iv.frac(hi ** 64).hi) # e^-q = (e^(-q/64))^64, both endpoints positive + X = Iv.frac(q) + got = (-X).exp() + ok &= got.intersects(exact) and CC.divide(got.width(), got.lo) < Decimal(10) ** (-PREC + 3) + r = root_frac(q, 2) + ok &= X.sqrt().intersects(r) and CC.divide(X.sqrt().width(), r.lo) < Decimal(10) ** (-PREC + 3) + ok &= (-X).lo == X.hi.copy_negate() and (-X).hi == X.lo.copy_negate() + return ok + + +def window_label(B, K): + def e(v): + return "inf" if isinstance(v, float) and v > 0 else ("-inf" if isinstance(v, float) else str(Fr(v))) + return "B=[%s,%s] K=[%s,%s]" % (e(B[0]), e(B[1]), e(K[0]), e(K[1])) + + +def main(): + global MUT + ap = argparse.ArgumentParser() + ap.add_argument("--mutant", choices=MUTANTS) + args = ap.parse_args() + MUT = args.mutant + t0 = time.time() + if MUT: + globals()["GAMMA"] = {Fr(7, 6): gamma_complete(Fr(7, 6)), Fr(4, 3): gamma_complete(Fr(4, 3))} + + checks, notes = {}, {} + ref = Planar(0) + E10, E24 = image_bound(10), image_bound(24) + tor10, tor24 = Planar(E10), Planar(E24) + + windows = [ + ("W1 (Math-#195 C8 band)", (Fr(0), Fr(1)), (Fr(1, 2), Fr(2))), + ("W2", (Fr(-1), Fr(1)), (Fr(1, 2), Fr(2))), + ("W3", (Fr(-2), Fr(2)), (Fr(1, 4), Fr(4))), + ("W4", (Fr(-3), Fr(3)), (Fr(1, 10), Fr(10))), + ("W5", (Fr(-1, 2), Fr(1, 2)), (Fr(1), Fr(3, 2))), + ("FULL", (-INF, INF), (Fr(0), INF)), + ] + b_windows = [(Fr(0), Fr(1)), (Fr(-1), Fr(1)), (Fr(-2), Fr(2)), (Fr(-3), Fr(3)), (Fr(-1, 2), Fr(1, 2)), (Fr(0), INF), + (-INF, Fr(0)), (-INF, INF)] + k_windows = [(Fr(1, 2), Fr(2)), (Fr(1, 4), Fr(4)), (Fr(1, 10), Fr(10)), (Fr(1), Fr(3, 2)), (Fr(1, 2), INF), (Fr(1), INF), + (Fr(0), INF)] + + # --- factor tables + F2 = {window_label(B, (Fr(0), INF)): F_ref(B) for B in b_windows} + F3 = {window_label(B, (Fr(0), INF)): F3_ref(B) for B in b_windows} + GK = {window_label((-INF, INF), K): G_ref(K) for K in k_windows} + F2f = {window_label(B, (Fr(0), INF)): F2_float(B) for B in b_windows} + F3f = {window_label(B, (Fr(0), INF)): F3_float(B) for B in b_windows} + GKf = {window_label((-INF, INF), K): G_float(K) for K in k_windows} + + # --- coefficient table + rows = [] + for name, B, K in windows: + c_closed = C2_REF * F_ref(B) * G_ref(K) + rows.append({ + "window": name, "label": window_label(B, K), + "c_ref_closed_form": c_closed.pair(), + "c_ref_pipeline": ref.coefficient(B, K).pair(), + "c_torus_L_ge_10": tor10.coefficient(B, K).pair(), + "c_torus_L_24": tor24.coefficient(B, K).pair(), + "fraction_of_c_2_ref": (F_ref(B) * G_ref(K)).pair(), + "c3_ref_closed_form": (C3_REF * F3_ref(B) * G_ref(K)).pair(), + "fraction_of_c_3_ref": (F3_ref(B) * G_ref(K)).pair(), + }) + + # --- rules + tol = 1e-9 + ok = True + for key in F2: + for tab, ftab in ((F2, F2f), (F3, F3f)): + iv, fv = tab[key], ftab[key] + ok &= within(iv, fv, tol) + for key in GK: + iv, fv = GK[key], GKf[key] + ok &= within(iv, fv, tol) + owen_pts = [(Fr(0), Fr(1, 2)), (Fr(1), Fr(1, 2)), (Fr(3, 2), Fr(1, 2)), (Fr(2), Fr(4, 5)), (Fr(5, 2), Fr(1))] + for hq, aq in owen_pts: + iv, fv = owen_T_eval(Iv.frac(hq), Iv.frac(aq)), owen_float(float(hq), float(aq)) + ok &= within(iv, fv, tol) + gf = math.gamma(7 / 6) + ok &= within(GAMMA76, gf, 1e-13) + checks["FLOAT_INSIDE"] = bool(ok) + + checks["WIDTHS"] = bool( + all(F2[k].width() < Decimal("1e-40") and F3[k].width() < Decimal("1e-40") for k in F2) + and all(GK[k].width() < Decimal("1e-40") for k in GK) + and all(Iv(Decimal(r["c_ref_closed_form"][0]), Decimal(r["c_ref_closed_form"][1])).width() < Decimal("1e-40") for r in rows) + and all(Iv(Decimal(r["c_torus_L_24"][0]), Decimal(r["c_torus_L_24"][1])).width() < Decimal("1e-40") for r in rows) + and all(Iv(Decimal(r["c_torus_L_ge_10"][0]), Decimal(r["c_torus_L_ge_10"][1])).width() < Decimal("1e-10") for r in rows)) + + fullB, fullK = (-INF, INF), (Fr(0), INF) + checks["D1_EXACT"] = bool(ref.b_integral(fullB).contains(Fr(4, 3)) and ref.D1.contains(Fr(4, 3)) + and F_ref(fullB).contains(1) and G_ref(fullK).contains(1)) + checks["D2_EXACT"] = bool(F3_ref(fullB).contains(1)) # the closed form of m_{3,b} integrates to 29/6 - sqrt6 + half = F_ref((Fr(0), INF)) + checks["HALF_LINE_EXACT"] = bool(half.contains(Iv.frac(Fr(2, 3)) + SQRT3 / (4 * PI))) # T(0, 1/sqrt3) = 1/12 + checks["SYMMETRIC_CLOSED_FORM"] = bool(all(F_ref((-beta, beta)).intersects(F_ref_symmetric(beta)) + for beta in (Fr(1, 2), Fr(1), Fr(2), Fr(3)))) + + fact = True + for r in rows: + a = Iv(Decimal(r["c_ref_closed_form"][0]), Decimal(r["c_ref_closed_form"][1])) + b = Iv(Decimal(r["c_ref_pipeline"][0]), Decimal(r["c_ref_pipeline"][1])) + t10 = Iv(Decimal(r["c_torus_L_ge_10"][0]), Decimal(r["c_torus_L_ge_10"][1])) + t24 = Iv(Decimal(r["c_torus_L_24"][0]), Decimal(r["c_torus_L_24"][1])) + fact &= a.intersects(b) and t10.contains(b) and t24.intersects(b) and t10.width() > 10 * b.width() + checks["FACTORIZATION_AND_TRANSFER"] = bool(fact) + + side = Iv(Decimal(SIDE24_D2[0]), Decimal(SIDE24_D2[1])) + full24 = tor24.coefficient(fullB, fullK) + checks["SIDE24_CONSISTENT"] = bool(full24.intersects(side) and C2_REF.intersects(side + Iv(-side.hi * Decimal("1e-106"), side.hi * Decimal("1e-106")))) + + checks["IMAGE_BOUND"] = bool(Decimal("1.8e-12") < E10.hi < Decimal("1.95e-12") and E24.hi < Decimal("1e-112") and E24.lo > 0) + + mono = True + seq = [F_ref((Fr(-1, 2), Fr(1, 2))), F_ref((Fr(-1), Fr(1))), F_ref((Fr(-2), Fr(2))), F_ref((Fr(-3), Fr(3))), F_ref(fullB)] + mono &= all(seq[i].hi < seq[i + 1].lo for i in range(4)) and seq[0].lo > 0 + seqk = [G_ref((Fr(1), Fr(3, 2))), G_ref((Fr(1, 2), Fr(2))), G_ref((Fr(1, 4), Fr(4))), G_ref((Fr(1, 10), Fr(10))), G_ref(fullK)] + mono &= all(seqk[i].hi < seqk[i + 1].lo for i in range(4)) and seqk[0].lo > 0 + mono &= F_ref((Fr(0), Fr(1))).lo > 0 and F3_ref((Fr(0), Fr(1))).lo > 0 and F_ref((-INF, Fr(0))).lo > 0 + checks["MONOTONE"] = bool(mono) + + # exhaustion: two-sided incomplete-gamma bounds and the elementary birth-tail bounds (NOTE section 5) + exh = True + a76 = Fr(7, 6) + for klo, khi in ((Fr(1, 2), Fr(2)), (Fr(1, 4), Fr(4)), (Fr(1, 10), Fr(10))): + s_lo, s_hi = 12 * Iv.frac(klo * klo), 12 * Iv.frac(khi * khi) + Plo = P_reg(s_lo) + s76 = s_lo * root_iv(s_lo, 6) + g13 = Iv.frac(a76) * GAMMA76 # Gamma(13/6) + exh &= Plo.intersects(Iv(((-s_lo).exp() * s76 / g13).lo, (s76 / g13).hi)) + Qhi = 1 - P_reg(s_hi) + s16 = root_iv(s_hi, 6) * (-s_hi).exp() # s^(a-1) e^-s + exh &= Qhi.intersects(Iv((s16 / GAMMA76).lo, (s16 / (GAMMA76 * (1 - Iv.frac(Fr(1, 6)) / s_hi))).hi)) + for bhi in (Fr(1), Fr(2), Fr(3)): # 1 - Psi(x) <= 2 Phi_bar(x) + x phi(x)/2, x = b sqrt(3/2) + x = x_ref(bhi) + exh &= (1 - Psi_ref(x)).hi <= (2 * Phi_bar(x) + x * phi(x) / 2).lo + for blo in (Fr(0), Fr(-1), Fr(-2), Fr(-3)): # Psi(x) <= (3/2) Phi(x) for b <= 0 + x = x_ref(blo) + exh &= Psi_ref(x).hi <= (Iv.frac(Fr(3, 2)) * Phi(x)).lo + checks["EXHAUSTION_BOUNDS"] = bool(exh) + + # truncation nesting: half the Owen terms, and erf / incomplete gamma without the tail must be caught by the tail rule + nest = True + for hq, aq in owen_pts: + nest &= owen_T(Iv.frac(hq), Iv.frac(aq), N=80).intersects(owen_T_eval(Iv.frac(hq), Iv.frac(aq))) + for xq in (Fr(1, 2), Fr(3, 2), Fr(3), Fr(5), Fr(48)): + e_full, e_coarse = erf_iv(Iv.frac(xq)), erf_iv(Iv.frac(xq), coarse=True) + nest &= e_coarse.intersects(e_full) and e_coarse.width() >= e_full.width() + gl, gc = gamma_lower(Iv.frac(xq), Fr(7, 6)), gamma_lower(Iv.frac(xq), Fr(7, 6), coarse=True) + nest &= gc.intersects(gl) and gc.width() >= gl.width() + nest &= gamma_complete(Fr(7, 6), Decimal(90)).intersects(GAMMA76) + checks["TRUNCATION_NESTING"] = bool(nest) + + pinned_vals = {"c_2_ref": C2_REF, "F|[0,1]": F_ref((Fr(0), Fr(1))), "G|[1/2,2]": G_ref((Fr(1, 2), Fr(2))), + "Gamma(7/6)": GAMMA76, "pi": PI} + checks["LIBRARY_EXACT"] = bool(library_exact()) + checks["PINNED"] = bool(all(str(v.lo).startswith(p) and str(v.hi).startswith(p) for (k, p), v in + zip(PINNED.items(), (pinned_vals[k] for k in PINNED)))) + + if len(checks) != 14: + raise ValueError("rule count changed") + passed = all(checks.values()) + + out = { + "object": "CL-C8-WINDOW-COEFFICIENT-PLANAR-20260930-v1", + "scientific_effect": "NONE", + "certified": True, + "mutant": MUT, + "passed": passed, + "checks": checks, + "constants": { + "pi": PI.pair(), "Gamma(7/6)": GAMMA76.pair(), "(3/2)^(1/3)": CBRT32.pair(), + "c_2_ref": C2_REF.pair(), "c_3_ref": C3_REF.pair(), "D_2": D2_EXACT.pair(), + "E_10": E10.pair(), "E_24": E24.pair(), + "reference_pipeline": {"p_G(0)": ref.pG.pair(), "p_V(0)": ref.pV.pair(), "tau^2": ref.tau2.pair(), + "Var(f|V=0)": ref.sig2.pair(), "alpha": ref.alpha.pair(), "s^2": ref.s2.pair(), + "a": ref.a.pair(), "D_1": ref.D1.pair()}, + "torus_L_ge_10_pipeline": {"tau^2": tor10.tau2.pair(), "Var(f|V=0)": tor10.sig2.pair(), + "alpha": tor10.alpha.pair(), "s^2": tor10.s2.pair(), "a": tor10.a.pair()}, + }, + "birth_factor_d2": {k: v.pair() for k, v in F2.items()}, + "birth_factor_d3_reference": {k: v.pair() for k, v in F3.items()}, + "gap_factor": {k: v.pair() for k, v in GK.items()}, + "windows": rows, + "float_reference_10sig": { + "birth_factor_d2": {k: fmt10(v) for k, v in F2f.items()}, + "birth_factor_d3_reference": {k: fmt10(v) for k, v in F3f.items()}, + "gap_factor": {k: fmt10(v) for k, v in GKf.items()}, + "Gamma(7/6)": fmt10(gf), + "owen_T": {"h=%s a=%s" % (hq, aq): fmt10(owen_float(float(hq), float(aq))) for hq, aq in owen_pts}, + }, + "exact_relations": { + "factorization": "c_{B,K} = c_{2,ref} F_B G_K for the reference kernel; c_{2,ref} = 2 Gamma(7/6) (3/2)^(1/3) / (3 sqrt3 pi^(3/2))", + "G_K": "P(7/6, 12 k_+^2) - P(7/6, 12 k_-^2)", + "F_B": "Psi(b_+ sqrt(3/2)) - Psi(b_- sqrt(3/2)); Psi(x) = Phi(x) - 2 T(x, 1/sqrt3) - x phi(x) Phi(x/sqrt3)/2 - sqrt3 exp(-2x^2/3)/(4 pi)", + "F_symmetric": "F_{[-beta,beta]} = erf(beta sqrt3/2) - beta sqrt3 exp(-3 beta^2/4)/(4 sqrt pi)", + "F_half_line": "F_{[0,inf)} = 2/3 + sqrt3/(4 pi)", + "m_3_b": "(b^3 + b) phi(b) + (b^4 + 2 b^2 + 7) Phi(b) - 4 sqrt2 exp(-b^2/4) Phi(b/sqrt2); E_b m_{3,b} = 29/6 - sqrt6", + "image_bound": "E_L = 128 (76 L^6 + 15) exp(-L^2/2), d = 2, L >= 10", + "exhaustion": "1 - G_K = P(7/6, 12 k_-^2) + Q(7/6, 12 k_+^2) with exp(-s) s^(7/6)/Gamma(13/6) <= P(7/6, s) <= s^(7/6)/Gamma(13/6) and " + "s^(1/6) e^-s/Gamma(7/6) <= Q(7/6, s) <= s^(1/6) e^-s/(Gamma(7/6)(1 - 1/(6s))); 1 - Psi(x) <= 2 Phi_bar(x) + x phi(x)/2 (x > 0); Psi(x) <= (3/2) Phi(x) (x <= 0)", + }, + } + sys.stdout.write(json.dumps(out, indent=1) + "\n") + sys.stderr.write("seconds %.1f\n" % (time.time() - t0)) + sys.exit(0 if passed else 1) + + +if __name__ == "__main__": + main()