refactor(MultiTapeTM): Make the deterministic machine a nondeterministic one - #821
Draft
barni120400 wants to merge 6 commits into
Draft
refactor(MultiTapeTM): Make the deterministic machine a nondeterministic one#821barni120400 wants to merge 6 commits into
barni120400 wants to merge 6 commits into
Conversation
barni120400
marked this pull request as draft
August 20, 2026 08:58
barni120400
force-pushed
the
multitape/ntm-deterministic
branch
2 times, most recently
from
August 20, 2026 15:27
98baaee to
ca7bec3
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>
…tic one `MultiTapeTM` now extends `MultiTapeNTM`, permitting exactly the transition its transition function prescribes, with `ofTr` building one from a transition function. Everything defined for the nondeterministic machine therefore applies to it, and the separate embedding file is gone. Determinism makes those notions concrete: a step is what `step` computes (`ntmStep_iff`, replacing `TransitionRelation`), every computation is the machine's own run (`computation_toFun`), and computing is a statement about that run (`computesInTimeAndSpace_iff`). Space is now defined once, on `Computation`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…e space measures A `Run` is a series of steps from anywhere; a `Computation` is a run starting at the initial configuration. `visited`, `spaceByTape` and `space` are therefore defined for arbitrary runs, and the lemmas about them live with the other tape lemmas. `spaceUsed_eq_run_space` relates the deterministic measures to them from any configuration. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
barni120400
force-pushed
the
multitape/ntm-deterministic
branch
from
August 20, 2026 15:44
ca7bec3 to
a03c9d4
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 #820 — only the last commit is new here.
MultiTapeTMnow extendsMultiTapeNTM, permitting exactly the transition its transition function prescribes, withofTrbuilding one from a transition function. Everything defined for the nondeterministic machine therefore applies to it directly, and the separate embedding file is gone.Determinism makes those notions concrete: a step is what
stepcomputes, every computation is the machine's own run, and computing is a statement about that run. Space is now defined once, on a computation.NB: claude was used heavily throughout.