diff --git a/research/nonidempotent-n-constant-insertion/PROOF.md b/research/nonidempotent-n-constant-insertion/PROOF.md new file mode 100644 index 0000000000..8ce1e59f2e --- /dev/null +++ b/research/nonidempotent-n-constant-insertion/PROOF.md @@ -0,0 +1,321 @@ +# A constant insertion beside the non-idempotent factor N + +No new kappa. The selected frontier stays 363005817/100000000000. + +PR #7027 exhibits a non-idempotent 4-by-4 matrix `N` over `F_2` whose gate +`I + x N` is the leading factor of a triple multiplying to `(1 + x) I_4`. +One matrix `R` is inserted immediately beside that gate, with `e` central and +`e^2 = 0`. The coefficient of `e` is never `I`. On the exhibited stage-0 +triple, the same coefficient equals `(1 + x) I_4` if and only if `R = I_4`. + +The evidence is split by class: + +1. A proof, for every trailing matrix, that the right-hand insertion has + `(0, 0)` entry in the principal ideal `(1 + x)`. The identity is therefore + impossible for every matrix `R` with entries in `F_2[x, y, z]`. +2. A proof, by exact cancellation in that integral domain, that the exhibited + stage-0 triple has coefficient `(1 + x) I_4` if and only if `R = I_4`, on + either side. +3. An exhaustive finite census of the `65,536` constant 4-by-4 matrices, on + both sides. The domain is finite, every bit pattern is visited once, and + the count is the whole domain. +4. A proof that the same one insertion, read in the eight-dimensional word + obtained by embedding the triple on stage 0, never has coefficient `I_8`. + This is not a census of the `2^64` constant 8-by-8 matrices. + +The diagonal entry formula of PR #7039 and PR #7103 is not used. `N` is not +diagonal, and the formula is false for this gate. + +## 1. Hypotheses + +The scalar ring is `F_2[x, y, z]`. It is an integral domain. The homomorphism +onto `F_2` given by `x ↦ 1`, `y ↦ 0`, `z ↦ 0` will be called evaluation at +`(1, 0, 0)`. The scalar `e` is central and `e^2 = 0`. A constant matrix has +entries in `F_2`. The coefficient of `e` is the degree-1 term in the quotient +by `e^2`. + +The exhibited factor, copied from the bit rows in PR #7027, is + +```text +N = [[1, 0, 0, 0], + [0, 0, 1, 0], + [0, 0, 0, 0], + [0, 0, 0, 0]], +B = E_22, +C = [[0, 0, 0, 0], + [0, 0, 1, 0], + [0, 0, 1, 0], + [0, 0, 0, 1]]. +``` + +Bit `c` of row `r` is the entry `(r, c)`, so these are the rows +`(1, 4, 0, 0)`, `(0, 2, 0, 0)` and `(0, 4, 4, 8)`. Then `N^2 = E_11`, so `N` +is not idempotent. The eight-dimensional coordinates are + +```text +(core_0, core_1, leaf0_0, leaf0_1, leaf1_0, leaf1_1, leaf2_0, leaf2_1). +``` + +Stage `j` uses the core together with leaf `j`. Embedding a 4-by-4 matrix on +stage 0 writes it on coordinates `(0, 1, 2, 3)`. + +## 2. The expansion + +Row 0 of `N` is `(1, 0, 0, 0)`, so + +```text +I + x N = [[1 + x, 0, 0, 0], + [0, 1, x, 0], + [0, 0, 1, 0], + [0, 0, 0, 1]]. +``` + +For an arbitrary matrix `M` of the same size, + +```text +(I + x N)(I + e R) M = (I + x N) M + e (I + x N) R M. +``` + +The coefficient of `e` is `K = (I + x N) R M`. Its `(0, 0)` entry uses only +row 0 of `I + x N`: + +```text +K_00 = (1 + x) (R M)_00. +``` + +The product `(R M)_00` lies in `F_2[x, y, z]`. Evaluation at `(1, 0, 0)` +sends `1 + x` to `0` and sends `1` to `1`, so `(1 + x) f = 1` has no +solution. Therefore `K` is not the identity. + +The trailing factor `M` is arbitrary. It may be `I`, the exhibited product +`(I + x B)(I + x C)`, or the product of every later gate in the embedded +word below. No choice of those gates removes the factor `1 + x`. + +The same row survives embedding. On coordinates `(0, 1, 2, 3)` the embedded +gate still has row 0 equal to `(1 + x)` times the first standard basis +covector. For every 8-by-8 trailing matrix, the coefficient of a right-hand +insertion therefore has `(0, 0)` entry in the ideal `(1 + x)`, and is not +`I_8`. + +This is the expansion the question asks for. It does not depend on the +diagonal identity. + +## 3. The exhibited stage-0 triple + +Direct multiplication gives + +```text +(I + x B)(I + x C) = [[1, 0, 0, 0 ], + [0, 1+x, x+x^2, 0 ], + [0, 0, 1+x, 0 ], + [0, 0, 0, 1+x ]] +``` + +and `(I + x N)` times that matrix is `(1 + x) I_4`. Write `M` for the +displayed product. + +**Left insertion.** The coefficient in `(I + e R)(I + x N) M` is +`(1 + x) R`, because `(I + x N) M = (1 + x) I_4`. The equation +`(1 + x) R = I_4` asks `(1 + x) R_00 = 1`, which section 2 forbids. The +equation `(1 + x) R = (1 + x) I_4` is `(1 + x)(R_ij - δ_ij) = 0`. The +multiplier is nonzero, so `R = I_4` is the only solution in +`F_2[x, y, z]`. + +**Right insertion.** Let `Q = (I + x N) R` and `K = Q M`. The shapes above +give + +```text +Q_0j = (1 + x) R_0j, +Q_1j = R_1j + x R_2j, +Q_2j = R_2j, +Q_3j = R_3j, +``` + +and then + +```text +K_i0 = Q_i0, +K_i1 = (1 + x) Q_i1, +K_i2 = x(1 + x) Q_i1 + (1 + x) Q_i2, +K_i3 = (1 + x) Q_i3. +``` + +In entries, with `π = 1 + x`, + +```text +K_00 = π R_00 +K_10 = R_10 + x R_20 +K_20 = R_20 +K_30 = R_30 +K_01 = π^2 R_01 +K_11 = π R_11 + x π R_21 +K_21 = π R_21 +K_31 = π R_31 +K_02 = x π^2 R_01 + π^2 R_02 +K_12 = x π R_11 + x^2 π R_21 + π R_12 + x π R_22 +K_22 = x π R_21 + π R_22 +K_32 = x π R_31 + π R_32 +K_03 = π^2 R_03 +K_13 = π R_13 + x π R_23 +K_23 = π R_23 +K_33 = π R_33. +``` + +Every identity is an equality in `F_2[x, y, z]`, not a sample of monomials. +In characteristic two, `π^2 = 1 + x^2` and `x π = x + x^2`. + +The identity `K = I_4` requires `K_00 = π R_00 = 1`, which is impossible. +The remaining fifteen entries are not needed for that conclusion. + +The identity `K = π I_4` cancels in the following order. Each pivot is a +nonzero element of `F_2[x]`, and the ring is an integral domain, so the +quotient is unique in `F_2[x, y, z]`. + +```text +K_20 = R_20 = 0 +K_30 = R_30 = 0 +K_10 = R_10 + x R_20 = 0 so R_10 = 0 +K_00 = π R_00 = π so R_00 = 1 +K_21 = π R_21 = 0 so R_21 = 0 +K_31 = π R_31 = 0 so R_31 = 0 +K_11 = π R_11 + x π R_21 = π so R_11 = 1 +K_23 = π R_23 = 0 so R_23 = 0 +K_13 = π R_13 + x π R_23 = 0 so R_13 = 0 +K_33 = π R_33 = π so R_33 = 1 +K_01 = π^2 R_01 = 0 so R_01 = 0 +K_03 = π^2 R_03 = 0 so R_03 = 0 +K_02 = x π^2 R_01 + π^2 R_02 = 0 so R_02 = 0 +K_22 = x π R_21 + π R_22 = π so R_22 = 1 +K_32 = x π R_31 + π R_32 = 0 so R_32 = 0 +K_12 = x π R_11 + x^2 π R_21 + π R_12 + x π R_22 = 0 +``` + +The last equation reduces to `π R_12 = 0` after the earlier values are +substituted, because the two copies of `x π` cancel. Thus `R_12 = 0`. Every +entry has been determined, and `R = I_4`. + +The same calculation shows where the diagonal identity stops applying. +That identity would require `K_11 = π R_11`. The formula here is +`K_11 = π R_11 + x π R_21`. The matrix unit `E_21` has `K_11 = x π`, which +is not zero. PR #7039 records that its diagonal argument does not cover this +factor. The `(0, 0)` entry is a different computation, using row 0 of `N` +rather than diagonality of every gate. + +The left-hand and right-hand statements are the two readings of "beside". +The right-hand expansion is the one the question names first. Both use the +same factor `N` and the same two remaining stage-0 gates. + +Any other middle matrix `B'` with `C' = I + N + B'` and +`(I + x N)(I + x B')(I + x C') = (1 + x) I_4` has the same two obstructions +to coefficient `I_4`: the right-hand `(0, 0)` entry is covered by section 2 +for every trailing matrix, and the left-hand coefficient is `(1 + x) R` +because the pure product is `(1 + x) I_4`. This package does not recount the +128 middle matrices of PR #7027. It also does not classify, for a +non-exhibited companion, the solutions of coefficient `(1 + x) I_4`. + +## 4. The constant census + +A constant 4-by-4 matrix is an integer from `0` through `65,535`, with row +`r` stored in bits `4r` through `4r + 3`. Each of the `2^16` matrices occurs +once. Nothing stops early. + +On the right of `N`, and on the left, the number of these matrices whose +coefficient equals `I_4` is `0`. The number whose coefficient equals +`(1 + x) I_4` is `1`, and that matrix is `I_4`, on each side. + +The zero matrix has coefficient `0`. The matrix `I_4 + E_01` does not have +coefficient `(1 + x) I_4`. Those are controls. The census agrees with +sections 2 and 3 on the constant subdomain. It is not a substitute for the +polynomial argument, and the polynomial argument is not a sampling of the +census. The degree checks in `verify.py` exercise the division routine; they +are not a degree cutoff in the theorem. + +## 5. The embedded three-stage word + +Replace the three diagonal stage-0 gates of the nine-gate word by the +embedded factors `N`, `B` and `C`, in that order, and keep the six diagonal +gates of stages 1 and 2. Stage 1 multiplies by `1 + y` on coordinate `0`, +then on coordinate `1`, then on coordinates `4` and `5`. Stage 2 does the +same with `1 + z` on coordinates `0`, `1`, `6` and `7`. + +The stage-0 product is `I + x E_0`. The full pure product `P` is therefore +the same diagonal operator as in the nine-gate word: + +```text +P_00 = P_11 = (1 + x)(1 + y)(1 + z), +P_22 = P_33 = 1 + x, +P_44 = P_55 = 1 + y, +P_66 = P_77 = 1 + z. +``` + +**Right insertion, immediately after the embedded `I + x N`.** Section 2 +already excludes coefficient `I_8`. For this particular tail, column 0 is +`(1 + y)(1 + z)` times the first basis vector, so the general formula +specialises to + +```text +K_00 = (1 + x)(1 + y)(1 + z) R_00. +``` + +Evaluation at `(1, 0, 0)` sends the right-hand side to `0`. The same +conclusion holds for a polynomial entry `R_00`, not only for a bit. + +**Left insertion, with `N` first.** The coefficient is `R P`. Since `P` is +diagonal, `K_00 = R_00 P_00`, and `P_00` is the same nonunit. The coefficient +is not `I_8`. + +Both statements are bilinear, so they are checked on the 64 matrix units and +then extended by the ring action. A sum of two units is checked directly as a +control. This unit check is not an enumeration of `M_8(F_2)`. + +The pure-product equation `K = P` is not solved. Its column 0 is. On the +right, that column is + +```text +K_00 = (1 + x)(1 + y)(1 + z) R_00, +K_10 = (1 + y)(1 + z) (R_10 + x R_20), +K_20 = (1 + y)(1 + z) R_20, +K_30 = (1 + y)(1 + z) R_30, +K_i0 = (1 + y)(1 + z) R_i0 for i = 4, 5, 6, 7. +``` + +`P` has `(1 + x)(1 + y)(1 + z)` in position `(0, 0)` and zeros below it. +Cancelling the nonzero factor `1 + y + z + y z` forces `R_00 = 1`, +`R_20 = 0`, hence `R_10 = 0`, and `R_i0 = 0` for every `i > 0`. Column 0 of +`R` is the first standard basis vector. The other seven columns are open. + +## 6. Limits + +The selected record remains `363005817/100000000000`. No native caller, +compiler bill, or thin map is constructed. Profiles `g = 13` and `g = 31` +are not considered. PR #6956 is not rerun. + +The result is not the two-gap classification of PR #7103, and it is not the +polynomial count of PR #7191. Those papers insert constants or linear +polynomials into the diagonal word. The factor here is `N`. + +A matrix over the rational function field is outside the statement. The +scalar matrix `(1/(1 + x)) I_4` satisfies `(1 + x) R = I_4` in that larger +ring, which is why the obstruction is that `1 + x` is not a unit. It is not +a solution in `F_2[x, y, z]`. + +`current-priorities.md` at this base can still print an older decimal. The +live selected record is `363005817/100000000000`, from +`certificates/selected-result.json`. This package uses that record and edits +neither file. PR #7027, PR #7039 and PR #7103 name the previous fraction +`781451/250000000`; that is not the frontier this package is measured +against, and this package does not move either value. + +## Credit + +The paired-star contract, the operator `T`, and the pure target are from PR +#5747 (Ali Romman), including PR #5673, PR #5631, and PR #5617. The +T-commuting projector obstruction is PR #6956. The factor `N`, the triple, +and the embedding convention are PR #7027, head +`1ba2ac5adfe58fbe9dba34d50d4e5d30633ce3d0`. The diagonal obstruction for the +idempotent gates, and the statement that it does not cover `N`, are PR +#7039, head `e4ddcd2fde8c46b7e528e8806ab72d9bf7690978`. The question answered +here is open question 3 of PR #7103, which is the same non-idempotent slot +already named as question 2 of PR #7039. Prepared by unpaidmoon with +substantial Cursor Grok assistance. Independent human review and a +proof-assistant proof are unclaimed. Apache-2.0. diff --git a/research/nonidempotent-n-constant-insertion/README.md b/research/nonidempotent-n-constant-insertion/README.md new file mode 100644 index 0000000000..19f029904f --- /dev/null +++ b/research/nonidempotent-n-constant-insertion/README.md @@ -0,0 +1,102 @@ +# Constant insertion beside the non-idempotent factor N + +**No new kappa.** For the non-idempotent leading factor `N` exhibited in +PR #7027, one matrix inserted immediately beside `I + x N` does not make the +coefficient of `e` equal `I`. On the exhibited stage-0 triple, that +coefficient equals `(1 + x) I_4` if and only if the inserted matrix is `I_4`. +The selected frontier stays 363005817/100000000000. + +The proofs, the census domain, and the limits are in [PROOF.md](PROOF.md). + +## Scope and evidence + +Original card: `joint-query-controller`. The card asks whether a changed +query demand removes real work. This package answers a different question: +open question 3 of PR #7103, which is the non-idempotent slot left open by +PR #7039. The factor stays the exhibited `N`. The insertion stays one matrix +beside `I + x N`. Scope status is `changed` for that reason. + +The evidence classes are separate. The right-hand expansion +`(I + x N)(I + e R) M` is an identity for every trailing matrix `M`: the +`(0, 0)` entry of the coefficient of `e` is divisible by `1 + x`, so the +coefficient is never `I`. The exhibited gates `B = E_22` and `C` are one +such trailing product. On that triple, both sides, the coefficient equals +`(1 + x) I_4` exactly for `R = I_4`, for entries in `F_2[x, y, z]`. The +`65,536` constant 4-by-4 matrices are an exhaustive finite census of the +constant special case, not a search sample and not the polynomial proof. +Embedding the same triple on stage 0 of the three-stage word, and inserting +the same one matrix beside `N`, never makes the eight-dimensional coefficient +equal `I_8`. That last statement is a proof by the same `(0, 0)` entry. It +is not a census of `M_8(F_2)`. + +`R = I_4` is a witness for the stage-0 equation "coefficient = `(1 + x) I_4`". +It is not a witness for coefficient `I`, and it is not a kappa witness. + +The diagonal identity of PR #7039 and PR #7103 does not apply. `N` is not +diagonal: the matrix unit `E_21` contributes `x(1 + x)` to position `(1, 1)`. +The two-gap classification of PR #7103 and the polynomial count of PR #7191 +stay on the diagonal word. This package does not rerun the 128-element +middle-factor census of PR #7027. + +`current-priorities.md` at this base can still print an older decimal. The +live selected record is 363005817/100000000000. This package uses that record +and edits neither file. Source commits, Git blobs and SHA256 pins are in +[SOURCES.json](SOURCES.json). The selected record and catalogue are historical +provenance. The verifier recomputes the matrices and does not read the +predecessor packages. + +Overlap was checked on 2026-11-11 against open upstream PR titles for the +non-idempotent insertion, against the bodies of PR #7027, PR #7039 and +PR #7103, and against `cursor/*` branches on `unpaidmoon/integer-mult-bounds`. +No open PR and no fork branch answers this slot. PR #7191 classifies +polynomial entries in the diagonal gaps of PR #7103. A later GitHub search +for the same phrase returned HTTP 403, so closed-PR body coverage is +incomplete; the open-PR title search had already been run. + +## Reproduce + +Python 3.12, standard library only. From the repository root: + +```sh +python3 -B scripts/research_package.py --package research/nonidempotent-n-constant-insertion +``` + +The registered replay runs the verifier twice, once with `-O`. Both print +`PASS_NONIDEMPOTENT_N_CONSTANT_INSERTION`. The checks raise, so `-O` does not +strip them. Directly: + +```sh +python3 -B research/nonidempotent-n-constant-insertion/verify.py +``` + +No Lean, Docker, native, or selected-frontier replay was run. + +## Open next questions + +- Which constant 8-by-8 matrices `R`, inserted immediately on the right of + the embedded `I + x N` in the three-stage word of the proof, make the + coefficient of `e` equal the pure product `P`? The endpoint operator asks + for coefficient `P`, and this package only excludes `I`. Column 0 of that + equation is already settled: it forces column 0 of `R` to be the first + basis vector. The first step is column 1 of the same linear system. + Nothing external blocks that column. The result would still not be a + census of all `2^64` matrices unless the solved linear system is shown to + have no free bit. This is not the diagonal two-gap problem of PR #7103 or + PR #7191. +- For a middle matrix other than `E_22` in the 128-element slice of PR + #7027, which constant matrices make the stage-0 coefficient equal + `(1 + x) I_4`? Section 2 already rules out coefficient `I` for every + trailing matrix, so this question is only the pure stage target. The first + step is to repeat the closed-form multiplication for one other middle + matrix accepted by that slice. Nothing external blocks that matrix. This + package does not rerun the slice. + +## Credit + +The paired-star contract, the operator `T`, and the pure target are from PR +#5747 (Ali Romman), including PR #5673, PR #5631, and PR #5617. The factor +`N` and the question's geometric setting are PR #7027. The diagonal +obstruction, and the statement that it does not cover `N`, are PR #7039. +The question answered here is open question 3 of PR #7103. Prepared by +unpaidmoon with substantial Cursor Grok assistance. Independent human review +and a proof-assistant proof are unclaimed. diff --git a/research/nonidempotent-n-constant-insertion/SOURCES.json b/research/nonidempotent-n-constant-insertion/SOURCES.json new file mode 100644 index 0000000000..5335fa97d9 --- /dev/null +++ b/research/nonidempotent-n-constant-insertion/SOURCES.json @@ -0,0 +1,18 @@ +{ + "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" + } + ] +} diff --git a/research/nonidempotent-n-constant-insertion/TASK.json b/research/nonidempotent-n-constant-insertion/TASK.json new file mode 100644 index 0000000000..b20237759d --- /dev/null +++ b/research/nonidempotent-n-constant-insertion/TASK.json @@ -0,0 +1,90 @@ +{ + "schema_version": 1, + "task_id": "joint-query-controller", + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "original_card": { + "id": "joint-query-controller", + "question": "Can a changed query demand or caller remove real work while satisfying native chronology and restoration?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "A source-bound arbitrary-input identity and legal producer/consumer boundary with the complete paid and productive target invoice, including restoration, ownership, native alignment and extra charges. Price under the actual current model; historical ceiling.py assumptions must be established before use. A favorable optimistic relaxation keeps a route open but is not a completed supplier. A scoped local result remains useful; expansion requires the family-level budget gate.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Choose an exact caller and a new demand/interface hypothesis. Read the scoped #5617/#5631/#5649/#5747 and #5720/#5745 objections before rebuilding an excluded schedule. Compare the complete matched source/consumer protocols including all retained helper outputs. For an active-mode injection, first check #5745: its canonical delivery claim repays the eight removed centre jobs. Audit that exact claim or change its channel/feedback hypothesis; do not repeat the same free-injection search. Stop if the full favorable budget fails or the required restored output is unobservable.", + "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": [ + "query demand", + "active mode", + "5720", + "5745", + "5747", + "caller" + ], + "existing_checks": [ + { + "scope": "PR #4166: author-checked installed producer/service/return/bridge connection; native-component comparison loses.", + "evidence": "research/qq16-caller-install/README.md", + "remaining": "Complete matched physical protocol bill, or changed source-compatible demand/circuit; no affordable supplier yet.", + "status": "author-checked", + "source_commit": "0b082d22a0e9a442d264ab0633e35ef26c790630", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + "scope_status": "changed", + "actual_scope": "For the exhibited non-idempotent factor N of PR #7027, one matrix with entries in F_2[x,y,z] inserted immediately beside I+xN does not make the coefficient of e equal I. On the exhibited stage-0 triple that coefficient equals (1+x)I_4 if and only if the matrix is I_4. The same one insertion in the embedded three-stage word does not make the eight-dimensional coefficient equal I_8.", + "scope_change_reason": "The card asks whether a changed query demand removes real work. This package answers open question 3 of PR #7103, the non-idempotent insertion left open by PR #7039. The factor stays the exhibited N and the insertion stays one matrix beside I+xN. No caller, paid bill, or selected frontier is changed.", + "bottleneck_link": "The paired-star endpoint asks for a coefficient of e equal to a pure product, not for a new kappa. This slot does not produce the identity coefficient. It supplies no supplier and does not change the selected frontier 363005817/100000000000.", + "budget_minutes": 60, + "stop_rule": "Stop after the expansion of (I+xN)(I+eR), the stage-0 identity for the exhibited triple, the constant census, and the same insertion in the embedded three-stage word. Do not classify the eight-dimensional pure-product solutions or another middle matrix from the 128-element slice.", + "outcome": "negative-result", + "evidence": "PROOF.md gives the (0,0) divisibility argument and the triangular cancellation. verify.py checks the closed forms against all 16 matrix units, censuses all 65536 constant 4-by-4 matrices on both sides (0 identity hits, 1 pure-target hit), and checks the embedded (0,0) entry on all 64 matrix units. It prints PASS_NONIDEMPOTENT_N_CONSTANT_INSERTION. Python 3.12, standard library only.", + "author": "unpaidmoon", + "ai_assistance": "Substantial Cursor Grok assistance. Independent human review and a proof-assistant proof are unclaimed.", + "open_questions": [ + { + "question": "Which constant 8-by-8 matrices R, inserted immediately on the right of the embedded I+xN, make the coefficient of e equal the pure product P?", + "why_it_matters": "The endpoint operator asks for coefficient P. This package only excludes I. Column 0 of the equation is already settled and forces column 0 of R to be the first basis vector.", + "first_step": "Solve column 1 of the same right-insertion linear system. The tail and the embedded gate are already fixed in PROOF.md section 5.", + "blocked_by": "Nothing external. The other seven columns are not enumerated here, and a free bit would have to be ruled out before calling the solution set a complete constant classification." + }, + { + "question": "For a middle matrix other than E_22 in the 128-element slice of PR #7027, which constant matrices make the stage-0 coefficient equal (1+x)I_4?", + "why_it_matters": "Section 2 already rules out coefficient I for every trailing matrix. The pure stage target is classified here only for the exhibited companion B=E_22.", + "first_step": "Repeat the closed-form multiplication (I+xN)R(I+xB)(I+xC) for one other middle matrix accepted by the PR #7027 slice, with C=I+N+B.", + "blocked_by": "Nothing external. This package does not rerun that slice." + } + ] +} diff --git a/research/nonidempotent-n-constant-insertion/VERIFY.json b/research/nonidempotent-n-constant-insertion/VERIFY.json new file mode 100644 index 0000000000..cc3ba0ed2b --- /dev/null +++ b/research/nonidempotent-n-constant-insertion/VERIFY.json @@ -0,0 +1,28 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Stage-0 shapes, closed forms against all 16 matrix units, triangular cancellation, exhaustive 65536-matrix census on both sides, general (0,0) divisibility for four 4-by-4 tails and for the embedded identity and E_20 tails, embedded pure product, and all 64 embedded matrix units. Zero and I+E_01 are failure controls." + }, + { + "argv": [ + "{python}", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "The same identities under python -O. Checks raise SystemExit, so optimized mode does not drop them." + } + ] +} diff --git a/research/nonidempotent-n-constant-insertion/verify.py b/research/nonidempotent-n-constant-insertion/verify.py new file mode 100644 index 0000000000..c76cc4d548 --- /dev/null +++ b/research/nonidempotent-n-constant-insertion/verify.py @@ -0,0 +1,557 @@ +#!/usr/bin/env python3 +"""Constant insertion beside the non-idempotent factor N of PR #7027. + +The stage-0 coefficient of e in (I + x N)(I + e R), multiplied by the +remaining factors of the exhibited word, is never I. Failures raise +SystemExit, so python -O still fails closed. +""" + +from __future__ import annotations + +N_BITS = (1, 4, 0, 0) +B_BITS = (0, 2, 0, 0) +C_BITS = (0, 4, 4, 8) +EYE_BITS = (1, 2, 4, 8) +E11_BITS = (1, 0, 0, 0) +E22_BITS = (0, 2, 0, 0) +E33_E44_BITS = (0, 0, 4, 8) + +# Univariate polynomials in F_2[x]: bit k is the coefficient of x^k. +ONE = 0b1 +X = 0b10 +ONE_PLUS_X = 0b11 + + +def fail(message): + raise SystemExit("FAIL: " + message) + + +def require(ok, message): + if not ok: + fail(message) + + +def pdeg(poly): + return -1 if poly == 0 else poly.bit_length() - 1 + + +def pmul(left, right): + out = 0 + shift = 0 + while right: + if right & 1: + out ^= left << shift + right >>= 1 + shift += 1 + return out + + +def pdiv(dividend, divisor): + """Exact quotient in F_2[x]. Fails when the remainder is nonzero.""" + require(divisor != 0, "division by zero") + quotient = 0 + remainder = dividend + degree = pdeg(divisor) + while remainder and pdeg(remainder) >= degree: + shift = pdeg(remainder) - degree + quotient ^= 1 << shift + remainder ^= divisor << shift + require(remainder == 0, "not an exact quotient in F_2[x]") + return quotient + + +def bits_matrix(rows): + return tuple( + tuple((rows[i] >> j) & 1 for j in range(4)) + for i in range(4) + ) + + +def gate_from_bits(rows): + matrix = [] + for i in range(4): + line = [] + for j in range(4): + entry = ONE if i == j else 0 + if (rows[i] >> j) & 1: + entry ^= X + line.append(entry) + matrix.append(tuple(line)) + return tuple(matrix) + + +def constant_matrix(rows): + return tuple( + tuple(((rows[i] >> j) & 1) * ONE for j in range(4)) + for i in range(4) + ) + + +def mul4(left, right): + out = [] + for i in range(4): + line = [] + for j in range(4): + acc = 0 + for k in range(4): + acc ^= pmul(left[i][k], right[k][j]) + line.append(acc) + out.append(tuple(line)) + return tuple(out) + + +def scale_identity(poly): + return tuple( + tuple(poly if i == j else 0 for j in range(4)) + for i in range(4) + ) + + +def unit_bits(row, col): + rows = [0, 0, 0, 0] + rows[row] = 1 << col + return tuple(rows) + + +def mul_bits(left, right): + out = [] + for i in range(4): + acc = 0 + for k in range(4): + if (left[i] >> k) & 1: + acc ^= right[k] + out.append(acc) + return tuple(out) + + +def check_arithmetic(): + require(pmul(ONE_PLUS_X, ONE) == ONE_PLUS_X, "(1+x)*1") + require(pmul(ONE_PLUS_X, X) == 0b110, "(1+x)*x = x+x^2") + require(pmul(ONE_PLUS_X, ONE_PLUS_X) == 0b101, "(1+x)^2 = 1+x^2") + require(pdiv(ONE_PLUS_X, ONE_PLUS_X) == ONE, "cancel 1+x") + require(pdiv(0, ONE_PLUS_X) == 0, "zero quotient") + require(pdiv(pmul(ONE_PLUS_X, ONE_PLUS_X), ONE_PLUS_X) == ONE_PLUS_X, "cancel one factor") + caught = False + try: + pdiv(ONE, ONE_PLUS_X) + except SystemExit: + caught = True + require(caught, "1+x divided 1") + for degree in range(12): + monomial = 1 << degree + product = pmul(ONE_PLUS_X, monomial) + require(product == monomial ^ (monomial << 1), "leading term of (1+x) x^k") + require(pdeg(product) == degree + 1, "degree rises") + require(product != ONE, "a monomial multiple was 1") + for poly in range(1, 64): + require(pdeg(pmul(ONE_PLUS_X, poly)) == pdeg(poly) + 1, "degree formula") + + +def check_shapes(): + require(mul_bits(N_BITS, N_BITS) == E11_BITS, "N^2 = E_11") + require(mul_bits(N_BITS, N_BITS) != N_BITS, "N is not idempotent") + require(mul_bits(B_BITS, B_BITS) == B_BITS, "exhibited middle factor") + gate_n = gate_from_bits(N_BITS) + gate_b = gate_from_bits(B_BITS) + gate_c = gate_from_bits(C_BITS) + hand_n = ( + (ONE_PLUS_X, 0, 0, 0), + (0, ONE, X, 0), + (0, 0, ONE, 0), + (0, 0, 0, ONE), + ) + hand_m = ( + (ONE, 0, 0, 0), + (0, ONE_PLUS_X, pmul(X, ONE_PLUS_X), 0), + (0, 0, ONE_PLUS_X, 0), + (0, 0, 0, ONE_PLUS_X), + ) + require(gate_n == hand_n, "I+xN shape") + require(gate_n[0] == (ONE_PLUS_X, 0, 0, 0), "row 0 of I+xN") + tail = mul4(gate_b, gate_c) + require(tail == hand_m, "tail (I+xB)(I+xC)") + require(tuple(tail[i][0] for i in range(4)) == (ONE, 0, 0, 0), "tail column 0") + product = mul4(gate_n, tail) + require(product == scale_identity(ONE_PLUS_X), "stage-0 triple is (1+x) I_4") + # The diagonal identity would say every diagonal scales by R_ii (1+x). + # Position (1, 1) of the right-hand coefficient sees R_21 as well. + skewed = constant_matrix(unit_bits(2, 1)) + skewed_coeff = mul4(mul4(gate_n, skewed), tail) + require(skewed_coeff[1][1] == pmul(X, ONE_PLUS_X), "E_21 reaches position (1,1)") + require(skewed_coeff[1][1] != 0, "diagonal identity does not describe N") + return gate_n, tail + + +def closed_forms(): + """Hand formulas for K = (I + x N) R (I + x B)(I + x C).""" + xx = pmul(ONE_PLUS_X, ONE_PLUS_X) + x_xx = pmul(X, xx) + x1 = pmul(X, ONE_PLUS_X) + x2 = pmul(X, x1) + return { + (0, 0): {(0, 0): ONE_PLUS_X}, + (0, 1): {(0, 1): xx}, + (0, 2): {(0, 1): x_xx, (0, 2): xx}, + (0, 3): {(0, 3): xx}, + (1, 0): {(1, 0): ONE, (2, 0): X}, + (1, 1): {(1, 1): ONE_PLUS_X, (2, 1): x1}, + (1, 2): {(1, 1): x1, (1, 2): ONE_PLUS_X, (2, 1): x2, (2, 2): x1}, + (1, 3): {(1, 3): ONE_PLUS_X, (2, 3): x1}, + (2, 0): {(2, 0): ONE}, + (2, 1): {(2, 1): ONE_PLUS_X}, + (2, 2): {(2, 1): x1, (2, 2): ONE_PLUS_X}, + (2, 3): {(2, 3): ONE_PLUS_X}, + (3, 0): {(3, 0): ONE}, + (3, 1): {(3, 1): ONE_PLUS_X}, + (3, 2): {(3, 1): x1, (3, 2): ONE_PLUS_X}, + (3, 3): {(3, 3): ONE_PLUS_X}, + } + + +def forms_from_units(gate_n, tail): + forms = {(i, j): {} for i in range(4) for j in range(4)} + for row in range(4): + for col in range(4): + coeff = mul4(mul4(gate_n, constant_matrix(unit_bits(row, col))), tail) + for i in range(4): + for j in range(4): + if coeff[i][j]: + forms[(i, j)][(row, col)] = coeff[i][j] + return forms + + +def check_forms(gate_n, tail): + expected = closed_forms() + actual = forms_from_units(gate_n, tail) + for i in range(4): + for j in range(4): + require(actual[(i, j)] == expected[(i, j)], "closed form " + str((i, j))) + require(actual[(0, 0)] == {(0, 0): ONE_PLUS_X}, "K_00 = (1+x) R_00") + # Linearity over F_2 and over the coefficient x. + combined_bits = [0, 0, 0, 0] + combined_bits[0] |= 1 << 0 + combined_bits[1] |= 1 << 2 + direct = mul4(mul4(gate_n, constant_matrix(tuple(combined_bits))), tail) + left = mul4(mul4(gate_n, constant_matrix(unit_bits(0, 0))), tail) + right = mul4(mul4(gate_n, constant_matrix(unit_bits(1, 2))), tail) + summed = tuple( + tuple(left[i][j] ^ right[i][j] for j in range(4)) + for i in range(4) + ) + require(direct == summed, "coefficient is additive") + scaled = tuple(tuple(pmul(X, left[i][j]) for j in range(4)) for i in range(4)) + x_unit = tuple( + tuple(pmul(X, constant_matrix(unit_bits(0, 0))[i][j]) for j in range(4)) + for i in range(4) + ) + require(mul4(mul4(gate_n, x_unit), tail) == scaled, "coefficient is F_2[x]-linear") + pure = mul4(gate_n, tail) + for row in range(4): + for col in range(4): + left = mul4(constant_matrix(unit_bits(row, col)), pure) + expect = tuple( + tuple( + ONE_PLUS_X if i == row and j == col else 0 + for j in range(4) + ) + for i in range(4) + ) + require(left == expect, "left coefficient scales the inserted unit") + + +def apply_known(form, known): + acc = 0 + rest = {} + for var, coeff in form.items(): + if var in known: + acc ^= pmul(coeff, known[var]) + else: + rest[var] = coeff + return rest, acc + + +def solve_pure_target(forms): + """Execute the written cancellation order for K = (1+x) I_4.""" + target = {(i, j): (ONE_PLUS_X if i == j else 0) for i in range(4) for j in range(4)} + known = {} + order = [ + (2, 0), (3, 0), (1, 0), (0, 0), + (2, 1), (3, 1), (1, 1), + (2, 3), (1, 3), (3, 3), + (0, 1), (0, 3), (0, 2), + (2, 2), (3, 2), (1, 2), + ] + for key in order: + rest, acc = apply_known(forms[key], known) + rhs = target[key] ^ acc + require(len(rest) == 1, "cancellation order is not triangular at " + str(key)) + (var, pivot), = rest.items() + require(var == key, "pivot variable " + str(key)) + require(pivot != 0, "zero pivot") + value = pdiv(rhs, pivot) + require(value in (0, ONE), "nonconstant quotient " + str(key)) + known[var] = value + require(len(known) == 16, "a matrix entry was not determined") + for i in range(4): + for j in range(4): + require(known[(i, j)] == (ONE if i == j else 0), "pure target solution") + # The same first pivot blocks the identity, before any later entry is used. + rest, acc = apply_known(forms[(0, 0)], {}) + require(rest == {(0, 0): ONE_PLUS_X} and acc == 0, "identity pivot") + caught = False + try: + pdiv(ONE, ONE_PLUS_X) + except SystemExit: + caught = True + require(caught, "(1+x) R_00 = 1 had a polynomial solution") + return known + + +def check_right_identity_for_any_tail(gate_n): + """K_00 = (1+x) (R M)_00 for every trailing M, from row 0 of I+xN.""" + tails = [ + scale_identity(ONE), + constant_matrix((15, 15, 15, 15)), + constant_matrix(unit_bits(2, 0)), + mul4(gate_from_bits(B_BITS), gate_from_bits(C_BITS)), + ] + for tail in tails: + for row in range(4): + for col in range(4): + matrix_r = constant_matrix(unit_bits(row, col)) + coeff = mul4(mul4(gate_n, matrix_r), tail) + mixed = mul4(matrix_r, tail) + require(coeff[0][0] == pmul(ONE_PLUS_X, mixed[0][0]), "general (0,0) entry") + + +def check_constant_census(gate_n, tail): + target_i = scale_identity(ONE) + target_p = scale_identity(ONE_PLUS_X) + pure = mul4(gate_n, tail) + hits_i_right = hits_i_left = hits_p_right = hits_p_left = 0 + pure_witness = None + visited = 0 + for bits in range(1 << 16): + visited += 1 + rows = tuple((bits >> (4 * row)) & 15 for row in range(4)) + matrix_r = constant_matrix(rows) + right = mul4(mul4(gate_n, matrix_r), tail) + left = mul4(matrix_r, pure) + hits_i_right += right == target_i + hits_i_left += left == target_i + if right == target_p: + hits_p_right += 1 + pure_witness = rows + hits_p_left += left == target_p + require(visited == 65536, "constant census missed a matrix") + require(hits_i_right == 0 and hits_i_left == 0, "a constant made the coefficient I") + require(hits_p_right == 1 and hits_p_left == 1, "pure-target count") + require(pure_witness == EYE_BITS, "pure-target witness") + zero = constant_matrix((0, 0, 0, 0)) + require(mul4(mul4(gate_n, zero), tail) == scale_identity(0), "zero insertion") + bumped = [1, 2, 4, 8] + bumped[0] = 1 | 2 + require( + mul4(mul4(gate_n, constant_matrix(tuple(bumped))), tail) != target_p, + "I+E_01 met the pure target", + ) + return hits_i_right, hits_p_right + + +# Multivariate polynomials: tuple of exponent triples (a, b, c) for x^a y^b z^c. + + +def madd(left, right): + support = set(left) + for exp in right: + if exp in support: + support.remove(exp) + else: + support.add(exp) + return tuple(sorted(support)) + + +def mmul(left, right): + acc = {} + for a1, b1, c1 in left: + for a2, b2, c2 in right: + exp = (a1 + a2, b1 + b2, c1 + c2) + acc[exp] = acc.get(exp, 0) ^ 1 + return tuple(sorted(exp for exp, bit in acc.items() if bit)) + + +M_ONE = ((0, 0, 0),) + + +def mmono(index): + exp = [0, 0, 0] + exp[index] = 1 + return (tuple(exp),) + + +def mscale(poly, size): + return tuple( + tuple(poly if i == j else () for j in range(size)) + for i in range(size) + ) + + +def mmul_mat(left, right): + size = len(left) + out = [] + for i in range(size): + line = [] + for j in range(size): + acc = () + for k in range(size): + acc = madd(acc, mmul(left[i][k], right[k][j])) + line.append(acc) + out.append(tuple(line)) + return tuple(out) + + +def embed_bits(rows, stage): + coords = (0, 1, 2 * (stage + 1), 2 * (stage + 1) + 1) + out = [0] * 8 + for i in range(4): + for j in range(4): + if (rows[i] >> j) & 1: + out[coords[i]] |= 1 << coords[j] + return tuple(out) + + +def gate8(bit_rows, variable): + mono = mmono(variable) + matrix = [] + for i in range(8): + line = [] + for j in range(8): + entry = M_ONE if i == j else () + if (bit_rows[i] >> j) & 1: + entry = madd(entry, mono) + line.append(entry) + matrix.append(tuple(line)) + return tuple(matrix) + + +def unit8(row, col): + matrix = [[() for _ in range(8)] for _ in range(8)] + matrix[row][col] = M_ONE + return tuple(tuple(line) for line in matrix) + + +def evaluate_at_one_zero_zero(poly): + acc = 0 + for a, b, c in poly: + if b == 0 and c == 0: + acc ^= 1 + return acc + + +def multiply_all(factors): + acc = factors[0] + for factor in factors[1:]: + acc = mmul_mat(acc, factor) + return acc + + +def check_embedded_word(): + gate_n = gate8(embed_bits(N_BITS, 0), 0) + require(gate_n[0][0] == madd(M_ONE, mmono(0)), "embedded (0,0) entry") + require(all(gate_n[0][j] == () for j in range(1, 8)), "embedded row 0") + tail_factors = [gate8(embed_bits(B_BITS, 0), 0), gate8(embed_bits(C_BITS, 0), 0)] + for stage, variable in ((1, 1), (2, 2)): + for factor in (E11_BITS, E22_BITS, E33_E44_BITS): + tail_factors.append(gate8(embed_bits(factor, stage), variable)) + tail = multiply_all(tuple(tail_factors)) + pure = mmul_mat(gate_n, tail) + one_x = madd(M_ONE, mmono(0)) + one_y = madd(M_ONE, mmono(1)) + one_z = madd(M_ONE, mmono(2)) + core = mmul(one_x, mmul(one_y, one_z)) + expected_diag = { + 0: core, + 1: core, + 2: one_x, + 3: one_x, + 4: one_y, + 5: one_y, + 6: one_z, + 7: one_z, + } + for i in range(8): + for j in range(8): + expect = expected_diag[i] if i == j else () + require(pure[i][j] == expect, "embedded pure diagonal") + factor = core + extra_tails = (mscale(M_ONE, 8), unit8(2, 0)) + for row in range(8): + for col in range(8): + matrix_r = unit8(row, col) + coeff = mmul_mat(mmul_mat(gate_n, matrix_r), tail) + expect = factor if (row, col) == (0, 0) else () + require(coeff[0][0] == expect, "embedded right unit") + for extra in extra_tails: + mixed = mmul_mat(matrix_r, extra) + general = mmul_mat(mmul_mat(gate_n, matrix_r), extra) + require( + general[0][0] == mmul(madd(M_ONE, mmono(0)), mixed[0][0]), + "embedded (0,0) entry for an arbitrary tail", + ) + left = mmul_mat(unit8(row, col), pure) + left_expect = pure[col][0] if row == 0 else () + require(left[0][0] == left_expect, "embedded left unit") + summed_r = [list(row) for row in unit8(0, 0)] + summed_r[3][5] = M_ONE + summed = tuple(tuple(line) for line in summed_r) + direct = mmul_mat(mmul_mat(gate_n, summed), tail) + parts = madd( + mmul_mat(mmul_mat(gate_n, unit8(0, 0)), tail)[0][0], + mmul_mat(mmul_mat(gate_n, unit8(3, 5)), tail)[0][0], + ) + require(direct[0][0] == parts == factor, "embedded linearity") + # Column 0 of the pure-product equation forces R e_0 = e_0. It does not + # solve the other seven columns. + t = mmul(one_y, one_z) + column_forms = [{} for _ in range(8)] + for row in range(8): + for col in range(8): + coeff = mmul_mat(mmul_mat(gate_n, unit8(row, col)), tail) + for i in range(8): + if coeff[i][0]: + column_forms[i][(row, col)] = coeff[i][0] + require(column_forms[0] == {(0, 0): factor}, "column-0 form at row 0") + require( + column_forms[1] == {(1, 0): t, (2, 0): mmul(mmono(0), t)}, + "column-0 form at row 1", + ) + require(column_forms[2] == {(2, 0): t}, "column-0 form at row 2") + require(column_forms[3] == {(3, 0): t}, "column-0 form at row 3") + for i in range(4, 8): + require(column_forms[i] == {(i, 0): t}, "column-0 form at row " + str(i)) + require(evaluate_at_one_zero_zero(M_ONE) == 1, "evaluation of 1") + require(evaluate_at_one_zero_zero(one_x) == 0, "evaluation of 1+x") + require(evaluate_at_one_zero_zero(factor) == 0, "evaluation of the core factor") + require(t != (), "later-stage factor is nonzero") + return factor + + +def main(): + check_arithmetic() + gate_n, tail = check_shapes() + check_forms(gate_n, tail) + forms = forms_from_units(gate_n, tail) + solve_pure_target(forms) + check_right_identity_for_any_tail(gate_n) + hits_i, hits_p = check_constant_census(gate_n, tail) + check_embedded_word() + print( + "stage0_constant_census=65536 identity_hits=%d pure_target_hits=%d " + "embedded_units=64" + % (hits_i, hits_p) + ) + print("PASS_NONIDEMPOTENT_N_CONSTANT_INSERTION") + + +if __name__ == "__main__": + main()