Relabeling multi-input machines along equivalences #
Relabeling the state type or the tape alphabet of a machine does not change its
behaviour: MultiInputTM.congrState and MultiInputTM.congrSymbol transport machines,
configurations, runs, outputs, space usage and ComputesInTimeAndSpace along
State ≃ State' and Symbol ≃ Symbol'. This is the canonicalization glue between
machines over arbitrary (finite) types and the Fin-typed shape of coded machines
(MIPRE.TM.Code.Semantics): coded machines are born over Fin, and outside results
about machines over other types meet them through these lemmas.
Adapted to the multi-input model from Regular.lean on the finite_in_fin branch of
Christian Reitwiessner's CSLib fork (https://github.com/crei/cslib, branch tip
4a149e205c99d4636d3a421c8cf3526e47b00f16, 2026-07-19; Apache 2.0), which develops the
same API for the one-input MultiTapeTM of an earlier model revision (its configurations
still carry an output field, so the file predates upstream #745 and cannot be vendored
against the current model). Two deliberate changes besides the multi-input
generalization:
congrStaterelabels along an equivalence, not an embedding: the fork's embedding-plus-Function.invFunversion isnoncomputable, and its only use instantiates with an equivalence anyway. Everything here is executable (planning/tm-infrastructure.md, decision D5).- The fork's DFA simulation and regular-language results are deliberately not ported; they concern the one-input model and can be revisited when CSLib is un-vendored.
Relabeling the state type #
None of the dependent structure of a configuration (inputs, head positions, work tapes) mentions the state type, so this direction is straightforward.
Relabel the state of a configuration along e : State ≃ State'.
Equations
- Turing.MultiInputTM.Cfg.congrState e cfg = { state := Option.map (⇑e) cfg.state, inputPos := cfg.inputPos, workTapes := cfg.workTapes, workTapePos := cfg.workTapePos }
Instances For
Relabel the state type of a machine along an equivalence e : State ≃ State'.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The step function commutes with state relabeling.
The configuration sequence commutes with state relabeling.
The emitted symbol is unchanged by state relabeling.
The output string is unchanged by state relabeling.
Relabeling the state type preserves computations: the relabeled machine computes the same input/output pairs in the same time and space.
Relabeling the symbol type #
This direction touches the dependent structure of a configuration: each input head
position lives in Fin ((input j).length + 2), so mapping the inputs transports the
positions along List.length_map via Fin.cast.
Relabel the symbols of a configuration along e : Symbol ≃ Symbol'.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Relabel the tape alphabet of a machine along an equivalence e : Symbol ≃ Symbol'.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The step function commutes with symbol relabeling.
The configuration sequence commutes with symbol relabeling.
The emitted symbol is relabeled along with the machine.
The output string is relabeled along with the machine.
The space usage is unchanged by symbol relabeling.
Relabeling the tape alphabet transports computations: the relabeled machine computes the relabeled input/output pairs in the same time and space.