Sums and products from lists #
This file provides further results about List.prod, List.sum,
which calculate the product and sum of elements of a list
and List.alternatingProd, List.alternatingSum, their alternating counterparts.
If elements of a list commute with each other, then their product does not depend on the order of elements.
If elements of a list additively commute with each other, then their sum does not depend on the order of elements.
Summing the count of x over a list filtered by some p is just countP applied to p
The members of l.ranges have no duplicates
Any entry of any member of l.ranges is strictly smaller than l.sum.
In a flatten of sublists, taking the slice between the indices A and B - 1 gives back the
original sublist of index i if A is the sum of the lengths of sublists of index < i, and
B is the sum of the lengths of sublists of index โค i.
If a product of integers is -1, then at least one factor must be -1.
A morphism into the opposite monoid acts on the product by acting on the reversed elements.