Proof using.
intros.
induction l; simpl in *; auto.
intro.
break_or_hyp.
- match goal with H: ~ _ |- _ => contradict H end.
left.
destruct a.
match goal with H: forall _ : A * B, _ |- _ => specialize (H (a, b)) end.
simpl in *.
intuition eauto; repeat find_rewrite; auto.
- match goal with H: In _ _ |- _ => contradict H end.
apply IHl; eauto.
Qed.

Lemma NoDup_map_snd_fst :
forall nms : list (A * B),
NoDup nms ->
(forall nm nm', In nm nms -> In nm' nms -> snd nm = snd nm') ->
NoDup (map fst nms).