An elliptic function field has genus one
ProvedWeierstrassCurve.Affine.genus_eq_oneLet be a field and let be the Weierstrass curve over
with nonzero discriminant , i.e. an elliptic curve. Let be its affine coordinate ring and let be a field of fractions of , viewed as an extension of through . The structure maps and are assumed compatible, and is assumed finite and separable over (these are hypotheses of the statement). The structure map is the composite , and is assumed to be the full constant field of : every element of algebraic over lies in .
A place of is a valuation ring with whose value group is infinite cyclic; is its normalized valuation and its degree. A divisor is a finite formal sum with , of degree . Its Riemann–Roch space is
a -vector space of dimension . The genus of is the largest value of the defect over all divisors .
Then the function field of the elliptic curve has genus one:
This is the function-field form of the statement that a smooth Weierstrass cubic is a curve of genus one, i.e. an elliptic curve; combined with the Riemann–Roch theorem it gives for every divisor of positive degree.
Formalization Note W : WeierstrassCurve.Affine k is Mathlib's Weierstrass curve, W.IsElliptic means that its discriminant is a unit, and W.Point is Mathlib's type of points: zero (the point ) or an affine point with a proof of W.Nonsingular x₀ y₀. The function field is an abstract field K with [Algebra W.CoordinateRing K] [IsFractionRing W.CoordinateRing K] and IsScalarTower k[X] W.CoordinateRing K. The places placeOfPoint W K P and infinityPlace K are intrinsic places obtained from coordinate places: an affine point gives the height-one prime of the integral closure of in corresponding to , and infinityPlace comes from a chosen height-one prime of the integral closure in of the valuation ring at infinity of . Here FunctionField k K, Algebra.IsSeparable k⟮X⟯ K and IsFullConstantField k K are hypotheses. Places (FunctionField.Place k K) are valuation subrings containing the image of whose value group admits an order isomorphism with (only its existence is recorded); the normalized valuation is written multiplicatively, , so that reads for every place. Degrees of places and are Module.finrank over , and divisors are finitely supported functions from places to . The genus FunctionField.genus k K is defined as the natural-number truncation of the supremum in of the defects .
import Mathlib
import Definitions.Def_RiemannRoch_WeierstrassGenus
/-
Contains code from riemann-roch-function-fields
(https://github.com/vaca22/riemann-roch-function-fields, commit dbca5bee),
Copyright (c) 2026 Guanghao Li, released under the Apache License 2.0
(https://www.apache.org/licenses/LICENSE-2.0).
Modified: ported to Lean v4.33.1 / Mathlib 0df444a (module headers converted, some proofs
adapted to this Mathlib, a few names qualified, `picTorsor` omitted; statements unchanged), then
split into prove2.me definitions and theorems, with comments removed.
-/
open FunctionField
open FunctionField.Chart
open scoped Polynomial RatFunc nonZeroDivisors
open WeierstrassCurve.Affine
variable {k : Type*} [Field k] (W : WeierstrassCurve.Affine k) [W.IsElliptic]
variable (K : Type*) [Field K] [Algebra W.CoordinateRing K] [IsFractionRing W.CoordinateRing K]
variable [Algebra k[X] K] [IsScalarTower k[X] W.CoordinateRing K]
[Algebra k⟮X⟯ K] [IsScalarTower k[X] k⟮X⟯ K]
[_root_.FunctionField k K] [Algebra.IsSeparable k⟮X⟯ K]
[Algebra k K] [IsScalarTower k k[X] K] [IsFullConstantField k K]
include Wtheorem WeierstrassCurve.Affine.genus_eq_one : FunctionField.genus k K = 1 := by sorry