From 900d5b61df7988895c5db95a8c36008f2229c1e8 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 20 Oct 2026 02:48:18 +0000 Subject: [PATCH] research: stop the one-XOR shear carrier on a lossless integer payload PR #3947's three-bit image of B=X^2 Y^2 is one XOR of order 2. That endpoint does not injectively encode a nonzero integer address, no wiring realizes B mod 4, and the exact m-bit caller is four additions at 8m+16 XOR plus matching AND and OR gates. No new kappa. Co-authored-by: unpaidmoon --- research/sl2z-payload-encoder-stop/README.md | 123 +++++++ .../sl2z-payload-encoder-stop/SOURCES.json | 18 + research/sl2z-payload-encoder-stop/TASK.json | 64 ++++ .../sl2z-payload-encoder-stop/VERIFY.json | 18 + research/sl2z-payload-encoder-stop/verify.py | 328 ++++++++++++++++++ 5 files changed, 551 insertions(+) create mode 100644 research/sl2z-payload-encoder-stop/README.md create mode 100644 research/sl2z-payload-encoder-stop/SOURCES.json create mode 100644 research/sl2z-payload-encoder-stop/TASK.json create mode 100644 research/sl2z-payload-encoder-stop/VERIFY.json create mode 100644 research/sl2z-payload-encoder-stop/verify.py diff --git a/research/sl2z-payload-encoder-stop/README.md b/research/sl2z-payload-encoder-stop/README.md new file mode 100644 index 0000000000..b202580479 --- /dev/null +++ b/research/sl2z-payload-encoder-stop/README.md @@ -0,0 +1,123 @@ +# The one-XOR shear carrier does not encode integer B + +**Negative stop on a lossless payload. No new κ.** Selected κ stays +`0.001672660197076918`. + +## Question + +PR #3905 shows that `B = X²Y²` needs four calls in the formal shear alphabet. +PR #3947 shows that a three-bit quotient sends that same `B` to one XOR, +`b ^= c`, and that this quotient is not a faithful encoding of the integer +matrices. Discussion reply 19032401 asks for the next piece, not another formal +word: name a payload subspace and an injective encoder/decoder/consumer, prove +the commuting diagram, and price conversion, storage, and dirty return. +**Stop if that caller already has the one-XOR endpoint.** + +This package answers that stop. It does not redo the faithful-word moment test +`M(a) < 1`. + +## Result + +Let + +```text +X = [[1, 1], [0, 1]], Y = [[1, 0], [1, 1]], B = X²Y² = [[5, 2], [2, 1]]. +``` + +`B² − I = [[28, 12], [12, 4]]`. Its only integer kernel vector is `0`, because +`12x + 4y = 0` forces `y = −3x` and then `28x + 12y = −8x = 0`. The gcd of the +four entries is 4, so `B² ≡ I` modulo `M` only for `M` dividing 4. + +The projective action of these matrices modulo 3, restricted to the sum-zero +plane in `F₂⁴`, reproduces the published carrier + +```text +ρ(B) = [[1, 0, 0], [0, 1, 1], [0, 0, 1]], +``` + +which is `b ^= c` on column vectors and has order 2. `ρ(X³) = I` while +`X³ = [[1, 3], [0, 1]] ≠ I`, so the carrier is not an injective encoding of +the integer generators. + +**Integer payload.** A map of order 2 cannot intertwine with `B` on a +`B`-invariant subset `S ⊆ ℤ²` through an injective encoder, except `S ⊆ {0}`. +One use of the 3-bit block distinguishes at most 8 payloads, and one use of +the 6-bit two-block caller at most 64. The box `{0, …, 2ᵐ − 1}²` exceeds 8 +states at `m ≥ 2` and exceeds 64 states at `m ≥ 4`. Under the identity 4-bit +packing, `(1, 0) ↦ (5, 2)` has Hamming distance 2, so it is not one XOR. + +**Mod-4 quotient.** This is the largest modulus on which `B² = I`. The action +has 4 fixed points and 6 transpositions, which would fit the cycle type of the +6-bit caller as a lookup. No wiring does so: every placement of the four +address bits into `(a, b, c, p, q, r)`, with the other two bits constant, +fails to realize `B` mod 4 after `b ^= c`. The Boolean map itself is the +linear circuit + +```text +(x0, x1, y0, y1) ↦ (x0, x1 XOR y0, y0, x0 XOR y1) +``` + +with **two XORs**, no AND, and no use of the carrier. Those two output parities +use disjoint inputs, so two XORs is the XOR count of this circuit. Routing the +same map through the carrier cannot undercut a circuit that does not need that +extra XOR. + +**Exact legal caller.** On an `m`-bit nonnegative address, `Y, Y, X, X` +overwrites the pair by `B`. Each step is one integer addition. A fixed +full-adder of `W` bits, final carry required to be 0, costs `2W` XOR, `2W` +AND and `W` OR. The four widths are `m+1`, `m+2`, `m+2` and `m+3`, so the bill +is + +```text +XOR = 8m + 16, AND = 8m + 16, OR = 4m + 8. +``` + +The input address is consumed. Restoring it costs a clean copy, `2m` further +XORs, and `2m` stored bits. The adder carry returns to 0. There is no spectator +role in this address model. For `m = 4` the consuming bill is 48 XOR, 48 AND +and 24 OR, against one incorrect carrier XOR. + +Checked for every pair at `m = 1..5`, and at the `m = 8` corner +`(255, 255)`. + +## What this does not claim + +No supplier, no group-algebra register, no selected cold replay, and no κ. +The mod-4 two-XOR circuit is a quotient, not an implementation of integer `B`. +A lookup table whose cycle type embeds into the 6-bit caller is not a legal +free conversion. Unknown gate-sharing across a different alphabet is not priced +as zero. + +## Reproduce + +```sh +python3.12 -B scripts/research_package.py --package research/sl2z-payload-encoder-stop +``` + +Expected first line: + +```text +PASS_SL2Z_PAYLOAD_ENCODER_STOP ... wiring_hits=0 mod4_direct_xor=2 ... no_new_kappa=true +``` + +Standard library only. Base `bb4bccbf42844d2801487450727c2f63e10d1d0f`. +Priority revision 6. + +## Open next questions + +Can the low two bits of an exact `m`-bit address use the mod-4 two-XOR map +while a carry into the high half replaces one of the four additions? The first +step is one shear's high-half recurrence on a single `m = 4` witness. It is +blocked if that carry is itself an addition: the split then does not beat +`8m + 16` XORs plus the matching ANDs and ORs. + +## Credit + +PR #3905 (1337isnot1337 / OpenAI Codex) for the integer shear target and the +four-call formal minimum. PR #3937 and PR #3947 (ToikY / OpenAI Codex) for the +commutative obstruction, the three-bit carrier, the one-XOR invoice, and the +payload question in discussion reply 19032401. The kernel argument, the wiring +exhaustion, the two-XOR quotient circuit, and the fixed-width adder bill are +new here. + +Prepared by unpaidmoon with substantial Cursor Grok 4.7 assistance. Apache-2.0. diff --git a/research/sl2z-payload-encoder-stop/SOURCES.json b/research/sl2z-payload-encoder-stop/SOURCES.json new file mode 100644 index 0000000000..a604c6a640 --- /dev/null +++ b/research/sl2z-payload-encoder-stop/SOURCES.json @@ -0,0 +1,18 @@ +{ + "schema_version": 1, + "base_commit": "bb4bccbf42844d2801487450727c2f63e10d1d0f", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", + "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0" + } + ] +} diff --git a/research/sl2z-payload-encoder-stop/TASK.json b/research/sl2z-payload-encoder-stop/TASK.json new file mode 100644 index 0000000000..e907f40ce1 --- /dev/null +++ b/research/sl2z-payload-encoder-stop/TASK.json @@ -0,0 +1,64 @@ +{ + "schema_version": 1, + "task_id": "bit-new-register-model", + "priority_revision": 6, + "base_commit": "bb4bccbf42844d2801487450727c2f63e10d1d0f", + "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_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": "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": "Does PR #3947's one-XOR carrier already implement a lossless payload for B=X^2 Y^2, and what does a legal exact address caller cost instead?", + "scope_change_reason": "The card asks for a new nonabelian register alphabet that might escape the three-register bound. This package does not search a new word. It takes the payload-encoder half of the #3947 handoff (discussion reply 19032401), which is item 5 of this session's ordered open-handoff list, and stops where that handoff says to stop: the one-XOR endpoint is not a lossless implementation of the integer target. The separate moment inequality M(a)<1 for faithful shear words is a different piece and is not redone.", + "bottleneck_link": "Side result. A three-bit image of B does not become a cheaper bit primitive unless a lossless payload encoder is priced. This prices that encoder as absent for integer addresses and records the four-addition bill. No selected-supplier term changes.", + "budget_minutes": 60, + "stop_rule": "Stop when the one-XOR carrier either implements a named injective payload or is shown not to. Do not search a larger formal word, and do not treat the mod-4 quotient as the integer target.", + "outcome": "negative-result", + "evidence": "Independent standard-library checks: B^2-I has trivial integer kernel, the recomputed carrier is the single XOR b^=c of order 2, identity packing of (1,0) to (5,2) has Hamming distance 2, no wiring into the six-bit caller realizes B mod 4, and four fixed-width additions realize exact B.", + "author": "unpaidmoon", + "ai_assistance": "Cursor Grok 4.7 drafted the package, the obstruction argument, and the verifier. The mathematics was checked by running that verifier.", + "open_questions": [ + { + "question": "Can the low two bits of an exact m-bit address use the mod-4 two-XOR map while a carry into the high half replaces one of the four additions?", + "why_it_matters": "The mod-4 quotient costs two XORs and no ANDs. If its carry into the remaining bits still costs an addition, the split does not beat the four-addition bill.", + "first_step": "Write the high-half recurrence for one shear, with the low limb reduced mod 4, and count additions plus the two XORs on a single m=4 witness.", + "blocked_by": "A carry that is itself an m-bit addition makes the split pointless; that comparison has not been expanded into a second package." + } + ] +} diff --git a/research/sl2z-payload-encoder-stop/VERIFY.json b/research/sl2z-payload-encoder-stop/VERIFY.json new file mode 100644 index 0000000000..7cb7a87395 --- /dev/null +++ b/research/sl2z-payload-encoder-stop/VERIFY.json @@ -0,0 +1,18 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Integer kernel of B^2-I, carrier XOR recomputation, Hamming witness, mod-4 wiring exhaustion, direct two-XOR quotient, and fixed-width four-addition bill" + } + ] +} diff --git a/research/sl2z-payload-encoder-stop/verify.py b/research/sl2z-payload-encoder-stop/verify.py new file mode 100644 index 0000000000..83a5849c5f --- /dev/null +++ b/research/sl2z-payload-encoder-stop/verify.py @@ -0,0 +1,328 @@ +#!/usr/bin/env python3 +"""The PR #3947 one-XOR carrier does not losslessly encode integer B=X^2 Y^2. + +The stop rule on discussion comment 19032401 asks for a payload, an injective +encoder, and a price, and says to stop if that carrier's one-XOR endpoint +already implements the target. This verifier checks that stop. + +Integer addresses, the mod-4 quotient (the largest modulus on which B^2 = I), +and the published three-bit representation are recomputed here. No predecessor +package is imported. +""" + +from itertools import permutations, product + +X = ((1, 1), (0, 1)) +Y = ((1, 0), (1, 1)) + + +def matmul(left, right): + return tuple( + tuple(left[i][0] * right[0][j] + left[i][1] * right[1][j] for j in range(2)) + for i in range(2) + ) + + +def matvec(matrix, vector): + return tuple( + sum(row[j] * vector[j] for j in range(len(vector))) for row in matrix + ) + + +def matmul3(left, right): + return tuple( + tuple(sum(left[i][k] * right[k][j] for k in range(3)) % 2 for j in range(3)) + for i in range(3) + ) + + +B = matmul(matmul(X, X), matmul(Y, Y)) +B2 = matmul(B, B) +B2_MINUS_I = ( + (B2[0][0] - 1, B2[0][1]), + (B2[1][0], B2[1][1] - 1), +) + + +def gcd(a, b): + while b: + a, b = b, a % b + return abs(a) + + +def check(condition, message="check failed"): + if not condition: + raise AssertionError(message) + + +def apply_b_mod(point, modulus): + image = matvec(B, point) + return (image[0] % modulus, image[1] % modulus) + + +def bits_of_pair(x, y): + return (x & 1, (x >> 1) & 1, y & 1, (y >> 1) & 1) + + +def pair_of_bits(bits): + return bits[0] + 2 * bits[1], bits[2] + 2 * bits[3] + + +def carrier_representation(): + """Projective action of X and Y mod 3, restricted to the sum-zero F2-plane.""" + points = ((1, 0), (0, 1), (1, 1), (1, 2)) + + def normalize(u, v): + u %= 3 + v %= 3 + if (u, v) == (0, 0): + raise AssertionError("projective image hit zero") + for scale in (1, 2): + candidate = ((scale * u) % 3, (scale * v) % 3) + if candidate in points: + return points.index(candidate) + raise AssertionError((u, v)) + + def permutation(matrix): + images = [] + for u, v in points: + images.append( + normalize( + matrix[0][0] * u + matrix[0][1] * v, + matrix[1][0] * u + matrix[1][1] * v, + ) + ) + return tuple(images) + + def on_f2_4(permutation_images, vector): + out = [0, 0, 0, 0] + for source, dest in enumerate(permutation_images): + out[dest] ^= vector[source] + return tuple(out) + + def coordinates(vector): + # w0=(0,1,0,1), w1=(1,1,1,1), w2=(0,1,1,0), in e0..e3 order. + c1 = vector[0] + c2 = (vector[2] + c1) % 2 + c0 = (vector[3] + c1) % 2 + if (c0 + c1 + c2) % 2 != vector[1] or (c0 + c1) % 2 != vector[3]: + return None + return (c0, c1, c2) + + def rho(permutation_images): + columns = [] + basis = ((0, 1, 0, 1), (1, 1, 1, 1), (0, 1, 1, 0)) + for vector in basis: + image = coordinates(on_f2_4(permutation_images, vector)) + if image is None: + raise AssertionError("basis vector left the sum-zero plane") + columns.append(image) + return tuple(tuple(columns[j][i] for j in range(3)) for i in range(3)) + + x_mod = tuple(tuple(entry % 3 for entry in row) for row in X) + y_mod = tuple(tuple(entry % 3 for entry in row) for row in Y) + rho_x = rho(permutation(x_mod)) + rho_y = rho(permutation(y_mod)) + rho_b = matmul3(matmul3(rho_x, rho_x), matmul3(rho_y, rho_y)) + return rho_x, rho_y, rho_b + + +def fixed_add(left, right, width): + carry = 0 + total = 0 + for bit in range(width): + xb = (left >> bit) & 1 + yb = (right >> bit) & 1 + partial = xb ^ yb + summed = partial ^ carry + carry = (xb & yb) | (carry & partial) + total |= summed << bit + return total, carry + + +def four_shears(x, y, width): + """Y then Y then X then X, with the fixed widths proved for m-bit inputs.""" + a, b = x, y + widths = (width + 1, width + 2, width + 2, width + 3) + b, carry = fixed_add(b, a, widths[0]) + if carry: + return None + b, carry = fixed_add(b, a, widths[1]) + if carry: + return None + a, carry = fixed_add(a, b, widths[2]) + if carry: + return None + a, carry = fixed_add(a, b, widths[3]) + if carry: + return None + return a, b + + +def wiring_realizes(output_bits): + """Bit placement into (a,b,c,p,q,r), constant scratch, then b ^= c. + + Encoder and decoder are wirings only: no XOR except the carrier instruction, + and no AND. Scratch bits are constants and must be readable only as discarded + positions. Returns one witness placement, or None. + """ + for in_slots in permutations(range(6), 4): + rest = [slot for slot in range(6) if slot not in in_slots] + for constants in product((0, 1), repeat=2): + for out_slots in permutations(range(6), 4): + if _wiring_ok(output_bits, in_slots, rest, constants, out_slots): + return in_slots, constants, out_slots + return None + + +def _wiring_ok(output_bits, in_slots, rest, constants, out_slots): + for x in range(4): + for y in range(4): + state = [0] * 6 + for bit, slot in zip(bits_of_pair(x, y), in_slots): + state[slot] = bit + state[rest[0]] = constants[0] + state[rest[1]] = constants[1] + state[1] ^= state[2] + if tuple(state[slot] for slot in out_slots) != output_bits(x, y): + return False + return True + + +def hamming(left, right, width): + distance = 0 + for value_l, value_r in zip(left, right): + for bit in range(width): + distance += ((value_l >> bit) ^ (value_r >> bit)) & 1 + return distance + + +def main(): + check(B == ((5, 2), (2, 1)), B) + check(B2 == ((29, 12), (12, 5)), B2) + check(B2_MINUS_I == ((28, 12), (12, 4)), B2_MINUS_I) + modulus = 0 + for entry in (28, 12, 12, 4): + modulus = gcd(modulus, entry) + assert modulus == 4 + + # (B^2 - I) p = 0 over Z has only p = 0. From 12x+4y = 0, y = -3x, + # then 28x+12y = -8x = 0. + for x in range(-12, 13): + for y in range(-12, 13): + image = matvec(B2_MINUS_I, (x, y)) + if image == (0, 0): + check((x, y) == (0, 0), (x, y)) + check(matvec(B2_MINUS_I, (1, -3)) == (-8, 0)) + + rho_x, rho_y, rho_b = carrier_representation() + check(rho_x == ((0, 0, 1), (0, 1, 0), (1, 0, 1)), rho_x) + check(rho_y == ((1, 0, 1), (1, 1, 0), (1, 0, 0)), rho_y) + check(rho_b == ((1, 0, 0), (0, 1, 1), (0, 0, 1)), rho_b) + check(matmul3(rho_b, rho_b) == ((1, 0, 0), (0, 1, 0), (0, 0, 1))) + # Column vector (a,b,c) maps to (a, b+c, c): one XOR, and not the identity. + check(matvec(rho_b, (0, 0, 1)) == (0, 1, 1)) + x_cubed = matmul(matmul(X, X), X) + check(x_cubed == ((1, 3), (0, 1))) + check(x_cubed != ((1, 0), (0, 1))) + identity3 = ((1, 0, 0), (0, 1, 0), (0, 0, 1)) + check(matmul3(matmul3(rho_x, rho_x), rho_x) == identity3) + + # One application of a k-bit map distinguishes at most 2^k payloads. + check(2 ** (2 * 2) > 8) # m=2 box does not inject into the 3-bit block + check(2 ** (2 * 4) > 64) # m=4 box does not inject into the 6-bit caller + + distance = hamming((1, 0), matvec(B, (1, 0)), 4) + check(matvec(B, (1, 0)) == (5, 2)) + check(distance == 2) + + # Largest modulus with B^2 = I is 4. Cycle type: 4 fixed points, 6 swaps. + seen = set() + fixed = transpositions = other = 0 + for x in range(4): + for y in range(4): + if (x, y) in seen: + continue + cycle = [(x, y)] + nxt = apply_b_mod((x, y), 4) + while nxt not in cycle: + cycle.append(nxt) + nxt = apply_b_mod(nxt, 4) + seen.update(cycle) + if len(cycle) == 1: + fixed += 1 + elif len(cycle) == 2: + transpositions += 1 + else: + other += 1 + check((fixed, transpositions, other, len(seen)) == (4, 6, 0, 16)) + + def target_bits(x, y): + image = apply_b_mod((x, y), 4) + return bits_of_pair(*image) + + check(wiring_realizes(target_bits) is None) + + def carrier_bits(x, y): + # Identity placement of the low three bits, with the carrier XOR as the target. + a, b, c, _p = bits_of_pair(x, y) + b ^= c + return (a, b, c, 0) + + check(wiring_realizes(carrier_bits) is not None) + + # Direct Boolean circuit for the mod-4 map. It does not use the carrier. + # out = (x0, x1 XOR y0, y0, x0 XOR y1), and the zero constant term was checked. + for x in range(4): + for y in range(4): + x0, x1, y0, y1 = bits_of_pair(x, y) + got = pair_of_bits((x0, x1 ^ y0, y0, x0 ^ y1)) + check(got == apply_b_mod((x, y), 4), (x, y, got)) + + # Exact m-bit integer caller: four additions, fixed full-adder widths. + for width in range(1, 6): + box = 1 << width + for x in range(box): + for y in range(box): + got = four_shears(x, y, width) + check(got == matvec(B, (x, y)), (width, x, y, got)) + corner = (1 << 8) - 1 + check(four_shears(corner, corner, 8) == matvec(B, (corner, corner))) + + def bill(width): + bit_slots = (width + 1) + (width + 2) + (width + 2) + (width + 3) + return { + "xor": 2 * bit_slots, + "and": 2 * bit_slots, + "or": bit_slots, + "copy_xor_if_source_restored": 2 * width, + "stored_source_bits": 2 * width, + } + + sample = bill(4) + check(sample == { + "xor": 48, + "and": 48, + "or": 24, + "copy_xor_if_source_restored": 8, + "stored_source_bits": 8, + }) + # Dropping any one shear misses the witness. + a, b = 1, 0 + b, _ = fixed_add(b, a, 8) + b, _ = fixed_add(b, a, 8) + a, _ = fixed_add(a, b, 8) + check((a, b) != (5, 2)) + + print( + "PASS_SL2Z_PAYLOAD_ENCODER_STOP " + "B=[[5,2],[2,1]] carrier_xor=b^=c order2=true " + "integer_invariant_payload={0} hamming_1_0_to_5_2=2 " + "mod4_cycle=4fixed+6swap wiring_hits=0 mod4_direct_xor=2 " + "adder_xor=8m+16 adder_and=8m+16 adder_or=4m+8 " + "no_new_kappa=true" + ) + + +if __name__ == "__main__": + main()