From Mathlib TM2 computations to CSLib polynomial time #
Mathlib counts one fixed stack-machine statement per transition. The simulation certifies each statement using CSLib's list and finite-table calculus, then iterates it for the source polynomial clock. Encoded configurations have linear growth in source time. The resulting certificate is for an actual tidy binary multi-tape Turing machine, with polynomial time and space.
Input and output words use encList (encFinite _). Their alphabets may differ or be empty.
Typed encoders must be injective, as required by CSLib. Every working alphabet must be finite;
Mathlib's FinTM2 alone only guarantees finiteness of the input alphabet.
Main results #
Turing.TM2ComputableInPolyTime.computableTidilyInPolyTime: transfer a typed Mathlib polynomial-time certificate to CSLib.
This is a polynomial-time bridge, not a space-preserving simulation or a converse equivalence.
References #
The source model and runtime convention are Mathlib's
Mathlib.Computability.TuringMachine.Computable and
Mathlib.Computability.TuringMachine.StackTuringMachine. This is a direct proof through the
tidy calculus, independent of the TM2-to-TM0 compiler in
Complexitylib PR #72.
Initialization copies the source input and supplies empty auxiliary stacks.
Polynomially many source steps have polynomially bounded encoded intermediate states.
A finite-alphabet Mathlib certificate gives tidy CSLib polynomial-time computation under the standard binary encodings of its input and output words.