#!/usr/bin/env python3 """Measure the cell's third-sequence (frequency) exponent a = log_c A from the route's OWN data. Job #1824 answers the question job #961 left open: Wright arXiv:2604.25177v2 Theorem 2.1's saving is linear in a, so the whole bar question is whether the retained-frequency length A reaches a >= 11/114 (R=1) or a >= 13/114 (R = c^(1/19)). This script does NOT recompute any published quantity: it reads the numbers return #778 published (its served `nulength-x13-17.out`, sha256 adb32fae0b573095940064720428a335b0eff1ab771c9f2b9882397188125c75, /files/adb32fae...), reproduces the published mass-weighted means as a provenance control, and turns them into the exponent. The object (kl-nulength.py, #778): T99(n) = min{ T : 2 sum_{0= 0.99 sum_{0= 7 and f[0].isdigit(): try: out[x]["rows"].append((int(f[0]), int(f[1]), float(f[6]))) except ValueError: pass return out def means(rec): rows = rec["rows"] wn = sum(m for _, _, m in rows) return { "n_mean": sum(n * m for n, _, m in rows) / wn, "T_mean": sum(t * m for _, t, m in rows) / wn, "T_arith": sum(t for _, t, _ in rows) / len(rows), "T_max": max(t for _, t, _ in rows), "T_min": min(t for _, t, _ in rows), "mean_sqrt": sum(t / math.sqrt(n) * m for n, t, m in rows) / wn, "mean_r13": sum(t / n ** (13 / 28) * m for n, t, m in rows) / wn, "mean_r712": sum(t / n ** (7 / 12) * m for n, t, m in rows) / wn, "n_over_L": [n / rec["L"] for n, _, _ in rows], } def main(argv): path = argv[1] if len(argv) > 1 else LOCAL src, data = "literals (served file not found)", ROWS sha = None if os.path.exists(path): b = open(path, "rb").read() sha = hashlib.sha256(b).hexdigest() data = parse(path) src = path if sha == PUB_SHA else "%s (sha MISMATCH)" % path checks = [] def gate(name, ok, detail): checks.append({"gate": name, "ok": bool(ok), "detail": detail}) gate("served_input_sha256_matches_return_778", sha is None or sha == PUB_SHA, "sha256 %s" % (sha or "not read")) recs = {} for x in sorted(data): recs[x] = means(data[x]) # Control 1: the published mass-weighted means are reproduced from the rows. for x in (13, 17): r = recs[x] gate("control_published_mean_T99_over_sqrtn_x%d" % x, abs(r["mean_sqrt"] - ROWS[x]["pub_mean_sqrt"]) < 5e-4, "recomputed %.5g vs published %.5g (proves the parse is #778's object)" % (r["mean_sqrt"], ROWS[x]["pub_mean_sqrt"])) gate("control_published_mean_T99_over_n13_28_x%d" % x, abs(r["mean_r13"] - ROWS[x]["pub_mean_r13"]) < 5e-4, "recomputed %.5g vs published %.5g" % (r["mean_r13"], ROWS[x]["pub_mean_r13"])) # The route's flagship ratio falls because n grows while T99 does not. n_ratio = recs[17]["n_mean"] / recs[13]["n_mean"] t_ratio = recs[17]["T_mean"] / recs[13]["T_mean"] r_ratio = recs[17]["mean_r13"] / recs[13]["mean_r13"] gate("T99_is_flat_while_the_modulus_grows", t_ratio < 1.2 and n_ratio > 10, "modulus x%.2f, T99 x%.3f (arithmetic means %.3f -> %.3f)" % (n_ratio, t_ratio, recs[13]["T_arith"], recs[17]["T_arith"])) gate("route_48_flagship_ratio_is_the_arithmetic_of_a_flat_T99", r_ratio < 0.5, "T99/n^(13/28) falls x%.3f = T99 x%.3f / n^(13/28) x%.3f" % (r_ratio, t_ratio, n_ratio ** (13 / 28))) # Consequence: the two level levels put a at 0, far below both thresholds. a_fit = math.log(t_ratio) / math.log(n_ratio) gate("measured_a_is_below_the_R1_threshold", a_fit < A_THRESH_R1, "two-level fit a = ln(T99 ratio)/ln(modulus ratio) = %.4f < 11/114 = %.4f" % (a_fit, A_THRESH_R1)) gate("measured_a_is_below_the_Rq_threshold", a_fit < A_THRESH_RQ, "a = %.4f < 13/114 = %.4f" % (a_fit, A_THRESH_RQ)) need_growth = n_ratio ** A_THRESH_RQ gate("bar_would_require_T99_to_grow_but_it_does_not", need_growth > 1.3 and t_ratio < 1.2, "a = 13/114 requires T99 to grow x%.3f across a modulus factor x%.1f; measured x%.3f" % (need_growth, n_ratio, t_ratio)) # Independent route statement: the DERIVED truncation T(n) << n/L = o(e) is also O(1) here. gate("n_over_L_is_O1_so_the_derived_truncation_agrees", all(0.5 < v < 4.0 for x in recs for v in recs[x]["n_over_L"]), "measured n/L in [%.2f, %.2f] at x=13 and [%.2f, %.2f] at x=17 -> T(n) << n/L = O(1)" % (min(recs[13]["n_over_L"]), max(recs[13]["n_over_L"]), min(recs[17]["n_over_L"]), max(recs[17]["n_over_L"]))) # What the bounded A leaves: saving from #961, as a fraction of the requirement. gate("bounded_A_saving_is_3_14_of_the_bar", abs(SAVING_R1 / BAR - 3 / 14) < 1e-12, "3/380 divided by 7/190 = %.6f = 3/14 (R=1); 1/380 -> %.6f = 1/14 (R=c^1/19)" % (SAVING_R1 / BAR, SAVING_RQ / BAR)) out = { "question": "measure a = log_c A, the third-sequence exponent, against 11/114 and 13/114", "input": {"source": src, "sha256": sha, "published_sha256": PUB_SHA, "origin": "return #778, file nulength-x13-17.out"}, "per_level": {str(x): recs[x] for x in recs}, "modulus_ratio_x17_over_x13": n_ratio, "T99_ratio_x17_over_x13": t_ratio, "T99_arithmetic_means": [recs[13]["T_arith"], recs[17]["T_arith"]], "flagship_ratio_ratio": r_ratio, "a_two_level_fit": a_fit, "a_threshold_R1": A_THRESH_R1, "a_threshold_Rq": A_THRESH_RQ, "T99_growth_needed_for_bar": need_growth, "saving_at_bounded_A": {"R1": SAVING_R1, "Rq": SAVING_RQ, "bar": BAR, "fraction_R1": SAVING_R1 / BAR, "fraction_Rq": SAVING_RQ / BAR}, "checks": checks, "passed": all(c["ok"] for c in checks), } for c in checks: print("%s %-52s %s" % ("PASS" if c["ok"] else "FAIL", c["gate"], c["detail"])) print() print("modulus grew x%.1f (mean n %.3g -> %.3g) while T99 went %.3f -> %.3f" % (n_ratio, recs[13]["n_mean"], recs[17]["n_mean"], recs[13]["T_arith"], recs[17]["T_arith"])) print("two-level fit: a = %.4f (thresholds %.4f at R=1, %.4f at R=c^1/19)" % (a_fit, A_THRESH_R1, A_THRESH_RQ)) print("so A is O(1): the saving is 3/380 = %.6f, the bar 7/190 = %.6f, shortfall x%.3f" % (SAVING_R1, BAR, BAR / SAVING_R1)) return out if __name__ == "__main__": res = main(sys.argv) dest = os.path.join(os.path.dirname(os.path.abspath(__file__)), "a_measure48.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)