p32_dark.py — frc/ledgers

The ledger file frc/ledgers/p32_dark.py of The Dark Sector over Finite Substrate, rendered with an anchor per line: the marked lines (# 32:C2 (p32010): a predicate and its accession key) are the checks that decide the predicates of the paper's predicate ledger — 23 of 23 checks passing; the predicates' theorems are the declarations of Dark in the core. ▶ run the predicates on Google Colab.

32-dark ledgerfrc/ledgers/p32_dark.py · 43.1 KBp32_dark.pyColab
1"""p32_dark — the ledger file of 32-dark (the 32-dark migration, 18 October 2026).23"The Dark Sector over Finite Relational Substrate" (Akhtman, Geifman and Voether, preprint 2026). The paper's predicate4ledger is docs/32-dark/32-dark-ledger.json. This file binds its python-witnessed predicates to the framework: the table5of keys (generated from the ledger by ci/make_ledgers.py) and the checks of eight blocks. The exact checks call the dark6theme (frc/dark.py) over the gravity theme's Gauss law and the extension theme's F_{p²}; the continuum readings call the7chart theme (frc/chart.py, frc/chart_dark.py, the SPARC tables under frc/data/sparc/) and compare its readings with8rational bounds. Each check names the predicate(s) it witnesses (LEDGER) and carries a `# 32:XN (<key>)` marker when it9decides one (PREDICATES).1011The checks are EXACT or CHART, one kind per check. An EXACT check decides by integer, finite-field or rational12arithmetic: the 5³ box in Fractions, Z[i], Z[ω] and F_{p²} for p = 13, 17, 53, the rational roots of the first-passage13quadratic, the killed walk on Z_N solved exactly, the divisor lattice of Ω − 1 on the laboratory Carrier; no float14decides anything. A CHART check is a continuum reading or a confrontation with the SPARC tables, every float converted15exactly before the comparison; its label carries "[chart]". The paper's own classes were EXACT, SIM and CHART, one per16package record (src/32-dark, twelve scripts and the figure script run by darkcommon.py); FAMILY names the package record17each check reproduces, None for the checks beyond the package (D2 the external-field speeds of the body's figure, F1 the18cosmological constant, Z1 the divisor lattice). The two seeded simulations (deep_regime, the killed walk of19meridian_walk) are not reproduced: the stationary Fokker–Planck slope and the exact cycle solution decide their clauses,20and the runs stay in the package as the figures' sources (decision D5 of the blueprint). The package stays the paper's21published witness until its release pins the framework.2223The Lean side: the theorems of the dark theme (lean/FrcCore/Theme/Dark.lean) over the gravity theme's Gauss law and24locked sum (Theme/Drift.lean) and the transform theme's geometric sum, the readings on Mathlib25(lean/FrcLedger/Theme/Dark.lean); the keys in Keys/Dark.lean (core) and Keys/Chart.lean (Mathlib), the certificates26Ledgers/P32Dark.lean.2728No numeral above Ω ∼ 10¹²³ is formed: the entropy S = 3.3 × 10¹²² enters Λ = 3π/S and the Λ-face of the floor as a29declared datum, and the divisor lattice is that of the laboratory Carrier's Ω − 1 = 2 408 560.3031    python3 -m frc.ledgers.p32_dark         every block, the census; exit 1 if a check fails (≈ 2 s)32    python3 -m frc.ledgers.p32_dark C       one block (A to Z)33    from frc.ledgers.p32_dark import R; R.predicate("32:C6")    one predicate: its blocks run once per session3435Blocks:  A  the Gauss law and the floor: the 5³ box, a₀ = cH₀/2π and its Λ-face                      (32:C1, X1, C2, X2, X10)36         B  the amplitude reading: n² and n, the geometric mean, the Newtonian link, Tully–Fisher       (32:C3, C4, C5, X3)37         C  the registration theorem: the count, Vieta, the cycle solution, the reduction               (32:C6, X4, C7, C2)38         D  the scatter and the environment: SPARC at the fixed floor, the external-field downturn      (32:C8, X5, P2, C9, X6)39         E  the coherence law: the weights 1 and 0, N_eff, the cluster core                             (32:C10, X7, P5, X8)40         F  the cosmological constant from the one cardinality                                          (32:C11, X9, X10)41         G  the predictions: the running floor, the scatter form, wide binaries, the offset, the law    (32:P1, P2, P3, P4, X11, P6)42         Z  the Ω-hard reading: the divisor lattice of Ω − 1                                            (32:Z1)4344Checks: 23, of them 9 EXACT and 14 CHART (A2, B2c, B3c, C1c, C2c, D1, D2, E2c, F1, G1, G2, G3, G4, G5). The notebook45frc/ledgers/p32_dark.ipynb runs one predicate per cell, the cell's id its key (gate G13).46"""47import random48import sys49from fractions import Fraction as Q5051from frc.registry import Registry52from frc import dark as D53from frc import flavour as FL54from frc import chart as CH55from frc import chart_dark as CD5657# ---- generated by ci/make_ledgers.py from docs/32-dark/32-dark-ledger.json; edit the ledger, not this table ----58PAPER = "32-dark"59KEYS = {"A1": "p32001", "A2": "p32002", "A3": "p32003", "A4": "p32004", "A5": "p32005", "A6": "p32006", "A7": "p32007", "B1": "p32008", "B2": "p32009", "B3": "p32010", "B4": "p32011", "B5": "p32012", "B6": "p32013", "B7": "p32014", "B8": "p32015", "B9": "p32051", "C1": "p32016", "C2": "p32017", "C3": "p32018", "C4": "p32019", "C5": "p32020", "C6": "p32021", "C7": "p32022", "C8": "p32023", "C9": "p32024", "C10": "p32050", "C11": "p32026", "X1": "p32027", "X2": "p32028", "X3": "p32029", "X4": "p32030", "X5": "p32031", "X6": "p32032", "X7": "p32033", "X8": "p32034", "X9": "p32035", "X10": "p32036", "X11": "p32037", "P1": "p32038", "P2": "p32039", "P3": "p32040", "P4": "p32041", "P5": "p32042", "P6": "p32043", "V1": "p32044", "V2": "p32045", "Z1": "p32047", "Y1": "p32048", "Y2": "p32049"}       # every row of the ledger: its label and its accession key60LEAN = {"C1": "core", "C2": "ml", "C3": "core", "C4": "core, ml", "C5": "core, ml", "C6": "core, ml", "C7": "core, ml", "C8": "ml", "C9": "ml", "C10": "core, ml", "C11": "ml", "X1": "core", "X2": "ml", "X3": "core, ml", "X4": "core, ml", "X5": "ml", "X6": "ml", "X7": "core, ml", "X8": "core, ml", "X9": "ml", "X10": "ml", "X11": "ml", "P1": "ml", "P2": "ml", "P3": "ml", "P4": "ml", "P5": "core", "P6": "ml"}       # the rows with a Lean declaration: the libraries whose key files prove them61# ---- end of the generated table ----6263LEAN_ONLY = ()                  # the predicates with a Lean declaration and no python check (gate G12): none6465# The paper's predicate ledger (predicates cited as 32:XN): the predicate(s) each check witnesses.66LEDGER = {67    "A1": "32:C1, 32:X1", "A2": "32:C2, 32:X2, 32:X10",68    "B1": "32:C3", "B2": "32:C4, 32:C1", "B2c": "32:C4", "B3": "32:C5, 32:X3", "B3c": "32:C5, 32:X3, 32:C4",69    "C1": "32:C6, 32:X4", "C1c": "32:C6, 32:X4", "C2": "32:C7, 32:C6", "C2c": "32:C7",70    "D1": "32:C8, 32:X5, 32:P2", "D2": "32:C9, 32:X6",71    "E1": "32:C10, 32:X7, 32:P5", "E2": "32:X8", "E2c": "32:X8",72    "F1": "32:C11, 32:X9, 32:X10",73    "G1": "32:P1", "G2": "32:P2, 32:C8", "G3": "32:P3", "G4": "32:P4", "G5": "32:X11, 32:P6, 32:C6, 32:C2",74    "Z1": "32:Z1",75}7677# the package record (dark.<script>) each check reproduces; None for the three checks beyond the package78FAMILY = {79    "A1": "flux_exact", "A2": "deep_mond",80    "B1": "born_exact", "B2": "flux_exact", "B2c": "deep_regime_fp", "B3": "deep_mond", "B3c": "deep_mond",81    "C1": "meridian_walk", "C1c": "interpolation", "C2": "firstpassage_finite", "C2c": "firstpassage_finite",82    "D1": "rar_scatter", "D2": None,83    "E1": "cluster_coherent", "E2": "cluster_coherent", "E2c": "cluster_coherent",84    "F1": None,85    "G1": "predictions", "G2": "predictions", "G3": "predictions", "G4": "predictions", "G5": "rar_shape",86    "Z1": None,87}8889BLOCK = {"A": "the Gauss law and the floor: the 5³ box, a₀ = cH₀/2π and its Λ-face",90         "B": "the amplitude reading: n² and n, the geometric mean, the Newtonian link, Tully–Fisher",91         "C": "the registration theorem: the count, Vieta, the cycle solution, the reduction",92         "D": "the scatter and the environment: SPARC at the fixed floor, the external-field downturn",93         "E": "the coherence law: the weights 1 and 0, N_eff, the cluster core",94         "F": "the cosmological constant from the one cardinality",95         "G": "the predictions: the running floor, the scatter form, wide binaries, the offset, the one-variable law",96         "Z": "the Ω-hard reading: the divisor lattice of Ω − 1"}9798# the deciding check of each witnessed predicate (the other checks that touch it are corroboration)99PREDICATES = {100    "32:C1": "A1", "32:C2": "A2", "32:C3": "B1", "32:C4": "B2", "32:C5": "B3", "32:C6": "C1", "32:C7": "C2",101    "32:C8": "D1", "32:C9": "D2", "32:C10": "E1", "32:C11": "F1",102    "32:X1": "A1", "32:X2": "A2", "32:X3": "B3", "32:X4": "C1", "32:X5": "D1", "32:X6": "D2", "32:X7": "E1",103    "32:X8": "E2", "32:X9": "F1", "32:X10": "F1", "32:X11": "G5",104    "32:P1": "G1", "32:P2": "G2", "32:P3": "G3", "32:P4": "G4", "32:P5": "E1", "32:P6": "G5",105    "32:Z1": "Z1",106}107108R = Registry("32", "dark", LEDGER, PREDICATES, sources=[__file__])109110SHELLS = (13, 17, 53)                                   # the shells of the F_{p²} checks111RNG = random.Random(32)112113114def _within(x, centre, tol):115    """|x − centre| < tol, x a float of the chart converted exactly."""116    return abs(Q(x) - Q(centre)) < Q(tol)117118119def _between(x, lo, hi):120    return Q(lo) < Q(x) < Q(hi)121122123def _rand_ext(K):124    return (RNG.randrange(K.p), RNG.randrange(K.p))125126127# ------------------------------------------------------------------------------------------------------------128# block A: the Gauss law and the floor (32:C1, X1, C2, X2, X10)129@R.block("A", BLOCK["A"])130def block_A():131    """Block A — the Gauss law and the floor: A1 exact, A2 chart."""132    # A1 the discrete Gauss law in Fractions on the 5³ box with Dirichlet boundary: the unit source at the centre has flux 1133    #    through the surfaces R = 0 and R = 1 (and through a non-cubic region enclosing it), a source-free field with random134    #    rational boundary values has flux 0, their superposition flux 1; two sources (the centre and a neighbour, charges 1 and135    #    3/7) give the enclosed count 10/7 through R = 1 and 1 through R = 0136    f0, f1, fn, fsn = D.gauss_law(seed=1, n=5)137    ok = f0 == 1 and f1 == 1 and fn == 0 and fsn == 1138    det = [f"5³: flux(R=0) = {f0}, flux(R=1) = {f1}, source-free {fn}, superposed {fsn}"]139    box = D.GaussBox(5)140    zero = {p: Q(0) for p in box.boundary}141    U = box.field({box.centre: Q(1)}, zero)142    region = {box.centre, (2, 2, 3)}                                             # a non-cubic region enclosing the source143    tot = Q(0)144    for p in region:145        for q in box.nbrs(p):146            if q not in region: tot += U[p] - U[q]147    ok &= tot == 1148    U2 = box.field({box.centre: Q(1), (1, 2, 2): Q(3, 7)}, zero)149    ok &= box.flux(U2, 1) == Q(10, 7) and box.flux(U2, 0) == 1150    det.append(f"two sources 1 and 3/7: flux(R=1) = {box.flux(U2, 1)}, flux(R=0) = {box.flux(U2, 0)}")151    # 32:C1 (p32016), 32:X1 (p32027)152    R.check("A1", "the discrete Gauss law of the synchronisation flux, exact in rationals on the 5³ box with Dirichlet boundary: "153            "a unit point source gives flux 1 through both enclosing cubes and through a non-cubic region around it, a "154            "source-free field with random rational boundary values gives flux 0, their superposition gives 1, and two sources "155            "of charges 1 and 3/7 give the enclosed count 10/7 — Newton's law as the enclosed count, the test cluster's "156            "acceleration independent of its composition", ok, "; ".join(det))157158    # A2 [chart] the floor a₀ = cH₀/2π at the entailed H₀ = 67.4: 1.0422 × 10⁻¹⁰ m s⁻², 13.2 % below the fitted g_† = 1.20 ×159    #    10⁻¹⁰ and 0.66 of its systematic 0.24 × 10⁻¹⁰; the Λ-face of the floor from the entropy alone, cH_Λ/2π with160    #    H_Λ = c/(√(S/π) ℓ_P), 0.864 × 10⁻¹⁰, five sixths of a₀161    a0, pct, sig = CD.floor_comparison()162    lo, hi = CH.floor_bracket(CD.DATA["cosmology"]["H0"])163    rH, HL, face = CD.lambda_face()164    ok = _within(a0, "1.0422e-10", "1e-14") and lo - Q("1e-25") < Q(a0) < hi + Q("1e-25") and _between(pct, "13.1", "13.2") and _between(sig, "0.65", "0.66")165    ok &= _between(face, "8.63e-11", "8.64e-11") and _between(Q(face) / Q(a0), "0.82", "0.84")166    # 32:C2 (p32017), 32:X2 (p32028)167    R.check("A2", "[chart] the acceleration floor a₀ = cH₀/2π = 1.0422 × 10⁻¹⁰ m s⁻² at the entailed H₀ = 67.4 km s⁻¹ Mpc⁻¹, "168            "inside the chart theme's certified bracket, 13.2 % below the fitted g_† = 1.20 × 10⁻¹⁰ and 0.66 of its systematic "169            "band (the paper's 13 %, 0.7σ); the Λ-face of the floor read from the entropy S = 3.3 × 10¹²² alone, "170            "cH_Λ/2π = 0.864 × 10⁻¹⁰, five sixths of a₀ (X10)", ok,171            f"a₀ = {a0:.5e}, {pct:.2f} % below g_†, {sig:.3f}σ; Λ-face {face:.4e} = {face / a0:.3f} a₀", kind="CHART")172173174# ------------------------------------------------------------------------------------------------------------175# block B: the amplitude reading (32:C3, C4, C5, X3)176@R.block("B", BLOCK["B"])177def block_B():178    """Block B — the amplitude reading: B1–B3 exact, B2c and B3c chart."""179    # B1 amplitude = √count: n aligned units have norm n² in Z[i] (the units 1 and i) and on F_{p²}; over all 2^n sign180    #    patterns the total of the norms is 2^n Σ norm(u_k) (the cross terms cancel), the mean of (Σ ε_k)² is exactly n for181    #    n ≤ 10; the parallelogram identity norm(a + b) + norm(a − b) = 2 norm a + 2 norm b on random Gaussian integers182    GI = D.GI; ok = True183    for n in range(1, 11):184        for u in (GI.el(1, 0), GI.el(0, 1), GI.el(1, 1)):185            lhs, rhs = D.coherent_count(GI, u, n); ok &= lhs == rhs == n * n * GI.norm(u)186        ok &= D.incoherent_mean(n) == n187        us = [GI.el(1, 0)] * n188        lhs, rhs = D.sign_pattern_total(GI, us); ok &= lhs == rhs == 2 ** n * n189    for _ in range(20):190        a, b = GI.el(RNG.randint(-9, 9), RNG.randint(-9, 9)), GI.el(RNG.randint(-9, 9), RNG.randint(-9, 9))191        ok &= GI.norm(GI.add(a, b)) + GI.norm(GI.add(a, GI.neg(b))) == 2 * GI.norm(a) + 2 * GI.norm(b)192        us = [GI.el(RNG.randint(-5, 5), RNG.randint(-5, 5)) for _ in range(6)]193        lhs, rhs = D.sign_pattern_total(GI, us); ok &= lhs == rhs194    det = []195    for p in SHELLS:196        K = D.shell_ext(p)197        for _ in range(5):198            u = _rand_ext(K); lhs, rhs = D.coherent_count(K, u, RNG.randint(2, 12)); ok &= lhs == rhs199            us = [_rand_ext(K) for _ in range(RNG.randint(2, 7))]; lhs, rhs = D.sign_pattern_total(K, us); ok &= lhs == rhs200        det.append(f"F_{p}² (ν = {K.nu})")201    # 32:C3 (p32018)202    R.check("B1", "amplitude is the square root of the count, exact in Z[i]: n aligned unit phasors have |Σ|² = n² (amplitude n, "203            "the coherent first moment) and the mean of |Σ ε_k|² over all 2ⁿ sign patterns is n (amplitude √n, the incoherent "204            "second moment) for n ≤ 10, by the cross-term cancellation Σ_ε N(Σ ε_k u_k) = 2ⁿ Σ N(u_k) on random Gaussian "205            "integers and on F_{p²} for p = 13, 17, 53; the parallelogram identity on 20 random pairs", ok,206            "n ≤ 10 in Z[i]; the shells " + ", ".join(det))207208    # B2 the deep-regime geometric mean on rational squares: g² = g_b a₀ ⟹ g = √(g_b a₀), and the Gauss law's invariance under209    #    a source-free current: the superposed field's enclosed flux equals the source's for three noise fields210    ok = True211    for gb, a0 in ((Q(1, 4), Q(9)), (Q(16, 25), Q(25, 4)), (Q(49), Q(1, 49)), (Q(2, 3), Q(3, 8))):212        g = D._sqrt_q(gb * a0); ok &= g is not None and g * g == gb * a0 and g > 0213    for seed in (2, 3, 4):214        f0, f1, fn, fsn = D.gauss_law(seed=seed)215        ok &= f1 == 1 and fn == 0 and fsn == f1216    # 32:C4 (p32019)217    R.check("B2", "the deep-regime law is registration, not force modification: below the floor the conserved flux g_b a₀ is read "218            "as an amplitude, g = √(g_b a₀) with g² = g_b a₀ exactly on rational squares, while the mean force stays Newtonian — "219            "the enclosed flux of the unit source on the 5³ box is unchanged by three source-free noise fields (the Gauss law's "220            "invariance under a source-free current, exact)", ok, "four rational instances; three noise fields, flux 1 = 1")221222    # B2c [chart] the stationary Fokker–Planck solution of the noisy link dφ = (T − sin φ)dt + √(2D) dW: the small-tilt log-slope223    #     of the mean response is 1.000 within 2 × 10⁻³ at D = 0.3 and 0.6, the boost T/⟨sin φ⟩ constant to rising — no √ regime224    #     in the mean force; the paper's simulated 1.03, 1.11 are the exhibit's step bias on this exact 1225    ok = True; det = []226    for Dn in CD.DATA["link"]["D"]:227        slope, boost = CD.fokker_planck_slope(Dn)228        ok &= _within(slope, 1, "0.002") and all(Q(b2) >= Q(b1) - Q("1e-9") for b1, b2 in zip(boost[:-1], boost[1:]))229        det.append(f"D = {Dn}: slope {slope:.4f}, boost {boost[0]:.3f} → {boost[-1]:.3f}")230    R.check("B2c", "[chart] the mean force of the noisy link is Newtonian at every noise level: in the stationary Fokker–Planck "231            "solution the small-tilt log-slope d ln T/d ln⟨sin φ⟩ is 1.000 within 2 × 10⁻³ at D = 0.3 and 0.6 and the boost "232            "T/⟨sin φ⟩ is constant to rising with the tilt (the paper's simulated 1.03 and 1.11 are the exhibit's step bias on "233            "this exact 1); the √ law is not in the mean force", ok, "; ".join(det), kind="CHART")234235    # B3 v⁴ = GMa₀ on rationals: s² = GMa₀, v² = s, so v⁴ = GMa₀ (the flat speed from the geometric mean g = √(GMa₀)/r)236    ok = True237    for G, M, a0 in ((Q(2, 3), Q(3, 2), Q(16)), (Q(1, 4), Q(9), Q(4, 9)), (Q(81, 16), Q(16), Q(1, 81)), (Q(5), Q(5), Q(1, 25))):238        r = D.tully_fisher(G, M, a0); ok &= r is not None and r[0] == r[1] and r[2] == r[3] and r[3] * r[3] == G * M * a0239    # 32:C5 (p32020), 32:X3 (p32029)240    R.check("B3", "flat rotation curves and the baryonic Tully–Fisher relation: with g = √(GMa₀)/r below the floor, v² = gr = "241            "√(GMa₀) is independent of r and v⁴ = GMa₀, exact on four rational instances where GMa₀ is a fourth power", ok,242            "v⁴ = GMa₀ on (2/3, 3/2, 16), (1/4, 9, 4/9), (81/16, 16, 1/81), (5, 5, 1/25)")243244    # B3c [chart] the Tully–Fisher speed (GMa₀)^{1/4} = 162 km s⁻¹ at 5 × 10¹⁰ M_⊙, the slope d ln v/d ln M = 1/4, the RAR245    #     deep slope 0.514 and the Newtonian slope 1.000; the exponential disk 5 × 10¹⁰ M_⊙, R_d = 3 kpc: its baryonic curve peaks246    #     at 167 km s⁻¹ and the registered curve runs flat at 180 km s⁻¹ over 20–30 kpc, 11 % above the Tully–Fisher asymptote247    v = CD.btfr_speed(); bt = CD.btfr_slope(); deep, newt = CD.slopes(); peak, outer, tf = CD.rotation_curve()248    ok = _between(v, 162, 163) and _within(bt, Q(1, 4), "1e-6") and _between(deep, "0.514", "0.515") and _within(newt, 1, "1e-4")249    ok &= _between(peak, 166, 167) and _between(outer, 180, 181) and _between(Q(outer) / Q(tf), "1.10", "1.12")250    R.check("B3c", "[chart] the Tully–Fisher speed (GMa₀)^{1/4} = 162 km s⁻¹ at 5 × 10¹⁰ M_⊙, the slope d ln v_flat/d ln M = 1/4, "251            "the RAR deep slope d ln(xν)/d ln x = 0.514 over 10⁻³ < x < 10⁻² and the Newtonian slope 1.000 over 10² < x < 10³; "252            "the exponential disk of that mass (R_d = 3 kpc, the Bessel kernel by quadrature) peaks at 167 km s⁻¹ in baryons and "253            "its registered curve runs flat at 180 km s⁻¹ over 20–30 kpc, 1.11 of the asymptote", ok,254            f"v = {v:.1f} km/s, slopes {bt:.4f}, {deep:.3f}, {newt:.4f}; disk peak {peak:.1f}, outer {outer:.1f}", kind="CHART")255256257# ------------------------------------------------------------------------------------------------------------258# block C: the registration theorem (32:C6, X4, C7, C2)259@R.block("C", BLOCK["C"])260def block_C():261    """Block C — the registration theorem: C1, C2 exact, C1c, C2c chart."""262    # C1 the registration count: N_bar = f N_reg ⟺ g_obs = g_b/f on rationals (both directions, 40 draws), and Vieta's form of263    #    the first-passage quadratic (z/2)f² − f + z/2 = 0 on z = 3/5, 5/13, 8/17 (1 − z² a square): the roots 1/3 and 3, 1/5264    #    and 5, 1/4 and 4, product 1, sum 2/z, residual 0265    ok = True266    for _ in range(40):267        f = Q(RNG.randint(1, 99), 100); gb = Q(RNG.randint(1, 99), RNG.randint(1, 9)); go = gb / f268        ok &= (f * go == gb) and (go == gb / f) and not (f * (go + 1) == gb)269    det = []270    for z in (Q(3, 5), Q(5, 13), Q(8, 17)):271        f, g = D.passage_roots(z)272        ok &= f * g == 1 and f + g == 2 / z and D.passage_residual(z, f) == 0 and D.passage_residual(z, g) == 0 and 0 < f < 1273        det.append(f"z = {z}: f = {f}, f' = {g}")274    # 32:C6 (p32021), 32:X4 (p32030)275    R.check("C1", "the registration theorem's exact core: the conditional count N_bar = f·N_reg is the relation g_obs = g_b/f and "276            "conversely (40 rational draws), and the first-passage quadratic (z/2)f² − f + z/2 = 0 has the two roots f = (1 − "277            "√(1 − z²))/z and 1/f with product 1 and sum 2/z — Vieta, exact on z = 3/5, 5/13, 8/17; the interpolation "278            "g_b/(1 − e^{−√x}) is this registration with the amplitude barrier B8, no fitted function", ok, "; ".join(det))279280    # C1c [chart] the interpolation against the simple rational form (1 + √(1 + 4/x))/2 with the same limits: the discriminant281    #     ν_simple − ν peaks at 0.0512 (0.0195 dex) at x = 5.22; the chart angle α(1) = arcsin(e^{−1/2}) = 37.3°282    dmax, xmax, ddex = CD.discriminant(); ang = CD.chart_angle()283    ok = _between(dmax, "0.0511", "0.0513") and _between(xmax, "5.2", "5.25") and _between(ddex, "0.0194", "0.0196") and _between(ang, "37.3", "37.4")284    R.check("C1c", "[chart] the interpolation ν(x) = 1/(1 − e^{−√x}) against the simple rational form with the same two limits: "285            "the discriminant ν_simple − ν is largest at x = 5.22, 0.0512 in g_obs/g_b (0.0195 dex), the paper's 0.051 at 5.2; "286            "the chart angle at the floor α(1) = arcsin(e^{−1/2}) = 37.3°", ok,287            f"max {dmax:.4f} at x = {xmax:.2f} ({ddex:.4f} dex); α(1) = {ang:.1f}°", kind="CHART")288289    # C2 the finite-cycle first-passage law: the killed walk on Z_N (absorbing barrier at a, per-step survival z) solved as an290    #    exact linear system equals the two-image form (f^a + f^{N−a})/(1 + f^N) for every a on Z₁₂ at z = 3/5 (f = 1/3) and291    #    Z₁₀ at z = 5/13 (f = 1/5); the passage factor f = u − √(u² − 1) at u = 5/4 is 1/2, the root at z = 4/5, its reciprocal 2;292    #    the single-step identity z(t + tf²) = 2tf293    ok = True; det = []294    for N, z in ((12, Q(3, 5)), (10, Q(5, 13))):295        f = D.passage_roots(z)[0]296        for a in range(1, N):297            ok &= D.cycle_escape(N, a, z) == D.cycle_closed(N, a, f)298        det.append(f"Z_{N}, z = {z}: h_0 = {D.cycle_closed(N, N // 4, f)} at a = {N // 4}, the line's f^a = {f ** (N // 4)}")299    fac, rec = D.passage_factor(Q(5, 4))300    ok &= fac == Q(1, 2) and rec == 2 and D.passage_roots(Q(4, 5))[0] == Q(1, 2)301    for z in (Q(3, 5), Q(5, 13), Q(8, 17), Q(4, 5)):302        f = D.passage_roots(z)[0]303        for t in (Q(1), Q(7, 3), Q(-2, 5)):304            ok &= z * (t + t * f * f) == 2 * t * f305    # 32:C7 (p32022)306    R.check("C2", "the finite-cycle first-passage law, exact: the killed walk on Z₁₂ (z = 3/5) and Z₁₀ (z = 5/13), absorbing at a, "307            "solved as a rational linear system equals the two-image form (f^a + f^{N−a})/(1 + f^N) for every a, the wrap term "308            "f^{N−a} the whole correction to the line's f^a; the passage factor u − √(u² − 1) is 1/2 at u = 5/4 (the root of the "309            "quadratic at z = 4/5, reciprocal 2); the single-step identity z(t + tf²) = 2tf on four rational z", ok, "; ".join(det))310311    # C2c [chart] the controlled reduction arccosh(e^s) = √(2s)(1 + s/6 + …): the coefficient (arccosh(e^s)/√(2s) − 1)/s is 1/6312    #     within 10⁻⁵ at s = 10⁻⁴; the wrap correction on Z₂₀₀ (a = 8, s = 0.02): the two-image difference 1.78 × 10⁻¹⁷, the313    #     wrap term e^{−192 arccosh(e^s)} = 1.85 × 10⁻¹⁷314    c4, c2 = CD.passage_reduction(Q("1e-4")), CD.passage_reduction(Q("1e-2")); diff, wrap = CD.wrap_term()315    ok = _within(c4, Q(1, 6), "1e-5") and _within(c2, Q(1, 6), "1e-3") and _between(diff, "1.77e-17", "1.78e-17") and _between(wrap, "1.85e-17", "1.86e-17")316    R.check("C2c", "[chart] the reduction of the exact exponent arccosh(e^s) to the Brownian √(2s): the relative error over s is "317            "1/6 within 10⁻⁵ at s = 10⁻⁴ (within 10⁻³ at 10⁻²), so e^{−√x} is the resolvable reading to O(s) = O(Ω^{−1/2}); on "318            "Z₂₀₀ with the barrier at 8 and s = 0.02 the cycle departs from the line by 1.78 × 10⁻¹⁷, the wrap term "319            "e^{−192 arccosh(e^s)} = 1.85 × 10⁻¹⁷", ok, f"coefficient {c4:.7f}; wrap difference {diff:.3e}, term {wrap:.3e}", kind="CHART")320321322# ------------------------------------------------------------------------------------------------------------323# block D: the scatter and the environment (32:C8, X5, P2, C9, X6)324@R.block("D", BLOCK["D"])325def block_D():326    """Block D — the scatter and the environment: D1, D2 chart."""327    # D1 [chart] the SPARC radial acceleration relation at the fixed floor a₀ = cH₀/2π: the 2693 points scatter by 0.133 dex328    #    against 0.127 expected from the quoted errors, an intrinsic 0.038 dex; binned in x the intrinsic scatter is 0.043 and329    #    0.046 dex across the knee (−0.5 < log x < 0.5), 0.135 dex at x ≈ 0.02 and zero above x = 3; the knee value bounds330    #    δα ≲ 3.5° while the dynamical-temperature identification δα = 6–11° would give 0.07–0.13 dex there; the within-galaxy331    #    intrinsic scatter of 116 disks shows no correlation with 1/V_flat (ρ = −0.02); an amplitude sum of a galaxy's gas, disk332    #    and bulge would lift the relation by 0.14 dex333    n, rms, exp_rms, intr, mean, bins = CD.sparc_residuals()334    ok = n == 2693 and _between(rms, "0.132", "0.134") and _between(exp_rms, "0.126", "0.128") and _between(intr, "0.037", "0.039")335    knee1, knee2, deep = bins[("-0.5", "0")][1], bins[("0", "0.5")][1], bins[("-2", "-1.5")][1]336    ok &= _between(knee1, "0.04", "0.05") and _between(knee2, "0.04", "0.05") and _between(deep, "0.13", "0.14") and Q(deep) > 2 * Q(knee1)337    ok &= bins[("0.5", "1")][1] == 0 and bins[("1", "1.5")][1] == 0338    da = CD.delta_alpha_bound(Q("0.04"), 1); s6, s11 = CD.scatter_at_angle(1, 6), CD.scatter_at_angle(1, 11)339    ok &= _between(da, "3.4", "3.5") and _between(s6, "0.069", "0.070") and _between(s11, "0.127", "0.128") and Q(s6) > Q(3, 2) * Q(knee2)340    ng, med, rho = CD.sparc_within_galaxy(); npts, boost, b16, b84 = CD.sparc_amplitude_boost()341    ok &= ng == 116 and _within(rho, "-0.02", "0.005") and abs(Q(rho)) < Q("0.17") and _between(boost, "0.13", "0.14") and Q(boost) > Q(1, 10)342    # 32:C8 (p32023), 32:X5 (p32031)343    R.check("D1", "[chart] the SPARC relation at the fixed floor: the 2693 points scatter by 0.133 dex against 0.127 expected from "344            "the quoted errors, an intrinsic 0.038 dex, smallest at high acceleration (zero above x = 3), 0.043–0.046 dex across "345            "the knee and 0.135 dex at x ≈ 0.02 — the deep rise of the form; the knee bounds δα ≲ 3.5°, the dynamical-temperature "346            "identification δα = 6–11° (0.07–0.13 dex at x = 1) exceeds the intrinsic scatter 1.5-fold and the within-galaxy "347            "scatter of 116 disks is uncorrelated with 1/V_flat (ρ = −0.02); an amplitude sum of gas, disk and bulge would lift "348            "the relation by 0.14 dex (the within-galaxy constraint on Y1)", ok,349            f"rms {rms:.3f}, expected {exp_rms:.3f}, intrinsic {intr:.3f}; bins {knee1:.3f}, {knee2:.3f}, deep {deep:.3f}; "350            f"δα ≲ {da:.2f}°; {ng} disks ρ = {rho:+.3f}; boost {boost:.3f} dex over {npts} points", kind="CHART")351352    # D2 [chart] the external-field effect: the registration reads the total field, g_obs = g_in ν((g_in + g_ext)/a₀), so a353    #    stronger environment uses up the deep enhancement; the outer speed (40 kpc) of the 6 × 10¹⁰ M_⊙ disk falls from 181 to354    #    163, 143 and 113 km s⁻¹ as g_ext/a₀ runs through 0, 0.03, 0.1, 0.5 (the body's figure); ν decreasing in its argument355    v = CD.efe_speeds()356    ok = all(_within(x, c, "0.5") for x, c in zip(v, (181, 163, 143, 113))) and all(Q(a) > Q(b) for a, b in zip(v[:-1], v[1:]))357    ok &= _between(100 * (1 - Q(v[1]) / Q(v[0])), 9, 10) and _between(100 * (1 - Q(v[3]) / Q(v[0])), 37, 38)358    ok &= all(CD.nu(y1) > CD.nu(y2) for y1, y2 in ((Q(1, 10), Q(1, 5)), (Q(1, 2), 1), (1, 2), (2, 5)))359    # 32:C9 (p32024), 32:X6 (p32032)360    R.check("D2", "[chart] the external-field effect: the registration reads the total field, g_obs = g_in ν((g_in + g_ext)/a₀) with "361            "ν decreasing, so a stronger environment uses up the deep enhancement — the outer rotation speed of the fixed disk "362            "(6 × 10¹⁰ M_⊙, R_d = 3 kpc, at 40 kpc) falls from 181 to 163, 143 and 113 km s⁻¹ as g_ext/a₀ increases through 0, "363            "0.03, 0.1, 0.5 (a 9 % downturn at the Milky-Way-scale field, 37 % at 0.5); the acceleration scale stays global", ok,364            "speeds " + ", ".join(f"{x:.1f}" for x in v) + " km/s", kind="CHART")365366367# ------------------------------------------------------------------------------------------------------------368# block E: the coherence law (32:C10, X7, P5, X8)369@R.block("E", BLOCK["E"])370def block_E():371    """Block E — the coherence law: E1, E2 exact, E2c chart."""372    # E1 the bulk-coherence weight: n aligned unit phasors sum to n (|Σ|² = n², w = 1); a full cycle of phases sums to zero373    #    (w = 0) — Σ_{l<3} ω^l = 0 in Z[ω], Σ_{l<4} i^l = 0 in Z[i], Σ_{l<n} ζ^l = 0 on F_{p²} for ζ of order n | p² − 1; the374    #    coherence sum g_amp² = Σg + 2Σ_{i<j}√(g_i g_j) C_ij equals (Σ√g)² at C = 1 (the relaxed core, the gas gravitates) and375    #    Σg at C = 0 (the merger, the shocked gas drops out) on rational squares376    w = FL.OMEGA; ok = (1 + w + w * w == 0) and (w + w + w == FL.QOmega(0, 3))377    GI = D.GI378    ok &= D.phasor_cycle_sum(GI, GI.el(0, 1), 4) == GI.el(0, 0) and D.phasor_cycle_sum(GI, GI.el(1, 0), 4) == GI.el(4, 0)379    det = []380    for p in SHELLS:381        K = D.shell_ext(p)382        for n in (3, 4, 6, p + 1, p - 1):383            if (p * p - 1) % n: continue384            zeta = next(z for z in ((a, b) for a in range(p) for b in range(p)) if z != (0, 0) and K.pow(z, n) == (1, 0)385                        and all(K.pow(z, d) != (1, 0) for d in range(1, n) if n % d == 0))386            ok &= D.phasor_cycle_sum(K, zeta, n) == (0, 0) and D.phasor_cycle_sum(K, (1, 0), n) == (n % p, 0)387        det.append(f"F_{p}²: the orders 3, 4, 6, {p - 1}, {p + 1}")388    for gs in (([4, 1, 1]), ([9, 4]), ([1, 1, 1, 1]), ([Q(1, 4), Q(9, 16), 1])):389        roots = [D._sqrt_q(g) for g in gs]390        ok &= D.coherence_sum(gs, 1) == sum(roots) ** 2 and D.coherence_sum(gs, 0) == sum(Q(g) for g in gs)391        ok &= D.coherence_sum(gs, 1) >= D.coherence_sum(gs, 0)392    # 32:C10 (p32050), 32:X7 (p32033), 32:P5 (p32042)393    R.check("E1", "the coherence law: n aligned phasors sum to n (weight w = 1, the virialised clump) and a full cycle of phases "394            "sums to zero (w = 0, the shock-randomised gas) — in Z[ω] and Z[i] and on F_{p²} for p = 13, 17, 53 at the orders 3, 4, "395            "6, p ± 1; the coherence sum g_amp² = Σg_i + 2Σ_{i<j}√(g_i g_j)C_ij is (Σ√g)² at C = 1 (the relaxed cluster, the gas "396            "gravitates) and Σg at C = 0 (the merger, the gas drops out of the lensing), exact on rational squares — the "397            "merging-cluster offset as a selection", ok, "; ".join(det) + "; four coherence sums")398399    # E2 N_eff = (Σ√g)²/Σg on rational squares: 8/3 for the BCG-dominated 4:1:1, N for N equal components (N = 2..8), 25/11400    #    for 9:1:1; 1 ≤ N_eff ≤ N on 30 random square triples and quadruples401    ok = D.n_eff([4, 1, 1]) == Q(8, 3) and D.n_eff([9, 1, 1]) == Q(25, 11) and all(D.n_eff([1] * n) == n for n in range(2, 9))402    ok &= D.n_eff([Q(1, 4), Q(1, 4), 1]) == Q(8, 3) and D.n_eff([Q(1, 9), Q(4, 9)]) == Q(9, 5)403    for _ in range(30):404        gs = [Q(RNG.randint(1, 9)) ** 2 / Q(RNG.randint(1, 5)) ** 2 for _ in range(RNG.randint(3, 4))]405        ne = D.n_eff(gs); ok &= 1 <= ne <= len(gs)406    # 32:X8 (p32034)407    R.check("E2", "the cluster-core residual's law: coherent amplitude addition over N separately virialised composites boosts the "408            "registered amplitude by √N_eff with N_eff = (Σ√g_i)²/Σg_i — exactly N for equal components (N = 2..8), 8/3 for the "409            "BCG-dominated 4:1:1 and 25/11 for 9:1:1, and 1 ≤ N_eff ≤ N on 30 random rational-square tuples; the quantitative "410            "closure with N_eff from a core population is the conjecture Y1", ok, "N_eff(4:1:1) = 8/3, N_eff(1ᴺ) = N")411412    # E2c [chart] the core numbers: ν(0.1) = 3.69 and ν(0.25) = 2.54 at the cluster-core accelerations, √6 = 2.449 for a413    #     six-composite core, √(8/3) = 1.63 for the BCG-dominated core414    (n1, n2), r6, r83 = CD.nu_core()415    ok = _between(n1, "3.68", "3.70") and _between(n2, "2.53", "2.55") and _between(r6, "2.449", "2.450") and _between(r83, "1.63", "1.64")416    R.check("E2c", "[chart] the cluster core's numbers: the registration factor ν = 3.69 at g_b/a₀ = 0.1 and 2.54 at 0.25 (the "417            "paper's 2.5–3.7), the coherent boost √6 = 2.449 for six comparable composites and √(8/3) = 1.63 for the "418            "BCG-dominated 4:1:1 core, decaying to 1 where the components fall out of mutual lock", ok,419            f"ν(0.1) = {n1:.3f}, ν(0.25) = {n2:.3f}, √6 = {r6:.3f}", kind="CHART")420421422# ------------------------------------------------------------------------------------------------------------423# block F: the cosmological constant (32:C11, X9, X10)424@R.block("F", BLOCK["F"])425def block_F():426    """Block F — the cosmological constant (chart): F1."""427    # F1 [chart] Λ = 3/r_H² = 3π/S in Planck units at S = 3.3 × 10¹²²: 2.86 × 10⁻¹²², positive, ΛS = 3π; the measured Λ = 1.088 ×428    #    10⁻⁵² m⁻² is 2.84 × 10⁻¹²² in Planck units, within 1 % of it; the floor's Λ-face and Λ are both read from the one S429    lam, lamS = CD.lambda_planck(); lam_fit = CD.lambda_measured(); pi_lo, pi_hi = CH.pi_bracket()430    rH, HL, face = CD.lambda_face(); a0 = CD.floor()431    ok = _between(lam, "2.85e-122", "2.86e-122") and Q(lam) > 0 and 3 * pi_lo - Q("1e-12") < Q(lamS) < 3 * pi_hi + Q("1e-12")432    ok &= _between(lam_fit, "2.83e-122", "2.85e-122") and _within(Q(lam_fit) / Q(lam), 1, "0.01")433    ok &= _between(Q(face) / Q(a0), "0.82", "0.84") and _between(Q(face) ** 2 / Q(lam), "2.6e101", "2.7e101")434    # 32:C11 (p32026), 32:X9 (p32035), 32:X10 (p32036)435    R.check("F1", "[chart] the cosmological constant is the curvature of the wrapped finite chart, Λ = 3/r_H² = 3π/S = 2.86 × 10⁻¹²² "436            "in Planck units at S = 3.3 × 10¹²², positive, ΛS = 3π exactly — a reading of the one cardinality Ω ∼ 4S, not a "437            "mode-sum vacuum energy, so no 120-order cancellation; the measured Λ = 1.088 × 10⁻⁵² m⁻² is 2.84 × 10⁻¹²² in Planck "438            "units, within 1 %; the same S gives the floor's Λ-face 0.86 × 10⁻¹⁰ = 0.83 a₀, the two dark scales fixed together "439            "(X10)", ok, f"Λ = {lam:.3e}, ΛS = {lamS:.6f} = 3π; measured {lam_fit:.3e}; Λ-face/a₀ = {face / a0:.3f}", kind="CHART")440441442# ------------------------------------------------------------------------------------------------------------443# block G: the predictions (32:P1, P2, P3, P4, X11, P6)444@R.block("G", BLOCK["G"])445def block_G():446    """Block G — the predictions (chart): G1–G5."""447    # G1 [chart] the running floor a₀(z) = cH(z)/2π: v_flat ∝ E(z)^{1/4}, +7.2 %, +15.7 %, +32.0 % at z = 0.5, 1, 2 for Ω_m = 0.315;448    #    the knee at z = 1 at cH(1)/2π = 1.87 × 10⁻¹⁰, the rise 0.82 × 10⁻¹⁰449    pct, a1, rise = CD.ez_quarter()450    ok = _within(pct[0], "7.23", "0.01") and _within(pct[1], "15.67", "0.01") and _within(pct[2], "31.95", "0.01")451    ok &= _between(a1, "1.86e-10", "1.87e-10") and _between(rise, "8.2e-11", "8.3e-11")452    ok &= _within(CD.tully_fisher_shift(1), CH.tully_fisher_shift(1, 1 - CD.DATA["cosmology"]["Omega_m"]), "1e-12")453    # 32:P1 (p32038)454    R.check("G1", "[chart] the redshift law a₀(z) = cH(z)/2π: at fixed baryonic mass v_flat ∝ a₀^{1/4} ∝ E(z)^{1/4}, so the "455            "Tully–Fisher zero-point rises by 7 %, 16 % and 32 % at z = 0.5, 1, 2 (Ω_m = 0.315) and the knee moves to "456            "cH(1)/2π = 1.87 × 10⁻¹⁰ m s⁻² at z = 1, a rise of 0.82 × 10⁻¹⁰; parameter-free, the shape resolvable, the value Ω-hard "457            "(Z1); the chart theme's running floor gives the same E(z)^{1/4}", ok,458            f"+{pct[0]:.1f} %, +{pct[1]:.1f} %, +{pct[2]:.1f} %; cH(1)/2π = {a1:.3e}", kind="CHART")459460    # G2 [chart] the two-variable scatter σ = (2 tan α/ln 10) arctan(σ_v/v): 0.267 dex at x = 0.01 and σ_v/v = 0.1, under 0.01 dex461    #    at x = 100, zero for cold systems; tan α(x)·x^{1/4} → 1 into the deep regime (the x^{−1/4} rise)462    s001 = CD.scatter_law(Q(1, 100), Q(1, 10)); s100 = CD.scatter_law(100, Q(1, 10)); rise = CD.scatter_rise()463    ok = _between(s001, "0.266", "0.268") and Q(s100) < Q(1, 100) and CD.scatter_law(1, 0) == 0464    ok &= all(Q(a) < Q(b) for a, b in zip(rise[:-1], rise[1:])) and _between(rise[-1], "0.997", 1) and _between(rise[0], "0.97", "0.98")465    # 32:P2 (p32039)466    R.check("G2", "[chart] the scatter is the two-variable form σ = (2 tan α(x)/ln 10)·δα with tan²α = 1/(e^{√x} − 1): 0.267 dex at "467            "x = 0.01 for σ_v/v = 0.1, below 0.01 dex at x = 100, zero for cold systems, and tan α·x^{1/4} → 1 (0.975, 0.992, 0.998 "468            "at x = 10⁻², 10⁻³, 10⁻⁴) — the x^{−1/4} rise into the deep regime that the SPARC bins show (D1)", ok,469            f"σ(0.01, 0.1) = {s001:.3f} dex; tan α·x^(1/4) = {rise[0]:.3f}, {rise[1]:.3f}, {rise[2]:.4f}", kind="CHART")470471    # G3 [chart] wide binaries in the Galactic field g_ext = 1.8 a₀ (a 1.5 M_⊙ pair, the collinear estimate): the enhancement472    #    √ν − 1 = 11.5 %, 14.9 %, 16.0 % at 10, 20, 40 kAU — the paper's 12–16 %; the arguments y = (g_b + g_ext)/a₀ = 2.65, 2.01, 1.85473    wb = CD.wide_binaries()474    ok = all(_within(r[4], c, "0.05") for r, c in zip(wb, ("11.53", "14.86", "15.96")))475    ok &= all(_within(r[2], c, "0.0005") for r, c in zip(wb, ("2.6535", "2.0134", "1.8533")))476    ok &= all(Q(a[4]) < Q(b[4]) for a, b in zip(wb[:-1], wb[1:])) and all(10 < r[4] < 30 for r in wb)477    # 32:P3 (p32040)478    R.check("G3", "[chart] wide binaries follow g_b ν((g_b + g_ext)/a₀) with the global a₀ and the Galactic field 1.8 a₀: a 1.5 M_⊙ "479            "pair at 10, 20, 40 kAU (g_b/a₀ = 0.85, 0.21, 0.053) has y = 2.65, 2.01, 1.85 and a velocity enhancement √ν − 1 of "480            "11.5 %, 14.9 %, 16.0 % (the paper's 12–16 % on the collinear estimate), rising with separation, inside the 10–30 % "481            "band; the exponential knee distinct from the Newtonian and rational forms", ok,482            "; ".join(f"{r[0]} kAU: y = {r[2]:.4f}, {r[4]:.1f} %" for r in wb), kind="CHART")483484    # G4 [chart] the pressure-supported offset log₁₀ √w, w = 1/(1 + (σ_v/v)²): −0.0485 dex at σ_v/v = 0.5 and −0.1505 at 1485    o1, o2 = CD.coherence_offsets()486    ok = _within(o1, "-0.04846", "0.00005") and _within(o2, "-0.15051", "0.00005") and Q(o1) < 0 and Q(o2) < Q(o1)487    # 32:P4 (p32041)488    R.check("G4", "[chart] pressure-supported systems lie below the cold-disk relation by the coherence factor √w with "489            "w = 1/(1 + (σ_v/v)²): log₁₀√w = −0.0485 dex at σ_v/v = 0.5 and −0.1505 dex at σ_v/v = 1 (the paper's 0.05–0.15 dex), "490            "the offset growing with the dispersion ratio; cold disks lose under 1 %", ok, f"{o1:.4f}, {o2:.4f} dex", kind="CHART")491492    # G5 [chart] the one-variable law: g_obs = g_b ν(g_b/a₀) with one global a₀ is strictly increasing in g_b (x ν(x) rising on a493    #    2001-point log grid 10⁻⁴..10⁴) — one registered acceleration fixes one baryonic acceleration, no second component (X11),494    #    no direction or environment in the law once the external field is in the argument (P6); the one global a₀ fits the binned495    #    SPARC relation: 17 bins of 0.2 dex, the exponential form's free a₀ = 1.17 × 10⁻¹⁰ within 3 % of g_† and 12–13 % above496    #    the floor, its χ² below the rational form's, every bin of 2 < x < 10 within its scatter497    mono = CD.monotone_grid()498    nb, a_e, c_e, a_s, c_s, ratio, worst, be, bs, ce0, cs0 = CD.binned_shape()499    ok = mono and nb == 17 and _between(a_e, "1.16e-10", "1.18e-10") and _within(Q(a_e) / Q(CH.A0_FIT[0]), 1, "0.03")500    ok &= _between(Q(a_e) / Q(CD.floor()), "1.12", "1.13") and _between(ratio, "0.88", "0.89") and Q(c_e) < Q(c_s) and Q(be) < Q(bs)501    ok &= Q(worst) < 1 and Q(ce0) < Q(cs0)502    # 32:X11 (p32037), 32:P6 (p32043)503    R.check("G5", "[chart] the dark sector adds no particle and the scale is global and isotropic: the registered acceleration "504            "g_b ν(g_b/a₀) is a strictly increasing function of g_b with the one global a₀ (x ν(x) rising on a 2001-point grid over "505            "10⁻⁴ < x < 10⁴), so one registered acceleration fixes one baryonic acceleration with no room for a second component, "506            "and no direction or environment enters once the external field is in the argument; one a₀ fits the binned SPARC "507            "relation (17 bins of 0.2 dex): the exponential form's free a₀ = 1.17 × 10⁻¹⁰ lies within 3 % of g_† and 12.5 % above "508            "the floor (floor/fit 0.89), its χ² below the rational form's at the fixed floor and free, every bin of 2 < x < 10 "509            "within its scatter", ok,510            f"monotone {mono}; free a₀ {a_e:.3e} (χ² {c_e:.2f} vs {c_s:.2f}), floor/fit {ratio:.3f}, worst band departure {worst:.2f}σ", kind="CHART")511512513# ------------------------------------------------------------------------------------------------------------514# block Z: the Ω-hard reading (32:Z1)515@R.block("Z", BLOCK["Z"])516def block_Z():517    """Block Z — the Ω-hard reading: Z1 exact."""518    # Z1 the cross-scale running a₀(d)/a₀(carrier) = (Ω − 1)/d on the laboratory Carrier Ω = 2 408 561: Ω − 1 = 2⁴·5·7·11·17·23 has519    #    160 divisors, every ratio (Ω − 1)/d an integer with d·((Ω − 1)/d) = Ω − 1, the ratios running from 1 to Ω − 1; the520    #    certificate closes at carrier scale only (master Z7), the value at Ω ∼ 10¹²³ Ω-hard521    n = D.CARRIER - 1522    fac, divs, ratios = D.divisor_lattice(n)523    ok = fac == {2: 4, 5: 1, 7: 1, 11: 1, 17: 1, 23: 1} and len(divs) == 160 and divs[0] == 1 and divs[-1] == n524    ok &= all(d * r == n for d, r in zip(divs, ratios)) and ratios == sorted(ratios, reverse=True) and len(set(divs)) == 160525    ok &= all(n % d == 0 for d in divs)526    # 32:Z1 (p32047)527    R.check("Z1", "the cross-scale running a₀(d)/a₀(carrier) = (Ω − 1)/d on the laboratory Carrier Ω = 2 408 561: Ω − 1 = 2⁴·5·7·11·17·23 "528            "has 160 divisors, each ratio (Ω − 1)/d an exact integer, the lattice running from 1 at d = Ω − 1 to Ω − 1 at d = 1; "529            "the uniform certificate closes at carrier scale only (master Z7), the value at Ω ∼ 10¹²³ Ω-hard", ok,530            f"Ω − 1 = {n} = 2⁴·5·7·11·17·23, {len(divs)} divisors, ratios {ratios[0]} … {ratios[-1]}")531532533if __name__ == "__main__":534    want = [a.upper() for a in sys.argv[1:]] or sorted(BLOCK)535    bad = [b for b in want if b not in BLOCK]536    if bad: sys.exit(f"no block {', '.join(bad)}: the blocks are {', '.join(sorted(BLOCK))}")537    for b in want: R.run_block(b)538    sys.exit(0 if R.summary(write=False, expect=list(LEDGER) if want == sorted(BLOCK) else None) else 1)539