In my previous post I stated a very formal, general form of the Principle of Inclusion-Exclusion, or PIE. In this post I am going to outline one proof of PIE. I’m not going to give a completely formal proof, because the notation gets quite hairy (imagine doing algebraic manipulations on the formulas in the previous post)! But I hope to give enough of an intuition that when I say “and so on”, intrepid readers with good algebra skills should be able to complete a formal algebraic proof.
For the proof, we will first need a few algebraic facts about set operations:
Set intersection distributes over union, that is,
You should be able to convince yourself of this by staring at a picture:
Also, if you think of union as being like addition and intersection as being like multiplication, then this says , which makes it easy to remember. (Although unlike the case of addition and multiplication, union also distributes over intersection, that is, —you might like to try convincing yourself that this works. We won’t need this fact, though.)
Set intersection has some nice properties:
It is idempotent, that is, : if you intersect a set with itself you get the same set back.
It is commutative, that is, : the order of sets being intersected doesn’t matter.
Finally, it is associative, that is, : if we have a sequence of intersections to do it doesn’t matter which one we start with. Because of this we can just write things like without worrying about parentheses.
Later in the proof we will use these properties together to argue, for example, that : associativity means it doesn’t matter where we put parentheses; commutativity means we can swap the and , and then idempotence says that the two adjacent copies of can be replaced by one copy.
There are lots of other nice properties, too—for example, union has similar properties to intersection—but these are the only ones we will need for the proof below.
Finally, to save space and make things a bit easier to read, in the rest of the post I will sometimes omit the symbol and write just instead of . For example, using this notation the fact that intersection distributes over union can be written
Onward to the proof! We’ll prove the alternative presentation of PIE I introduced in my previous post, which tells us how to compute the size of a set like . The proof is by induction on the number of sets being unioned.
First, for , PIE just says that . Done!
Well, actually, to get things off the ground we really need to treat as a base case as well. In this case, PIE says that
(remember that means ). We’ll call this equation PIE2. We can prove it by staring at another picture:
This is pretty clear: adding the sizes of and double-counts their overlap, so we have to subtract it once.
Now is where it gets more interesting. Consider the case with three sets, . The trick is to start by writing as and then to apply PIE2, using as the first set and as the second. In the proof below I’ve written the justification for each step in curly brackets.
Notice in the last step how we turned into —recall that the properties of intersection let us reorder the sets in an intersection like this and get rid of duplicates.
And there we go, we have derived PIE for just using PIE2 and the laws of set algebra! We’ll call this result PIE3. Now, what about the case for ?
There is a lot of algebra to do after applying PIE3 twice, but I think it’s actually better to not do it and instead focus on the big picture. We already know what is. We get every combination of intersections among , , and , added or subtracted according to whether the number is odd or even. But what about ? Notice it’s the same as but where each set has been intersected with . We’re going to end up with every possible intersection between , , and , but because we can cancel out duplicate copies of , this is the same as taking every possible intersection between , , and , and then intersecting each with one copy of . Also note that because we’re subtracting , the signs will be flipped relative to what we got with —which makes sense since each term will have one extra set in it (namely, ) which will turn odd intersections into even and vice versa. In other words, at a very high level we will end up with
(all combinations of ,,) + – (all combinations of ,, with a added)
Notice how every possible combination of , , , and other than the empty intersection shows up exactly once, with the correct sign: every combination that doesn’t include shows up in the first part (with the correct sign); then is added by itself; then every combination that does include and at least one other set shows up in the last part (with sign flipped to reflect the addition of one extra set).
In general, you can see how this is going to work. For each we can prove PIE, that is, the version of PIE for a union of sets, by splitting off a single set , using PIE2 like so:
and then using PIE twice, once yielding all combinations without , and once yielding all combinations with . As I said, the notation to write that out formally (without any ellipses!) gets a bit hairy, but hopefully the idea makes sense!
Next time we’ll see a completely different proof of PIE, that relies on counting rather than algebra.