Try   HackMD

Setup

Recall from our previous note that the Specialized Sum-Check protocol allows to prove a statement of the form

(x0,,xv){0,1}v+1g(f0(x0,,xv),,fm(x0,,xv))=C,

where

f0,,fm are multi-linear polynomials defined over some field
F
,
g
is any multivariate polynomial
Fv+1F
, and
C
is some arbitrary value. During each round of the protocol, the prover is asked to build the following univariate polynomial:

si(X0)=(xi+1,,xv){0,1}vig(f0(r0,,ri1,X0,xi+1,xv),,fm(r0,,ri1,X0,xi+1,xv)),

where

r0,,ri1 are random variables from the previous rounds.

In this note, we will discuss how to efficiently compute that polynomial

si.

Preliminaries

Polynomials can either be stored in coefficient form, or evaluation form. For example, given a simple polynomial

f(x)=ax+b, we could store
f
as

  • coefficient form:
    [a,b]
  • evaluation form:
    [f(0),f(1)]

In general, for a polynomial of degree

d, we need to store
d+1
distinct evaluations. Barycentric evaluation is an algorithm that can be used to evaluate a polynomial stored in evaluation form.

We will be storing

si using evaluation form. Specifically, we will limit
si
to be at most degree
d
, and store
si
as
[si(0),si(1),...,si(d)]
.

Also, the multi-linear

f0,,fm will have the evaluations of
r0,,ri1
already bound. That is, we will actually be working with some similar
fj
, defined as
fj(xi,,xv)=fj(r0,,ri1,xi,,xv)
. Therefore, the sum-check round univariate polynomial
si
will actually be built as:

si(X0)=(xi+1,,xv){0,1}vig(f0(X0,xi+1,xv),,fm(X0,xi+1,xv),),

Key multi-linear polynomial identity

Our algorithm will make use of a very useful identity of affine functions.

Let's begin with a simple univariate affine function:

h(x)=ax+b. The identity is:

h(x)=(1x)h(0)+xh(1)

This is relatively easy to show:

(1x)h(0)+xh(1)=(1x)b+x(a+b)=bbx+ax+bx=b+ax=h(x)

Note that multi-linear polynomials are affine in each of their variables. For example, take a 2-variate multi-linear function

h2(x0,x1)=ax0x1+bx0+cx1+d. We will show that it is affine in
x0
:

h2(X0,x1)=aX0x1+bX0+cx1+d=(ax1+b)X0+(cx1+d)

We used a capitalized

X0 to accentutate the fact that we're treating
x1
as constant. Since
(ax1+b)
and
(cx1+d)
are constants, then
h2
is affine in
X0
. The same argument can be used to show that
h2
is affine in
x1
as well. And this is not limited to only 2 variables - it is true for any arbitrary number of variables.

Hence, our identity for multi-linear polynomials becomes:

h(x0,x1,,xv)=(1x0)×h(0,x1,,xv)+x0×h(1,x1,,xv)

Use of the key identity in the algorithm

In the algorithm described below, we will need to evaluate

si at successive points:
si(0),si(1),,si(d)
. Ultimately, this will translate into evaluating each multilinear
fj
similarly:
fj(0,xi+1,,xv),fj(1,xi+1,,xv),,fj(d,xi+1,,xv)
, for all
(xi+1,,xv){0,1}vi
.

For each instantiation of

(xi+1,,xv), instead of naively evaluating
fj
some
d+1
times, we will only evaluate it twice:
fj(0,xi+1,,xv)
and
fj(1,xi+1,,xv)
. Then, we use the identity to get all the other evaluations:

  • fj(2,xi+1,,xv)=1×fj(0,xi+1,,xv)+2×fj(1,xi+1,,xv)
  • fj(3,xi+1,,xv)=2×fj(0,xi+1,,xv)+3×fj(1,xi+1,,xv)
  • fj(d,xi+1,,xv)=(d+1)×fj(0,xi+1,,xv)+d×fj(1,xi+1,,xv)

The algorithm

To simplify the notation, in this algorithm we will make use of vector addition and scalar mutliplication. That is, if

v1=[a,b,c] and
v2=[d,e,f]
, then
v1+v2=[a+d,b+e,c+f]
, and
42v1=[42a,42b,42c]
.

The goal of the algorithm is to compute

si(X0), which concretely, means computing
si(0),si(1),,si(d)
, since
si
is stored in evaluation form as previously discussed.

  • let
    sacc=[0,,0]
    be an array of
    d+1
    variables initialized to
    0
    that will ultimately hold the evaluations of
    si
    at
    0,1,,d
    .
    • The "acc" stands for "accumulator", as for each round of the coming loop, we will "accumulate" the results in this array.
    • Only by the end of the loop will
      sacc
      contain the evaluations
      si(0),,si(d)
      .
  • For each
    (xi+1,,xv){0,1}vi
    • Let
      evals0=[f0(0,xi+1,,xv),,fm(0,xi+1,,xv)]
    • Let
      evals1=[f0(1,xi+1,,xv),,fm(1,xi+1,,xv)]
    • Update
      sacc
      • sacc[0]+=g(evals0)
      • sacc[1]+=g(evals1)
      • sacc[2]+=g(2evals1evals0)
      • sacc[3]+=g(3evals12evals0)
      • sacc[d]+=g(devals1(d1)evals0)
  • Return
    sacc