Proof using.
intros l; elim l; simpl in |- *; auto.
intros a l0 H H0; apply ulist_cons.
inversion H0.
red in |- *; intros H5; case in_map_inv with (1 := H5).
intros (b2, l2); simpl in |- *; intros (Hb1, Hb2); case (H3 l2); auto.
rewrite Hb2; auto.
apply H; apply unique_key_inv with (1 := H0); auto.
Qed.

(* A list of keys is unique gives a code with unique keys *)
Theorem ulist_unique_key :
forall l : list (A * B), ulist (map (fst (B:=_)) l) -> unique_key l.