"""Job #1391, type explore: exact verifier for the interface pricing. Every exponent is an exact rational and no comparison is floating point. Claims checked, in order: A. The record's own small-gcd chain, reproduced from structured-dispersion-estimate section 8 and RESEARCH-HANDOFF section 5. B. Milićević-Qin-Wu (arXiv:2511.07550) condition (1.2) and Blomer-Pascadi (arXiv:2607.24311) hypothesis N <= c, evaluated at the (D1) top sector. C. The Blomer-Pascadi window and payoff for the record's COMPLETED per-pair object. D. The band-only L2 count, its exact ratio to the record's per-pair bound, and the folding identity behind it (two exact lemmas). E. The harmonic gcd average cannot supply a power. F. The CRT separation of the record's completed kernel and the exactness of the record's gcd loss (exhaustive integer controls, no roots of unity assumed). G. The harmonic-band complete-period channel, priced against the q-modulus bound. Run: C:\\Python314\\python.exe check-bp-interface.py Exit status 0 iff every check passes. Prints one JSON object. """ import json import sys from fractions import Fraction as F from math import gcd RESULTS = [] def check(name, ok, detail=None): RESULTS.append({"check": name, "ok": bool(ok), "detail": detail}) return bool(ok) def frac(x): x = F(x) return "%d/%d" % (x.numerator, x.denominator) if x.denominator != 1 else str(x.numerator) # ------------------------------------------------------------- A. the record chain a_top = F(14, 25) # M ~ x^a b_top = F(1, 2) # N ~ x^b (N = E Q) sigma = F(1, 20) # q ~ x^sigma, the right prime power held outside the Cauchy alpha = a_top + b_top - 1 # top harmonic band A ~ x^alpha assert alpha == F(3, 50) E = b_top - sigma # e ~ x^E majorant = F(3, 2) * sigma + 3 * E check("A1 moment majorant Q^(3/2)E^3 exponent == 57/40", majorant == F(57, 40), frac(majorant)) cauchy = a_top + sigma check("A2 Cauchy factor MQ exponent == 61/100", cauchy == F(61, 100), frac(cauchy)) block = (majorant + cauchy) / 2 check("A3 block exponent == 407/400", block == F(407, 400), frac(block)) budget_moment = 2 - cauchy check("A4 sufficient moment budget == 139/100", budget_moment == F(139, 100), frac(budget_moment)) deficit_moment = majorant - budget_moment deficit_block = block - 1 check("A5 moment deficit == 7/200", deficit_moment == F(7, 200), frac(deficit_moment)) check("A6 block deficit == 7/400", deficit_block == F(7, 400), frac(deficit_block)) check("A7 block deficit is half the moment deficit", deficit_block == deficit_moment / 2) band_over_q = alpha - sigma check("A8 band/modulus exponent == 1/100: the band is LONGER than q", band_over_q == F(1, 100), frac(band_over_q)) band_over_sqrtq = alpha - sigma / 2 check("A9 band/sqrt(q) exponent == 7/200, i.e. exactly the required saving", band_over_sqrtq == F(7, 200), frac(band_over_sqrtq)) # ------------------------------------------------- B. located hypotheses at this box # MQW Theorem 1.1 conditions (1.2) with M = N = A (the harmonic band) and modulus q. mqw_c1 = alpha - (alpha + sigma / 4) check("B1 MQW cond 1 (M <= N q^(1/4)) holds", mqw_c1 < 0, frac(mqw_c1)) mqw_c2 = F(7, 5) * alpha + alpha - F(3, 2) * sigma check("B2 MQW cond 2 (M^(7/5)N < q^(3/2)) FAILS by x^(69/1000)", mqw_c2 == F(69, 1000), frac(mqw_c2)) mqw_c3 = 2 * alpha - F(5, 4) * sigma check("B3 MQW cond 3 (MN <= q^(5/4)) FAILS by x^(23/400)", mqw_c3 == F(23, 400), frac(mqw_c3)) bp_size_fail = alpha - sigma check("B4 Blomer-Pascadi N <= c FAILS at c = q by x^(1/100)", bp_size_fail == F(1, 100), frac(bp_size_fail)) # ------------------------------------------- C. BP window for the COMPLETED object M_exp = a_top # M ~ x^(14/25) c_exp = sigma + 2 * E # c = q e1 e2 N_exp = alpha + E # |R| <= A * E, R the pair numerator dual_exp = c_exp - M_exp # dual length c / M check("C1 completed-object modulus exponent == 19/20", c_exp == F(19, 20), frac(c_exp)) check("C2 R-length exponent == 51/100", N_exp == F(51, 100), frac(N_exp)) check("C3 dual length exponent == 39/100", dual_exp == F(39, 100), frac(dual_exp)) check("C4 both lengths <= the modulus, so the N <= c hypothesis now HOLDS", max(N_exp, dual_exp) <= c_exp, frac(max(N_exp, dual_exp) - c_exp)) lo = F(13, 28) * c_exp hi = F(7, 12) * c_exp check("C5 inside the BP window: N > c^(13/28)", N_exp > lo, "%s > %s" % (frac(N_exp), frac(lo))) check("C6 inside the BP window: N < c^(7/12)", N_exp < hi, "%s < %s" % (frac(N_exp), frac(hi))) check("C7 lower window margin == 193/2800", N_exp - lo == F(193, 2800), frac(N_exp - lo)) check("C8 upper window margin == 53/1200", hi - N_exp == F(53, 1200), frac(hi - N_exp)) # BP (1.3) versus the trivial bound (1.1): ratio = max bracket t1 = F(-7, 8) * N_exp + F(13, 32) * c_exp t2 = F(-11, 16) * N_exp + F(5, 16) * c_exp t3 = F(-1, 3) * N_exp + F(1, 9) * c_exp check("C9 bracket term 1 exponent == -193/3200", t1 == F(-193, 3200), frac(t1)) check("C10 bracket term 2 exponent == -43/800", t2 == F(-43, 800), frac(t2)) check("C11 bracket term 3 exponent == -29/450", t3 == F(-29, 450), frac(t3)) check("C12 term 2 dominates", t2 == max(t1, t2, t3), frac(t2)) gain = -t2 check("C13 per-pair gain over the trivial bound == 43/800", gain == F(43, 800), frac(gain)) check("C14 the gain exceeds the required 7/200", gain > deficit_moment, frac(gain - deficit_moment)) check("C15 the margin is 3/160", gain - deficit_moment == F(3, 160), frac(gain - deficit_moment)) crit = F(-1, 32) * c_exp check("C16 at the critical length the headline saving c^(-1/32) is x^(-19/640), far below the need", crit > -deficit_moment, "%s vs %s" % (frac(crit), frac(-deficit_moment))) # ------------------- D. the band-only L2 count and where the e-factor norm enters record = F(1, 2) * sigma + E check("D1 record per-pair exponent == 19/40", record == F(19, 40), frac(record)) band_l2 = sigma - alpha check("D2 band-only L2 count exponent == -1/100", band_l2 == F(-1, 100), frac(band_l2)) ratio = record - band_l2 check("D3 record / band-only-L2 ratio exponent == 97/200", ratio == F(97, 200), frac(ratio)) check("D4 that ratio factors exactly as (band/sqrt q) * sqrt(e1 e2)", ratio == band_over_sqrtq + E, "%s == %s + %s" % (frac(ratio), frac(band_over_sqrtq), frac(E))) check("D5 its first factor is exactly the required 7/200", ratio - E == deficit_moment, frac(ratio - E)) check("D6 its second factor is the e-factor norm count 9/20", E == F(9, 20), frac(E)) def poly_mul(p, q): out = [0] * (len(p) + len(q) - 1) for i, a in enumerate(p): for j, b in enumerate(q): out[i + j] += a * b return out poly_ok = True for n in range(2, 31): lhs = poly_mul([-1, 1], [1] * n) # (x - 1) * (1 + x + ... + x^(n-1)) rhs = [-1] + [0] * (n - 1) + [1] # x^n - 1 if lhs != rhs: poly_ok = False check("D7 (x-1)(1+x+...+x^(n-1)) = x^n - 1 for n = 2..30, over Z", poly_ok) count_ok = True for q in (8, 9, 12, 25): for m in range(1, q): g = gcd(m, q) counts = {} for lam in range(q): counts[(lam * m) % q] = counts.get((lam * m) % q, 0) + 1 if set(counts.values()) != {g} or any(r % g for r in counts): count_ok = False check("D8 lam -> lam*m mod q hits every multiple of gcd(m,q) exactly gcd(m,q) times", count_ok) def folding_check(): """Exact folding identity, verified with integer coefficients. Sum_{lam mod q} |Sum_h c_h e_q(lam h)|^2 = q * Sum_r |Sum_{h=r (q)} c_h|^2. Expanded, the left side is Sum_{h,h'} c_h c_h' G(h-h') with G(m) = Sum_lam e_q(lam m) = q if m = 0 (q) else 0, which is exactly what D7 and D8 establish. So the identity reduces to that expansion, checked here in integers. """ import itertools tests = 0 for q in (5, 7, 9, 12): for H in ([3, 8, 13], [2, 2, 7, 12], [1, 6, 11, 16, 21], [4]): for coeffs in itertools.product((-3, 1, 2), repeat=len(H)): left = 0 for c1, h1 in zip(coeffs, H): for c2, h2 in zip(coeffs, H): g = q if (h1 - h2) % q == 0 else 0 left += c1 * c2 * g folded = [0] * q for c, h in zip(coeffs, H): folded[h % q] += c right = q * sum(v * v for v in folded) if left != right: return tests, False tests += 1 return tests, True fold_tests, fold_ok = folding_check() check("D9 folding identity holds on %d integer configurations" % fold_tests, fold_ok) # ------------------------------------------------- E. harmonic gcd average cannot pay def sig(l): """sigma_{-1/2}(l) = Sum_{d|l} d^(-1/2).""" return sum(F(1) / F(d) for d in range(1, l + 1) if l % d == 0) e_ok = True worst = F(0) for L in (100, 500, 1000, 2000): total = sum(sig(l) for l in range(1, L + 1)) alt = sum(F(1) / F(d) * (L // d) for d in range(1, L + 1)) if total != alt or total > 3 * L: e_ok = False worst = max(worst, F(total, L)) check("E1 Sum_{l<=L} sigma_{-1/2}(l) = Sum_{d<=L} d^(-1/2) floor(L/d) <= 3L exactly", e_ok, "worst average order %s" % frac(worst)) check("E2 the average order is bounded, so the harmonic band gives no power", worst <= 3) # --------------------------------- F. CRT separation and exactness of the gcd loss def check_crt_reduction(): """The two steps of the complete-sum separation, in exact integer arithmetic. (i) R*tbar mod f equals the reduced numerator times tbar, for f in {q, e1, e2}, with R = h1 e2 - h2 e1; so the c-character splits into the three factors; (ii) the e-factors can be reindexed: t -> e2 t (mod e1) and t -> e1 t (mod e2) are bijections of the units, turning S(e1, h1 e2) into S(e1, h1) and S(e2, -h2 e1) into S(e2, -h2). """ tests = 0 for q, e1, e2 in ((5, 3, 7), (7, 4, 3), (9, 2, 5), (11, 3, 5), (8, 9, 5), (13, 2, 3), (25, 3, 7), (27, 4, 5), (32, 3, 5), (49, 2, 3)): if gcd(q, e1) != 1 or gcd(q, e2) != 1 or gcd(e1, e2) != 1: continue c = q * e1 * e2 for mod, mult in ((e1, e2), (e2, e1)): units = [t for t in range(1, mod) if gcd(t, mod) == 1] if sorted((mult * t) % mod for t in units) != sorted(units): return tests, False, "reindex %d x%d" % (mod, mult) for h1 in range(1, 6): for h2 in range(1, 6): R = h1 * e2 - h2 * e1 for t in range(1, c + 1): if gcd(t, c) != 1: continue tb = pow(t, -1, c) if (R * tb) % q != ((R % q) * pow(t % q, -1, q)) % q: return tests, False, ("q", q, e1, e2, h1, h2, t) if (R * tb) % e1 != (((h1 * e2) % e1) * pow(t % e1, -1, e1)) % e1: return tests, False, ("e1", q, e1, e2, h1, h2, t) if (R * tb) % e2 != (((-h2 * e1) % e2) * pow(t % e2, -1, e2)) % e2: return tests, False, ("e2", q, e1, e2, h1, h2, t) tests += 1 return tests, True, None crt_tests, crt_ok, crt_why = check_crt_reduction() check("F1 S(q e1 e2, R) separates as S(q,R) S(e1,h1) S(e2,-h2) (%s controls)" % crt_tests, crt_ok, crt_why) g_tests = 0 g_ok = True for q, e1, e2 in ((5, 3, 7), (7, 4, 3), (9, 2, 5), (11, 3, 5), (8, 9, 5), (25, 3, 7)): if gcd(q, e1) != 1 or gcd(q, e2) != 1 or gcd(e1, e2) != 1: continue for h1 in range(1, 9): for h2 in range(1, 9): R = h1 * e2 - h2 * e1 c = q * e1 * e2 if (gcd(abs(R), c) != gcd(abs(R), q) * gcd(abs(R), e1) * gcd(abs(R), e2) or gcd(abs(R), e1) != gcd(h1, e1) or gcd(abs(R), e2) != gcd(h2, e2)): g_ok = False g_tests += 1 check("F2 record gcd loss is EXACT: (R,c) = (R,q)(h1,e1)(h2,e2) (%s controls)" % g_tests, g_ok) # ------------------------------------------------- G. the harmonic-band period channel record_q = F(1, 2) * sigma check("G1 record bound with modulus q exponent == 1/40", record_q == F(1, 40), frac(record_q)) period_bound = 3 * sigma - 2 * alpha check("G2 period-cancellation bound exponent == 3/100", period_bound == F(3, 100), frac(period_bound)) check("G3 the period channel FAILS against the q-modulus bound by exactly x^(1/200)", period_bound - record_q == F(1, 200), frac(period_bound - record_q)) check("G4 the band is longer than one period at the top sector", alpha > sigma) # -------------------------------------------------------------------------- output passed = sum(1 for r in RESULTS if r["ok"]) total = len(RESULTS) out = { "job": 1391, "attempt": "09f9c3f805851f59b79243fd6bb9f208", "checks_passed": passed, "checks_total": total, "all_passed": passed == total, "failures": [r for r in RESULTS if not r["ok"]], "key_exponents": { "top_sector": {"a": frac(a_top), "b": frac(b_top), "sigma": frac(sigma), "alpha": frac(alpha), "E": frac(E)}, "moment_majorant": frac(majorant), "cauchy_factor": frac(cauchy), "block": frac(block), "sufficient_moment_budget": frac(budget_moment), "moment_deficit": frac(deficit_moment), "band_over_q": frac(band_over_q), "band_over_sqrt_q": frac(band_over_sqrtq), "bp_window_lower_margin": frac(N_exp - lo), "bp_window_upper_margin": frac(hi - N_exp), "bp_gain_per_pair": frac(gain), "bp_margin_over_requirement": frac(gain - deficit_moment), "record_over_band_only_l2": frac(ratio), "period_channel_failure": frac(period_bound - record_q), }, "results": RESULTS, } print(json.dumps(out, indent=1, sort_keys=True)) sys.exit(0 if passed == total else 1)