Counting the binary numbers below a bound #
A number written in binary on the positions of a linear order is a set of
positions (DescriptiveComplexity.binNum). This file counts those sets: over
n positions the decoding is a bijection onto the numbers below 2 ^ n
(DescriptiveComplexity.binCode_bijective), so the sets of bits whose value is
below that of a given set w are exactly as many as the value of w
(DescriptiveComplexity.card_binNum_lt).
That is what lets a number in the instance act as a weight in a count: a
witness that carries, beside a solution, a number below the weight of that
solution is counted once per unit of weight, and “below” is first-order
(DescriptiveComplexity.binNum_lt_iff).
The decoding of a set of bits, over all the elements as positions, as a
number below 2 ^ n.
Equations
- DescriptiveComplexity.binCode hlin b = ⟨DescriptiveComplexity.binNum Le (fun (x : A) => True) b, ⋯⟩
Instances For
Dependency graph
Binary decoding is a bijection from the sets of positions onto the
numbers below 2 ^ n.