Documentation

CslibFrontier.Computability.Machines.Turing.SingleTape.TM0Universal

Universal finite-state TM0 machine #

This module constructs a fixed universal Post–Turing machine M₀' in Mathlib's Turing.TM0 model, with a finite state type and finite tape alphabet.

Starting from a ToPartrec code univ that evaluates the n-th partial recursive code on input 0 (ToPartrec.Code.exists_code), Mathlib's compilers PartrecToTM2, TM2to1 and TM1to0 turn univ into a fixed TM0 machine M₀. Applying state-set restriction (TM0.restrict) along its finite support produces M₀'.

The input tape for a natural number n is input n, computed primitive recursively (primrec_input). The machine halts on input n if and only if the n-th partial recursive code halts on 0 (eval_dom_iff).

Main definitions #

Main results #

References #

A ToPartrec code evaluating, on input [n], the n-th partial recursive function at 0.

The labels of the TM2 machine compiled from univ, with initial label the compiled program.

Instances For
    @[instance_reducible]

    The finite set of TM1 labels used by M₁.

    The finite set of TM0 states used by M₀.

    The restriction of M₀ to its finitely many reachable states.

    @[instance_reducible]

    The tape alphabet of M₀ is primcodable through an enumeration.

    @[instance_reducible]

    The state set of M₀' is primcodable through an enumeration.

    The input tape of M₀' holding the number n.

    The encoding of input numbers as tape configurations for M₀' is primitive recursive.

    M₀' halts on input n if and only if univ halts on [n].

    M₀' halts on input n if and only if the n-th partial recursive code halts on 0.