Polynomial-time compilation of CNF parity checks to sparse ๐ฝโ monomial systems #
This module implements the executable sparse ๐ฝโ polynomial compilation and heavy-variable
restriction algorithms from ยง5.5 (pp. 38โ39) and ยง6 / ยง6.2โ6.3 (pp. 39โ40, 42โ43) of
OpenAI, The Exponential Time Hypothesis is False:
- Canonical monomial-list algebra over
๐ฝโ: strictly increasing monomials (IsCanonicalMonomial), duplicate-free equations (IsCanonicalEquation), Boolean evaluation (evalMonomialList,evalSystem), and mod-2 symmetric difference (xorEquation). - Clause falsification and parity-row compilation (ยง6 eq. (6.1), ยง6.2โ6.3):
compileClause,compileParityRow, andcompileParitySystem, plus width-kguarded polynomial-time variants (compileClauseBounded,compileParityRowBounded,compileParitySystemBounded). - Heavy-variable detection and single-variable restriction (ยง5.5):
equationVars,varDegree,findHeavyVar,restrictEquation, andrestrictSystem, all certified by plainComputableInPolyTime.
Main definitions #
Cslib.Complexity.IsCanonicalMonomial,Cslib.Complexity.IsCanonicalEquation: canonical sorted monomials and duplicate-free sparse๐ฝโequations.Cslib.Complexity.evalMonomialList,Cslib.Complexity.evalSystem: Boolean evaluation of a sparse๐ฝโequation and common-zero test for a sparse system.Cslib.Complexity.toggleMonomial,Cslib.Complexity.reduceEquation,Cslib.Complexity.xorEquation: executable mod-2 duplicate cancellation and symmetric difference.Cslib.Complexity.insertSorted,Cslib.Complexity.sortDedup: strictly increasing variable insertion and deduplication.Cslib.Complexity.isTautologicalClause,Cslib.Complexity.compileClause,Cslib.Complexity.compileParityRow,Cslib.Complexity.compileParitySystem: executable clause falsification and parity-row compilation.Cslib.Complexity.compileClauseBounded,Cslib.Complexity.compileParityRowBounded,Cslib.Complexity.compileParitySystemBounded: width-kguarded polynomial-time compilers.Cslib.Complexity.equationVars,Cslib.Complexity.varDegree,Cslib.Complexity.findHeavyVar: equation variable support, variable incidence degree, and heavy-variable finder.Cslib.Complexity.restrictEquation,Cslib.Complexity.restrictSystem: single-variable Boolean substitution on sparse๐ฝโequations and systems.
Main results #
Cslib.Complexity.evalMonomialList_xorEquation,Cslib.Complexity.length_xorEquation_le,Cslib.Complexity.isCanonicalEquation_xorEquation,Cslib.Complexity.length_enc_reduceEquation_le,Cslib.Complexity.computableInPolyTime_reduceEquation,Cslib.Complexity.computableInPolyTime_xorEquation: mod-2 equation reduction/addition specs.Cslib.Complexity.bitVal_evalMonomialList_eq_sum_monomial,Cslib.Complexity.bitVal_evalMonomialList_mem_lowDegree: bridge toBitString.monomial (ZMod 2)andBitString.lowDegree (ZMod 2) โ k.Cslib.Complexity.evalMonomialList_compileClause,Cslib.Complexity.length_compileClause_le,Cslib.Complexity.length_mem_compileClause_le,Cslib.Complexity.isCanonicalEquation_compileClause: clause compilation semantics and bounds.Cslib.Complexity.evalMonomialList_compileParityRow_eq_dotProduct,Cslib.Complexity.evalSystem_compileParitySystem_iff_passesTests,Cslib.Complexity.length_compileParityRow_le,Cslib.Complexity.length_mem_compileParityRow_le: parity-row semantics and sparsity/degree bounds.Cslib.Complexity.computableInPolyTime_compileClauseBounded,Cslib.Complexity.computableInPolyTime_compileParityRowBounded,Cslib.Complexity.computableInPolyTime_compileParitySystemBounded: polynomial-time compilation.Cslib.Complexity.findHeavyVar_eq_some_iff,Cslib.Complexity.findHeavyVar_eq_none_iff,Cslib.Complexity.evalMonomialList_restrictEquation,Cslib.Complexity.length_restrictEquation_le,Cslib.Complexity.length_mem_restrictEquation_le,Cslib.Complexity.not_mem_of_mem_restrictEquation,Cslib.Complexity.computableInPolyTime_varDegree,Cslib.Complexity.computableInPolyTime_findHeavyVar,Cslib.Complexity.computableInPolyTime_restrictEquation,Cslib.Complexity.computableInPolyTime_restrictSystem: heavy-variable and restriction specs.
References #
- OpenAI, The Exponential Time Hypothesis is False, ยง5.5 (pp. 38โ39) and ยง6 / ยง6.2โ6.3 (pp. 39โ40, 42โ43)
1. Canonical Sparse ๐ฝโ Monomial-List Representation & Mod-2 Algebra #
A canonical multilinear monomial is a strictly increasing list of variable indices.
Instances For
On a canonical equation eq, reading evalMonomialList eq ฯ in ZMod 2 equals the Finset
sum of BitString.monomial (ZMod 2) over (eq.map List.toFinset).toFinset.
Every sparse ๐ฝโ equation whose monomials have length at most k defines a Boolean-cube
function of ZMod 2-degree at most k.
Cancel duplicate monomials in eq modulo 2 by folding toggleMonomial from [].
Instances For
xorEquation preserves canonical sorted monomials and Nodup.
xorEquation evaluates to the Boolean XOR of the two equations' evaluations.
xorEquation outputs at most eq1.length + eq2.length monomials.
2. Executable Clause Falsification & Parity-Row Compiler (ยง6 eq. (6.1) & ยง6.3) #
Check whether clause c contains both (v, true) and (v, false) for some v.
Instances For
Sorted distinct positive-literal variables of c.
Instances For
Sorted distinct negative-literal variables of c.
Instances For
Compile the falsification indicator v_c(x) = !c.eval x of a clause c : Clause โ into a
canonical sparse ๐ฝโ polynomial (ยง6, p. 39). Tautological clauses compile to [] (0).
Instances For
compileClause c always produces a canonical sparse ๐ฝโ equation.
Every variable occurring in compileClause c is a variable of c.
Every monomial in compileClause c has length at most c.length.
compileClause c expands into at most 2 ^ c.length monomials.
Exact clause falsification semantics (ยง6, p. 39): compileClause c evaluates to
!c.eval ฯ for every assignment ฯ.
Compile a parity-check row row : List Bool on ฯ : CNF โ into a sparse ๐ฝโ polynomial
equation by XORing compileClause ฯ[e] over e < ฯ.length with row.getD e false = true.
Instances For
When every clause of ฯ has width at most k, every monomial in compileParityRow ฯ row has
degree at most k.
Row sparsity bound (ยง6.2, p. 42): when every clause of ฯ has width at most k,
compileParityRow ฯ row contains at most row.count true * 2 ^ k monomials.
Exact parity-row semantics (ยง6 eq. (6.1)): compileParityRow ฯ row evaluates to the ๐ฝโ
dot product of row with ฯ.violations ฯ.
System acceptance equivalence: ฯ is a common zero of compileParitySystem ฯ rows over
๐ฝโ if and only if ฯ passes all parity tests represented by rows on ฯ.violations.
Width-k guarded clause compiler (agrees with compileClause on clauses of width โค k).
Instances For
Width-k guarded parity-row compiler.
Instances For
3. Executable Heavy-Variable Finder & Variable Restriction (ยง5.5, pp. 38โ39) #
findHeavyVar n bโ sys = some v iff v < n is minimal with varDegree v sys > bโ.
findHeavyVar n bโ sys = none iff every v < n occurs in at most bโ equation scopes.
restrictEquation never increases the number of monomials.
restrictEquation v val eq eliminates v from all output monomials.
Exact variable-restriction semantics (ยง5.5, p. 38): evaluating restrictEquation v val eq
on ฯ agrees with evaluating eq on Function.update ฯ v val.
4. Polynomial-Time Complexity Proofs (Plain ComputableInPolyTime) #
Mod-2 duplicate monomial cancellation reduceEquation is polynomial-time.
Mod-2 equation symmetric difference xorEquation is polynomial-time.
For any fixed width bound k : โ, compiling a clause with width guard k into a canonical
sparse ๐ฝโ polynomial is polynomial-time.
Reducing an equation modulo 2 (reduceEquation) does not increase its encoded length.
For any fixed width bound k : โ, compiling a parity-check row on ฯ : CNF โ is
polynomial-time (for any sized Boolean list encoding encRow, such as encBits or
encList encBool).
For any fixed width bound k : โ, compiling a list of parity-check rows on ฯ : CNF โ into a
sparse degree-โค k ๐ฝโ polynomial system is polynomial-time.
Computing varDegree v sys (returned in unary) is polynomial-time.
Finding the first heavy variable v < n with varDegree v sys > bโ (n in unary, bโ in
binary, result in encOption encNat) is polynomial-time.
Substituting x_v = val into a sparse ๐ฝโ equation (restrictEquation) is polynomial-time.
Substituting x_v = val across a sparse ๐ฝโ system (restrictSystem) is polynomial-time.