Try   HackMD

Lookup argument for folding

Example
Assume in lookup arguments, we have two columns

(A,S), and try to lookup
AiS
. Firstly, we cannot directly fold two such instances, e.g. with random factor
r=1
:
A1=[1,1,2,3],S1=[1,2,3,4,5]A2=[1,1,1,2],S2=[1,2,3,4,5]A1+A2=[2,2,3,5],S1+S2=[2,4,6,8,10]

Obviously
(A1+A2,S1+S2)
will not work. And since the lookup is arbitrary, we probably will not have any explicit formula to make the folding of
(A,S)
work.

Attempt 1
Assume we want to calcualte a function

F:XY. Instead of writing circuit for
F
, we do lookup argument that
(x,F(x))S
. Here
S={(x,F(x))|xX}
.

Encoding: we use encoder

enc to encode
(x,F(x))
to be a field element, i.e.
A(x):=enc[x,F(x)]Fq

Now the table is
T={enc[x,F(x)]|xX}
. When we do lookup of row
x
across two columns
(x,F(x))
, we first encode as
A(x)=enc(x,F(x))
and prove
A(x)S
.

In the following, we will only consider the case that

X is closed under linear combination, i.e.
x1,x2X
, we have
x1+rx2X
. In this case, we say the table
T
is closed.

Assume we have two instances:

(A,S),
(B,S)
, where
Ai=enc[xA[i],F(xA[i])]
,
Bi=enc[xB[i],F(xB[i])]
.

We define folded instances of

A and
B
as:
Ci:=enc[xA[i]+rxB[i],F(xA[i]+rxB[i])]

Notice that table
S
is closed by our assumption, we have
CiS
. The folding prover needs to recalculate the new value
F(xA[i]+rxB[i])
.

During in folding, the prover will first fold input value

x=x1+rx2, then calculate
F(x)
and fill it into corresponding advice column.

There are

3 kinds of columns, one type is for folding (like Sangria and Nova); one type is advice column calculated by applying
F
on folded lookup key (it seems we can prove the soundness for this type); one type is fixed table column (i.e. will not change during folding). However, even this approach work, this is only suitable for hash, bit operation but not for range check (range check table is not closed).

Attempt 2
We can try to fold two instances such that the polynomial constraints below are still satisfied:

Z(ωX)(A(X)+β)(S(X)+γ)Z(x)(A(x)+β)(S(X)+γ)=0(A(X)S(X))(A(X)A(ω1X))=0

As example, let's fold the second relation. First rewrite it as:

G=AA+AAωSASAω=0
Take two instances
U1=(A1,A1,S1)
,
U2=(A2,A2,S2)
.
A=A1+rA2,A=A1+rA2,S=S1+S2G=G1+r2G2+r(2A1A2+A1A2ω+A1ωA2S1A2S2A1S1A2ωS2A1ω)=G1+r2G2+rT

Thus, we need modify the second relation as
P:=AA+AAωSASAω+E

Then the folding will stay the same format. i.e.
Fold(U1,U2)=G+E=(G1+r2G2)+(E1+r2E2+rT)