Mathlib TM2 string computations belong to canonical FP #
A polynomial-time Mathlib certificate for a total binary-string function yields membership in Complexitylib's canonical machine-based FP. All working stack alphabets are explicitly required to be finite; Mathlib's FinTM2 bundle itself only includes input-alphabet finiteness. Marked input copying, complete output decoding, and string reversal account for the stack representation.
The total-function theorem uses the identity encoding on all binary strings.
For a regular domain, mem_FP_on_dfa checks the input format and returns empty
output outside the domain; the source time bound is required only inside it.
mem_FP_encoded supports independent finite input and output alphabets through
explicit binary symbol codes, including empty alphabets. Invalid symbol codes
return empty output before the source starts. mem_FP_encoded_on_dfa additionally
validates a regular binary input domain. Typed problem encodings still need
their own validity and encoding-correspondence arguments.
Total Mathlib TM2 binary-string computations with finite working alphabets transfer to the canonical FP class, with no separate output-length assumption.
Validate a regular input domain and return empty output on malformed strings. Only valid inputs need a source time bound; output length is bounded automatically.
Polynomial-time word functions over independent finite alphabets give canonical FP functions under explicit binary codes. Invalid codewords return empty output; no output-size bound is needed.
Validate a regular binary domain as well as finite-alphabet symbol codes. Source bounds are required only for source words whose binary encodings lie in the domain.