Union of countable sequence of countable sets I realize this question has been asked and answered multiple times, but I'm still not understanding the reasoning. For reference, I've read this, this, and this.

Theorem 2.12. Let {}, =1,2,…, be a sequence of countable sets, and put
$$S = \bigcup\limits_{n=1}^{\infty}E_n$$
Then  is countable.
Proof. Let every set  be arranged in a sequence {},
=1,2,3,…, and consider the infinite array

in which the elements of  form the th row. The array contains
all elements of . As indicated by the arrows, these elements can be arranged in a
sequence
11;21,12;31,22,13;41,32,23,14;…(*)
If any two of the sets  have elements in common, these will appear
more than once in (∗). Hence there is a subset  of the set of all
positive integers such that ∼, which shows that  is at most
countable. Since 1⊂, and 1 is infinite,  is infinite, and thus
countable. ◼

I understand if there's an injection $F: S\rightarrow \mathbb{N}$, S is countable. I don't understand how utilizing the diagonals leads to such an injection. Since there's 1 element in the first diagonal, 2 in the second, ..., n in the n-th, (n - 1) in the (n + 1)-th, etc., how is it possible to say that since there are n elements at most in any diagonal the set is countable?
 A: It's hard, at least for me, to make the diagonal argument clearer, so I offer you the next. Define the following sets:
$$\begin{cases}A_0=\{1,3,5,7,...,2n-1,...\}\\{}\\
A_1=\{2,6,10,14,...,4n-2,...\}\\{}\\
A_2=\{4,12,20,28,...,8n-4,...\}\\{}\\
...................................\\{}\\
A_n=\{2^n, 2^n+2^{n+1}, 2^n+2\cdot2^{n+1},...,n2^{n+1}-2^n,...\\{}\\..........................................| \end{cases}$$
Check all the above sets are pairwise disjoint and that their union is $\;\Bbb N\;$. Now you have a nice bijection between $\;\Bbb N\;$ and that countable union $\;\{E_n\}\;$ of countable sets: first, map each $\;E_n\to A_n\;$, and then map each element of $\;E_n\to $ an element of $\;A_n\;$ ( can you see why is this possible?).
A: The argument shows that there is a surjection $g : \Bbb{N} \to S$ (that's what the bit about arranging the elements in a sequence is telling us). Given such a surjection $g$, you can define the function $h : S \to \Bbb{N}$ that maps $s \in S$ to the least $n \in \Bbb{N}$ such that $g(n) = s$. $h$ is an injection.
A: Intuitively,  a set is countable precisely when it can be put into a list.  And that's exactly what the diagonal process does:  it puts all the elements of the array into a list.
A: All you're doing is showing that you can break $\mathbb{N}$ into sequential sets of size 1, 2, 3, 4 and so on as:
$\left\{\{0\}, \{1, 2\}, \{3, 4, 5\}, \{6, 7, 8, 9\}, \ldots \right\}$
and we can match those up with equally-sized sets of ordered pairs from $\mathbb{N}^2$ as:
$\left\{\{(0, 0)\}, \{(0, 1), (1, 0)\}, \{(0, 2), (1, 1), (2, 0)\}, \{(0, 3), (1, 2), (2, 1), (3, 0)\} \ldots \right\}$
If you want to make it more formal, you can outright define the bijection between each natural number and one of the pairs by noticing that (1) in each of those sets of pairs the sum of the pair is constant and equal to the position of the set in the list (if you start numbering from 0), (2) the first value in each pair denotes the index within the set (again counting from 0), (3) in the sets of single numbers the first number in the set is a triangular number.
Let's denote $t_k = \frac{k(k+1)}{2}$ as the $k$-th triangular number. Then in one direction, we have the function:
$F: \mathbb{N}^2 \rightarrow \mathbb{N}$, $F(i, j) = t_{i+j} + i$
You can also define $F^{-1}: \mathbb{N} \rightarrow \mathbb{N}^2$ explicitly, but it's a little messier since you have to use a floor function on a quadratic formula. Instead, I'm just going to outright claim that $F$ is a bijection since:

*

*$t_{i+j}$ is always the largest triangular number less than or equal to $F(i, j)$ because $t_{i+1} \leq F(i, j) < t_{i+j+1}$

*Therefore, if $F(i, j) = F(i', j')$ then $t_{i + j} = t_{i' + j'} \implies i + j = i' + j'$ and $F(i, j) - t_{i + j} = i = i' \implies i' = j'$ so $F$ is injective

*There are $k$ natural numbers in the interval $[t_k, t_{k+1} - 1]$ and $k$ ways to find natural numbers $i, j$ such that $i + j = k$, so $F$ must in some sense "fill" all of the gaps between consecutive triangular numbers.

