Documentation

CslibFrontier.Computability.Interactive.Sumcheck

The sumcheck protocol with a final evaluation check #

The index is a polynomial P in n variables over a finite field F with every individual degree at most d. A claim at round i (Sumcheck.Claim) consists of the challenges r : Fin i → F of the earlier rounds and a value c. It states that the sum of P over the Boolean hypercube in the coordinates i, …, n - 1, with the coordinates below i fixed to r, is c (Sumcheck.rel P i). At round 0 this is the sumcheck claim ∑_{b ∈ {0,1}ⁿ} P b = c, and at round n it is the evaluation claim P r = c.

This is the protocol of Lund, Fortnow, Karloff and Nisan [LFKN92] as a composition of one-round reductions, with each challenge uniform on the field. Each round needs i < n: past the last variable the honest round polynomial is constant, and the round is neither complete nor round-by-round sound. The TQBF protocol in CslibFrontier.Computability.Complexity.Classes.IP.TQBF.Protocol is a separate, unchanged development.

Main definitions #

Main results #

References #

A claim of round i: the challenges of the rounds before i and the claimed value.

  • challenges : Fin i → F

    The challenges of the rounds before i.

  • value : F

    The claimed partial sum at challenges.

def Cslib.Interactive.Sumcheck.point {F : Type} [Field F] {n i : ℕ} (r : Fin i → F) (b : Fin (n - i) → Bool) :
Fin n → F

The point of F^n equal to r on the first i coordinates and to the Boolean point b on the others.

noncomputable def Cslib.Interactive.Sumcheck.partialSum {F : Type} [Field F] {n : ℕ} (P : MvPolynomial (Fin n) F) {i : ℕ} (r : Fin i → F) :
F

The sum of P over the Boolean hypercube in the coordinates from i on, with the coordinates below i fixed to r.

def Cslib.Interactive.Sumcheck.rel {F : Type} [Field F] {n : ℕ} (P : MvPolynomial (Fin n) F) (i : ℕ) :
Claim F i → Unit → Prop

The relation of round i: the claimed value is the partial sum. There is no witness.

noncomputable def Cslib.Interactive.Sumcheck.roundPoly {F : Type} [Field F] {n : ℕ} (P : MvPolynomial (Fin n) F) {i : ℕ} (r : Fin i → F) :

The honest message of round i: the partial sum as a polynomial in coordinate i.

@[reducible, inline]

One round: the prover sends a polynomial, read in full; the verifier sends a field element.

@[reducible, inline]
abbrev Cslib.Interactive.Sumcheck.accepts {F : Type} [Field F] (d : ℕ) (c : F) (g : Polynomial F) :

The verifier's test of a round polynomial g against the claimed value c.

noncomputable def Cslib.Interactive.Sumcheck.round {F : Type} [Field F] [Fintype F] [DecidableEq F] {n : ℕ} (d : ℕ) (P : MvPolynomial (Fin n) F) (i : ℕ) :

Round i of sumcheck: on the claim ⟨r, c⟩ and the challenge z, the new claim is ⟨Fin.snoc r z, g.eval z⟩ for the prover's polynomial g.

The final check: evaluate P at the claimed point, without interaction.

noncomputable def Cslib.Interactive.Sumcheck.proof {F : Type} [Field F] [Fintype F] [DecidableEq F] {n : ℕ} (d : ℕ) (P : MvPolynomial (Fin n) F) :

Sumcheck followed by the final check: a proof system for the claim ∑_{b ∈ {0,1}ⁿ} P b = c (rel P 0).

The round polynomial #

theorem Cslib.Interactive.Sumcheck.natDegree_roundPoly_le {F : Type} [Field F] {n : ℕ} (d : ℕ) (P : MvPolynomial (Fin n) F) (hP : ∀ (j : Fin n), MvPolynomial.degreeOf j P ≤ d) {i : ℕ} (hi : i < n) (r : Fin i → F) :

The round polynomial has degree at most d.

theorem Cslib.Interactive.Sumcheck.eval_roundPoly_eq {F : Type} [Field F] {n : ℕ} (P : MvPolynomial (Fin n) F) {i : ℕ} (r : Fin i → F) (z : F) :

The round polynomial at z is the partial sum of the next round at the point extended by z.

theorem Cslib.Interactive.Sumcheck.roundPoly_eval_zero_add_one {F : Type} [Field F] {n : ℕ} (P : MvPolynomial (Fin n) F) {i : ℕ} (hi : i < n) (r : Fin i → F) :

The verifier's test passes on the honest round polynomial: its values at 0 and 1 sum to the partial sum.

theorem Cslib.Interactive.Sumcheck.partialSum_self {F : Type} [Field F] {n : ℕ} (P : MvPolynomial (Fin n) F) (r : Fin n → F) :

At round n all coordinates are fixed: the partial sum is the evaluation.

Component theorems (milestone 2) #

theorem Cslib.Interactive.Sumcheck.round_complete {F : Type} [Field F] [Fintype F] [DecidableEq F] {n : ℕ} (d : ℕ) (P : MvPolynomial (Fin n) F) (hP : ∀ (j : Fin n), MvPolynomial.degreeOf j P ≤ d) {i : ℕ} (hi : i < n) :
Reduction.Complete World.plain (round d P i) (rel P i) (rel P (i + 1)) 0

Each round is perfectly complete.

theorem Cslib.Interactive.Sumcheck.round_rbrSound {F : Type} [Field F] [Fintype F] [DecidableEq F] {n : ℕ} (d : ℕ) (P : MvPolynomial (Fin n) F) (hP : ∀ (j : Fin n), MvPolynomial.degreeOf j P ≤ d) {i : ℕ} (hi : i < n) :
(round d P i).verifier.RbrSound (language (rel P i)) (language (rel P (i + 1))) (↑d / ↑(Fintype.card F), ())

Each round is round-by-round sound with error d / |F| (Schwartz–Zippel for one variable).

The final check is perfectly complete.

The final check is round-by-round sound without error.

End-to-end theorems, by composition #

theorem Cslib.Interactive.Sumcheck.proof_complete {F : Type} [Field F] [Fintype F] [DecidableEq F] {n : ℕ} (d : ℕ) (P : MvPolynomial (Fin n) F) (hP : ∀ (j : Fin n), MvPolynomial.degreeOf j P ≤ d) :

Completeness of sumcheck with the final check.

theorem Cslib.Interactive.Sumcheck.proof_sound {F : Type} [Field F] [Fintype F] [DecidableEq F] {n : ℕ} (d : ℕ) (P : MvPolynomial (Fin n) F) (hP : ∀ (j : Fin n), MvPolynomial.degreeOf j P ≤ d) :

Soundness of sumcheck with the final check: a false claim is accepted with probability at most n * (d / |F|).