# Apostol's Calulus: Prove that $[x+y] = [x]+[y]$ or $[x]+[y]+1$, where $[·]$ is the floor function.

Prove that $$[x+y] = [x]+[y]$$ or $$[x]+[y]+1$$, where $$[·]$$ is the floor function

I'm Having a little bit of trouble with the last part of this proof.

First, I will use the definition of floor function:

$$[x] = m ≡ m ≤ x < m+1$$

and

$$[y] = n ≡ n ≤ y < n+1$$

so, $$[x]+[y] = m+n ≡ m+n ≤ x+y < m+n+2$$

This is where I get stuck; I have that $$[x+y] = t ≡ t ≤ x < t+1$$, so putting $$m+n ≤ x+y < m+n+2$$ in that form, seems impossible, let alone the one that corresponds to $$[x]+[y]+1$$.

Could you help me with this last part?

• Your inequalities should be less than signs on the right everywhere.That should improve things. – jgon Dec 19 '18 at 22:20
• Corrected; however, it was typo when passing notes from my notebook, I used the correct definition in my notebook, and still don't realize how to follow up. – Daniel Bonilla Jaramillo Dec 19 '18 at 22:23
• Why do you write: "$[x+y] = t ≡ t ≤ x < t+1$" Shouldn't that be "$[x+y] = t \equiv t \le x + y \le t + 1$"? – fleablood Dec 19 '18 at 22:44

$$m+n\le x+y or $$m+n+1$$, because the only integers in $$[m+n,m+n+2)$$ are $$m+n, m+n+1$$

You have $$[x] = m$$ and $$[y] = n$$ so $$m+n\le x + y < m+n+2$$

But how does $$x+y$$ compare to $$m + n + 1$$? There are two possibilities.

1) $$x + y < m+n + 1$$ then

$$m + n \le x + y < m+ n + 1$$. Then by definition you have $$[x+y] = m+n = [x]+[y]$$.

2) $$x + y \ge m+n + 1$$ then

$$m+n + 1 \le x+y < m+n + 2=(m+n+1) + 1$$ so by definition you have $$[x+y] = m+n+1$$.

That's it.

• How do you conclude the two possibilities "$x+y<m+n+1$" and "$x+y≥m+n+1$"? – Daniel Bonilla Jaramillo Dec 19 '18 at 23:05
• Trichotomy. Given two values $A$ and $B$ then you either have $A < B$ or $A\ge B$. What other options are there? How can neither be true? – fleablood Dec 19 '18 at 23:28
• @DanielBonillaJaramillo : For any real numbers $a$ and $b$, exactly one of “$a<b$”, “$a=b$”, or “$a>b$” holds. Combine the last two to get that exactly one of “$a<b$” or “$a\geq b$” holds. – MPW Dec 19 '18 at 23:28

I didn't read the question exactly, but you have floor(x)=n iff. $$n, hence you get $$... instead of $$\leq$$.

Let $$m=\lfloor x\rfloor$$ and $$n=\lfloor y\rfloor$$; let $$\{x\}=x-\lfloor x\rfloor=x-m$$ and $$\{y\}=y-\lfloor x\rfloor=y-n$$. Then $$x+y=m+\{x\}+n+\{y\}$$ Note that $$0\le\{x\}<1$$ and $$0\le\{y\}<1$$, so $$0\le\{x\}+\{y\}<2$$. There are two cases:

1. if $$0\le\{x\}+\{y\}<1$$, then $$m+n\le x+y and so $$\lfloor x+y\rfloor=m+n$$;
2. if $$1\le\{x\}+\{y\}<2$$, then $$m+n+1\le x+y and so $$\lfloor x+y\rfloor=m+n+1$$.

Alternatively. By definition $$[x+y]$$ is the largest possible integer that this less than or equal to $$x+y$$. But $$[x] \le x$$ and $$[y] \le y$$ so $$[x] + [y] \le x+y$$. So $$[x]+[y] \le [x+y]$$.

Likewise $$[x+y] + 1$$ by definition is the smallest possible integer that is larger $$x + y$$. But $$[x]+ 1 > x$$ and $$[y] + 1 > y$$ so $$[x]+[y] + 2 > x+y$$. So $$[x] + [y] + 2\ge [x+y]+1$$.

So $$[x]+[y] + 1 \ge [x+y]$$.

So $$[x]+[y] \le [x+y] \le [x] + [y] + 1$$

As $$[x]+[y]$$ and $$[x+y]$$ and $$[x] + [y]+1$$ are all integers. And there is NO integer between $$[x] +[y]$$ and $$[x]+[y]+1$$ there are only two options $$[x] + [y]= [x+y]$$ or $$[x+y] = [x] + [y]+1$$.

.......

And a third way.

$$[x] \le x < [x]+1$$ means $$0 \le x - [x] < 1$$.

A) $$0 \le x-[x] < 1$$ and $$0 \le y -[y] < 1$$ so $$0 \le x+y -[x]-[y] < 2$$.

B) $$0 \le x+y - [x+y] < 1$$.

Reverse B) to get

B') $$-1 < [x+y] - x - y \le 0$$.

Add B' and A to get:

$$-1 < ([x+y] - x - y) + (x + y - [x]-[y]) < 2$$ so

$$-1 < [x+y] - [x] -[y] < 2$$ or

$$0 \le [x+y] -[x] -[y] \le 1$$ or

$$[x]+[y] \le [x+y] \le [x] + [y] + 1$$.

.....

Basically: $$x+y$$ is between $$[x+y]$$ and $$[x+y] + 1$$; two integers that are only $$1$$ apart.

But $$x + y$$ is also between $$[x] + [y]$$ and $$[x] + [y] + 2$$; two integers that are only $$2$$ apart.

There are only so many choicese to find these integers $$[x+y], [x]+[y], [x+y] + 1$$ and $$[x]+[y] + 2$$ so that they all fit in such a tight range.

It doesn't matter how you prove it but you must have $$[x+y]$$ and $$[x]+ [y]$$ within one of each other and you must have $$[x]+[y]\le [x+y]$$. There are only two ways that can happen.