#[deprecated(use = snd_list_prod)]
Notation map_snd_list_prod := snd_list_prod (only parsing).
(** Sum of elements of a list of [nat]: [list_sum] *)
Definition list_sum l := fold_right plus 0 l.

(* Specifications: *)
Lemma list_sum_app : forall l1 l2,
list_sum (l1 ++ l2) = list_sum l1 + list_sum l2.
Lemma length_concat A l:
length (concat l) = list_sum (map (@length A) l).
Lemma length_flat_map A B (f: A -> list B) l:
length (flat_map f l) = list_sum (map (fun x => length (f x)) l).
Corollary flat_map_constant_length A B c (f: A -> list B) l:
(forall x, In x l -> length (f x) = c) -> length (flat_map f l) = (length l) * c.
Lemma length_list_power (A B:Type)(l:list A) (l':list B):
length (list_power l l') = (length l')^(length l).