Partrec Code → TM0 Assembly #
This file assembles the full chain Code → TM2 → TM1 → TM0, proving that
any partial recursive function (given as ToPartrec.Code) can be
evaluated by a TM0 machine.
Main results #
partrec_init_trCfg— TrCfg for PartrecToTM2.init (the key lemma)code_to_tm0_halts— full chain: Code halts iff TM0 haltscode_to_tm0— existential form, without finite state restrictioncode_to_tm0_fintype/code_to_tm0_fintype_general— finite-state TM0 realizations for unary and list inputs
Stack Equality #
The stacks of PartrecToTM2.init c v equal those of TM2.init K'.main (trList v).
TrCfg for PartrecToTM2.init #
Chain Type Abbreviations #
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
TM2 halts iff Code evaluates.
Full Chain: Code → TM0 #
Full chain: Code → TM0 (eval form).
Support Chain (for Fintype states) #
The TM2 support set for a given code c.
Instances For
The TM1 support set.
Equations
Instances For
The TM0 support set.
Equations
Instances For
Full Chain with Fintype States #
The initial TM1 config for the chain.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Generalized version of chainTM0_trCfg_eq_nc for arbitrary v : List ℕ.
Works because the TM0 state depends only on the Code c (via the non-canonical
Inhabited instance), not on the input list. The var component of init c v
is always none : Option Γ'.
Full chain: Code → TM0 with Fintype states.
This is the strengthened version of code_to_tm0 that provides Fintype Λ.
The key insight is to override the Inhabited PartrecToTM2.Λ' instance
to ⟨trNormal c halt⟩ (matching tr_supports), then thread the non-canonical
@[expose]
public instance through the entire chain. The resulting TM0 machine is definitionally
the same as ChainTM0 (since TM1to0.tr ignores Inhabited), but the support
proof uses the non-canonical default.
Generalized chain: Code → TM0 with Fintype states and multi-element input.
Same as code_to_tm0_fintype but works for arbitrary v : List ℕ instead of
just [n]. The machine and state space are identical — only the input encoding
trInit K'.main (trList v) varies with the input list.