Skip to content

[Merged by Bors] - feat: Dirichlet character#7010

Closed
mo271 wants to merge 24 commits intomasterfrom
mo271/dirichlet_character_change_level
Closed

[Merged by Bors] - feat: Dirichlet character#7010
mo271 wants to merge 24 commits intomasterfrom
mo271/dirichlet_character_change_level

Conversation

@mo271
Copy link
Copy Markdown
Collaborator

@mo271 mo271 commented Sep 7, 2023

@mo271
Copy link
Copy Markdown
Collaborator Author

mo271 commented Sep 7, 2023

@ghost ghost added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Sep 7, 2023
@MichaelStollBayreuth
Copy link
Copy Markdown
Contributor

Is there a specific reason for not using MulChar (ZMod n) R as the definition of DirichletCharacter R n?

@MichaelStollBayreuth
Copy link
Copy Markdown
Contributor

Also, there is maybe some ambiguity as to what should be the correct definition of a "Dirichlet character mod n".
I'm more used to it being defined as a map from the integers to (some monoid with zero) R that is obtained as the composition of the reduction map $\mathbb Z \to \mathbb Z/n \mathbb Z$ and a multiplicative character on $\mathbb Z/n \mathbb Z$. Of course, both versions are equivalent, and it is perhaps a question of what is more convenient...

@laughinggas
Copy link
Copy Markdown
Collaborator

Is there a specific reason for not using MulChar (ZMod n) R as the definition of DirichletCharacter R n?

I thought it makes sense to give it a separate name since there will be a few files on it. Also, I think MulChar is more in sync with asso_dirichlet_character, which has now been replaced in terms of ofUnitHom.

@laughinggas
Copy link
Copy Markdown
Collaborator

Also, there is maybe some ambiguity as to what should be the correct definition of a "Dirichlet character mod n". I'm more used to it being defined as a map from the integers to (some monoid with zero) R that is obtained as the composition of the reduction map Z→Z/nZ and a multiplicative character on Z/nZ. Of course, both versions are equivalent, and it is perhaps a question of what is more convenient...

I have at least 300-500 lines of code (in the folder dirichlet_character here : https://github.com/laughinggas/p-adic-L-functions/tree/main/src/dirichlet_character ) based on this definition. It comes with a lot of nice properties such as change_level, which is a monoid homomorphism. One can choose to make a second definition as a function from the integers (I am happy to contribute to that!), and show the equivalence of the two definitions.

@ghost ghost removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Sep 8, 2023
@ghost
Copy link
Copy Markdown

ghost commented Sep 8, 2023

This PR/issue depends on:

@MichaelStollBayreuth
Copy link
Copy Markdown
Contributor

Is there a specific reason for not using MulChar (ZMod n) R as the definition of DirichletCharacter R n?

I thought it makes sense to give it a separate name since there will be a few files on it. Also, I think MulChar is more in sync with asso_dirichlet_character, which has now been replaced in terms of ofUnitHom.

It certainly makes sense to give it a separate name. What I mean is why not define it as

@[reducible] def DirichletCharacter (R : Type) [CommMonoidWithZero R] (n : ℕ) := MulChar (ZMod n) R

instead? The rationale being that in many (most?) applications, you also want to evaluate the characters at non-units. (And, of course, that there is already an API for MulChars.)

@MichaelStollBayreuth
Copy link
Copy Markdown
Contributor

Also, there is maybe some ambiguity as to what should be the correct definition of a "Dirichlet character mod n". I'm more used to it being defined as a map from the integers to (some monoid with zero) R that is obtained as the composition of the reduction map Z→Z/nZ and a multiplicative character on Z/nZ. Of course, both versions are equivalent, and it is perhaps a question of what is more convenient...

I have at least 300-500 lines of code (in the folder dirichlet_character here : https://github.com/laughinggas/p-adic-L-functions/tree/main/src/dirichlet_character ) based on this definition. It comes with a lot of nice properties such as change_level, which is a monoid homomorphism. One can choose to make a second definition as a function from the integers (I am happy to contribute to that!), and show the equivalence of the two definitions.

After some consideration, I think it is best to use MulChar (ZMod n) R (as opposed to maps from integers to R), since if χ is an object of this type, χ a for an integer a just works. And, as you indicate, this definition seems to be better suited for proving properties (which, I think, comes down to the fact that the units of ZMod n are a thing, whereas their preimage in the integers isn't really).

@laughinggas
Copy link
Copy Markdown
Collaborator

Is there a specific reason for not using MulChar (ZMod n) R as the definition of DirichletCharacter R n?

I thought it makes sense to give it a separate name since there will be a few files on it. Also, I think MulChar is more in sync with asso_dirichlet_character, which has now been replaced in terms of ofUnitHom.

It certainly makes sense to give it a separate name. What I mean is why not define it as

@[reducible] def DirichletCharacter (R : Type) [CommMonoidWithZero R] (n : ℕ) := MulChar (ZMod n) R

instead? The rationale being that in many (most?) applications, you also want to evaluate the characters at non-units. (And, of course, that there is already an API for MulChars.)

If you look at the following : https://github.com/laughinggas/p-adic-L-functions/blob/88c5750b71f90ae9a9964968f4eabcb994d6d279/src/dirichlet_character/basic.lean#L54 , I think the definition of MulChar is related more to asso_dirichlet_character. I removed the definition of asso_dirichlet_character from this port and have instead used the properties of MulChar instead.

@mo271
Copy link
Copy Markdown
Collaborator Author

mo271 commented Sep 8, 2023

Defining it as (ZMod n)ˣ →* Rˣ has the conceptual advantage of defining it on the smallest possible object, instead of either on ZMod n or even \Z with extra conditions. I agree that we should have convenient api to switch between the different incarnations.

@MichaelStollBayreuth
Copy link
Copy Markdown
Contributor

MichaelStollBayreuth commented Sep 8, 2023

OK; I guess the one reason why you want to work with homomorphisms on the unit group is that this gives you the correct notion of changing the level. I would suggest using the MulChar definition as the main one and then go via the equivalence to "unit homs" (toUnitHom/ofUnitHom) to do the level change etc:

def ZMod.unitsMap {n m : ℕ} (hm : n ∣ m) : (ZMod m)ˣ →* (ZMod n)ˣ := Units.map (ZMod.castHom hm (ZMod n))

@[reducible]
def DirichletCharacter (R : Type) [CommMonoidWithZero R] (n : ℕ) := MulChar (ZMod n) R

namespace DirichletCharacter

noncomputable def change_level {R : Type} [CommMonoidWithZero R] {n m : ℕ} (hm : n ∣ m) :
    DirichletCharacter R n →* DirichletCharacter R m :=
  { toFun := fun ψ ↦ MulChar.ofUnitHom (ψ.toUnitHom.comp (ZMod.unitsMap hm)),
    map_one' := by ext; simp,
    map_mul' := fun ψ₁ ψ₂ ↦ by ext; simp }

(I was working on that while you were already answering; this refers to the earlier point.
EDIT: (hopefully) corrected units_map to unitsMap...)

@laughinggas
Copy link
Copy Markdown
Collaborator

OK; I guess the one reason why you want to work with homomorphisms on the unit group is that this gives you the correct notion of changing the level. I would suggest using the MulChar definition as the main one and then go via the equivalence to "unit homs" (toUnitHom/ofUnitHom) to do the level change etc:

def ZMod.unitsMap {n m : ℕ} (hm : n ∣ m) : (ZMod m)ˣ →* (ZMod n)ˣ := Units.map (ZMod.castHom hm (ZMod n))

@[reducible]
def DirichletCharacter (R : Type) [CommMonoidWithZero R] (n : ℕ) := MulChar (ZMod n) R

namespace DirichletCharacter

noncomputable def change_level {R : Type} [CommMonoidWithZero R] {n m : ℕ} (hm : n ∣ m) :
    DirichletCharacter R n →* DirichletCharacter R m :=
  { toFun := fun ψ ↦ MulChar.ofUnitHom (ψ.toUnitHom.comp (ZMod.unitsMap hm)),
    map_one' := by ext; simp,
    map_mul' := fun ψ₁ ψ₂ ↦ by ext; simp }

(I was working on that while you were already answering; this refers to the earlier point. EDIT: (hopefully) corrected units_map to unitsMap...)

change_level is not the only reason I wish to work with the units. I am using Dirichlet characters to define the p-adic L-function. The definition of the p-adic L-function (attached below) and its properties (which is about 3000-5000 lines of code) depend on the Dirichlet character being defined on the units. I understand that this is equivalent to the definition you have given, however, it is not the same. Your definition coincides with the definition of the associated Dirichlet character, asso_dirichlet_character in the p-adic L-functions repository, which I reworded in terms of MulChar.ofUnitHom. The main reason why I am hesitant to completely remove the units is because it will involve rewriting a lot of proofs going ahead.

image

image

@laughinggas
Copy link
Copy Markdown
Collaborator

laughinggas commented Sep 13, 2023

@MichaelStollBayreuth I can change the definition to be the following :
def DirichletCharacter (R : Type) [CommMonoidWithZero R] (n : ℕ) := MulChar.toUnitHom (ZMod n) R
but given the equivalence equivToUnitHom, I think it might be easier to keep the original definition?

Your help is much appreciated, thank you!

mo271 and others added 2 commits September 18, 2023 20:58
Co-authored-by: Kevin Buzzard <k.buzzard@imperial.ac.uk>
@riccardobrasca
Copy link
Copy Markdown
Member

@MichaelStollBayreuth Do you think this can be merged now?

@MichaelStollBayreuth
Copy link
Copy Markdown
Contributor

@MichaelStollBayreuth Do you think this can be merged now?

Yes.

@riccardobrasca
Copy link
Copy Markdown
Member

One small comment about using the API for periodic but LGTM, thanks!

bors d+

@bors
Copy link
Copy Markdown

bors bot commented Sep 19, 2023

✌️ mo271 can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@github-actions github-actions bot added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed awaiting-review labels Sep 19, 2023
@mo271
Copy link
Copy Markdown
Collaborator Author

mo271 commented Sep 19, 2023

bors r+

bors bot pushed a commit that referenced this pull request Sep 19, 2023
- [x] depends on: #7013 



Co-authored-by: Moritz Firsching <firsching@google.com>
Co-authored-by: laughinggas <58670661+laughinggas@users.noreply.github.com>
@bors
Copy link
Copy Markdown

bors bot commented Sep 19, 2023

Pull request successfully merged into master.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title feat: Dirichlet character [Merged by Bors] - feat: Dirichlet character Sep 19, 2023
@bors bors bot closed this Sep 19, 2023
@bors bors bot deleted the mo271/dirichlet_character_change_level branch September 19, 2023 14:38
kodyvajjha pushed a commit that referenced this pull request Sep 22, 2023
- [x] depends on: #7013 



Co-authored-by: Moritz Firsching <firsching@google.com>
Co-authored-by: laughinggas <58670661+laughinggas@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants