Notation nthe n A := (nth_error A n).

(* Specifications: *)
Lemma nthe_length A n : length A > n -> { x | nthe n A = Some x }.
Lemma pos_nthe x A n : pos x A = Some n -> nthe n A = Some x.
Lemma nthe_app_l x n A B : nthe n A = Some x -> nthe n (A ++ B) = Some x.
Lemma pos_nth X d (x : X) l n def : pos d x l = Some n -> nth n l def = x.
Lemma pos_length X d (x : X) l n : pos d x l = Some n -> n < | l |.
Lemma nthe_length A n : length A > n -> { x | nthe n A = Some x }.
Lemma pos_nthe x A n : pos x A = Some n -> nthe n A = Some x.
Lemma nthe_app_l x n A B : nthe n A = Some x -> nthe n (A ++ B) = Some x.
Lemma pos_nth X d (x : X) l n def : pos d x l = Some n -> nth n l def = x.
Lemma pos_length X d (x : X) l n : pos d x l = Some n -> n < | l |.