This repository contains Magma code implementing the elimination step in the modular method for families of generalised Fermat equations of signatures
This code is intended for researchers working on the modular method, Darmon’s program, and Diophantine equations involving Hilbert modular forms.
The implementation follows the framework developed in the paper:
Martin Azon, Effective Darmon’s program for the generalised Fermat equation.
At a high level, the code:
- constructs the level predicted by the modular method,
- computes the corresponding space of Hilbert newforms,
- and eliminates Hecke constituents by comparing the Galois representations attached to Hilbert newforms with those coming from Frey hyperelliptic Jacobians.
The current implementation is designed for the computational elimination step explained in Section 6 of the paper.
⚠️ Important: This repository uses the Magma computer algebra system. All.mfiles are Magma code (despite GitHub might classify them as MATLAB).
Fix integers
-
signature
$(p,p,r)$ :$$A x^p + B y^p = C z^r,$$ -
signature
$(r,r,p)$ :$$A x^r + B y^r = C z^p.$$
Given the equation parameters and optional hypotheses on a putative primitive non-trivial solution
- determine the level of the Hilbert newforms predicted by level lowering,
- compute the Hecke constituents of the corresponding Hilbert modular forms space,
- try to eliminate each constituent,
- return the set of prime exponents
$p$ that are not ruled out by the implemented elimination criteria.
In the examples treated in the paper, this procedure is used to prove non-existence of primitive non-trivial solutions under suitable local assumptions.
The code is split into reusable Magma files:
main.m— main entry point; this is the file to edit in order to choose the equation and assumptions.interface.m— definitions of theGFEandGFEAssumptionsobjects, input validation, and interactive reading utilities.Frey_cvs.m— construction of the twisted Frey hyperelliptic curve associated with a putative solution.level&irred.m— level computation and irreducibility checks.elim_functions.m— elimination routines (Bounding_ps,Eliminate_g, trace comparisons, auxiliary quantities).solving.m— orchestration of the full elimination process for a chosen equation.spec— Magma spec file (used byAttachSpec) linking the package components.
The repository also includes sample output files illustrating the method on concrete families, such as:
-
expp5.txtfor a family of signature$(p,p,5)$ , -
ex55p.txtfor a family of signature$(5,5,p)$ .
- Magma
No external dependencies are required beyond Magma and the files in this repository.
- Open
main.m. - Set the equation parameters:
-
signature := "ppr";for signature$(p,p,r)$ , -
signature := "rrp";for signature$(r,r,p)$ , - choose integers
r,A,B,C.
-
- Set the optional assumptions on a putative solution.
- Set the irreducibility flag if you already have an independent irreducibility argument.
- Load
main.min Magma.
The file begins with
AttachSpec("spec");
so loading main.m automatically attaches the rest of the package.
The main user-editable parameters are:
signature := "ppr";
r := 5;
A := 7;
B := 1;
C := 3;
with the following meaning:
signaturemust be either"ppr"or"rrp",rmust be a prime number greater than3,A,B,Cmust be non-zero, pairwise coprime, and free ofr-th powers.
You may also specify assumptions on a putative primitive non-trivial solution:
DoingAssumptions := true;
ab_even := true;
c_even := false;
ab_div_r := true;
c_div_r := false;
g_irred := false;
These encode local hypotheses such as:
- whether
$ab$ is even, - whether
$c$ is even, - whether
$ab$ is divisible by$r$ , - whether
$c$ is divisible by$r$ , - whether the polynomial
$g_r^-$ is irreducible over$\mathbf{Q}_r$ .
The input is validated, and incompatible assumptions are rejected.
The script can apply the irreducibility criterion implemented from the paper. If your case is not covered by that criterion, you may still run the elimination step by providing your own external irreducibility argument:
irred_argument := true;
You may also specify a set of prime exponents already excluded for theoretical reasons:
initially_eliminated_ps := {2, 3, r};
The default call in main.m is:
Main(E : irreducibility_argument := irred_argument,
init_eliminated_ps := initially_eliminated_ps);
This prints the chosen equation and assumptions, computes the space of Hilbert newforms at the predicted level, and then processes the Hecke constituents one by one.
An interactive workflow is also available through ReadGFE() and TerminalMain().
During execution, the program reports:
- the equation being studied,
- the assumptions on the putative solution,
- the factorisation of the level,
- the dimension of the Hilbert newform space,
- the number of Hecke constituents,
- the progress of the elimination for each constituent,
- the remaining prime exponents that are not yet eliminated.
A constituent may be eliminated immediately if the totally real field
At the end, the script prints the set of primes that the implemented elimination step did not rule out.
The repository includes sample outputs for two families discussed in the paper:
7x^p + y^p = 3z^5under suitable local assumptions,x^5 + 7y^5 = z^punder suitable local assumptions.
These examples illustrate the intended use of the code and the typical shape of the output.
- The implementation is aimed at the elimination step, not at automating every part of the modular method.
- The cost of the computation grows quickly with the level and with the size of the coefficient fields of the newforms.
- In difficult cases, the program may only reduce the set of possible exponents rather than eliminate every Hecke constituent completely.
- Some cases are intentionally excluded when the conductor exponent or irreducibility input is not available from the current theory implemented in the code.
If you use this code, please cite the accompanying paper:
Martin Azon, Effective Darmon’s program for the generalised Fermat equation.
Bug reports, corrections, and suggestions for improvements are very welcome.