Section Undup.
Variable X : eqType.
Implicit Types A B : list X.
Fixpoint undup (A : list X) : list X :=
match A with
| nil => nil
| x::A' => if Dec (x el A') then undup A' else  x :: undup A'
end.

Lemma not_dupfree (A:list X):
~dupfree A ->
exists a A1 A2 A3, A = A1++a::A2++a::A3.