Documentation

CslibFrontier.Computability.Complexity.FineGrained.OrthogonalVectors

Williams's split-and-list transfer from Orthogonal Vectors to SAT #

The split-and-list reduction of Williams [Wil05] (Cslib.Complexity.toOV) splits the n distinct variables of a formula with m clauses into halves of ⌊n / 2⌋ and ⌈n / 2⌉ variables. To each assignment of a half it assigns the vector of length m whose coordinate j is true when no literal of clause j on a variable of the half is satisfied (Cslib.Complexity.OV.clauseVector). Two such vectors, one for each half, are orthogonal exactly when every clause is satisfied by one of the two partial assignments, that is when together they satisfy the formula. So the formula is satisfiable exactly when the instance toOV φ, of 2 ^ ⌊n / 2⌋ and 2 ^ ⌈n / 2⌉ vectors of dimension m, is in OV (Cslib.Complexity.toOV_mem_OV_iff).

The reduction writes its output of about 2 ^ ⌈n / 2⌉ m bits within time 2 ^ ⌈n / 2⌉ times a polynomial in the length of the encoded formula (Cslib.Complexity.exists_computableInO_toOV). The vectors are streamed to the output one at a time (Turing.MultiTapeTM.ComputableInTimeAndSpace.iterate_unary_stream_sum); accumulating them in a list would cost time quadratic in the number of vectors. Then a decider for OV within time N ^ (2 - ε) times a polynomial in the dimension, on N vectors, decides unrestricted SAT within time 2 ^ ((1 - min ε 1 / 2) n) times a polynomial, for ε > 0 (Cslib.Complexity.DecidableInTimeO.decidableInExpTime_SAT). Contrapositively, if unrestricted SAT is not decidable at any exponential rate below 1, the orthogonal vectors hypothesis holds (Cslib.Complexity.OVH_of_not_decidableInExpTime_SAT).

The orthogonal vectors hypothesis is stated with a polynomial factor in the dimension. Its form for dimension c log N is not proved here. Williams derives OVH from the strong exponential time hypothesis, which concerns k-SAT for fixed widths k. Cslib.Complexity.CountingNativeEndpoint.not_SETH refutes that hypothesis, so this module does not state the implication from it. The premise of OVH_of_not_decidableInExpTime_SAT, about unrestricted SAT, is not refuted, and the library neither proves nor refutes OVH.

Main definitions #

Main results #

References #

Orthogonality #

theorem Cslib.Complexity.OV.orthogonal_map_map {γ : Type u_1} {l : List γ} {f g : γ → Bool} :
Orthogonal (List.map f l) (List.map g l) ↔ ∀ x ∈ l, f x = false ∨ g x = false

Vectors indexed by the same list are orthogonal when no index is true in both.

The split-and-list reduction #

Whether the assignment numbered by i on the variables vs satisfies a literal of the clause c on a variable of vs.

The vector of the assignment numbered by i on the variables vs: coordinate j is true when the assignment satisfies no literal of clause j of φ on a variable of vs.

The vectors of the 2 ^ |vs| assignments numbered on the variables vs.

The first ⌊n / 2⌋ of the n distinct variables.

The last ⌈n / 2⌉ of the n distinct variables.

The split-and-list reduction [Wil05]: the vectors of the assignments of the first ⌊n / 2⌋ and of the last ⌈n / 2⌉ of the n distinct variables of a formula.

theorem Cslib.Complexity.OV.orthogonal_clauseVector_iff {φ : Logic.PL.CNF ℕ} {vs₁ vs₂ : List ℕ} (hdisj : vs₁.Disjoint vs₂) (hcover : ∀ v ∈ φ.vars, v ∈ vs₁ ∨ v ∈ vs₂) (i₁ i₂ : ℕ) :
Orthogonal (clauseVector φ vs₁ i₁) (clauseVector φ vs₂ i₂) ↔ Logic.PL.CNF.eval (fun (v : ℕ) => if v ∈ vs₁ then Logic.PL.bitsAssignment vs₁ i₁ v else Logic.PL.bitsAssignment vs₂ i₂ v) φ = true

Orthogonal vectors are satisfying assignments. For disjoint lists of variables vs₁ and vs₂ covering the variables of φ, the vectors of the assignments numbered by i₁ on vs₁ and by i₂ on vs₂ are orthogonal exactly when the two assignments together satisfy φ.

The split-and-list reduction is correct [Wil05]: toOV φ ∈ OV ↔ φ ∈ SAT.

Sizes #

theorem Cslib.Complexity.OV.dim_le {p : List (List Bool) × List (List Bool)} {b : ℕ} (h : ∀ v ∈ p.1 ++ p.2, v.length ≤ b) :
dim p ≤ b

The dimension is at most a bound on the lengths of all vectors.

The vectors of toOV φ have one coordinate for each clause.

Running time #

@[reducible, inline]

The states of the stream of vectors: a formula, a list of variables, and the number of the next assignment.

@[reducible, inline]

Stream states encoded as framed tuples.

Computing the vector of a numbered assignment is polynomial-time.

Streaming the vectors of a half of the variables: the vectors of the 2 ^ |half φ| assignments numbered on half φ, each wrapped by wrap, followed by fin, are written within time 2 ^ |half φ| times a polynomial in the length of the encoded formula.

theorem Cslib.Complexity.exists_computableInO_toOV :
∃ (e : ℕ), Turing.MultiTapeTM.ComputableInO toOV encCNF encOV (fun (φ : Logic.PL.CNF ℕ) => 2 ^ (φ.numVars - φ.numVars / 2) * ((encCNF φ).length + 1) ^ e) fun (φ : Logic.PL.CNF ℕ) => 2 ^ (φ.numVars - φ.numVars / 2) * ((encCNF φ).length + 1) ^ e

The split-and-list reduction is fast: it writes its output within time 2 ^ ⌈n / 2⌉ times a polynomial in the length of the encoded formula, on formulas with n variables.

Williams' theorem #

theorem Cslib.Complexity.DecidableInTimeO.decidableInExpTime_SAT {ε : ℝ} (hε : 0 < ε) {e : ℕ} (h : DecidableInTimeO OV encOV fun (p : List (List Bool) × List (List Bool)) => ↑(p.1.length + p.2.length) ^ (2 - ε) * (↑(OV.dim p) + 1) ^ e) :

Williams' theorem [Wil05]: a decider for OV within time N ^ (2 - ε) times a polynomial in the dimension, on instances of N vectors, gives a decider for SAT within time 2 ^ ((1 - ε / 2) n) times a polynomial in the length of the encoded formula, on formulas with n variables, for 0 < ε ≤ 1; for ε > 1 it gives the exponent 1 / 2 of the reduction.

If unrestricted SAT is not decidable at any exponential rate strictly below 1, then the orthogonal vectors hypothesis OVH holds [Wil05].