Documentation

CslibFrontier.Computability.Complexity.Classes.SharpP.MetricOracle

Metric reductions as oracle computations #

Arora and Barak define FP^f for f : {0,1}* → ℕ as the functions computable in polynomial time by an oracle machine that may ask for bit i of f x Arora and Barak, Section 9.2; here the oracle language answers the bits of f (Cslib.Complexity.AnswersBits, for instance Cslib.Complexity.bitGraph). A function is #P-complete in their sense (Definition 9.5) when it is in #P and every function in #P lies in FP^f.

A metric reduction f a = post (a, g (r a)) is such an oracle computation when the values of g have polynomially many bits: the program Cslib.Complexity.readBitsProgram asks, one after the other, for bits 0, 1, …, c a - 1 of g (r a), where c a is a polynomial in the length of the encoded query, reassembles the number, and applies post (Cslib.Complexity.MetricReducible.polyTimeOracleProgram). The program is fixed before the oracle and is correct against every oracle language answering the bits of g. Hence #P-completeness under metric reductions gives #P-completeness in the sense of Arora and Barak (Cslib.Complexity.SharpPMetricComplete.computableInPolyTimeWithOracle).

Main results #

References #

theorem Cslib.Complexity.MetricReducible.polyTimeOracleProgram {α β Y : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {encY : Y ↪ List Bool} {f : α → Y} {g : β → ℕ} (h : MetricReducible encA encB encY Turing.MultiTapeTM.encNat f g) {p : Polynomial ℕ} (hp : ∀ (b : β), g b < 2 ^ Polynomial.eval (encB b).length p) :
PolyTimeOracleProgram encA encY (AnswersBits encB g) fun (x : α → Y) => x = f

A metric reduction is a polynomial-time oracle program. If f reduces by a metric reduction to g, whose values have fewer than p (|encB b|) bits for a polynomial p, then one polynomial-time oracle program computes f against every oracle language answering the bits of g: it reads the bits of g (r a) and applies the recovery map.

theorem Cslib.Complexity.MetricReducible.computableInPolyTimeWithOracle {α β Y : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {encY : Y ↪ List Bool} {f : α → Y} {g : β → ℕ} (h : MetricReducible encA encB encY Turing.MultiTapeTM.encNat f g) {p : Polynomial ℕ} (hp : ∀ (b : β), g b < 2 ^ Polynomial.eval (encB b).length p) :

A metric reduction to a function g with polynomially many bits makes f computable in polynomial time relative to the bit graph of g: f ∈ FP^g in the sense of Arora and Barak.

theorem Cslib.Complexity.SharpPMetricComplete.computableInPolyTimeWithOracle {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {g : β → ℕ} (hg : SharpPMetricComplete encB g) {f : α → ℕ} (hf : f ∈ SharpP encA) :

#P-completeness under metric reductions gives #P-completeness in the sense of Arora and Barak (Definition 9.5): every function in #P is computable in polynomial time relative to the bit graph of a #P-complete function.

A #P-complete function in FP collapses #P to FP [AroraBarak07, Proposition 9.6]. Fix an instance encoding encA. Suppose every function in #P under encA is computable in polynomial time relative to the bit graph of g, as in Definition 9.5, and g itself is computable in polynomial time. Then the functions in #P under encA are exactly the polynomial-time functions with binary output (FP here): f ∈ FP^g = FP, and FP ⊆ #P by mem_SharpP_of_polyTime.

The draft's functions are on {0,1}*: at encA = encBits the completeness premise is Definition 9.5's, and Decoder.bits decodes the instances of g. Here g may have any instance encoding with a polynomial-time decoder, which lets the bit-graph oracle reject words that are not codes (bitGraph_mem_P). The draft's hypothesis g ∈ #P is not needed. For #SAT and the 0/1 permanent, the completeness premise holds at every encoding, by SharpPMetricComplete.computableInPolyTimeWithOracle.