Documentation

CslibFrontier.Computability.Complexity.FineGrained.Diameter

Orthogonal vectors hardness of diameter two versus three #

Roditty and Vassilevska Williams [RVW13] (Section 4, Theorem 9) showed that a procedure distinguishing graphs of diameter two from graphs of diameter three within time m ^ (2 - ε) on m edges solves CNF-SAT on n variables within time 2 ^ (n (1 - ε / 2)) times a polynomial. Their graph has a vertex for each partial assignment of either half of the variables, a vertex for each clause, and two hubs; the clause vertices and the hubs form a clique. This module formalizes the orthogonal vectors form of that construction, factoring it through the split-and-list reduction of Williams [Wil05]: partial assignments become vectors and clauses become coordinates. The clique on the coordinates is replaced by edges from both hubs to every coordinate, and two padding vertices are added.

From lists A and B of N vectors of dimension d, the graph Cslib.Complexity.OV.toDiameter has a vertex for each vector, a vertex for each coordinate, two hubs 0 and 1, and two non-adjacent padding vertices 2 and 3. The hub 0 is adjacent to the vectors of A, the hub 1 to those of B, the two hubs to each other and to every coordinate and padding vertex, and a vector to the coordinates where it holds true. Every vertex is adjacent to a hub, so the diameter is at most three. Two vectors of the same list share a hub, and a vector of A and one of B are at distance two exactly when they share a coordinate holding true, that is when they are not orthogonal. So the graph has diameter three when the instance has an orthogonal pair, and diameter two otherwise (Cslib.Complexity.OV.ediam_toDiameter); the padding vertices keep the diameter at two on instances with no vectors.

The graph has O(N d) vertices and edges. Its vertex list and its edge list are each written by one pass over the encoded instance, a finite automaton with two counters (Cslib.Complexity.OV.parseRun), the coordinate and the number of the current vector, streaming the outputs of each bit. The counters take O(log L) bits on an encoded instance of length L, so the two streams, paired, compute the reduction within time L (log L) ^ D (Cslib.Complexity.OV.exists_computableInO_toDiameter). Then a procedure separating diameter two from diameter three within time L ^ (2 - ε), on graphs encoded in length L, decides OV within time N ^ (2 - ε') times a polynomial in the dimension (Cslib.Complexity.DecidableInTimeO.decidableInTimeO_OV_of_diameter), which the orthogonal vectors hypothesis excludes (Cslib.Complexity.not_decidableInTimeO_diameter_of_OVH).

The lower bound is stated in the length L of the encoded graph. A time bound in the number n + m of listed vertices and edges alone would be vacuous: vertex labels are unbounded, and a machine whose time is bounded in n + m cannot read long labels, so it cannot tell a four-cycle from a path whose last edge leaves the declared vertices. The size form therefore charges the input length as well, with the bound (n + m) ^ (2 - ε) + L (Cslib.Complexity.not_decidableInTimeO_diameter_size_of_OVH). On the graphs of the reduction, labels take O(log (N d)) bits, so L and n + m differ by a logarithmic factor.

The graphs of the reduction have Θ(N d) edges for an unrestricted dimension d, so this is Theorem 9 for general m. The statement for sparse graphs in the introduction of [RVW13] is not covered: it needs dimension c log N, that is the low-dimension form of the orthogonal vectors hypothesis, which this library does not state.

The hypothesis is unresolved. This library neither proves nor refutes OVH. It refutes SETH (Cslib.Complexity.CountingNativeEndpoint.not_SETH), so OVH is not derived from it; Cslib.Complexity.OVH_of_not_decidableInExpTime_SAT derives OVH from a hypothesis on unrestricted SAT that is open. The transfer from a fast diameter procedure to a fast OV decider is unconditional.

Main definitions #

Main results #

References #

Outputs of the bits and vectors of a list #

def Cslib.Complexity.OV.bitsOut {β : Type} (f : ℕ → Bool → List β) :
ℕ → List Bool → List β

The concatenated outputs f i b of the bits b of a vector, numbered from i.

def Cslib.Complexity.OV.vecsOut {β : Type} (f : ℕ → ℕ → Bool → List β) (g : ℕ → List β) :
ℕ → List (List Bool) → List β

The concatenated outputs of the vectors of a list, numbered from k: for the vector v numbered k, the outputs f k i b of its bits followed by g k.

theorem Cslib.Complexity.OV.mem_bitsOut {β : Type} {f : ℕ → Bool → List β} {i : ℕ} {v : List Bool} {x : β} :
x ∈ bitsOut f i v ↔ ∃ (j : ℕ) (h : j < v.length), x ∈ f (i + j) v[j]

Membership in the outputs of the bits of a vector.

theorem Cslib.Complexity.OV.mem_vecsOut {β : Type} {f : ℕ → ℕ → Bool → List β} {g : ℕ → List β} {k : ℕ} {vs : List (List Bool)} {x : β} :
x ∈ vecsOut f g k vs ↔ ∃ (j : ℕ) (h : j < vs.length), (∃ (i : ℕ) (hi : i < vs[j].length), x ∈ f (k + j) i vs[j][i]) ∨ x ∈ g (k + j)

Membership in the outputs of the vectors of a list.

The graph #

The vertex of the coordinate i.

The vertex of the vector numbered k; the vectors of both lists are numbered consecutively.

The hub of a list: 0 for the first list, 1 for the second.

The vertices listed for the bit of coordinate i of a vector: the coordinate vertex.

The vertices listed after the vector numbered k: the vector vertex.

The edges listed for the bit b of coordinate i of the vector numbered k: the coordinate is adjacent to both hubs, and to the vector when b is true.

The edge listed after the vector numbered k of a list: from the hub of the list.

The hubs 0 and 1 and the padding vertices 2 and 3.

The hubs are adjacent to each other and to both padding vertices.

The graph of an orthogonal vectors instance, the orthogonal vectors form of the graph of Theorem 9 of [RVW13]: a vertex for each vector and each coordinate, the hubs 0 and 1 and the padding vertices 2 and 3. The hub 0 is adjacent to the vectors of the first list, the hub 1 to those of the second, both hubs to each other, to the coordinates and to the padding vertices, and a vector to the coordinates where it holds true.

Vertices and edges of the gadget #

The vertices of the gadget: four constants, coordinates, and vectors.

theorem Cslib.Complexity.OV.mem_edges_toDiameter {p : List (List Bool) × List (List Bool)} {e : ℕ × ℕ} (he : e ∈ (toDiameter p).edges) :
e ∈ Diameter.constEdges ∨ (∃ (i : ℕ), e = (0, Diameter.coordVertex i) ∨ e = (1, Diameter.coordVertex i)) ∨ (∃ k < p.1.length, e = (0, Diameter.vecVertex k)) ∨ (∃ j < p.2.length, e = (1, Diameter.vecVertex (p.1.length + j))) ∨ (∃ (k : ℕ) (hk : k < p.1.length) (i : ℕ) (hi : i < p.1[k].length), p.1[k][i] = true ∧ e = (Diameter.coordVertex i, Diameter.vecVertex k)) ∨ ∃ (j : ℕ) (hj : j < p.2.length) (i : ℕ) (hi : i < p.2[j].length), p.2[j][i] = true ∧ e = (Diameter.coordVertex i, Diameter.vecVertex (p.1.length + j))

The edges of the gadget.

An edge starts at a hub or at a coordinate.

The neighbours of a vector of the first list: the hub 0 and its coordinates.

The neighbours of a vector of the second list: the hub 1 and its coordinates.

The constant vertices are vertices of the gadget.

The constant edges are edges of the gadget.

The hub 0 is adjacent to the vectors of the first list.

The hub 1 is adjacent to the vectors of the second list.

A vector of the first list is adjacent to the coordinates where it holds true.

A vector of the second list is adjacent to the coordinates where it holds true.

The coordinates of the vectors of the first list are vertices of the gadget.

The vectors of the first list are vertices of the gadget.

The vectors of the second list are vertices of the gadget.

Distances in the gadget #

The hub 0 of the first list, a vertex of the gadget.

The hub 1 of the second list, a vertex of the gadget.

The vertices of the gadget: every vertex is a neighbour of both hubs 0 and 1, or a vector of the first list, adjacent to 0, or a vector of the second list, adjacent to 1.

theorem Cslib.Complexity.OV.exists_getElem_of_not_orthogonal {a b : List Bool} (h : ¬Orthogonal a b) :
∃ (i : ℕ) (ha : i < a.length) (hb : i < b.length), a[i] = true ∧ b[i] = true

Non-orthogonal vectors share a coordinate holding true in both.

Diameter at most three: through the hubs 0 and 1.

Diameter at most two without an orthogonal pair: a vector of each list share a coordinate holding true in both, and all other pairs of vertices share a hub.

An orthogonal pair is at distance more than two.

The constant vertices 2 and 3 are not adjacent.

Correctness of the reduction from orthogonal vectors to diameter: the gadget has diameter three on instances with an orthogonal pair, and diameter two otherwise.

One pass over an encoded instance #

@[reducible, inline]

The state of the parser of an encoded instance encOV (A, B): whether it reads B, whether it reads the marker of a bit of the outer frame of A (or the first bit of encOV), whether the bit it reads is a frame marker, the coordinate of the current bit, and the number of the current vector.

@[reducible, inline]

The encoding of the parser state.

A round of the parser, reading one bit. In the first list each bit c of the inner frames comes as [true, c] in the outer frame, and the first unmarked bit ends the first list. In the inner frames, a marker true announces a bit of the vector and false ends the vector.

def Cslib.Complexity.OV.parseEmit {β : Type} (f : ℕ → ℕ → Bool → List β) (g : Bool → ℕ → List β) (p : ParseState × Bool) :
List β

The output of a round of the parser: f k i b for the bit b of coordinate i of the vector numbered k, and g s k at the end of the vector numbered k of the list s.

def Cslib.Complexity.OV.parseRun {β : Type} (f : ℕ → ℕ → Bool → List β) (g : Bool → ℕ → List β) :

One pass of the parser over a list of bits, from a state.

theorem Cslib.Complexity.OV.streamEmit_eq_parseRun {β : Type} {f : ℕ → ℕ → Bool → List β} {g : Bool → ℕ → List β} {enc : β ↪ List Bool} (s : ParseState) (l : List Bool) :

The streamed output of the parser rounds is the encoded output of the pass.

theorem Cslib.Complexity.OV.parseRun_frame_snd {β : Type} {f : ℕ → ℕ → Bool → List β} {g : Bool → ℕ → List β} (i k : ℕ) (v rest : List Bool) :

In the second phase, a frame [true, b₁, …, true, bₙ, false] is one vector.

theorem Cslib.Complexity.OV.parseRun_frames_snd {β : Type} {f : ℕ → ℕ → Bool → List β} {g : Bool → ℕ → List β} (k : ℕ) (vs : List (List Bool)) (rest : List Bool) :

In the second phase, the frames of a list of vectors.

theorem Cslib.Complexity.OV.parseRun_frame_fst {β : Type} {f : ℕ → ℕ → Bool → List β} {g : Bool → ℕ → List β} (i k : ℕ) (v rest : List Bool) :

In the first phase, the outer frame marks each bit c of the inner frames as [true, c].

theorem Cslib.Complexity.OV.parseRun_frames_fst {β : Type} {f : ℕ → ℕ → Bool → List β} {g : Bool → ℕ → List β} (k : ℕ) (vs : List (List Bool)) (rest : List Bool) :

In the first phase, the outer frame of the inner frames of a list of vectors.

theorem Cslib.Complexity.OV.parseRun_encOV {β : Type} {f : ℕ → ℕ → Bool → List β} {g : Bool → ℕ → List β} (p : List (List Bool) × List (List Bool)) :
parseRun f g ((((false, false), false), 0), 0) (encOV p) = vecsOut f (g false) 0 p.1 ++ vecsOut f (g true) p.1.length p.2

The parser on an encoded instance: it emits the outputs of the first list, then those of the second, numbering the vectors of both lists consecutively.

The size of the parser state #

One pass of the parser over an encoded instance runs within time L (log L) ^ D on inputs of length L, when its outputs are computable in polynomial time.

The reduction from orthogonal vectors to diameter runs in quasi-linear time: within time L (log L) ^ D on instances encoded in length L.

theorem Cslib.Complexity.OV.length_encOV_le (p : List (List Bool) × List (List Bool)) :
(encOV p).length + 1 ≤ 4 * (p.1.length + p.2.length) * (dim p + 1) + 2

The encoded length of an instance of N vectors of dimension d is O(N d).

The conditional lower bound #

theorem Cslib.Complexity.DecidableInTimeO.decidableInTimeO_OV_of_diameter {ε : ℝ} (hε : 0 < ε) {S : Set Graph} (hS₂ : ∀ (G : Graph), G.induced.ediam ≤ 2 → G ∈ S) (hS₃ : ∀ (G : Graph), G.induced.ediam = 3 → G ∉ S) (hS : DecidableInTimeO S encGraph fun (G : Graph) => ↑(encGraph G).length ^ (2 - ε)) :
DecidableInTimeO OV encOV fun (p : List (List Bool) × List (List Bool)) => ↑(p.1.length + p.2.length) ^ (2 - min ε 1 / 2) * (↑(OV.dim p) + 1) ^ 2

Separating diameter two from three decides orthogonal vectors, the orthogonal vectors form of Theorem 9 of [RVW13]: a procedure accepting the graphs of diameter at most two and rejecting those of diameter three, within time L ^ (2 - ε) on graphs encoded in length L, decides OV within time N ^ (2 - min ε 1 / 2) (d + 1) ^ 2 on N vectors of dimension d.

theorem Cslib.Complexity.not_decidableInTimeO_diameter_of_OVH (hOVH : OVH) {ε : ℝ} (hε : 0 < ε) {S : Set Graph} (hS₂ : ∀ (G : Graph), G.induced.ediam ≤ 2 → G ∈ S) (hS₃ : ∀ (G : Graph), G.induced.ediam = 3 → G ∉ S) :
¬DecidableInTimeO S encGraph fun (G : Graph) => ↑(encGraph G).length ^ (2 - ε)

Orthogonal vectors hardness of diameter two versus three [RVW13]: under the orthogonal vectors hypothesis, for every ε > 0, no procedure accepting the graphs of diameter at most two and rejecting those of diameter three runs within time L ^ (2 - ε) on graphs encoded in length L.

theorem Cslib.Complexity.not_decidableInTimeO_diameter_size_of_OVH (hOVH : OVH) {ε : ℝ} (hε : 0 < ε) {S : Set Graph} (hS₂ : ∀ (G : Graph), G.induced.ediam ≤ 2 → G ∈ S) (hS₃ : ∀ (G : Graph), G.induced.ediam = 3 → G ∉ S) :
¬DecidableInTimeO S encGraph fun (G : Graph) => ↑(G.vertices.length + G.edges.length) ^ (2 - ε) + ↑(encGraph G).length

Orthogonal vectors hardness of diameter two versus three, in the size of the graph: under the orthogonal vectors hypothesis, for every ε > 0, no procedure accepting the graphs of diameter at most two and rejecting those of diameter three runs within time (n + m) ^ (2 - ε) + L on graphs listing n vertices and m edges, encoded in length L. The term L lets the procedure read its input: without it the statement would hold without the hypothesis, since a time bound in n + m alone does not allow reading long vertex labels.

Diameter at most two is not decidable in subquadratic time under the orthogonal vectors hypothesis, for graphs encoded in length L.