End DupfreeLength.
(* * Cardinality *)
Section Cardinality.
Variable X : Type.
Context {eq_X_dec : eq_dec X}.
Implicit Types A B : list X.
Definition card (A : list X) : nat := |undup A|.

Lemma card_cons_rem x A :
card (x::A) = 1 + card (rem A x).