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.

Lemma replist_replist {cs: compspecs}: forall t (lo hi lo' hi': Z) al, 0 <= lo <= hi -> 0 <= lo' <= hi' -> lo'+hi <= hi' -> replist t lo hi (replist t lo' hi' al) = replist t (lo+lo') (hi+lo') al.