# Proof of floor and ceiling functions

By definition:

$\lfloor {x}\rfloor = i \Rightarrow i \le x \lt i + 1$ (floor function)

and

$\lceil {x} \rceil = j \Rightarrow j - 1 \lt x \le j$ (ceiling function)

So, how is the proof that these properties are true for all integers?

$(n−1)/2 ≤ ⌊n/2⌋ ≤ n/2$

$n/2 ≤ ⌈n/2⌉ ≤ (n+1)/2$

• Write $n=2k$ or $n=2k+1$ for an integer $k$ and consider the two cases separately? – Harald Hanche-Olsen Oct 31 '13 at 6:08
• When $n = 2k$ on first: $(2k -1)/2 ≤ ⌊k⌋ ≤ k$ and with n = 2k + 1: $k ≤ ⌊2k+ 1⌋ ≤ 2k+ 1$ Right? How consider all cases now? – Aleff Oct 31 '13 at 6:23
• The floor function on an integer is the integer itself. So the two equations you wrote up (which you need to prove) become $(2k -1)/2 ≤ k ≤ k$ and $k ≤ 2k+ 1 ≤ 2k+ 1$. – Harald Hanche-Olsen Oct 31 '13 at 7:17
• Your ceiling definition should be $j-1<x\le j$. To check, note ceiling of an integer should be itself. – coffeemath Oct 31 '13 at 10:05
• @coffeemath Sure... Edited =) – Aleff Oct 31 '13 at 15:44