(* "replist" is an alternative to zlist, avoids mysterious typeclass *)
Fixpoint replist' {A: Type} {d: Inhabitant A} (lo: Z) (n: nat) (al: list A) :=
match n with
| O => nil
| S n' =>  Znth lo al :: replist' (Z.succ lo) n' al
end.
Definition replist {cs: compspecs} (t: type)  (lo hi: Z) (al: list (reptype t)) :=
replist'  lo (Z.to_nat (hi-lo)) al.
(* replist t lo hi al *)

Lemma replist'_succ:
forall {A} {d:Inhabitant A} lo n r al,
(lo>=0) -> replist' (Z.succ lo) n (r::al) = replist' lo n al.