I am trying to understand the construction of $\mathbb{R}$ with slopes / quasi-isomorphism, as shown here
at some point, the following property is used :
$$\forall p \in \mathbb{Z},\forall q \in \mathbb{Z}\setminus\lbrace{0\rbrace},\exists ! r \in \mathbb{N} \text{ st. } 2p-|q|\leq2qr\leq2p+|q|$$
which is denoted by $$r=p:q$$
and the following property
$$|p/q-p:q|<\frac12$$
with $p/q$ denotes the euclidian division,
Can anyone help me proving these two results ?
Thanks a lot
T.D.
First we'll prove the existence of such $r$. We will then can prove uniqueness for this $r$
The Euclidean Algorithm in $\mathbb{Z}$ tells us that for every $p,q \in \mathbb{Z}$ with $q \neq 0$ there exists unique $k,r \in \mathbb{Z}$ such that $p =kq + r'$ with $0 \leq r' < q$.
Now suppose that $q>0$ (The case when $q<0$ is analogous), then the inequality in the definition becomes
$$2p-q \leq 2pr' < 2p +q$$
Taking $r = k$ or $r = k + 1$ you can see that they're satisfied.
Now note that either $0 \leq 2r' \leq q$ or $q < 2r'<2q$.
In the first case we have that \begin{align} 2p-q &= 2(qk +r') -q = 2qk + 2r' - q = q(2k-1) + 2r' \\ & \leq q(2k-1) + q = 2qk \leq 2qk + 2r' +q = 2p +q \end{align}
Now, for the second case \begin{align} 2p-q &= 2(qk +r') -q = 2qk + 2r' -q = q(2k -1) + 2r' \\ &< q(2k-1) + 2q = q(2k+1) < 2q(k+1) = 2qk + 2q \\ &< 2qk + 2r' + q = 2(qk +r') + q = 2p +q \end{align}
We have that \begin{align} |p/q - p:q|< \dfrac{1}{2} &\iff 2|p/q - p:q| < 1 \\ & \iff 2|q| |p/q - p:q| = 2|q(p:q)-p| < |q| \end{align} We know that if $x = qk + r'$ with $0 \leq r' < q$, then $r = p:q = k$ or $k+1$ (for positive $q$, in the negative case you have $k-1$ instead).
Suppose that $p:q = k$. Then $2r' \leq |q|$ and $$2|q(p:q) - p| = 2|qk -p| =2|qk - (qk + r)| = |2r'| \leq |q|$$
Suppose that $p:q = k +1$. Then $q <r' \leq 2q$ and $$2|q(p:q) - p| = 2|q(k+1) -p| =2|qk + q - p| = 2|q-r'| \leq |q|$$
Suppose that $p:q = k-1$. Then $-q < 2r' <-2q$. $$2|q(p:q) - p| = 2|q(k-1) -p| =2|qk - q - p| = 2|-q-r'| \leq |q|$$
Now for the uniqueness part :
Suppose that $r_0$ and $r_1$ satisfy this inequalities and that $r_0 \neq r_1$, then $|r_0 - r_1|\geq 1$, multiply both sides by $2q$ and note that this implies that $r_0$ and $r_1$ are at least $2q$ units apart but between $2p-q$ and $2p+q$ there are only $2q$ numbers, a contradiction.
Whence $|r_0-r_1<1\implies r_0=r_1$