Exercise 1.2 · Q3: The greatest integer function
Prove that the Greatest Integer Function , given by , is neither one-one nor onto, where denotes the greatest integer less than or equal to .
and , but . So is not one-one.
is an integer for every , so is not the image of any . So is not onto.
Hence is neither one-one nor onto.
Want the reason behind every step, the basics and the checks?
The greatest integer function rounds down to an integer. Two consequences settle the whole question. First, a whole interval of inputs is rounded down to the same integer (everything from up to, but not including, goes to ), so many inputs share one output: not one-one. Second, every output is an integer, so a non-integer value in the codomain , such as , is never produced: not onto. Its graph is a staircase of flat steps, which shows both facts at a glance.
- Given
- , , the greatest integer less than or equal to .
- To show
- is not one-one, and is not onto.
- Plan
- (1) Make the definition usable: exactly when is an integer with . (2) Not one-one: exhibit two different inputs with the same output, and verify each value from the definition. (3) Not onto: name a real number that is not an integer and prove no input reaches it. (4) Conclude.
Basics you need
is the largest integer that does not exceed . Equivalently, means and . Examples: , , and (since ). For negative non-integers, rounding down moves away from zero. Basics: integers, even and odd
Here both are . The codomain is the set outputs are allowed to land in; onto asks whether they land on all of it. Basics: what a function is
One-one: for all inputs (Definition 5). Onto: every in the codomain is for some input (Definition 6). Basics: one-one and onto
Both properties are "for all" statements, so each is disproved by one explicit counterexample: a pair of inputs for one-one, a codomain value for onto. For onto, we must also prove that nothing maps to the chosen value. Basics: how to prove and disprove
Solution
is well defined for every real
The intervals , one for each integer , are
They follow on from each other without gaps or overlaps, so every real lies in exactly one of them, say . Then , so is an integer not exceeding ; and every larger integer is at least . So is the greatest integer , and . Thus gives each real number exactly one output, and that output is an integer.
We need two facts from this step. "Exactly one output" confirms is a function from to . "The output is always an integer" is the key to the onto part. Writing also gives a reliable way to compute values, including for negative numbers, where guessing often goes wrong.The greatest integer is the with (Basic 1).Not one-one:
Compute both values with the rule from Step 1:
So although . Two different inputs have the same image, so is not one-one.
One-one claims that equal outputs always come from equal inputs. A single pair that breaks this is a complete disproof. The pair is not special: every in has , so infinitely many inputs share the output . On the graph this is the flat step at height 1.One counterexample disproves a "for all" statement (Basic 4). Basics: how to prove and disproveNot onto: is never an output
The number belongs to the codomain . By Step 1, is an integer for every . Since , the number is not an integer, so
No element of the domain is mapped to , so is not onto.
The graph of for (scales differ). Each step sits at height ; the filled dot at its left end belongs to the graph and the open dot at its right end does not, because . The flat step at height 1 contains both and (not one-one). The dashed line runs between two steps and meets the graph nowhere (not onto). To disprove onto we must choose a value in the codomain and show that no input reaches it. Checking a few inputs would not be enough; the argument "every output is an integer, and is not" covers all real inputs at once. Any non-integer real number (, , , …) would serve equally well. The range of is exactly , which is much smaller than the codomain .Onto means every element of the codomain is an image (Basic 3). Definition 6, and the Remark after it: is onto if and only if its range equals the codomain. Basics: one-one and ontoConclude, and note what the codomain does
is not one-one (Step 2) and not onto (Step 3), so the greatest integer function is neither one-one nor onto.
If the codomain were instead of , the function would become onto: for every integer , , so , and is the image of itself. It would still not be one-one, because does not depend on the codomain.
Onto is a statement about the codomain, so changing the codomain can change the answer. One-one depends only on which inputs share outputs, so changing the codomain cannot repair it. This is why the question has to say , and why both sets matter.
from to is not one-one, because with , and not onto, because every value is an integer, so the real number in the codomain is never an image. Hence it is neither one-one nor onto, as required. (The textbook's answer list gives no entry for this "prove that" question; the result is the statement asked for.)
Using : , , , , , , . The last three show one output shared by several inputs. A computer check of inputs from to in steps of gives only different outputs, all of them integers, and is never among them.
- Rounding negative numbers towards zero. is , not : it must be an integer less than or equal to .
- Choosing an integer to disprove onto. Every integer is reached (). The missed values are the non-integers.
- Writing "not onto because the graph has gaps" with no specific value. Name a codomain value such as and say why nothing maps to it.
- Drawing the steps with both ends filled. Each step includes its left end and excludes its right end; drawing both ends filled would make look like it had two values.
- The working form of the definition is .
- A function that is constant on an interval is never one-one. A function whose outputs all lie in a set that leaves out part of the codomain is never onto.
- Onto depends on the codomain: is onto but not onto .
Every fact used, and where it comes from
| Fact | Used in | Source |
|---|---|---|
| is the greatest integer | Steps 1 to 4 | Statement of Exercise 1.2, Q3 |
| Steps 1, 2, 4 | The intervals cover without overlap | |
| Definition of one-one | Step 2 | Definition 5, Section 1.3 (Lesson: types of functions) |
| Definition of onto; onto range = codomain | Steps 3, 4 | Definition 6 and the Remark after it, Section 1.3 |
| One counterexample disproves a "for all" statement | Steps 2, 3 | Logic of quantifiers |
| All numerical values and graph coordinates | Check, figure | Recomputed exactly in the site's verification script |
Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →