(* mem_seq and index. *)
(* mem_seq defines a predType for seq. *)

Fixpoint mem_seq (s : seq T) :=
  if s is y :: s' then xpredU1 y (mem_seq s') else xpred0.Definition eqseq_class := seq T.Identity Coercion seq_of_eqseq : eqseq_class >-> seq.Canonical seq_predType := @mkPredType T (seq T) pred_of_eq_seq.(* The line below makes mem_seq a canonical instance of topred. *)
Canonical mem_seq_predType := mkPredType mem_seq.

Lemma eq_has_r s1 s2 : s1 =i s2 -> has^~ s1 =1 has^~ s2.