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

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