From f9e68f40b0da7236a7fad415f7172218c0666d27 Mon Sep 17 00:00:00 2001 From: Nick Petalas Date: Mon, 2 Nov 2026 19:38:12 +0000 Subject: [PATCH] feat(research): prove sharp direct higher-moment split charge --- research/direct-higher-moment-split/PROOF.md | 142 ++++++++++++++ research/direct-higher-moment-split/README.md | 141 ++++++++++++++ .../direct-higher-moment-split/SOURCES.json | 30 +++ research/direct-higher-moment-split/TASK.json | 89 +++++++++ .../direct-higher-moment-split/VERIFY.json | 37 ++++ research/direct-higher-moment-split/verify.py | 184 ++++++++++++++++++ 6 files changed, 623 insertions(+) create mode 100644 research/direct-higher-moment-split/PROOF.md create mode 100644 research/direct-higher-moment-split/README.md create mode 100644 research/direct-higher-moment-split/SOURCES.json create mode 100644 research/direct-higher-moment-split/TASK.json create mode 100644 research/direct-higher-moment-split/VERIFY.json create mode 100644 research/direct-higher-moment-split/verify.py diff --git a/research/direct-higher-moment-split/PROOF.md b/research/direct-higher-moment-split/PROOF.md new file mode 100644 index 0000000000..32a27958b2 --- /dev/null +++ b/research/direct-higher-moment-split/PROOF.md @@ -0,0 +1,142 @@ +# The sharp direct higher-moment split coefficient + +This proof was produced by Nick Petalas. Apache-2.0. + +## Theorem + +Fix real numbers `01`. For positive integers `R>J`, write +`R=qJ+r`, where `q>=1` and `0<=r=1`. +Its derivative has the sign of + +``` +(1-sigma)q + s - sigma s^t < 0. +``` + +Indeed `s<=s^t` and `sigma>1`. Thus every integer `q>1` is strictly worse +than `q=1`. This step retains the denominator's full higher moment, unlike +the linear-rank estimate followed by a separate moment comparison in PR4832. + +For `F_1`, the derivative on `(0,1)` has the sign of + +``` +h(s) = t s^(t-1) + (t-sigma)s^t - sigma, +h'(s) = t(t-1)s^(t-2) + t(t-sigma)s^(t-1) < 0. +``` + +The function `h` tends to positive infinity at zero and has +`h(1)=2(t-sigma)<0`. It has one zero, and this is the unique maximum of +`F_1` on `[0,1]`. Its stationary equation gives the second expression for K. +Since `F_1(0)=1` and the derivative is positive before that maximum, `K>1`. +At its positive maximizer, division by `(1+s)^(sigma-1)>1` gives +`K(t,sigma)<(1+s^t)/(1+s)<=K(t,1)`. PR4832 supplies `K(t,1)<2`. + +For sharpness over integers, let `J` tend to infinity and choose +`r=floor(s_(t,sigma) J)`, `R=J+r`. Eventually `0C`, `sigma=t+u>1`, +`J=c^v` and `L=b^v`, with `1C`. +The completion coefficient, unsplit overcount and all realization premises +are retained. No particular inventory, tensor power or admitted supplier is +certified here. The direct compiler of zxv's PR4483 can avoid strictification +for profiles satisfying its own gates; this result makes no comparison to +that compiler's sufficient sizes. + +## Exact finite certificate + +For rational `t=a/b`, `sigma=c/d`, put `y=s^(1/b)`. The critical equation +becomes the strictly decreasing polynomial + +``` +ad + (ad-bc)y^b - bc y^(b-a) = 0. +``` + +The verifier bisects this polynomial using rational arithmetic. At any rational +y, the normalized ratio's d-th power is exactly + +``` +F_q(y^b)^d = (q+y^a)^d / (q+y^b)^c. +``` + +Thus its root enclosures, finite split checks and attaining example require +neither floating-point tolerances nor algebraic-number libraries. These checks +corroborate the proof; they are not a universal census or proof-kernel acceptance. diff --git a/research/direct-higher-moment-split/README.md b/research/direct-higher-moment-split/README.md new file mode 100644 index 0000000000..ddfb5f4cab --- /dev/null +++ b/research/direct-higher-moment-split/README.md @@ -0,0 +1,141 @@ +# Sharp direct higher-moment split charge + +For every real `01`, the least coefficient in + +``` +split_t(R,J) <= K(t,sigma) R^sigma J^(t-sigma), +R=qJ+r>J, 0<=rC`, its complete sufficient charge improves as follows. + +```diff +-alpha^v + K(t,1) gamma_u^v + 2 delta^v ++alpha^v + K(t,t+u) gamma_u^v + 2 delta^v +``` + +The full completion charge and unsplit overcount remain. The proof derives +this consequence from the credited moment-product premise, without replaying +predecessor programs or numbers. This is a sharp coefficient for the full +split charge, not a net-tax optimum, a smaller demonstrated tensor power or +a newly admitted supplier. PR4483's different direct compiler can avoid +strictification under its own gates. + +## Reproduce + +From the repository root, using CPython 3.12 and the standard library: + +```sh +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -W error -B research/direct-higher-moment-split/verify.py +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -O -W error -B research/direct-higher-moment-split/verify.py +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/research_package.py --package research/direct-higher-moment-split +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/check_research_commit.py --package research/direct-higher-moment-split --check-source-history +``` + +Other hosts may substitute their CPython 3.12 path. The last check requires +committed publication bytes. The scientific command prints a JSON receipt with +`PASS_DIRECT_HIGHER_MOMENT_SPLIT`; the runner prints +`PASS_REGISTERED_RESEARCH_PACKAGE`. To save a generated receipt, append +`--receipt /absolute/path/outside/the/checkout.json` to a direct command. +Normal replay writes no files. Receipts bind all six package files and both +source documents by SHA256; no receipt is hand-written or treated as an oracle. + +The finite verifier checks 30 rational parameter pairs, 7,650 exact integer +splits, 6,720 strict quotient comparisons and 30 near-maximizing integer +witnesses. It also checks the exactly attaining family representative and +13 rejecting controls. Rational polynomial bisection encloses each maximizing +remainder; comparisons use powers of positive rational numbers. No floating +point or predecessor executable is used. The written proof covers arbitrary +real parameters; finite examples do not supply that universal quantification. +Checks remain enabled under Python optimization. + +## Scope and overlap + +The `uniform-transfer-audit` card is changed from assumption audit to a new +compiler coefficient theorem. This side result tightens one sufficient +accounting bound; it does not discharge any of the five framework assumptions. +The documented first source-binding control passes against selected PR6030. +Source provenance is canonical main +`7c49fe32c55de02c2c873655c804b16e4c3fef0a`, priority revision 8. + +[The advance claim](https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19358948) +records the exact question. Entry checks inspected live open PRs, recent handoff +claims, merged titles/bodies and distinctive formulas in all tracked main +package READMEs. The question source predates the recent contribution series. +Search coverage does not certify novelty; sparse notes, arbitrary historical +diffs and unpublished work remain limits. + +Native semantics, dirty restoration, paid placement, chronological compiler +closure, precision, stock, tape access and exact recovery remain inherited +obligations. No physical caller, selected cold replay, native suite, Lean or +Docker run is supplied. No independent human or proof-kernel acceptance is +claimed. + +## Verification design + +The verifier has no recursion, subprocesses, callbacks or imported predecessor +code. All scientific loops have explicit finite bounds. Its census uses six +exponents, five higher moments, 32 remainder parameters and eight quotients; +root isolation takes 72 steps. Rational parameters have denominators at most +16, `0= 0: + low = middle + else: + high = middle + require(critical_polynomial(low, t, sigma) >= 0, "lower root bracket") + require(critical_polynomial(high, t, sigma) < 0, "upper root bracket") + lower = normalized_power(1, low, t, sigma) + upper = (1 + high**a) ** d / (1 + low**b) ** c + require(1 < lower <= upper and upper - lower < Q(1, 2**52), "coefficient bracket") + return low, high, lower, upper + + +def census(): + exponents = (Q(1, 4), Q(1, 3), Q(1, 2), Q(2, 3), Q(3, 4), Q(7, 8)) + moments = (Q(5, 4), Q(3, 2), Q(17, 10), Q(2), Q(3)) + rows, cases, quotient_checks, witnesses = [], 0, 0, 0 + for t in exponents: + for sigma in moments: + low, high, lower, upper = coefficient_enclosure(t, sigma) + for k in range(32): + y = Q(k, 32) + previous = normalized_power(1, y, t, sigma) + for q in range(1, 9): + value = normalized_power(q, y, t, sigma) + require(value == literal_split_power(q, y, t, sigma), "literal integer split") + require(value <= upper, "split exceeds certified maximum") + if q > 1: + require(value < previous, "quotient monotonicity") + quotient_checks += 1 + previous = value + if k or q > 1: + cases += 1 + a, b, c, d = parameters(t, sigma) + cutoff, remainder = low.denominator**b, low.numerator**b + require(0 < remainder < cutoff, "integer sharpness witness") + require(Q(remainder, cutoff) == low**b, "integer normalization") + require(normalized_power(1, low, t, sigma) == lower, "witness value") + require(literal_split_power(1, low, t, sigma) == lower, "literal witness charge") + witnesses += 1 + rows.append({"t": str(t), "sigma": str(sigma), "root_y": [str(low), str(high)], + "K_power": d, "K_power_interval": [str(lower), str(upper)], + "witness_cutoff_bits": cutoff.bit_length()}) + require((cases, quotient_checks, witnesses) == (7650, 6720, 30), "census domain") + return rows, cases, quotient_checks, witnesses + + +def sharp_fixture(): + t, sigma, y = Q(1, 2), Q(17, 10), Q(1, 4) + require(critical_polynomial(y, t, sigma) == 0, "exact maximizing remainder") + power = Q(5, 4) ** 10 * Q(16, 17) ** 17 + require(normalized_power(1, y, t, sigma) == power, "attaining J=16 R=17") + require(literal_split_power(1, y, t, sigma) == power, "literal attaining charge") + require(Q(9, 8) ** 10 < power < Q(8, 7) ** 10, "strict rational separation") + # PR4832's cited half-power coefficient is (1+sqrt(2))/2 > 6/5. + require(Q(2) > Q(7, 5) ** 2, "old coefficient exceeds 6/5") + require(power < Q(6, 5) ** 10, "strict improvement over linear-rank transfer") + return {"t": str(t), "sigma": str(sigma), "J": 16, "R": 17, + "maximizing_remainder": "1/16", "K_to_10": str(power), + "K_strict_interval": ["9/8", "8/7"]} + + +def controls(fixture): + rejected = 0 + invalid = ((Q(0), Q(2)), (Q(1), Q(2)), (Q(-1), Q(2)), + (Q(1, 2), Q(1)), (Q(1, 2), Q(0)), (Q(1, 2), Q(5)), + (Q(1, 17), Q(2)), (Q(1, 2), Q(33, 17))) + for t, sigma in invalid: + try: + parameters(t, sigma) + except ValueError: + rejected += 1 + else: + raise ValueError("invalid parameters accepted") + for q, y in ((0, Q(1, 2)), (1, Q(-1, 2)), (1, Q(1))): + try: + normalized_power(q, y, Q(1, 2), Q(17, 10)) + except ValueError: + rejected += 1 + else: + raise ValueError("invalid split accepted") + for underclaim in (Q(1), Q(9, 8)): + require(underclaim**10 < Q(fixture["K_to_10"]), "false coefficient not rejected") + rejected += 1 + require(rejected == 13, "control count") + return rejected + + +def source_hashes(): + package = Path(__file__).resolve().parent + root = package.parent.parent + names = ("README.md", "PROOF.md", "TASK.json", "SOURCES.json", "VERIFY.json", "verify.py") + hashes = {} + for name in names: + data = (package / name).read_bytes() + require(len(data) <= 2_000_000, "package file budget") + hashes[f"research/direct-higher-moment-split/{name}"] = hashlib.sha256(data).hexdigest() + manifest = json.loads((package / "SOURCES.json").read_text()) + inputs = [row for row in manifest["files"] if row["usage"] == "input"] + require(len(inputs) == 2, "source input count") + for row in inputs: + data = (root / row["path"]).read_bytes() + require(len(data) <= 2_000_000, "source file budget") + digest = hashlib.sha256(data).hexdigest() + require(digest == row["sha256"], "source pin mismatch") + hashes[row["path"]] = digest + return hashes + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--receipt", type=Path) + args = parser.parse_args() + rows, cases, quotient_checks, witnesses = census() + fixture = sharp_fixture() + rejected = controls(fixture) + result = {"status": "PASS_DIRECT_HIGHER_MOMENT_SPLIT", "claim_type": "scoped proof with finite corroboration", + "split_cases": cases, "quotient_comparisons": quotient_checks, + "integer_near_maximizers": witnesses, "rejected_controls": rejected, + "coefficient_enclosures": rows, "sharp_fixture": fixture, "sha256": source_hashes()} + payload = json.dumps(result, indent=2, sort_keys=True) + "\n" + if args.receipt is not None: + target = args.receipt.resolve() + require(not target.is_relative_to(Path(__file__).resolve().parent.parent.parent), + "keep generated receipts outside the checkout") + written = target.write_text(payload) + require(written == len(payload) and target.read_text() == payload, "receipt write") + print(payload, end="") + + +if __name__ == "__main__": + main()