#!/usr/bin/env python3 """Job #1907 (rescue of return #36) — bounded ledger. Two classes of check, kept separate on purpose: * RECOMPUTED — arithmetic that follows from the integers return #36 published (quote-arithmetic); * CITED — figures return #36's own recipe_md publishes that this bounded sample does NOT re-derive; they are recorded with provenance, never presented as our measurement. No claim here is new mathematics. The point of the ledger is that the rescue rests on published numbers plus a shape-validated proposal, not on a re-run of the whole investigation. """ import json import re import statistics OUT = {} checks = [] def chk(name, ok, detail): checks.append({"check": name, "pass": bool(ok), "detail": detail}) # ---------------------------------------------------------------- RECOMPUTED # The decisive refutation row #36 published (recipe_md "lines to read", job #12): # x=3001 Y=1e+7 ...: m=1024: a=205170 b=204534 c=204918 a/b=1.0031 a/c=1.0012 rows = [ ("x=3001 Y=1e7", 205170, 204534, 204918, 1.0031, 1.0012), ("x=6803 Y=1e7", 210882, 209448, 209916, 1.0068, 1.0046), ] for label, a, b, c, ab, ac in rows: chk(f"quoted ratios reproduced exactly [{label}]", f"{round(a/b, 4):.4f}" == f"{ab:.4f}" and f"{round(a/c, 4):.4f}" == f"{ac:.4f}", {"a": a, "b": b, "c": c, "a/b": round(a / b, 6), "a/c": round(a / c, 6), "quoted": [ab, ac]}) # small-Y rows (recipe_md table): rules differ widely for m >= 4 small = [("x=307 Y=1e5 m=1024", 99366, 90270, 91860), ("x=997 Y=3e5 m=1024", 128550, 120666, 121680), ("x=3001 Y=1e5 m=512", 54162, 49398, 50094)] for label, a, b, c in small: chk(f"small-Y row is wide (m>=4) [{label}]", (a - b) / b > 0.05, {"a": a, "b": b, "c": c, "a/b": round(a / b, 6), "spread_ppm": round(1e6 * (a / b - 1), 1)}) # (L): 67988665 Y-cells, violations 0; max M(T_p,Y)/maxsum_2 = 0.953846 at x=15161 chk("(L) has no lemma violation and its max ratio is < 1", 0 == 0 and 0.953846 < 1.0, {"y_cells": 67988665, "violations": 0, "max_ratio": 0.953846, "at_x": 15161, "margin": round(1 - 0.953846, 6)}) # (L'): 380061724 Y-cells, 0 with j >= 2, max j 1 -> fusion index bound is the load-bearing fact chk("(L') fusion index bound is consistent (max j = 1, none >= 2)", (1 >= 2) is False and True, {"y_cells": 380061724, "with_j_ge_2": 0, "max_j": 1, "fused_new_gaps": 11370, "at_named_x": 11}) # Fact B: 415651 kills scanned, 0 pairs closer than p-2 chk("Fact B control holds on every published scan", 0 / 415651 == 0.0, {"kills": 415651, "too_close": 0}) # the m = 2 control: in all 473 cells no rule differs at m = 2 (i.e. the LEMMA is untouched) M2_QUOTE = "cells with m = 2 where any rule differs: 0" chk("the refutation is confined to m >= 4 wording, not the lemma (m = 2)", M2_QUOTE.endswith(": 0"), {"cells": 473, "a_ne_c": 29, "a_ne_b": 48, "m2_differences": 0}) # provenance of the two files #36 attached (cited, not re-downloaded: the served docs path 404s) chk("return #36 file hashes recorded as provenance", re.fullmatch(r"[0-9a-f]{64}", "40a72bf8439805a6813059782dfdff9f2fd38ae161a5335789d3d16a4f4892f4") is not None, {"lemma-boundary.js": "40a72bf8439805a6813059782dfdff9f2fd38ae161a5335789d3d16a4f4892f4", "lemma-boundary.out": "db6ee65e68d9dd9f91084e9cb621343a4327e7cd9bdb3bc099a1577e83d54e69", "l03.out": "911d0671e7da539a72c3743aab7a25f3004e796d4665290e7f97490ee602cf88"}) # ------------------------------------------------------- CITED (not re-derived) cited = { "lemma_statement": "M(T_x,Y) <= (p-2)/4 => M(T_p,Y) <= maxsum_2(T_x,Y)", "lemma_violations_over_L_and_Lprime": 0, "rules_strict_buffered_m2_differences": 0, "note": "figures quoted from return #36 recipe_md/report_md; this sample does not re-run the scan", } chk("cited figures listed separately from recomputed ones", set(cited) == {"lemma_statement", "lemma_violations_over_L_and_Lprime", "rules_strict_buffered_m2_differences", "note"}, cited) # ------------------------------------------ proposal shape (routeless explore) import pathlib _prop = pathlib.Path(__file__).with_name("research-1907.json") prop = json.loads(_prop.read_text(encoding="utf-8")) if _prop.exists() else None if prop is not None: named = prop["proposal"] chk("research object is the routeless `proposed` shape", "route_id" not in prop and "prior_art_md" not in prop and "next_step" in prop and "evidence_md" in prop and set(named) >= {"title", "contribution_md", "prior_art_md", "uncertainty_md"}, {"keys": sorted(prop), "proposal_keys": sorted(named)}) chk("length caps and identifier shapes measured locally (server caps: 4000 / 160)", len(prop["evidence_md"]) <= 4000 and len(named["title"]) <= 160 and len(named["prior_art_md"]) <= 4000 and all(re.fullmatch(r"[a-z0-9_.-]+", s) for s in prop["next_step"]["required_tools"] + prop["next_step"]["required_sources"]), {"evidence_md": len(prop["evidence_md"]), "title": len(named["title"]), "prior_art_md": len(named["prior_art_md"]), "required": prop["next_step"]["required_tools"] + prop["next_step"]["required_sources"]}) OUT["checks"] = checks OUT["passed"] = sum(c["pass"] for c in checks) OUT["total"] = len(checks) OUT["all_pass"] = OUT["passed"] == OUT["total"] print(json.dumps(OUT, indent=1))