-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(EllipticCurve): ZSMul formula in terms of division polynomials #13782
base: master
Are you sure you want to change the base?
Conversation
…acobian.Representative
…ve.Jacobian.Point
…acobian.Representative
…acobian.Representative
…ve.Jacobian.Point
2061693
to
734af33
Compare
734af33
to
55c38c6
Compare
suppress_compilation in | ||
/-- The `ω` family of division polynomials: `ω n` gives the second (`Y`) coordinate in | ||
Jacobian coordinates of the scalar multiplication by `n`. -/ | ||
protected def ω (n : ℤ) : R[X][Y] := | ||
redInvarDenom W.ψ₂ (C W.Ψ₃) (C W.preΨ₄) n * | ||
((CC W.a₁ * polynomialY W - polynomialX W) * C W.Ψ₃ | ||
+ 4 * polynomial W * (2 * polynomial W + C W.Ψ₂Sq)) | ||
- compl₂EDSAux W.ψ₂ (C W.Ψ₃) (C W.preΨ₄) n + negPolynomial W * W.ψ n ^ 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is suppress_compilation
just the same as tagging noncomputable
?
Anyways, I'm wondering if it's possible to extract a version of ω
that very close to being a univariate polynomial, i.e. Ω
for ω
analogous to Ψ
for ψ
, where Ω
is some univariate polynomial times a constant (2?) multiple of ψ
. This way the ZSmul
formula can be expressed in affine coordinates as n • (x, y) = (f(x), g(x) * h(x, y))
for some univariate rational functions f
and g
and some bivariate polynomial h
, mirroring Sutherland's statement in Lemma 5.21. When a₁
and a₃
are zero, then there should be a way to define Ω
so that h(x, y)
is just y
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll see what I can do with ω.
Lean is sometimes slow to compile something computable or fails to compile due to incomplete support. Verifying computability seems to always be fast though, so there should never be a need to mark a computable def noncomputable
. To deal with slow compilation people have invented suppress_compilation
and that's what we should use instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not yet sure what could be done for ω
; the best idea I have is to take the expression
(first posted on Zulip, here I removed the multiple of polynomial
) and try to analyze the even n and odd n cases separately. You can always write it as p(X)+Yq(X)
in a unique way and maybe you will be able to compute the degrees of p(X)
and q(X)
.
An inadvertent discovery: when I tried to derive negDblY
from ψ₃ polynomialX + Y polynomialY^3
. Comparing this with what we have in mathlib we arrive at the identity ψ₃ + polynomialX^2 - a1 polynomialX polynomialY - (3x + a2) polynomialY^2 + (12 x + b2) polynomial = 0
. In my notes I've explained that dblX
can be taken to be X polynomialY^2 - ψh₃
where ψh₃
is the weighted homogenization of ψ₃
. This new discovery shows that negDblY
can be taken to be Y polynomialY^3 + ψh₃ polynomialX
which is of a similar form. TODO: use this to simplify the expressions here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the identities. I guess we'd have to either redefine ψh₃
recursively, or get the homogenisation API working and apply it to the existing ψ₃
. It's probably not too urgent now but we should do it eventually.
The reason I'm asking for Ω
is because I need Sutherland's argument for Theorem 5.8 to finish the computation for |E[n]| = n^2
. We can translate that theorem into division polynomial language, and he essentially relates |E[n]|
to the number of roots of ψ²
(as a univariate polynomial), by showing that the fibers (x₀, y₀)
of multiplication by n
(after shifting 0
to a suitable point (a, b)
) are uniquely determined by x₀
, and we can show this easily if we have an expression for ω
directly in terms of y
. The same argument happens to also work to show that multiplication by n
is surjective (the "standard" proof to this is a non-trivial fact about morphisms of curves).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's a need to define the whole family ψh
recursively (which I think is what you mean); in any case ψh₃
will be one of the base cases, so it either needs to be directly written down, or obtained from ψ₃
via homogenization API.
I'll read Sutherland to understand what is really needed.
The formula$[n]P = (\phi_n(x,y) : \omega_n(x,y) : \psi_n(x,y))$ in Jacobian coordinates for $P=(x,y)$ a nonsingular point on a Weierstrass/elliptic curve.