Documentation

MIPRE.Foundations.OracularDecider

The typed oracularized decider #

Piece O4 of planning/oracularization.md (issue #189): the decider of the paper's typed oracularized verifier (sec:orac-def, fig:oracle-decider) as a total CL.TypedDecider over the three roles, whose acceptance law is O2's bit-string predicate oraclePred.

The paper runs the input decider in its timeout-counter form, which halts within a bound B_𝒟(n) read off its description, and parses answers against that bound. The ambient model has no such form, and the detyping compiler needs a total typed decider, so the timeout is made explicit: an index routine (OracleDecider.Index) supplies at index n a parse cut B n and a simulation budget K n, and the decider runs an unclocked core under the clocked universal machine for K n steps. Three programs, each fixed, with the input programs as data:

The decider is hardcode (shell j) (encode (S̄, D̄, Ī)), so its program is the s-m-n function of the three programs. It halts on every input, whatever the input programs do (oracleDecider_total), and it accepts exactly when the core accepts within the budget (oracleDecider_accepts_iff). The core's acceptance law is oraclePred exactly, with no hypothesis on the input verifier (core_accepts_iff): the input decider need not halt on the inputs it rejects, which is why both directions go through inversion lemmas of the programs. So the decider's acceptance implies oraclePred unconditionally (accepts_sound), and oraclePred implies acceptance once the core's run fits in the budget (accepts_complete) — the role the timeout bound plays in the paper's completeness.

Inverting the routing combinators #

theorem MIPRE.Cost.Prog.let_closed_runs {p q : Prog} (hq : WellScoped 1 q) {x v r : Data} {s t : ℕ} (hp : p.Runs x v s) (hq' : q.Runs v r t) :
(p.let_ q).Runs x r (s + t + 1)

Sequencing two closed programs.

theorem MIPRE.Cost.Prog.let_closed_inv {p q : Prog} (hq : WellScoped 1 q) {x r : Data} {t : ℕ} (h : (p.let_ q).Runs x r t) :
∃ (v : Data) (s : ℕ) (t' : ℕ), p.Runs x v s ∧ q.Runs v r t'

Inverting the sequence of two closed programs.

theorem MIPRE.Cost.Prog.callWithContext_inv {p : Prog} (hp : WellScoped 1 p) (post : PolyTimeFun (Data × Data) Data) {a ctx r : Data} {t : ℕ} (h : (p.callWithContext post).Runs (a.cons ctx) r t) :
∃ (r' : Data) (t' : ℕ), p.Runs a r' t' ∧ r = post.toFun (ctx, r')

Inverting callWithContext: a run is a run of the callee on the argument, followed by the postprocessor.

theorem MIPRE.Cost.Prog.routeOneCall_indirect_inv (route : PolyTimeFun Data (Bool × Data)) {p : Prog} (hp : WellScoped 1 p) (post : PolyTimeFun (Data × Data) Data) {x a ctx r : Data} {t : ℕ} (hroute : route.toFun x = (true, a.cons ctx)) (h : (routeOneCall route p post).Runs x r t) :
∃ (r' : Data) (t' : ℕ), p.Runs a r' t' ∧ r = post.toFun (ctx, r')

Inverting a routed call: when the router calls, a run is a run of the callee on the argument, followed by the postprocessor.

theorem MIPRE.Cost.Prog.routeOneCall_direct_inv (route : PolyTimeFun Data (Bool × Data)) (p : Prog) (post : PolyTimeFun (Data × Data) Data) {x r₀ r : Data} {t : ℕ} (hroute : route.toFun x = (false, r₀)) (h : (routeOneCall route p post).Runs x r t) :
r = r₀

Inverting a routed call when the router answers directly.

The game check #

The input sampler's program, first field of a game check's input.

Equations
Instances For

    The marginal query (n, w, marginal, j, z) at the game check's seed.

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

      First call: Alice's marginal.

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

        Second call: Bob's marginal.

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

          Third call: the input decider on the two questions and the two answers.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def MIPRE.OracleDecider.gInput (sp dp : Cost.Prog) (n : ℕ) (z a₁ a₂ : Cost.BitStr) :

            The input of a game check.

            Equations
            Instances For
              theorem MIPRE.OracleDecider.gRoute₁_apply (j : ℕ) (sp dp : Cost.Prog) (n : ℕ) (z a₁ a₂ : Cost.BitStr) :
              (gRoute₁ j).toFun (gInput sp dp n z a₁ a₂) = (true, ((Cost.encode sp).cons (Cost.encode (n, CL.Sampler.Query.marginal Player.alice j z))).cons (gInput sp dp n z a₁ a₂))
              theorem MIPRE.OracleDecider.gRoute₂_apply (j : ℕ) (sp dp : Cost.Prog) (n : ℕ) (z a₁ a₂ : Cost.BitStr) (rA : Cost.Data) :
              (gRoute₂ j).toFun ((gInput sp dp n z a₁ a₂).cons rA) = (true, ((Cost.encode sp).cons (Cost.encode (n, CL.Sampler.Query.marginal Player.bob j z))).cons ((gInput sp dp n z a₁ a₂).cons rA))
              theorem MIPRE.OracleDecider.gRoute₃_apply (sp dp : Cost.Prog) (n : ℕ) (z a₁ a₂ : Cost.BitStr) (rA rB : Cost.Data) :
              gRoute₃.toFun (((gInput sp dp n z a₁ a₂).cons rA).cons rB) = (true, ((Cost.encode dp).cons ((Cost.encode n).cons (rA.cons (rB.cons (Cost.encode (a₁, a₂)))))).cons Cost.Data.nil)
              noncomputable def MIPRE.OracleDecider.margBits {ℓ : ℕ} (S : CL.Sampler ℓ) (n j : ℕ) (w : Player) (z : Cost.BitStr) :

              The question the game check computes for player w from the seed z.

              Equations
              Instances For
                noncomputable def MIPRE.OracleDecider.gameArg {ℓ : ℕ} (S : CL.Sampler ℓ) (n j : ℕ) (z a₁ a₂ : Cost.BitStr) :

                The input decider's input in a game check.

                Equations
                Instances For
                  theorem MIPRE.OracleDecider.univ_marginal {ℓ : ℕ} (S : CL.Sampler ℓ) (n j : ℕ) (hj₁ : 1 ≤ j) (hj : j ≤ ℓ) (w : Player) (z : Cost.BitStr) (hz : List.length z = S.dim n) :

                  The two marginal calls, through the universal machine.

                  theorem MIPRE.OracleDecider.gameProg_runs {ℓ : ℕ} (S : CL.Sampler ℓ) (dp : Cost.Prog) (n j : ℕ) (hj₁ : 1 ≤ j) (hj : j ≤ ℓ) (z a₁ a₂ : Cost.BitStr) (hz : List.length z = S.dim n) {rD : Cost.Data} {tD : ℕ} (hD : dp.Runs (gameArg S n j z a₁ a₂) rD tD) :
                  ∃ (t : ℕ), (gameProg j).Runs (gInput S.prog dp n z a₁ a₂) (Cost.encode (decide (rD = Cost.encode true))) t

                  The game check runs the input decider on the two questions and the two answers, and returns whether it accepted.

                  theorem MIPRE.OracleDecider.univ_marginal_inv {ℓ : ℕ} (S : CL.Sampler ℓ) (n j : ℕ) (hj₁ : 1 ≤ j) (hj : j ≤ ℓ) (w : Player) (z : Cost.BitStr) (hz : List.length z = S.dim n) {r : Cost.Data} {t : ℕ} (h : Cost.selfUniversal.univ.Runs ((Cost.encode S.prog).cons (Cost.encode (n, CL.Sampler.Query.marginal w j z))) r t) :
                  r = Cost.encode (margBits S n j w z)

                  The sampler's run on a marginal query, read back through the universal machine.

                  theorem MIPRE.OracleDecider.gameProg_inv {ℓ : ℕ} (S : CL.Sampler ℓ) (dp : Cost.Prog) (n j : ℕ) (hj₁ : 1 ≤ j) (hj : j ≤ ℓ) (z a₁ a₂ : Cost.BitStr) (hz : List.length z = S.dim n) {r : Cost.Data} {t : ℕ} (h : (gameProg j).Runs (gInput S.prog dp n z a₁ a₂) r t) :
                  ∃ (rD : Cost.Data) (tD : ℕ), dp.Runs (gameArg S n j z a₁ a₂) rD tD ∧ r = Cost.encode (decide (rD = Cost.encode true))

                  Inverting the game check: every run of it is a run of the input decider on the two questions and the two answers, whose verdict it returns.

                  theorem MIPRE.OracleDecider.gameProg_accepts_iff {ℓ : ℕ} (S : CL.Sampler ℓ) (dp : Cost.Prog) (n j : ℕ) (hj₁ : 1 ≤ j) (hj : j ≤ ℓ) (z a₁ a₂ : Cost.BitStr) (hz : List.length z = S.dim n) :
                  (∃ (t : ℕ), (gameProg j).Runs (gInput S.prog dp n z a₁ a₂) (Cost.encode true) t) ↔ ∃ (tD : ℕ), dp.Runs (gameArg S n j z a₁ a₂) (Cost.encode true) tD

                  The game check accepts exactly when the input decider does on the two questions and the two answers.

                  Parsing an answer by its role #

                  A datum decodes to a bit string exactly when it is its encoding.

                  An oracle's answer parses to a pair exactly when its postorder parse is the encoding of that pair.

                  theorem MIPRE.OracleDecider.parseAns_oracle (B : ℕ) (s : Cost.BitStr) :
                  parseAns B Role.oracle s = match pairDec s with | some (a, b) => if h : List.length a ≤ B ∧ List.length b ≤ B then some (OAns.pair ⟨a, ⋯⟩ ⟨b, ⋯⟩) else none | none => none

                  Postorder parsing, as a polynomial-time function (Prog.parseProg).

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

                    a ∧ b on Boolean-valued functions.

                    Equations
                    Instances For
                      @[simp]
                      theorem MIPRE.OracleDecider.andB_apply {α : Type u_1} [Cost.SizedEncoding α] (f g : Cost.PolyTimeFun α Bool) (x : α) :
                      (andB f g).toFun x = (f.toFun x && g.toFun x)

                      ¬ a ∨ b on Boolean-valued functions.

                      Equations
                      Instances For
                        @[simp]
                        theorem MIPRE.OracleDecider.impB_apply {α : Type u_1} [Cost.SizedEncoding α] (f g : Cost.PolyTimeFun α Bool) (x : α) :
                        (impB f g).toFun x = (!f.toFun x || g.toFun x)

                        Equality of two raw trees.

                        Equations
                        Instances For
                          @[simp]
                          theorem MIPRE.OracleDecider.eqD_apply {α : Type u_1} [Cost.SizedEncoding α] (f g : Cost.PolyTimeFun α Cost.Data) (x : α) :
                          (eqD f g).toFun x = decide (f.toFun x = g.toFun x)

                          The bounded parse, as a check: an oracle's answer must parse to the encoding of a pair of strings of length at most the cut, an isolated player's must have length at most the cut.

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

                            The parsed answer, as a datum: the parse tree of an oracle's answer, an isolated player's answer as it is.

                            Equations
                            Instances For
                              @[simp]
                              theorem MIPRE.OracleDecider.answers_mk_inj {B : ℕ} {a b : Cost.BitStr} (ha : List.length a ≤ B) (hb : List.length b ≤ B) :
                              ⟨a, ha⟩ = ⟨b, hb⟩ ↔ a = b

                              Two answers of the same shape are equal exactly when their data are.

                              theorem MIPRE.OracleDecider.okAns_spec (r s : Cost.PolyTimeFun Cost.Data Cost.Data) (B : Cost.PolyTimeFun Cost.Data ℕ) (c : Cost.Data) (role : Role) (str : Cost.BitStr) (hr : r.toFun c = Cost.encode role) (hs : s.toFun c = Cost.encode str) :
                              ((okAns r s B).toFun c = true ↔ (parseAns (B.toFun c) role str).isSome = true) ∧ ∀ (U : OAns (Verifier.Answers (B.toFun c))), parseAns (B.toFun c) role str = some U → (reprAns r s).toFun c = ansData U

                              The parse check is the bounded parse, and the parsed datum represents the parse.

                              The bounded parse returns answers of the role's shape.

                              The core #

                              The fields of the core's input ((S̄, D̄, B), (n, t, x, u, y, a, b)).

                              Equations
                              Instances For
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        def MIPRE.OracleDecider.cInput (sp dp : Cost.Prog) (B n : ℕ) (t : Role) (x : Cost.BitStr) (u : Role) (y a b : Cost.BitStr) :

                                        The core's input.

                                        Equations
                                        Instances For
                                          @[simp]
                                          theorem MIPRE.OracleDecider.cSp_cInput (sp dp : Cost.Prog) (B n : ℕ) (t : Role) (x : Cost.BitStr) (u : Role) (y a b : Cost.BitStr) :
                                          cSp.toFun (cInput sp dp B n t x u y a b) = Cost.encode sp
                                          @[simp]
                                          theorem MIPRE.OracleDecider.cDp_cInput (sp dp : Cost.Prog) (B n : ℕ) (t : Role) (x : Cost.BitStr) (u : Role) (y a b : Cost.BitStr) :
                                          cDp.toFun (cInput sp dp B n t x u y a b) = Cost.encode dp
                                          @[simp]
                                          theorem MIPRE.OracleDecider.cB_cInput (sp dp : Cost.Prog) (B n : ℕ) (t : Role) (x : Cost.BitStr) (u : Role) (y a b : Cost.BitStr) :
                                          cB.toFun (cInput sp dp B n t x u y a b) = B
                                          @[simp]
                                          theorem MIPRE.OracleDecider.cN_cInput (sp dp : Cost.Prog) (B n : ℕ) (t : Role) (x : Cost.BitStr) (u : Role) (y a b : Cost.BitStr) :
                                          cN.toFun (cInput sp dp B n t x u y a b) = Cost.encode n
                                          @[simp]
                                          theorem MIPRE.OracleDecider.cT_cInput (sp dp : Cost.Prog) (B n : ℕ) (t : Role) (x : Cost.BitStr) (u : Role) (y a b : Cost.BitStr) :
                                          cT.toFun (cInput sp dp B n t x u y a b) = Cost.encode t
                                          @[simp]
                                          theorem MIPRE.OracleDecider.cX_cInput (sp dp : Cost.Prog) (B n : ℕ) (t : Role) (x : Cost.BitStr) (u : Role) (y a b : Cost.BitStr) :
                                          cX.toFun (cInput sp dp B n t x u y a b) = Cost.encode x
                                          @[simp]
                                          theorem MIPRE.OracleDecider.cU_cInput (sp dp : Cost.Prog) (B n : ℕ) (t : Role) (x : Cost.BitStr) (u : Role) (y a b : Cost.BitStr) :
                                          cU.toFun (cInput sp dp B n t x u y a b) = Cost.encode u
                                          @[simp]
                                          theorem MIPRE.OracleDecider.cY_cInput (sp dp : Cost.Prog) (B n : ℕ) (t : Role) (x : Cost.BitStr) (u : Role) (y a b : Cost.BitStr) :
                                          cY.toFun (cInput sp dp B n t x u y a b) = Cost.encode y
                                          @[simp]
                                          theorem MIPRE.OracleDecider.cA_cInput (sp dp : Cost.Prog) (B n : ℕ) (t : Role) (x : Cost.BitStr) (u : Role) (y a b : Cost.BitStr) :
                                          cA.toFun (cInput sp dp B n t x u y a b) = Cost.encode a
                                          @[simp]
                                          theorem MIPRE.OracleDecider.cBb_cInput (sp dp : Cost.Prog) (B n : ℕ) (t : Role) (x : Cost.BitStr) (u : Role) (y a b : Cost.BitStr) :
                                          cBb.toFun (cInput sp dp B n t x u y a b) = Cost.encode b

                                          Check 2(a): equal roles force equal answers.

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

                                            Check 2(b), for the role r against the role r': an oracle's component for an isolated player's role must be that player's answer.

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

                                              The checks that need no call: both parses, check 2(a) and check 2(b) both ways.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                theorem MIPRE.OracleDecider.ovpCheck_spec {B : ℕ} (r r' rep rep' : Cost.PolyTimeFun Cost.Data Cost.Data) (c : Cost.Data) (t u : Role) (U W : OAns (Verifier.Answers B)) (hU : SeededGame.shapeOk t U = true) (hW : SeededGame.shapeOk u W = true) (hr : r.toFun c = Cost.encode t) (hr' : r'.toFun c = Cost.encode u) (hrep : rep.toFun c = ansData U) (hrep' : rep'.toFun c = ansData W) {V : Type u_1} (z z' : V) :
                                                (ovpCheck r r' rep rep').toFun c = SeededGame.oracleVsPlayer (t, z) (u, z') U W
                                                theorem MIPRE.OracleDecider.sameCheck_spec {B : ℕ} (c : Cost.Data) (t u : Role) (U W : OAns (Verifier.Answers B)) (hU : SeededGame.shapeOk t U = true) (hW : SeededGame.shapeOk u W = true) (ht : cT.toFun c = Cost.encode t) (hu : cU.toFun c = Cost.encode u) (hrA : repA.toFun c = ansData U) (hrB : repB.toFun c = ansData W) :
                                                theorem MIPRE.OracleDecider.localCheck_spec (sp dp : Cost.Prog) (B n : ℕ) (t : Role) (x : Cost.BitStr) (u : Role) (y a b : Cost.BitStr) {V : Type u_1} (z z' : V) :

                                                The local checks are the checks of oaccepts that need no call.

                                                The game checks and the verdict #

                                                The game check's input for the answer datum rep at the seed z.

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

                                                  Route a game check: when cond holds of the core's input (read through view), call the game check on arg; otherwise pass true on. The whole state is the context either way.

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

                                                    The game check of each player runs when that player is an oracle whose answer parsed.

                                                    Equations
                                                    Instances For

                                                      The verdict: the local checks passed and both game checks returned true.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        noncomputable def MIPRE.OracleDecider.coreTail (j : ℕ) :

                                                        The second game check and the verdict.

                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For
                                                          noncomputable def MIPRE.OracleDecider.core (j : ℕ) :

                                                          The core of the typed oracularized decider.

                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For
                                                            theorem MIPRE.OracleDecider.gameStage_inv (j : ℕ) (cond : Cost.PolyTimeFun Cost.Data Bool) (arg view : Cost.PolyTimeFun Cost.Data Cost.Data) {s r : Cost.Data} {t : ℕ} (h : (gameStage j cond arg view).Runs s r t) :
                                                            cond.toFun (view.toFun s) = false ∧ r = s.cons (Cost.encode true) ∨ cond.toFun (view.toFun s) = true ∧ ∃ (v : Cost.Data) (tv : ℕ), (gameProg j).Runs (arg.toFun (view.toFun s)) v tv ∧ r = s.cons v
                                                            theorem MIPRE.OracleDecider.gameStage_shape (j : ℕ) (cond : Cost.PolyTimeFun Cost.Data Bool) (arg view : Cost.PolyTimeFun Cost.Data Cost.Data) {s r : Cost.Data} {t : ℕ} (h : (gameStage j cond arg view).Runs s r t) :
                                                            ∃ (v : Cost.Data), r = s.cons v
                                                            theorem MIPRE.OracleDecider.gameStage_runs_false (j : ℕ) (cond : Cost.PolyTimeFun Cost.Data Bool) (arg view : Cost.PolyTimeFun Cost.Data Cost.Data) (s : Cost.Data) (hc : cond.toFun (view.toFun s) = false) :
                                                            ∃ (t : ℕ), (gameStage j cond arg view).Runs s (s.cons (Cost.encode true)) t
                                                            theorem MIPRE.OracleDecider.gameStage_runs_true (j : ℕ) (cond : Cost.PolyTimeFun Cost.Data Bool) (arg view : Cost.PolyTimeFun Cost.Data Cost.Data) (s : Cost.Data) (hc : cond.toFun (view.toFun s) = true) {v : Cost.Data} {tv : ℕ} (hv : (gameProg j).Runs (arg.toFun (view.toFun s)) v tv) :
                                                            ∃ (t : ℕ), (gameStage j cond arg view).Runs s (s.cons v) t

                                                            The core's acceptance law #

                                                            theorem MIPRE.OracleDecider.gameArg_seed {ℓ : ℕ} (V : Verifier (ℓ + 1)) (n B : ℕ) (z : V.Questions n) (a₁ a₂ : Cost.BitStr) :
                                                            gameArg V.sampler n (ℓ + 1) (CL.toBits z) a₁ a₂ = Cost.encode (n, CL.toBits ((V.seeded n B).LA z), CL.toBits ((V.seeded n B).LB z), a₁, a₂)

                                                            The input decider's input in the game check at a seed is the query of 𝒱_n's predicate.

                                                            theorem MIPRE.OracleDecider.gameProg_accepts_iff_gameCheck {ℓ : ℕ} (V : Verifier (ℓ + 1)) (n B : ℕ) (z : V.Questions n) (a₁ a₂ : Verifier.Answers B) :
                                                            (∃ (t : ℕ), (gameProg (ℓ + 1)).Runs (gInput V.sampler.prog V.decider.prog n (CL.toBits z) ↑a₁ ↑a₂) (Cost.encode true) t) ↔ (V.seeded n B).gameCheck (Role.oracle, z) (OAns.pair a₁ a₂) = true

                                                            One game check is the game check of fig:oracle-decider.

                                                            theorem MIPRE.OracleDecider.gameStage_sound {ℓ : ℕ} (V : Verifier (ℓ + 1)) (n B : ℕ) (cond : Cost.PolyTimeFun Cost.Data Bool) (arg view : Cost.PolyTimeFun Cost.Data Cost.Data) (s : Cost.Data) (role : Role) (z : V.Questions n) (U : OAns (Verifier.Answers B)) (hU : SeededGame.shapeOk role U = true) (hcond : cond.toFun (view.toFun s) = decide (role = Role.oracle)) (harg : ∀ (a₁ a₂ : Verifier.Answers B), U = OAns.pair a₁ a₂ → arg.toFun (view.toFun s) = gInput V.sampler.prog V.decider.prog n (CL.toBits z) ↑a₁ ↑a₂) {r : Cost.Data} {t : ℕ} (h : (gameStage (ℓ + 1) cond arg view).Runs s r t) :
                                                            ∃ (v : Cost.Data), r = s.cons v ∧ (v = Cost.encode true → (V.seeded n B).gameCheck (role, z) U = true)

                                                            A game-check stage returns true only if the role's game check holds.

                                                            theorem MIPRE.OracleDecider.gameStage_complete {ℓ : ℕ} (V : Verifier (ℓ + 1)) (n B : ℕ) (cond : Cost.PolyTimeFun Cost.Data Bool) (arg view : Cost.PolyTimeFun Cost.Data Cost.Data) (s : Cost.Data) (role : Role) (z : V.Questions n) (U : OAns (Verifier.Answers B)) (hU : SeededGame.shapeOk role U = true) (hcond : cond.toFun (view.toFun s) = decide (role = Role.oracle)) (harg : ∀ (a₁ a₂ : Verifier.Answers B), U = OAns.pair a₁ a₂ → arg.toFun (view.toFun s) = gInput V.sampler.prog V.decider.prog n (CL.toBits z) ↑a₁ ↑a₂) (hg : (V.seeded n B).gameCheck (role, z) U = true) :
                                                            ∃ (t : ℕ), (gameStage (ℓ + 1) cond arg view).Runs s (s.cons (Cost.encode true)) t

                                                            A game-check stage returns true when the role's game check holds.

                                                            theorem MIPRE.OracleDecider.oraclePred_eq_true_iff {V' : Type u_1} {B : ℕ} (S : SeededGame V' (Verifier.Answers B)) (p q : Role × V') (a b : Cost.BitStr) :
                                                            oraclePred S p q a b = true ↔ ∃ (U : OAns (Verifier.Answers B)) (W : OAns (Verifier.Answers B)), parseAns B p.1 a = some U ∧ parseAns B q.1 b = some W ∧ S.oaccepts p q U W = true

                                                            oraclePred accepts exactly the pairs that parse to answers oaccepts accepts.

                                                            theorem MIPRE.OracleDecider.core_accepts_iff {ℓ : ℕ} (V : Verifier (ℓ + 1)) (B n : ℕ) (t u : Role) (x y : V.Questions n) (a b : Cost.BitStr) :
                                                            (∃ (time : ℕ), (core (ℓ + 1)).Runs (cInput V.sampler.prog V.decider.prog B n t (CL.toBits x) u (CL.toBits y) a b) (Cost.encode true) time) ↔ oraclePred (V.seeded n B) (t, x) (u, y) a b = true

                                                            The core's acceptance law is oraclePred, with no hypothesis on the input verifier: the input decider need not halt on the inputs it rejects.

                                                            The shell: the index routine and the clock #

                                                            The index routine of the oracularized decider: at index n, a simulation budget K n, in unary, and a parse cut B n — the explicit form of the paper's timeout bound B_𝒟(n), which plays both roles there.

                                                            Instances For

                                                              Call the index routine on the index.

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

                                                                Assemble the clocked simulation's input (K, (core, ((S̄, D̄, B), input))) from the index routine's answer (K, B).

                                                                Equations
                                                                • One or more equations did not get rendered due to their size.
                                                                Instances For
                                                                  noncomputable def MIPRE.OracleDecider.shell (j : ℕ) :

                                                                  The shell: the index stage, the clocked simulation of the core, and the check of its result.

                                                                  Equations
                                                                  Instances For

                                                                    The shell's run on every input with the hardcoded programs: the verdict of the core, clocked at the budget, on the input with the parse cut.

                                                                    The typed oracularized decider, at level j, of the input programs S̄, D̄ with the index routine I.

                                                                    Equations
                                                                    Instances For

                                                                      The decider halts on every input, whatever the input programs do.

                                                                      theorem MIPRE.OracleDecider.oracleDecider_accepts_iff (j : ℕ) (sp dp : Cost.Prog) (I : Index) (n : ℕ) (t : Role) (x : Cost.BitStr) (u : Role) (y a b : Cost.BitStr) :
                                                                      (oracleDecider j sp dp I).Accepts n t x u y a b ↔ ∃ time ≤ I.budget n, (core j).Runs (cInput sp dp (I.cut n) n t x u y a b) (Cost.encode true) time

                                                                      The decider accepts exactly when the core accepts within the budget.

                                                                      theorem MIPRE.OracleDecider.accepts_sound {ℓ : ℕ} (V : Verifier (ℓ + 1)) (I : Index) (n : ℕ) (t u : Role) (x y : V.Questions n) (a b : Cost.BitStr) (h : (oracleDecider (ℓ + 1) V.sampler.prog V.decider.prog I).Accepts n t (CL.toBits x) u (CL.toBits y) a b) :
                                                                      oraclePred (V.seeded n (I.cut n)) (t, x) (u, y) a b = true

                                                                      Soundness of the acceptance law: the decider accepts only answers oraclePred accepts, at the index routine's cut, whatever the budget.

                                                                      theorem MIPRE.OracleDecider.accepts_complete {ℓ : ℕ} (V : Verifier (ℓ + 1)) (I : Index) (n : ℕ) (t u : Role) (x y : V.Questions n) (a b : Cost.BitStr) (h : oraclePred (V.seeded n (I.cut n)) (t, x) (u, y) a b = true) (hK : ∀ (time : ℕ), (core (ℓ + 1)).Runs (cInput V.sampler.prog V.decider.prog (I.cut n) n t (CL.toBits x) u (CL.toBits y) a b) (Cost.encode true) time → time ≤ I.budget n) :
                                                                      (oracleDecider (ℓ + 1) V.sampler.prog V.decider.prog I).Accepts n t (CL.toBits x) u (CL.toBits y) a b

                                                                      Completeness of the acceptance law: the decider accepts the answers oraclePred accepts once the core's accepting run fits in the budget.

                                                                      The decider's program as a polynomial-time function of the three programs: the s-m-n map.

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

                                                                        The typed predicate of the detyping compiler #

                                                                        The detyping compiler reads a typed decider through typedPredicate, whose typed game over the complete graph on the roles is O2's (oracleSampler_cl). Its acceptance factors through the bounded parse, and it accepts the honest encodings once the core's runs on them fit in the budget: the two forms in which O2's value transfers take a typed predicate.

                                                                        theorem MIPRE.OracleDecider.typedPredicate_sound {ℓ : ℕ} (V : Verifier (ℓ + 1)) (I : Index) (C : CL.Detyping.CutoffProgram) (n : ℕ) (p q : CL.Detyping.Question Role (Fin (V.sampler.dim n))) (a b : Verifier.Answers (C.outer n)) (h : CL.Detyping.DeciderProgram.typedPredicate (oracleSampler V.sampler) (oracleDecider (ℓ + 1) V.sampler.prog V.decider.prog I) C n p q a b = true) :
                                                                        (V.seeded n (I.cut n)).oaccepts p q ((parseAns (I.cut n) p.1 ↑a).getD default) ((parseAns (I.cut n) q.1 ↑b).getD default) = true

                                                                        The compiler's typed predicate of the oracularized decider accepts only what oaccepts accepts after the bounded parse.

                                                                        theorem MIPRE.OracleDecider.typedPredicate_complete {ℓ : ℕ} (V : Verifier (ℓ + 1)) (I : Index) (C : CL.Detyping.CutoffProgram) (n : ℕ) (hin : 8 * I.cut n + 3 ≤ C.inner n) (hout : C.inner n ≤ C.outer n) (hK : ∀ (t u : Role) (x y : V.Questions n) (a b : Cost.BitStr), List.length a ≤ C.inner n → List.length b ≤ C.inner n → ∀ (time : ℕ), (core (ℓ + 1)).Runs (cInput V.sampler.prog V.decider.prog (I.cut n) n t (CL.toBits x) u (CL.toBits y) a b) (Cost.encode true) time → time ≤ I.budget n) (p q : CL.Detyping.Question Role (Fin (V.sampler.dim n))) (U W : OAns (Verifier.Answers (I.cut n))) (h : (V.seeded n (I.cut n)).oaccepts p q U W = true) :

                                                                        The compiler's typed predicate of the oracularized decider accepts the honest encodings of every answer pair oaccepts accepts, when the inner cut holds them and the core's accepting runs fit in the budget.

                                                                        Soundness of the compiled typed game: its quantum value above 1 - ε puts val*(𝒱_n) at the parse cut at least 1 - 24√ε, whatever the budget.

                                                                        theorem MIPRE.OracleDecider.exists_typedPredicate_perfectPCC {ℓ : ℕ} (V : Verifier (ℓ + 1)) (I : Index) (C : CL.Detyping.CutoffProgram) (n : ℕ) (hin : 8 * I.cut n + 3 ≤ C.inner n) (hout : C.inner n ≤ C.outer n) (hK : ∀ (t u : Role) (x y : V.Questions n) (a b : Cost.BitStr), List.length a ≤ C.inner n → List.length b ≤ C.inner n → ∀ (time : ℕ), (core (ℓ + 1)).Runs (cInput V.sampler.prog V.decider.prog (I.cut n) n t (CL.toBits x) u (CL.toBits y) a b) (Cost.encode true) time → time ≤ I.budget n) (hV : V.HasPerfectPCC n (I.cut n)) :

                                                                        Completeness of the compiled typed game: a value-1 PCC strategy of 𝒱_n at the parse cut gives one of the doubled typed game, when the inner cut holds every honest encoding and the core's accepting runs fit in the budget.