User:Padex/(b-1)'s complement

A very brief introduction to hyperreal numbers
This paragraph is essentially informal and only aims at providing a quick and intuitive understanding on how to manipulate hyperreal numbers. Please check the main article for more information.

We note $$^*\mathbb{R}$$ the set of hyperreal numbers.

What we call a hyperreal is actually a sequence of real numbers. However, two distinct sequences in the sense of $$\mathbb{R}^\mathbb{N}$$ may be identified as the same hyperreal number. This is why $$^*\mathbb{R} \neq \mathbb{R}^\mathbb{N}$$ (more precisely, *R is a quotient group, a subgroup of RN).

In order to understand whether two sequences represent the same hyperreal number, we need an ultrafilter.

Ultrafilter
An ultrafilter U is a set of subsets of $$\mathbb{N}$$, such that :


 * 1) For all subset X of N, either X of N\X belongs to U, but not both
 * 2) For all element X of U, for all subset I of N, if X is included in I then I belongs to U
 * 3) For X and Y of U, the intersection of X and Y is also in U

We also specify that we want our ultrafilter to be free (or non-trivial), meaning it does not contain any finite subset of N.

fr:Utilisateur: Padex/Complément à b-1

The good news is: such ultrafilters exist. The bad news is: we can not explicitly construct one, and the definition of hyperreal numbers depends slightly on which U we choose. Despite this bad news, the actual choice of U will not matter for our purpose.

Total order over the real sequences
Now, if we consider $$a = (a_0,\ a_1,\ a_2,\ \dots)$$ and $$b = (b_0,\ b_1,\ b_2,\ \dots)$$ two real sequences, we can define :

$$A = \{i \in \mathbb{N}\ |\ a_i \geq b_i \} $$

and

$$B = \{i \in \mathbb{N}\ |\ b_i \geq a_i \} $$

We will also define: $$B' = B\setminus(A\cap B) = \mathbb{N}\setminus A$$

From the first rule we know that either A or B' belongs to U, and from the second rule we know that if B' is in U, then so is B. So either A or B (maybe both) is in U.

Hence we can define a total order over our real sequences: we say that a ≥ b if and only if A is in U. Likewise, we say a ≤ b if and only if B is in U. Finally we say a = b if and only if a ≤ b and a ≥ b, i.e. iff A ∩ B is in U.

Note that, since U is non-trivial, any two sequences differing only on a finite set of indices are actually equal in the sense of the hyperreals.

Reals in hyperreals
The notation *R and the name "hyperreal" indicate that we want to extend the real numbers, which implies to include them first.

A canonical way of representing a real number x as a hyperreal is the sequence (x, x, x, x, …).

We then remark that the sequence ω = (0, 1, 2, 3, 4, …), by definition, is larger (with the total order we defined above) than any real number: it is an infinite number. Likewise, ε = (1, 1/2, 1/3, 1/4, …) is larger than 0 but less than any strictly positive real number: it is an infinitesimal number.

There is an infinity of infinite and infinitesimal numbers, but all of them can be ordered and manipulated ordinarily.

Manipulating the hyperreals
Since a canonical way to represent a real x is the sequence (x, x, x, …), then for some real function f a canonical way to represent f(x) is the sequence (f(x), f(x), f(x), …). We then intituively extend f over the hyperreals as a component-wise function:

$$f((x_0,\ x_1,\ x_2,\ \dots)) = (f(x_0),\ f(x_1),\ f(x_2),\ \dots)$$

(if f is not defined for some xi, replace by 0)

In particular, we consider the extension of the integer part and we name hyperintegers the hyperreals that are equal to their integer part. The set of hyperintegers is noted $$^*\mathbb{Z}$$. For multivariable functions such as classical operators + and ×, component-wise computations still hold:

$$(a_0,\ a_1,\ a_2,\ \dots) + (b_0,\ b_1,\ b_2,\ \dots) = (a_0 + b_0,\ a_1 + b_1,\ a_2 + b_2,\ \dots)$$

$$(a_0,\ a_1,\ a_2,\ \dots) \times (b_0,\ b_1,\ b_2,\ \dots) = (a_0\cdot b_0,\ a_1\cdot b_1,\ a_2\cdot b_2,\ \dots)$$

(b-1)'s complement
Let b be a positive integer, greater or equal than two.

We consider the writing $$a = \dots a_n\dots a_2a_1a_0,a_{-1}a_{-2}\dots a_{-m}\dots$$ (with 0≤ ai ≤ b-1 for all i in Z) and we associate it with the unique real number ( if it exists ) representing the hyperreal

$$h(a) = \Bigg(\sum_{n \in \mathbb{Z},\ n < N} a_n \cdot b^n \Bigg)_{N \in \mathbb{N}} $$

in the quotient group *R/(bω*Z), where ω = (0, 1, 2, 3, 4, …).

All real numbers have such a writing
This property is rather straitforward for positive real numbers, since it is the same as their base b writing.

For strictly negative real numbers x, since h(⋅) can only be positive, we must consider bω + x = bω − |x|.

We remark that, for any writing a, the indices of the corresponding h(a) verify h(a)i ≤ bi, for all i in N

In fact, we have an equality if and only if aj = b-1 for all j ≤ i, which corresponds to the improper writing of bi. That is, we have two ways for writing bω, for instance with b = 10:

$$10^\omega = (1,\ 10,\ 100,\ 1000,\ \dots) = (0.999\dots,\ 9.999\dots,\ 99.999\dots,\ 999.999\dots,\ \dots)$$

Now, let x be a strictly negative real, and let y = −x = |x|.

Let us write $$y = \sum_{i \in \mathbb{Z}} y_i \cdot b^i$$ with $$ 0\leq y_i \leq b-1$$ for all i, the unique proper writing of y in base b.

We define $$x_i = (b-1) - y_i$$ for all i in Z. From what precedes we deduce that

$$\Bigg(\sum_{i \in \mathbb{Z},\ i < N} x_i \cdot b^i \Bigg)_{i \in \mathbb{N}} $$

is equal to the hyperreal bω - y = bω + x ≡ x [bω]

Not all writings correspond to a real
Most hyperreals between 0 and bω do not have any real representator of their class in *R/(bω*Z). Only those who belong to R+ or bω − R+ have such a representator. The former have a writing whose left-terms are eventually equal to 0, and the latter have a writing whose left-terms are eventually equal to (b-1).

Compact notation
Writing an infinity of left terms is long, especially at the beginning.

Fortunately, since all real numbers have a writing whose left terms are eventually constant, we can apply a variant of the rule for usual notation : for instance, in base 10 you would not write 0000054 but instead only 54; here you apply the same except you keep one 0 and write 054. This in order not to confuse between …0…054 (written 054) and …9…954 (written 954 and equal to -46). You can even reduce if you apply the convention that leftest terms must be understood as: 1 = …0…01, …, 4 = …0…04, 5 = …9…95, …, 8 = …9…98. Examples in many bases are shown in the french version of this subpage.

Q notation
For reasons of convenience and compatibility with our current decimal system, one may choose to use an "eleventh digit Q" to replace the notation $$\dots 9$$.

I chose to use a letter, as is done in hexadecimal. I took one whose some spellings like "q" recall the number 9; I did not choose the letter G for one does not imagine that this is F + 1 = 16.

In addition, as Murakami reminded to us, Japanese people will not be surprised by this choice.

A simplified version is to consider that Q = -1, with added rules that we can and shall use this digit only once and only for the negative real, in which case it is most left digit (necessarily before the decimal point).

Hence :

-0,07 = Q,93

-0,7 = Q,3

-1 = Q

-1,4 = Q8,6

-2 = Q8

…

-10 = Q0

-11 = Q89 etc.

With this notation, all real positive are written in the usual way. As can be seen above, the Q notation is not longer than the usual one for negative real numbers; it is at most as long, and sometimes shorter.