Documentation

CslibFrontier.Computability.Complexity.FineGrained.BruteForce

Exhaustive search for satisfiability #

Exhaustive search decides SAT by trying the 2 ^ n numbered assignments of the n distinct variables of a formula (Cslib.Logic.PL.CNF.satisfiable_iff_exists_bitsAssignment). By Cslib.Complexity.DecidableInExpTime.of_exhaustiveSearch, iterating the polynomial-time evaluation step (Cslib.Complexity.computableInPolyTime_eval_bitsAssignment) 2 ^ n times decides SAT, and every k-SAT, within time 2 ^ n times a polynomial in the length of the encoded formula (Cslib.Complexity.SAT_decidableInExpTime_one, Cslib.Complexity.KSAT_decidableInExpTime_one).

Main definitions #

Main results #

References #

Exponential bounds #

theorem Cslib.Complexity.exists_le_mul_two_pow_of_polyBounded {α : Type u_1} {size μ T P Q : α → ℕ} (hP : Turing.MultiTapeTM.PolyBounded size P) (hQ : Turing.MultiTapeTM.PolyBounded size Q) (hT : ∀ (a : α), T a ≤ (2 ^ μ a + 1) * P a + Q a) :
∃ (c : ℕ) (e : ℕ), ∀ (a : α), T a ≤ c * 2 ^ μ a * (size a + 1) ^ e

A bound by 2 ^ μ a + 1 rounds of a polynomial, plus a polynomial, is a bound by 2 ^ μ a times a polynomial.

Exhaustive search: try the 2 ^ n assignments numbered by i < 2 ^ n on the n distinct variables of the formula.

Exhaustive search decides SAT.

SAT by exhaustive search: SAT is decidable within time 2 ^ n times a polynomial in the length of the encoded formula, on formulas with n variables.

theorem Cslib.Complexity.KSAT_eq_inter (k : ℕ) {B : Set (Logic.PL.CNF ℕ)} (hB : KSAT k ⊆ B) (hBSAT : B ⊆ SAT) :

k-SAT is SAT restricted to the formulas whose clauses have at most k literals.

k-SAT by exhaustive search: k-SAT is decidable within time 2 ^ n times a polynomial in the length of the encoded formula, on formulas with n variables.