# The floor and ceiling functions are equal for integer numbers

The exercise

Proof the following directly: Let $x \in \mathbb{R}$. If $x \in \mathbb{Z}$, then $\lfloor x \rfloor = \lceil x \rceil$.

My problem

I mostly fail completely on the formal part of any kind of proof (here a direct proof). This means I've mostly the right idea but I'm also mostly not able to bring it to paper in the right form.

What I know currently

The direct proof for a implication like $p \implies q$ could be $p \implies s_1, s_1 \implies s_2, s_2 \implies q$. So you typically start with the (rearranged) hypothesis $q$ assuming it's true and repeatedly apply the modus ponsens on your established implications until you reach $q$.

What I've done

When I take a look at the definition of $\lfloor x \rfloor = \max\{k \in \mathbb{Z}|k\leq x\}$ and $\lceil x \rceil = \min\{k \in \mathbb{Z}|k\geq x\}$ it seems to be "pretty clear". Since $x,k \in \mathbb{Z}$ is $x \in \{k \leq x\}$ and $x = \max\{k \leq x\}$ which in turn implies $\lfloor x \rfloor = x$. The same is true for $\lceil x \rceil$, which means that $x \in \{k \geq x\}$ and $x = \min\{k \geq x\}$ which in turn implies $\lfloor x \rfloor = x$. And since $\lfloor x \rfloor = x$ and $\lfloor x \rfloor = x$ is $\lfloor x \rfloor = \lceil x \rceil$.

My question(s)

How can I get this in a formally correct form? And how can I proof that $x \in \{k \leq x\}$, $x = \max\{k \leq x\}$, $x \in \{k \geq x\}$ and $x = \min\{k \geq x\}$ is true?

With $A=\{k:k\in\mathbb{Z},k\leq x\}$, then $x\in A$ because $x\in\mathbb{Z}$ and $x\leq x$. Moreover $x=\max A$ because (i) $x\in A$, (ii) if $k\in A$, then $k\leq x$. You can do the same for $B=\{k:k\in\mathbb{Z}, k\geq x\}$.

• Thanks! The second part ($x = \max A$) seems to be too easy. Should this be enough? Beside that have you any hints about my first question (how to get the formally correct form or how to improve it)? Sep 14 '14 at 17:08
• Your approach is fine. As for $x=\max A$, what I wrote should be enough. Sep 14 '14 at 17:13

That $x \in \{ k \leq x\}$ follows since $x \leq x$. Similarly for $x \in \{ k \geq x\}$. To show that $x = max\{ k \leq x\}$, suppose not. Then there is some $y \in \{ k \leq x\}$ such that $y > x$. But this is impossible, by the definition of the set $\{ k \leq x\}$. So $x$ must be the supremum. But $x$ is also in the set, so it's the maximum. You should be able to do the minimum case now.

I guess at the beginning, the more (without exaggerating!) details you put the better. For example, your proof is fine, but I'd put sentences of the form "x = max{...} since x is the supremum and it's in the set...", just to show that you understand why what you claim is true.

• Thanks! It looks like you're using a proof by contradiction for $x = \max\{k \leq x\}$. Is this okay as a part of a direct proof? Beside that have you any hints about my first question (how to get the formally correct form or how to improve it)? Sep 14 '14 at 17:11
• The proof by contradiction is a bit of an over-kill to be honest, but it's an alternative to the direct proof. Concerning your first question, what level of details are looking for? Sep 14 '14 at 17:19
• Is it enough what I wrote, or should I bring your parts into it? Is there a more cleaner way to write all that stuff down; less words more math (like in "What I know currently")? ;) Sep 14 '14 at 17:23
• I guess at the beginning, the more (without exaggerating!) details you put the better. For example, your proof is fine, but I'd put sentences of the form "x = max{...} since x is the supremum and it's in the set...", just to show that you understand why what you claim is true. Sep 14 '14 at 17:25
• Put your last comment into the answer and you get your check! Also because you were the one with the first answer (13 seconds faster). Sep 14 '14 at 17:29