Diamond graph definitions, membership, and size bounds #
This file defines the diamond graph (Cslib.Complexity.Diamond.graph) and closed diamond graph
(Cslib.Complexity.Diamond.cycleGraph) used in the reduction of satisfiability to directed
Hamiltonian paths and cycles Sipser, Theorem 7.46, along with vertex and arc
membership characterizations and size formulas.
Main definitions #
Cslib.Complexity.Diamond.Detour: a detour through a clause node across a slot of a row.Cslib.Complexity.Diamond.topNode,Cslib.Complexity.Diamond.rowNode,Cslib.Complexity.Diamond.clauseNode: vertex labels of a diamond graph.Cslib.Complexity.Diamond.graph,Cslib.Complexity.Diamond.cycleGraph: diamond graphs and closed diamond graphs.Cslib.Complexity.Diamond.WellFormed,Cslib.Complexity.Diamond.Satisfiable.
Main results #
Cslib.Complexity.Diamond.mem_vertices,Cslib.Complexity.Diamond.mem_arcs: membership in the vertex and arc lists.Cslib.Complexity.Diamond.length_vertices,Cslib.Complexity.Diamond.length_arcs: the size of a diamond graph.Cslib.Complexity.Diamond.notMem_arcs_topNode_zero: no arc enters the top of the first diamond.
References #
Diamond graphs #
A detour through the node of clause clause, across slot of row, left to right when
leftToRight is true and right to left otherwise.
- clause : ℕ
The clause index visited by the detour.
- row : ℕ
The row index containing the slot.
- slot : ℕ
The slot index within the row.
- leftToRight : Bool
Whether the detour traverses the slot from left to right.
Instances For
Instances For
@[instance_reducible]
The top of diamond i, which is also the bottom of diamond i - 1.
Instances For
Vertices and arcs #
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem Cslib.Complexity.Diamond.mem_arcs {N : ℕ} {slots : ℕ → ℕ} {D : List Detour} {u v : ℕ} :
(u, v) ∈ arcs N slots D ↔ (∃ i < N,
u = topNode i ∧ (v = rowNode i 0 ∨ v = rowNode i (rowLength slots i - 1)) ∨ (u = rowNode i 0 ∨ u = rowNode i (rowLength slots i - 1)) ∧ v = topNode (i + 1) ∨ ∃ a < rowLength slots i - 1,
u = rowNode i a ∧ v = rowNode i (a + 1) ∨ u = rowNode i (a + 1) ∧ v = rowNode i a) ∨ ∃ d ∈ D,
d.leftToRight = true ∧ (u = rowNode d.row (3 * d.slot + 2) ∧ v = clauseNode d.clause ∨ u = clauseNode d.clause ∧ v = rowNode d.row (3 * d.slot + 3)) ∨ d.leftToRight = false ∧ (u = rowNode d.row (3 * d.slot + 3) ∧ v = clauseNode d.clause ∨ u = clauseNode d.clause ∧ v = rowNode d.row (3 * d.slot + 2))