Barrington's theorem with a length bound #
Circuits/BarringtonRepr.lean proves the existence of a width-5 permutation
branching program for every Boolean formula, but discards the program's length.
This module tracks both the original wrapper-based construction and the optimized
textbook construction. Pointwise conjugation retargets a program without changing
its length, while compact negation folds the final constant into the last
instruction. The resulting binary-gate recurrence is exactly fourfold and proves
the classical 4 ^ depth bound.
Main results #
Complexity.BP.length_inverse— program inversion preserves length.Complexity.BP.Computes_retarget_len,Complexity.BP.Computes_and5_len— compatibility bounds for the original wrapper construction.Complexity.BP.Computes_and5_tight— the exact additive-free commutator length recurrence.Complexity.barringtonBound,Complexity.barringtonBound_le— the explicit original length recurrence and its13 ^ sizeclosed form.Complexity.Computes_formula_len— the length-tracked formula recursion.Complexity.Computes_formula_depth_four— optimized formula recursion with the textbook4 ^ depthbound.Complexity.barrington_representation_len— Barrington's theorem with the13 ^ sizelength bound.Complexity.barrington_representation_depth_four— Barrington's theorem with the textbook4 ^ depthlength bound.
Inverting a branching program preserves its length.
Compatibility retargeting bound. Pointwise conjugation actually preserves length exactly, which is stronger than the historical two-instruction bound.
Length-tracked AND gate: the commutator construction at most doubles the two
subprograms and adds a constant from the two retargetings.
Tight Barrington AND gate. Pointwise retargeting has zero overhead, so
the commutator program has exactly twice the sum of the two input lengths.
Explicit length bound for the Barrington branching-program construction,
following its recurrence: leaves cost ≤ 1, negation adds 1, and the AND
/ OR steps double the children and add a constant.
Equations
- Complexity.barringtonBound (Complexity.BoolFormula.var i) = 1
- Complexity.barringtonBound Complexity.BoolFormula.tru = 1
- Complexity.barringtonBound Complexity.BoolFormula.fls = 0
- Complexity.barringtonBound φ.neg = Complexity.barringtonBound φ + 1
- Complexity.barringtonBound (φ.conj ψ) = 2 * Complexity.barringtonBound φ + 2 * Complexity.barringtonBound ψ + 8
- Complexity.barringtonBound (φ.disj ψ) = 2 * Complexity.barringtonBound φ + 2 * Complexity.barringtonBound ψ + 13
Instances For
The construction bound is dominated by 13 ^ (size φ).
The construction bound is also dominated by 17 ^ (depth φ). Because depth is
the NC¹ measure, this is the load-bearing bound: a formula of depth
d = O(log n) compiles to a width-5 program of length 17^d = poly(n) — the
NC¹ ⊆ polynomial-size width-5 branching programs direction of Barrington.
Length-tracked formula representability. Every Boolean formula φ is
computed through any target 5-cycle by a program of length at most
barringtonBound φ. Same recursion as Computes_formula, carrying the length
bound through the length-tracked moves.
Textbook depth-tracked formula representability. Every Boolean formula
φ is represented through any target 5-cycle by a program of length at most
4 ^ depth φ. Pointwise retargeting contributes no instructions, compact
negation contributes no length beyond max 1, and each binary gate uses the
four copies in the commutator construction.
Barrington's theorem with a length bound. Every Boolean formula φ is
computed by a width-5 permutation branching program (a nonidentity σ ∈ S₅
with program-value = σ ↔ φ true) whose length is at most 13 ^ (size φ).
Barrington's theorem, textbook finite form. Every Boolean formula φ
of depth d is computed by a width-5 permutation branching program of length
at most 4 ^ d.
Compatibility form of the earlier depth bound. The textbook theorem
barrington_representation_depth_four now gives the stronger base 4; this
corollary retains the former base-17 API.
Log-depth formulas have quadratic-length width-5 programs. A formula
of depth at most log₂ n compiles to a program of length at most n².
NC¹ ⟹ polynomial size (concrete form). A formula of depth at most log₂ n
is computed by a width-5 permutation branching program of length at most
n ^ 5 — the polynomial-size direction of Barrington made explicit: the program
is polynomial-size in n whenever the formula's depth is logarithmic.