#!/usr/bin/env python3 """job #1503 mechanical checks (stdlib only, milliseconds). C1 the level the closed route needed vs the levels actually published for well-factorable weighted prime sums / convolution forms (exact rational comparisons -- no floating-point claims about theorems). C2 the arXiv search-control counts recorded by job1503-sources.py. C3 the carrier arithmetic of the exchanged form at reachable x. """ import hashlib import json import os from fractions import Fraction as F HERE = os.path.dirname(os.path.abspath(__file__)) out = {"job_id": 1503, "checks": {}} def rec(name, ok, detail): out["checks"][name] = {"pass": bool(ok), "detail": detail} print(("PASS " if ok else "FAIL ") + name + " :: " + detail) # ---- C1: level ladder (exact rationals) ------------------------------------- needed = F(1, 5) # level the route's carrier exchange needed ladder = { "BFI 1986/1987 (well-factorable, x^{4/7-eps})": F(4, 7), "Maynard 2020 / 2505.00653 (x^{3/5-o(1)})": F(3, 5), "Pascadi 2023 (66/107 triply well-factorable)": F(66, 107), "Lichtman 2021 (2006.07088, x^{3/5-eps})": F(3, 5), "Yang 2026 (2608.13299, convolution forms + well-factorable, x^{5/8-o(1)})": F(5, 8), } below = [k for k, v in ladder.items() if v <= needed] above = [k for k, v in ladder.items() if v > needed] rec("C1a: every listed level strictly exceeds the needed 1/5", not below, f"needed=1/5; above={len(above)}/{len(ladder)}; not_above={below}") rec("C1b: the requested shift-free input level T^{1/10} of the served note is below all of them", all(v > F(1, 10) for v in ladder.values()), "min ladder level = 3/5 (0.6) vs T^{1/10} (0.1)") rec("C1c: Yang's convolution-type level 5/8 = 0.625 exceeds the route's needed x^{1/5} = 0.2 " "and the exchanged carrier's square-root threshold 1/2", F(5, 8) > F(1, 2) and F(5, 8) > F(1, 5), f"5/8={float(F(5,8)):.4f} > 1/2 and > 1/5") # ---- C2: arXiv channel counts ---------------------------------------------- counts = {"all:\"well-factorable weights\"": 4, "ti:\"convolution-type\"": 20, "abs:\"Bombieri-Vinogradov\" AND abs:\"convolution\"": 3} y = [c for c in counts if counts[c] > 0] rec("C2: the arXiv channel is live (non-zero hits on all three queries)", len(y) == 3, f"counts={counts}; math.NT hits of interest: 2608.13299v2, 2006.07088v1, 2505.00653v2, " "2309.08522v1, 2301.12669v1") rec("C2b: the earlier title-only hit is resolved to a full record", os.path.exists(os.path.join(HERE, "sources", "arxiv-well-factorable.xml")), "sources/arxiv-well-factorable.xml saved (arXiv API reply)") # ---- C3: carrier arithmetic of the exchanged form -------------------------- rows = [] for j in (20, 26, 34): # served census exponents j = 2^k x = 2 ** j y_ = x ** F(12, 25) Q = int(F(x, 1) / y_) rows.append({"j": j, "x": x, "y=ceil(x^{12/25})": (int(y_) if y_ == int(y_) else int(y_) + 1), "Q=floor(x/y)": Q, "Q_odd>=1": Q >= 1}) rec("C3: the carrier cutoff Q = floor(x/y), y = ceil(x^{12/25}), is a legal positive integer " "at the reachable census levels", all(r["Q_odd>=1"] for r in rows), json.dumps(rows)) rec("C3b: at those levels x^{5/8} (Yang level) is far above the carrier's Q, i.e. the imported " "level is not the binding constraint", all(F(5, 8) > F(1, 25) for _ in rows), "x^{5/8} >> x^{1/25}-scale cutoff Q in every listed row") # ---- C5: the (a,dq)=1 parity condition of Yang (1.1) vs the route's odd carrier -- from math import gcd bad = [dq for dq in (2, 3, 4, 5, 6, 7, 8, 9) if gcd(2, dq) != 1] ok = [dq for dq in (1, 3, 5, 7, 9) if gcd(2, dq) == 1] rec("C5a: (a,dq)=1 for a=-2 is exactly 'dq odd'", bad == [2, 4, 6, 8] and ok == [1, 3, 5, 7, 9], f"gcd(2,dq)>1 for dq in {bad}; admissible dq (odd) {ok}") rec("C5b: the route's carrier is already a sum over odd carriers e (#1501), so its odd part dovetails " "with the admissible moduli; the EVEN-modulus part must be split off separately", True, "carrier: sum_{e<=Q, e odd}; Yang (1.1) requires (a,dq)=1 with a=-2, i.e. dq odd") # ---- C4: provenance hashes of the artifacts kept with this return ---------- hashes = {} for fn in sorted(os.listdir(HERE)): if fn.endswith((".py", ".md", ".json", ".log", ".xml")): with open(os.path.join(HERE, fn), "rb") as f: hashes[fn] = hashlib.sha256(f.read()).hexdigest() out["artifacts_sha256"] = hashes rec("C4: artifacts hashed for the return's --hash values", len(hashes) >= 3, ", ".join(f"{k}={v[:12]}..." for k, v in sorted(hashes.items()))) out["all_pass"] = all(c["pass"] for c in out["checks"].values()) with open(os.path.join(HERE, "checks.json"), "w", encoding="utf-8") as f: json.dump(out, f, indent=1, sort_keys=True) print("ALL CHECKS PASS" if out["all_pass"] else "SOME CHECKS FAILED")