Principle of inclusion and exclusion

Theorem 210.1(Principle of inclusion and exclusion).

Let be a finite universe. . For , define , .

Number of surjections

Let be the set of all functions from .
Let be the set of all functions from to such that is not covered.
Then, the number of surjections is equal to

Derangements

Let be the set of all permutations on . Let be the set of all permutations which map to . Then, the number of derangements is equal to

The Euler function

Let . Let be distinct prime factors of . The “bad elements” are the multiples of the s. Let .

Linear algebraic formulation

Let . Consider the collection . This forms a dimensional vector space over . Then, for , the following two statements are equivalent.

Think of it this way: Let the elements of be different “properties” of elements of another set . An element of can have any number of properties . For , Let be the set of all which have each property (Note that all the properties of may be a super set of ). Think of as counting the number of elements in which have properties (), and as counting the number of elements in which have exactly the properties ().