NLA-lib Explorer

NLAlib.sumLargest_eq_sum_of_forall_le

Library · theorem

Recognising the largest entries: if an index set t with \min(k, \lvert \iota \rvert) elements carries entries that are all at least every entry outside it, the sum of the k largest entries is the sum over t: S_k(\mathbf{x}) = \sum_{i \in t} \mathbf{x}_i.

NLAlib.sumLargest_eq_sum_of_forall_le.{u_1} {ι : Type u_1} [Fintype ι] {x : ι → ℝ} {t : Finset ι}
  {k : ℕ} (ht : t.card = min k (Fintype.card ι)) (h : ∀ i ∈ t, ∀ j ∉ t, x j ≤ x i) :
  sumLargest x k = ∑ i ∈ t, x i

Full source on GitHub

Import NLAlib.Matrix.Majorization.Basic.