<s>[INST] Prove $\lceil z \rceil=z+\frac12-\frac{\tan^{-1}(\tan(\pi(z+0.5)))}{\pi}$ when $z$ is not an integer How can I prove that $\lceil z \rceil=z+\dfrac12-\dfrac{\tan^{-1}(\tan(\pi(z+0.5)))}{\pi}$  for all non-integer real numbers $z$?
Z cannot be an integer because then tan(pi*z + pi/2) would be undefined. I got this equation by messing around with arcsin(sin(x)), arccos(cos(x)), and arctan(tan(x)) and noticed that arctan(tan(x))-x looked liked a weird negative ceiling function, so I made it x-arctan(tan(x)), and saw a disproportional ceiling function: 
Then I changed the equation so that it was the arctan(tan(x)) became $\dfrac{\tan^{-1}(\tan(\pi(z+0.5)))}{\pi}$ and I added 0.5 to make it the ceiling function. I am looking for a mathematical proof that is relatively simple and only uses trig, low level calc, and algebra.
 [/INST] $\tan (x)$ has a period of $\pi$, so $\tan x = \tan (\pi(\frac{x}{\pi}-\lceil \frac{x}{\pi} \rceil + \epsilon))$, where $\epsilon \in \mathbb{Z}$. Consider $x = \pi(z+\frac{1}{2})$, then 
$$z + \frac{1}{2} - \frac{\tan^{-1} \tan (\pi(z+\frac{1}{2}))}{\pi} = z + \frac{1}{2} - \frac{\tan^{-1} \tan (\pi(z+\frac{1}{2} - \lceil z+\frac{1}{2}\rceil+\epsilon)))}{\pi}$$
Because we want to invert the tangent/arctangent with its principal value , we want $z+\frac{1}{2}-\lceil z+\frac{1}{2} \rceil + \epsilon \in (-\frac{1}{2},\frac{1}{2})$. This fixes $\epsilon$. So:
$$z + \frac{1}{2} - \frac{\tan^{-1} \tan (\pi(z+\frac{1}{2} - \lceil z+\frac{1}{2}\rceil+\epsilon)))}{\pi} = z + \frac{1}{2} - \frac{\pi(z+\frac{1}{2} - \lceil z+\frac{1}{2}\rceil+\epsilon))}{\pi} = \\ = \lceil z+\frac{1}{2}\rceil-\epsilon$$
Remember when I said "this fixes $\epsilon$"? This trick is such that $$\lceil z+\frac{1}{2}\rceil-\epsilon = \lceil z \rceil$$
Indeed, if $\lceil z+\frac{1}{2}\rceil = \lceil z \rceil +1$, then $\epsilon = 1$: $$z+\frac{1}{2}-\lceil z+\frac{1}{2} \rceil + \epsilon  = z - \lceil z \rceil - \frac{1}{2} + \epsilon\in (-\frac{1}{2},\frac{1}{2}) \Rightarrow \epsilon = 1$$ 
In the same way, if $\lceil z+\frac{1}{2}\rceil = \lceil z \rceil$, then $\epsilon = 0$.
</s>