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.

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.

theorem Cslib.Circuits.Boolean.exists_lt_le_add_of_update_le {ι : Type u_1} {α : Type u_2} [Finite ι] [DecidableEq ι] (μ : (ι → α) → ℕ) {B t : ℕ} (hμ : ∀ (w : ι → α) (i : ι) (a : α), μ (Function.update w i a) ≤ μ w + B) {u v : ι → α} (hu : μ u ≤ t) (hv : t < μ v) :
∃ (w : ι → α), t < μ w ∧ μ w ≤ t + B

Discrete intermediate values. If changing one coordinate raises a measure by at most B, and the measure is at most t at u and above t at v, then it lies in (t, t + B] somewhere.

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.