Corollary Znth_rebase' : forall {A} {d : Inhabitant A} (m : list A) i j, 0 <= i < Zlength m -> 0 <= j < Zlength m ->
  Znth ((i - j) mod Zlength m) (rebase m j) = Znth i m.

(* Specifications: *)
Lemma index_of'_upd : forall m k v i (Hrange : 0 <= i < Zlength m) (Hi : fst (Znth i m) = k \/ fst (Znth i m) = 0), index_of' (upd_Znth i m (k, v)) k = index_of' m k.
Lemma Zlength_rebase : forall {A} (m : list A) i, 0 <= i < Zlength m -> Zlength (rebase m i) = Zlength m.
Lemma rebase_upd : forall {A} (m : list A) i j x, 0 <= i < Zlength m -> 0 <= j < Zlength m -> rebase (upd_Znth i m x) j = upd_Znth ((i - j) mod Zlength m) (rebase m j) x.