In Descriptive Set Theory we often see the notion of encoding a real as a sequence of integers or natural numbers -- i.e. there obviously is a bijection according to ZF axioms. But how does it look like concretely? Anybody has seen a simple construction?


My own approach is by chain-fractions:


Let $q\in\mathbb{R}$ be the given real and now define the sequence $(z\_i,q\_i)$ by $$z\_{i+1}=\begin{cases}[q\_i]&\text{if } \{q\_i\}\leq\frac{1}{2}\\
[q\_{i}]+1&\text{else}
\end{cases}$$
$$q\_{i+1}=(q\_i-z\_{i+1})^{-1}$$
where $[q]$ is the next lower integer and $\{q\}=q-[q]$. (Hence $(q\_i-z\_{i+1})\in(-\frac12,\frac12]$ thereby absolute value of $q\_{i+1}$, its reciprocal, is bigger than 2.) Now my bijection is mapping $q$ to the sequence:
$$m\_i=\begin{cases}z\_i-2&z\_i>0, i>1\\
z\_i&i=1\\
z\_i+2&z\_i<0, i>1\end{cases}$$ with $i$ starting at 1 and above $q\_0$ becomes the initial $q$. And the inverse of my bijection just calculates the chain-fraction:$q\_{i-1}\in(z\_i-\frac12,z\_i+\frac12]$ with $q\_{i-1}=z\_i+q\_i^{-1}$ step-wise narrowing down the real by a sequence of intervals each containing the next.


is there a paper or book covering my example? any other simple constructions?



What's the bijection between reals and infinite sequences of integers?
[**Note:** this answer uses the convention where $\mathbb{N} := \{ 0, 1, 2, \dots \}$ contains zero.]


There's an elegant explicit order-preserving bijection between the [Baire space](https://en.wikipedia.org/wiki/Baire_space_(set_theory)) $\mathbb{N}^{\mathbb{N}}$ (under lexicographical order) and $\mathbb{R}\_{\geq 0}$ (under the usual order) described [here](https://oscarcunningham.com/494/a-better-representation-for-real-numbers/).


In particular, we define the image of:


$$ (a\_0, a\_1, a\_2, a\_3, \dots) $$


to be the generalised continued fraction:


$$ a\_0 + \cfrac{1}{1 + \cfrac{1}{a\_1 + \cfrac{1}{1 + \cfrac{1}{a\_2 + \ddots}}}} $$


This order-preserving bijection shows that $\mathbb{R}\_{\geq 0}$ and $\mathbb{N}^{\mathbb{N}}$ are not only isomorphic as sets (i.e. equinumerous), but also isomorphic as totally-ordered sets.


Topologically, this bijection from $\mathbb{N}^{\mathbb{N}}$ to $\mathbb{R}\_{\geq 0}$ is continuous, meaning that every open subset of the nonnegative reals corresponds to an open subset of Baire space. The converse is not quite true (if it were, the two spaces would be homeomorphic, which they're not); continuity of the inverse map fails exactly at the positive rationals.


