Documentation

Complexity.Computability.Circuit.Boolean.Barrington

Barrington's theorem #

Barrington's theorem: a De Morgan formula of depth d, with negations free, becomes a permutation branching program of width 5 and length at most 4 ^ d, which is a fixed 5-cycle on the inputs where the formula is true and the identity elsewhere (Formula.exists_monoidProgram_computes) [Bar89], Jukna, Section 15.4. The programs here are the programs over Boolean inputs BitString n = Fin n → Bool, those of MonoidProgram (Fin n) Bool M.

The construction works for every 5-cycle σ at once. An input xᵢ reads xᵢ and selects σ or the identity (Instruction.cond i σ 1). A negation σ⁻¹-computes its argument and multiplies by σ. For a conjunction, σ is the commutator ⁅α, β⁆ = α β α⁻¹ β⁻¹ of two 5-cycles (Equiv.Perm.IsFiveCycle.exists_commutator); running the programs for the arguments with α and β, then their inverses, gives σ exactly when both arguments are true. A disjunction is the negation of the conjunction of the negations. This works in any group with a set of elements closed under inverses in which every element is a commutator of two of them (Formula.exists_monoidProgram_computes_of_forall_commutator). Five-cycles are even, so the programs select only elements of the alternating group A₅ (Formula.exists_monoidProgram_alternatingGroup_computes); mapped into S₅, they are permutation branching programs of width 5 (Formula.exists_monoidProgram_computes).

Conversely, whether a branching program of width w, a program over Function.End (Fin w), maps a to b is a formula of depth O(log w · log L): split the program in halves and take the disjunction over the middle values (MonoidProgram.entryFormulaMul), recursively along a balanced tree (MonoidProgram.entryFormula, by List.balancedFold). So a branching program of width w and length L is a formula of depth (⌈log₂ w⌉ + 1) ⌈log₂ L⌉ + ⌈log₂ w⌉ (MonoidProgram.exists_formula), with negations only at the leaves, and constant-width polynomial-length branching programs and logarithmic-depth formulas compute the same functions.

Main definitions #

Main results #

References #

Barrington's theorem #

theorem Cslib.Circuits.Formula.exists_monoidProgram_computes_of_forall_commutator {n : ℕ} {G : Type u_1} [Group G] [NeZero n] {C : Set G} (hinv : ∀ σ ∈ C, σ⁻¹ ∈ C) (hcomm : ∀ σ ∈ C, ∃ α ∈ C, ∃ β ∈ C, ⁅α, β⁆ = σ) (F : Formula Boolean.signature n) {σ : G} (hσ : σ ∈ C) :

Barrington's construction in a group G. Let C be a set of elements of G, closed under inverses, in which every element is the commutator of two elements of C. For every σ ∈ C, a De Morgan formula of depth d, with negations and constants free, has a program over G of length at most 4 ^ d that σ-computes it.

Barrington's theorem in A₅. For every 5-cycle σ, a De Morgan formula of depth d, with negations and constants free, is σ-computed by a program of length at most 4 ^ d over the alternating group A₅: five-cycles are even.

Barrington's theorem. For every 5-cycle σ, a De Morgan formula of depth d, with negations and constants free, has a permutation branching program of width 5 and length at most 4 ^ d that σ-computes it: the program over A₅ mapped into S₅.

A function of formula depth d is σ-computed, for every 5-cycle σ, by a program over the alternating group A₅ of length at most 4 ^ d.

A function of formula depth d is σ-computed, for every 5-cycle σ, by a permutation branching program of width 5 and length at most 4 ^ d.

The converse #

The formula saying that an instruction of a width-w branching program maps a to b: a constant or a literal.

Instances For

    The formula of an instruction is a constant or a literal, so in negation normal form.

    The formulas saying that two pieces of a branching program of width w, run one after the other, map a to b, from the formulas u and v of the two pieces: the second piece, which acts first, maps a to some c that the first piece maps to b.

    Instances For

      The formula saying that a branching program of width w maps a to b: split the program in halves, and say that the second half maps a to some c that the first half maps to b (List.balancedFold).

      Instances For

        The formula saying that a branching program maps a to b has negations only at the leaves.

        Branching programs give formulas. A branching program of width w and length L, started at a and accepting at the states of acc, is computed by a De Morgan formula of depth at most (⌈log₂ w⌉ + 1) ⌈log₂ L⌉ + ⌈log₂ w⌉, with negations only at the leaves (Formula.IsNNF).

        Permutation branching programs give formulas. A permutation branching program of width w and length L that σ-computes f, with σ ≠ 1, is turned into a De Morgan formula computing f of depth at most (⌈log₂ w⌉ + 1) ⌈log₂ L⌉ + ⌈log₂ (w ^ 2)⌉, with negations only at the leaves (Formula.IsNNF): f is true where some a is mapped to some b ≠ a.