Cardinality of Set of Injections

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

The number of injections from $$S$$ to $$T$$, where $$\left|{S}\right| = m, \left|{T}\right| = n$$ is:

$$ \begin{cases} \frac {n!} {\left({n - m}\right)!} & : m \le n \\ 0 & : m > n \end{cases} $$

Informal Proof
This is the same question as determining how many permutations there are of $$n$$ objects out of $$m$$.

Informally, the thinking goes like this.

We pick the elements of $$S$$ in any arbitrary order, and assign them in turn to an element of $$T$$.

The first element of $$S$$ can be mapped to any element of $$T$$, so there are $$n$$ options for the first element.

The second element of $$S$$, once we've mapped the first, can be mapped to any of the remaining $$n-1$$ elements of $$T$$, so there are $$n-1$$ options for that one.

And so on, to the $$m$$th element of $$S$$, which has $$n - \left({m-1}\right)$$ possible elements in $$T$$ that it can be mapped to.

Each mapping is independent of the choices made for all the other mappings, so the total number of mappings from $$S$$ to $$T$$ is:

$$n \left({n-1}\right) \left({n-2}\right) \ldots \left({n-m+1}\right) = \frac {n!} {\left({n - m}\right)!}$$

Formal Proof

 * Let $$m > n$$.

There can be no injection from $$S$$ to $$T$$ when $$\left|{S}\right| > \left|{T}\right|$$, because once you've used up $$\left|{T}\right|$$ of the elements of $$S$$, there is no element of $$T$$ left for the remaining elements of $$S$$ to be mapped to such that they all still map to different elements of $$T$$.


 * Let $$m = 0$$.

The only injection from $$\varnothing \to T$$ is $$\varnothing \times T$$ which is $$\varnothing$$.

So if $$m = 0$$ there is $$1 = n! / n!$$ injection.


 * Let $$0 < m \le n$$.

As in the proof of Cardinality of Set of All Mappings, we can assume that $$S = \mathbb{N}_m$$ and $$T = \mathbb{N}_n$$.

For each $$k \in \left[{1 \,. \, . \, n}\right]$$, let $$\mathbb{H} \left({k, n}\right)$$ be the set of all injections from $$\mathbb{N}_k$$ to $$\mathbb{N}_n$$. Let:

$$\mathbb{S} = \left\{{k \in \left[{1 \,. \, . \, n}\right]: \left|{\mathbb{H} \left({k, n}\right)}\right| = \frac {n!} {\left({n - k}\right)!}}\right\}$$

It is clear that $$1 \in \mathbb{S}$$

Let $$k \in \mathbb{S}$$ such that $$k < n$$.

Let $$\rho: \mathbb{H} \left({k + 1, n}\right) \to \mathbb{H} \left({k, n}\right)$$ be the mapping defined by:

$$\forall f \in \mathbb{H} \left({k + 1, n}\right): \rho \left({f}\right) =$$ the restriction of $$f$$ to $$\mathbb{N}_k$$

Given that $$g \in \mathbb{H} \left({k, n}\right)$$ and $$a \in \mathbb{N}_n - g \left({\mathbb{N}_k}\right)$$, let $$g_a: \mathbb{N}_{k + 1} \to \mathbb{N}_n$$ be the mapping defined as:

$$ g_a \left({x}\right) = \begin{cases} g \left({x}\right) & : x \in \mathbb{N}_k \\ a & : x = k \end{cases} $$

It is clear that $$g_a \in \mathbb{H} \left({k + 1, n}\right)$$, and that:

$$\rho^{-1} \left({\left\{{g}\right\}}\right) = \left\{{g_a: a \in \mathbb{N}_n - g \left({\mathbb{N}_k}\right)}\right\}$$

Since $$g$$ is an injection, $$g \left({\mathbb{N}_k}\right)$$ has $$k$$ elements.

Therefore $$\mathbb{N}_n - g \left({\mathbb{N}_k}\right)$$ has $$n - k$$ elements by Cardinality of Complement.

As $$G: a \to g_a$$ is clearly a bijection from $$\mathbb{N}_n - g \left({\mathbb{N}_k}\right)$$ onto $$\rho^{-1} \left({\left\{{g}\right\}}\right)$$, that set has $$n - k$$ elements.

Clearly:

$$\left\{{\rho^{-1} \left({\left\{{g}\right\}}\right): g \in \mathbb{H} \left({k, n}\right)}\right\}$$

is a partition of $$\mathbb{H} \left({k + 1, n}\right)$$, so by Number of Elements in Partition:

$$\left|{\mathbb{H} \left({k + 1, n}\right)}\right| = \left({n - k}\right) \frac {n!} {n - k} = \frac {n!} {\left({\left({n - k}\right) - 1}\right)!}$$

as $$k \in \mathbb{S}$$.

But $$\left({n - k}\right) - 1 = n - \left({k + 1}\right)$$.

So $$k + 1 \in \mathbb{S}$$.

By induction, $$\mathbb{S} = \left[{1 \,. \, . \, n}\right]$$ and in particular, $$m \in \mathbb{S}$$.