Documentation

CslibFrontier.Computability.PCP.Approximation.AssignmentGraph

The assignment graph of a 3CNF formula #

Arora and Barak Lemma 18.16 turn a 3CNF formula φ with m clauses into a graph on n = 7 m vertices whose largest independent set has val(φ) m = val(φ) n / 7 vertices, where val(φ) is the largest proportion of the clauses an assignment satisfies. Each clause gets a cluster of seven vertices, one for each assignment to its three variables that satisfies it; two vertices are adjacent when they lie in the same cluster or their partial assignments disagree on a shared variable. An assignment gives an independent set with one vertex in each satisfied cluster, and an independent set gives consistent partial assignments, in distinct clusters, that extend to one assignment satisfying all their clauses.

Here a partial assignment is a list of literals (x, b), read as x := b (Cslib.Complexity.SAT.consistentLits). The local satisfying assignments of a clause (Cslib.Complexity.SAT.clauseAssignments) give values to the variables of its literals position by position and keep those that are consistent and satisfy the clause. There are at most seven (Cslib.Complexity.SAT.length_clauseAssignments_le), exactly seven when the three variables are distinct; with fewer, the first one is repeated, as the draft does when it "treats one of them as repeated". The draft does not treat clauses without literals: their seven vertices are adjacent to every other vertex, and a formula all of whose clauses are empty (including the formula without clauses) maps to the empty graph, as the lemma requires.

Main definitions #

Main results #

References #

The partial assignment that gives the variables of the literals of c the values bs, position by position.

The local satisfying assignments of a clause: the values of the variables of its (at most three) literals, as consistent partial assignments that satisfy the clause. The values are drawn for three positions, so a clause with fewer literals lists each of them several times.

The partial assignment of the k-th vertex of the cluster of a clause: the k-th local satisfying assignment, repeating the first one when there are fewer.

A vertex record of the assignment graph: the vertex at position pos of the cluster of the clause lits with index clause, labelled by the partial assignment label.

Instances For
    theorem Cslib.Complexity.SAT.AssignmentRecord.ext {x y : AssignmentRecord} (clause : x.clause = y.clause) (pos : x.pos = y.pos) (lits : x.lits = y.lits) (label : x.label = y.label) :
    x = y
    theorem Cslib.Complexity.SAT.encAssignmentRecord_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 x1 T1 S1 : γ → ℕ} {x2 : γ → List (ℕ × Bool)} {T2 S2 : γ → ℕ} {x3 : γ → List (ℕ × Bool)} {T3 S3 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encUnary T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encUnary T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn (Turing.MultiTapeTM.encList (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encNat Turing.MultiTapeTM.encBool)) T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn (Turing.MultiTapeTM.encList (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encNat Turing.MultiTapeTM.encBool)) T3 S3) :
    Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { clause := x0 x, pos := x1 x, lits := x2 x, label := x3 x }) encIn encAssignmentRecord (fun (x : γ) => T0 x + (T1 x + (T2 x + T3 x))) fun (x : γ) => S0 x + (S1 x + (S2 x + S3 x))
    theorem Cslib.Complexity.SAT.encAssignmentRecord_pos_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → AssignmentRecord} :
    theorem Cslib.Complexity.SAT.encAssignmentRecord_clause_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → AssignmentRecord} :

    Unary indices, then the clause and the label as lists of binary literals.

    The vertex records of the assignment graph: seven per clause.

    Two records are joined in the assignment graph when they lie in the same cluster, when one of them belongs to an empty clause, or when their partial assignments are inconsistent.

    The assignment graph of a formula Arora and Barak, Lemma 18.16: seven vertices per clause, labelled by its local satisfying assignments, joined inside clusters and across inconsistent labels. A formula all of whose clauses are empty gives the empty graph.

    Local satisfying assignments #

    The restriction of an assignment satisfying a clause of at most three literals is a local satisfying assignment.

    A clause of at most three literals has at most seven local satisfying assignments: the values falsifying every literal are excluded.

    The graph #

    theorem Cslib.Complexity.SAT.mem_assignmentRecords {φ : Logic.PL.CNF ℕ} {r : AssignmentRecord} :
    r ∈ assignmentRecords φ ↔ ∃ (i : ℕ) (hi : i < List.length φ), ∃ k < 7, r = { clause := i, pos := k, lits := φ[i], label := clusterLabel φ[i] k }

    The records of the assignment graph: a clause index, a position below seven, the clause and the label.

    Two vertices of the assignment graph are adjacent exactly when their records are distinct and conflict.

    The assignment graph of a formula with a nonempty clause has seven vertices per clause.

    An assignment gives an independent set with a vertex for each clause it satisfies: the vertex of the clause labelled by the restriction of the assignment.

    An independent set of the assignment graph gives an assignment satisfying as many clauses: the vertices lie in distinct clusters, and their consistent labels extend to one assignment.

    The independence number of the assignment graph. For a formula φ with at most three literals per clause, the assignment graph on n vertices has independence number val(φ) n / 7, where val(φ) = 1 - unsatVal φ is the largest proportion of the clauses of φ that an assignment satisfies.

    Polynomial time #

    The assignment graph is polynomial-time: it lists seven records per clause, each with a label among the local satisfying assignments of the clause, and tests every pair of records.

    Arora–Barak Lemma 18.16 #

    theorem Cslib.Complexity.SAT.exists_computableInPolyTime_indepNum_eq :
    ∃ (f : Logic.PL.CNF ℕ → Graph), Turing.MultiTapeTM.ComputableInPolyTime f encCNF encGraph ∧ ∀ (φ : Logic.PL.CNF ℕ), (∀ c ∈ φ, List.length c ≤ 3) → ((∃ c ∈ φ, c ≠ []) → (f φ).vertices.toFinset.card = 7 * List.length φ) ∧ ((∀ c ∈ φ, c = []) → (f φ).vertices = []) ∧ ↑(f φ).indepNum = (1 - φ.unsatVal) * ↑(f φ).vertices.toFinset.card / 7

    Arora–Barak Lemma 18.16 Arora and Barak, Lemma 18.16. There is a polynomial-time transformation f of formulas into graphs such that, for every 3CNF formula φ with m clauses, f φ is a graph on n vertices whose largest independent set has val(φ) n / 7 vertices, and n = 7 m as in the draft's construction. Here the 3CNF formulas are those with at most three literals per clause, val(φ) = 1 - unsatVal φ is the largest proportion of the clauses, counted with multiplicity, that an assignment satisfies, and n is the number of distinct declared vertices. The vertex count 7 m holds when some clause is nonempty; a formula all of whose clauses are empty (including the formula without clauses), which the draft's proof does not treat, gives the graph without vertices, as the value equation then requires. The transformation is Cslib.Complexity.SAT.assignmentGraph.