Definition remove_Znth {A} i (al : list A) := sublist 0 i al ++ sublist (i + 1) (Zlength al) al.

(* Specifications: *)
Lemma remove_Znth0 : forall {A} (l : list A), remove_Znth 0 l = sublist 1 (Zlength l) l.
Lemma remove_Znth_cons : forall {A} i a (l : list A), i > 0 ->
remove_Znth i (a :: l) = a :: remove_Znth (i - 1) l.
Lemma Zlength_remove_Znth : forall {A} i (l : list A), 0 <= i < Zlength l ->
Zlength (remove_Znth i l) = Zlength l - 1.
Lemma remove_upd_Znth: forall {A} i l (a : A), 0 <= i < Zlength l ->
remove_Znth i (upd_Znth i l a) = remove_Znth i l.
Lemma remove_Znth_map: forall {A B} (f : A -> B) i l,
remove_Znth i (map f l) = map f (remove_Znth i l).
Lemma remove_Znth_combine: forall {A B} i (l1 : list A) (l2 : list B),
0 <= i < Zlength l1 -> Zlength l1 = Zlength l2 ->
remove_Znth i (combine l1 l2) = combine (remove_Znth i l1) (remove_Znth i l2).
Lemma iter_sepcon_Znth: forall {A} {d : Inhabitant A} f (l : list A) i, 0 <= i < Zlength l ->
iter_sepcon f l = f (Znth i l) * iter_sepcon f (remove_Znth i l).
Lemma iter_sepcon2_Znth: forall {A B} {d1 : Inhabitant A} {d2 : Inhabitant B}
f (l1 : list A) (l2 : list B) i, 0 <= i < Zlength l1 -> Zlength l1 = Zlength l2 ->
iter_sepcon2 f l1 l2 =
f (Znth i l1) (Znth i l2) * iter_sepcon2 f (remove_Znth i l1) (remove_Znth i l2).