Try   HackMD

Checking univariate identities in linear time

By Justin Drake && Ariel Gabizon && Izaak Meckler

Let

HF be a multiplicative subgroup of order
n=2t
.
In this note, we show a method for proving univariate identities over
H
hold where the prover runs in
O(n)
time when the polynomials involved have degree
O(n)
, and the base identity is of constant degree. The most common example of such an identity is the degree 2 identity
XYZ
; namely, the Hadamard check:
fg=h
on
H
.

The typical way to do such checks is via computing a quotient, e.g.

T=(fgh)/ZH in the Hadamard case. This requires
O(nlogn)
operations.

Comparison to hyperplonk

Lately, people have been using sumcheck and multilinear polynomials to get

O(n) prover time. Our protocol nearly matches the asymptotic performance of HyperPLONK.

In general, for an identity

P of degree
d
involving
k
polynomials; the approach here will require essentially
O(nd)
evaluations of
P
from the prover, which is the same as the multilinear sumcheck approach used in HyperPLONK. In addition, however, we perform
O(n)
size
d
FFTs and a few other operations, which requires
O(n(k+dlogd))
additional field operations.

Depending on the structure of

P, the additional computation may be small enough
that a closer analysis of the concrete computation involved in both protocols would be required to determine their relative efficiencies.

Preliminaries

Denote by

HF a multiplicative subgroup of order
n=2t
.
F
is a field of prime order. Let
H
be the set of squares in
H
of size
n/2
.
Througout the note we use FFT-style decomposition of univariate polynomials.
Namely, for a polynomial
f
of degree
<d
,
we denote by
fe,fo
the unique polyonmials of degree
<d/2
such that
f(X)=fe(X2)+Xfo(X2)

We make frequent use of how this decomposition behaves under multiplication. For example, given polys

f,g, we have
(fg)e=fege+X2fogo

(fg)o=fego+foge

We make crucial use of the fact that

fe,fo can be evaluated at squares in
F
given oracle access to
f
via
fe(x2)=(f(x)+f(x))/2;fo(x2)=(f(x)f(x))/2x

Lemma:
Given polys

p,q;
p=q
on
H
iff
pe=qe
and
po=qo
on
H

proof:
Suppose that

p=q on
H
.
Using the above identity, we have that for each
aH
,
pe(a2)+apo(a2)=qe(a2)+aqo(a2)

Denote by
pe,po,qe,qo
the corresponding polynomials modulu
ZH
.
Note that this modulu operation doesn't change values on
H
. So, since
a2H
when
aH
, we have for all
aH
.
pe(a2)+apo(a2)=qe(a2)+aqo(a2)

Note that the above is an identity holding for
n
points, where the lhs and rhs have degree smaller than
n
.
Thus, we have as a polynomial identity
pe(X2)+Xpo(X2)=qe(X2)+Xqo(X2)

Note that in the above the coefficients of
pe
are the even coefficients of the lhs, and the coefficients of
qe
are the coefficients of the even powers of the rhs.
Therefore, since the above is a polynomial identity, we must have
pe=qe
.

Similarly, we can argue the above implies

po=qo.

In the other direction, assume

pe=qe, and
po=qo
on
H
.
For any
aH
, we have

p(a)=pe(a2)+apo(a2)=qe(a2)+aqo(a2)=q(a)

Basic case - a Hadamard check

Given KZG commitments to polynomials

f,g,h
of degree smaller than
n
. (In fact, we just need that their degrees are
O(n)
.)
We wish to check that
fg=h
on
H
.
We reduce this to a similar check of half the size.

  1. The prover interpolates on

    H three polynomials of deg
    <n/2

    • h0:=fegemodZH
    • h1:=fego+fogemodZH
    • h2:=fogomodZH

      Note that this can be done in
      O(n)
      operations:
      we can compute
      fe,fo,ge,go
      on any point
      a2H
      using
      the values of
      f,g
      on
      a,aH
      .
      And thus in
      O(n)
      time we can compute representations to
      h0,h1,h2

      in the Lagrange base
      L
      of
      H
      .
  2. The prover computes and sends

    KZG-commitments to
    h0,h1,h2
    .
    This can be done in
    O(n)
    G1
    operations, assuming we precompute the commitments to the basis functions in
    L
    .

  3. The prover shows that

    • he=h0+X2h2
      .
    • ho=h1
      .
      by the verifier choosing random
      αF
      and checking that
      h(α)=h0(α2)+α2h2(α2)+αh1(α2).
  4. Verifier chooses random

    rF.

  5. Prover sends commitments to

    f=fe+rfo,g=ge+rgo.

  6. Verifier checks these commitments are correct at

    γ=β2 for random
    β
    (using the fact that
    fe(γ),fo(γ)
    can be evaluated using
    f(β),f(β)
    ).

  7. The verifier computes the commitment to

    h:=h0+rh1+r2h2 from the commitments to
    h0,h1,h2
    .

  8. Prover and verifier recursively run the protocol to check that

    fg=h on
    H
    .

Efficiency:
We have

logn rounds with
O(n/2j)
prover work in round
j
, so total
O(n)

Soundness
Since

f,g,h,h0,h1,h2 are committed before
r
is chosen, the recursive check
(fe+rfo)(ge+rgo)=h0+rh1+r2h2
on
H

implies

  • fege=h0
    on
    H
  • fego+foge=h1
    on
    H
    ,
  • fogo=h2
    on
    H

as the coefficient of each power of

r must be equal on both sides.
Since we checked that
-
he=h0+X2h2
.
-
ho=h1
.
and we know that

  • (fg)e=fege+X2fogo
  • (fg)o=fego+foge

it follows that the recursive check tells us that on

H

  • (fg)e=he
  • (fg)o=ho

which from the lemma tells us that

fg=h on
H
.

General Identities

In the general case, we have committed polynomials

f1,,fk,h of degree
<n
, and we assume the prover already has their values over
H
.
We have a polynomial
P(X1,,Xk)
of total degree
d
,
and wish to show that
P(f1(a),,fk(a))=h(a),aH

We will similarly reduce to a check over

H that will look like

P(f1(a),,fk(a))=h(a)aH

For some

fi and
h
of degree
<n/2
.

To start, we need a slightly cumbersome definition.
Given

P, we define
d+1
polynomials
P0,,Pd

such that over variables
X1,,Xk,Y1,Yk,Z

P(X1+ZY1,,Xk+ZYk)=j=0dZiPj(X1,,Xk,Y1,,Yk)

For example, when

P=X1X2X3 we have

  • P0=X1X2X3
  • P1=X1X2Y3+X1Y2X3+Y1X2X3
  • P2=X1Y2Y3+Y1Y2X3+Y1X2Y3
  • P3=Y1Y2Y3
  1. The prover computes on

    H the evaluations of
    d+1
    polynomials
    h0,,hd
    of deg
    <n/2
    . Where
    hi:=Pi(f1,e,,fk,e,f1,o,,fk,o)modZH

    We claim the evaluations of the

    {hi} can be computed by
    O(nd)
    evaluations of
    P
    and
    O(n(k+dlogd))
    additional field operations.

    To that end let

    DF be a smooth domain of size at least
    d+1
    . In practice when using power-of-two size domains,
    D
    will have size equal to the smallest power of two greater than
    d
    , so size at most
    2d
    .

    • For each

      aH, we will simultaneously compute
      h0(a),,hd(a)
      :

      • Consider the univariate polynomial
        pa(Z):=P(f1,e(a)+Zf1,o(a),,fk,e(a)+Zfk,o(a))

        For each
        δD
        , compute
        pa(δ)
        . Note that since we have access to the evalutions of the
        fi,e
        and
        fi,o
        on
        H
        , the computation of
        pa(δ)
        only involves
        k
        multiplications and additions followed by an evaluation of
        P
        .
        Then perform an iFFT on those evaluations to obtain the coefficients of
        pa
        . By definition of the
        Pj
        ,
        pa(Z)
        is equal to
        j=0dZjPj(f1,e(a),,fk,e(a),f1,o(a),,fk,o(a))=j=0dhj(a)Zj

        Therefore, the coefficients of
        pa
        that we have computed are precisely
        h0(a),,hd(a)
        as desired.

    This procedure involves

    n2d evaluations of
    P
    and
    n2
    FFTs of size
    O(d)
    , which gives it the claimed efficiency.

  2. The prover computes and sends

    KZG-commitments to
    h0,h1,hd
    .
    This takes
    O(dn)
    G1
    operations, assuming we precompute the commitments to the basis functions in
    L
    .

  3. The prover shows that

    • he=i=0d/2X2ih2i(X)
      .
    • ho=i=0d/21X2ih2i+1(X)
      .
      by the verifier choosing random
      αF
      and checking that
      h(α)=i=0dαihi(α2)
  4. Verifier chooses random

    rF.

  5. For

    i[k], the Prover sends commitments to
    fi=fi,e+rfi,o
    .

  6. Verifier checks these commitments are correct at

    γ=β2 for random
    β
    (using the fact that
    fi,e,fi,o
    can be evaluated using
    fi(β),fi(β)
    ).

  7. The verifier computes the commitment to

    h:=i=0drihi from the commitments to
    {hi}
    .

  8. Prover and verifier recursively run the protocol to check that

    P(f1,,fk)=h on
    H
    .

Soundness
Similarly, to the Hadamard check case, one can check the protocol guarantees

  • P(f1,,fk)e=he
  • P(f1,,fk)o=ho

    on
    H
    .

Which from the lemma tells us that

P(f1,,fk)(a)=h(a) for all
aH
.