Skip to content

feat(MultitapeTM): Prove an exponential upper bound in the number of configurations reachable in bounded space - #772

Open
crei wants to merge 8 commits into
leanprover:mainfrom
crei:configs_reachable_in_bounded_space
Open

feat(MultitapeTM): Prove an exponential upper bound in the number of configurations reachable in bounded space#772
crei wants to merge 8 commits into
leanprover:mainfrom
crei:configs_reachable_in_bounded_space

Conversation

@crei

@crei crei commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Proves an upper bound on the number of configurations reachable in bounded space on a multi-tape TM.

The proof introduces the concept of Storage, the projection of Cfg that only contain the state and the work tapes. It shows that if the TM uses at most s space, there is an injection to a structure that only uses [-s, s] to index the tape.

@crei

crei commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

#819 should be merged first, I'll update this one in a minute.

@crei
crei marked this pull request as draft August 27, 2026 10:28
@crei
crei marked this pull request as ready for review August 29, 2026 09:56
@crei

crei commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator Author

This is now updated to the new definition of Cfg. I kept most of it so that it also applies to nondeterministic machines, so once that is merged, it should be easy to adapt.

Comment thread Cslib/Computability/Machines/Turing/MultiTape/ConfigBound.lean Outdated
Comment thread Cslib/Computability/Machines/Turing/MultiTape/ConfigBound.lean Outdated
Comment thread Cslib/Computability/Machines/Turing/MultiTape/ConfigBound.lean Outdated
Comment thread Cslib/Computability/Machines/Turing/MultiTape/ConfigBound.lean Outdated
Comment thread Cslib/Computability/Machines/Turing/MultiTape/ConfigBound.lean Outdated
Comment thread Cslib/Computability/Machines/Turing/MultiTape/ConfigBound.lean
Comment thread Cslib/Computability/Machines/Turing/MultiTape/TapeLemmas.lean Outdated
Comment thread Cslib/Computability/Machines/Turing/MultiTape/ConfigBound.lean Outdated
Comment thread Cslib.lean Outdated
Comment thread Cslib/Computability/Machines/Turing/MultiTape/ConfigBound.lean Outdated

/-- The part of a configuration that the machine can still read: the input head position together
with the `Storage`, i.e. the configuration without the write-only output tape. -/
def Cfg.core (c : Cfg k Symbol State input) :

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't how good the terms "Storage" and "Core". I don't see any standard name for specifically these stuff, so maybe just call them ore explicitely instead of assigning new terms?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's difficult for storage and I would say it's a good name because this is the part where the TM can store information. For core I kind of agree. What about accessibleMemory?

Comment on lines +72 to +73
open Cslib

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
open Cslib

/-- The restriction is injective on storages that fit in the windows. -/
lemma Storage.toBounded_injOn (w : Fin k → ℕ) :
Set.InjOn (Storage.toBounded (Symbol := Symbol) (State := State) · w) {x | x.FitsIn w} := by
rintro x ⟨hxp, hxc⟩ y ⟨hyp, hyc⟩ hxy

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rintro x ⟨hxp, hxc⟩ y ⟨hyp, hyc⟩ hxy
rintro x ⟨_, _⟩ y ⟨_, _⟩ hxy


/-! ## The storage and the core of a configuration

Now we relate `Cfg` and `Storage` by givin the projection.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Now we relate `Cfg` and `Storage` by givin the projection.
Now we relate `Cfg` and `Storage` by giving the projection.

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.

4 participants