I'm looking for a function that defines $\lceil x \rceil$ and I found the following:
$$\lceil x \rceil=\frac{1}{2}(1+ \sum_{n=-\infty}^{+\infty}(\operatorname{sgn}(x-n)-|\operatorname{sgn}(x-n)|+1+\operatorname{sgn}(n)))$$
Explanation: first I noticed that plotting $\lceil x \rceil$ yields a graph that looks like a staircase, so I started combining "steps" and offsetting them by $n$ ($a$ and $b$ are the upper and lower bounds of the stairs; $a\le 0$)
$$\frac{1}{2}\sum_{n=a}^{b}(\operatorname{sgn}(x-n)+1)$$
but because of the $\operatorname{sgn}$ function, all integers are lowered by $0.5$. So I adjust it with $-\left|\operatorname{sgn}\left(x-n\right)\right|$
$$\frac{1}{2}\sum_{n=a}^{b}\left(\operatorname{sgn}\left(x-n\right)-\left|\operatorname{sgn}\left(x-n\right)\right|\right)$$
and finally, I make both functions coincide:
$$\lceil x \rceil=\frac{1}{2}(1+ \sum_{n=-\infty}^{+\infty}(\operatorname{sgn}(x-n)-|\operatorname{sgn}(x-n)|+1+\operatorname{sgn}(n)))$$
Unfortunately Wolfram Alpha doesn't seem to like this function; I would greatly appreciate it if you could prove this/simplify it or find a way to rewrite it without the sum
We can do it in cases:
1a) $x < 0; x\not \in \mathbb Z$.
Then
$\frac{1}{2}(1+ \sum_{n=-\infty}^{+\infty}(\operatorname{sgn}(x-n)-|\operatorname{sgn}(x-n)|+1+\operatorname{sgn}(n)))=$
$\frac 12(1 + \sum_{n< x< 0}(\operatorname{sgn}(x-n)-|\operatorname{sgn}(x-n)|+1+\operatorname{sgn}(n)) + \sum_{x< n< 0}(\operatorname{sgn}(x-n)-|\operatorname{sgn}(x-n)|+1+\operatorname{sgn}(n)) + (\operatorname{sgn}(x-n)-|\operatorname{sgn}(x-n)|+1+\operatorname{sgn}(n))_{n=0} + \sum_{n=1}^{\infty}(\operatorname{sgn}(x-n)-|\operatorname{sgn}(x-n)|+1+\operatorname{sgn}(n))=$
$\frac 12(1 + \sum_{n< x< 0}(1-1+1+-1) + \sum_{x< n< 0}(-1-1+1+-1) + (-1-1+1+0)_{n=0} + \sum_{n=1}^{\infty}(-1-1+1+1)=$
$\frac 12(1 + \sum_{n< x< 0}0 + \sum_{x< n< 0}(-2) + (-1) + \sum_{n=1}^{\infty}(0)=$
$\sum_{x<n<0} (-1)=\sum_{n=-1;n--}^{\lceil x\rceil}(-1)=-\sum_{n=1}^{|\lceil x\rceil|}1= -|\lceil x\rceil|$ and as $\lceil x\rceil \le 0$ this is equal to $\lceil x\rceil$ (maybe I should note that if $-1 < x < 0$ then $\sum_{n=-1;n--}^{\lceil x\rceil}(-1)$ is $0$ as the condition for the summand is never met so this is a sum with zero terms.)
1b) $x < 0; x\in \mathbb Z$.
This is much as above but we have an addition term $(sgn(x-n)-|sgn(x-n)| +1 sgn(n))_{n=x}= 0-0+1-1= 0$.
Hmmm this doesn't seem to work as in this case: $\sum_{x<n<0} (-1)=\sum_{n=-1;n--}^{x+1}(-1)=x+1\ne \lceil x\rceil$
Case 2: $x=0$ then
$\frac{1}{2}(1+ \sum_{n=-\infty}^{+\infty}(\operatorname{sgn}(x-n)-|\operatorname{sgn}(x-n)|+1+\operatorname{sgn}(n)))=$
$\frac{1}{2}(1+ \sum_{n=-\infty}^{1}(\operatorname{sgn}(x-n)-|\operatorname{sgn}(x-n)|+1+\operatorname{sgn}(n))+(\operatorname{sgn}(x-n)-|\operatorname{sgn}(x-n)|+1+\operatorname{sgn}(n))_{n=0=x} + \sum_{n=1}^{\infty}(\operatorname{sgn}(x-n)-|\operatorname{sgn}(x-n)|+1+\operatorname{sgn}(n)))=$
$\frac{1}{2}(1+ \sum_{n=-\infty}^{1}(1-1+1+1)+(0-0+1+0) + \sum_{n=1}^{\infty}(-1-1+1+1)=\frac 12$
Hmm, doesn't seem to work. If $sgn(0) =1$ (it might, I never know what the conventions is) we still get the error that this is equal to $ 1$.
Case 3: $x > 0; x\not \in \mathbb Z$.
This is similar to the above. For $n> x$ we have $(\operatorname{sgn}(x-n)-|\operatorname{sgn}(x-n)|+1+\operatorname{sgn}(n))= -1-1 + 1 +1 =0$ and for $n<0$ we have $(\operatorname{sgn}(x-n)-|\operatorname{sgn}(x-n)|+1+\operatorname{sgn}(n))=1-1+1-1=0$ so
$\frac{1}{2}(1+ \sum_{n=-\infty}^{+\infty}(\operatorname{sgn}(x-n)-|\operatorname{sgn}(x-n)|+1+\operatorname{sgn}(n)))=$
$\frac{1}{2}(1+(\operatorname{sgn}(x-n)-|\operatorname{sgn}(x-n)|+1+\operatorname{sgn}(n))_{n=0}+ \sum_{n=1}^{\lfloor x \rfloor}(\operatorname{sgn}(x-n)-|\operatorname{sgn}(x-n)|+1+\operatorname{sgn}(n)))=$
$\frac{1}{2}(1+(1-1+1+0)+ \sum_{n=1}^{\lfloor x \rfloor}(1-1+1+1)=$
$1 + \sum_{n=1}^{\lfloor x \rfloor}1 = 1 +\lfloor x \rfloor= \lceil x \rceil$.
And finally.
2b. $x > 0; x\in \mathbb Z$.
This gives us
$\frac{1}{2}(1+(\operatorname{sgn}(x-n)-|\operatorname{sgn}(x-n)|+1+\operatorname{sgn}(n))_{n=0}+ \sum_{n=1}^{x-1}(\operatorname{sgn}(x-n)-|\operatorname{sgn}(x-n)|+1+\operatorname{sgn}(n)))+ (\operatorname{sgn}(x-n)-|\operatorname{sgn}(x-n)|+1+\operatorname{sgn}(n))_{x=0}=$
$\frac 12(1 + 1 + 2(x-1) + (0-0+1+1)= x + \frac 12$.
So
You're formula does work if $x$ is not an integer.