Draft — mutable and not usable as a dependency; its citation marks the draft state.

Lax51.TuringRamEquivalence

Equivalence of Turing machines and word RAMs

concepts/Lax51/TuringRamEquivalence.lean · lax-51

proven

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Concept map

    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Evidence

    Each proof establishes this claim relative to its assumptions.

    Theorem

    Turing machines and word random access machines compute exactly the same total functions from finite lists of natural numbers to finite lists of natural numbers.

    A function is word-RAM computable when there are one program and a computable word-length threshold, depending on the input, such that the program returns the exact value from the length-prefixed physical input x.length::xx.length :: x at every word length at or above that threshold. The program is chosen before both the input and the word length, so it is uniform. Requiring the threshold to be computable is essential: mere eventual stabilization with no effective modulus describes the larger class of limit-computable functions.

    On the Turing-machine side, ComputableComputable is mathlib's standard predicate for total computability. Mathlib's Turing-machine development proves its equivalence with execution by a concrete finitely described Turing machine, so the right-hand side is the usual Turing-computability notion rather than an additional machine model introduced here.

    No running-time comparison is asserted. The theorem identifies the functions computable by the two models; simulations may have arbitrary overhead.

    Lean source view on GitHub

    1import Lax13.Ram
    2import Mathlib.Computability.TuringMachine.ToPartrec
    3
    4/-!
    5---
    6title: Equivalence of Turing machines and word RAMs
    7type: theorem
    8---
    9Turing machines and word random access machines compute exactly the same
    10total functions from finite lists of natural numbers to finite lists of
    11natural numbers.
    12
    13A function is word-RAM computable when there are one program and a
    14computable word-length threshold, depending on the input, such that the
    15program returns the exact value from the length-prefixed physical input
    16`x.length :: x` at every word length at or above that threshold. The program
    17is chosen before both the input and the word length, so it is uniform.
    18Requiring the threshold to be computable is essential:
    19mere eventual stabilization with no effective modulus describes the larger
    20class of limit-computable functions.
    21
    22On the Turing-machine side, `Computable` is mathlib's standard predicate for
    23total computability. Mathlib's Turing-machine development proves its
    24equivalence with execution by a concrete finitely described Turing machine,
    25so the right-hand side is the usual Turing-computability notion rather than
    26an additional machine model introduced here.
    27
    28No running-time comparison is asserted. The theorem identifies the
    29functions computable by the two models; simulations may have arbitrary
    30overhead.
    31-/
    32
    33namespace Lax51.TuringRamEquivalence
    34
    35open Lax13.Ram
    36
    37/-- A total function on finite words is computable by a word RAM if one
    38uniform program computes it from the length-prefixed physical input
    39`x.length :: x` at every effectively sufficient word length. -/
    40def RamComputable (f : List ℕ → List ℕ) : Prop :=
    41 ∃ (p : Program) (threshold : List ℕ → ℕ),
    42 Computable threshold ∧
    43 ∀ (x : List ℕ) (w : ℕ), threshold x ≤ w →
    44 ∃ t : ℕ, RunsTo w p (x.length :: x) (f x) t
    45
    46/-- **Equivalence of Turing machines and word RAMs.** A total function on
    47finite words is computable by the archive's word RAM model exactly when it
    48is Turing-computable. -/
    49axiom ramComputable_iff_computable (f : List ℕ → List ℕ) :
    50 RamComputable f ↔ Computable f
    51
    52end Lax51.TuringRamEquivalence
    53
    Show Proof

    Builds on

    Used by

    none

    Community review

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above; your ORCID profile must share a public name.

    0 comments

    Loading discussion…