How to convert a linear vector to a polynomial using Lagrangian interpolation?

321 Views Asked by At

I'm trying to understand this article by Vitalik Butarin on conversion to QAPs as a pre-requisite to understanding zk-SNARKS.

However, I seem to have hit a dead-end when he says to convert a vector into its corresponding polynomial. I am able to follow the example he gives before that, but I haven't been able to apply that to this problem.

To quote:

Now, let’s use Lagrange interpolation to transform our R1CS. What we are going to do is take the first value out of every a vector, use Lagrange interpolation to make a polynomial out of that (where evaluating the polynomial at i gets you the first value of the ith a vector), repeat the process for the first value of every b and c vector, and then repeat that process for the second values, the third, values, and so on.

If I am following this correctly, he is trying to convert the vector $\begin{bmatrix} 0 & 0 & 0 & 5\end{bmatrix}$ to a polynomial $0.833 x^3 - 5x^2 + 9.166x - 5$ as he says later).

How did he reach this polynomial? The example only talks about $2$-D vectors. How can that be applied to a $1$-D vector? I tried by assuming the first vector as $x$ a corresponding $0$-vector $y$ ($\begin{bmatrix} 0 & 0 & 0 & 0\end{bmatrix}$), but that doesn't seem to work either.

I will appreciate any input you have.

1

There are 1 best solutions below

2
On BEST ANSWER

It interpolates the following points: $(1,0), (2,0), (3,0), (4,5)$ and the interpolation polynomial is

$$\frac{5}{6}x^3-5x^2+\frac{55}{6}x-5.$$