Fixpoint ltList (l1 l2 : list positive) :=
    match l1, l2 with
      | nil, nil => False
      | (hd1 :: tl1), (hd2 :: tl2) => if (Pos.ltb hd1 hd2) then True
                                      else if (Pos.ltb hd2 hd1) then False
                                           else (ltList tl1 tl2)
      | nil, _ => True
      | _, nil => False
    end.

(* Specifications: *)
Lemma lengthOne : forall (l : list positive), length l = 1 -> exists a, l = a :: nil.
Lemma lengthAtLeastOne : forall (l : list positive) n, length l = (S n) -> exists a0 l0, l = a0 :: l0.
Lemma ltListTrans : forall m x y z, length x = (S m) -> length y = (S m) -> length z = (S m) -> ltList x y -> ltList y z -> ltList x z.
Lemma sortOK : forall m l, length l = m -> length (sort l) = m.