On 14 May 2017 at 17:07, Ralf Hemmecke <[email protected]> wrote: > On 05/14/2017 07:22 PM, Bill Page wrote: >> Algebraically some choices are better than others. In particular it >> seems desirable that >> >> Q := Fraction R >> gcd(n,m) = retract gcd(n::Q, m::Q) >> >> for all n and m in R. > > Why? As a mathematician, I wouldn't expect that.
I do not understand what you mean. Why should a mathematician not expect this? It seems like a natural homomorphism to me. > And as a computer scientist, keeping that relation in general, just > means overhead in computation time. My suggestion does not add computation time to anything that calculates something useful in FriCAS as it stands right now. > So I don't see why your suggestion would be a good > choice. Perhaps what you mean is that you are not aware of any useful application for this choice? Computer science and mathematics need not always be concerned with such pragmatic issues but I will let you know if I find one. At this point all I can say is that this apparent irregularity in the definition of 'gcd' came up while I was looking into problems with groebner basis calculations discussed in another thread. > Note that (in contrast to SAGE) FriCAS has no duck typing. I am not sure what "duck typing" has to do with gcd. Sage has the same issues as FriCAS when it comes to coercion between types. > >> BTW, I neglected to include a revised definition of 'lcm' in my patch >> >> lcm(x:%,y:%):% == lcm(x.num,y.num)/gcd(x.den,y.den) >> >> since obviously we also need >> >> gcd(x,y)*lcm(x,y) = x*y (*) > > But relation (*) is exactly what is implemented in Fraction(R). > Well, yes of course the current definition of 'gcd' in FriCAS requires that lcm(x,y) == x*y. I only meant to admit that one needs to change both in order to remain consistent. -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" 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 https://groups.google.com/group/fricas-devel. For more options, visit https://groups.google.com/d/optout.
