Section dedup.
Variable A : Type.
Hypothesis A_eq_dec : forall x y : A, {x = y} + {x <> y}.
Fixpoint dedup (xs : list A) : list A :=
match xs with
| [] => []
| x :: xs => let tail := dedup xs in
if in_dec A_eq_dec x xs then
tail
else
x :: tail
end.
Proof using.
intros. simpl in *.
break_match.
+ auto.
+ exfalso. intuition auto with datatypes.
Qed.

Lemma dedup_In : forall (x : A) xs,
In x xs ->
In x (dedup xs).