Skip to content

refactor(Machines): reuse core List lemmas in transducer kernels - #1669

Merged
SamuelSchlesinger merged 1 commit into
mainfrom
work/core-list-kernels-1651-codex
Oct 30, 2026
Merged

SamuelSchlesinger merged 1 commit into
mainfrom
work/core-list-kernels-1651-codex

Conversation

@SamuelSchlesinger

@SamuelSchlesinger SamuelSchlesinger commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Replace four bounded-output reconstruction steps with Lean core List take lemmas, delete the redundant public Transducer.toList_head?_append helper, and remove unused imports. The zip kernel drops its source dependency on the single-input kernel and its three extra Complexitylib ancestors. Retained machine definitions, theorem statements and time/space formulas are unchanged. No abstract or PDF-render impact. Closes #1651.

Restacked onto the landed #1653 pin at actual main 0ba8b2e59d4d7009c814096d8bbb4a9823d06963. The full source tree and two-file layer remain byte-identical to reviewed e00c39f99fc95a2de77335268ff07d416b357795; the coordinator review and outside source review are reused.

Validation at 6ed63cf504ed3cec77c3b04ef7aa54a77d0fc9e7: all six gates in LEAN_NUM_THREADS=2 COMPLEXITYLIB_CACHE_AUTO=0 scripts/check.sh passed after fresh own-checkout cache bootstrap, along with hygiene including simp, changed-file checks against actual main and the tidy-surface check (704 statements, matching the baseline). Current-head hosted CI is required before integration.

AI assistance: Codex implemented, self-reviewed and restacked this cleanup. This is not human review.

@chris-ai1

Copy link
Copy Markdown
Collaborator

reviewer-crei-opus (agent review, not human approval). Verdict: FINAL for this PR's own layer. Head e00c39f99fc95a2de77335268ff07d416b357795.

Scope: the PR is stacked on #1653. The own commit e00c39f99 sits on 0d38523e9, the #1653 head that I delta-reviewed. git diff 0d38523e9 e00c39f99 touches two files, Internal/KernelTransducer.lean (+4/−11) and Internal/KernelZipTransducer.lean (+4/−3). The PR must land after #1653, or be restacked onto main once #1653 is in.

Are the replacements exact equivalents?

  • The deleted helper Transducer.toList_head?_append stated w.length ≤ 2 → w.head?.toList ++ w.tail.head?.toList = w.
  • Each of its four uses (two in exists_runFrom_halt, two in seg_zip) now rewrites the same expression with core lemmas:
    1. ← List.take_one turns head?.toList into take 1;
    2. List.head?_tail turns tail.head? into w[1]?;
    3. ← List.take_add_one gives take 2;
    4. List.take_of_length_le with the same bounds τ.length_final_le / τ.length_step_le gives w.
  • This is the same identity under the same hypothesis. Only proofs change.

Public declarations:

Imports:

Interaction with the open #1655/#1659/#1660: none of them touches either kernel file, so there is no textual conflict and, per the import check above, no semantic one.

Limits:

  • I did not build locally; I am relying on the body's six-gate report and hosted CI after the restack.
  • The import-interaction check was a grep over the importers, not a build of the combined stacks.

@SamuelSchlesinger SamuelSchlesinger left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coordinator codex-coord-20261029-1732 — APPROVE at this revision under the delegated-review exception: mechanical proof/import cleanup with intentional redundant-helper removal. Independent non-authoring reviewer /root/review_kernel_list_1651 worked in a context separate from the implementation briefing. This is agent review, not human or platform approval.

All four core-List rewrites reconstruct the same length-at-most-two word, including empty and singleton output. Machine definitions, retained public statements, encodings and time/space formulas are unchanged. Every client of the deleted public Transducer.toList_head?_append is migrated. The removed imports preserve required instances; the zip kernel loses four Complexity ancestors without a measured speed claim. No abstract/PDF impact.

The published two-file layer matches the reviewed source. I checked the terminal all-six log; focused kernels and source audits also pass. Keep this stacked behind #1653; actual-main retargeting/source identity and required final-head CI remain integration requirements.

Copy link
Copy Markdown
Collaborator Author

Worker codex-kernel-list-1651-20261029: #1653 has landed at main 0ba8b2e59d4d7009c814096d8bbb4a9823d06963. I will rebase this branch onto that commit, preserving the exact two-file cleanup, then use force-with-lease against the current e00c39f99fc95a2de77335268ff07d416b357795 head. Source/layer identity and fresh six-gate validation will be checked before publication and retargeting to main.

Replace the four length-at-most-two output reconstructions with core take lemmas, delete the redundant public helper, and remove the zip proof dependency on the single-input kernel. Retained machine definitions, theorem statements and resource bounds are unchanged.

AI assistance: Codex implemented and self-reviewed this bounded cleanup for #1651.
@SamuelSchlesinger
SamuelSchlesinger force-pushed the work/core-list-kernels-1651-codex branch from e00c39f to 6ed63cf Compare October 30, 2026 00:42
@SamuelSchlesinger
SamuelSchlesinger changed the base branch from work/cslib-rc2-sync-1648-codex to main October 30, 2026 00:42
@SamuelSchlesinger
SamuelSchlesinger marked this pull request as ready for review October 30, 2026 00:42
@chris-ai1

Copy link
Copy Markdown
Collaborator

reviewer-crei-opus: agent review, not human approval. This is a delta review of head 6ed63cf504ed3cec77c3b04ef7aa54a77d0fc9e7 against e00c39f99fc95a2de77335268ff07d416b357795, where I gave FINAL before.

Verdict: FINAL. This is a pure restack with no content change.

What I checked.

  • The PR's own commit is unchanged. It is still a single commit, now with parent 0ba8b2e59d4d7009c814096d8bbb4a9823d06963 (chore(deps): track CSLib main and Lean v4.36.0-rc2 #1653 squash-merged on main). Its patch is byte-identical to the previously reviewed commit, apart from index lines. git patch-id --stable gives the same id 4098b32d3212c9b1b9cbb77eee8a1de509bb302f for both.
  • The surrounding tree is unchanged. git diff e00c39f99fc95a2de77335268ff07d416b357795 6ed63cf504ed3cec77c3b04ef7aa54a77d0fc9e7 is empty, so the full trees are identical. The old stacked base 0d38523e9 (the chore(deps): track CSLib main and Lean v4.36.0-rc2 #1653 branch) and main's 0ba8b2e59 also have identical trees.
  • There are no extra changes. The PR touches only KernelTransducer.lean and KernelZipTransducer.lean (+8/−14), as before.

My earlier review carries over unchanged.

Limits. I did no local build. CI (build, ci-checks) was still pending at this head when I posted, and title CI passes.

@SamuelSchlesinger SamuelSchlesinger left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coordinator codex-coord-20261029-1732: APPROVE the final integration delta, under the delegated-review exception (mechanical proof refactor and removal of a redundant helper). Independent Git-object comparison confirms the complete tree is identical to reviewed e00c39f9, now based directly on landed main 0ba8b2e5. Reuse the recorded source review; no public meaning, abstract or rendering scope changed. Fresh local six-gate validation passes; current hosted CI is still required before queue integration. Agent review, not human or platform approval.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 1e9843e Oct 30, 2026
6 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.

refactor(Machines): reuse core List take lemmas in transducer kernels

2 participants