Documentation

MIPRE.Tailored.Intro.Layout

The padded answer layout of the tailored introspection verifier #

The introspection verifier's answers are byte strings of variable length: an auxiliary answer is a tuple of self-delimiting fields (AnswerParser.pairBits, tripleBits), the last of which may be the input's answer, of any length up to the original cutoff R. A tailored game has, at each question, a fixed number of readable and of linear answer bits. This file fixes the re-encoding, by the question's label (QuestionType P ℓ):

The input's answer at the question read off y has splitR t y readable and splitL t y linear bits, the two functions being parameters here; the instance runs the input's answer-length calculator. enc re-encodes, dec decodes, and dec_enc is the round trip on well-formed answers whose input answer has the input's lengths; length_enc says that enc has the label's lengths.

Pad with zeros to length R.

Equations
Instances For
    @[simp]
    def MIPRE.Tailored.Intro.lenR {P : Type u_1} {ℓ : ℕ} (Q R : ℕ) (plen : P → ℕ) (pread : P → Bool) :

    The number of readable answer bits of a label.

    Equations
    Instances For
      def MIPRE.Tailored.Intro.lenL {P : Type u_1} {ℓ : ℕ} (Q R : ℕ) (plen : P → ℕ) (pread : P → Bool) :

      The number of linear answer bits of a label.

      Equations
      Instances For

        The re-encoding of a byte answer, readable bits first.

        Equations
        Instances For
          def MIPRE.Tailored.Intro.unpad {ℓ : ℕ} (R : ℕ) (splitR splitL : Introspection.AuxType ℓ × Bool → Cost.BitStr → ℕ) (t : Introspection.AuxType ℓ × Bool) (y rb lb : Cost.BitStr) :

          The input's answer, from its two padded blocks.

          Equations
          Instances For
            def MIPRE.Tailored.Intro.dec {P : Type u_1} {ℓ : ℕ} (Q R : ℕ) (splitR splitL : Introspection.AuxType ℓ × Bool → Cost.BitStr → ℕ) :

            The decoding of a re-encoded answer.

            Equations
            Instances For

              The round trip #

              def MIPRE.Tailored.Intro.Fits {ℓ : ℕ} (R : ℕ) (splitR splitL : Introspection.AuxType ℓ × Bool → Cost.BitStr → ℕ) (t : Introspection.AuxType ℓ × Bool) (y α : Cost.BitStr) :

              The input's answer fits its two blocks.

              Equations
              Instances For
                theorem MIPRE.Tailored.Intro.unpad_pad {ℓ R : ℕ} {splitR splitL : Introspection.AuxType ℓ × Bool → Cost.BitStr → ℕ} {t : Introspection.AuxType ℓ × Bool} {y α : Cost.BitStr} (h : Fits R splitR splitL t y α) (rest : Cost.BitStr) :
                unpad R splitR splitL t y (pad R (List.take (splitR t y) α) ++ rest) (pad R (List.drop (splitR t y) α)) = α
                theorem MIPRE.Tailored.Intro.enc_pair {P : Type u_1} {ℓ Q R : ℕ} {splitR : Introspection.AuxType ℓ × Bool → Cost.BitStr → ℕ} {t : Introspection.AuxType ℓ × Bool} (ht : t.1 = Introspection.AuxType.introspect ∨ t.1 = Introspection.AuxType.sample) {y α : Cost.BitStr} (hy : List.length y = Q) :
                enc Q R splitR (Sum.inr t) (Introspection.AnswerParser.pairBits y α) = y ++ pad R (List.take (splitR t y) α) ++ pad R (List.drop (splitR t y) α)
                theorem MIPRE.Tailored.Intro.dec_enc_pair {P : Type u_1} {ℓ Q R : ℕ} {splitR splitL : Introspection.AuxType ℓ × Bool → Cost.BitStr → ℕ} {t : Introspection.AuxType ℓ × Bool} (ht : t.1 = Introspection.AuxType.introspect ∨ t.1 = Introspection.AuxType.sample) {y α : Cost.BitStr} (hy : List.length y = Q) (h : Fits R splitR splitL t y α) :
                theorem MIPRE.Tailored.Intro.dec_enc_read {P : Type u_1} {ℓ Q R : ℕ} {splitR splitL : Introspection.AuxType ℓ × Bool → Cost.BitStr → ℕ} {w : Bool} {y yp α : Cost.BitStr} (hy : List.length y = Q) (hyp : List.length yp = Q) (h : Fits R splitR splitL (Introspection.AuxType.read, w) y α) :
                theorem MIPRE.Tailored.Intro.dec_enc_hide {P : Type u_1} {ℓ Q R : ℕ} {splitR splitL : Introspection.AuxType ℓ × Bool → Cost.BitStr → ℕ} {k : Fin ℓ} {w : Bool} {y yp x : Cost.BitStr} (hy : List.length y = Q) (hyp : List.length yp = Q) (hx : List.length x = Q) :

                The lengths #

                theorem MIPRE.Tailored.Intro.length_enc_pair {P : Type u_1} {ℓ Q R : ℕ} (plen : P → ℕ) (pread : P → Bool) {splitR splitL : Introspection.AuxType ℓ × Bool → Cost.BitStr → ℕ} {t : Introspection.AuxType ℓ × Bool} (ht : t.1 = Introspection.AuxType.introspect ∨ t.1 = Introspection.AuxType.sample) {y α : Cost.BitStr} (hy : List.length y = Q) (h : Fits R splitR splitL t y α) :
                List.length (enc Q R splitR (Sum.inr t) (Introspection.AnswerParser.pairBits y α)) = lenR Q R plen pread (Sum.inr t) + lenL Q R plen pread (Sum.inr t)
                theorem MIPRE.Tailored.Intro.length_enc_read {P : Type u_1} {ℓ Q R : ℕ} (plen : P → ℕ) (pread : P → Bool) {splitR splitL : Introspection.AuxType ℓ × Bool → Cost.BitStr → ℕ} {w : Bool} {y yp α : Cost.BitStr} (hy : List.length y = Q) (hyp : List.length yp = Q) (h : Fits R splitR splitL (Introspection.AuxType.read, w) y α) :
                theorem MIPRE.Tailored.Intro.length_enc_hide {P : Type u_1} {ℓ Q R : ℕ} (plen : P → ℕ) (pread : P → Bool) {splitR : Introspection.AuxType ℓ × Bool → Cost.BitStr → ℕ} {k : Fin ℓ} {w : Bool} {y yp x : Cost.BitStr} (hy : List.length y = Q) (hyp : List.length yp = Q) (hx : List.length x = Q) :
                theorem MIPRE.Tailored.Intro.length_enc_pauli {P : Type u_1} {ℓ : ℕ} (Q R : ℕ) (plen : P → ℕ) (pread : P → Bool) (splitR : Introspection.AuxType ℓ × Bool → Cost.BitStr → ℕ) (p : P) (bs : Cost.BitStr) (h : List.length bs = plen p) :
                List.length (enc Q R splitR (Sum.inl p) bs) = lenR Q R plen pread (Sum.inl p) + lenL Q R plen pread (Sum.inl p)
                theorem MIPRE.Tailored.Intro.dec_enc_pauli {P : Type u_1} {ℓ : ℕ} (Q R : ℕ) (splitR splitL : Introspection.AuxType ℓ × Bool → Cost.BitStr → ℕ) (p : P) (bs : Cost.BitStr) :
                dec Q R splitR splitL (Sum.inl p) (enc Q R splitR (Sum.inl p) bs) = bs

                Well-formed answers, uniformly #

                def MIPRE.Tailored.Intro.OkLayout {P : Type u_1} {ℓ : ℕ} (Q R : ℕ) (plen : P → ℕ) (splitR splitL : Introspection.AuxType ℓ × Bool → Cost.BitStr → ℕ) :

                A byte answer is well formed for the layout at a label: a Pauli answer of the label's length, or a tuple whose registers have length Q and whose input answer fits its two blocks.

                Equations
                Instances For
                  theorem MIPRE.Tailored.Intro.dec_enc_of_ok {P : Type u_1} {ℓ Q R : ℕ} {plen : P → ℕ} {splitR splitL : Introspection.AuxType ℓ × Bool → Cost.BitStr → ℕ} {u : Introspection.QuestionType P ℓ} {bs : Cost.BitStr} (h : OkLayout Q R plen splitR splitL u bs) :
                  dec Q R splitR splitL u (enc Q R splitR u bs) = bs

                  The round trip on well-formed answers.

                  theorem MIPRE.Tailored.Intro.length_enc_of_ok {P : Type u_1} {ℓ Q R : ℕ} {plen : P → ℕ} (pread : P → Bool) {splitR splitL : Introspection.AuxType ℓ × Bool → Cost.BitStr → ℕ} {u : Introspection.QuestionType P ℓ} {bs : Cost.BitStr} (h : OkLayout Q R plen splitR splitL u bs) :
                  List.length (enc Q R splitR u bs) = lenR Q R plen pread u + lenL Q R plen pread u

                  Well-formed answers re-encode to the label's lengths.

                  On bounded answers #

                  def MIPRE.Tailored.Intro.decB {P : Type u_1} {ℓ : ℕ} (Q R : ℕ) (splitR splitL : Introspection.AuxType ℓ × Bool → Cost.BitStr → ℕ) (B : ℕ) (u : Introspection.QuestionType P ℓ) (tb : Cost.BitStr) :

                  Decoding into the answers of length at most B, [] when the decoding is longer.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    theorem MIPRE.Tailored.Intro.decB_enc_of_ok {P : Type u_1} {ℓ Q R : ℕ} {plen : P → ℕ} {splitR splitL : Introspection.AuxType ℓ × Bool → Cost.BitStr → ℕ} {B : ℕ} {u : Introspection.QuestionType P ℓ} (a : Verifier.Answers B) (h : OkLayout Q R plen splitR splitL u ↑a) :
                    decB Q R splitR splitL B u (enc Q R splitR u ↑a) = a