Corollary Zlength_upto : forall n, Zlength (upto n) = Z.of_nat n.

(* Specifications: *)
Lemma skipn_cons : forall {A}{d: Inhabitant A} n (l : list A), (length l > n)%nat -> skipn n l = Znth (Z.of_nat n) l :: skipn (S n) l.
Lemma Znth_upto : forall d m n, 0 <= n < Z.of_nat m -> @Znth _ d n (upto m) = n.
Lemma In_Znth : forall {A} {d: Inhabitant A} (l : list A) x, In x l -> exists i, 0 <= i < Zlength l /\ Znth i l = x.
Lemma In_upd_Znth_old : forall {A}{d: Inhabitant A} i (x y : A) l, In x l -> x <> Znth i l -> 0 <= i <= Zlength l -> In x (upd_Znth i l y).
Lemma Znth_combine : forall {A B} {a: Inhabitant A} {b: Inhabitant B} i (l1: list A) (l2: list B), Zlength l1 = Zlength l2 -> Znth i (combine l1 l2) = (Znth i l1, Znth i l2).
Lemma Zlength_combine : forall {A B} (l : list A) (l' : list B), Zlength (combine l l') = Z.min (Zlength l) (Zlength l').
Lemma nth_Znth : forall {A}{d: Inhabitant A} i l, nth i l default = Znth (Z.of_nat i) l.
Lemma upd_Znth_cons : forall {A} i a l (x : A), i > 0 -> upd_Znth i (a :: l) x = a :: upd_Znth (i - 1) l x.
Lemma upd_Znth_triv : forall {A}{d: Inhabitant A} i (l : list A) x (Hi : 0 <= i < Zlength l), Znth i l = x -> upd_Znth i l x = l.
Lemma combine_upd_Znth : forall {A B} (l1 : list A) (l2 : list B) i x1 x2, 0 <= i < Zlength l1 -> Zlength l1 = Zlength l2 -> combine (upd_Znth i l1 x1) (upd_Znth i l2 x2) = upd_Znth i (combine l1 l2) (x1, x2).