An executable Barrington compiler #
This module turns the finite Barrington theorem into an explicit recursive
compiler. Earlier existence proofs selected S₅ conjugators in Prop; here,
allPermutationsFin gives a computable enumeration and firstConjugator5
performs a deterministic finite search. The resulting barringtonCompile
contains no choice operation.
For every Boolean formula and target 5-cycle, the compiler returns a width-5
permutation branching program with exact representation semantics and the
textbook length bound 4 ^ depth. The remaining work for a fully uniform
Barrington theorem is therefore serialization and a resource-bounded generator
proof, not extraction of program data from an existential theorem.
Main results #
Complexity.firstConjugator5_spec-- correctness of finite conjugator search.Complexity.barrington_commutator-- the searched factors decompose every target5-cycle.Complexity.barringtonCompile_computes-- exact compiler semantics.Complexity.barringtonCompile_length_le-- length at most4 ^ depth.Complexity.barringtonCompile_var_bound-- no new queried variables.Complexity.barringtonCompile_representation-- constructive finite Barrington theorem for the fixed canonical target cycle.
allPermutationsFin n contains every permutation of Fin n.
If two permutations are conjugate, the executable finite search returns a valid conjugator.
The fixed left base permutation is a 5-cycle.
The fixed right base permutation is a 5-cycle.
The fixed commutator target is a 5-cycle.
The canonical left factor is a 5-cycle for every target value.
The canonical right factor is a 5-cycle for every target value.
The executable factors have commutator equal to any target 5-cycle.
The four-block commutator program has exactly twice the sum of the source lengths.
The executable compiler represents a formula through any target 5-cycle.
The executable compiler satisfies the textbook 4 ^ depth length bound.
The executable compiler reads no formula-external variable: any bound on
the source formula's variable indices bounds every emitted instruction.
Constant instructions use variable zero, so the bound is stated for a natural
upper bound rather than as a literal subset of formula.vars.
The canonical target cycle is nonidentity.
Constructive finite Barrington theorem. The explicit compiled program
evaluates to the fixed target barringtonTargetBase exactly when the formula is
true (and to the identity otherwise), the target is not the identity, and the
program's length is at most 4 ^ depth. That the target is a 5-cycle is the
separate theorem barringtonTargetBase_spec; this statement records only that
it is nonidentity.