diff --git a/research/elementary-abelian-four-label-floor/README.md b/research/elementary-abelian-four-label-floor/README.md new file mode 100644 index 0000000000..39cd33b397 --- /dev/null +++ b/research/elementary-abelian-four-label-floor/README.md @@ -0,0 +1,163 @@ +# Three-gate words for four addresses in `(Z/2)^3` have total rank at least 5 + +**Scoped sharpening; no new κ.** The selected conditional result, the +selected suppliers and `upstream/` are unchanged. The complex side binds, +and this finite address model is not a bit-supplier admission. + +The rank-one count for these targets is already 4. Over `F2`, Wentao Li's +`research/elementary-abelian-diagonal-minimum` gives one rank-one call per +non-identity diagonal entry of `F2[(C2)^k]`. Over every field, the +prime-exponent theorem recorded in discussion +[#1166](https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19227902) +(PR #6008) gives total projector rank at least `d` for `d` non-identity +entries. Neither statement is in this checkout. Both allow a three-gate +word of ranks `(2,1,1)`, total rank 4. The argument below rules that shape +out. + +Let `V=(Z/2)^3` and let `K` be any field. A paid gate on finitely many +registers is + +```text +D(N,g) = (I-N)[0] + N[g], N^2 = N, g in V. +``` + +It costs one at every rank. A free operation is a matrix over `K`, of any +shape, acting as the identity address `[0]`. It may add or drop workspace, +copy, or be singular. It cannot apply an address. The target is +`diag([t1],[t2],[t3],[t4])` with four distinct nonzero `ti`. Dirty workspace +may change arbitrarily, but it may not affect the data output. + +## Theorem + +For every such quadruple, in any characteristic, with finite workspace and +free scalar maps: + +1. Two paid gates are impossible at every rank. Three gates suffice, so the + unit-gate count is 3. +2. Every three-gate realization uses a basis of labels and has total + projector rank at least 5. Ranks `(2,1,1)` do not occur. +3. Four rank-one coordinate gates realize the target at total rank 4. + +A unit-minimum word therefore costs at least one rank unit more than the +general floor of 4. Rank charging prefers the longer rank-one word. + +This replaces the rational three-register model +(`research/bit-three-register-lower-bound`: three registers, frames in +`M_3(Q)`, nine calls) by four data registers and the finite group +`(Z/2)^3`. The dependent triple `{g,h,g+h}` already has unit cost 2 and +rank-one cost 3. The new constant is for four addresses: the general floor +allows total rank 4, and every three-gate word needs at least 5. + +## Proof + +**Support.** Expand each gate into the branches `I-N` and `N`. Free scalar +matrices contribute only `[0]`. Every data-output entry is a `K`-linear +combination of subset sums of the three labels. Cancellation can remove an +address, not create one outside their span. A subspace of dimension at most +2 contains at most three nonzero vectors, so two gates, or three dependent +labels, cannot produce four distinct nonzero addresses. + +**Unit upper bound.** The quadruple spans `V`. In the standard basis +`(e1,e2,e3)`, let `N_j` be the diagonal projector whose `i`-th entry is the +`j`-th bit of `ti`. Then `D(N_1,e1) D(N_2,e2) D(N_3,e3)` equals the target. +In any basis a nonzero vector has weight at least 1, and at most three +vectors have weight 1, so four distinct nonzero vectors have total weight +at least 5. Thus some `N_j` has rank at least 2, every `N_j` is nonzero, +and the total rank of this word is at least 5. + +**Rank lower bound for every three-gate word.** A successful three-gate +word cannot have dependent labels, so its labels `g,h,k` are a basis. +Let `χ` be the dual coordinate that is 1 on `g` and 0 on `h` and `k`. +Exactly one gate has `χ=1`. The algebra map `K[V] → K[Z/2]` sends that +gate to `(I-N)+N[σ]` and sends the other two gates to `I`. Free maps stay +scalar. The coefficient of `[σ]` from data inputs to data outputs is +therefore `B N A` for scalar matrices `A,B`, and its rank is at most +`rank N`. On the target, that coefficient is the diagonal matrix with a 1 +in each position whose address has `χ=1`, and 0 elsewhere. + +In the label basis, those addresses are four distinct nonzero vectors. +Their total weight is at least 5, so some dual coordinate is 1 on at least +two of them. The corresponding gate has rank at least 2. Summing the three +coordinates, the total rank is at least 5. In particular the three gates +cannot all have rank one. + +**Rank-one upper bound.** `D(E_ii, ti)` multiplies register `i` by `[ti]` +and fixes the others. Four such gates give the target and total rank 4. +One or two gates are already excluded by the support bound, so four is the +rank-one minimum. + +The identity `K^n = im N ⊕ ker N` for a projector is the reason a rank-one +gate is similar to `E_11`, but the rank bound above does not need that +similarity: it uses only `rank(BNA) ≤ rank N`. + +## What was checked + +`verify.py` uses the standard library only. It exhausts all 35 quadruples, +all 168 ordered bases and all 512 ordered label triples. For every +quadruple it rebuilds both words in three independent algebras: bit masks, +frozensets of vectors, and nonnegative integer coefficients. The integer +engine checks that every construction coefficient is 0 or 1, so the words +are not using characteristic-2 cancellation. It also checks that omitting +any basis gate, or clearing any single 1 in a projector, misses the target; +that every `F2` rank-one idempotent on four coordinates is one of the 120 +outer products `xy^T` with `y^T x=1`; and that the dependent triple +`(e1,e2,e1+e2)` has an explicit two-gate unit word while no one-register +rank-one gate realizes it. + +## Reproduce + +From the repository root, with CPython 3.12: + +```sh +python3 -B research/elementary-abelian-four-label-floor/verify.py +python3 -I -O -B research/elementary-abelian-four-label-floor/verify.py +python3 -B scripts/research_package.py --package research/elementary-abelian-four-label-floor --check-only +``` + +Expected final line: + +```text +PASS_ELEMENTARY_ABELIAN_FOUR_LABEL_FLOOR quadruples=35 bases=168 label_triples=512 unit_gates=3 rank_one_gates=4 total_rank_at_least=5 standard_weight_range=5..9 omissions=105 cleared_bits=240 idempotents=120 engines=3 no_new_kappa +``` + +`standard_weight_range` is the Hamming weight in the standard basis. The +lower bound of 5 is checked again in every ordered basis. + +## Limits + +The theorem is for this address group and for diagonal targets whose +entries are distinct and nonzero. It does not cover repeated addresses, +groups with trivial homomorphism onto `(Z/2)^3`, restricted label sets, +data-dependent control, or a nonfaithful representation. No native gate, +frame, hosting, precision, tape, or recursive child is priced. The selected +cold replay `make frontier1094-verify` was not run, and neither was any +Lean or predecessor suite. One attempt to post this finding on discussion +#1166 returned `Resource not accessible by integration`. That write was +not retried. + +## Open next questions + +1. **Does `A4` still force rank-one cost four for four distinct non-identity + addresses?** `A4` is the smallest nonabelian group with no homomorphism + onto `Z/2`, so the character cut above is blind there. A length-three + rank-one word would be genuine compression. The first step is to fix + four 3-cycles inside one ordered three-label subproduct set and either + find a `C3` coefficient cut of rank at least 2, or test the coordinate + normal form over `F2` against a finite scalar generating set. Free + scalar maps are infinite, so that search becomes a proof only with a + normal form or a new quotient identity. + +## Credit + +The rational three-register model and its nine-call theorem are Ali +Romman's `research/bit-three-register-lower-bound`, from the pinned +argument in eumemic's PR #288. The three-label separation between unit +cost and rank-one cost is Ali Romman's `research/group-subproduct-cover` +(PR #5394). Wentao Li's `research/elementary-abelian-diagonal-minimum` +already gives the `F2` rank-one count, and the prime-exponent theorem in +PR #6008 gives total rank at least 4 over every field. Those packages are +not in this checkout and were not replayed. The new comparison is the +exclusion of total rank 4 for every three-gate word. The calculation, both +explicit words, and this verifier were prepared in an AI-assisted research +session. Substantial AI assistance was used for the argument and the +checks. Apache-2.0. diff --git a/research/elementary-abelian-four-label-floor/SOURCES.json b/research/elementary-abelian-four-label-floor/SOURCES.json new file mode 100644 index 0000000000..90404e6419 --- /dev/null +++ b/research/elementary-abelian-four-label-floor/SOURCES.json @@ -0,0 +1,24 @@ +{ + "schema_version": 1, + "base_commit": "ef5f39403610d231a0c27e8a6b4f08c10209bcd6", + "files": [ + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "c05fafaa25ba95b2d5af86b1800427198e3d20eb", + "sha256": "89b5928bc92c81e2647b6d702a7ad85a6795b8f44e2eb267b2ff3145d8f2b2ce" + }, + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "ae6a99f28aa468649eb66a361e764d769363bf11", + "sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32" + }, + { + "path": "research/bit-three-register-lower-bound/README.md", + "usage": "provenance", + "git_blob": "25e41c370c101a33a6deb978de08b03ed7539b79", + "sha256": "c12b33ef388deece0cbf891505a2ce2c0779a0c3a6cf1f0f7f7039bab59cbebd" + } + ] +} diff --git a/research/elementary-abelian-four-label-floor/TASK.json b/research/elementary-abelian-four-label-floor/TASK.json new file mode 100644 index 0000000000..cbc1244f14 --- /dev/null +++ b/research/elementary-abelian-four-label-floor/TASK.json @@ -0,0 +1,60 @@ +{ + "schema_version": 1, + "task_id": "bit-new-register-model", + "priority_revision": 2, + "base_commit": "ef5f39403610d231a0c27e8a6b4f08c10209bcd6", + "original_card": { + "id": "bit-new-register-model", + "question": "Can an explicitly larger or nonabelian register model escape the scoped three-register obstruction?", + "starting_points": [ + "research/bit-three-register-lower-bound/README.md", + "certificates/selected-result.json" + ], + "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.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read Model section 1 of the three-register bound and identify the exact excluded free operations.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Write a complete operation alphabet outside one named premise and price a baseline before searching identities.", + "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." + ], + "overlap_terms": [ + "three-register", + "nonabelian", + "group algebra" + ] + }, + "scope_status": "changed", + "actual_scope": "In the formal group algebra K[(Z/2)^3], for every set of four distinct nonzero addresses on four data registers, compare the unit paid-gate count with the rank-one gate count and the total projector rank, allowing finite workspace and fixed free scalar maps.", + "scope_change_reason": "The assigned card allows a larger register count outside the rational three-register model. Four data registers and the finite address group (Z/2)^3 replace M_3(Q) rank-one frames. This is the smallest width at which four distinct nonzero addresses can separate a unit-gate bill from a rank-one bill; the rational three-register theorem does not apply, and the three-label group-algebra cut does not decide four labels.", + "bottleneck_link": "Side result on the bit register interface, not a supplier admission. A three-gate word looks cheaper if every projector costs one, but every such word has total rank at least 5, while four rank-one coordinate gates cost total rank 4. Adopting the shorter word would not improve a rank-charged bit primitive. No selected moment or kappa changes.", + "budget_minutes": 60, + "stop_rule": "Stop after the (Z/2)^3 four-address floor and its direct matching constructions. Do not search A4, extra generators, or a native supplier in this session.", + "outcome": "completed", + "evidence": "Self-contained support and character argument. The new comparison is that every three-gate word has total rank at least 5, so ranks (2,1,1) are impossible, while four rank-one gates have total rank 4. Checked on all 35 quadruples, 168 bases and 512 label triples in three algebras. Marker PASS_ELEMENTARY_ABELIAN_FOUR_LABEL_FLOOR.", + "author": "AI-assisted research session", + "ai_assistance": "Substantial AI assistance was used to derive the argument, write the verifier, and check the finite cases. Assistance is disclosed without naming a coding-agent product. One Discussion comment attempt was forbidden and was not retried.", + "open_questions": [ + { + "question": "For four distinct non-identity elements of A4, is the rank-one gate count still four when every homomorphism to Z/2 is trivial?", + "why_it_matters": "The separation proved here uses a surjection onto (Z/2)^3. A4 is the smallest nonabelian group whose 2-abelianization is trivial, so a length-three rank-one word there would be real compression that this quotient cannot see.", + "first_step": "Fix four 3-cycles that lie in one ordered three-label subproduct set and test the coordinate normal form D(E_11, g) C1 D(E_11, h) C2 D(E_11, k) over F2 with a finite generating set of scalar maps, or find a C3-valued coefficient cut whose rank is at least 2.", + "blocked_by": "Free scalar maps are infinite. A finite normal form or a new quotient identity is required before an exhaustive search is a proof." + } + ] +} diff --git a/research/elementary-abelian-four-label-floor/VERIFY.json b/research/elementary-abelian-four-label-floor/VERIFY.json new file mode 100644 index 0000000000..ce170dd44f --- /dev/null +++ b/research/elementary-abelian-four-label-floor/VERIFY.json @@ -0,0 +1,19 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": ["{python}", "-B", "{package}/verify.py"], + "timeout_seconds": 120, + "checks": "All 35 nonzero quadruples in (Z/2)^3: unit-gate construction, rank-one direct word, support bound, character rank lower bound, two algebra engines, and failure controls." + }, + { + "argv": ["{python}", "-I", "-O", "-B", "{package}/verify.py"], + "timeout_seconds": 120, + "checks": "Same identity and controls with isolated imports and optimized bytecode, so the result does not depend on assertions stripped by optimization." + } + ] +} diff --git a/research/elementary-abelian-four-label-floor/verify.py b/research/elementary-abelian-four-label-floor/verify.py new file mode 100644 index 0000000000..c2dee85e85 --- /dev/null +++ b/research/elementary-abelian-four-label-floor/verify.py @@ -0,0 +1,371 @@ +#!/usr/bin/env python3 +"""Exact four-address floor in the elementary abelian group of order 8. + +The proof is in README.md. This program checks its finite content and the +explicit words. It does not import predecessor packages. +""" + +from itertools import combinations + +NONZERO = tuple(range(1, 8)) + + +def require(condition, message): + if not condition: + raise SystemExit("FAIL: " + message) + + +def popcount(value): + return bin(value).count("1") + + +def rank_bits(rows): + """Rank of 4-bit row vectors over F2.""" + span = [] + for row in rows: + value = row + for pivot in span: + if value & -value == pivot & -pivot: + value ^= pivot + if value: + span.append(value) + span.sort(key=lambda item: item & -item) + return len(span) + + +def convolution(left, right): + out = 0 + for i in range(8): + if (left >> i) & 1: + for j in range(8): + if (right >> j) & 1: + out ^= 1 << (i ^ j) + return out + + +def set_convolution(left, right): + return frozenset(i ^ j for i in left for j in right) + + +class MaskAlgebra: + @staticmethod + def zero(): + return 0 + + @staticmethod + def one(): + return 1 # group identity, vector 0 + + @staticmethod + def basis(vector): + return 1 << vector + + @staticmethod + def mul(left, right): + return convolution(left, right) + + @staticmethod + def add(left, right): + return left ^ right + + +class SetAlgebra: + @staticmethod + def zero(): + return frozenset() + + @staticmethod + def one(): + return frozenset({0}) + + @staticmethod + def basis(vector): + return frozenset({vector}) + + @staticmethod + def mul(left, right): + return set_convolution(left, right) + + @staticmethod + def add(left, right): + return left.symmetric_difference(right) + + +class IntAlgebra: + """Nonnegative integer coefficients. Used to see that the direct words + do not cancel, so the same words are valid over every field.""" + + @staticmethod + def zero(): + return (0, 0, 0, 0, 0, 0, 0, 0) + + @staticmethod + def one(): + return (1, 0, 0, 0, 0, 0, 0, 0) + + @staticmethod + def basis(vector): + values = [0] * 8 + values[vector] = 1 + return tuple(values) + + @staticmethod + def mul(left, right): + out = [0] * 8 + for i, coeff in enumerate(left): + if not coeff: + continue + for j, other in enumerate(right): + if other: + out[i ^ j] += coeff * other + return tuple(out) + + @staticmethod + def add(left, right): + return tuple(a + b for a, b in zip(left, right)) + + +def eye(algebra, size=4): + zero = algebra.zero() + return tuple( + tuple(algebra.one() if i == j else zero for j in range(size)) + for i in range(size) + ) + + +def matmul(algebra, left, right): + size = len(left) + zero = algebra.zero() + out = [] + for i in range(size): + row = [] + for j in range(size): + acc = zero + for k in range(size): + acc = algebra.add(acc, algebra.mul(left[i][k], right[k][j])) + row.append(acc) + out.append(tuple(row)) + return tuple(out) + + +def gate(algebra, projector, label): + """D(N, label) = (I-N)[0] + N[label] for a diagonal 0-1 projector.""" + size = len(projector) + one = algebra.one() + step = algebra.basis(label) + zero = algebra.zero() + rows = [] + for i in range(size): + row = [] + for j in range(size): + if i != j: + row.append(zero) + elif projector[i]: + row.append(step) + else: + row.append(one) + rows.append(tuple(row)) + return tuple(rows) + + +def target_matrix(algebra, labels): + size = len(labels) + one = algebra.one() + zero = algebra.zero() + return tuple( + tuple(algebra.basis(labels[i]) if i == j else zero for j in range(size)) + for i in range(size) + ) + + +def word_for(algebra, projectors, labels): + acc = eye(algebra) + for projector, label in zip(projectors, labels): + acc = matmul(algebra, acc, gate(algebra, projector, label)) + return acc + + +def bits_of(vector): + return ((vector >> 0) & 1, (vector >> 1) & 1, (vector >> 2) & 1) + + +def projectors_for(labels): + columns = list(zip(*(bits_of(label) for label in labels))) + return tuple(columns) + + +def weight(vector): + return popcount(vector) + + +def all_idempotent_rank_one(): + found = [] + for mask in range(1 << 16): + rows = [(mask >> (4 * i)) & 15 for i in range(4)] + product = [0, 0, 0, 0] + for i, row in enumerate(rows): + for j in range(4): + if (row >> j) & 1: + product[i] ^= rows[j] + if product == rows and rank_bits(rows) == 1: + found.append(tuple(rows)) + return found + + +def outer_factorization_count(): + count = 0 + seen = set() + for x in range(1, 16): + for y in range(16): + if bin(x & y).count("1") % 2 != 1: + continue + rows = tuple(((x >> i) & 1) * y for i in range(4)) + seen.add(rows) + count += 1 + return count, len(seen) + + +def main(): + quadruples = list(combinations(NONZERO, 4)) + require(len(quadruples) == 35, "expected C(7,4)=35 quadruples") + algebras = (MaskAlgebra, SetAlgebra, IntAlgebra) + omitted = 0 + cleared = 0 + min_weight = 99 + max_weight = 0 + + for labels in quadruples: + # At most three weight-1 vectors exist in any basis of F2^3, and + # every nonzero vector has weight at least 1, so four of them weigh + # at least 5 in every basis. Checked here on the standard basis and + # on every image under GL3 by recomputing weights after all ordered + # bases below. + standard_weight = sum(weight(label) for label in labels) + min_weight = min(min_weight, standard_weight) + max_weight = max(max_weight, standard_weight) + require(standard_weight >= 5, "standard weight dropped below 5") + projectors = projectors_for(labels) + ranks = tuple(sum(column) for column in projectors) + require(sum(ranks) == standard_weight, "rank sum is the Hamming weight") + require(max(ranks) >= 2 and min(ranks) >= 1, "a basis word is uneven and uses all three labels") + for algebra in algebras: + built = word_for(algebra, projectors, (1, 2, 4)) + require(built == target_matrix(algebra, labels), "unit-gate basis word missed its target") + # Direct rank-one word: gate i multiplies register i by labels[i]. + for algebra in algebras: + acc = eye(algebra) + for index, label in enumerate(labels): + projector = tuple(1 if i == index else 0 for i in range(4)) + acc = matmul(algebra, acc, gate(algebra, projector, label)) + require(acc == target_matrix(algebra, labels), "direct rank-one word missed its target") + # Omitting any one basis gate misses the target. + for drop in range(3): + kept = [(projectors[j], (1, 2, 4)[j]) for j in range(3) if j != drop] + missed = word_for(MaskAlgebra, [item[0] for item in kept], [item[1] for item in kept]) + require(missed != target_matrix(MaskAlgebra, labels), "omitted gate still hit the target") + omitted += 1 + # Clearing any single 1 in a projector misses the target. + for column, bit_row in enumerate(projectors): + for row, bit in enumerate(bit_row): + if not bit: + continue + damaged = [list(col) for col in projectors] + damaged[column][row] = 0 + missed = word_for(MaskAlgebra, damaged, (1, 2, 4)) + require(missed != target_matrix(MaskAlgebra, labels), "cleared bit still hit the target") + cleared += 1 + + # Every ordered basis: four distinct nonzero vectors still weigh at least 5. + bases = 0 + for first, second, third in ((a, b, c) for a in NONZERO for b in NONZERO for c in NONZERO): + if rank_bits((first, second, third)) < 3: + continue + bases += 1 + # Express every nonzero vector in this basis and weigh each quadruple + # by summing those coordinates. The change-of-basis matrix sends the + # standard basis to (first, second, third). + decode = {} + for mask in range(8): + image = 0 + for shift, vector in enumerate((first, second, third)): + if (mask >> shift) & 1: + image ^= vector + decode[image] = mask + require(len(decode) == 8, "basis did not enumerate the group") + for labels in quadruples: + total = sum(weight(decode[label]) for label in labels) + require(total >= 5, "some basis gives four addresses total weight below 5") + require(bases == 168, "GL3(F2) has 168 ordered bases") + + # Every ordered label triple: dependent labels cover at most 3 nonzero + # addresses; independent labels are a basis. + dependent_cover = 0 + independent = 0 + for labels in ((a, b, c) for a in range(8) for b in range(8) for c in range(8)): + generated = {0} + for mask in range(8): + acc = 0 + for shift, label in enumerate(labels): + if (mask >> shift) & 1: + acc ^= label + generated.add(acc) + nonzero = generated - {0} + if rank_bits(labels) < 3: + require(len(nonzero) <= 3, "dependent triple covered four addresses") + dependent_cover += 1 + else: + require(len(nonzero) == 7, "independent triple missed an address") + independent += 1 + require(dependent_cover + independent == 512, "label triple census incomplete") + + idempotents = all_idempotent_rank_one() + factorizations, distinct = outer_factorization_count() + require(len(idempotents) == 120, "F2 rank-one idempotent count") + require(distinct == 120 and factorizations == 120, "outer-product parametrization missed an idempotent") + for rows in idempotents: + require(rank_bits(rows) == 1, "census rank drifted") + + # Three-label control: {1,2,3} = {e1, e2, e1+e2} has a two-gate unit word + # and is not realized by one gate. This is the predecessor shape inside + # this group, checked directly rather than imported. + triple = (1, 2, 3) + acc = eye(MaskAlgebra, 3) + acc = matmul(MaskAlgebra, acc, gate(MaskAlgebra, (1, 0, 1), 1)) + acc = matmul(MaskAlgebra, acc, gate(MaskAlgebra, (0, 1, 1), 2)) + expected = target_matrix(MaskAlgebra, triple) + # target_matrix uses len(labels); good. + require(acc == expected, "two-gate triple control failed") + one = gate(MaskAlgebra, (1, 1, 1), 1) + require(one != expected, "one gate must not realize three distinct addresses") + # No single rank-one diagonal pattern realizes the triple: every diagonal + # rank-one gate writes one label on one register. + for index in range(3): + projector = tuple(1 if i == index else 0 for i in range(3)) + for label in NONZERO: + require(gate(MaskAlgebra, projector, label) != expected, "rank-one gate realized the triple") + + # Integer-coefficient witness that a representative quadruple has + # coefficient 1 on the target address and 0 elsewhere, with no carries. + sample = (1, 2, 4, 7) + built = word_for(IntAlgebra, projectors_for(sample), (1, 2, 4)) + for i, label in enumerate(sample): + for j in range(4): + coeffs = built[i][j] + require(all(coeff in (0, 1) for coeff in coeffs), "construction used a nontrivial integer coefficient") + require(sum(coeffs) == (1 if i == j else 0), "integer support is not a pure address") + if i == j: + require(coeffs[label] == 1, "integer target coefficient") + + print( + "PASS_ELEMENTARY_ABELIAN_FOUR_LABEL_FLOOR" + f" quadruples=35 bases={bases} label_triples=512" + f" unit_gates=3 rank_one_gates=4 total_rank_at_least=5" + f" standard_weight_range={min_weight}..{max_weight}" + f" omissions={omitted} cleared_bits={cleared}" + f" idempotents={len(idempotents)} engines=3" + " no_new_kappa" + ) + + +if __name__ == "__main__": + main()