+  induction xs.
- constructor.
- simpl in H.
destruct xs.
* constructor.
* constructor. simpl in H. apply IHxs. remember (a <=? z)%Z. destruct b.
simpl. apply H. congruence.
apply Z.leb_le. destruct (a <=? z)%Z; congruence.
+  induction xs.
- auto.
- simpl. destruct xs. auto.
simpl. remember (a <=? z)%Z. destruct b.
inv H. intuition.
inv H. apply Z.leb_le in H4. congruence.
Qed.

(* Specifications: *)
Lemma insert_sorted : forall x xs, LocallySorted Z.le xs -> LocallySorted Z.le (insert x xs).
Lemma insertion_sort_sorted : forall xs, LocallySorted Z.le (insertion_sort xs).
Lemma insert_permutation : forall x xs , Permutation (x::xs) (insert x xs).
Lemma insert_permutation2 : forall x xs x2, Permutation xs x2 ->
Permutation (x::xs) (insert x x2).
Lemma insertion_sort_permutation : forall xs, Permutation xs (insertion_sort xs).
Lemma insertion_sort_sound : forall xs, LocallySorted Z.le (insertion_sort xs) /\ Permutation xs (insertion_sort xs).
*)