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

Lemma upd_complete_gen : forall {A} (l : list A) x n y, Zlength l < n ->
upd_Znth (Zlength l) (l ++ repeat y (Z.to_nat (n - Zlength l))) x =
(l ++ [x]) ++ repeat y (Z.to_nat (n - Zlength (l ++ [x]))).