#!/usr/bin/env python3 """Price Wright (arXiv:2604.25177v2) Theorem 2.1 at route 48's blocking cell, ALL FIVE TERMS. Why this exists --------------- Return #914 read Wright Theorem 2.1 as a single "headline N-term" 1/N^{1/8} and concluded a saving of 39/760 at the record's shorter length, "the first located statement whose number CLEARS the bar". That is the max-term shortcut: Theorem 2.1's bracket is a SUM, so the bound is governed by its LARGEST term and the saving by the WEAKEST one. #916 priced all five at the record and got 3/380 (R=1) and 1/380 (R=c^{1/19}), below the 7/190 bar. This script re-derives both from the theorem text, names the binding term, and exposes the one quantity that decides the bar: the length A = c^a of the third (frequency) sequence. Exact rational arithmetic only (fractions.Fraction); no floating point in any gate. Theorem 2.1 verbatim (transcribed from the paper's HTML, section 2, v2 of 2026-08-07): Let M << N^2 and R << M^A. Then B(M,N,A,R) << M^eps ||alpha|| ||nu|| ||beta|| (AMN)^(1/2) R^(1/4) (1 + |theta|A/(MN))^(1/4) x ( 1/N^(1/8) + R^(1/8)N^(1/8)/M^(1/4) + M^(1/10)/(R^(3/20)A^(1/20)N^(3/20)) + N^(3/20)/(A^(3/20)M^(1/5)) + N^(3/8)/M^(1/2) ) for the trilinear form sum_{a~A,m~M,n~N,(m,nR)=1} alpha_m beta_n nu_a e(theta a mbar/(nR)). The third term is printed with A^(1/20) but the paper's own derivation (section 3) gives (M^(1/5)/(R^(3/10)A^(3/5)N^(3/10)))^(1/2) = M^(1/10)/(R^(3/20)A^(3/10)N^(3/20)). The two displays disagree, so both readings are priced (they differ only in how fast A helps). """ import json import sys from fractions import Fraction as F # Record parameters in c-units (corpus normalisation c = q e1 e2, q = c^(1/19), e1,e2 ~ c^(9/19)). M = F(51, 95) # longer length c^51/95 (route 29/9's record: M = F) N = F(39, 95) # shorter length c^39/95 (route 29/9's record: N = E) BAR = F(7, 190) # the requirement used by #780 and #916, in c-units RHO_Q = F(1, 19) # the fixed factor q, in c-units # Route 48's own stated cell lengths as a second reading: min(d,e) <= L^(2/5), complement ~ L^(3/5). ALT_M, ALT_N = F(3, 5), F(2, 5) def bracket(m, n, rho, a, a_exp): """The five bracket terms as c-exponents; a_exp is A's exponent inside the third term.""" return [ -n / 8, # 1/N^(1/8) rho / 8 - m / 4 + n / 8, # R^(1/8)N^(1/8)/M^(1/4) m / 10 - F(3, 20) * rho - a_exp * a - F(3, 20) * n, # M^(1/10)/(R^..A^..N^(3/20)) F(3, 20) * n - F(3, 20) * a - m / 5, # N^(3/20)/(A^(3/20)M^(1/5)) F(3, 8) * n - m / 2, # N^(3/8)/M^(1/2) ] def saving(m=M, n=N, rho=F(0), a=F(0), a_exp=F(3, 10)): """Saving over the trivial bound (the term count MNA) as a positive exponent, plus the terms. bound = MNA * R^(1/4) * (bracket), so the saving exponent is -(rho/4 + max_i t_i). """ t = bracket(m, n, rho, a, a_exp) return -rho / 4 - max(t), t def binding(rho, a, n=N, m=M, a_exp=F(3, 10)): t = bracket(m, n, rho, a, a_exp) return t.index(max(t)) + 1 def a_star(rho, n=N, m=M, a_exp=F(3, 10)): """Where the third term stops binding and the 1/N^(1/8) term takes over.""" t3_0 = m / 10 - F(3, 20) * rho - F(3, 20) * n t1 = -n / 8 return (t3_0 - t1) / a_exp def a_needed_for_bar(rho, n=N, m=M, a_exp=F(3, 10)): """Smallest a with saving >= BAR on the third-term-binding branch.""" t3_0 = m / 10 - F(3, 20) * rho - F(3, 20) * n # saving = -(rho/4 + t3_0 - a_exp*a) >= BAR return (BAR + rho / 4 + t3_0) / a_exp def main(): checks = [] def gate(name, ok, detail): checks.append({"gate": name, "ok": bool(ok), "detail": detail}) s0, t0 = saving(rho=F(0), a=F(0)) gate("R1_bounded_A_saving_is_3_380", s0 == F(3, 380), "#916's R=1 number reproduced from the theorem: %s" % s0) gate("binding_term_is_the_third", binding(F(0), F(0)) == 3, "weakest of the five terms is #3 %s; all terms %s" % (t0.index(max(t0)) + 1, [str(x) for x in t0])) s1, t1 = saving(rho=RHO_Q, a=F(0)) gate("Rq_bounded_A_saving_is_1_380", s1 == F(1, 380), "#916's R=c^(1/19) number reproduced: %s" % s1) maxterm = -t0[0] gate("term1_alone_reproduces_914_39_760", maxterm == F(39, 760), "term-1-only saving %s" % maxterm) gate("914_is_high_by_13_2_at_bounded_A", maxterm / s0 == F(13, 2), "39/760 / (3/380) = %s; the bracket is a sum, so the single-term reading is high by this" % (maxterm / s0)) st = a_star(F(0)) sq = a_star(RHO_Q) gate("a_star_R1_is_11_76", st == F(11, 76), "R=1: term 3 yields to term 1 at a = %s" % st) gate("a_star_Rq_is_9_76", sq == F(9, 76), "R=c^(1/19): term 3 yields to term 1 at a = %s" % sq) need1 = a_needed_for_bar(F(0)) needq = a_needed_for_bar(RHO_Q) gate("a_needed_R1_is_11_114", need1 == F(11, 114), "R=1 reaches the bar %s at a >= %s" % (BAR, need1)) gate("a_needed_Rq_is_13_114", needq == F(13, 114), "R=c^(1/19) reaches the bar at a >= %s" % needq) s_half_R1, _ = saving(rho=F(0), a=F(1, 2)) s_half_Rq, _ = saving(rho=RHO_Q, a=F(1, 2)) gate("a_half_R1_gives_39_760", s_half_R1 == F(39, 760), "R=1, a=1/2: saving %s, bar %s, ratio %s" % (s_half_R1, BAR, s_half_R1 / BAR)) gate("a_half_Rq_gives_29_760", s_half_Rq == F(29, 760), "R=c^(1/19), a=1/2: saving %s, bar %s, ratio %s" % (s_half_Rq, BAR, s_half_Rq / BAR)) gate("a_half_both_clear_the_bar", s_half_R1 > BAR and s_half_Rq > BAR, "at the sqrt(n) scale the bar is cleared: 39/28 (R=1) and 29/28 (R=c^1/19) of it") # sanity: saving is continuous at the crossover (both branches meet) one = saving(rho=F(0), a=a_star(F(0)))[0] two = saving(rho=RHO_Q, a=a_star(RHO_Q))[0] gate("branches_meet_at_crossover", one == F(39, 760) and two == F(29, 760), "at a* the saving equals the term-1 value: %s and %s" % (one, two)) s_p1, _ = saving(rho=RHO_Q, a=F(1, 2), a_exp=F(1, 20)) gate("printed_A_exponent_also_decides", abs(s_p1 - BAR) < F(1, 100), "with the printed A^(1/20), a=1/2 gives %s vs bar %s (a=1/2 is near the threshold)" % (s_p1, BAR)) alt = {} for a in (F(0), F(1, 2), F(1)): s, t = saving(ALT_M, ALT_N, F(0), a) alt[str(a)] = {"saving": str(s), "vs_bar": str(s / BAR), "binding": t.index(max(t)) + 1} gate("alt_lengths_bounded_A_is_exactly_zero", alt["0"]["saving"] == "0", "route-48's own length reading (L^2/5, L^3/5): a=0 saving %s - the third term is exactly " "1 there, so a bounded frequency sequence buys nothing at all" % alt["0"]["saving"]) gate("alt_lengths_clear_the_bar_from_a_1_2", F(alt["1/2"]["vs_bar"]) > 1, "same reading at a = 1/2: saving %s = %s x the bar" % (alt["1/2"]["saving"], alt["1/2"]["vs_bar"])) out = { "theorem": "arXiv:2604.25177v2 Theorem 2.1 (five terms, transcribed)", "parameters": {"M": str(M), "N": str(N), "bar": str(BAR), "rho_q": str(RHO_Q), "alt_M": str(ALT_M), "alt_N": str(ALT_N)}, "terms_R1_a0": [str(x) for x in t0], "terms_Rq_a0": [str(x) for x in t1], "saving_R1_a0": str(s0), "saving_Rq_a0": str(s1), "binding_term_index": 3, "term1_only_reading": str(maxterm), "term1_over_sum_correct_at_a0": str(maxterm / s0), "a_star_R1": str(st), "a_star_Rq": str(sq), "a_needed_for_bar_R1": str(need1), "a_needed_for_bar_Rq": str(needq), "saving_R1_a_half": str(s_half_R1), "saving_Rq_a_half": str(s_half_Rq), "ratio_R1_a_half": str(s_half_R1 / BAR), "ratio_Rq_a_half": str(s_half_Rq / BAR), "alt_length_reading": alt, "printed_A_exponent_saving_a_half": str(s_p1), "checks": checks, "passed": all(c["ok"] for c in checks), } for c in checks: print("%s %-38s %s" % ("PASS" if c["ok"] else "FAIL", c["gate"], c["detail"])) print() print("saving(R=1, A=O(1)) = c^-(%s) binding term #3 of 5" % s0) print("saving(R=c^1/19, A=O(1)) = c^-(%s)" % s1) print("bar = c^-(%s)" % BAR) print("single-term (#914) reading= c^-(%s) = %s x the sum-correct value at A=O(1)" % (maxterm, maxterm / s0)) print("thresholds: bar met iff a >= %s (R=1) or a >= %s (R=c^1/19); crossover %s / %s" % (need1, needq, st, sq)) return out if __name__ == "__main__": res = main() dest = sys.argv[1] if len(sys.argv) > 1 else "wright48price.json" with open(dest, "w", encoding="utf-8", newline="\n") as fh: json.dump(res, fh, indent=1, sort_keys=True) sys.exit(0 if res["passed"] else 1)