Documentation

Complexitylib.Classes.PCP.Internal.AlgKeyFn

Reading an edge's data off the input #

The constants of a round — the expander's degree, the walk's length, the killing rate, how many constraints the alphabet has, how many random strings the tester uses — are fixed. Given them, an edge number of the composed graph splits by division into a test, a random string and a read; the test splits into a vertex and a killed dart; and the killed dart drives the walk, whose parities, codes and return darts are what the edge's data is made of.

This module writes that out as FP functions.

Main definitions #

Main results #

The constants of one round of amplification, as an algorithm sees them.

  • deg :

    The expander's degree.

  • P :

    The preprocessed system's degree.

  • T :

    The walk's length.

  • q :

    The killing rate.

  • C :

    How many constraints there are on the alphabet.

  • cZ :

    How many random strings the tester has.

Instances For

    How many darts the powered graph has at a vertex.

    Equations
    Instances For

      How many coin tuples there are.

      Equations
      Instances For

        Splitting an edge number #

        noncomputable def Complexity.testFn (r : Round) (w : List Bool) :

        The test an edge belongs to.

        Equations
        Instances For
          noncomputable def Complexity.randFn (r : Round) (w : List Bool) :

          The random string it runs on.

          Equations
          Instances For
            noncomputable def Complexity.readFn (w : List Bool) :

            The read it asks for.

            Equations
            Instances For
              noncomputable def Complexity.dartFn (r : Round) (w : List Bool) :

              The killed dart the test is.

              Equations
              Instances For
                noncomputable def Complexity.vertFn (r : Round) (w : List Bool) :

                The vertex it starts at.

                Equations
                Instances For
                  noncomputable def Complexity.stepsFn (r : Round) (w : List Bool) :

                  The walk's steps.

                  Equations
                  Instances For
                    noncomputable def Complexity.coinFn (r : Round) (w : List Bool) :

                    The walk's coins.

                    Equations
                    Instances For
                      noncomputable def Complexity.walkArg (r : Round) (w : List Bool) :

                      The input the walk algorithm reads.

                      Equations
                      Instances For
                        noncomputable def Complexity.killArg (r : Round) (w : List Bool) :

                        The input the killed-walk algorithms read.

                        Equations
                        Instances For

                          The walk's data #

                          noncomputable def Complexity.stopBlk (r : Round) (w : List Bool) :

                          Where the walk stops.

                          Equations
                          Instances For
                            noncomputable def Complexity.parDigit (F : FinBase) (pol : Polynomial ) (r : Round) (i : ) (w : List Bool) :

                            The parity of the vertex the i-th step stands on, and 0 past the end.

                            Equations
                            Instances For
                              theorem Complexity.parDigit_mem_FP (F : FinBase) (pol : Polynomial ) (r : Round) (i : ) :
                              parDigit F pol r i FP
                              noncomputable def Complexity.codeDigit (F : FinBase) (pol : Polynomial ) (r : Round) (i : ) (w : List Bool) :

                              The code of the constraint the i-th step meets, and 0 past the end.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                theorem Complexity.codeDigit_mem_FP (F : FinBase) (pol : Polynomial ) (r : Round) (i : ) :
                                codeDigit F pol r i FP

                                The data as a string #

                                noncomputable def Complexity.keyFn (F : FinBase) (pol : Polynomial ) (r : Round) (w : List Bool) :

                                An edge's data, written out as the seven blocks packKey expects.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  theorem Complexity.keyFn_mem_FP (F : FinBase) (pol : Polynomial ) (r : Round) :
                                  keyFn F pol r FP

                                  What the blocks read #

                                  theorem Complexity.blocks_eq (r : Round) (hD : 0 < r.cD) (hZ : 0 < r.cZ) (g : List Bool) (a b c d : ) (hb : b < r.cD) (hc : c < r.cZ) (hd : d < 22) :
                                  testFn r (pair g (List.replicate (((a * r.cD + b) * r.cZ + c) * 22 + d) true)) = List.replicate (a * r.cD + b) true vertFn r (pair g (List.replicate (((a * r.cD + b) * r.cZ + c) * 22 + d) true)) = List.replicate a true dartFn r (pair g (List.replicate (((a * r.cD + b) * r.cZ + c) * 22 + d) true)) = List.replicate b true randFn r (pair g (List.replicate (((a * r.cD + b) * r.cZ + c) * 22 + d) true)) = List.replicate c true readFn (pair g (List.replicate (((a * r.cD + b) * r.cZ + c) * 22 + d) true)) = List.replicate d true

                                  The blocks split an edge number.

                                  theorem Complexity.steps_coin_eq (r : Round) (hQ : 0 < r.cQ) (w : List Bool) (s t : ) (ht : t < r.cQ) (hdart : dartFn r w = List.replicate (s * r.cQ + t) true) :

                                  The dart block splits into steps and coins.

                                  theorem Complexity.walkArg_eq (r : Round) {w g : List Bool} {a s : } (hg : pairFst w = g) (hv : vertFn r w = List.replicate a true) (hs : stepsFn r w = List.replicate s true) :

                                  The walk's input, once the blocks are known.

                                  theorem Complexity.killArg_eq (r : Round) {w g : List Bool} {a b : } (hg : pairFst w = g) (hv : vertFn r w = List.replicate a true) (hb : dartFn r w = List.replicate b true) :

                                  The killed walk's input, likewise.

                                  The walk, on encoded vertices #

                                  theorem Complexity.walkFn_enc {F : FinBase} {pol : Polynomial } {α : Type} [Fintype α] [DecidableEq α] (hd : 1 < F.deg) (G : ConstraintGraph α) {T q : } (v : (G.preprocess (F.toFamily hd)).graph.V) (x : (Fin T(G.preprocess (F.toFamily hd)).graph.D) × (Fin TFin q)) (hpc : ∀ (u : Fin G.numVerts), F.fitLevel hd (G.cloudList u).length Polynomial.eval (G.cloudList u).length pol) (hpe : F.fitLevel hd (2 * G.numEdges) Polynomial.eval (2 * G.numEdges) pol) (j : ) (hj : j (G.preprocess (F.toFamily hd)).graph.kLen x) :

                                  The walk algorithm, run on a dart's own numbers.

                                  theorem Complexity.stopBlk_eq {F : FinBase} (r : Round) {α : Type} [Fintype α] [DecidableEq α] (hd : 1 < F.deg) (G : ConstraintGraph α) (hq : 0 < r.q) (v : (G.preprocess (F.toFamily hd)).graph.V) (x : (Fin r.T(G.preprocess (F.toFamily hd)).graph.D) × (Fin r.TFin r.q)) {w : List Bool} (hg : pairFst w = encGraph G) (hv : vertFn r w = List.replicate (NumEnc.enc v) true) (hdart : dartFn r w = List.replicate (NumEnc.enc x) true) :

                                  The stopping block is the effective walk's length.

                                  theorem Complexity.parBlk_eq {F : FinBase} {pol : Polynomial } (r : Round) {α : Type} [Fintype α] [DecidableEq α] (hd : 1 < F.deg) (G : ConstraintGraph α) (hq : 0 < r.q) (hdeg : r.deg = (F.toFamily hd).degree) (hP : r.P = G.preDeg (F.toFamily hd)) (v : (G.preprocess (F.toFamily hd)).graph.V) (x : (Fin r.T(G.preprocess (F.toFamily hd)).graph.D) × (Fin r.TFin r.q)) {w : List Bool} (hg : pairFst w = encGraph G) (hv : vertFn r w = List.replicate (NumEnc.enc v) true) (hs : stepsFn r w = List.replicate (NumEnc.enc x.1) true) (hdart : dartFn r w = List.replicate (NumEnc.enc x) true) (hpc : ∀ (u : Fin G.numVerts), F.fitLevel hd (G.cloudList u).length Polynomial.eval (G.cloudList u).length pol) (hpe : F.fitLevel hd (2 * G.numEdges) Polynomial.eval (2 * G.numEdges) pol) (B : ) (z : BooleanAnalysis.Cube (Tester.ROf B)) (i : ReadIdx) :
                                  marks (digitSum 2 (parDigit F pol r) r.T w) = List.replicate (NumEnc.enc (stepKeyOf G (F.toFamily hd) v x B z i).par) true

                                  The parity block is the parity tuple's number.

                                  theorem Complexity.codeBlk_eq {F : FinBase} {pol : Polynomial } (r : Round) {α : Type} [Fintype α] [DecidableEq α] (hd : 1 < F.deg) (G : ConstraintGraph α) (hq : 0 < r.q) (hdeg : r.deg = (F.toFamily hd).degree) (hP : r.P = G.preDeg (F.toFamily hd)) (hC : r.C = Fintype.card (ααBool)) (v : (G.preprocess (F.toFamily hd)).graph.V) (x : (Fin r.T(G.preprocess (F.toFamily hd)).graph.D) × (Fin r.TFin r.q)) {w : List Bool} (hg : pairFst w = encGraph G) (hv : vertFn r w = List.replicate (NumEnc.enc v) true) (hs : stepsFn r w = List.replicate (NumEnc.enc x.1) true) (hdart : dartFn r w = List.replicate (NumEnc.enc x) true) (hpc : ∀ (u : Fin G.numVerts), F.fitLevel hd (G.cloudList u).length Polynomial.eval (G.cloudList u).length pol) (hpe : F.fitLevel hd (2 * G.numEdges) Polynomial.eval (2 * G.numEdges) pol) (B : ) (z : BooleanAnalysis.Cube (Tester.ROf B)) (i : ReadIdx) :
                                  marks (digitSum r.C (codeDigit F pol r) r.T w) = List.replicate (NumEnc.enc (stepKeyOf G (F.toFamily hd) v x B z i).code) true

                                  The code block is the code tuple's number.

                                  theorem Complexity.revBlk_eq {F : FinBase} {pol : Polynomial } (r : Round) {α : Type} [Fintype α] [DecidableEq α] (hd : 1 < F.deg) (G : ConstraintGraph α) (hq : 0 < r.q) (hdeg : r.deg = (F.toFamily hd).degree) (hP : r.P = G.preDeg (F.toFamily hd)) (v : (G.preprocess (F.toFamily hd)).graph.V) (x : (Fin r.T(G.preprocess (F.toFamily hd)).graph.D) × (Fin r.TFin r.q)) {w : List Bool} (hg : pairFst w = encGraph G) (hv : vertFn r w = List.replicate (NumEnc.enc v) true) (hdart : dartFn r w = List.replicate (NumEnc.enc x) true) (hpc : ∀ (u : Fin G.numVerts), F.fitLevel hd (G.cloudList u).length Polynomial.eval (G.cloudList u).length pol) (hpe : F.fitLevel hd (2 * G.numEdges) Polynomial.eval (2 * G.numEdges) pol) (B : ) (z : BooleanAnalysis.Cube (Tester.ROf B)) (i : ReadIdx) :
                                  List.take (r.P ^ r.T) (revNumFn F pol r.deg r.P r.T r.q (killArg r w)) = List.replicate (NumEnc.enc (stepKeyOf G (F.toFamily hd) v x B z i).rev) true

                                  The return-dart block is the return tuple's number.

                                  theorem Complexity.keyFn_eq {F : FinBase} {pol : Polynomial } (r : Round) {α : Type} [Fintype α] [DecidableEq α] (hd : 1 < F.deg) (G : ConstraintGraph α) (hq : 0 < r.q) (hdeg : r.deg = (F.toFamily hd).degree) (hP : r.P = G.preDeg (F.toFamily hd)) (hC : r.C = Fintype.card (ααBool)) (hZ : 0 < r.cZ) (v : (G.preprocess (F.toFamily hd)).graph.V) (x : (Fin r.T(G.preprocess (F.toFamily hd)).graph.D) × (Fin r.TFin r.q)) {B : } (z : BooleanAnalysis.Cube (Tester.ROf B)) (i : ReadIdx) (hcZ : r.cZ = NumEnc.card (BooleanAnalysis.Cube (Tester.ROf B))) (hpc : ∀ (u : Fin G.numVerts), F.fitLevel hd (G.cloudList u).length Polynomial.eval (G.cloudList u).length pol) (hpe : F.fitLevel hd (2 * G.numEdges) Polynomial.eval (2 * G.numEdges) pol) :
                                  keyFn F pol r (pair (encGraph G) (List.replicate (((NumEnc.enc v * r.cD + NumEnc.enc x) * r.cZ + NumEnc.enc z) * 22 + NumEnc.enc i) true)) = packKey (stepKeyOf G (F.toFamily hd) v x B z i)

                                  The algorithm writes out the walk's own data.

                                  A bound on the length of an edge's data.

                                  Equations
                                  Instances For
                                    theorem Complexity.keyFn_length_le (F : FinBase) (pol : Polynomial ) (r : Round) (hQ : 0 < r.cQ) (hD : 0 < r.cD) (hZ : 0 < r.cZ) (hC : 0 < r.C) (w : List Bool) :
                                    (keyFn F pol r w).length keyBound r

                                    The cube and the code, in polynomial time #

                                    noncomputable def Complexity.cubeFn (F : FinBase) (pol : Polynomial ) (r : Round) {α : Type} [Fintype α] [DecidableEq α] {E : ExpanderFamily} {B : } (dflt : StepKey E r.T r.q B (Fintype.card (ααBool))) (encβ : (PreWalk E r.Tα)BooleanAnalysis.Cube B) (w : List Bool) :

                                    The cube a composed edge's second endpoint names.

                                    Equations
                                    Instances For
                                      noncomputable def Complexity.codeFn (F : FinBase) (pol : Polynomial ) (r : Round) {α : Type} [Fintype α] [DecidableEq α] {E : ExpanderFamily} {B : } (dflt : StepKey E r.T r.q B (Fintype.card (ααBool))) (encβ : (PreWalk E r.Tα)BooleanAnalysis.Cube B) (w : List Bool) :

                                      The code of a composed edge's constraint.

                                      Equations
                                      Instances For
                                        theorem Complexity.cubeFn_mem_FP (F : FinBase) (pol : Polynomial ) (r : Round) {α : Type} [Fintype α] [DecidableEq α] {E : ExpanderFamily} {B : } (hQ : 0 < r.cQ) (hD : 0 < r.cD) (hZ : 0 < r.cZ) (hC : 0 < r.C) (dflt : StepKey E r.T r.q B (Fintype.card (ααBool))) (encβ : (PreWalk E r.Tα)BooleanAnalysis.Cube B) :
                                        cubeFn F pol r dflt encβ FP
                                        theorem Complexity.codeFn_mem_FP (F : FinBase) (pol : Polynomial ) (r : Round) {α : Type} [Fintype α] [DecidableEq α] {E : ExpanderFamily} {B : } (hQ : 0 < r.cQ) (hD : 0 < r.cD) (hZ : 0 < r.cZ) (hC : 0 < r.C) (dflt : StepKey E r.T r.q B (Fintype.card (ααBool))) (encβ : (PreWalk E r.Tα)BooleanAnalysis.Cube B) :
                                        codeFn F pol r dflt encβ FP
                                        theorem Complexity.cubeFn_eq {F : FinBase} {pol : Polynomial } (r : Round) {α : Type} [Fintype α] [DecidableEq α] {B : } (hd : 1 < F.deg) (G : ConstraintGraph α) (hq : 0 < r.q) (hdeg : r.deg = (F.toFamily hd).degree) (hP : r.P = G.preDeg (F.toFamily hd)) (hC : r.C = Fintype.card (ααBool)) (hZ : 0 < r.cZ) (v : (G.preprocess (F.toFamily hd)).graph.V) (x : (Fin r.T(G.preprocess (F.toFamily hd)).graph.D) × (Fin r.TFin r.q)) (z : BooleanAnalysis.Cube (Tester.ROf B)) (i : ReadIdx) (hcZ : r.cZ = NumEnc.card (BooleanAnalysis.Cube (Tester.ROf B))) (hpc : ∀ (u : Fin G.numVerts), F.fitLevel hd (G.cloudList u).length Polynomial.eval (G.cloudList u).length pol) (hpe : F.fitLevel hd (2 * G.numEdges) Polynomial.eval (2 * G.numEdges) pol) (dflt : StepKey (F.toFamily hd) r.T r.q B (Fintype.card (ααBool))) (encβ : (PreWalk (F.toFamily hd) r.Tα)BooleanAnalysis.Cube B) :
                                        cubeFn F pol r dflt encβ (pair (encGraph G) (List.replicate (((NumEnc.enc v * r.cD + NumEnc.enc x) * r.cZ + NumEnc.enc z) * 22 + NumEnc.enc i) true)) = List.replicate (((G.preprocess (F.toFamily hd)).killedPow r.q r.T hq).cubeNum encβ (v, x) z i) true

                                        The cube algorithm computes the composed edge's cube.

                                        theorem Complexity.cubeFn_eq' {F : FinBase} {pol : Polynomial } (r : Round) {α : Type} [Fintype α] [DecidableEq α] {B : } (hd : 1 < F.deg) (G : ConstraintGraph α) (hq : 0 < r.q) (hdeg : r.deg = (F.toFamily hd).degree) (hP : r.P = G.preDeg (F.toFamily hd)) (hC : r.C = Fintype.card (ααBool)) (hZ : 0 < r.cZ) (p : ((G.preprocess (F.toFamily hd)).killedPow r.q r.T hq).Dart) (z : BooleanAnalysis.Cube (Tester.ROf B)) (i : ReadIdx) (hcZ : r.cZ = NumEnc.card (BooleanAnalysis.Cube (Tester.ROf B))) (hpc : ∀ (u : Fin G.numVerts), F.fitLevel hd (G.cloudList u).length Polynomial.eval (G.cloudList u).length pol) (hpe : F.fitLevel hd (2 * G.numEdges) Polynomial.eval (2 * G.numEdges) pol) (dflt : StepKey (F.toFamily hd) r.T r.q B (Fintype.card (ααBool))) (encβ : (PreWalk (F.toFamily hd) r.Tα)BooleanAnalysis.Cube B) :
                                        cubeFn F pol r dflt encβ (pair (encGraph G) (List.replicate (((NumEnc.enc p.1 * r.cD + NumEnc.enc p.2) * r.cZ + NumEnc.enc z) * 22 + NumEnc.enc i) true)) = List.replicate (((G.preprocess (F.toFamily hd)).killedPow r.q r.T hq).cubeNum encβ p z i) true

                                        The cube algorithm, with the dart given as one object.

                                        theorem Complexity.codeFn_eq {F : FinBase} {pol : Polynomial } (r : Round) {α : Type} [Fintype α] [DecidableEq α] {B : } (hd : 1 < F.deg) (G : ConstraintGraph α) (hq : 0 < r.q) (hdeg : r.deg = (F.toFamily hd).degree) (hP : r.P = G.preDeg (F.toFamily hd)) (hC : r.C = Fintype.card (ααBool)) (hZ : 0 < r.cZ) (v : (G.preprocess (F.toFamily hd)).graph.V) (x : (Fin r.T(G.preprocess (F.toFamily hd)).graph.D) × (Fin r.TFin r.q)) (z : BooleanAnalysis.Cube (Tester.ROf B)) (i : ReadIdx) (hcZ : r.cZ = NumEnc.card (BooleanAnalysis.Cube (Tester.ROf B))) (hpc : ∀ (u : Fin G.numVerts), F.fitLevel hd (G.cloudList u).length Polynomial.eval (G.cloudList u).length pol) (hpe : F.fitLevel hd (2 * G.numEdges) Polynomial.eval (2 * G.numEdges) pol) (dflt : StepKey (F.toFamily hd) r.T r.q B (Fintype.card (ααBool))) (encβ : (PreWalk (F.toFamily hd) r.Tα)BooleanAnalysis.Cube B) :

                                        The code algorithm computes the composed edge's constraint.

                                        theorem Complexity.codeFn_eq' {F : FinBase} {pol : Polynomial } (r : Round) {α : Type} [Fintype α] [DecidableEq α] {B : } (hd : 1 < F.deg) (G : ConstraintGraph α) (hq : 0 < r.q) (hdeg : r.deg = (F.toFamily hd).degree) (hP : r.P = G.preDeg (F.toFamily hd)) (hC : r.C = Fintype.card (ααBool)) (hZ : 0 < r.cZ) (p : ((G.preprocess (F.toFamily hd)).killedPow r.q r.T hq).Dart) (z : BooleanAnalysis.Cube (Tester.ROf B)) (i : ReadIdx) (hcZ : r.cZ = NumEnc.card (BooleanAnalysis.Cube (Tester.ROf B))) (hpc : ∀ (u : Fin G.numVerts), F.fitLevel hd (G.cloudList u).length Polynomial.eval (G.cloudList u).length pol) (hpe : F.fitLevel hd (2 * G.numEdges) Polynomial.eval (2 * G.numEdges) pol) (dflt : StepKey (F.toFamily hd) r.T r.q B (Fintype.card (ααBool))) (encβ : (PreWalk (F.toFamily hd) r.Tα)BooleanAnalysis.Cube B) :

                                        The code algorithm, with the dart given as one object.