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/Weierstrass): elliptic curves with specified j-invariant #5935

Closed
wants to merge 26 commits into from

Conversation

acmepjz
Copy link
Collaborator

@acmepjz acmepjz commented Jul 16, 2023

Main changes:

  • Define specific Weierstrass curves, whose j-invariants should be 0, 1728, or ≠ 0 and 1728.
  • Prove the quantities c₄, Δ and j for them (whenever they are defined).
  • Define an elliptic curve from an element j in a field, whose j-invariant is equal to j.
  • Generalize Inhabited (EllipticCurve ℚ) to Inhabited (EllipticCurve F) for any field F (computable if F has DecidableEq).

Open in Gitpod

@acmepjz acmepjz marked this pull request as ready for review July 16, 2023 10:45
Copy link
Collaborator

@Multramate Multramate left a comment

Choose a reason for hiding this comment

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

I've added some comments, mostly stylistic based on old conventions in the same file.

Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean Outdated Show resolved Hide resolved
Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean Outdated Show resolved Hide resolved
Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean Outdated Show resolved Hide resolved
Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean Outdated Show resolved Hide resolved
Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean Outdated Show resolved Hide resolved
Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean Outdated Show resolved Hide resolved
Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean Outdated Show resolved Hide resolved
Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean Outdated Show resolved Hide resolved
Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean Outdated Show resolved Hide resolved
Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean Outdated Show resolved Hide resolved
@acmepjz
Copy link
Collaborator Author

acmepjz commented Jul 18, 2023

Now I got strange error again: rw refuses to rewrite the result obtained from unitOfInvertible_val, although they look the same on the info panel.

@Multramate
Copy link
Collaborator

Now I got strange error again: rw refuses to rewrite the result obtained from unitOfInvertible_val, although they look the same on the info panel.

You will need to supply the instance argument explicitly, e.g. @unitOfInvertible _ _ _ <| invertibleNeg _.

Copy link
Collaborator

@Multramate Multramate left a comment

Choose a reason for hiding this comment

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

I finally managed to convert ofJ into term mode.

Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean Outdated Show resolved Hide resolved
Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean Outdated Show resolved Hide resolved
Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean Outdated Show resolved Hide resolved
Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean Outdated Show resolved Hide resolved
Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean Outdated Show resolved Hide resolved
Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean Outdated Show resolved Hide resolved
Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean Outdated Show resolved Hide resolved
Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean Outdated Show resolved Hide resolved
acmepjz and others added 6 commits July 19, 2023 08:12
Co-authored-by: David Kurniadi Angdinata <dka31@cantab.ac.uk>
In the general case, by adding 'Classical' and 'noncomputable', it implies a noncomputable 'DecidableEq'
@acmepjz
Copy link
Collaborator Author

acmepjz commented Jul 23, 2023

Is it a good idea to remove remaining noncomputable in this file, as many as possible, by adding DecidableEq instance (possibly in another PR)? This has a disadvantage then it introduces classical if the relevant ring does not have DecidableEq.

@Multramate
Copy link
Collaborator

Is it a good idea to remove remaining noncomputable in this file, as many as possible, by adding DecidableEq instance (possibly in another PR)? This has a disadvantage then it introduces classical if the relevant ring does not have DecidableEq.

I don't know anything about this. All I know for the inhabited instance is that we should have 37 instead of 42. 😉

@Multramate Multramate added awaiting-review The author would like community review of the PR t-number-theory Number theory (also use t-algebra or t-analysis to specialize) t-algebraic-geometry Algebraic geometry labels Jul 26, 2023
by rw [h1728, show (1728 : F) = 2 * 864 by norm_num1, h, zero_mul]
else @ofJ' _ _ j (invertibleOfNonzero h0) (invertibleOfNonzero <| sub_ne_zero_of_ne h1728)

lemma ofJ_0_of_three_ne_zero (h3 : (3 : F) ≠ 0) : ofJ 0 = @ofJ0 _ _ (invertibleOfNonzero h3) := by
Copy link
Member

Choose a reason for hiding this comment

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

What about using NeZero instead of h3? Similarly elsewhere.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good. I'll try later.

@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 Aug 1, 2023
# Conflicts:
#	Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean
@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 Aug 1, 2023
@acmepjz
Copy link
Collaborator Author

acmepjz commented Aug 1, 2023

@riccardobrasca I tried NeZero but I think the resulting code looks weird. We don't have NeZero -> Invertible automatic conversion even if it's a field. Also we don't have EqZero. So now the code is a mix of typeclass and explicit assumptions.

@riccardobrasca
Copy link
Member

@riccardobrasca I tried NeZero but I think the resulting code looks weird. We don't have NeZero -> Invertible automatic conversion even if it's a field. Also we don't have EqZero. So now the code is a mix of typeclass and explicit assumptions.

OK, no problem if it becomes a mess. Thanks!

bors merge

@bors
Copy link

bors bot commented Aug 3, 2023

Already running a review

@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 Aug 3, 2023
bors bot pushed a commit that referenced this pull request Aug 3, 2023
…th specified j-invariant (#5935)

Main changes:

- [x] Define specific Weierstrass curves, whose j-invariants should be 0, 1728, or ≠ 0 and 1728.
- [x] Prove the quantities c₄, Δ and j for them (whenever they are defined).
- [x] Define an elliptic curve from an element j in a field, whose j-invariant is equal to j.
- [x] Generalize `Inhabited (EllipticCurve ℚ)` to `Inhabited (EllipticCurve F)` for any field `F` (computable if `F` has `DecidableEq`).
@bors
Copy link

bors bot commented Aug 3, 2023

Pull request successfully merged into master.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title feat(AlgebraicGeometry/EllipticCurve/Weierstrass): elliptic curves with specified j-invariant [Merged by Bors] - feat(AlgebraicGeometry/EllipticCurve/Weierstrass): elliptic curves with specified j-invariant Aug 3, 2023
@bors bors bot closed this Aug 3, 2023
@bors bors bot deleted the acmepjz_ec_exists_j branch August 3, 2023 10:45
semorrison pushed a commit that referenced this pull request Aug 3, 2023
…th specified j-invariant (#5935)

Main changes:

- [x] Define specific Weierstrass curves, whose j-invariants should be 0, 1728, or ≠ 0 and 1728.
- [x] Prove the quantities c₄, Δ and j for them (whenever they are defined).
- [x] Define an elliptic curve from an element j in a field, whose j-invariant is equal to j.
- [x] Generalize `Inhabited (EllipticCurve ℚ)` to `Inhabited (EllipticCurve F)` for any field `F` (computable if `F` has `DecidableEq`).
semorrison pushed a commit that referenced this pull request Aug 14, 2023
…th specified j-invariant (#5935)

Main changes:

- [x] Define specific Weierstrass curves, whose j-invariants should be 0, 1728, or ≠ 0 and 1728.
- [x] Prove the quantities c₄, Δ and j for them (whenever they are defined).
- [x] Define an elliptic curve from an element j in a field, whose j-invariant is equal to j.
- [x] Generalize `Inhabited (EllipticCurve ℚ)` to `Inhabited (EllipticCurve F)` for any field `F` (computable if `F` has `DecidableEq`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

4 participants