Skip to content

Independently check #4538's native-layout cost theorems 1-4: own RAM program within 8NL+40N+8, phases, negation, metadata compiler (no new κ) - #4555

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
pinterbanget:check-4538-cost
Oct 22, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
pinterbanget:check-4538-cost

Conversation

@pinterbanget

Copy link
Copy Markdown
Contributor

Summary

This adds research/pr4538-cost-theorems-check/, an independent check of the four native-layout cost theorems in Dugongue's #4538 (head dffc7939, cost/COST-THEOREMS.md). All checked claims are confirmed. No new κ.

The theorem text is vendored (blob a5d940b2, SHA256-pinned). Nothing is imported from #4538's streaming_affine.py, quadratic_phase.py or monomial_metadata.py.

Checks

  • Theorem 1, affine permutation within 8NL + 40N + 8.
    • Count arithmetic. Literal increments give the flip count T = 2N − r − 2, and the count identity holds.
    • My own program. I wrote a separate 30-instruction program on a small additive/Boolean RAM with truncated SUB and no multiplication, division or right shift, using the stated macro costs XOR 4, MOV 2, JNZ 2. Over 36 runs (r ≤ 8, L ≤ 5, random invertible A, offset b), it permutes records exactly and preserves source, table and padding. It uses at most 0.82× the bound.
    • Control. An XOR→ADD mutation is rejected.
  • Theorem 2, streaming quadratic phases. The d = (a_j + 2g_j) mod 4 update reproduces q(x) at all 3,012 visited points, with fewer than 2N flips.
  • Theorem 3, limb negation. Complement plus carry equals negation modulo 2^(kL) in 800 cases, with temporaries ≤ β. The Gaussian-unit table equals multiplication by i^q.
  • Theorem 4, metadata compiler. My compiler, written from the stated S/Z/CZ/CNOT/SWAP/X rules, satisfies word|x⟩ = i^(c+q(x))|Ax⊕b⟩ on every basis state. This holds for 360 random words (r ≤ 6, up to 40 gates) against a literal Gaussian-integer interpreter. The X-then-S control needs c = 1, and dropping c is caught.
  • Replay. Word RAM transfer: finite TM compiler, checked logarithmic-width bridge and native kernels #4538's own package replays at its head (outcome=partial, 9.1 s).
python3.12 -B scripts/research_package.py --package research/pr4538-cost-theorems-check
  PASS_REGISTERED_RESEARCH_PACKAGE research/pr4538-cost-theorems-check outcome=completed   (~1 s, stdlib only)

Limitations:

  • The TM emitter, the Lean bridge and packed tapes are out of scope.
  • Macro costs are taken as stated, not re-derived from Lean.
  • These are finite checks that corroborate the written inductions.

Head: a73b063b6970ecb6730211508969b05b306f4f80. Base: canonical main f626db5c.

Credit: Dugongue (#4538). Prepared by Ryanson Jonathan with substantial Claude Code (Claude Opus 5.5) assistance.

🤖 Generated with Claude Code

…own RAM program within 8NL+40N+8, phases, negation, metadata compiler (no new κ)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Mister-Meeseeks
Mister-Meeseeks merged commit 1f87c35 into CrocSwap:main Oct 22, 2026
1 of 2 checks passed
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