Sketch: apply inclusion and exclusion to the maps missing a given value, and to the permutations fixing a given point, then group the subsets by size.
Throughout, and are finite, as subsets of the finite sets and (Finite Sets: the Pigeonhole Principle, Uniqueness of the Length, Subsets, Unions, Products, Images, Bounded Sets of Natural Numbers, Extreme Elements, Sets of Maps, Finite Unions and Finite Choice (ix), Finite Sets: Removing an Element, Injective Self-Maps, Infinite Sets, Sets of Permutations, Pairs and Extended Tuples (iv), Finite Sets: the Pigeonhole Principle, Uniqueness of the Length, Subsets, Unions, Products, Images, Bounded Sets of Natural Numbers, Extreme Elements, Sets of Maps, Finite Unions and Finite Choice (iv)); the elements of are exactly the bijections (Permutations of a Set and the Set of Permutations of [n] (iii)); and for and we have , because and (Counting: Intervals, Empty Sets and Singletons, Injective Images, Subsets, Unions and Products (iv), Counting: Intervals, Empty Sets and Singletons, Injective Images, Subsets, Unions and Products (v), Counting: Intervals, Empty Sets and Singletons, Injective Images, Subsets, Unions and Products (i), The Difference of Two Natural Numbers with Zero (i)); the intervals of are finite sets (Finite Sets: the Pigeonhole Principle, Uniqueness of the Length, Subsets, Unions, Products, Images, Bounded Sets of Natural Numbers, Extreme Elements, Sets of Maps, Finite Unions and Finite Choice (vii)); and elements of , which is closed under products, are read in the field , where they and powers such as lie, and where their differences, products and powers keep their values (Multiplication on Omega (i), The Structure of β as a Field and an Ordered Ring (i), Maps Given by Iterated Operations: Partial Iterates, Images of Natural Numbers, Powers and Operations over a Finite Set (ii), Maps Given by Iterated Operations: Partial Iterates, Images of Natural Numbers, Powers and Operations over a Finite Set (iv), The Image of the Natural Numbers with Zero in a Commutative Ring Respects Zero, One, Sums, Products, Differences, Powers, and Finite Sums and Products (iv), The Image of the Natural Numbers with Zero in a Commutative Ring Respects Zero, One, Sums, Products, Differences, Powers, and Finite Sums and Products (iii), The Image of the Natural Numbers with Zero in a Commutative Ring Respects Zero, One, Sums, Products, Differences, Powers, and Finite Sums and Products (v)). All formulas follow from The Principle of Inclusion and Exclusion (i), after grouping the subsets by size (the maps and on the subsets of the index set are those of The Maps i β¦ #C(i) and S β¦ #S (i) and The Maps i β¦ #C(i) and S β¦ #S (ii)).
Step 1 (surjections avoid no value). Let , , and for let . A map lies in none of the exactly when every is a value of , so
by The Sets of Injections, Surjections and Bijections between Two Sets (ii).
Step 2 (the sets ). Let . For nonempty , means that no element of is a value of ; for , . In both cases
A map with all its values in is a map , and conversely (Gluing Maps on Disjoint Domains, and Shrinking the Codomain (iii)); so , and by Counting Maps, Injections, Bijections and Permutations (i)
Step 3 ((i)). By Steps 1 and 2 and The Principle of Inclusion and Exclusion (i) with , and then Counting Subsets (iii) with and , with and its power formed in ,
Step 4 (derangements fix no point). Now let and, for , . A permutation lies in none of the exactly when it fixes no point, so (Derangements (ii)). For , both for and for nonempty ,
Step 5 (a permutation fixing permutes the rest). Let , and . If and , then , so by injectivity, which is impossible; hence . If , then for some , and , since otherwise ; hence every is the value of at a point of . Therefore the restriction of to (Domains and Restrictions of Maps (ii)), taken with codomain (Gluing Maps on Disjoint Domains, and Shrinking the Codomain (iii)), is injective and surjective, that is, an element of (The Sets of Injections, Surjections and Bijections between Two Sets (iii)).
Step 6 (restriction is a bijection onto ). The map , , is injective: two elements of with the same restriction agree on , and on both are the identity, so they agree on . It is surjective: for , gluing with the identity map of gives a bijection , since and (Gluing Maps on Disjoint Domains, and Shrinking the Codomain (i), Gluing Maps on Disjoint Domains, and Shrinking the Codomain (ii)); fixes every point of , so , and . Since , Counting through Bijections, Injections and Surjections (i) and Counting Maps, Injections, Bijections and Permutations (iii) give
Step 7 ((ii)). By Steps 4 and 6 and The Principle of Inclusion and Exclusion (i) with , and then Counting Subsets (iii) with and the map given by for and for (Maps Defined by Cases (i)), whose value at is (as for ),
Step 8 ((iii)). Let . By Binomial Coefficients: Existence and Uniqueness by Pascal's Recursion, Vanishing above the Diagonal, Diagonal and First Values, the Factorial Formula and Symmetry (v), . As in (Natural Numbers and Factorials Read in the Reals: the Order Carries Over, One Is Least, and Factorials Are Positive, Recursive and Nondecreasing (iii)), dividing by gives
Substituting this into Step 7 and taking the common factor out of the sum (Sums over Finite Sets in a Commutative Ring and in an Ordered Field: Distributivity, Products of Sums, Vanishing Terms, Sums over Pairs, Expanding Products of Sums, Counting, Comparison, Monotonicity and the Triangle Inequality (i)),
Loadingβ¦