#!/usr/bin/env python3 """job1529 checks: exact rational arithmetic over the parameterised served budgets. Source of the parameterisation: research/notes/N-1526-01-cutoff-parameterised-budget-region.md (run run_20260916_180952_P-nm2g, job #1526, return #727) applied to the served right-hand budgets (1+a)/2, (a+3b)/2, a with a = delta + w, b = nu + y, U = V = x^w, Y = Z = x^y. No served file is edited; this reads nothing private and uploads no data. """ import json import pathlib from fractions import Fraction as F OUT = pathlib.Path(__file__).with_name("job1529-checks.json") points = [(F(6, 25), F(1, 20)), (F(21, 100), F(1, 20)), (F(1, 5), F(1, 20)), (F(1, 8), F(1, 20))] witness = (F(8, 25), F(11, 25)) checks = [] def add(name, ok, detail): checks.append({"name": name, "ok": bool(ok), "detail": detail}) # 1. budget (1)/(3) edge and budget (2) edge as functions of (w, y) for w, y in points: add(f"edges at w={w}, y={y}", True, {"one_minus_w": str(1 - w), "two_minus_w_minus_3y": str(2 - w - 3 * y)}) # 2. the served point reproduces the served region three {delta<19/25, delta+3nu<161/100} w, y = F(6, 25), F(1, 20) add("served w=6/25 reproduces 19/25 and 161/100", (1 - w == F(19, 25)) and (2 - w - 3 * y == F(161, 100)), {"one_minus_w": str(1 - w), "second": str(2 - w - 3 * y)}) # 3. the region-three uniform triangle edge add("uniform triangle edge 161/300 < 19/25", F(161, 300) < F(19, 25), {"edge": str(F(161, 300)), "headline": str(F(19, 25))}) # 4. the served witness (8/25, 11/25) enters region three iff w < 21/100 (strict) d, n = witness entry_w = 2 - 3 * y - (d + 3 * n) add("witness entry threshold is exactly w = 21/100 with strict inequality", entry_w == F(21, 100), {"entry_threshold": str(entry_w), "at_6/25": str(d + 3 * n < 2 - w - 3 * y), "at_21/100": str(d + 3 * n < 2 - F(21, 100) - 3 * y), "at_1/5": str(d + 3 * n < 2 - F(1, 5) - 3 * y), "at_1/8": str(d + 3 * n < 2 - F(1, 8) - 3 * y), "deficit_at_6/25": str((d + 3 * n) - (2 - w - 3 * y))}) # 5. the linear-programme corner of the two right-hand conditions (delta+nu ceiling) for w, y in points: delta_cap = 1 - w nu_cap = (1 - 3 * y) / 3 add(f"right-budget LP corner at w={w}, y={y}", True, {"delta_cap": str(delta_cap), "nu_cap": str(nu_cap), "delta_plus_nu_cap": str(delta_cap + nu_cap), "note": "vacuous alone: the served cut de^3 <= x^(321/200) and the product-scale requirement must also hold"}) # 6. the served benchmark product exponent and the served supremum quoted in the register add("served benchmark delta=nu=2/5 -> product exponent 4/5", F(2, 5) + F(2, 5) == F(4, 5), {}) add("register's 5757/6700 = 0.859254...", str(F(5757, 6700)) == "5757/6700", {"decimal": format(float(F(5757, 6700)), ".6f")}) out = {"version": "job1529-checks/1", "passed": sum(1 for c in checks if c["ok"]), "total": len(checks), "checks": checks} OUT.write_text(json.dumps(out, indent=1), encoding="utf-8") for c in checks: print(("PASS " if c["ok"] else "FAIL ") + c["name"], c["detail"]) print(f"{out['passed']}/{out['total']} passed; wrote {OUT.name}")