Bodigrim / arithmoi

Number theory: primes, arithmetic functions, modular computations, special sequences
http://hackage.haskell.org/package/arithmoi
MIT License
147 stars 40 forks source link

Constructing Dirichlet characters #185

Open b-mehta opened 4 years ago

b-mehta commented 4 years ago

At the moment, constructing Dirichlet characters from a table is done as follows: By way of example, let us use modulus 2520 = 2^3 × 3^2 × 5 × 7. Any character of this modulus is then a group homomorphism (Z / 2520Z)* -> C*, in particular is specified by the generators of (Z / 2520Z)*. We have also that (Z / 2520Z)* ≅ (Z/8Z)* × (Z/9Z)* × (Z/5Z)* × (Z/7Z), so one choice of generating set is given by:

(since 5 generates (Z/8Z)*, 2 generates (Z/9Z)*, 2 generates (Z/5Z)* and 3 generates (Z/7Z)*).

In fromTable, these congruences would be solved to find the generators mod 2520, then the values of the character at these points are calculated to specify the character, and the constructed character is compared to the given table to ensure the table specified a unique character.

But of course, this is not the only generating set. Ideally, we would be given Vector (Maybe (OrZero RootOfUnity)); the function would then check that the points at which the value is given do generate the group (else the character is underspecified), and that the points at which values are given are consistent (else the character is overspecified). It would also check that the given values are valid (are roots of unity for the correct n), and construct the Dirichlet character specified.

I suspect the hardest part of this is the first - checking that the values generate the group.