Documentation

MIPRE.Foundations.OracularTyped

The typed oracularized game #

Piece O2 of planning/oracularization.md (issue #189): the game of the paper's typed oracularized verifier (sec:orac-def) at one index, in the vocabulary the detyping compiler consumes (MIPRE.CL.Detyping.typedGame), and its two value transfers to the input verifier.

The identity as a CL function #

def MIPRE.CL.CLFun.trivialOn {F : Type u_1} [Semiring F] {ฮน : Type u_2} [DecidableEq ฮน] (โ„“ : โ„•) :
CLFun F ฮน โ„“

The zero function with โ„“ levels, every level on the empty register.

Equations
Instances For
    @[simp]
    theorem MIPRE.CL.CLFun.eval_trivialOn {F : Type u_1} [Semiring F] {ฮน : Type u_2} [DecidableEq ฮน] [Fintype ฮน] (โ„“ : โ„•) (x : ฮน โ†’ F) :
    (trivialOn โ„“).eval x = 0
    theorem MIPRE.CL.CLFun.exactlyOn_trivialOn {F : Type u_1} [Semiring F] {ฮน : Type u_2} [DecidableEq ฮน] [Fintype ฮน] (โ„“ : โ„•) :
    def MIPRE.CL.CLFun.ident {F : Type u_1} [Semiring F] {ฮน : Type u_2} [DecidableEq ฮน] [Fintype ฮน] (โ„“ : โ„•) :
    CLFun F ฮน (โ„“ + 1)

    The identity, as an (โ„“ + 1)-level CL function: the whole space at the first level, trivial levels after it. The oracularized sampler gives it to the oracle, who receives the seed itself.

    Equations
    Instances For
      @[simp]
      theorem MIPRE.CL.CLFun.eval_ident {F : Type u_1} [Semiring F] {ฮน : Type u_2} [DecidableEq ฮน] [Fintype ฮน] (โ„“ : โ„•) (x : ฮน โ†’ F) :
      (ident โ„“).eval x = x
      theorem MIPRE.CL.CLFun.exactlyOn_ident {F : Type u_1} [Semiring F] {ฮน : Type u_2} [DecidableEq ฮน] [Fintype ฮน] (โ„“ : โ„•) :

      The typed sampler's CL functions and type graph #

      def MIPRE.roleFamily {ฮน : Type u_1} [Fintype ฮน] [DecidableEq ฮน] {โ„“ : โ„•} (L : Player โ†’ CL.CLFun CL.๐”ฝโ‚‚ ฮน (โ„“ + 1)) :
      Role โ†’ CL.CLFun CL.๐”ฝโ‚‚ ฮน (โ„“ + 1)

      The oracularized sampler's CL functions, one per role and the same for both players: the identity for the oracle, and the input sampler's function of the corresponding original player for an isolated player.

      Equations
      Instances For
        theorem MIPRE.exactlyOn_roleFamily {ฮน : Type u_1} [Fintype ฮน] [DecidableEq ฮน] {โ„“ : โ„•} {L : Player โ†’ CL.CLFun CL.๐”ฝโ‚‚ ฮน (โ„“ + 1)} (hL : โˆ€ (w : Player), (L w).ExactlyOn Finset.univ) (r : Role) :
        def MIPRE.roleGraph :
        Role โ†’ Role โ†’ Prop

        The complete type graph on the three roles, loops included: every ordered pair of roles is sampled.

        Equations
        Instances For
          theorem MIPRE.roleGraph_symm (u v : Role) :
          roleGraph u v โ†’ roleGraph v u

          The seeded game of a CL pair, and the typed game #

          def MIPRE.SeededGame.ofCL {ฮน : Type u_1} [Fintype ฮน] [DecidableEq ฮน] {โ„“ : โ„•} {A : Type u_2} (L : Player โ†’ CL.CLFun CL.๐”ฝโ‚‚ ฮน (โ„“ + 1)) (D : (ฮน โ†’ CL.๐”ฝโ‚‚) โ†’ (ฮน โ†’ CL.๐”ฝโ‚‚) โ†’ A โ†’ A โ†’ Bool) :
          SeededGame (ฮน โ†’ CL.๐”ฝโ‚‚) A

          The seeded game presented by a pair of CL functions and a decision predicate: the game of a normal form verifier at one index, with the seed space its question space.

          Equations
          Instances For
            theorem MIPRE.SeededGame.roleFamily_question {ฮน : Type u_1} [Fintype ฮน] [DecidableEq ฮน] {โ„“ : โ„•} {A : Type u_2} (L : Player โ†’ CL.CLFun CL.๐”ฝโ‚‚ ฮน (โ„“ + 1)) (D : (ฮน โ†’ CL.๐”ฝโ‚‚) โ†’ (ฮน โ†’ CL.๐”ฝโ‚‚) โ†’ A โ†’ A โ†’ Bool) (r : Role) (z : ฮน โ†’ CL.๐”ฝโ‚‚) :
            (r, (roleFamily L r).eval z) = (ofCL L D).oquestion r z

            The role family's question is the oracularized game's.

            The typed seeds of the complete graph are the ordered pairs of roles with a seed.

            Equations
            Instances For
              @[simp]
              theorem MIPRE.SeededGame.typedSeedEquiv_apply {ฮน : Type u_1} (s : CL.Detyping.TypedSeed roleGraph ฮน) :
              typedSeedEquiv s = ((โ†‘s.1).1, (โ†‘s.1).2, s.2)
              theorem MIPRE.SeededGame.typedGame_mu {ฮน : Type u_1} [Fintype ฮน] [DecidableEq ฮน] {โ„“ : โ„•} {A : Type u_2} (L : Player โ†’ CL.CLFun CL.๐”ฝโ‚‚ ฮน (โ„“ + 1)) (D : (ฮน โ†’ CL.๐”ฝโ‚‚) โ†’ (ฮน โ†’ CL.๐”ฝโ‚‚) โ†’ A โ†’ A โ†’ Bool) {A' : Type u_3} [Fintype A'] (D' : CL.Detyping.Question Role ฮน โ†’ CL.Detyping.Question Role ฮน โ†’ A' โ†’ A' โ†’ Bool) (p q : Role ร— (ฮน โ†’ CL.๐”ฝโ‚‚)) :

              The typed game has the oracularization's distribution: a uniform ordered pair of roles and one common uniform seed, the oracle receiving the seed and an isolated player its original question.

              theorem MIPRE.SeededGame.quantumValue_typedGame_le {ฮน : Type u_1} [Fintype ฮน] [DecidableEq ฮน] {โ„“ : โ„•} {A : Type u_2} [Fintype A] [DecidableEq A] (L : Player โ†’ CL.CLFun CL.๐”ฝโ‚‚ ฮน (โ„“ + 1)) (D : (ฮน โ†’ CL.๐”ฝโ‚‚) โ†’ (ฮน โ†’ CL.๐”ฝโ‚‚) โ†’ A โ†’ A โ†’ Bool) {A' : Type u_3} [Fintype A'] (D' : CL.Detyping.Question Role ฮน โ†’ CL.Detyping.Question Role ฮน โ†’ A' โ†’ A' โ†’ Bool) (rA : CL.Detyping.Question Role ฮน โ†’ A' โ†’ OAns A) (hD : โˆ€ (p q : CL.Detyping.Question Role ฮน) (a b : A'), D' p q a b = true โ†’ (ofCL L D).oaccepts p q (rA p a) (rA q b) = true) :

              Soundness through a reading of the answers. A typed predicate whose acceptance implies the oracularized predicate, after the answers are read by a map that may depend on the question, has no larger quantum value than the oracularization: a strategy is played through the reading, on the same state, and the two games have the same distribution.

              Pushing a synchronous strategy into another game #

              noncomputable def MIPRE.SyncStrategy.pushTo {X : Type u_1} {A : Type u_2} [Fintype X] [Fintype A] [DecidableEq A] {G : SynchronousGame X A} (S : SyncStrategy G) {A' : Type u_3} [Fintype A'] [DecidableEq A'] (G' : SynchronousGame X A') (f : A โ†’ A') :

              Play a synchronous strategy on another game with the same questions, its outcomes pushed forward along f: the operator for a' is the sum over the fibre above it.

              Equations
              Instances For
                theorem MIPRE.SyncStrategy.value_le_pushTo {X : Type u_1} {A : Type u_2} [Fintype X] [Fintype A] [DecidableEq A] {G : SynchronousGame X A} (S : SyncStrategy G) {A' : Type u_3} [Fintype A'] [DecidableEq A'] (G' : SynchronousGame X A') (f : A โ†’ A') (hฮผ : โˆ€ (x y : X), G'.ฮผ x y = G.ฮผ x y) (hD : โˆ€ (x y : X) (a b : A), G.D x y a b = true โ†’ G'.D x y (f a) (f b) = true) :

                Pushing forward loses no value when every accepted tuple stays accepted and the distribution is the same.

                theorem MIPRE.SyncStrategy.isPCC_pushTo {X : Type u_1} {A : Type u_2} [Fintype X] [Fintype A] [DecidableEq A] {G : SynchronousGame X A} {S : SyncStrategy G} (hS : S.IsPCC) {A' : Type u_3} [Fintype A'] [DecidableEq A'] (G' : SynchronousGame X A') (f : A โ†’ A') (hฮผ : โˆ€ (x y : X), G'.ฮผ x y = G.ฮผ x y) :
                (S.pushTo G' f).IsPCC

                Pushing forward keeps the PCC property: sums over fibres of pairwise commuting operators commute.

                The two transfers, at a normal form verifier #

                @[instance_reducible]
                Equations
                @[reducible, inline]
                noncomputable abbrev MIPRE.Verifier.seeded {โ„“ : โ„•} (V : Verifier (โ„“ + 1)) (n B : โ„•) :

                ๐’ฑ_n with answers of length at most B, as a seeded game: the seed space is the question space, and the seed's two images are the questions.

                Equations
                Instances For
                  theorem MIPRE.Verifier.seeded_toGame {โ„“ : โ„•} (V : Verifier (โ„“ + 1)) (n B : โ„•) :
                  (V.seeded n B).toGame = V.game n B
                  theorem MIPRE.Verifier.valStar_ge_of_typed {โ„“ : โ„•} (V : Verifier (โ„“ + 1)) (n B : โ„•) {A' : Type u_1} [Fintype A'] (D' : CL.Detyping.Question Role (Fin (V.sampler.dim n)) โ†’ CL.Detyping.Question Role (Fin (V.sampler.dim n)) โ†’ A' โ†’ A' โ†’ Bool) (rA : CL.Detyping.Question Role (Fin (V.sampler.dim n)) โ†’ A' โ†’ OAns (Answers B)) (hD : โˆ€ (p q : CL.Detyping.Question Role (Fin (V.sampler.dim n))) (a b : A'), D' p q a b = true โ†’ (V.seeded n B).oaccepts p q (rA p a) (rA q b) = true) {ฮต : โ„} (hฮต : 0 < ฮต) (h : 1 - ฮต < quantumValue (CL.Detyping.typedGame roleGraph roleGraph_nonempty (fun (x : Bool) => roleFamily (V.sampler.cl n)) D')) :
                  1 - 24 * โˆšฮต โ‰ค V.valStar n B

                  Soundness of the typed oracularized game. For a typed predicate whose acceptance implies the oracularized predicate after a reading of the answers, val* of the typed game above 1 - ฮต puts val* (๐’ฑ_n) at least 1 - 24โˆšฮต.

                  theorem MIPRE.Verifier.exists_typed_perfectPCC {โ„“ : โ„•} (V : Verifier (โ„“ + 1)) (n B : โ„•) (hV : V.HasPerfectPCC n B) {A' : Type u_1} [Fintype A'] [DecidableEq A'] (D' : CL.Detyping.Question Role (Fin (V.sampler.dim n)) โ†’ CL.Detyping.Question Role (Fin (V.sampler.dim n)) โ†’ A' โ†’ A' โ†’ Bool) (f : OAns (Answers B) โ†’ A') (hf : โˆ€ (p q : Role ร— V.Questions n) (u v : OAns (Answers B)), (V.seeded n B).oaccepts p q u v = true โ†’ D' p q (f u) (f v) = true) :

                  Completeness of the typed oracularized game. For a typed predicate that accepts the encodings of every answer pair the oracularized predicate accepts, a value-1 PCC strategy of ๐’ฑ_n gives one of the doubled typed game: oracleStrategy, with identical measurement operators for the two players, doubled and pushed forward along the encoding.

                  The bit-string predicate #

                  The serialization of an oracle's pair of answers: the postorder bits of the encoded pair (Cost.Data.toBitsPost), the format the repeated decider already parses.

                  Equations
                  Instances For

                    Reading a pair back from its serialization.

                    Equations
                    Instances For
                      @[simp]

                      The bounded parse, by the role of the player who answered: an oracle's answer must be the serialization of a pair of answers of length at most B, an isolated player's a single answer of length at most B. Anything else fails to parse, and the predicate rejects it: the paper's grouping of failed parses into one rejected outcome (repair 3), and its truncation to the cut (repair 4) made explicit.

                      Equations
                      Instances For
                        def MIPRE.oraclePred {V : Type u_1} {B : โ„•} (S : SeededGame V (Verifier.Answers B)) (p q : Role ร— V) (a b : Cost.BitStr) :

                        The typed oracularized predicate on bit-string answers (fig:oracle-decider): both answers are parsed by role, a failed parse is rejected, and otherwise the decision is the oracularized game's.

                        Equations
                        Instances For

                          The honest encoding of an oracularized answer: an oracle's pair serialized, an isolated player's answer as it is.

                          Equations
                          Instances For

                            An answer of the right shape parses back from its honest encoding.

                            theorem MIPRE.oaccepts_of_oraclePred {V : Type u_1} {B : โ„•} {S : SeededGame V (Verifier.Answers B)} {p q : Role ร— V} {a b : Cost.BitStr} (h : oraclePred S p q a b = true) :
                            S.oaccepts p q ((parseAns B p.1 a).getD default) ((parseAns B q.1 b).getD default) = true

                            Acceptance of the bit-string predicate is acceptance of the oracularized one, after the answers are read by the bounded parse.

                            theorem MIPRE.oraclePred_encAns {V : Type u_1} {B : โ„•} {S : SeededGame V (Verifier.Answers B)} {p q : Role ร— V} {u v : OAns (Verifier.Answers B)} (h : S.oaccepts p q u v = true) :
                            oraclePred S p q (encAns u) (encAns v) = true

                            The bit-string predicate accepts the honest encodings of every answer pair the oracularized predicate accepts.

                            @[reducible, inline]
                            noncomputable abbrev MIPRE.Verifier.oracleTypedPred {โ„“ : โ„•} (V : Verifier (โ„“ + 1)) (n B T : โ„•) :
                            CL.Detyping.Question Role (Fin (V.sampler.dim n)) โ†’ CL.Detyping.Question Role (Fin (V.sampler.dim n)) โ†’ Answers T โ†’ Answers T โ†’ Bool

                            The typed oracularized predicate of ๐’ฑ_n, with parse cut B, on answers of length at most T.

                            Equations
                            Instances For
                              theorem MIPRE.Verifier.valStar_ge_of_oraclePred {โ„“ : โ„•} (V : Verifier (โ„“ + 1)) (n B T : โ„•) {ฮต : โ„} (hฮต : 0 < ฮต) (h : 1 - ฮต < quantumValue (CL.Detyping.typedGame roleGraph roleGraph_nonempty (fun (x : Bool) => roleFamily (V.sampler.cl n)) (V.oracleTypedPred n B T))) :
                              1 - 24 * โˆšฮต โ‰ค V.valStar n B

                              Soundness of the typed oracularized game of ๐’ฑ_n: its quantum value above 1 - ฮต, at any output cut, puts val* (๐’ฑ_n) at the parse cut B at least 1 - 24โˆšฮต.

                              theorem MIPRE.Verifier.exists_oraclePred_perfectPCC {โ„“ : โ„•} (V : Verifier (โ„“ + 1)) (n B T : โ„•) (hT : 8 * B + 3 โ‰ค T) (hV : V.HasPerfectPCC n B) :

                              Completeness of the typed oracularized game of ๐’ฑ_n: a value-1 PCC strategy of ๐’ฑ_n at the parse cut B gives one of the doubled typed game, at any output cut T โ‰ฅ 8B + 3, which holds every honest encoding.