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.

Lemma before_all_neq_append : forall l (x y a : A), a <> x -> before_all x y l -> before_all x y (l ++ [a]).