The median of a finite family of reals #
Cslib.median v is the lower median of a finite family v : ι → ℝ: the least value v i that is
weakly above at least half of the family (and 0 for an empty family). It is characterized by
majorities: if more than half of the family lies weakly below b, so does the median
(Cslib.median_le), and if more than half lies weakly above a, so does the median
(Cslib.le_median). Hence a majority within t of μ forces the median within t of μ
(Cslib.abs_median_sub_le), the step that turns estimates that are good with probability above a
half into one that is good with high probability [AlonMatiasSzegedy1999, Theorem 2.2].
Finset.exists_median (CslibFrontier.Foundations.Data.Finset.Quantile) only asserts that a median
element exists; Cslib.median is a chosen value, so it can appear in an algorithm's output. It is
unrelated to Cslib.BitString.median, the coordinatewise majority of three bit strings; under
open Cslib.BitString write Cslib.median explicitly.
Main definitions #
Cslib.median: the lower median of a finite family of reals.
Main results #
Cslib.median_le,Cslib.le_median: a strict majority below (above) a bound puts the median below (above) it.Cslib.abs_median_sub_le: the median of a family with a strict majority withintofμis withintofμ.Cslib.median_const: the median of a nonempty constant family.