Theory Multitape_Substrate_Core
theory Multitape_Substrate_Core
imports "HOL-Library.FuncSet"
begin
section ‹Substrate core (Dalvit--Thiemann definition surface)›
text ‹The ∗‹definition surface› of the substrate, deliberately isolated
in this theory: the datatypes, selectors, step relation, and the validity /
configuration / language definitions --- and no proofs. This is the part
of the development that corresponds to the Dalvit--Thiemann AFP entry
‹Multitape_To_Singletape_TM› (its files ‹Multitape_TM› and
‹TM_Common›, about 180 lines), kept small so a reader can diff it
directly against that source. Every lemma --- the ‹valid_mttm›
axiom-extraction toolkit, the validity-preservation and reachability
results, and the displacement / left-endmarker tape tools, all
∗‹our› additions --- lives in the parent theory ‹Multitape_Substrate›,
which imports this one.
The datatypes (‹mttm›, ‹mt_config›, ‹dir›) and the step
relation are adapted from that entry \<^cite>‹"Dalvit2022:verified"›;
‹valid_mttm› is a direct conjunction of the substrate's structural
axioms (no locale wrapping), tightened beyond the AFP entry's
‹δLE› axiom by an additional LE-write conjunct (see the
validity predicate below).
The number of tapes is a ∗‹value›: a machine carries its tape count
as a ‹nat› field ‹k›, and head contents are a total function
‹nat ⇒ 'a› with a ∗‹blank tail› beyond ‹k› (the
support invariant). This departs from the AFP source, where the
tape count is trapped in a finite type parameter ‹'k›; the value
form is what makes ‹∃ M› / ‹∀ M› over machines of all
arities a single HOL proposition.›
subsection ‹TM-direction primitive (forked from AFP ‹TM_Common›)›
text ‹Three-valued TM head movement: right (R), left (L), or
neutral / stay (N). Used positionally as the fifth component
of every transition tuple; functions ‹nat ⇒ dir› encode the
per-tape head movement.›