## A Naive Case
We assume the modulus $p = 17$, and folding factor $r = 2$, the first folding case would be like this:
![image.png](https://hackmd.io/_uploads/BJLpDetQa.png)
<br />
The first witness matrix $W_1$ and its error term $E_1$:
|$w_a$|$w_b$|$w_c$|$e$|
|---|---|---|---|
|1|2|2|0|
|2|3|5|0|
|2|5|10|0|
<br />
The second witness matrix $W_2$ and its error term $E_2$:
|$w_a$|$w_b$|$w_c$|$e$|
|---|---|---|---|
|2|3|6|0|
|3|4|7|0|
|6|7|8|0|
<br />
Finally we get the folding witness matrix $W_3$ and its error term $E_3$:
|$w_a$|$w_b$|$w_c$|$e$|
|---|---|---|---|
|5|8|14|15|
|8|11|2|0|
|14|2|9|1|
<br />
## Relaxed Gate Check
standard plonk wires are :
$$
[w_0, w_1, w_2, w_3, w_o, w_r]
$$
and its gate check is:
$$
q_o * w_o = q_c + pi + q_{lc_0} * w_0 + q_{lc_1} * w_1 + q_{mul_0} * w_0 * w_1 + q_{mul_1} * w_2 * w_3 + q_{ecc} * w_0 * w_1 * w_2 * w_3 * w_o
$$
<br />
relaxed plonk wires are:
$$
[w_0, w_1, w_2, w_3, w_o, \color{red}{w_e}, w_r]
$$
<br />
and its gate check is:
$$
q_o * w_o + \color{red}{q_e * w_e} = q_c + pi + q_{lc_0} * w_0 + q_{lc_1} * w_1 + q_{mul_0} * w_0 * w_1 + q_{mul_1} * w_2 * w_3 + q_{ecc} * w_0 * w_1 * w_2 * w_3 * w_o
$$
<br />
## Relaxed Arithmetic
|Number|Gate |$q_c$|$pi$|$q_{lc}$|$q_{mul}$|$q_{o}$|$q_{e}$|$q_{ecc}$|$q_{hash}$|
|---|---|---|---|---|---|---|---|---|---|
|1|ConstantGate|$\checkmark$|-|-|-|$\checkmark$|-|-|-|
|2|AdditionGate|-|-|$\checkmark$|-|$\checkmark$|-|-|-|
|3|ConstantAdditionGate|$\checkmark$|-|$\checkmark$|-|$\checkmark$|-|-|-|
|4|SubtractionGate|-|-|$\checkmark$|-|$\checkmark$|-|-|-|
|5|MultiplicationGate|-|-|-|$\checkmark$|$\checkmark$|$\checkmark$|-|-|
|6|ConstantMultiplicationGate|-|-|-|$\checkmark$|$\checkmark$|-|-|-|
|7|BoolGate|-|-|-|$\checkmark$|$\checkmark$|$\checkmark$|-|-|
|8|EqualityGate|-|-|$\checkmark$|-|$\checkmark$|-|-|-|
|9|IoGate|-|$\checkmark$|-|-|$\checkmark$|-|-|-|
|10|FifthRootGate|-|-|-|-|$\checkmark$|$\checkmark$|-|$\checkmark$|
|11|QuadPolyGate|$\checkmark$|-|$\checkmark$|$\checkmark$|$\checkmark$|$\checkmark$|-|-|
|12|LinCombGate|-|-|$\checkmark$|-|$\checkmark$|-|-|-|
|13|MulAddGate|-|-|-|$\checkmark$|$\checkmark$|$\checkmark$|-|-|
|14|CondSelectGate|-|-|$\checkmark$|$\checkmark$|$\checkmark$|$\checkmark$|-|-|