Space of run paths and of halted runs #
The additions of Christian Reitwiessner's branch crei/tidy-universal and of cslib PR #1111 to
Cslib.Computability.Machines.Turing.MultiTape.TapeLemmas.
MultiTapeTM.space (the space of the first t steps from a configuration) is read through the
cells each head visits: the visited set is monotone, splits along a run, stops growing once the
machine halts, and depends only on the head positions.
MultiTapeNTM.RunPath.space_le_mul_time_add_one bounds the space of any run path by its length.
MultiTapeTM.runsInSpace_of_runPath turns the space of a single run path to a halted configuration
into a space bound for every computation path, since a deterministic machine stays where it is
after halting.
Main results #
Turing.MultiTapeNTM.RunPath.space_le_mul_time_add_one.Turing.MultiTapeTM.mem_of_last_halted,Turing.MultiTapeTM.runsInSpace_of_runPath.Turing.MultiTapeTM.space_add_le,Turing.MultiTapeTM.space_eq_of_halt,Turing.MultiTapeTM.space_eq_of_workTapePos: the space of a run, split, after halting, and of runs with the same head positions.Turing.MultiTapeTM.runsInSpace_of_halted: a space bound on a halted run bounds every computation path.Turing.MultiTapeTM.exists_runPath_iff_runFrom: a run path to a halted configuration is the run of the given number of steps, with its space.Turing.MultiTapeTM.exists_visitedByTapeHead_eq_Icc,Turing.MultiTapeTM.workTapes_runFrom_eq_of_notMem_visitedByTapeHead: the visited cells of a work-tape head form an interval, and unvisited cells keep their contents.
Each head visits at most one cell per configuration, so a path visits at most k * (time + 1)
cells.
Space of halted runs #
Every configuration on a path from the head of a path that ends halted lies on that path: after halting, a deterministic machine stays where it is.
A run path from the initial configuration to a halted configuration, using at most s cells,
bounds the space of every computation path by s.
Space of runs #
The space of a run is the sum of the space used by each tape.
Every position the head takes up to step t lies in S, so the whole visited set does. This
is Finset.image_subset_iff for the visited set, and the workhorse behind the space bounds
below.
A set containing every position of a head bounds the space used by its tape.
A run that starts with the head of tape i at cell 0 and uses at most s cells keeps that
head within [-s, s].
A run whose heads all stay within [-σ, σ] uses at most 2 * σ + 1 cells per tape.
A head that never moves uses a single cell.
The cells a run visits are the ones visited by its two halves.
Splitting a run into two phases can only overcount the cells it visits, since the two phases may revisit each other's cells.
Space usage only depends on where the work-tape heads are at each step, so two runs whose head positions agree use the same space. This is what lets a machine be replaced by a simulation of it.
After the machine has halted the heads no longer move, so the visited set stops growing.
After the machine has halted the heads no longer move, so the space usage stops growing.
A run that never moves a work-tape head visits one cell per tape.
Space of computation paths #
The space of a computation path is the space of the run of the same length.
A machine that has halted by step t, using at most s cells, uses at most s cells on every
computation path.
Run paths to halted configurations as runs #
A run path from cfg to a halted configuration cfg' within t steps and s cells is the run
of t steps from cfg, which ends in cfg' and uses at most s cells.
The cells visited by a head up to step n form an interval.
A cell the head of a tape never visits keeps its contents.