Number Systems: From to gave every
element of an Archimedean field an integer part (Number Systems: From to , Proposition 4.2.4).
Here the integer part becomes a function on all of , one that jumps at
every integer. From it we build the distance to the
nearest integer and the step functions. Section 8.6
builds its strange functions from these pieces.
The floor
and the ceiling
Nobody needs a definition to round down to . The integer is the one with .
Rounding up gives , and the part left
over, , lies between and .
For a number such as , with
no decimal expansion handed to us, we need to know that
the answer exists and is unique. Both facts are already
proved:
Throughout, integers are read inside , as in Number
Systems. The embedding respects
sums, products and order and reflects order (Number Systems: From to , Theorem 4.2.2).
So a sum, product or comparison of integers means the
same in and in
.
The floor of is the integer you
reach by stepping down from to the nearest integer
at or below it.
Definition
8.4.1 (Floor, Ceiling, Fractional Part)
Let .
The floor of , written , is
the unique with The ceiling of is . The number is the
fractional part of ; it lies in .
Existence and uniqueness are Number Systems: From to , Proposition 4.2.4
for . So
is a function with values in , a real function in
the sense of Definition 8.1.1.
The fractional part lies in because
subtracting from gives
. For a rational the floor is the
integer part of Number Systems: From to , Proposition 3.2.5.
Sets and Functions used the floor map as a
school fact (Sets and Functions, Example (Maps from calculus)
(b)). Now it rests on a proof.
Examples. , since
.
,
since : at an integer the floor is the integer
itself. , since . .
The graph of the floor is a staircase: on each a horizontal
segment at height , with a filled dot at
its left end and a hollow dot at its right end.
The figure shows the graph of on , with the dashed
line : the
staircase never rises above the line and never falls a
full unit below it, which is rule (a) below.
Warning. The floor is not “drop the
decimals”. For , dropping the decimals gives , but is false; the
integer with is . For negative non-integers the floor is one
below the truncation.
Quick check. Compute , and .
Solution. , so
.
Next, gives , so . Finally , not : the floor does not
commute with negation.
Each of these floors was found the same way: name a
candidate integer and verify the two inequalities. That
is the whole method for floors.
Example
(Method: pin the floor by its inequality)
How it goes. To show for a real
expression , use
one of two forms.
- First form. Check that is an integer and that
.
Uniqueness in Definition 8.4.1
does the rest.
- Second form. Check that is an integer and that
every satisfies . This form rests on rule (g) of
Proposition 8.4.1,
which turns
into a statement about .
| an expression ; a candidate integer
|
(first form), or (second form) |
When to use it. Every identity with
a floor on one side. The first form suits a candidate
given by a formula; the second suits an built from floors and
divisions, where each step of the argument is an
equivalence.
Common mistakes. One mistake is to
drop the decimals, as in the warning above. Another is
to forget that
must be an integer. For example, holds for every real , yet is only when it is
an integer.
Here are the rules for the floor that later chapters
use. Most of them are one application of the method;
rule (g) is discreteness of .
Proposition
8.4.1 (Rules for the Floor)
Let , and .
- (a) , and if and only if .
- (b) .
- (c) The floor is
increasing: if , then .
- (d) .
- (e)
if , and
if .
- (f) is the unique
with
.
- (g) For every : .
- (h) .
Idea. Parts (a), (b), (d), (e) and
(f) use the first form of Example (Method: pin the floor by its inequality):
write down the candidate and check two inequalities.
Part (g) is discreteness of : no integer lies
strictly between and . Part (c)
is (g) applied once, and (h) needs a separate
argument.
Proof. Write , so
and .
(a) The
inequality
is half of the definition, and subtracting from gives . If , the integer
satisfies , so
by
the first form. Conversely, if , then is an integer, because
is.
(b) The number
is an
integer, and adding to gives
. By the first form, .
(c) Let ,
and write and , both in . Then with .
Case . Then , so by
the first form. Case . Then , so . In both cases .
(d) If , then , and (a) gives
. If , then by (a), so . Negating reverses both
inequalities (Number Systems: From to , Proposition 2.4.3
(a)): . So the integer satisfies , and by the first form.
(e) Let , so . Negating gives , that is,
satisfies . If also satisfies
, then negating gives , so by the definition of the
floor, and .
(f) Let . If , then . We prove
the contrapositive. If fails, then , by totality of the order. Discreteness
of (Number Systems: From to , Theorem 2.4.2
(c)) then gives . Then , so fails.
(g) Let . Then by
(a), and , so (g) for , with , gives
. Hence the floor is increasing on
(Definition 8.2.1).
Rule (g) justifies the second form of the method.
Suppose
and every
satisfies . By (g), every then satisfies . The choice gives , and the choice gives . So .
Part (h) is the rule behind dividing in stages: .
Idea (Scratch work). Start with the
first form, candidate .
| ,
;
|
|
| , |
upper half: ; done |
| , that
is, |
lower half: |
|
rule (g) turns into |
Both halves go through. But the lower half is just
rule (g) again, and every step is an equivalence. The
second form writes it as one chain, with no candidate to
guess.
Proof.
- (h) Let . Multiplying by
and by
preserves , and
. Hence
where the second and the last equivalence are
(g), applied to
with the integer
and to with
. So the integer
satisfies the second form for , and
.
Applied to
and , it gives .
Quick check. Compute and
.
Solution. , and
since . On the other side and . The two
agree, as (h) says with .
Distance to
the nearest integer
The fractional part measures how far sits above the integer
below it. Often we want the distance to
any integer: is far above but close to . That is a distance to
a set, so we define it as an infimum and then show that
it is attained.
The distance from to is how far must move to land on an
integer.
Definition
8.4.2 (Distance to the Integers)
For ,
the distance from to is
The set is non-empty (take ) and bounded below
by , so the
infimum exists (Proposition 8.3.1).
Proposition
8.4.2 (Distance to the Integers)
Let , and .
- (a) , and it is a minimum: for or , and for every .
- (b) ; if and only if ;
if and only if .
- (c) and .
- (d) ; ; and
.
Idea. Every integer is at most
or at least , so the nearest
integer is or
, at distance
or . Parts (b)–(d)
follow, using a nearest integer as a witness.
Proof.
(a) We have . Let . If , then , so . Otherwise , so by discreteness (Number Systems: From to , Theorem 2.4.2
(c)), and ,
so . In both cases . The value is
itself in the set: and . A lower bound of a set that
belongs to the set is its infimum, and its
minimum.
(b) By (a), . The
two numbers and
add up to
, so the smaller
is at most . Since , the minimum
is exactly when
, that is,
when ,
that is, when (Proposition 8.4.1
(a)). The minimum is exactly when
and
,
that is, when ; then . Conversely, if ,
then , so and .
(c) For every
, and . As runs through , so do and . So the three sets in
the definitions of , and are equal, and so are their
infima.
(d) The first
inequality is the term of the set. For the others, use (a) to choose
with
and . By the triangle inequality
(Number Systems: From to , Proposition 4.1.3
(e)), which is subadditivity. Similarly . Exchanging and gives , and the two bounds together are
.
The graph is a row of tents: it rises with slope
from at each integer to
at each
half-integer, and falls back with slope .
The figure shows on . The last inequality of (d) says that no
tent is steeper than slope : moving by changes the height by
at most .
Rule (c) says that shifting by changes nothing. For
instance, , and are all
. Functions with
such a shift have a name.
Definition
8.4.3 (Periodic Function)
Let with , and let with . The number is a
period of if, for
every , both and lie in
and . The function is
periodic if it has a period.
The periods of
are closed under negation and under non-zero sums. Let
be periods and
. The domain
condition for is
the one for . With
, we get . If , then in
two steps, and . By induction on (Sets and Functions, Theorem 3.2.1),
is a period,
since ; by negation so is . So if is a period, every
non-zero integer is one.
Examples. The fractional part
on has period
, by Proposition 8.4.1
(b) with :
. The distance
has period , by Proposition 8.4.2
(c). A constant function on has every as a period. The
identity on has
none, since .
Quick check. Is a period of
?
Solution. No. A period would give . But , since
, while
by Proposition 8.4.2
(b), since .
Step
functions
On a bounded interval the floor changes value only
finitely often. On it is
on , on and on . It jumps at , and , and is constant in
between. Functions of this shape are the simplest after
the constants.
A step function is constant between finitely many
cut points, and may take any values at the cut
points.
Definition
8.4.4 (Step Function)
Let
with . A
function is a step function
if there exist and
points such that, for each ,
is constant
on the open interval . The
points form a partition of
adapted to , and the
intervals are its open pieces.
In words: finitely many cut points, constant on each
open piece, and nothing required at the cut points
themselves. Adding cut points keeps a partition adapted,
since a constant function stays constant on a smaller
interval; so an adapted partition is never unique.
Examples. A constant function on
is a step
function, with the partition . So is on (Sets and Functions, Definition 2.3.2),
with the partition : it is on and on , and its
value at the cut
point is
allowed.
The floor on any is a step function. The integers with satisfy
, by rules (a) and (g) of Proposition 8.4.1.
So they form a subset of the finite set (Sets and Functions, Definition 4.1.2).
A subset of a finite set is finite (Sets and Functions, Proposition 4.1.6),
so there are finitely many such . Take as cut points
, and these integers, in
increasing order. On an open piece , let be two of its
points. Then , and :
otherwise the integer would lie in
, inside the
open piece, where no integer is. So
by Proposition 8.4.1
(g), and by (c). The floor is constant on the
piece.
Non-example. The identity on is not a step
function. Every partition has a first open piece with , and the
identity takes two different values on it, at and . The clause that fails is
“constant on each open piece”.
Quick check. Which of these
functions on
are step functions: ; the
indicator of ?
Solution. The first is, with the
partition , as in the examples. The second is not. Take
any partition . By Number Systems: From to , Proposition 4.2.3
there is with . The
point lies
in the first open piece , and the indicator is there. The midpoint
of and also lies in
. It is not
of the form ,
since larger denominators give smaller reciprocals (Number Systems: From to , Proposition 3.2.2
(b)). For , , and for , . So the indicator is at , and it is not constant
on .
Combining two step functions point by point gives a
step function again. The only work is to find one
partition that serves both. For instance, on needs the merged cut points ;
neither partition alone is adapted to it.
Proposition
8.4.3 (Step Functions Are Closed Under the
Operations)
Let be step functions and . Then , , , and
(Definition 8.1.2)
are step functions.
Idea. Merge the two partitions.
Every open piece of the merged partition sits inside an
open piece of each old one, so both and are constant there,
and so is anything computed from their values point by
point.
Proof. Let and be the sets of cut
points of partitions adapted to and to , and let .
Then is finite,
contains and
, and lies in
. So listing
it in increasing order gives a partition . Each open piece lies
inside an open piece of and inside an open
piece of , because
no point of or
lies strictly
between consecutive points of . So takes one value
and one value on . The five
functions take the values , , , and
there.
Hence each is constant on every open piece of , and is adapted to all
five.
↺Second readingMerging
two partitions
is finite
and can be listed. and are finite. Since , it is finite (Sets and Functions, Proposition 4.1.6).
Then is a disjoint union of finite sets, finite
by Sets and Functions, Proposition 4.1.5.
Repeatedly removing the minimum (Sets and Functions, Proposition 3.3.8)
lists it in increasing order.
Each piece of lies in a piece of
. Let be
consecutive in .
Let be the
largest point of
with and
the least
with ; both exist, since and is finite. No point
of lies in . If , it would be a
point of at most
and larger than
. If , it would be
a point of at
least and
smaller than . If , it
would be a point of between the consecutive
points and . So are consecutive
in , and . The same holds for .
Exercises
A. Check your
understanding
Exercise
(A1)
Compute:
- (a) ;
- (b) ;
- (c) ;
- (d) ;
- (e) .
Solution.
(a) , so
.
(b) , since (Proposition 8.4.1
(a)).
(c) , so
,
and . The sum is .
(d) , so
, and (Proposition 8.4.2
(a)). The nearest integer is .
(e) , so
, and .
Exercise
(A2)
True or false for all real , ? Give a reason or a
counterexample.
- (a) .
- (b) .
- (c) .
Solution.
(a) False: for
, but .
(b) False: for
,
, but .
(c) True:
subadditivity in Proposition 8.4.2
(d), with ,
gives .
B. Practice
Exercise
(B1: Prove or disprove)
Prove each true statement for all real , and refute each false
one with a counterexample. In (c), prove it for all
.
- (a) .
- (b) .
- (c) for .
- (d) .
Solution.
(a) True. Let
and . Case .
Then
with , so and . Also
with , so . Both sides are . Case . Then
, so
. Also , so . Both sides are . Each floor was
found by the first form of Example (Method: pin the floor by its inequality).
(b) False: for
, .
(For
it is true, by Proposition 8.4.1
(e).)
(c) True, by the
second form. Since , by Proposition 8.4.1
(g), so both square roots exist. First, for : . Indeed, if , then by Lemma 1.5.1
(a) with ,
with equality when . If , then by the same part. Now let . If , the middle step by Proposition 8.4.1
(g), since . If , then
lies below both square roots, which are , so both sides
hold. Rule (g) rewrites as . So every satisfies , and the second form gives
.
(d) False: for
, . It holds
exactly for , by Proposition 8.4.1
(e).
Exercise
(B2: Counting multiples)
Let . Prove that the number of multiples
of in is .
Solution. The multiples of are the numbers with . Since , holds exactly
when : for
, , and for
, . Also The first step multiplies or divides by , which keeps the
direction of .
The second step is rule (g) of Proposition 8.4.1.
So the multiples of in are
exactly with
; here , since
, and the
set is empty when . The map
from
onto this set is injective, since
and
give . So it is a
bijection, and the set has elements (Sets and Functions, Definition 4.1.2).
This number of elements is unique (Sets and Functions, Corollary 4.1.4).
Exercise
(B3)
Show that is a step
function on ,
and give an adapted partition and the values on its open
pieces.
Solution. Take the partition . On each open piece both floors are constant,
by the first form of Example (Method: pin the floor by its inequality):
- on : and , so ;
- on : , , so ;
- on : , , so ;
- on : , , so .
So is
constant on each open piece, as Definition 8.4.4
requires. At the cut points, , ,
,
, .
C. Going deeper
Exercise
(C1: A sum of floors)
Let . Prove that for every ,
Solution (Hint 1). Compare the left
side at and at
: which
terms survive the shift?
Solution (Hint 2). Let be the left side
minus the right side. Show that is a period of and that on .
Solution. Let for .
Step 1:
is a period of . Shifting the
index gives and by rule (b) of Proposition 8.4.1.
Since is
the term of
the sum at , the
left side of the identity grows by exactly from to . So does the
right side: . Hence
for every , and
is a period of
on (Definition 8.4.3).
Step 2: on . For and , , so each . Also
, so
.
Step 3: every . Let
and . From , dividing by , . If
, then is a period of , since integer
multiples of a period are periods; so . If , then and by Step 2. This proves the identity.
What a complete answer needs. (10
points)
- 3: shows that both sides increase by exactly under , naming
Proposition 8.4.1
(b) for each side.
- 2: checks that both sides vanish on , with the bound
.
- 3: reduces an arbitrary to by a multiple
of the period,
with
(or another integer chosen so that the remainder lands
in ).
- 2: uses that integer multiples of a period
(including negative ones) are periods, or iterates the
shift in both directions.
A direct count also earns full marks. Write . The
terms with equal , and the others equal . Such a proof
earns the 3, 2, 3 and 2 points for, in order: the count,
each term’s inequality, , and the
comparison.
Slips that lose the step (0 points for it): shifting
only forward, although needs a backward shift; treating as .
Exercise
(C2: Multiplying the distance)
Let .
- (a) Prove that for every .
- (b) Prove that
equality holds whenever .
- (c) Find with strict inequality
for .
Hint: if for an integer , then .
Solution.
(a) By induction
on (Sets and Functions, Theorem 3.2.1,
with base ). For
both sides
are .
If , then subadditivity (Proposition 8.4.2
(d)) gives
(b) First the
hint. Let with , and let with . Then by discreteness (Number Systems: From to , Theorem 2.4.2
(c)). The reverse triangle inequality (Number Systems: From to , Proposition 4.1.3
(f)) gives So is the least of the numbers , , and equals
.
Now let . By Proposition 8.4.2
(a) there is with ; put . Then
with
and
. By the hint, .
- (c) : . Here , so (b) does not apply.
Exercise A2 (c) gave the inequality only; (b) adds where
it is an equality.