Set Finite iff Surjection from Initial Segment of Natural Numbers

Theorem
Let $S$ be a set.

Then $S$ is finite for some $n \in \N$ there exists a surjection $f: \N_{< n} \to S$.

Here, $\N_{< n}$ denotes an initial segment of $\N$.

Necessary Condition
Suppose that $S$ is finite.

By definition, this means there exists a bijection $f: \N_{< n} \to S$.

Then $f$ is a fortiori also the sought surjection.

Sufficient Condition
Let $f: \N_{< n} \to S$ be a surjection.

Define $g: S \to \N_{< n}$ by:


 * $g (s) := \min f^{-1} (s)$

where $f^{-1} (s)$ is the preimage of $s$ under $f$.

Note that $f^{-1} (s)$ is not empty because $f$ is a surjection.

By the Well-Ordering Principle, $f^{-1} (s) \subseteq \N$ has a smallest element.

Hence $g$ is well-defined.

It remains to show that $g$ is injective.

So suppose that $g(s) = g(s')$ for some $s, s' \in S$:

Hence $g$ is injective.