Skip to content

Elliptic curve definitions bridging LMFDB knowls to Lean - #71

Open
JaneShi99 wants to merge 13 commits into
CBirkbeck:mainfrom
JaneShi99:formalize/ec-defs
Open

Elliptic curve definitions bridging LMFDB knowls to Lean#71
JaneShi99 wants to merge 13 commits into
CBirkbeck:mainfrom
JaneShi99:formalize/ec-defs

Conversation

@JaneShi99

Copy link
Copy Markdown

Adds Lean definitions to LeanBridge/ForMathlib/4-EC.lean for LMFDB elliptic-curve knowls (blueprint chapter 4) that are not yet in mathlib, written in mathlib style.

What's added

  • Reduction types (over a DVR): IsAdditiveReduction, IsMultiplicativeReduction,
    IsBadReduction, IsPotentialGoodReduction, IsGood{Ordinary,Supersingular}Reduction,
    Is{Split,NonsplitMultiplicative}Reduction, the finite-field blocks traceOfFrobenius,
    IsOrdinary, IsSupersingular, and the ReductionType enum.
  • Global minimal models (over a Dedekind domain): IsGlobalMinimalModel,
    IsSemiGlobalMinimalModel, minimalDiscriminantIdeal, localMinimalDiscriminant,
    IsReducedMinimalModel (/ℚ), IsSemistable, and obstructionClass/obstructionExponent
    (Silverman's Weierstrass class, AEC §VIII.8).
  • Mordell–Weil / heights / misc: mordellWeilGenerators, naiveHeight,
    naivePointHeight/canonicalHeight, freyCurve, abcQuality, integralPoints.

All compile (lake build LeanBridge.ForMathlib.«4-EC»). Each docstring documents the modeling
choices and caveats (totality/junk-value conventions, unproven facts taken as hypotheses).

🤖 Generated with Claude Code

JaneShi99 and others added 3 commits June 14, 2026 23:16
…ge ch.4)

Mathlib-style definitions from LMFDB elliptic-curve knowls that are not yet in mathlib: additive / multiplicative / bad / potential-good reduction; good-ordinary / good-supersingular reduction; split / non-split multiplicative reduction; plus the finite-field building blocks traceOfFrobenius / IsOrdinary / IsSupersingular.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…h.4 EC)

Extends ForMathlib/4-EC.lean with the global (Dedekind-domain) minimal-model cluster — IsGlobalMinimalModel, IsSemiGlobalMinimalModel, minimalDiscriminantIdeal, IsReducedMinimalModel, IsSemistable, and obstructionExponent/obstructionClass (Silverman's Weierstrass class) — plus the ReductionType enum and the one-offs naiveHeight, naivePointHeight/canonicalHeight, freyCurve, abcQuality, and integralPoints. All compile.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replaces @IsOrdinary/@IsSupersingular instance passing in IsGoodOrdinaryReduction / IsGoodSupersingularReduction with 'haveI := h; (W.reduction R).IsOrdinary' (dot notation), and the brittle positional pattern '@Affine.Point.some _ _ _ x _ _' in naivePointHeight with the named binder '.some (x := x) ..'. No change in meaning; compiles.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@Multramate Multramate left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some preliminary comments for reductions.

Comment thread LeanBridge/ForMathlib/4-EC.lean Outdated
Comment thread LeanBridge/ForMathlib/4-EC.lean Outdated
Comment thread LeanBridge/ForMathlib/4-EC.lean Outdated
Comment thread LeanBridge/ForMathlib/4-EC.lean Outdated
Comment thread LeanBridge/ForMathlib/4-EC.lean Outdated
Comment thread LeanBridge/ForMathlib/4-EC.lean Outdated
JaneShi99 and others added 4 commits June 28, 2026 17:20
Compile fixes after merging main (v4.23.0 -> v4.31.0): update moved/deprecated imports (RingTheory.Radical -> .NatInt, RingTheory.ClassGroup -> .Basic; drop the split Module.Torsion imports); IsGoodReduction -> HasGoodReduction (deprecated); Affine.Point.some now takes coordinates explicitly; drop redundant [IsDomain O] (IsDedekindDomain implies it). Remove mordellWeilGenerators: its Module.Free (M / torsion) instance chain no longer synthesizes in v4.31.0, and it is the def flagged in PR review (do we need the basis of generators?) - set aside pending that decision.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…pe (ch.4 EC)

Following review by Multramate (mathlib EC maintainer), now that the branch is on mathlib v4.31.0 which has the reduction API: drop IsAdditiveReduction/IsMultiplicativeReduction/IsSplitMultiplicativeReduction in favour of mathlib's HasAdditiveReduction/HasMultiplicativeReduction/HasSplitMultiplicativeReduction; rebuild IsNonsplitMultiplicativeReduction as HasMultiplicativeReduction and not HasSplitMultiplicativeReduction (drops the [Finite] hypothesis and point-count); IsSemistable uses HasAdditiveReduction; IsBadReduction = not HasGoodReduction. Define IsSupersingular first, IsOrdinary := not IsSupersingular. Restructure ReductionType to good | multiplicative (split : Bool) | additive. IsPotentialGoodReduction keeps the j-invariant criterion (the base-change form needs the finite-extension/DVR-tower machinery; j integral is the equivalent characterization, Silverman AEC VII.5.5).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
….4 EC)

Replace the j-invariant criterion with the base-change form requested in PR
review: there exists a DVR S extending R (compatible R->S->Frac S and
R->K->Frac S towers) whose fraction field is a finite extension of K over which
W has good reduction. Expressed as a single existential over S (no helper
structure / Nonempty wrapper); S is universe-pinned to K. Silverman AEC VII.5.5
gives the equivalence with j(E) integral.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@JaneShi99
JaneShi99 requested a review from Multramate June 29, 2026 13:01
Comment thread LeanBridge/ForMathlib/4-EC.lean Outdated
Comment thread LeanBridge/ForMathlib/4-EC.lean Outdated
Comment thread LeanBridge/ForMathlib/4-EC.lean Outdated
Comment thread LeanBridge/ForMathlib/4-EC.lean Outdated
Comment thread LeanBridge/ForMathlib/4-EC.lean Outdated
Comment thread LeanBridge/ForMathlib/4-EC.lean Outdated
Comment thread LeanBridge/ForMathlib/4-EC.lean Outdated
Comment thread LeanBridge/ForMathlib/4-EC.lean Outdated
Comment thread LeanBridge/ForMathlib/4-EC.lean Outdated
Comment thread LeanBridge/ForMathlib/4-EC.lean Outdated
Comment thread LeanBridge/ForMathlib/4-EC.lean Outdated

variable {O : Type*} [CommRing O] [IsDedekindDomain O]

/-- A Weierstrass model over `K = FractionRing O` (with `O` the ring of integers, a Dedekind domain)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If you notice in the definition of IsMinimal etc, we want to have an "AKLB" construction rather than a fixed ring and a fixed fraction ring. So the assumptions will need to be a Dedekind domain R, a field K such that IsFractionRing R K (not K = FractionRing R), etc

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@Multramate I did have the AKLB construction, but it costed a few lines of local instance. See the updated file.

Comment thread LeanBridge/ForMathlib/4-EC.lean Outdated
1. used "isGalobalMinimal" instead of "isGlobalMinimalModel" to match
   the mathlib naming for "isMinimal"
   2. local instance to get rid of the "HaveI"s
   3. since IsMinimal -> IsIntegral, no longer has IsIntegral in the
      hypothesis
@JaneShi99
JaneShi99 requested a review from Multramate July 29, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants