Ask Your Question

Intersection of polynomial Ideals over $\mathbb{R}$

asked 2019-04-18 17:35:35 +0200

Legh gravatar image

updated 2019-04-18 18:06:06 +0200

I am trying to compute the intersection of Ideals over $\mathbb{R}[x,y]$, but I get problems from the coefficient $\frac{1}{\sqrt{2}}$. This is my code:








and this is the error I get:

TypeError: Intersection is only available for ideals of the same ring.

So when I ask if

I5 in R

the answer is False. I also tried with QQbar but same result, can someone explain this? Thanks!

EDIT: I also tried with $\frac{\sqrt{2}}{2}$ instead of $\frac{1}{\sqrt{2}}$ and I get the same error.

edit retag flag offensive close merge delete


I fixed the block quoting. Not sure why you were having trouble.

Iguananaut gravatar imageIguananaut ( 2019-04-18 17:56:28 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-04-18 18:26:07 +0200

Iguananaut gravatar image

updated 2019-04-19 17:00:27 +0200

You can check what ring each ideal is in like I5.ring(). In this case I get Symbolic Ring. Presumably it converts to this because Sage treats sqrt(2) as an exact symbolic expression and does not presume to convert it to something less precise even if you use it in an expression with variables like x and y that are in your ring on RR. (In this case I feel like it should be able to do just what you clearly mean, but I'm not expert-enough on this to know if there's really a better way to do this unambiguously). One way (of several) to fix this would be to use the .ideal method on your ring like R.ideal([(x^2+y^2-1),(x*y),(y^3-y)]). This ensures that each of the generators can be converted to an element of your ring. I get:

sage: I5 = R.ideal([x-1/sqrt(2),y-1/sqrt(2)])
sage: I5
Ideal (x - 0.707106781186548, y - 0.707106781186548) of Multivariate Polynomial Ring in x, y over Real Field with 53 bits of precision

And so on.

Unfortunately when I try to take the intersection I get an exception:

TypeError: Cannot call Singular function 'intersect' with ring parameter of type '<class 'sage.rings.polynomial.multi_polynomial_ring.MPolynomialRing_polydict_domain_with_category'>'

If I try things like:

sage: R.<x,y>=PolynomialRing(RR,order='lex',implementation='singular')

I get:

NotImplementedError: polynomials over Real Field with 53 bits of precision are not supported in Singular

which is strange because the Singular docs seem to say so.

I'm not an algebraicist or even a mathematician at all so I'm in over my head, but maybe you can try using a number field ( $\mathbb{Q}$ extended by $\sqrt 2$)? It certainly gives an answer which AFAICT should be just as applicable if $ x $ and $ y $ are real. I'm just not sure if it's the one you're looking for. Perhaps it would help if you gave more details about the specific problem you're trying to solve:

sage: F.<sqrt2> = NumberField(x^2 - 1/2)
sage: F
Number Field in sqrt2 with defining polynomial x^2 - 1/2
sage: R.<x,y> = PolynomialRing(F, order='lex')
sage: R
Multivariate Polynomial Ring in x, y over Number Field in sqrt2 with defining polynomial x^2 - 1/2
sage: I = R.ideal([(x^2+y^2-1),(x*y),(y^3-y)])
sage: I5 = R.ideal([x-1/sqrt2,y-1/sqrt2])
sage: I6 = R.ideal([x+1/sqrt2,y-1/sqrt2])
sage: I7 = R.ideal([x+1/sqrt2,y+1/sqrt2])
sage: I8 = R.ideal([x-1/sqrt2,y+1/sqrt2])
sage: I.intersection(I5, I6, I7, I8)
Ideal (2*y^5 - 3*y^3 + y, 2*x*y^3 - x*y, x^2 + y^2 - 1) of Multivariate Polynomial Ring in x, y over Number Field in sqrt2 with defining polynomial x^2 - 2

Hopefully someone with more expertise in this problem area can give a better answer.

edit flag offensive delete link more


Thanks for your answer, i see what is happening with the $\sqrt{2}$, hope someone can help me solve the intersection problem.

Legh gravatar imageLegh ( 2019-04-18 19:21:51 +0200 )edit

Working over the rationals (QQ) works, but of course then you don't have $\sqrt{2}$. Can you for now get away with working over QQ and replacing the last four ideals with $(x^2-1/2)$ and $(y^2-1/2)$?

John Palmieri gravatar imageJohn Palmieri ( 2019-04-18 19:36:36 +0200 )edit

No, I can't. Thanks for the concern but I'd like to solve the problem, not go around it. I'm sure there is a way to work with intersections and Groebner basis of ideals over the Real numbers field

Legh gravatar imageLegh ( 2019-04-18 20:49:10 +0200 )edit

See updated answer, in case it's of any use.

Iguananaut gravatar imageIguananaut ( 2019-04-19 16:56:41 +0200 )edit

Thanks, I actually finished the task I needed this for using something else, so now this just a curiosity to me. You are right $\mathbb{Q}$ extended by $\sqrt{2}$ could give a useful answer, but since this is not vital to me anymore I don't have a reason to try. I'll just leave the post here to see if someone has an answer to this problem, if possible. To be honest at this point I'm not sure anymore there is one, since this morning I tried to do the same thing using python and didn't work out. Thanks again.

Legh gravatar imageLegh ( 2019-04-19 20:01:15 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2019-04-18 17:29:09 +0200

Seen: 695 times

Last updated: Apr 19 '19