Skip to content

refactor(MultiTapeTM): share computation predicates - #1153

Open
barni120400 wants to merge 3 commits into
leanprover:mainfrom
barni120400:refactor/multitape-computes-such-that
Open

barni120400 wants to merge 3 commits into
leanprover:mainfrom
barni120400:refactor/multitape-computes-such-that

Conversation

@barni120400

Copy link
Copy Markdown
Contributor

Factor deterministic computation and computability through ComputesSuchThat, ComputesFunSuchThat, and ComputableSuchThat, with predicates on the machine and input and shared definitions for time, space, and combined bounds. Depends on #1152, whose commits are included until it merges. Implemented with Codex.

barni120400 and others added 3 commits October 27, 2026 02:30
A machine follows another when it performs each of its transitions
through an adapter: what the inner machine reads, computed from the
symbols under the heads of the outer machine (`HeadSymbols`), and the
outer action performing each inner action. `adapt` runs a machine
through an adapter, and `Follows.runningStepHom` and `Follows.stepHom`
turn a configuration map that agrees with the adapter into a
homomorphism of step relations.

`extendTapes`, `outputToTape` and `inputFromTape` run `tm` through their
adapters, so their homomorphisms come from `follows_adapt`. `seq` and
`repeatUntilBlank` relabel the actions of their inner machines with
`Action.mapState` and follow them by definition, and `prependOutputHom`
follows the machine itself. This replaces the step lemmas of each
simulation and the deterministic `stepHom` and `runningStepHom`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds visit sequences of run paths and an input-shortening theorem for
multi-tape Turing machines: when two input cells carry the same symbol
and a halting computation path visits them with the same storages,
deleting the cells after the first through the second preserves every
storage reached by a step on either retained side. A long enough input
to a space-bounded machine has such a pair of cells.

Collapsing the cut is a homomorphism from the steps on one retained
side to the steps of the machine with its output erased,
`MultiTapeTM.eraseOutput`, built with `adapt`. It comes from the
single-step lemma `Follows.step`, which now also gives `stepHom` and
`runningStepHom`. Segments of the path between boundary visits map
with `RelSeries.map` and join with `smash`, and all statements are
about computation paths. Replaces the unused
`not_halts_of_repeat_nonhalt` with its path version,
`RunPath.injOn_running`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Factor deterministic computation and computability through `ComputesSuchThat`,
`ComputesFunSuchThat` and `ComputableSuchThat`, with predicates on the machine and
input and shared definitions for time, space and combined bounds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@barni120400
barni120400 force-pushed the refactor/multitape-computes-such-that branch from 39d6956 to ccbef1d Compare October 27, 2026 00:31
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.

1 participant