Documentation

CslibFrontier.Computability.Complexity.Classes.Sparse

Sparse problems #

A problem is sparse when it has only polynomially many members of each size. With instances encoded as binary words, S ∈ SPARSE enc when, for a polynomially bounded p, at most p n members of S have encodings of length at most n. This is the census form of the definition Fluet, Hemaspaandra and Homan, Assignment page 5. Counting encodings of length exactly n gives the same class, the form taken by Cslib.Circuits.Boolean.PPoly.of_sparse, which Cslib.Circuits.Boolean.PPoly.of_mem_SPARSE connects to this definition. The count is an extended natural number (Set.encard), so that an infinite set of members is not counted as 0; since an encoding is injective, every such set is finite.

Sparse problems cannot be hard for coNP (Fortune) or for NP (Mahaney), even under one-query truth-table reductions, unless P = NP; see CslibFrontier/Computability/Complexity/Classes/Sparse/Fortune.lean, CslibFrontier/Computability/Complexity/Classes/Sparse/Mahaney.lean and CslibFrontier/Computability/Complexity/Classes/Sparse/OneQuery.lean.

Main definitions #

Main results #

References #

def Cslib.Complexity.SPARSE {α : Type u_1} (enc : α ↪ List Bool) :
Set (Set α)

The sparse problems with respect to the encoding enc: S ∈ SPARSE enc when, for some polynomially bounded p, at most p n members of S have encodings of length at most n Fluet, Hemaspaandra and Homan, Assignment page 5.

theorem Cslib.Complexity.mem_SPARSE {α : Type u_1} {enc : α ↪ List Bool} {S : Set α} :
S ∈ SPARSE enc ↔ ∃ (p : ℕ → ℕ), PolynomiallyBounded p ∧ ∀ (n : ℕ), {a : α | a ∈ S ∧ (enc a).length ≤ n}.encard ≤ ↑(p n)
theorem Cslib.Complexity.exists_card_le_of_mem_SPARSE {α : Type u_1} {enc : α ↪ List Bool} {S : Set α} (h : S ∈ SPARSE enc) :
∃ (c : ℕ) (d : ℕ), ∀ (n : ℕ) (s : Finset α), (∀ a ∈ s, a ∈ S ∧ (enc a).length ≤ n) → s.card ≤ c * (n + 1) ^ d

A sparse problem has at most c (n + 1) ^ d members of encoded length at most n, in every finite set of them.

theorem Cslib.Complexity.mem_SPARSE_of_subset {α : Type u_1} {enc : α ↪ List Bool} {S T : Set α} (hTS : T ⊆ S) (h : S ∈ SPARSE enc) :
T ∈ SPARSE enc

Subsets of sparse problems are sparse.

A problem is sparse exactly when the language of the encodings of its members is.

theorem Set.Finite.mem_SPARSE {α : Type u_1} {enc : α ↪ List Bool} {S : Set α} (h : S.Finite) :

Finite problems are sparse.

theorem Cslib.Complexity.mem_SPARSE_of_unary {L : Set (List Bool)} (hL : ∀ w ∈ L, ∀ b ∈ w, b = true) :

Unary languages are sparse: a language of words consisting only of trues has at most n + 1 words of length at most n.

The language of all words is not sparse: it has 2 ^ n words of each length n, more than any polynomial bound allows.