Hi Simon,

Warning: I am partially playing "advocatus diavoli" here. 
>

That can be very useful!
 

> > so let me just say here that I think this 
> > principle (that conversions need not be canonical) shouldn't be pushed 
> > further than reasonable. 
>
> Yes, but for a rather relaxed notion of "reasonable". For example, you 
> couldn't even say that you have a "conversion from K[x]/(f) to 
> K[x]/(g)", since a conversion is not a map. It is a *partial* map, 
> hence, it often is the case that only polynomials of degree zero can be 
> converted and higher degree polynomials result in an error. 
>

Sure, that still counts as reasonable for me.
 

> >  For example, if K is a field and f, g in K[x] are 
> > polynomials, then applying a conversion K[x]/(f) -> K[x]/(g) is a 
> sensible 
> > thing to do if g divides f (the canonical map) or if f divides g (the 
> > lifting map).  However, I don't see why it is important to insist that 
> the 
> > composition of two such maps (e.g. K[x]/(f) -> K[x] -> K[x]/(g) when f, 
> g 
> > have nothing to do with each other) should again be a valid conversion 
> that 
> > can be invoked with the same ease. 
>
> Hang on. Nobody says that the composition of two conversions A->B and 
> B->C yields a conversion A->C (even if we forget for the moment that 
> conversions are not more than partially defined maps)! Composibility 
> is an axiom for *coercions*, but not for *conversions*. Actially 
> conversion 
> have no axioms worth mentioning. 
>

Yes, I shouldn't have said "insist" above, maybe "suggest".  I don't know 
if the fact that we have maps K[x]/(f) -> K[x]/(g) for arbitrary f, g (or 
Z/mZ -> Z/nZ for arbitrary m, n) was intended or just a side effect of not 
doing any checks and just doing conversions if the implementation allows 
it.  However, I'm really not convinced that it is easy for the average user 
to avoid the idea that such conversions apparently have some mathematical 
meaning, just because Sage makes it so easy to do these conversions.

Hence, it would be perfectly fine to have K[x]/(f)->K[x] and 
> K[x]->K[x]/(g) for *all* elements of the involved rings, but 
> no conversion from K[x]/(f)->K[x]/(g), or actually: Only conversion for 
> polynomials of degree zero.
>

Yes, that is more or less what I wanted to say.
 

> That said, do you really think one should do more or less expensive 
> operations (such as: compute gcd or a prime factorisation) to 
> verify that an easy conversion rule makes sense in a particular case? 
>

I don't know of an example where one has to do such expensive things; in 
the above examples, it is just a divisibility check.  In the examples of 
K[x]/(f) and Z/mZ, this divisibility check does look like a good sanity 
check to me.

You say it should not be pushed further than reasonable. Is it reasonable 
> to have an expensive test to decide whether or not to apply an easy 
> conversion rule? Recall: Coercions should obey axioms and thus expensive 
> tests may be needed. But why should one have expensive tests for something 
> that has no defined properties? How *could* you possibly test something 
> that has no defined properties?
>

It depends on how expensive the test is.  If I may play the devil's 
advocate for a moment: why would you want to *use* something that has no 
defined properties?
 

> > Hence I think that R(h), for R = 
> > K[x]/(g) and h in L[x]/(f), should only be allowed when K has a 
> canonical 
> > map to L and either f divides g (in L[x]) or vice versa. 
>
> Do you claim we should drop conversion entirely? After all, we also have a 
> *coercion* system, and coercions (as opposed to conversions) are supposed 
> to 
> be mathematically consistent. Do you think this would be reasonable? 
>

No, I am certainly not suggesting that conversion should go away.  Using 
conversion to find preimages in the maps Z -> Z/mZ or K[x] -> K[x]/(f) is 
something that makes a lot of sense.  But when it comes to being maximally 
permissive in allowing conversions (allowing for example direct conversions 
Z/3Z -> Z/2Z): despite some arguments for it (less checking, allowing 
people who really want to do that to save a few keystrokes) I don't see why 
it is a good thing.

If there is a coercion map then conversion must give the same result. 
> Everything else would be a bug.
>

At least there is no misunderstanding about that!

Best regards,

Peter

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to