The Sum-check Protocol #
We define the sum-check protocol as a series of Interactive Oracle Reductions (IORs), where the
underlying polynomials are represented using Mathlib's noncomputable types Polynomial
and
MvPolynomial
.
Other files will deal with implementations of the protocol, and we will prove that those implementations derive security from that of the abstract protocol.
Protocol Specification #
The sum-check protocol is parameterized by the following:
R
: the underlying ring (for soundness, required to be finite and a domain)n + 1 : ℕ+
: the number of variables (also number of rounds)deg : ℕ
: the individual degree bound for the polynomialD : Fin m ↪ R
: the set ofm
evaluation points for each variable (for somem
), represented as an injectionFin m ↪ R
. The image ofD
as a finite subset ofR
is written asFinset.univ.map D
.oSpec : OracleSpec ι
: the set of underlying oracles (e.g. random oracles) that may be needed for other reductions. However, the sum-check protocol does not use any oracles.
The sum-check relation has no witness. The statement for the i
-th round,
where i : Fin (n + 2)
, contains:
target : R
, which is the target value for sum-checkchallenges : Fin i → R
, which is the list of challenges sent from the verifier to the prover in previous rounds
There is a single oracle statement, which is:
poly : MvPolynomial (Fin (n + 2)) R
, the multivariate polynomial that is summed over
The sum-check relation for the i
-th round checks that:
∑ x ∈ (univ.map D) ^ᶠ (n + 1 - i), poly ⸨challenges, x⸩ = target
.
Note that the last statement (when i = n
) is the output statement of the sum-check protocol.
For i = 0, ..., n
, the i
-th round of the sum-check protocol consists of the following:
The prover sends a univariate polynomial
pᵢ ∈ R⦃≤ deg⦄[X]
of degree at mostdeg
. If the prover is honest, then we have:pᵢ(X) = ∑ x ∈ (univ.map D) ^ᶠ (n - i), poly ⸨X ⦃i⦄, challenges, x⸩
.
Here, poly ⸨X ⦃i⦄, challenges, x⸩
is the polynomial poly
evaluated at the concatenation of the
prior challenges challenges
, the i
-th variable as the new indeterminate X
, and the rest of
the values x ∈ (univ.map D) ^ᶠ (n - i)
.
In the oracle protocol, this polynomial pᵢ
is turned into an oracle for which the verifier can
query for evaluations at arbitrary points.
The verifier then sends the
i
-th challengerᵢ
sampled uniformly at random fromR
.The (oracle) verifier then performs queries for the evaluations of
pᵢ
at all points in(univ.map D)
, and checks that:∑ x in (univ.map D), pᵢ.eval x = target
.If the check fails, then the verifier outputs
failure
.Otherwise, it outputs a statement for the next round as follows:
target
is updated topᵢ.eval rᵢ
challenges
is updated to the concatenation of the previous challenges andrᵢ
Notes & TODOs #
An annoying issue is that we need to index over i : Fin (n + 2)
, not i : Fin (n + 1)
. This is
because existing Fin
functions works better with n + 1
which is clearly positive, and not
i : Fin (n + 1)
(which would imply n > 0
, but this fact is not apparent).
Note that to represent sum-check as a series of IORs, we will need to implicitly constrain the
degree of the polynomials via using subtypes, such as Polynomial.degreeLE
and
MvPolynomial.degreeOf
. This is because the oracle verifier only gets oracle access to evaluating
the polynomials, but does not see the polynomials in the clear.
When this is compiled to an interactive proof, the corresponding polynomial commitment schemes will enforce that the declared degree bound holds, via letting the (non-oracle) verifier perform explicit degree checks.
There are some generalizations that we could consider later:
Generalize to
degs : Fin (n + 2) → ℕ
anddomain : Fin (n + 2) → (Fin m ↪ R)
, e.g. can vary the degree bound and the summation domain for each variableGeneralize the challenges to come from a suitable subset of
R
(e.g. subtractive sets), and not necessarily the whole domain. This is used in lattice-based protocols.Sumcheck over modules instead of just rings. This will require extending
MvPolynomial
to have such a notion of evaluation, something likeevalModule (x : σ → M) (p : MvPolynomial σ R) : M
, where we have[Module R M]
.
References #
[JACM:LFKN92]
[C:BooChiSot21]
Equations
- Sumcheck.Spec.Simpler.InputOracleStatement R d x✝ = ↥(Polynomial.degreeLE R ↑d)
Instances For
Equations
- Sumcheck.Spec.Simpler.OutputOracleStatement R d x✝ = ↥(Polynomial.degreeLE R ↑d)
Instances For
Equations
- Sumcheck.Spec.Simpler.inputRelation R d D (target, oStmt) x✝ = (∑ x ∈ Finset.map D Finset.univ, Polynomial.eval x ↑(oStmt ()) = target)
Instances For
Equations
- Sumcheck.Spec.Simpler.outputRelation R d (chal, oStmt) x✝ = (Polynomial.eval chal ↑(oStmt (Sum.inl ())) = Polynomial.eval chal ↑(oStmt (Sum.inr ())))
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Sumcheck.Spec.Simpler.reduction R d D = { prover := Sumcheck.Spec.Simpler.prover R d, verifier := Sumcheck.Spec.Simpler.verifier R d D }
Instances For
Equations
Equations
Equations
- Sumcheck.Spec.OracleStatement R n deg x✝ = ↥(MvPolynomial.restrictDegree (Fin (n + 1)) R deg)
Instances For
The sum-check relation for the i
-th round, for i ≤ n
Equations
- One or more equations did not get rendered due to their size.
Instances For
Protocol specification for the i
-th round of the sum-check protocol
Consists of a message from prover to verifier of degree at most deg
, and a message
from verifier to prover of a field element in R
.
Equations
- Sumcheck.Spec.pSpec R deg = ![(Direction.P_to_V, ↥(Polynomial.degreeLE R ↑deg)), (Direction.V_to_P, R)]
Instances For
Recognize that the (only) message from the prover to the verifier has type R⦃≤ deg⦄[X]
, and
hence can be turned into an oracle for evaluating the polynomial
Equations
Recognize that the challenge from the verifier to the prover has type R
, and hence can be
sampled uniformly at random
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Prover input for the i
-th round of the sum-check protocol, where i < n
Equations
- Sumcheck.Spec.proverIn R n deg i = { input := fun (x : Sumcheck.Spec.Statement R n i.castSucc × ((i : Fin 1) → Sumcheck.Spec.OracleStatement R n deg i)) (x_1 : Unit) => x }
Instances For
Auxiliary lemma for proving that the polynomial sent by the honest prover is of degree at most
deg
Prover interaction for the i
-th round of the sum-check protocol, where i < n
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Since there is no witness, the prover's output for each round i < n
of the sum-check protocol
is trivial
Equations
- Sumcheck.Spec.proverOut R n deg i = { output := fun (x : (Sumcheck.Spec.proverState R n deg i).PrvState (Fin.last 2)) => (x, ()) }
Instances For
The overall prover for the i
-th round of the sum-check protocol, where i < n
. This is only
well-defined for n > 0
, since when n = 0
there is no protocol.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The (non-oracle) verifier of the sum-check protocol for the i
-th round, where i < n + 1
Equations
- One or more equations did not get rendered due to their size.
Instances For
The oracle verifier for the i
-th round, where i < n + 1
Equations
- One or more equations did not get rendered due to their size.
Instances For
The sum-check reduction for the i
-th round, where i < n
and n > 0
Equations
- Sumcheck.Spec.reduction R n deg D oSpec i = { prover := Sumcheck.Spec.prover R n deg D oSpec i, verifier := Sumcheck.Spec.verifier R n deg D oSpec i }
Instances For
The sum-check oracle reduction for the i
-th round, where i < n
and n > 0
Equations
- Sumcheck.Spec.oracleReduction R n deg D oSpec i = { prover := Sumcheck.Spec.prover R n deg D oSpec i, verifier := Sumcheck.Spec.oracleVerifier R n deg D oSpec i }
Instances For
The oracle verifier does the same thing as the non-oracle verifier
Completeness theorem for sumcheck
State function for round-by-round soundness
Equations
- One or more equations did not get rendered due to their size.
Instances For
Trivial extractor since witness is Unit
Equations
- Sumcheck.Spec.rbrExtractor i x✝² x✝¹ x✝ = ()
Instances For
We give the type signature & security guarantees for the whole sum-check protocol (so that we could use it for other oracle reductions, e.g. Spartan, without needing to prove security of sum-check first)
Equations
- Sumcheck.Spec.Combined.pSpec R n deg i = if i % 2 = 0 then (Direction.P_to_V, ↥(Polynomial.degreeLE R ↑deg)) else (Direction.V_to_P, R)
Instances For
Equations
- Sumcheck.Spec.Combined.instToOracleMessagePSpec R n deg ⟨i, hDir⟩ = if h : i % 2 = 0 then ⋯.mpr inferInstance else ⋯.mpr ⋯.elim
Equations
- Sumcheck.Spec.Combined.instVCVCompatibleChallengePSpec R n deg ⟨i, hDir⟩ = if h : i % 2 = 0 then ⋯.mpr ⋯.elim else ⋯.mpr inferInstance
Equations
Instances For
Equations
- Sumcheck.Spec.Combined.OStmtIn R n deg x✝ = ↥(MvPolynomial.restrictDegree (Fin (n + 1)) R deg)
Instances For
Equations
Instances For
Equations
- Sumcheck.Spec.Combined.StmtOut R n = (R × (Fin (n + 1) → R))
Instances For
Equations
- Sumcheck.Spec.Combined.OStmtOut R n deg x✝ = ↥(MvPolynomial.restrictDegree (Fin (n + 1)) R deg)
Instances For
Equations
Instances For
Equations
- Sumcheck.Spec.Combined.relIn R n deg D (target, polyOracle) x✝ = (∑ x ∈ Finset.map D Finset.univ ^ᶠ (n + 1), (MvPolynomial.eval (x ∘ Fin.cast ⋯)) ↑(polyOracle ()) = target)
Instances For
Equations
- Sumcheck.Spec.Combined.prover R n deg = sorry
Instances For
Equations
- Sumcheck.Spec.Combined.verifier R n deg = sorry
Instances For
Equations
- Sumcheck.Spec.Combined.reduction R n deg = { prover := Sumcheck.Spec.Combined.prover R n deg, verifier := Sumcheck.Spec.Combined.verifier R n deg }
Instances For
Perfect completeness for the (full) sum-check protocol