Section suml.
Fixpoint suml (l : list nat) : nat :=
match l with
| nil => 0
| n :: l' => n + suml l'
end.

Lemma suml_flat_map_map (A B : Type) (f : A -> list B) (g : B -> nat) l :
suml (flat_map (fun x => map g (f x)) l) = suml (map (fun x => suml (map g (f x))) l).