Appearance
Permutation Argument and Copy constraints
Recall our discussion on the recursive constraints
Exercise 14
Compute a dictionary encoding a permutation over the three columns
python
sigma = {}
#First input
sigma[1] = 1
#First cycle
sigma[2] = 5
sigma[5] = 2
#Solve here!
If implemented correctly, your permutation should pass the following checks.
python
print("Length should be 12:", len(sigma) == 12)
print("There should be no repeated elements in the domain:", len(set(sigma.keys())) == 12 )
print("Both the image and domain should be the indexes from 1 to 12", set(sigma.keys()) == set(range(1,13)) == set(sigma.values()))
print("The cycle (3,4+2,8+1) should be in sigma:" , sigma[3] == 4+2 and sigma[4+2] == 8+1 and sigma[8+1] == 3)
The mathematical property we want to check for a given function
If this holds, we know that all values in our equivalence classes are equal. We can in fact check this for our permutation
python
def get_wire_value(pos):
if 1 <= pos <= n: # column a
return a(ω**pos)
elif n+1 <= pos <= 2*n: # column b
return b(ω**(pos - n))
elif 2*n+1 <= pos <= 3*n: # column c
return c(ω**(pos - 2*n))
for i in range(1, 3*n + 1):
assert get_wire_value(i) == get_wire_value(sigma[i])
Now the question is, how does the prover convince the verifier that this holds without sharing all intermediate computation values?
One simple way to achieve this is to run the equality testing protocol for:
over the domain
python
a(b)
Instead, we are going to introduce a new protocol to approach this check in an efficient way. Fundamentally, what we want to do is to capture the "for all" quantifier where we check