Arithmetization
A proof system cannot directly reason about a program. Its algebra works with field elements, so the first step in any proof is to rewrite the statement as equations over a field. This rewriting is called arithmetization, and every later step depends on its output.
This chapter takes one small computation through the whole process. We start with ordinary arithmetic, express it as a list of multiplications and linear equations, and then compress all of those equations into a single equation with one secret vector. That final equation is the form Ragu proves, and the next chapter turns it into a statement about polynomials.
1. What arithmetization produces
We continue with the running example from the previous chapter:
I know a number such that .
In the terms of that chapter, 35 is the instance and is the witness. Arithmetization has to produce a fixed set of equations, determined only by the statement's structure, such that a witness satisfies the equations exactly when the statement is true.
The equations cannot depend on the secret value, because the verifier must know them in advance. A program with an if branch therefore has to compute both branches and select one arithmetically. For example, a value is restricted to a bit by the equation , and the expression selects between and . Hash functions and signature checks reduce to field equations in the same way, with many more of them.
All arithmetic in this chapter happens in , the scalar field of the toy curve from the curves appendix. The statement is an equation in this field, though the small values in our example make it look like ordinary arithmetic.
2. Flattening a computation
The expression contains several operations at once, so we first split it into steps that each perform one operation. Each intermediate result gets its own name:
| Step | Operation | Value for |
|---|---|---|
| 1 | 9 | |
| 2 | 27 | |
| 3 | 35 |
The steps have different costs in a proof system. Step 3 is a linear combination of values we already have, and later sections show that linear combinations can be checked in bulk with a single random combination. Steps 1 and 2 multiply two unknown values, which no linear check can express. Multiplications are therefore what a proof system counts as its main cost, and we keep their number small.
3. Gates
Each multiplication becomes a gate. A circuit with gates uses three vectors , and gate requires
The entries of these vectors are called wires. Together they form the witness, which also goes by the name trace because it records one execution of the computation. In vector form, all the gates together say , where is the entrywise product.
Our computation has two multiplications, so :
| Gate | Check | |||
|---|---|---|---|---|
| 0 | 3 | 3 | 9 | |
| 1 | 9 | 3 | 27 |
4. Linear constraints
The gates alone are not enough, because they treat every wire as independent. Nothing yet says that the of gate 1 is the output of gate 0, or that the same is used everywhere. A separate set of linear constraints connects the wires and ties them to the instance. Constraint has the form
which we can write with inner products as
The vectors are public and describe the circuit. The vector is the public input vector, which holds the instance.
Our statement needs four constraints. The first three connect wires, and the last one checks the output. It moves the constant 5 to the right side, which gives the target value :
| Constraint | |||||
|---|---|---|---|---|---|
| 0 | 0 | ||||
| 1 | 0 | ||||
| 2 | 0 | ||||
| 3 | 30 |
Step 3 from Section 2 has disappeared into constraint 3 at no additional cost in gates. This is why addition is cheap here: a sum of any number of wires appears as one row of coefficients, with no new multiplication.
Ragu allows up to constraint rows, a limit that comes from the size of the polynomial holding the wiring data. Our circuit has room for 8 rows, and the four unused rows are all zeros, which any witness satisfies.
The gates and constraints together reject false statements:
Try instead. Filling in the gates gives , and , with and modulo 43. Both gates and the first three constraints hold. The last constraint gives , which is not 30, so this witness is rejected.
5. Reducing the gates to one equation
The verifier now faces gate equations and constraints, and a real circuit has thousands of each. A proof that handled every equation separately would be enormous, so we want to replace them all with one equation that still fails if any of them fails.
Let be the error of gate . The previous chapter's random linear combination does this job, with the errors as the claims and the powers of a random value as the weights:
This sum is a polynomial in with the errors as its coefficients, so it is 0 for every when all the gates hold. If any gate fails, the bound from that section applies, because the prover must fix the witness before seeing . A uniformly random then hides the failure with probability below .
For the honest witness both gate errors are 0, so the sum is 0 for every . Now take a dishonest witness with , and . It satisfies all the linear constraints above, but its gate errors are and modulo 43. At the sum is , which exposes the error. Checking all 43 values of finds 1 value that hides it, , the root of this degree-1 polynomial.
On a field of about elements, this probability is negligible. We have traded certainty for an overwhelming probability, in exchange for checking only one equation.
6. Reducing the constraints to one equation
The constraints collapse in the same way, using a second random value . Multiplying constraint by and adding gives
Inner products are linear, so we can move the powers of inside. Define the combined vectors
The equation becomes
where . The combined vectors are public once is known, so this is one linear equation in the witness.
At , the combined vectors are , and . The left side for the honest witness is modulo 43. The right side is , because only is nonzero.
We now have two equations, one quadratic in the witness and one linear. The remaining sections merge them into one equation about a single vector.
7. Reading one coefficient of a product
The merged equation needs a specific form, and the reason comes from polynomial multiplication. Take polynomials and with coefficient vectors . The coefficient of in the product is the sum of over all pairs with . For the middle exponent , this sum is
Each entry of meets the entry of at the mirrored position. This is the inner product of with the reversal of , which is called the revdot product:
Let and over . The coefficient of in collects every pair of exponents that adds to 3: modulo 43. The revdot product computes the same sum, since and . The full product has coefficients , and the entry for is the one in the middle.
So a claim about a revdot product is a claim about one coefficient of a polynomial product. This link is why Ragu writes its checks as revdot products, and the next chapter uses it to reach a polynomial test. Our goal for the rest of this chapter is to express both equations as one revdot product.
8. Arranging the witness
A gate's product has to appear in a revdot product of the witness with itself. Since revdot pairs position with position , we need to place and at mirrored positions. We also need room for the wires, whose partners must not create unwanted products.
A vector of length with four blocks of length achieves this:
The vector is an extra block of wires that we set to zero for now, so each has a partner of value 0. Reversing the block places at position , and sits at position . These two positions add up to , so they are partners. A vector with this arrangement is called a structured vector.
With , the positions and their partners are:
| Position | Entry | Value | Partner position | Partner entry |
|---|---|---|---|---|
| 0 | 9 | 7 | ||
| 1 | 27 | 6 | ||
| 2 | 9 | 5 | ||
| 3 | 3 | 4 | ||
| 4 | 3 | 3 | ||
| 5 | 3 | 2 | ||
| 6 | 0 | 1 | ||
| 7 | 0 | 0 |

Each product appears twice in the revdot sum, once from each end of the pair. With , the wires contribute nothing, so
For our witness, . Multiplying each entry by its partner and summing gives , and modulo 43.
The Ragu Book's chapters arrange the witness differently
The Ragu Book's core arithmetization chapter uses , which swaps the roles of and . Its local arithmetization chapter uses the arrangement above, and the wiring code at commit 3219e08 matches it. The two arrangements give the same products, because . This site uses the arrangement from the code.
9. Weighting each gate
The sum has lost track of which product belongs to which gate, so it cannot check the gates individually. Section 5 solved the same problem by giving each gate its own power of , and we can build this weighting into the revdot product.
Multiply entry of the second vector by . This operation is called dilation, and the result is , where . The revdot product becomes
Now we group the terms by gate. The wires and occupy positions and . Taking produces , and taking produces . The pair of wires contributes in the same way at positions and . The result is
Each gate now has its own weight, built from powers of that no other gate uses. With , the second sum vanishes.
At the powers are , so .
| Term | ||||
|---|---|---|---|---|
| 0 | 9 | 0 | 37 | 0 |
| 1 | 27 | 0 | 16 | 0 |
| 2 | 9 | 3 | 29 | 9 |
| 3 | 3 | 3 | 23 | 35 |
| 4 | 3 | 3 | 39 | 7 |
| 5 | 3 | 9 | 25 | 30 |
| 6 | 0 | 27 | 5 | 0 |
| 7 | 0 | 9 | 1 | 0 |
The last column sums to 38. The formula above gives the same value, using weights and : modulo 43.
10. Removing the output wires
The expression above contains the products , but a gate check needs the differences . We therefore have to subtract with the same weight as its gate:
This sum is linear in the witness, so it can be written as a revdot product of with a public vector . The wire sits at position , and its partner is position . Placing the desired coefficient at that partner position gives
with all other entries of equal to zero. Adding the two revdot products and using linearity gives
This expression is the gate check from Section 5 with different weights. It is zero for every when all the gates hold, and otherwise it is a nonzero polynomial in .
At , . Its two nonzero entries sit at positions 7 and 6, the partners of and . Then , and adding the dilated term gives modulo 43, as it should for a witness that satisfies its gates.
11. Encoding the constraints
The combined constraint equation from Section 6 is linear in the witness, so it fits the same pattern. We want a public vector such that equals its left side. Each wire's coefficient goes at the partner of that wire's position:
| Wire | Position in | Coefficient | Position in |
|---|---|---|---|
Filling in these entries gives for a witness that satisfies the constraints.
At , placing the vectors from Section 6 at the partner positions gives , and . This equals .
The vector contains the whole circuit structure, compressed by . The chapter on wiring and the registry studies how a verifier can check without computing it from scratch.
12. The consolidated equation
Both checks are now revdot products with the same left vector . The revdot product is linear in its second argument, so we can add them into one equation:
This is the output of arithmetization. It contains one secret vector, . Everything else depends only on the circuit, the instance, and the challenges and .
At and , the combined right vector is . Its revdot product with is 13, and . Checking the equation at all pairs confirms that the honest witness passes at every pair.
Why a false witness fails
Subtracting the right side from the left side splits the equation into two parts:
The first part depends only on , and every power of in it is at least , since for . The second part depends only on . A gate error therefore cannot cancel a constraint error for all values of the challenges, because the two parts vary independently. If either part is nonzero, the whole expression is a nonzero polynomial in of degree at most . The prover has to fix before seeing the challenges, so a random pair passes with probability at most . This bound is the two-variable Schwartz–Zippel lemma from the previous chapter.
On the toy field we can count the exact number of passing challenges for several dishonest witnesses:
| Dishonest witness | Passing pairs | Fraction | |||
|---|---|---|---|---|---|
| Gates fail, constraints hold | 172 of 1849 | 0.093 | |||
| Gates hold, last constraint fails | 43 of 1849 | 0.023 | |||
| Both fail | 40 of 1849 | 0.022 |
The bound for this circuit is , and each row falls below it.
Those rates are large only because the field has 43 elements. For on a 255-bit field, the bound falls below .
Notice that the argument depends on the challenge order. A prover who learned and before fixing could look for a witness that satisfies only this one equation. The chapter on polynomial commitments provides the tool that fixes first.
13. The arithmetization in Ragu
Reconstructed from code at commit 3219e08, not confirmed by the authors
Our toy circuit sets and moves constants into . Ragu's implementation differs in the following ways:
- Four wires per gate. The local arithmetization chapter gives each gate the two equations and . The second equation is the second sum from Section 9, which the dilation already checks. At a gate with , the wire is free to hold extra witness data.
- A wire that holds the constant 1. The circuit setup code reserves gate 0 as a system gate, with as the
ONEwire and a blinding factor in . A constraint ties this wire to the constant term of the instance. Constants such as our 5 can then appear in constraints as multiples ofONE, instead of being moved to . - Virtual wires. Ragu's
Driverinterface hasmulfor gates,enforce_zerofor constraints, andaddfor a virtual wire, which is a named linear combination of existing wires. A virtual wire adds no gate, which matches the cost of addition we saw in Section 4.
The core chapter of the Ragu Book describes the simpler form with , and this chapter follows that form for its example.
14. Comparison with R1CS and PLONK
Other proof systems make different choices at this stage. Two of them are worth knowing, and the first is needed for the next chapter.
R1CS (rank-1 constraint system) uses one vector containing the constant 1, the instance, and the witness. Three public matrices define the constraints:
Each row is one constraint that multiplies two linear combinations of and compares the result with a third. Our statement fits in three rows:
With , holding the constant 1, the public output, , and , the three matrices are
The products are and . Their entrywise product is , which equals .
R1CS and Ragu's system have the same expressive power, and each can be converted to the other with a linear increase in size. R1CS merges the wiring into its multiplication rows, while Ragu's system (called Bootle16, after its source paper) keeps gates and linear constraints apart. That separation is what makes the revdot form above possible.
PLONK uses gates with selectable coefficients, of the form , and adds separate copy constraints to connect wires. Later variants add custom gates and lookup tables that reduce the number of gates for certain operations. Ragu deliberately avoids these features. It uses a simple circuit model and splits large computations into many small circuits that communicate along the PCD tree.
15. Where this chapter leaves us
This chapter took the following steps:
- A computation becomes a list of multiplication gates and linear constraints over a field.
- Random powers of and reduce all gates and constraints to two equations, at the cost of a small failure probability.
- A revdot product corresponds to one coefficient of a polynomial product.
- A structured vector places each and at mirrored positions, and dilation by weights each gate separately.
- The public vectors and add the gate outputs and the wiring, which gives one equation.
The prover still has to convince the verifier of this equation without revealing . The next chapter starts from the R1CS form to derive the standard QAP reduction, and then uses Section 7 to reach a polynomial test for the consolidated equation.