<s>[INST] Is this proof of $\left\lfloor \frac{n}{m} \right\rfloor = \left\lceil \frac{n-m+1}{m} \right\rceil$ correct? I've been practicing proving things about floor and ceiling functions, so I thought I'd try to prove this well-known identity:
$$\left\lfloor \frac{n}{m} \right\rfloor = \left\lceil \frac{n-m+1}{m} \right\rceil$$
for all $n,m \in \mathbb{Z}$, $m>0$.
This is what I came up with. Is my proof correct?
Proof:

[see edit below]
Case 1: $m=1$ $$\left\lfloor \frac{n}{1} \right\rfloor = \lfloor n \rfloor = n$$ $$\left\lceil \frac{n-1+1}{1} \right\rceil = \lceil n \rceil = n$$
Case 2: $m>1$

If $\frac{n}{m}$ is an integer, then
$$\left\lceil \frac{n-m+1}{m} \right\rceil = \left\lceil \frac{n}{m} -1 + \frac{1}{m}\right\rceil = \frac{n}{m} -1 + \left\lceil \frac{1}{m} \right\rceil = \frac{n}{m} -1 + 1 = \frac{n}{m} = \left\lfloor \frac{n}{m} \right\rfloor$$
If $\frac{n}{m}$ is NOT an integer, then
$$\left\lfloor \frac{n}{m} \right\rfloor = \left\lceil \frac{n}{m} \right\rceil - 1 = \left\lceil \frac{n}{m} + \frac{1}{m} \right\rceil - 1 = \left\lceil \frac{n}{m} + \frac{1}{m} -1 \right\rceil = \left\lceil \frac{n-m+1}{m} \right\rceil$$
$\blacksquare$
If it's correct but you know a simpler/better way to prove it, please include that in your answer. Thank you.

EDIT: As pointed out by user peterwhy, "Case 1: $m=1$" is simply a special case of "$\frac{n}{m}$ is an integer" and therefore is not needed; hence I have grayed it out, and we don't need to separate the $m=1$ and $m>1$ cases anymore.
 [/INST] Your proof looks okay (although the second equality in the $n/m$ not being integer might need some clarification). Notice that this identity can be proven essentially the same way as Prove that $\left\lceil \frac{n}{m} \right\rceil =\left \lfloor \frac{n+m-1}{m} \right\rfloor$ . Here is one variant.
By division with remainder, we can write $n=\lfloor \frac{n}{m} \rfloor m+(n \bmod m)$. Adding $-m+1$ to both sides and dividing by $m$ we get
$$
\frac{n-m+1}{m}=\Big\lfloor \frac{n}{m} \Big\rfloor +\frac{(n \bmod m)-m+1}{m}.\tag{*}
$$
Since $0 \leq n \bmod m \leq m-1$, we have $-m+1 \leq (n \bmod m)-m+1\leq 0$. So the rightmost fraction in $(*)$ (denote $x$) satisfies $-1<-1+\frac{1}{m}\leq x \leq 0$. Hence applying the ceiling function (and using that $\Big\lfloor \frac{n}{m} \Big\rfloor$ is an integer), we get
$$
\Big\lceil \frac{n-m+1}{m}\Big\rceil =\Big\lfloor \frac{n}{m} \Big\rfloor +\Big\lceil\frac{(n \bmod m)-m+1}{m}\Big\rceil=\Big\lfloor \frac{n}{m} \Big\rfloor.
$$
Note. Alternatively, if you already know the dual statement $\left\lceil \frac{n}{m} \right\rceil =\left \lfloor \frac{n+m-1}{m} \right\rfloor$, you can just use $\lfloor -x \rfloor=-\lceil x \rceil$ few times:
$$
\left\lfloor \frac{n}{m} \right\rfloor = -\Big\lceil \frac{-n}{m} \Big\rceil = - \left \lfloor \frac{-n+m-1}{m} \right\rfloor =-\Big(-\Big\lceil \frac{n-m+1}{m}\Big\rceil\Big)=\Big\lceil \frac{n-m+1}{m}\Big\rceil
$$
</s>