# Proving that $\lceil x-\lceil y \rceil \rceil =\lfloor \lceil x \rceil - y \rfloor$

Having trouble proving this equality for all real numbers. I understand that the left side simplifies to $\lceil x \rceil$ - $\lceil y \rceil$, however I cannot for the life of me get the right side simplified to equal the left side.

$\lceil x-\lceil y \rceil \rceil =\lfloor \lceil x \rceil - y \rfloor$

• Note that you can pull integers out of floors or ceilings, $\lfloor k + z\rfloor = k + \lfloor z\rfloor$ if $k\in \mathbb{Z}$. Commented Feb 15, 2016 at 20:40
• Take $x = \pi$ and $y = e$ to see what happens. Commented Feb 15, 2016 at 20:45
• @J.-E.Pin What happens? I get $\;1\;$ in both sides. Commented Feb 15, 2016 at 21:25

Building on Daniel Fischer's comment: \begin{align}\lfloor\lceil x\rceil-y\rfloor&=\lceil x\rceil+\lfloor-y\rfloor\\ &=\lceil x\rceil-\lceil y\rceil\end{align}

• Can't be simpler.
– user65203
Commented Feb 16, 2016 at 9:26

For any real numbers, $x, y$ there are integers $n_x$ and $n_y$ such that

$n_x \le x < n_x + 1$ and $n_y \le y < n_y + 1$.

Case 1: Neither $x$ nor $y$ are integers.

$\lceil x-\lceil y \rceil \rceil = \lceil x-(n_y + 1) \rceil= \lceil x\rceil-(n_y + 1)= n_x + 1 - n_y - 1 = n_x - n_y$

While $\lfloor \lceil x \rceil - y \rfloor = \lfloor n_x + 1 - n_y - (y - n_y) \rfloor = n_x - n_y + \lfloor 1 - (y - n_y) \rfloor = n_x - n_y + 0 = n_x - n_y$

Case 2: $x = n_x$ is an integer. $y$ is not.

$\lceil x-\lceil y \rceil \rceil = x-(n_y + 1)= n_x - n_y - 1$

While $\lfloor \lceil x \rceil - y \rfloor = \lfloor n_x - n_y - (y - n_y) \rfloor = n_x - n_y + \lfloor - (y - n_y) \rfloor = n_x - n_y -1$

Case 3: $x$ is not and integer. $y = n_y$ is.

$\lceil x-\lceil y \rceil \rceil = \lceil x-n_y \rceil= \lceil x\rceil-n_y= n_x + 1 - n_y$

While $\lfloor \lceil x \rceil - y \rfloor = \lfloor n_x + 1 - n_y \rfloor = n_x +1 - n_y$

Case 4: $x = n_x$ and $y = n_y$ are both integers.

$\lceil x-\lceil y \rceil \rceil =\lceil x_n-y_n \rceil = x_n - y_n= \lfloor x_n - y_n \rfloor = \lfloor \lceil x \rceil - y \rfloor$

$$\lceil x-\lceil y \rceil \rceil \overset{?}=\lfloor \lceil x \rceil - y \rfloor$$

Note that I used @Daniel Fischer's comment

$$\boxed{\color{red}{\lceil x - \lceil y \rceil \rceil}= \lceil x \rceil -\lceil y \rceil = \lceil x \rceil+\lfloor - y \rfloor = \color{red}{\lfloor \lceil x \rceil -y \rfloor}}$$