Acceptance by deterministic Turing machines
Lax535992.DeterministicMachines · concepts/Lax535992/DeterministicMachines.lean · lax-535992
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural 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
Lean source view on GitHub
| 1 | import Mathlib.ModelTheory.Semantics |
| 2 | import Lax904597.Problems |
| 3 | import Lax485149.Problems |
| 4 | import Lax904597.Machines |
| 5 | |
| 6 | /-! |
| 7 | --- |
| 8 | title: Acceptance by deterministic Turing machines |
| 9 | type: definition |
| 10 | --- |
| 11 | An instance is a machine instance of the NP core: a finite structure |
| 12 | describing a Turing machine, by its transitions and their attributes, |
| 13 | together with its input and a linear order of positions that bounds both |
| 14 | the tape and the number of steps. The machine is deterministic when it has |
| 15 | at most one start state, at most one transition applicable in a given state |
| 16 | on a given symbol, and each transition has at most one destination state |
| 17 | and one written symbol. The instance is a yes-instance of deterministic |
| 18 | machine acceptance when it is well-formed, deterministic, and the machine |
| 19 | accepts its input within the bounds; the problem is the decision problem of |
| 20 | the structures isomorphic to such an instance. Determinism is part of the |
| 21 | problem, not a promise. |
| 22 | -/ |
| 23 | |
| 24 | namespace Lax535992.DeterministicMachines |
| 25 | |
| 26 | open FirstOrder FirstOrder.Language |
| 27 | open Lax904597.Problems Lax904597.Machines Lax485149.Problems |
| 28 | |
| 29 | namespace TMData |
| 30 | |
| 31 | variable {A : Type} (M : TMData A) |
| 32 | |
| 33 | /-- **Determinism**: one start state, at most one transition applicable in a |
| 34 | given state on a given symbol, and at most one destination and written symbol |
| 35 | per transition. Together with well-formedness this leaves at most one step |
| 36 | from any configuration and at most one initial configuration, so the run is |
| 37 | unique. Every conjunct is first-order. -/ |
| 38 | def 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 | |
| 45 | end TMData |
| 46 | |
| 47 | /-- Deterministic machine acceptance: is the machine instance well-formed, |
| 48 | deterministic and accepting within the bounds of the instance? -/ |
| 49 | def DTMAccept : DecisionProblem turing := |
| 50 | DecisionProblem.ofPred fun A _ => |
| 51 | (tmData A).WellFormed ∧ TMData.Deterministic (tmData A) ∧ (tmData A).Accepts |
| 52 | |
| 53 | end Lax535992.DeterministicMachines |
| 54 |
Used by
Lax535992.CircuitValueInvarianceLax535992.CircuitValuePTIMECompleteLax535992.DeterministicMachineInvarianceLax535992.DeterministicMachinePTIMECompleteLax535992.GameInvarianceLax535992.GamePTIMECompleteLax535992.HornIsLeastFixedPointLax535992.HornSatInvarianceLax535992.HornSatPTIMECompleteLax535992.ImmermanVardiLax535992.InflationaryIsLeastFixedPointLax535992.LeastFixedPointComplementLax535992.NLSubsetPTIMELax535992.PTIMEClosureLax535992.PTIMEEqCoPTIMELax535992.PTIMESubsetNP
From Mathlib
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments