(**************************************)
(** * Cutting a list at some position *)
(**************************************)
Section Cutting.
Variable A : Type.
Local Notation firstn := (@firstn A).
Local Notation skipn := (@skipn A).

Lemma nth_firstn (n : nat) (l : list A) (i : nat) (d : A) :
nth i (firstn n l) d = if i <? n then nth i l d else d.