I am struggling to understand following points made on wikipedia page of counting sets:
Let S be a set. The following statements are equivalent:
- S is countable, i.e. there exists an injective function f : S → N.
- Either S is empty or there exists a surjective function g : N → S.
- Either S is finite or there exists a bijection h : N → S.
I understand how point 1 implies point 2. But I dont understand how point 2 implies point 3.
Let me prove $(1)\implies (2)$:
Let $f:S\rightarrow \mathbb N$ be injective function.
First of all $f$ is a function. So each element of $S$ is mapped to some element in $\mathbb N$, since any function maps all elements in its domain to its codomain. Since each element in domain has corresponding mapping element in codomain, if we make a new function $g$ with domain as codomain of $f$ and codomain as domain of $f$ , it will be surjective function, since by definition, in surjective function, all elements in codomain have corresponding mapping element in domain. Thus, $g:\mathbb N\rightarrow S$ is surjective function. (Is this proof correct?)
How can we prove $(2)\implies (3)$ ?