Documentation

Complexitylib.Classes.PCP.Internal.AlgCSPModel

Proofs as assignments #

The proof a PCP verifier reads is an assignment written out: one fixed-width block per vertex. This module sets up that correspondence — how to cut a proof into blocks, how to write an assignment as a proof, and that the two are inverse.

Main definitions #

Main results #

def Complexity.blockOf (w : ) (π : List Bool) (v : ) :

The block a proof carries at a vertex, when symbols occupy w bits.

Equations
Instances For
    def Complexity.proofOf (n : ) (f : List Bool) :

    The proof an assignment writes: the blocks of the first n vertices, one after another.

    Equations
    Instances For
      theorem Complexity.length_proofOf {w : } {f : List Bool} (hf : ∀ (i : ), (f i).length = w) (n : ) :
      (proofOf n f).length = n * w
      theorem Complexity.blockOf_proofOf {w : } {f : List Bool} (hf : ∀ (i : ), (f i).length = w) (n v : ) :
      v < nblockOf w (proofOf n f) v = f v

      Reading back what was written.

      theorem Complexity.length_blockOf {w : } {π : List Bool} {v : } (h : (v + 1) * w π.length) :
      (blockOf w π v).length = w
      theorem Complexity.getElem_blockOf {w : } {π : List Bool} {v j : } (h : (v + 1) * w π.length) (hj : j < w) :
      (blockOf w π v)[j] = π.getD (v * w + j) false
      theorem Complexity.answers_posVal (A : AlgCSP) (x π : List Bool) (e : ) (h0 : (A.vert false x e + 1) * A.width π.length) (h1 : (A.vert true x e + 1) * A.width π.length) :
      PCPVerifier.answers π (List.map (A.posVal x e) (List.range (2 * A.width))) = blockOf A.width π (A.vert false x e) ++ blockOf A.width π (A.vert true x e)

      The verifier reads exactly the two endpoint blocks.

      Padding a proof #

      Agreement with a real constraint graph #

      structure Complexity.AlgCSP.Models (A : AlgCSP) {α : Type} (G : List BoolConstraintGraph α) (enc : αList Bool) (dec : List Boolα) :

      An algorithmic graph agrees with a real one: same edges, same endpoints, and the constraint means the same thing once symbols are decoded.

      Instances For
        def Complexity.AlgCSP.assignProof {α : Type} [Inhabited α] (enc : αList Bool) (n : ) (a : Fin nα) :

        The proof an assignment writes.

        Equations
        Instances For
          theorem Complexity.AlgCSP.length_assignProof {A : AlgCSP} {α : Type} [Inhabited α] {G : List BoolConstraintGraph α} {enc : αList Bool} {dec : List Boolα} (hM : A.Models G enc dec) (n : ) (a : Fin nα) :
          (assignProof enc n a).length = n * A.width
          theorem Complexity.AlgCSP.blockOf_assignProof {A : AlgCSP} {α : Type} [Inhabited α] {G : List BoolConstraintGraph α} {enc : αList Bool} {dec : List Boolα} (hM : A.Models G enc dec) {n : } (a : Fin nα) {v : } (hv : v < n) :
          blockOf A.width (assignProof enc n a) v = enc (a v, hv)
          theorem Complexity.AlgCSP.Models.sat_of_satisfiable {A : AlgCSP} {α : Type} [Inhabited α] {G : List BoolConstraintGraph α} {enc : αList Bool} {dec : List Boolα} (hM : A.Models G enc dec) (x : List Bool) (h : (G x).Satisfiable) :
          ∃ (π : List Bool), e < A.numEdges x, A.Sat x π e

          Completeness transfers. A satisfying assignment writes a proof the verifier accepts on every edge.

          theorem Complexity.AlgCSP.Models.card_sat_le {A : AlgCSP} {α : Type} {G : List BoolConstraintGraph α} {enc : αList Bool} {dec : List Boolα} [Fintype α] [Nonempty α] (hM : A.Models G enc dec) (x : List Bool) {gap : } (hgap : gap (G x).unsatVal) (π : List Bool) :
          (Finset.filter (A.Sat x π) (Finset.range (A.numEdges x))).card (1 - gap) * (A.numEdges x)

          Soundness transfers. No proof satisfies more than a 1 - gap fraction of the edges.