author haftmann Thu, 23 Feb 2012 20:15:49 +0100 changeset 46629 8d3442b79f9c parent 46619 08cb66dc7d2c child 46630 3abc964cdc45
tuned proof
 src/HOL/Big_Operators.thy file | annotate | diff | comparison | revisions
--- a/src/HOL/Big_Operators.thy	Thu Feb 23 17:27:37 2012 +0100
+++ b/src/HOL/Big_Operators.thy	Thu Feb 23 20:15:49 2012 +0100
@@ -786,15 +786,13 @@
by (simp only: card_def setsum_def)

lemma card_UN_disjoint:
-  "finite I ==> (ALL i:I. finite (A i)) ==>
-   (ALL i:I. ALL j:I. i \<noteq> j --> A i Int A j = {})
-   ==> card (UNION I A) = (\<Sum>i\<in>I. card(A i))"
-apply (simp add: card_eq_setsum del: setsum_constant)
-apply (subgoal_tac
-         "setsum (%i. card (A i)) I = setsum (%i. (setsum (%x. 1) (A i))) I")
-apply (simp add: setsum_UN_disjoint del: setsum_constant)
-apply simp
-done
+  assumes "finite I" and "\<forall>i\<in>I. finite (A i)"
+    and "\<forall>i\<in>I. \<forall>j\<in>I. i \<noteq> j \<longrightarrow> A i \<inter> A j = {}"
+  shows "card (UNION I A) = (\<Sum>i\<in>I. card(A i))"
+proof -
+  have "(\<Sum>i\<in>I. card (A i)) = (\<Sum>i\<in>I. \<Sum>x\<in>A i. 1)" by simp
+  with assms show ?thesis by (simp add: card_eq_setsum setsum_UN_disjoint del: setsum_constant)
+qed

lemma card_Union_disjoint:
"finite C ==> (ALL A:C. finite A) ==>