Mathlib stack-machine computations within polynomial space #
The simulation stores one encoded source configuration and a binary clock. Its space bound
depends on the sizes of the intermediate configurations, independently of the number of rounds.
All source stacks count towards space, including the initial input and final output.
The terminating-computation theorem derives an exponential clock from the polynomial stack
bound; it does not require a runtime certificate. The simulation gives polynomial space overhead,
rather than an assertion of a linear space bound.
TM2.Reverse.Transfer supplies the converse comparison and PSPACE decision equivalence under
the original binary encodings. Its target counts input and output storage, so it does not
preserve sublinear native work-space bounds.
Main definitions #
Turing.TM2Computable.StacksBounded: a uniform bound on all reachable stack lengths.
Main results #
Turing.TM2.run_polySpace: a polynomial-time binary clock and polynomially bounded source stacks give a polynomial-space simulation.Turing.TM2Computable.computableInPolySpace_encList: transfer termination and a polynomial source-stack bound to polynomial-space computation.
References #
Iterate a source machine using a binary clock. The source input may be computed from a typed input; only its actual intermediate stacks need to obey the supplied space bound.
Every stack of every configuration reached from the encoded input a has length at most
space a. Since Turing.TM2.stepTotal fixes halted configurations, this bounds the initial,
intermediate and final stacks of the computation.
Instances For
A terminating Mathlib computation with polynomially bounded source stacks is computable within polynomial space. No source runtime bound or computable space bound is needed. The bound includes the input and output stacks at initialization, during execution and at halting.