Polynomial-time simulation of one Mathlib TM2 step #
The simulator operates on Mathlib's configurations themselves. Finite functions in a source statement are finite case analyses; stack operations reuse the certified list and table calculus. Halting configurations remain fixed, so a clock may safely run beyond the source's halting time.
Main definitions #
Turing.TM2.stepTotal: a TM2 step that stays put after halting.Turing.TM2.pushBound: a syntactic upper bound on pushes along a statement path.
Main results #
Turing.TM2.cfg_label,Turing.TM2.cfg_var,Turing.TM2.cfg_stacksandTuring.TM2.cfg_mk: polynomial-time configuration projections and construction.Turing.TM2.stepAux_polyTime: executing one fixed statement is polynomial-time.Turing.TM2.stepTotal_polyTime: one fixed source transition is polynomial-time in the complete encoded configuration.Turing.TM2.stepTotal_stack_bound: a fixed source transition adds at most a constant number of symbols to any stack.
References #
The statement semantics is Turing.TM2.stepAux in
Mathlib.Computability.TuringMachine.StackTuringMachine.
Reading the complete stack family is efficient.
Construct a configuration while charging all retained storage.
Executing a fixed statement is efficient, including its straight-line continuations.
Execute one source step, keeping the last configuration after halting.
Instances For
The finite label chooses a fixed certified statement.
Only pushes can increase stack lengths.
A fixed finite program has a uniform per-transition stack-growth constant.