Zulip Chat Archive
Stream: Is there code for X?
Topic: Piecewise larger list means larger sum
Aatman Supkar (Apr 16 2025 at 16:33):
Is there a theorem which proves that given a L1 L2 : List α
of the same length where LinearOrder α
can be inferred, if L1.get(i) ≥ L2.get(i)
for all i
, then List.sum L1 ≥ List.sum L2
?
Aaron Liu (Apr 16 2025 at 16:35):
docs#List.sum_le_sum might be helpful
Aaron Liu (Apr 16 2025 at 16:37):
You can use docs#List.finRange_map_get along with docs#List.sum_le_sum to prove this
Last updated: May 02 2025 at 03:31 UTC