I know that the real algebraic numbers $\mathbb A \subset \mathbb R$ form a field. I've seen this as a more theoretical result, but it's also seems nice idea to implement algebraic numbers for the computer in order to make computations more exact.
Now I wonder how could this be done? I thought of representing an algebraic number $\alpha$ as a tuple $(P,(a,b)) \in \mathbb Q[T]\times \mathbb Q^2$ such that $\alpha$ is the unique root of $P$ in $[a,b]$.
Now take for example the numbers
- $\varphi = (T^2-T-1,(\frac 3 2,2))$
- $\sqrt 2 = (T^2-2,(1,2))$
But how can I actually perform computations on this numbers?
Surely $\varphi + \sqrt 2$ lies in $(\frac 5 2, 4)$, but what polynomial's root is it? What about $\varphi \cdot \sqrt 2$? In general, given polynomials $P,Q \in \mathbb Q[T]$ with $P(x)=Q(y)=0$, how do I find some polynomial $S$ such that $S(x+y)=0$?