Documentation

CslibFrontier.Computability.Complexity.FineGrained

The exponential time hypotheses #

Fine-grained complexity measures running time in a parameter of the instance, such as the number n of variables of a formula, rather than in the length L of its encoding. The time class Cslib.Complexity.DTIME bounds the time by a function of L; here Cslib.Complexity.DecidableInTimeO A enc T bounds it by O(T a) for any real function T of the instance a, on the same machines. A bound that is a function of the length gives back DTIME (Cslib.Complexity.mem_DTIME_iff_decidableInTimeO).

Cslib.Complexity.DecidableInExpTime A enc μ δ says that A is decidable within time 2 ^ (δ * μ a) times a polynomial in L, for a parameter μ. The polynomial in L is the cost of reading and processing the instance; the parameter is never hidden in the encoding length. For formulas μ is usually the number of distinct variables (Cslib.Logic.PL.CNF.numVars), which is at most L, and can be much smaller.

The negation of ETH is Cslib.Complexity.DecidableInSubexpTime: decidability within time 2 ^ (δ * n) times a polynomial for every δ > 0, by a decider that may depend on δ (Cslib.Complexity.ETH_iff_not_decidableInSubexpTime).

The companion CountingNativeEndpoint module proves subexponential decidability of k-SAT for each fixed width using an exact-counting algorithm with polynomial workspace. It derives zero SAT exponents and the negations of ETH and SETH. The hypotheses remain defined here so their conditional consequences can still be stated.

Main definitions #

Main results #

References #

Time bounds in parameters of the instance #

def Cslib.Complexity.DecidableInTimeO {α : Type u_1} (A : Set α) (enc : α ↪ List Bool) (T : α → ℝ) :

A is decidable within time O(T a) on the instance a: within time c * T a + c, for a constant c, by a machine with a binary alphabet and finitely many states reading enc a, with any space bound. Unlike Cslib.Complexity.DTIME, the bound is any real function of the instance, not only a function of the length of enc a.

theorem Cslib.Complexity.DecidableInTimeO.mono {α : Type u_1} {enc : α ↪ List Bool} {A : Set α} {T T' : α → ℝ} (h : DecidableInTimeO A enc T) (c : ℕ) (hT : ∀ (a : α), T a ≤ ↑c * T' a + ↑c) (hT' : ∀ (a : α), 0 ≤ T' a) :

Weakening the bound of Cslib.Complexity.DecidableInTimeO up to constants.

theorem Cslib.Complexity.mem_DTIME_iff_decidableInTimeO {α : Type u_1} {enc : α ↪ List Bool} {A : Set α} {t : ℕ → ℕ} :
A ∈ DTIME enc t ↔ DecidableInTimeO A enc fun (a : α) => ↑(t (enc a).length)

DTIME in terms of DecidableInTimeO. For a bound that is a function of the length of the encoded instance, Cslib.Complexity.DecidableInTimeO is membership in Cslib.Complexity.DTIME.

The machine combinators of the library are stated for Type.

theorem Cslib.Complexity.DecidableInTimeO.exists_computableInO {α : Type} {enc : α ↪ List Bool} {A : Set α} {T : α → ℝ} (h : DecidableInTimeO A enc T) :
∃ (g : α → Bool) (t : α → ℕ) (c : ℕ), Turing.MultiTapeTM.ComputableInO g enc Turing.MultiTapeTM.encBool t t ∧ (∀ (a : α), a ∈ A ↔ g a = true) ∧ ∀ (a : α), ↑(t a) ≤ ↑c * T a + ↑c

A decider within time O(T) is a decider within time and space O(t), for a bound t within O(T).

theorem Cslib.Complexity.DecidableInTimeO.of_computableInO {α : Type} {enc : α ↪ List Bool} {A : Set α} {T : α → ℝ} {g : α → Bool} {t S : α → ℕ} (hg : Turing.MultiTapeTM.ComputableInO g enc Turing.MultiTapeTM.encBool t S) (hA : ∀ (a : α), a ∈ A ↔ g a = true) (hT : ∀ (a : α), ↑(t a) ≤ T a) :

A decider within time O(t), for t ≤ T, decides within time O(T).

theorem Cslib.Complexity.DecidableInTimeO.inter {α : Type} {enc : α ↪ List Bool} {B : Set α} {T : α → ℝ} {p : α → Bool} (hp : Turing.MultiTapeTM.ComputableInPolyTime p enc Turing.MultiTapeTM.encBool) (hB : DecidableInTimeO B enc T) (hT : ∀ (a : α), 0 ≤ T a) :
∃ (e : ℕ), DecidableInTimeO ({a : α | p a = true} ∩ B) enc fun (a : α) => (if p a = true then T a else 0) + (↑(enc a).length + 1) ^ e

Restriction to a set decided in polynomial time. If p is computable in polynomial time and B is decidable within time O(T), then the instances of B satisfying p are decidable within time O(T) on instances satisfying p, plus a polynomial in the length of the encoded instance: the decider tests p first, and rejects at once when it fails.

Exponential and subexponential time #

def Cslib.Complexity.DecidableInExpTime {α : Type u_1} (A : Set α) (enc : α ↪ List Bool) (μ : α → ℕ) (δ : ℝ) :

A is decidable within time 2 ^ (δ * μ a) times a polynomial in the length of the encoded instance: within time O(2 ^ (δ * μ a) * (L + 1) ^ e) for some e, on instances a with encoding of length L.

def Cslib.Complexity.DecidableInSubexpTime {α : Type u_1} (A : Set α) (enc : α ↪ List Bool) (μ : α → ℕ) :

A is decidable in subexponential time in μ: within time 2 ^ (δ * μ a) times a polynomial in the length of the encoded instance, for every δ > 0. The decider may depend on δ, so this is weaker than a single decider within time 2 ^ o(μ a); it is the negation of the quantifier pattern of the exponential time hypothesis.

theorem Cslib.Complexity.DecidableInExpTime.mono {α : Type u_1} {enc : α ↪ List Bool} {A : Set α} {μ : α → ℕ} {δ δ' : ℝ} (h : DecidableInExpTime A enc μ δ) (hδ : δ ≤ δ') :
DecidableInExpTime A enc μ δ'

Larger exponents allow more problems.

theorem Cslib.Complexity.DecidableInExpTime.of_computableInO {α : Type} {enc : α ↪ List Bool} {A : Set α} {μ : α → ℕ} {δ : ℝ} {g : α → Bool} {t S : α → ℕ} (hg : Turing.MultiTapeTM.ComputableInO g enc Turing.MultiTapeTM.encBool t S) (hA : ∀ (a : α), a ∈ A ↔ g a = true) (c e : ℕ) (ht : ∀ (a : α), ↑(t a) ≤ ↑c * (2 ^ (δ * ↑(μ a)) * (↑(enc a).length + 1) ^ e)) :
DecidableInExpTime A enc μ δ

A decider within time O(t), for t within a constant times 2 ^ (δ * μ a) times a polynomial, decides within time 2 ^ (δ * μ a) times a polynomial.

theorem Cslib.Complexity.DecidableInExpTime.inter {α : Type} {enc : α ↪ List Bool} {B : Set α} {μ : α → ℕ} {δ : ℝ} {p : α → Bool} (hp : Turing.MultiTapeTM.ComputableInPolyTime p enc Turing.MultiTapeTM.encBool) (h : DecidableInExpTime B enc μ δ) (hδ : 0 ≤ δ) :
DecidableInExpTime ({a : α | p a = true} ∩ B) enc μ δ

Restriction to a set decided in polynomial time, for exponential bounds with δ ≥ 0.

k-SAT and the exponential time hypotheses #

k-SAT: the satisfiable formulas whose clauses have at most k literals.

noncomputable def Cslib.Complexity.satExponent (k : ℕ) :

The exponent s_k of k-SAT [IP01]: the infimum (Cslib.rateExponent) of the δ ≥ 0 for which k-SAT is decidable within time 2 ^ (δ * n) times a polynomial in the length of the encoded formula, on formulas with n variables. Exhaustive search puts 1 in this set, so s_k ∈ [0, 1] (Cslib.Complexity.satExponent_le_one).

The exponential time hypothesis [IP01]: for some δ > 0, 3SAT is not decidable within time 2 ^ (δ * n) times any polynomial in the length of the encoded formula, on formulas with n variables.

The strong exponential time hypothesis [IP01]: for every ε > 0 there is a width k such that k-SAT is not decidable within time 2 ^ ((1 - ε) * n) times any polynomial in the length of the encoded formula, on formulas with n variables.

The exponential time hypothesis says that 3SAT is not decidable in subexponential time in the number of variables.

Orthogonal vectors #

Two bit vectors are orthogonal when no coordinate is true in both. Missing coordinates of a shorter vector count as false.

Instances For

    Orthogonality only depends on the coordinates of the first vector.

    The orthogonal vectors problem: the pairs (A, B) of lists of bit vectors with an orthogonal pair of vectors a ∈ A and b ∈ B.

    Instances of the orthogonal vectors problem, encoded as pairs of lists of bit vectors.

    The dimension of an instance of the orthogonal vectors problem: the length of its longest vector.

    The orthogonal vectors hypothesis, in its moderate-dimension form: for every ε > 0, the orthogonal vectors problem is not decidable within time N ^ (2 - ε) times any polynomial in the dimension d, on instances of N vectors. The low-dimension form, for dimension c log N with a constant c depending on ε, is stronger and is not stated here.