(* Skip the first elements of a list *)
Fixpoint skip_n (l : list A) (n : nat) {struct n} : 
 list A :=
  match n with
  | O => l
  | S n1 => match l with
            | nil => nil
            | a :: l1 => skip_n l1 n1
            end
  end.

(* Specifications: *)
Theorem skip_n_app1 : forall (n : nat) (l1 l2 : list A), length l1 <= n -> skip_n (l1 ++ l2) n = skip_n l2 (n - length l1).
Theorem skip_n_app2 : forall (n : nat) (l1 l2 : list A), n <= length l1 -> skip_n (l1 ++ l2) n = skip_n l1 n ++ l2.
Theorem skip_n_length : forall (n : nat) (l1 : list A), length (skip_n l1 n) = length l1 - n.
Theorem skip_n_id : forall l : list A, skip_n l (length l) = nil.
Theorem first_n_skip_n_app : forall (n : nat) (l : list A), first_n l n ++ skip_n l n = l.
Theorem exist_first_max : forall l : list nat, l <> nil -> exists a : nat, (exists l1 : list nat, (exists l2 : list nat, l = l1 ++ a :: l2 /\ (forall n1, In n1 l1 -> n1 < a) /\ (forall n1, In n1 l2 -> n1 <= a))).