I think this computation (in the quotient ring) makes sense even if
the ideal is not prime. I had already tried to do it that way, but
failed.
However I am not quite convinced that verifying P1+(P1+P3)==(P1+P2)+P3
is genuinely proving anything! Since in the implementation of
elliptic curve addition, it may well be that commutativity and/or
associativity are implicitly assumed.
I tried doing this in Magma some time ago, using something like David
Harvey's code. I longed for a function GenericPoint() for a curve, so
that for example
(x1,y1)=E.GenericPoint()
would return a point where x1,y1 live in the function field k(x1,y1)
of the curve. In fact I did manage to do that in Magma, but had
problems then trying to define a second *independednt* generic point,
since in Magma there is only ever *one* univariate polynomial ring
over any given field. To get a second generic point I had to make a
base change of the curve from k (the proginal ground field) to the
function field k(x1,y1), and then define a second point (x2,y2) such
that k(x1,y1){x2,y2) is the function field of the curve over k(x1,y1).
I think I was then able to verify commutativity....but chickened out
before going up another level to get a third point.
There may be a better way of doing all that in Magma than I was doing,
and I'm not sure that I care now. But I think it would be really
useful if in Sage we could define a GenericPoint for a curve, in such
a way that subsequent calls to it returned independent generic points.
Does anyone think that might be possible?
John
On 15/01/2008, David Harvey <[EMAIL PROTECTED]> wrote:
>
> (moved over from sage-support...)
>
> On Jan 14, 2008, at 10:28 PM, David Harvey wrote:
>
> > What would be *really* nice is if we could work directly in the
> > fraction field of the quotient of R.<x1,y1,x2,y2,x3,y3,a,b> by the
> > appropriate ideal. (Does that even make sense? Is the ideal prime?) I
> > tried to do this but Sage gave up pretty quickly on me. A nice encore
> > would be to do this using Sage's elliptic curve class to do the
> > actual arithmetic. After all EllipticCurves can be defined over any
> > field....
> >
> > Here's my dream session:
> >
> > sage: R.<x1,y1,x2,y2,x3,y3,a,b> = QQ[]
> > sage: I = R.ideal(y1^2 - x1^3 - a*x1 - b, y2^2 - x2^3 - a*x2 - b,
> > y3^2 - x3^3 - a*x3 - b)
> > sage: S = FractionField(R.quotient(I)) # currently barfs
> > sage: E = EllipticCurve(S, [a, b])
> > sage: P1 = E(x1, y1)
> > sage: P2 = E(x2, y2)
> > sage: P3 = E(x3, y3)
> > sage: (P1 + P2) + P3 == P1 + (P2 + P3)
> > True
>
> Ha ha ha I can almost make this work.
>
> I edited sage/rings/ideal.py so that is_prime() always returns True
> and is_maximal() function always returns False (not a good long-term
> solution.....)
>
> Then:
>
> sage: R.<x1,y1,x2,y2,x3,y3,a,b> = QQ[]
> sage: I = R.ideal(y1^2 - x1^3 - a*x1 - b, y2^2 - x2^3 - a*x2 - b,
> y3^2 - x3^3 - a*x3 - b)
> sage: S = FractionField(R.quotient(I))
> sage: S
> Fraction Field of Quotient of Multivariate Polynomial Ring in x1, y1,
> x2, y2, x3, y3, a, b over Rational Field by the ideal (-x1^3 + y1^2 -
> x1*a - b, -x2^3 + y2^2 - x2*a - b, -x3^3 + y3^2 - x3*a - b)
> sage: E = EllipticCurve(S, [a, b])
> sage: E
> Elliptic Curve defined by y^2 = x^3 + abar*x + bbar over Fraction
> Field of Quotient of Multivariate Polynomial Ring in x1, y1, x2, y2,
> x3, y3, a, b over Rational Field by the ideal (-x1^3 + y1^2 - x1*a -
> b, -x2^3 + y2^2 - x2*a - b, -x3^3 + y3^2 - x3*a - b)
> sage: P1 = E(x1, y1)
> sage: P1
> (x1bar : y1bar : 1)
> sage: P2 = E(x2, y2)
> sage: P3 = E(x3, y3)
> sage: P1 + P2
> ((x1bar^2*x2bar + x1bar*x2bar^2 - 2*y1bar*y2bar + x1bar*abar +
> x2bar*abar + 2*bbar)/(x1bar^2 - 2*x1bar*x2bar + x2bar^2) :
> (-3*y1bar^3*x2bar^2 + x1bar^2*y1bar^2*y2bar +
> x1bar*y1bar^2*x2bar*y2bar - 5*y1bar^2*x2bar^2*y2bar +
> 5*x1bar^2*y1bar*y2bar^2 - x1bar*y1bar*x2bar*y2bar^2 -
> y1bar*x2bar^2*y2bar^2 + 3*x1bar^2*y2bar^3 -
> 6*x1bar^2*y1bar*x2bar*abar + 9*x1bar*y1bar*x2bar^2*abar -
> 9*x1bar^2*x2bar*y2bar*abar + 6*x1bar*x2bar^2*y2bar*abar -
> y1bar^3*abar + 2*y1bar^2*y2bar*abar - 2*y1bar*y2bar^2*abar +
> y2bar^3*abar + x1bar*y1bar*abar^2 + 2*y1bar*x2bar*abar^2 -
> 2*x1bar*y2bar*abar^2 - x2bar*y2bar*abar^2 - 9*x1bar^2*y1bar*bbar +
> 9*x1bar*y1bar*x2bar*bbar - 9*x1bar*x2bar*y2bar*bbar +
> 9*x2bar^2*y2bar*bbar + 3*y1bar*abar*bbar - 3*y2bar*abar*bbar)/
> (x1bar^2*y1bar^2 - 5*x1bar*y1bar^2*x2bar + 10*y1bar^2*x2bar^2 -
> 10*x1bar^2*y2bar^2 + 5*x1bar*x2bar*y2bar^2 - x2bar^2*y2bar^2 +
> 15*x1bar^2*x2bar*abar - 15*x1bar*x2bar^2*abar - y1bar^2*abar +
> y2bar^2*abar + x1bar*abar^2 - x2bar*abar^2 + 9*x1bar^2*bbar -
> 9*x2bar^2*bbar) : 1)
> sage: Q1 = (P1 + P2) + P3
>
> .... but then it chickens out. Sage thinks for about 90s, chews up
> 400MB RAM, then singular takes over and just sits there for a while.
> Maybe it's doing a multivariate gcd somewhere? Dunno. Funny thing is
> that singular doesn't use much memory at all. I killed it after 10
> minutes. Any ideas?
>
> david
>
>
> >
>
--
John Cremona
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---