While this submission is a draft, it cannot be used by other submissions.

Acceptance by deterministic Turing machines

Lax535992.DeterministicMachines · concepts/Lax535992/DeterministicMachines.lean · lax-535992

definition

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.

    Natural Language Statement

    Definition

    An instance is a machine instance of the NP core: a finite structure describing a Turing machine, by its transitions and their attributes, together with its input and a linear order of positions that bounds both the tape and the number of steps. The machine is deterministic when it has at most one start state, at most one transition applicable in a given state on a given symbol, and each transition has at most one destination state and one written symbol. The instance is a yes-instance of deterministic machine acceptance when it is well-formed, deterministic, and the machine accepts its input within the bounds; the problem is the decision problem of the structures isomorphic to such an instance. Determinism is part of the problem, not a promise.

    Concept map
    4 concepts; 16 descendants hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Lean source view on GitHub

    1import Mathlib.ModelTheory.Semantics
    2import Lax904597.Problems
    3import Lax485149.Problems
    4import Lax904597.Machines
    5
    6/-!
    7---
    8title: Acceptance by deterministic Turing machines
    9type: definition
    10---
    11An instance is a machine instance of the NP core: a finite structure
    12describing a Turing machine, by its transitions and their attributes,
    13together with its input and a linear order of positions that bounds both
    14the tape and the number of steps. The machine is deterministic when it has
    15at most one start state, at most one transition applicable in a given state
    16on a given symbol, and each transition has at most one destination state
    17and one written symbol. The instance is a yes-instance of deterministic
    18machine acceptance when it is well-formed, deterministic, and the machine
    19accepts its input within the bounds; the problem is the decision problem of
    20the structures isomorphic to such an instance. Determinism is part of the
    21problem, not a promise.
    22-/
    23
    24namespace Lax535992.DeterministicMachines
    25
    26open FirstOrder FirstOrder.Language
    27open Lax904597.Problems Lax904597.Machines Lax485149.Problems
    28
    29namespace TMData
    30
    31variable {A : Type} (M : TMData A)
    32
    33/-- **Determinism**: one start state, at most one transition applicable in a
    34given state on a given symbol, and at most one destination and written symbol
    35per transition. Together with well-formedness this leaves at most one step
    36from any configuration and at most one initial configuration, so the run is
    37unique. Every conjunct is first-order. -/
    38def Deterministic : Prop :=
    39 (∀ q q', M.Start q → M.Start q' → q = q') ∧
    40 (∀ τ τ' q a, M.Tr τ → M.Tr τ' → M.Src τ q → M.Src τ' q → M.Read τ a → M.Read τ' a →
    41 τ = τ') ∧
    42 (∀ τ q q', M.Dst τ q → M.Dst τ q' → q = q') ∧
    43 ∀ τ a a', M.Write τ a → M.Write τ a' → a = a'
    44
    45end TMData
    46
    47/-- Deterministic machine acceptance: is the machine instance well-formed,
    48deterministic and accepting within the bounds of the instance? -/
    49def DTMAccept : DecisionProblem turing :=
    50 DecisionProblem.ofPred fun A _ =>
    51 (tmData A).WellFormed ∧ TMData.Deterministic (tmData A) ∧ (tmData A).Accepts
    52
    53end Lax535992.DeterministicMachines
    54

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…