Set Implicit Arguments.
Plus List Permutation Arith Relations RelationClasses Morphisms
arith_lems util list_utils nat_seqs Omega.
(* sum *)
Fixpoint sum (l: list nat): nat :=
match l with
| nil => 0
| h :: t => h + sum t
end.
Open Scope R_scope.
(* Rsum *)
Definition Rsum: list R -> R := fold_right Rplus 0.

Lemma Rsum_sum_map (T: Set) (fi: T -> nat) (fr: T -> R) (l: list T):
(forall x, In x l -> fr x = INR (fi x)) -> Rsum (map fr l) = INR (sum (map fi l)).