Skip to content

Research: exact four-call minimum for an integer-shear target - #3905

Draft
1337isnot1337 wants to merge 1 commit into
CrocSwap:mainfrom
1337isnot1337:research/luna-pass-20261018-macbook-02
Draft

1337isnot1337 wants to merge 1 commit into
CrocSwap:mainfrom
1337isnot1337:research/luna-pass-20261018-macbook-02

Conversation

@1337isnot1337

Copy link
Copy Markdown
Contributor

Summary

This package specifies the nonabelian address group generated by two opposite integer shears
[
X=\begin{pmatrix}1&1\0&1\end{pmatrix},\qquad
Y=\begin{pmatrix}1&0\1&1\end{pmatrix}
]
with paid labels (X^{\pm1},Y^{\pm1}). Each is a reversible integer update with rank-one difference from identity.

For (B=X^2Y^2=\begin{pmatrix}5&2\2&1\end{pmatrix}), the exact minimum for
[
\operatorname{diag}([B],[e])\in M_2(\mathbb F_2[G])
]
is four paid calls. The word using (X,X,Y,Y) acts on every dirty pair ((u,v)) as ((Bu,v)).

Proof and bill

Each paid factor contributes only the identity label or its chosen generator label. Thus a k-factor operator cannot contain an address outside the radius-k word ball. B is absent from all 85 words of length at most three, giving the lower bound for arbitrary rank-one idempotent frames. The explicit four-call word attains it.

The complete model-local bill is four paid factors, two arbitrary dirty roles, no scratch roles, and zero copy, reset, restore or uncharged address calls. The second role is unchanged.

Verification

python3.12 scripts/research_package.py --package research/sl2z-four-call-native-target
PASS_SL2Z_FOUR_CALL_TARGET alphabet=4 roles=2 calls=4 shorter_words=85 distinct_radius3=47 rank1_labels=4 restoration_calls=0 omitted_controls=4 wrong_label=1 wrong_order=1 no_new_kappa
PASS_REGISTERED_RESEARCH_PACKAGE research/sl2z-four-call-native-target outcome=completed
python3.12 scripts/research_package.py --package research/sl2z-four-call-native-target --check-only
PASS_PACKAGE_METADATA_AND_PINS (not a mathematical acceptance check)

Scope and credit

The result changes the address group from the additive rational-frame model to a specified nonabelian integer-shear group. It is a scoped exact minimum only. No bit supplier, physical compiler invoice, recursive moment, new kappa, or selected-frontier change is claimed.

The package records overlap with the all-S_n adjacent-transposition tariff, free-group commutator-pair and UT5(Z) four-role claims, and current UT3(F4) work. It retains credit to the earlier register-model line, including PR #288 and PR #203. Exact heads and sources are in research/sl2z-four-call-native-target/OVERLAP.md and SOURCES.json.

Publication validation

The registered package replay passed on CPython 3.12.3 with python3.12 scripts/research_package.py --package research/sl2z-four-call-native-target. The optional --check-source-history preflight could not run because this MacBook checkout is shallow and the checker requires full Git history. This package's source manifest pins only files at its exact base commit 20ecf2891d80b5acf18d980b2164fb44ea7faa90; it contains no head: source pins. Any earlier pending note above refers to the state before this publication-time replay.

@rcfc-jreed

Copy link
Copy Markdown
Contributor

Independent scoped audit of the SL2(Z) four-call shear package at b27bf4c7: packaging defect (missing RESULT.json); algebra otherwise agrees

Code-disjoint checks; does not import package verify.py. Package bytes from head b27bf4c72a822b21f483e08cb3241ad9d165b66f via GitHub contents API. CLAIM.

Defect found:

  • D1 — missing RESULT.json. verify.py prints PASS_SL2Z_FOUR_CALL_TARGET … no_new_kappa, but the package ships no committed RESULT.json.

What still passes:

  1. Pins: base 20ecf289…; VERIFY ready; TASK outcome completed.
  2. Alphabet / target: XX·YY=(5,2,2,1); no length ≤ 3 word hits the target among 85 short words.
  3. Four-call F₂[G] witness hits the diagonal target; four omission controls plus wrong-label and reversed-order fail.

Not covered: larger alphabets; new κ; formal-kernel proof.

This is a finite algebraic replay, not a formal proof. Adding a committed RESULT.json would close D1.

check_3905.py
#!/usr/bin/env python3
"""Independent finite controls for PR3905 (SL2(Z) four-call shear minimum).

Recomputes alphabet / radius-3 exclusion / group-algebra witness without
importing package verify.py. Also checks packaging seals.

Package head b27bf4c72a822b21f483e08cb3241ad9d165b66f via GitHub API.

James Reed (@rcfc-jreed), with substantial AI assistance (Claude, in Cursor).
Apache-2.0.
"""
from __future__ import annotations

import argparse, json, sys
from itertools import product
from pathlib import Path

HEAD = "b27bf4c72a822b21f483e08cb3241ad9d165b66f"
BASE = "20ecf2891d80b5acf18d980b2164fb44ea7faa90"
IDENTITY = (1, 0, 0, 1)
X = (1, 1, 0, 1)
XI = (1, -1, 0, 1)
Y = (1, 0, 1, 1)
YI = (1, 0, -1, 1)
ALPHABET = (X, XI, Y, YI)
EXPECTED = (5, 2, 2, 1)
P = ((1, 0), (0, 0))
results = []


def check(name, ok, detail=""):
    results.append((name, bool(ok), detail))
    print(("PASS " if ok else "FAIL ") + name + ((": " + str(detail)) if detail else ""), flush=True)
    return bool(ok)


def load(pkg, name):
    return json.loads((pkg / name).read_text(encoding="utf-8"))


def mul(a, b):
    a00, a01, a10, a11 = a
    b00, b01, b10, b11 = b
    return (
        a00 * b00 + a01 * b10,
        a00 * b01 + a01 * b11,
        a10 * b00 + a11 * b10,
        a10 * b01 + a11 * b11,
    )


def det(a):
    return a[0] * a[3] - a[1] * a[2]


def scalar_product(a, b):
    return tuple(
        tuple(sum(a[i][k] * b[k][j] for k in range(2)) % 2 for j in range(2))
        for i in range(2)
    )


def word_product(word):
    out = IDENTITY
    for label in word:
        out = mul(out, label)
    return out


def xor_term(dst, key, bit):
    value = dst.get(key, 0) ^ bit
    if value:
        dst[key] = value
    else:
        dst.pop(key, None)


def matrix_product(a, b):
    out = [[{}, {}], [{}, {}]]
    for i in range(2):
        for k in range(2):
            for j in range(2):
                for g, coefficient_a in a[i][k].items():
                    for h, coefficient_b in b[k][j].items():
                        key = mul(g, h)
                        xor_term(out[i][j], key, coefficient_a & coefficient_b)
    return out


def paid_factor(g, n):
    out = [[{IDENTITY: 1}, {}], [{}, {IDENTITY: 1}]]
    for i in range(2):
        for j in range(2):
            if n[i][j]:
                xor_term(out[i][j], IDENTITY, 1)
                xor_term(out[i][j], g, 1)
    return out


def target_matrix(g):
    return [[{g: 1}, {}], [{}, {IDENTITY: 1}]]


def run(pkg: Path):
    task = load(pkg, "TASK.json")
    sources = load(pkg, "SOURCES.json")
    verify = load(pkg, "VERIFY.json")
    verify_py = (pkg / "verify.py").read_text(encoding="utf-8")
    readme = (pkg / "README.md").read_text(encoding="utf-8")

    check("I1 TASK/SOURCES base_commit == 20ecf289…; VERIFY ready; outcome completed",
          task["base_commit"] == BASE == sources["base_commit"]
          and verify["status"] == "ready"
          and task["outcome"] == "completed")
    check("D1 packaging: RESULT.json absent despite PASS_SL2Z_FOUR_CALL_TARGET",
          not (pkg / "RESULT.json").exists()
          and "PASS_SL2Z_FOUR_CALL_TARGET" in verify_py)

    check("A1 alphabet inverses/dets; rank-one label differences; XY≠YX; P idempotent rank-one",
          mul(X, XI) == IDENTITY == mul(XI, X)
          and mul(Y, YI) == IDENTITY == mul(YI, Y)
          and all(det(label) == 1 for label in ALPHABET)
          and all(det(tuple(label[i] - IDENTITY[i] for i in range(4))) == 0
                  for label in ALPHABET)
          and mul(X, Y) != mul(Y, X)
          and scalar_product(P, P) == P
          and sum(sum(row) for row in P) == 1)

    b = mul(mul(X, X), mul(Y, Y))
    difference = tuple(b[i] - IDENTITY[i] for i in range(4))
    check("T1 target XX·YY = (5,2,2,1); det=1; det(target-I)=-4",
          b == EXPECTED and det(b) == 1 and det(difference) == -4)

    shorter = [w for length in range(4) for w in product(ALPHABET, repeat=length)]
    radius3 = {word_product(word) for word in shorter}
    check("T2 no length≤3 word equals target; |short words|=85; target ∉ radius-3 ball",
          len(shorter) == 85
          and all(word_product(word) != b for word in shorter)
          and b not in radius3)

    factors = [paid_factor(g, P) for g in (X, X, Y, Y)]
    result = factors[0]
    for factor in factors[1:]:
        result = matrix_product(result, factor)
    expected = target_matrix(b)
    check("W1 four-call F2[G] witness hits diagonal target",
          result == expected)

    omissions = 0
    for omitted in range(4):
        damaged = [factor for index, factor in enumerate(factors) if index != omitted]
        value = damaged[0]
        for factor in damaged[1:]:
            value = matrix_product(value, factor)
        if value != expected:
            omissions += 1
    wrong_middle = [paid_factor(g, P) for g in (X, X, YI, Y)]
    value = wrong_middle[0]
    for factor in wrong_middle[1:]:
        value = matrix_product(value, factor)
    wrong_role = [paid_factor(g, P) for g in (Y, Y, X, X)]
    value2 = wrong_role[0]
    for factor in wrong_role[1:]:
        value2 = matrix_product(value2, factor)
    check("W2 four omission controls + wrong-label + reversed-order all fail target",
          omissions == 4 and value != expected and value2 != expected)

    check("N1 no_new_kappa in verify stdout seal; four-call minimum scope in README",
          "no_new_kappa" in verify_py
          and ("four-call" in readme.lower() or "four call" in readme.lower()))

    failed = [name for name, ok, _ in results if not ok]
    print(f"\n{len(results) - len(failed)}/{len(results)} PASS", flush=True)
    if failed:
        print("FAILED:", ", ".join(failed), flush=True)
        return 1
    return 0


def main():
    ap = argparse.ArgumentParser()
    ap.add_argument("--pkg", required=True)
    ap.add_argument("--expect-head", default=HEAD)
    args = ap.parse_args()
    check("HEAD pin recorded (API fetch)", args.expect_head == HEAD, args.expect_head)
    return run(Path(args.pkg))


if __name__ == "__main__":
    sys.exit(main())

James Reed (@rcfc-jreed), with substantial AI assistance (Claude, in Cursor).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants