The following inequalities are extremely useful to compare real numbers amongst themselves and with decimal numbers.
Let #r# be a non-negative real number and #h# a decimal number with #i# decimals. Then #h# is a head of the decimal development of #r# if and only if \[ h\le r \lt h+\frac{1}{10^i}\tiny.\]
We first prove that the inequalities are satisfied if #h# is the head of the decimal development of #r#.
Let #w.r_1r_2r_3\cdots# be the decimal development of #r#, in which #w# is a non-negative integer and #r_1,r_2,\ldots# are digits. Then #h# equals #w.r_1r_2r_3\cdots r_i#. Hence, the inequalities we have to prove can be written as \[ w.r_1\cdots r_i\le r \le w.r_1\cdots r_{i-1} +\frac{r_i+1}{10^i}\tiny.\]
The first inequality, #w.r_1\cdots r_i\le r #, results from the fact that \({}r=w.r_1\cdots r_i+ \frac{r_{i+1}}{10^{i+1}}+\frac{r_{i+2}}{10^{i+2}}+\cdots{} \), because all the fractions on the right-hand side are greater than or equal to #0#. Equality only occurs when the tail from #i+1# onwards is equal to #0#.
The second inequality, # \le w.r_1\cdots r_{i-1} +\frac{r_i+1}{10^i}# results from the fact that #\frac{r_{i+1}}{10^{i+1}} +\frac{r_{i+2}}{10^{i+2}}+\cdots # is less than or equal to #\frac{9}{10^{i+1}} +\frac{9}{10^{i+2}}+\cdots =(.999\cdots )\times 10^{-i} = \frac{1}{10^{i}}#.
The case of equalization can not occur, because then the tail starting from #(i+1)#, would have to consist solely of #9# 's. That is excluded by the requirement that #w.r_1r_2r_3\cdots# is the decimal development of #r#.
Suppose #h# satisfies #h\le r \lt h+\frac{1}{10^i}#. We show that #h# is then the head of the decimal development of #r#. Let #k# be the head of the decimal development of #r# with #i# decimals. Then, according to the statement that has just been proven that #k\le r \lt k+\frac{1}{10^i}#. If we apply rule of calculation 2 for inequalities on #h\le r\lt k+\frac{1}{10^i}# and #k\le r\lt h+\frac{1}{10^i}#, then we find #h\lt k+\frac{1}{10^i}# and #k\lt h+\frac{1}{10^i}#. With rule of calculation 3 for inequalities this can be rewritten as \[-\frac{1}{10^i}\lt h-k\lt\frac{1}{10^i}\tiny.\] Hence #h# and #k# are decimal numbers with #i# digits after the decimal point, that differ less than #\frac{1}{10^i}# from one another. This means that they are equal. The conclusion is that #h=k# is the head of the decimal development of #r#, just as we had to prove.
A direct consequence is the following method to compare two real numbers.
Let #r_{-n}r_{1-n}\cdots r_0.r_1r_2r_3\cdots # and #s_{-n}s_{1-n}\cdots s_0.s_1s_2s_3\cdots # be the respective decimal developments of positive real numbers #r# and #s#. Then #r\lt s# is satisfied if and only if there is an integer #j\ge-n# such that \[r_{-n}=s_{-n},\ r_{1-n}=s_{1-n},\ldots, r_{j-1}=s_{j-1},\ \text{ and } r_j\lt s_j\tiny.\]
Proof:
Suppose, for the given decimal developments of #r# and #s#, that there exists an integer #j\ge -n# such that #r_{-n}=s_{-n}#, # r_{1-n}=s_{1-n},\ldots, r_{j-1}=s_{j-1}#, and #r_j\lt s_j#. Because #r_j\lt s_j#, #c_j := r_j+1# is a digit that is less than or equal to #s_j#. From this we reduce: \[ \begin{array}{rclcl}.r_1r_2r_3\cdots &\lt& .r_1r_2\cdots r_{j-1} +\frac{c_j}{10^j}&\phantom{x}&\color{blue}{\text{the above statement}}\\ &\le& .r_1r_2\cdots r_{j-1}s_j&&\color{blue}{c_j\le s_j}\\ &\le& .r_1r_2\cdots r_{j-1}s_js_{j+1}s_{j+2}\cdots&&\color{blue}{s_{j+1}\ge0, s_{j+2}\ge0,\ldots}\end {array}\] It follows that #r\lt s#.
Now suppose, conversely, that #r\lt s#, in which #r# and #s# are positive real numbers. Let #r_{-m}r_{1-m}\cdots r_0.r_1r_2r_3\cdots # and #s_{-n}s_{1-n}\cdots s_0.s_1s_2s_3\cdots # be the decimal developments of #a#, respectively #b#, without #9#-repetitive tails. By adding enough zeros to the left of the decimal development of #r# or #s#, we can assume that #m=n#. Now let #j\ge -n# be the index of the first digit where the decimal developments differ. So #r_{-n}=s_{-n}#, #r_{1-n}=s_{1-n},\ldots, r_{j-1}=s_{j-1}#. If now #r_j\gt s_j#, then we can apply the previous with #r# and #s# reversed, with conclusion #r\gt s#. This is a contradiction. Because we have chosen #j# such that #r_j\ne s_j#, we must have #r_j\lt s_j#. This proves the existence of #j# as indicated.
Which inequality sign should occur between the real numbers with decimal development #{ 417.787080 }1\cdots# and #{ 417.757080 }1\cdots# ?
#\gt#
The first digit where #{ 417.787080 }1\cdots# and #{ 417.757080 }1\cdots# differ is at position #2# after the decimal point. It is bigger for #{ 417.787080 }1\cdots# than for #{ 417.757080 }1\cdots#. According to the
statement follows #{ 417.787080 }1\cdots \gt { 417.757080 }1\cdots#