Multiplicative binary enumeration #
Products over fixed-width words enumerate a bounded interval or a finite subset once.
The interval result is the additive enumeration theorem transported through Additive.
Main results #
Cslib.BitString.prod_binaryValue_lt: multiplicative bounded enumeration.Cslib.BitString.prod_binaryValue_mem: multiplicative finite-subset enumeration.
theorem Cslib.BitString.prod_binaryValue_lt {M : Type u_1} [CommMonoid M] {n k : ℕ} (hk : k ≤ 2 ^ n) (f : ℕ → M) :
(∏ w : Fin n → Bool, if binaryValue (List.ofFn w) < k then f (binaryValue (List.ofFn w)) else 1) = ∏ i ∈ Finset.range k, f i
Fixed-width binary enumeration preserves a product on an initial interval.
theorem Cslib.BitString.prod_binaryValue_mem {M : Type u_1} [CommMonoid M] {n k : ℕ} (hk : k ≤ 2 ^ n) (s : Finset ℕ) (hs : s ⊆ Finset.range k) (f : ℕ → M) :
A finite subset below the binary width is enumerated once, with unit factors elsewhere.