NLA-lib Explorer

NLAlib.sumLargest_eq_sum_of_antitone

Library · theorem

For a non-increasing family indexed by Fin N, the sum of the k largest entries is the sum of the first k: S_k(\mathbf{a}) = \sum_{i < \min(k, N)} \mathbf{a}_i.

NLAlib.sumLargest_eq_sum_of_antitone {N : ℕ} {a : Fin N → ℝ} (ha : Antitone a) (k : ℕ) :
  sumLargest a k = ∑ i, if ↑i < k then a i else 0

Full source on GitHub

Import NLAlib.Matrix.Majorization.Basic.