5

I am trying to determine if that the set, $T$, of all eventually constant sequences of natural numbers is countable.

My intuition: The set $T$ is countable. . Let $T_j$ denote the set of sequences of natural numbers so that $t_i=t_j$ for all $i>j$. If we can show that $\mathbb{N}^k$ for all $k\in\mathbb{Z}^+$ is countable, then the union $$T=\bigcup_{j\in\mathbb{N}}T_j$$ is countable as a countable union of countable sets is also countable.

Is my intuition correct?

Steven H
  • 165

2 Answers2

2

First let's prove that $|\mathbb{N}^2| = |\mathbb{N}|$. An easy way to do this is by using Schröder-Cantor-Bernstein. We easily see that $|\mathbb{N}| \leq |\mathbb{N}^2|$ by sending $n$ to $(n, 0)$. We also find an injection $|\mathbb{N}^2| \leq |\mathbb{N}|$ by sending $(a, b)$ to $2^a 3^b$. By induction we thus have that $|\mathbb{N}^n| = |\mathbb{N}|$ for each natural $n \geq 1$.

Now we can complete the argument based on your sketch.

A finite sequence of length $n$ is just an element of $\mathbb{N}^n$. An eventually constant sequence is a finite sequence with an infinite tail that has constant value $k \in \mathbb{N}$. So for each $n,k \in \mathbb{N}$ there is a set $S_{n,k}$ of sequences that after $n$ values just become the constant sequence with value $k$. Then $$ |S_{n,k}| = |\mathbb{N}^n| = |\mathbb{N}|. $$ We have $$ T = \bigcup_{n,k \in \mathbb{N}} S_{n,k}, $$ which is a countable union of countable sets and hence countable.


As pointed out in the comments below your question, we generally need the axiom of choice (or a weak version of it) to prove that the countable union of countable sets is countable. This is because for each of the sets in the union we would have to choose a bijection. However, we can get around choice by explicitly constructing bijections $\mathbb{N}^n \to \mathbb{N}$. See for example the Cantor pairing function.

Edit: or see the excellent answer of String, describing an explicit bijection directly, showing that we do not need choice.

Mark Kamsma
  • 13,548
  • 1
  • 11
  • 35
  • Thank you for the mention! Your answer is very informative regarding the axiom of choice, which might sometimes be the way to go. – String Jun 09 '20 at 10:06
  • I think I worked it out! I was wondering though, is it okay that we define our tuples $t_n\in T$ by $(t_1,t_2,t_3,....)$? Or must they start from $t_0$? – Steven H Jun 11 '20 at 05:13
  • @StevenH That doesn't matter, it is only notation. If you'd want to start indexing at 5 or -580 you could do that as well (not recommended). – Mark Kamsma Jun 11 '20 at 06:40
  • @MarkKamsma haha okay, awesome. I am having trouble showing this is injective. Consider the map $$f: T\rightarrow\bigcup_{j\in\mathbb{Z}^+}\mathbb{N}^j.$$ If we define $f(t_1,t_2,t_3,...,t_j,t_k,t_k)=(t_1,t_2,...,t_j)$, we can take $T_x,T_y\in T$. How does $f(T_x)=f(T_y)\implies T_x=T_y$ and therefore injectivity? – Steven H Jun 11 '20 at 07:01
1

Your suggestion works well, but I just felt tempted to propose the following bijection: $$ f:T\longleftrightarrow\mathbb N $$ given by: $$ f(\{t_1,t_2,...,t_k,t_k,...\})=\prod_{i=1}^k p_i^{t_i-1} $$ where $p_i$ denotes the $i^{th}$ prime number.


TonyK is completely correct in the comments. I will suggest a fix in a minute!

String
  • 18,838
  • That doesn't work, for two reasons: (i) $f({t_1,t_2,\ldots,t_{k-1},1,1,1,\ldots})$ is the same as $f({t_1,t_2,\ldots,t_{k-1},t_{k-1},t_{k-1},\ldots})$; and (ii) integers whose last two prime exponents are equal won't appear in the range: e.g. $f^{-1}(2^33^55^5)$ doesn't exist, because it would be ${4,6,6,6,6,\ldots}$ but $f({4,6,6,6,6,\ldots})$ is $2^33^5$. These are both fixable, but it gets rather messy. – TonyK Jun 09 '20 at 10:22
  • @TonyK: You are right! Will fix it. – String Jun 09 '20 at 10:36
  • An injection is simpler: $\prod_{i=1}^k p_i^{t_i}$. – TonyK Jun 09 '20 at 10:39
  • @TonyK: Yes, I thought about that. A bijection is nice, though! – String Jun 09 '20 at 10:39