(* not an iff. There might be l' before l with (k, v') in it *)
End assoc.

Lemma flat_map_comp (A B C : Type) (f : A -> B) (g : B -> list C) (h : A -> list C) (l : list A) :
(forall x, In x l -> h x = g (f x)) -> flat_map h l = flat_map g (map f l).