Neural Networks as Products of Boolean Functions

Setup

A second, reversible variant replaces non-reversible primitives by a reversible embedding using ancillary bits.

Reduction of a Neural Net to a Straight-Line Program

Model. Fix:

Observation. Under these choices, a forward pass is a straight-line program (no data-dependent loops; conditionals arise only from comparisons inside activations like ReLU or explicit branches). Thus the net computes some function F by composing a finite number of primitives, each of which itself is a finite function on bit-vectors.

Each Primitive is a Product of Boolean Functions

Any k-bit adder, multiplier, comparator, mux, table lookup, and each fixed-width activation implementation has a known combinational boolean circuit. Therefore:

Induction on the Abstract Syntax Tree (AST)

Define a minimal typed functional core for forward passes:

Claim (by structural induction).
For every term t denoting a b-bit value, there exists a tuple of boolean formulas [t]=f1(t)(x),,fb(t)(x) over the input bits x such that evaluation of t equals this tuple.

Proof sketch.

Thus, by induction on the AST, the whole network’s output [net] is a product of boolean functions of the input bits.
This also immediately yields a boolean circuit (replace boolean formulas by gates), and hence extensional equality on {0,1}n.

Reversible Version (with Ancilla)

Neural primitives are generally non-bijective. To embed computation reversibly, use the standard Bennett trick:

Therefore the network’s function embeds into a reversible boolean permutation on a larger space, i.e., a product of reversible boolean functions with ancillas.

Converse Direction (for Completeness)

Any boolean function f:{0,1}n{0,1} can be computed by a small neural net:

Thus we have equivalence up to the chosen bit-encoding.

Edge Cases and Objections

Summary (the "One-Line" Induction)

Fix a finite bit-encoding of all values. Interpret inference as a term in a first-order functional language whose leaves are input bits/constants and whose internal nodes are finite-arity primitives. Each primitive denotes a product of boolean functions; pairing, projection, composition, and conditional preserve "being a product of boolean functions." By structural induction on the AST, the whole network denotes a product of boolean functions of the input bits. Moreover, by Bennett’s method and Toffoli universality, the same computation admits a reversible embedding with ancillas.