# HG changeset patch # User haftmann # Date 1288713580 -3600 # Node ID ad053b4e2b6de399887077b15c59a786ffeb54b0 # Parent e4461b9854a5a79da7d36b348a9b86c23b39c177 tuned proof diff -r e4461b9854a5 -r ad053b4e2b6d src/HOL/Library/Multiset.thy --- a/src/HOL/Library/Multiset.thy Tue Nov 02 16:48:19 2010 +0100 +++ b/src/HOL/Library/Multiset.thy Tue Nov 02 16:59:40 2010 +0100 @@ -901,28 +901,28 @@ next fix l assume "l \ set ?rhs" - let ?pivot = "f (xs ! (length xs div 2))" 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 "[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) with ** have [simp]: "[x \ sort_key f xs . f l = f x] = [x \ xs. f l = f x]" by simp + let ?pivot = "f (xs ! (length xs div 2))" 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 + case less then moreover have "f l \ ?pivot" and "\ f l > ?pivot" by auto + ultimately show ?thesis apply (auto simp add: filter_sort [symmetric]) apply (subst *) apply simp - apply (frule less_imp_neq) apply simp - apply (subst *) apply (frule less_not_sym) apply simp + apply (subst *) apply simp done next case equal then show ?thesis by (auto simp add: ** less_le) next - case greater then show ?thesis + case greater then moreover have "f l \ ?pivot" and "\ f l < ?pivot" by auto + ultimately show ?thesis apply (auto simp add: filter_sort [symmetric]) - apply (subst *) apply (frule less_not_sym) apply simp - apply (frule less_imp_neq) apply simp + apply (subst *) apply simp apply (subst *) apply simp done qed