Cardinality of Set of Surjections

Theorem
Let $S$ and $T$ be finite sets.

Let $\card S = m, \card T = n$.

Let $C$ be the number of surjections from $S$ to $T$.

Then:
 * $C = n! \displaystyle {m \brace n}$

where $\displaystyle {m \brace n}$ denotes a Stirling number of the second kind.

Proof
Let $T$ be the codomain of a surjection $f$ from $S$ to $T$.

By the Quotient Theorem for Surjections, $f$ induces an equivalence $\mathcal R_f$ on $T$.


 * $f = r \circ q_{\mathcal R_f}$

where:
 * $\mathcal R_f$ is the equivalence induced by $f$ on $T$
 * $r: S / \mathcal R_f \to T$ is a bijection from the quotient set $S / \mathcal R_f$ to $T$
 * $q_{\mathcal R_f}: S \to S / \mathcal R_f$ is the quotient mapping induced by $\mathcal R_f$.

From the Fundamental Theorem on Equivalence Relations, $\mathcal R_f$ induces a partition on $S$.

From Cardinality of Set of Induced Equivalence Classes of Surjection, $\mathcal R_f$ has $m$ components.

From Number of Set Partitions by Number of Components, there are $\displaystyle {m \brace n}$ different ways of performing such a partitioning.

From Cardinality of Set of Injections, there are $n!$ different bijections from $S / \mathcal R_f \to T$

The total number of surjections is then the product of these:


 * $C = n! \displaystyle {m \brace n}$