The Cook–Levin theorem, in its machine form
Lax904597.MachineForm · concepts/Lax904597/MachineForm.lean · lax-904597
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
Machine acceptance – does a nondeterministic Turing machine, given as a finite structure, accept its input in fewer steps than there are positions? – is interreducible with SAT, and characterizes NP: a problem is existential second-order definable exactly when it has an ordered first-order reduction to machine acceptance.
Together with the machine-free Cook–Levin theorem this gives the statement in machine terms: SAT is NP-complete for NP read as nondeterministic polynomial time, where the time available to a machine is the number of positions of the structure a reduction builds, polynomial in the input – the bound is unary by construction – and where the reduction from a machine to a formula is the usual tableau, built here as a first-order interpretation.
Concept map
Evidence
Lean source view on GitHub
| 1 | import Lax904597.Classes |
| 2 | import Lax904597.Sat |
| 3 | import Lax904597.Machines |
| 4 | |
| 5 | /-! |
| 6 | --- |
| 7 | title: The Cook–Levin theorem, in its machine form |
| 8 | type: theorem |
| 9 | --- |
| 10 | Machine acceptance – does a nondeterministic Turing machine, given as a |
| 11 | finite structure, accept its input in fewer steps than there are |
| 12 | positions? – is interreducible with SAT, and characterizes NP: a problem is |
| 13 | existential second-order definable exactly when it has an ordered |
| 14 | first-order reduction to machine acceptance. |
| 15 | |
| 16 | Together with the machine-free Cook–Levin theorem this gives the statement |
| 17 | in machine terms: SAT is NP-complete for NP read as nondeterministic |
| 18 | polynomial time, where the time available to a machine is the number of |
| 19 | positions of the structure a reduction builds, polynomial in the input – |
| 20 | the bound is unary by construction – and where the reduction from a machine |
| 21 | to a formula is the usual tableau, built here as a first-order |
| 22 | interpretation. |
| 23 | -/ |
| 24 | |
| 25 | namespace Lax904597.MachineForm |
| 26 | |
| 27 | open FirstOrder FirstOrder.Language |
| 28 | open Lax904597.Problems Lax904597.Interpretations Lax904597.SecondOrder Lax904597.Classes |
| 29 | Lax904597.Sat Lax904597.Machines |
| 30 | |
| 31 | /-- SAT reduces to machine acceptance, by the machine that guesses an |
| 32 | assignment and checks the clauses; and whatever reduces to machine |
| 33 | acceptance reduces to SAT, by the tableau of the machine as a first-order |
| 34 | interpretation. -/ |
| 35 | axiom SAT_complete_for_ntmAccept : ∀ (h : NTMAcceptInvariant), |
| 36 | Nonempty (OrderedFOReduction SAT (NTMAccept h)) ∧ |
| 37 | ∀ {L : Language.{0, 0}} [L.IsRelational] (P : DecisionProblem L), |
| 38 | Nonempty (OrderedFOReduction P (NTMAccept h)) → Nonempty (OrderedFOReduction P SAT) |
| 39 | |
| 40 | /-- NP, as existential second-order definability, is the class of problems |
| 41 | that reduce to machine acceptance. -/ |
| 42 | axiom mem_NP_iff_le_ntmAccept : ∀ (h : NTMAcceptInvariant) |
| 43 | {L : Language.{0, 0}} [L.IsRelational] (P : DecisionProblem L), |
| 44 | NP.Mem P ↔ Nonempty (OrderedFOReduction P (NTMAccept h)) |
| 45 | |
| 46 | end Lax904597.MachineForm |
| 47 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments