Fixpoint removeFirst(A : Set)(eqd : eq_dec A)(ls : list A) a :=
  match ls with
    | nil => nil
    | a' :: ls' =>
      if (eqd a a') then ls' else a' :: (removeFirst eqd ls' a)
  end.

(* Specifications: *)
Lemma removeFirst_permutation : forall (A : Set)(eqd : eq_dec A)(ls : list A) a, In a ls -> Permutation ls (a :: (removeFirst eqd ls a)).
Lemma removeFirst_not_in : forall (A : Set)(eqd : eq_dec A)(ls : list A) a1 a2, ~In a1 ls -> ~In a1 (removeFirst eqd ls a2).
Lemma removeFirst_NoDup_not_in : forall (A : Set)(eqd : eq_dec A)(ls : list A)(a : A), NoDup ls -> ~In a (removeFirst eqd ls a).
Lemma removeFirst_NoDup : forall (A : Set)(eqd : eq_dec A)(ls : list A) a, NoDup ls -> NoDup (removeFirst eqd ls a).
Lemma removeFirst_in : forall (A : Set)(eqd : eq_dec A)(ls : list A)(a1 a2 : A), In a1 ls -> a1 <> a2 -> In a1 (removeFirst eqd ls a2).
Lemma removeFirst_in_iff : forall (A : Set)(eqd : eq_dec A)(ls : list A) a1 a2, In a1 (removeFirst eqd ls a2) -> In a1 ls.