Sampling without replacement: the uniform law on injections
Library · Source module
Sampling without replacement: the uniform law on injections
Sampling \lvert k \rvert indices from a finite population n without replacement, in order, is a uniformly random injection \iota : k \to n. Its law is Mathlib's uniformOn {f : k → n | Function.Injective f} on k → n with the product measurable space (discrete, since k is finite); no new definition is introduced. This file gives its basic API: it is a probability measure when \lvert k \rvert \le \lvert n \rvert and the zero measure otherwise (junk value), each injection has mass 1 / (\lvert n \rvert)_{\lvert k \rvert} (the falling factorial), the law is invariant under relabelling the population and reordering the sample, and each single draw is uniform on n.
Degenerate cases. For empty k there is exactly one injection, the empty map, and the law is a Dirac mass. For \lvert n \rvert < \lvert k \rvert there is none and the law is 0, so a random injection with this law lives on the zero measure.
## Main results
* NLAlib.isProbabilityMeasure_uniformOn_injective, NLAlib.uniformOn_injective_of_card_lt: probability measure, and the junk value. * NLAlib.uniformOn_injective_singleton: the mass of one injection. * NLAlib.map_perm_comp_uniformOn_injective, NLAlib.map_comp_perm_uniformOn_injective: invariance under permutations of the population and of the sample. * NLAlib.map_eval_uniformOn_injective: one draw without replacement is uniform.