(* An association list has unique keys if the keys appear only once *)
Inductive unique_key : list (A * B) -> Prop :=
  | unique_key_nil : unique_key nil
  | unique_key_cons :
      forall (a : A) (b : B) l,
      (forall b : B, ~ In (a, b) l) ->
      unique_key l -> unique_key ((a, b) :: l).(* An association list has unique keys if the keys appear only once *)
Inductive unique_key : list (A * B) -> Prop :=
  | unique_key_nil : unique_key nil
  | unique_key_cons :
      forall (a : A) (b : B) l,
      (forall b : B, ~ In (a, b) l) ->
      unique_key l -> unique_key ((a, b) :: l).(* An association list has unique keys if the keys appear only once *)
Inductive unique_key : list (A * B) -> Prop :=
  | unique_key_nil : unique_key nil
  | unique_key_cons :
      forall (a : A) (b : B) l,
      (forall b : B, ~ In (a, b) l) ->
      unique_key l -> unique_key ((a, b) :: l).

Theorem unique_key_map : forall (A B C D : Type) l (f : A * B -> C * D), unique_key l -> (forall a b, fst (f a) = fst (f b) -> fst a = fst b) -> unique_key (map f l).