Show that for every real number x, there exists an integer n so that $\ \left|n\ -x\right|\ \le\ \frac{1}{2}$

276 Views Asked by At

I am very new to proofs and just wanted to make sure that mine isn't absolute nonsense. Here's the question and what I wrote:

Show that for every real number x, there exists an integer n so that $\ \left|n\ -x\right|\ \le\ \frac{1}{2}$

Both sides of the expression are positive, so we can square them without changing the inequality: $${\left|n\ -\ x\right|\ }^2\le\ \frac{1}{4}$$ We get a quadratic inequality in terms of n and solve for the n intercepts: $$4{(n\ -\ x)\ }^2\le\ 1$$ $$4{(n}^2-\ 2xn\ +\ x^2)\ -1\le\ 0$$ $$n^2-\ 2xn\ +\ x^2\ -\ \frac{1}{4}\ =\ 0$$ $$n=\frac{2x\pm\sqrt{{(-2x)}^2-4\left(x^2-\frac{1}{4}\right)\ }}{2}\ =\ \frac{2x\ \pm\ 1}{2}$$

Testing the value of the expression for n values between the two intercepts: $$n\in\left(-\infty,\ \frac{2x-1}{2}\right):\ \ \left(x-1\right)^2\ -\ 2x(x-1)\ +\ x^2\ -\frac{1}{4\ }\ =\ (2x^2\ +\ \frac{3}{4}\ )\ >\ 0\ \forall x\in\mathbb{R}\ \ $$ $$n\in\left(\ \frac{2x-1}{2},\ \frac{2x+1}{2}\right):\ \ {(x)}^2\ -\ 2x(x)\ +\ x^2\ -\frac{1}{4\ }\ =\ -\ \frac{1}{4}\ <\ 0\ \forall x\in\mathbb{R}\ \ $$ $$n\in\left(\ \frac{2x+1}{2},\ \infty\right):\ \ \left(x\ +1\right)^2\ -\ 2x(x+1)\ +\ x^2\ -\frac{1}{4\ }\ =\ \ \frac{3}{4}\ \ >\ 0\ \forall x\in\mathbb{R}$$

Therefore, $ \forall x\in\mathbb{R}, \left|n\ -\ x\right|\ \le\ \frac{\mathbf{1}}{\mathbf{2}} $ is true if $ n\in\left(\ \frac{\mathbf{2}x-\mathbf{1}}{\mathbf{2}},\ \frac{\mathbf{2}x+\mathbf{1}}{\mathbf{2}}\right): $$

$$\frac{2x-1}{2}\ \le\ n\ \le\ \frac{2x+1}{2}$$ $$x-\frac{1}{2}\ \le\ n\ \le\ x+\frac{1}{2}\ $$ $$-\frac{1}{2}\ \le\ n\ -x\ \le\ \frac{1}{2}\ $$ $$\ \left|n\ -x\right|\ \le\ \frac{1}{2}\ $$

Would that be a reasonable proof? Also, how would I show a similar thing for complex numbers:

$\ \mathbb{Z}[i]$ is a set of complex numbers z = a +bi with a,b $ > \in\mathbb{Z} $

We define $ N(z)\ =\ \left|z\right|^2\ =\ z\bar{z}$

Show that $\forall w\in\mathbb{C},\ \ \ \exists z\in\mathbb{Z}[i]$ so that $ N(z\ – w) ≤ \frac{1}{2}\ .$

Thank you in advance!