(* Duplicate-freenes. *)

(* Specifications: *)
Lemma cons_uniq x s : uniq (x :: s) = (x \notin s) && uniq s.
Lemma uniq_catC s1 s2 : uniq (s1 ++ s2) = uniq (s2 ++ s1).
Lemma rcons_uniq s x : uniq (rcons s x) = (x \notin s) && uniq s.
Lemma rot_uniq s : uniq (rot n0 s) = uniq s.
Lemma count_memPn x s : reflect (count_mem x s = 0) (x \notin s).
Lemma filter_pred1_uniq s x : uniq s -> x \in s -> filter (pred1 x) s = [:: x].
Fixpoint undup s :=
if s is x :: s' then if x \in s' then undup s' else x :: undup s' else [::].