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 before_app_if : forall x y l' l, before (A := A) x y l -> ~ In y l' -> before (A := A) x y (l' ++ l).