Videos
What does floor function do?
What is the floor function example?
How do you write a floor function?
I managed to find a list of properties of ceil and floor functions in this blog: https://janmr.com/blog/2009/09/useful-properties-of-the-floor-and-ceil-functions/ It contains various relations between these functions, their results and argument values. It also contain some references for further reading.
Please find below some of these properties for real numbers.
(In)equalities
$$ x - 1 < \lfloor x \rfloor \leq x \leq \lceil x \rceil < x + 1 $$ $$ \lfloor -x \rfloor = -\lceil x \rceil $$ $$ \lfloor x \rfloor + k = \lfloor x + k \rfloor $$ $$ \lceil x \rceil + k = \lceil x + k \rceil $$
$$ \Bigl\lfloor \frac{n}{m}\Bigr\rfloor = \Bigl\lceil \frac{n - m + 1}{m} \Bigr\rceil $$
$$ \Bigl\lceil \frac{n}{m}\Bigr\rceil = \Bigl\lfloor \frac{n + m - 1}{m} \Bigr\rfloor $$
Increasing functions
If a function $f: \mathbb{R} \rightarrow \mathbb{R} $ is continuous and monotonically increasing and for each integer $f(x)$ the value of $x$ is also an integer (e.g. $f(x) = \sqrt{x}$), we have:
$$ \lfloor f( \lfloor x \rfloor ) \rfloor = \lfloor f(x) \rfloor $$
$$ \lceil f( \lceil x \rceil ) \rceil = \lceil f(x) \rceil $$
Logarithms
For integer $k$ and all $b > 0$, $b \neq 1$:
$$ k =\lfloor \log_b{x} \rfloor \Leftrightarrow b^k \leq x < b^{k + 1} $$
$$ k = \lceil \log_b{x} \rceil \Leftrightarrow b^{k - 1} < x \leq b^k $$
References
The references are taken from the blog above:
- "Concrete Mathematics" by R. L. Graham, D. E. Knuth, and O. Patashnik
- "The Art of Computer Programming", Volume 1, by Donald E. Knuth.
Your statements are both false. Here are counter-examples:
For $x=y=.5$, $\lfloor x \rfloor +\lfloor y\rfloor=0$, but $\lfloor x+y \rfloor=1$.
For $x = .5$, $y=0$, we have $\lfloor x \rfloor =0$ but $\lceil y \rceil = 0 \neq .5$.
It is true that $\lfloor x +y \rfloor - 1 \leq \lfloor x \rfloor + \lfloor y \rfloor \leq \lfloor x+y \rfloor$, because, writing $x = \lfloor x \rfloor + \alpha$, $y = \lfloor y \rfloor + \beta$, we have $0 \leq \alpha,\beta < 1$, and $x + y = \lfloor x \rfloor + \lfloor y \rfloor + \alpha + \beta$. Then: $$ \lfloor x + y \rfloor = \lfloor x \rfloor + \lfloor y \rfloor + \lfloor \alpha + \beta \rfloor, $$ and $\lfloor \alpha+\beta \rfloor$ is either $0$ or $1$.
This is one of my favourite exercises, because of the following neat solution:
Fix $n$. Let
$$ f(x) := \sum\limits_{k=0}^{n-1} \Biggl[x + \frac{k}{n}\Biggr] - [nx] \,.$$
Then $f(x) =0 \forall x \in [0,\frac{1}{n})$ since all terms are zero, and it is easy to prove that $f(x+\frac{1}{n})=f(x)$.
It follows imediately that $f$ is identically 0.
Let $n=\lfloor x\rfloor$, and let $\alpha=x-n$; clearly either $0\le\alpha<\frac12$, or $\frac12\le\alpha<1$. Then
$$\lfloor 2x\rfloor=\lfloor 2n+2\alpha\rfloor=2n+\lfloor 2\alpha\rfloor=\begin{cases} 2n,&\text{if }0\le\alpha<\frac12\\ 2n+1,&\text{if }\frac12\le\alpha<1\;, \end{cases}$$
and
$$\left\lfloor x+\frac12\right\rfloor=\left\lfloor n+\alpha+\frac12\right\rfloor=n+\left\lfloor\alpha+\frac12\right\rfloor=\begin{cases} n,&\text{if }0\le\alpha<\frac12\\ n+1&\text{if }\frac12\le\alpha<1\;; \end{cases}$$
since $\lfloor x\rfloor=n$, the first result is immediate.
The general case is handled similarly, except that there are $n$ cases; for $k=0,\dots,n-1$, case $k$ is $$\frac kn\le\alpha<\frac{k+1}n\;.$$



