The Principle of Inclusion-Exclusion is one of the most fundamental results in combinatorics, providing a systematic method for computing the cardinality of unions of finite sets.
DefinitionPrinciple of Inclusion-Exclusion
Let A1,A2,…,An be finite sets. Then:
∣⋃i=1nAi∣=∑k=1n(−1)k+1∑∣S∣=k⋂i∈SAi
where the inner sum is over all subsets S⊆{1,2,…,n} with exactly k elements.
Proof by Induction:
We prove by induction on n.
Base case: For n=1, the formula gives ∣A1∣, which is trivially true.
For n=2, we need to show ∣A1∪A2∣=∣A1∣+∣A2∣−∣A1∩A2∣.
Every element x is counted as follows:
If x∈A1 only: counted once in ∣A1∣, total = 1 ✓
If x∈A2 only: counted once in ∣A2∣, total = 1 ✓
If x∈A1∩A2: counted once in ∣A1∣, once in ∣A2∣, subtracted once in ∣A1∩A2∣, total = 1+1−1=1 ✓
If x∈/A1∪A2: not counted, total = 0 ✓
Inductive step: Assume the formula holds for n−1 sets. We prove it for n sets.
Note that A1∪A2∪⋯∪An=(A1∪⋯∪An−1)∪An.
By the n=2 case:
∣⋃i=1nAi∣=⋃i=1n−1Ai+∣An∣−(⋃i=1n−1Ai)∩An
By the inductive hypothesis:
⋃i=1n−1Ai=∑k=1n−1(−1)k+1∑∣S∣=k,S⊆{1,…,n−1}⋂i∈SAi
Note that (⋃i=1n−1Ai)∩An=⋃i=1n−1(Ai∩An).
Applying the inductive hypothesis again:
⋃i=1n−1(Ai∩An)=∑k=1n−1(−1)k+1∑∣S∣=k,S⊆{1,…,n−1}⋂i∈SAi∩An
Rearranging to group terms by the size of intersection sets, we obtain exactly the formula for n sets. □
Alternative Proof (Direct Counting):
Consider any element x in ⋃i=1nAi. Suppose x belongs to exactly m of the sets A1,…,An (where m≥1).
On the right-hand side, x is counted:
(1m) times in the first sum (single-set terms)
−(2m) times in the second sum (two-set intersections)
+(3m) times in the third sum (three-set intersections)
And so on...
The net count is:
∑k=1m(−1)k+1(km)=−∑k=0m(−1)k(km)+1=−(1−1)m+1=1
Therefore, each element in the union is counted exactly once. □
Remark
The inclusion-exclusion principle has a dual formulation for counting elements in the intersection of complements (using De Morgan's laws). It also extends to infinite sets in measure theory and probability, where it provides bounds through Bonferroni inequalities when the series is truncated at various terms.