Documentation

Complexitylib.Classes.Containments.Internal.IPStep

One step of the walk, inside the polynomial-time algebra #

⚠️ Unreviewed by Bolton

Complexity.IPM.step walks the game tree on an inductive state; Complexity.IPM.encSst writes that state on a tape. This file writes the step on the tape, out of the algebra's operations only, and proves the square commutes.

Everything the step needs from the protocol enters through three arguments: a ruler mr whose length is the message bound, a ruler cr whose length is the coin width, and the leaf test okf, which reads the encoded stack below a leaf and a coin string.

Main definitions #

Main results #

Reading and writing the encoded state #

def Complexity.IPM.mkS (d ab r stk : List Bool) :

The state's four fields, written.

Equations
Instances For
    def Complexity.IPM.mkF (lvl v a sum best body : List Bool) :

    A frame's six fields, written.

    Equations
    Instances For
      @[simp]
      theorem Complexity.IPM.mkF_eq (f : Frm) :
      mkF f.lvl f.v f.a f.sum f.best f.body = encFrm f

      The done flag.

      Equations
      Instances For

        A frame's level.

        Equations
        Instances For

          A frame's verifier counter.

          Equations
          Instances For

            A frame's prover counter, or its coin counter.

            Equations
            Instances For

              The body of the encoding of the rounds below a frame.

              Equations
              Instances For

                The frame on top of the stack.

                Equations
                Instances For

                  The stack below the top frame.

                  Equations
                  Instances For
                    @[simp]
                    @[simp]
                    @[simp]
                    @[simp]
                    @[simp]
                    @[simp]
                    theorem Complexity.IPM.fV_enc (f : Frm) :
                    fV (encFrm f) = f.v
                    @[simp]
                    theorem Complexity.IPM.fA_enc (f : Frm) :
                    fA (encFrm f) = f.a
                    @[simp]
                    @[simp]
                    @[simp]
                    @[simp]
                    theorem Complexity.IPM.sTop_pair (y S : List Bool) :
                    sTop (pair y S) = y
                    @[simp]
                    theorem Complexity.IPM.sRest_pair (y S : List Bool) :
                    sRest (pair y S) = S
                    theorem Complexity.IPM.sTop_cons (f : Frm) (fs : List Frm) :
                    sTop (encStk (f :: fs)) = encFrm f
                    theorem Complexity.IPM.sRest_cons (f : Frm) (fs : List Frm) :
                    sRest (encStk (f :: fs)) = encStk fs

                    The encoded step #

                    The zero of a count's width, from the coin ruler.

                    Equations
                    Instances For

                      The first coin string, from the coin ruler.

                      Equations
                      Instances For

                        The bitstring of 2 ^ t, from the coin ruler.

                        Equations
                        Instances For
                          theorem Complexity.IPM.zcOf_eq (cr : List Bool) (P : Params) (h : cr.length = P.t) :
                          theorem Complexity.IPM.zkOf_eq (cr : List Bool) (P : Params) (h : cr.length = P.t) :
                          theorem Complexity.IPM.tpOf_eq (cr : List Bool) (P : Params) (h : cr.length = P.t) :

                          The frame a node starts from, written on the tape.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            theorem Complexity.IPM.freshEnc_eq (cr : List Bool) (P : Params) (h : cr.length = P.t) (body lvl : List Bool) :
                            freshEnc cr body lvl = encFrm (freshFrm P body lvl)

                            The descending half of the step: a leaf tallies one coin string, a branch pushes a subtree.

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

                              The returning half of the step: advance a counter, or pop with the sum.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                def Complexity.IPM.ipStep (mr cr : List Bool) (okf : List BoolList BoolList Bool) (z : List Bool) :

                                One step of the walk, on the tape.

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

                                  The state the walk starts from, on the tape.

                                  Equations
                                  Instances For
                                    theorem Complexity.IPM.ipInit_eq (cr : List Bool) (P : Params) (h : cr.length = P.t) (rr : List Bool) :
                                    ipInit cr rr = encSst { done := false, ansBit := false, ret := none, stk := [freshFrm P [] rr] }
                                    theorem Complexity.IPM.ipInitFn_mem_FP {CR RR : List BoolList Bool} (hcr : CR FP) (hrr : RR FP) :
                                    (fun (z : List Bool) => ipInit (CR z) (RR z)) FP

                                    The square commutes #

                                    theorem Complexity.IPM.ipStep_encSst (P : Params) (mr cr : List Bool) (hm : mr.length = P.m) (hc : cr.length = P.t) (okf : List BoolList BoolList Bool) (D : ) (hokf : ∀ (f : Frm) (fs : List Frm), BodyOk (f :: fs)(f :: fs).length D∀ (u : List Bool), okf (encStk (f :: fs)) u = [P.ok (roundsOf fs) u]) (s : Sst) (h : EncOk P D s) :
                                    ipStep mr cr okf (encSst s) = encSst (step P s)

                                    One encoded step is one abstract step.

                                    theorem Complexity.IPM.ipStep_iterate (P : Params) (mr cr : List Bool) (hm : mr.length = P.m) (hc : cr.length = P.t) (okf : List BoolList BoolList Bool) (D : ) (hokf : ∀ (f : Frm) (fs : List Frm), BodyOk (f :: fs)(f :: fs).length D∀ (u : List Bool), okf (encStk (f :: fs)) u = [P.ok (roundsOf fs) u]) (j : ) (s : Sst) :
                                    EncOk P D s(ipStep mr cr okf)^[j] (encSst s) = encSst ((step P)^[j] s)

                                    And so is any number of steps.

                                    The encoded step is polynomial-time #

                                    theorem Complexity.IPM.ipStepFn_mem_FP {A B C : List BoolList Bool} (hA : A FP) (hB : B FP) (hC : C FP) {OK : List BoolList BoolList BoolList Bool} (hok : ∀ {u v : List BoolList Bool}, u FPv FP(fun (z : List Bool) => OK z (u z) (v z)) FP) :
                                    (fun (z : List Bool) => ipStep (A z) (B z) (OK z) (C z)) FP