Searching the three-wise independent sample space runs in polynomial time #
Exhaustive search of the three-wise independent sample space (Cslib.Logic.PL.paritySearch) is
polynomial-time for any encoding of the variables, with literals encoded by encPair and clauses
and formulas by encList (Cslib.Logic.PL.computableInPolyTime_paritySearch). A sample bit is a
Boolean fold over the seed and the low binary digits of a position, computed in unary by idxOf
and converted to binary. The seeds of ⌈log₂ n⌉ + 1 bits are enumerated by bitsEnumList; there
are at most 4 n + 4 of them (Nat.two_pow_clog_two_le), so the enumeration has polynomial size.
Counting falsified clauses is polynomial-time, and the search is a fold over the candidates whose
step reads the input formula. Every candidate is a sublist of the distinct variables
(Cslib.Logic.PL.sublist_of_mem_parityCandidates), which bounds the state.
Main results #
Cslib.Logic.PL.computableInPolyTime_paritySample: a sample bit.Cslib.Logic.PL.computableInPolyTime_parityCandidates: the points of the sample space.Cslib.Logic.PL.computableInPolyTime_paritySearch: the search.
References #
Computing the value a seed gives a variable is polynomial-time.
One step of the search, reading the formula, is polynomial-time.
Listing the points of the sample space is polynomial-time.
Every point of the sample space lists some of the variables, in order.
Searching the three-wise independent sample space is polynomial-time, for any encoding of the variables.