Section ordered.
Variable A : Type.
Variable order : A -> A -> Prop.
Variable order_trans : forall a b c : A, order a b -> order b c -> order a c.
(* Ordered list with respect to an order *)
Inductive ordered : list A -> Prop :=
| ordered_nil : ordered nil
| ordered_one : forall a : A, ordered (a :: nil)
| ordered_cons :
forall (a b : A) (l : list A),
order a b -> ordered (b :: l) -> ordered (a :: b :: l).
Hint Constructors ordered : core.
Proof using.
intros a b l H; inversion H; auto.
Qed.
Proof using.
intros a l H; inversion H; auto.
Qed.
Proof using A order order_trans.
intros a b l; case l; clear l; auto.
intros c l H; apply ordered_cons.
apply order_trans with (b := b); auto.
apply ordered_inv_order with (1 := H).
apply ordered_inv_order with (1 := ordered_inv _ _ H).
apply ordered_inv with (1 := ordered_inv _ _ H).
Qed.

(* All the element of the list are smaller than the first one *)
Theorem ordered_trans :
forall (a b : A) (l : list A), ordered (a :: l) -> In b l -> order a b.