author haftmann Sun, 19 Feb 2012 15:40:58 +0100 changeset 46554 87d4e4958476 parent 46553 50a7e97fe653 child 46555 c2b5900988e2
tuned proof
 src/HOL/Big_Operators.thy file | annotate | diff | comparison | revisions
```--- a/src/HOL/Big_Operators.thy	Sun Feb 19 15:30:35 2012 +0100
+++ b/src/HOL/Big_Operators.thy	Sun Feb 19 15:40:58 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) ==>```