(* Lemma Znth_indep : forall {A} i (l : list A) d d', 0 <= i < Zlength l -> Znth i l d = Znth i l d'. *)
Fixpoint upto n :=
match n with
| O => []
| S n' => 0 :: map Z.succ (upto n')
end.
Opaque Z.of_nat.

(* Specifications: *)
Lemma upto_app : forall n m, upto (n + m) = upto n ++ map (fun i => Z.of_nat n + i) (upto m).
Lemma upto_length : forall n, length (upto n) = n.
Corollary Zlength_upto : forall n, Zlength (upto n) = Z.of_nat n.
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.