So I was perusing wikipedia for some floor function facts for a problem I am working on and I saw this:
Let $x,y\in \mathbb{R}$ $$\lfloor x\rfloor +\lfloor y\rfloor \leq \lfloor x+y\rfloor \leq \lfloor x\rfloor +\lfloor y\rfloor +1$$
However when I adapted my problem to this
Let $n,m,k\in \mathbb{Z},k\neq0$ $$\lfloor \frac{n}{k}\rfloor +\lfloor \frac{m}{k}\rfloor \leq \lfloor \frac{n}{k}+\frac{m}{k}\rfloor \leq \lfloor \frac{n}{k}\rfloor +\lfloor \frac{m}{k}\rfloor +1$$
I really didn't want to work with the inequalities, so I devised an equality that encompasses the idea from above as
$$\lfloor\frac{n+m}{k}\rfloor=\lfloor\frac{n}{k}\rfloor+\lfloor\frac{m}{k}\rfloor+\lfloor\lbrace\frac{n}{k}\rbrace+\lbrace\frac{m}{k}\rbrace\rfloor$$
$\lfloor num \rfloor$ is the floor of num and $\lbrace num \rbrace$ is the fractional component of num
However, I don't know if it this is true. So help on a proof of the last equation would be much appreciated.
Bonus points if we can also figure out if the equality is true or not for $n,m,k\in \mathbb{R},k\neq0$
Thanks in advanced!
Edit: I wanted a go at the proof after seeing the answer too, so check below for the alternate proof
Let $x,y\in \mathbb{R}$ and let $n\in \mathbb{Z}$
We will use the fact that $x = \lfloor x \rfloor + \lbrace x \rbrace$ and $\lfloor x + n \rfloor = \lfloor x \rfloor + n$.
So $\lfloor x + y \rfloor = \lfloor \lfloor x \rfloor + \lbrace x \rbrace + \lfloor y \rfloor + \lbrace y \rbrace \rfloor$
then commute $\lfloor \lfloor x \rfloor + \lbrace x \rbrace + \lfloor y \rfloor + \lbrace y \rbrace \rfloor= \lfloor \lbrace x \rbrace + \lbrace y \rbrace+ \lfloor x \rfloor + \lfloor y \rfloor \rfloor$
and we know that $\lfloor x \rfloor,\lfloor y \rfloor \in \mathbb{Z}$
so by our second fact
$\lfloor \lbrace x \rbrace + \lbrace y \rbrace+ \lfloor x \rfloor + \lfloor y \rfloor \rfloor = \lfloor \lbrace x \rbrace + \lbrace y \rbrace+ \lfloor x \rfloor \rfloor + \lfloor y \rfloor$
$= \lfloor \lbrace x \rbrace + \lbrace y \rbrace \rfloor + \lfloor x \rfloor + \lfloor y \rfloor$
And rearrange to get
$\lfloor x + y \rfloor = \lfloor x \rfloor + \lfloor y \rfloor + \lfloor \lbrace x \rbrace + \lbrace y \rbrace \rfloor$