Documentation

CslibFrontier.Computability.Circuit.Boolean.Oracle

Oracle circuits and inlining #

An oracle circuit for a language A over Bool is a De Morgan circuit with, in addition, an oracle gate of every arity q, which answers whether the word formed by its q arguments is in A (oracleSignature, oracleInterpretation A). The arguments of an oracle gate may be computed from the answers of other oracle gates, so the queries are adaptive. Such circuits are the relativized circuits of Wilson.

Inlining replaces every oracle gate of arity q by a De Morgan circuit D q computing the slice of A at q (inlineOracle), which is the simulation of the oracle basis by the De Morgan basis (Circuit.simulate): the result computes what the oracle circuit computes (eval_inlineOracle), each oracle gate costing the size and the depth of its replacement (size_inlineOracle, depth_inlineOracle_le).

PPolyOracle A is P/poly relative to A: the languages with oracle circuits of polynomial size whose gates have polynomially many arguments. Every language in P/poly is in it (PPoly.subset_PPolyOracle), and when A is in P/poly, inlining its circuits, of polynomial size at the polynomially bounded arities of the queries, shows the converse (PPolyOracle_subset_PPoly): P/poly with oracle gates for a language in P/poly is P/poly (PPolyOracle_eq_PPoly).

Main definitions #

Main results #

References #

The operations of the De Morgan basis, and an oracle gate of every arity.

  • base (op : Op) : OracleOp

    An operation of the De Morgan basis.

  • query (q : ℕ) : OracleOp

    The oracle gate of q arguments.

@[reducible, inline]

The arity of an operation of the oracle basis.

One for an oracle gate and zero for a De Morgan operation: the weight whose cost counts oracle gates and whose weighted depth counts oracle gates along a path.

The fan-in of an oracle gate, and zero for a De Morgan operation.

@[reducible, inline]

The De Morgan basis with an oracle gate of every arity. It is reducible, so that case analysis on its operations sees their arities.

The meaning of the oracle basis for the oracle A: the oracle gate of q arguments answers whether the word they form is in A.

Instances For
    @[simp]

    oracleInterpretation A interprets a base operation using the standard De Morgan interpretation.

    @[simp]

    oracleInterpretation A interprets an arity-q query gate using A.slice q.

    The De Morgan basis inside the oracle basis.

    Instances For

      The embedding toOracle of the De Morgan basis into the oracle basis preserves semantics.

      Inlining #

      The De Morgan circuit replacing each operation of the oracle basis: a gate for an operation of the De Morgan basis, and D q for the oracle gate of q arguments.

      The cost of an operation of the oracle basis in the size of the inlined circuit: one gate for an operation of the De Morgan basis, and the size of D q for the oracle gate of q arguments.

      The cost of an operation of the oracle basis in the depth of the inlined circuit: one level for an operation of the De Morgan basis, and the depth of D q for the oracle gate of q arguments.

      The oracle circuit C with every oracle gate of q arguments replaced by the De Morgan circuit D q.

      Inlining an oracle. If every D q computes the slice of A at q, the inlined circuit computes what the oracle circuit computes with the oracle A.

      The inlined circuit has one gate for each gate of the De Morgan basis and the gates of D q for each oracle gate of q arguments.

      The inlined circuit is at most as deep as the oracle circuit when an oracle gate of q arguments costs the depth of D q.

      theorem Cslib.Circuits.Boolean.size_inlineOracle_le {n m : ℕ} (C : Circuit oracleSignature n m) (D : (q : ℕ) → Circuit signature q 1) {r s : ℕ} (hC : C.FanInAtMost r) (hD : ∀ q ≤ r, (D q).size ≤ s) :

      If every gate of an oracle circuit has at most r arguments, and every D q with q ≤ r has at most s gates, the inlined circuit has at most size C * max 1 s gates.

      P/poly relative to an oracle #

      P/poly relative to the oracle A: the languages with oracle circuits, one for each input length n, with at most s n gates, each of at most s n arguments, for a polynomially bounded s. The size counts gates; bounding arity too bounds incoming wire occurrences by s n ^ 2.

      A De Morgan program in the oracle basis has fan-in at most two.

      @[simp]

      A De Morgan program in the oracle basis has no oracle gates.

      A De Morgan circuit in the oracle basis has no oracle gate on any path. Not a simp lemma: Circuit.depthWith_mapOp rewrites its left-hand side.

      A language in P/poly is in P/poly relative to any oracle.

      Inlining an oracle in P/poly. If A is in P/poly, so is every language in P/poly relative to A: its oracle gates have polynomially many arguments, at which A has circuits of polynomial size.

      P/poly relative to a language in P/poly is P/poly.