Theorem 1 (Principle of Inclusion-Exclusion) Let be a finite set, and be subsets of , then
Problem 1063
Official solution
To prove (contribution method) that for any , it is sufficient to prove that the number of times is counted on both sides of (1) is the same.
If does not belong to any of the sets , then is counted 1 time on the left side of (1), and is counted 1 time in the first term on the right side of (1), while in the other summation terms on the right side of (1), is counted 0 times. Therefore, the total number of times is counted on the right side of (1) is also 1.
If belongs to exactly of the sets , where , then is counted 0 times on the left side of (1), and in the first term, second term, , -th term, , the last term on the right side, is counted , times, respectively. Therefore, the total number of times is counted on the right side of (1) is
In summary, we know that for any , the number of times is counted on both sides of (1) (i.e., the contribution of to both sides of the equation) is the same. Therefore, (1) holds.
For any subset of , since
we have . Thus, Theorem 2 can be derived from Theorem 1.