Section sec_exteq.
Variable T: Type.
CoInductive exteq : infseq T -> infseq T -> Prop :=
exteq_intro :
forall x s1 s2, exteq s1 s2 -> exteq (Cons x s1) (Cons x s2).
Proof using.
intros x1 s1 x2 s2 e.
change (hd (Cons x1 s1) = hd (Cons x2 s2) /\
exteq (tl (Cons x1 s1)) (tl (Cons x2 s2))).
case e; clear e x1 s1 x2 s2. simpl. intros; split; trivial.
Qed.
Proof using.
cofix cf. intros (x, s). constructor. apply cf.
Qed.

Lemma exteq_sym : forall s1 s2, exteq s1 s2 -> exteq s2 s1.