Block weights and exact-weight certificates #
The arithmetic of the Lecomte--Ramakrishnan construction: partitioning input bits preserves their total weight, a residue class partition has small blocks, and coprime modular certificates determine the exact weight. Complementing one block turns a difference of block weights into a symmetric function.
Hamming weight on any finite set of coordinates.
Equations
- Complexity.Shallow.weight x = ∑ i : ι, (x i).toNat
Instances For
def
Complexity.Shallow.blockWeight
{ι : Type u_1}
{G : Type u_2}
[Fintype ι]
[DecidableEq G]
(block : ι → G)
(x : ι → Bool)
(a : G)
:
The weight of a partition block.
Equations
- Complexity.Shallow.blockWeight block x a = Complexity.Shallow.weight fun (i : { i : ι // block i = a }) => x ↑i
Instances For
theorem
Complexity.Shallow.sum_blockWeight
{ι : Type u_1}
{G : Type u_2}
[Fintype ι]
[Fintype G]
[DecidableEq G]
(block : ι → G)
(x : ι → Bool)
:
Summing the block weights recovers the total weight.
Round-robin partition into k residue classes.
Equations
Instances For
Every residue block has at most n/k + 1 positions.
theorem
Complexity.Shallow.weight_eq_of_shiftTests
{n : ℕ}
{ι : Type u_1}
[Fintype ι]
(k : ι → ℕ)
[∀ (i : ι), NeZero (k i)]
(hc : Pairwise fun (i j : ι) => (k i).Coprime (k j))
(hn : n < ∏ i : ι, k i)
(t : Fin (n + 1))
(x : BitString n)
(s : (i : ι) → ZMod (k i) → ZMod (k i))
(hs : ∀ (i : ι), ShiftTest (↑↑t) (fun (a : ZMod (k i)) => ↑(blockWeight residueBlock x a)) (s i))
:
Modular certificates over coprime moduli larger in product than the input length certify the exact Hamming weight.