equal
deleted
inserted
replaced
824 |
824 |
825 text {* |
825 text {* |
826 This lemma shows which properties suffice to show that a function |
826 This lemma shows which properties suffice to show that a function |
827 @{text "f"} with @{text "f xs = ys"} behaves like sort. |
827 @{text "f"} with @{text "f xs = ys"} behaves like sort. |
828 *} |
828 *} |
829 lemma properties_for_sort: |
829 |
|
830 lemma (in linorder) properties_for_sort: |
830 "multiset_of ys = multiset_of xs \<Longrightarrow> sorted ys \<Longrightarrow> sort xs = ys" |
831 "multiset_of ys = multiset_of xs \<Longrightarrow> sorted ys \<Longrightarrow> sort xs = ys" |
831 proof (induct xs arbitrary: ys) |
832 proof (induct xs arbitrary: ys) |
832 case Nil then show ?case by simp |
833 case Nil then show ?case by simp |
833 next |
834 next |
834 case (Cons x xs) |
835 case (Cons x xs) |