A question about countability of a set of functions from natural numbers to natural numbers

elementary-set-theorysolution-verification

Let $\mathscr{A}$ be the set of all functions $f : \mathbb{N} \to \mathbb{N}$ such that $\{i \in \mathbb{N} \mid f(i) \neq 1\}$ is finite. Is the set $\mathscr{A}$ finite, countably infinite, or uncountable? Prove your answer.

Let A=$\{i \in \mathbb{N} \mid f(i) \neq 1\}$.

My idea is to find an example. Let A=$\{2,3,4\}$

Then this accords with the requirement that A is a finite set and because all elements in A satisfy the restriction that $f(i)\neq 1$

Then list some suitable functions in all maps from N to N

$ f_1(2)=2, f_2(2)=3,f_3(2)=4,…$

These functions are in $\mathscr{A}$ and they are different functions. There are countably infinite of them.

Similarly

$ f_1'(3)=2, f_2'(3)=3,f_3'(3)=4,…$
Some of the functions in this collection of functions can be the same as the previous collection $ f_1(2)=2, f_2(2)=3,f_3(2)=4,…$, but it doesn't matter because the union of these two collections is also countably finite. Similarly, for 4$\in$ A

As a result, $\mathscr{A}$ is countably finite.

Is this correct?

Best Answer

Choose an enumeration of the finite subsets of $\Bbb N$. There are countably many such subsets so such an enumeration is possible.

For each finite subset of $S \subseteq \Bbb N$, there are only countably many maps $g: S \to \Bbb N \setminus \{ 1 \}$. There is a one-to-one correspondence between elements of $\mathscr A$ and ordered pairs $(S, g)$. There are only countably many possible choices for $S$ and for each $S$ only countably many choices for $g$. Therefore, there are only countably many such ordered pairs, so $\mathscr A$ is countable.

As noted in Mark Saving's answer, the problem with a diagonal argument is that you haven't proved (and can't prove) that the new function created using the diagonal technique is in fact also in $\mathscr A$ because you haven't proved that it takes on the value $1$ at all but finitely many arguments.