/- Copyright 2025 The Formal Conjectures Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ import FormalConjecturesUtil

Modularity conjecture

The Modularity conjecture (also know as the Shimura-Taniyama-Weil conjecture) states that every rational elliptic curve is modular, meaning that it can be associated with a modular form. We state the a_p version of the conjecture, which relates the coefficients of the modular form to the number of points on the elliptic curve over finite fields.

Since we don't have the conductor of the elliptic curve, our definition of a_p(E) differs from that in the literature at primes of bad reduction. For this reason, we state the conjecture with the assumption that p ∤ N, in order to give an equivalent statement.

References:

namespace ModularityConjectureopen Complex CongruenceSubgroup ModularFormClass ModularityConjecture UpperHalfPlaneopen scoped Real ModularForm CongruenceSubgroup

The n-th Fourier coefficient of a modular forms (around the cusp at infinity).

noncomputable def modularFormAn (n : ) {N : } {k : } (f : CuspForm (Gamma0 N) k) : := (qExpansion N f).coeff nlocal notation:73 "a_[" n:0 "]" f:72 => modularFormAn n f

We need to reduce a rational modulo p, in practice we won't be dividing by zero since the conductor of the elliptic curve saves us.

def ratRed (q : ) (p : ) : ZMod p := (q.num : ZMod p) * (q.den : ZMod p)⁻¹

The set of points on an elliptic curve over ZMod n.

def setOfPointsModN (E : WeierstrassCurve ) [E.IsElliptic] (n : ) := {P : ZMod n × ZMod n | let x, y := P y ^ 2 + ratRed E.a₁ n * x * y + ratRed E.a₃ n * y = x ^ 3 + ratRed E.a₂ n * x ^ 2 + ratRed E.a₄ n * x + ratRed E.a₆ n}

The set of point mod n is finite.

E:WeierstrassCurve inst✝:E.IsEllipticp:ℕ+Fintype {(x, y) | y ^ 2 + ratRed E.a₁ p * x * y + ratRed E.a₃ p * y = x ^ 3 + ratRed E.a₂ p * x ^ 2 + ratRed E.a₄ p * x + ratRed E.a₆ p} All goals completed! 🐙

Note that normally this is written as p + 1 - #E(𝔽ₚ), but since we don't have a point at infinity on this affine curve we only have p. The trace is integer-valued and can be negative.

noncomputable def WeierstrassCurve.ap (E : WeierstrassCurve ) [E.IsElliptic] (p : ) : := (p : ) - Cardinal.toNat (Cardinal.mk (setOfPointsModN E p))

Since we don't have Hecke operators yet, we define this via the q-expansion coefficients. See Proposition 5.8.5 of [diamondshurman2005].

def IsNormalisedEigenform {N : } {k : } (f : CuspForm (Gamma0 N) k) : Prop := a_[1]f = 1 ( (m n : ), m.Coprime n a_[n * m]f = a_[n]f * a_[m]f) ( (p r : ), p.Prime 2 r (N : ZMod p) 0 a_[p ^ r]f = a_[p]f * a_[p ^ (r - 1)]f - p ^ (k - 1) * a_[p ^ (r - 2)]f) (p r : ), p.Prime 2 r (N : ZMod p) = 0 a_[p ^ r]f = (a_[p]f) ^ r

See theorem 8.8.1 of [diamondshurman2005].

def modularityConjecture (E : WeierstrassCurve ) [E.IsElliptic] : Prop := (N : ℕ+) (f : CuspForm (Gamma0 N) 2), IsNormalisedEigenform f (p : ), p.Prime (N : ZMod p) 0 a_[p]f = E.ap p

The Modularity Theorem (formerly Shimura-Taniyama-Weil conjecture): every elliptic curve over $\mathbb{Q}$ is modular.

@[category research solved, AMS 11] theorem modularity_conjecture (E : WeierstrassCurve ) [E.IsElliptic] : modularityConjecture E := E:WeierstrassCurve inst✝:E.IsEllipticmodularityConjecture E All goals completed! 🐙end ModularityConjecture