Fully polynomial almost uniform samplers #
Jerrum, Valiant and Vazirani's generator may return none. Every successful output belongs to
the witness set. Its individual probability approximates a common positive reference mass
φ(x) multiplicatively, and the probability of success is at least one half on nonempty
instances [JerrumValiantVazirani1986, §6, p. 181]. Time is polynomial in the instance length
and the unary precision q. The total-variation estimates below are used in the reductions
between this generator and approximate counting.
Main definitions #
Cslib.Complexity.uniformWitness: the uniform law on a finite set of witnesses.Cslib.Complexity.IsFPAUS: a fully polynomial almost uniform sampler.Cslib.Complexity.FPAUS: the witness families admitting one.
Main results #
Cslib.Complexity.uniformWitness_toOuterMeasure_some: the probability of an event of witnesses is its relative cardinality.Cslib.Complexity.closeTo_uniformWitness_of_le: pointwise lower bounds(1 - ε) / |W|on the witnesses give closeness touniformWitness W.
References #
A fully polynomial almost uniform generator in the sense of Jerrum, Valiant and Vazirani
[JerrumValiantVazirani1986, §6, p. 181]. The unary input q asks for dyadic relative error
ε = 2 ^ (-(q+1)). Every positive tolerance below one admits a smaller such tolerance with
q = O(log (1/ε)). The common reference mass may depend on the instance.
- isPPTOn : Probability.IsPPTOn (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encUnary) (Turing.MultiTapeTM.encOption Turing.MultiTapeTM.encBits) (Function.uncurry S)
The sampler runs in strict polynomial time on the encoded instance and unary precision.
A successful run always outputs a witness.
On a nonempty instance the probability of failure is at most one half.
- pointwise (x : α) : ∃ φ ∈ Set.Ioc 0 1, ∀ (q : ℕ), ∀ w ∈ W x, φ / (1 + (1 / 2) ^ (q + 1)) ≤ ((S x q).eval (some w)).toReal ∧ ((S x q).eval (some w)).toReal ≤ (1 + (1 / 2) ^ (q + 1)) * φ
Every individual witness has the prescribed relative accuracy at every precision.
Nonempty witness sets have no ideal failure mass.
Closeness to the uniform witness law from pointwise lower bounds. A law on optional
witnesses giving every witness of W probability at least (1 - ε) / |W|, and no witness at all
when W is empty, is within statistical distance ε of uniformWitness W.