Section prefix.
Variable A : Type.
Proof using.
intros. induction l; simpl in *; auto.
Qed.
Proof using.
intros. destruct l.
- reflexivity.
- contradiction.
Qed.
Proof using.
simpl. intuition.
Qed.
Proof using.
induction l; intros l' H.
- find_apply_lem_hyp Prefix_nil. subst. contradiction.
- destruct l'.
+ contradiction.
+ intros. simpl Prefix in *. break_and. subst. simpl in *. intuition.
right. eapply IHl; eauto.
Qed.
Proof using.
induction xs; intros; simpl in *.
- auto.
- break_match.
+ discriminate.
+ subst. find_inversion. eauto.
Qed.
Proof using.
induction l; intros; simpl in *; intuition auto;
subst; break_match; intuition auto with datatypes;
subst; intuition auto with datatypes.
Qed.

Lemma Prefix_exists_rest :
forall (l1 l2 : list A),
Prefix l1 l2 ->
exists rest,
l2 = l1 ++ rest.