Proof using.
intros a1 a2 b1 l; elim l; simpl in |- *; auto.
intros [H1| H1]; auto; injection H1; auto.
intros (a3, b3) l1 Rec; simpl in |- *; auto.
case (eqA_dec a2 a3); simpl in |- *; auto.
intros e H; cut (In (a1, b1) ((a2, S b3) :: l1)); auto.
simpl in |- *; intros [H1| H1]; auto.
injection H1; auto.
intuition.
Qed.

(* Adding an element does not change the unique key property *)
Theorem add_frequency_list_unique_key :
forall (a : A) l, unique_key l -> unique_key (add_frequency_list a l).