diff --git a/research/clean-helper-bank-exchange/CERTIFICATE.json b/research/clean-helper-bank-exchange/CERTIFICATE.json new file mode 100644 index 0000000000..d4b870d954 --- /dev/null +++ b/research/clean-helper-bank-exchange/CERTIFICATE.json @@ -0,0 +1,702 @@ +{ + "schema_version": 1, + "data_wires": 4, + "clean_helpers": 1, + "gate_count": 20, + "excluded_maximum_length": 5, + "prefix": { + "layers": [ + 1, + 16, + 166 + ], + "states": 183, + "sha256": "e34d3bef919db4c212b5595d917726079271c7826a2e5446f8d5dbf6b415ba40" + }, + "endpoints": [ + { + "rows": [ + 4, + 8, + 1, + 2, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "af838520579dafb4f038bdfc61540458f04947619c3d703bfeea91b2660629a8" + }, + { + "rows": [ + 4, + 8, + 1, + 3, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "c99bd46229905b615455a0904375a917e4f6ae491fe27b79152ca882f66d5d52" + }, + { + "rows": [ + 4, + 8, + 2, + 1, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "fece01793618f5e034c59a6c0985c3a3b15edbf7d9bbbedc528ed333065cb630" + }, + { + "rows": [ + 4, + 8, + 2, + 3, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "b1219a6bb2bb158efc638bd572aaa15b86fd7e209756d3e069d1d5e68e735f7e" + }, + { + "rows": [ + 4, + 8, + 3, + 1, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "3df2eb441639050158506d10cb189e53529863f85e620330bc60679982a3bcc0" + }, + { + "rows": [ + 4, + 8, + 3, + 2, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "b55284c44f012ba45307dcd048afaea0b127ac487403de029fee5d3b0d7f3aa3" + }, + { + "rows": [ + 4, + 12, + 1, + 2, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "f03168c94e9fd7466633e8d12c2295addbb6417e5923c9e6b6dba5e6d743f79c" + }, + { + "rows": [ + 4, + 12, + 1, + 3, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "bb1a39f2e8da5be8aa514af7ee4bb560fb7a5f45cb4c1f26f8095adf840efe1d" + }, + { + "rows": [ + 4, + 12, + 2, + 1, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "b5e4cc1f67c9a11bdd27dec42999fffd406f8aadf113ac0e49a78ae5b3b2d65c" + }, + { + "rows": [ + 4, + 12, + 2, + 3, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "7df9283ef416a0551f21974492aad9ccbc4e60698a606501d0b93a9234504758" + }, + { + "rows": [ + 4, + 12, + 3, + 1, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "3a4dcb628b7e304f399bcf3c8a878e98679ba92008dcd3fe03abb9f0adc8841a" + }, + { + "rows": [ + 4, + 12, + 3, + 2, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "3aad4c83df6b032b96a3fb96435262a52f1ec1d5c3f75ffa201136e7b0a458ef" + }, + { + "rows": [ + 8, + 4, + 1, + 2, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "e1d56155a2cc00f4be738a5869619ae678bab226a65bbc530dcba165997fcca3" + }, + { + "rows": [ + 8, + 4, + 1, + 3, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "eaee38295a72c2de6b09d4628cbfb2f045c8761247209baa09e860dceb564a87" + }, + { + "rows": [ + 8, + 4, + 2, + 1, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "6969a858b3924983bc7a507f8488f079c19f9f947e606368db7e1068ede1809c" + }, + { + "rows": [ + 8, + 4, + 2, + 3, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "528a5044832aea3f081db35f6d7481617b18d60136c43ff1e0a96f8f0644cc2c" + }, + { + "rows": [ + 8, + 4, + 3, + 1, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "9d29bdcaa05552b91da57f358d08dd67f70baa0b0d804ae14b21cd628941372d" + }, + { + "rows": [ + 8, + 4, + 3, + 2, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "fb00e40974c8cd8d0cc4da7a9d3cd872836ded0084eb6c02ceef448d5036246a" + }, + { + "rows": [ + 8, + 12, + 1, + 2, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "ab0fe40de0cf1acdee88c115b9113ec47c8df1c1e8b4ef5caf0dc8e5a59f0738" + }, + { + "rows": [ + 8, + 12, + 1, + 3, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "03f96987f4daa1fa50b0945bf9042afcefd4bb55f6af669e7be7892075ca0d58" + }, + { + "rows": [ + 8, + 12, + 2, + 1, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "3651bdc7055508c32398ac08cd9aaf92a4e80450aaeda3a8fe7d38633b17c66b" + }, + { + "rows": [ + 8, + 12, + 2, + 3, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "13a7182331cd5dddc84ddabc6e5f1dd84ce485fb553ca3bc60fb6fe406ad347a" + }, + { + "rows": [ + 8, + 12, + 3, + 1, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "6fd0aea06102fd241b18293a019db5d40edee767974362b673e9f79d198f9b78" + }, + { + "rows": [ + 8, + 12, + 3, + 2, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "3807d457b6a75b7cc2b3ec1962cac1441779001e9f3c714107a30a1cfd036735" + }, + { + "rows": [ + 12, + 4, + 1, + 2, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "547dd682fde5b7cf9d69551332675bcefc8f610afd016ae26860b16a3a4bb8b8" + }, + { + "rows": [ + 12, + 4, + 1, + 3, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "efb56c643bd1d36d45a573a35ceaba6fdf07135cb22d20e50c6cc32de5c368bb" + }, + { + "rows": [ + 12, + 4, + 2, + 1, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "769ed278463cd5354af73136bfa55bda16df40849811cb9aa22b5521d8364f8d" + }, + { + "rows": [ + 12, + 4, + 2, + 3, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "6e1e57af27221d8175298303818a3d673a00f41e1567be671f80885c91ee6888" + }, + { + "rows": [ + 12, + 4, + 3, + 1, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "db0936db61f8f5ce12b7fc45a19a9d1f1bce6841891216146511290b43df0bb0" + }, + { + "rows": [ + 12, + 4, + 3, + 2, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "078f81c1b0e47f4319ba50b27996ef2ecf10b449819f60856e01cb984e6ae431" + }, + { + "rows": [ + 12, + 8, + 1, + 2, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "73f2c9e6d54494fe308314e2f67e4b369c97d707c11e6e0dc172144b10692857" + }, + { + "rows": [ + 12, + 8, + 1, + 3, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "7413da8477a7761a22c39cb270c36cbced94cea5128b5732969a2d6f78de62e2" + }, + { + "rows": [ + 12, + 8, + 2, + 1, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "2d80aa71caef0e1333338c3fe5b3129dae1f3d980fbc963f3c4ee9ac6b32c22a" + }, + { + "rows": [ + 12, + 8, + 2, + 3, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "787f515919a005b855b63171840d43bc10028722cba3f8b2e9aa3993d0e0a9ac" + }, + { + "rows": [ + 12, + 8, + 3, + 1, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "12c8fb4cadd0116ff22e35815ac246a90df6ac75d05930ffbb2613d3b6d9958e" + }, + { + "rows": [ + 12, + 8, + 3, + 2, + 0 + ], + "layers": [ + 1, + 16, + 166, + 1302 + ], + "states": 1485, + "sha256": "664a2fbd0b3d14d513977229e2a914ae736f025b613ea7b1d710190994b3f3a8" + } + ], + "six_add_attainments": [ + { + "gates": [ + [ + 0, + 2 + ], + [ + 2, + 0 + ], + [ + 0, + 2 + ], + [ + 1, + 3 + ], + [ + 3, + 1 + ], + [ + 1, + 3 + ] + ], + "rows": [ + 4, + 8, + 1, + 2, + 0 + ] + }, + { + "gates": [ + [ + 0, + 3 + ], + [ + 3, + 0 + ], + [ + 0, + 3 + ], + [ + 1, + 2 + ], + [ + 2, + 1 + ], + [ + 1, + 2 + ] + ], + "rows": [ + 8, + 4, + 2, + 1, + 0 + ] + } + ] +} diff --git a/research/clean-helper-bank-exchange/PROOF.md b/research/clean-helper-bank-exchange/PROOF.md new file mode 100644 index 0000000000..fa4b80f1a1 --- /dev/null +++ b/research/clean-helper-bank-exchange/PROOF.md @@ -0,0 +1,148 @@ +# One clean helper does not lower the bank-exchange floor + +This result was produced by Nick Petalas. It is an exact finite certificate +with a written reduction to a scalar circuit problem. Independent human and +formal proof-kernel review are unclaimed. + +## Statement and changed premise + +Let `a0,a1,b0,b1` be independent inputs over F2 and let `z=0` initially. +A paid ADD replaces one of these five wires by its XOR with a distinct wire. +Every one of the twenty ordered directions is allowed. A word is finite, +straight-line and independent of the input values. No other operation is +allowed, including reset, overwrite, free permutation or intermediate basis +change. The final helper must be zero for every data input. + +For any `A,B in GL(2,F2)`, the requested data endpoint is + +```text +(a', b') = (A b, B a), z' = 0. +``` + +Every such word needs at least six ADDs. Two endpoint choices attain six, +so the minimum over the allowed endpoint bases is exactly six. +This does not determine every endpoint's exact length above that floor. + +Charan .'s [PR #5851](https://github.com/CrocSwap/integer-mult-bounds/pull/5851) +proves the corresponding no-scratch floor. Its exact source head is +`c698080add27ea02f62da393f27f05c537558ff8`. That package explicitly excludes +added scratch. The new claim grants one zero helper and all incident ADDs. +The predecessor result and its complete distance census are cited, not +replayed or used to prove this stronger finite statement. + +## Exact state reduction + +Represent each live wire by its four coefficients on the independent data +inputs. The initial five rows are `(1,2,4,8,0)`, with bit `i` denoting input +`i`. The matrix is five by four, rather than a five-by-five identity: its last +input is fixed to zero, and must not be treated as independent dirt. +An ADD XORs the source row into the destination row. This description is +exact by induction on the word, including every use of the helper. + +The two nonzero rows of an invertible binary two-by-two matrix are any +ordered pair of distinct elements of `{1,2,3}`. There are six choices per +bank, hence exactly 36 target coefficient states + +```text +(4u, 4v, w, x, 0), +u,v,w,x in {1,2,3}, u != v, w != x. +``` + +Here `4u` means an ordinary integer left shift by two in the row encoding. +Independent invertible entrance and exit bases within the two banks give +exactly this endpoint class. All instructions realizing the endpoint remain +paid. A choice of endpoint does not grant free basis changes during the word. + +## Complete exclusion of length at most five + +Let `Ball_r(q)` be the set of coefficient states obtained from `q` by at +most `r` ADDs. Every ADD is its own inverse. Therefore a word of length at +most five from the initial state `s` to a target `t` exists if and only if + +```text +Ball_2(s) intersects Ball_3(t). +``` + +For the forward implication, split after at most two instructions. The +remaining suffix has length at most three, and its reverse reaches the split +state from `t`. The reverse implication concatenates the prefix and reversed +suffix. Shorter words are included throughout. + +The generated certificate and independent checker establish the following +finite facts. Forward distance layers are `1,16,166`, totaling 183 states. +For each of the 36 targets, backward distance layers are `1,16,166,1302`, +totaling 1,485 states. Every one of the 36 intersections is empty. The +53,460 backward states counted over targets need not be distinct across +targets; no union cardinality is claimed. + +`generate.py` builds the coefficient-state balls by breadth-first layers. +It emits their sorted-state SHA256 digests, counts and two attaining words. +`verify.py` imports no generator code. It evaluates wires on every one of +the sixteen data assignments, stores five literal sixteen-bit truth tables, +and enumerates all padded words of lengths two and three directly. The +padding symbol does nothing and only includes shorter paid words. It is +not a free data operation. There are `21^2=441` padded prefix words and +`36*21^3=333396` padded backward words for the main exclusion. +The checker reconstructs every digested state set and checks disjointness. +Hashes bind the certificate; exact enumeration supplies the exclusion. + +This is a complete exclusion in the finite stated circuit model, rather +than a heuristic search failure. It remains a computational certificate, +not a proof-assistant theorem. + +## Attainment and vector inputs + +For each pair of distinct wires `(i,j)`, the three ADDs + +```text +i += j; j += i; i += j +``` + +swap their arbitrary initial values. Swapping `(0,2)` and `(1,3)` attains +`A=B=I`. Swapping `(0,3)` and `(1,2)` attains the crossed orientation in +both banks. Both words have six instructions and leave the helper untouched. +The verifier checks both complete truth tables and helper restoration. +The swap identity is standard and is not claimed as new. + +The same identities apply coordinatewise to arbitrary equal-length vectors +over F2, with one full vector ADD as the unit operation. A universal shorter +word would in particular work on one-bit inputs, contradicting the finite +exclusion. The same floor also holds for an arbitrarily dirty restored +helper: specialize its initial contents to zero. The attaining words already +leave every possible helper value untouched. + +## Source relevance and limitations + +Ali Romman's [PR #5840](https://github.com/CrocSwap/integer-mult-bounds/pull/5840), +head `6a043d0fc0199ee5b24c61f883f1943eaf6424be`, supplies the G20 bank-boundary +construction and general-basis question. Under #5851's retained decomposition +into fixed chain instructions and isolated four-wire exchange components, +granting one private clean helper to a component cannot reduce its six-ADD +floor. That conditional application uses the cited source decomposition; +the actual controller is not imported or independently replayed here. + +Two or more helpers, cross-component gates, sharing with the chain, changed +tariffs, nonlinear operations, data-dependent control, and a nonrestored helper +are outside this certificate. There is no global boundary minimum, native +implementation, physical supplier admission or new kappa. Initialization, +ownership, movement and all other physical helper costs are unpriced here; +granting the clean helper at no extra charge favors a proposed improvement. +Any complete implementation must pay those costs as well as every ADD. +The five selected framework assumptions and selected frontier are unchanged. + +## Verifier bounds + +All enumeration loops have fixed finite bounds. The largest direct word set +has at most 9,261 entries and each state uses at most eighty bits. Only one +target's balls are live during the main exclusion. Certificate input is capped +at 64 KiB, the endpoint inventory at 36 and each attainment at six ADDs. +Functions stay below sixty lines. Explicit exceptions preserve checks under +optimization. There is no recursion, subprocess, network, runtime code +generation or mutable external state in the direct verifier. + +Python integers, sets and JSON require managed allocation. The fixed domains +bound it; no allocation-free execution is claimed. Seven explicit mutations +exercise certificate rejection, without callbacks or input-selected code. +Warning-strict normal and optimized +replays provide the available interpreted-language diagnostics. No global +lint configuration or unrelated source is changed. diff --git a/research/clean-helper-bank-exchange/README.md b/research/clean-helper-bank-exchange/README.md new file mode 100644 index 0000000000..e62a252d21 --- /dev/null +++ b/research/clean-helper-bank-exchange/README.md @@ -0,0 +1,96 @@ +# Sharp bank-exchange floor with one clean helper + +This finite certificate was produced by Nick Petalas. Exchanging two arbitrary +two-wire binary banks needs at least **six paid ADDs**, even with one initially +zero helper restored to zero and arbitrary invertible endpoint bases within +the banks. All 36 endpoint choices are excluded at length at most five. +Two ordinary matching exchanges attain six. Exact lengths above the floor +for the other endpoint choices are unclaimed. + +This extends the no-scratch model of Charan .'s +[PR #5851](https://github.com/CrocSwap/integer-mult-bounds/pull/5851). +Ali Romman's [PR #5840](https://github.com/CrocSwap/integer-mult-bounds/pull/5840) +supplies the G20 bank-boundary construction and general-basis question. +Neither predecessor's verifier is imported or replayed. The new contribution +is the added-helper exclusion, not their no-scratch census or standard swap +construction. Exact heads and roles are recorded in [SOURCES.json](SOURCES.json). + +Every ADD among the five wires costs one. No reset, free basis change, +overwrite or other data operation is granted. The proof also gives the same +floor for arbitrary vector width and for a restored dirty helper by restriction +to zero initial dirt. See [PROOF.md](PROOF.md) for the exact model and reduction. + +## Evidence + +The forward radius-two ball has 183 injection states. Each of the 36 backward +radius-three balls has 1,485 states. All 36 intersections are empty. A generator +using coefficient rows emits [CERTIFICATE.json](CERTIFICATE.json); a separate +checker enumerates literal truth tables on all sixteen data assignments. +It checks 441 padded prefix words and 333,396 padded suffix words for the main +exclusion, both six-ADD attainments, seven rejection controls, twenty one-ADD +positive controls and a helper-touching five-ADD positive meet. + +This is a complete finite exclusion with a scoped mathematical reduction. +Independent human and formal proof-kernel review are unclaimed. +The direct verifier prints a generated receipt binding every package file's +SHA256 to the actual counts and interpreter version. Receipts and replay logs +are outputs, not handwritten package evidence. + +## Reproduce + +From the repository root, use CPython 3.12 and its standard library: + +```sh +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -W error -B research/clean-helper-bank-exchange/verify.py +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -O -W error -B research/clean-helper-bank-exchange/verify.py +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/research_package.py --package research/clean-helper-bank-exchange +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/check_research_commit.py --package research/clean-helper-bank-exchange --check-source-history +``` + +Both direct commands must end with `PASS_CLEAN_HELPER_BANK_EXCHANGE`. +Use another CPython 3.12 path when reproducing on another machine. Direct +verification needs only this package and works without Git or network. +The source-history preflight needs the committed package and full Git ancestry. + +To regenerate the certificate, redirect `generate.py` stdout to an external +scratch file, then compare that file byte for byte with `CERTIFICATE.json`. +The generator never writes the package. Both registered verification commands +have a 120-second timeout. Their measured local runtimes belong in the PR body. + +## Scope and research record + +Base is canonical main `de5ec2e7a6074068452f45b1a191b5c72832df4a`, priority +revision 8. [TASK.json](TASK.json) records the changed connector card premise, +stop rule, source attribution and +[advance claim](https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19216124). +The first working example was the five-by-four identity injection with one +zero row. The original card's old connector census was read for its interface; +replaying another result was excluded by the research assignment. + +This is a local obstruction to an added-workspace route. Two or more helpers, +cross-component gates, shared chain operations and the complete physical bill +remain outside its scope. No global CNOT minimum, new supplier, kappa or +complete multiplication theorem is claimed. The selected frontier is unchanged. +No full native/caller replay, Lean, Docker or historical suite was run. + +## Open next questions + +Can two clean helpers reduce the floor? A first step is the same length-five +meet with two zero rows, with every ADD counted. That is a new finite domain +and is not decided here. It matters only if ownership, initialization and +movement can also fit the complete caller bill. + +Can cross-component synthesis or sharing with the fixed chain shorten the +whole boundary? A strictly shorter exact source-bound boundary and inverse +would be the first useful witness. Complete native and caller costs remain +the blocker to supplier use. + +## Credit and license + +The added-helper result, certificate and independent checker were produced by +Nick Petalas. Credit Charan . for #5851, Ali Romman for #5840, and the retained +#5834, #5807/#5828, #5708/#5671, ai-nanachi #5512, Dugongue, ToikY and native, +controller, compiler and BIT source lineage credited there. No predecessor +source is copied or modified. Breadth-first enumeration, meet in the middle, +elementary transvections and the three-ADD swap are standard techniques. +New work is Apache-2.0 under the repository license. diff --git a/research/clean-helper-bank-exchange/SOURCES.json b/research/clean-helper-bank-exchange/SOURCES.json new file mode 100644 index 0000000000..f3d3cca14d --- /dev/null +++ b/research/clean-helper-bank-exchange/SOURCES.json @@ -0,0 +1,35 @@ +{ + "schema_version": 1, + "base_commit": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "581f8d87008354eb5b869f7ed9de1317ad837ce8", + "sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + } + ], + "mathematical_references": [ + { + "pr": 5851, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/5851", + "head": "c698080add27ea02f62da393f27f05c537558ff8", + "path": "research/g20-isolated-exchange-floor/PROOF.md", + "author": "Charan .", + "use": "Question source and no-scratch predecessor. Cited, not an executable or a mathematical dependency of the finite five-wire enumeration." + }, + { + "pr": 5840, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/5840", + "head": "6a043d0fc0199ee5b24c61f883f1943eaf6424be", + "author": "Ali Romman", + "use": "G20 bank-boundary construction and general-basis question, used only as motivation." + } + ] +} diff --git a/research/clean-helper-bank-exchange/TASK.json b/research/clean-helper-bank-exchange/TASK.json new file mode 100644 index 0000000000..1319d830ea --- /dev/null +++ b/research/clean-helper-bank-exchange/TASK.json @@ -0,0 +1,75 @@ +{ + "schema_version": 1, + "task_id": "connector-alphabet-change", + "priority_revision": 8, + "base_commit": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "original_card": { + "id": "connector-alphabet-change", + "question": "Does one explicit extension of the connector alphabet offer a favorable completed budget?", + "starting_points": [ + "docs/research/research-family-status.md", + "research/universal-connector-boundary/README.md", + "certificates/selected-result.json" + ], + "methods": [ + "Construct and charge a legal extra operation on a minimal instance.", + "Prove a target-specific bound after adding one specified operation family." + ], + "acceptance_gate": "State which fixed-alphabet premise changes and charge its implementation; do not declare it free. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "research/universal-connector-boundary/verify.py" + ], + "expected": "PASS_UNIVERSAL_CONNECTOR_BOUNDARY", + "inspect": "Reproduce the 945-pairing control, then read Exact interface to list the allowed calls.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Add exactly one legally priced operation and test a tiny dirty-input instance before enumerating larger cases.", + "bottleneck_link": "A new legal connector operation could change recursive interface cost; a larger census in the same alphabet is a separate side result.", + "allowed_variations": [ + "Choose one additional operation and a small source count for its first counterexample." + ], + "scope_change_triggers": [ + "Keeping the alphabet and only increasing the source count; record this as a changed assignment.", + "Extending a source-count census without naming a supplier/interface decision it could change; audit #2973 pruning concerns before relying on the affected predecessor exclusions." + ], + "overlap_terms": [ + "universal connector", + "source-toggle", + "connector alphabet" + ] + }, + "scope_status": "changed", + "actual_scope": "Exclude at most five directed binary ADDs for all 36 two-bank exchange endpoints with one initially zero helper restored to zero; attain six on the straight and crossed matching exchanges.", + "scope_change_reason": "The card asks for a new connector operation. This side result instead changes the workspace premise of PR5851 by adding one clean helper and all eight incident ADD directions. Its first working example is the five-wire identity injection, rather than a replay of the predecessor connector census.", + "bottleneck_link": "Rules out a proposed local route to cheaper G20 bank boundaries. Under isolated exchange components and fixed chain instructions, one private clean helper per component cannot beat the cited six-ADD component floor. No global supplier claim.", + "budget_minutes": 60, + "stop_rule": "Stop at the first certified extension or shorter exact witness. Do not enlarge helper count or synthesize the complete boundary.", + "outcome": "negative-result", + "evidence": "CERTIFICATE.json plus independent literal truth-table short-word enumeration in verify.py; written reduction in PROOF.md.", + "author": "Nick Petalas", + "ai_assistance": "Independent human and formal proof-kernel review are unclaimed.", + "open_questions": [ + { + "question": "Can two or more clean helpers lower the six-ADD minimum for a general two-bank endpoint?", + "why_it_matters": "Determines whether the remaining scratch route is worth considering before a complete caller rewrite.", + "first_step": "Add a second zero row to the injection model and test the same length-five meet.", + "blocked_by": "Not covered by the present five-wire enumeration; every ADD and helper ownership must still be paid." + }, + { + "question": "Can cross-component synthesis or sharing with the fixed chain beat the complete boundary?", + "why_it_matters": "These interactions escape the component floor even with one helper.", + "first_step": "Construct one strictly shorter source-bound full boundary and its inverse, retaining target pairs.", + "blocked_by": "Requires actual source endpoint and full native/caller invoice; no claim follows from the local result." + } + ], + "predecessor": { + "pr": 5851, + "head": "c698080add27ea02f62da393f27f05c537558ff8", + "author": "Charan .", + "relationship": "The new result changes its explicitly excluded added-scratch premise; no predecessor executable is imported or replayed." + }, + "claim_url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19216124" +} diff --git a/research/clean-helper-bank-exchange/VERIFY.json b/research/clean-helper-bank-exchange/VERIFY.json new file mode 100644 index 0000000000..934ed84732 --- /dev/null +++ b/research/clean-helper-bank-exchange/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": "All 36 clean-helper exchange endpoints, full radius-two/radius-three meet, literal attainments and semantic controls." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Same exact exclusion and controls with assertions disabled." + } + ] +} diff --git a/research/clean-helper-bank-exchange/generate.py b/research/clean-helper-bank-exchange/generate.py new file mode 100644 index 0000000000..20aac7c8c1 --- /dev/null +++ b/research/clean-helper-bank-exchange/generate.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python3 +"""Emit the finite clean-helper exchange certificate to stdout.""" + +import hashlib +import itertools +import json + + +GATES = tuple((d, s) for d in range(5) for s in range(5) if d != s) + + +def add(rows, gate): + destination, source = gate + result = list(rows) + result[destination] ^= result[source] + return tuple(result) + + +def ball(start, radius): + seen = {start} + frontier = {start} + layers = [1] + for _ in range(radius): + following = {add(rows, gate) for rows in frontier for gate in GATES} - seen + seen.update(following) + frontier = following + layers.append(len(frontier)) + return seen, layers + + +def truth_state(rows): + result = 0 + for wire, row in enumerate(rows): + for data in range(16): + result |= ((row & data).bit_count() % 2) << (16 * wire + data) + return result + + +def digest(states): + values = sorted(truth_state(rows) for rows in states) + payload = json.dumps(values, separators=(",", ":")).encode() + return hashlib.sha256(payload).hexdigest() + + +def certificate(): + initial = (1, 2, 4, 8, 0) + left, layers = ball(initial, 2) + bases = tuple((a, b) for a in range(1, 4) for b in range(1, 4) if a != b) + endpoints = [] + for upper, lower in itertools.product(bases, repeat=2): + target = (upper[0] << 2, upper[1] << 2, *lower, 0) + right, right_layers = ball(target, 3) + if left.intersection(right): + raise ValueError("a word of length at most five exists") + endpoints.append({"rows": target, "layers": right_layers, + "states": len(right), "sha256": digest(right)}) + words = [] + for pairs in (((0, 2), (1, 3)), ((0, 3), (1, 2))): + word = tuple(gate for a, b in pairs for gate in ((a, b), (b, a), (a, b))) + rows = initial + for gate in word: + rows = add(rows, gate) + words.append({"gates": word, "rows": rows}) + return {"schema_version": 1, "data_wires": 4, "clean_helpers": 1, + "gate_count": 20, "excluded_maximum_length": 5, + "prefix": {"layers": layers, "states": len(left), "sha256": digest(left)}, + "endpoints": endpoints, "six_add_attainments": words} + + +if __name__ == "__main__": + print(json.dumps(certificate(), indent=2) + "\n", end="") diff --git a/research/clean-helper-bank-exchange/verify.py b/research/clean-helper-bank-exchange/verify.py new file mode 100644 index 0000000000..9513b9f0b2 --- /dev/null +++ b/research/clean-helper-bank-exchange/verify.py @@ -0,0 +1,157 @@ +#!/usr/bin/env python3 +"""Check all short words by literal truth tables, independently of generation.""" + +import hashlib +import itertools +import json +from pathlib import Path +import platform + + +PACKAGE = Path(__file__).resolve().parent +MASK = (1 << 16) - 1 +GATES = tuple((destination, source) for source in range(5) + for destination in range(5) if source != destination) + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def pack(rows): + """Evaluate each row on all sixteen assignments, without parity arithmetic.""" + require(len(rows) == 5 and all(type(row) is int and 0 <= row < 16 for row in rows), + "invalid five-wire coefficient state") + tables = [] + for row in rows: + table = 0 + for assignment in itertools.product((0, 1), repeat=4): + data = sum(bit << i for i, bit in enumerate(assignment)) + value = 0 + for bit in range(4): + if row & (1 << bit): + value ^= assignment[bit] + table |= value << data + tables.append(table) + return sum(table << (16 * wire) for wire, table in enumerate(tables)) + + +def apply(state, gate): + if gate is None: + return state + destination, source = gate + require(0 <= destination < 5 and 0 <= source < 5 and destination != source, + "invalid directed ADD") + return state ^ (((state >> (16 * source)) & MASK) << (16 * destination)) + + +def short_words(start, depth): + """Enumerate all (20+1)^depth words; None pads shorter words only.""" + reached = set() + for word in itertools.product((None, *GATES), repeat=depth): + state = start + for gate in word: + state = apply(state, gate) + reached.add(state) + return reached + + +def digest(states): + payload = json.dumps(sorted(states), separators=(",", ":")).encode() + return hashlib.sha256(payload).hexdigest() + + +def check_record(record, states, shorter): + require(record["states"] == len(states), "wrong state count") + require(record["sha256"] == digest(states), "wrong state digest") + require(record["layers"] == shorter + [len(states) - sum(shorter)], "wrong layers") + + +def check_certificate(cert): + require(cert["schema_version"] == 1 and cert["data_wires"] == 4 + and cert["clean_helpers"] == 1 and cert["gate_count"] == 20 + and cert["excluded_maximum_length"] == 5, "wrong model") + start = pack((1, 2, 4, 8, 0)) + prefix = short_words(start, 2) + check_record(cert["prefix"], prefix, [1, len(short_words(start, 1)) - 1]) + nonzero = (1, 2, 3) + bases = tuple((a, b) for a, b in itertools.permutations(nonzero, 2)) + expected = {(a << 2, b << 2, c, d, 0) for a, b in bases for c, d in bases} + rows = [tuple(record["rows"]) for record in cert["endpoints"]] + require(len(rows) == 36 and set(rows) == expected, "wrong endpoint inventory") + suffix_total = 0 + for record in cert["endpoints"]: + target = pack(record["rows"]) + one = short_words(target, 1) + two = short_words(target, 2) + suffix = short_words(target, 3) + check_record(record, suffix, [1, len(one) - 1, len(two) - len(one)]) + require(prefix.isdisjoint(suffix), "short exchange word found") + suffix_total += len(suffix) + del one, two, suffix + witnesses = cert["six_add_attainments"] + require(len(witnesses) == 2, "missing attainments") + targets = set() + for witness in witnesses: + require(len(witness["gates"]) == 6, "wrong attainment length") + state = start + for gate in witness["gates"]: + state = apply(state, gate) + target_rows = tuple(witness["rows"]) + require(target_rows in expected and state == pack(target_rows), "false attainment") + targets.add(target_rows) + require(len(targets) == 2, "duplicate attainments") + return {"endpoints": len(rows), "prefix_states": len(prefix), + "suffix_states_summed_over_endpoints": suffix_total, + "padded_suffix_words": 36 * 21**3, "attainments": len(targets)} + + +def controls(cert): + names = ("model", "count", "digest", "inventory", "helper return", "attainment", "gate") + mutations = [json.loads(json.dumps(cert)) for _ in names] + mutations[0]["clean_helpers"] = 0 + mutations[1]["prefix"]["states"] = 1 + mutations[2]["prefix"]["sha256"] = "0" * 64 + mutations[3]["endpoints"].pop() + mutations[4]["endpoints"][0]["rows"][4] = 1 + mutations[5]["six_add_attainments"][0]["gates"].pop() + mutations[6]["six_add_attainments"][0]["gates"][0] = [0, 0] + rejected = [] + for name, copy in zip(names, mutations): + try: + check_certificate(copy) + except ValueError: + rejected.append(name) + require(len(rejected) == len(names), "mutation accepted") + start = pack((1, 2, 4, 8, 0)) + require(start in short_words(start, 3), "padding lost a short word") + for gate in GATES: + state = apply(start, gate) + require(state in short_words(start, 2), "positive one-gate meet missing") + require(apply(state, gate) == start, "ADD is not involutive") + target = start + for gate in ((4, 0), (1, 4), (4, 0), (2, 1), (3, 2)): + target = apply(target, gate) + require((target >> 64) == 0, "positive helper word failed restoration") + require(not short_words(start, 2).isdisjoint(short_words(target, 3)), + "positive five-ADD meet missing") + return rejected + + +def main(): + source = PACKAGE / "CERTIFICATE.json" + require(source.stat().st_size < 64 * 1024, "certificate size limit") + cert = json.loads(source.read_text()) + counts = check_certificate(cert) + rejected = controls(cert) + names = ("CERTIFICATE.json", "PROOF.md", "README.md", "SOURCES.json", "TASK.json", + "VERIFY.json", "generate.py", "verify.py") + hashes = {name: hashlib.sha256((PACKAGE / name).read_bytes()).hexdigest() for name in names} + print(json.dumps({"counts": counts, "rejected_controls": rejected, + "python": platform.python_version(), "source_sha256": hashes}, sort_keys=True)) + print("PASS_CLEAN_HELPER_BANK_EXCHANGE") + + +if __name__ == "__main__": + main()