While reading a book on algorithms I came across the equality:
$ \lceil \lceil x/a \rceil / b \rceil = \lceil x/(ab) \rceil \ \forall \text{ real }\ x \geq 0\ \text{ and }\ \forall \text{ integer }\ a,b > 0 $.
I tried to prove it out of curiosity with no success. Can someone write down and explain the proof?
Appendix: outline of my attempts
Both $ \lceil \lceil x/a \rceil / b \rceil $ and $ \lceil x/(ab) \rceil $ are integers. And I know that the following equality (E1) holds true: $$ x \leq \lceil x \rceil < x + 1 \quad \forall \ \text{ real }\ x $$
My idea was to separately substitute $ \lceil \lceil x/a \rceil / b \rceil $ and $ \lceil x/(ab) \rceil $ in E1 and show that they are both contained in the same interval and that such interval contains exactly one integer. But I only managed to prove that they are both contained in one interval that contains two integers.
By substituting $ \lceil \lceil x/a \rceil / b \rceil $ into E1 (and developing some terms):
$$ x/(ab) \leq \lceil \lceil x/a \rceil / b \rceil < \lceil x/a \rceil / b + 1 $$ and as a result $$ x/(ab) \leq \lceil \lceil x/a \rceil / b \rceil < x/(ab) + 1 + 1/b $$
By substituting $ \lceil x/(ab) \rceil $ into E1 (and developing some terms):
$$ x/(ab) \leq \lceil x/(ab) \rceil < x/(ab) + 1 $$ and as a result $$ x/(ab) \leq \lceil x/(ab) \rceil < x/(ab) + 1 + 1/b $$
So both $ \lceil \lceil x/a \rceil / b \rceil $ and $ \lceil x/(ab) \rceil $ are contained in the interval $ [ \ x/(ab), \ x/(ab) + 1 + 1/b \ ) $. If such interval contained only one integer the proof would be completed, but such interval could contain two integers and so I am stuck.
Let $x = k(ab) +r$ with $r \in (0,ab]$
Then $\lceil x / a \rceil = \lceil kb + r/a \rceil= kb+r_1$, where $r_1 = \lceil r/a \rceil $.
Since $r/a \in (0,b]$ we have $r_1 \in (0,b]$
It follows $\lceil \lceil x/a \rceil / b \rceil = \lceil (kb+ r_1)/b \rceil = \lceil k + r1/b \rceil = k+1$