Documentation

CslibFrontier.Foundations.Data.Finset.KthLargest.Truncation

Upper truncation of zero-padded order statistics #

Capping every value at a nonnegative threshold caps the positive-order k-th largest value at the same threshold. Nonnegativity of the cap preserves the zero padding. Input values may be negative, and the retained cardinality may be smaller than the requested rank.

Main results #

theorem Finset.kthLargest_min {α : Type u_1} {R : Type u_2} [LinearOrder R] [Zero R] {s : Finset α} {k : ℕ} {f : α → R} {t : R} (hk : 0 < k) (ht : 0 ≤ t) :
(kthLargest k s fun (x : α) => min t (f x)) = min t (kthLargest k s f)

An upper cap that preserves zero commutes with every positive-order padded rank.