In the previous chapters, we studied the Number Theoretic Transform (NTT), which evaluates a polynomial at its -th roots of unity. It can be understood as transforming a polynomial from its coefficient form into its point-value form.
The NTT can be performed by multiplying the coefficient vector of a degree- polynomial by a Vandermonde matrix, with time complexity . It is also possible, and more interesting, to use a fast and recursive version of the transformation, which reduces the time complexity to .
In this chapter, we begin the study of the inverse transformation of the NTT, called the Inverse Number Theoretic Transform, or INTT. It can be used to convert a polynomial from its point-valu form back to its coefficient form. This process is called interpolation.
In our article on Lagrange interpolation, we have already seen a method to perform interpolation. The difference between using Lagrange interpolation and the Inverse Number Theoretic Transform is twofold: Lagrange interpolation can be performed from any set of points, while the INTT can only be performed on the set of -th roots of unity. Conversely, Lagrange interpolation always has time complexity , while the INTT can be performed in time complexity .
In this chapter, we will:
- Recall how evaluation can be performed using a Vandermonde matrix;
- Propose an inverse transformation that is also perfomed using a Vandermonde matrix;
- Show that this inverse transformation undoes the original transformation. In other words, we show that evaluation through NTT, followed by interpolation through INTT, returns the polynomial to its original coefficient form.
For now, we will work with the INTT for a polynomial of degree so that the reader can more easily follow the calculations.
In a subsequent chapter, we will prove that the proposed inverse transformation applies to polynomials of any degree.
Consider the polynomial
To convert this polynomial from coefficient form to point-value form, it is necessary to evaluate it at least at points.
For example, if the set represents the evaluation points, where is a primitive th root of unity, the evaluations at these points are given by:
This can be expressed by the following matrix multiplication:
where is called a Vandermonde Matrix, and is the column vector representing the coefficients. You may refer to the article on Vandermonde Matrices to learn about them in detail. A Vandermonde matrix has the property that each of its rows forms a geometric progression, which is a sequence of numbers in which each term is obtained by multiplying the previous one by a constant ratio.
In the matrix above, we can note that:
- 1st row: first term: , common ratio:
- 2nd row: first term: , common ratio:
- 3rd row: first term: , common ratio:
- 4th row: first term: , common ratio:
Let us recall how the multiplication gives the evaluations of :
If we carry out the matrix multiplication of in a row-wise manner, we obtain:
Therefore, we obtain:
Thus, if we are given the coefficient form of a polynomial, represented by the vector , we can obtain its point-value form, represented by the vector , by left-multiplying by the Vandermonde matrix .
But what if we are given the evaluations instead, that is, the vector , and are asked to compute the coefficients, that is, the vector ?
This can be done using the inverse of the Vandermonde matrix , denoted by , through the following operation:
Our claim is that the matrix is given by
Observe that also has the property that each of its rows forms a geometric progression:
- 1st row: first term: , common ratio:
- 2nd row: first term: , common ratio:
- 3rd row: first term: , common ratio:
- 4th row: first term: , common ratio:
Therefore, the inverse of the Vandermonde matrix in this case is itself another Vandermonde matrix.
In the following sections, we will show that our claim is true in this example using the -th roots of unity. In the subsequent chapter, we will prove it in general.
We will prove that, in the case of -th roots of unity, when the NTT is realized using the following Vandermonde matrix,
the inverse matrix can be obtained by replacing each power of with and dividing by a factor of , as follows
The inverse Vandermonde matrix, when multiplied by the vector of evaluations of a given polynomial at the roots of unity, returns the coefficient vector of that polynomial.
Evaluating
To demonstrate that the matrix multiplication between and gives us back the coefficient vector , let us use our earlier example, where , and .
Recall that , the vector of evaluations of at the points in , is given by:
Let us perform the matrix multiplication between and :
We aim to show that the vector obtained from the above matrix multiplication is equal to the coefficient vector of .
Substituting the evaluations and from the vector , we can compute the coefficients as:
We now show that the vectors and are equal. In other words, we want to show that
Calculating the coefficients and
Let us carry out the matrix multiplication row by row on the right-hand side (RHS) to see how the corresponding coefficients on the left-hand side (LHS) are obtained. For the coefficient , we take the dot product of the first row of with the vector :
Recall from the previous chapter that, since is a primitive -th root of unity, the sum
is equal to zero whenever is not a multiple of . Explicitly,
For a detailed look at this concept, please refer to the article on Orthogonality of Roots of Unity.
By substituting values of that are not multiples of , we obtain the following identities:
Therefore, all terms multiplying , , and vanish, leaving
Similarly, to compute
, we take the dot product of the second row of with :
Substituting the expressions for the evaluations and , we get,
Grouping the terms to get the factors of and yields
Again, the terms within the parentheses associated with the factors of vanish, leaving
Try expanding the multiplication for and on your own and observe how they simplify according to the same logic we have used above. You will find that and , as expected.
This completes the demonstration that . With this, we have shown that the inverse of the Vandermonde matrix for the case is also a Vandermonde matrix. The case for a general value of will be proved in the subsequent chapter.
This article is part of a series on the Number Theoretic Transform in our ZK Book