Section subseq.
Variable A B : Type.
Hypothesis A_eq_dec : forall x y : A, {x = y} + {x <> y}.
Proof using.
induction l; simpl; tauto.
Qed.
Proof using.
induction zs; intros; simpl in *;
repeat break_match; subst; simpl in *; intuition; subst; eauto;
right; (eapply IHzs; [|eauto]); simpl; eauto.
Qed.
Proof using.
induction ys; intros.
- destruct xs; simpl in *; intuition.
- simpl in *.
break_match; simpl in *; intuition auto; subst; intuition eauto;
right; (eapply IHys; [eauto| intuition auto with datatypes]).
Qed.
Proof using.
induction ys; intros.
- destruct xs; simpl in *; intuition.
- simpl in *. invc_NoDup.
break_match.
+ constructor.
+ intuition.
subst. constructor; eauto using subseq_In.
Qed.
Proof using.
induction xs; intros; simpl.
- auto.
- repeat break_match; auto.
+ intuition congruence.
+ find_inversion. auto.
Qed.
Proof using.
induction ys; intros; simpl in *.
- repeat break_match; try discriminate; auto.
- repeat break_match; try discriminate; auto.
intuition.
+ subst. simpl in *. find_inversion. auto.
+ right. repeat find_reverse_rewrite. auto.
Qed.
Proof using.
induction ys; intros; simpl in *; intuition; break_match; eauto.
Qed.

Lemma subseq_length :
forall (ys xs : list A),
subseq xs ys ->
length xs <= length ys.