Skip to content
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

Open
wants to merge 91 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
bb1bf7e
Implement Jacobian coordinates
Multramate Jan 2, 2024
906e858
Implement equations and nonsingularity for Jacobian coordinates
Multramate Jan 4, 2024
b9e60a1
Implement group operation polynomials for Jacobian coordinates
Multramate Jan 4, 2024
d42c841
Implement group operations on point representatives for Jacobian coor…
Multramate Jan 4, 2024
59a7cf4
Implement group operations on nonsingular rational points for Jacobia…
Multramate Jan 4, 2024
4449702
Merge branch 'EllipticCurve.Jacobian.Point' into EllipticCurve.Jacobian
Multramate Jan 4, 2024
18e2fd4
Remove extraneous factor in addition
Multramate Jan 5, 2024
04c8b01
Merge branch 'EllipticCurve.Jacobian.Polynomial' into EllipticCurve.J…
Multramate Jan 5, 2024
44f37d6
Fix merge error
Multramate Jan 5, 2024
2fdd995
Merge branch 'EllipticCurve.Jacobian.Representative' into EllipticCur…
Multramate Jan 5, 2024
8b3cc83
Fix merge error
Multramate Jan 5, 2024
640f3a4
Merge branch 'EllipticCurve.Jacobian.Point' into EllipticCurve.Jacobian
Multramate Jan 5, 2024
fa6f23d
Merge branch 'master' into EllipticCurve.Jacobian.Polynomial
Multramate Apr 1, 2024
c352856
Fix merge error
Multramate Apr 5, 2024
3f195e0
Fix merge issue
Multramate Apr 5, 2024
fa01869
Merge branch 'EllipticCurve.Jacobian.Polynomial' into EllipticCurve.J…
Multramate Apr 6, 2024
a1cb0b4
feat(EllipticCurve): a coordinate ring over a domain is a domain
alreadydone May 13, 2024
03acb6e
docstring
alreadydone May 13, 2024
332d7ba
Define the universal curve and point
alreadydone May 15, 2024
beb47d9
normEDS IsEllSequence: finish main argument
alreadydone May 18, 2024
99015a0
finish equivalence between normEDS and IsEllDivSequence & more
alreadydone May 20, 2024
617dd0a
Add API for equations and nonsingularity
Multramate May 20, 2024
830f781
Merge branch 'EllipticCurve.Jacobian.Equation' into EllipticCurve.Jac…
Multramate May 20, 2024
5dcfcc9
Merge branch 'EllipticCurve.Jacobian.Polynomial' into EllipticCurve.J…
Multramate May 20, 2024
4aa3025
Fix merge
Multramate May 20, 2024
f07d247
Fix names
Multramate May 20, 2024
98c72d4
Merge branch 'EllipticCurve.Jacobian.Representative' into EllipticCur…
Multramate May 20, 2024
e6536d4
Fix merge
Multramate May 20, 2024
434a7c2
Merge branch 'EllipticCurve.Jacobian.Point' into EllipticCurve.Jacobian
Multramate May 20, 2024
4057092
Fix merge
Multramate May 20, 2024
0bd22f0
generalize invar; lint; cleanup; golf
alreadydone May 20, 2024
24d2b1f
temp
alreadydone May 23, 2024
f7f8958
Merge remote-tracking branch 'origin/master' into DivisionPolynomial_…
alreadydone May 23, 2024
a76ce6e
Merge remote-tracking branch 'origin/EllipticCurve.Jacobian' into Div…
alreadydone May 23, 2024
99ab86d
WIP
alreadydone May 23, 2024
d3390c0
feat(Algebra): auxiliary results for proofs about elliptic divisibili…
alreadydone May 24, 2024
3dd8f9f
Allow Int.strongRec eliminate into Sort*
alreadydone May 24, 2024
6b843f7
feat(NumberTheory/EllipticDivisibilitySequence): show elliptic relati…
alreadydone May 24, 2024
28045a9
empty line
alreadydone May 24, 2024
589b163
Merge branch 'normEDS_aux' into EllNet_from_evenOdd
alreadydone May 24, 2024
e5e1648
fix
alreadydone May 24, 2024
4cbf10f
Merge branch 'master' into normEDS_aux
alreadydone May 24, 2024
d8e6a7d
Merge branch 'master' into EllNet_from_evenOdd
alreadydone May 24, 2024
c792f67
Merge branch 'master' into normEDS_aux
alreadydone May 24, 2024
13299c4
more consistent ordering of variables in rel₆_eq₃(')
alreadydone May 24, 2024
6591889
address review
alreadydone May 24, 2024
a83b24d
extra character in imports
alreadydone May 24, 2024
5c6c52e
missing `by`
alreadydone May 24, 2024
9733eeb
Merge remote-tracking branch 'origin/normEDS_aux' into EllNet_from_ev…
alreadydone May 24, 2024
2dfa330
isSwap -> swap
alreadydone May 24, 2024
022e4c6
finish reduction to universal case
alreadydone May 27, 2024
31daa86
Affine formulas
alreadydone May 27, 2024
752637f
sorry-free
alreadydone May 28, 2024
f470ddf
docstrings
alreadydone May 28, 2024
302f36f
docstrings
alreadydone May 28, 2024
0adce7b
lint: import & Mathlib.lean
alreadydone May 28, 2024
bd3b187
golfs etc.
alreadydone May 31, 2024
bdb5b9f
Discard changes to Mathlib/Data/Int/Parity.lean
alreadydone Jun 12, 2024
5fb43e0
Discard changes to Mathlib/Data/Int/Defs.lean
alreadydone Jun 12, 2024
d9af09b
Discard changes to Mathlib/GroupTheory/Perm/Sign.lean
alreadydone Jun 12, 2024
d01d949
Merge branch 'master' into EllNet_from_evenOdd
alreadydone Jun 12, 2024
87bf347
fix after merge; adjust docstrings
alreadydone Jun 12, 2024
8b71cbb
doc
alreadydone Jun 12, 2024
d0365fd
import shake (still need to be added back next PR)
alreadydone Jun 12, 2024
7c50c54
Discard changes to Mathlib/Algebra/Ring/NegOnePow.lean
alreadydone Jun 12, 2024
da06906
Discard changes to Mathlib/Data/Int/Defs.lean
alreadydone Jun 12, 2024
3ca57ad
Discard changes to Mathlib/Data/Int/Parity.lean
alreadydone Jun 12, 2024
2b9495c
Discard changes to Mathlib/GroupTheory/Perm/Sign.lean
alreadydone Jun 12, 2024
12253d6
Merge remote-tracking branch 'origin/EllNet_from_evenOdd' into Divisi…
alreadydone Jun 12, 2024
2aa1342
fix Affine
alreadydone Jun 12, 2024
a98d587
duplicated docs
alreadydone Jun 12, 2024
91f58be
rename file to DivisionPolynomial/ZSMul
alreadydone Jun 12, 2024
04d5264
fix EDS.lean
alreadydone Jun 12, 2024
b5c817e
fix Jacobian
alreadydone Jun 12, 2024
bea1fa4
fix Group
alreadydone Jun 12, 2024
2897bcb
move from ZSMul to Basic
alreadydone Jun 14, 2024
a7b5a1a
fix build
alreadydone Jun 15, 2024
35cae57
explain main proof strategy
alreadydone Jun 15, 2024
55c38c6
Bivariate -> Mathlib.lean
alreadydone Jun 15, 2024
b2b801d
headers
alreadydone Jun 15, 2024
2d66866
remove smul_fin3'
alreadydone Jun 15, 2024
29bcf60
blank line
alreadydone Jun 15, 2024
0f636cc
Universal: docstring
alreadydone Jun 15, 2024
7084d85
more docstring for ZSMul
alreadydone Jun 15, 2024
d6f6c1a
Use evalEval in Affine.lean
alreadydone Jun 15, 2024
fcde482
Use evalEval in Jacobian.lean
alreadydone Jun 15, 2024
47fab1f
fix Universal
alreadydone Jun 15, 2024
d0313f3
ZSMul.lean doc adjust
alreadydone Jun 15, 2024
c632b3f
ZSMul docs again
alreadydone Jun 15, 2024
9b65fe6
Merge branch 'DivisionPolynomial_smul' of https://github.com/leanprov…
alreadydone Jun 15, 2024
3d6da3d
docs: ZSMul & Universal
alreadydone Jun 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Mathlib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ import Mathlib.Algebra.Pointwise.Stabilizer
import Mathlib.Algebra.Polynomial.AlgebraMap
import Mathlib.Algebra.Polynomial.Basic
import Mathlib.Algebra.Polynomial.BigOperators
import Mathlib.Algebra.Polynomial.Bivariate
import Mathlib.Algebra.Polynomial.CancelLeads
import Mathlib.Algebra.Polynomial.Cardinal
import Mathlib.Algebra.Polynomial.Coeff
Expand Down Expand Up @@ -706,9 +707,11 @@ import Mathlib.Algebra.Vertex.HVertexOperator
import Mathlib.AlgebraicGeometry.AffineScheme
import Mathlib.AlgebraicGeometry.EllipticCurve.Affine
import Mathlib.AlgebraicGeometry.EllipticCurve.DivisionPolynomial.Basic
import Mathlib.AlgebraicGeometry.EllipticCurve.DivisionPolynomial.ZSMul
import Mathlib.AlgebraicGeometry.EllipticCurve.Group
import Mathlib.AlgebraicGeometry.EllipticCurve.Jacobian
import Mathlib.AlgebraicGeometry.EllipticCurve.Projective
import Mathlib.AlgebraicGeometry.EllipticCurve.Universal
import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass
import Mathlib.AlgebraicGeometry.FunctionField
import Mathlib.AlgebraicGeometry.GammaSpecAdjunction
Expand Down
7 changes: 7 additions & 0 deletions Mathlib/Algebra/MvPolynomial/PDeriv.lean
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ theorem pderiv_C_mul {f : MvPolynomial σ R} {i : σ} : pderiv i (C a * f) = C a
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_C_mul MvPolynomial.pderiv_C_mul

theorem pderiv_map {S} [CommSemiring S] {φ : R →+* S} {f : MvPolynomial σ R} {i : σ} :
pderiv i (map φ f) = map φ (pderiv i f) := by
apply induction_on f (fun r ↦ by simp) (fun p q hp hq ↦ by simp [hp, hq]) fun p j eq ↦ ?_
obtain rfl | h := eq_or_ne j i
· simp [eq]
· simp [eq, h]

end PDeriv

end MvPolynomial
73 changes: 73 additions & 0 deletions Mathlib/Algebra/Polynomial/Bivariate.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/-
Copyright (c) 2024 Junyan Xu. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Junyan Xu
-/
import Mathlib.Algebra.Polynomial.AlgebraMap

/-!
# Bivariate polynomials

This file introduces the notation `R[X][Y]` for the polynomial ring `R[X][X]` in two variables,
and the notation `Y` for the second variable, in the `PolynomialPolynomial` scope.

It also defines `Polynomial.evalEval` for the evaluation of a bivariate polynomial at a point
on the affine plane, which is a ring homomorphism (`Polynomial.evalEvalRingHom`), as well as
the abbreviation `CC` to view a constant in the base ring `R` as a bivariate polynomial.
-/

/-- The notation `Y` for `X` in the `PolynomialPolynomial` scope. -/
scoped[PolynomialPolynomial] notation3:max "Y" => Polynomial.X (R := Polynomial _)

/-- The notation `R[X][Y]` for `R[X][X]` in the `PolynomialPolynomial` scope. -/
scoped[PolynomialPolynomial] notation3:max R "[X][Y]" => Polynomial (Polynomial R)

namespace Polynomial

noncomputable section

open scoped PolynomialPolynomial

variable {R : Type*}

/-- `evalEval x y p` is the evaluation `p(x,y)` of a two-variable polynomial `p : R[X][Y]`. -/
abbrev evalEval [Semiring R] (x y : R) (p : R[X][Y]) : R := eval x (eval (C y) p)

/-- `evalEval x y` as a ring homomorphism. -/
@[simps!] abbrev evalEvalRingHom [CommSemiring R] (x y : R) : R[X][Y] →+* R :=
(evalRingHom x).comp (evalRingHom <| C y)

/-- A constant viewed as a polynomial in two variables. -/
abbrev CC [Semiring R] (r : R) : R[X][Y] := C (C r)

lemma coe_algebraMap_eq_CC [CommSemiring R] : algebraMap R R[X][Y] = CC (R := R) := rfl
lemma coe_evalEvalRingHom [CommSemiring R] (x y : R) : evalEvalRingHom x y = evalEval x y := rfl

variable {S} [CommSemiring R] [CommSemiring S]

/-- Two equivalent ways to express the evaluation of a bivariate polynomial over `R`
at a point in the affine plane over an `R`-algebra `S`. -/
lemma eval₂RingHom_eval₂RingHom (f : R →+* S) (x y : S) :
eval₂RingHom (eval₂RingHom f x) y =
(evalEvalRingHom x y).comp (mapRingHom <| mapRingHom f) := by
ext <;> simp

lemma eval₂_eval₂RingHom_apply (f : R →+* S) (x y : S) (p : R[X][Y]) :
eval₂ (eval₂RingHom f x) y p = (p.map <| mapRingHom f).evalEval x y :=
congr($(eval₂RingHom_eval₂RingHom f x y) p)

lemma eval_C_X_comp_eval₂_map_C_X :
(evalRingHom (C X : R[X][Y])).comp (eval₂RingHom (mapRingHom <| algebraMap R R[X][Y]) (C Y)) =
.id _ := by
ext <;> simp

/-- Since `R[X,Y,X']` is an `R[X']`-algebra, a polynomial `p : R[X',Y']` can be evaluated at
`Y : R[X,Y,X']` (substitution of `Y'` by `Y`), obtaining another polynomial in `R[X,Y,X']`.
When this polynomial is then evaluated at `X' = X`, the original polynomial `p` is recovered. -/
lemma eval_C_X_eval₂_map_C_X {p : R[X][Y]} :
eval (C X) (eval₂ (mapRingHom <| algebraMap R R[X][Y]) (C Y) p) = p :=
congr($eval_C_X_comp_eval₂_map_C_X p)

end

end Polynomial
Loading
Loading