Khrapchenko's bound #
For sets A of inputs where a formula is 1 and B of inputs where it is 0,
let edges A B be the pairs in A × B at Hamming distance one. Khrapchenko's
theorem says that every De Morgan formula separating A from B has at least
|edges A B|² / (|A| · |B|) leaves (Formula.sq_card_edges_le, stated without
division). A literal leaf can only separate along its own coordinate, so its
edges form a partial matching, and a gate splits one side of the rectangle,
where the Cauchy–Schwarz inequality makes the measure subadditive.
If every input of a nonempty A has at least s₁ neighbours in a nonempty B and
every input of B has at least s₀ neighbours in A, every formula separating them
has at least s₀ · s₁ leaves (Formula.mul_le_leaves_of_neighbours); taking the
one-inputs and zero-inputs of f gives the bound for sensitive functions
(leaves_ge_of_sensitive). Parity is sensitive to every coordinate everywhere, so
every De Morgan formula for parity on n ≥ 1 bits has at least n² leaves
(parity_sq_le_leaves). The inputs of weight k and k - 1 show that the threshold
function "at least k ones" needs k · (n + 1 - k) leaves for 1 ≤ k ≤ n
(threshold_mul_le_leaves), so strict majority needs ((n + 1) / 2)² leaves for odd
n (majority_mul_le_leaves).
These corollaries use only the rectangle bound |edges A B|² ≤ M · |A| · |B| for sets A
of one-inputs and B of zero-inputs of f (KhrapchenkoBound f M). They are proved for
every such M (KhrapchenkoBound.mul_le_of_sensitive, KhrapchenkoBound.parity_sq_le,
KhrapchenkoBound.threshold_mul_le, KhrapchenkoBound.majority_mul_le) and specialized to
formulas, where M is the number of leaves (Formula.khrapchenkoBound), so other models
that satisfy the rectangle bound inherit them.
Splitting the inputs in half gives formulas with exactly 4 ^ k leaves for
parity on 2 ^ k bits, so formulaSize parity = n² when n is a power of two
(formulaSize_parity_two_pow).
The Khrapchenko measure #
The input x with coordinate i flipped.
Equations
- Algebraic.KW.flip x i = Function.update x i !x i
Instances For
A literal separating A from B has at most |A| edges: each one-input has
only one candidate partner, obtained by flipping the literal's coordinate.
Khrapchenko's theorem for a formula computing f, on the full rectangle of
one-inputs and zero-inputs.
M bounds the Khrapchenko measure of f: for every set A of one-inputs and every
set B of zero-inputs of f, |edges A B|² ≤ M · |A| · |B|. A formula computing f
gives this bound with M its number of leaves (Formula.khrapchenkoBound); the
corollaries below depend only on this bound, not on the model of computation.
Equations
Instances For
Khrapchenko's theorem as a bound on the measure of the computed function.
Neighbour counts #
The coordinates at which flipping x lands in S.
Equations
- Algebraic.KW.neighbours S x = {i : Fin n | Algebraic.KW.flip x i ∈ S}
Instances For
Neighbour counts against a measure bound. If |edges A B|² ≤ M · |A| · |B| for
nonempty A and B, every input of A has at least s₁ neighbours in B, and every
input of B has at least s₀ neighbours in A, then s₀ · s₁ ≤ M.
Khrapchenko's bound from neighbour counts. If a formula separates nonempty
A from nonempty B, every input of A has at least s₁ neighbours in B, and
every input of B has at least s₀ neighbours in A, the formula has at least
s₀ · s₁ leaves.
Sensitive functions #
The coordinates of x at which flipping changes f.
Equations
- Algebraic.KW.sensitiveCoordinates f x = {i : Fin n | f (Algebraic.KW.flip x i) ≠ f x}
Instances For
Sensitivity against a measure bound. If every one-input of f is sensitive on at
least s₁ coordinates, every zero-input on at least s₀, and f takes both values, then
every bound M on the Khrapchenko measure of f satisfies s₀ · s₁ ≤ M.
Khrapchenko's bound for sensitive functions. If every one-input of f is
sensitive on at least s₁ coordinates, every zero-input on at least s₀, and f
takes both values, every De Morgan formula for f has at least s₀ · s₁ leaves.
Parity #
Parity against a measure bound. Every bound on the Khrapchenko measure of the
parity of n ≥ 1 bits is at least n².
Khrapchenko's bound for parity. Every De Morgan formula computing the
parity of n ≥ 1 bits has at least n² leaves.
Threshold functions #
The threshold function: at least k of the inputs are one.
Equations
- Algebraic.KW.threshold k x = decide (k ≤ Algebraic.KW.weight x)
Instances For
Strict majority: more than half of the inputs are one (ties are false).
Equations
- Algebraic.KW.majority = Algebraic.KW.threshold (n / 2 + 1)
Instances For
An input whose first k coordinates are one and the rest zero.
Equations
- Algebraic.KW.prefixOnes k i = decide (↑i < k)
Instances For
Threshold functions against a measure bound. For 1 ≤ k ≤ n, every bound on the
Khrapchenko measure of "at least k of n inputs are one" is at least k · (n + 1 - k):
the inputs of weight k and k - 1 form the rectangle.
Khrapchenko's bound for threshold functions. For 1 ≤ k ≤ n, every De Morgan
formula computing "at least k of n inputs are one" has at least k · (n + 1 - k)
leaves: the inputs of weight k and k - 1 form the rectangle.
Majority against a measure bound. For n ≥ 1, every bound on the Khrapchenko
measure of strict majority of n inputs is at least (n - ⌊n/2⌋) · (⌊n/2⌋ + 1).
A matching upper bound at powers of two #
Parity on 2 ^ k bits as a balanced formula with 4 ^ k leaves.
Equations
- One or more equations did not get rendered due to their size.
- Algebraic.KW.parityFormula 0 = Algebraic.KW.Formula.lit 0 true
Instances For
Formula size of parity. At n = 2 ^ k bits the minimum number of leaves
of a De Morgan formula computing parity is exactly n².