Bonsoir again,

2015-01-25 21:48 UTC+01:00, Bruno Grenet <bruno.gre...@gmail.com>:
> Le 25/01/2015 21:26, Vincent Delecroix a écrit :
>> Hello Bruno,
>>
>> Thanks for your answer.
>>
>>>> PS: On a related note, the following looks very wrong to me
>>>> {{{
>>>> sage: x = polygen(ZZ)
>>>> sage: (x+2).gcd(x+4)
>>>> 1
>>>> }}}
>>> Why does it look wrong to you? In ZZ[x], (x+2) and (x+4) are two
>>> irreducible monic polynomials, so their GCD is 1. Or I am missing
>>> something...
>> I forgot
>> {{{
>> sage: (x+2).xgcd(x+4)
>> (2, -1, 1)
>> }}}
>> The thing is that they have no common factor but (x+2, x+4) is not
>> ZZ[x]. Subtlety between PID and UFD, isn't it? What should we do in
>> that case?
>
> I am quite reluctant for (x+2).gcd(x+4) to return 2 since to my mind (I
> haven't checked references yet), the GCD of two elements should divide
> both of them. So in this case, I think I prefer gcd and xgcd not the
> return the same result. Yet it is not a strong opinion...

Af course the gcd is what it is and you can not change that.
(x+2).gcd(x+4) = 1 is what it should be.

> I'll try to have a look to some references to see how they usually
> define the GCD and the Bézout coefficients for non-PIDs.

In Sage it is explicitely written that xgcd (for non-PID cases) will
not return the gcd as first argument in general.

New question: for PID, do we have a usecase where gcd and xgcd should not agree?

Vincent

-- 
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/d/optout.

Reply via email to