Fixed-width element distinctness has a short item-by-item unit-SAT encoding
ProvedPvsNP.DistinctnessToSAT.fixed_width_stream_reductioncomplexity-theoryformal-verification
For n items of b positive bits with n at most 2^b, the emitted SAT word is satisfiable exactly when the items are pairwise distinct. Its bit length is at most 10nb². The full word is the concatenation of the blocks whose position, item, and common width determine them.
Preamble
import Definitions.Def_ElementDistinctnessUnitSAT import Definitions.Def_Complexitylib_0ebd467_Foundations_Data_Nat_Bits set_option autoImplicit false open PvsNP PvsNP.DistinctnessToSAT
Formal statement
theorem PvsNP.DistinctnessToSAT.fixed_width_stream_reduction {n : ℕ}
(items : Fin n → ℕ) (itemBits : ℕ)
(positive : 0 < itemBits) (enoughPositions : n ≤ 2^itemBits)
(fitsItems : ∀ i, items i < 2^itemBits) :
(word items itemBits ∈ SAT ↔ Function.Injective items) ∧
(word items itemBits).length ≤ 10*(n*itemBits)*itemBits ∧
word items itemBits = (List.finRange n).flatMap
(fun i => itemWord i.val (items i) itemBits) := by sorrySource
An explicit reduction using the mission CNF delimiters and injective variable identifiers.