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 .

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.