[sage-support] Irreducibility of a polynomial

2010-01-29 Thread Santanu Sarkar
How one can check weather a polynomial f(x,y) is irreducible over rational
or not?

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Irreducibility of a polynomial

2010-01-29 Thread William Stein
On Fri, Jan 29, 2010 at 5:06 AM, Santanu Sarkar
sarkar.santanu@gmail.com wrote:
 How one can check weather a polynomial f(x,y) is irreducible over rational
 or not?



sage: R.x,y = QQ[]
sage: f = (x^3-x*y+y^2-x)*(x^5-3/2*x-y); f
x^8 - x^6*y + x^5*y^2 - x^6 - 3/2*x^4 - x^3*y + 3/2*x^2*y - 1/2*x*y^2
- y^3 + 3/2*x^2 + x*y
sage: f.factor()
(1/2) * (x^3 - x*y + y^2 - x) * (2*x^5 - 3*x - 2*y)
sage: len(f.factor())
2

We should have len(f.factor()) == 1 when f is irreducible.

I'm skeptical that the above function is provably correct, by the way,
since it calls singular, and I don't trust singular's factor function,
personally...

William

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Irreducibility of a polynomial

2010-01-29 Thread Robert Bradshaw

On Jan 29, 2010, at 11:55 AM, William Stein wrote:


On Fri, Jan 29, 2010 at 5:06 AM, Santanu Sarkar
sarkar.santanu@gmail.com wrote:
How one can check weather a polynomial f(x,y) is irreducible over  
rational

or not?




sage: R.x,y = QQ[]
sage: f = (x^3-x*y+y^2-x)*(x^5-3/2*x-y); f
x^8 - x^6*y + x^5*y^2 - x^6 - 3/2*x^4 - x^3*y + 3/2*x^2*y - 1/2*x*y^2
- y^3 + 3/2*x^2 + x*y
sage: f.factor()
(1/2) * (x^3 - x*y + y^2 - x) * (2*x^5 - 3*x - 2*y)
sage: len(f.factor())
2

We should have len(f.factor()) == 1 when f is irreducible.

I'm skeptical that the above function is provably correct, by the way,
since it calls singular, and I don't trust singular's factor function,
personally...


To check if f (or one if its factors) is actually irreducible one  
could find a specialization down one variable that is irreducible (I  
think the univariate case uses Pari).


sage: f = R.random_element() + R.random_element(5)
sage: len(f.factor())
1
sage: g = QQ['x'](f.subs(y=5))
sage: g.is_irreducible()
True

- Robert

--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org