Documentation

Complexitylib.Classes.PCP.Internal.VerifierLang

The witness layout of a PCP verifier #

A witness for a PCP verifier is a table of answers, one fixed-width block per coin string. This module fixes that layout and reads it back: the block for a coin string, cut down to the number of queries actually made, is exactly the answer list SubsetNP.tableOf names.

It also records that the query bound can be taken to be a constant. A bound q =O 1 need not be a computable function, but it is eventually bounded and takes finitely many values before that, so a single number bounds every query list — which is what an algorithm can actually use.

Main definitions #

Main results #

theorem Complexity.exists_const_query_bound {V : PCPVerifier} {q : } (hV : V.QueryBounded q) (hq : BigO q fun (x : ) => 1) :
∃ (K : ), ∀ (x ρ : List Bool), (V.positions x ρ).length K

A constant bounds every query list. This is what makes the witness layout uniform: each block has the same fixed width.

def Complexity.wBlock (w : List Bool) (start len : ) :

The witness block starting at start and holding len answers.

Equations
Instances For
    theorem Complexity.wBlock_mem_FP {w s l : List BoolList Bool} (hw : w FP) (hs : s FP) (hl : l FP) :
    (fun (z : List Bool) => wBlock (w z) (s z).length (l z).length) FP
    theorem Complexity.length_wBlock {w : List Bool} {start len : } (h : start + len w.length) :
    (wBlock w start len).length = len
    theorem Complexity.getElem_wBlock {w : List Bool} {start len : } (h : start + len w.length) {i : } (hi : i < len) :
    (wBlock w start len)[i] = w.getD (start + i) false

    The block is the answer list. With the answers for coin index c laid out in the slots c * Q, …, the witness block is exactly the table SubsetNP.tableOf reads.

    theorem Complexity.wBlock_one {w : List Bool} {k : } (h : k < w.length) :
    wBlock w k 1 = [w.getD k false]

    A one-bit block is the bit it holds.

    theorem Complexity.getElem?_tableOf (V : PCPVerifier) (t Q : ) (x w : List Bool) (ρ : Fin tBool) {i : } (hi : i < (V.positions x (BitString.toList ρ)).length) :
    (V.tableOf t Q x w ρ)[i]? = some (w.getD (PCPVerifier.coinIndex ρ * Q + i) false)

    Reading a slot of the table.

    Acceptance on every coin string #

    The check is a loop over coin indices. Each iteration recovers the coin string from its index, reads the verifier's query list to learn how many answers this coin string uses, cuts that many out of the witness block, and asks the verdict.

    The input of one iteration is pair (pair x w) (unary c).

    Equations
    Instances For

      The witness, out of the iteration's input.

      Equations
      Instances For
        noncomputable def Complexity.accCoin (r : ) (y : List Bool) :

        The coin string named by the iteration's index.

        Equations
        Instances For
          noncomputable def Complexity.accView (f : List BoolList Bool) (r : ) (Q : ) (y : List Bool) :

          The verifier's view: input and coins paired with the answers read off the witness block.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            theorem Complexity.accCoin_mem_FP (r : ) (hr : (fun (x : List Bool) => List.replicate (r x.length) true) FP) :
            theorem Complexity.accView_mem_FP (f : List BoolList Bool) (r : ) (Q : ) (hf : f FP) (hr : (fun (x : List Bool) => List.replicate (r x.length) true) FP) :
            accView f r Q FP
            noncomputable def Complexity.accInner (V : PCPVerifier) (f : List BoolList Bool) (r : ) (Q : ) :

            One iteration's condition: the verifier accepts the view.

            Equations
            Instances For
              theorem Complexity.accInner_mem_P (V : PCPVerifier) (f : List BoolList Bool) (r : ) (Q : ) (hf : f FP) (hr : (fun (x : List Bool) => List.replicate (r x.length) true) FP) :
              accInner V f r Q P
              noncomputable def Complexity.accLang (V : PCPVerifier) (f : List BoolList Bool) (r : ) (Q : ) :

              Acceptance on every coin string, as a language of pair x w.

              Equations
              Instances For
                theorem Complexity.accLang_mem_P (V : PCPVerifier) (f : List BoolList Bool) (r : ) (Q : ) (hf : f FP) (hr : (fun (x : List Bool) => List.replicate (r x.length) true) FP) (hrlog : BigO r fun (n : ) => Nat.log 2 n) :
                accLang V f r Q P
                theorem Complexity.accView_pair (V : PCPVerifier) (f : List BoolList Bool) (r : ) (Q : ) (hfspec : ∀ (x rr : List Bool), f (pair x rr) = DataEncode.bitstringEncode (V.positions x rr)) {x w : List Bool} {c : } (hc : c < 2 ^ r x.length) (hw : w.length = 2 ^ r x.length * Q) (hQ : ∀ (rr : List Bool), (V.positions x rr).length Q) :

                What one iteration looks at, on a well-formed input.

                theorem Complexity.mem_accLang_iff (V : PCPVerifier) (f : List BoolList Bool) (r : ) (Q : ) (hfspec : ∀ (x rr : List Bool), f (pair x rr) = DataEncode.bitstringEncode (V.positions x rr)) {x w : List Bool} (hw : w.length = 2 ^ r x.length * Q) (hQ : ∀ (rr : List Bool), (V.positions x rr).length Q) :
                pair x w accLang V f r Q ∀ (ρ : Fin (r x.length)Bool), pair (pair x (BitString.toList ρ)) (V.tableOf (r x.length) Q x w ρ) V.verdict

                Acceptance on every coin string.