Skip to content

Bound capped Gaussian inverses through half shifts - #4193

Open
jmbarrancoml wants to merge 3 commits into
CrocSwap:mainfrom
jmbarrancoml:research/shifted-gaussian-conditioning
Open

jmbarrancoml wants to merge 3 commits into
CrocSwap:mainfrom
jmbarrancoml:research/shifted-gaussian-conditioning

Conversation

@jmbarrancoml

@jmbarrancoml jmbarrancoml commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

I improve PR4100's inverse-norm allowance for its capped broad Gaussian interiors from the source's loose p^6 bound to p^(1+xi+o(1)), where the block cap is N<=B<=p^xi and 0<xi<1 is fixed. I derive this conditioning corollary from the predecessor's exact finite Gaussian q-LDU factors, preserving the raw normalization and positive real diagonal gauges.

For the normalized kernel k(u)=exp(-gamma*u²+2*gamma*s*u), I prove

||T_N(s)^-1||₂ <= N/P_(N-1)^3 <= N*exp(pi²/(4gamma))

for gamma>0 and |s|<=1/2, including both half-shift endpoints. Here P_j=product_(r=1..j)(1-exp(-2gamma*r)). A telescoping column-sum bound at the endpoints controls the inverse entries; diagonal conjugation extends the estimate to the closed shift interval. This uses the actual finite cap to avoid the inverse shift-gap loss. I credit Vlado's retained q-LDU identities and the classical finite q-binomial theorem.

For strict |s|<1/2, I also prove

m=Phi(pi) >= (1-2|s|)*sqrt(pi/gamma)*exp(-pi²/(4gamma)).

I use a Poisson relative-tail argument for small scales and a positive-product estimate for large scales. The new floor strictly improves the retained simplified 1/3-exponent floor for 0<gamma<=1; I retain the old bound where it is stronger. I also prove the sharp uniform finite-section identity lim_N ||T_N^-1||₂ = sup_N ||T_N^-1||₂ = 1/m, with an explicit A0/sqrt(N) approximation bound. I credit the original PR1758 product/phase proof for the already-implied minimum-at-pi statement.

At the actual broad caller I retain the raw alpha^-1 normalization, fine-prime parameters and ceiling in alpha. The explicit upper bound is alpha*G*N*exp(a*rho/4), where I bound the inverse-gauge factor G=1+o(1). I give the perturbation condition needed to preserve the result after truncation and rounding. I do not claim an optimal finite-size constant, controlled intermediate precision for an LDU implementation, or an inverse theorem for the broad global matrix or its Schur complement.

I add only research/shifted-gaussian-conditioning/. This refines the uniform-transfer-audit card at priority revision 7. I start from canonical main 12fa8c5c844be21bfefb38a19503fbd867a11244 and pin the retained PR4100 source at 337d04939571a637aeab54a0f58f54fde811663a. I refreshed unchanged main and the source head before submission. Discussion4191 records the bounded overlap search: 5,236 local records, source proofs and fine-prime reviews, plus live PR/hub checkpoints. ToikY's new PR4192 audits compiler arena scans, a separate obligation.

I certify 25 shifted-kernel cases through directed Decimal enclosures of the direct series, Jacobi product and Poisson expression, with explicit tails. I charge the complete truncation/rounding error and reconstruct exact rational LDL positivity certificates for 125 rounded finite sections. I check 150 circle points and ideal alternating-vector inverse bounds. I also check 60 exact rational finite-cap cases, including both half shifts, through full left/right inverse products, entry-decay and row/column bounds; 36 reversed-conjugation variants fail. Further controls cover source corruption, strict-symbol endpoint rejection, outside-domain loss of accretivity, missing normalization, unpaid omitted coefficients, indefiniteness and typed receipt comparison. I mark the analytic large-size descriptors as unexecuted. The written universal proof remains separate from these finite certificates and from the CPython arithmetic trust boundary.

At head 52e962e318423be1fe8ed9d705dba92067795b61, both ordinary/optimized registered checks pass. I passed the 17-file committed-byte/source-history preflight, official export integrity and both Git-free export commands in 3.324 seconds each. All 18 exported files, including the receipt, remained unchanged. Export SHA256: 7cb6b28fa74b50d93c2f7177e2fd57e5cfeba8857e739c730215c3d8b5a10159; receipt SHA256: 1c6ac35a0d41331a728500f32b89446d0b7fc61a8d651903ffae07739a00ce94. Complete scientific receipt: 687ed693fe2614352fec8aae292641ab264444474c42145f45fc66e728ee22ff.

I matched both successful hosted replay records to that export and checked the successful unchanged-input step. Test merge 45ce594f203168028bb4b811512124da52efffdb has the published tree c86e1cd965f9713fb1642b0aff685743c00bf22b. I preserve the first revision's successful receipts in the canonical Discussion.

Reproduce with CPython 3.12 and its standard library:

python3.12 -B scripts/research_package.py \
  --package research/shifted-gaussian-conditioning

I leave the selected frontier unchanged. The package's open questions concern finite-cap sharpness and integration into the complete Gaussian circuit/error ledger. Shallow-circuit correctness, coefficient-generation costs, physical execution and complete multiplication-theorem acceptance remain separate.

Jose Manuel (jmbarrancoml), with substantial OpenAI Codex assistance. I credit Jeremy Kothe/IdeaOuter and the PR1758 contributors for shifted product/phase accretivity, Vlado Vojdanovski/PR1673 for the unshifted Poisson estimate, exact q-LDU factors and capped framework, Chafik Boukhalfa/PR1786 for fine-prime padding, and Cinna Davis for the later caller. I retain the classical Jacobi, Poisson, Newton/q-binomial and Gaussian Toeplitz attribution and frozen source notices. Source-analysis agents belong to the author process; I claim no independent human or formal-kernel acceptance or worldwide priority.

@jmbarrancoml jmbarrancoml changed the title Sharpen shifted Gaussian conditioning for the broad caller Bound capped Gaussian inverses through half shifts Oct 20, 2026
@jmbarrancoml
jmbarrancoml marked this pull request as ready for review October 20, 2026 13:04
@rcfc-jreed

Copy link
Copy Markdown
Contributor

Independent scoped audit of the shifted-Gaussian inverse package at 52e962e3: no defect found in the finite enclosure / finite-cap / seal layer

Code-disjoint reimplementation; does not import package verify.py / intervals.py. Package bytes from head 52e962e318423be1fe8ed9d705dba92067795b61 via GitHub contents API. CLAIM.

What passes (13 of 13):

  1. Pins. Base 12fa8c5c…. Nine SOURCES inputs authenticate. RESULT.sources digests match. π enclosure ordered; kernel half-width 64; 192 fractional bits.
  2. Primary cases. 25 cases over γ∈{1/16,1/8,1/2,1,4,8}; all minimum/floor/enclosure pairs ordered; new_floor ≤ minimum.
  3. Finite cap. 60 cases; gap_free ≈ size·product (1 ulp); row≡column; 36 reversed-shift rejections; four named controls + 130 half-shift pairs.

Not covered: live interval regeneration; universal PROOF.md derivation; new κ.

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

check_4193.py
#!/usr/bin/env python3
"""Independent finite controls for PR4193 (shifted Gaussian conditioning).

Recomputes enclosure order, finite-cap gap-free = 2·product (size>1), π pin,
and SOURCES authentication. Does not import package verify.py / intervals.py.

Package head 52e962e318423be1fe8ed9d705dba92067795b61 via GitHub API.

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

import argparse, hashlib, json, sys
from decimal import Decimal, getcontext
from pathlib import Path

getcontext().prec = 120

HEAD = "52e962e318423be1fe8ed9d705dba92067795b61"
BASE = "12fa8c5c844be21bfefb38a19503fbd867a11244"
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 load(pkg, name):
    return json.loads((pkg / name).read_text(encoding="utf-8"))


def D(x):
    return Decimal(x)


def auth_sources(sources, deps: Path):
    bad, count = [], 0
    for row in sources["files"]:
        if row["usage"] != "input":
            continue
        data = (deps / row["path"]).read_bytes()
        if hashlib.sha256(data).hexdigest() != row["sha256"]:
            bad.append(row["path"]); continue
        blob = b"blob " + str(len(data)).encode() + b"\0" + data
        if hashlib.sha1(blob).hexdigest() != row["git_blob"]:
            bad.append(row["path"] + ":blob"); continue
        count += 1
    return count, bad


def ordered_pair(pair):
    lo, hi = map(D, pair)
    return lo <= hi


def run(pkg: Path, deps: Path):
    sources = load(pkg, "SOURCES.json")
    verify = load(pkg, "VERIFY.json")
    result = load(pkg, "RESULT.json")

    check("I1 SOURCES base_commit == 12fa8c5c…; VERIFY ready",
          sources["base_commit"] == BASE and verify["status"] == "ready")
    check("I2 scope is finite certified evidence (universal in PROOF.md)",
          "finite certified evidence" in result["scope"])

    n_in, bad = auth_sources(sources, deps)
    check("S1 SOURCES input files authenticate (sha256 + git blob)",
          not bad and n_in == 9, bad)
    spath = {f["path"]: f["sha256"] for f in sources["files"]}
    rs_bad = [row["path"] for row in result["sources"]
              if spath.get(row["path"]) != row["sha256"]]
    check("S2 RESULT.sources (9) digests match SOURCES table",
          not rs_bad and len(result["sources"]) == 9, rs_bad)

    # π enclosure
    plo, phi = map(D, result["pi"])
    check("P1 π enclosure ordered and pins 3.141592653589793… with ulp gap",
          plo <= phi
          and str(plo).startswith("3.141592653589793")
          and str(phi).startswith("3.141592653589793")
          and phi - plo > 0)
    check("P2 kernel_half_width=64; coefficient_fractional_bits=192; arithmetic digits=80",
          result["kernel_half_width"] == 64
          and result["coefficient_fractional_bits"] == 192
          and result["arithmetic"]["decimal_digits"] == 80
          and result["arithmetic"]["exp_cases"] == 3
          and result["arithmetic"]["sqrt_cases"] == 3)

    # Main cases
    check("C1 25 primary cases; gamma set {1/16,1/8,1/2,1,4,8}",
          len(result["cases"]) == 25
          and {c["gamma"] for c in result["cases"]}
          == {"1/16", "1/8", "1/2", "1", "4", "8"})
    bad_ord = []
    for i, c in enumerate(result["cases"]):
        for key in ("minimum", "new_floor", "old_floor"):
            if not ordered_pair(c[key]):
                bad_ord.append((i, key))
        for key in ("direct", "product", "tail"):
            if not ordered_pair(c["enclosures"][key]):
                bad_ord.append((i, "enc:" + key))
        # new_floor roughly ≤ minimum (lower bound for half-factor)
        if D(c["new_floor"][1]) > D(c["minimum"][1]) * Decimal("1.0000001"):
            bad_ord.append((i, "new>min"))
    check("C2 all case interval pairs ordered; new_floor ≤ minimum (hi)",
          not bad_ord, bad_ord[:8])

    # Finite cap
    fc = result["finite_cap"]
    check("F1 finite_cap: 60 cases (=3 q × 5 shifts × 4 sizes); 36 reversed-shift rejections",
          len(fc["cases"]) == 60
          and fc["reversed_shift_rejections"] == 36
          and fc["outside_domain_rejected"] is True)
    bad_g = []
    for i, c in enumerate(fc["cases"]):
        if not (ordered_pair(c["row_norm"]) and ordered_pair(c["column_norm"])
                and ordered_pair(c["finite_product_constant"])
                and ordered_pair(c["gap_free_inverse_norm_upper"])):
            bad_g.append(("ord", i)); continue
        prod_lo, prod_hi = map(D, c["finite_product_constant"])
        gap_lo, gap_hi = map(D, c["gap_free_inverse_norm_upper"])
        n = c["size"]
        # Exact relation is gap_free = size·product; allow 1 ulp endpoint drift from decimal print.
        tol = Decimal("1e-70") * max(gap_lo, Decimal(1))
        if abs(gap_lo - n * prod_lo) > tol or abs(gap_hi - n * prod_hi) > tol:
            bad_g.append(("n*prod", i, n))
        if c["row_norm"] != c["column_norm"]:
            bad_g.append(("rowcol", i))
    check("F2 finite_cap: ordered norms; gap_free ≈ size·product (1 ulp); row≡column",
          not bad_g, bad_g[:6])
    qs = {c["q"] for c in fc["cases"]}
    check("F3 finite_cap q ∈ {1/4, 9/16, 225/256}; sizes {1,2,4,8}",
          qs == {"1/4", "9/16", "225/256"}
          and {c["size"] for c in fc["cases"]} == {1, 2, 4, 8})

    ctrl = result["controls"]
    check("N1 controls: 4 rejections; half_shift_pairs=130; domain/normalization/tail/typed True",
          len(ctrl["rejected"]) == 4
          and ctrl["half_shift_pairs"] == 130
          and ctrl["outside_domain_indefinite"] is True
          and ctrl["normalization_control"] is True
          and ctrl["unpaid_tail_control"] is True
          and ctrl["typed_receipt_control"] is True)

    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("--deps", 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.deps))


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

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

@rcfc-jreed

Copy link
Copy Markdown
Contributor

Independent scoped audit of #4193 capped Gaussian inverses / half shifts at 52e962e3: 8/8

Code-disjoint nested HERE/ROOT fork of verify.py. Head 52e962e318423be1fe8ed9d705dba92067795b61. CLAIM.

No packaging defect in SOURCES scope. All 11 digests match.

What passes: fork regenerates a PASS receipt against sealed RESULT.json.

Not covered here: Lean; new κ; merge/close.

Finite pin/seal/interval replay ≠ formal proof.

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