<s>[INST] Proving basic floor function inequality: $-1 \lt \lfloor 2x \rfloor - 2 \lfloor x \rfloor \lt 2$ As a direct consequence of the definition of  $\lfloor x \rfloor $ I know that $$2x-1 \lt \lfloor 2x \rfloor \le 2x$$ and $$2x-2 \lt 2\lfloor x\rfloor \le 2x$$
How can I use these to show that $-1 \lt \lfloor 2x  \rfloor - 2 \lfloor x \rfloor \lt 2$? I'm a bit rusty with inequalities.
Any help is appreciated.
 [/INST] Let $n = \lfloor x\rfloor$ and $f=x-n = x-\lfloor x\rfloor$, i.e. $x=n+f$. Then
$$\begin{align*}
\lfloor 2x\rfloor-2\lfloor x\rfloor&= \lfloor 2n+2f\rfloor - 2\lfloor n+f\rfloor\\
&=2n+\lfloor 2f\rfloor - 2n\\
&= \lfloor 2f\rfloor
\end{align*}$$
Since $0\le f<1$, $0\le 2f<2$ and then $\lfloor 2f\rfloor$ can only be $0$ or $1$.
Hence we have a stronger result:
$$0\le\lfloor 2x\rfloor-2\lfloor x\rfloor\le1$$
</s>