(* RsumOver *)

Definition RsumOver (X: Set) (l: list X) (f: X -> R): R := Rsum (map f l).

(* Specifications: *)
Lemma RsumOver_nats_le x y z: (y <= z)%nat -> forall f, (forall q, (x <= q)%nat -> 0 <= f q) -> RsumOver (nats x y) f <= RsumOver (nats x z) f.
Lemma RsumOver_cons (X: Set) (x: X) (l: list X) (f: X -> R): RsumOver (x :: l) f = f x + RsumOver l f.
Lemma RsumOver_concat_map (X Y: Set) (f: X -> R) (g: Y -> list X) (l: list Y): RsumOver (concat (map g l)) f = RsumOver l (fun x => RsumOver (g x) f).
Lemma RsumOver_constant_le (X: Set) (l: list X) (f: X -> R) (c: R): (forall x, List.In x l -> f x <= c) -> RsumOver l f <= INR (length l) * c.
Lemma nats_plusb b b' w: nats (b + b') w = map (plus b) (nats b' w).
Lemma RsumOver_le (X: Set) (f g: X -> R) (l: list X): (forall x, In x l -> f x <= g x) -> RsumOver l f <= RsumOver l g.