Hi Peter,

On 2013-12-31, Peter Bruin <pjbr...@gmail.com> wrote:
> I posted a comment at #11239,

Then perhaps I should answer there, but anyway, here it goes.

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

> 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. Think of
QQ[x]->ZZ:
  sage: a = QQ['x'](1)
  sage: ZZ(a)
  1
but
  sage: a = QQ['x'](1/2)
  sage: ZZ(a)
  <boom>

>  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.

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.

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?

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?

> 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?

> Should we leave the old conversion when there is no coercion even though 
>> that might easily to wrong mathematical results for a careless user? Or 
>> never look for a coercion unless the user explicitly asks for it (i.e. what 
>> the situation is currently in Sage without the patches of the ticket)?
>>
> I thought that conversion should always give the same result as a coercion 
> map whenever one exists; is there any (intended) situation where this is 
> not the case?

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

Best regards,
Simon


-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
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