Section contents.
Variable X: Set.
Variable Xle: X -> X -> Prop.
Hypothesis XO: preorder X Xle.
Definition Xlt (x y: X): Prop := Xle x y /\ ~ Xle y x.
(* Vsorted *)
Inductive sorted: forall n, Vector.t X n -> Prop := (* Coq.Sorting's definition sucks *)
| sorted_nil: sorted Vector.nil
| sorted_one x: sorted (Vector.cons x Vector.nil)
| sorted_more (a b: X) n (t: Vector.t X n):
Xle a b -> sorted (Vector.cons b t) -> sorted (Vector.cons a (Vector.cons b t)).
Hint Constructors sorted.
Proof with auto.
intros.
rewrite (eq_cons v).
apply sorted_more...
rewrite <- eq_cons...
Qed.

Lemma sorted_cons' x n (v: Vector.t X n): (forall y, List.In y v -> Xle x y) -> sorted v -> sorted (Vector.cons x v).