Section RotRcons.
Variable T : Type.
Implicit Types (x : T) (s : seq T).
Canonical seq_eqMixin := EqMixin eqseqP.
Canonical seq_eqType := Eval hnf in EqType (seq T) seq_eqMixin.
Variables (a : pred T) (s : seq T) (A : T -> Prop).
Hypothesis aP : forall x, reflect (A x) (a x).
(* Duplicate-freenes. *)
Fixpoint uniq s := if s is x :: s' then (x \notin s') && uniq s' else true.
(* Removing duplicates *)
Fixpoint undup s :=
if s is x :: s' then if x \in s' then undup s' else x :: undup s' else [::].

Lemma index_uniq i s : i < size s -> uniq s -> index (nth s i) s = i.