Skip to content

refactor(MultiTape): remove the deterministic space measures - #1122

Open
barni120400 wants to merge 2 commits into
leanprover:mainfrom
barni120400:refactor/multitape-single-space-api
Open

barni120400 wants to merge 2 commits into
leanprover:mainfrom
barni120400:refactor/multitape-single-space-api

Conversation

@barni120400

@barni120400 barni120400 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Removes MultiTapeTM.visitedByTapeHead, spaceUsedByTape and space, so space is counted only on run and computation paths. The visitation and displacement lemmas move to run paths and hold for nondeterministic machines.

Counts the storages and cores in ConfigBound at the ends of computation paths, bounded by RunsInSpace, with unchanged numerical bounds. The computation paths of a deterministic machine are prefixes of one another (RunPath.eq_take), so the one visiting the most cells contains the windows of every other.

Depends on #1145: its commit is included temporarily and will leave this diff when it merges.

Composed with Claude Code.

@barni120400
barni120400 force-pushed the refactor/multitape-single-space-api branch 3 times, most recently from 18fe0f6 to 875ec7a Compare October 13, 2026 20:29
@barni120400
barni120400 force-pushed the refactor/multitape-single-space-api branch 6 times, most recently from 7c96b26 to e129036 Compare October 14, 2026 16:09
ctchou pushed a commit to ctchou/cslib that referenced this pull request Oct 15, 2026
Renames `MultiTapeTM.spaceUsed` to `space`, matching `RunPath.space` and
`ComputationPath.space`: `tm.space cfg t` is the space of the path of
the first `t` steps from `cfg`. The lemmas named after it follow.

Depends on leanprover#1117: its commits are included temporarily and will leave
this diff when that PR merges. The stack continues in leanprover#1122.

Composed with Claude Code.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@barni120400
barni120400 force-pushed the refactor/multitape-single-space-api branch 3 times, most recently from a73142b to 09736d7 Compare October 18, 2026 15:05
barni120400 and others added 2 commits October 20, 2026 00:38
The windows, the bounds of a path's space by sets containing its head
positions, and the space of a mapped path move from TapeLemmas.lean to
Space.lean, next to the space measures; `prependOutputHom` moves to
Nondeterministic.lean. Prepending output keeps every head in place, so
`transformsTapes_iff_nil_output` reuses the space bound as it is, and
the then unused `space_map_eq` goes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Space is counted only on run and computation paths. The visitation and
displacement lemmas hold for the run paths of nondeterministic
machines, and the configuration bounds take `RunsInSpace` and count the
storages and cores at the ends of computation paths: the computation
paths of a deterministic machine are prefixes of one another, so the
one visiting the most cells contains the windows of every other. The
deterministic `visitedByTapeHead`, `spaceUsedByTape` and `space` go,
with their lemmas and the unused `core_step_eq_of_core_eq`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@barni120400
barni120400 force-pushed the refactor/multitape-single-space-api branch from 09736d7 to 516b637 Compare October 19, 2026 21:40
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