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

Lemma In_app_before : forall xs ys x y, In(A:=A) x xs -> (~ In y xs) -> before x y (xs ++ y :: ys).