Edited: The RHS should be $i-2+k$, not $i-2-k$, I made a typo. Probably needed more sleep.
While reading some paper about sorting algorithms, I ran through this: $$\displaystyle\sum_{r=1}^k\ \Big\lceil\frac{i-1}{2^r}\Big\rceil \leq i-2+k$$
Under the circumstances that $i=n-2^k-1$, while $2^{k}\lt n\leq 2^{k+1}-1, k\in\mathbb{N}$.
Now, I understand how geometric series are calculated, but adding the ceiling function here is totally over my capacity. By simply calculating by hand from $i=1$ and upward, I was able to get that for $i\geq2$, the result of the LHS being $\Big\lfloor\frac{i-2}{2}+k\Big\rfloor$, looking alike but not the one provided. It seems like was using the properties of ceiling functions but nothing useful comes to my mind.
It really would help if some instructions are given in the right direction or a very simple step-by-step explanation.
Thanks in advance.
Thanks to the comments, after a few days of struggling I finally was able to find the way to get the upper bound. To calculate the following formula, $$\displaystyle\sum_{r=1}^k\ \Big\lceil\frac{i-1}{2^r}\Big\rceil$$
What we do first is to separate it into 2 parts, the integer part and the fractal part (which would be affected by the ceiling function), getting: $$\displaystyle\sum_{r=1}^k\frac{i-1}{2^r}+\displaystyle\sum_{r=1}^k\Big(\Big\lceil\frac{i-1}{2^r}\Big\rceil-\frac{i-1}{2^r}\Big)$$
The first term is easy to deal with. Eliminating the constant term, we get: $$(i-1)\displaystyle\sum_{r=1}^k\frac{1}{2^r}$$ which can be easily evaulated into $$(i-1)\cdot\Big(1-\frac{1}{2^k}\Big)$$
As for the second term, we use the property that $$\begin{align} \\ \displaystyle\sum_{r=1}^k\Big(\Big\lceil\frac{i-1}{2^r}\Big\rceil-\frac{i-1}{2^r}\Big) &\leq \overbrace{\Big[\Big(1-\frac{1}{2}\Big)+\Big(1-\frac{1}{2^2}\Big)+\dots+\Big(1-\frac{1}{2^k}\Big)\Big]}^{\text{k terms}} \\ &= k-\Big[\frac{1}{2}+\frac{1}{2^2}+\dots+\frac{1}{2^k}\Big] \\ &=k-\Big[1-\frac{1}{2^k}\Big]\end{align}$$
Adding the two terms up results in $$\begin{align} \displaystyle\sum_{r=1}^k\frac{i-1}{2^r}+\displaystyle\sum_{r=1}^k\Big(\Big\lceil\frac{i-1}{2^r}\Big\rceil-\frac{i-1}{2^r}\Big)&\leq (i-1)\cdot\Big(1-\frac{1}{2^k}\Big)+k-\Big[1-\frac{1}{2^k}\Big] \\ &= i-1-\frac{i-1}{2^k}+k-1+\frac{1}{2^k} \\ &= i+k-2+\frac{2-i}{2^k} \\ \end{align}$$
Since $i\geq 2$, we are able to elimate the last term, thus obtaining the inequality stated in the question: $$\Big\lceil\frac{i-1}{2^r}\Big\rceil \leq i-2+k$$