(* 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).(* 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).(* 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).(* 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).

(* Specifications: *)
Theorem ordered_inv_order : forall (a b : A) (l : list A), ordered (a :: b :: l) -> order a b.
Theorem ordered_inv : forall (a : A) (l : list A), ordered (a :: l) -> ordered l.
Theorem ordered_skip : forall (a b : A) (l : list A), ordered (a :: b :: l) -> ordered (a :: l).
Theorem ordered_trans : forall (a b : A) (l : list A), ordered (a :: l) -> In b l -> order a b.
Theorem ordered_trans_app : forall (a b : A) (l1 l2 : list A), ordered (l1 ++ l2) -> In a l1 -> In b l2 -> order a b.
Theorem ordered_perm_antisym_eq : (forall a b : A, order a b -> order b a -> a = b) -> forall l1 l2 : list A, permutation l1 l2 -> ordered l1 -> ordered l2 -> l1 = l2.
Theorem ordered_map_inv : forall (A B : Type) (order : A -> A -> Prop) (g : B -> A) (l : list B), ordered (fun x y => order (g x) (g y)) l -> ordered order (map g l).