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

[Merged by Bors] - feat(AlgebraicGeometry/EllipticCurve/Jacobian): implement equations and nonsingularity for Jacobian coordinates #9432

Closed
wants to merge 6 commits into from

Conversation

Multramate
Copy link
Collaborator

@Multramate Multramate commented Jan 4, 2024

Define a Jacobian point representative over a ring R as the type Fin 3 -> R, and its equivalence class PointClass as a quotient by the usual weighted scaling relation. Define the analogous equation and nonsingular predicates on Fin 3 -> F over a field F, and lift nonsingular to PointClass. This also has minimal API (e.g. it's missing many of the equation lemmas) as most computations should ideally be done using the affine API.

This is the first in a series of four PRs leading to #9405 and is analogous to #9416


Open in Gitpod

Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian.lean Outdated Show resolved Hide resolved
Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian.lean Outdated Show resolved Hide resolved
Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian.lean Outdated Show resolved Hide resolved
Comment on lines 221 to 228
lemma nonsingular_zero [Nontrivial R] : W.nonsingular ![1, 1, 0] :=
(W.nonsingular_iff ![1, 1, 0]).mpr ⟨W.equation_zero,
by simp; by_contra! h; exact one_ne_zero <| by linear_combination -h.1 - h.2.1⟩

lemma nonsingular_zero' [NoZeroDivisors R] {Y : R} (hy : Y ≠ 0) :
W.nonsingular ![Y ^ 2, Y ^ 3, 0] :=
(W.nonsingular_iff ![Y ^ 2, Y ^ 3, 0]).mpr ⟨W.equation_zero' Y,
by simp [hy]; by_contra! h; exact pow_ne_zero 3 hy <| by linear_combination Y ^ 3 * h.1 - h.2.1⟩
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nonterminal simps here and the behavior is a bit nonpredictable; the first simp results in ¬0 = 3 ∨ ¬1 = -1 ∨ ¬W.a₁ = 0 while the second results in ¬3 = 0 ∨ ¬Y ^ 3 = -Y ^ 3 ∨ ¬W.a₁ = 0 (the order of 3 and 0 is changed). However, if this breaks it's probably not hard to figure out what linear combination to use by inspecting the simp'd expressions. Here's a slight generalization to the second proof:

Suggested change
lemma nonsingular_zero [Nontrivial R] : W.nonsingular ![1, 1, 0] :=
(W.nonsingular_iff ![1, 1, 0]).mpr ⟨W.equation_zero,
by simp; by_contra! h; exact one_ne_zero <| by linear_combination -h.1 - h.2.1
lemma nonsingular_zero' [NoZeroDivisors R] {Y : R} (hy : Y ≠ 0) :
W.nonsingular ![Y ^ 2, Y ^ 3, 0] :=
(W.nonsingular_iff ![Y ^ 2, Y ^ 3, 0]).mpr ⟨W.equation_zero' Y,
by simp [hy]; by_contra! h; exact pow_ne_zero 3 hy <| by linear_combination Y ^ 3 * h.1 - h.2.1
lemma nonsingular_zero [Nontrivial R] : W.nonsingular ![1, 1, 0] :=
(W.nonsingular_iff ![1, 1, 0]).mpr ⟨W.equation_zero,
by simp; by_contra! h; exact one_ne_zero <| by linear_combination -h.1 - h.2.1
lemma nonsingular_zero' [IsReduced R] {Y : R} (hy : Y ≠ 0) :
W.nonsingular ![Y ^ 2, Y ^ 3, 0] :=
(W.nonsingular_iff ![Y ^ 2, Y ^ 3, 0]).mpr ⟨W.equation_zero' Y, by
simp; contrapose! hy; exact IsNilpotent.eq_zero ⟨4, by linear_combination -hy.1 - Y * hy.2.1

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the projective file, I think we can relegate this to a future PR.

@jcommelin jcommelin added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Feb 15, 2024
@Multramate Multramate added awaiting-review The author would like community review of the PR awaiting-CI and removed awaiting-author A reviewer has asked the author a question or requested changes labels Feb 19, 2024
Copy link
Contributor

@alreadydone alreadydone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian.lean Outdated Show resolved Hide resolved
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Feb 21, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Feb 21, 2024
@alreadydone
Copy link
Contributor

Thanks!
maintainer merge

Copy link

🚀 Pull request has been placed on the maintainer queue by alreadydone.

@riccardobrasca
Copy link
Member

Thanks!

bors merge

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review The author would like community review of the PR labels Feb 23, 2024
mathlib-bors bot pushed a commit that referenced this pull request Feb 23, 2024
…nd nonsingularity for Jacobian coordinates (#9432)

Define a Jacobian point representative over a ring `R` as the type `Fin 3 -> R`, and its equivalence class `PointClass` as a quotient by the usual weighted scaling relation. Define the analogous `equation` and `nonsingular` predicates on `Fin 3 -> F` over a field `F`, and lift `nonsingular` to `PointClass`. This also has minimal API (e.g. it's missing many of the `equation` lemmas) as most computations should ideally be done using the affine API.

This is the first in a series of four PRs leading to #9405 and is analogous to #9416
@mathlib-bors
Copy link

mathlib-bors bot commented Feb 23, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(AlgebraicGeometry/EllipticCurve/Jacobian): implement equations and nonsingularity for Jacobian coordinates [Merged by Bors] - feat(AlgebraicGeometry/EllipticCurve/Jacobian): implement equations and nonsingularity for Jacobian coordinates Feb 23, 2024
@mathlib-bors mathlib-bors bot closed this Feb 23, 2024
@mathlib-bors mathlib-bors bot deleted the EllipticCurve.Jacobian.Equation branch February 23, 2024 19:19
thorimur pushed a commit that referenced this pull request Feb 24, 2024
…nd nonsingularity for Jacobian coordinates (#9432)

Define a Jacobian point representative over a ring `R` as the type `Fin 3 -> R`, and its equivalence class `PointClass` as a quotient by the usual weighted scaling relation. Define the analogous `equation` and `nonsingular` predicates on `Fin 3 -> F` over a field `F`, and lift `nonsingular` to `PointClass`. This also has minimal API (e.g. it's missing many of the `equation` lemmas) as most computations should ideally be done using the affine API.

This is the first in a series of four PRs leading to #9405 and is analogous to #9416
thorimur pushed a commit that referenced this pull request Feb 26, 2024
…nd nonsingularity for Jacobian coordinates (#9432)

Define a Jacobian point representative over a ring `R` as the type `Fin 3 -> R`, and its equivalence class `PointClass` as a quotient by the usual weighted scaling relation. Define the analogous `equation` and `nonsingular` predicates on `Fin 3 -> F` over a field `F`, and lift `nonsingular` to `PointClass`. This also has minimal API (e.g. it's missing many of the `equation` lemmas) as most computations should ideally be done using the affine API.

This is the first in a series of four PRs leading to #9405 and is analogous to #9416
riccardobrasca pushed a commit that referenced this pull request Mar 1, 2024
…nd nonsingularity for Jacobian coordinates (#9432)

Define a Jacobian point representative over a ring `R` as the type `Fin 3 -> R`, and its equivalence class `PointClass` as a quotient by the usual weighted scaling relation. Define the analogous `equation` and `nonsingular` predicates on `Fin 3 -> F` over a field `F`, and lift `nonsingular` to `PointClass`. This also has minimal API (e.g. it's missing many of the `equation` lemmas) as most computations should ideally be done using the affine API.

This is the first in a series of four PRs leading to #9405 and is analogous to #9416
dagurtomas pushed a commit that referenced this pull request Mar 22, 2024
…nd nonsingularity for Jacobian coordinates (#9432)

Define a Jacobian point representative over a ring `R` as the type `Fin 3 -> R`, and its equivalence class `PointClass` as a quotient by the usual weighted scaling relation. Define the analogous `equation` and `nonsingular` predicates on `Fin 3 -> F` over a field `F`, and lift `nonsingular` to `PointClass`. This also has minimal API (e.g. it's missing many of the `equation` lemmas) as most computations should ideally be done using the affine API.

This is the first in a series of four PRs leading to #9405 and is analogous to #9416
Louddy pushed a commit that referenced this pull request Apr 15, 2024
…nd nonsingularity for Jacobian coordinates (#9432)

Define a Jacobian point representative over a ring `R` as the type `Fin 3 -> R`, and its equivalence class `PointClass` as a quotient by the usual weighted scaling relation. Define the analogous `equation` and `nonsingular` predicates on `Fin 3 -> F` over a field `F`, and lift `nonsingular` to `PointClass`. This also has minimal API (e.g. it's missing many of the `equation` lemmas) as most computations should ideally be done using the affine API.

This is the first in a series of four PRs leading to #9405 and is analogous to #9416
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer-merge ready-to-merge This PR has been sent to bors. t-algebraic-geometry Algebraic geometry t-number-theory Number theory (also use t-algebra or t-analysis to specialize)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants