The order-free first-order interpretation from 3SAT to 3COL #
The reductions in this module use order-free first-order interpretations. Input structures have no built-in order or numeric predicates; these are variants of the standard ordered setting.
The palette, variable and clause gadget reduction from 3SAT to three-colorability, a standard
exercise Sipser, Chapter 7 (three-colorability is NP-complete
Garey and Johnson), is first-order on CNF structures
(Cslib.Logic.FO.cnf.reduces_ThreeSAT_ThreeColorable). From a 3-CNF structure it builds a palette
triangle T, F, B, two literal vertices x and ¬x for each variable, joined to each other
and to B, and for each clause a gadget of six vertices, two chained OR gates whose output is
joined to F and B. A clause with at most three literals has no canonical order, so there is a
gadget for every triple of its literals that lists all of them; each such gadget forces the clause.
The construction is a tagged interpretation, the tags being the kinds of vertices. Inputs that are
not 3-CNF structures, or that have an empty clause, are mapped to graphs with a loop.
The target is the class graph.ThreeColorable of three-colorable graph structures, loops allowed.
On the members of 3SAT the graph is symmetric and loopless, so the same interpretation reduces
3SAT to classical three-colorability of simple graphs
(Cslib.Logic.FO.cnf.reduces_ThreeSAT_SimpleThreeColorable). The machine-level reduction, on
encoded formulas and graphs, is Cslib.Complexity.SAT.toThreeColoring.
Main definitions #
Cslib.Logic.FO.cnf.coloringInterpretation: the graph built from a CNF structure, a tagged interpretation.
Main results #
Cslib.Logic.FO.cnf.colorable_coloringInterpretation_iff: the graph built from a CNF structure is three-colorable exactly when the structure is a satisfiable 3-CNF structure.Cslib.Logic.FO.cnf.reduces_ThreeSAT_ThreeColorable,Cslib.Logic.FO.cnf.reduces_ThreeSAT_SimpleThreeColorable: 3SAT is order-free reducible to 3COL, with loops allowed or on simple graphs.
References #
The clause gadget #
The coloring of the six vertices of the clause gadget for inputs colored u, v, w.
Instances For
The edges of the clause gadget with inputs u, v, w and palette t, f, b are
properly colored by g: vertices 0, 1, 2 and 3, 4, 5 are triangles, 0 is joined to u,
1 to v, 2 to 3, 4 to w, and 5 to f and b.
Instances For
The graph of a CNF structure #
The kinds of vertices of the graph built from a CNF structure: the palette T, F, B,
the literal vertices of each polarity, and the vertices of the clause gadgets, for each pattern of
polarities of the three literals of the gadget.
- trueV : ColoringTag
The palette vertex of true.
- falseV : ColoringTag
The palette vertex of false.
- baseV : ColoringTag
The palette vertex joined to all literals.
- lit (p : Bool) : ColoringTag
The literal vertices of a polarity.
- gadget (g : Fin 6) (ps : Fin 3 → Bool) : ColoringTag
The vertex
gof the gadgets of a pattern of polarities.
Instances For
The coordinates of the vertices: none for the palette, the variable of a literal vertex, and the clause and the three literal variables of a gadget vertex.
Instances For
The sentence saying that the structure is not a 3-CNF structure with nonempty clauses.
Instances For
The edges of the graph, from each kind of vertex: the palette triangle, with a loop at T
on bad inputs, the literal vertices joined to B and x joined to ¬x, and the gadgets.
Instances For
The formula of the edges between vertices of kinds u and w, in both directions.
Instances For
The graph of a CNF structure, a tagged interpretation: the edges are those of
coloringEdges, in both directions.
Instances For
Correctness #
The graph of a CNF structure is three-colorable exactly when the structure is a satisfiable 3-CNF structure.
On a 3-CNF structure without empty clauses, the graph is a simple graph.
Structures with at most one element #
On a structure with at most one element: a single vertex, with a loop when its clause is empty.
Instances For
3SAT is order-free reducible to 3COL, by the palette, variable and clause gadget construction Sipser, Chapter 7, Immerman, Chapter 7.
3SAT is order-free reducible to classical 3COL, three-colorability of simple graphs: on the members of 3SAT the graph of the reduction is symmetric and loopless.