Documentation

Complexity.Computability.Circuit.Boolean.Hierarchy

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 #

References #

Changing one value of a Boolean function costs at most 2 n + 3 gates.

theorem Cslib.Circuits.Boolean.complexity_mask_le {n : ℕ} (f : BooleanFunction n) (S : Finset (Fin n → Bool)) :
complexity interpretation (single fun (x : Fin n → Bool) => decide (x ∈ S) && f x) ≤ S.card * (2 * n + 3) + 1

Restricting a Boolean function f to S and returning false outside S costs at most #S * (2 * n + 3) + 1 gates: start from the constant false and change one value in S at a time.

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.

theorem Cslib.Circuits.Boolean.SIZE_ssubset {s t : ℕ → ℕ} (hst : s ≤ t) (ht : ∀ (n : ℕ), 1 ≤ t n) (hgap : ∀ᶠ (n : ℕ) in Filter.atTop, s n + (2 * n + 3) ≤ t n) (hs : ∃ᶠ (n : ℕ) in Filter.atTop, ↑(s n) < 2 ^ n / ↑n) :
SIZE s ⊂ SIZE t

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.

theorem Cslib.Circuits.Boolean.SIZE_pow_ssubset {k : ℕ} (hk : 1 ≤ k) :
(SIZE fun (n : ℕ) => (n + 1) ^ k) ⊂ SIZE fun (n : ℕ) => (n + 1) ^ (k + 1)

The polynomial size hierarchy. For k ≥ 1, circuits of size (n + 1) ^ (k + 1) decide strictly more languages than circuits of size (n + 1) ^ k.