diff --git a/research/bit-single-relation-bank-obstruction/.gitattributes b/research/bit-single-relation-bank-obstruction/.gitattributes new file mode 100644 index 0000000000..c88f1a697c --- /dev/null +++ b/research/bit-single-relation-bank-obstruction/.gitattributes @@ -0,0 +1 @@ +credits/** -text whitespace=cr-at-eol diff --git a/research/bit-single-relation-bank-obstruction/CERTIFICATE.json.gz b/research/bit-single-relation-bank-obstruction/CERTIFICATE.json.gz new file mode 100644 index 0000000000..2613e2d3e8 Binary files /dev/null and b/research/bit-single-relation-bank-obstruction/CERTIFICATE.json.gz differ diff --git a/research/bit-single-relation-bank-obstruction/CREDITS.md b/research/bit-single-relation-bank-obstruction/CREDITS.md new file mode 100644 index 0000000000..51351b9038 --- /dev/null +++ b/research/bit-single-relation-bank-obstruction/CREDITS.md @@ -0,0 +1,51 @@ +# Sources and credit + +Ali Romman prepared this result with substantial OpenAI Codex assistance in +research, implementation, verification and writing. New code and prose use +Apache-2.0. The two checker implementations have one author and are not +independent human review. No priority claim is made for helper deletion. + +The exact word and caller are declared inputs from +[PR #7001](https://github.com/CrocSwap/integer-mult-bounds/pull/7001), +head `d777f3a0aa2878bea0478918923dabcf86b9878b`: +[native](https://github.com/CrocSwap/integer-mult-bounds/blob/d777f3a0aa2878bea0478918923dabcf86b9878b/research/paired-query-only-bit/retained/inputs/BIT-NATIVE-WORD.json.gz), +[caller](https://github.com/CrocSwap/integer-mult-bounds/blob/d777f3a0aa2878bea0478918923dabcf86b9878b/research/paired-query-only-bit/EFREE-CALLER.json.gz), +[proof](https://github.com/CrocSwap/integer-mult-bounds/blob/d777f3a0aa2878bea0478918923dabcf86b9878b/research/paired-query-only-bit/PROOF.md) and +[notice](https://github.com/CrocSwap/integer-mult-bounds/blob/d777f3a0aa2878bea0478918923dabcf86b9878b/research/paired-query-only-bit/NOTICE). +The notice credits Jerry Chen / @CubeJerry for the paired source and +QUERY-only caller lineage, DreamingOfClouds for the chain-root caller, zxv +and retained authors for the source-native export, and Ali Romman and Cinna +Davis for the root/native lineage. These notices and the license are kept +unchanged. [SOURCE-PINS.json](SOURCE-PINS.json) authenticates them. + +The source admission review is +[PROOF-REVIEW.md](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/docs/research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md). +Its physical and uniform conclusions are inherited, not proved again here. + +The overlap check read these related results: + +- ToikY's [PR #7304](https://github.com/CrocSwap/integer-mult-bounds/pull/7304) + excludes its fixed original-pivot productive split domain. +- Jerry Chen / CubeJerry's + [PR #7573](https://github.com/CrocSwap/integer-mult-bounds/pull/7573) and + [proof](https://github.com/CrocSwap/integer-mult-bounds/blob/34016136b3aadfcace5116aac0da70e7bc4637ff/research/bit-alternate-carrier-split-bound/PROOF.md) + exclude clean alternate-carrier pairing at fixed cuts. That operator result + does not grant a promise on a productive helper. +- [PR #1043](https://github.com/CrocSwap/integer-mult-bounds/pull/1043) deletes + a helper on an older R439 source. The associated fixed-anchor exclusion in + [PR #1250](https://github.com/CrocSwap/integer-mult-bounds/pull/1250) uses a + different word and does not cover this current-source bank model. +- Ali Romman's [PR #5679](https://github.com/CrocSwap/integer-mult-bounds/pull/5679) + and [PR #5708](https://github.com/CrocSwap/integer-mult-bounds/pull/5708) + give helper splits and changed paths on an older G20 word. +- Ali Romman's [PR #7713](https://github.com/CrocSwap/integer-mult-bounds/pull/7713) + supplies the related rational helper-quotient method on a P104 word. + No P104 certificate is used as a binary proof. +- DreamingOfClouds's + [PR #7618](https://github.com/CrocSwap/integer-mult-bounds/pull/7618) + already treats the conservative complex BIT premise. This result does not + duplicate that lift or change the source admission. + +The new contribution is the exact single-relation receiver criterion, +complete current-word certificate in both orientations and complete signed +exclusion. The source word and caller are unchanged. diff --git a/research/bit-single-relation-bank-obstruction/LICENSE b/research/bit-single-relation-bank-obstruction/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/bit-single-relation-bank-obstruction/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/bit-single-relation-bank-obstruction/PROOF.md b/research/bit-single-relation-bank-obstruction/PROOF.md new file mode 100644 index 0000000000..6058cb7914 --- /dev/null +++ b/research/bit-single-relation-bank-obstruction/PROOF.md @@ -0,0 +1,141 @@ +# One binary helper relation cannot improve this fixed BIT word + +The input is the 659-public-field native word retained by +[PR #7001](https://github.com/CrocSwap/integer-mult-bounds/pull/7001). +[SOURCES.json](SOURCES.json) pins its compressed bytes and the paired caller. +This result concerns one linear relation over F2 on one group of helpers with +the same entrance and exit charts. It covers both orientations separately. +It gives no new multiplication exponent. + +## Contract and price + +Let G be one of the nine helper groups. Its entrance is A and its exit is D. +Let H_G be the coordinate space on those helpers. Impose `u*x_G=0` for any +nonzero vector u in H_G. Free invertible changes of helper basis at A and D +can express this promise as the removal of one productive helper. The lost +productive rank is `d=abs(dim(D)-dim(A))`. + +Keep the source word, its frames, the paid capture forms and their order fixed. +Grant free storage of every past paid bank at its arrival chart. Also grant +all public entrance fields at their entrance charts. Grant all ordinary +scalar XOR work for free. A paid bank can be omitted only if its value under the +promise is a linear combination of strictly earlier banks and entrance +fields at that same chart. The relation must hold for every remaining +arbitrary public input. This is an optimistic cost model. An exclusion in +this model also applies when these extra resources have positive costs. + +The scope does not include a new paid route, a changed capture form, a second +relation, a group with different boundary charts, nonlinear operations or a +composition of forward and transposed changes. Receiver coefficients +are scalars in F2; matrix-valued receiver coefficients are outside scope. + +## Exact receiver criterion + +At chart C, place all entrance rows first and all paid arrival rows in time +order. Let V_C be their span in the full 659-dimensional entrance space. +The two replays verify that this ordered list is linearly independent at +every chart, in both orientations. + +After imposing u, a relation between bank rows can arise only if their sum +is u. Define `L_C = V_C intersect H_G`. Thus a dependency is possible exactly +when u belongs to L_C. Since the original bank list is independent, the +representation of u is unique. + +At C=A, the representation uses free entrance fields. The promise lowers +the rank of the free entrances by one and creates no paid saving. At C +other than A, the unique representation must contain a paid bank. Its last +paid token is the only bank that can be recovered from earlier tokens under +the promise. Before that token there is no relation. After removing that +token, all later rows remain independent modulo u. Thus at most one paid +bank can be omitted at each chart. This argument accounts for all causal +linear substitutions, including substitutions through other omitted banks. + +The certificate supplies a basis of every nonzero L_C with literal bank +witnesses. A separate checker verifies each witness and proves completeness +from the rank formula + +```text +dim(L_C) = number of independent bank rows - rank(rows projected outside G). +``` + +It checks this formula at every receiver, including charts whose intersection +is zero. It does not assume that clean directions are coordinate vectors. + +## Complete finite reduction + +At D, the clean space is all of H_G. Every other receiver has clean dimension +at most four in the forward orientation and at most two in the transpose. +Enumerate the union of all nonzero vectors in these small nonterminal spaces. +This gives 664 forward and 125 transposed directions. The union, not a list +of basis vectors, is needed: it includes noncoordinate directions. + +For each such direction, the unique witness gives every receiver and the +last paid token at that receiver. In every one of these 789 cases, the sum +of removed paid ranks is strictly less than d. + +Every other nonzero u can affect only the terminal chart D. To cover these +unlisted directions, the first checker computes leading positions of the +terminal witness space. The second checker instead grows prefixes of the +bank list and records each increase of the clean prefix dimension. These +are exactly the possible last paid tokens. Every such token has rank at +most d. This covers all `2^410-1` possible nonzero relations in the largest +group without enumerating them. + +| Orientation | Helpers in groups | Exceptional directions by group | Maximum nonterminal dimension | +| --- | --- | --- | ---: | +| Forward | 410,2,1,7,6,5,3,2,1 | 661,2,1,0,0,0,0,0,0 | 4 | +| Transpose | 410,2,1,7,6,5,3,2,1 | 100,2,1,6,6,5,3,2,0 | 2 | + +The complete per-group counts and terminal rank bounds are in +[RESULT.json](RESULT.json). The full bases, witnesses and exceptional cases +are in [CERTIFICATE.json.gz](CERTIFICATE.json.gz). + +## Signed power inequality and complete caller + +Write `t=1-kappa`. For `99/100 <= t <= 1`, every positive integer rank r +satisfies `r^t <= r`. The lost ranks are 2, 4, 6 and 8. Exact integer checks +prove `d^99 > (d-1)^100` for each of these ranks. Thus every exceptional case +satisfies + +```text +sum(saved_rank^t) <= sum(saved_rank) <= d-1 < d^(99/100) <= d^t. +``` + +The removed paid moment is smaller than the lost productive moment. The +signed target-minus-paid margin strictly decreases. For every remaining +direction there is at most one removed paid rank r, with `r<=d`. Then +`r^t<=d^t`, so the margin cannot increase. Equal ranks cancel exactly. + +The source paired caller has 36 local invocations. Its complete invoice has +107352 paid calls, 19950 productive targets and rank surplus 1506. Both +implementations recount its query, idle and root terms. Fixed caller terms +cancel in the change; the local difference is multiplied by 36. One changed +invocation also cannot give a gain. No whole-call saving is inferred from +a paid count alone. The theorem covers `0<=kappa<=1/100`, which contains the +selected saving and the source BIT saving. No frozen-profile ceiling from a +different caller is used. + +## Verification and limits + +[census.py](census.py) uses packed binary rows and highest pivots. +[independent.py](independent.py) replays all public endpoints and paid rows +with coordinate sets, checks dimensions with lowest pivots and checks +terminal pivots with prefix ranks. It also verifies all 636 rational frame +bases, orthogonal complements and strict nested paid pairs. Both directions +start with independent public inputs. Reverse CLEAR introduces zero; reverse +INIT discards its owned value; reverse ADD acts on the donor. + +[verify.py](verify.py) compares the complete generated certificate and summary. +It rejects an omitted target debit, an omitted receiver, an omitted +noncoordinate direction, a corrupted witness, a future donor and an omitted +terminal pivot. A positive equal-mass split control shows why strict rank +deficit is needed; equal integer mass alone would not prove this exclusion. + +The two implementations were written by the same author after reading the +source. This is author checking, not blind review or formal acceptance. +The caller's physical identity, native phases, owned storage implementation, +compiler and tape interfaces, analytic framework and all five framework +assumptions remain inherited. Full predecessor suites, selected cold replay, +Lean and Docker were not run. No physical construction is claimed for the +free retained banks. Since this is an optimistic exclusion, their cost can +only strengthen the result within the stated fixed-word scope. diff --git a/research/bit-single-relation-bank-obstruction/README.md b/research/bit-single-relation-bank-obstruction/README.md new file mode 100644 index 0000000000..cd59c6a590 --- /dev/null +++ b/research/bit-single-relation-bank-obstruction/README.md @@ -0,0 +1,37 @@ +# Fixed BIT single-relation obstruction + +No single cocharted binary helper relation can improve the complete signed +moment of the pinned PR7001 word for `0<=kappa<=1/100`, in either orientation. +The model grants all past receiver banks and ordinary scalar XOR work for free. +It still charges the productive helper that the relation removes. + +Read [PROOF.md](PROOF.md), [RESULT.json](RESULT.json), +[CERTIFICATE.json.gz](CERTIFICATE.json.gz) and [CREDITS.md](CREDITS.md). +The certificate reduces every nonzero relation in nine helper groups to +789 exceptional directions and exact terminal prefix bounds. This includes +all `2^410-1` relations in the largest group. + +Use CPython 3.12 with its standard library: + +```sh +python3.12 -B scripts/research_package.py --package research/bit-single-relation-bank-obstruction +``` + +Both registered commands print: + +```text +PASS_SINGLE_BIT_RELATION_OBSTRUCTION 18 group-orientations; 789 exceptional directions; 6 rejected mutations; exact frame and full invoice checks +``` + +The declared source inputs must be present, or exported with the package. +The replay does not need Git or network and does not write into the package. +It is not a selected supplier replay. No kappa improvement, new physical +construction or selected-frontier change is claimed. Two simultaneous +relations, new paid routes and changed capture forms remain outside scope. + +## Open next questions + +Can two simultaneous helper relations give a gain on this exact BIT word? +First derive their joint rank loss at every receiver and charge both lost +targets. A single-relation certificate does not settle that interaction. +A new scope and overlap check are required before a search. diff --git a/research/bit-single-relation-bank-obstruction/RESULT.json b/research/bit-single-relation-bank-obstruction/RESULT.json new file mode 100644 index 0000000000..f045c9f7e5 --- /dev/null +++ b/research/bit-single-relation-bank-obstruction/RESULT.json @@ -0,0 +1,240 @@ +{ + "status": "PASS_SINGLE_BIT_RELATION_OBSTRUCTION", + "source_invoice": { + "paid": { + "1": 50340, + "2": 45108, + "3": 2232, + "4": 1692, + "5": 324, + "6": 3744, + "7": 804, + "14": 444, + "21": 444, + "28": 444, + "35": 444, + "42": 444, + "49": 444, + "56": 444 + }, + "targets": { + "2": 36, + "4": 900, + "6": 36, + "8": 15204, + "15": 444, + "22": 444, + "29": 444, + "36": 444, + "43": 444, + "50": 444, + "57": 444, + "64": 444, + "127": 222 + }, + "calls": 36, + "paid_count": 107352, + "target_count": 19950, + "rank_surplus": 1506 + }, + "public": 659, + "owned": 237, + "events": 34137, + "frames": 636, + "nested_pairs": 2374, + "orientations": [ + { + "direction": "forward", + "paid": 2871, + "receiver_charts": 636, + "retained_rows": 3530, + "exceptional_directions": 664, + "groups": [ + { + "entrance": 0, + "exit": 1, + "helpers": 410, + "lost_rank": 8, + "terminal_rank_max": 2, + "nonterminal_dimension_max": 4, + "exceptional_directions": 661 + }, + { + "entrance": 0, + "exit": 506, + "helpers": 2, + "lost_rank": 4, + "terminal_rank_max": 2, + "nonterminal_dimension_max": 1, + "exceptional_directions": 2 + }, + { + "entrance": 0, + "exit": 374, + "helpers": 1, + "lost_rank": 6, + "terminal_rank_max": 4, + "nonterminal_dimension_max": 1, + "exceptional_directions": 1 + }, + { + "entrance": 506, + "exit": 1, + "helpers": 7, + "lost_rank": 4, + "terminal_rank_max": 4, + "nonterminal_dimension_max": 0, + "exceptional_directions": 0 + }, + { + "entrance": 507, + "exit": 1, + "helpers": 6, + "lost_rank": 4, + "terminal_rank_max": 1, + "nonterminal_dimension_max": 0, + "exceptional_directions": 0 + }, + { + "entrance": 508, + "exit": 1, + "helpers": 5, + "lost_rank": 4, + "terminal_rank_max": 1, + "nonterminal_dimension_max": 0, + "exceptional_directions": 0 + }, + { + "entrance": 509, + "exit": 1, + "helpers": 3, + "lost_rank": 4, + "terminal_rank_max": 1, + "nonterminal_dimension_max": 0, + "exceptional_directions": 0 + }, + { + "entrance": 520, + "exit": 1, + "helpers": 2, + "lost_rank": 4, + "terminal_rank_max": 1, + "nonterminal_dimension_max": 0, + "exceptional_directions": 0 + }, + { + "entrance": 374, + "exit": 1, + "helpers": 1, + "lost_rank": 2, + "terminal_rank_max": 2, + "nonterminal_dimension_max": 0, + "exceptional_directions": 0 + } + ] + }, + { + "direction": "transpose", + "paid": 2871, + "receiver_charts": 636, + "retained_rows": 3530, + "exceptional_directions": 125, + "groups": [ + { + "entrance": 1, + "exit": 0, + "helpers": 410, + "lost_rank": 8, + "terminal_rank_max": 4, + "nonterminal_dimension_max": 2, + "exceptional_directions": 100 + }, + { + "entrance": 506, + "exit": 0, + "helpers": 2, + "lost_rank": 4, + "terminal_rank_max": 1, + "nonterminal_dimension_max": 1, + "exceptional_directions": 2 + }, + { + "entrance": 374, + "exit": 0, + "helpers": 1, + "lost_rank": 6, + "terminal_rank_max": 1, + "nonterminal_dimension_max": 1, + "exceptional_directions": 1 + }, + { + "entrance": 1, + "exit": 506, + "helpers": 7, + "lost_rank": 4, + "terminal_rank_max": 4, + "nonterminal_dimension_max": 2, + "exceptional_directions": 6 + }, + { + "entrance": 1, + "exit": 507, + "helpers": 6, + "lost_rank": 4, + "terminal_rank_max": 2, + "nonterminal_dimension_max": 1, + "exceptional_directions": 6 + }, + { + "entrance": 1, + "exit": 508, + "helpers": 5, + "lost_rank": 4, + "terminal_rank_max": 2, + "nonterminal_dimension_max": 1, + "exceptional_directions": 5 + }, + { + "entrance": 1, + "exit": 509, + "helpers": 3, + "lost_rank": 4, + "terminal_rank_max": 2, + "nonterminal_dimension_max": 1, + "exceptional_directions": 3 + }, + { + "entrance": 1, + "exit": 520, + "helpers": 2, + "lost_rank": 4, + "terminal_rank_max": 2, + "nonterminal_dimension_max": 1, + "exceptional_directions": 2 + }, + { + "entrance": 1, + "exit": 374, + "helpers": 1, + "lost_rank": 2, + "terminal_rank_max": 2, + "nonterminal_dimension_max": 0, + "exceptional_directions": 0 + } + ] + } + ], + "controls": [ + "omitted productive debit", + "omitted receiver space", + "omitted noncoordinate direction", + "corrupt exact witness", + "future donor reconstruction", + "omitted terminal prefix pivot", + "equal-mass split lies outside strict-deficit proof" + ], + "kappa_interval": [ + "0", + "1/100" + ] +} diff --git a/research/bit-single-relation-bank-obstruction/SOURCE-PINS.json b/research/bit-single-relation-bank-obstruction/SOURCE-PINS.json new file mode 100644 index 0000000000..22acdcd1fe --- /dev/null +++ b/research/bit-single-relation-bank-obstruction/SOURCE-PINS.json @@ -0,0 +1,23 @@ +[ + { + "path": "LICENSE", + "source_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "source_path": "research/paired-query-only-bit/LICENSE", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + { + "path": "credits/PR7001-NOTICE", + "source_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "source_path": "research/paired-query-only-bit/NOTICE", + "git_blob": "32c2936ea041e8f3e78638572a73f5f4079d4180", + "sha256": "8c73eaf46327f01b4cfc18640b5e5f552648fc5e4427cbccd42af5e7ecd3b732" + }, + { + "path": "credits/NATIVE-NOTICE", + "source_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "source_path": "research/paired-query-only-bit/retained/NOTICE", + "git_blob": "16c9afd68ed47b0e1ebb1421ffddb41719e3195b", + "sha256": "620e4ec6f537fa1c071f019ac92fa0e4eec8ab487c811e84153292b981de0424" + } +] diff --git a/research/bit-single-relation-bank-obstruction/SOURCES.json b/research/bit-single-relation-bank-obstruction/SOURCES.json new file mode 100644 index 0000000000..89244d9f7b --- /dev/null +++ b/research/bit-single-relation-bank-obstruction/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/paired-query-only-bit/retained/inputs/BIT-NATIVE-WORD.json.gz", + "usage": "input", + "git_blob": "b718d6b2848215ad785022106dfa9f871a3d1c0c", + "sha256": "51203e7fc75ba10bd3ac3f8e675759f47e13d262bea66b6600d1e515095cad78" + }, + { + "path": "research/paired-query-only-bit/EFREE-CALLER.json.gz", + "usage": "input", + "git_blob": "f022272a8d51ede841778dec76e2bfb24b614d04", + "sha256": "757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b" + } + ] +} diff --git a/research/bit-single-relation-bank-obstruction/TASK.json b/research/bit-single-relation-bank-obstruction/TASK.json new file mode 100644 index 0000000000..55931e5f07 --- /dev/null +++ b/research/bit-single-relation-bank-obstruction/TASK.json @@ -0,0 +1,77 @@ +{ + "schema_version": 1, + "task_id": "bit-helper-contract", + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "original_card": { + "id": "bit-helper-contract", + "question": "Can a changed G20 helper path or independent-target split improve the complete BIT moment without losing its physical endpoint?", + "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", + "research/g20-helper-split/README.md", + "research/g20-conjugation-admission/README.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": "A full boundary contract and paid profile; unchanged scalar counts alone are insufficient. 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", + "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": "First read #5679/#5708 and their audits as pending component proposals. Choose one uncovered helper group/cut on an exact word; compare arbitrary-input native action, targets, owned storage, both orientations and full signed bill. Stop if the gain is only a scalar count or repaid by lost targets. Do not rerun the frozen #5609 common-frame domain without changing its hypothesis.", + "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": [ + "G20", + "helper split", + "5679", + "5708", + "independent target" + ], + "existing_checks": [ + { + "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": "refined", + "actual_scope": "All single cocharted binary helper relations on the current PR7001 native, with free retained causal receiver banks, both orientations and the complete target debit.", + "scope_change_reason": "The task card cites earlier G20 words. This result pins the current source and changes one productive helper contract.", + "bottleneck_link": "The lost productive target must be smaller than the paid moment saving before a changed helper contract can help.", + "budget_minutes": 60, + "stop_rule": "Stop at a proved exclusion of this exact domain; do not expand to multiple relations or new paid words.", + "outcome": "completed", + "evidence": "PROOF.md; RESULT.json; CERTIFICATE.json.gz", + "author": "Ali Romman", + "ai_assistance": "Substantial OpenAI Codex assistance in research, implementation, verification and writing.", + "open_questions": [ + { + "question": "Can two simultaneous helper relations give a gain on this exact BIT word?", + "why_it_matters": "The one-relation proof does not control interactions between multiple quotient directions.", + "first_step": "Claim a new scope, derive the exact quotient rank loss at every receiver and charge both productive targets before a construction search.", + "blocked_by": "A new multi-relation rank and causal certificate, with both productive debits." + } + ] +} diff --git a/research/bit-single-relation-bank-obstruction/VERIFY.json b/research/bit-single-relation-bank-obstruction/VERIFY.json new file mode 100644 index 0000000000..5795642847 --- /dev/null +++ b/research/bit-single-relation-bank-obstruction/VERIFY.json @@ -0,0 +1,37 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/paired-query-only-bit/retained/inputs/BIT-NATIVE-WORD.json.gz", + "research/paired-query-only-bit/EFREE-CALLER.json.gz" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Replay both native orientations, all receiver intersections and causal witnesses, complete target debit, rational frames and six rejection controls." + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "-O", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Replay both native orientations, all receiver intersections and causal witnesses, complete target debit, rational frames and six rejection controls." + } + ] +} diff --git a/research/bit-single-relation-bank-obstruction/census.py b/research/bit-single-relation-bank-obstruction/census.py new file mode 100644 index 0000000000..a73e57d729 --- /dev/null +++ b/research/bit-single-relation-bank-obstruction/census.py @@ -0,0 +1,213 @@ +"""Compute exact receiver spaces for one binary helper relation.""" +from collections import Counter, defaultdict +from hashlib import sha256 +from pathlib import Path +import gzip +import json + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +NATIVE = 'research/paired-query-only-bit/retained/inputs/BIT-NATIVE-WORD.json.gz' +CALLER = 'research/paired-query-only-bit/EFREE-CALLER.json.gz' + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def read(path): + raw = path.read_bytes() + return json.loads(gzip.decompress(raw) if path.suffix == '.gz' else raw) + + +def source(): + for pin in read(HERE / 'SOURCES.json')['files']: + if pin['usage'] == 'input': + need(sha256((ROOT / pin['path']).read_bytes()).hexdigest() == pin['sha256'], 'input bytes') + return read(ROOT / NATIVE), read(ROOT / CALLER) + + +def walk(word, reverse): + n = word['public'] + initial, final = (word['final'], word['start']) if reverse else (word['start'], word['final']) + at = initial[:] + [None] * word['owned_fields'] + rows = [1 << i for i in range(n)] + [0] * word['owned_fields'] + banks = defaultdict(dict) + for r, chart in enumerate(initial): + banks[chart][~r] = rows[r] + moves = {} + program = list(reversed(word['program'])) if reverse else word['program'] + for clock, event in enumerate(program): + op, a, *args = event + if reverse and op in ('INIT', 'CLEAR'): + op = 'CLEAR' if op == 'INIT' else 'INIT' + if op == 'INIT': + need(a >= n and at[a] is None, 'new owned lifetime') + at[a], rows[a] = args[0], 0 + elif op == 'CLEAR': + need(a >= n and at[a] == args[0], 'owned retirement') + at[a], rows[a] = None, 0 + elif op == 'SWAP': + b, = args + at[a], at[b] = at[b], at[a] + rows[a], rows[b] = rows[b], rows[a] + elif op == 'ADD': + b, chart = args + need(a != b and at[a] == at[b] == chart, 'cocharted ADD') + if reverse: + rows[b] ^= rows[a] + else: + rows[a] ^= rows[b] + else: + need(op == 'MOVE', 'native operation') + start, end = args[::-1] if reverse else args + need(at[a] == start, 'MOVE entrance') + at[a] = end + moves[clock] = (start, end) + banks[end][clock] = rows[a] + need(at == final + [None] * word['owned_fields'], 'complete final chart inventory') + for r in range(n): + other = r + 111 if reverse and r < 111 else r - 111 if not reverse and 111 <= r < 222 else None + need(rows[r] == (1 << r) ^ (0 if other is None else 1 << other), 'full public endpoint') + return initial, final, banks, moves + + +def echelon(rows): + pivots = {} + for value, tags in rows: + while value: + pivot = value.bit_length() - 1 + if pivot not in pivots: + pivots[pivot] = value, tags + break + donor, indices = pivots[pivot] + value ^= donor + tags ^= indices + return pivots + + +def solve(value, pivots): + tags = set() + while value: + pivot = value.bit_length() - 1 + if pivot not in pivots: + return None + donor, indices = pivots[pivot] + value ^= donor + tags ^= indices + return tags + + +def clean_space(bank, mask): + outside, inside = {}, [] + for key, value in bank.items(): + tags = {key} + while value & ~mask: + pivot = (value & ~mask).bit_length() - 1 + if pivot not in outside: + outside[pivot] = value, tags + break + donor, indices = outside[pivot] + value ^= donor + tags ^= indices + else: + if value: + inside.append((value, tags)) + return echelon(inside) + + +def coordinates(value): + return [i for i in range(value.bit_length()) if value >> i & 1] + + +def enumerate_space(space): + values = {0} + for row, _ in space.values(): + values |= {value ^ row for value in values} + return values - {0} + + +def one_orientation(word, reverse): + initial, final, banks, moves = walk(word, reverse) + rank = lambda key: abs(word['frames'][str(moves[key][0])]['dim'] - word['frames'][str(moves[key][1])]['dim']) + for bank in banks.values(): + need(len(echelon((v, set()) for v in bank.values())) == len(bank), 'independent receiver bank') + groups = defaultdict(list) + for r in range(222, word['public']): + groups[initial[r], final[r]].append(r) + records = [] + for (a, d), roles in groups.items(): + mask = sum(1 << r for r in roles) + lost = abs(word['frames'][str(a)]['dim'] - word['frames'][str(d)]['dim']) + spaces = {c: clean_space(bank, mask) for c, bank in banks.items() if c != a} + nonzero = {c: space for c, space in spaces.items() if space} + need(len(nonzero[d]) == len(roles), 'complete terminal space') + exceptional = set() + for c, space in nonzero.items(): + if c != d: + need(len(space) <= 4, 'bounded exceptional enumeration') + exceptional |= enumerate_space(space) + keys = list(banks[d]) + positions = {key: i for i, key in enumerate(keys)} + image = echelon((sum(1 << positions[k] for k in tags), set()) for _, tags in nonzero[d].values()) + terminal_pivots = sorted(keys[p] for p in image) + need(all(k >= 0 and rank(k) <= lost for k in terminal_pivots), 'terminal-only rank bound') + cases = [] + for value in sorted(exceptional): + hits = [] + for c, space in nonzero.items(): + tags = solve(value, space) + if tags is not None: + key = max(tags) + need(key >= 0, 'paid causal pivot') + hits.append(dict(chart=c, pivot=key, rank=rank(key), relation=sorted(tags))) + need(sum(h['rank'] for h in hits) < lost, 'strict exceptional rank deficit') + cases.append(dict(signal=coordinates(value), hits=hits)) + need(lost ** 99 > (lost - 1) ** 100, 'uniform power interval') + records.append(dict(entrance=a, exit=d, roles=roles, lost_rank=lost, + checked_receivers=len(spaces), + spaces=[dict(chart=c, basis=[dict(signal=coordinates(v), relation=sorted(tags)) for v, tags in space.values()]) + for c, space in sorted(nonzero.items())], + terminal_pivots=terminal_pivots, terminal_rank_max=max(map(rank, terminal_pivots)), + exceptional_cases=cases)) + return dict(direction='transpose' if reverse else 'forward', paid=len(moves), + receiver_charts=len(banks), retained_rows=sum(map(len, banks.values())), groups=records, + exceptional_directions=sum(len(g['exceptional_cases']) for g in records), + bank_rows_sha256=sha256(json.dumps([[c, [[k, str(v)] for k, v in row.items()]] + for c, row in sorted(banks.items())], separators=(',', ':')).encode()).hexdigest()) + + +def invoice(word, caller): + _, _, _, moves = walk(word, False) + dim = lambda chart: word['frames'][str(chart)]['dim'] + native = Counter(abs(dim(a) - dim(b)) for a, b in moves.values()) + helpers = Counter(abs(dim(word['start'][r]) - dim(word['final'][r])) for r in range(222, word['public'])) + calls = [e for e in caller['events'] if e[0] == 'LOCAL'] + need(caller['ports'] == 111 and caller['stages'] == 18 and len(calls) == 36, 'complete paired caller') + need(Counter(e[1] for e in calls) == Counter({s: 2 for s in range(1, 19)}), 'two native calls per stage') + paid, targets = Counter({r: 36 * n for r, n in native.items()}), Counter({r: 36 * n for r, n in helpers.items()}) + for event in caller['events']: + if event[0] == 'QUERY': + paid[1] += 111 + elif event[0] == 'IDLE_ONE': + paid[7 * len(event[2])] += 111 + for target in caller['diagonal']: + need(target['q'] == 1 and target['stages'] and len(set(target['stages'])) == len(target['stages']), 'positive root target') + targets[1 + 7 * len(target['stages'])] += 111 + need((sum(paid.values()), sum(targets.values())) == (107352, 19950), 'complete source invoice') + return dict(paid=dict(sorted(paid.items())), targets=dict(sorted(targets.items())), + calls=36, paid_count=sum(paid.values()), target_count=sum(targets.values()), + rank_surplus=sum(r * n for r, n in targets.items()) - sum(r * n for r, n in paid.items())) + + +def run(): + word, caller = source() + return dict(status='PASS_SINGLE_BIT_RELATION_OBSTRUCTION', public=word['public'], + helper_groups=9, source_invoice=invoice(word, caller), + orientations=[one_orientation(word, False), one_orientation(word, True)], + kappa_interval=['0', '1/100']) + + +if __name__ == '__main__': + print(json.dumps(run(), indent=2)) diff --git a/research/bit-single-relation-bank-obstruction/credits/NATIVE-NOTICE b/research/bit-single-relation-bank-obstruction/credits/NATIVE-NOTICE new file mode 100644 index 0000000000..16c9afd68e --- /dev/null +++ b/research/bit-single-relation-bank-obstruction/credits/NATIVE-NOTICE @@ -0,0 +1,25 @@ +This research package contains and adapts Apache-2.0 material from +CrocSwap/integer-mult-bounds. The repository's Apache-2.0 license is +provided as LICENSE. + +The six-field mixed-projector architecture and binary-child recursion +are adapted from research/mixed-projector-query-root and its PR6348/PR6398 +lineage, credited there to Ali Romman and Cinna Davis with substantial +OpenAI Codex assistance. The public complex normalization, dyadic bases +and proof by two central characters are not imported as a binary proof. + +The binary projectors, direct characteristic-two operator verification, +complete binary staged callers, exact incidence enumeration and target +economic relaxation in this directory were constructed and checked in +this research session. No novelty or priority assertion is made. + +inputs/interval_engine.py is an unchanged copy of +research/higher-moment-strictification/verify.py, credited to zxv with +substantial OpenAI Codex assistance; its own source notices remain intact. +The broader finite/compiler/ordinary admission in the sibling root +package retains the credit and assumptions of its pinned predecessors. + +The unchanged native source and baseline construction retain all their +original attribution, including their functional kernel, receiver +compensation, temporal retiming, helper exchange and ordinary admission +lineages. No new source-word saving is claimed by this caller package. diff --git a/research/bit-single-relation-bank-obstruction/credits/PR7001-NOTICE b/research/bit-single-relation-bank-obstruction/credits/PR7001-NOTICE new file mode 100644 index 0000000000..32c2936ea0 --- /dev/null +++ b/research/bit-single-relation-bank-obstruction/credits/PR7001-NOTICE @@ -0,0 +1,26 @@ +Paired E-free BIT specialization and complete accounting, with substantial +OpenAI Codex assistance, for the integer-multiplication research project. +Apache-2.0; LICENSE is retained from the source project. + +DreamingOfClouds (Claude Opus assistance) receives credit for #6834's chain-root +BIT caller, #6937's E-free roots and the underlying two-chain construction. +@CubeJerry (OpenAI assistance) receives credit for #6980's four-input three-query +identity, separated interval replacement and QUERY-only caller. The complete +#6980 proof is retained byte-for-byte in data/6980_PROOF.md. + +The new contribution specializes that existing caller to the actual #6726 BIT +native, supplies the parity-driven pairing of two real 111-port invocations, +and checks the complete E-free finite/compiler/ordinary budget from the selected +ordinary backend. No general QUERY-only mechanism, chain root or new raw kappa +is claimed as new here. + +independent/bit_review.py and independent/interval_gate.py were written by a +separate OpenAI Codex research worker for an implementation-independent scalar +and arithmetic audit. This is model-run checking, not external human review. + +zxv and retained predecessor authors receive credit for #6726's source-native +export, integer-before-mod2 transfer, complete source checking and admission +framework. Ali Romman and Cinna Davis retain the root/native lineage credit. +The copied arithmetic and native checker retain their original headers; see +retained/NOTICE. The selected .0034 backend retains the source and contributor +credits in data/selected_record.json and data/selected_review.md. diff --git a/research/bit-single-relation-bank-obstruction/independent.py b/research/bit-single-relation-bank-obstruction/independent.py new file mode 100644 index 0000000000..6831e9aa83 --- /dev/null +++ b/research/bit-single-relation-bank-obstruction/independent.py @@ -0,0 +1,207 @@ +"""Check the receiver certificate with sets and prefix ranks.""" +from collections import Counter, defaultdict +from fractions import Fraction +from hashlib import sha256 +import json + + +def require(ok, message): + if not ok: + raise ValueError(message) + + +def insert(vector, basis): + value = set(vector) + while value: + key = min(value) + if key not in basis: + basis[key] = value + return True + value.symmetric_difference_update(basis[key]) + return False + + +def rank(vectors): + basis = {} + for vector in vectors: + insert(vector, basis) + return len(basis) + + +def replay(word, backward): + n = word['public'] + start, finish = (word['final'], word['start']) if backward else (word['start'], word['final']) + state = {i: (chart, {i}) for i, chart in enumerate(start)} + banks = defaultdict(dict) + for i, chart in enumerate(start): + banks[chart][-1-i] = {i} + moves = {} + length = len(word['program']) + clocks = range(length-1, -1, -1) if backward else range(length) + for clock, index in enumerate(clocks): + event = word['program'][index] + op, a = event[:2] + if (op == 'INIT' and not backward) or (op == 'CLEAR' and backward): + require(a >= n and a not in state, 'owned introduction') + state[a] = event[2], set() + elif (op == 'CLEAR' and not backward) or (op == 'INIT' and backward): + require(a >= n and state[a][0] == event[2], 'owned exit') + del state[a] + elif op == 'ADD': + b, chart = event[2:] + require(a != b and state[a][0] == state[b][0] == chart, 'ADD chart') + target, donor = (b, a) if backward else (a, b) + state[target][1].symmetric_difference_update(state[donor][1]) + elif op == 'SWAP': + b = event[2] + state[a], state[b] = state[b], state[a] + else: + require(op == 'MOVE', 'operation') + source, target = event[2:][::-1] if backward else event[2:] + require(state[a][0] == source, 'MOVE chart') + state[a] = target, state[a][1] + banks[target][clock] = set(state[a][1]) + moves[clock] = source, target + require(set(state) == set(range(n)), 'complete public inventory') + for i in range(n): + expected = {i} + if backward and i < 111: + expected.add(i+111) + if not backward and 111 <= i < 222: + expected.add(i-111) + require(state[i] == (finish[i], expected), 'public endpoint') + return start, finish, banks, moves + + +def rational_rank(rows): + pivots = {} + for row in rows: + v = [Fraction(x) for x in row] + for key, donor in pivots.items(): + coefficient = v[key] + v = [x-coefficient*y for x, y in zip(v, donor)] + if any(v): + key = next(i for i, x in enumerate(v) if x) + scale = v[key] + pivots[key] = [x/scale for x in v] + return len(pivots) + + +def orthogonal(left, right): + return all(sum(Fraction(a)*Fraction(b) for a, b in zip(x, y)) == 0 for x in left for y in right) + + +def frames(word): + fs = word['frames'] + for frame in fs.values(): + d, b, a = frame['dim'], frame['B'], frame['A'] + require(len(b) == d and len(a) == 8-d and all(len(row) == 8 for row in b+a), 'frame dimensions') + require(rational_rank(b) == d and rational_rank(a) == 8-d and orthogonal(b, a), 'rational frame') + pairs = {(e[2], e[3]) for e in word['program'] if e[0] == 'MOVE'} + for left, right in pairs: + x, y = fs[str(left)], fs[str(right)] + small, large = (x, y) if x['dim'] < y['dim'] else (y, x) + require(small['dim'] < large['dim'] and orthogonal(small['B'], large['A']), 'strict nested MOVE') + return len(pairs) + + +def xor_rows(bank, keys): + result = set() + require(len(set(keys)) == len(keys), 'distinct witness tokens') + for key in keys: + require(key in bank, 'same-chart witness') + result.symmetric_difference_update(bank[key]) + return result + + +def span_with_witness(basis): + values = {frozenset(): set()} + for row in basis: + signal, witness = frozenset(row['signal']), set(row['relation']) + values.update({value ^ signal: tags ^ witness for value, tags in list(values.items())}) + del values[frozenset()] + return values + + +def validate_group(group, initial, final, banks, moves, dimensions): + a, d = group['entrance'], group['exit'] + roles = {i for i in range(222, len(initial)) if (initial[i], final[i]) == (a, d)} + lost = abs(dimensions[a]-dimensions[d]) + require(set(group['roles']) == roles and group['lost_rank'] == lost, 'productive target debit') + require(group['checked_receivers'] == len(banks)-1, 'all receiver charts') + supplied = {row['chart']: row['basis'] for row in group['spaces']} + require(len(supplied) == len(group['spaces']) and set(supplied) <= set(banks)-{a}, 'unique receiver spaces') + exceptional, witnesses = set(), {} + for chart, bank in banks.items(): + if chart == a: + continue + dimension = len(bank)-rank(value-roles for value in bank.values()) + basis = supplied.get(chart, []) + require(len(basis) == dimension and rank(row['signal'] for row in basis) == dimension, 'complete clean dimension') + for row in basis: + signal = set(row['signal']) + require(signal and signal <= roles and signal == xor_rows(bank, row['relation']), 'exact clean witness') + if chart != d: + require(dimension <= 4, 'small nonterminal space') + witnesses[chart] = span_with_witness(basis) + exceptional.update(witnesses[chart]) + terminal = supplied[d] + require(len(terminal) == len(roles), 'full terminal space') + prefix, last_keys = {}, [] + for key, value in banks[d].items(): + if not insert(value-roles, prefix): + last_keys.append(key) + paid_rank = lambda key: abs(dimensions[moves[key][0]]-dimensions[moves[key][1]]) + require(last_keys == group['terminal_pivots'] and all(key >= 0 for key in last_keys), 'causal terminal pivots') + require(max(map(paid_rank, last_keys)) == group['terminal_rank_max'] <= lost, 'terminal rank bound') + cases = {frozenset(row['signal']): row for row in group['exceptional_cases']} + require(len(cases) == len(group['exceptional_cases']) and set(cases) == exceptional, 'complete exceptional union') + for signal, case in cases.items(): + expected_charts = {c for c, table in witnesses.items() if signal in table} | {d} + hits = {hit['chart']: hit for hit in case['hits']} + require(set(hits) == expected_charts and len(hits) == len(case['hits']), 'complete receiver hits') + for chart, hit in hits.items(): + tags = hit['relation'] + require(xor_rows(banks[chart], tags) == set(signal), 'exact removal relation') + require(hit['pivot'] == max(tags) >= 0 and hit['rank'] == paid_rank(hit['pivot']), 'earlier-bank reconstruction') + require(sum(hit['rank'] for hit in hits.values()) < lost, 'strict saved rank deficit') + require(lost**99 > (lost-1)**100, 'uniform power inequality') + return len(cases) + + +def validate_orientation(word, certificate, backward): + initial, final, banks, moves = replay(word, backward) + dimensions = {int(c): f['dim'] for c, f in word['frames'].items()} + require(all(rank(bank.values()) == len(bank) for bank in banks.values()), 'independent receiver rows') + rows = [[c, [[key, str(sum(1 << i for i in value))] for key, value in bank.items()]] for c, bank in sorted(banks.items())] + require(sha256(json.dumps(rows, separators=(',', ':')).encode()).hexdigest() == certificate['bank_rows_sha256'], 'all literal bank values') + groups = {(initial[i], final[i]) for i in range(222, len(initial))} + require({(g['entrance'], g['exit']) for g in certificate['groups']} == groups and len(certificate['groups']) == len(groups), 'all helper groups') + total = sum(validate_group(g, initial, final, banks, moves, dimensions) for g in certificate['groups']) + require(total == certificate['exceptional_directions'], 'exception count') + require(certificate['paid'] == len(moves) == 2871 and certificate['receiver_charts'] == len(banks), 'bank count') + require(certificate['retained_rows'] == sum(map(len, banks.values())), 'all retained rows') + return initial, final, banks, moves, dimensions + + +def invoice(word, caller): + dimensions = {int(c): f['dim'] for c, f in word['frames'].items()} + paid, targets = Counter(), Counter() + calls = 0 + for event in caller['events']: + if event[0] == 'LOCAL': + calls += 1 + for gate in word['program']: + if gate[0] == 'MOVE': + paid[abs(dimensions[gate[2]]-dimensions[gate[3]])] += 1 + for i in range(222, word['public']): + targets[abs(dimensions[word['start'][i]]-dimensions[word['final'][i]])] += 1 + if event[0] == 'QUERY': + paid[1] += caller['ports'] + if event[0] == 'IDLE_ONE': + paid[7*len(event[2])] += caller['ports'] + for root in caller['diagonal']: + targets[root['q']+7*len(root['stages'])] += caller['ports'] + return dict(paid=dict(sorted(paid.items())), targets=dict(sorted(targets.items())), calls=calls, + paid_count=sum(paid.values()), target_count=sum(targets.values()), + rank_surplus=sum(r*n for r,n in targets.items())-sum(r*n for r,n in paid.items())) diff --git a/research/bit-single-relation-bank-obstruction/verify.py b/research/bit-single-relation-bank-obstruction/verify.py new file mode 100644 index 0000000000..a2c8650b84 --- /dev/null +++ b/research/bit-single-relation-bank-obstruction/verify.py @@ -0,0 +1,91 @@ +"""Replay the fixed-word obstruction and its rejection controls.""" +from copy import deepcopy +from hashlib import sha1, sha256 +from pathlib import Path +import gzip +import importlib.util +import json + +HERE = Path(__file__).resolve().parent + + +def load(name): + spec = importlib.util.spec_from_file_location(name, HERE / (name+'.py')) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +def normalized(value): + return json.loads(json.dumps(value)) + + +def evaluate(): + primary, other = load('census'), load('independent') + word, caller = primary.source() + for pin in primary.read(HERE / 'SOURCE-PINS.json'): + data = (HERE / pin['path']).read_bytes() + other.require(sha256(data).hexdigest() == pin['sha256'], 'retained source SHA-256') + other.require(sha1(b'blob '+str(len(data)).encode()+b'\0'+data).hexdigest() == pin['git_blob'], 'retained source Git blob') + certificate = primary.read(HERE / 'CERTIFICATE.json.gz') + other.require(normalized(primary.run()) == certificate, 'primary certificate replay') + frame_pairs = other.frames(word) + states = [other.validate_orientation(word, record, backward) + for record, backward in zip(certificate['orientations'], (False, True))] + other.require(normalized(other.invoice(word, caller)) == certificate['source_invoice'], 'independent full invoice') + controls = [] + group = certificate['orientations'][0]['groups'][0] + + def reject(label, changed, expected): + try: + other.validate_group(changed, *states[0]) + except ValueError as error: + other.require(str(error) == expected, label+' failed at wrong gate: '+str(error)) + controls.append(label) + else: + raise ValueError('control accepted: '+label) + + changed = deepcopy(group) + changed['lost_rank'] = 0 + reject('omitted productive debit', changed, 'productive target debit') + changed = deepcopy(group) + changed['spaces'].pop(next(i for i,s in enumerate(changed['spaces']) if s['chart'] != group['exit'])) + reject('omitted receiver space', changed, 'complete clean dimension') + changed = deepcopy(group) + changed['exceptional_cases'].pop(next(i for i,c in enumerate(changed['exceptional_cases']) if len(c['signal']) > 1)) + reject('omitted noncoordinate direction', changed, 'complete exceptional union') + changed = deepcopy(group) + changed['spaces'][0]['basis'][0]['relation'].pop() + reject('corrupt exact witness', changed, 'exact clean witness') + changed = deepcopy(group) + hit = next(h for c in changed['exceptional_cases'] for h in c['hits'] if len(h['relation']) > 1) + hit['pivot'] = min(hit['relation']) + reject('future donor reconstruction', changed, 'earlier-bank reconstruction') + changed = deepcopy(group) + changed['terminal_pivots'].pop() + reject('omitted terminal prefix pivot', changed, 'causal terminal pivots') + # Equal integer mass can improve after a split. The strict deficit is needed. + # The exact equivalent is 2*2^t > 4^t for 0 4**99, 'positive concave split') + controls.append('equal-mass split lies outside strict-deficit proof') + receipt = dict(status='PASS_SINGLE_BIT_RELATION_OBSTRUCTION', source_invoice=certificate['source_invoice'], + public=word['public'], owned=word['owned_fields'], events=len(word['program']), frames=len(word['frames']), + nested_pairs=frame_pairs, orientations=[dict(direction=o['direction'], paid=o['paid'], + receiver_charts=o['receiver_charts'], retained_rows=o['retained_rows'], + exceptional_directions=o['exceptional_directions'], groups=[dict(entrance=g['entrance'], exit=g['exit'], + helpers=len(g['roles']), lost_rank=g['lost_rank'], terminal_rank_max=g['terminal_rank_max'], + nonterminal_dimension_max=max((len(s['basis']) for s in g['spaces'] if s['chart'] != g['exit']), default=0), + exceptional_directions=len(g['exceptional_cases'])) for g in o['groups']]) for o in certificate['orientations']], + controls=controls, kappa_interval=certificate['kappa_interval']) + return receipt + + +def run(): + receipt = evaluate() + if receipt != json.loads((HERE / 'RESULT.json').read_text()): + raise ValueError('stored summary receipt') + print(receipt['status'], '18 group-orientations; 789 exceptional directions; 6 rejected mutations; exact frame and full invoice checks') + + +if __name__ == '__main__': + run()