feat(MultiTapeTM): Nondeterministic multi-tape Turing machines - #820
Open
barni120400 wants to merge 4 commits into
Open
feat(MultiTapeTM): Nondeterministic multi-tape Turing machines#820barni120400 wants to merge 4 commits into
barni120400 wants to merge 4 commits into
Conversation
crei
reviewed
Aug 19, 2026
| /-- `ntm` has a computation on `input` that starts at the initial configuration, halts, emits | ||
| `output` and satisfies `P`. The notions below are its instances, so their constraints all refer to | ||
| a single computation. -/ | ||
| def ComputesSuchThat (ntm : MultiTapeNTM k Symbol State) (input output : List Symbol) |
Collaborator
There was a problem hiding this comment.
This kind of hides the fact that P only has to hold for some computation path. Maybe this should be a bit more visible in the name?
Author
There was a problem hiding this comment.
I did it on purpose, because by definition a computation of a non-deterministic machine is existance of a computation path.
So I didn't want to carry this existence in the name outside the "ComputesSuchThat".
I think the alternative is "ExistComputationPathSuchThat" but I think "ComputesSuchThat" is better
barni120400
force-pushed
the
multitape/ntm
branch
from
August 20, 2026 08:58
ff38796 to
52f938a
Compare
crei
reviewed
Aug 20, 2026
crei
reviewed
Aug 20, 2026
crei
reviewed
Aug 20, 2026
crei
reviewed
Aug 20, 2026
crei
reviewed
Aug 20, 2026
crei
reviewed
Aug 20, 2026
crei
reviewed
Aug 20, 2026
barni120400
force-pushed
the
multitape/ntm
branch
from
August 20, 2026 15:26
52f938a to
bcd837a
Compare
The configuration gains an `output` field holding the symbols emitted so far, `step` appends to it and `initCfg` starts it empty. The output of a run can then be read off its final configuration, so `outputString` and its lemmas are replaced by `step_output` and existing facts about `configs`, and `ComputesInTimeAndSpace` reads the output from the configuration it already mentions. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`configs` returns the single configuration reached after `t` steps, not a sequence of configurations, so the plural name did not match the type. It also depends on `tm` only through its step function. Renamed to `runFrom`, along with its five lemmas. Pure rename, no change to any statement or proof. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Keep the design section free of storage details, list the output tape among a configuration's components, and drop the stale `BiTape` mention. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A nondeterministic machine replaces the transition function by a transition relation. Configurations and the effect of an action move to a shared `MultiTape/Configuration.lean`; no existing statement changes meaning. A computation path is a `RelSeries` of the step relation starting at the initial configuration, so Mathlib supplies its length, the configurations it passes through, and the one it ends at. `MultiTapeTM.toNTM` embeds the deterministic machine and `toNTM_computes` shows the embedding preserves computation in bounded time and space. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
barni120400
force-pushed
the
multitape/ntm
branch
from
August 20, 2026 15:43
bcd837a to
e9426ed
Compare
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.
Builds on #819 — only the last commit is new here, the first three are that PR.
Adds nondeterministic multi-tape Turing machines: the transition function is replaced by a transition relation, and a computation is a
RelSeriesof the step relation starting at the initial configuration, so its length, the configurations it visits and the one it halts in all come from Mathlib.MultiTapeTM.toNTMembeds the deterministic machine and preserves computation in bounded time and space.Configurations and the effect of a transition move to a shared
MultiTape/Basic.lean. No existing statement changes meaning.NB: claude was used heavily throughout.