End count_occ.

(* Specifications: *)
Lemma tl_incl (A:Type): forall (a:A) l l', incl (a::l') l -> incl l' l.
Section NoDup.
Lemma NoDup_app (A: Type) (l1 l2: list A):
(forall x, In x l1 -> ~ In x l2) ->
NoDup l1 ->
NoDup l2 ->
NoDup (l1 ++ l2).
Lemma NoDup_split (A: Type) (l1 l2: list A):
NoDup (l1 ++ l2) ->
NoDup l1.
Lemma NoDup_split_right : forall (A : Type) (l1 l2 : list A), NoDup (l1 ++ l2) -> NoDup l2.
Theorem NoDup_cons_iff {A:Type} (a: A) (l: list A):
NoDup (a::l) <-> ~ In a l /\ NoDup l.
Lemma NoDup_app_in_l A l l' :
NoDup (l ++ l') -> forall x : A, (In x l) -> ~ (In x l').
(* dans la lib standard de coq 8.5 *)
Lemma NoDup_Permutation_NoDup A l l' : @NoDup A l -> Permutation.Permutation l l' -> NoDup l'.
(* 8.5 : NoDup_incl_length *)
Lemma NoDup_incl_le_length (A: Type)
(l1 l2: list A):
NoDup l1 -> incl l1 l2 -> length l1 <= length l2.
Lemma NoDup_flat_map A B (f : A -> list B) l :
(forall x, In x l -> NoDup (f x)) ->
NoDup l ->
(forall x y, In x l -> In y l -> x <> y -> (forall z, In z (f x) <-> ~ In z (f y))) ->
NoDup (flat_map f l).