From 94c1336647abf7ff8caaa12edf729d09dc5aa32b Mon Sep 17 00:00:00 2001 From: Nick Petalas Date: Fri, 13 Nov 2026 13:52:46 +0000 Subject: [PATCH 1/2] feat(research): prove sharp acyclic interaction error budgets --- research/acyclic-interaction-budgets/PROOF.md | 164 +++++++++ .../acyclic-interaction-budgets/README.md | 160 ++++++++ .../acyclic-interaction-budgets/SOURCES.json | 30 ++ .../acyclic-interaction-budgets/TASK.json | 118 ++++++ .../acyclic-interaction-budgets/VERIFY.json | 34 ++ .../acyclic-interaction-budgets/budgets.py | 93 +++++ .../acyclic-interaction-budgets/verify.py | 345 ++++++++++++++++++ 7 files changed, 944 insertions(+) create mode 100644 research/acyclic-interaction-budgets/PROOF.md create mode 100644 research/acyclic-interaction-budgets/README.md create mode 100644 research/acyclic-interaction-budgets/SOURCES.json create mode 100644 research/acyclic-interaction-budgets/TASK.json create mode 100644 research/acyclic-interaction-budgets/VERIFY.json create mode 100644 research/acyclic-interaction-budgets/budgets.py create mode 100644 research/acyclic-interaction-budgets/verify.py diff --git a/research/acyclic-interaction-budgets/PROOF.md b/research/acyclic-interaction-budgets/PROOF.md new file mode 100644 index 0000000000..df9de2b753 --- /dev/null +++ b/research/acyclic-interaction-budgets/PROOF.md @@ -0,0 +1,164 @@ +# Sharp budgets from a common acyclic interaction support + +This contribution was produced by Nick Petalas. Apache-2.0. + +## Contract and notation + +Let D_1,...,D_K be real or complex n by n matrices. Their union support is +the directed graph having an edge c to r whenever some (D_i)_(r,c) is +nonzero. Assume this graph is acyclic and every directed path has at most h +edges, with 0<=h<=n-1. Fix any induced matrix norm and bounds +d_i>=||D_i||. The d_i may be zero and need not be small. + +For a list d=(d_1,...,d_j), define + + e_r(d) = sum_{1<=i_1<...=0} d_1^a1 ... d_j^aj, + E_h(d) = sum_{r=0}^h e_r(d), + C_h(d) = sum_{r=0}^h H_r(d). + +Both degree-zero polynomials are one. For the empty list, all positive +degree polynomials vanish. These are the classical elementary symmetric +and complete homogeneous symmetric polynomials, respectively. + +Write R_j=(I+D_j)...(I+D_1), with R_0=I. Then + + ||R_j|| <= E_h(d_1,...,d_j), + ||R_j-I|| <= E_h(d_1,...,d_j)-1, + ||R_j^-1|| <= C_h(d_1,...,d_j), + ||R_j^-1-I|| <= C_h(d_1,...,d_j)-1. + +Every R_j is invertible. All four envelopes are sharp over the stated +class in the induced infinity norm, separately for forward and inverse +quantities, for every finite nonnegative list d and every h. A witness has +dimension h+1. Sharpness also holds in any larger dimension by adding zero +coordinates to the errors. A particular graph or an extra rank restriction +can have smaller optimal envelopes. + +## Vanishing products and the upper bounds + +An entry of a product of r supported matrices is a sum over directed walks +of length r in the union graph. A directed walk in an acyclic graph cannot +repeat a vertex, so it is a path. Thus every product of h+1 matrices chosen +from the D_i, with arbitrary repetition and order, is zero. This statement +is stronger than each individual D_i being nilpotent. + +Expand R_j in its chronological order. Its terms of degree r choose r +distinct factor indices. Submultiplicativity bounds the sum of their norms +by e_r(d). Every term of degree greater than h vanishes. Keeping the +constant term proves the first bound; removing it proves the second. + +Since D_i^(h+1)=0, the exact inverse of I+D_i is the finite sum + + I-D_i+D_i^2-...+(-D_i)^h. + +The inverse R_j^-1 is the product of these inverse factors in reverse +order, namely (I+D_1)^-1...(I+D_j)^-1. Expanding and grouping by total +degree r gives one term for each nonnegative exponent tuple summing to r. +The norm sum is at most H_r(d). Terms above degree h vanish, even when +they use different factors. This proves both inverse bounds. No infinite +series, commuting-error hypothesis or small-error limit is used. + +## Exact attaining families + +Let S be the (h+1)-dimensional matrix with ones just above the diagonal +and zeros elsewhere. Its norm is one when h>=1, and S^(h+1)=0. Its union +support is one directed path of length h. For h=0 use the zero 1 by 1 +matrix. Take D_i=d_i S. All factors commute in this example, and direct +polynomial multiplication gives + + R_j = sum_{r=0}^h e_r(d) S^r. + +The first row has one entry e_r(d) in each column r+1. Every other row +has a shorter nonnegative sum. Consequently its maximum absolute row sum +is exactly E_h(d), and removing I gives exactly E_h(d)-1. + +For the inverse bounds instead take D_i=-d_i S. Its inverse product is + + R_j^-1 = sum_{r=0}^h H_r(d) S^r. + +The same first-row argument gives C_h(d) and C_h(d)-1. These witnesses +satisfy the prescribed upper bounds on individual norms, with equality +when h>=1. The h=0 class necessarily has zero errors, and both envelopes +are one regardless of any looser prescribed d_i. + +These are different sign choices. No simultaneous attainment of the +forward and inverse maxima by one error sequence is asserted. If the +positive d_i fail to use every edge, the union graph can have depth less +than h. The witness still belongs to the class of support depth at most h, +and a zero budget has the same sharp value one in either depth class. + +## Arithmetic noise and the original precision interface + +For z_0=x and z_i=(I+D_i)z_(i-1)+v_i, finite expansion gives + + ||z_j-x|| <= (E_h(d_1,...,d_j)-1)||x|| + + sum_{i=1}^j E_h(d_(i+1),...,d_j)||v_i||. + +Each noise term meets only the later factors. The proof above applies to +that suffix, whose support depth is at most h. This bound is sharp in the +same class in the infinity norm. Use D_i=d_i S, x=M times the all-ones +vector, and v_i=eta_i times that vector, with M,eta_i>=0. Every contribution +is nonnegative and its first-row sum attains the displayed bound. This +also covers h=0 and empty suffixes. + +For exact gates A_i with F_i=A_i...A_1 and perturbed gates A_i+Delta_i, +y_i=(A_i+Delta_i)y_(i-1)+u_i, the interaction identity of ywz65's PR2701 is + + D_i=F_i^-1 Delta_i F_(i-1), + z_i=F_i^-1 y_i, + v_i=F_i^-1 u_i. + +If these actual D_i satisfy the common acyclic hypothesis, the preceding +bounds apply. In particular, for ||F_i||,||F_i^-1||<=B, + + ||Q_j|| <= B E_h(d_1,...,d_j), + ||Q_j^-1|| <= B C_h(d_1,...,d_j), + ||Q_j-F_j|| <= B(E_h(d_1,...,d_j)-1), + ||Q_j^-1-F_j^-1|| <= B(C_h(d_1,...,d_j)-1). + +The physical trajectory bound is ||F_j|| times the preceding noise formula +with ||v_i||=||F_i^-1 u_i||. The B factors are sufficient; their optimality +for arbitrary prescribed physical frames is not claimed. For data-dependent +errors, apply the inequalities to the realized sequence and its stated +norm bounds. Inverting that realized linear product is not an inverse for +a nonlinear rounded execution. + +## A strict improvement and its boundary + +At depth h=1, both exact envelopes are + + 1+sum_i d_i. + +All interactions are then mutually annihilating, which is stronger than +the separate square-zero condition in Ali Romman's PR5288. Whenever two +d_i are positive, this is strictly below its sufficient product +product_i(1+d_i). That earlier theorem is cited, not replayed. Twenty +errors of norm 1/10 have exact envelope 3, instead of (11/10)^20. + +The higher-depth contract also allows individual errors with D_i^2!=0. +For h=2 and the same twenty norms, the exact forward envelope is 49/10 +and the exact inverse envelope is 51/10. Their total norm budget is two; +the general small-total-error criterion in PR2701 is unavailable. + +Common acyclicity is essential for truncation at h. In dimension two, +D_1=D_3=E_12 and D_2=E_21 are individually square-zero, but their union +has a directed two-cycle. Their product (I+D_3)(I+D_2)(I+D_1) has infinity +norm five, exceeding the invalid depth-one prediction four. + +Physical gate supports do not establish the hypothesis in interaction +coordinates. For example, with physical Delta_2=E_12, exact A_1=I+E_21 +and A_2=I, one gets D_2=A_1^-1 E_12 A_1, which has nonzero diagonal +entries. Thus even a triangular physical perturbation can lose the +coordinate-support certificate after conjugation. + +## Scope + +This is a scoped mathematical precision-interface theorem. The norm and +support of an actual selected interaction word remain to be supplied. +No actual selected caller, coefficient storage policy, bounded arithmetic +kernel, physical inverse, overflow margin, tape/storage invoice, native +operation, supplier admission or exponent improvement is proved here. +All five selected framework assumptions remain. Finite rational checks +corroborate the written universal argument; they are not its quantifier +proof or independent human or formal proof-kernel acceptance. diff --git a/research/acyclic-interaction-budgets/README.md b/research/acyclic-interaction-budgets/README.md new file mode 100644 index 0000000000..8717e7dec3 --- /dev/null +++ b/research/acyclic-interaction-budgets/README.md @@ -0,0 +1,160 @@ +# Sharp polynomial budgets for acyclic interaction errors + +This contribution was produced by Nick Petalas. Apache-2.0. +Independent human and formal proof-kernel review are unclaimed. + +Claim type: scoped written mathematical proof with exact finite corroboration. +If all interaction-error matrices share an acyclic coordinate support with +paths of at most h edges, the sharp forward norm envelope is the degree-h +sum of elementary symmetric polynomials in their individual norm budgets. +The sharp inverse envelope uses complete homogeneous symmetric polynomials. +No small-total-error restriction is needed. A common shift matrix attains +each envelope exactly in the infinity norm, with separate sign choices. + +For R=(I+D_K)...(I+D_1), d_i>=||D_i||, write e_r and H_r for these two +classical symmetric polynomials. [PROOF.md](PROOF.md) proves + +```text +||R|| <= sum_(r=0..h) e_r(d), +||R^-1|| <= sum_(r=0..h) H_r(d). +``` + +Subtracting the degree-zero term gives sharp operator-defect bounds. The +proof also gives a sharp suffix-weighted arithmetic-noise budget. Products +of more than h errors vanish because every such product follows a directed +walk in the common graph. This argument permits arbitrary finite real or +complex matrices; they need not commute or be individually square-zero. + +At depth one, the exact forward and inverse envelope is `1+sum_i d_i`. +Twenty errors of norm `1/10` therefore have bound **3**, strictly below the +earlier sufficient shear product `(11/10)^20` of Ali Romman's +[PR5288](https://github.com/CrocSwap/integer-mult-bounds/pull/5288). +This uses the stronger common-depth-one hypothesis. At depth two the exact +bounds for the same norm list are **49/10 forward** and **51/10 inverse**. +Those higher-depth errors may have nonzero squares, outside that earlier +shear theorem. Neither predecessor result is re-audited here. + +## Reproduce + +From the repository root, with CPython 3.12 and its standard library: + +```sh +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -W error -B research/acyclic-interaction-budgets/verify.py +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -O -W error -B research/acyclic-interaction-budgets/verify.py +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/research_package.py --package research/acyclic-interaction-budgets +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/check_research_commit.py --package research/acyclic-interaction-budgets --check-source-history +``` + +Another CPython 3.12 path may replace that executable. Expected direct marker: +`PASS_ACYCLIC_INTERACTION_BUDGETS`, with `errors=0`. Each run emits a newly +computed JSON receipt bound to every package file by SHA256. The verifier +writes nothing. No receipt is handwritten, and no solver or predecessor +executable is required. The two registered commands each have a 120-second +timeout. Provenance pins are authenticated separately by the package checks. + +The finite replay covers: + +- 326 coefficient comparisons against independently enumerated subsets and + multisets, plus two maximum-capacity checks. +- All 729 pairs of three-dimensional strictly upper triangular matrices with + entries in `{-1/2,0,1/2}`. A separate adjacency-power oracle checks graph + depth, and rational Gaussian elimination computes the actual inverses. +- Fifteen permuted-coordinate words and two twenty-step words. Across these + and the exhaustive pairs, 746 support graphs, 1,553 prefixes and 1,553 + arithmetic-noise steps pass. +- Fifty-one attaining families, including empty words, zero depth, zero + norms and the executable's maximum dimension and step count. +- Twenty malformed-input rejections and seven mathematical controls. These + distinguish individual from common nilpotence, elementary from homogeneous + inverse coefficients, chronological inverse order, suffix noise, and + physical from interaction-coordinate support. + +These finite checks corroborate the universal written proof. They do not +exhaust all matrices or supply formal proof-kernel acceptance. + +## Scope, sources and limitations + +The interaction identity `D_i=F_i^-1 Delta_i F_(i-1)` and the physical +prefix/noise contract come from ywz65's +[PR2701](https://github.com/CrocSwap/integer-mult-bounds/pull/2701), head +`c21f5a50b9f4682ff9d4fe622d3d4e81c3cc86fb`. Ali Romman's PR5288, +head `cd33c723408bb98875211ee3145582c507881f29`, supplies the distinct +square-zero shear product comparison. Classical nilpotent inverse formulas,+symmetric polynomials and directed-path expansions retain their mathematical +credit. No general literature-priority claim is made for those methods. + +The new step is the pair of sharp common-depth budgets, their attaining +families and exact precision-interface consequence. The predecessor's +production-caller question is refined to this additional-structure question; +it is not claimed as a completed caller binding. No predecessor executable, +construction or scientific replay is used. Predecessor files and credit lines +remain unchanged. Their retained proof texts, the original card and selected +record are pinned as historical provenance in [SOURCES.json](SOURCES.json). + +The `uniform-transfer-audit` card explicitly changes scope to this side +result. It does not discharge the selected `precision_tape` assumption. +Canonical base is `e54523517d0f03e58352e647c403a5af3e525a57`, priority +revision eight, selected #7000 with conditional kappa `363005817/10^11`. +The selected bindings-only baseline passed. No selected cold replay, +predecessor scientific replay, native build, Lean or Docker run is claimed. + +Common acyclicity must hold for the actual interaction errors. Triangular +physical perturbations can acquire diagonal entries under the required +prefix conjugation. A written two-dimensional example and its exact control +show this distinction. The optimal bounds concern all support graphs of +depth at most h; a prescribed graph can have smaller optima. The physical +frame-norm factors are sufficient, with no sharpness claim for them. + +Arithmetic rounding may be nonlinear. An inverse of its realized perturbed +linear product is not a reversible finite-grid program. Actual coefficient +storage, a bounded-error arithmetic kernel, overflow, physical representation, +ownership/restoration, native operations, tape/storage costs, a complete +signed invoice and supplier admission remain open. All five framework +assumptions remain. No new kappa or selected-frontier change is claimed. + +The [advance claim](https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19591516) +and local reservation precede the result. Live coverage included 800 open PRs +and 7,400 Discussion records with complete pagination, followed by distinctive +all-main README and merged-PR searches. Sparse local notes were incomplete; +the separate full closed-PR refresh timed out. Arbitrary historical diffs and +unpublished work remain outside coverage. These checks are not a novelty +certificate. [TASK.json](TASK.json) records the source and scope decision. + +## Open next questions + +1. Bind one actual emitted tile and coefficient-storage policy to the common + acyclic interaction hypothesis. Compute the exact prefixes, their inverses + and transformed error supports in one fixed basis. Include basis-change + norms, arithmetic error and physical costs before judging any precision + or complete-invoice gain. The supplied caller contract is the blocker. +2. Determine the sharper envelope for one particular acyclic graph that + excludes the shift witness. Start with its chronological paths and the + within-factor paths appearing in inverse expansions. A specific error + budget and consumer decision are needed before a new census is useful. + +No further construction or search is supplied here. + +## Verifier constraints + +The bounded rational API accepts dimensions at most 16, words of at most 32 +steps and input numerator/denominator heights of at most 256 bits. The proof +has no such finite restrictions. Polynomial updates use O(K(h+1)) arithmetic +operations and O(h+1) rational entries; the trajectory helper uses O(K^2(h+1)). +The support checker uses a bounded topological elimination on at most 256 +edges. All new functions have fewer than sixty physical lines and use no +recursion. Explicit exceptions keep every scientific check enabled under +optimized Python. No subprocess, network access or persistent write occurs. + +Power of Ten rule 3 deviation: CPython dynamically allocates rational numbers +and containers. The dimensions, step counts, bit heights and serial fixture +domains bound live data. The pair inventory has 27 matrices and tests one pair +at a time. An attaining fixture holds two lists of at most 32 matrices. Internal runtime +allocation is not instrumented. Receipt reads are limited to seven regular +files, each at most 128 KiB. A fixed-allocation implementation would be needed +before using this checker as an embedded runtime service. + +The isolated verifier explicitly loads its one adjacent implementation module +because isolated Python omits the script directory from the import path. +This is the only dynamic module target, with no generated code or arbitrary +callback dispatch. Package-file hashes bind its source in each generated +receipt. Warning-strict normal and optimized replay and in-memory syntax +compilation supply diagnostics; no separate static analyzer is claimed. diff --git a/research/acyclic-interaction-budgets/SOURCES.json b/research/acyclic-interaction-budgets/SOURCES.json new file mode 100644 index 0000000000..9525b3ef2b --- /dev/null +++ b/research/acyclic-interaction-budgets/SOURCES.json @@ -0,0 +1,30 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + }, + { + "path": "research/simultaneous-gate-rounding/README.md", + "usage": "provenance", + "git_blob": "eaad013627f7ded744f032eea77fed6f121fc01c", + "sha256": "4bd564aa762f07d67127cba668b370bab3c1407c733f873c756cf2f62e906f2a" + }, + { + "path": "research/shear-structure-perturbation/README.md", + "usage": "provenance", + "git_blob": "badc068ab14b3c80ca659799a2c8dc4c563379a2", + "sha256": "2f6eee473e3b1bccdd926ebb055d32ba299770d8037f9e0c120cbfc98e4f4a94" + } + ] +} diff --git a/research/acyclic-interaction-budgets/TASK.json b/research/acyclic-interaction-budgets/TASK.json new file mode 100644 index 0000000000..a774d050e2 --- /dev/null +++ b/research/acyclic-interaction-budgets/TASK.json @@ -0,0 +1,118 @@ +{ + "schema_version": 1, + "task_id": "uniform-transfer-audit", + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "original_card": { + "id": "uniform-transfer-audit", + "question": "Can one of the selected record's five inherited assumptions be proved at its actual caller?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "Identify the proposition and what would change downstream; do not equate a finite replay with a universal proof.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Choose one assumption ID (native_all_columns, owned_erasure, compiler, precision_tape, analytic_recovery), one quantified implication and exact dependency closure. Check current handoffs, including #5625 row reentry and #5707 root-prefix lowering, without treating their partial scope as the whole theorem. Prove or falsify that implication with a caller-bound argument; stop at the chosen obligation. Finite tests or root digits do not discharge an all-size statement.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "native_all_columns", + "owned_erasure", + "compiler", + "precision_tape", + "analytic_recovery" + ], + "existing_checks": [ + { + "scope": "PR #4100: proposed unconditional construction and finite checks, without independent acceptance.", + "evidence": "research/unconditional-batched-crt/README.md", + "remaining": "Independent proof audit of one caller-bound all-size implication; all other premises remain explicit.", + "status": "author-checked", + "source_commit": "337d04939571a637aeab54a0f58f54fde811663a", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Sharp forward, inverse and arithmetic-noise norm envelopes for products whose interaction errors share an acyclic support graph of bounded path length.", + "scope_change_reason": "The actual selected caller has no established common acyclic interaction-support contract. This is a new structured precision-interface theorem, rather than an audit or discharge of the selected precision_tape assumption.", + "bottleneck_link": "A common acyclic interaction graph would replace conservative small-error or scalar-product precision budgets by exact finite polynomial envelopes. Binding that structure to a real caller and charging its arithmetic remain open.", + "budget_minutes": 60, + "stop_rule": "Stop at the first proved sharp norm envelope and its exact attaining family; do not expand to caller construction or larger searches.", + "outcome": "completed", + "evidence": "PROOF.md proves the all-finite-dimensional theorem. verify.py checks 326 polynomial coefficients, 729 exhaustive matrix pairs, 15 permuted words, 1553 prefixes and noisy steps, 51 attaining families, 20 input rejections and seven mathematical controls.", + "author": "Nick Petalas", + "ai_assistance": "Independent human and formal proof-kernel review are unclaimed.", + "open_questions": [ + { + "question": "Does one actual emitted local tile have a common acyclic interaction support in a usable fixed basis?", + "why_it_matters": "Only that binding can make the sharp envelopes reduce an actual caller precision budget.", + "first_step": "Pin its exact prefixes F_i and actual coefficient-storage errors Delta_i; compute the union supports of F_i^-1 Delta_i F_(i-1), including the basis-change norm factors.", + "blocked_by": "A supplied coefficient-error and arithmetic-kernel contract, with paid basis changes and physical costs." + }, + { + "question": "What is the sharp budget for one particular acyclic graph when its forbidden paths rule out the shift-matrix witness?", + "why_it_matters": "The theorem is sharp over every graph of depth at most h, while an individual graph can admit a smaller precision envelope.", + "first_step": "Enumerate its chronological supported paths and inverse within-factor path blocks for one fixed error-support schedule.", + "blocked_by": "Prescribed entry or norm budgets and an actual consumer decision; no additional graph census is supplied here." + } + ], + "claim_type": "scoped written proof with exact finite corroboration", + "source_question": { + "pr": 2701, + "author": "ywz65", + "head": "c21f5a50b9f4682ff9d4fe622d3d4e81c3cc86fb", + "refinement": "How much can additional interaction-error structure sharpen the source precision contract? This contribution supplies exact common-depth envelopes, without claiming the source circuit has that structure." + }, + "related_predecessor": { + "pr": 5288, + "author": "aliromman", + "head": "cd33c723408bb98875211ee3145582c507881f29", + "usage": "Cited sufficient square-zero-shear product bound; no executable imported or predecessor scientific replay performed." + }, + "coordination": { + "claim": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19591516", + "priority_revision": 8, + "selected_record_context": "#7000, conditional kappa 363005817/100000000000", + "live_open_snapshot": "2026-11-13T13:42:47.643064+00:00", + "live_open_records": 800, + "discussion_snapshot": "2026-11-13T13:44:16.595306+00:00", + "discussion_records": 7400, + "coverage_limits": "Open PR and Discussion pagination completed; sparse local notes were incomplete. Main README and targeted merged searches were also checked. The separate complete closed-PR refresh timed out; arbitrary historical diffs and unpublished work were not searched." + }, + "environment": { + "python": "CPython 3.12.15", + "platform": "Darwin arm64", + "interpreter": "/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12", + "dependencies": "Python standard library only" + } +} diff --git a/research/acyclic-interaction-budgets/VERIFY.json b/research/acyclic-interaction-budgets/VERIFY.json new file mode 100644 index 0000000000..17396ff141 --- /dev/null +++ b/research/acyclic-interaction-budgets/VERIFY.json @@ -0,0 +1,34 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Exact polynomial oracles, exhaustive rational matrix pairs, independent inverses, attaining families, support certification, arithmetic noise and failure controls." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "The same complete finite corroboration and generated source-hash receipt with Python assertions disabled." + } + ] +} diff --git a/research/acyclic-interaction-budgets/budgets.py b/research/acyclic-interaction-budgets/budgets.py new file mode 100644 index 0000000000..4be93208cd --- /dev/null +++ b/research/acyclic-interaction-budgets/budgets.py @@ -0,0 +1,93 @@ +"""Exact polynomial budgets for a common acyclic interaction support.""" + +from fractions import Fraction + + +MAX_DIMENSION = 16 +MAX_STEPS = 32 +MAX_HEIGHT_BITS = 256 + + +def nonnegative(value): + """Validate the bounded rational interface; floats are not certificates.""" + if type(value) not in (int, Fraction): + raise ValueError("expected an integer or Fraction") + value = Fraction(value) + if value < 0: + raise ValueError("expected a nonnegative bound") + if max(value.numerator.bit_length(), value.denominator.bit_length()) > MAX_HEIGHT_BITS: + raise ValueError("rational height exceeds capacity") + return value + + +def coefficients(norms, depth): + """Return elementary and complete homogeneous coefficients through depth.""" + if type(depth) is not int or not 0 <= depth < MAX_DIMENSION: + raise ValueError("depth exceeds capacity") + if type(norms) not in (tuple, list) or len(norms) > MAX_STEPS: + raise ValueError("step count exceeds capacity") + values = tuple(nonnegative(value) for value in norms) + elementary = [Fraction(1)] + [Fraction(0)] * depth + homogeneous = elementary.copy() + for value in values: + for degree in range(depth, 0, -1): + elementary[degree] += value * elementary[degree - 1] + for degree in range(1, depth + 1): + homogeneous[degree] += value * homogeneous[degree - 1] + return tuple(elementary), tuple(homogeneous) + + +def envelopes(norms, depth): + """Return the sharp forward and inverse norm envelopes.""" + elementary, homogeneous = coefficients(norms, depth) + return sum(elementary), sum(homogeneous) + + +def trajectory_budget(norms, depth, input_norm, noise_norms): + """Bound z_j-x, with noise added after each interaction factor.""" + forward, _ = envelopes(norms, depth) + initial = nonnegative(input_norm) + if type(noise_norms) not in (tuple, list) or len(noise_norms) != len(norms): + raise ValueError("one noise bound is required per step") + noise = tuple(nonnegative(value) for value in noise_norms) + bound = (forward - 1) * initial + for index, value in enumerate(noise): + suffix, _ = envelopes(norms[index + 1 :], depth) + bound += suffix * value + return bound + + +def support_depth(matrices, dimension): + """Certify the longest path of the union of all nonzero matrix supports.""" + if type(dimension) is not int or not 1 <= dimension <= MAX_DIMENSION: + raise ValueError("dimension exceeds capacity") + if type(matrices) not in (tuple, list) or len(matrices) > MAX_STEPS: + raise ValueError("step count exceeds capacity") + edges = [[False] * dimension for _ in range(dimension)] + for matrix in matrices: + if type(matrix) not in (tuple, list) or len(matrix) != dimension: + raise ValueError("matrix has wrong row count") + for row, entries in enumerate(matrix): + if type(entries) not in (tuple, list) or len(entries) != dimension: + raise ValueError("matrix has wrong column count") + for column, value in enumerate(entries): + if type(value) not in (int, Fraction): + raise ValueError("matrix entries must be rational") + nonnegative(abs(value)) + edges[column][row] |= value != 0 + indegree = [sum(edges[source][target] for source in range(dimension)) + for target in range(dimension)] + distance = [0] * dimension + removed = [False] * dimension + for _ in range(dimension): + ready = [vertex for vertex in range(dimension) + if not removed[vertex] and indegree[vertex] == 0] + if not ready: + raise ValueError("interaction supports contain a directed cycle") + vertex = ready[0] + removed[vertex] = True + for target in range(dimension): + if edges[vertex][target]: + indegree[target] -= 1 + distance[target] = max(distance[target], distance[vertex] + 1) + return max(distance) diff --git a/research/acyclic-interaction-budgets/verify.py b/research/acyclic-interaction-budgets/verify.py new file mode 100644 index 0000000000..4d4dacaad7 --- /dev/null +++ b/research/acyclic-interaction-budgets/verify.py @@ -0,0 +1,345 @@ +#!/usr/bin/env python3 +"""Exact finite corroboration; the universal quantifiers are in PROOF.md.""" + +import hashlib +import importlib.util +import itertools +import json +import math +from pathlib import Path +import sys +from fractions import Fraction as Q + + +PACKAGE = Path(__file__).resolve().parent +SPEC = importlib.util.spec_from_file_location("acyclic_budgets", PACKAGE / "budgets.py") +if SPEC is None or SPEC.loader is None: + raise RuntimeError("cannot load the adjacent budget implementation") +BUDGETS = importlib.util.module_from_spec(SPEC) +SPEC.loader.exec_module(BUDGETS) + + +def require(condition, message): + if not condition: + raise AssertionError(message) + + +def identity(size): + return [[Q(row == column) for column in range(size)] for row in range(size)] + + +def zero(size): + return [[Q(0) for _ in range(size)] for _ in range(size)] + + +def plus(left, right, sign=1): + return [[a + sign * b for a, b in zip(row, other)] + for row, other in zip(left, right)] + + +def scale(matrix, value): + return [[value * entry for entry in row] for row in matrix] + + +def multiply(left, right): + size = len(left) + return [[sum(left[row][inner] * right[inner][column] for inner in range(size)) + for column in range(size)] for row in range(size)] + + +def act(matrix, vector): + return [sum(a * b for a, b in zip(row, vector)) for row in matrix] + + +def norm(matrix): + return max(sum(abs(entry) for entry in row) for row in matrix) + + +def vector_norm(vector): + return max(abs(entry) for entry in vector) + + +def inverse(matrix): + """Independent exact elimination, without a nilpotent inverse formula.""" + size = len(matrix) + rows = [row.copy() + unit for row, unit in zip(matrix, identity(size))] + for column in range(size): + pivots = [row for row in range(column, size) if rows[row][column]] + require(bool(pivots), "unexpected singular matrix") + pivot = pivots[0] + rows[column], rows[pivot] = rows[pivot], rows[column] + divisor = rows[column][column] + rows[column] = [entry / divisor for entry in rows[column]] + for row in range(size): + if row != column: + factor = rows[row][column] + rows[row] = [a - factor * b for a, b in zip(rows[row], rows[column])] + result = [row[size:] for row in rows] + require(multiply(result, matrix) == identity(size), "left inverse failed") + require(multiply(matrix, result) == identity(size), "right inverse failed") + return result + + +def literal_product(errors): + size = len(errors[0]) + result = identity(size) + for error in errors: + result = multiply(plus(identity(size), error), result) + return result + + +def graph_oracle(errors): + """Adjacency powers give a separate longest-walk oracle for tiny graphs.""" + size = len(errors[0]) + adjacency = [[Q(any(error[row][column] for error in errors)) + for column in range(size)] for row in range(size)] + power = identity(size) + depth = 0 + for degree in range(1, size + 1): + power = multiply(adjacency, power) + if norm(power) == 0: + return depth + depth = degree + raise ValueError("cycle in the union support") + + +def polynomial_checks(counts): + for length in range(7): + for depth in range(6): + values = tuple(Q((2 * index + length) % 5, 3) for index in range(length)) + elementary, homogeneous = BUDGETS.coefficients(values, depth) + for degree in range(depth + 1): + expected_e = sum(math.prod(values[i] for i in subset) + for subset in itertools.combinations(range(length), degree)) + expected_h = sum(math.prod(values[i] for i in subset) + for subset in itertools.combinations_with_replacement( + range(length), degree)) + require(elementary[degree] == expected_e, "elementary polynomial mismatch") + require(homogeneous[degree] == expected_h, "homogeneous polynomial mismatch") + counts["polynomial_coefficients"] += 2 + elementary, homogeneous = BUDGETS.coefficients([Q(1, 8)] * 32, 15) + for degree in range(16): + require(elementary[degree] == math.comb(32, degree) * Q(1, 8) ** degree, + "capacity elementary coefficient") + require(homogeneous[degree] == math.comb(31 + degree, degree) * Q(1, 8) ** degree, + "capacity homogeneous coefficient") + counts["polynomial_coefficients"] += 2 + BUDGETS.coefficients([Q(1 << 255)] * 32, 15) + counts["capacity_checks"] += 2 + + +def sequence_checks(errors, depth, counts): + size = len(errors[0]) + require(BUDGETS.support_depth(errors, size) == graph_oracle(errors), + "support-depth oracle mismatch") + require(BUDGETS.support_depth(errors, size) <= depth, "invalid fixture depth") + counts["support_graphs"] += 1 + norms = [] + noise_norms = [] + result = identity(size) + initial = [Q((-1) ** index * (index + 1), 3) for index in range(size)] + trajectory = initial.copy() + for index, error in enumerate(errors): + norms.append(norm(error)) + gate = plus(identity(size), error) + result = multiply(gate, result) + actual_inverse = inverse(result) + forward, backward = BUDGETS.envelopes(norms, depth) + require(norm(result) <= forward, "forward envelope failed") + require(norm(plus(result, identity(size), -1)) <= forward - 1, + "forward defect failed") + require(norm(actual_inverse) <= backward, "inverse envelope failed") + require(norm(plus(actual_inverse, identity(size), -1)) <= backward - 1, + "inverse defect failed") + noise = [Q((-1) ** (index + row), index + 2) for row in range(size)] + noise_norms.append(vector_norm(noise)) + trajectory = [a + b for a, b in zip(act(gate, trajectory), noise)] + bound = BUDGETS.trajectory_budget(norms, depth, vector_norm(initial), noise_norms) + defect = [a - b for a, b in zip(trajectory, initial)] + require(vector_norm(defect) <= bound, "arithmetic-noise envelope failed") + counts["prefixes"] += 1 + counts["noise_steps"] += 1 + + +def exhaustive_pairs(counts): + matrices = [] + for entries in itertools.product((Q(-1, 2), Q(0), Q(1, 2)), repeat=3): + matrix = zero(3) + matrix[0][1], matrix[0][2], matrix[1][2] = entries + matrices.append(matrix) + for left in matrices: + for right in matrices: + sequence_checks([left, right], 2, counts) + counts["exhaustive_pairs"] += 1 + + +def permuted_words(counts): + for size in range(2, 7): + permutation = tuple(reversed(range(size))) + for length in (1, 3, 7): + errors = [] + for index in range(length): + matrix = zero(size) + for row in range(size): + for column in range(row + 1, size): + value = Q((index + row + 2 * column) % 5 - 2, 4) + matrix[permutation[row]][permutation[column]] = value + errors.append(matrix) + sequence_checks(errors, size - 1, counts) + counts["permuted_words"] += 1 + + +def shift(depth): + result = zero(depth + 1) + for index in range(depth): + result[index][index + 1] = Q(1) + return result + + +def witness_checks(depth, values, counts): + matrix = shift(depth) + size = depth + 1 + positive = [scale(matrix, value) for value in values] + negative = [scale(matrix, -value) for value in values] + forward, backward = BUDGETS.envelopes(values, depth) + result = literal_product(positive) if positive else identity(size) + inverse_result = inverse(literal_product(negative)) if negative else identity(size) + require(norm(result) == forward, "forward sharpness failed") + require(norm(plus(result, identity(size), -1)) == forward - 1, + "forward defect sharpness failed") + require(norm(inverse_result) == backward, "inverse sharpness failed") + require(norm(plus(inverse_result, identity(size), -1)) == backward - 1, + "inverse defect sharpness failed") + initial = [Q(2, 3)] * size + trajectory = initial.copy() + noise = [Q(index + 1, 10) for index in range(len(values))] + for error, value in zip(positive, noise): + trajectory = [entry + value for entry in act(plus(identity(size), error), trajectory)] + bound = BUDGETS.trajectory_budget(values, depth, Q(2, 3), noise) + require(vector_norm([a - b for a, b in zip(trajectory, initial)]) == bound, + "trajectory sharpness failed") + counts["attaining_families"] += 1 + + +def all_witnesses(counts): + for depth in range(6): + for length in (*range(7), 20): + values = tuple(Q(index % 4, 5) for index in range(length)) + witness_checks(depth, values, counts) + witness_checks(15, (Q(1, 8),) * 32, counts) + for depth, expected in ((1, (Q(3), Q(3))), (2, (Q(49, 10), Q(51, 10)))): + values = (Q(1, 10),) * 20 + witness_checks(depth, values, counts) + require(BUDGETS.envelopes(values, depth) == expected, "twenty-step exact values") + sequence_checks([scale(shift(depth), value) for value in values], depth, counts) + require(Q(3) < Q(11, 10) ** 20, "strict depth-one product improvement") + + +def expect_invalid(kind, arguments): + try: + if kind == "coefficients": + BUDGETS.coefficients(*arguments) + elif kind == "support": + BUDGETS.support_depth(*arguments) + elif kind == "trajectory": + BUDGETS.trajectory_budget(*arguments) + else: + raise AssertionError("unknown rejection fixture") + except ValueError: + return + raise AssertionError("invalid input accepted") + + +def rejection_checks(counts): + fixtures = [ + ("coefficients", ([1], -1)), + ("coefficients", ([1], 16)), + ("coefficients", ([1], True)), + ("coefficients", ([1] * 33, 2)), + ("coefficients", ([Q(-1)], 2)), + ("coefficients", ([0.5], 2)), + ("coefficients", ([True], 2)), + ("coefficients", ([1 << 256], 2)), + ("coefficients", ([Q(1, 1 << 256)], 2)), + ("coefficients", ((value for value in (1, 2)), 2)), + ("support", ([], 0)), + ("support", ([], 17)), + ("support", ([[[1]]], 1)), + ("support", ([[[0, 1], [1, 0]]], 2)), + ("support", ([[[0]]], 2)), + ("support", ([[[0], [0]]], 2)), + ("support", ([[[0.0]]], 1)), + ("trajectory", ([1], 1, 0, [])), + ("trajectory", ([1], 1, -1, [0])), + ("trajectory", ([1], 1, 0, [-1])), + ] + for kind, arguments in fixtures: + expect_invalid(kind, arguments) + counts["input_rejections"] += 1 + require(BUDGETS.support_depth([], 16) == 0, "empty support has depth zero") + + +def mathematical_controls(counts): + upper = [[Q(0), Q(1)], [Q(0), Q(0)]] + lower = [[Q(0), Q(0)], [Q(1), Q(0)]] + require(multiply(upper, upper) == zero(2) and multiply(lower, lower) == zero(2), + "individual nilpotence control") + require(norm(literal_product([upper, lower, upper])) == 5 + > BUDGETS.envelopes([1, 1, 1], 1)[0], + "common-support necessity control") + expect_invalid("support", ([upper, lower], 2)) + matrix = shift(2) + require(norm(literal_product([matrix, matrix])) == 4 > 3, + "omitted degree-two term control") + require(norm(inverse(plus(identity(3), scale(matrix, -1)))) == 3 + > BUDGETS.envelopes([1], 2)[0], "inverse is homogeneous, not elementary") + a, b = zero(3), zero(3) + a[0][1], b[1][2] = Q(1), Q(1) + actual = inverse(literal_product([a, b])) + right = multiply(plus(identity(3), a, -1), plus(identity(3), b, -1)) + wrong = multiply(plus(identity(3), b, -1), plus(identity(3), a, -1)) + require(actual == right and actual != wrong, "inverse chronological order control") + require(BUDGETS.trajectory_budget([0, 1], 1, 0, [1, 0]) == 2 > 1, + "noise suffix cannot be omitted") + frame = plus(identity(2), lower) + interaction = multiply(multiply(inverse(frame), upper), frame) + require(interaction[0][0] != 0 and interaction[1][1] != 0, + "physical and interaction supports differ") + expect_invalid("support", ([interaction], 2)) + require(multiply(matrix, matrix) != zero(3), "higher-nilpotency class is present") + counts["mathematical_controls"] += 7 + + +def file_hashes(): + names = ("README.md", "PROOF.md", "TASK.json", "SOURCES.json", "VERIFY.json", + "budgets.py", "verify.py") + result = {} + for name in names: + path = PACKAGE / name + require(path.is_file() and not path.is_symlink(), "missing or aliased package file") + require(path.stat().st_size <= 131072, "package file exceeds replay capacity") + result[name] = hashlib.sha256(path.read_bytes()).hexdigest() + return result + + +def main(): + counts = dict.fromkeys(("polynomial_coefficients", "capacity_checks", "support_graphs", + "prefixes", "noise_steps", "exhaustive_pairs", "permuted_words", + "attaining_families", "input_rejections", "mathematical_controls"), 0) + polynomial_checks(counts) + exhaustive_pairs(counts) + permuted_words(counts) + all_witnesses(counts) + rejection_checks(counts) + mathematical_controls(counts) + print(json.dumps({"status": "PASS_ACYCLIC_INTERACTION_BUDGETS", "errors": 0, + "claim_type": "scoped written proof with exact finite corroboration", + "python": sys.version.split()[0], "counts": counts, + "twenty_norms_one_tenth": { + "depth_one": [str(x) for x in BUDGETS.envelopes([Q(1, 10)] * 20, 1)], + "depth_two": [str(x) for x in BUDGETS.envelopes([Q(1, 10)] * 20, 2)]}, + "package_sha256": file_hashes()}, sort_keys=True)) + + +if __name__ == "__main__": + main() From e637e0e158814f2b588fbfc91e5ebaac3650c520 Mon Sep 17 00:00:00 2001 From: Nick Petalas Date: Fri, 13 Nov 2026 13:53:00 +0000 Subject: [PATCH 2/2] docs(research): correct acyclic budget prose formatting --- research/acyclic-interaction-budgets/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/research/acyclic-interaction-budgets/README.md b/research/acyclic-interaction-budgets/README.md index 8717e7dec3..d002dae09e 100644 --- a/research/acyclic-interaction-budgets/README.md +++ b/research/acyclic-interaction-budgets/README.md @@ -79,7 +79,8 @@ prefix/noise contract come from ywz65's [PR2701](https://github.com/CrocSwap/integer-mult-bounds/pull/2701), head `c21f5a50b9f4682ff9d4fe622d3d4e81c3cc86fb`. Ali Romman's PR5288, head `cd33c723408bb98875211ee3145582c507881f29`, supplies the distinct -square-zero shear product comparison. Classical nilpotent inverse formulas,+symmetric polynomials and directed-path expansions retain their mathematical +square-zero shear product comparison. Classical nilpotent inverse formulas, +symmetric polynomials and directed-path expansions retain their mathematical credit. No general literature-priority claim is made for those methods. The new step is the pair of sharp common-depth budgets, their attaining @@ -147,8 +148,8 @@ optimized Python. No subprocess, network access or persistent write occurs. Power of Ten rule 3 deviation: CPython dynamically allocates rational numbers and containers. The dimensions, step counts, bit heights and serial fixture domains bound live data. The pair inventory has 27 matrices and tests one pair -at a time. An attaining fixture holds two lists of at most 32 matrices. Internal runtime -allocation is not instrumented. Receipt reads are limited to seven regular +at a time. An attaining fixture holds two lists of at most 32 matrices. +Internal runtime allocation is not instrumented. Receipt reads are limited to seven regular files, each at most 128 KiB. A fixed-allocation implementation would be needed before using this checker as an embedded runtime service.