added lemma motivated by a more specific lemma in the AFP-KBPs theories
authorbulwahn
Tue, 13 Sep 2011 12:14:29 +0200
changeset 44916 840d8c3d9113
parent 44914 f0fd38929d21
child 44917 8df4c332cb1c
added lemma motivated by a more specific lemma in the AFP-KBPs theories
src/HOL/List.thy
--- a/src/HOL/List.thy	Tue Sep 13 09:56:38 2011 +0200
+++ b/src/HOL/List.thy	Tue Sep 13 12:14:29 2011 +0200
@@ -3867,6 +3867,9 @@
 lemma insort_is_Cons: "\<forall>x\<in>set xs. f a \<le> f x \<Longrightarrow> insort_key f a xs = a # xs"
 by (cases xs) auto
 
+lemma sorted_sort_id: "sorted xs \<Longrightarrow> sort xs = xs"
+  by (induct xs) (auto simp add: sorted_Cons insort_is_Cons)
+
 lemma sorted_map_remove1:
   "sorted (map f xs) \<Longrightarrow> sorted (map f (remove1 x xs))"
   by (induct xs) (auto simp add: sorted_Cons)