Proof using.
intros L; elim L; simpl in |- *; auto.
intros b l H' a.
CaseEq (order_fun a b); intros H1; auto.
apply permutation_trans with (l2 := b :: a :: l); auto.
Qed.
Hint Resolve insert_ordered insert_permutation : core.
(* Sorting by insertion *)
Fixpoint isort (l : list A) : list A :=
match l with
| nil => nil
| b :: l1 => insert b (isort l1)
end.

(* Sorting gives an ordered list *)
Theorem isort_ordered : forall l : list A, ordered order (isort l).
Proof using order_fun_false order_fun_true.