On Thu, Mar 19, 2009 at 05:23:07PM +0000, Martin Albrecht wrote:
> On Thursday 19 March 2009, David Madore wrote:
> > So, is there a way in Sage to pull back an ideal by a canonical map?
> 
> Quotient rings are in a particularly bad shape in Sage, here's a hack:
> 
> sage: R.<x,y> = QQ['x','y']
> sage: I = Ideal(y^2 - x^3 - x)
> sage: Q = R.quotient(I)
> sage: p = R.hom(Q)
> sage: J = Ideal(p(y)-1)
> sage: J
> Ideal (ybar - 1) of Quotient of Multivariate Polynomial Ring in x, y over 
> Rational Field by the ideal (-x^3 + y^2 - x)
> 
> sage: I2 = Ideal([f._QuotientRingElement__rep for f in  J.gens()]) + I
> sage: I2
> Ideal (y - 1, -x^3 + y^2 - x) of Multivariate Polynomial Ring in x, y over 
> Rational Field
> 
> sage: I2.groebner_basis()
> [x^3 + x - 1, y - 1]
> 
> that should be what you want. However, f._QuotientRingElement__rep is quite 
> evil because it uses the internal representation. 

Thanks, I did something of the sort (except that since I had to define
the Q.lift() map for various reasons, I used that instead of
__QuotientRingElement__rep).

> I'd actually give it a shot to implement the NotImplementedError above but 
> I'm 
> unsure where the implementation belongs:
> 
> Not sure whether I should just patch RingHomomorphism_coercion:add a bunch of 
> type checks and then do something like the above if they pass and raise 
> NotImplementedError otherwise?

I'm not sure how relevant this is, but I notice that the map returned
by Q.cover() (where Q is the quotient ring) is printed differently
from the one returned by R.hom(Q) (it has the explicit "Defn: Natural
quotient map"): it would be quite acceptable to handle inverse_image
only for this special map returned by Q.cover() (assuming, of course,
that it is of any help).  Perhaps using Q.lift(), if it can be used.

Another case where inverse_image might be handled at perhaps little
cost is when the morphism is known to be an isomorphism.

Cheers,

-- 
     David A. Madore
   ( http://www.madore.org/~david/ )

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to