Math 2.0

Combinatorics Proof

Proof of the inclusion–exclusion principle by counting each element

Builds on Rule of sumNumber of k-element subsetsAlternating sum of binomial coefficientsDouble counting

Proof

We count how often each element is counted on the right side, a form of double counting.

  1. Let A1,…,AnA_1, \dots, A_n be finite sets, and let U=⋃i=1nAiU = \bigcup_{i=1}^{n} A_i. Then UU is the union of the pairwise disjoint sets Ai∖(A1∪⋯∪Ai−1)A_i \setminus (A_1 \cup \dots \cup A_{i-1}). Each is a subset of the finite set AiA_i, so the rule of sum shows that UU is finite.
  2. Let ℐ\mathcal{I} be the set of nonempty subsets I⊆{1,…,n}I \subseteq \set{1, \dots, n}. For I∈ℐI \in \mathcal{I}, let AI=⋂i∈IAiA_I = \bigcap_{i \in I} A_i. Then AI⊆UA_I \subseteq U.
  3. For x∈Ux \in U and I∈ℐI \in \mathcal{I}, let e(x,I)=1e(x, I) = 1 if x∈AIx \in A_I, and e(x,I)=0e(x, I) = 0 otherwise.
  4. For each I∈ℐI \in \mathcal{I}, the set AIA_I is the disjoint union of the singletons {x}\set{x} with x∈AIx \in A_I. So the rule of sum gives ∣AI∣=∑x∈Ue(x,I)|A_I| = \sum_{x \in U} e(x, I).
  5. Let RR be the right side of the statement. By step 4, and by exchanging two finite sums, R=∑I∈ℐ(−1)∣I∣+1∑x∈Ue(x,I)=∑x∈Uc(x),c(x)=∑I∈ℐ(−1)∣I∣+1e(x,I).R = \sum_{I \in \mathcal{I}} (-1)^{|I| + 1} \sum_{x \in U} e(x, I) = \sum_{x \in U} c(x), \qquad c(x) = \sum_{I \in \mathcal{I}} (-1)^{|I| + 1} e(x, I).
  6. Fix x∈Ux \in U. Let J={i:x∈Ai}J = \set{i : x \in A_i} and m=∣J∣m = |J|. Since x∈Ux \in U, JJ is nonempty, so m≥1m \ge 1.
  7. For I∈ℐI \in \mathcal{I}, we have x∈AIx \in A_I exactly when x∈Aix \in A_i for all i∈Ii \in I, that is, when I⊆JI \subseteq J.
  8. So c(x)c(x) is the sum of (−1)∣I∣+1(-1)^{|I| + 1} over the nonempty subsets II of JJ.
  9. By the number of kk-element subsets, JJ has (mk)\binom{m}{k} subsets with kk elements. Grouping the subsets by size gives c(x)=∑k=1m(−1)k+1(mk).c(x) = \sum_{k=1}^{m} (-1)^{k+1} \binom{m}{k}.
  10. Since m≥1m \ge 1, the alternating sum of binomial coefficients gives ∑k=0m(−1)k(mk)=0\sum_{k=0}^{m} (-1)^k \binom{m}{k} = 0.
  11. The term with k=0k = 0 there is (m0)=1\binom{m}{0} = 1. So ∑k=1m(−1)k(mk)=−1\sum_{k=1}^{m} (-1)^k \binom{m}{k} = -1, and by step 9, c(x)=1c(x) = 1.
  12. By steps 5 and 11, R=∑x∈U1=∣U∣R = \sum_{x \in U} 1 = |U|. This is the claimed formula ∣⋃i=1nAi∣=∑I∈ℐ(−1)∣I∣+1∣AI∣\left| \bigcup_{i=1}^{n} A_i \right| = \sum_{I \in \mathcal{I}} (-1)^{|I| + 1} |A_I|.

Idea

Expand each ∣AI∣|A_I| as a sum over its elements and collect the contributions of one element xx. If xx lies in exactly m≥1m \ge 1 of the sets, the signs add up to (m1)−(m2)+…\binom{m}{1} - \binom{m}{2} + \dots, which is 11 because (1−1)m=0(1 - 1)^m = 0. So every element of the union is counted exactly once.

Reading path

To understand this page from the ground up, read these 56 pages in order. The foundations come first. The path takes the proofs Proof of the number of k-element subsets by induction, Proof that a composition of injections is injective, Proof that a function is bijective iff it has a two-sided inverse, Proof of the complement principle, Proof of Pascal's rule from the recursive definition, Proof that a composition of surjections is surjective, Proof of the alternating sum of binomial coefficients from the binomial theorem, Proof of the factorial formula for binomial coefficients by induction, Proof of the binomial theorem by induction, Proof of the rule of sum, Proof of the bijection principle.

  1. Binomial coefficient definition
  2. Cardinality of a finite set definition
  3. Combination definition
  4. Double counting concept
  5. Element definition
  6. Factorial definition
  7. Group concept
  8. Proposition concept
  9. Proof of Pascal's rule from the recursive definition proof
  10. Set definition
  11. Ring definition
  12. Conjunction definition
  13. Implication definition
  14. Predicate definition
  15. Pascal's rule statement
  16. Empty set object
  17. Ordered pair definition
  18. Commutative ring definition
  19. Intersection definition
  20. Existential quantifier definition
  21. Universal quantifier definition
  22. Proof of the factorial formula for binomial coefficients by induction proof
  23. Cartesian product definition
  24. Disjoint sets definition
  25. Subset definition
  26. Uniqueness quantifier definition
  27. Factorial formula for binomial coefficients statement
  28. Binary relation definition
  29. Proof of the binomial theorem by induction proof
  30. Function definition
  31. Binomial theorem statement
  32. Codomain definition
  33. Function composition definition
  34. Identity function definition
  35. Injective function definition
  36. Proof of the alternating sum of binomial coefficients from the binomial theorem proof
  37. Surjective function definition
  38. Left inverse definition
  39. Right inverse definition
  40. Proof that a composition of injections is injective proof
  41. Alternating sum of binomial coefficients statement
  42. Proof that a composition of surjections is surjective proof
  43. Bijective function definition
  44. Composition of injections is injective statement
  45. Composition of surjections is surjective statement
  46. Proof of the rule of sum proof
  47. Proof that a function is bijective iff it has a two-sided inverse proof
  48. Rule of sum statement
  49. Bijective iff it has a two-sided inverse statement
  50. Proof of the complement principle proof
  51. Proof of the bijection principle proof
  52. Complement principle statement
  53. Bijection principle statement
  54. Proof of the number of k-element subsets by induction proof
  55. Number of k-element subsets statement
  56. Proof of the inclusion–exclusion principle by counting each element proof

Where this leads

5 pages build on this one.

Further reading

  1. Web https://en.wikipedia.org/wiki/Inclusion–exclusion_principle, Proof of main statement
About this page
TagJFVZP694ST
URIm2://JFVZP694ST
Kindproof
WritingW0 stub
MSC05A05
ProvesInclusion–exclusion principle
UsesRule of sum, Number of k-element subsets, Alternating sum of binomial coefficients, Double counting
Changed4 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.