Cook–Levin: every NP language reduces to CNF satisfiability
ProvedPNPMission.cook_levin_hardnesscomplexity-theory
For every language there is a polynomial-time computable map on bit strings such that
where is the set of encodings of satisfiable CNF formulas. Polynomial time, and the encodings are those of the definitions PNPMission_Complexity and PNPMission_Instances (Mathlib's multi-stack Turing machines, Turing.TM2ComputableInPolyTime).
This is the hardness half of the Cook–Levin theorem.
Preamble
import Mathlib import Definitions.Def_PNP_ThmMain_Defs import Definitions.Def_PNPMission_Complexity import Definitions.Def_PNPMission_Instances open PNP.Gadget PNP.Semantics open PNPMission
Formal statement
theorem PNPMission.cook_levin_hardness :
∀ L : Set (List Bool), InNP L →
∃ f : List Bool → List Bool, PolyTimeComputable f ∧ ∀ x : List Bool, x ∈ L ↔ f x ∈ SatLang := by sorrySource
S. Cook, The complexity of theorem-proving procedures, STOC 1971, Theorem 1; L. Levin, Universal sequential search problems, 1973