NP and PTIME are the textbook classes on bit strings
Lax832283.MachineBridge · concepts/Lax832283/MachineBridge.lean · lax-832283
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
A decision problem is in NP exactly when the language of the binary encodings of its yes-instances has polynomially bounded certificates checked by a polynomial-time Mathlib machine, and in PTIME exactly when a polynomial-time Mathlib machine decides that language. The encodings of the yes-instances of SAT and of HORN-SAT are examples, for any numbering of their vocabulary.
Concept map
Evidence
Lean source view on GitHub
| 1 | import Lax832283.LogicalBridge |
| 2 | import Lax904597.CookLevin |
| 3 | import Lax535992.HornSatPTIMEComplete |
| 4 | import Lax751879.ImmermanVardi |
| 5 | import Lax988886.Fagin |
| 6 | |
| 7 | /-! |
| 8 | --- |
| 9 | title: NP and PTIME are the textbook classes on bit strings |
| 10 | type: theorem |
| 11 | --- |
| 12 | A decision problem is in NP exactly when the language of the binary encodings of its |
| 13 | yes-instances has polynomially bounded certificates checked by a polynomial-time Mathlib |
| 14 | machine, and in PTIME exactly when a polynomial-time Mathlib machine decides that language. |
| 15 | The encodings of the yes-instances of SAT and of HORN-SAT are examples, for any numbering of |
| 16 | their vocabulary. |
| 17 | -/ |
| 18 | |
| 19 | namespace Lax832283.MachineBridge |
| 20 | |
| 21 | open FirstOrder Lax904597.Problems Lax904597.Classes Lax535992.ClassPTIME |
| 22 | open Lax832283.StringProblems Lax988886.FiniteStructures |
| 23 | open Lax988886.NondeterministicPolynomialTime Lax751879.PolynomialTime |
| 24 | |
| 25 | /-- NP is the textbook class. -/ |
| 26 | axiom mem_NP_iff_inNP {L : Language.{0, 0}} [L.IsRelational] (V : FinVocab L) |
| 27 | (P : DecisionProblem L) : NP.Mem P ↔ InNP (toProperty V P) |
| 28 | |
| 29 | /-- NP, on bit strings. -/ |
| 30 | axiom mem_NP_iff_languageInNP {L : Language.{0, 0}} [L.IsRelational] (V : FinVocab L) |
| 31 | (P : DecisionProblem L) : |
| 32 | NP.Mem P ↔ LanguageInNP (Lax988886.FiniteStructures.language (toProperty V P)) |
| 33 | |
| 34 | /-- PTIME is the textbook class. -/ |
| 35 | axiom mem_PTIME_iff_inP {L : Language.{0, 0}} [L.IsRelational] (V : FinVocab L) |
| 36 | (P : DecisionProblem L) : PTIME.Mem P ↔ InP (toQuery V P) |
| 37 | |
| 38 | /-- The encodings of satisfiable CNF instances form a language in NP. -/ |
| 39 | axiom SAT_languageInNP (V : FinVocab Lax904597.Sat.sat) : |
| 40 | LanguageInNP (Lax988886.FiniteStructures.language (toProperty V Lax904597.Sat.SAT)) |
| 41 | |
| 42 | /-- A polynomial-time machine decides the encodings of the satisfiable Horn instances. -/ |
| 43 | axiom HORNSAT_inP (V : FinVocab Lax904597.Sat.sat) : |
| 44 | InP (toQuery V Lax535992.HornSat.HORNSAT) |
| 45 | |
| 46 | end Lax832283.MachineBridge |
| 47 |
Builds on
Used by
none
From Mathlib
none
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments