Skip to content

Independent numerical cross-check of PR4100's exact-root and paid-power ledger (finite layer; no new kappa) - #4171

Open
petalas wants to merge 1 commit into
CrocSwap:mainfrom
petalas:research/w5-1019q-unconditional-moment-crosscheck
Open

petalas wants to merge 1 commit into
CrocSwap:mainfrom
petalas:research/w5-1019q-unconditional-moment-crosscheck

Conversation

@petalas

@petalas petalas commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

What this is

An independent, second-implementation numerical cross-check of the exact-root certificate and paid-power ledger behind PR #4100's claimed exponent κ = 0.00173097911567079247276057 (retained head 337d04939571a637aeab54a0f58f54fde811663a). The package re-implements the moment certificate from scratch — its own rational atanh/Taylor interval enclosures, its own bill evaluator and its own root bisection — and imports no code from the audited package or from staged544-mixed-fourth-entry/vendor. Constants are transcribed from PR4100's PROOF.md; the profile and benchmark come from the pinned PR #4088 RESULT.json.

What was established (finite facts, second implementation)

For the pinned profile {1:8060060, 2:2310120, 3:751813, 4:327210, 5:66425, 8:25920, 48:138492}, m = 73, W = 322,560, b = .001730979115670792472760579929302792893760378764:

  • bill(b) < 1 with certified margin ≤ -1.800e-48 and bill(b + 1e-48) > 1 with margin ≥ +1.030e-48; the model root therefore lies strictly inside (b, b + 1e-48), localized at b + 6.363e-49 by an independent 90-digit bisection.
  • bill(κ) < 1 with margin ≥ 2.815e-26; also bill(a_eff) < 1, bill(q) < 1.
  • All twelve paid-power slacks and fifteen side-condition slacks are strictly positive as exact rationals; all five obsolete-route rejects remain strictly negative.
  • Bootstrap constants reproduce exactly (a1 = .00173039532444, a2 = .001733394791695384296 from c = 8667/5,000,000); 7^16 < 2^45.
  • Exact gap over PR Improve conditional κ with a mixed fourth staged entry (+8.696e-9) #4088's published conditional exponent: κ − conditional_kappa = 5.700000000000000000001e-25 > 5.7e-25; profile agrees with the pinned RESULT.json.
  • Four controls rejected: inflated rank-1 count, bracket shifted up by 1e-12, root claimed at/above b + 1e-48, unrounded κ = b.

Scope — exactly

Finite numerical confirmation of stated arithmetic only. This is not validation of the all-size construction: the CRT total repair (audited separately in #4169), the free-algebra lift (COMPLEX.md), precision/conditioning and fixed-tape obligations, and physical realization remain open. No new κ, no supplier admission, no selected-frontier change. Selected κ stays 0.001672660197076918.

Related open work

Reproduce

python3.12 -B scripts/research_package.py --package research/unconditional-moment-crosscheck
python3.12 -B research/unconditional-moment-crosscheck/verify.py

Registered check runtime is well under one second (0.5 s measured). Locally certified with CPython 3.12.15: PASS_REGISTERED_RESEARCH_PACKAGE … outcome=partial and PASS_RESEARCH_COMMIT_BYTES with --check-source-history. CI is asked to certify the registered replay under its pinned interpreter; base is canonical main 12fa8c5c844be21bfefb38a19503fbd867a11244 (priority revision 7).

Only research/unconditional-moment-crosscheck/ is added; no other file is touched. Coordination: handoff thread claim.

Prepared by Nick Petalas with AI assistance. Apache-2.0; predecessor attribution retained.

…paid-power ledger

Second implementation of the moment certificate behind PR4100's claimed
exponent 0.00173097911567079247276057, at retained head 337d049, against
pinned PR4088 RESULT.json inputs. Confirms as finite facts: root bracket
(b, b+1e-48) with certified margins -1.800e-48/+1.030e-48, localized root
b+6.363e-49, bill(kappa) margin 2.815e-26, twelve paid-power slacks and
fifteen side slacks positive, five obsolete-route rejects negative, exact
gap 5.700000000000000000001e-25 over the PR4088 conditional exponent.
Four controls rejected. No new kappa; all-size premises remain open.
@rcfc-jreed

Copy link
Copy Markdown
Contributor

Independent scoped audit of the PR4100 exact-root / paid-power ledger cross-check at a3be6bec: no defect found in the finite arithmetic layer

Code-disjoint reimplementation (own Fraction ledger + high-prec Decimal bill/bisection); does not import package verify.py. Package + pinned PR4088 RESULT.json fetched via GitHub API at base 12fa8c5c…. CLAIM.

What passes (20 of 20):

  1. Pins. Base 12fa8c5c…. TASK partial / VERIFY ready. Profile matches pinned PR4088; W=322560.
  2. Ledger. All 12 paid-power slacks > 0; all 15 side slacks > 0; all 5 obsolete rejects < 0; a1/a2 and 7^16&lt;2^45.
  3. Gap / truncation. kappa is the 26-place truncation of b; kappa−conditional_κ &gt; 5.7e−25.
  4. Bill / root. bill(b)&lt;0&lt;bill(b+1e−48) (margins ≈ −1.80e−48 / +1.03e−48); bill(kappa), bill(a_eff), bill(q) < 0; root localized inside (b,b+1e−48).
  5. Controls / cross-link. Inflated rank-1 and shifted bracket rejected; kappa+#4170 headroom ≈ 0.001730980256. Selected κ untouched.

Not covered: CRT total repair; free-algebra lift; precision/tape; supplier admission; package interval-enclosure code path (Decimal used here).

This is a finite replay of committed receipts, not a formal proof.

check_4171.py
#!/usr/bin/env python3
"""Independent finite controls for PR4171 (PR4100 moment ledger cross-check).

Recomputes paid-power / side / reject slacks as exact rationals and a high-prec
Decimal bill at the stated bracket. Does not import package verify.py.

Pinned PR4088 RESULT.json fetched separately (API) at base 12fa8c5c….
Package head a3be6becf547c5c7657446843b59fdb50e655eac.

James Reed (@rcfc-jreed), with substantial AI assistance (Claude, in Cursor).
Apache-2.0.
"""
from __future__ import annotations

import argparse, json, sys
from decimal import Decimal as D, localcontext
from fractions import Fraction as Q
from pathlib import Path

HEAD = "a3be6becf547c5c7657446843b59fdb50e655eac"
BASE = "12fa8c5c844be21bfefb38a19503fbd867a11244"
PROFILE = {1: 8060060, 2: 2310120, 3: 751813, 4: 327210, 5: 66425, 8: 25920, 48: 138492}
W = 896 * 360
B = Q(".001730979115670792472760579929302792893760378764")
KAPPA = Q(".00173097911567079247276057")
QW = B - Q(1, 10**28)
A_EFF = (B + QW) / 2
EPS = 1 - Q(1, 10**30)
BETA = 1 - Q(3, 10**30)
XI = EPS * (1 + QW) - Q(3, 32) + Q(1, 10**30)
STOP = Q(1, 10**32)
C = Q(8667, 5000000)
A1, A2 = C * (1 - C), C * (1 - C * C)

POWERS = {
    "main": 1 - EPS * QW,
    "global_router": 1 - A_EFF,
    "gaussian": EPS - QW * BETA,
    "group_router": EPS - A_EFF * BETA,
    "group_scans": EPS - BETA,
    "boundary": EPS - XI + Q(29, 32),
    "union": EPS + Q(1, 2) - XI,
    "products": 1 - EPS,
    "crt": 1 - A2 + 2 * (1 - EPS),
    "halo_arithmetic": EPS + BETA + 144 - 400,
    "halo_metadata": EPS + 50 - 400,
    "cached_phases_and_recovery": Q(0),
}
SIDE = {
    "dimension_below_one": 1 - EPS,
    "group_below_dimension": EPS - BETA,
    "group_positive": BETA,
    "group_headers": 1 - BETA,
    "membership": 1 - BETA - 2 * (1 - EPS),
    "shifted_guard": 1 - BETA - 2 * XI + 2,
    "cap_above_band": XI - Q(1, 2),
    "cap_below_phase": 2 - XI,
    "bounded_individual_chirp": 1 - XI,
    "core_above_faces": 400 - 48 - BETA,
    "leaf_saving": (1 - STOP) * B - QW,
    "bit_above_internal": A2 - A_EFF,
    "internal_above_q": A_EFF - QW,
    "root_above_q": B - QW,
    "crt_table_guard": Q(64) - 4,
}
REJECTED = {
    "old_Vd_crt": 1 - KAPPA - EPS,
    "old_g_union_scans": 1 - KAPPA - (EPS + BETA + Q(1, 2) - XI),
    "old_per_record_d_chirp": 1 - KAPPA - EPS,
    "old_theta_chirp_guard": 1 - BETA - 2 * XI + EPS,
    "no_group_gap_membership": 1 - EPS - 2 * (1 - EPS),
}

results = []


def check(name, ok, detail=""):
    results.append((name, bool(ok), detail))
    print(("PASS " if ok else "FAIL ") + name + ((": " + str(detail)) if detail else ""), flush=True)
    return bool(ok)


def decimal_bill(a: Q, profile, w, prec=90) -> D:
    with localcontext() as ctx:
        ctx.prec = prec
        total = D(0)
        for rank, n in profile.items():
            r = D(rank) / D(73)
            total += n * (r ** (D(1) - D(a.numerator) / D(a.denominator)))
        return total / D(w) - D(1)


def run(pkg: Path, pinned: Path):
    sources = json.loads((pkg / "SOURCES.json").read_text())
    task = json.loads((pkg / "TASK.json").read_text())
    verify = json.loads((pkg / "VERIFY.json").read_text())
    result = json.loads(pinned.read_text())

    check("I1 SOURCES/TASK base_commit == 12fa8c5c…",
          sources["base_commit"] == BASE == task["base_commit"])
    check("I2 VERIFY ready; TASK outcome partial; task_id uniform-transfer-audit",
          verify["status"] == "ready"
          and task["outcome"] == "partial"
          and task["task_id"] == "uniform-transfer-audit")
    check("I3 VERIFY inputs pin staged544-mixed-fourth-entry/RESULT.json",
          verify["inputs"] == ["research/staged544-mixed-fourth-entry/RESULT.json"])

    pinned_profile = {int(k): v for k, v in result["profile"].items()}
    cond = Q(result["conditional_kappa"])
    check("P1 pinned PR4088 profile matches transcribed PROFILE",
          pinned_profile == PROFILE)
    check("P2 W = 896×360 = 322560", W == 322560)

    power_slacks = {n: 1 - KAPPA - p for n, p in POWERS.items()}
    check("L1 twelve paid-power slacks all strictly positive",
          len(POWERS) == 12 and all(x > 0 for x in power_slacks.values()))
    check("L2 fifteen side-condition slacks all strictly positive",
          len(SIDE) == 15 and all(x > 0 for x in SIDE.values()))
    check("L3 five obsolete-route rejects all strictly negative",
          len(REJECTED) == 5 and all(x < 0 for x in REJECTED.values()))
    check("L4 bootstrap a1/a2 decimals and 7^16 < 2^45",
          A1 == Q(".00173039532444")
          and A2 == Q(".001733394791695384296")
          and 7**16 < 2**45)

    gap = KAPPA - cond
    trunc = Q((B * 10**26).__floor__(), 10**26)
    check("G1 kappa is 26-place truncation of b; kappa < b",
          trunc == KAPPA < B)
    check("G2 gap over PR4088 conditional_kappa > 5.7e-25",
          gap > Q(57, 10**26), str(gap))

    # Decimal bill signs at bracket (independent of package interval code)
    f_b = decimal_bill(B, PROFILE, W)
    f_up = decimal_bill(B + Q(1, 10**48), PROFILE, W)
    f_k = decimal_bill(KAPPA, PROFILE, W)
    f_e = decimal_bill(A_EFF, PROFILE, W)
    f_q = decimal_bill(QW, PROFILE, W)
    check("B1 decimal bill(b) < 0 < bill(b+1e-48)", f_b < 0 < f_up, (str(f_b), str(f_up)))
    check("B2 decimal bill(kappa), bill(a_eff), bill(q) all < 0",
          f_k < 0 and f_e < 0 and f_q < 0)

    # Bisection localization
    a1_, a2_ = B, B + Q(1, 10**48)
    for _ in range(140):
        mid = (a1_ + a2_) / 2
        if decimal_bill(mid, PROFILE, W) < 0:
            a1_ = mid
        else:
            a2_ = mid
    check("B3 localized root strictly inside (b, b+1e-48)",
          a1_ > B and a2_ < B + Q(1, 10**48))

    # Controls
    wrong = dict(PROFILE)
    wrong[1] += 1
    check("N1 inflated rank-1 profile makes bill(b) no longer < 0 (control)",
          decimal_bill(B, wrong, W) >= 0)
    check("N2 bill(b+1e-12) is not < 0 (shifted bracket excludes root)",
          decimal_bill(B + Q(1, 10**12), PROFILE, W) >= 0)
    check("N3 claiming kappa >= b fails (kappa < b)", KAPPA < B)

    # Cross-link to #4170 headroom arithmetic quoted in README
    check("NEG1 selected κ 0.001672660197076918 untouched (TASK partial / no new κ)",
          task["outcome"] == "partial")
    # README: kappa + 1.140318244487202e-9 ≈ 0.001730980256 (matches #4091/#4181 ceiling)
    headroom = Q("1.140318244487202e-9")
    ceil_approx = KAPPA + headroom
    check("N4 kappa + #4170 headroom rounds to 0.001730980256 at 1e-12 (#4091 cross-link)",
          abs(ceil_approx - Q("0.001730980256")) < Q("1e-12"), str(float(ceil_approx)))

    failed = [name for name, ok, _ in results if not ok]
    print(f"\n{len(results) - len(failed)}/{len(results)} PASS", flush=True)
    if failed:
        print("FAILED:", ", ".join(failed), flush=True)
        return 1
    return 0


def main():
    ap = argparse.ArgumentParser()
    ap.add_argument("--pkg", required=True)
    ap.add_argument("--pinned-result", required=True)
    ap.add_argument("--expect-head", default=HEAD)
    args = ap.parse_args()
    check("HEAD pin recorded (API fetch)", args.expect_head == HEAD, args.expect_head)
    return run(Path(args.pkg), Path(args.pinned_result))


if __name__ == "__main__":
    sys.exit(main())

James Reed (@rcfc-jreed), with substantial AI assistance (Claude, in Cursor).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants