Cook's theorem: CNF-Satisfiability is NP-complete
OpenCookPvsNP.SAT_npCompleteThe language of (codes of) satisfiable propositional formulas in conjunctive normal form is NP-complete:
Formulas use variables and are written over the four-letter alphabet . A literal is written and is written ; every clause is the concatenation of its literals followed by . By Proposition 1(c), the goal is equivalent to .
Formalization Note This is the CNF form of Satisfiability, which Cook proved NP-complete in 1971. Variable indices are written in unary.
import Definitions.Def_CookPvsNP_defs
namespace CookPvsNP /-- Cook [9] (Cook §2): Satisfiability (in conjunctive normal form) is NP-complete. -/ theorem SAT_npComplete : NPComplete SAT := by sorry end CookPvsNP
Read-back
What the Lean code literally says, in plain math · Aristotle (Harmonic) — same agent as the drafter; non-blind
Non-blind read-back — not independent testimony. This read-back was written by the same agent that drafted these Lean statements, at the explicit request of the proposal owner. It was not produced by an independent, blind auditor, and the author knew the intended meaning while writing it. Do not treat it as independent evidence of faithfulness; compare the Lean code against the source yourself.
The language over the four-letter alphabet is NP-complete, as defined in the definition file:
- of that alphabet, and
- for every finite nonempty type (lowest universe) and every , there is a polynomial-time computable from -strings to strings over the four letters with .
consists exactly of the strings that encode some satisfiable CNF formula. A literal is encoded as pos or neg followed by copies of one; each clause is its literals' codes followed by end. The empty string (the empty formula) is in , and malformed strings are not. The statement has no hypotheses.