I want to prove that the following identity is true for any positive integers $x,y,z$:
$$\Big\lfloor{x}/({y}\cdot{z})\Big\rfloor=\Big\lfloor{\lfloor{x}/{y}\rfloor}/{z}\Big\rfloor$$
Here is a script that I wrote in Python 3 to test it:
for x in range(1,100):
for y in range(1,100):
for z in range(1,100):
print(x, y, z)
assert x // (y * z) == x // y // z
So empirically it seems to hold, but I'm finding it hard to establish a formal proof.
Any idea?
$$\begin{array}{rc} & \left\lfloor \dfrac {\lfloor x/y \rfloor} z \right\rfloor = u \\ \iff& uz \le \lfloor x/y \rfloor < (u+1)z \\ \iff& uz \le \lfloor x/y \rfloor \le (u+1)z-1 \\ \iff& uyz \le x < ((u+1)z-1+1)y \\ \iff& uyz \le x < (u+1)yz \\ \iff& \left\lfloor \dfrac x {yz} \right\rfloor = u \\ \end{array}$$