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

Lemma upd_rotate : forall {A} i (l : list A) n m x (Hl : Zlength l = m) (Hlt : 0 <= n <= m)
(Hi : 0 <= i < Zlength l),
upd_Znth i (rotate l n m) x = rotate (upd_Znth ((i - n) mod m) l x) n m.