The circuit size hierarchy #
Changing one value of a Boolean function on n inputs changes its circuit complexity by at most
2 n + 3 (complexity_update_le). Walking from a constant function, which costs exactly one gate
(complexity_const), to a hard one, one value at a time, the complexity therefore takes every
value up to the complexity of the hard function, up to 2 n + 3 (exists_complexity_mem_Ioc).
With Shannon's lower bound [Sha49], every size below 2 ^ n / n is the complexity of some
function, up to 2 n + 3, and so more gates allow strictly more languages (SIZE_ssubset).
Walking from a constant function to any function f shows that f costs at most
2 ^ n (2 n + 3) + 1 gates (complexity_le_two_pow_mul_add_one).
Main results #
Cslib.Circuits.Boolean.complexity_const: a constant costs exactly one gate.Cslib.Circuits.Boolean.complexity_update_le: changing one value costs2 n + 3gates.Cslib.Circuits.Boolean.complexity_ite_mem_le,Cslib.Circuits.Boolean.complexity_mask_le,Cslib.Circuits.Boolean.complexity_le_two_pow_mul_add_one,Cslib.Circuits.Boolean.complexity_le_of_dependsOn: the sparse and truth-table bounds, for finite supports, all functions, and functions depending on few inputs.Cslib.Circuits.Boolean.exists_complexity_mem_Ioc: complexities below that of a given function are attained, up to2 n + 3.Cslib.Circuits.Boolean.SIZE_ssubset: the size hierarchy.Cslib.Circuits.Boolean.SIZE_pow_ssubset:SIZE ((n + 1) ^ k) ⊂ SIZE ((n + 1) ^ (k + 1)).Cslib.Circuits.Boolean.SIZE_sub_ssubset_of_isLittleO: the hierarchy under the hypotheses of [AroraBarak07, Theorem 6.17], with sizes counting input vertices.
References #
Changing one value of a Boolean function costs at most 2 n + 3 gates.
Finite override of a constant. Returning f x on a finite set S and the constant c
outside S costs at most #S * (2 * n + 3) + 1 gates: start from the constant c and change
one value in S at a time.
Restricting a Boolean function f to S and returning false outside S costs at most
#S * (2 * n + 3) + 1 gates (complexity_ite_mem_le with the constant false).
The truth-table bound. A Boolean function on n inputs costs at most
2 ^ n * (2 * n + 3) + 1 gates: start from a constant and change one value at a time.
A Boolean function that depends only on the inputs in s costs at most
2 ^ #s * (2 * #s + 3) + 1 gates.
A constant function costs exactly one gate: a circuit without gates outputs an input.
Every complexity below that of a given function is exceeded by at most 2 n + 3 by the
complexity of some function.
The circuit size hierarchy. If s ≤ t, t is positive, eventually
s n + 2 n + 3 ≤ t n, and infinitely often s n < 2 ^ n / n, then some language has circuits of
size t but not of size s.
The circuit size hierarchy under the draft's hypotheses [AroraBarak07, Theorem 6.17]. If
n < T n < T' n for every n, eventually T' n < 2 ^ n / (100 n), and T log T = o(T'), then
circuits with T' n vertices decide strictly more languages than circuits with T n vertices.
The draft counts the n input vertices in the size of a circuit, so its SIZE (T(n)) is
SIZE (fun n => T n - n) here, under the convention of SIZE: the library's circuits may also
use constant gates and need no separate output vertex. The cap 2 ^ n / (100 n) > T'(n) is
read eventually, as is standard for asymptotic hypotheses: the literal every-n reading cannot
hold for n ≤ 14 and would make the theorem vacuous. The other two bounds are assumed for every
n, as printed. The proof reduces to SIZE_ssubset: T log T = o(T') gives the gap of
2 n + 3 gates, and the draft's bound keeps T below Shannon's 2 ^ n / n.