# How to prove this apparent identity?

While solving the problem in my other question, I've come across an identity, which I've empirically found to be true, but can't seem to prove.

Here I've simplified the problem a bit, so that the formulas don't look too bulky. So, define a function:

$$f(n)=\begin{cases} \left\lceil\frac n{1+\alpha}\right\rceil+\left\lfloor\alpha\left\lceil\frac n{1+\alpha}\right\rceil\right\rfloor & \mathrm{if}\;\; \left\lceil\frac n{1+\alpha}\right\rceil<\frac1\alpha\left\lceil\frac{\alpha n}{1+\alpha}\right\rceil,\\ \left\lceil\frac{\alpha n}{1+\alpha}\right\rceil+\left\lfloor\frac1\alpha\left\lceil\frac{\alpha n}{1+\alpha}\right\rceil\right\rfloor& \mathrm{otherwise.} \end{cases}$$

The statement to prove is: if $\alpha\in\mathbb R \setminus \mathbb Q$ and $n\in\mathbb N$, then $$f(n)=n.$$

How can I prove this?

Consider the first case:

$$\left\lceil\frac n{1+\alpha}\right\rceil<\frac1\alpha\left\lceil\frac{\alpha n}{1+\alpha}\right\rceil.$$

From this we can say

$$\left\lceil\frac n{1+\alpha}\right\rceil+\left\lfloor\alpha\left\lceil\frac n{1+\alpha}\right\rceil\right\rfloor<\left\lceil\frac n{1+\alpha}\right\rceil+\left\lceil\frac {\alpha n}{1+\alpha}\right\rceil.$$

In the second case with

$$\left\lceil\frac n{1+\alpha}\right\rceil>\frac1\alpha\left\lceil\frac{\alpha n}{1+\alpha}\right\rceil$$

we'll have

$$\left\lceil\frac{\alpha n}{1+\alpha}\right\rceil+\left\lfloor\frac1\alpha\left\lceil\frac{\alpha n}{1+\alpha}\right\rceil\right\rfloor<\left\lceil\frac {\alpha n}{1+\alpha}\right\rceil+\left\lceil\frac n{1+\alpha}\right\rceil.$$

Thus, for $\left\lceil\frac n{1+\alpha}\right\rceil\alpha\ne\left\lceil\frac{\alpha n}{1+\alpha}\right\rceil$ (which is always the case for irrational $\alpha$) we have that

$$f(n)<\left\lceil\frac {\alpha n}{1+\alpha}\right\rceil+\left\lceil\frac n{1+\alpha}\right\rceil\le\left\lceil\frac {\alpha n}{1+\alpha}+\frac n{1+\alpha}\right\rceil+1=n+1,$$

i.e. we have an upper bound on $f$: $$f(n)<n+1.\tag1$$

On the other hand, in any case we can say for the upper expression in definition of $f$, just using the relations between floor and ceiling functions:

$$\left\lceil\frac{n}{1+\alpha}\right\rceil+\left\lfloor\alpha\left\lceil\frac{n}{1+\alpha}\right\rceil\right\rfloor \ge \left\lceil\frac{n}{1+\alpha}\right\rceil+\left\lceil\alpha\left\lceil\frac{n}{1+\alpha}\right\rceil\right\rceil-1\ge\\ \ge \left\lceil\frac{n}{1+\alpha}+\alpha\left\lceil\frac{n}{1+\alpha}\right\rceil\right\rceil-1 > \left\lceil\frac{n}{1+\alpha}+\alpha\frac{n}{1+\alpha}\right\rceil-1=n-1,$$

where we get strict inequality from the fact of irrationality of $\frac n{1+\alpha}$.

Similarly for lower expression we have

$$\left\lceil\frac{\alpha n}{1+\alpha}\right\rceil+\left\lfloor\frac1\alpha\left\lceil\frac{\alpha n}{1+\alpha}\right\rceil\right\rfloor \ge \left\lceil\frac{\alpha n}{1+\alpha}\right\rceil+\left\lceil\frac1\alpha\left\lceil\frac{\alpha n}{1+\alpha}\right\rceil\right\rceil-1 \ge \left\lceil\frac{\alpha n}{1+\alpha}+\frac1\alpha\left\lceil\frac{\alpha n}{1+\alpha}\right\rceil\right\rceil-1 > \left\lceil\frac{\alpha n}{1+\alpha}+\frac1\alpha\frac{\alpha n}{1+\alpha}\right\rceil-1=n-1.$$

Thus, we now also have a lower bound on $f$:

$$f(n)>n-1.\tag2$$

Combining $(1)$ and $(2)$, we have

$$n-1<f(n)<n+1$$

Since $f(n)$ and $n$ are integral, we can rewrite this as

$$n\le f(n)\le n,$$

which implies

$$f(n)=n,$$

Q.E.D..