From 030ecb77c63a4bcc0fb5286cee9e42e856975da3 Mon Sep 17 00:00:00 2001 From: Ali Romman <226877337+aliromman@users.noreply.github.com> Date: Wed, 18 Nov 2026 20:12:45 -0500 Subject: [PATCH] Classify all three-relation words on the four-projector maximizer --- .../one-edge-word-obstruction/.gitattributes | 1 + research/one-edge-word-obstruction/CREDITS.md | 37 ++ research/one-edge-word-obstruction/PROOF.md | 218 ++++++++++ research/one-edge-word-obstruction/README.md | 35 ++ .../one-edge-word-obstruction/RESULT.json | 75 ++++ .../SOURCE-PINS.json | 69 ++++ .../one-edge-word-obstruction/SOURCES.json | 18 + research/one-edge-word-obstruction/TASK.json | 70 ++++ .../one-edge-word-obstruction/VERIFY.json | 32 ++ .../retained/augmentation-PROOF.md | 246 ++++++++++++ .../retained/maximizer/README.md | 108 +++++ .../retained/maximizer/SOURCES.json | 18 + .../retained/maximizer/TASK.json | 89 ++++ .../retained/maximizer/VERIFY.json | 28 ++ .../retained/maximizer/verify.py | 76 ++++ .../retained/seven-call-CREDITS.md | 32 ++ .../retained/seven-call-verify.py | 380 ++++++++++++++++++ research/one-edge-word-obstruction/verify.py | 318 +++++++++++++++ 18 files changed, 1850 insertions(+) create mode 100644 research/one-edge-word-obstruction/.gitattributes create mode 100644 research/one-edge-word-obstruction/CREDITS.md create mode 100644 research/one-edge-word-obstruction/PROOF.md create mode 100644 research/one-edge-word-obstruction/README.md create mode 100644 research/one-edge-word-obstruction/RESULT.json create mode 100644 research/one-edge-word-obstruction/SOURCE-PINS.json create mode 100644 research/one-edge-word-obstruction/SOURCES.json create mode 100644 research/one-edge-word-obstruction/TASK.json create mode 100644 research/one-edge-word-obstruction/VERIFY.json create mode 100644 research/one-edge-word-obstruction/retained/augmentation-PROOF.md create mode 100644 research/one-edge-word-obstruction/retained/maximizer/README.md create mode 100644 research/one-edge-word-obstruction/retained/maximizer/SOURCES.json create mode 100644 research/one-edge-word-obstruction/retained/maximizer/TASK.json create mode 100644 research/one-edge-word-obstruction/retained/maximizer/VERIFY.json create mode 100644 research/one-edge-word-obstruction/retained/maximizer/verify.py create mode 100644 research/one-edge-word-obstruction/retained/seven-call-CREDITS.md create mode 100644 research/one-edge-word-obstruction/retained/seven-call-verify.py create mode 100644 research/one-edge-word-obstruction/verify.py diff --git a/research/one-edge-word-obstruction/.gitattributes b/research/one-edge-word-obstruction/.gitattributes new file mode 100644 index 0000000000..130a3ecaa2 --- /dev/null +++ b/research/one-edge-word-obstruction/.gitattributes @@ -0,0 +1 @@ +retained/** -text whitespace=cr-at-eol diff --git a/research/one-edge-word-obstruction/CREDITS.md b/research/one-edge-word-obstruction/CREDITS.md new file mode 100644 index 0000000000..0525099427 --- /dev/null +++ b/research/one-edge-word-obstruction/CREDITS.md @@ -0,0 +1,37 @@ +# Sources and credit + +Ali Romman (@aliromman) prepared this proof, exact checker and package +with substantial OpenAI Codex assistance. New material is Apache-2.0. +No independent human or formal proof-kernel acceptance is claimed. + +Nick Petalas (@petalas) supplied the four-projector alphabet and its paid-word +question in [PR #7749](https://github.com/CrocSwap/integer-mult-bounds/pull/7749), +at the [source proof](https://github.com/petalas/integer-mult-bounds/blob/6bd8a384d64b6da2334bc94f6a97cdd74d710780/research/even-one-edge-maximizer/README.md) +and [unchanged checker](https://github.com/petalas/integer-mult-bounds/blob/6bd8a384d64b6da2334bc94f6a97cdd74d710780/research/even-one-edge-maximizer/verify.py). +All five package files are retained byte-exact. The word proof uses the +displayed matrices directly; it does not require a new geometric maximum. +The source notices credit Ali Romman's +[PR #7707](https://github.com/CrocSwap/integer-mult-bounds/pull/7707) +and [PR #7692](https://github.com/CrocSwap/integer-mult-bounds/pull/7692) +for the comparison pool, even maximum and matching theorem. + +The paid-generated augmentation and commutator approach follows +[PR #7711](https://github.com/CrocSwap/integer-mult-bounds/pull/7711), +[retained proof](https://github.com/aliromman/integer-mult-bounds/blob/ac185e4529a01156f7b574555b50827f8cb645bb/research/shared-hub-triple-word-obstruction/PROOF.md). +Its notices credit Jerry Jiaheng Chen (@CubeJerry) and +[PR #6782](https://github.com/CrocSwap/integer-mult-bounds/pull/6782) +for augmentation chronology. The matrices and chronology conditions here +are for the distinct four-projector alphabet. + +The finite Laurent engines adapt +[PR #7763](https://github.com/CrocSwap/integer-mult-bounds/pull/7763), +[retained checker](https://github.com/aliromman/integer-mult-bounds/blob/3cb09504f8c1b6b728d8ce90b76ff938c06fbe5d/research/shared-hub-seven-call/verify.py) +and [retained credit](https://github.com/aliromman/integer-mult-bounds/blob/3cb09504f8c1b6b728d8ce90b76ff938c06fbe5d/research/shared-hub-seven-call/CREDITS.md). +That notice retains Nick Petalas's earlier bit-encoded Laurent method. +These two files are credit dependencies; the seven-call replay is not run. + +The new result is the private-writer lemma and the all-length three-relation +classification, with exact R/S cancellation and a complete rank-power +inequality. `SOURCE-PINS.json` authenticates all eight retained files. +`SOURCES.json` records canonical main selection and catalogue provenance. +Content pins do not assert unmerged ancestry. diff --git a/research/one-edge-word-obstruction/PROOF.md b/research/one-edge-word-obstruction/PROOF.md new file mode 100644 index 0000000000..7a4da67cec --- /dev/null +++ b/research/one-edge-word-obstruction/PROOF.md @@ -0,0 +1,218 @@ +# Three relations leave only two productive labels + +Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. + +Use Nick Petalas's alphabet from +[PR #7749](https://github.com/CrocSwap/integer-mult-bounds/pull/7749), +in coordinates a,b,f,g: + +```text +P=(1,3), Q=(3,2), R=(5,9), S=(11,6). +``` + +The pair (x,y) denotes xy^T over F2. Each call is I+([z]-1)A for one +of these projectors. Its label z belongs to the torsion-free abelian +group H generated by all m paid labels. Equivalently H=Z^m/L, with +L saturated. Later calls act on the left. Every type is present, every +paid label is nonzero, and rank(L)<=3. Require a diagonal endpoint on +all four original coordinates; arbitrary changes of register basis +are not included. + +**Theorem.** The word is diagonal exactly when its chronology satisfies +the following three conditions and its exact type totals satisfy (1). + +1. No P or Q call lies between the first and last R calls. +2. No Q call lies between the first and last S calls. +3. After deleting P and Q, the R/S word has at most three runs. Thus one + type is a single block inside the other type, or the types form two blocks. + +```text +total(P)=total(Q)=u, total(R)=total(S)=0. (1) +``` + +The full endpoint is diag([u],[u],1,1). The two fresh coordinates have +identity targets. This classification holds at every finite word length +under the stated three-relation contract. + +For rational matrix labels and every 0=2. The off-patterns have exactly three independent generators: +off(P)=off(Q), off(R), off(S). The degree-one off-diagonal endpoint +therefore forces + +```text +sum(P forms)=sum(Q forms)=u, +sum(R forms)=0, sum(S forms)=0. (2) +``` + +These are three independent relations among the m call variables before +quotient. Since H is paid-generated and L is saturated, its degree-one +augmentation space has dimension m-rank(L), and its graded algebra is +the polynomial ring on that space. The limit rank(L)<=3 makes (2) the +complete set of degree-one relations; rank(L)=3 in every diagonal case. + +Choose the common u, all but one variable of each P and Q type, and all +but one variable of each R and S type as coordinates. The P variables +are a basis of their p-dimensional span; the Q variables are a basis of +their q-dimensional span. The R variables have exactly one dependence, +their full sum zero, and the same is true of S. The R and S variable +spaces are disjoint from each other and from the P/Q variable spaces. +The latter two share only u. + +This is a statement about the paid-generated group. An unrelated larger +ambient exponent group must not supply the augmentation coordinates. +Nor does degree one alone imply the exact integral identities (1). + +## 3. Four commutators force the chronology + +P,Q are orthogonal, as are P,S. The remaining four off-commutators +[P,R], [Q,R], [Q,S], [R,S] are independent modulo the pattern span. +Here [A,B]=AB+BA. The following finite certificate uses bit 4i+j for +matrix entry (i,j), after deleting the diagonal: + +| Row | Hexadecimal encoding | +| --- | --- | +| off(P) | 0002 | +| off(R) | 0908 | +| off(S) | 6046 | +| off([P,R]) | 030a | +| off([Q,R]) | 0202 | +| off([Q,S]) | 2044 | +| off([R,S]) | 1098 | + +Row elimination gives 6046,2044,1098,0908,030a,0108,0002, with distinct +leading positions 14,13,12,11,9,8,1. Thus all seven rows are independent. +The checker also tests all 127 nonempty subsets. + +Compare the candidate chronology with the order P then Q then R then S. +The reference word's degree-two off-diagonal part lies in the pattern +span: its R/S totals have zero degree-one part, and P,Q commute. Each +interchange of two calls contributes the product of their linear forms +times the corresponding commutator. Independence makes each of the four +inversion polynomials zero. + +For P/R, that polynomial is the sum over P calls of its variable times +the sum of variables of all earlier R calls. Independence of the P +variables and their products with the disjoint R space makes each such +R subset sum zero. The R variables have no proper nonempty zero-sum +subset. Hence each P call is before every R or after every R. The Q/R +and Q/S polynomials give the corresponding statements for Q. These +are conditions 1 and 2. + +For R/S, form the r-by-s binary matrix M with entry one when S_j is +before R_i. The map from its rows and columns to the R/S variable +spaces has all-one kernels. Its tensor image is zero exactly when + +```text +M_ij = alpha_i + beta_j. +``` + +One can check this by eliminating the last variable on each side: every +remaining coefficient is M_ij+M_i,s+M_r,j+M_r,s. In chronological order, +each row of M is a prefix of ones among the S calls. Two rows can differ +only by zero or by the all-one row. If one prefix is proper and nonempty, +every row has that same prefix, so all R calls form a single R block +between S blocks. Otherwise the prefixes are empty or full, so all S +calls form a single S block between R blocks. This is condition 3. + +## 4. Exact cancellation, not just parity + +If R is the inner block of the R/S chronology, conditions 1 and 3 make +its calls consecutive: neither P,Q nor S can occur between them. Combine +them into one call at their exact sum. Section 1 forces that sum to be +zero, so the block is identity. Only P can remain between S calls, by +condition 2. P commutes with S, so combine the S calls and use the same +private-row argument to force their exact total to zero. + +If S is the inner block, condition 2 excludes Q and condition 3 excludes +R from its interval. Commute P past S and combine the S calls first. +Their total is zero by Section 1. Condition 1 then lets the R calls +combine, and their total is zero too. The same reasoning covers two +disjoint blocks. + +Only P and Q remain. They commute and their product on a,b is + +```text +[ [v], [v]+[w] ] +[ 0, [w] ], +``` + +where v and w are their exact totals. Diagonality forces [v]=[w], hence +v=w=u. This proves (1), necessity and the full endpoint. Conversely, +the same block reduction proves sufficiency from conditions 1--3 and (1). + +Give the first target all P paid labels and the second target all Q paid +labels. Give the two identity targets empty subsets. Rank subadditivity, +monotonicity and subadditivity of x^t for 0=1 and r,s>=2 are checked. +Recursive type-word generation and a separate position-subset enumeration +agree on every domain and its multinomial count. The 108,904 words each +receive an exact quadratic chronology check and a full Laurent matrix +product. Exactly 8,412 are diagonal, all with the stated four entries. +The minimal domain (1,1,2,2) has 46 passing orders out of 180. + +The label fixtures use the universal exact quotient of (1). Every private +basis vector is a paid label, and u is an integral sum of P labels, which +authenticates the paid-generated free group and saturated three-relation +kernel. For these fixtures each exponent-support coordinate has width at +most two. Base-three substitution is injective on the whole support box. +A separate multivariate set engine checks 175 complete products. + +Four hundred conjugated single-writer words check the private-row +obstruction, including nonzero even labels. Three nonzero even changes +to Q, R and S totals preserve the quadratic check but fail the exact +endpoint; a separate multivariate product checks each fault. This marks +why parity is insufficient. All eight retained files are authenticated, +and the PR7749 geometry verifier runs unchanged. + +The all-length statement is the written proof, not a finite census of +all saturated lattices. More than three relations, changed projector +pools, arbitrary register bases, native implementation, physical storage +and restoration, and the complete caller invoice remain open. The full +PR7711/PR7763 word suites, other geometry suites, selected cold replay, +Lean and Docker were not run. There is no new kappa or selected-frontier +change; all five framework assumptions remain. No independent human or +formal proof-kernel acceptance or global literature priority is claimed. diff --git a/research/one-edge-word-obstruction/README.md b/research/one-edge-word-obstruction/README.md new file mode 100644 index 0000000000..aae58aa415 --- /dev/null +++ b/research/one-edge-word-obstruction/README.md @@ -0,0 +1,35 @@ +# Four-projector words at three exponent relations + +At every finite length, a full diagonal word on the PR7749 alphabet with +all four types, nonzero labels and at most three saturated relations must +cancel both fresh-type totals. Its only targets are ([u],[u],1,1). +The complete rank-power tariff cannot improve for 0 X R Y^T` consists of `r_ij=s_i+t_j`. To check this, +choose two independent columns on each side. The four corresponding +entries determine the quotient map, which is onto the four-dimensional +space of two-by-two matrices. The displayed additive row-and-column +forms lie in its kernel and have dimension five. They are the full +kernel by dimension. + +For this form, the full commutator sum is + +```text +sum_i s_i [Ai,DB] + sum_j t_j [DA,Bj]. (2) +``` + +Here `[P,R]=PR+RP`. The first term is supported inside the A triple +and has only common/private entries; it has no private/private entry. +The second term has the corresponding support inside B. These off- +diagonal supports are disjoint. A member of the A-pattern space with +zero private/private entries is zero, by the explicit entries in +Section 2. The same is true for B. Thus membership of (2) in Q forces +both terms to vanish separately. + +The common/private entries of the first term vanish exactly when the +private image sum and private covector sum vanish. Both two-by-three +matrices have all-one kernel, so s0=s1=s2. The same argument gives +t0=t1=t2. Thus all r_ij are equal. Conversely their common value one +gives `[DA,DB]=0`, since DA and DB are diagonal. This proves the lemma, +including the quotient by Q. Its rank is eight. + +## 4. Degree two forces two blocks + +For each pair i,j, define the quadratic polynomial q_ij to be the sum +of `a*b` over calls a of type Ai and calls b of type Bj for which b +occurs before a. These are degree-one call variables in U. + +Compare the word's degree-two coefficient with the order in which all +A calls precede all B calls. Calls inside a triple commute exactly. +Each interchange of an A call and a B call changes the degree-two +matrix by its variable product times the corresponding commutator. +The degree-two terms of individual factors lie in Q after off. In +the comparison order, the first-order blocks are u DA and v DB, so +their cross term is diagonal. The remaining within-block terms lie +in Q. Therefore a diagonal endpoint requires + +```text +sum_ij C_ij q_ij = 0 modulo Q. (3) +``` + +The rank-eight lemma, applied to each quadratic monomial separately, +makes all nine q_ij the same polynomial q. + +For each i,j, q_ij lies in `E_i F_j`, the span of products of one +element of E_i and one element of F_j. The basis in Section 2 shows +that the intersection of these nine spaces is precisely span(uv). +Indeed a private variable of any one type is absent from the product +space for another type on that side. The only remaining monomial is +uv. Hence `q=epsilon*u*v`, where epsilon is zero or one. + +Fix i,j. The call variables within Ai are a basis of E_i; those within +Bj are a basis of F_j. Their pairwise products are independent because +E_i and F_j lie in disjoint variable spaces. Their complete sum is uv, +by (1). Thus the coefficient of every call pair in q_ij is epsilon. +If epsilon is zero, every Ai call precedes every Bj call. If epsilon +is one, every Bj call precedes every Ai call. The same epsilon applies +to all nine pairs. This proves the two-block chronology at every length. + +## 5. Exact totals and full endpoints + +Degree one alone does not give exact equality of exponent totals. +Let the three exact A totals be S_i and the three exact B totals T_j. +After collecting calls within each block, its operator is + +```text +FA = I + sum_i ([S_i]-1)Ai, +FB = I + sum_j ([T_j]-1)Bj. (4) +``` + +Suppose A precedes B, so the full map is FB FA. The two A-private +rows of FB are identity rows. They leave the corresponding rows of +FA unchanged. The private off-diagonal entries in those rows are +`[S_0]+[S_2]` and `[S_1]+[S_2]`. Diagonality forces all three monomials +equal. Distinct group elements are linearly independent in F2[H], so +S0=S1=S2 exactly. + +The B-private columns of FA are identity columns. Thus the corresponding +columns of FB FA equal those of FB. Their private off-diagonal entries +force T0=T1=T2 by the same argument. If B precedes A, exchange the +roles of rows, columns and triples. The conclusion is unchanged. + +Equation (4) now gives `FA=I+([S]-1)DA` and `FB=I+([T]-1)DB`. +These operators are diagonal, commute, and have the stated full endpoint. +Their common coordinate has monomial `[S][T]=[S+T]`. Every spectator +is fixed at each call. This proves necessity, sufficiency and the +disjoint paid-subset rank bound in Section 1. + +## 6. Exact checks and limits + +The checker tests all 511 nonempty subsets of the nine commutators, +including reduction modulo Q. Only the full subset vanishes. This +corroborates the direct rank lemma; it is not the unbounded proof. + +Five multiplicity domains contain 68760 distinct type orders, with +1584 passing orders. Each has both a degree-two check and a full +original-coordinate Laurent product. The exponents use the universal +exact common-total lattice, with four relations. Every passing word +has the predicted full endpoint. Every other word has an off-diagonal +entry. A separate multinomial count gives each passing count. These +finite checks do not enumerate every saturated lattice with the same +modulo-two reduction; the written proof covers that distinction. + +Twenty-four larger fixtures include repeated calls, both block orders, +coordinate permutations, and up to twelve unused spectators. They +check the actual paid exponent rank and all ambient columns. Moving +one call across the block boundary changes an explicit input column. + +The controls also check two nonzero-even total changes at the same +four-relation rank. Degree two misses these changes; the full endpoint +rejects them. A larger ambient exponent group can hide an interleaving +after all labels are doubled; the correct paid-generated coordinates +reject it. At five relations, an interleaved diagonal word exists with +three zero calls. At six relations, an interleaved identity has every +call nonzero. These are boundary controls, not rank-saving constructions +or a classification above four relations. Omitted-type and wrong-hub- +target controls change the full map. + +The exact six-type alphabet, all types present, original diagonal +endpoint, paid-generated group and four-relation limit are essential +scope restrictions. This does not classify other even maximizers or +arbitrary ambient embeddings. It does not supply a native word, +physical storage, restoration, a complete recursive invoice, or a +selected-assumption discharge. The selected kappa and all five +assumptions remain unchanged. Full predecessor suites, selected cold +replay, native/physical replay, Lean, Docker, independent human and +formal-kernel review were not run. diff --git a/research/one-edge-word-obstruction/retained/maximizer/README.md b/research/one-edge-word-obstruction/retained/maximizer/README.md new file mode 100644 index 0000000000..e8c47ff23f --- /dev/null +++ b/research/one-edge-word-obstruction/retained/maximizer/README.md @@ -0,0 +1,108 @@ +# Inequivalent even maximizers with one matrix-unit edge + +At pattern dimension `k=3` and matching number `ν=1`, two complete binary +projector pools attain the maximum joint-image dimension `n=4` and have +inequivalent actions. The new pool has two unordered pairs whose product has +trace one. The published maximizer has four. This is a scoped construction over +`F₂`. + +## Model and construction + +Write `P=xyᵀ` with `yᵀx=1`. Its pattern is the off-diagonal part of `P`. +For a pattern space `H`, the complete pool consists of all rank-one idempotents +whose patterns belong to `H \ {0}`. An edge `{i,j}` is present when `H` contains +`Eᵢⱼ` or `Eⱼᵢ`. The matching number is the maximum number of disjoint edges. +Equivalence of actions means simultaneous conjugacy by an invertible map on the +joint image, with the projectors allowed to be relabelled. + +Use coordinates `a,b,f,g`, with corresponding unit vectors denoted by the same +letters. Take these four pairs of factors. + +| Projector | Image `x` | Covector `y` | +| --- | --- | --- | +| `P` | `a` | `a+b` | +| `Q` | `a+b` | `b` | +| `R` | `a+f` | `a+g` | +| `S` | `a+b+g` | `b+f` | + +Each pairing `yᵀx` is one. Put `H=span(E_ab, off(R), off(S))`. The patterns of +`P` and `Q` both equal `E_ab`. Partition the coordinates into `(a,b)` and +`(f,g)`. On the first two rows and last two columns, the patterns of `R` and +`S` restrict to `a gᵀ` and `(a+b) fᵀ`. In the reverse rectangle they restrict to +`f aᵀ` and `g bᵀ`. Both pairs of restrictions are independent. Every +pattern outside `span(E_ab)` therefore has a nonzero entry in each of the two +disjoint rectangles. It follows that `k=3` and `E_ab` is the sole matrix unit. + +The only lifts of `E_ab` are `P` and `Q`. Indeed, the side conditions `x_a=1` +and `y_b=1` force all the other bits except `x_b,y_a` to vanish, and exactly one +of those two bits must be one. In the coset of `off(R)` modulo `span(E_ab)`, +the two nonzero cross rectangles uniquely fix `x` and `y` over `F₂`, yielding +`R`. The coset of `off(S)` gives `S` by the same argument. In the sum coset the +first rectangle has rank two, since `a` and `a+b` are independent. It cannot +be a rectangle of an outer product. This exhausts the nonzero pattern space. + +The four images form a basis because `a` and `a+b` span the first two +coordinates and the other images have distinct fresh coordinates `f,g`. +The covectors are also a basis. Every nonzero invariant subspace must therefore +contain at least one of the four images, obtained by applying a projector to a +nonzero element of the subspace. Define an arrow `i → j` if `P_j x_i = x_j`. +The closed walk `P → R → S → Q → R → P` reaches all four images from each of its +vertices. Thus the action is irreducible, with `n=4`. The even maximum at these +parameters is four by the matching bound and its attainment in #7707. + +## Inequivalence + +For distinct projectors `P_i=x_i y_iᵀ` and `P_j=x_j y_jᵀ`, +`tr(P_i P_j)=(y_iᵀ x_j)(y_jᵀ x_i)`. The integer count of unordered pairs +with trace one is unchanged by simultaneous conjugation and relabelling. +The pairing matrix for the new pool, with entries `y_iᵀ x_j` and order +`P,Q,R,S`, is + +```text +1 0 1 0 +0 1 0 1 +1 1 1 0 +0 1 1 1 +``` + +The trace-one pairs are `{P,R}` and `{Q,S}`. For the published maximizer, +#7707 uses `P,Q` with the two links `(b+f)(a+f)ᵀ` and `(b+g)(a+g)ᵀ`. +Each link has trace-one product with each of `P,Q`. The two links have +trace-zero product, as do `P,Q`. Its count is four, which separates the two +actions even under arbitrary linear changes of basis on the joint image. + +## Reproduce + +Run these from the repository root with CPython 3.12.15 and its standard library. + +```sh +python3.12 -B research/even-one-edge-maximizer/verify.py +python3.12 -B -O research/even-one-edge-maximizer/verify.py +python3.12 -B scripts/research_package.py --package research/even-one-edge-maximizer +python3.12 -B scripts/check_research_commit.py --package research/even-one-edge-maximizer --check-source-history +``` + +The verifier scans all 120 width-four rank-one idempotents for the new pattern +space, checks all 15 nonzero starting vectors and reports the two trace-one +pairs. The written proof uses the published upper bound as a premise. + +## Open next questions + +- What are all action classes at `(k,ν,n)=(3,1,4)`? Start by enumerating spans + of `E_ab` and two realized pattern classes at width four, then classify + their complete pools up to conjugacy. Higher ambient widths require a + separate reduction. +- Can the new alphabet realize a rank-saving paid word? Start by specifying + a saturated exponent relation lattice and the full ambient endpoint. A + word, dirty-state restoration, native implementation and the complete + recursive invoice remain open. This construction supplies no new saving. + +## Credit + +The new construction and proof were produced by Nick Petalas. Ali Romman’s +[PR #7707](https://github.com/CrocSwap/integer-mult-bounds/pull/7707) supplies +its even-maximizer question, the baseline construction and the sharp value. +His [PR #7692](https://github.com/CrocSwap/integer-mult-bounds/pull/7692) +supplies the matching theorem and the two lifts of a matrix unit used in the +baseline. [TASK.json](TASK.json) identifies the exact predecessor proofs. +The new package is Apache-2.0. diff --git a/research/one-edge-word-obstruction/retained/maximizer/SOURCES.json b/research/one-edge-word-obstruction/retained/maximizer/SOURCES.json new file mode 100644 index 0000000000..5335fa97d9 --- /dev/null +++ b/research/one-edge-word-obstruction/retained/maximizer/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/one-edge-word-obstruction/retained/maximizer/TASK.json b/research/one-edge-word-obstruction/retained/maximizer/TASK.json new file mode 100644 index 0000000000..e7307df0ce --- /dev/null +++ b/research/one-edge-word-obstruction/retained/maximizer/TASK.json @@ -0,0 +1,89 @@ +{ + "schema_version": 1, + "task_id": "bit-new-register-model", + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "original_card": { + "id": "bit-new-register-model", + "question": "Can an explicitly larger or nonabelian register model escape the scoped three-register obstruction?", + "starting_points": [ + "docs/research/research-family-status.md", + "research/bit-three-register-lower-bound/README.md", + "certificates/selected-result.json", + "research/bit-gl3-mixed-targets-length10/README.md", + "docs/research/community-efficient1000-review.md" + ], + "methods": [ + "Construct the smallest exact identity in a newly specified legal operation alphabet.", + "Derive a target-specific relaxation bound for that same explicit alphabet." + ], + "acceptance_gate": "Name the changed hypothesis, all counted roles and a uniform identity; finite column tests alone do not certify it. 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": "Resolve the current selected review, separate complex/ordinary BIT/admitted BIT/outer budgets, and compare the card against live handoffs before starting. Historical ceilings require exact source/model equivalence.", + "scope": "Source-binding orientation only; not a scientific replay or all-size proof. Materialize selected inputs if this checkout is sparse." + }, + "first_experiment": "First compare the alphabet, role count and length with the fully replayed #1974 census and #2027 mixed-root tariff. Identify a changed premise and a legal native implementation; then price one smallest completed instance before searching larger words.", + "bottleneck_link": "A small-width completed saving changes the bit primitive; a finite-address identity alone is insufficient.", + "allowed_variations": [ + "Choose a fixed larger register count or a specified nonabelian operation family." + ], + "scope_change_triggers": [ + "Remaining inside the already-excluded three-register abelian model.", + "Repeating the two-register GL3 census or a covered three-register length without changing a hypothesis; a formal group-algebra word without native conversion is a partial result." + ], + "overlap_terms": [ + "three-register", + "nonabelian", + "group algebra" + ] + }, + "scope_status": "changed", + "actual_scope": "Construct an inequivalent complete F2 projector pool for (k, matching number, joint-image dimension) = (3, 1, 4).", + "scope_change_reason": "Takes the first open question in PR #7707 at the smallest one-edge even maximum. The scope is classification of scalar alphabets before an endpoint word or native implementation.", + "bottleneck_link": "Inequivalent joint-image actions give different scalar alphabets for future binary endpoint-word searches at the same pattern and matching dimensions.", + "budget_minutes": 60, + "stop_rule": "Stop after the first inequivalent complete irreducible maximizer passes the exact width-four check.", + "outcome": "completed", + "evidence": "The written construction and trace comparison are in README.md. verify.py checks all 120 width-four rank-one idempotents and all 15 nonzero starting vectors in the new action, on CPython 3.12.15 with its standard library.", + "author": "Nick Petalas", + "ai_assistance": "Independent human and formal proof-kernel review are unclaimed.", + "open_questions": [ + { + "question": "Which simultaneous-conjugacy classes occur at (k, matching number, joint-image dimension) = (3, 1, 4)?", + "why_it_matters": "A complete list would show which actions need separate word tests at the same dimension bound.", + "first_step": "At width four, form all spans of one matrix unit and two realized pattern classes, then classify their complete pools.", + "blocked_by": "Higher ambient widths need a separate reduction and are outside this construction." + }, + { + "question": "Does the new alphabet admit a rank-saving paid word?", + "why_it_matters": "A complete irreducible action is only a candidate scalar alphabet.", + "first_step": "Specify a saturated exponent relation lattice and test a full ambient diagonal endpoint.", + "blocked_by": "Word chronology, dirty restoration, native realization and the complete recursive invoice remain open." + } + ], + "predecessors": [ + { + "pr": 7707, + "author": "aliromman", + "commit": "57e24923b609d2588b83321f530fa2a1e75ed364", + "proof": "https://github.com/aliromman/integer-mult-bounds/blob/57e24923b609d2588b83321f530fa2a1e75ed364/research/edge-matching-even-attainment/PROOF.md", + "sha256": "688efc2cd7c19e43c49193e94c1759c515dd79afbc4d832d62b27726f411daac", + "use": "Even maximum, open classification question and published comparison action. No runtime dependency." + }, + { + "pr": 7692, + "author": "aliromman", + "commit": "c2870a38841f515db7203a0761cd77f014f7fb7a", + "proof": "https://github.com/aliromman/integer-mult-bounds/blob/c2870a38841f515db7203a0761cd77f014f7fb7a/research/edge-matching-image-bound/PROOF.md", + "sha256": "0e49106713d5b0dfe50bf193737edc0fa4ee7862eb6696b43a53ddf5e06bc026", + "use": "Matching bound and the two-lift edge pair. No runtime dependency." + } + ], + "advance_claim": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19718509" +} diff --git a/research/one-edge-word-obstruction/retained/maximizer/VERIFY.json b/research/one-edge-word-obstruction/retained/maximizer/VERIFY.json new file mode 100644 index 0000000000..9a753186d4 --- /dev/null +++ b/research/one-edge-word-obstruction/retained/maximizer/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": 10, + "checks": "One matrix unit, exact complete pool, full-image irreducibility and trace-one pair count for the new witness." + }, + { + "argv": [ + "{python}", + "-B", + "-O", + "{package}/verify.py" + ], + "timeout_seconds": 10, + "checks": "One matrix unit, exact complete pool, full-image irreducibility and trace-one pair count for the new witness." + } + ] +} diff --git a/research/one-edge-word-obstruction/retained/maximizer/verify.py b/research/one-edge-word-obstruction/retained/maximizer/verify.py new file mode 100644 index 0000000000..dd59470400 --- /dev/null +++ b/research/one-edge-word-obstruction/retained/maximizer/verify.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python3 +"""Check the complete width-four witness and its trace invariant over F2.""" + +from itertools import combinations, product + +WIDTH = 4 +CARDINALITY = 1 << WIDTH +# The low-to-high bits represent a, b, f, g. +PROJECTORS = ((1, 3), (3, 2), (5, 9), (11, 6)) + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def pairing(image, covector): + return (image & covector).bit_count() % 2 + + +def off_pattern(image, covector): + pattern = 0 + for row in range(WIDTH): + if image & (1 << row): + entries = covector & ~(1 << row) + pattern |= entries << (WIDTH * row) + return pattern + + +def span(generators): + vectors = {0} + for generator in generators: + vectors |= {vector ^ generator for vector in vectors} + return vectors + + +def reaches_all_images(start, images): + reached = {start} + for _ in range(len(PROJECTORS)): + reached |= { + image for image, covector in PROJECTORS + if any(pairing(vector, covector) for vector in reached) + } + return images <= reached + + +def main(): + patterns = span(tuple(off_pattern(*projector) for projector in PROJECTORS)) + require(len(patterns) == 8, "expected pattern dimension three") + units = {pattern for pattern in patterns if pattern.bit_count() == 1} + require(units == {1 << 1}, "expected the single unit E_ab") + + factors = range(1, CARDINALITY) + idempotents = tuple((x, y) for x, y in product(factors, repeat=2) if pairing(x, y)) + pool = {pair for pair in idempotents if off_pattern(*pair) in patterns - {0}} + require(len(idempotents) == 120, "incorrect width-four idempotent inventory") + require(pool == set(PROJECTORS), "complete pool differs from the four displayed lifts") + + images = {image for image, _ in pool} + require(len(span(images)) == CARDINALITY, "joint image is not the full width-four space") + for vector in factors: + require(reaches_all_images(vector, images), f"nonspanning orbit at {vector}") + + reciprocal = { + (i, j) for i, j in combinations(range(len(PROJECTORS)), 2) + if pairing(PROJECTORS[i][0], PROJECTORS[j][1]) + and pairing(PROJECTORS[j][0], PROJECTORS[i][1]) + } + require(reciprocal == {(0, 2), (1, 3)}, "unexpected trace-one pairs") + print("PASS_EVEN_ONE_EDGE_MAXIMIZER") + print(f"{len(idempotents)} idempotents scanned, {len(patterns) - 1} nonzero patterns, " + f"{len(pool)} lifts, {len(factors)} spanning orbits, {len(reciprocal)} trace-one pairs") + + +if __name__ == "__main__": + main() diff --git a/research/one-edge-word-obstruction/retained/seven-call-CREDITS.md b/research/one-edge-word-obstruction/retained/seven-call-CREDITS.md new file mode 100644 index 0000000000..d868b6e66c --- /dev/null +++ b/research/one-edge-word-obstruction/retained/seven-call-CREDITS.md @@ -0,0 +1,32 @@ +# Sources and credit + +Ali Romman (@aliromman) prepared this proof, checker and package with +substantial OpenAI Codex assistance. New material is Apache-2.0. +No independent human or formal proof-kernel acceptance is claimed. + +Nick Petalas (@petalas) supplied the six-call theorem, unchanged checker +and seven-call question in [PR #7742](https://github.com/CrocSwap/integer-mult-bounds/pull/7742), +at the [exact proof](https://github.com/petalas/integer-mult-bounds/blob/9394615e9fd3a30b66e23d422da4945258d7923f/research/shared-hub-single-pass/README.md) +and [checker](https://github.com/petalas/integer-mult-bounds/blob/9394615e9fd3a30b66e23d422da4945258d7923f/research/shared-hub-single-pass/verify.py). +All five package files are retained byte-exact. The integer bit-encoded +Laurent engine here adapts that source method; the bivariate set engine +is separate. + +Ali Romman supplied the shared-hub projector pool in +[PR #7707](https://github.com/CrocSwap/integer-mult-bounds/pull/7707), +[source proof](https://github.com/aliromman/integer-mult-bounds/blob/57e24923b609d2588b83321f530fa2a1e75ed364/research/edge-matching-even-attainment/PROOF.md), +and the four-relation theorem and cross-commutator lemma in +[PR #7711](https://github.com/CrocSwap/integer-mult-bounds/pull/7711), +[retained proof](https://github.com/aliromman/integer-mult-bounds/blob/ac185e4529a01156f7b574555b50827f8cb645bb/research/shared-hub-triple-word-obstruction/PROOF.md). +The displayed projector matrices are checked directly. The cross-commutator lemma is a dependency. The four-relation theorem is +related prior work; its complete predecessor suite is not rerun. + +Jerry Jiaheng Chen (@CubeJerry) supplied the augmentation chronology method +in [PR #6782](https://github.com/CrocSwap/integer-mult-bounds/pull/6782), +[source word proof](https://github.com/CubeJerry/integer-mult-bounds/blob/685457252b51b9c7932ece363365bdf0b12c9c31/research/bit-three-relation-core/FIVE-CORE-WORD.md). +The source notices identify this credit. This package adds the complete first-nonzero-form case split and the +exact cuts for the repeated call with a higher augmentation order. It does not claim a new geometry theorem or physical realization. + +`SOURCES.json` pins canonical main selection and task provenance. +`SOURCE-PINS.json` authenticates six retained source files. Source pins +are content references and do not assert unmerged ancestry. diff --git a/research/one-edge-word-obstruction/retained/seven-call-verify.py b/research/one-edge-word-obstruction/retained/seven-call-verify.py new file mode 100644 index 0000000000..fc6f89d88b --- /dev/null +++ b/research/one-edge-word-obstruction/retained/seven-call-verify.py @@ -0,0 +1,380 @@ +"""Check seven shared-hub calls and the two exceptional proof cases. + +Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. +""" +from hashlib import sha1, sha256 +from itertools import permutations, product +import json +from math import factorial, gcd +from pathlib import Path +import subprocess +import sys + +ROOT = Path(__file__).resolve().parent +PAIRS = ((6, 5), (5, 6), (7, 7), (12, 20), (20, 12), (28, 28)) +SUPPORTS = tuple((tuple(i for i in range(5) if u >> i & 1), + tuple(i for i in range(5) if v >> i & 1)) for u, v in PAIRS) +ORDERS = tuple(permutations(range(7))) +# S, T and X; X and S-X are the two calls of the repeated type. +CASES = ( + ('S', (2, 0), (0, 1), (1, 0)), + ('T', (1, 0), (0, 2), (0, 1)), + ('X', (1, 0), (0, 1), (2, 0)), + ('S+T', (1, 0), (1, 2), (0, 1)), + ('S+X', (1, 0), (0, 1), (1, 2)), + ('T+X', (1, 0), (0, 1), (0, 1)), + ('S+T+X', (1, 0), (0, 1), (1, 1)), + ('rank-one-1', (1, 0), (1, 0), (2, 0)), + ('rank-one-2', (2, 0), (1, 0), (1, 0)), + ('rank-one-3', (1, 0), (2, 0), (2, 0)), + ('rank-one-4', (4, 0), (2, 0), (1, 0)), + ('rank-one-5', (2, 0), (4, 0), (1, 0)), + ('rank-one-6', (1, 0), (-1, 0), (2, 0)), +) + + +def require(value, message): + if not value: + raise ArithmeticError(message) + + +def add(a, b): + return tuple(x + y for x, y in zip(a, b)) + + +def parity(a): + return (a[0] & 1) | ((a[1] & 1) << 1) + + +def quadratic(a, b): + return ((a & b & 1) | ((((a & 1) * (b >> 1)) ^ + ((a >> 1) * (b & 1))) << 1) | ((a & b & 2) << 1)) + + +def types_for(repeated): + side = 0 if repeated < 3 else 3 + other = tuple(i for i in range(side, side + 3) if i != repeated) + opposite = tuple(i for i in range(6) if i // 3 != repeated // 3) + return (repeated, repeated, *other, *opposite) + + +def separated(order): + first, last = sorted((order.index(0), order.index(1))) + return any(call >= 4 for call in order[first + 1:last]) + + +def two_blocks(order): + return set(order[:4]) == set(range(4)) or set(order[:3]) == {4, 5, 6} + + +def cross_coefficients(order, labels, first_mixed=False): + positions = [order.index(i) for i in range(7)] + rows = [] + for calls in ((0, 1), (2,), (3,)): + for b in (4, 5, 6): + value = 0 + for a in calls: + if positions[b] < positions[a]: + value ^= labels[a] if first_mixed else quadratic(labels[a], labels[b]) + rows.append(value) + return rows + + +def check_leading_cases(): + records = [] + for f1, f2 in ((1, 1), (1, 2), (0, 1), (1, 0)): + labels = (f1, f2, f1 ^ f2, f1 ^ f2, 1, 1, 1) + passing = separated_pass = 0 + for order in ORDERS: + values = cross_coefficients(order, labels, True) + if len(set(values)) != 1: + continue + passing += 1 + separated_pass += separated(order) + if not f1 or not f2: + zero = 0 if f1 == 0 else 1 + core = tuple(i for i in order if i != zero) + require(set(core[:3]) == (set(range(4)) - {zero}) or + set(core[:3]) == {4, 5, 6}, 'visible core has two blocks') + else: + require(not separated(order), 'leading forms admit a separator') + records.append({'leading_forms': [f1, f2], 'passing_orders': passing, + 'separated_passing_orders': separated_pass}) + # Every ordered pair of vectors has one of the four stated relation types. + for f1, f2 in product(range(8), repeat=2): + if not (f1 or f2): + continue + for alpha, beta, epsilon in product(range(2), repeat=3): + if (f1 * alpha) ^ (f2 * beta) != (f1 ^ f2) * epsilon: + continue + if f1 and f2: + require(alpha == beta, 'all coefficient relations') + if f1 != f2: + require(alpha == epsilon, 'independent coefficient relations') + else: + require((alpha if f1 else beta) == epsilon, 'visible coefficient relation') + return {'canonical_cases': records, 'coefficient_pairs': 63, + 'indicator_cases': 504, 'order_cases': 4 * len(ORDERS)} + + +def integer_matrix(pair): + u, v = pair + return sum(((u >> i & 1) * (v >> j & 1)) << (5 * i + j) + for i in range(5) for j in range(5)) + + +def matrix_product(a, b): + return sum((sum(((a >> (5 * i + k)) & (b >> (5 * k + j)) & 1) + for k in range(5)) % 2) << (5 * i + j) + for i in range(5) for j in range(5)) + + +def off(a): + return a & ~sum(1 << (6 * i) for i in range(5)) + + +def span_basis(values): + basis = {} + for value in values: + while value: + pivot = value.bit_length() - 1 + if pivot not in basis: + basis[pivot] = value + break + value ^= basis[pivot] + return basis + + +def remainder(value, basis): + for pivot in sorted(basis, reverse=True): + if value >> pivot & 1: + value ^= basis[pivot] + return value + + +def check_pool(): + matrices = list(map(integer_matrix, PAIRS)) + for i, matrix in enumerate(matrices): + require(matrix_product(matrix, matrix) == matrix, 'idempotent') + for j in range(6): + if i != j and i // 3 == j // 3: + require(matrix_product(matrix, matrices[j]) == 0, 'orthogonal triple') + basis = span_basis(map(off, matrices)) + require(len(basis) == 4, 'pattern rank') + commutators = [remainder(off(matrix_product(a, b) ^ matrix_product(b, a)), basis) + for a in matrices[:3] for b in matrices[3:]] + zeros = [] + for mask in range(1, 512): + value = 0 + for i, matrix in enumerate(commutators): + if mask >> i & 1: + value ^= matrix + if value == 0: + zeros.append(mask) + require(zeros == [511], 'rank-eight commutator quotient') + reflection = lambda a: sum((a >> i & 1) << (4 - i) for i in range(5)) + require(tuple((reflection(u), reflection(v)) for u, v in PAIRS[:3]) == PAIRS[3:], + 'reflection exchanges the triples') + return {'off_pattern_rank': 4, 'commutator_rank': 8, 'subset_checks': 511} + + +def full_product(order, types, vectors): + radix = 2 * sum(abs(a) for a, _ in vectors) + 1 + labels = [a + radix * b for a, b in vectors] + offset = sum(-a for a in labels if a < 0) + one = 1 << offset + rows = [[one if i == j else 0 for j in range(5)] for i in range(5)] + for call in order: + image, covector = SUPPORTS[types[call]] + exponent = labels[call] + for column in range(5): + donor = 0 + for row in covector: + donor ^= rows[row][column] + shifted = donor << exponent if exponent >= 0 else donor >> -exponent + require(exponent >= 0 or (shifted << -exponent) == donor, 'Laurent shift') + delta = donor ^ shifted + for row in image: + rows[row][column] ^= delta + return rows, radix, offset + + +def sparse_product(order, types, vectors): + one = {(0, 0)} + rows = [[one.copy() if i == j else set() for j in range(5)] for i in range(5)] + for call in order: + u, v = PAIRS[types[call]] + factor = [[({(0, 0)} if i == j else set()) ^ + ({(0, 0), vectors[call]} if (u >> i & v >> j & 1) else set()) + for j in range(5)] for i in range(5)] + result = [[set() for _ in range(5)] for _ in range(5)] + for i, j, k in product(range(5), repeat=3): + for a in factor[i][k]: + for b in rows[k][j]: + value = add(a, b) + if value in result[i][j]: + result[i][j].remove(value) + else: + result[i][j].add(value) + rows = result + return rows + + +def check_full_words(): + records = [] + sparse_checks = 0 + for repeated in range(6): + types = types_for(repeated) + for name, s, t, x in CASES: + vectors = (x, add(s, tuple(-v for v in x)), s, s, t, t, t) + require(all(v != (0, 0) for v in vectors), 'nonzero labels') + minors = [abs(a[0] * b[1] - a[1] * b[0]) for a in vectors for b in vectors] + paid_rank = 2 if any(minors) else 1 + if paid_rank == 2: + require(gcd(*minors) == 1, 'paid-generated Z2 and saturated kernel') + else: + require(all(b == 0 for _, b in vectors) and gcd(*(abs(a) for a, _ in vectors)) == 1, + 'paid-generated Z and saturated kernel') + targets = (s, s, add(s, t), t, t) if repeated < 3 else (t, t, add(s, t), s, s) + passed = 0 + digest = sha256() + for index, order in enumerate(ORDERS): + rows, radix, offset = full_product(order, types, vectors) + diagonal = all(rows[i][j] == 0 for i in range(5) for j in range(5) if i != j) + require(diagonal == two_blocks(order), 'full seven-call endpoint') + if diagonal: + require([rows[i][i] for i in range(5)] == + [1 << (offset + a + radix * b) for a, b in targets], + 'exact hub and private targets') + passed += 1 + digest.update(json.dumps(rows, separators=(',', ':')).encode() + b'\n') + if index in (0, 39, 101, 777, 2048, 5039): + sparse = sparse_product(order, types, vectors) + encoded = [[sum(1 << (offset + a + radix * b) for a, b in entry) + for entry in row] for row in sparse] + require(rows == encoded, 'independent bivariate multiplication') + sparse_checks += 1 + require(passed == 2 * factorial(4) * factorial(3), 'block count') + records.append({'repeated_type': repeated, 'fixture': name, 'paid_rank': paid_rank, 'relations': 7 - paid_rank, 'orders': len(ORDERS), + 'diagonal': passed, 'full_matrix_sha256': digest.hexdigest()}) + return {'cases': records, 'sparse_products': sparse_checks, + 'words': len(records) * len(ORDERS), 'diagonal': sum(r['diagonal'] for r in records)} + + +def pmul(a, b): + result = set() + for x in a: + for y in b: + value = x + y + if value in result: + result.remove(value) + else: + result.add(value) + return result + + +def pmat(a, b): + result = [[set() for _ in range(3)] for _ in range(3)] + for i, j, k in product(range(3), repeat=3): + result[i][j] ^= pmul(a[i][k], b[k][j]) + return result + + +def factor_sum(coefficients): + return [ + [({0} if i == j else set()) ^ + xor_all(coefficient if (u >> i & v >> j & 1) else set() + for coefficient, (u, v) in zip(coefficients, PAIRS[:3])) + for j in range(3)] for i in range(3)] + + +def xor_all(values): + result = set() + for value in values: + result ^= value + return result + + +def check_exact_cut(): + one = {0} + a, b, c, d, t = ({1 << (4 * i)} for i in range(5)) + scale = [[one if i == j and i < 2 else t if i == j else set() + for j in range(3)] for i in range(3)] + + def word(repeated, coefficients): + extra = [set(), set(), set()] + extra[repeated] = d + return pmat(factor_sum(extra), pmat(scale, factor_sum(coefficients))) + + initial = word(0, (a, b, c)) + require(initial[0][1] == initial[0][2] == b ^ c, 'A0 initial private row') + w = word(0, (a, b, b)) + require(w[1][0] ^ w[2][0] == pmul(one ^ t, a ^ b), 'A0 cut elimination') + require(word(0, (a, a, a))[1][2] == pmul(pmul(d, t), one ^ a), 'A0 final factor') + swapped = word(1, (b, a, b)) + require(all(swapped[i][j] == w[1 - i if i < 2 else 2][1 - j if j < 2 else 2] + for i in range(3) for j in range(3)), 'A1 private permutation') + general = word(2, (a, b, c)) + require(general[0][2] ^ general[1][2] == a ^ b, 'A2 private difference') + w = word(2, (a, a, c)) + require(w[0][1] ^ w[0][2] == pmul(pmul(d, one ^ a), one ^ t), 'A2 final factor') + # Every nonempty proper B prefix misses at least one coefficient. + prefix_masks = [] + for mask in range(1, 7): + patterns = [(v >> 3) & 3 for i, (_, v) in enumerate(PAIRS[3:]) if mask >> i & 1] + rank = len(span_basis(patterns)) + require(rank == mask.bit_count(), 'proper prefix cut is injective') + prefix_masks.append({'mask': mask, 'rank': rank}) + return {'symbolic_identities': 6, 'proper_prefix_masks': prefix_masks} + + +def controls(): + _, s, t, x = CASES[2] + vectors = (x, add(s, tuple(-v for v in x)), s, s, t, t, t) + order = (1, 2, 3, 4, 0, 5, 6) + values = cross_coefficients(order, tuple(map(parity, vectors))) + require(len(set(values)) == 1 and separated(order), 'even repeated label evades degree two') + rows, _, _ = full_product(order, types_for(0), vectors) + require(any(rows[i][j] for i in range(5) for j in range(5) if i != j), 'exact cut detects separator') + labels = list(vectors) + labels[2] = add(labels[2], (2, 0)) + require(tuple(map(parity, labels)) == tuple(map(parity, vectors)), 'even mutation parity') + rows, _, _ = full_product(tuple(range(7)), types_for(0), labels) + require(any(rows[i][j] for i in range(5) for j in range(5) if i != j), 'even total mutation') + rows, radix, offset = full_product(tuple(range(7)), types_for(0), vectors) + require(rows[2][2] != 1 << (offset + s[0] + radix * s[1]), 'missing hub contribution') + return ['even repeated separator', 'even type-total mutation', 'missing hub target'] + + +def source_replay(): + pins = json.loads((ROOT / 'SOURCE-PINS.json').read_text())['sources'] + for pin in pins: + data = (ROOT / pin['retained']).read_bytes() + require(sha256(data).hexdigest() == pin['sha256'], 'retained SHA256') + require(sha1(b'blob ' + str(len(data)).encode() + b'\0' + data).hexdigest() + == pin['git_blob'], 'retained Git blob') + command = [sys.executable, '-W', 'error', *(['-O'] if sys.flags.optimize else []), + '-B', str(ROOT / 'retained/single-pass/verify.py')] + result = subprocess.run(command, check=True, capture_output=True, text=True, timeout=60) + require('PASS_SHARED_HUB_SINGLE_PASS cases=527040 diagonal=792' in result.stdout, + 'unchanged source replay') + return len(pins) + + +def collect(): + require(len(ORDERS) == factorial(7) and len(set(ORDERS)) == factorial(7), 'order coverage') + return {'source_files': source_replay(), 'pool': check_pool(), 'leading_cases': check_leading_cases(), + 'exact_cut': check_exact_cut(), 'full_words': check_full_words(), 'controls': controls()} + + +def main(): + actual = collect() + require(actual == json.loads((ROOT / 'RESULT.json').read_text()), 'saved certificate') + print('PASS_SHARED_HUB_SEVEN_CALL') + print('4 complete leading-form cases; 20160 order checks; 511 commutator subsets') + print('393120 full Laurent words; 22464 diagonal endpoints; 468 independent sparse products') + print('All three repeated projector types and both triples; exact exceptional cuts and controls') + + +if __name__ == '__main__': + main() diff --git a/research/one-edge-word-obstruction/verify.py b/research/one-edge-word-obstruction/verify.py new file mode 100644 index 0000000000..b3db615fec --- /dev/null +++ b/research/one-edge-word-obstruction/verify.py @@ -0,0 +1,318 @@ +"""Check the three-relation word obstruction for the four-projector pool. + +Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. +""" +from hashlib import sha1, sha256 +from itertools import combinations, product +import json +from math import factorial +from pathlib import Path +import subprocess +import sys + +ROOT = Path(__file__).resolve().parent +PAIRS = ((1, 3), (3, 2), (5, 9), (11, 6)) +SUPPORTS = tuple((tuple(i for i in range(4) if u >> i & 1), + tuple(i for i in range(4) if v >> i & 1)) for u, v in PAIRS) +NONCOMMUTING = ((0, 2), (1, 2), (1, 3), (2, 3)) + + +def require(value, message): + if not value: + raise ArithmeticError(message) + + +def xor_all(values): + result = 0 + for value in values: + result ^= value + return result + + +def matrix(pair): + u, v = pair + return sum((u >> i & v >> j & 1) << (4 * i + j) + for i in range(4) for j in range(4)) + + +def multiply(a, b): + return sum((sum(a >> (4 * i + k) & b >> (4 * k + j) & 1 for k in range(4)) % 2) + << (4 * i + j) for i in range(4) for j in range(4)) + + +def off(a): + return a & ~sum(1 << (5 * i) for i in range(4)) + + +def basis(values): + result = {} + for value in values: + while value: + pivot = value.bit_length() - 1 + if pivot not in result: + result[pivot] = value + break + value ^= result[pivot] + return result + + +def check_alphabet(): + matrices = list(map(matrix, PAIRS)) + require(all(multiply(p, p) == p for p in matrices), 'idempotents') + require(multiply(matrices[0], matrices[1]) == multiply(matrices[1], matrices[0]) == 0, + 'P and Q are orthogonal') + require(multiply(matrices[0], matrices[3]) == multiply(matrices[3], matrices[0]) == 0, + 'P and S are orthogonal') + patterns = [off(matrices[i]) for i in (0, 2, 3)] + require(off(matrices[1]) == patterns[0], 'P/Q common pattern') + commutators = [off(multiply(matrices[i], matrices[j]) ^ multiply(matrices[j], matrices[i])) + for i, j in NONCOMMUTING] + rows = patterns + commutators + require(len(basis(rows)) == 7, 'four independent commutators modulo patterns') + for mask in range(1, 128): + require(xor_all(row for i, row in enumerate(rows) if mask >> i & 1) != 0, + 'independent seven-row certificate') + for private, writer in ((2, 2), (3, 3)): + require([i for i, (u, _) in enumerate(PAIRS) if u >> private & 1] == [writer], + 'unique private writer') + require(PAIRS[writer][1] & ~(1 << private), 'writer reads outside its private coordinate') + return {'rows': rows, 'echelon_rows': [basis(rows)[p] for p in sorted(basis(rows), reverse=True)], + 'rank': 7, 'nonempty_subsets': 127} + + +def words(counts): + remaining = list(counts) + + def visit(prefix): + if not any(remaining): + yield tuple(prefix) + return + for kind in range(4): + if remaining[kind]: + remaining[kind] -= 1 + prefix.append(kind) + yield from visit(prefix) + prefix.pop() + remaining[kind] += 1 + + return visit([]) + + +def position_words(counts): + n = sum(counts) + positions = set(range(n)) + for p in combinations(range(n), counts[0]): + after_p = positions - set(p) + for q in combinations(sorted(after_p), counts[1]): + after_q = after_p - set(q) + for r in combinations(sorted(after_q), counts[2]): + word = [3] * n + for kind, selected in enumerate((p, q, r)): + for index in selected: + word[index] = kind + yield tuple(word) + + +def good_order(word): + r = [i for i, kind in enumerate(word) if kind == 2] + s = [i for i, kind in enumerate(word) if kind == 3] + if any(word[i] in (0, 1) for i in range(r[0] + 1, r[-1])): + return False + if any(word[i] == 1 for i in range(s[0] + 1, s[-1])): + return False + projection = [kind for kind in word if kind in (2, 3)] + return 1 + sum(a != b for a, b in zip(projection, projection[1:])) <= 3 + + +def labels_for_counts(counts): + dimension = sum(counts) - 3 + unit = lambda i: tuple(int(j == i) for j in range(dimension)) + next_axis = 1 + labels = [] + free = [] + for kind, count in enumerate(counts): + row = [unit(i) for i in range(next_axis, next_axis + count - 1)] + free.extend(row) + next_axis += count - 1 + total = unit(0) if kind < 2 else (0,) * dimension + row.append(tuple(total[i] - sum(v[i] for v in row) for i in range(dimension))) + labels.append(row) + require(free == [unit(i) for i in range(1, dimension)], 'paid private unit basis') + require(tuple(sum(v[i] for v in labels[0]) for i in range(dimension)) == unit(0), + 'paid common unit recovered over integers') + require(all(any(v) for row in labels for v in row), 'nonzero paid vectors') + return labels + + +def ordered_labels(word, labels): + indices = [0] * 4 + result = [] + for kind in word: + result.append(labels[kind][indices[kind]]) + indices[kind] += 1 + return result + + +def degree_two(word, vectors): + dimension = len(vectors[0]) + masks = [sum((value & 1) << i for i, value in enumerate(v)) for v in vectors] + prefix = [0] * 4 + result = [0] * 4 + for kind, mask in zip(word, masks): + for index, (left, right) in enumerate(NONCOMMUTING): + if kind != left: + continue + for i in range(dimension): + if mask >> i & 1: + for j in range(dimension): + if prefix[right] >> j & 1: + result[index] ^= 1 << (min(i, j) * dimension + max(i, j)) + prefix[kind] ^= mask + return result + + +def encoded_product(word, exponents): + offset = sum(-x for x in exponents if x < 0) + one = 1 << offset + rows = [[one if i == j else 0 for j in range(4)] for i in range(4)] + for kind, exponent in zip(word, exponents): + image, covector = SUPPORTS[kind] + for column in range(4): + donor = xor_all(rows[row][column] for row in covector) + shifted = donor << exponent if exponent >= 0 else donor >> -exponent + require(exponent >= 0 or shifted << -exponent == donor, 'Laurent shift') + delta = shifted ^ donor + for row in image: + rows[row][column] ^= delta + return rows, offset + + +def sparse_product(word, vectors): + zero = (0,) * len(vectors[0]) + rows = [[{zero} if i == j else set() for j in range(4)] for i in range(4)] + for kind, exponent in zip(word, vectors): + u, v = PAIRS[kind] + factor = [[({zero} if i == j else set()) ^ + ({zero, exponent} if u >> i & v >> j & 1 else set()) + for j in range(4)] for i in range(4)] + result = [[set() for _ in range(4)] for _ in range(4)] + for i, j, k in product(range(4), repeat=3): + for a in factor[i][k]: + for b in rows[k][j]: + value = tuple(x + y for x, y in zip(a, b)) + if value in result[i][j]: + result[i][j].remove(value) + else: + result[i][j].add(value) + rows = result + return rows + + +def check_words(): + records = [] + sparse_checks = 0 + for n in range(6, 10): + for counts in product(range(1, n), repeat=4): + if sum(counts) != n or min(counts[2:]) < 2: + continue + orders = list(words(counts)) + expected = factorial(n) + for count in counts: + expected //= factorial(count) + require(len(orders) == expected and set(orders) == set(position_words(counts)), + 'independent order coverage') + labels = labels_for_counts(counts) + dimension = n - 3 + powers = [3 ** i for i in range(dimension)] + digest = sha256() + passing = 0 + for index, word in enumerate(orders): + vectors = ordered_labels(word, labels) + expected_diagonal = good_order(word) + require((not any(degree_two(word, vectors))) == expected_diagonal, + 'quadratic chronology equivalence') + exponents = [sum(a * b for a, b in zip(v, powers)) for v in vectors] + rows, offset = encoded_product(word, exponents) + diagonal = all(not rows[i][j] for i in range(4) for j in range(4) if i != j) + require(diagonal == expected_diagonal, 'full word classification') + if diagonal: + require([rows[i][i] for i in range(4)] == + [1 << (offset + 1), 1 << (offset + 1), 1 << offset, 1 << offset], + 'two productive labels and two identities') + passing += 1 + digest.update(json.dumps(rows, separators=(',', ':')).encode() + b'\n') + if index in {0, 1, len(orders) // 3, len(orders) // 2, len(orders) - 1}: + sparse = sparse_product(word, vectors) + encoded = [[sum(1 << (offset + sum(a * b for a, b in zip(v, powers))) + for v in entry) for entry in row] for row in sparse] + require(rows == encoded, 'independent multivariate product') + sparse_checks += 1 + records.append({'multiplicities': list(counts), 'paid_rank': dimension, + 'relations': 3, 'orders': len(orders), 'diagonal': passing, + 'full_matrix_sha256': digest.hexdigest()}) + return {'domains': records, 'words': sum(r['orders'] for r in records), + 'diagonal': sum(r['diagonal'] for r in records), 'sparse_products': sparse_checks} + + +def check_controls(): + writer_cases = 0 + for writer in (2, 3): + others = tuple(i for i in range(4) if i != writer) + for length in range(4): + for prefix in product(others, repeat=length): + for label in (-2, -1, 1, 2, 4): + word = prefix + (writer,) + prefix[::-1] + exponents = (1,) * length + (label,) + (-1,) * length + rows, _ = encoded_product(word, exponents) + require(any(rows[writer][j] for j in range(4) if j != writer), + 'single private writer cannot return a diagonal row') + writer_cases += 1 + word = (0, 1, 2, 2, 3, 3) + labels = labels_for_counts((1, 1, 2, 2)) + vectors = ordered_labels(word, labels) + powers = (1, 5, 25) + for changed in (1, 3, 5): + mutant = list(vectors) + mutant[changed] = (mutant[changed][0] + 2, *mutant[changed][1:]) + require(not any(degree_two(word, mutant)), 'even mutation keeps degree two') + rows, offset = encoded_product(word, [sum(a * b for a, b in zip(v, powers)) for v in mutant]) + sparse = sparse_product(word, mutant) + encoded = [[sum(1 << (offset + sum(a * b for a, b in zip(v, powers))) + for v in entry) for entry in row] for row in sparse] + require(rows == encoded, 'independent exact fault product') + require(any(rows[i][j] for i in range(4) for j in range(4) if i != j), + 'exact endpoint rejects even total mutation') + return {'unique_writer_words': writer_cases, + 'even_total_faults': ['Q total', 'R total', 'S total']} + + +def source_replay(): + pins = json.loads((ROOT / 'SOURCE-PINS.json').read_text())['sources'] + for pin in pins: + data = (ROOT / pin['retained']).read_bytes() + require(sha256(data).hexdigest() == pin['sha256'], 'retained SHA256') + require(sha1(b'blob ' + str(len(data)).encode() + b'\0' + data).hexdigest() + == pin['git_blob'], 'retained Git blob') + command = [sys.executable, '-W', 'error', *(['-O'] if sys.flags.optimize else []), + '-B', str(ROOT / 'retained/maximizer/verify.py')] + result = subprocess.run(command, check=True, capture_output=True, text=True, timeout=30) + require('PASS_EVEN_ONE_EDGE_MAXIMIZER' in result.stdout, 'unchanged geometry replay') + return len(pins) + + +def collect(): + return {'source_files': source_replay(), 'alphabet': check_alphabet(), + 'words': check_words(), 'controls': check_controls()} + + +def main(): + actual = collect() + require(actual == json.loads((ROOT / 'RESULT.json').read_text()), 'saved certificate') + print('PASS_ONE_EDGE_WORD_OBSTRUCTION') + print('35 multiplicity domains; 108904 type orders; exact degree-two and full Laurent checks') + print(f"{actual['words']['diagonal']} diagonal endpoints; 175 independent sparse products; 400 unique-writer controls") + print('All-length three-relation classification: exact R/S cancellation and endpoint diag([u],[u],1,1)') + + +if __name__ == '__main__': + main()