SAT belongs to NP #
The existing verifier is polynomial-time on the framed binary encoding of CNF formulas and raw certificate bits. It looks up each variable's first occurrence, so arbitrary binary variable labels do not inflate certificates. Repeated variables read the same certificate position.
Together with Cslib.Complexity.SAT.isVerifier, this proves membership in NP
Arora and Barak, Section 2.3. Combined with the tableau reduction in
CslibFrontier/Computability/Complexity/CookLevin/PolyTime.lean, this gives
Cslib.Complexity.CookLevin.SAT_npComplete in
CslibFrontier/Computability/Complexity/CookLevin/Completeness.lean.
Main definitions #
Cslib.Complexity.cnfDecoder: the total decoder of formulas, alongencCNF.Cslib.Complexity.SAT.encOccurrence: encoding of a literal occurrence for natural-number variables.
Main results #
Cslib.Complexity.SAT.computableInPolyTime_verifier: the verifier is polynomial-time.Cslib.Complexity.SAT.computableInPolyTime_distinctVars,Cslib.Complexity.SAT.computableInPolyTime_numVars,Cslib.Complexity.SAT.computableInPolyTime_occurrences: distinct variables, their unary count, and literal occurrences for natural-number variables.Cslib.Complexity.SAT.computableInPolyTime_clause_length,Cslib.Complexity.SAT.computableInPolyTime_length,Cslib.Complexity.SAT.computableInPolyTime_vars_length: literal, clause and variable-occurrence counts for natural-number variables, in unary (fun_propversions of the genericCslib.Logic.PL.CNFlemmas).Cslib.Complexity.computableInPolyTime_all_length_le: checking that every clause has at mostkliterals, the guard ofk-SAT, is polynomial-time.Cslib.Complexity.SAT.mem_NP: satisfiability belongs to NP.Cslib.Complexity.UNSAT_mem_coNP: unsatisfiability belongs to coNP.
References #
Formulas in conjunctive normal form are decoded along their encoding encCNF.
Instances For
Listing the variables in order of occurrence is polynomial-time.
Listing the distinct variables in order of first occurrence is polynomial-time.
The number of distinct variables of a formula, in unary, is polynomial-time.
Encoding of a literal occurrence: unary clause and position indices with a binary-numbered literal.
Instances For
Enumerating the literal occurrences of a CNF formula is polynomial-time.
The number of literals of a polynomial-time clause, in unary, is polynomial-time.
The number of clauses of a polynomial-time formula, in unary, is polynomial-time.
The number of variable occurrences of a polynomial-time formula, in unary, is polynomial-time.
Reading the certificate at the first occurrence of a variable is polynomial-time.
Evaluating a literal with the certificate assignment is polynomial-time.
Evaluating a clause with the certificate assignment is polynomial-time.
The SAT verifier is polynomial-time, including on certificates of arbitrary length.
Checking that every clause has at most k literals is polynomial-time.