Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Literature predicates: LLL-series continuations, Gross–Zagier, TYZ, and CR3_33​

Definition
ZInQLiterature

by LG · Nov 21, 2026 · Mathlib 0df444a (Lean v4.33.1)

number-theoryz-is-diophantine-in-q

This bundle defines the literature-level predicates over Mathlib's LLL-series of an elliptic curve, with the genus-sum definitions inlined. IsLContinuation(E,F)\mathrm{IsLContinuation}(E,F)IsLContinuation(E,F) says FFF is an entire function agreeing with EEE's LLL-series on ℜs>3/2\Re s>3/2ℜs>3/2. The completed LLL-function is Λ(s)=Ns/2(2π)−sΓ(s)F(s)\Lambda(s)=N^{s/2}(2\pi)^{-s}\Gamma(s)F(s)Λ(s)=Ns/2(2π)−sΓ(s)F(s). Gross–Zagier (positive-rank half) says a simple zero at s=1s=1s=1 forces a point of infinite order. Hecke continuation gives an entire continuation for CdC_dCd​ (d≠0d\ne 0d=0); the functional equation has conductor 32d232d^232d2 and root number −1-1−1 on 0<ℜs<20<\Re s<20<ℜs<2. TYZ Theorem 3.5(2) in reading A says order ≥2\ge 2≥2 at s=1s=1s=1 forces both genus sums T5a,T5bT_{5a},T_{5b}T5a​,T5b​ even; row 5b says odd T5bT_{5b}T5b​ gives order ≤1\le 1≤1. Finally CR3TYZ_Cl,Rk_3^{\mathrm{TYZ\_Cl,Rk}}3TYZ_Cl,Rk​ says odd T5b(d)T_{5b}(d)T5b​(d) gives a point of infinite order on Cd:y2=x3−d2xC_d:y^2=x^3-d^2xCd​:y2=x3−d2x for squarefree d≡5(mod8)d\equiv 5\pmod 8d≡5(mod8).

Definition code
import Mathlib
import Mathlib.Algebra.QuadraticAlgebra.Basic

noncomputable section

open NumberField

namespace ZInQ.RouteK.Rank5b

/-- The field Q(sqrt(-n)), as Mathlib's quadratic algebra. -/
abbrev QNeg (n : ℕ) : Type := QuadraticAlgebra ℚ (-(n : ℚ)) 0

/-- No rational r satisfies r^2 = -n (for n != 0); this is the Fact the
QuadraticAlgebra field instance requires at this Mathlib pin. -/
instance QNeg.factNoRoot (n : ℕ) [NeZero n] : Fact (∀ r : ℚ, r ^ 2 ≠ -(n : ℚ) + 0 * r) := by
  refine ⟨fun r hr => ?_⟩
  have h0 : (0 : ℚ) < n := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne n)
  rw [zero_mul, add_zero] at hr
  nlinarith [sq_nonneg r]

instance QNeg.numberField (n : ℕ) [NeZero n] : NumberField (QNeg n) where

/-- d_B = product of the primes in B. -/
def dProd {d : ℕ} (B : Finset d.primeFactors) : ℕ := ∏ p ∈ B, (p : ℕ)

instance neZero_dProd {d : ℕ} (B : Finset d.primeFactors) : NeZero (dProd B) :=
  ⟨Finset.prod_ne_zero_iff.mpr fun p _ => (Nat.prime_of_mem_primeFactors p.2).ne_zero⟩

/-- TYZ's genus class number g(n) = #(2 Cl(Q(sqrt(-n)))). -/
def gCl (n : ℕ) [NeZero n] : ℕ :=
  Nat.card (powMonoidHom 2 : ClassGroup (𝓞 (QNeg n)) →* ClassGroup (𝓞 (QNeg n))).range

/-- Admissibility for row 5b: one block = 7, one block = 3, all blocks 7, 3 or 1 mod 8. -/
def Admissible5bNat (d : ℕ) (P : Finpartition (Finset.univ : Finset d.primeFactors)) : Prop :=
  (P.parts.filter fun B => dProd B % 8 = 7).card = 1 ∧
  (P.parts.filter fun B => dProd B % 8 = 3).card = 1 ∧
  ∀ B ∈ P.parts, dProd B % 8 = 7 ∨ dProd B % 8 = 3 ∨ dProd B % 8 = 1

instance (d : ℕ) (P : Finpartition (Finset.univ : Finset d.primeFactors)) :
    Decidable (Admissible5bNat d P) := by
  unfold Admissible5bNat; infer_instance

/-- The genus sum of row 5b with TYZ's class-number g. -/
def T5bCl (d : ℕ) : ZMod 2 :=
  ∑ P : Finpartition (Finset.univ : Finset d.primeFactors),
    if Admissible5bNat d P then ∏ B ∈ P.parts, ((gCl (dProd B) : ℕ) : ZMod 2) else 0

end ZInQ.RouteK.Rank5b

open WeierstrassCurve

namespace ZInQ.Literature

open ZInQ.RouteK.Rank5b

/-- F is an entire continuation of L(E, s) from the half-plane Re s > 3/2. -/
def IsLContinuation (E : WeierstrassCurve ℚ) (F : ℂ → ℂ) : Prop :=
  Differentiable ℂ F ∧ ∀ s : ℂ, 3 / 2 < s.re → F s = E.LSeries s

/-- Admissibility for T_5a: exactly one block = 5 mod 8, all others = 1 or 5 mod 8. -/
def Admissible5aNat (d : ℕ) (P : Finpartition (Finset.univ : Finset d.primeFactors)) : Prop :=
  (P.parts.filter fun B => dProd B % 8 = 5).card = 1 ∧
  ∀ B ∈ P.parts, dProd B % 8 = 5 ∨ dProd B % 8 = 1

instance (d : ℕ) (P : Finpartition (Finset.univ : Finset d.primeFactors)) :
    Decidable (Admissible5aNat d P) := by
  unfold Admissible5aNat; infer_instance

/-- TYZ's first sum T_5a(d) with g = #2Cl. -/
noncomputable def T5aCl (d : ℕ) : ZMod 2 :=
  ∑ P : Finpartition (Finset.univ : Finset d.primeFactors),
    if Admissible5aNat d P then ∏ B ∈ P.parts, ((gCl (dProd B) : ℕ) : ZMod 2) else 0

/-- The completed L-function Lambda(s) = N^{s/2} (2 pi)^{-s} Gamma(s) F(s). -/
noncomputable def completedL (N : ℕ) (F : ℂ → ℂ) (s : ℂ) : ℂ :=
  (N : ℂ) ^ (s / 2) * (2 * Real.pi : ℂ) ^ (-s) * Complex.Gamma s * F s

/-- Gross-Zagier (positive-rank half): a simple zero of L(E,s) at s=1 gives infinite order. -/
def GrossZagier : Prop :=
  ∀ (E : WeierstrassCurve ℚ), E.IsElliptic → ∀ F : ℂ → ℂ, IsLContinuation E F →
    analyticOrderAt F 1 = 1 → ∃ P : E.toAffine.Point, ¬IsOfFinAddOrder P

/-- Root number -1 for C_d, d = 5 mod 8: the continuation vanishes at s=1. -/
def RootNumberVanishing : Prop :=
  ∀ d : ℕ, d % 8 = 5 → Squarefree d → ∀ F : ℂ → ℂ,
    IsLContinuation (WeierstrassCurve.mk 0 0 0 (-(d : ℚ) ^ 2) 0) F → F 1 = 0

/-- TYZ row 5b: odd genus sum gives order of vanishing at most 1. -/
def TYZRow5b : Prop :=
  ∀ d : ℕ, d % 8 = 5 → Squarefree d → T5bCl d = 1 →
    ∃ F : ℂ → ℂ, IsLContinuation (WeierstrassCurve.mk 0 0 0 (-(d : ℚ) ^ 2) 0) F ∧ analyticOrderAt F 1 ≤ 1

/-- Hecke: L(C_d, s) has an entire continuation for d != 0. -/
def HeckeContinuation : Prop :=
  ∀ d : ℕ, d ≠ 0 → ∃ F : ℂ → ℂ, IsLContinuation (WeierstrassCurve.mk 0 0 0 (-(d : ℚ) ^ 2) 0) F

/-- TYZ Theorem 3.5(2), reading A, case L(n)=0: order >= 2 forces both genus sums even. -/
def TYZThm35ReadingA : Prop :=
  ∀ d : ℕ, d % 8 = 5 → Squarefree d → ∀ F : ℂ → ℂ,
    IsLContinuation (WeierstrassCurve.mk 0 0 0 (-(d : ℚ) ^ 2) 0) F → 2 ≤ analyticOrderAt F 1 →
      T5aCl d = 0 ∧ T5bCl d = 0

/-- Functional equation of L(C_d,s), conductor 32 d^2, root number -1, on 0 < Re s < 2. -/
def FunctionalEquation5 : Prop :=
  ∀ d : ℕ, d % 8 = 5 → Squarefree d → ∀ F : ℂ → ℂ,
    IsLContinuation (WeierstrassCurve.mk 0 0 0 (-(d : ℚ) ^ 2) 0) F →
      ∀ s : ℂ, 0 < s.re → s.re < 2 →
        completedL (32 * d ^ 2) F (2 - s) = -completedL (32 * d ^ 2) F s

end ZInQ.Literature

namespace ZInQ.RouteK.Rank

open WeierstrassCurve ZInQ.RouteK.Rank5b

/-- CR_3^{TYZ_Cl,Rk}: odd genus sum gives a point of infinite order on C_d. -/
def CertifiedRankTYZClRk : Prop :=
  ∀ d : ℕ, d % 8 = 5 → Squarefree d → T5bCl d = 1 →
    ∃ P : (WeierstrassCurve.mk 0 0 0 (-(d : ℚ) ^ 2) 0).toAffine.Point, ¬IsOfFinAddOrder P

end ZInQ.RouteK.Rank
Source
https://github.com/elliotglazer/diophantine-z-q/blob/964d7dd71f253091dbc5eac793b78cc56d1fcc73/ZInQKernel/Hypotheses/CR3Literature.lean#L36-L180
Read-back

What the Lean code literally says, in plain math · glm

The bundle defines the following, all noncomputable. QNeg(n)\mathrm{QNeg}(n)QNeg(n) is the quadratic algebra Q[ω]/(ω2=−n)\mathbb{Q}[\omega]/(\omega^2=-n)Q[ω]/(ω2=−n); for n≠0n\ne 0n=0 it is a field (because no rational rrr satisfies r2=−nr^2=-nr2=−n) and a number field. For a set BBB of prime factors of ddd, dProd(B)=∏p∈Bp\mathrm{dProd}(B)=\prod_{p\in B}pdProd(B)=∏p∈B​p, a nonzero natural number. gCl(n)\mathrm{gCl}(n)gCl(n) (for n≠0n\ne 0n=0) is the natural-number cardinality of the range of the squaring endomorphism x↦x2x\mapsto x^2x↦x2 of the class group of the ring of integers of QNeg(n)\mathrm{QNeg}(n)QNeg(n). A partition PPP of the prime factors of ddd satisfies Admissible5bNat(d,P)\mathrm{Admissible5bNat}(d,P)Admissible5bNat(d,P) iff exactly one block has product ≡7(mod8)\equiv 7\pmod 8≡7(mod8), exactly one block has product ≡3(mod8)\equiv 3\pmod 8≡3(mod8), and every block has product ≡7,3,\equiv 7,3,≡7,3, or 1(mod8)1\pmod 81(mod8); this predicate is decidable. T5bCl(d)∈Z/2Z\mathrm{T5bCl}(d)\in\mathbb{Z}/2\mathbb{Z}T5bCl(d)∈Z/2Z is the sum, over all set partitions PPP of the prime factors of ddd, of ∏B∈PgCl(dProd(B))\prod_{B\in P}\mathrm{gCl}(\mathrm{dProd}(B))∏B∈P​gCl(dProd(B)) (cast to Z/2Z\mathbb{Z}/2\mathbb{Z}Z/2Z) when PPP is admissible, and 000 otherwise. The literature predicates are as follows. Admissible5aNat(d,P)\mathrm{Admissible5aNat}(d,P)Admissible5aNat(d,P) holds iff exactly one block has product ≡5(mod8)\equiv 5\pmod 8≡5(mod8) and every block has product ≡5\equiv 5≡5 or 1(mod8)1\pmod 81(mod8) (decidable). T5aCl(d)∈Z/2Z\mathrm{T5aCl}(d)\in\mathbb{Z}/2\mathbb{Z}T5aCl(d)∈Z/2Z sums ∏BgCl(dProd(B))\prod_B \mathrm{gCl}(\mathrm{dProd}(B))∏B​gCl(dProd(B)) over partitions admissible for row 5a, else 000. completedL(N,F,s)=Ns/2(2π)−sΓ(s)F(s)\mathrm{completedL}(N,F,s)=N^{s/2}(2\pi)^{-s}\Gamma(s)F(s)completedL(N,F,s)=Ns/2(2π)−sΓ(s)F(s). IsLContinuation(E,F)\mathrm{IsLContinuation}(E,F)IsLContinuation(E,F) holds iff FFF is complex-differentiable everywhere and F(s)=E.LSeries(s)F(s)=E.\mathrm{LSeries}(s)F(s)=E.LSeries(s) for ℜs>3/2\Re s>3/2ℜs>3/2. GrossZagier\mathrm{GrossZagier}GrossZagier: for every elliptic curve EEE over Q\mathbb{Q}Q and every entire continuation FFF with analyticOrderAt(F,1)=1\mathrm{analyticOrderAt}(F,1)=1analyticOrderAt(F,1)=1, there is an affine point of EEE not of finite additive order. RootNumberVanishing\mathrm{RootNumberVanishing}RootNumberVanishing: for squarefree d≡5(mod8)d\equiv 5\pmod 8d≡5(mod8) and every continuation FFF of L(Cd,s)L(C_d,s)L(Cd​,s), F(1)=0F(1)=0F(1)=0. TYZRow5b\mathrm{TYZRow5b}TYZRow5b: for squarefree d≡5(mod8)d\equiv 5\pmod 8d≡5(mod8) with T5bCl(d)=1\mathrm{T5bCl}(d)=1T5bCl(d)=1, some continuation has analyticOrderAt(F,1)≤1\mathrm{analyticOrderAt}(F,1)\le 1analyticOrderAt(F,1)≤1. HeckeContinuation\mathrm{HeckeContinuation}HeckeContinuation: for de0d e 0de0, L(Cd,s)L(C_d,s)L(Cd​,s) has some entire continuation. TYZThm35ReadingA\mathrm{TYZThm35ReadingA}TYZThm35ReadingA: for squarefree d≡5(mod8)d\equiv 5\pmod 8d≡5(mod8) and every continuation with analyticOrderAt(F,1)≥2\mathrm{analyticOrderAt}(F,1)\ge 2analyticOrderAt(F,1)≥2, both T5aCl(d)=0\mathrm{T5aCl}(d)=0T5aCl(d)=0 and T5bCl(d)=0\mathrm{T5bCl}(d)=0T5bCl(d)=0. FunctionalEquation5\mathrm{FunctionalEquation5}FunctionalEquation5: for squarefree d≡5(mod8)d\equiv 5\pmod 8d≡5(mod8), every continuation FFF, and 0<ℜs<20<\Re s<20<ℜs<2, completedL(32d2,F,2−s)=−completedL(32d2,F,s)\mathrm{completedL}(32d^2,F,2-s)=-\mathrm{completedL}(32d^2,F,s)completedL(32d2,F,2−s)=−completedL(32d2,F,s). CertifiedRankTYZClRk\mathrm{CertifiedRankTYZClRk}CertifiedRankTYZClRk: for squarefree d≡5(mod8)d\equiv 5\pmod 8d≡5(mod8) with T5bCl(d)=1\mathrm{T5bCl}(d)=1T5bCl(d)=1, the curve y2=x3−d2xy^2=x^3-d^2xy2=x3−d2x has an affine point not of finite additive order.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me