6

Say you want to represent the rational numbers in a computer. This is quite easy, you can think of them as pairs of integers. It is also easy to develop algorithms for adding, subtracting, multiplying and dividing rational numbers. Can something similar be done for algebraic numbers?

To be specific this is what I'm looking for:

For each algebraic number there should be at least 1 way to represent it using a finite list of symbols. It is fine if there are multiple ways to represent a given algebraic so long as there is at least 1. This is similar to how there are many ways to represent the rational number 1/3. it could also be written 2/6 or 3/9.

There should exist an algorithm A1 such that for any 2 algebraic numbers a and b, A1(a,b) returns true if a=b or false if a≠b. This would be analogous to determining if 2 rational numbers are equal by multiplying each numerator by the others denominator and comparing the results.

There should exist an algorithm A2 such that for any 2 algebraic numbers a and b, A2(a,b) returns a representation of their sum. Similarly for multiplication. Also there should exist an algorithm that given an algebraic number, it returns its additive inverse and another that returns its multiplicative inverse (assuming its not 0 or equivalent to 0).

Also, given a polynomial with algebraic coefficients there should exist an algorithm that returns a list of roots of the polynomial.

Finally, I'm not too concerned about the time-complexity of the algorithms, naturally a faster set of algorithms would be better however I'm really just interested in seeing if this is at all possible as I have been unable to come up with any way of doing this myself.

Thanks

Mathew
  • 1,894

1 Answers1

9

Represent an algebraic number $a$ by a finite list of integers and two rational numbers. The integers are the coefficients of a polynomial that has $a$ as a root, and the two rational numbers are the bounds of an interval that contains exactly one distinct root of the polynomial. The interval bounds are mutable and can be changed to shrink the interval on demand to compute the number to arbitrary precision. The required operations work like this:

  • To test whether $a=b$, compute $a-b$ and check whether the associated interval contains $0$ and the associated polynomial, evaluated at $0$, yields $0$.
  • To compute $-a$, flip the sign of the coefficients of odd order terms in the polynomial and negate the interval bounds.
  • To compute $a^{-1}$, shrink the interval until both bounds have the same sign, which is possible if $a\neq 0$. Then, reverse the order of coefficients of the polynomial and invert the interval bounds.
  • To compute $a\cdot b$, use the fact that each polynomial is the characteristic polynomial of a matrix, that is, its roots are the eigenvalues of that matrix, and that the eigenvalues of the tensor product $A \otimes B$ of two matrices $A, B$ are all possible products of the pairs of eigenvalues of $A$ and $B$, so $a\cdot b$ will be among the eigenvalues (This is obvious for upper triangular matrices, and every matrix is similar to an upper triangular matrix in the algebraic closure of the ring of matrix elements). To go from polynomials to matrices, you can use the companion matrix, and for the other direction you can take the characteristic polynomial of a matrix $A$, which is $\det (A-xI)$, by doing an LU/f decomposition of the matrix of polynomials that is $A-xI$ ("LU/f" is what I call a LU decomposition that avoids divisions by the pivot element when eliminating subdiagonal entries by way of multiplying the lower row with the pivot element instead of dividing the pivot row, accumulating the factors from all these multiplications in a variable $f$. The determinant is then $\frac{\det L \cdot \det U}{f}$.) To determine the interval bounds of $a\cdot b$, shrink the interval bounds of $a$ and $b$ until the interval bounding the possible products of pairs of numbers from both intervals contains only one (possibly multiple) root of the polynomial for ($a\cdot b$).
  • Computing $a+b$ works similarly, only that the operation on the matrices is $A\otimes I + I \otimes B$, instead of $A\otimes B$. Again, that this works is obvious with upper triangular matrices, because they have all their eigenvalues right there on the diagonal. To determine the interval bounds of $a+b$, you may again have to shrink the operand's interval bounds.

So far, my answer is missing one essential and one inessential ingredient. I'm referring to Wikipedia for these ingredients, as I haven't looked at the algorithms found there in detail yet. The missing ingredients are:

  • How to determine if an interval contains zero, one or more different roots of a polynomial. This is essential for shrinking the interval in such a way that it still contains the root, and for knowing when to stop shrinking the operand's intervals when doing addition and multiplication. Relevant Wikipedia article. If you want complex algebraic numbers, it's probably natural to use rectangles or circles instead of intervals.
  • To avoid multiple roots (which complicate the shrinking process) and unnecessary blowup of the polynomials, after each addition and multiplication the polynomial should be simplified to be the minimal polynomial of the result. To do this, factorize it and only keep one of the lowest degree factors among those that have a root in the interval. Relevant Wikipedia article
  • 1
    Another operation of interest is one you did not mention in your question: since the algebraic numbers are algebraically closed, each root of a polynomial with algebraic coefficients is also a root of another polynomial with integer coefficients. See this question. This would for example enable taking square- and other roots of algebraic numbers. – Benjamin Berger Mar 12 '19 at 01:33
  • Very nicely explained! – Jair Taylor Mar 12 '19 at 01:53
  • Note that if you're using minimum polynomials the equality test can be simplified: two numbers are equal iff they have the same minimum polynomial and their ranges overlap. – Peter Taylor Jul 31 '19 at 15:26