Threshold languages of #P functions
DefinitionThreshold language of a counting function#✓fully proved
For a function \(f\) from bitstrings to natural numbers, the threshold language of \(f\) is the decision problem that accepts a bitstring \(y\) exactly when decoding \(y\) with the canonical bitstring encoding of pairs of a bitstring and a natural number succeeds and gives a pair \((x, k)\) with \(k \le f(x)\); bitstrings that do not decode are rejected.
noncomputable def thresholdLang (f : List Bool → ℕ) :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun y =>
match MetaMathlibExt.BitstringEncoding.bitDecode (α := List Bool × ℕ) y with
| some (x, k) => decide (k ≤ f x)
| none => false
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def bitDecode [BitstringEncoding α] (l : List Bool) : Option α := toEncoding.decode l
MathlibExt/Computability/Complexity.lean:58
Uses 9 · Used by 1
TheoremThreshold languages of #P functions are in PSPACE#●ready to prove
For every function \(f\) in \(\#P\), the threshold language of \(f\), which accepts a bitstring exactly when it decodes, under the canonical bitstring encoding of pairs, to a pair \((x, k)\) of a bitstring \(x\) and a natural number \(k\) with \(k \le f(x)\), is in PSPACE.
public theorem_wanted sharpP_threshold_pspace :
∀ f ∈ SharpP, thresholdLang f ∈ PSPACE
def SharpP : Set (List Bool → ℕ) :=
{f | ∃ p : Polynomial ℕ, ∃ R : List Bool × List Bool → Bool, IsPolyTime R ∧
∀ x, f x = Set.ncard
{w : Fin (p.eval x.length) → Bool | R (x, List.ofFn w) = true}}
CSLibExt/Computability/Complexity/Classes.lean:229
noncomputable def thresholdLang (f : List Bool → ℕ) :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun y =>
match MetaMathlibExt.BitstringEncoding.bitDecode (α := List Bool × ℕ) y with
| some (x, k) => decide (k ≤ f x)
| none => false
WantedExt/Complexity/KeyTheorems/SharpPThresholdPSPACEWanted.lean:43
def PSPACE : DecisionComplexityClass :=
{L | langOf L ∈ Cslib.Turing.MultiTapeTM.Classes.PSPACE}
CSLibExt/Computability/Complexity/Classes.lean:117
Sources
- L. G. Valiant, "The complexity of enumeration and reliability problems" (1979); S. Arora and B. Barak, Computational Complexity: A Modern Approach, 2009, Theorem 9.3 (#P ⊆ PSPACE in the threshold-language form).
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.