Fixed-weight bit-mask enumeration has no duplicates
ProvedThreeSum.SubsetAddress.enumerateLayer_nodup3sumalgorithmsfine-grained-complexitythree-sum-1962word-ram
For , let be the recursively constructed list of -bit masks having selected positions. The enumeration visits the lower half before the upper half and stops on empty layers. It has no repeated entries:
The assertion is uniform in and : the zero-weight list contains only the zero mask, and layers with are empty.
This uniqueness property allows list positions to serve as unambiguous compact addresses for subsets of a fixed size.
Preamble
import Definitions.Def_ThreeSum1962Source_Bundle01 import Lean.Elab.Tactic.Omega import Mathlib.Algebra.BigOperators.Ring.Finset import Mathlib.Combinatorics.Colex import Mathlib.Data.Fin.Embedding import Mathlib.Data.Finset.Powerset import Mathlib.Data.List.Basic import Mathlib.Data.List.Nodup import Mathlib.Data.Nat.Choose.Basic import Mathlib.Tactic.Linarith import Mathlib.Tactic.Ring set_option autoImplicit false set_option relaxedAutoImplicit false set_option Elab.async false
Formal statement
theorem ThreeSum.SubsetAddress.enumerateLayer_nodup : ∀ (L k : Nat), @List.Nodup.{0} Nat (ThreeSum.SubsetAddress.enumerateLayer L k) := by
sorry
Source