Q. Explain how QAP's Lagrange interpolation converts R1CS's matrix columns into polynomials.
Imagine you have an R1CS system with several constraints and several variables. Each matrix, A, B, and C, contains numbers that describe how each variable participates in each constraint. QAP uses Lagrange interpolation to turn these matrix columns into polynomials. Think of each column as a list of numbers, one number for each constraint. For example, if a column contains the values [2, 4, 6], we can create a polynomial that passes through three corresponding points, such as (1, 2), (ω, 4), and (ω², 6). Lagrange interpolation gives us the unique polynomial of degree less than the number of constraints that passes through all those points. We do this for every column, creating one polynomial for each variable. Then, we multiply each of these polynomials by the corresponding value in the witness vector z and add them together. This produces one combined polynomial, A(x), representing the entire A matrix evaluated using the witness. We do the same for B(x) and C(x). Now, instead of checking every R1CS constraint separately, we calculate A(x) × B(x) − C(x). If the witness is valid, this polynomial will evaluate to zero at every point in our chosen evaluation domain, meaning every original R1CS constraint is satisfied. A polynomial that is zero at all these points must be divisible by a special polynomial called the vanishing polynomial, Z(x), which is constructed to be zero exactly at those points. In simple terms, QAP transforms many individual R1CS equations into one polynomial equation, making it possible to use polynomial-based cryptographic techniques to create a proof.