From 79ff656972d66915977e816b23ffdcef42fb0e12 Mon Sep 17 00:00:00 2001 From: Ali Romman <226877337+aliromman@users.noreply.github.com> Date: Wed, 18 Nov 2026 08:43:51 -0500 Subject: [PATCH] Classify all middle factors after an idempotent of any rank --- .../idempotent-first-factor-kernel/CREDITS.md | 34 ++ .../idempotent-first-factor-kernel/PROOF.md | 197 ++++++++++++ .../idempotent-first-factor-kernel/README.md | 86 +++++ .../RESULT.json | 293 ++++++++++++++++++ .../SOURCES.json | 18 ++ .../idempotent-first-factor-kernel/TASK.json | 84 +++++ .../VALIDATION.md | 49 +++ .../VERIFY.json | 34 ++ .../idempotent-first-factor-kernel/verify.py | 280 +++++++++++++++++ 9 files changed, 1075 insertions(+) create mode 100644 research/idempotent-first-factor-kernel/CREDITS.md create mode 100644 research/idempotent-first-factor-kernel/PROOF.md create mode 100644 research/idempotent-first-factor-kernel/README.md create mode 100644 research/idempotent-first-factor-kernel/RESULT.json create mode 100644 research/idempotent-first-factor-kernel/SOURCES.json create mode 100644 research/idempotent-first-factor-kernel/TASK.json create mode 100644 research/idempotent-first-factor-kernel/VALIDATION.md create mode 100644 research/idempotent-first-factor-kernel/VERIFY.json create mode 100644 research/idempotent-first-factor-kernel/verify.py diff --git a/research/idempotent-first-factor-kernel/CREDITS.md b/research/idempotent-first-factor-kernel/CREDITS.md new file mode 100644 index 0000000000..ab2aa1b696 --- /dev/null +++ b/research/idempotent-first-factor-kernel/CREDITS.md @@ -0,0 +1,34 @@ +# Sources and attribution + +- unpaidmoon, with substantial Cursor Grok assistance as stated in the source: + [PR #7223](https://github.com/CrocSwap/integer-mult-bounds/pull/7223), + head `7a17378d02117c956ca76b8106f35b15aa34c0dc`. + The [proof](https://github.com/unpaidmoon/integer-mult-bounds/blob/7a17378d02117c956ca76b8106f35b15aa34c0dc/research/nonidempotent-middle-factor-1100/PROOF.md) + gives the all-dimension coefficient criterion BC=0 and the named rank-one + classification. Its Git blob is `ed66217bb9168670c76a245c86d96f3d8bc4af13`. + The [README](https://github.com/unpaidmoon/integer-mult-bounds/blob/7a17378d02117c956ca76b8106f35b15aa34c0dc/research/nonidempotent-middle-factor-1100/README.md) + gives the scope and next questions, blob `eff4b18ab892b2b75a309e679ac77a298dd462b3`. + These files were read. The 296-element accepted-list fingerprint is checked + by a new raw-product census. The full predecessor suite was not run. +- unpaidmoon, with substantial Cursor Grok assistance: + [PR #7040](https://github.com/CrocSwap/integer-mult-bounds/pull/7040), + head `2bac9bfafe5fa009bce2141c07b703c977b18456`. + The [proof](https://github.com/unpaidmoon/integer-mult-bounds/blob/2bac9bfafe5fa009bce2141c07b703c977b18456/research/rank1-idempotent-triple-1100/PROOF.md), + blob `902037a612824c9a460a64f38666668607577336`, supplies the orthogonal + idempotent restriction/extension bijection and earlier counts 58 and 177. + Its proof, README and verifier were read; its pair census was not rerun. +- Retained lineage, credited by these sources: the E11 slice and orthogonal + identity in [PR #7027](https://github.com/CrocSwap/integer-mult-bounds/pull/7027), + Ali Romman's paired-star coordinates in + [PR #5747](https://github.com/CrocSwap/integer-mult-bounds/pull/5747), and the + T-commuting obstruction in [PR #6956](https://github.com/CrocSwap/integer-mult-bounds/pull/6956). + Those packages are not dependencies of this verifier and were not replayed. + +The coefficient criterion and the named 296-matrix result are prior work. +The new contribution is the kernel parameterization, all-rank count and rank +distribution, and the higher-rank idempotence split. Gaussian subspace counts, +complement counts and rank-nullity are standard linear algebra, not new claims. + +No predecessor code or file is copied. The sources and this new package use +Apache-2.0. Prepared by Ali Romman with substantial OpenAI Codex assistance. +No independent human or formal-kernel review is claimed. diff --git a/research/idempotent-first-factor-kernel/PROOF.md b/research/idempotent-first-factor-kernel/PROOF.md new file mode 100644 index 0000000000..a41d5a32d5 --- /dev/null +++ b/research/idempotent-first-factor-kernel/PROOF.md @@ -0,0 +1,197 @@ +# All middle factors after an idempotent first factor + +No new kappa. This is a classification over F2 of one ordered polynomial +matrix identity. It supplies no native factor, paid-word saving, or supplier. + +Let V have dimension n, let A be an idempotent of rank r, and put +U = im(A), W = ker(A), and m = n-r. Thus V = U direct-sum W. The question is +which endomorphisms B satisfy the following identity, with x an indeterminate: + +```text +C = I + A + B, +(I + xA)(I + xB)(I + xC) = I + xI. (1) +``` + +The coefficient criterion `BC=0` is prior work: see the +[proof of PR #7223](https://github.com/unpaidmoon/integer-mult-bounds/blob/7a17378d02117c956ca76b8106f35b15aa34c0dc/research/nonidempotent-middle-factor-1100/PROOF.md). +Its named rank-one case, count 296, and three families are also prior work. +The new result here is a kernel parameterization at every rank and dimension, +with exact counts and rank distributions. In particular, higher rank permits +both B and C to be non-idempotent. + +## 1. Complete parameterization + +Choose subspaces K1 in U and K0 in W, of dimensions u and v. Put +K = K1 direct-sum K0. For each such pair, fix complements Q1 and Q0 once: + +```text +U = K1 direct-sum Q1, W = K0 direct-sum Q0. +``` + +Choose an injective linear map f1 from Q1 to K and any linear map f0 from +Q0 to K. Define B on the four summands by + +```text +B(k) = 0 for k in K, +B(q1) = f1(q1) for q1 in Q1, +B(q0) = q0 + f0(q0) for q0 in Q0. (2) +``` + +**Theorem.** With these fixed complements, (2) is a bijection onto all +solutions of (1). Its kernel is exactly K and its rank is `n-u-v`. +This includes r=0 and r=n. + +**Necessity.** The ordered coefficient expansion gives linear coefficient +`A+B+C=I`, quadratic coefficient `BC`, and cubic coefficient `A(BC)`. +Here `A^2=A` is used in the quadratic reduction. Thus (1) holds if and only +if `BC=0`, or, equivalently, `B^2+B=BA`. + +Let K=ker(B). For k in K, the last equation gives `BAk=0`. Hence K is +A-invariant. Since A is a projection, every k in K splits as Ak and +`k+Ak`, both in K, with the first in U and the second in W. Therefore +K splits uniquely as K1 direct-sum K0. Also `BC=0` says that +`v+Av+Bv` is in K for every v. On Q1 this says Bq1 is in K; on Q0 it says +`Bq0+q0` is in K. These are precisely f1 and f0 in (2). If f1(q1)=0, +then q1 is in K and in its chosen complement, so q1=0. Thus f1 is injective. +The fixed complements and B determine both maps uniquely. + +**Sufficiency.** The map in (2) has kernel K. In fact, the Q0 component +of `B(k+q1+q0)` is q0, so a zero output forces q0=0. Injectivity of f1 +then forces q1=0. To check `BC=0`, it is enough to check each summand. +For k in K, both k and Ak lie in K, so BCk=0. For q1 in Q1, +`Cq1=f1(q1)` lies in K. For q0 in Q0, `Cq0=f0(q0)` lies in K. +Thus BC=0 on V. Distinct K, f1, or f0 give distinct B by necessity. +The kernel dimension is u+v, which proves the rank formula. + +Changing the chosen complements changes the coordinates of the maps, +not the set of solutions or the count. This is a parameterization of +matrices with a fixed A. It is not a classification of pairs up to similarity. + +## 2. Exact count and rank distribution + +Write `[a b]_2` for the number of b-dimensional subspaces of F2^a. It is +zero outside `0<=b<=a`. For admissible u and v define + +```text +T(n,r;u,v) = [r u]_2 [n-r v]_2 + 2^((u+v)(n-r-v)) + product(i=0,...,r-u-1) (2^(u+v) - 2^i). +N(n,r) = sum(u=0,...,r) sum(v=0,...,n-r) T(n,r;u,v). (3) +``` + +An empty product is 1. If `r-u>u+v`, the product has a zero factor and +there is no injective f1. The two Gaussian coefficients count K1 and K0. +There are `2^((u+v)(n-r-v))` maps f0. Choose the images of an ordered +basis of Q1 successively to count the injective maps f1: the next image +must avoid the span of the images already chosen. This gives the product +in (3). The bijection proves that no matrix is counted twice. + +The number of solutions of rank s is the sum of T over `u+v=n-s`. +All these counts depend only on n and r, not on the entries of A. Indeed, +a basis of U followed by a basis of W puts A in the form `diag(I_r,0)`; +conjugation transports (1), kernels, and ranks bijectively. + +## 3. Which remaining factors are idempotent? + +On a solution, direct expansion gives + +```text +B^2+B = BA, C^2+C = AB. (4) +``` + +Thus B is idempotent if and only if U lies in K, which is `u=r`. +Its exact count is + +```text +J(n,r) = sum(v=0,...,m) [m v]_2 2^((r+v)(m-v)). (5) +``` + +The number with C idempotent is also J(n,r). To prove this without a +symmetry assumption on A, transpose and exchange B and C. The map +`(A,B,C) -> (A^T,C^T,B^T)` preserves `BC=0`, the forced sum, and the rank +of A. Apply the rank-only count from Section 2 to A^T. This is a bijection, +and exchanges idempotence of B with idempotence of the new C. + +Both are idempotent if and only if `AB=BA=0`. Such B is zero on U and +is an arbitrary idempotent on W. This restriction and extension bijection +was used in [PR #7040](https://github.com/unpaidmoon/integer-mult-bounds/blob/2bac9bfafe5fa009bce2141c07b703c977b18456/research/rank1-idempotent-triple-1100/PROOF.md). +An idempotent on W is specified by its image and a complementary kernel. +A fixed j-dimensional image has `2^(j(m-j))` complements. Hence + +```text +D(m) = sum(j=0,...,m) [m j]_2 2^(j(m-j)), +both idempotent: D(m), +only B idempotent: J(n,r)-D(m), +only C idempotent: J(n,r)-D(m), +neither idempotent: N(n,r)-2J(n,r)+D(m). (6) +``` + +For r=1, either u=1, so B is idempotent, or u=0. In the second case K +lies in W, and (2) shows that the image of B lies in W. Then AB=0 and +C is idempotent. This proves the rank-one exclusion in every dimension; +the named dimension-four exclusion is already in PR #7223. + +At rank two the exclusion fails. In row-mask notation take + +```text +A=(1,2,0,0), B=(2,0,0,0), C=(2,0,4,8). +``` + +Here A is idempotent, B is nonzero with B^2=0, and C is not idempotent. +The sum is I and BC=0, so (1) holds. It is one of 114 such solutions +among the 188 total solutions for n=4, r=2. For n=4 the totals at +r=0,1,2,3,4 are respectively `802,296,188,184,316`. +The counts with neither factor idempotent are `0,0,114,168,315`. + +These factors belong to the enlarged matrix alphabet of this problem. +They are not asserted to be admissible paid rank-one calls. + +## 4. Finite corroboration and its limits + +The proof above covers every finite dimension. The verifier supplies +separate finite evidence, with no random sampling or early stop: + +1. For `1<=n<=4` and every `0<=r<=n`, construct every parameter tuple in + (2), with a deterministic complement for each K. Check its exact kernel, + absence of duplicates, every stratum count, and the rank distribution. +2. For each of these 14 canonical first factors, enumerate every matrix B + and multiply the three polynomial matrices entry by entry. This oracle + does not use BC to compute the product. Its accepted set must equal the + constructed set. Separately check BC and both equations in (4). +3. Conjugate the n=4, r=1 construction by the involution with row masks + `(1,3,4,8)`. This sends `diag(1,0,0,0)` to the named first factor + `(1,1,0,0)` of PR #7223. Scan all 65,536 matrices for that A as well. + Its count, rank distribution and accepted-list SHA256 agree with that + predecessor. These are overlap controls, not new rank-one counts. + +The total is 395,316 raw matrix cases. All receipts are in +[RESULT.json](RESULT.json). The parameter enumeration uses subspaces and +maps; the raw oracle uses all matrix bit patterns and polynomial products. +These are two different enumeration paths. They do not constitute an +independent human or formal-kernel review. + +The rank-two witness is checked directly. A changed C and a non-idempotent +A are rejected by the raw oracle. The latter has BC=0, so it checks the +essential first-factor hypothesis. An impossible injection stratum has +zero count, and the zero matrix at A=I is assigned its full kernel, not an +incorrect smaller one. Formula nonnegativity and the rank-one exclusion +are also checked for n through 12; these arithmetic checks are not censuses. + +The order, characteristic two, and idempotence of A are essential to the +stated reduction. Other fields and other orders are outside this package. +No physical embedding, native instruction, whole caller, signed paid +invoice, or change to the selected multiplier follows. All five selected +framework assumptions remain. No predecessor full replay, selected cold +replay, Lean, Docker, independent human review, or proof-kernel check was run. + +## Credit + +The coefficient criterion and named 296-matrix classification are due to +unpaidmoon in PR #7223, with substantial Cursor Grok assistance as stated +there. PR #7040 supplies the orthogonal and one-sided idempotent counts. +The sources retain the earlier PR #7027, Ali Romman's PR #5747 paired-star +coordinates, and PR #6956 obstruction credit. See [CREDITS.md](CREDITS.md) +for exact links and scope. No predecessor code is copied. Standard linear +algebra supplies the Gaussian subspace and complement counts. + +Prepared by Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. diff --git a/research/idempotent-first-factor-kernel/README.md b/research/idempotent-first-factor-kernel/README.md new file mode 100644 index 0000000000..3a96e56833 --- /dev/null +++ b/research/idempotent-first-factor-kernel/README.md @@ -0,0 +1,86 @@ +# All-rank middle-factor classification + +No new kappa. For every idempotent A over F2, this package gives a bijection +and exact count for all matrices B such that +`(I+xA)(I+xB)(I+x(I+A+B)) = I+xI`. +The data are the A-invariant kernel of B, an injective map on one fixed +complement, and an arbitrary map on the other complement. + +The [proof](PROOF.md) covers every rank and dimension. It gives each rank +count and the numbers for which B, the forced third factor C, both, or +neither are idempotent. In dimension four, the totals for first-factor +ranks zero through four are `802,296,188,184,316`. The counts with neither +remaining factor idempotent are `0,0,114,168,315`. + +The named rank-one count 296 and its three families are already proved in +[PR #7223](https://github.com/CrocSwap/integer-mult-bounds/pull/7223). +This package credits that result and repeats it only as a source comparison. +The new all-rank parameterization includes higher-rank cases that the +rank-one exclusion does not permit. No factor is admitted as a paid call. + +## Evidence and reproduction + +Use CPython 3.12 with the standard library, from the repository root: + +```sh +python3 -B scripts/research_package.py --package research/idempotent-first-factor-kernel +python3 -I -O -W error -B research/idempotent-first-factor-kernel/verify.py +``` + +Expected direct marker: `PASS_IDEMPOTENT_FIRST_FACTOR_KERNEL raw_matrix_cases=395316`. +The registered hook runs normal and optimized checks. Failures raise exceptions. +The verifier reads only [RESULT.json](RESULT.json). It compares two different +enumerations: subspaces with maps, and every matrix bit pattern with direct +polynomial multiplication. All 14 canonical first-factor cases through +dimension four and the named source matrix are covered. It checks exact +kernels, unique parameter tuples, each count stratum, rank histograms, both +idempotence criteria, the source fingerprint, and changed-hypothesis controls. + +The finite checks corroborate the written all-dimension proof. They are not +independent human or proof-kernel review. See [VALIDATION.md](VALIDATION.md). + +## Scope and overlap + +Base: canonical main `e54523517d0f03e58352e647c403a5af3e525a57`. +The selected value remains `363005817/100000000000`; all five framework +assumptions remain. The revision-8 catalogue still has historical context; +the contextual picker detects this difference and the selected binding +check passes. It is not a full selected replay. + +Card `joint-query-controller` changes scope to one algebraic classification. +The boundary is the exact ordered polynomial identity on arbitrary vectors. +All physical realization, preparation, ownership, restoration and complete +recursive prices are unknown. Stop at the classification; no supplier +expansion follows from these matrix counts. + +The [scoped claim](https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19709190) +records the change. The 2026-11-18 refresh searched 1,003 open PRs and 7,645 +Discussion records with complete pagination. Phrase search found PR #7223, +which reference-only intake missed because its body does not name its +predecessor. Its proof and open questions were read before the claim. +The complete closed cache contains 6,175 records; a fresh updated-order +check found no closed update after that cache. No all-rank kernel result +was found. Sparse local notes, unpublished work and semantic search limits +prevent a novelty guarantee. + +Before submission, Discussion refresh completed but the full open-PR refresh +timed out and retained its earlier cache. A separate updated-order page of +100 open PRs covers every update since that cache. Its four changed records +are this chat's prior result, two banked-circuit improvements and a Lean +proof link; none classifies these middle factors. The pinned PR #7223 head +was also read back and is unchanged. + +## Open next questions + +Which classified higher-rank factors have an admitted implementation in +an actual paired-star caller? Pin one caller and one rank-two witness. +Check its arbitrary-input action and all preparation, storage, restoration +and paid costs. The missing native implementation and consumer contract +block any saving claim. This question is not reserved. + +## Credit + +[CREDITS.md](CREDITS.md) pins the proofs by unpaidmoon and retains their +source lineage. Standard linear algebra supplies the subspace and complement +counts. No source code is copied. Prepared by Ali Romman with substantial +OpenAI Codex assistance. Apache-2.0. diff --git a/research/idempotent-first-factor-kernel/RESULT.json b/research/idempotent-first-factor-kernel/RESULT.json new file mode 100644 index 0000000000..3a8f89cc70 --- /dev/null +++ b/research/idempotent-first-factor-kernel/RESULT.json @@ -0,0 +1,293 @@ +{ + "canonical_censuses": [ + { + "n": 1, + "rank_A": 0, + "total": 2, + "rank_B": [ + 1, + 1 + ], + "both_idempotent": 2, + "only_B_idempotent": 0, + "only_C_idempotent": 0, + "neither_idempotent": 0, + "matrices": 2, + "rejected": 0, + "accepted_sha256": "82c1315e6c757f33c4a77ca58b2a184f5a88614470c05ec77f3d28918db6b8ae" + }, + { + "n": 1, + "rank_A": 1, + "total": 1, + "rank_B": [ + 1, + 0 + ], + "both_idempotent": 1, + "only_B_idempotent": 0, + "only_C_idempotent": 0, + "neither_idempotent": 0, + "matrices": 2, + "rejected": 1, + "accepted_sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "n": 2, + "rank_A": 0, + "total": 8, + "rank_B": [ + 1, + 6, + 1 + ], + "both_idempotent": 8, + "only_B_idempotent": 0, + "only_C_idempotent": 0, + "neither_idempotent": 0, + "matrices": 16, + "rejected": 8, + "accepted_sha256": "ec6a5661d084fd617be71f4a10dc0b55bd9e532d22de48442bbe9e2a6ad0b9b6" + }, + { + "n": 2, + "rank_A": 1, + "total": 4, + "rank_B": [ + 1, + 3, + 0 + ], + "both_idempotent": 2, + "only_B_idempotent": 1, + "only_C_idempotent": 1, + "neither_idempotent": 0, + "matrices": 16, + "rejected": 12, + "accepted_sha256": "2c640d878988776a7c8a67eadaa5750804f3e081098d0ab9f4d4c7a4acbb96bd" + }, + { + "n": 2, + "rank_A": 2, + "total": 4, + "rank_B": [ + 1, + 3, + 0 + ], + "both_idempotent": 1, + "only_B_idempotent": 0, + "only_C_idempotent": 0, + "neither_idempotent": 3, + "matrices": 16, + "rejected": 12, + "accepted_sha256": "efaa24bcfed4f4d2f7a57841fd3581e217178587e5673feba099d7eae73e964f" + }, + { + "n": 3, + "rank_A": 0, + "total": 58, + "rank_B": [ + 1, + 28, + 28, + 1 + ], + "both_idempotent": 58, + "only_B_idempotent": 0, + "only_C_idempotent": 0, + "neither_idempotent": 0, + "matrices": 512, + "rejected": 454, + "accepted_sha256": "5d149d5f165cc131c5684f774013bb238fc53a6619d01cbff295d1d123f78dd5" + }, + { + "n": 3, + "rank_A": 1, + "total": 26, + "rank_B": [ + 1, + 15, + 10, + 0 + ], + "both_idempotent": 8, + "only_B_idempotent": 9, + "only_C_idempotent": 9, + "neither_idempotent": 0, + "matrices": 512, + "rejected": 486, + "accepted_sha256": "9bb55dcc56f7908ead42a3f9ee18f2fb8f0ebfa3099d73d1bd195fe7e245dfff" + }, + { + "n": 3, + "rank_A": 2, + "total": 20, + "rank_B": [ + 1, + 13, + 6, + 0 + ], + "both_idempotent": 2, + "only_B_idempotent": 3, + "only_C_idempotent": 3, + "neither_idempotent": 12, + "matrices": 512, + "rejected": 492, + "accepted_sha256": "027674f6afa85f0e3c6ea2d1d401cee1a7cc78ccd51edc84f14840247849a485" + }, + { + "n": 3, + "rank_A": 3, + "total": 22, + "rank_B": [ + 1, + 21, + 0, + 0 + ], + "both_idempotent": 1, + "only_B_idempotent": 0, + "only_C_idempotent": 0, + "neither_idempotent": 21, + "matrices": 512, + "rejected": 490, + "accepted_sha256": "4d142e66a7335e32f6b9fb5498a021fc5cc1dc257e9b3796af62681b227c3b5b" + }, + { + "n": 4, + "rank_A": 0, + "total": 802, + "rank_B": [ + 1, + 120, + 560, + 120, + 1 + ], + "both_idempotent": 802, + "only_B_idempotent": 0, + "only_C_idempotent": 0, + "neither_idempotent": 0, + "matrices": 65536, + "rejected": 64734, + "accepted_sha256": "29ec89b1dfe613bbcba0fc39a7754f92a4d9b60ec7bc001ba33bbfd0db423593" + }, + { + "n": 4, + "rank_A": 1, + "total": 296, + "rank_B": [ + 1, + 63, + 196, + 36, + 0 + ], + "both_idempotent": 58, + "only_B_idempotent": 119, + "only_C_idempotent": 119, + "neither_idempotent": 0, + "matrices": 65536, + "rejected": 65240, + "accepted_sha256": "73ce9f1c7ad19ecfdebcce98eb7ee6d54ab0b9723a921ceabee9537f370cb7bd" + }, + { + "n": 4, + "rank_A": 2, + "total": 188, + "rank_B": [ + 1, + 45, + 130, + 12, + 0 + ], + "both_idempotent": 8, + "only_B_idempotent": 33, + "only_C_idempotent": 33, + "neither_idempotent": 114, + "matrices": 65536, + "rejected": 65348, + "accepted_sha256": "d3e437545cc1d1f65de887da55773c8495f7d2fb29ced77022782c2bd541cfa8" + }, + { + "n": 4, + "rank_A": 3, + "total": 184, + "rank_B": [ + 1, + 57, + 126, + 0, + 0 + ], + "both_idempotent": 2, + "only_B_idempotent": 7, + "only_C_idempotent": 7, + "neither_idempotent": 168, + "matrices": 65536, + "rejected": 65352, + "accepted_sha256": "6a60528f497561a5acb4da3bc4fdb64041231ede631357445a7388b2d8e3a4ba" + }, + { + "n": 4, + "rank_A": 4, + "total": 316, + "rank_B": [ + 1, + 105, + 210, + 0, + 0 + ], + "both_idempotent": 1, + "only_B_idempotent": 0, + "only_C_idempotent": 0, + "neither_idempotent": 315, + "matrices": 65536, + "rejected": 65220, + "accepted_sha256": "fd07880a42e1835f3910ab11f38397b43694bdaf341ae25195c0c70565abd71c" + } + ], + "named_census": { + "total": 296, + "rank_B": [ + 1, + 63, + 196, + 36, + 0 + ], + "both_idempotent": 58, + "only_B_idempotent": 119, + "only_C_idempotent": 119, + "neither_idempotent": 0, + "matrices": 65536, + "rejected": 65240, + "accepted_sha256": "07a59d5644b30bf5c78ec67fd58bdee01cc1048fc5dc20ea574fffe3e4ec5659" + }, + "rank_two_witness": { + "A": [ + 1, + 2, + 0, + 0 + ], + "B": [ + 2, + 0, + 0, + 0 + ], + "C": [ + 2, + 0, + 4, + 8 + ] + }, + "formula_domain": "1 <= n <= 12, 0 <= r <= n", + "scope": "All-rank proof; complete raw-product censuses only through n=4." +} diff --git a/research/idempotent-first-factor-kernel/SOURCES.json b/research/idempotent-first-factor-kernel/SOURCES.json new file mode 100644 index 0000000000..5335fa97d9 --- /dev/null +++ b/research/idempotent-first-factor-kernel/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/idempotent-first-factor-kernel/TASK.json b/research/idempotent-first-factor-kernel/TASK.json new file mode 100644 index 0000000000..d2be9013ca --- /dev/null +++ b/research/idempotent-first-factor-kernel/TASK.json @@ -0,0 +1,84 @@ +{ + "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": "Classify all middle factors in the ordered three-factor identity after any idempotent first factor over F2, at every rank and dimension.", + "scope_change_reason": "The named rank-one census is already covered by PR7223. The new kernel parameterization determines the whole higher-rank alphabet and identifies cases where neither remaining factor is idempotent.", + "bottleneck_link": "It identifies which formal matrix factorizations leave the idempotent call alphabet. It does not provide a native caller or a paid saving.", + "budget_minutes": 60, + "stop_rule": "Stop after the all-rank proof, complete small-matrix comparison, and source-bound handoff. Native costs remain unknown.", + "outcome": "completed", + "evidence": "PROOF.md; RESULT.json; complete parameter and raw polynomial enumerations; exact source-fingerprint and changed-hypothesis controls.", + "author": "Ali Romman", + "ai_assistance": "Substantial OpenAI Codex assistance. No independent human or formal-kernel review is claimed.", + "open_questions": [ + { + "question": "Which classified higher-rank factors have an admitted implementation in an actual paired-star caller?", + "why_it_matters": "The formal matrix alphabet is larger than the paid-call alphabet. A factorization alone does not save work.", + "first_step": "Pin one caller and one rank-two witness; test its arbitrary-input action and give a complete preparation, storage, restoration and paid invoice.", + "blocked_by": "No native implementation or complete consumer contract is supplied." + } + ] +} diff --git a/research/idempotent-first-factor-kernel/VALIDATION.md b/research/idempotent-first-factor-kernel/VALIDATION.md new file mode 100644 index 0000000000..9aa5ede16f --- /dev/null +++ b/research/idempotent-first-factor-kernel/VALIDATION.md @@ -0,0 +1,49 @@ +# Validation record + +Environment: CPython 3.12.16, macOS arm64, standard library only. +Base: `e54523517d0f03e58352e647c403a5af3e525a57`. + +The following command passed in normal and optimized isolated modes: + +```sh +python3 -B scripts/research_package.py --package research/idempotent-first-factor-kernel +``` + +Both direct runs printed: + +```text +PASS_IDEMPOTENT_FIRST_FACTOR_KERNEL raw_matrix_cases=395316 +``` + +The registered marker was `PASS_REGISTERED_RESEARCH_PACKAGE` with +`outcome=completed`. AST parsing and `tabnanny` also passed. + +The complete domains are 14 canonical first factors: every rank at each +dimension from one through four. Each case enumerates all `2^(n^2)` +middle matrices. The named source matrix adds 65,536 cases. No matrix is +sampled and there is no early exit. Every accepted set equals a second +construction from subspaces, fixed complements and maps. Each kernel, +duplicate check, count stratum, rank distribution and idempotence class +is checked. The named accepted-list SHA256 agrees with the pinned PR #7223 +receipt. The formula checks through dimension 12 are arithmetic checks, +not full matrix censuses. + +Controls check a changed third factor, a non-idempotent first factor, +an impossible injection dimension and the exact kernel of the zero map. +The rank-two witness demonstrates the failure of the rank-one exclusion. +All checks raise exceptions and remain active under `-O`. + +The all-dimension claim rests on the proof in [PROOF.md](PROOF.md), not +on extrapolation from these finite checks. No code from the predecessor +is imported. Its coefficient lemma and named result are credited inputs. + +The selected binding-only check passed; it is not a full selected replay. +No complete predecessor replay, native or physical replay, selected cold +replay, Lean, Docker, independent human review or proof-kernel check was run. +The exact order, F2 coefficients and first-factor idempotence remain premises. +No paid profile, supplier admission, full multiplication theorem or new +kappa is claimed. All five selected assumptions remain. + +Commit-byte, source-history, export, sealed replay and publication checks +are recorded separately in the PR description. Hosted CI status is also +reported separately and does not replace the local scientific evidence. diff --git a/research/idempotent-first-factor-kernel/VERIFY.json b/research/idempotent-first-factor-kernel/VERIFY.json new file mode 100644 index 0000000000..20c84feb53 --- /dev/null +++ b/research/idempotent-first-factor-kernel/VERIFY.json @@ -0,0 +1,34 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Compare complete kernel constructions with raw polynomial multiplication on 395316 matrices; check stratum, rank and idempotence counts, source fingerprint and hypothesis controls." + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "-O", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Compare complete kernel constructions with raw polynomial multiplication on 395316 matrices; check stratum, rank and idempotence counts, source fingerprint and hypothesis controls." + } + ] +} diff --git a/research/idempotent-first-factor-kernel/verify.py b/research/idempotent-first-factor-kernel/verify.py new file mode 100644 index 0000000000..de5f316834 --- /dev/null +++ b/research/idempotent-first-factor-kernel/verify.py @@ -0,0 +1,280 @@ +#!/usr/bin/env python3 +"""Check the kernel classification with two finite constructions.""" + +from collections import Counter +from functools import cache +from hashlib import sha256 +from itertools import product +import json +from pathlib import Path +import sys + + +def require(ok, message): + if not ok: + raise ValueError(message) + + +def apply(matrix, vector): + return sum(((row & vector).bit_count() % 2) << i + for i, row in enumerate(matrix)) + + +def mul(left, right): + out = [] + for row in left: + value = 0 + for j, other in enumerate(right): + if row >> j & 1: + value ^= other + out.append(value) + return tuple(out) + + +def add(*matrices): + out = [0] * len(matrices[0]) + for matrix in matrices: + out = [a ^ b for a, b in zip(out, matrix)] + return tuple(out) + + +def identity(n): + return tuple(1 << i for i in range(n)) + + +def rows(code, n): + return tuple((code >> (n * i)) & ((1 << n) - 1) for i in range(n)) + + +def code(matrix): + return sum(row << (len(matrix) * i) for i, row in enumerate(matrix)) + + +def span(vectors): + values = {0} + for vector in vectors: + values |= {x ^ vector for x in values} + return frozenset(values) + + +@cache +def subspaces(n): + found = {frozenset({0})} + pending = [frozenset({0})] + while pending: + space = pending.pop() + for vector in range(1, 1 << n): + if vector in space: + continue + extended = space | {x ^ vector for x in space} + if extended not in found: + found.add(extended) + pending.append(extended) + return tuple(sorted(found, key=lambda s: (len(s), sorted(s)))) + + +def basis(space): + out = [] + known = frozenset({0}) + for vector in sorted(space): + if vector not in known: + out.append(vector) + known = span(out) + return tuple(out) + + +def complement(space, n): + known = space + out = [] + for i in range(n): + vector = 1 << i + if vector not in known: + out.append(vector) + known |= {x ^ vector for x in known} + require(len(known) == 1 << n, 'complement does not span') + return tuple(out) + + +def from_basis(domain, images, n): + table = {0: 0} + for vector, image in zip(domain, images): + require(vector not in table, 'domain is not a basis') + table.update({x ^ vector: y ^ image for x, y in list(table.items())}) + require(len(table) == 1 << n, 'domain misses a coordinate') + return tuple(sum(((table[1 << j] >> i) & 1) << j for j in range(n)) + for i in range(n)) + + +def construct(n, r): + """Use fixed complements for every invariant kernel. Keep no duplicates.""" + built = {} + for ku in subspaces(r): + for small_kw in subspaces(n - r): + kw = frozenset(x << r for x in small_kw) + kernel = frozenset(x ^ y for x in ku for y in kw) + q1 = complement(ku, r) + q0 = tuple(x << r for x in complement(small_kw, n - r)) + kb = basis(ku) + basis(kw) + values = sorted(kernel) + for f1 in product(values, repeat=len(q1)): + if len(span(f1)) != 1 << len(q1): + continue + for f0 in product(values, repeat=len(q0)): + matrix = from_basis(kb + q1 + q0, + (0,) * len(kb) + f1 + + tuple(x ^ y for x, y in zip(q0, f0)), n) + require(matrix not in built, 'parameterization repeats a matrix') + actual = frozenset(x for x in range(1 << n) if not apply(matrix, x)) + require(actual == kernel, 'constructed kernel differs') + built[matrix] = (len(ku).bit_length() - 1, + len(kw).bit_length() - 1) + return built + + +@cache +def gaussian(n, k): + if k < 0 or k > n: + return 0 + if k in (0, n): + return 1 + return gaussian(n - 1, k) + (1 << (n - k)) * gaussian(n - 1, k - 1) + + +def parameter_count(n, r, u, v): + injections = 1 + for i in range(r - u): + injections *= (1 << (u + v)) - (1 << i) + return (gaussian(r, u) * gaussian(n - r, v) + * (1 << ((u + v) * (n - r - v))) * injections) + + +def counts(n, r): + by_rank = [0] * (n + 1) + for u in range(r + 1): + for v in range(n - r + 1): + by_rank[n - u - v] += parameter_count(n, r, u, v) + one = sum(parameter_count(n, r, r, v) for v in range(n - r + 1)) + m = n - r + both = sum(gaussian(m, j) * (1 << (j * (m - j))) for j in range(m + 1)) + total = sum(by_rank) + return {'total': total, 'rank_B': by_rank, 'both_idempotent': both, + 'only_B_idempotent': one - both, 'only_C_idempotent': one - both, + 'neither_idempotent': total - 2 * one + both} + + +def polynomial_product(a, b, c): + """Multiply entry polynomials directly, without the coefficient criterion.""" + n = len(a) + acc = [[int(i == j) for j in range(n)] for i in range(n)] + for matrix in (a, b, c): + out = [[0] * n for _ in range(n)] + for i in range(n): + for k in range(n): + value = acc[i][k] + out[i][k] ^= value + for j in range(n): + if matrix[k] >> j & 1: + out[i][j] ^= value << 1 + acc = out + return tuple(tuple(row) for row in acc) + + +def target(n): + return tuple(tuple(3 * int(i == j) for j in range(n)) for i in range(n)) + + +def census(a, expected): + n = len(a) + eye, zero = identity(n), (0,) * n + accepted = set() + hist = Counter() + ranks = Counter() + failures = Counter() + for integer in range(1 << (n * n)): + b = rows(integer, n) + c = add(eye, a, b) + raw = polynomial_product(a, b, c) == target(n) + reduced = mul(b, c) == zero + require(raw == reduced, 'raw polynomial product differs from BC criterion') + require(raw == (b in expected), 'kernel construction differs from raw product') + if not raw: + failures['rejected'] += 1 + continue + accepted.add(b) + idem_b, idem_c = mul(b, b) == b, mul(c, c) == c + require(idem_b == (mul(b, a) == zero), 'B idempotence criterion') + require(idem_c == (mul(a, b) == zero), 'C idempotence criterion') + hist[f'{int(idem_b)}{int(idem_c)}'] += 1 + rank = len({apply(b, x) for x in range(1 << n)}).bit_length() - 1 + ranks[rank] += 1 + integers = sorted(code(b) for b in accepted) + digest = sha256(''.join(f'{i}\n' for i in integers).encode()).hexdigest() + actual = {'total': len(accepted), 'rank_B': [ranks[i] for i in range(n + 1)], + 'both_idempotent': hist['11'], 'only_B_idempotent': hist['10'], + 'only_C_idempotent': hist['01'], 'neither_idempotent': hist['00']} + return actual | {'matrices': 1 << (n * n), 'rejected': failures['rejected'], + 'accepted_sha256': digest} + + +def run(): + receipts = [] + for n in range(1, 5): + for r in range(n + 1): + a = tuple(1 << i if i < r else 0 for i in range(n)) + built = construct(n, r) + actual = census(a, built) + formula = counts(n, r) + require(all(actual[k] == value for k, value in formula.items()), 'count formula') + strata = Counter(built.values()) + for u in range(r + 1): + for v in range(n - r + 1): + require(strata[u, v] == parameter_count(n, r, u, v), 'kernel stratum count') + receipts.append({'n': n, 'rank_A': r, **actual}) + p = (1, 3, 4, 8) + named = (1, 1, 0, 0) + require(mul(p, p) == identity(4), 'named basis is not its own inverse') + require(mul(mul(p, (1, 0, 0, 0)), p) == named, 'named basis does not conjugate A') + transported = {mul(mul(p, b), p) for b in construct(4, 1)} + named_result = census(named, transported) + require(named_result['accepted_sha256'] == + '07a59d5644b30bf5c78ec67fd58bdee01cc1048fc5dc20ea574fffe3e4ec5659', + 'PR7223 named-matrix fingerprint differs') + + # Rank two permits two non-idempotent remaining factors. + a, b = (1, 2, 0, 0), (2, 0, 0, 0) + c = add(identity(4), a, b) + require(polynomial_product(a, b, c) == target(4), 'rank-two witness misses target') + require(mul(b, b) != b and mul(c, c) != c, 'rank-two witness is not discriminating') + require(polynomial_product(a, b, add(c, (1, 0, 0, 0))) != target(4), 'changed C accepted') + require(polynomial_product(b, (0,) * 4, add(identity(4), b)) != target(4), + 'non-idempotent A control accepted') + # Non-injective f1 enlarges the declared kernel and must not be counted there. + require(parameter_count(4, 2, 0, 0) == 0, 'impossible injection counted') + require((0, 0, 0, 0) in construct(4, 4), 'zero map missing at A=I') + require(construct(4, 4)[(0, 0, 0, 0)] == (4, 0), 'zero map assigned wrong kernel') + for n in range(1, 13): + for r in range(n + 1): + result = counts(n, r) + require(all(v >= 0 for k, v in result.items() if k != 'rank_B'), 'negative class count') + if r == 1: + require(result['neither_idempotent'] == 0, 'rank-one specialization') + return {'canonical_censuses': receipts, 'named_census': named_result, + 'rank_two_witness': {'A': a, 'B': b, 'C': c}, + 'formula_domain': '1 <= n <= 12, 0 <= r <= n', + 'scope': 'All-rank proof; complete raw-product censuses only through n=4.'} + + +def main(): + result = json.loads(json.dumps(run())) + if sys.argv[1:] == ['--emit']: + print(json.dumps(result, indent=2)) + return + require(not sys.argv[1:], 'unknown arguments') + expected = json.loads(Path(__file__).with_name('RESULT.json').read_text()) + require(result == expected, 'receipt differs') + visits = sum(r['matrices'] for r in result['canonical_censuses']) + result['named_census']['matrices'] + print('PASS_IDEMPOTENT_FIRST_FACTOR_KERNEL', 'raw_matrix_cases=' + str(visits)) + + +if __name__ == '__main__': + main()