feat(MultiTapeTM): halting-time, output-length, and visited-position lemmas for multi-tape TMs - #816
Open
SamuelSchlesinger wants to merge 1 commit into
Conversation
…lti-tape TMs General lemmas independent of any particular construction: - exists_minimal_halting_config: a padded halting run has a least halting time reaching the same configuration - outputString_length_le / output_length_le_time: the output is no longer than the elapsed time - spaceUsedByTape_le_of_positions: space comparison between two machines via inclusion of visited head positions
SamuelSchlesinger
requested review from
chenson2018 and
fmontesi
as code owners
August 18, 2026 16:20
crei
reviewed
Aug 18, 2026
|
|
||
| /-- Every padded halting computation has a least halting time, and the configuration there is the | ||
| same as at the padded time. -/ | ||
| lemma exists_minimal_halting_config (tm : MultiTapeTM k Symbol State) |
Collaborator
There was a problem hiding this comment.
I think this lemma could be reworked a little. It seems to be related to haltsAtStep and halting_step_unique, so should maybe move there. Also the conjunction is rather complicated, maybe it should be split?
Maybe we could also prove Monotone fun t => (tm.configs cfg t).state.isNone?
crei
reviewed
Aug 18, 2026
Comment on lines
+433
to
+436
| have hone : (tm.outputSymbol (tm.configs cfg t)).toList.length ≤ 1 := by | ||
| cases tm.outputSymbol (tm.configs cfg t) <;> simp | ||
| simp only [List.length_append] | ||
| omega |
Collaborator
There was a problem hiding this comment.
There does not seem to be a lemma Option.toList_length (x : Option α) : x.toList.length ≤ 1 (which would he hone). But maybe this one suffices (I did not test it):
Suggested change
| have hone : (tm.outputSymbol (tm.configs cfg t)).toList.length ≤ 1 := by | |
| cases tm.outputSymbol (tm.configs cfg t) <;> simp | |
| simp only [List.length_append] | |
| omega | |
| grind [Option.toList] |
crei
reviewed
Aug 18, 2026
| _ = k * t + k := by simp [Nat.mul_succ] | ||
|
|
||
| /-- | ||
| The space used by one tape is monotone under inclusion of its visited head positions in the |
Collaborator
There was a problem hiding this comment.
I think this lemma deserves a bit more explanation, in particular, I don't understand the meaning of hpos.
Collaborator
|
Heads up: This might conflict with #819 |
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 is in advance of a PR for Turing machine composition.