Definition rotate {A} (l : list A) n m := sublist (m - n) (Zlength l) l ++
sublist 0 (m - n) l.

Lemma sublist_repeat : forall {A} i j k (v : A), 0 <= i -> i <= j <= k ->
sublist i j (repeat v (Z.to_nat k)) = repeat v (Z.to_nat (j - i)).