Counting oracles within polynomial space and the counting hierarchy #
An arbitrarily encoded #P function extends to a #P function on all words: use the finite native counting machine supplied by its machine characterization and count the branches halted by its polynomial clock. On valid codes this is the original function; on other words no halting claim is needed. Thresholding the extension gives the corresponding extension for PP languages.
The definitions of P^PP and P^#P require a single oracle program to work for every oracle
agreeing on valid encodings. Choosing the total PP extension therefore puts these classes within
PSPACE. In particular, this argument does not assume that an encoding's image is decidable. In
the same way, if every #P function on words is computable in polynomial time, the bit graph of the
total extension is a polynomial-time oracle, and P^#P collapses to P. Since the total
extension is a PP language on words, it is also an oracle of the first level of the counting
hierarchy, so P^PP lies in its second level C₂P = PP^PP; with Toda's theorem, so does PH.
Main results #
Cslib.Complexity.SharpP.exists_extension: a total word extension of a counting function.Cslib.Complexity.exists_PP_extension: a PP word language agreeing on valid encodings.Cslib.Complexity.PWithPPOracle_subset_PSPACE.Cslib.Complexity.PWithPPOracle_subset_CountingLevel_two:P^PP ⊆ C₂P.Cslib.Complexity.PWithSharpPOracle_subset_PSPACE.Cslib.Complexity.PWithSharpPOracle_subset_P_of_SharpP_subset:#P ⊆ FPimpliesP^#P = P.
References #
Polynomial time with a PP oracle is contained in polynomial space, including arbitrary oracle-instance encodings and arbitrary answers outside their image.
P^PP ⊆ C₂P: polynomial time with a PP oracle lies in the second level of the counting
hierarchy, PP^PP. The total PP extension of the oracle problem is a PP language on words, and a
polynomial-time oracle program is a majority verifier relative to it. With Toda's theorem
PH ⊆ P^PP Toda (Cslib.Complexity.PH_subset_PWithPPOracle) this gives
PH ⊆ C₂P.
Polynomial time with a bit-by-bit #P oracle is contained in polynomial space.
If #P ⊆ FP, then P^#P = P: if every #P function on words is computable in polynomial
time with binary output, every problem in P^#P is in P, at every instance encoding. The total
word extension of the oracle's function (SharpP.exists_extension) is then computable in
polynomial time, so its bit graph is a polynomial-time oracle answering every query on a valid
code.