Hi Mark, On 2012-03-31, Mark Shimozono <msh...@math.vt.edu> wrote: > However if all coercion maps involved are injective then > can't I expect == to be preserved?
Why do you think that all coercions are injective? The coercion from ZZ to GF(2) is certainly not injective. Generally, it is required that coercions are morphisms (in some appropriate category, here: Category of rings). They need to be "unique" (there is at most one coercion from one ring to another). The identity morphism always is a coercion. And the composition of two coercion morphism is a coercion morphism. It would of course be difficult (or perhaps impossible) to prove that the system of coercion maps in Sage really follows the axioms above. Introducing additional coercions can involve a lot of trouble, though. > Since the coercion from S to FractionField(R) > is injective, the pushout must necessarily be > FractionField(R). Here is the problem: sage: S.<x> = LaurentPolynomialRing(QQ) sage: R = S.polynomial_ring() sage: K = R.fraction_field() sage: K.has_coerce_map_from(S) False There are two possibilities: Either the "obvious" embedding of S into K would create problems with the axioms above. Probably it is fine. Or it was forgotten to teach Sage that it is fine. Note that conversion from S to K is implemented: sage: K(x) x sage: K(1/x) 1/x So, the only problem is that Sage does not think (yet) that this conversion qualifies as coercion. I am not sure how to fix it. The first one might think of is the method K._coerce_map_from_: This is where the existence of basic coercion maps is defined. However, K is a generic fraction field - it would be very bad style to have tests for "Laurent polynomial rings" in a very general method. More advanced would be to implement the functionality in the so-called construction functors. I am not going into details. And my favourite solution would be: The fraction field of a polynomial ring over a ring R should be a Laurent polynomial ring over the fraction field of R. That is similar to what I attempted in the ticket I mentioned (but this is for power series rings, not for polynomial rings). Conclusion: * I suggest to override the fraction_field() method for polynomial rings. * That would solve the problem without introducing more coercions. > The problem occurs when the Laurent polynomial ring unit element > is factored! Well, if factorisation isn't implemented then it isn't implemented - unit or not unit doesn't matter, then. Cheers, Simon -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org