Countable ordinals in the reals

I'm trying to show that for any countable ordinal $\alpha$, there is a subset of $(\mathbb{R},<)$ that has order type $\alpha$. In this post I'm not asking for a solution, but instead for a proof-check. If it's wrong I'll go back to the drawing board.

I tried using induction: assume that every $\beta<\alpha$ admits a subset of $(\mathbb{R},<)$ with order type $\beta$. Since $\alpha$ is assumed countable $\{\beta\in \text{Ord}:\beta<\alpha\}$ is countable, so we can enumerate as $\beta_0,\beta_1\dots$. Then map $f_k:\beta_k\to [k,k+1)\subset \mathbb{R}$ where $f_k$ order preserving and continuous, and $\sup f( \beta_k) = k+1$. Then $\bigcup \beta_k$ is a well-order with order type $\alpha$.

Does this work? If so, is it ok to claim the existence of such $f_k$'s?


Here is an alternative way of showing that every countable ordinal is order-isomorphic to a subset of the real line (or a subset of $[0,1]$, below).

For finite ordinals this is clear (just take a finite subset of $[0,1]$ with the same number of points).

Now let $\nu=\{\gamma:\gamma<\nu\}$ be an infinite countable ordinal. Fix a bijection $f:\{\gamma:\gamma<\nu\}\to\Bbb N_+$ (where $\Bbb N_+$ denotes the set of all positive integers), and map each $\gamma<\nu$ to $\psi(\gamma):=\sum\limits_{\delta<\gamma}\frac{1}{2^{f(\delta)}}$.
Note that this maps $\gamma=0$ to $0\in[0,1]$ (i.e. $\psi(0)=0\ $) because $\sum\limits_{\delta<0}\frac{1}{2^{f(\delta)}}$ is a sum with an empty index set, and by convention it sums up to $0$.
Then, $\psi(1)=\frac{1}{2^{f(0)}}$.
Also $\psi(2)=\frac{1}{2^{f(0)}}+\frac{1}{2^{f(1)}}\ $, etc.

Clearly if $\beta<\gamma<\nu$ then $\psi(\beta)<\psi(\gamma)$. Indeed, $\psi(\beta)+\frac{1}{2^{f(\beta)}}\le\psi(\gamma)$.

Note also that if $A=\{\psi(\gamma):\gamma<\nu\}$, then $\inf(A)=\min(A)=0$ and $\sup(A)\le1$. We have $\sup(A)=\max(A)<1$ only when $\nu$ is a successor ordinal (assuming $\nu$ is countably infinite, to begin with).

An alternative definition would be $\varphi(\gamma):=\sum\limits_{\delta\le\gamma}\frac{1}{2^{f(\delta)}}$.
Then, $\varphi(0)=\frac{1}{2^{f(0)}}$. Also $\varphi(1)=\frac{1}{2^{f(0)}}+\frac{1}{2^{f(1)}}\ $, etc.
But, $\psi$ might be a better choice, since $\psi(\gamma)=\sup\limits_{\delta<\gamma}\psi(\delta)$ (in $[0,1]$) exactly when $\gamma$ is limit, i.e. $\gamma=\sup\limits_{\delta<\gamma}\delta$.

The above is not properly an answer to the original question, as the OP did not ask for a different approach, but only asked for a verification of the approach presented in the question. I put, nevertheless, this different approach here, for reference. It is slick (though not completely self-contained since it presumes background knowledge of sum of an infinite series), but it is also simple and, I would think, good-to-know.

The notation $\sum\limits_{\delta<\gamma}\frac{1}{2^{f(\delta)}}$ may need some extra explanation since one usually sees something like $\sum\limits_{n=1}^\infty$ rather than $\sum\limits_{\delta<\gamma}$, but the latter is ok too, since all terms are non-negative (so the order in which they appear won't matter) so $\sum\limits_{\delta<\gamma}\frac{1}{2^{f(\delta)}}$ could be defined as $\sup$ of all possible sums of the form $\frac{1}{2^{f(\delta_1)}}+\cdots+\frac{1}{2^{f(\delta_k)}}$ where $k\ge1$ and $0\le\delta_1<\dots<\delta_k<\gamma$. This $\sup$ cannot exceed $\sum\limits_{n=1}^\infty\frac{1}{2^n}=1$.

Yet another way to explain this, if $g=f^{-1}$ is the inverse bijection, $g:\Bbb N_+\to\{\gamma:\gamma<\nu\}$, then for each $\gamma<\nu$ and all $n\ge1$, one may define $a_{n,\gamma}= \begin{cases} \frac{1}{2^n}\ ,\ {\mathrm{ if }}\ g(n)<\gamma\\ 0\ ,\ {\mathrm{ if }}\ \gamma\le g(n)<\nu \end{cases}\ ,$ and then $\sum\limits_{\delta<\gamma}\frac{1}{2^{f(\delta)}}:=\sum\limits_{n=1}^\infty a_{n,\gamma}\ $.
Clearly $0\le\psi(\gamma)=\sum\limits_{n=1}^\infty a_{n,\gamma}< \sum\limits_{n=1}^\infty\frac{1}{2^n}=1$, for each $\gamma<\nu$. Also, if $\beta<\gamma<\nu$ then $0\le a_{n,\beta}\le a_{n,\gamma}$ for all $n$, and if $m=f(\beta)$ then $a_{m,\beta}=0<\frac{1}{2^m}=a_{m,\gamma}$ so $\sum\limits_{n=1}^\infty a_{n,\beta}<\frac{1}{2^m}+\sum\limits_{n=1}^\infty a_{n,\beta}\le\sum\limits_{n=1}^\infty a_{n,\gamma}\ .$