Documentation

Complexitylib.Classes.PCP.Internal.Hadamard

Decoding a Hadamard proof #

Dinur's alphabet-reduction step composes a constraint system with an inner verifier — an assignment tester — and the classical one is built from the Hadamard code: an assignment a ⊆ Fin n is encoded as the parity function χ a, and the verifier checks that the proof is (close to) such a function.

The two facts the analysis rests on are already in Complexitylib.BooleanAnalysis.FourierExpansion: blr_soundness, which says a proof passing the linearity test is close to some linear function, and local_correctability, which recovers that function's value anywhere. What is missing for a tester is the witness: soundness must hand back the coordinate set S, since S is precisely the assignment being decoded.

This module extracts that witness, and records the two identities that make χ S a usable decoding: its value on a basis vector is the membership bit of S, so reading the corrected proof at basis vectors recovers the assignment.

Main results #

BLR soundness, with the witness named. A proof passing the linearity test is close to χ S for an explicit coordinate set S — and S is the assignment the tester decodes.

The basis vector at coordinate i.

Equations
Instances For
    theorem Complexity.parityFun_basis {n : } (S : Finset (Fin n)) (i : Fin n) :

    Reading the assignment. The decoded parity function, evaluated at the i-th basis vector, is -1 exactly when i belongs to the coordinate set: the assignment is read off the proof one coordinate at a time.

    The Hadamard code #

    @[reducible, inline]
    abbrev Complexity.BitFun (n : ) :

    An 𝔽₂-valued function on the cube. The tester's checks are stated over 𝔽₂ — the consistency check multiplies two bits, which is not a ±1 operation — while the linearity analysis lives in the ±1 world, so the two views must be bridged.

    Equations
    Instances For
      noncomputable def Complexity.signOf {n : } (F : BitFun n) :

      The ±1 encoding of an 𝔽₂-valued function.

      Equations
      Instances For
        theorem Complexity.chi_sum {ι : Type u_1} (s : Finset ι) (f : ιZMod 2) :
        BooleanAnalysis.chi (∑ is, f i) = is, BooleanAnalysis.chi (f i)

        The Hadamard encoding of an assignment a: the linear function x ↦ ⟨a, x⟩.

        Equations
        Instances For

          The Hadamard code is a parity function. Its ±1 encoding is χ of the support of the assignment — so the Fourier layer's linearity results apply to Hadamard proofs verbatim, and the decoded coordinate set is the assignment's support.

          The tensor part #

          The outer product of two cube points, as a point of the squared cube. The Fourier layer is indexed by Fin n, so the pair index is transported along finProdFinEquiv.

          Equations
          Instances For

            The tensor square of an assignment — the second table a Hadamard proof carries, so that the verifier can evaluate quadratic constraints.

            Equations
            Instances For

              The consistency identity. The tensor table, read at an outer product, is the product of the two linear readings. This is the check that ties the quadratic table to the linear one, and it is a statement about bits: over 𝔽₂ the right-hand side is a product, which is why the tester's checks cannot be phrased in the ±1 encoding.

              Decoding a proof into an assignment #

              The assignment a coordinate set stands for.

              Equations
              Instances For

                Every parity function is a Hadamard codeword. With signOf_hadamard this makes the correspondence between assignments and parity functions a bijection, so BLR's coordinate set can be handed back as an assignment.

                Decoding. A proof passing the linearity test is close to the Hadamard encoding of an explicit assignment — the assignment the tester extracts.

                Consistency forces the tensor #

                Reading a Hadamard table at a basis vector returns that coordinate.

                The outer product of two basis vectors is the basis vector at the corresponding pair index.

                Consistency forces the tensor. A quadratic table that agrees with the product of the linear readings on every outer product is the tensor square of the assignment — testing at basis vectors pins down every entry. This is why the consistency check suffices: it leaves the prover no freedom in the quadratic table.

                Checking a constraint #

                A quadratic constraint over 𝔽₂. Dinur's inner verifier tests exactly this: the constraints of a system with a constant-size alphabet are quadratic equations once the alphabet symbols are spelled out in bits.

                Instances For

                  The constraint evaluated at an assignment.

                  Equations
                  Instances For

                    The assignment satisfies the constraint.

                    Equations
                    Instances For
                      def Complexity.checkValue {n : } (F : BitFun (n * n)) (f : BitFun n) (C : QuadConstraint n) :

                      What the verifier computes from the two tables: one query into each.

                      Equations
                      Instances For

                        On honest tables the check is the constraint — this is completeness.

                        theorem Complexity.sat_of_checks {n : } (a : BooleanAnalysis.Cube n) (b : BooleanAnalysis.Cube (n * n)) (C : QuadConstraint n) (hcons : ∀ (x y : BooleanAnalysis.Cube n), hadamard b (tensor x y) = hadamard a x * hadamard a y) (hcheck : checkValue (hadamard b) (hadamard a) C = 0) :
                        C.Sat a

                        Tester soundness, exact form. If the two tables are Hadamard codewords, the consistency check holds everywhere, and the constraint check passes, then the decoded assignment satisfies the constraint. The prover's only freedom is the assignment itself: consistency pins the quadratic table to the tensor of the linear one, and then the check computes the constraint honestly.

                        The Hadamard encoding of an assignment is linear, so it passes the linearity test with certainty.

                        Tester completeness, exact form. The honest tables of a satisfying assignment pass the linearity test with certainty, satisfy the consistency check everywhere, and pass the constraint check.

                        Rigidity of the decoding #

                        Distinct parity functions are far apart. Two different parity functions disagree on exactly half the cube, so agreeing on more than half forces them to be equal.

                        This is what makes the approximate tester work: the decoded tables are linear, and a check that passes on a large enough fraction of the cube therefore holds everywhere on the corrected tables — turning a probabilistic hypothesis into the exact one sat_of_checks needs.

                        The decoded assignment is unique: a proof cannot be close to the Hadamard encodings of two different assignments.

                        A nonzero linear form is balanced #

                        The ±1 encoding turns a bit into 1 - 2·bit.

                        The expectation of a bit function's sign encoding.

                        A nonzero linear form is balanced. Over 𝔽₂ a nonzero linear form takes each value on exactly half the cube — the counting fact behind every "the check cannot pass too often unless it always passes" step.

                        The bilinear form #

                        The bilinear form of c, contracted against y: the linear form in x obtained by fixing the second argument.

                        Equations
                        Instances For

                          Row decomposition. Reading the quadratic table at an outer product is a linear reading in the first argument, with coefficients contracted against the second. This is what lets the one-variable balance lemma be applied inside a two-variable check.

                          Probability is monotone. The Fourier layer has the union bound and complements but not this.

                          The bilinear form is nonzero on many rows. If the quadratic table's error c is nonzero, then for at least half the y the contracted linear form is nonzero — the first half of the 1/4 bound.

                          A nonzero bilinear form is nonzero on a quarter of all pairs. For at least half the second arguments the contracted form is nonzero, and each such form is nonzero on exactly half the first arguments.

                          This is the quantitative heart of the consistency check: a prover whose quadratic table differs from the tensor square fails the check on at least a quarter of the pairs, so passing it more often than that forces the tables to agree exactly.

                          Approximate consistency #

                          Approximate consistency forces the tensor. A quadratic table passing the consistency check on more than three quarters of the pairs must be the tensor square: otherwise their difference is a nonzero bilinear form, which prob₂_tensor_ne_zero says fails on at least a quarter.

                          Reads over bundled randomness #

                          A corrected read is right. Reading a close-to-linear table by self-correction, with the randomness taken from the first block of a bundled random string, returns the codeword's value except with probability .

                          Two corrected reads are both right. The union bound over the two blocks: bundling the randomness is what makes this an ordinary one-variable union bound rather than a product-measure argument.

                          theorem Complexity.sat_of_prob_checks {n : } (a : BooleanAnalysis.Cube n) (b : BooleanAnalysis.Cube (n * n)) (C : QuadConstraint n) (hcons : 3 / 4 < BooleanAnalysis.prob₂ fun (y x : BooleanAnalysis.Cube n) => hadamard b (tensor x y) = hadamard a x * hadamard a y) (hcheck : checkValue (hadamard b) (hadamard a) C = 0) :
                          C.Sat a

                          Tester soundness with a probabilistic consistency check. The verifier cannot test consistency everywhere — it tests one random pair. This says that is enough: passing on more than three quarters of the pairs pins the quadratic table down exactly, and then the constraint check computes the constraint honestly.

                          Together with checks_of_sat this is the assignment tester's guarantee at the level of decoded tables: the prover's only freedom is which assignment to encode, and if the checks pass, that assignment satisfies the constraint.

                          Completeness of the consistency check. The honest tables pass it on every pair, so the tester accepts a correct proof with certainty.

                          theorem Complexity.prob_all_reads {n m k : } (f : BooleanAnalysis.BooleanFunction n) (hf : BooleanAnalysis.IsBooleanValued f) (S : Finset (Fin n)) {ε : } (hclose : BooleanAnalysis.IsClose f (BooleanAnalysis.parityFun S) ε) (blk : Fin kBooleanAnalysis.Cube mBooleanAnalysis.Cube n) (hblk : ∀ (i : Fin k) (P : BooleanAnalysis.Cube nProp), (BooleanAnalysis.prob fun (z : BooleanAnalysis.Cube m) => P (blk i z)) = BooleanAnalysis.prob P) (pts : Fin kBooleanAnalysis.Cube n) :
                          1 - k * (2 * ε) BooleanAnalysis.prob fun (z : BooleanAnalysis.Cube m) => ∀ (i : Fin k), f (blk i z) * f (pts i + blk i z) = BooleanAnalysis.parityFun S (pts i)

                          All of a tester's reads are correct. Given a close-to-linear table and any family of blocks of a bundled random string — each uniformly distributed, which is what hblk asks and what CubeBlocks supplies — every self-corrected read returns the codeword's value, except with probability 2kε.

                          Parameterising by the block maps keeps this independent of how many reads the tester makes and how the string is carved up.