Permutation arguments

Definition

Given two vectors, and , the vectors and are permutations of each other if there exists a bijective mapping such that , where is defined by: A protocol (,) is a permutation argument if the protocol can be used by to prove to that two vectors in are a permutation of each other. Unlike inclusion arguments, the two vectors subject to a permutation argument must have the same length.

In the PIL context, the permutation argument between two columns and can be declared using the keyword is and using the syntax: {} is {}. where a and b do not necessarily need to be defined in same programs. like below snippet of permutation code:

include "config.pil"; 

namespace A(%N);
pol commit a, b;

{a} is {b};

namespace B(%N);
pol commit a, b;

{a} is {A.b};

A valid execution trace with the number of rows N=4, for the above example, is shown in the below table. A.a, A.b and B.a are permutations of each other.

ab
82
13
28
31

namespace A

ab
36
87
18
29

namespace B

Permutation arguments over multiple columns

Permutation arguments in PIL can be written not only over single columns but over multiple columns as well.

That is, given two subsets of committed columns and of some program(s), we can write {} in {} to denote that the rows generated by columns {} are a permutation of the rows generated by columns {}.

A natural application for this generalization is showing that a set of columns in a program is precisely a commonly known operation such as XOR, where the correct XOR operation is carried out in a distinct program (see the following example).

include "config.pil"; 

namespace Main(%N);
pol commit a, b, c;

{a,b,c} is {in1,in2,xor};

namespace XOR(%N);
pol constant in1, in2, xor;

However, the functionality is further extended by the introduction of selectors in the sense that one can still write a permutation argument even though it is not satisfied over the entire trace of a set of columns, but only over a subset.

Suppose that we are given the following execution traces:

Two Tables with Execution traces for programs A and B

Notice that columns {,,} of the program A and columns {,,} of the program B are permutations of each other only over a subset of the trace.

To still achieve a valid permutation argument over such columns, we have introduced a committed column set to 1 in rows where a permutation argument is enforced, and is 0 elsewhere.

Therefore, the permutation argument is valid only if,

  • is correctly computed, and
  • the subset of rows chosen by in both programs shows a permutation.

The corresponding PIL code of the previous programs can now be written as follows:

namespace A(4);
pol commit a, b, c;
pol commit sel;

sel {a, b, c} is B.sel {B.e, B.d, B.f};

namespace B(6);
pol commit d, e, f; 
pol commit sel;

The column should be turned on (i.e., set to 1) the same number of times in both programs. Otherwise, a permutation cannot exist between any of the columns, since the resulting vectors would be of different lengths. This allows the use of this kind of argument even if both execution traces do not contain the same amount of rows.