Documentation

Complexitylib.Classes.PCP.Internal.CSPVerifier

A verifier for a constraint graph #

The verifier of a constraint graph picks an edge at random, reads the symbols its two endpoints carry, and checks the constraint. The proof is the assignment, written as one fixed-width block per vertex, so the queries are the two blocks.

This module packages the algorithmic content a graph must supply — how many edges, the endpoints of an edge, and the constraint — and turns it into a PCPVerifier. Nothing here is about the graph's quality: completeness and soundness are hypotheses on the supplied data, discharged elsewhere by Dinur's amplification.

Main definitions #

Main results #

A constraint graph presented the way an algorithm sees it: a count of edges, the endpoints of each edge, and a decidable constraint. Indices are handled in unary, which is what a polynomial-time loop can carry.

Instances For

    The edge a coin string names.

    Equations
    Instances For
      noncomputable def Complexity.AlgCSP.edgeU (p : Polynomial ) (z : List Bool) :

      That index in unary, as far as the clamp allows.

      Equations
      Instances For
        noncomputable def Complexity.AlgCSP.inRange (A : AlgCSP) (p : Polynomial ) (z : List Bool) :

        Is the named edge a real one?

        Equations
        Instances For
          noncomputable def Complexity.AlgCSP.cntU (A : AlgCSP) (p : Polynomial ) (z : List Bool) :

          How many queries the verifier makes: both symbol blocks, or none when the coin string names no edge.

          Equations
          Instances For

            Where the verifier looks #

            noncomputable def Complexity.AlgCSP.vertU (A : AlgCSP) (p : Polynomial ) (b : Bool) (w : List Bool) :

            The endpoint a query index refers to: the first for the low half of the queries, the second for the high half.

            Equations
            Instances For

              Is this query in the low half?

              Equations
              Instances For

                The offset inside the symbol block.

                Equations
                Instances For
                  noncomputable def Complexity.AlgCSP.posU (A : AlgCSP) (p : Polynomial ) (w : List Bool) :

                  The position a query reads, in unary.

                  Equations
                  Instances For

                    The verifier #

                    noncomputable def Complexity.AlgCSP.cnt (A : AlgCSP) (p : Polynomial ) (z : List Bool) :

                    How many queries, as a number.

                    Equations
                    Instances For
                      noncomputable def Complexity.AlgCSP.pos (A : AlgCSP) (p : Polynomial ) (z : List Bool) (i : ) :

                      The i-th query position, as a number.

                      Equations
                      Instances For

                        The verdict: accept unless the coin string names a real edge whose constraint fails.

                        Equations
                        Instances For
                          theorem Complexity.AlgCSP.cnt_le (A : AlgCSP) (p : Polynomial ) (z : List Bool) :
                          A.cnt p z 2 * A.width

                          The verifier of a constraint graph.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            @[simp]
                            theorem Complexity.AlgCSP.positions_verifier (A : AlgCSP) (p : Polynomial ) (x ρ : List Bool) :
                            (A.verifier p).positions x ρ = List.map (A.pos p (pair x ρ)) (List.range (A.cnt p (pair x ρ)))

                            What the verifier reads and decides #

                            def Complexity.AlgCSP.posVal (A : AlgCSP) (x : List Bool) (e i : ) :

                            The position query i reads, as a function of the edge alone.

                            Equations
                            Instances For
                              theorem Complexity.AlgCSP.pos_eq (A : AlgCSP) (p : Polynomial ) {x ρ : List Bool} (h : 2 ^ ρ.length Polynomial.eval (pair x ρ).length p) (i : ) :
                              A.pos p (pair x ρ) i = A.posVal x (binValLE ρ) i
                              def Complexity.AlgCSP.Sat (A : AlgCSP) (x π : List Bool) (e : ) :

                              Edge e is satisfied by the proof π.

                              Equations
                              Instances For
                                theorem Complexity.AlgCSP.accepts_verifier_iff (A : AlgCSP) (p : Polynomial ) {x ρ : List Bool} (h : 2 ^ ρ.length Polynomial.eval (pair x ρ).length p) (π : List Bool) :
                                (A.verifier p).Accepts x π ρ binValLE ρ < A.numEdges xA.Sat x π (binValLE ρ)

                                What the verifier decides. It accepts unless the coin string names a real edge that the proof fails to satisfy.

                                How often the verifier accepts #

                                theorem Complexity.AlgCSP.acceptEvent_eq (A : AlgCSP) (p : Polynomial ) {x : List Bool} {T : } (h : 2 ^ T Polynomial.eval (2 * x.length + 2 + T) p) (π : List Bool) :
                                (A.verifier p).acceptEvent T x π = {ρ : Fin TBool | PCPVerifier.coinIndex ρ < A.numEdges xA.Sat x π (PCPVerifier.coinIndex ρ)}
                                theorem Complexity.AlgCSP.card_reject (A : AlgCSP) {x : List Bool} {T : } (hN : A.numEdges x 2 ^ T) (π : List Bool) :
                                {ρ : Fin TBool | PCPVerifier.coinIndex ρ < A.numEdges xA.Sat x π (PCPVerifier.coinIndex ρ)}.card = {eFinset.range (A.numEdges x) | ¬A.Sat x π e}.card
                                theorem Complexity.AlgCSP.eventProb_eq_one (A : AlgCSP) (p : Polynomial ) {x : List Bool} {T : } (h : 2 ^ T Polynomial.eval (2 * x.length + 2 + T) p) (hN : A.numEdges x 2 ^ T) {π : List Bool} (hsat : e < A.numEdges x, A.Sat x π e) :
                                eventProb ((A.verifier p).acceptEvent T x π) = 1

                                Perfect completeness. A proof satisfying every edge is always accepted.

                                theorem Complexity.AlgCSP.eventProb_le (A : AlgCSP) (p : Polynomial ) {x : List Bool} {T : } {gap : } (h : 2 ^ T Polynomial.eval (2 * x.length + 2 + T) p) (hN : A.numEdges x 2 ^ T) (hT : 2 ^ T 2 * A.numEdges x) {π : List Bool} (hs : (Finset.filter (A.Sat x π) (Finset.range (A.numEdges x))).card (1 - gap) * (A.numEdges x)) :
                                eventProb ((A.verifier p).acceptEvent T x π) 1 - gap / 2

                                Soundness. If no proof satisfies more than a 1 - gap fraction of the edges, the verifier accepts with probability at most 1 - gap / 2.

                                theorem Complexity.mem_PCP_of_algCSP (A : AlgCSP) (p : Polynomial ) (t : ) (ht : (fun (x : List Bool) => List.replicate (t x.length) true) FP) (hclamp : ∀ (n : ), 2 ^ t n Polynomial.eval (2 * n + 2 + t n) p) (hN : ∀ (x : List Bool), A.numEdges x 2 ^ t x.length) (hT : ∀ (x : List Bool), 2 ^ t x.length 2 * A.numEdges x) {L : Language} {gap : } (hgap0 : 0 < gap) (hgap1 : gap 1) (hcomp : xL, ∃ (π : List Bool), e < A.numEdges x, A.Sat x π e) (hsound : xL, ∀ (π : List Bool), (Finset.filter (A.Sat x π) (Finset.range (A.numEdges x))).card (1 - gap) * (A.numEdges x)) :
                                ∃ (j : ), L PCP (fun (n : ) => 2 ^ j * t n) fun (x : ) => 2 ^ j * (2 * A.width)

                                A constraint graph with a gap puts its language in PCP. Completeness and soundness are hypotheses on the graph: a member has an assignment satisfying every edge, and a non-member has none satisfying more than a 1 - gap fraction.