Fixpoint before_all {A : Type} (x : A) y l : Prop :=
  match l with
    | [] => True
    | a :: l' => 
      ~ In x l' \/ 
      (y <> a /\ before_all x y l')
  end.

(* Specifications: *)
Lemma before_all_head_not_in : forall l (x y : A), x <> y -> before_all x y (y :: l) -> ~ In x l.
Lemma before_all_neq_append : forall l (x y a : A), a <> x -> before_all x y l -> before_all x y (l ++ [a]).
Lemma before_all_not_in_1 : forall l (x y : A), ~ In x l -> before_all x y l.
Lemma before_all_not_in_2 : forall l (x y : A), ~ In y l -> before_all x y l.