# HG changeset patch # User haftmann # Date 1288712899 -3600 # Node ID e4461b9854a5a79da7d36b348a9b86c23b39c177 # Parent 41833242cc428afa7faeb05c02219a3f4bd1f1f5 tuned proof diff -r 41833242cc42 -r e4461b9854a5 src/HOL/Library/Multiset.thy --- a/src/HOL/Library/Multiset.thy Tue Nov 02 16:36:33 2010 +0100 +++ b/src/HOL/Library/Multiset.thy Tue Nov 02 16:48:19 2010 +0100 @@ -902,11 +902,12 @@ fix l assume "l \ set ?rhs" let ?pivot = "f (xs ! (length xs div 2))" - have *: "\x P. P (f x) \ f x = f l \ P (f l) \ f x = f l" by auto + have *: "\x P. P (f x) \ f l = f x \ P (f l) \ f l = f x" by auto have **: "\x. f l = f x \ f x = f l" by auto - have [simp]: "[x \ sort_key f xs . f x = f l] = [x \ xs. f x = f l]" + have "[x \ sort_key f xs . f x = f l] = [x \ xs. f x = f l]" unfolding filter_sort by (rule properties_for_sort_key) (auto intro: sorted_map_same) - have "[x \ ?rhs. f x = f l] = [x \ ?lhs. f x = f l]" + with ** have [simp]: "[x \ sort_key f xs . f l = f x] = [x \ xs. f l = f x]" by simp + show "[x \ ?rhs. f l = f x] = [x \ ?lhs. f l = f x]" proof (cases "f l" ?pivot rule: linorder_cases) case less then show ?thesis apply (auto simp add: filter_sort [symmetric]) @@ -915,11 +916,8 @@ apply (subst *) apply (frule less_not_sym) apply simp done next - case equal from this [symmetric] show ?thesis - apply (auto simp add: filter_sort [symmetric]) - apply (subst *) apply simp - apply (subst *) apply simp - done + case equal then show ?thesis + by (auto simp add: ** less_le) next case greater then show ?thesis apply (auto simp add: filter_sort [symmetric]) @@ -927,8 +925,7 @@ apply (frule less_imp_neq) apply simp apply (subst *) apply simp done - qed - then show "[x \ ?rhs. f l = f x] = [x \ ?lhs. f l = f x]" by (simp add: **) + qed qed lemma sort_by_quicksort: