Strings of a given weight below or above a string #
In the pointwise order on ι → Bool, the strings x ≤ y of weight a are the indicators of the
a-element subsets of the support of y, so there are C(|y|, a) of them
(Cslib.BitString.card_filter_le_and_weight_eq). Complementing every bit reverses the order, so
the strings y ≥ x of weight b ≤ |ι| number C(|ι| - |x|, |ι| - b)
(Cslib.BitString.card_filter_ge_and_weight_eq). These count the partners in the containment
relation between two weight layers that adversary arguments use.
Main results #
Cslib.BitString.card_filter_le_and_weight_eq:#{x ≤ y | |x| = a} = C(|y|, a).Cslib.BitString.card_filter_ge_and_weight_eq:#{y ≥ x | |y| = b} = C(|ι| - |x|, |ι| - b).
The strings of weight a below y are the indicators of the a-element subsets of the
support of y: there are C(|y|, a) of them.
The strings of weight b ≤ |ι| above x are the complements of the strings of weight
|ι| - b below the complement of x: there are C(|ι| - |x|, |ι| - b) of them.