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.

Next we show that $g$ is injective.

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

Hence $g$ is injective.

Then by Injection to Image is Bijection, $S$ is equivalent to a subset of $\N_{<n}$.

By Subset of Finite Set is Finite, it follows that $S$ is finite.