I've written some code for Sage to compute radical ideals and primary decompositions over $\overline{Q}$ (the field of algebraic numbers), and I'm not sure if it's right.


Since Singular (the underlying engine) can work with number fields but not $\overline{Q}$, the idea is to convert the base ring into a number field that's large enough to factor the ideal's generators, perform the calculation with Singular, then convert back.


For example, let's say we're trying to compute the primary decomposition of $(x^2+y^2)$ in $\overline{Q}[x,y]$. Since $x^2+y^2$ factors as $(x+iy)(x-iy)$, we construct the number field $Q(\alpha)$, where $\alpha^2=-1$, calculate the primary decomposition of $(x^2+y^2)$ in $Q(\alpha)[x,y]$, get $(x+\alpha y)\cap(x-\alpha y)$, then convert back to $\overline{Q}[x,y]$ and return $(x+iy)\cap(x-iy)$.


I think it's pretty straightforward for a principal ideal, but the question is whether a number field that factors an ideal's generators is suitable, in all cases, for computing radical ideals and primary decompositions.


I've been reading up on the various algorithms used to compute radicals and primary decompositions, but haven't managed to convince myself one way or the other whether this idea actually works.


Can somebody help me either prove it or refute it? If it works, then we'll get this code into Sage. If it doesn't work, then I'll rip this part of the code out and we'll at least get polynomial factorization over $\overline{Q}$ into Sage.


Thanks.



Is this algorithm for primary decomposition correct?
(Just making an answer out of the above comment, with a small modification.) I think this will have problems if the ideal's generators don't factor at all. For example, for an ideal like
$$
 (y^2 - x^3 , 200(x-1)^2 - (y+2)^3 ),
$$
the generators don't factor at all. (Graphing these curves shows that they are cusps. They visibly cross at five real points in the rectangle $0 \leq x \leq 7$, $-2 \leq y \leq 16$. The other four intersection points are apparently not real.) (A homogeneous version of the same ideal is $(y^2z-x^3, 200(x-z)^2z - (y+2z)^3$.)


