Hello My question is connected with file http://modular.fas.harvard.edu/ent/ent_py and especially with checking the associativity law of addition on ell. curves. When I was trying to perform the same calculations in Sage I observed some surprising (me) behaviour. Enclosed is the corresponding Sage code.
# the first 12 lines of code is modyfied version of # http://modular.fas.harvard.edu/ent/ent_py # necessary changes seem to be inessential x1 = var('x1'); x2 = var('x2'); x3 = var('x3') y1 = var('y1'); y2 = var('y2'); y3 = var('y3') a = var('a'); b = var('b') lambda12 = (y1 - y2)/(x1 - x2) x4 = (lambda12*lambda12 - x1 - x2) nu12 = (y1 - lambda12*x1) y4 = (-lambda12*x4 - nu12) lambda23 = ((y2 - y3)/(x2 - x3)) x5 = (lambda23*lambda23 - x2 - x3) nu23 = (y2 - lambda23*x2) y5 = (-lambda23*x5 - nu23) s1 =(x1 - x5)*(x1 - x5)*((y3 - y4)*(y3 - y4) - (x3 + x4)*(x3 - x4)*(x3 - x4)) s2 = (x3 - x4)*(x3 - x4)*((y1 - y5)*(y1 - y5) - (x1 + x5)*(x1 - x5)*(x1 - x5)) #the code below looks reasonable but gives wrong result; I wonder why? t1=s1.factor() t2=s2.factor() R=QQ[x1,x2,x3,y1,y2,y3] print R(t1.denominator())==R(t2.denominator()) # True #denominators of s1,s2 are equal, so let's compare numerators print R(t1.numerator())==R(t2.numerator()) # False (in Sage 2.9) I would be grateful for any comments. Is there an easy way to check the mentioned associativity in Sage? A. Chrzeszczyk --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/ -~----------~----~----~----~------~----~------~--~---