General inclusion–exclusion
Statement
For finite sets :
Why is it true?
Each element that lies in several of the sets gets added once for every single set, subtracted once for every pair, added back for every triple, and so on; the alternating pattern is exactly what is needed to bring its total count back down to exactly .
Proof sketch
Fix any element . If belongs to none of , it contributes to both sides of the formula, so assume belongs to exactly of the sets.
For each , the number of -fold intersections that contain equals the number of ways to choose of the sets containing , namely . So 's total contribution to the right-hand side is (terms with vanish since ).
By the binomial theorem, , so , and multiplying by gives exactly .
So every element in at least one set contributes exactly to the right-hand side, matching its contribution of to ; elements in no set contribute to both sides. Since every element contributes equally to both sides, the two sides are equal.
Topics that use this theorem
Step-by-step proofs
No step-by-step proof yet for this theorem.
References
- Wikipedia contributors (2024). Inclusion–exclusion principle
- James Maynard (2015). Small gaps between primes · arXiv:1311.4600
- Richard A. Brualdi (2017). Introductory Combinatorics (Classic Version), 5th edition