Order embedding of $\mathbb{N}^{\mathbb{N}}$ with the lexicographic order into $\mathbb R$ We order the set $\mathbb{N}^{\mathbb{N}}$ with the relation $\sqsubset \text{which defimed by}$ $$ f\sqsubset g \iff \exists n \in \mathbb{N}.f(n)<g(n)\wedge \forall k < n.f(k)=g(k).$$
$\bullet$  Find $ I:\mathbb{N}^{\mathbb{N}} \rightarrow \mathbb{R}, \text{for which} \ \forall f,g \in \mathbb{N}^{\mathbb{N}}.f\sqsubset g \iff I(f)<I(g) $
What is the best way to find $I$, I dont know how to start.
 A: Consider $I:\mathbb{N}^{\mathbb{N}}\longrightarrow\mathbb{R}$ be defined by: for each $(x_n)_{n\in\mathbb{N}}\in\mathbb{N}^{\mathbb{N}}$, $f((x_n)_{n\in\mathbb{N}})$ is the only number in $[0,1)$ defined by the following string of decimals: first, put $x_0+1$ ones, then a zero, then $x_1+1$ ones, etc.
For example, take a sequence that starts like:
$$2\;\;3\;\;0\;\;4\;\;0\;\;514\;\dots$$
Then its image via $f$ would be a real number in $[0,1)$ that starts like:
$$0.1110111101011111010\dots$$
followed by $515$ ones, then by a zero, and then by $x_6+1$ ones, etc.
First, note that the image of any such sequence is a real number. In fact, since we are working in base $10$, and none of the defined images contain an infinite number of $9'$s in its decimal expression, this gives us an unique real number that lies in $[0,1)$. On the other hand, it is clear that this function is well-defined, since every sequence uniquely determines the decimal expression of its image; each of its elements determines a portion of the decimal expression in a unique manner. In fact, from this construction it is clear that this function is injective.
Now, if $f\sqsubset g$, then $I(f)<I(g)$, because if there exists some $n\in\mathbb{N}$ such that $f(k)=g(k)$ for all $k<n$ but $f(n)<g(n)$, this means that in the string of zeros and ones in the decimal expressions of $I(f)$ and $I(g)$, should be identical up until the position
$$(f(0)+1)+1+(f(1)+1)+1\dots+(f(n-1)+1)+1+f(n)+1=$$
$$=f(0)+f(1)+\dots+f(n)+2n+1$$
In which $I(g)$ has a $1$ in its decimal expression, while $I(f)$ has a $0$, thus $I(f)<I(g)$ with the usual order of $\mathbb{R}$.
