Fixpoint Lget (A:Set) (n:nat) (l:list A) {struct l}:option A :=
match l with nil => None
| x::q =>
match n with O => Some x
| S m => Lget A m q
end end .

(* Specifications: *)
Lemma map_app : forall (A B:Set) (f:A -> B) l m, List.map f (l ++ m) = List.map f l ++ List.map f m.
Lemma length_map : forall (A B:Set) (f:A -> B) l, length (List.map f l) = length l.
Lemma Lget_map : forall (A B:Set) (f:A -> B) i l, Lget i (List.map f l) = match Lget i l with Some a => Some (f a) | None => None end.
Lemma Lget_app : forall (A:Set) (a:A) l i, Lget i (l ++ a :: nil) = if Nat.eqb i (length l) then Some a else Lget i l.
Lemma Lget_app_Some : forall (A:Set) l delta i (a: A), Lget i l = Some a -> Lget i (l ++ delta) = Some a.