mathlib icon indicating copy to clipboard operation
mathlib copied to clipboard

feat(number_theory/modular_forms): Modular form definition

Open CBirkbeck opened this issue 2 years ago • 14 comments

This contains the basic definitions of modular forms and cusp forms together with some lemmas about mdifferentiability that are needed.


  • [x] depends on: #15009

Open in Gitpod

CBirkbeck avatar Apr 08 '22 18:04 CBirkbeck

  • [ ] depends on: #12415

CBirkbeck avatar Apr 08 '22 18:04 CBirkbeck

  • [ ] depends on: #15007

CBirkbeck avatar Jun 27 '22 16:06 CBirkbeck

  • [ ] depends on: #15009

CBirkbeck avatar Jun 27 '22 17:06 CBirkbeck

This PR/issue depends on:

  • ~~leanprover-community/mathlib#15009~~ By Dependent Issues (🤖). Happy coding!

bors d=@alexjbest

Vierkantor avatar Sep 24 '22 15:09 Vierkantor

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

bors[bot] avatar Sep 24 '22 15:09 bors[bot]

This looks good to me. @kbuzzard @AlexKontorovich can you have a look?

riccardobrasca avatar Oct 04 '22 16:10 riccardobrasca

Sorry, I only just saw this: I will take a look.

kbuzzard avatar Oct 07 '22 12:10 kbuzzard

Can you set this up to be a graded ring? It seems like this is the mathematics of what you are doing, so you might as well do it explicitly. @eric-wieser @jjaassoonn can probably help with the formalism if you haven't used it before.

hrmacbeth avatar Oct 07 '22 20:10 hrmacbeth

Can you set this up to be a graded ring? It seems like this is the mathematics of what you are doing, so you might as well do it explicitly. @eric-wieser @jjaassoonn can probably help with the formalism if you haven't used it before.

Oh I have it as a graded ring already, but the PR was already quite long, so I haven't included it here. I plan to PR that and some other things later

CBirkbeck avatar Oct 08 '22 15:10 CBirkbeck

This PR has failed to build because of an unrelated timeout. Junyan has fixed the problem with #16873 so after that has been merged to master someone should merge master to this branch and try again. Sorry I've not looked at this PR yet! But right now it doesn't compile for me :-(

kbuzzard avatar Oct 08 '22 22:10 kbuzzard

Can you set this up to be a graded ring? It seems like this is the mathematics of what you are doing, so you might as well do it explicitly. @eric-wieser @jjaassoonn can probably help with the formalism if you haven't used it before.

Oh I have it as a graded ring already, but the PR was already quite long, so I haven't included it here. I plan to PR that and some other things later

OK great! Just wanted to check that your setup would be compatible with the graded ring formalism. What branch is that on?

hrmacbeth avatar Oct 08 '22 22:10 hrmacbeth

Can you set this up to be a graded ring? It seems like this is the mathematics of what you are doing, so you might as well do it explicitly. @eric-wieser @jjaassoonn can probably help with the formalism if you haven't used it before.

Oh I have it as a graded ring already, but the PR was already quite long, so I haven't included it here. I plan to PR that and some other things later

OK great! Just wanted to check that your setup would be compatible with the graded ring formalism. What branch is that on?

So its not on a branch yet, but its here: https://github.com/CBirkbeck/ModularForms/blob/master/src/for_mathlib/mod_forms2.lean (line 306)

I essentially proved and instance of direct_sum.gcomm_ring for (λ k, M k Γ)

CBirkbeck avatar Oct 08 '22 22:10 CBirkbeck

This PR has failed to build because of an unrelated timeout. Junyan has fixed the problem with #16873 so after that has been merged to master someone should merge master to this branch and try again. Sorry I've not looked at this PR yet! But right now it doesn't compile for me :-(

yeah I saw that. I've bumped to see if it works now!

CBirkbeck avatar Oct 08 '22 22:10 CBirkbeck

  • depends on: #17432

CBirkbeck avatar Nov 08 '22 09:11 CBirkbeck

  • depends on: #17675

CBirkbeck avatar Nov 22 '22 09:11 CBirkbeck

  • depends on: #17676

CBirkbeck avatar Nov 22 '22 09:11 CBirkbeck

  • depends on: #17677

CBirkbeck avatar Nov 22 '22 09:11 CBirkbeck

@CBirkbeck You should update the description of the PR to include the new dependencies.

tb65536 avatar Nov 22 '22 19:11 tb65536

This PR/issue depends on:

  • ~~leanprover-community/mathlib#15009~~
  • ~~leanprover-community/mathlib#17677~~
  • ~~leanprover-community/mathlib#17676~~ By Dependent Issues (🤖). Happy coding!

@CBirkbeck Could you merge master?

tb65536 avatar Nov 25 '22 23:11 tb65536

I just looked at the definition of slash_action and found that slash_action β G α γ is exactly same as β → representation γ Gᵐᵒᵖ α. slash_action has weaker assumptions, but working with α being a γ-module should be general enough. (I wonder why the unused_argument linter doesn't complain about the [has_one α] though.) We also have representation.invariants for slash_invariant_forms.

slash_action was added in #15007 and representation earlier in #13573, but maybe @CBirkbeck isn't aware of the work.

cc @antoinelab01

alreadydone avatar Nov 30 '22 01:11 alreadydone

I just looked at the definition of slash_action and found that slash_action β G α γ is exactly same as β → representation γ Gᵐᵒᵖ α. slash_action has weaker assumptions, but working with α being a γ-module should be general enough. (I wonder why the unused_argument linter doesn't complain about the [has_one α] though.) We also have representation.invariants for slash_invariant_forms.

slash_action was added in #15007 and representation earlier in #13573, but maybe @CBirkbeck isn't aware of the work.

cc @antoinelab01

Is #17765 related to this?

riccardobrasca avatar Nov 30 '22 10:11 riccardobrasca

I just looked at the definition of slash_action and found that slash_action β G α γ is exactly same as β → representation γ Gᵐᵒᵖ α. slash_action has weaker assumptions, but working with α being a γ-module should be general enough. (I wonder why the unused_argument linter doesn't complain about the [has_one α] though.) We also have representation.invariants for slash_invariant_forms.

slash_action was added in #15007 and representation earlier in #13573, but maybe @CBirkbeck isn't aware of the work.

cc @antoinelab01

No I wasn't aware of this and no one stopped me making this class :P . I'm not sure whats best here.

Edit: But you make a good point about the has_one I honestly don't remember why its there. I felt that everything I added was because I at one point needed it, but maybe this was a leftover from a previous version.

CBirkbeck avatar Nov 30 '22 10:11 CBirkbeck

Edit: But you make a good point about the has_one I honestly don't remember why its there. I felt that everything I added was because I at one point needed it, but maybe this was a leftover from a previous version.

You probably need it for the graded algebra instance, right?

hrmacbeth avatar Dec 02 '22 16:12 hrmacbeth

Edit: But you make a good point about the has_one I honestly don't remember why its there. I felt that everything I added was because I at one point needed it, but maybe this was a leftover from a previous version.

You probably need it for the graded algebra instance, right?

Hmm maybe, but its hard to check as the code is out of date now. That said, it now seems harder to prove a gcomm_ring instance for (λ k, modular_form Γ k). It wants me to show that 1.mul f == f which I don't know how to do. Has making things their own type made it so that now we need to deal with these things? Because with the previous iteration of the definition, I managed to get away with never worrying about k + 0 = k issues.

CBirkbeck avatar Dec 05 '22 10:12 CBirkbeck

I am little bit lost because of the huge amount of comments, but unless there is something we're sure is wrong, I propose to merge this: it now only create a new file, so it cannot really do anything bad. If something is badly designed and can be improved, we can do it in another PR, and in any case the best way to test the actual design is to use it.

riccardobrasca avatar Dec 05 '22 11:12 riccardobrasca

@riccardobrasca This does seem like a real issue to me. But the graded ring setup is rather complicated and I'm not sure that in my quick test just now I was using it correctly. Maybe @eric-wieser, who has written some of the few existing graded ring instances, can comment. If the fun_like setting is incompatible with the graded ring instance, then I think we should choose the graded ring instance (ping @mcdoll who advocated for fun_like).

hrmacbeth avatar Dec 05 '22 13:12 hrmacbeth

I will try to make time to look at this tomorrow. Please ping me if I forget!

eric-wieser avatar Dec 05 '22 13:12 eric-wieser

Sorry, I haven't followed the discussion. Almost all of my Lean attention is at mathlib4 at the moment. When I originally suggested fun_like, I was completely ignorant of the graded ring instance, but it seems to me that fun_like should be the way to go (or else we have to rethink how to implement functions in mathlib again, but please not in this PR). I feel very bad for causing so much work for Chris and would really like to see modular forms in mathlib.

mcdoll avatar Dec 05 '22 13:12 mcdoll

Yeah this graded ring thing it annoying. Before I could use sigma.subtype_ext but now I only have sigma.ext which involves these ==. I guess one could maybe define the space of modular forms (of any weight and level) and then have these spaces as subtypes of that(?) But this feels almost like going back to the non-fun_like definition. I should say I'm trying to prove an instance of direct_sum.gcomm_ring which is what I had managed to prove before. At somepoint someone suggested using set_like.graded_monoid and going from there. But I can't seem to get the correct set_like instance.

CBirkbeck avatar Dec 05 '22 15:12 CBirkbeck