3

What I know is: The floor function of $x$, denoted $[x]$, is the greatest integer smaller than $x$, ceiling of $x$ is the smallest integer greater than $x$. We define $\{x\} = x- [x]$, the factional part of x.

Till now all is okay and fine, but whenever I come across a proving question involving these type of functions, I can't even seem to get started.

I try to use extreme cases to disprove the statement if possible, but when it comes to proving, I'm just....lost. Like where do I even begin??

An example would be:

Proposition: For any real numbers $x, y,$ and $z$, prove that $[x + y + z] = [x + y] + [z + \{x + y\}]$.

I don't even know what to do with this except try and check it for some cases, which I already did.

kimchi lover
  • 24,277
  • 1
    Here's one idea: in both sides in your example, think of $x$ and $y$ as fixed (but arbitrary) and consider them both as functions of $z$. They're both step functions that jump up by $1$ at particular values of $z$. Can you show that they both jump at the same values of $z$? (and that they're equal for one value of $z$, which should be easy) – Greg Martin May 29 '21 at 15:23
  • 1
    Experiment and try to notice and describe the ways that Floor is "compatible" with addition. One thing to notice is by definition, $x = [x] + {x}$. What is $[[x]+{x}]$? And so on. – While I Am May 29 '21 at 15:38
  • Great, great, great question. This merits a superb canonical answer ,unless there's already one on the site. – Sarvesh Ravichandran Iyer May 29 '21 at 19:16

3 Answers3

8

$\newcommand{\fl}[1]{\left \lfloor #1\right \rfloor}$ $\newcommand{\cl}[1]{\left \lceil #1\right \rceil}$ Let me first link to some fairly obvious identities involving the floor and ceiling function, which can be used to solve the given question very easily. The Wikipedia page for the floor and ceiling function contains these fundamental identities.

Essentially speaking, every identity in the article given follows from the definition of the floor function as $\fl{x}$ being the unique integer $k$ such that $k \leq x < k+1$.

For example, supposing you wanted to show that $\fl{x+n} = \fl{x}+n$ for any integer $n$ and real number $x$, then it suffices to see that $k \leq x < k+1$ if and only if $k+n \leq x+n < k+n+1$ for any $k$, so the unique $k$ for which the former statement is true, plus $n$, is the unique $k$ for which the latter statement is true. Of course, the unique $k$ for the former statement is $\fl{x}$ so $\fl{x}+n $ is the unique $k$ satisfying the latter statement i.e. $\fl{x+n} = \fl{x}+n$.

I loved William's answer above, but I felt it important to mention a result that isn't talked about very much, yet is extremely powerful. In particular, this can be used to prove identities involving the floor function very, very easily.

The point is, many people have asked this question before us : how do we make computations involving the floor and ceiling simpler? (People have also asked similar questions about making results involving the maximum/minimum of sets have easier proofs, rather than going case-by-case).

There is a rather magnificent tool that can be used very very nicely for this purpose. It's called the universal property of the floor (and ceiling) function. Basically speaking, for equating functions involving the floor and ceiling functions, one just needs to make manipulations dictated by the universal property.


The Universal Property

The universal property is the most obvious thing one can think of : for the floor function, let $x$ be real and $n$ be an arbitrary integer. Then, we know that : $$ n \leq x \iff n \leq \lfloor x \rfloor $$ This characterizes $\lfloor x \rfloor$ in the following sense : this quantity is decided by the set of natural numbers that lie below it.

Similarly, we have for the ceiling function : $$ n \geq x \iff n \geq \lceil x \rceil $$ so the quantity $\lceil x \rceil$ is decided by the integers that sit above it.


But how do we use the universal property? It is actually pretty simple : let's say you had to prove something like $\lfloor f(x) \rfloor = \lfloor g(x)\rfloor$ for two functions $f$ and $g$. The universal property tells you this : it's enough to prove for each integer $n$ and element $x$ that $n \leq f(x)$ if and only if $n \leq g(x)$.

How nice does this sound? Let's prove something.

Let's prove this remarkable theorem first : which gives us so, so many generalizations that I can't imagine how many questions could have been solved using this on this site!


A Remarkable Result

Let $f : \mathbb R \to \mathbb R$ have the following properties :

  • $f$ is continuous.
  • $f$ is strictly monotonically increasing and hence one-one.
  • $f^{-1}(n)$ , for any integer $n$, is either empty ($f$ can satisfy the above two conditions without being surjective) or is an integer. Then : $$ \lceil f(x)\rceil = \lceil f(\lceil x\rceil)\rceil \quad \text{and}\quad \lfloor f(x)\rfloor = \lfloor f(\lfloor x\rfloor)\rfloor $$
    for all $x \in \mathbb R$.

What this means is quite simple : you can replace $x$ by $\lceil x\rceil$ (or floor of $x$) in such functions, and you'd not change the quantity!

Proof : Use the universal property, and let's do it just for the floor. Let $k$ be an arbitrary integer. Suppose that $k \leq f(\lfloor x \rfloor)$. Then since $x \geq \lfloor x\rfloor$ we get from monotonicity that $f(\lfloor x \rfloor) \leq f(x)$ so $k \leq f(x)$.

For the other direction : suppose that $k \leq f(x)$. Suppose that $f(\lfloor x \rfloor) < k \leq f(x)$.Then by the intermediate value theorem , there exists $y \in (\lfloor x \rfloor , x]$ such that $f(y) = k$. But then $f^{-1}(k)$ is not empty but $y$ is not an integer. Hence, it follows that $k \leq f(\lfloor x \rfloor)$ and we are done! $\blacksquare$

Let's see some fairly remarkable uses of this result.

  • With $f(x) = \sqrt x$ (note : this is for positive $x$ : the domain of real numbers can be suitably varied , the proof structure doesn't really depend upon the domain), which is continuous on $[0,\infty)$, one-one on the same interval and $f^{-1}(n) = n^2$ for any $n$, we get : $$ \lfloor \sqrt{x}\rfloor = \left\lfloor \sqrt{\lfloor x\rfloor}\right\rfloor $$ Looks difficult to prove otherwise? I'd like your thoughts.

  • With $f(x) = \frac {x+n}m$ for $m>0$, we get : $$ \fl{\frac {x+n}m} = \fl{\frac{\fl x + n}{m}} $$

  • Use iteration of the above theorem to prove the following result : for any positive integers $a_1,a_2...a_n$ we have : $$ \fl{\fl{\ldots \fl{\fl{x / a_1}/a_2} / \ldots} / a_n} = \fl{\frac x{a_1a_2....a_n}} $$

all these properties apply to the ceiling as well!


Interchange of ceil and floor

Let's see a slightly different property now : one for alternating between floor and ceiling functions.

For any $m$ integer and $n>0$ we have $$ \cl{\frac mn} = \fl{\frac{m+n-1}n} $$

Proof : Suppose that $k$ is an arbitrary integer. Then $k \leq \frac{m+n-1}{n}$ implies ,following rearrangement and factorization (pretty simple stuff that I leave to you to see) that $kn-n+1\leq m$, which (because they are all integers) happens if and only if $kn-n < m$, or $k-1 < \frac mn$, which is equivalent to $k \leq \cl{\frac mn}$(why?). Thus, we get from the universal property (for the floor) that $\fl{\cl{\frac mn}} = \fl{\frac{m+n-1}{n}}$, but the LHS is equal to $\cl{\frac mn}$, obviously.

Which gives a funny fascinating technique : introduce the floor of an integer just to apply the universal property! This can be used to flip between ceilings and floors in arguments.


Periodicity

Now, let's find a third technique for these kind of situations : I refer to it as periodicity. This basically says the following :

Given an identity, it's equivalent to proving that $f = 0$ for some $f$ once you transfer everything to one side. If this $f$ is found to be periodic, and found to be zero on one of the periodic intervals, then it's zero everywhere!

What a simple thought : but it's so profound.

Let's use it to prove the result above : that $[x+y+z] = [x+y] + [z+\{x+y\}]$.

Switch everything to one side : so that we have $[x+y+z] -[x+y] - [z+\{x+y\}]$. Increase $x$ by $1$ : then $[x+y+z]$ is up by $1$, $[x+y]$ is up by $1$ and $[z+\{x+y\}]$ doesn't change! So with respect to $x$, the function repeats upon addition of $1$ (it could be smaller, of course!).

With respect to $y$, it repeats by $1$ again. With respect to $z$ as well, as a matter of fact!

Because of this, it's enough to prove the result when $0 \leq x,y,z< 1$ : because the periodicity ensures that equality carries through everywhere.

But now we just have to literally look at two cases : $[x+y]=0$ and $[x+y]=1$, because $[x+y]$ can't be anything else. In the former case, we have $x+y = \{x+y\}$ so the identity is obvious. In the latter case we have ${x+y} = x+y-1$ and so you get the result once you realize that $[z-x-y+1] = [z-x-y]+1$.

(Note that , as in Hagen's answer, we could have used this technique directly).

But the point is, that there's much, much harder problems that can be handled through this absolutely brilliant technique. Let's see one of them.

Hermite's identity : for all $x \in \mathbb R$ and $n>0$ we have : $$ \sum_{k=0}^{n-1} \fl{x+ \frac kn} = \fl{nx} $$

How to prove this? Well, of course you can try the universal property, by taking a ceil on the LHS and then proceeding perhaps, but periodicity is so amazing!

Indeed, take everything to one side so $f(x) = \sum_{k=0}^{n-1} \fl{x+ \frac kn} - \fl{nx}$. Then, Moving forward $x$ by $\frac 1n$, note that $f(x)$ doesn't change : because exactly one of the terms in the summation will move forward by $1$ (for the unique $k$ for which $\fl{x+\frac kn} \neq \fl{x+ \frac{k+1}n}$) and that will be compensated by $\fl{nx+1} = \fl{nx}+1$, whence a $1$ gets subtracted.

So it's enough to prove this when $0 \leq x < \frac 1n$. But in that case, it's terribly obvious that every term in the summation is zero, and $\fl{nx} = 0$. Done!


So the takeaways are :

  • The universal property and the theorem.

  • The ceil-floor flip relation.

  • The periodicity trick.

These, along with standard fundamental results mentioned here will take you a long, long way in handling such identities with fluid ease.

  • 1
    This answer is currently under further editing : to include far-flung relations as well and to be a compendium of results on the floor function that can handle a variety of situations. – Sarvesh Ravichandran Iyer May 30 '21 at 20:15
  • 2
    Holy sh*t, is it possible there's been no better way to start a morning than to learn so many good things? Thanks for the info. Regarding your questions: I was able to prove [√x] = [√[x]] easily using the property that [x] <= x< [x]+1. – Confused_nerd May 31 '21 at 05:09
  • @Confused_nerd Oh I see, that's great, because that means you are comfortable with its usage. There's so much more you can do with floor functions : see for example the question here which , with the universal property, becomes an (non-trivial) algebraic calculation. I mean, life is generally very easy with these few tricks, but sometimes you'll have some off-track questions like here – Sarvesh Ravichandran Iyer May 31 '21 at 05:11
  • I believe the best reference for floor and ceiling function manipulations is the book Concrete Mathematics by Graham, Knuth and Patashnik. They were computer scientists : perhaps you would like to know why the floor function come into computer science? It comes in while calculating the time complexity of algorithms , briefly speaking, and therefore needed addressing in a canonical fashion. – Sarvesh Ravichandran Iyer May 31 '21 at 05:15
  • Regarding your questions: I was able to prove [√x] = [√[x]] easily using the property that [x] <= x< [x]+1. I don't think I would have been able to prove the next two without this tho. Proving that k - 1 < m/n is equivalent to k <= ceiling(m/n) was easy too. Writing m/n = ceiling(m/n) - x, for 0<=x<1 and peoceeding worked for me( noting that k is an integer was useful). The proof of hermite's identity was elegant. Thanks! (The site didn't let me edit the earlier comment) – Confused_nerd May 31 '21 at 05:17
  • 1
    I actually was planning to study the book by GKP next week( completely unrelated to this, i didnt know about the floor functions etc.) – Confused_nerd May 31 '21 at 05:21
  • 1
    @Confused_nerd Thanks for working along my guidelines. I have given you a +1 in this regard. Just a small request, in case you were thinking : I would like William's answer to remain accepted over mine for a simple reason : the second way of working, while less satisfying, needed emphasis as a technique for all forms of math : not just floors and ceilings. My answer basically addresses the math aspects of your question, but William motivates and attaches emotion to problem solving : I love that! (I'm mentioning this in case you felt my answer is better : I don't think it is!) – Sarvesh Ravichandran Iyer May 31 '21 at 05:22
  • I had already thought of that, so no worries. – Confused_nerd May 31 '21 at 05:24
  • 1
    @Confused_nerd I'm happy to know you thought about it and will read GKP : once you're done, come back to the site and see how many floor questions could have been done in seconds if people had read that book! Good luck reading that book and otherwise doing mathematics as well, and wish you a good time using the site as well. I hope your impression of the site has been good so far, and I'll see you around on another good question of yours sometime! Side note : there's apparently some combinatorial interpretation type results as well, which aren't there in GKP : so I'll add that when I can. – Sarvesh Ravichandran Iyer May 31 '21 at 05:26
  • 1
    The universal viewpoint has been mentioned here many times in the past, e.g. see this answer nine years ago, and see the comments there for links to category-theoretic views. – Bill Dubuque Jul 17 '21 at 18:36
  • @BillDubuque Correct about the viewpoint, but your answer, and another answer by the user Math Gems if I'm not wrong are the only places where the phrase "universal property" is mentioned. Anyway, I kind of meant for this thread to serve as a large dupe-target thread containing a general lemma derived from the U.P, a "floor-ceiling" switch lemma and the periodicity property. These three are, as far as I see the most common floor-identity related techniques. More are available (summation/combinatorial techniques) in the book GKP discussed above. Thank you for the category-theoretic reference! – Sarvesh Ravichandran Iyer Jul 17 '21 at 18:40
  • Out of curiosity I did a search. I see no posts by Aqua. As you can see, I tried to popularize this universal view in the early days of the site a decade ago. As I knew well from sci.math, it is not as well known as it deserves to be among students at this level (ditto for the analogous view of the gcd universal proiperty- which I also frequently emphasize) – Bill Dubuque Jul 17 '21 at 18:50
  • @BillDubuque Yes, I edited my earlier comment, sorry. It was an answer by Math Gems. Let me also admit I was surprised by what I saw : one was that it hadn't been mentioned that often (neither did I know about it!), and the other that I did not find a whole list of techniques that did cover floor functions well, but only some isolated bunch of questions. I had done an Approach0 search as well, looking for previous sources. I found your answer and Math Gems' answer, but I must admit that I picked up the definition from another blog post, which I must edit my answer to cite. – Sarvesh Ravichandran Iyer Jul 17 '21 at 18:54
  • Yes, no doubt it deserves to be better known. fyi: Math Gems is my partner (sometimes we post using each other's account when that is more convenient than switching acoounts). – Bill Dubuque Jul 17 '21 at 19:15
  • @BillDubuque Oh I see! Thanks for the information. I will certainly link the relevant answers to my post. Not immediately since I happen to be on a conversation, but I will do so in due course. – Sarvesh Ravichandran Iyer Jul 17 '21 at 19:16
6

You ask for a general toolkit to prove these kinds of questions.

I will give an answer in two forms.


First, it's worth remembering (or understanding) a suite of facts about $\text{Floor}$. This includes, but it not limited to:

  1. $\lfloor x \rfloor + \{x\} = x$ (this is by definition)

  2. $\lfloor x \rfloor = \max \{ m \in \mathbb{Z} : m \leqslant x\}$ (in some cases, this is the definition of $\text{Floor}$. It's useful for the most elementary of problems)

  3. $\lfloor x + z \rfloor = \lfloor x \rfloor + z \Longleftrightarrow z \in \mathbb{Z}$ (this is good for breaking up problems, as in Hagen von Eitzen's answer)

  4. $\lfloor x + y\rfloor \geq \lfloor x \rfloor + \lfloor y \rfloor $ (can you see why this is? Check cases where $\{x\},\{y\} > 1/2$)

  5. $\lfloor x \rfloor \leq x$ (this one seems obvious, but is important when dealing with integer bounds. It makes more sense to say the number of elements of a set at most $\lfloor r\rfloor $ rather than some real number $r$.)


The second way I will answer this question may be less satisfying. These kind of elementary problems often have one most direct way to solve it, with other ways being valid, but seen as inferior. If I can do a proof in three steps, or do it in 6 steps with those three steps secretly in it, one would see the second way as more elegant. It takes practice to be able to be see this quickest way, and there is rarely, if ever, a way to develop this intuition other than doing problems.

I will use Hagen von Eitzen's answer as a kind of paradigmatic example. What they did was:

  1. Run with a few test cases (presumably. Practiced mathematicians sometimes skip this step, but I certainly don't!)

  2. See what structure is exposed in the test cases.

  3. Think about how to describe this structure with mathematical fact.

This third step is the hardest of all. Often times the most obvious thing is the hardest to prove rigorously, simply because you don't know how to even put it into different words! Steps (2) and (3) will also vary wildly from object to object. As we are working with a function going into the integers, one of the most obvious points of structural limitation is looking at where your argument can "break" into integral and fractional parts. Another structural limitation is that you can only make really good inferences with inequalities and substitutions, since we're working purely arithmetically. A good proof for an arithmetical problem will use words sparingly to explain steps; the actual meat of the proof will be found in substitutions, identities, and bounds.

  1. Translate your argument into this mathematical argument, and write it down.

This is what Hagen von Eitzen did. They saw a useful way to break up the fractional and integral parts (which is often a key step in these kinds of proofs), and then found a useful substitution into identities which we know are true.

  1. Realize you made a mistake, and fix it.

  2. Realize you made another mistake, and fix it.

$\hphantom{13}\vdots$

$\hphantom{13}n.$ Conclude there are no mistakes, and be satisfied.

I hope this was helpful. There's only so much advice someone can give other than practice, practice, practice!

Oh, and always draw a picture! That helps for me.

While I Am
  • 2,380
3

Note that $$\tag1a=\lfloor a\rfloor+\{a\}$$ by definition. Also, if $n$ is an integer, then $$ \tag2\lfloor n+a\rfloor = n+\lfloor a\rfloor.$$ In order to show $$ \lfloor x+y+z\rfloor = \lfloor x+y\rfloor +\lfloor z+\{x+y\}\rfloor,$$ use $(2)$ with substitution $n\leftarrow\lfloor x+y\rfloor$, $a\leftarrow z+\{x+y\}$ and use $(1)$ with substitution $a\leftarrow x+y$.

  • Thanks for the answer, but this was just one example I was using as a refrence. What I was hoping for was something some different "useful" things that i can use in different proofs. – Confused_nerd May 29 '21 at 17:14