|
barretenberg
|
#include <pow.hpp>
Public Member Functions | |
| PowUnivariate (FF zeta_pow) | |
| FF | univariate_eval (FF challenge) const |
| void | partially_evaluate (FF challenge) |
| Parially evaluate the polynomial in the new challenge, by updating the constant c_{l} -> c_{l+1}. Also update (ζ_{l}, ζ_{l+1}) -> (ζ_{l+1}, ζ_{l+1}^2) | |
Public Attributes | |
| FF | zeta_pow |
| FF | zeta_pow_sqr |
| FF | partial_evaluation_constant = FF(1) |
Note that
pow(X) = ∏_{0≤l<d} ((1−X_l) + X_l⋅ζ_l) is the multi-linear polynomial whose evaluation at the i-th index of the full hypercube, equals ζⁱ. We can also see it as the multi-linear extension of the vector (1, ζ, ζ², ...).
At round l, we iterate over all remaining vertices (i_{l+1}, ..., i_{d-1}) ∈ {0,1}^{d-l-1}. Let i = ∑_{l<k<d} i_k ⋅ 2^{k-(l+1)} be the index of the current edge over which we are evaluating the relation. We define the edge univariate for the pow polynomial as powˡᵢ( X_l ) and it can be represented as:
powˡᵢ( X_{l} ) = pow( u_{0}, ..., u_{l-1}, X_{l}, i_{l+1}, ..., i_{d-1}) = ∏_{0≤k<l} ( (1-u_k) + u_k⋅ζ_k ) ⋅( (1−X_l) + X_l⋅ζ_l ) ∏_{l<k<d} ( (1-i_k) + i_k⋅ζ_k ) = c_l ⋅ ( (1−X_l) + X_l⋅ζ^{2^l} ) ⋅ ∏_{l<k<d} ( (1-i_k) + i_k⋅ζ^{2^k} ) = c_l ⋅ ( (1−X_l) + X_l⋅ζ^{2^l} ) ⋅ ζ^{ ∑_{l<k<d} i_k ⋅ 2^k } = c_l ⋅ ( (1−X_l) + X_l⋅ζ^{2^l} ) ⋅(ζ^2^{l+1})^{ ∑_{l<k<d} i_k ⋅ 2^{k-(l+1)} } = c_l ⋅ ( (1−X_l) + X_l⋅ζ^{2^l} ) ⋅ζ_{l+1}^{i}
This is the pow polynomial, partially evaluated in (X_{0}, ..., X_{l-1}) = (u_{0}, ..., u_{l-1}), at the index 0 ≤ i < 2^{d-l-1} of the dimension-{d-l-1} hypercube.
We want to check that P(i)=0 for all i ∈ {0,1}^d. So we use Sumcheck over the polynomial P'(X) = pow(X)⋅P(X). The claimed sum is 0 and is equal to ∑_{i ∈ {0,1}^d} pow(i)⋅P(i) = ∑_{i ∈ {0,1}^d} ζ^{i}⋅P(i) If the Sumcheck passes, then with it must hold with high-probability that all P(i) are 0.
The trivial implementation using P'(X) directly would increase the degree of our combined relation by 1. Instead, we exploit the special structure of pow to preserve the same degree.
In each round l, the prover should compute the univariate polynomial for the relation defined by P'(X) S'ˡ(X_l) = ∑_{ 0 ≤ i < 2^{d-l-1} } powˡᵢ( X_l ) Sˡᵢ( X_l ) . = ∑_{ 0 ≤ i < 2^{d-l-1} } [ ζ_{l+1}ⁱ⋅( (1−X_l) + X_l⋅ζ_l )⋅c_l ]⋅Sˡᵢ( X_l ) = ( (1−X_l) + X_l⋅ζ_l ) ⋅ ∑_{ 0 ≤ i < 2^{d-l-1} } [ c_l ⋅ ζ_{l+1}ⁱ ⋅ Sˡᵢ( X_l ) ] = ( (1−X_l) + X_l⋅ζ_l ) ⋅ ∑_{ 0 ≤ i < 2^{d-l-1} } [ c_l ⋅ ζ_{l+1}ⁱ ⋅ Sˡᵢ( X_l ) ]
If we define Tˡ( X_l ) := ∑_{0≤i<2ˡ} [ c_l ⋅ ζ_{l+1}ⁱ ⋅ Sˡᵢ( X_l ) ], then Tˡ has the same degree as the original Sˡ( X_l ) for the relation P(X) and is only slightly more expensive to compute than Sˡ( X_l ). Moreover, given Tˡ( X_l ), the verifier can evaluate S'ˡ( u_l ) by evaluating ( (1−u_l) + u_l⋅ζ_l )Tˡ( u_l ). When the verifier checks the claimed sum, the procedure is modified as follows
Init:
Round 0≤l<d-1:
Final round l=d-1:
|
inline |
Parially evaluate the polynomial in the new challenge, by updating the constant c_{l} -> c_{l+1}. Also update (ζ_{l}, ζ_{l+1}) -> (ζ_{l+1}, ζ_{l+1}^2)
| challenge | l-th verifier challenge u_{l} |