feat(MultiTapeTM): add tape redirection plumbing - #936
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
barni120400
reviewed
Sep 23, 2026
barni120400
reviewed
Sep 23, 2026
barni120400
reviewed
Sep 23, 2026
Replace `rw [show ... from Function.iterate_succ_apply' ..]` with a direct `rw [runFrom, Function.iterate_succ_apply', ← runFrom]` in the three proofs that previously relied on the removed `runFrom_succ_eq_step'` wrapper lemma. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore the concise case-split proof used on main before Action.apply lost its blanket @[simp]: add Action.apply explicitly to the simp set in the `some q` case instead of manually unfolding via Prod.ext/Storage.ext. Verified this avoids the linter.flexible warning under --wfail --iofail. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adapt proofs to the new `Fin.append`/`Fin.natAdd`/`invOfMemRange`-based definitions of `inCfg` (InputFromTape) and `partialInv` (ExtendTapes): - Replace subtype literals `⟨k, by omega⟩`/`⟨k + 1, by omega⟩` with `Fin.natAdd k 0`/`Fin.natAdd k 1` throughout InputFromTape.lean to match the new definition's indexing. - Fix `inCfg_workTapes_vip`/`_flag` and `inCfg_workTapePos_vip`/`_flag`, which no longer reduced by `simp [inCfg]` alone under the `Fin.append` encoding (removes a leftover `sorry`). - Simplify `partialInv_isPartialInv` to use the dedicated `Function.Embedding.left_inv_of_invOfMemRange`/ `right_inv_of_invOfMemRange` lemmas instead of manually re-deriving them via `Fintype.choose_spec`, matching the new `invOfMemRange`-based `partialInv` definition. Verified with lake build --wfail --iofail, mk_all --check, lake test, lake lint, lake exe lint-style. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
crei
marked this pull request as ready for review
September 25, 2026 06:00
crei
requested review from
SamuelSchlesinger,
arademaker,
chenson2018,
fmontesi,
kim-em and
sorrachai
as code owners
September 25, 2026 06:00
… modifiers Add `runFrom_comm`, which lifts a step-semiconjugation to whole runs, and `spaceUsed_le_of_workTapePos_embedding`, which bounds the space of a simulation that tracks the original heads on embedded tapes. The run and space lemmas of `extendTapes`, `inputFromTape` and `outputToTape` become applications of these, and the step lemmas are shortened to a case split on the tape index followed by `simp`. `Action.apply` now derives its projection lemmas with `@[simps -fullyApplied]`, unused lemmas are removed, and the `inputFromTape` reading lemmas are public simp lemmas stated in terms of `inCfg`.
Restore `step_inputPos_of_state`, `step_workTapes_of_state`, `step_workTapePos_of_state`, `inputPos_runFrom_le` and `val_moveInputPos_le`, which later plumbing uses. Drop `runFrom_comm` in favour of `Function.Semiconj.iterate_right`, as leanprover#942 did, passing only the configuration map. `inputFromTape` builds its tape actions with `Fin.append` like `inCfg`, the space lemma takes its embedding as `e` with the hypothesis oriented like `spaceUsed_eq_of_workTapePos`, and `val_moveInputPos_sub_one` is renamed to `val_moveInputPos_sub_one_eq_clampMove`.
…pe-plumbing-refactor refactor(MultiTapeTM): simplify the tape redirection plumbing
SamuelSchlesinger
approved these changes
Sep 26, 2026
SamuelSchlesinger
enabled auto-merge
September 26, 2026 03:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds TM modifiers to use work tapes instead of input or output tapes