Congruences

CongruenceGroup(M1, M2, prec) : ModFrm, ModFrm, RngIntElt -> GrpAb
A group C that measures all possible congruences (to precision prec) between some modular form in M1 and some modular form in M2. The group C is defined as follows. Let W1 be the finite-rank Z-module q-exp(M1)∩Z[[q]] and let W2 be q-exp(M2)∩Z[[q]]. Let V be the saturation of W1 + W2 in Z[[q]]. Then C=V/(W1 + W2).
CongruenceGroupAnemic(M1, M2, prec) : ModFrm, ModFrm, RngIntElt -> GrpAb
Analogous to CongruenceGroup, but now considering congruences that hold for all q-expansion coefficients an with n coprime to the levels of both M1 and M2 (rather than for all q-expansion coefficients).

Example ModFrm_Congruences (H141E18)

We verify that the newform corresponding to the first elliptic curve of rank 2 is congruent modulo 5 to some Galois-conjugate newform corresponding to the winding quotient of J0(389) (there is also a congruence modulo 2 to some conjugate form).
> M := ModularForms(Gamma0(389),2);
> f := Newform(M,1);
> Degree(f);
1
> g := Newform(M,5);
> Degree(g);
20
> CongruenceGroup(Parent(f),Parent(g),30);
Abelian Group isomorphic to Z/20
Defined on 1 generator
Relations:
    20*$.1 = 0
The congruence can be seen directly by computing the reductions of f and g modulo 5:
> fmod5 := Reductions(f,5);
> gmod5 := Reductions(g,5);  // takes a few seconds.
> #gmod5;
7
> #fmod5;
1
> [gbar : gbar in gmod5 | #gbar eq 1];
[ [*
q + 4*q^2 + q^3 + 4*q^4 + q^5 + 4*q^6 + O(q^8)
*], [*
q + 3*q^2 + 3*q^3 + 2*q^4 + 2*q^5 + 4*q^6 + O(q^8)
*] ]
> fmod5[1][1];
q + 3*q^2 + 3*q^3 + 2*q^4 + 2*q^5 + 4*q^6 + O(q^8)
V2.28, 13 July 2023