Arithmetic circuits
import gkr
env = gkr.init(verbose=False)
from gkr.ac import ArithmeticCircuit
Introduction ¶ Through our sum-check protocol and multilinear extensions notebooks, we have started to replicate Thaler’s elegant presentation 1 of the GKR interactive proof for circuit evaluation, as introduced by Goldwasser, Kalai, and Rothblum 2 3 . We are nearly ready to present the GKR protocol in full, but before we do, there’s one final topic to address: arithmetic circuits.
Modeling computations ¶ An arithmetic circuit is defined as a special kind of directed graph, which is assumed to be familiar to the reader.
An arithmetic circuit C C C over a field F \mathbb{F} F in the variables X = { x 0 , … , x n − 1 } X = \{x_0, \ldots, x_{n-1}\} X = { x 0 , … , x n − 1 } is a labeled directed acyclic multigraph (DAG). The nodes of this graph are called gates , and the edges are called wires .
Input gates are gates with fan-in (in-degree) zero, labeled by variables from X X X or constants from F \mathbb{F} F .
Output gates are gates with fan-out (out-degree) zero, where the output of the circuit is computed.
Non-input gates are either addition gates , labeled with the addition operation (+ + + ), or multiplication gates , labeled with the multiplication operation (× \times × ). These gates compute the sum or product of the polynomials computed on the tails of the incoming wires. Subtraction can be represented by multiplication with the constant -1 (i.e., using ( x − y ) = x + ( − 1 ) ⋅ y (x - y) = x + (-1) \cdot y ( x − y ) = x + ( − 1 ) ⋅ y ).
The output of C C C is the polynomial (or set of polynomials) computed at the output gate(s).
The size S S S of C C C is the total number of gates in the graph, and the depth d d d of C C C is the length of the longest path from an input gate to an output gate.
Layer i i i of C C C is a set of all gates v v v such that the shortest path from v v v to any output gate has length i i i . We index layers starting from the output layer (Layer 0), increasing as we move toward the inputs. This convention is convenient for top-down verification in the GKR protocol.
We say that C C C is a constant-input circuit if:
We say that C C C is a binary arithmetic circuit if:
We say that C C C is a strictly layered arithmetic circuit if:
All inputs are in Layer d d d , and every wire is a wire from a gate in Layer i + 1 i + 1 i + 1 to a gate in Layer i i i , for some i ∈ { 0 , 1 , … , d − 1 } i \in \{0,1,\ldots,d - 1\} i ∈ { 0 , 1 , … , d − 1 } , where d d d is the depth of the circuit.
Throughout, we will assume that all of our arithmetic circuits are constant-input , binary and strictly layered .
Under the constant-input restriction, the circuit computes a constant polynomial. We adopt this model because, in the GKR protocol, verification concerns the correctness of gate evaluations rather than symbolic polynomial computation. Allowing variable-labeled inputs would require only notational changes and does not affect the protocol.
The binary fan-in assumption ensures that wiring predicates depend on exactly two child gates, which will be essential when defining the verification equations in later sections.
The strictly layered assumption is made primarily for conceptual and notational simplicity. In the GKR protocol, verification proceeds layer by layer, with each round reducing correctness of one layer to a polynomial identity checked via sum-check. Strict layering ensures that all dependencies are local to adjacent layers, yielding uniform wiring predicates and a clean inductive structure. This assumption is not restrictive. Any arithmetic circuit can be transformed into a strictly layered circuit by inserting identity gates, with at most polynomial overhead. The protocol and its soundness guarantees extend to general circuits after such a normalization.
Consider evaluating the expressions ( 2 + 2 ) × ( 3 × 3 ) (2 + 2) \times (3 \times 3) ( 2 + 2 ) × ( 3 × 3 ) and 3 × 4 + ( 5 + 5 ) 3 \times 4 + (5 + 5) 3 × 4 + ( 5 + 5 ) in the field F = Z / 11 Z \mathbb{F} = \mathbb{Z}/11\mathbb{Z} F = Z /11 Z . The following circuit of size S = 10 S = 10 S = 10 and depth d = 2 d = 2 d = 2 illustrates one way to perform this computation:
Layer 0 (output layer) : The top layer contains the two gates labeled × \times × and + + + .
Layer 1 (intermediate layer) : The middle layer contains four gates labeled + + + , × \times × , × \times × , and + + + .
Layer 2 (input layer) : The bottom layer contains four gates labeled 2, 3, 4, and 5. (Although the number 3 appears only once as an input gate, it has fan-out three: its value is used as an input to two multiplication operations via three outgoing wires.)
In this structure:
Every input gate is labeled with a constant from F \mathbb{F} F . This is a constant-input circuit.
Every gate in layers 0 and 1 has a fan-in of 2 (representing a binary operation, either addition or multiplication). This is a binary circuit.
All inputs are in Layer 2: no inputs are in Layer 0 or Layer 1. Also, wires only connect consecutive layers: from Layer 2 to Layer 1, and from Layer 1 to Layer 0. No wires connect gates within the same layer, non-consecutive layers, or consecutive layers in the ‘low to high’ (e.g. 1 to 2) direction. This is a strictly layered circuit.
For example:
The two wires from the gate labeled 2 enter the leftmost gate in Layer 1 labeled + + + , representing the subexpression 2 + 2 2 + 2 2 + 2 .
Similarly, the gates in Layer 1 compute the subexpressions 3 × 3 3 \times 3 3 × 3 , 3 × 4 3 \times 4 3 × 4 , and 5 + 5 5 + 5 5 + 5 in parallel.
Next, in Layer 1, we evaluate:
2 + 2 ≡ 4 m o d 11 2 + 2 \equiv 4 \bmod 11 2 + 2 ≡ 4 mod 11 ,
3 × 3 ≡ 9 m o d 11 3 \times 3 \equiv 9 \bmod 11 3 × 3 ≡ 9 mod 11 ,
3 × 4 ≡ 1 m o d 11 3 \times 4 \equiv 1 \bmod 11 3 × 4 ≡ 1 mod 11 ,
5 + 5 ≡ 10 m o d 11 5 + 5 \equiv 10 \bmod 11 5 + 5 ≡ 10 mod 11 .
Finally, the output layer computes:
4 × 9 ≡ 3 m o d 11 4 \times 9 \equiv 3 \bmod 11 4 × 9 ≡ 3 mod 11 ,
1 + 10 ≡ 0 m o d 11 1 + 10 \equiv 0 \bmod 11 1 + 10 ≡ 0 mod 11 .
Thus, the circuit computes two expressions through six binary operations performed in two stages, holding four field elements in memory at each stage.
expression_01a = '(2 + 2)*(3*3)'
expression_01b = '3*4 + (5 + 5)'
ac_01 = ArithmeticCircuit(expression_01a, expression_01b, prime=11)
print(f"{expression_01a} mod {ac_01.field.mod}, {expression_01b} mod {ac_01.field.mod}")
display(ac_01.graphviz_circuit)
print(f"This circuit has size S = {ac_01.size} and depth d = {ac_01.depth}.")(2 + 2)*(3*3) mod 11, 3*4 + (5 + 5) mod 11
This circuit has size S = 10 and depth d = 2.
Topological ordering ¶ An arithmetic circuit cannot have cycles because it represents a well-defined, finite computation. They are designed to compute polynomials in a finite number of steps. If a cycle existed, it would be unclear where to start, and the computation would never terminate. For example, the cycle below results in the expression 2 + ( 3 × ( 2 + ( 3 × ⋯ ) ) ) 2 + (3 \times (2 + ( 3 \times \cdots ))) 2 + ( 3 × ( 2 + ( 3 × ⋯ ))) (or 3 × ( 2 + ( 3 × ( 2 + ⋯ ) ) ) 3 \times (2 + (3 \times ( 2 + \cdots ))) 3 × ( 2 + ( 3 × ( 2 + ⋯ ))) ), which is ambiguous and infinite, making it meaningless. Arithmetic circuits are acyclic to ensure that each operation is performed in a clear, finite sequence.
from graphviz import Digraph
# Non-DAG example
dot = Digraph()
dot.node('2', '2', shape='circle')
dot.node('+', '+', shape='circle')
dot.node('3', '3', shape='circle')
dot.node('×', '×', shape='circle')
dot.edge('2', '+')
dot.edge('+', '3')
dot.edge('3', '×')
dot.edge('×', '2')
dot.attr(rankdir='LR')
display(dot)A topological ordering (or topological sort ) of a directed graph is a linear ordering of its vertices such that, for every directed edge from vertex u u u to vertex v v v , vertex u u u appears before vertex v v v in the ordering. In other words, the ordering respects the direction of the edges.
More formally:
Given a directed acyclic graph (DAG) G = ( V , E ) G = (V, E) G = ( V , E ) , a topological ordering of the vertices V V V is a linear sequence v 0 , v 1 , … , v n − 1 v_0, v_1, \ldots, v_{n-1} v 0 , v 1 , … , v n − 1 such that for every directed edge ( v i , v j ) ∈ E (v_i, v_j) \in E ( v i , v j ) ∈ E , it holds that i < j i < j i < j , meaning that vertex v i v_i v i appears before vertex v j v_j v j in the ordering.
Since an arithmetic circuit is acyclic, a topological order of its nodes allows us to evaluate the circuit in a sequence where each node (operation) depends only on previously evaluated nodes. This ensures that each computation is performed in a clear, finite order, starting from the input nodes and progressing through intermediate gates to the output nodes. Without a valid topological order, cycles would create circular dependencies, preventing the circuit from being evaluated at all. Therefore, topological ordering guarantees that the computation proceeds in a finite, unambiguous manner.
display(ac_01.layers)
print("")
display(ac_01.graphviz_circuit_bitstring)
print("")
ac_01.print_topological_order(){0: {'0.0', '0.1'},
1: {'1.00', '1.01', '1.10', '1.11'},
2: {'2.00', '2.01', '2.10', '2.11'}}
2.00 -> 2.01 -> 2.10 -> 2.11 -> 1.00 -> 1.01 -> 1.10 -> 1.11 -> 0.0 -> 0.1
Gate-value functions ¶ A gate-value function is a function that records the values computed by all gates in a given layer of an arithmetic circuit, where gates are indexed by their binary identifiers. We formalize this notion below.
Let C C C be an arithmetic circuit of depth d d d . For 0 ≤ i ≤ d 0 \le i \le d 0 ≤ i ≤ d , let S i S_i S i denote the number of gates in Layer i i i , and let s i s_i s i be the smallest integer such that S i ≤ 2 s i S_i \leq 2^{s_i} S i ≤ 2 s i . We refer to S i S_i S i as the size of Layer i i i , and s i s_i s i as the bit length of Layer i i i . A bit labeling of the gates in Layer i i i assigns each gate a unique bitstring of length s i s_i s i , corresponding to the binary representation of its index in the layer. If b ∈ { 0 , 1 } s i \mathbf{b} \in \{0,1\}^{s_i} b ∈ { 0 , 1 } s i , we refer to the gate in Layer i i i labeled by b \mathbf{b} b as gate b \mathbf{b} b .
In the degenerate case where S i = 1 S_i = 1 S i = 1 and s i = 0 s_i = 0 s i = 0 , a bit labeling assigns the only gate, which has index 0, to the empty string ( ) () ( ) . This will be the case in Layer 0 of a circuit with a single output. More formally, a bit labeling is a map ℓ : { 0 , … , S i − 1 } → { 0 , 1 } s i \ell : \{0, \ldots, S_i - 1\} \to \{0,1\}^{s_i} ℓ : { 0 , … , S i − 1 } → { 0 , 1 } s i . When S i = 1 S_i = 1 S i = 1 and s i = 0 s_i = 0 s i = 0 , we interpret { 0 , 1 } s i \{0,1\}^{s_i} { 0 , 1 } s i as the singleton set whose only element is the empty set. In this case, ℓ : { 0 } → { ∅ } \ell : \{0\} \to \{\emptyset\} ℓ : { 0 } → { ∅ } maps 0 to ℓ ( 0 ) = ∅ \ell(0) = \emptyset ℓ ( 0 ) = ∅ , which we represent as ( ) () ( ) .
Let C C C be a constant-input, binary, strictly layered arithmetic circuit of depth d d d over a field F \mathbb{F} F . For 0 ≤ i ≤ d 0 \leq i \leq d 0 ≤ i ≤ d , let Layer i i i have size S i S_i S i and bit length s i s_i s i , and fix a bit labeling of each layer. The gate-value function W i : { 0 , 1 } s i → F W_i : \{0,1\}^{s_i} \to \mathbb{F} W i : { 0 , 1 } s i → F is defined as follows:
Non-gate labels: If b ∈ { 0 , 1 } s i \mathbf{b} \in \{0,1\}^{s_i} b ∈ { 0 , 1 } s i does not correspond to a valid gate label in Layer i i i (i.e., if S i S_i S i is not a power of 2 and b \mathbf{b} b represents an integer exceeding S i − 1 S_i - 1 S i − 1 ), then:
W i ( b ) : = 0. W_i(\mathbf{b}) := 0. W i ( b ) := 0. Valid gate labels:
Layer d d d (input layer): For all b ∈ { 0 , 1 } s d \mathbf{b} \in \{0,1\}^{s_d} b ∈ { 0 , 1 } s d , define:
W d ( b ) : = the input at gate b in Layer d . W_d(\mathbf{b}) := \text{the input at gate $\mathbf{b}$ in Layer $d$}. W d ( b ) := the input at gate b in Layer d . Intermediate layers, d − 1 ≥ i ≥ 0 d-1 \geq i \geq 0 d − 1 ≥ i ≥ 0 : For c ∈ { 0 , 1 } s i \mathbf{c} \in \{0,1\}^{s_i} c ∈ { 0 , 1 } s i , let a , b ∈ { 0 , 1 } s i + 1 \mathbf{a}, \mathbf{b} \in \{0,1\}^{s_{i+1}} a , b ∈ { 0 , 1 } s i + 1 (possibly a = b \mathbf{a} = \mathbf{b} a = b ) be the gates in Layer i + 1 i+1 i + 1 connected by wires to gate c \mathbf{c} c . Define:
W i ( c ) : = W i + 1 ( a ) ⊙ W i + 1 ( b ) , W_i(\mathbf{c}) := W_{i+1}(\mathbf{a}) \odot W_{i+1}(\mathbf{b}), W i ( c ) := W i + 1 ( a ) ⊙ W i + 1 ( b ) , where ⊙ \odot ⊙ represents:
Addition, if gate c \mathbf{c} c is an addition gate;
Multiplication, if gate c \mathbf{c} c is a multiplication gate.
Multilinear extension: For each layer i i i , the multilinear extension W ~ i : F s i → F \widetilde{W}_i : \mathbb{F}^{s_i} \to \mathbb{F} W i : F s i → F is defined to extend W i W_i W i to inputs in F s i \mathbb{F}^{s_i} F s i .
display(ac_01.graphviz_circuit_bitstring)ac_01.print_gate_values()
MULTILINEAR EXTENSIONS OF GATE-VALUE FUNCTIONS
W̃_2(x_0, x_1) = 2*x_0 + x_1 + 2
W̃_1(x_0, x_1) = 4*x_0*x_1 + 8*x_0 + 5*x_1 + 4
Wiring predicates ¶ For the purposes of the next definition, we order bitstrings of a given length lexicographically with the most significant bit first (equivalently, by the numeric value of their binary representation). That is, if a = ( a 0 , … , a m − 1 ) ∈ { 0 , 1 } m \mathbf{a} = (a_0,\ldots,a_{m - 1}) \in \{0,1\}^m a = ( a 0 , … , a m − 1 ) ∈ { 0 , 1 } m and b = ( b 0 , … , b m − 1 ) ∈ { 0 , 1 } m \mathbf{b} = (b_0,\ldots,b_{m - 1}) \in \{0,1\}^m b = ( b 0 , … , b m − 1 ) ∈ { 0 , 1 } m , we write
a ≤ b ⇔ 2 m − 1 a 0 + 2 m − 2 a 1 + ⋯ + 2 0 a m − 1 ≤ 2 m − 1 b 0 + 2 m − 2 b 1 + ⋯ + 2 0 b m − 1 . \mathbf{a} \, \le \, \mathbf{b} \quad \Leftrightarrow \quad 2^{m - 1}a_{0} + 2^{m - 2}a_{1} + \cdots + 2^0a_{m - 1} \, \le \, 2^{m - 1}b_{0} + 2^{m - 2}b_1 + \cdots + 2^0b_{m - 1}. a ≤ b ⇔ 2 m − 1 a 0 + 2 m − 2 a 1 + ⋯ + 2 0 a m − 1 ≤ 2 m − 1 b 0 + 2 m − 2 b 1 + ⋯ + 2 0 b m − 1 . This ordering is fixed once and for all and serves only as a convenient convention.
Let C C C be a binary, strictly layered arithmetic circuit of depth d d d over a field F \mathbb{F} F . For 0 ≤ i ≤ d 0 \leq i \leq d 0 ≤ i ≤ d , let Layer i i i have size S i S_i S i and bit length s i s_i s i , and fix a bit labeling of each layer. For 0 ≤ i ≤ d − 1 0 \le i \le d - 1 0 ≤ i ≤ d − 1 , the wiring predicates
a d d i : { 0 , 1 } s i × { 0 , 1 } s i + 1 × { 0 , 1 } s i + 1 → F m u l t i : { 0 , 1 } s i × { 0 , 1 } s i + 1 × { 0 , 1 } s i + 1 → F \begin{align}
\mathrm{add}_i & : \{0,1\}^{s_i} \times \{0,1\}^{s_{i + 1}} \times \{0,1\}^{s_{i + 1}} \to \mathbb{F} \\
\mathrm{mult}_i & : \{0,1\}^{s_i} \times \{0,1\}^{s_{i + 1}} \times \{0,1\}^{s_{i + 1}} \to \mathbb{F}
\end{align} add i mult i : { 0 , 1 } s i × { 0 , 1 } s i + 1 × { 0 , 1 } s i + 1 → F : { 0 , 1 } s i × { 0 , 1 } s i + 1 × { 0 , 1 } s i + 1 → F with respect to this bit labeling is defined as follows. Let c ∈ { 0 , 1 } s i \mathbf{c} \in \{0,1\}^{s_i} c ∈ { 0 , 1 } s i , and let a , b ∈ { 0 , 1 } s i + 1 \mathbf{a}, \mathbf{b} \in \{0,1\}^{s_{i + 1}} a , b ∈ { 0 , 1 } s i + 1 be gates in layer i + 1 i + 1 i + 1 (with the possibility that a = b \mathbf{a} = \mathbf{b} a = b ).
If gate c \mathbf{c} c is:
an addition gate, and
the (multi)set of its two children is { a , b } \{\mathbf{a}, \mathbf{b}\} { a , b } , and
a ≤ b \mathbf{a} \le \mathbf{b} a ≤ b ,
then we set a d d i ( c , a , b ) = 1 \mathrm{add}_i(\mathbf{c}, \mathbf{a}, \mathbf{b}) = 1 add i ( c , a , b ) = 1 ; otherwise, we set a d d i ( c , a , b ) = 0 \mathrm{add}_i(\mathbf{c}, \mathbf{a}, \mathbf{b}) = 0 add i ( c , a , b ) = 0 .
If gate c \mathbf{c} c is:
a multiplication gate, and
the (multi)set of its two children is { a , b } \{\mathbf{a}, \mathbf{b}\} { a , b } , and
a ≤ b \mathbf{a} \le \mathbf{b} a ≤ b ,
then we set m u l t i ( c , a , b ) = 1 \mathrm{mult}_i(\mathbf{c}, \mathbf{a}, \mathbf{b}) = 1 mult i ( c , a , b ) = 1 ; otherwise, we set m u l t i ( c , a , b ) = 0 \mathrm{mult}_i(\mathbf{c}, \mathbf{a}, \mathbf{b}) = 0 mult i ( c , a , b ) = 0 .
If c \mathbf{c} c is the label of a nonexistent gate, i.e., S i S_i S i is not a power of 2 and c \mathbf{c} c is the binary representation of an integer exceeding S i − 1 S_i - 1 S i − 1 , a d d i ( c , a , b ) = m u l t i ( c , a , b ) = 0 \mathrm{add}_i(\mathbf{c}, \mathbf{a}, \mathbf{b}) = \mathrm{mult}_i(\mathbf{c}, \mathbf{a}, \mathbf{b}) = 0 add i ( c , a , b ) = mult i ( c , a , b ) = 0 .
We may then define the multilinear extensions
a d d ~ i : F s i × F s i + 1 × F s i + 1 → F m u l t ~ i : F s i × F s i + 1 × F s i + 1 → F \begin{align}
\widetilde{\mathrm{add}}_i & : \mathbb{F}^{s_i} \times \mathbb{F}^{s_{i + 1}} \times \mathbb{F}^{s_{i + 1}} \to \mathbb{F} \\
\widetilde{\mathrm{mult}}_i & : \mathbb{F}^{s_i} \times \mathbb{F}^{s_{i + 1}} \times \mathbb{F}^{s_{i + 1}} \to \mathbb{F}
\end{align} add i mult i : F s i × F s i + 1 × F s i + 1 → F : F s i × F s i + 1 × F s i + 1 → F (i) The reason we define a d d i ( c , a , b ) \mathrm{add}_i(\mathbf{c}, \mathbf{a}, \mathbf{b}) add i ( c , a , b ) to be 0 unless a ≤ b \mathbf{a} \le \mathbf{b} a ≤ b is precisely so that, if a ≠ b \mathbf{a} \ne \mathbf{b} a = b , then at most one of a d d i ( c , a , b ) \mathrm{add}_i(\mathbf{c}, \mathbf{a}, \mathbf{b}) add i ( c , a , b ) and a d d i ( c , b , a ) \mathrm{add}_i(\mathbf{c}, \mathbf{b}, \mathbf{a}) add i ( c , b , a ) can be 1. Similarly for m u l t i \mathrm{mult}_i mult i . This avoids double counting in the layer-wise gate-value propagation equation and Thaler’s identity below .
(ii) For A ⊆ F A \subseteq \mathbb{F} A ⊆ F , we may of course identify the domain A s i × A s i + 1 × A s i + 1 A^{s_i} \times A^{s_{i + 1}} \times A^{s_{i + 1}} A s i × A s i + 1 × A s i + 1 with A s i + 2 s i + 1 A^{s_i + 2s_{i + 1}} A s i + 2 s i + 1 , and write ( c 0 , … , c s i − 1 , a 0 , … , a s i + 1 − 1 , b 0 , … , b s i + 1 − 1 ) (c_0,\ldots,c_{s_i - 1},a_0,\ldots,a_{s_{i + 1} - 1},b_0,\ldots,b_{s_{i + 1} - 1}) ( c 0 , … , c s i − 1 , a 0 , … , a s i + 1 − 1 , b 0 , … , b s i + 1 − 1 ) instead of ( ( c 0 , … , c s i − 1 ) , ( a 0 , … , a s i + 1 − 1 ) , ( b 0 , … , b s i + 1 − 1 ) ) ((c_0,\ldots,c_{s_i - 1}),(a_0,\ldots,a_{s_{i + 1} - 1}),(b_0,\ldots,b_{s_{i + 1} - 1})) (( c 0 , … , c s i − 1 ) , ( a 0 , … , a s i + 1 − 1 ) , ( b 0 , … , b s i + 1 − 1 )) for the input of a d d i \mathrm{add}_i add i and m u l t i \mathrm{mult}_i mult i .
ac_01.print_wiring_predicates()
ADDITION WIRING PREDICATES (NONZERO VALUES)
add_1((0,0),(0,0),(0,0)) = 1
add_1((1,1),(1,1),(1,1)) = 1
add_0((1),(1,0),(1,1)) = 1
MULTIPLICATION WIRING PREDICATES (NONZERO VALUES)
mult_1((0,1),(0,1),(0,1)) = 1
mult_1((1,0),(0,1),(1,0)) = 1
mult_0((0),(0,0),(0,1)) = 1
ac_01.print_wiring_predicate_mles()
MULTILINEAR EXTENSIONS OF WIRING PREDICATES: ADD
add̃_1(z_0,z_1,x_0,x_1,y_0,y_1) = 2*x_0*x_1*y_0*y_1*z_0*z_1 + 10*x_0*x_1*y_0*y_1*z_0 + 10*x_0*x_1*y_0*y_1*z_1 + x_0*x_1*y_0*y_1 + 10*x_0*x_1*y_0*z_0*z_1 + x_0*x_1*y_0*z_0 + x_0*x_1*y_0*z_1 + 10*x_0*x_1*y_0 + 10*x_0*x_1*y_1*z_0*z_1 + x_0*x_1*y_1*z_0 + x_0*x_1*y_1*z_1 + 10*x_0*x_1*y_1 + x_0*x_1*z_0*z_1 + 10*x_0*x_1*z_0 + 10*x_0*x_1*z_1 + x_0*x_1 + 10*x_0*y_0*y_1*z_0*z_1 + x_0*y_0*y_1*z_0 + x_0*y_0*y_1*z_1 + 10*x_0*y_0*y_1 + x_0*y_0*z_0*z_1 + 10*x_0*y_0*z_0 + 10*x_0*y_0*z_1 + x_0*y_0 + x_0*y_1*z_0*z_1 + 10*x_0*y_1*z_0 + 10*x_0*y_1*z_1 + x_0*y_1 + 10*x_0*z_0*z_1 + x_0*z_0 + x_0*z_1 + 10*x_0 + 10*x_1*y_0*y_1*z_0*z_1 + x_1*y_0*y_1*z_0 + x_1*y_0*y_1*z_1 + 10*x_1*y_0*y_1 + x_1*y_0*z_0*z_1 + 10*x_1*y_0*z_0 + 10*x_1*y_0*z_1 + x_1*y_0 + x_1*y_1*z_0*z_1 + 10*x_1*y_1*z_0 + 10*x_1*y_1*z_1 + x_1*y_1 + 10*x_1*z_0*z_1 + x_1*z_0 + x_1*z_1 + 10*x_1 + y_0*y_1*z_0*z_1 + 10*y_0*y_1*z_0 + 10*y_0*y_1*z_1 + y_0*y_1 + 10*y_0*z_0*z_1 + y_0*z_0 + y_0*z_1 + 10*y_0 + 10*y_1*z_0*z_1 + y_1*z_0 + y_1*z_1 + 10*y_1 + z_0*z_1 + 10*z_0 + 10*z_1 + 1
add̃_0(z_0,x_0,x_1,y_0,y_1) = 10*x_0*x_1*y_0*y_1*z_0 + x_0*y_0*y_1*z_0
MULTILINEAR EXTENSIONS OF WIRING PREDICATES: MULT
mult̃_1(z_0,z_1,x_0,x_1,y_0,y_1) = 9*x_0*x_1*y_0*y_1*z_0*z_1 + x_0*x_1*y_0*y_1*z_0 + x_0*x_1*y_0*y_1*z_1 + x_0*x_1*y_0*z_0*z_1 + 10*x_0*x_1*y_0*z_0 + x_0*x_1*y_1*z_0*z_1 + 10*x_0*x_1*y_1*z_1 + 2*x_1*y_0*y_1*z_0*z_1 + 10*x_1*y_0*y_1*z_0 + 10*x_1*y_0*y_1*z_1 + 10*x_1*y_0*z_0*z_1 + x_1*y_0*z_0 + 10*x_1*y_1*z_0*z_1 + x_1*y_1*z_1
mult̃_0(z_0,x_0,x_1,y_0,y_1) = x_0*x_1*y_0*y_1*z_0 + 10*x_0*x_1*y_0*y_1 + 10*x_0*x_1*y_1*z_0 + x_0*x_1*y_1 + 10*x_0*y_0*y_1*z_0 + x_0*y_0*y_1 + x_0*y_1*z_0 + 10*x_0*y_1 + 10*x_1*y_0*y_1*z_0 + x_1*y_0*y_1 + x_1*y_1*z_0 + 10*x_1*y_1 + y_0*y_1*z_0 + 10*y_0*y_1 + 10*y_1*z_0 + y_1
Thaler’s identity ¶ The structure of an arithmetic circuit is fully described by the wiring predicates a d d i \mathrm{add}_i add i and m u l t i \mathrm{mult}_i mult i , which encode its topology but not the values assigned to the gates by the gate-value functions W i W_i W i . The circuit’s computation can be expressed in terms of the gate-value functions and wiring predicates, as shown in part (a) of the following proposition. Part (b) enables us to apply the sum-check protocol to verify the output of a circuit, as we will explore in the next notebook . We refer to this as Thaler’s identity, a simplification by Thaler 1 of an identity of Cormode, Mitzenmacher, and Thaler 4 .
Let C C C be a constant-input, binary, strictly layered arithmetic circuit of depth d d d over a field F \mathbb{F} F . For 0 ≤ i ≤ d 0 \leq i \leq d 0 ≤ i ≤ d , let Layer i i i have size S i S_i S i and bit length s i s_i s i , and fix a bit labeling of each layer. For 0 ≤ i ≤ d 0 \le i \le d 0 ≤ i ≤ d , let W i W_i W i be the gate-value function corresponding to this bit labeling, and for 0 ≤ i ≤ d − 1 0 \le i \le d - 1 0 ≤ i ≤ d − 1 , let a d d i \mathrm{add}_i add i and m u l t i \mathrm{mult}_i mult i be the wiring predicates corresponding to this bit labeling.
(a) [Layer-wise gate-value propagation equation] Let i ∈ { 0 , … , d − 1 } i \in \{0,\ldots,d - 1\} i ∈ { 0 , … , d − 1 } . For all z ∈ { 0 , 1 } s i \mathbf{z} \in \{0,1\}^{s_i} z ∈ { 0 , 1 } s i ,
W i ( z ) = ∑ x ∈ { 0 , 1 } s i + 1 y ∈ { 0 , 1 } s i + 1 { a d d i ( z , x , y ) [ W i + 1 ( x ) + W i + 1 ( y ) ] + m u l t i ( z , x , y ) [ W i + 1 ( x ) W i + 1 ( y ) ] } . W_i(\mathbf{z}) =
\sum_{\substack{\mathbf{x} \, \in \{0,1\}^{s_{i + 1}} \\ \mathbf{y} \, \in \{0,1\}^{s_{i + 1}}}} \Big\{ \mathrm{add}_i(\mathbf{z},\mathbf{x},\mathbf{y}) \big[ W_{i+1}(\mathbf{x}) + W_{i+1}(\mathbf{y})\big]
+ \mathrm{mult}_i(\mathbf{z},\mathbf{x},\mathbf{y}) \big[ W_{i+1}(\mathbf{x})W_{i+1}(\mathbf{y})\big]\Big\}. W i ( z ) = x ∈ { 0 , 1 } s i + 1 y ∈ { 0 , 1 } s i + 1 ∑ { add i ( z , x , y ) [ W i + 1 ( x ) + W i + 1 ( y ) ] + mult i ( z , x , y ) [ W i + 1 ( x ) W i + 1 ( y ) ] } . (b) [Thaler’s identity] Let i ∈ { 0 , … , d − 1 } i \in \{0,\ldots,d - 1\} i ∈ { 0 , … , d − 1 } . For all z ∈ F s i \mathbf{z} \in \mathbb{F}^{s_i} z ∈ F s i ,
W ~ i ( z ) = ∑ x ∈ { 0 , 1 } s i + 1 y ∈ { 0 , 1 } s i + 1 { a d d ~ i ( z , x , y ) [ W ~ i + 1 ( x ) + W ~ i + 1 ( y ) ] + m u l t ~ i ( z , x , y ) [ W ~ i + 1 ( x ) W ~ i + 1 ( y ) ] } . \widetilde{W}_i(\mathbf{z}) = \sum_{\substack{\mathbf{x} \, \in \{0,1\}^{s_{i + 1}} \\ \mathbf{y} \, \in \{0,1\}^{s_{i + 1}}}} \Big\{\widetilde{\mathrm{add}}_i(\mathbf{z},\mathbf{x},\mathbf{y}) \big[ \widetilde{W}_{i + 1}(\mathbf{x}) + \widetilde{W}_{i + 1}(\mathbf{y})\big]
+ \widetilde{\mathrm{mult}}_i(\mathbf{z},\mathbf{x},\mathbf{y}) \big[ \widetilde{W}_{i + 1}(\mathbf{x})\widetilde{W}_{i + 1}(\mathbf{y})\big]\Big\}. W i ( z ) = x ∈ { 0 , 1 } s i + 1 y ∈ { 0 , 1 } s i + 1 ∑ { add i ( z , x , y ) [ W i + 1 ( x ) + W i + 1 ( y ) ] + mult i ( z , x , y ) [ W i + 1 ( x ) W i + 1 ( y ) ] } . (a) Let z ∈ { 0 , 1 } s i \mathbf{z} \in \{0,1\}^{s_i} z ∈ { 0 , 1 } s i . When the (multi)set of z \mathbf{z} z 's two children is { a , b } \{\mathbf{a}, \mathbf{b}\} { a , b } with a ≤ b \mathbf{a} \le \mathbf{b} a ≤ b , the only potentially nonzero summand on the right-hand side of (1) corresponds to x = a \mathbf{x} = \mathbf{a} x = a and y = b \mathbf{y} = \mathbf{b} y = b . Furthermore:
If z \mathbf{z} z is an addition gate, then m u l t i ( z , a , b ) = 0 \mathrm{mult}_i(\mathbf{z},\mathbf{a},\mathbf{b}) = 0 mult i ( z , a , b ) = 0 , reducing the right-hand side to
a d d i ( z , a , b ) [ W i + 1 ( a ) + W i + 1 ( b ) ] = W i + 1 ( a ) + W i + 1 ( b ) = W i ( z ) . \mathrm{add}_i(\mathbf{z},\mathbf{a},\mathbf{b})\big[ W_{i+1}(\mathbf{a}) + W_{i+1}(\mathbf{b})\big] = W_{i+1}(\mathbf{a}) + W_{i+1}(\mathbf{b}) = W_i(\mathbf{z}). add i ( z , a , b ) [ W i + 1 ( a ) + W i + 1 ( b ) ] = W i + 1 ( a ) + W i + 1 ( b ) = W i ( z ) . Similarly, if z \mathbf{z} z is a multiplication gate, then a d d i ( z , a , b ) = 0 \mathrm{add}_i(\mathbf{z},\mathbf{a},\mathbf{b}) = 0 add i ( z , a , b ) = 0 , reducing the right-hand side to
m u l t i ( z , a , b ) [ W i + 1 ( a ) W i + 1 ( b ) ] = W i + 1 ( a ) W i + 1 ( b ) = W i ( z ) . \mathrm{mult}_i(\mathbf{z},\mathbf{a},\mathbf{b})\big[ W_{i+1}(\mathbf{a}) W_{i+1}(\mathbf{b})\big] = W_{i+1}(\mathbf{a}) W_{i+1}(\mathbf{b}) = W_i(\mathbf{z}). mult i ( z , a , b ) [ W i + 1 ( a ) W i + 1 ( b ) ] = W i + 1 ( a ) W i + 1 ( b ) = W i ( z ) . (b) Still assuming z ∈ { 0 , 1 } s i \mathbf{z} \in \{0,1\}^{s_i} z ∈ { 0 , 1 } s i , since z \mathbf{z} z , x \mathbf{x} x , and y \mathbf{y} y lie in a Boolean hypercube, each function in the expression (1) can be replaced by its multilinear extension. Specifically, for z ∈ { 0 , 1 } s i \mathbf{z} \in \{0,1\}^{s_i} z ∈ { 0 , 1 } s i ,
W i ( z ) = W ~ i ( z ) ; W_i(\mathbf{z}) = \widetilde{W}_i(\mathbf{z}); W i ( z ) = W i ( z ) ; for x , y ∈ { 0 , 1 } s i + 1 \mathbf{x}, \mathbf{y} \in \{0,1\}^{s_{i + 1}} x , y ∈ { 0 , 1 } s i + 1 ,
W i + 1 ( x ) = W ~ i + 1 ( x ) and W i + 1 ( y ) = W ~ i + 1 ( y ) ; W_{i + 1}(\mathbf{x}) = \widetilde{W}_{i + 1}(\mathbf{x}) \quad \text{and} \quad W_{i + 1}(\mathbf{y}) = \widetilde{W}_{i + 1}(\mathbf{y}); W i + 1 ( x ) = W i + 1 ( x ) and W i + 1 ( y ) = W i + 1 ( y ) ; and for ( z , x , y ) ∈ { 0 , 1 } s i × { 0 , 1 } s i + 1 × { 0 , 1 } s i + 1 (\mathbf{z},\mathbf{x}, \mathbf{y}) \in \{0,1\}^{s_i} \times \{0,1\}^{s_{i + 1}} \times \{0,1\}^{s_{i + 1}} ( z , x , y ) ∈ { 0 , 1 } s i × { 0 , 1 } s i + 1 × { 0 , 1 } s i + 1 ,
a d d i ( z , x , y ) = a d d ~ i ( z , x , y ) and m u l t i ( z , x , y ) = m u l t ~ i ( z , x , y ) . \mathrm{add}_i(\mathbf{z},\mathbf{x},\mathbf{y}) = \widetilde{\mathrm{add}}_i(\mathbf{z},\mathbf{x},\mathbf{y}) \quad \text{and} \quad
\mathrm{mult}_i(\mathbf{z},\mathbf{x},\mathbf{y}) = \widetilde{\mathrm{mult}}_i(\mathbf{z},\mathbf{x},\mathbf{y}). add i ( z , x , y ) = add i ( z , x , y ) and mult i ( z , x , y ) = mult i ( z , x , y ) . Therefore,
∑ x ∈ { 0 , 1 } s i + 1 y ∈ { 0 , 1 } s i + 1 { a d d i ( z , x , y ) [ W i + 1 ( x ) + W i + 1 ( y ) ] + m u l t i ( z , x , y ) [ W i + 1 ( x ) W i + 1 ( y ) ] } = ∑ x ∈ { 0 , 1 } s i + 1 y ∈ { 0 , 1 } s i + 1 { a d d ~ i ( z , x , y ) [ W ~ i + 1 ( x ) + W ~ i + 1 ( y ) ] + m u l t ~ i ( z , x , y ) [ W ~ i + 1 ( x ) W ~ i + 1 ( y ) ] } . \begin{align}
\begin{split}
& \sum_{\substack{\mathbf{x} \, \in \{0,1\}^{s_{i + 1}} \\ \mathbf{y} \, \in \{0,1\}^{s_{i + 1}}}} \Big\{ \mathrm{add}_i(\mathbf{z},\mathbf{x},\mathbf{y}) \big[ W_{i+1}(\mathbf{x}) + W_{i+1}(\mathbf{y})\big]
+ \mathrm{mult}_i(\mathbf{z},\mathbf{x},\mathbf{y}) \big[ W_{i+1}(\mathbf{x})W_{i+1}(\mathbf{y})\big]\Big\}
\\ & =
\sum_{\substack{\mathbf{x} \, \in \{0,1\}^{s_{i + 1}} \\ \mathbf{y} \, \in \{0,1\}^{s_{i + 1}}}} \Big\{\widetilde{\mathrm{add}}_i(\mathbf{z},\mathbf{x},\mathbf{y}) \big[ \widetilde{W}_{i + 1}(\mathbf{x}) + \widetilde{W}_{i + 1}(\mathbf{y})\big]
+ \widetilde{\mathrm{mult}}_i(\mathbf{z},\mathbf{x},\mathbf{y}) \big[ \widetilde{W}_{i + 1}(\mathbf{x})\widetilde{W}_{i + 1}(\mathbf{y})\big]\Big\}.
\end{split}
\end{align} x ∈ { 0 , 1 } s i + 1 y ∈ { 0 , 1 } s i + 1 ∑ { add i ( z , x , y ) [ W i + 1 ( x ) + W i + 1 ( y ) ] + mult i ( z , x , y ) [ W i + 1 ( x ) W i + 1 ( y ) ] } = x ∈ { 0 , 1 } s i + 1 y ∈ { 0 , 1 } s i + 1 ∑ { add i ( z , x , y ) [ W i + 1 ( x ) + W i + 1 ( y ) ] + mult i ( z , x , y ) [ W i + 1 ( x ) W i + 1 ( y ) ] } . The functions on both sides of (2) are defined for all z ∈ F s i \mathbf{z} \in \mathbb{F}^{s_i} z ∈ F s i , and we’ve just shown they agree for all z \mathbf{z} z in the Boolean hypercube { 0 , 1 } s i \{0,1\}^{s_i} { 0 , 1 } s i . We claim that equality in fact holds for all z \mathbf{z} z in F s i \mathbb{F}^{s_i} F s i . Since the left-hand side is a multilinear extension of W i W_i W i and the right hand side is an extension of W i W_i W i , it suffices to show that the right-hand side is multilinear in z \mathbf{z} z . By uniqueness of multilinear extensions, it then follows that both sides of (2) are the same function on F s i \mathbb{F}^{s_i} F s i , viz. the multilinear extension of W i W_i W i .
Indeed, given x , y ∈ { 0 , 1 } s i + 1 \mathbf{x}, \mathbf{y} \in \{0,1\}^{s_{i + 1}} x , y ∈ { 0 , 1 } s i + 1 , a d d ~ i ( z , x , y ) \widetilde{\mathrm{add}}_i(\mathbf{z},\mathbf{x},\mathbf{y}) add i ( z , x , y ) and m u l t ~ i ( z , x , y ) \widetilde{\mathrm{mult}}_i(\mathbf{z},\mathbf{x},\mathbf{y}) mult i ( z , x , y ) are multilinear functions in z \mathbf{z} z , because they are multilinear extensions of a d d i \mathrm{add}_i add i and m u l t i \mathrm{mult}_i mult i respectively. Recall the proposition of our multilinear extensions notebook , which states that the multilinear extension process is linear on function spaces, i.e. c f + d g ~ = c f ~ + d g ~ \widetilde{cf + dg} = c\tilde{f} + d\tilde{g} c f + d g = c f ~ + d g ~ . This implies that the summand on the right-hand side of (2) is a multilinear function in z \mathbf{z} z , and therefore, in turn, that the entire sum is a multilinear function in z \mathbf{z} z .
(i) We call a function multilinear if it is the evaluation map of some multilinear polynomial. For example, over Z / 3 Z \mathbb{Z}/3\mathbb{Z} Z /3 Z , the function ( z 0 , z 1 , x 0 , x 1 , y 0 , y 1 ) ↦ x 0 2 y 1 z 0 3 + x 1 y 0 2 z 1 3 (z_0,z_1,x_0,x_1,y_0,y_1) \mapsto x_0^2y_1z_0^3 + x_1y_0^2z_1^3 ( z 0 , z 1 , x 0 , x 1 , y 0 , y 1 ) ↦ x 0 2 y 1 z 0 3 + x 1 y 0 2 z 1 3 is multilinear in ( z 0 , z 1 ) (z_0,z_1) ( z 0 , z 1 ) , because it is equivalent to the function ( z 0 , z 1 , x 0 , x 1 , y 0 , y 1 ) ↦ x 0 2 y 1 z 0 + x 1 y 0 2 z 1 (z_0,z_1,x_0,x_1,y_0,y_1) \mapsto x_0^2y_1z_0 + x_1y_0^2z_1 ( z 0 , z 1 , x 0 , x 1 , y 0 , y 1 ) ↦ x 0 2 y 1 z 0 + x 1 y 0 2 z 1 , which is the evaluation map of the polynomial X 0 2 Y 1 Z 0 + X 1 Y 0 2 Z 1 X_0^2Y_1Z_0 + X_1Y_0^2Z_1 X 0 2 Y 1 Z 0 + X 1 Y 0 2 Z 1 , which is multilinear in ( Z 0 , Z 1 ) (Z_0,Z_1) ( Z 0 , Z 1 ) .
(ii) We did not use the fact that a d d ~ i ( z , x , y ) \widetilde{\mathrm{add}}_i(\mathbf{z},\mathbf{x},\mathbf{y}) add i ( z , x , y ) and m u l t ~ i ( z , x , y ) \widetilde{\mathrm{mult}}_i(\mathbf{z},\mathbf{x},\mathbf{y}) mult i ( z , x , y ) are multilinear functions with respect to x \mathbf{x} x and y \mathbf{y} y in the above proof. The hypotheses for Thaler’s identity can be relaxed: a d d ~ i ( z , x , y ) \widetilde{\mathrm{add}}_i(\mathbf{z},\mathbf{x},\mathbf{y}) add i ( z , x , y ) and m u l t ~ i ( z , x , y ) \widetilde{\mathrm{mult}}_i(\mathbf{z},\mathbf{x},\mathbf{y}) mult i ( z , x , y ) can be extensions of a d d i ( z , x , y ) \mathrm{add}_i(\mathbf{z},\mathbf{x},\mathbf{y}) add i ( z , x , y ) and m u l t i ( z , x , y ) \mathrm{mult}_i(\mathbf{z},\mathbf{x},\mathbf{y}) mult i ( z , x , y ) that are multilinear in z \mathbf{z} z .
ac_01.print_verification_propagation_equation()
VERIFICATION OF LAYER-WISE GATE-VALUE PROPAGATION EQUATION
W_1(0,0) = 4, sum { add_1((0,0),x,y) [ W_2(x) + W_2(y) ] + mult_1((0,0),x,y) [ W_2(x) W_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 4 ✓
W_1(0,1) = 9, sum { add_1((0,1),x,y) [ W_2(x) + W_2(y) ] + mult_1((0,1),x,y) [ W_2(x) W_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 9 ✓
W_1(1,0) = 1, sum { add_1((1,0),x,y) [ W_2(x) + W_2(y) ] + mult_1((1,0),x,y) [ W_2(x) W_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 1 ✓
W_1(1,1) = 10, sum { add_1((1,1),x,y) [ W_2(x) + W_2(y) ] + mult_1((1,1),x,y) [ W_2(x) W_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 10 ✓
W_0(0) = 3, sum { add_0((0),x,y) [ W_1(x) + W_1(y) ] + mult_0((0),x,y) [ W_1(x) W_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 3 ✓
W_0(1) = 0, sum { add_0((1),x,y) [ W_1(x) + W_1(y) ] + mult_0((1),x,y) [ W_1(x) W_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 0 ✓
ac_01.print_verification_propagation_equation(mle=True)
VERIFICATION OF THALER'S IDENTITY
W̃_1(0,0) = 4, sum { add̃_1((0,0),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((0,0),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 4 ✓
W̃_1(0,1) = 9, sum { add̃_1((0,1),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((0,1),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 9 ✓
W̃_1(0,2) = 3, sum { add̃_1((0,2),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((0,2),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 3 ✓
W̃_1(0,3) = 8, sum { add̃_1((0,3),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((0,3),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 8 ✓
W̃_1(0,4) = 2, sum { add̃_1((0,4),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((0,4),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 2 ✓
W̃_1(0,5) = 7, sum { add̃_1((0,5),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((0,5),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 7 ✓
W̃_1(0,6) = 1, sum { add̃_1((0,6),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((0,6),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 1 ✓
W̃_1(0,7) = 6, sum { add̃_1((0,7),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((0,7),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 6 ✓
W̃_1(0,8) = 0, sum { add̃_1((0,8),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((0,8),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 0 ✓
W̃_1(0,9) = 5, sum { add̃_1((0,9),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((0,9),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(0,10) = 10, sum { add̃_1((0,10),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((0,10),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 10 ✓
W̃_1(1,0) = 1, sum { add̃_1((1,0),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((1,0),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 1 ✓
W̃_1(1,1) = 10, sum { add̃_1((1,1),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((1,1),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 10 ✓
W̃_1(1,2) = 8, sum { add̃_1((1,2),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((1,2),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 8 ✓
W̃_1(1,3) = 6, sum { add̃_1((1,3),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((1,3),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 6 ✓
W̃_1(1,4) = 4, sum { add̃_1((1,4),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((1,4),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 4 ✓
W̃_1(1,5) = 2, sum { add̃_1((1,5),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((1,5),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 2 ✓
W̃_1(1,6) = 0, sum { add̃_1((1,6),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((1,6),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 0 ✓
W̃_1(1,7) = 9, sum { add̃_1((1,7),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((1,7),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 9 ✓
W̃_1(1,8) = 7, sum { add̃_1((1,8),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((1,8),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 7 ✓
W̃_1(1,9) = 5, sum { add̃_1((1,9),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((1,9),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(1,10) = 3, sum { add̃_1((1,10),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((1,10),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 3 ✓
W̃_1(2,0) = 9, sum { add̃_1((2,0),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((2,0),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 9 ✓
W̃_1(2,1) = 0, sum { add̃_1((2,1),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((2,1),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 0 ✓
W̃_1(2,2) = 2, sum { add̃_1((2,2),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((2,2),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 2 ✓
W̃_1(2,3) = 4, sum { add̃_1((2,3),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((2,3),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 4 ✓
W̃_1(2,4) = 6, sum { add̃_1((2,4),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((2,4),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 6 ✓
W̃_1(2,5) = 8, sum { add̃_1((2,5),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((2,5),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 8 ✓
W̃_1(2,6) = 10, sum { add̃_1((2,6),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((2,6),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 10 ✓
W̃_1(2,7) = 1, sum { add̃_1((2,7),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((2,7),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 1 ✓
W̃_1(2,8) = 3, sum { add̃_1((2,8),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((2,8),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 3 ✓
W̃_1(2,9) = 5, sum { add̃_1((2,9),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((2,9),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(2,10) = 7, sum { add̃_1((2,10),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((2,10),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 7 ✓
W̃_1(3,0) = 6, sum { add̃_1((3,0),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((3,0),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 6 ✓
W̃_1(3,1) = 1, sum { add̃_1((3,1),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((3,1),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 1 ✓
W̃_1(3,2) = 7, sum { add̃_1((3,2),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((3,2),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 7 ✓
W̃_1(3,3) = 2, sum { add̃_1((3,3),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((3,3),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 2 ✓
W̃_1(3,4) = 8, sum { add̃_1((3,4),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((3,4),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 8 ✓
W̃_1(3,5) = 3, sum { add̃_1((3,5),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((3,5),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 3 ✓
W̃_1(3,6) = 9, sum { add̃_1((3,6),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((3,6),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 9 ✓
W̃_1(3,7) = 4, sum { add̃_1((3,7),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((3,7),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 4 ✓
W̃_1(3,8) = 10, sum { add̃_1((3,8),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((3,8),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 10 ✓
W̃_1(3,9) = 5, sum { add̃_1((3,9),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((3,9),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(3,10) = 0, sum { add̃_1((3,10),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((3,10),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 0 ✓
W̃_1(4,0) = 3, sum { add̃_1((4,0),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((4,0),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 3 ✓
W̃_1(4,1) = 2, sum { add̃_1((4,1),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((4,1),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 2 ✓
W̃_1(4,2) = 1, sum { add̃_1((4,2),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((4,2),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 1 ✓
W̃_1(4,3) = 0, sum { add̃_1((4,3),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((4,3),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 0 ✓
W̃_1(4,4) = 10, sum { add̃_1((4,4),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((4,4),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 10 ✓
W̃_1(4,5) = 9, sum { add̃_1((4,5),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((4,5),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 9 ✓
W̃_1(4,6) = 8, sum { add̃_1((4,6),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((4,6),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 8 ✓
W̃_1(4,7) = 7, sum { add̃_1((4,7),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((4,7),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 7 ✓
W̃_1(4,8) = 6, sum { add̃_1((4,8),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((4,8),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 6 ✓
W̃_1(4,9) = 5, sum { add̃_1((4,9),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((4,9),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(4,10) = 4, sum { add̃_1((4,10),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((4,10),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 4 ✓
W̃_1(5,0) = 0, sum { add̃_1((5,0),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((5,0),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 0 ✓
W̃_1(5,1) = 3, sum { add̃_1((5,1),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((5,1),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 3 ✓
W̃_1(5,2) = 6, sum { add̃_1((5,2),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((5,2),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 6 ✓
W̃_1(5,3) = 9, sum { add̃_1((5,3),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((5,3),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 9 ✓
W̃_1(5,4) = 1, sum { add̃_1((5,4),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((5,4),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 1 ✓
W̃_1(5,5) = 4, sum { add̃_1((5,5),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((5,5),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 4 ✓
W̃_1(5,6) = 7, sum { add̃_1((5,6),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((5,6),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 7 ✓
W̃_1(5,7) = 10, sum { add̃_1((5,7),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((5,7),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 10 ✓
W̃_1(5,8) = 2, sum { add̃_1((5,8),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((5,8),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 2 ✓
W̃_1(5,9) = 5, sum { add̃_1((5,9),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((5,9),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(5,10) = 8, sum { add̃_1((5,10),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((5,10),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 8 ✓
W̃_1(6,0) = 8, sum { add̃_1((6,0),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((6,0),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 8 ✓
W̃_1(6,1) = 4, sum { add̃_1((6,1),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((6,1),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 4 ✓
W̃_1(6,2) = 0, sum { add̃_1((6,2),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((6,2),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 0 ✓
W̃_1(6,3) = 7, sum { add̃_1((6,3),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((6,3),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 7 ✓
W̃_1(6,4) = 3, sum { add̃_1((6,4),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((6,4),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 3 ✓
W̃_1(6,5) = 10, sum { add̃_1((6,5),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((6,5),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 10 ✓
W̃_1(6,6) = 6, sum { add̃_1((6,6),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((6,6),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 6 ✓
W̃_1(6,7) = 2, sum { add̃_1((6,7),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((6,7),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 2 ✓
W̃_1(6,8) = 9, sum { add̃_1((6,8),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((6,8),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 9 ✓
W̃_1(6,9) = 5, sum { add̃_1((6,9),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((6,9),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(6,10) = 1, sum { add̃_1((6,10),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((6,10),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 1 ✓
W̃_1(7,0) = 5, sum { add̃_1((7,0),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((7,0),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(7,1) = 5, sum { add̃_1((7,1),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((7,1),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(7,2) = 5, sum { add̃_1((7,2),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((7,2),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(7,3) = 5, sum { add̃_1((7,3),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((7,3),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(7,4) = 5, sum { add̃_1((7,4),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((7,4),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(7,5) = 5, sum { add̃_1((7,5),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((7,5),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(7,6) = 5, sum { add̃_1((7,6),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((7,6),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(7,7) = 5, sum { add̃_1((7,7),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((7,7),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(7,8) = 5, sum { add̃_1((7,8),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((7,8),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(7,9) = 5, sum { add̃_1((7,9),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((7,9),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(7,10) = 5, sum { add̃_1((7,10),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((7,10),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(8,0) = 2, sum { add̃_1((8,0),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((8,0),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 2 ✓
W̃_1(8,1) = 6, sum { add̃_1((8,1),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((8,1),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 6 ✓
W̃_1(8,2) = 10, sum { add̃_1((8,2),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((8,2),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 10 ✓
W̃_1(8,3) = 3, sum { add̃_1((8,3),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((8,3),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 3 ✓
W̃_1(8,4) = 7, sum { add̃_1((8,4),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((8,4),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 7 ✓
W̃_1(8,5) = 0, sum { add̃_1((8,5),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((8,5),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 0 ✓
W̃_1(8,6) = 4, sum { add̃_1((8,6),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((8,6),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 4 ✓
W̃_1(8,7) = 8, sum { add̃_1((8,7),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((8,7),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 8 ✓
W̃_1(8,8) = 1, sum { add̃_1((8,8),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((8,8),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 1 ✓
W̃_1(8,9) = 5, sum { add̃_1((8,9),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((8,9),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(8,10) = 9, sum { add̃_1((8,10),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((8,10),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 9 ✓
W̃_1(9,0) = 10, sum { add̃_1((9,0),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((9,0),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 10 ✓
(Displayed 100 of 121 checked equations.)
W̃_0(0) = 3, sum { add̃_0((0),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((0),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 3 ✓
W̃_0(1) = 0, sum { add̃_0((1),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((1),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 0 ✓
W̃_0(2) = 8, sum { add̃_0((2),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((2),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 8 ✓
W̃_0(3) = 5, sum { add̃_0((3),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((3),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_0(4) = 2, sum { add̃_0((4),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((4),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 2 ✓
W̃_0(5) = 10, sum { add̃_0((5),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((5),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 10 ✓
W̃_0(6) = 7, sum { add̃_0((6),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((6),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 7 ✓
W̃_0(7) = 4, sum { add̃_0((7),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((7),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 4 ✓
W̃_0(8) = 1, sum { add̃_0((8),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((8),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 1 ✓
W̃_0(9) = 9, sum { add̃_0((9),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((9),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 9 ✓
W̃_0(10) = 6, sum { add̃_0((10),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((10),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 6 ✓
Conclusion ¶ Fix z ∈ F s i \mathbf{z} \in \mathbb{F}^{s_i} z ∈ F s i . We may view the summand on the right-hand side of Thaler’s identity (2) as a function of x \mathbf{x} x and y \mathbf{y} y , rather than of z \mathbf{z} z . Specifically, for fixed z \mathbf{z} z it defines a polynomial function
F z : F s i + 1 × F s i + 1 → F , F_{\mathbf{z}} : \mathbb{F}^{s_{i + 1}} \times \mathbb{F}^{s_{i + 1}} \to \mathbb{F}, F z : F s i + 1 × F s i + 1 → F , which we may identify with a polynomial function on F 2 s i + 1 \mathbb{F}^{2s_{i+1}} F 2 s i + 1 .
Moreover, this polynomial function may be represented by a polynomial that is multilinear (and hence of low total degree) in the variables ( x , y ) (\mathbf{x},\mathbf{y}) ( x , y ) . Thaler’s identity asserts that W ~ i ( z ) \widetilde{W}_i(\mathbf{z}) W i ( z ) is equal to the sum of F z F_{\mathbf{z}} F z over the Boolean hypercube { 0 , 1 } 2 s i + 1 \{0,1\}^{2s_{i + 1}} { 0 , 1 } 2 s i + 1 . Consequently, for any fixed z \mathbf{z} z , verification of (2) is amenable to the sum-check protocol.
Appendix A: further examples ¶ expression_02 = '(2 + 2)*(3*3)'
ac_02 = ArithmeticCircuit(expression_02, prime=7)
print(f"{expression_02} mod {ac_02.field.mod}")
display(ac_02.graphviz_circuit)
print(f"This circuit has size S = {ac_02.size} and depth d = {ac_02.depth}.")
ac_02.print_topological_order()
display(ac_02.graphviz_circuit_bitstring)
ac_02.print_gate_values()
ac_02.print_tilde_W()
ac_02.print_wiring_predicates()
ac_02.print_wiring_predicate_mles()
ac_02.print_verification_propagation_equation()
ac_02.print_verification_propagation_equation(mle=True)This circuit has size S = 5 and depth d = 2.
TOPOLOGICAL ORDERING
2.0 -> 2.1 -> 1.0 -> 1.1 -> 0._
MULTILINEAR EXTENSIONS OF GATE-VALUE FUNCTIONS
ADDITION WIRING PREDICATES (NONZERO VALUES)
MULTIPLICATION WIRING PREDICATES (NONZERO VALUES)
MULTILINEAR EXTENSIONS OF WIRING PREDICATES: ADD
add̃_1(z_0,x_0,y_0) = 6*x_0*y_0*z_0 + x_0*y_0 + x_0*z_0 + 6*x_0 + y_0*z_0 + 6*y_0 + 6*z_0 + 1
MULTILINEAR EXTENSIONS OF WIRING PREDICATES: MULT
mult̃_1(z_0,x_0,y_0) = x_0*y_0*z_0
mult̃_0(x_0,y_0) = 6*x_0*y_0 + y_0
VERIFICATION OF LAYER-WISE GATE-VALUE PROPAGATION EQUATION
W_1(0) = 4, sum { add_1((0),x,y) [ W_2(x) + W_2(y) ] + mult_1((0),x,y) [ W_2(x) W_2(y)] } over (x,y) in {0,1}^1 × {0,1}^1 = 4 ✓
W_1(1) = 2, sum { add_1((1),x,y) [ W_2(x) + W_2(y) ] + mult_1((1),x,y) [ W_2(x) W_2(y)] } over (x,y) in {0,1}^1 × {0,1}^1 = 2 ✓
W_0() = 1, sum { add_0((),x,y) [ W_1(x) + W_1(y) ] + mult_0((),x,y) [ W_1(x) W_1(y)] } over (x,y) in {0,1}^1 × {0,1}^1 = 1 ✓
VERIFICATION OF THALER'S IDENTITY
W̃_1(0) = 4, sum { add̃_1((0),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((0),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^1 × {0,1}^1 = 4 ✓
W̃_1(1) = 2, sum { add̃_1((1),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((1),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^1 × {0,1}^1 = 2 ✓
W̃_1(2) = 0, sum { add̃_1((2),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((2),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^1 × {0,1}^1 = 0 ✓
W̃_1(3) = 5, sum { add̃_1((3),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((3),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^1 × {0,1}^1 = 5 ✓
W̃_1(4) = 3, sum { add̃_1((4),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((4),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^1 × {0,1}^1 = 3 ✓
W̃_1(5) = 1, sum { add̃_1((5),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((5),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^1 × {0,1}^1 = 1 ✓
W̃_1(6) = 6, sum { add̃_1((6),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((6),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^1 × {0,1}^1 = 6 ✓
W̃_0() = 1, sum { add̃_0((),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^1 × {0,1}^1 = 1 ✓
expression_03a = '5*4 + 3'
expression_03b = '5*4 + (3 + 0)'
ac_03a = ArithmeticCircuit(expression_03a, prime=7, strict=False)
ac_03b = ArithmeticCircuit(expression_03b, prime=7)
print(f"{expression_03a} mod {ac_03a.field.mod}")
display(ac_03a.graphviz_circuit)
print(f"- The above is not a strictly layered circuit because the input 3 is not in Layer {ac_03a.depth} (the depth of the circuit).")
print(f"- If an arithmetic circuit can't model such a simple computation, it is rather otiose.")
print(f"- There is a simple workaround: note that {expression_03a} = {expression_03b}.\n")
print(f"{expression_03b} mod {ac_03b.field.mod}")
display(ac_03b.graphviz_circuit)
ac_03b.print_topological_order()
display(ac_03b.graphviz_circuit_bitstring)
ac_03b.print_gate_values()
ac_03b.print_tilde_W()
ac_03b.print_wiring_predicates()
ac_03b.print_wiring_predicate_mles()
ac_03b.print_verification_propagation_equation()
ac_03b.print_verification_propagation_equation(mle=True)- The above is not a strictly layered circuit because the input 3 is not in Layer 2 (the depth of the circuit).
- If an arithmetic circuit can't model such a simple computation, it is rather otiose.
- There is a simple workaround: note that 5*4 + 3 = 5*4 + (3 + 0).
5*4 + (3 + 0) mod 7
2.00 -> 2.01 -> 2.10 -> 2.11 -> 1.0 -> 1.1 -> 0._
MULTILINEAR EXTENSIONS OF GATE-VALUE FUNCTIONS
W̃_2(x_0, x_1) = 5*x_0*x_1 + 5*x_0 + 6*x_1 + 5
ADDITION WIRING PREDICATES (NONZERO VALUES)
add_1((1),(1,0),(1,1)) = 1
MULTIPLICATION WIRING PREDICATES (NONZERO VALUES)
mult_1((0),(0,0),(0,1)) = 1
MULTILINEAR EXTENSIONS OF WIRING PREDICATES: ADD
add̃_1(z_0,x_0,x_1,y_0,y_1) = 6*x_0*x_1*y_0*y_1*z_0 + x_0*y_0*y_1*z_0
add̃_0(x_0,y_0) = 6*x_0*y_0 + y_0
MULTILINEAR EXTENSIONS OF WIRING PREDICATES: MULT
mult̃_1(z_0,x_0,x_1,y_0,y_1) = x_0*x_1*y_0*y_1*z_0 + 6*x_0*x_1*y_0*y_1 + 6*x_0*x_1*y_1*z_0 + x_0*x_1*y_1 + 6*x_0*y_0*y_1*z_0 + x_0*y_0*y_1 + x_0*y_1*z_0 + 6*x_0*y_1 + 6*x_1*y_0*y_1*z_0 + x_1*y_0*y_1 + x_1*y_1*z_0 + 6*x_1*y_1 + y_0*y_1*z_0 + 6*y_0*y_1 + 6*y_1*z_0 + y_1
VERIFICATION OF LAYER-WISE GATE-VALUE PROPAGATION EQUATION
W_1(0) = 6, sum { add_1((0),x,y) [ W_2(x) + W_2(y) ] + mult_1((0),x,y) [ W_2(x) W_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 6 ✓
W_1(1) = 3, sum { add_1((1),x,y) [ W_2(x) + W_2(y) ] + mult_1((1),x,y) [ W_2(x) W_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 3 ✓
W_0() = 2, sum { add_0((),x,y) [ W_1(x) + W_1(y) ] + mult_0((),x,y) [ W_1(x) W_1(y)] } over (x,y) in {0,1}^1 × {0,1}^1 = 2 ✓
VERIFICATION OF THALER'S IDENTITY
W̃_1(0) = 6, sum { add̃_1((0),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((0),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 6 ✓
W̃_1(1) = 3, sum { add̃_1((1),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((1),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 3 ✓
W̃_1(2) = 0, sum { add̃_1((2),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((2),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 0 ✓
W̃_1(3) = 4, sum { add̃_1((3),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((3),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 4 ✓
W̃_1(4) = 1, sum { add̃_1((4),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((4),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 1 ✓
W̃_1(5) = 5, sum { add̃_1((5),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((5),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 5 ✓
W̃_1(6) = 2, sum { add̃_1((6),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((6),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 2 ✓
W̃_0() = 2, sum { add̃_0((),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^1 × {0,1}^1 = 2 ✓
expression_04 = '5*x + (3*4)'
ac_04 = ArithmeticCircuit(expression_04, prime=7, strict=False)
print(f"{expression_04} mod {ac_04.field.mod}")
display(ac_04.graphviz_circuit)
print(f"- The above is not a constant-input circuit because the input x a variable.")
print(f"- Nevertheless, we can still explore the arithmetic circuit.")
ac_04.print_topological_order()
display(ac_04.graphviz_circuit_bitstring)
print(ac_04.layers)- The above is not a constant-input circuit because the input x a variable.
- Nevertheless, we can still explore the arithmetic circuit.
TOPOLOGICAL ORDERING
2.00 -> 2.01 -> 2.10 -> 2.11 -> 1.0 -> 1.1 -> 0._
{0: {'0._'}, 1: {'1.0', '1.1'}, 2: {'2.00', '2.01', '2.10', '2.11'}}
expression_05a = '1*5 + 2*6'
expression_05b = '3*5 + 4*6'
ac_05 = ArithmeticCircuit(expression_05a, expression_05b, prime=43)
print(f"Here is an example of matrix multiplication: [ [1 2] [3 4] ] * [ [5] [6] ] ")
print(f"{expression_05a} mod {ac_05.field.mod}, {expression_05b} mod {ac_05.field.mod}")
display(ac_05.graphviz_circuit)
display(ac_05.graphviz_circuit_bitstring)
ac_05.print_topological_order()
display(ac_05.graphviz_circuit_bitstring)
ac_05.print_gate_values()
ac_05.print_tilde_W()
ac_05.print_wiring_predicates()
ac_05.print_wiring_predicate_mles()
# With prime field of size p = 43, there will be a large number of equations to print, so we just verify for a random selection
ac_05.print_verification_propagation_equation(random_selection=10)
ac_05.print_verification_propagation_equation(mle=True, random_selection=10)Here is an example of matrix multiplication: [ [1 2] [3 4] ] * [ [5] [6] ]
1*5 + 2*6 mod 43, 3*5 + 4*6 mod 43
2.001 -> 2.010 -> 2.011 -> 2.100 -> 2.101 -> 2.000 -> 1.00 -> 1.10 -> 1.11 -> 1.01 -> 0.0 -> 0.1
MULTILINEAR EXTENSIONS OF GATE-VALUE FUNCTIONS
W̃_2(x_0, x_1, x_2) = 3*x_0*x_1*x_2 + 36*x_0*x_1 + 2*x_0 + x_1 + 40*x_2 + 4
W̃_1(x_0, x_1) = 27*x_0*x_1 + 7*x_0 + 19*x_1 + 5
ADDITION WIRING PREDICATES (NONZERO VALUES)
add_0((0),(0,0),(1,0)) = 1
add_0((1),(0,1),(1,1)) = 1
MULTIPLICATION WIRING PREDICATES (NONZERO VALUES)
mult_1((0,0),(0,0,1),(0,1,0)) = 1
mult_1((0,1),(0,0,0),(1,0,0)) = 1
mult_1((1,0),(0,1,1),(1,0,0)) = 1
mult_1((1,1),(0,1,0),(1,0,1)) = 1
MULTILINEAR EXTENSIONS OF WIRING PREDICATES: ADD
add̃_1(z_0,z_1,x_0,x_1,x_2,y_0,y_1,y_2) = 0
add̃_0(z_0,x_0,x_1,y_0,y_1) = 42*x_0*x_1*y_0*y_1 + 42*x_0*x_1*y_0*z_0 + x_0*x_1*y_0 + 42*x_0*y_0*y_1*z_0 + x_0*y_0*y_1 + x_0*y_0*z_0 + 42*x_0*y_0 + x_1*y_0*y_1 + x_1*y_0*z_0 + 42*x_1*y_0 + y_0*y_1*z_0 + 42*y_0*y_1 + 42*y_0*z_0 + y_0
MULTILINEAR EXTENSIONS OF WIRING PREDICATES: MULT
mult̃_1(z_0,z_1,x_0,x_1,x_2,y_0,y_1,y_2) = 2*x_0*x_1*x_2*y_0*y_1*y_2*z_0*z_1 + 41*x_0*x_1*x_2*y_0*y_1*y_2*z_0 + 41*x_0*x_1*x_2*y_0*y_1*y_2*z_1 + x_0*x_1*x_2*y_0*y_1*y_2 + 40*x_0*x_1*x_2*y_0*y_1*z_0*z_1 + 2*x_0*x_1*x_2*y_0*y_1*z_0 + 2*x_0*x_1*x_2*y_0*y_1*z_1 + 42*x_0*x_1*x_2*y_0*y_1 + 42*x_0*x_1*x_2*y_0*y_2*z_0*z_1 + x_0*x_1*x_2*y_0*y_2*z_0 + x_0*x_1*x_2*y_0*y_2*z_1 + 2*x_0*x_1*x_2*y_0*z_0*z_1 + 42*x_0*x_1*x_2*y_0*z_0 + 42*x_0*x_1*x_2*y_0*z_1 + 42*x_0*x_1*x_2*y_1*y_2*z_0*z_1 + x_0*x_1*x_2*y_1*y_2*z_0 + x_0*x_1*x_2*y_1*y_2*z_1 + 42*x_0*x_1*x_2*y_1*y_2 + x_0*x_1*x_2*y_1*z_0*z_1 + 42*x_0*x_1*x_2*y_1*z_0 + 42*x_0*x_1*x_2*y_1*z_1 + x_0*x_1*x_2*y_1 + x_0*x_1*y_0*y_1*y_2*z_1 + x_0*x_1*y_0*y_1*z_0*z_1 + 42*x_0*x_1*y_0*y_1*z_1 + 42*x_0*x_1*y_0*y_2*z_1 + 42*x_0*x_1*y_0*z_0*z_1 + x_0*x_1*y_0*z_1 + 41*x_0*x_2*y_0*y_1*y_2*z_0*z_1 + x_0*x_2*y_0*y_1*y_2*z_0 + 2*x_0*x_2*y_0*y_1*y_2*z_1 + 42*x_0*x_2*y_0*y_1*y_2 + 2*x_0*x_2*y_0*y_1*z_0*z_1 + 42*x_0*x_2*y_0*y_1*z_0 + 41*x_0*x_2*y_0*y_1*z_1 + x_0*x_2*y_0*y_1 + x_0*x_2*y_0*y_2*z_0*z_1 + 42*x_0*x_2*y_0*y_2*z_1 + 42*x_0*x_2*y_0*z_0*z_1 + x_0*x_2*y_0*z_1 + x_0*x_2*y_1*y_2*z_0*z_1 + 42*x_0*x_2*y_1*y_2*z_0 + 42*x_0*x_2*y_1*y_2*z_1 + x_0*x_2*y_1*y_2 + 42*x_0*x_2*y_1*z_0*z_1 + x_0*x_2*y_1*z_0 + x_0*x_2*y_1*z_1 + 42*x_0*x_2*y_1 + x_0*y_0*y_1*y_2*z_0*z_1 + 42*x_0*y_0*y_1*y_2*z_1 + 42*x_0*y_0*y_1*z_0*z_1 + x_0*y_0*y_1*z_1 + 42*x_0*y_0*y_2*z_0*z_1 + x_0*y_0*y_2*z_1 + x_0*y_0*z_0*z_1 + 42*x_0*y_0*z_1 + 41*x_1*x_2*y_0*y_1*y_2*z_0*z_1 + 2*x_1*x_2*y_0*y_1*y_2*z_0 + 2*x_1*x_2*y_0*y_1*y_2*z_1 + 42*x_1*x_2*y_0*y_1*y_2 + 3*x_1*x_2*y_0*y_1*z_0*z_1 + 41*x_1*x_2*y_0*y_1*z_0 + 41*x_1*x_2*y_0*y_1*z_1 + x_1*x_2*y_0*y_1 + x_1*x_2*y_0*y_2*z_0*z_1 + 42*x_1*x_2*y_0*y_2*z_0 + 42*x_1*x_2*y_0*y_2*z_1 + 41*x_1*x_2*y_0*z_0*z_1 + x_1*x_2*y_0*z_0 + x_1*x_2*y_0*z_1 + x_1*x_2*y_1*y_2*z_0*z_1 + 42*x_1*x_2*y_1*y_2*z_0 + 42*x_1*x_2*y_1*y_2*z_1 + x_1*x_2*y_1*y_2 + 42*x_1*x_2*y_1*z_0*z_1 + x_1*x_2*y_1*z_0 + x_1*x_2*y_1*z_1 + 42*x_1*x_2*y_1 + 42*x_1*y_0*y_1*y_2*z_1 + 42*x_1*y_0*y_1*z_0*z_1 + x_1*y_0*y_1*z_1 + x_1*y_0*y_2*z_1 + x_1*y_0*z_0*z_1 + 42*x_1*y_0*z_1 + 2*x_2*y_0*y_1*y_2*z_0*z_1 + 42*x_2*y_0*y_1*y_2*z_0 + 41*x_2*y_0*y_1*y_2*z_1 + x_2*y_0*y_1*y_2 + 41*x_2*y_0*y_1*z_0*z_1 + x_2*y_0*y_1*z_0 + 2*x_2*y_0*y_1*z_1 + 42*x_2*y_0*y_1 + 42*x_2*y_0*y_2*z_0*z_1 + x_2*y_0*y_2*z_1 + x_2*y_0*z_0*z_1 + 42*x_2*y_0*z_1 + 42*x_2*y_1*y_2*z_0*z_1 + x_2*y_1*y_2*z_0 + x_2*y_1*y_2*z_1 + 42*x_2*y_1*y_2 + x_2*y_1*z_0*z_1 + 42*x_2*y_1*z_0 + 42*x_2*y_1*z_1 + x_2*y_1 + 42*y_0*y_1*y_2*z_0*z_1 + y_0*y_1*y_2*z_1 + y_0*y_1*z_0*z_1 + 42*y_0*y_1*z_1 + y_0*y_2*z_0*z_1 + 42*y_0*y_2*z_1 + 42*y_0*z_0*z_1 + y_0*z_1
mult̃_0(z_0,x_0,x_1,y_0,y_1) = 0
VERIFICATION OF LAYER-WISE GATE-VALUE PROPAGATION EQUATION
(Random selection of 4 z-values.)
W_1(1,1) = 15, sum { add_1((1,1),x,y) [ W_2(x) + W_2(y) ] + mult_1((1,1),x,y) [ W_2(x) W_2(y)] } over (x,y) in {0,1}^3 × {0,1}^3 = 15 ✓
W_1(1,1) = 15, sum { add_1((1,1),x,y) [ W_2(x) + W_2(y) ] + mult_1((1,1),x,y) [ W_2(x) W_2(y)] } over (x,y) in {0,1}^3 × {0,1}^3 = 15 ✓
W_1(1,1) = 15, sum { add_1((1,1),x,y) [ W_2(x) + W_2(y) ] + mult_1((1,1),x,y) [ W_2(x) W_2(y)] } over (x,y) in {0,1}^3 × {0,1}^3 = 15 ✓
W_1(0,1) = 24, sum { add_1((0,1),x,y) [ W_2(x) + W_2(y) ] + mult_1((0,1),x,y) [ W_2(x) W_2(y)] } over (x,y) in {0,1}^3 × {0,1}^3 = 24 ✓
(Random selection of 2 z-values.)
W_0(1) = 39, sum { add_0((1),x,y) [ W_1(x) + W_1(y) ] + mult_0((1),x,y) [ W_1(x) W_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 39 ✓
W_0(0) = 17, sum { add_0((0),x,y) [ W_1(x) + W_1(y) ] + mult_0((0),x,y) [ W_1(x) W_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 17 ✓
VERIFICATION OF THALER'S IDENTITY
(Random selection of 10 z-values.)
W̃_1(19,8) = 8, sum { add̃_1((19,8),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((19,8),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^3 × {0,1}^3 = 8 ✓
W̃_1(15,35) = 29, sum { add̃_1((15,35),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((15,35),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^3 × {0,1}^3 = 29 ✓
W̃_1(18,33) = 26, sum { add̃_1((18,33),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((18,33),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^3 × {0,1}^3 = 26 ✓
W̃_1(30,16) = 20, sum { add̃_1((30,16),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((30,16),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^3 × {0,1}^3 = 20 ✓
W̃_1(34,19) = 29, sum { add̃_1((34,19),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((34,19),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^3 × {0,1}^3 = 29 ✓
W̃_1(24,25) = 35, sum { add̃_1((24,25),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((24,25),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^3 × {0,1}^3 = 35 ✓
W̃_1(19,34) = 37, sum { add̃_1((19,34),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((19,34),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^3 × {0,1}^3 = 37 ✓
W̃_1(20,32) = 16, sum { add̃_1((20,32),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((20,32),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^3 × {0,1}^3 = 16 ✓
W̃_1(31,6) = 26, sum { add̃_1((31,6),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((31,6),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^3 × {0,1}^3 = 26 ✓
W̃_1(0,6) = 33, sum { add̃_1((0,6),x,y) [ W̃_2(x) + W̃_2(y) ] + mult̃_1((0,6),x,y) [ W̃_2(x) W̃_2(y)] } over (x,y) in {0,1}^3 × {0,1}^3 = 33 ✓
(Random selection of 10 z-values.)
W̃_0(0) = 17, sum { add̃_0((0),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((0),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 17 ✓
W̃_0(27) = 9, sum { add̃_0((27),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((27),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 9 ✓
W̃_0(4) = 19, sum { add̃_0((4),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((4),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 19 ✓
W̃_0(18) = 26, sum { add̃_0((18),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((18),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 26 ✓
W̃_0(18) = 26, sum { add̃_0((18),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((18),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 26 ✓
W̃_0(3) = 40, sum { add̃_0((3),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((3),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 40 ✓
W̃_0(22) = 28, sum { add̃_0((22),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((22),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 28 ✓
W̃_0(21) = 6, sum { add̃_0((21),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((21),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 6 ✓
W̃_0(24) = 29, sum { add̃_0((24),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((24),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 29 ✓
W̃_0(40) = 37, sum { add̃_0((40),x,y) [ W̃_1(x) + W̃_1(y) ] + mult̃_0((40),x,y) [ W̃_1(x) W̃_1(y)] } over (x,y) in {0,1}^2 × {0,1}^2 = 37 ✓
Thaler, J. (2015). A note on the GKR protocol . https://api.semanticscholar.org/CorpusID:16402332 Goldwasser, S., Kalai, Y. T., & Rothblum, G. N. (2008). Delegating computation: Interactive proofs for muggles. Proceedings of the 40th Annual ACM Symposium on Theory of Computing (STOC) , 113–122. 10.1145/1374376.1374396 Goldwasser, S., Kalai, Y. T., & Rothblum, G. N. (2015). Delegating computation: Interactive proofs for muggles. Journal of the ACM , 62 (4), 1–64. 10.1145/2699436 Cormode, G., Mitzenmacher, M., & Thaler, J. (2012). Practical verified computation with streaming interactive proofs. Proceedings of the 3rd Innovations in Theoretical Computer Science Conference (ITCS) , 90–112. 10.1145/2090236.2090245