Fixpoint replicate {X} (n : nat) (m : X) : list X :=
  match n with
  | O => []
  | S n' => cons m (replicate n' m)
  end.

Lemma concat_list_sum : forall {X} (l : list (list X)), List.length (concat l) = List.list_sum (List.map (@List.length X) l).