Selecting largest coordinates and rounding an approximate indicator #
List.selectLargest sorts a finite list by decreasing weight and keeps its first k entries.
It is executable when its weights have a decidable linear order, including integer weights.
The rounding theorem bounds the number of missed coordinates when selecting a set of the correct cardinality by largest score. If the scores are close to a scaled indicator in squared Euclidean distance, the selected set has small symmetric difference from its support. The proof pairs each missed coordinate with an incorrectly selected coordinate.
Sort by decreasing weight and select the first k entries, breaking ties by the order
chosen by merge sort. A duplicate-free input yields min k xs.length selected elements.
On a duplicate-free input, selection has the expected cardinality.
Every selected weight is at least every omitted weight from the input list.
Rounding a real score vector by its largest coordinates. If S and T have the same
cardinality and the scores on T dominate those outside T, the squared error from the
scaled indicator of S controls the number of missed elements. This statement also covers
negative scores; the indicator height a is nonnegative.
A squared error of at most 1 / 32 from a normalized indicator suffices for the
one-sixteenth overlap bound used in clique recovery. The normalization equation separates
this finite rounding argument from the construction of a unit indicator vector.