Skip to content

Lemma A of #484: the realization of paid wrappers and spectators, proved in Lean 4 - #516

Merged
Mister-Meeseeks merged 14 commits into
CrocSwap:mainfrom
DreamingOfClouds:e8-lemma-a-lean
Oct 12, 2026
Merged

Mister-Meeseeks merged 14 commits into
CrocSwap:mainfrom
DreamingOfClouds:e8-lemma-a-lean

Conversation

@DreamingOfClouds

@DreamingOfClouds DreamingOfClouds commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Lemma A of #484 has two parts:

This PR proves the realization part as a general theorem. It also proves the asynchronous variant that #505 needs.

The PR is stacked on #509 (→ #484 → #442). The new commits here are f71a4bb, 871b1c5 and 1c6b6ff. They touch only research/e8-lemma-a-lean/. The package reuses the Lemma G package's event semantics through a Lake path dependency.

Model and coverage

Units are physical streams (family F, cover class g ∈ O(73,2)), as in #442 §2. Sources:

Lemma A is proved in #442's stream model. That the model describes the machine is inherited from #442, like the compiler.

#458 §3 states the one-helper rule as required, and rejects same-call packing into disjoint slots. Its case is the single-owner calls. The sharing calls rest on #442's model, which needs atomic invocations.

At cover class d, register r lives on the stream (F_r, d·σ_r⁻¹). The theorem needs one owner per stream. That holds whenever registers sharing a family have pairwise disjoint footprints, which covers:

On #484's words, every call of all four words satisfies the hypotheses:

word calls with one register per family other calls (disjoint footprints on a shared family) hosted blocks
headline 72/72 — 39,792
gauge80 40/72 32 (#433 slots) 38,112
kernel79 56/72 16 (#433 slots) 37,720
anchor — 72 (#442 slots) 34,560

Every hosted block lies inside its window.

The anchor is not pinned to EXPECTED and has no wrappers. Its (O′) and windows are checked by this package's checkers alone.

What is proved (Lean 4.21.0 + Mathlib v4.21.0, the pin of formal/lean on main)

theorem LemmaA.lemmaA_streams ... (hdis : ∀ r r', r ≠ r' → fam r = fam r' → Disjoint (fp (σ r)) (fp (σ r')))
    (hrec : RecipesExact T rec es) (hw : WellLabelled es l) (hS : ∀ s, S es j s = if s = j then 1 else 0)
    (hfac : ∀ v, T (labRun es l j) ((T (l j)).symm v) = Cj.rTensor B v) :
    realizeRun ⟨streamOwner fam σ d, chart⟩ rec es y (streamOwner fam σ d j) =
      (chart j).symm (Cj.rTensor B (chart j (y (streamOwner fam σ d j))))

The theorem holds over any commutative semiring, for any modules, charts and number of stages. Suppose:

  • registers sharing a family have pairwise disjoint footprints;
  • the invocation is well labelled, with exact recipes;
  • it gives the helper a unit row (Lemma G);
  • its block factors as C ⊗ id.

The last hypothesis is read in Lemma G's extended labels, where T_{λ¹}T_{λ⁰}⁻¹ = L_E⁻¹ S_E R_E⁻¹. #484's I-helper check verifies it, and Lemma G's check_extended_labels.py (run here) verifies the reading.

Then, after the complete invocation, the helper's stream holds chart⁻¹ (C ⊗ id) chart of its own initial value. The spectators are untouched.

The other Lean results:

  • Streams. streamOwner_injective(_of_disjoint): distinct routes, or disjoint footprints, give distinct streams. sweep_unique: the cover sweep visits each stream once per route.
  • Realization. realize_run: with one owner per unit, the physical execution read through the charts is the local run. one_owner_needed: within the model, sharing a unit already breaks this with a single event.
  • No other actor. whole_invocation, endpoint_indep, lemmaA_piece: the invocation acts on the helper's unit as a single-unit piece that no other unit reads.
  • Pending blocks. pieces_commute and pieces_product: pieces on disjoint blocks of one pending child commute and multiply back to the child.
  • Asynchronous whole-owner replicas: kappa 0.001357701757628940 (+1.9236% over #496) #505's variant. lemmaA_async, async_window and gather: a borrowed piece moves to its child's deadline past every commuting action, and the gathered pieces give the child. This needs three scheduling conditions:
    • the window;
    • disjoint blocks;
    • whole invocations with distinct owners.

There is no instance enumeration and no decide/native_decide. #print axioms reports only propext, Classical.choice and Quot.sound for all 24 named results. verify.py builds this package and the Lemma G package from source, scans both for sorry/axiom/native_decide, and checks every axiom report.

What is checked

hypothesis check result
exact factorization, extended labels #484 adapters_gk.py and I-helper; Lemma G check_extended_labels.py 16 headline frames; helpers 122/122, 80/80 and 79/79; 0 tag violations
unit helper rows, exact recipes, well labelled Lemma G package H1–H3 0 violations
one owner per stream; centre copies in distinct private slots; atomic calls (the template's declared loop_order) new code/check_owners.py (3 mutants rejected) 0 violations on all four words
windows, disjoint blocks, family-group windows disjoint new code/check_windows.py, written independently of #484's and #505's audits (2 mutants rejected) 0 violations on all four words

#505 and #512

#505. I replayed #505's own verify.py here, offline under Python 3.14.

On the emitted asynchronous template:

  • check_owners.py: one register per family in 72/72 calls;
  • check_windows.py: all 40,320 hosted blocks lie strictly inside their owner child's open window, with blocks disjoint.

So Variant A′'s owner and window hypotheses hold on the template emitted by replaying #505 (4ee769c) here. That template does not hash-match #505's EXPECTED.json (template_sha256 aa741871… vs 276b69e3…). The sigma-stream digest, owner, profile and κ records equal #505's shipped evidence.

Not re-checked here:

#512 (the current frontier) lists "#484 Lemma A spectator realization" as a retained condition. It reports 800 distinct physical owners per invocation and builds on #505's asynchronous machinery and #507's factory. Its invocations meet the hypotheses on that report, and its borrowing is Variant A′ under the same conditions. #512's word is not checked here; this rests on #512's own report.

Reproduce

python3 research/e8-lemma-a-lean/verify.py                                    # Lean (builds the Lemma G package too)
python3 research/e8-lemma-a-lean/verify.py --instances /abs/out/of/484/verify # plus #484's results, extended labels, owners, windows
python3 research/e8-lemma-a-lean/verify.py --no-cache --async T.json.gz       # owners and windows on an asynchronous template

Credits

Prepared by DreamingOfClouds with Claude Opus 5.5 (Anthropic), via Claude Code.

🤖 Generated with Claude Code

icekylinx and others added 14 commits October 11, 2026 19:54
…375517e-3

Both E8 suppliers of CrocSwap#434 keep their local words. Whole dirty-helper
residuals move from bank streams onto pending idle-advance coordinates
of data families that are untouched between the hosting invocation
and the advance. Bit c 1.239085e-3, complex b 1.267453e-3, kappa
618775866623647/5e17 (+9.22% over CrocSwap#434). Fresh CrocSwap#434 replay, independent
audit with nine mutation controls, two exact moments, fresh invoices
and all 47 outer inequalities.
…rance gauges on whole-residual hosting

Adds research/e8-complex-gauge-kernel (on PR442's tree) and its CI workflow.
Conditional on Lemma G (reduced to CrocSwap#425 + CrocSwap#471/CrocSwap#458 plus a schedule lemma)
and CrocSwap#458's paid adapters. Independent audit and light checks passed; heavy
full replays pending.
Prepared by DreamingOfClouds with Claude Opus 5.5 (Anthropic), via Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ions)

The Lemma G summary pinned sha256 of runtime-written .gz files, whose
container bytes depend on the zlib bundled with the Python in use, so
the Python 3.12 full run failed EXPECTED while 3.14 passed. Hash the
decompressed JSON instead (keys without .gz); regenerate those 8
EXPECTED fields and MANIFEST.json. Full fresh-copy runs pass on
Python 3.14 (--all --discover-check) and 3.12 (--all).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
research/e8-lemma-g-lean/: the abstract core of Lemma G (common-frame
conjugation for labelled event streams, matrix form of the scalar shadow,
schedule emitter for the compensation segment and centre phase, telescoping
accounting, bit-side entrance identities) proved in Lean 4.21.0 + Mathlib
v4.21.0 for every semiring, module and invertible label family; the instance
hypotheses stay checked by CrocSwap#484's Python stage plus a new extended-label
check (adapters and wrappers read as relabel events). verify.py builds the
package, scans for sorry/axiom/native_decide and checks #print axioms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, wording)

- check_extended_labels.py: a source must convert exactly once (entry adapter
  only from ('pre', i)); identity adapters pinned to frame 0 / FULL; wrappers
  keyed by the start frame; unknown events rejected; new mutant (duplicated
  source entry adapter); adapter mutants now also run on the anchor.
- code/check_adapters.py (new): CrocSwap#433's data-adapter identities on all 512
  columns of every port (H6), 0 failures on all four words.
- verify.py --instances: confirms CrocSwap#484's own checks passed on inputs equal to
  CrocSwap#484 EXPECTED.json, runs both instance checks; CrocSwap#484 files it imports are
  pinned in MANIFEST (external_files).
- PROOF/README: explicit H2 bridge and C-linearity, H6, exact statement of
  CrocSwap#484's endpoint imprecision (mid-stream adapters are identities), "every
  input" qualified by its inherited facts, semiring wording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… proved in Lean 4

research/e8-lemma-a-lean/: the realization part of Lemma A (assumed from
CrocSwap#458 s3 in CrocSwap#484) as a general theorem over any semiring, modules, charts and
stage count: one owner + whole invocation + no other actor + Lemma G's exact
endpoint + the checked factorization C_[w] x I => the helper's family ends as
chart^-1 (C x id) chart of itself, spectators untouched; necessity of the
one-owner rule; disjoint-block residuals commute and gather into the idle
child; CrocSwap#505's asynchronous borrowing as a proved window variant. Reuses the
Lemma G package (Lake path dependency, same Mathlib pin). New instance check
code/check_owners.py (literal owner injectivity on the emitted templates).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Model: units are physical streams (family, cover class) as in CrocSwap#442/CrocSwap#458
  and the template's route_semantics. New LemmaA/Streams.lean:
  streamOwner_injective(_of_disjoint), sweep_unique, lemmaA_streams (one
  owner per stream from disjoint footprints on shared families); plus
  lemmaA_piece and lemmaA_async (Lemma A feeding CrocSwap#505's window variant).
- code/check_owners.py rewritten for stream units (data wires alone,
  disjoint footprints on shared families, centre copies in distinct private
  slots, atomic calls; 3 mutants): all four CrocSwap#484 words pass, including the
  32 gauge80 / 16 kernel79 slot-sharing calls and the anchor.
- code/check_windows.py (new, independent): every hosted block inside its
  pending child's open window, blocks disjoint, family-group windows
  disjoint (2 mutants); all four words and CrocSwap#505's emitted async template.
- verify.py: runs Lemma G's check_extended_labels.py ((F) is read in the
  extended labels), fails on a missing LEMMA-A.json, checks I-helper counts
  against EXPECTED, prints the owner and window results; --async T.json.gz.
- Docs: unit model stated, coverage per word, CrocSwap#505 replay results and
  what is not re-run, commutative-semiring wording, credits CrocSwap#433/CrocSwap#442/CrocSwap#500.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e, nits)

- M1: the stream model is sourced to CrocSwap#442 section 2 (distinct slots ->
  distinct physical classes, sequential co-ownership across cover classes);
  CrocSwap#458 section 3 is cited only for g = d sigma^-1 and the fixed-route
  bijection, and its one-helper rule is stated as CrocSwap#458's case. Lemma A is
  proved in CrocSwap#442's stream model, which is inherited.
- M2: CrocSwap#505 coverage stated for the template emitted by replaying CrocSwap#505
  (4ee769c) here, which does not hash-match CrocSwap#505's EXPECTED (aa741871 vs
  276b69e3); (E), (F), per-replica order, prefix bound and invoice not
  re-checked.
- Nits: hne for data wires and centre copies; loop_order check is
  declarative; checker layout assumptions stated; commute_of_not_mem axiom
  probe (24 named results); anchor coverage rests on this package's
  checkers; CrocSwap#512 rests on its own report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DreamingOfClouds DreamingOfClouds changed the title [Draft] Lemma A of #484: the realization of paid wrappers and spectators, proved in Lean 4 Lemma A of #484: the realization of paid wrappers and spectators, proved in Lean 4 Oct 11, 2026
@DreamingOfClouds
DreamingOfClouds marked this pull request as ready for review October 11, 2026 23:58
@DreamingOfClouds

Copy link
Copy Markdown
Contributor Author

Note: code/check_windows.py hard-codes #484's family layout (scope limit; claims unaffected)

Proof. The checker decodes a family id as orep, ps, port = f // 960, (f % 960) // 120, f % 120, which assumes #484's layout: 8 pending children × 120 ports = 960 families per replica. Run unchanged on #523's punctured word (published evidence/hosted/GLOBAL-TEMPLATE.json.gz: 112 ports, so 8 × 112 = 896 families per replica, live 7,168), it reports 35,543 false violations, the first being call 0,0: family 2351 is not on child 4. These are decoding errors, not real window or disjointness failures.

Fix (logic unchanged). Derive the layout from the template:

NPORT = len(t['port_restriction']['new_to_old']) if 'port_restriction' in t else 120
FPR = t['live'] // len(allreps); assert FPR == 8 * NPORT, (FPR, NPORT)
orep, ps, port = f // FPR, (f % FPR) // NPORT, f % NPORT

With this change:

Scope. This PR's claims (#484's four words and the #505 template) all use the 960/120 layout, so they are unaffected. The fix only matters for running verify.py --async on punctured or otherwise re-ported words such as #523. For the record: with the parameterised window check, #523's word and its 784-owner allocation also pass check_owners (72/72 calls, 3/3 mutants) and the Lemma G checks of #484 and #509.

DreamingOfClouds with Claude Opus 5.5 (Anthropic), via Claude Code.

@Mister-Meeseeks
Mister-Meeseeks merged commit 69d09f4 into CrocSwap:main Oct 12, 2026
61 of 64 checks passed
@Mister-Meeseeks

Copy link
Copy Markdown
Contributor

Integrated into published main at 681e8923a0f23a19f93c7105c3a9c96149aa8362, preserving the original commits, notices and contributor credit. Thank you for the contribution.

The Lemma A stream-model proofs build in Lean 4.21.0, with 24 named axiom reports and owner/window/extended-label checks on the four freshly reconstructed words.

The scoped review and pinned execution receipts record the exact coverage and remaining assumptions. This strengthens specific interfaces and preserves useful research; it does not change the selected κ or establish the complete multiplication theorem. Local checks passed; fresh Linux CI was queued at publication.

thakrarsagar added a commit to thakrarsagar/integer-mult-bounds that referenced this pull request Oct 14, 2026
…kernel A

- The certificate's fresh invoice pins WRAPPER-CHECKS.json's bytes (now
  bound and recorded); the gap is that no chain code reads its status, and
  exactness comes only from the producer's own generation and decoding
  (re-run in the cold replay, verify_slots.py:103).
- Overlap: CrocSwap#1697 covers 0:1000..0:1003 as hyperplane cases, CrocSwap#1611 tied
  2:999 to Exact.lean pair 3; only the 22 FULL-ended records were
  producer-only. Byte-identical example corrected.
- Kernel B's monomial and F_w are checked against kernel A on every column
  before evaluation; RESULT records per-kernel counts; dead adjoint removed.
- Controls: width -1 and +1; residual events must be pre/post only; exact
  record field sets. 17 tests.
- Credits: Lemma A (CrocSwap#516), producer hpe_adapters_local.py (DreamingOfClouds),
  PR425 (jacklightChen).
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.

5 participants