[Math] Is a surjective function with the same finite domain and finite codomain automatically bijective

elementary-set-theory

I have a particular question I am trying to solve.

True or false. Any surjective (onto) function $f:x \rightarrow x$ where $x$ is finite, must be bijective.

Since $x$ is finite, and since the domain and codomain are both the same, I am tempted to argue true, because I don't see how else each element in x could be hit. Am I wrong?

Best Answer

You are correct, as the comments point out. Two quick comments:

(1) You don't need induction, although you can use it if you want to. Given a map $f: X\rightarrow X$ which is surjective but not injective, you can build an injection of $\mathbb{N}$ into $X$ (fun exercise), so $X$ couldn't have been finite.

(2) Very weirdly, the converse need not hold (unless we assume the axiom of choice): it is consistent with ZF, the axioms of set theory minus choice, that there are infinite sets $X$ such that any onto map $X\rightarrow X$ must be a bijection. Such sets are called Dedekind-finite.