Suppose $X$ is infinite and $f_n: \{1,\cdots,n\} \to X$ is injective for all $n \in \mathbb N$. Define an injective mapping $G:\mathbb N \to X$.
I re-formulate Asaf Karagila's sketch into a proof in detail. The motivation for this conduct is that I would like to truly understand Asaf Karagila's ideas.
Does this proof look fine or contain gaps? Do you have suggestions? Many thanks for your dedicated help!
My attempt:
Let $\Bbb N =\{1,2,3,\cdots\}$ be the set of natural numbers and $I_n = \{1,\cdots,n\}$.
Let $X^{<\omega} = \{h: I_k \to X \mid k \in \Bbb N\}$ be the set of all finite sequences from $X$. Consider
$$\begin {array}{l|rcl} H : & X^{<\omega} & \longrightarrow & X^{<\omega} \\ & h & \longmapsto & H(h) \end{array}$$
where $h: I_k \to X$.
$H(h):I_{k+1} \to X$ is defined by $${H(h)\restriction}_{I_k} = h \text{ and } H(h)(k+1)=f_{k+1}(t)$$ where $t = \min \{n \in \mathbb N \mid f_{k+1}(n) \notin \operatorname{ran}h\}$.
Because $|\operatorname{ran}f_{k+1}| = k+1 > |\operatorname{ran}h| = k$, $\{n \in \mathbb N \mid f_{k+1}(n) \notin \operatorname{ran}h\} \neq \emptyset$ and consequently such $t$ does exists by the fact that $\Bbb N$ is well-ordered with respect to <.
By Recursion Theorem, there exists a unique mapping $g:\Bbb N \to X^{<\omega}$ such that $g_1=f_1$ and $g_{n+1}=H \circ g_n$.
Notice that $H \circ g_n (k):=(H(g_n))(k)$, i.e. $H \circ g_n (k)$ denotes the value of function $H (g_n)$ at $k$ for $k \in \operatorname{dom}H (g_n)$.
- $g_n \subseteq g_{n+1}$
By definition, $g_{n+1} = H \circ g_n$, then $g_{n+1}(i)=g_n(i)$ for all $i \in \operatorname{dom}g_n$. Hence $g_n \subseteq g_{n+1}$.
- $g_n$ is injective
We prove this statement by induction on $n$. It's clear that $g_1=f_1$ is injective since $|\operatorname{dom}f_1|=1$. Assume that $g_n$ is injective for $n=k$.
Assume the contrary that $g_{n+1}$ is not injective, then $g_{n+1}(i_1)=g_{n+1}(i_2)$ for some $i_1 < i_2 \le n+1$ or equivalently $H \circ g_n(i_1) = H \circ g_n(i_2)$ for some $i_1 < i_2 \le n+1$.
a. If $i_2 = n+1$. Then $H \circ g_n(i_2)=H \circ g_n(i_1) =g_n(i_1)$. Thus $H \circ g_n(n+1)=H \circ g_n(i_2) =g_n(i_1) \in \operatorname{ran}g_n$. This contradicts the definition of $H \circ g_n(n+1)$.
b. If $i_2 < n+1$. Then $i_1,i_2 \in \operatorname{dom}g_n$, then $H \circ g_n(i_1) = H \circ g_n(i_2)$ $\implies g_n(i_1)=g_n(i_2)$. This contradicts the inductive hypothesis that $g_n$ is injective.
Hence $g_{n+1}$ is injective.
We now define the required mapping $G:\Bbb N \to X$ by $G_n=g_n(n)$.
- $G$ is injective
Assume the contrary that $G$ is not injective. Then there exists $n_1 < n_2$ such that $G_{n_1} = G_{n_2}$, thus $g_{n_1}(n_1) = g_{n_2}(n_2)$.
$g_{n_1} \subseteq g_{n_1+1} \subseteq g_{n_1+2} \subseteq \cdots \subseteq g_{n_2} \implies g_{n_1} \subseteq g_{n_2}$. It follows that $g_{n_1}(n_1)=g_{n_2}(n_1) \neq g_{n_2}(n_2)$ since $g_{n_2}$ is injective. This contradicts the fact that $g_{n_1}(n_1) = g_{n_2}(n_2)$.
Hence $G$ is injective.
The only thing I'd do differently, here, is to point out that we're defining $I_n$ for all $n\in\Bbb N.$ I might also define $I_n=\{k\in\Bbb N\mid k\le n\},$ for precision.
The flow here is a bit disjointed, though you seem to have the right idea. There is one error that you made: we cannot say for sure that $\lvert\operatorname{ran}h\rvert=k,$ only that $\lvert\operatorname{ran}h\rvert\leq k.$ Can you see why? Instead, I'd proceed as follows:
Notice that I've also adjusted the notation slightly in the definition line (I'll address that again, shortly.) Now, let's get back to your proof.
One thing I'd do differently is add "for all $n\in\Bbb N$" at the end of the first sentence. For another thing, you've gone from using the notation $H(h)(k)$ to $H\circ h(k).$ While they are effectively the same in this case, it necessitates your next comment to try to avoid confusion. But there, you compare it to the notation $\bigl(H(h)\bigr)(k),$ instead! I would instead stick with the clearest notation throughout, at which point the second sentence here becomes unnecessary. One other thing I'd add, here, is that $g_n:I_n\to X$ for all $n\in\Bbb N,$ which readily follows inductively from prior discussion during the definition of $H.$
It would probably be more straightforward (if you've proved that $g_n:I_n\to X$ for all $n\in\Bbb N$) to say: "Since $g_{n+1}\restriction_{I_n}=g_n$ for all $n\in\Bbb N,$ then $g_n\subseteq g_{n+1}$ for all $n\in\Bbb N.$"
This part is much more complicated than it needs to be (and may not even be correct; I haven't read through it). Instead, I'd look back to the definition of $H,$ and proceed directly, as follows:
Now, let's get back to your proof.
You've got the idea, but you should make the induction explicit, instead of relying on "..." to fill in the blank. Instead, I'd proceed in this way: