Lookup tables and local maps #
Two size bounds for multi-output Boolean functions, used when a circuit reads a hard-wired table.
A lookup table is an arbitrary map D from a index bits to r output bits. One shared
decoder computes the 2 ^ a minterms of the index, with 2 a + 1 gates each, and every output
bit is the disjunction of the minterms of the indices where it is set. So D costs at most
2 ^ a * (2 a + 1) + r * (2 ^ a + 1) gates (complexity_le_lookup): linear in the number of
table entries times the index and output widths, instead of r separate truth tables.
A local map is one where every output bit depends on at most t inputs. Each output then costs
at most the truth-table bound on t inputs, so the whole map costs at most
r * (2 ^ t * (2 t + 3) + 1) gates (complexity_le_mul_of_forall_dependsOn); for constant t
this is linear in the number of outputs.
A selected answer reads one of q answer bits z, chosen by the inputs in a set s. Disjoining
one minterm conjoined with its selected answer wire for each assignment of s costs at most
2 ^ #s * (2 #s + 3) + 1 gates whatever q is (complexity_select_le). Learners use this to read
the answers to their queries from input wires.
Main results #
Cslib.Circuits.Boolean.complexity_le_lookup: a table onaindex bits withroutput bits costs at most2 ^ a * (2 * a + 1) + r * (2 ^ a + 1)gates.Cslib.Circuits.Boolean.complexity_le_mul_of_forall_dependsOn: a map whoseroutputs each depend on at mosttinputs costs at mostr * (2 ^ t * (2 * t + 3) + 1)gates.Cslib.Circuits.Boolean.complexity_select_le: reading the answer bit selected by the inputs inscosts at most2 ^ #s * (2 * #s + 3) + 1gates.
Lookup tables. Any map from a index bits to r output bits costs at most
2 ^ a * (2 * a + 1) + r * (2 ^ a + 1) gates: a shared decoder computes every minterm of the
index, and each output bit is the disjunction of the minterms of the indices where it is set.
Local maps. A map whose r outputs each depend on at most t of its inputs costs at most
r * (2 ^ t * (2 * t + 3) + 1) gates: compute each output from its truth table on those inputs.
Reading a selected answer. On inputs z ++ x, returning the answer bit
z (sel (x restricted to s)) costs at most 2 ^ #s * (2 * #s + 3) + 1 gates, the bound of
complexity_le_of_dependsOn for a function of s alone: one minterm and two gates for each
assignment of s. The answer bits z are not part of that count, whereas treating the map as a
function of s and all of z would cost 2 ^ (#s + q).