Documentation

MIPRE.Foundations.OracularSampler

The typed oracularized sampler #

Piece O3 of planning/oracularization.md (issue #189): the sampler of the paper's typed oracularized verifier (sec:orac-def) as a CL.TypedSampler over the three roles, whose typed CL functions are roleFamily of the input sampler's (the identity for the oracle, the input's for the isolated players) — the half of lem:oracle-effective-interface about the sampler.

The program is the fixed core OracleSampler.core, run on the input sampler's program through the s-m-n construction hardcode, as the repeated sampler is. The core routes a typed query with at most one call to the input sampler, through the universal machine:

The identity's queries #

theorem MIPRE.CL.CLFun.factorOfPrefix_trivialOn {F : Type u_1} [Semiring F] {ι : Type u_2} [DecidableEq ι] [Fintype ι] (ℓ k : ℕ) (u : ι → F) :
theorem MIPRE.CL.CLFun.mapOfPrefix_trivialOn {F : Type u_1} [Semiring F] {ι : Type u_2} [DecidableEq ι] [Fintype ι] (ℓ k : ℕ) (u : ι → F) :
(trivialOn ℓ).mapOfPrefix k u = 0
theorem MIPRE.CL.CLFun.eval_truncate_ident {F : Type u_1} [Semiring F] {ι : Type u_2} [DecidableEq ι] [Fintype ι] (ℓ j : ℕ) (hj : 1 ≤ j) (x : ι → F) :
(truncate j (ident ℓ)).eval x = x

Every marginal of the identity from the first on is the identity.

theorem MIPRE.CL.CLFun.mapOfPrefix_ident_zero {F : Type u_1} [Semiring F] {ι : Type u_2} [DecidableEq ι] [Fintype ι] (ℓ : ℕ) (u : ι → F) :
theorem MIPRE.CL.CLFun.mapOfPrefix_ident_succ {F : Type u_1} [Semiring F] {ι : Type u_2} [DecidableEq ι] [Fintype ι] (ℓ k : ℕ) (u : ι → F) :
(ident ℓ).mapOfPrefix (k + 1) u = 0
theorem MIPRE.CL.CLFun.factorOfPrefix_ident_zero {F : Type u_1} [Semiring F] {ι : Type u_2} [DecidableEq ι] [Fintype ι] (ℓ : ℕ) (u : ι → F) :
theorem MIPRE.CL.CLFun.factorOfPrefix_ident_succ {F : Type u_1} [Semiring F] {ι : Type u_2} [DecidableEq ι] [Fintype ι] (ℓ k : ℕ) (u : ι → F) :
(ident ℓ).factorOfPrefix (k + 1) u = ∅
@[simp]
theorem MIPRE.Cost.PolyTimeFun.const_toFun {α : Type u_1} {β : Type u_2} [SizedEncoding α] [SizedEncoding β] (b : β) :
(const b).toFun = fun (x : α) => b

Roles as data #

The roles as numbers: the oracle 0, the isolated Alice 1, the isolated Bob 2.

Equations
Instances For
    @[instance_reducible]
    Equations
    • One or more equations did not get rendered due to their size.

    The core #

    The input sampler's program, hardcoded first.

    Equations
    Instances For

      A call to the input sampler, through the universal machine, on the query q.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        An isolated role's query, as the query of the corresponding original player.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          The oracle's answers, read off the query alone: the marginal of the identity is the seed; its first stage map is the identity and its later ones zero; its first factor space is everything and its later ones nothing.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            The router: the dimension query and the isolated roles' queries go to the input sampler, the oracle's are answered directly.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              The answer of the call is the answer.

              Equations
              Instances For

                The router on well-formed queries #

                theorem MIPRE.OracleSampler.route_call_shape (sD' nD' qd' payload : Cost.Data) (h : route.toFun (sD'.cons (nD'.cons qd')) = (true, payload)) :
                ∃ (q' : Cost.Data), payload = (sD'.cons (nD'.cons q')).cons Cost.Data.nil

                Every call the router makes keeps the hardcoded program and the index.

                The typed sampler #

                noncomputable def MIPRE.OracleSampler.prog (sp : Cost.Prog) :

                The program of the typed oracularized sampler on the input sampler's program sp.

                Equations
                Instances For
                  theorem MIPRE.OracleSampler.prog_runs_forward (n : ℕ) {ℓ : ℕ} (S : CL.Sampler (ℓ + 1)) (x : Cost.Data) (q : CL.Sampler.Query) (r : Cost.Data) (t : ℕ) (hroute : route.toFun ((Cost.encode S.prog).cons x) = (true, ((Cost.encode S.prog).cons (Cost.encode (n, q))).cons Cost.Data.nil)) (hS : S.prog.Runs (Cost.encode (n, q)) r t) :
                  ∃ (t' : ℕ), (prog S.prog).Runs x r t'

                  A forwarded query is answered by the input sampler, through the universal machine.

                  An oracle query is answered directly.

                  noncomputable def MIPRE.oracleSampler {ℓ : ℕ} (S : CL.Sampler (ℓ + 1)) :

                  The typed oracularized sampler (the sampler of sec:orac-def): the typed CL functions are the identity for the oracle and the input sampler's own for the isolated players, the same for both players; the program answers an isolated role's query as the input sampler answers the corresponding original player's, and an oracle query directly. It depends on the input sampler alone.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    @[simp]
                    theorem MIPRE.oracleSampler_dim {ℓ : ℕ} (S : CL.Sampler (ℓ + 1)) (n : ℕ) :
                    @[simp]
                    theorem MIPRE.oracleSampler_cl {ℓ : ℕ} (S : CL.Sampler (ℓ + 1)) (n : ℕ) (w : Player) (t : Role) :
                    (oracleSampler S).cl n w t = roleFamily (S.cl n) t

                    The running time #

                    theorem MIPRE.OracleSampler.size_call_le (sD' nD' d q' : Cost.Data) (h : route.toFun (sD'.cons (nD'.cons d)) = (true, (sD'.cons (nD'.cons q')).cons Cost.Data.nil)) :
                    q'.size ≤ 2 * d.size + 9

                    A forwarded query is at most twice the typed query, plus a constant: it is the dimension query, or the typed query's own fields with the player replaced.

                    noncomputable def MIPRE.OracleSampler.coreCost (xs B k X : ℕ) :

                    The explicit cost of the core on an input of size xs, at the input sampler's coefficient B and degree k, with X one more than the size of the typed query.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      theorem MIPRE.OracleSampler.core_runs_within {ℓ : ℕ} (S : CL.Sampler (ℓ + 1)) (n : ℕ) {B k : ℕ} (hS : S.TimeBoundAt n B k) (d : Cost.Data) :
                      ∃ (r : Cost.Data), ∃ t ≤ coreCost ((Cost.encode S.prog).cons ((Cost.encode n).cons d)).size B k (d.size + 1), core.Runs ((Cost.encode S.prog).cons ((Cost.encode n).cons d)) r t

                      The core halts within coreCost on every input of the typed sampler, well formed or not: the router, at most one call to the input sampler through the universal machine, and the postprocessing.

                      theorem MIPRE.OracleSampler.oracleSampler_timeBound :
                      ∃ (c : ℕ) (m : ℕ) (e : ℕ), ∀ {ℓ : ℕ} (S : CL.Sampler (ℓ + 1)) (n B k W : ℕ), B ≤ W → Cost.esize S.prog ≤ W → n ≤ W → S.TimeBoundAt n B k → (oracleSampler S).TimeBoundAt n (c * (W + 1) ^ m) (e * (k + 1))

                      The running time of the typed oracularized sampler: constants c, m, e uniform in everything such that, whenever W dominates the input sampler's coefficient, its description length and the index, and the input sampler runs within B (|d| + 1)^k at n, the typed sampler runs within c (W + 1)^m (|d| + 1)^{e (k + 1)}. A forwarded query is at most a constant factor larger than the typed query, and since |d| + 1 ≥ 2 that factor is absorbed into the degree, so no term exponential in k enters the coefficient.

                      The program is a polynomial-time function of the input sampler's program: the s-m-n map at the fixed core.

                      Equations
                      Instances For