Documentation

Complexitylib.Classes.PCP.Internal.BitwiseFP

Computing an output one bit at a time #

A polynomial-time function is usually easiest to describe not as a string transformation but as a rule for each output bit: "the i-th bit of f x is whatever this decision procedure says". This module turns such a description into f ∈ FP.

The two inputs are a unary length function — how long the output is, given in unary so that it is itself a plausible FP output — and a bit oracle, a polynomial-time function reading pair x (unary i) and returning the single bit. The construction is an iteration of an append-one-bit step, run once per output position, and iterate_mem_FP supplies the closure of FP under such iterations.

This is the bridge that lets a decision procedure written on the RAM surface (where RAM_P_eq_P transfers it to P) be used to build a function in FP, for which no direct RAM bridge exists.

Main definitions #

Main results #

One step of the construction: consult the oracle at the current output length and append the bit it returns. The state is pair (output so far) input.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem Complexity.bitStep_iterate {G : List BoolList Bool} {b : List BoolBool} (hGspec : ∀ (x : List Bool) (i : ), G (pair x (List.replicate i true)) = [b x i]) (x : List Bool) (n : ) :
    (bitStep G)^[n] (pair [] x) = pair (List.map (b x) (List.range n)) x

    Running the step from the empty output builds the first n bits.

    theorem Complexity.bitwise_mem_FP {len : List Bool} {b : List BoolBool} (hlen : (fun (x : List Bool) => List.replicate (len x) true) FP) {G : List BoolList Bool} (hG : G FP) (hGspec : ∀ (x : List Bool) (i : ), G (pair x (List.replicate i true)) = [b x i]) :
    (fun (x : List Bool) => List.map (b x) (List.range (len x))) FP

    A function described bit by bit is polynomial time. If the output length is computable in unary and each output bit is computable from the input and the position in unary, the function itself is in FP.

    theorem Complexity.bitwise_mem_FP_of_mem_P {len : List Bool} {b : List BoolBool} (hlen : (fun (x : List Bool) => List.replicate (len x) true) FP) {L : Language} (hL : L P) (hLspec : ∀ (x : List Bool) (i : ), pair x (List.replicate i true) L b x i = true) :
    (fun (x : List Bool) => List.map (b x) (List.range (len x))) FP

    The same, from a language in P. The bit rule is usually established as a decision problem — "does position i of the output carry a one?" — and this is the form in which RAM_P_eq_P delivers it.