Section Sublist.
Inductive sublist (A : Type) : (list A) -> (list A) -> Prop :=
| sublist_refl : forall l, sublist l l
| sublist_skip : forall l1 h t, sublist l1 t -> sublist l1 (h :: t)
| sublist_cons : forall h t1 t2, sublist t1 t2 -> sublist (h :: t1) (h :: t2).
Hint Constructors sublist.

Lemma sublist_flatmap_in_ext A B (f : A -> list B) g l:
(forall x : A , In x l -> sublist (f x) (g x)) ->
sublist (flat_map f l) (flat_map g l).