Documentation

CslibFrontier.Computability.Complexity.Classes.SharpP.Metric

Metric reductions and #P-hardness under one-query reductions #

A metric reduction Krentel from f : α → Y to g : β → Z is a pair of polynomial-time functions, a query map r : α → β and a recovery map post : α × Z → Y, with f a = post (a, g (r a)): one query to g, whose answer is post-processed together with the input. Parsimonious reductions are the metric reductions whose recovery returns the answer (ParsimoniousReducible.metricReducible). The reductions of Valiant's theorem Valiant, Arora and Barak, Section 9.2, Goldreich, Section 6.2.1 are of this form but are not parsimonious: the permanent of the matrix built from a formula is a fixed power c ^ m times the number of satisfying assignments, and the integer permanent is recovered from a 0/1 permanent by reduction modulo a large number.

Both books define #P-completeness by polynomial-time oracle (Cook) reductions. A metric reduction makes one oracle query; SharpPMetricHard is #P-hardness under metric reductions, a strengthening of the books' notion that is weaker than parsimonious hardness (SharpPHard.sharpPMetricHard). It already rules out polynomial-time algorithms unless every function in #P is polynomial-time computable (SharpPMetricHard.computableInPolyTime).

Main definitions #

Main results #

References #

def Cslib.Complexity.MetricReducible {α β Y Z : Type} (encA : α ↪ List Bool) (encB : β ↪ List Bool) (encY : Y ↪ List Bool) (encZ : Z ↪ List Bool) (f : α → Y) (g : β → Z) :

f reduces to g by a metric reduction: a polynomial-time query map r and a polynomial-time recovery map post, reading the input and the answer of g, satisfy f a = post (a, g (r a)).

theorem Cslib.Complexity.MetricReducible.refl {α Y : Type} (encA : α ↪ List Bool) (encY : Y ↪ List Bool) (f : α → Y) :
MetricReducible encA encA encY encY f f

Every function reduces to itself by a metric reduction.

theorem Cslib.Complexity.MetricReducible.trans {α β γ Y Z W : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {encC : γ ↪ List Bool} {encY : Y ↪ List Bool} {encZ : Z ↪ List Bool} {encW : W ↪ List Bool} {f : α → Y} {g : β → Z} {h : γ → W} (hfg : MetricReducible encA encB encY encZ f g) (hgh : MetricReducible encB encC encZ encW g h) :
MetricReducible encA encC encY encW f h

Metric reductions compose: query the second reduction's instance and recover twice.

theorem Cslib.Complexity.ParsimoniousReducible.metricReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {f : α → ℕ} {g : β → ℕ} (h : ParsimoniousReducible encA encB f g) :

Parsimonious reductions are metric reductions, recovering the answer unchanged.

def Cslib.Complexity.SharpPMetricHard {β Z : Type} (encB : β ↪ List Bool) (encZ : Z ↪ List Bool) (g : β → Z) :

g is #P-hard under metric reductions: every function in #P, with any encoding of its instances, reduces to g by a metric reduction. The values of g are encoded by encZ, so that integer-valued problems such as the integer permanent are included.

def Cslib.Complexity.SharpPMetricComplete {β : Type} (encB : β ↪ List Bool) (g : β → ℕ) :

g is in #P and #P-hard under metric reductions.

Parsimonious #P-hardness implies #P-hardness under metric reductions.

Parsimonious #P-completeness implies #P-completeness under metric reductions.

theorem Cslib.Complexity.SharpPMetricHard.trans {β γ Z W : Type} {encB : β ↪ List Bool} {encC : γ ↪ List Bool} {encZ : Z ↪ List Bool} {encW : W ↪ List Bool} {g : β → Z} {h : γ → W} (hg : SharpPMetricHard encB encZ g) (hgh : MetricReducible encB encC encZ encW g h) :
SharpPMetricHard encC encW h

#P-hardness under metric reductions transfers along a metric reduction.

theorem Cslib.Complexity.SharpPMetricHard.computableInPolyTime {α β Z : Type} {encB : β ↪ List Bool} {encZ : Z ↪ List Bool} {g : β → Z} (hg : SharpPMetricHard encB encZ g) (hpoly : Turing.MultiTapeTM.ComputableInPolyTime g encB encZ) {enc : α ↪ List Bool} {f : α → ℕ} (hf : f ∈ SharpP enc) :

If a function that is #P-hard under metric reductions is computable in polynomial time, then so is every function in #P.