Documentation

Complexity.Computability.PCP.Approximation.MaxExactThreeSAT

MAX-E3SAT: NP-hardness of approximation and the 7 / 8 random-assignment bound #

GapExactThreeSAT s is the gap problem of MAX-3SAT (Cslib.Complexity.GapThreeSAT) restricted to formulas all of whose clauses have exactly three, not necessarily distinct, literals. Here "MAX-E3SAT" (Cslib.Complexity.GapExactThreeSAT) allows repeated literals in a clause, as Cslib.Complexity.ExactThreeSAT does. Its yes-instances are the members of Cslib.Complexity.ExactThreeSAT.

The gap of MAX-3SAT transfers unchanged: repeating a literal of every clause with one or two literals (Cslib.Complexity.toExactThreeSAT) changes neither the value of a clause nor the number of clauses, so every assignment falsifies the same clauses. An empty clause cannot be padded; a formula with one is unsatisfiable, so it is mapped to a fixed formula (Cslib.Complexity.GapExactThreeSAT.contradiction) in which every assignment falsifies one of two clauses, a no-instance for every soundness s ≥ 1 / 2. Hence distinguishing satisfiable formulas with clauses of exactly three literals from those in which every assignment satisfies at most the proportion 1 - 1 / (3 * 2 ^ 77) of the clauses is NP-hard (Cslib.Complexity.GapExactThreeSAT_npHard) Arora, Lund, Motwani, Sudan and Szegedy.

In the other direction, when the three variables of every clause are distinct (Cslib.Logic.PL.CNF.IsExactThreeDistinct), a uniform random assignment falsifies each clause with probability 1 / 8 (Cslib.Logic.PL.Clause.IsExactThreeDistinct.expect_eval_eq_false), so some assignment falsifies at most 1 / 8 of the clauses (Cslib.Logic.PL.CNF.IsExactThreeDistinct.unsatVal_le_one_eighth, developed in Complexity.Logics.Propositional.CNF.UnsatVal and re-exported here). Håstad showed that this 7 / 8 threshold is optimal [Has01]; that hardness result is not formalized here.

Main definitions #

Main results #

References #

The gap problem of MAX-E3SAT with perfect completeness and soundness s: the gap problem of MAX-3SAT (GapThreeSAT) on the formulas all of whose clauses have exactly three literals, not necessarily distinct.

Instances For

    The yes-instances of GapExactThreeSAT are the members of ExactThreeSAT.

    theorem Cslib.Complexity.mem_no_GapExactThreeSAT {s : ℝ} {φ : Logic.PL.CNF ℕ} (hs : s < 1) :
    φ ∈ (GapExactThreeSAT s).no ↔ (∀ c ∈ φ, List.length c = 3) ∧ 1 - s ≤ φ.unsatVal

    For s < 1, the no-instances of GapExactThreeSAT are the formulas with clauses of exactly three literals in which every assignment falsifies at least the proportion 1 - s of the clauses.

    A formula with two clauses of three literals, x₀ ∨ x₀ ∨ x₀ and ¬x₀ ∨ ¬x₀ ∨ ¬x₀: every assignment falsifies exactly one of them.

    Instances For

      Every assignment falsifies half of the clauses of contradiction.

      The reduction from MAX-3SAT to MAX-E3SAT: a formula with an empty clause goes to contradiction; otherwise every clause with one or two literals is padded to three by repeating a literal (toExactThreeSAT).

      Instances For

        MAX-3SAT reduces to MAX-E3SAT with the same gap, repeated literals allowed, for every soundness 1 / 2 ≤ s < 1, by GapExactThreeSAT.reduce.

        MAX-E3SAT is NP-hard to approximate [ALM+98]: distinguishing satisfiable formulas with exactly three, not necessarily distinct, literals per clause from those in which every assignment satisfies at most the proportion 1 - 1 / (3 * 2 ^ 77) of the clauses is NP-hard.

        theorem Cslib.Complexity.GapExactThreeSAT_notMem_PromiseP {β : Type} {enc : β ↪ List Bool} (h : P enc ≠ NP enc) :
        GapExactThreeSAT (1 - 1 / (3 * 2 ^ 77)) ∉ PromiseP encCNF

        Unless P = NP, no polynomial-time algorithm distinguishes satisfiable formulas with exactly three, not necessarily distinct, literals per clause from those in which every assignment satisfies at most the proportion 1 - 1 / (3 * 2 ^ 77) of the clauses.