Documentation

CslibFrontier.Computability.Complexity.FineGrained.PPSZ.Search

Deciding w-implication by a finite search #

Cslib.Complexity.PPSZ.WImplied quantifies over subformulas and total assignments. This file reduces it to a search over finite lists: x = b is w-implied under τ exactly when τ already sets x to b, or some choice of w clauses of φ (with repetitions) has no compatible choice of one literal per clause under τ with x set to !b (Cslib.Complexity.PPSZ.wImplied_iff_test). A choice of literals is compatible when τ falsifies none of them and no two are complementary (Cslib.Complexity.PPSZ.compatible); a list of clauses has an extension of a partial assignment that satisfies it exactly when some choice of one literal per clause is compatible (Cslib.Complexity.PPSZ.satExt_iff). Both choices are sections of lists (List.sections), the lists picking one element from each of a list of lists, so the test is a nested search over sections. The search is the one the word-RAM program Cslib.Algorithms.WordRAM.PPSZ.impliedCode runs.

Main definitions #

Main results #

References #

def Cslib.Complexity.PPSZ.SatExt {n : ℕ} (ρ : Fin n → Option Bool) (ψ : Logic.PL.CNF (Fin n)) :

Some total assignment extending the partial assignment ρ satisfies ψ.

The literals ls can be made true together by an extension of the partial assignment ρ: ρ falsifies none of them, and no two of them are complementary.

theorem Cslib.Complexity.PPSZ.satExt_iff {n : ℕ} (ρ : Fin n → Option Bool) (ψ : Logic.PL.CNF (Fin n)) :
SatExt ρ ψ ↔ ∃ ls ∈ List.sections ψ, compatible ρ ls = true

Satisfiability by an extension through choices of literals. Some extension of ρ satisfies the clauses ψ exactly when some choice of one literal from each clause is compatible with ρ.

The empty list of clauses is satisfied by an extension of any partial assignment.

theorem Cslib.Complexity.PPSZ.satExt_congr {n : ℕ} {ρ : Fin n → Option Bool} {ψ ψ' : Logic.PL.CNF (Fin n)} (h : ∀ (c : Logic.PL.Clause (Fin n)), c ∈ ψ ↔ c ∈ ψ') :
SatExt ρ ψ ↔ SatExt ρ ψ'

Satisfiability by an extension depends only on the set of clauses.

theorem Cslib.Complexity.PPSZ.mem_sections_replicate {α : Type u_1} {l : List α} {k : ℕ} {f : List α} :
f ∈ (List.replicate k l).sections ↔ f.length = k ∧ ∀ a ∈ f, a ∈ l

Sections of n copies of l are the lists of length n with entries in l.

def Cslib.Complexity.PPSZ.impliedTest {n : ℕ} (φ : Logic.PL.CNF (Fin n)) (w : ℕ) (τ : Fin n → Option Bool) (x : Fin n) (b : Bool) :

The finite search deciding w-implication: τ sets x to b, or some choice of w clauses of φ has no compatible choice of literals under τ with x set to !b.

theorem Cslib.Complexity.PPSZ.wImplied_iff_test {n : ℕ} (φ : Logic.PL.CNF (Fin n)) (w : ℕ) (τ : Fin n → Option Bool) (x : Fin n) (b : Bool) :
WImplied φ w τ x b ↔ impliedTest φ w τ x b = true

w-implication is a finite search. x = b is w-implied under τ exactly when impliedTest accepts.

theorem Cslib.Complexity.PPSZ.implied_eq_test {n : ℕ} (φ : Logic.PL.CNF (Fin n)) (w : ℕ) (τ : Fin n → Option Bool) (x : Fin n) :

The implied value through the search: true if the search accepts x = true, otherwise false if it accepts x = false, and none otherwise.