number_theory.modular_forms.basic โŸท Mathlib.NumberTheory.ModularForms.Basic

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -126,14 +126,14 @@ theorem CuspForm.toFun_eq_coe {f : CuspForm ฮ“ k} : f.toFun = (f : โ„ โ†’ โ„‚)
 #print ModularForm.ext /-
 @[ext]
 theorem ModularForm.ext {f g : ModularForm ฮ“ k} (h : โˆ€ x, f x = g x) : f = g :=
-  FunLike.ext f g h
+  DFunLike.ext f g h
 #align modular_form.ext ModularForm.ext
 -/
 
 #print CuspForm.ext /-
 @[ext]
 theorem CuspForm.ext {f g : CuspForm ฮ“ k} (h : โˆ€ x, f x = g x) : f = g :=
-  FunLike.ext f g h
+  DFunLike.ext f g h
 #align cusp_form.ext CuspForm.ext
 -/
 
@@ -294,7 +294,7 @@ theorem sub_apply (f g : ModularForm ฮ“ k) (z : โ„) : (f - g) z = f z - g z :=
 -/
 
 instance : AddCommGroup (ModularForm ฮ“ k) :=
-  FunLike.coe_injective.AddCommGroup _ rfl coe_add coe_neg coe_sub coe_smul coe_smul
+  DFunLike.coe_injective.AddCommGroup _ rfl coe_add coe_neg coe_sub coe_smul coe_smul
 
 #print ModularForm.coeHom /-
 /-- Additive coercion from `modular_form` to `โ„ โ†’ โ„‚`. -/
@@ -307,7 +307,7 @@ def coeHom : ModularForm ฮ“ k โ†’+ โ„ โ†’ โ„‚ where
 -/
 
 instance : Module โ„‚ (ModularForm ฮ“ k) :=
-  Function.Injective.module โ„‚ coeHom FunLike.coe_injective fun _ _ => rfl
+  Function.Injective.module โ„‚ coeHom DFunLike.coe_injective fun _ _ => rfl
 
 instance : Inhabited (ModularForm ฮ“ k) :=
   โŸจ0โŸฉ
@@ -477,7 +477,7 @@ theorem sub_apply (f g : CuspForm ฮ“ k) (z : โ„) : (f - g) z = f z - g z :=
 -/
 
 instance : AddCommGroup (CuspForm ฮ“ k) :=
-  FunLike.coe_injective.AddCommGroup _ rfl coe_add coe_neg coe_sub coe_smul coe_smul
+  DFunLike.coe_injective.AddCommGroup _ rfl coe_add coe_neg coe_sub coe_smul coe_smul
 
 #print CuspForm.coeHom /-
 /-- Additive coercion from `cusp_form` to `โ„ โ†’ โ„‚`. -/
@@ -490,15 +490,15 @@ def coeHom : CuspForm ฮ“ k โ†’+ โ„ โ†’ โ„‚ where
 -/
 
 instance : Module โ„‚ (CuspForm ฮ“ k) :=
-  Function.Injective.module โ„‚ coeHom FunLike.coe_injective fun _ _ => rfl
+  Function.Injective.module โ„‚ coeHom DFunLike.coe_injective fun _ _ => rfl
 
 instance : Inhabited (CuspForm ฮ“ k) :=
   โŸจ0โŸฉ
 
 instance (priority := 99) [CuspFormClass F ฮ“ k] : ModularFormClass F ฮ“ k
     where
-  coe := FunLike.coe
-  coe_injective' := FunLike.coe_injective'
+  coe := DFunLike.coe
+  coe_injective' := DFunLike.coe_injective'
   slash_action_eq := CuspFormClass.slash_action_eq
   holo := CuspFormClass.holo
   bdd_at_infty _ _ := (CuspFormClass.zero_at_infty _ _).BoundedAtFilter
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2022 Chris Birkbeck. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Chris Birkbeck
 -/
-import Mathbin.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty
-import Mathbin.Analysis.Complex.UpperHalfPlane.Manifold
-import Mathbin.NumberTheory.ModularForms.SlashInvariantForms
+import Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty
+import Analysis.Complex.UpperHalfPlane.Manifold
+import NumberTheory.ModularForms.SlashInvariantForms
 
 #align_import number_theory.modular_forms.basic from "leanprover-community/mathlib"@"1a51edf13debfcbe223fa06b1cb353b9ed9751cc"
 
Diff
@@ -194,15 +194,15 @@ theorem add_apply (f g : ModularForm ฮ“ k) (z : โ„) : (f + g) z = f z + g z :=
 #align modular_form.add_apply ModularForm.add_apply
 -/
 
-#print ModularForm.hasZero /-
-instance hasZero : Zero (ModularForm ฮ“ k) :=
+#print ModularForm.instZero /-
+instance instZero : Zero (ModularForm ฮ“ k) :=
   โŸจ{
       (0 :
         SlashInvariantForm ฮ“
           k) with
       holo' := fun _ => mdifferentiableAt_const ๐“˜(โ„‚, โ„‚) ๐“˜(โ„‚, โ„‚)
       bdd_at_infty' := fun A => by simpa using zero_form_is_bounded_at_im_infty }โŸฉ
-#align modular_form.has_zero ModularForm.hasZero
+#align modular_form.has_zero ModularForm.instZero
 -/
 
 #print ModularForm.coe_zero /-
@@ -223,14 +223,14 @@ section
 
 variable {ฮฑ : Type _} [SMul ฮฑ โ„‚] [IsScalarTower ฮฑ โ„‚ โ„‚]
 
-#print ModularForm.hasSmul /-
-instance hasSmul : SMul ฮฑ (ModularForm ฮ“ k) :=
+#print ModularForm.instSMul /-
+instance instSMul : SMul ฮฑ (ModularForm ฮ“ k) :=
   โŸจfun c f =>
     { c โ€ข (f : SlashInvariantForm ฮ“ k) with
       toFun := c โ€ข f
       holo' := by simpa using f.holo'.const_smul (c โ€ข (1 : โ„‚))
       bdd_at_infty' := fun A => by simpa using (f.bdd_at_infty' A).const_smul_left (c โ€ข (1 : โ„‚)) }โŸฉ
-#align modular_form.has_smul ModularForm.hasSmul
+#align modular_form.has_smul ModularForm.instSMul
 -/
 
 #print ModularForm.coe_smul /-
@@ -249,14 +249,14 @@ theorem smul_apply (f : ModularForm ฮ“ k) (n : ฮฑ) (z : โ„) : (n โ€ข f) z = n 
 
 end
 
-#print ModularForm.hasNeg /-
-instance hasNeg : Neg (ModularForm ฮ“ k) :=
+#print ModularForm.instNeg /-
+instance instNeg : Neg (ModularForm ฮ“ k) :=
   โŸจfun f =>
     { -(f : SlashInvariantForm ฮ“ k) with
       toFun := -f
       holo' := f.holo'.neg
       bdd_at_infty' := fun A => by simpa using (f.bdd_at_infty' A).neg }โŸฉ
-#align modular_form.has_neg ModularForm.hasNeg
+#align modular_form.has_neg ModularForm.instNeg
 -/
 
 #print ModularForm.coe_neg /-
@@ -273,10 +273,10 @@ theorem neg_apply (f : ModularForm ฮ“ k) (z : โ„) : (-f) z = -f z :=
 #align modular_form.neg_apply ModularForm.neg_apply
 -/
 
-#print ModularForm.hasSub /-
-instance hasSub : Sub (ModularForm ฮ“ k) :=
+#print ModularForm.instSub /-
+instance instSub : Sub (ModularForm ฮ“ k) :=
   โŸจfun f g => f + -gโŸฉ
-#align modular_form.has_sub ModularForm.hasSub
+#align modular_form.has_sub ModularForm.instSub
 -/
 
 #print ModularForm.coe_sub /-
@@ -379,13 +379,13 @@ theorem add_apply (f g : CuspForm ฮ“ k) (z : โ„) : (f + g) z = f z + g z :=
 #align cusp_form.add_apply CuspForm.add_apply
 -/
 
-#print CuspForm.hasZero /-
-instance hasZero : Zero (CuspForm ฮ“ k) :=
+#print CuspForm.instZero /-
+instance instZero : Zero (CuspForm ฮ“ k) :=
   โŸจ{ (0 : SlashInvariantForm ฮ“ k) with
       toFun := 0
       holo' := fun _ => mdifferentiableAt_const ๐“˜(โ„‚, โ„‚) ๐“˜(โ„‚, โ„‚)
       zero_at_infty' := by simpa using Filter.zero_zeroAtFilter _ }โŸฉ
-#align cusp_form.has_zero CuspForm.hasZero
+#align cusp_form.has_zero CuspForm.instZero
 -/
 
 #print CuspForm.coe_zero /-
@@ -406,14 +406,14 @@ section
 
 variable {ฮฑ : Type _} [SMul ฮฑ โ„‚] [IsScalarTower ฮฑ โ„‚ โ„‚]
 
-#print CuspForm.hasSmul /-
-instance hasSmul : SMul ฮฑ (CuspForm ฮ“ k) :=
+#print CuspForm.instSMul /-
+instance instSMul : SMul ฮฑ (CuspForm ฮ“ k) :=
   โŸจfun c f =>
     { c โ€ข (f : SlashInvariantForm ฮ“ k) with
       toFun := c โ€ข f
       holo' := by simpa using f.holo'.const_smul (c โ€ข (1 : โ„‚))
       zero_at_infty' := fun A => by simpa using (f.zero_at_infty' A).smul (c โ€ข (1 : โ„‚)) }โŸฉ
-#align cusp_form.has_smul CuspForm.hasSmul
+#align cusp_form.has_smul CuspForm.instSMul
 -/
 
 #print CuspForm.coe_smul /-
@@ -432,14 +432,14 @@ theorem smul_apply (f : CuspForm ฮ“ k) (n : ฮฑ) {z : โ„} : (n โ€ข f) z = n โ€ข
 
 end
 
-#print CuspForm.hasNeg /-
-instance hasNeg : Neg (CuspForm ฮ“ k) :=
+#print CuspForm.instNeg /-
+instance instNeg : Neg (CuspForm ฮ“ k) :=
   โŸจfun f =>
     { -(f : SlashInvariantForm ฮ“ k) with
       toFun := -f
       holo' := f.holo'.neg
       zero_at_infty' := fun A => by simpa using (f.zero_at_infty' A).neg }โŸฉ
-#align cusp_form.has_neg CuspForm.hasNeg
+#align cusp_form.has_neg CuspForm.instNeg
 -/
 
 #print CuspForm.coe_neg /-
@@ -456,10 +456,10 @@ theorem neg_apply (f : CuspForm ฮ“ k) (z : โ„) : (-f) z = -f z :=
 #align cusp_form.neg_apply CuspForm.neg_apply
 -/
 
-#print CuspForm.hasSub /-
-instance hasSub : Sub (CuspForm ฮ“ k) :=
+#print CuspForm.instSub /-
+instance instSub : Sub (CuspForm ฮ“ k) :=
   โŸจfun f g => f + -gโŸฉ
-#align cusp_form.has_sub CuspForm.hasSub
+#align cusp_form.has_sub CuspForm.instSub
 -/
 
 #print CuspForm.coe_sub /-
Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2022 Chris Birkbeck. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Chris Birkbeck
-
-! This file was ported from Lean 3 source module number_theory.modular_forms.basic
-! leanprover-community/mathlib commit 1a51edf13debfcbe223fa06b1cb353b9ed9751cc
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty
 import Mathbin.Analysis.Complex.UpperHalfPlane.Manifold
 import Mathbin.NumberTheory.ModularForms.SlashInvariantForms
 
+#align_import number_theory.modular_forms.basic from "leanprover-community/mathlib"@"1a51edf13debfcbe223fa06b1cb353b9ed9751cc"
+
 /-!
 # Modular forms
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Chris Birkbeck
 
 ! This file was ported from Lean 3 source module number_theory.modular_forms.basic
-! leanprover-community/mathlib commit 57f9349f2fe19d2de7207e99b0341808d977cdcf
+! leanprover-community/mathlib commit 1a51edf13debfcbe223fa06b1cb353b9ed9751cc
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -15,6 +15,9 @@ import Mathbin.NumberTheory.ModularForms.SlashInvariantForms
 /-!
 # Modular forms
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file defines modular forms and proves some basic properties about them.
 
 We begin by defining modular forms and cusp forms as extension of `slash_invariant_forms` then we
Diff
@@ -43,24 +43,29 @@ variable (F : Type _) (ฮ“ : Subgroup SL(2, โ„ค)) (k : โ„ค)
 
 open scoped ModularForm
 
+#print ModularForm /-
 /-- These are `slash_invariant_form`'s that are holomophic and bounded at infinity. -/
 structure ModularForm extends SlashInvariantForm ฮ“ k where
   holo' : MDifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (to_fun : โ„ โ†’ โ„‚)
   bdd_at_infty' : โˆ€ A : SL(2, โ„ค), IsBoundedAtImInfty (to_fun โˆฃ[k] A)
 #align modular_form ModularForm
+-/
 
 /-- The `slash_invariant_form` associated to a `modular_form`. -/
 add_decl_doc ModularForm.toSlashInvariantForm
 
+#print CuspForm /-
 /-- These are `slash_invariant_form`s that are holomophic and zero at infinity. -/
 structure CuspForm extends SlashInvariantForm ฮ“ k where
   holo' : MDifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (to_fun : โ„ โ†’ โ„‚)
   zero_at_infty' : โˆ€ A : SL(2, โ„ค), IsZeroAtImInfty (to_fun โˆฃ[k] A)
 #align cusp_form CuspForm
+-/
 
 /-- The `slash_invariant_form` associated to a `cusp_form`. -/
 add_decl_doc CuspForm.toSlashInvariantForm
 
+#print ModularFormClass /-
 /-- `modular_form_class F ฮ“ k` says that `F` is a type of bundled functions that extend
 `slash_invariant_form_class` by requiring that the functions be holomorphic and bounded
 at infinity. -/
@@ -68,7 +73,9 @@ class ModularFormClass extends SlashInvariantFormClass F ฮ“ k where
   holo : โˆ€ f : F, MDifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (f : โ„ โ†’ โ„‚)
   bdd_at_infty : โˆ€ (f : F) (A : SL(2, โ„ค)), IsBoundedAtImInfty (f โˆฃ[k] A)
 #align modular_form_class ModularFormClass
+-/
 
+#print CuspFormClass /-
 /-- `cusp_form_class F ฮ“ k` says that `F` is a type of bundled functions that extend
 `slash_invariant_form_class` by requiring that the functions be holomorphic and zero
 at infinity. -/
@@ -76,7 +83,9 @@ class CuspFormClass extends SlashInvariantFormClass F ฮ“ k where
   holo : โˆ€ f : F, MDifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (f : โ„ โ†’ โ„‚)
   zero_at_infty : โˆ€ (f : F) (A : SL(2, โ„ค)), IsZeroAtImInfty (f โˆฃ[k] A)
 #align cusp_form_class CuspFormClass
+-/
 
+#print ModularFormClass.modularForm /-
 instance (priority := 100) ModularFormClass.modularForm : ModularFormClass (ModularForm ฮ“ k) ฮ“ k
     where
   coe := ModularForm.toFun
@@ -85,7 +94,9 @@ instance (priority := 100) ModularFormClass.modularForm : ModularFormClass (Modu
   holo := ModularForm.holo'
   bdd_at_infty := ModularForm.bdd_at_infty'
 #align modular_form_class.modular_form ModularFormClass.modularForm
+-/
 
+#print CuspFormClass.cuspForm /-
 instance (priority := 100) CuspFormClass.cuspForm : CuspFormClass (CuspForm ฮ“ k) ฮ“ k
     where
   coe := CuspForm.toFun
@@ -94,29 +105,39 @@ instance (priority := 100) CuspFormClass.cuspForm : CuspFormClass (CuspForm ฮ“ k
   holo := CuspForm.holo'
   zero_at_infty := CuspForm.zero_at_infty'
 #align cusp_form_class.cusp_form CuspFormClass.cuspForm
+-/
 
 variable {F ฮ“ k}
 
+#print ModularForm.toFun_eq_coe /-
 @[simp]
-theorem modularForm_toFun_eq_coe {f : ModularForm ฮ“ k} : f.toFun = (f : โ„ โ†’ โ„‚) :=
+theorem ModularForm.toFun_eq_coe {f : ModularForm ฮ“ k} : f.toFun = (f : โ„ โ†’ โ„‚) :=
   rfl
-#align modular_form_to_fun_eq_coe modularForm_toFun_eq_coe
+#align modular_form_to_fun_eq_coe ModularForm.toFun_eq_coe
+-/
 
+#print CuspForm.toFun_eq_coe /-
 @[simp]
-theorem cuspForm_toFun_eq_coe {f : CuspForm ฮ“ k} : f.toFun = (f : โ„ โ†’ โ„‚) :=
+theorem CuspForm.toFun_eq_coe {f : CuspForm ฮ“ k} : f.toFun = (f : โ„ โ†’ โ„‚) :=
   rfl
-#align cusp_form_to_fun_eq_coe cuspForm_toFun_eq_coe
+#align cusp_form_to_fun_eq_coe CuspForm.toFun_eq_coe
+-/
 
+#print ModularForm.ext /-
 @[ext]
 theorem ModularForm.ext {f g : ModularForm ฮ“ k} (h : โˆ€ x, f x = g x) : f = g :=
   FunLike.ext f g h
 #align modular_form.ext ModularForm.ext
+-/
 
+#print CuspForm.ext /-
 @[ext]
 theorem CuspForm.ext {f g : CuspForm ฮ“ k} (h : โˆ€ x, f x = g x) : f = g :=
   FunLike.ext f g h
 #align cusp_form.ext CuspForm.ext
+-/
 
+#print ModularForm.copy /-
 /-- Copy of a `modular_form` with a new `to_fun` equal to the old one. Useful to fix
 definitional equalities. -/
 protected def ModularForm.copy (f : ModularForm ฮ“ k) (f' : โ„ โ†’ โ„‚) (h : f' = โ‡‘f) : ModularForm ฮ“ k
@@ -126,7 +147,9 @@ protected def ModularForm.copy (f : ModularForm ฮ“ k) (f' : โ„ โ†’ โ„‚) (h : f'
   holo' := h.symm โ–ธ f.holo'
   bdd_at_infty' A := h.symm โ–ธ f.bdd_at_infty' A
 #align modular_form.copy ModularForm.copy
+-/
 
+#print CuspForm.copy /-
 /-- Copy of a `cusp_form` with a new `to_fun` equal to the old one. Useful to fix
 definitional equalities. -/
 protected def CuspForm.copy (f : CuspForm ฮ“ k) (f' : โ„ โ†’ โ„‚) (h : f' = โ‡‘f) : CuspForm ฮ“ k
@@ -136,6 +159,7 @@ protected def CuspForm.copy (f : CuspForm ฮ“ k) (f' : โ„ โ†’ โ„‚) (h : f' = โ‡‘
   holo' := h.symm โ–ธ f.holo'
   zero_at_infty' A := h.symm โ–ธ f.zero_at_infty' A
 #align cusp_form.copy CuspForm.copy
+-/
 
 end ModularForm
 
@@ -145,25 +169,32 @@ open SlashInvariantForm
 
 variable {F : Type _} {ฮ“ : Subgroup SL(2, โ„ค)} {k : โ„ค}
 
-instance hasAdd : Add (ModularForm ฮ“ k) :=
+#print ModularForm.add /-
+instance add : Add (ModularForm ฮ“ k) :=
   โŸจfun f g =>
     {
       (f : SlashInvariantForm ฮ“ k) +
         g with
       holo' := f.holo'.add g.holo'
       bdd_at_infty' := fun A => by simpa using (f.bdd_at_infty' A).add (g.bdd_at_infty' A) }โŸฉ
-#align modular_form.has_add ModularForm.hasAdd
+#align modular_form.has_add ModularForm.add
+-/
 
+#print ModularForm.coe_add /-
 @[simp]
 theorem coe_add (f g : ModularForm ฮ“ k) : โ‡‘(f + g) = f + g :=
   rfl
 #align modular_form.coe_add ModularForm.coe_add
+-/
 
+#print ModularForm.add_apply /-
 @[simp]
 theorem add_apply (f g : ModularForm ฮ“ k) (z : โ„) : (f + g) z = f z + g z :=
   rfl
 #align modular_form.add_apply ModularForm.add_apply
+-/
 
+#print ModularForm.hasZero /-
 instance hasZero : Zero (ModularForm ฮ“ k) :=
   โŸจ{
       (0 :
@@ -172,21 +203,27 @@ instance hasZero : Zero (ModularForm ฮ“ k) :=
       holo' := fun _ => mdifferentiableAt_const ๐“˜(โ„‚, โ„‚) ๐“˜(โ„‚, โ„‚)
       bdd_at_infty' := fun A => by simpa using zero_form_is_bounded_at_im_infty }โŸฉ
 #align modular_form.has_zero ModularForm.hasZero
+-/
 
+#print ModularForm.coe_zero /-
 @[simp]
 theorem coe_zero : โ‡‘(0 : ModularForm ฮ“ k) = (0 : โ„ โ†’ โ„‚) :=
   rfl
 #align modular_form.coe_zero ModularForm.coe_zero
+-/
 
+#print ModularForm.zero_apply /-
 @[simp]
 theorem zero_apply (z : โ„) : (0 : ModularForm ฮ“ k) z = 0 :=
   rfl
 #align modular_form.zero_apply ModularForm.zero_apply
+-/
 
 section
 
 variable {ฮฑ : Type _} [SMul ฮฑ โ„‚] [IsScalarTower ฮฑ โ„‚ โ„‚]
 
+#print ModularForm.hasSmul /-
 instance hasSmul : SMul ฮฑ (ModularForm ฮ“ k) :=
   โŸจfun c f =>
     { c โ€ข (f : SlashInvariantForm ฮ“ k) with
@@ -194,19 +231,25 @@ instance hasSmul : SMul ฮฑ (ModularForm ฮ“ k) :=
       holo' := by simpa using f.holo'.const_smul (c โ€ข (1 : โ„‚))
       bdd_at_infty' := fun A => by simpa using (f.bdd_at_infty' A).const_smul_left (c โ€ข (1 : โ„‚)) }โŸฉ
 #align modular_form.has_smul ModularForm.hasSmul
+-/
 
+#print ModularForm.coe_smul /-
 @[simp]
 theorem coe_smul (f : ModularForm ฮ“ k) (n : ฮฑ) : โ‡‘(n โ€ข f) = n โ€ข f :=
   rfl
 #align modular_form.coe_smul ModularForm.coe_smul
+-/
 
+#print ModularForm.smul_apply /-
 @[simp]
 theorem smul_apply (f : ModularForm ฮ“ k) (n : ฮฑ) (z : โ„) : (n โ€ข f) z = n โ€ข f z :=
   rfl
 #align modular_form.smul_apply ModularForm.smul_apply
+-/
 
 end
 
+#print ModularForm.hasNeg /-
 instance hasNeg : Neg (ModularForm ฮ“ k) :=
   โŸจfun f =>
     { -(f : SlashInvariantForm ฮ“ k) with
@@ -214,34 +257,46 @@ instance hasNeg : Neg (ModularForm ฮ“ k) :=
       holo' := f.holo'.neg
       bdd_at_infty' := fun A => by simpa using (f.bdd_at_infty' A).neg }โŸฉ
 #align modular_form.has_neg ModularForm.hasNeg
+-/
 
+#print ModularForm.coe_neg /-
 @[simp]
 theorem coe_neg (f : ModularForm ฮ“ k) : โ‡‘(-f) = -f :=
   rfl
 #align modular_form.coe_neg ModularForm.coe_neg
+-/
 
+#print ModularForm.neg_apply /-
 @[simp]
 theorem neg_apply (f : ModularForm ฮ“ k) (z : โ„) : (-f) z = -f z :=
   rfl
 #align modular_form.neg_apply ModularForm.neg_apply
+-/
 
+#print ModularForm.hasSub /-
 instance hasSub : Sub (ModularForm ฮ“ k) :=
   โŸจfun f g => f + -gโŸฉ
 #align modular_form.has_sub ModularForm.hasSub
+-/
 
+#print ModularForm.coe_sub /-
 @[simp]
 theorem coe_sub (f g : ModularForm ฮ“ k) : โ‡‘(f - g) = f - g :=
   rfl
 #align modular_form.coe_sub ModularForm.coe_sub
+-/
 
+#print ModularForm.sub_apply /-
 @[simp]
 theorem sub_apply (f g : ModularForm ฮ“ k) (z : โ„) : (f - g) z = f z - g z :=
   rfl
 #align modular_form.sub_apply ModularForm.sub_apply
+-/
 
 instance : AddCommGroup (ModularForm ฮ“ k) :=
   FunLike.coe_injective.AddCommGroup _ rfl coe_add coe_neg coe_sub coe_smul coe_smul
 
+#print ModularForm.coeHom /-
 /-- Additive coercion from `modular_form` to `โ„ โ†’ โ„‚`. -/
 @[simps]
 def coeHom : ModularForm ฮ“ k โ†’+ โ„ โ†’ โ„‚ where
@@ -249,6 +304,7 @@ def coeHom : ModularForm ฮ“ k โ†’+ โ„ โ†’ โ„‚ where
   map_zero' := coe_zero
   map_add' _ _ := rfl
 #align modular_form.coe_hom ModularForm.coeHom
+-/
 
 instance : Module โ„‚ (ModularForm ฮ“ k) :=
   Function.Injective.module โ„‚ coeHom FunLike.coe_injective fun _ _ => rfl
@@ -256,6 +312,7 @@ instance : Module โ„‚ (ModularForm ฮ“ k) :=
 instance : Inhabited (ModularForm ฮ“ k) :=
   โŸจ0โŸฉ
 
+#print ModularForm.mul /-
 /-- The modular form of weight `k_1 + k_2` given by the product of two modular forms of weights
 `k_1` and `k_2`. -/
 def mul {k_1 k_2 : โ„ค} {ฮ“ : Subgroup SL(2, โ„ค)} (f : ModularForm ฮ“ k_1) (g : ModularForm ฮ“ k_2) :
@@ -265,12 +322,15 @@ def mul {k_1 k_2 : โ„ค} {ฮ“ : Subgroup SL(2, โ„ค)} (f : ModularForm ฮ“ k_1) (g :
   holo' := f.holo'.mul g.holo'
   bdd_at_infty' A := by simpa using (f.bdd_at_infty' A).mul (g.bdd_at_infty' A)
 #align modular_form.mul ModularForm.mul
+-/
 
+#print ModularForm.mul_coe /-
 @[simp]
 theorem mul_coe {k_1 k_2 : โ„ค} {ฮ“ : Subgroup SL(2, โ„ค)} (f : ModularForm ฮ“ k_1)
     (g : ModularForm ฮ“ k_2) : (f.mul g : โ„ โ†’ โ„‚) = f * g :=
   rfl
 #align modular_form.mul_coe ModularForm.mul_coe
+-/
 
 instance : One (ModularForm ฮ“ 0) :=
   โŸจ{
@@ -280,10 +340,12 @@ instance : One (ModularForm ฮ“ 0) :=
       holo' := fun x => mdifferentiableAt_const ๐“˜(โ„‚, โ„‚) ๐“˜(โ„‚, โ„‚)
       bdd_at_infty' := fun A => by simpa using at_im_infty.const_bounded_at_filter (1 : โ„‚) }โŸฉ
 
+#print ModularForm.one_coe_eq_one /-
 @[simp]
 theorem one_coe_eq_one : ((1 : ModularForm ฮ“ 0) : โ„ โ†’ โ„‚) = 1 :=
   rfl
 #align modular_form.one_coe_eq_one ModularForm.one_coe_eq_one
+-/
 
 end ModularForm
 
@@ -293,6 +355,7 @@ open ModularForm
 
 variable {F : Type _} {ฮ“ : Subgroup SL(2, โ„ค)} {k : โ„ค}
 
+#print CuspForm.hasAdd /-
 instance hasAdd : Add (CuspForm ฮ“ k) :=
   โŸจfun f g =>
     { (f : SlashInvariantForm ฮ“ k) + g with
@@ -300,38 +363,50 @@ instance hasAdd : Add (CuspForm ฮ“ k) :=
       holo' := f.holo'.add g.holo'
       zero_at_infty' := fun A => by simpa using (f.zero_at_infty' A).add (g.zero_at_infty' A) }โŸฉ
 #align cusp_form.has_add CuspForm.hasAdd
+-/
 
+#print CuspForm.coe_add /-
 @[simp]
 theorem coe_add (f g : CuspForm ฮ“ k) : โ‡‘(f + g) = f + g :=
   rfl
 #align cusp_form.coe_add CuspForm.coe_add
+-/
 
+#print CuspForm.add_apply /-
 @[simp]
 theorem add_apply (f g : CuspForm ฮ“ k) (z : โ„) : (f + g) z = f z + g z :=
   rfl
 #align cusp_form.add_apply CuspForm.add_apply
+-/
 
+#print CuspForm.hasZero /-
 instance hasZero : Zero (CuspForm ฮ“ k) :=
   โŸจ{ (0 : SlashInvariantForm ฮ“ k) with
       toFun := 0
       holo' := fun _ => mdifferentiableAt_const ๐“˜(โ„‚, โ„‚) ๐“˜(โ„‚, โ„‚)
       zero_at_infty' := by simpa using Filter.zero_zeroAtFilter _ }โŸฉ
 #align cusp_form.has_zero CuspForm.hasZero
+-/
 
+#print CuspForm.coe_zero /-
 @[simp]
 theorem coe_zero : โ‡‘(0 : CuspForm ฮ“ k) = (0 : โ„ โ†’ โ„‚) :=
   rfl
 #align cusp_form.coe_zero CuspForm.coe_zero
+-/
 
+#print CuspForm.zero_apply /-
 @[simp]
 theorem zero_apply (z : โ„) : (0 : CuspForm ฮ“ k) z = 0 :=
   rfl
 #align cusp_form.zero_apply CuspForm.zero_apply
+-/
 
 section
 
 variable {ฮฑ : Type _} [SMul ฮฑ โ„‚] [IsScalarTower ฮฑ โ„‚ โ„‚]
 
+#print CuspForm.hasSmul /-
 instance hasSmul : SMul ฮฑ (CuspForm ฮ“ k) :=
   โŸจfun c f =>
     { c โ€ข (f : SlashInvariantForm ฮ“ k) with
@@ -339,19 +414,25 @@ instance hasSmul : SMul ฮฑ (CuspForm ฮ“ k) :=
       holo' := by simpa using f.holo'.const_smul (c โ€ข (1 : โ„‚))
       zero_at_infty' := fun A => by simpa using (f.zero_at_infty' A).smul (c โ€ข (1 : โ„‚)) }โŸฉ
 #align cusp_form.has_smul CuspForm.hasSmul
+-/
 
+#print CuspForm.coe_smul /-
 @[simp]
 theorem coe_smul (f : CuspForm ฮ“ k) (n : ฮฑ) : โ‡‘(n โ€ข f) = n โ€ข f :=
   rfl
 #align cusp_form.coe_smul CuspForm.coe_smul
+-/
 
+#print CuspForm.smul_apply /-
 @[simp]
 theorem smul_apply (f : CuspForm ฮ“ k) (n : ฮฑ) {z : โ„} : (n โ€ข f) z = n โ€ข f z :=
   rfl
 #align cusp_form.smul_apply CuspForm.smul_apply
+-/
 
 end
 
+#print CuspForm.hasNeg /-
 instance hasNeg : Neg (CuspForm ฮ“ k) :=
   โŸจfun f =>
     { -(f : SlashInvariantForm ฮ“ k) with
@@ -359,34 +440,46 @@ instance hasNeg : Neg (CuspForm ฮ“ k) :=
       holo' := f.holo'.neg
       zero_at_infty' := fun A => by simpa using (f.zero_at_infty' A).neg }โŸฉ
 #align cusp_form.has_neg CuspForm.hasNeg
+-/
 
+#print CuspForm.coe_neg /-
 @[simp]
 theorem coe_neg (f : CuspForm ฮ“ k) : โ‡‘(-f) = -f :=
   rfl
 #align cusp_form.coe_neg CuspForm.coe_neg
+-/
 
+#print CuspForm.neg_apply /-
 @[simp]
 theorem neg_apply (f : CuspForm ฮ“ k) (z : โ„) : (-f) z = -f z :=
   rfl
 #align cusp_form.neg_apply CuspForm.neg_apply
+-/
 
+#print CuspForm.hasSub /-
 instance hasSub : Sub (CuspForm ฮ“ k) :=
   โŸจfun f g => f + -gโŸฉ
 #align cusp_form.has_sub CuspForm.hasSub
+-/
 
+#print CuspForm.coe_sub /-
 @[simp]
 theorem coe_sub (f g : CuspForm ฮ“ k) : โ‡‘(f - g) = f - g :=
   rfl
 #align cusp_form.coe_sub CuspForm.coe_sub
+-/
 
+#print CuspForm.sub_apply /-
 @[simp]
 theorem sub_apply (f g : CuspForm ฮ“ k) (z : โ„) : (f - g) z = f z - g z :=
   rfl
 #align cusp_form.sub_apply CuspForm.sub_apply
+-/
 
 instance : AddCommGroup (CuspForm ฮ“ k) :=
   FunLike.coe_injective.AddCommGroup _ rfl coe_add coe_neg coe_sub coe_smul coe_smul
 
+#print CuspForm.coeHom /-
 /-- Additive coercion from `cusp_form` to `โ„ โ†’ โ„‚`. -/
 @[simps]
 def coeHom : CuspForm ฮ“ k โ†’+ โ„ โ†’ โ„‚ where
@@ -394,6 +487,7 @@ def coeHom : CuspForm ฮ“ k โ†’+ โ„ โ†’ โ„‚ where
   map_zero' := CuspForm.coe_zero
   map_add' _ _ := rfl
 #align cusp_form.coe_hom CuspForm.coeHom
+-/
 
 instance : Module โ„‚ (CuspForm ฮ“ k) :=
   Function.Injective.module โ„‚ coeHom FunLike.coe_injective fun _ _ => rfl
Diff
@@ -45,7 +45,7 @@ open scoped ModularForm
 
 /-- These are `slash_invariant_form`'s that are holomophic and bounded at infinity. -/
 structure ModularForm extends SlashInvariantForm ฮ“ k where
-  holo' : Mdifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (to_fun : โ„ โ†’ โ„‚)
+  holo' : MDifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (to_fun : โ„ โ†’ โ„‚)
   bdd_at_infty' : โˆ€ A : SL(2, โ„ค), IsBoundedAtImInfty (to_fun โˆฃ[k] A)
 #align modular_form ModularForm
 
@@ -54,7 +54,7 @@ add_decl_doc ModularForm.toSlashInvariantForm
 
 /-- These are `slash_invariant_form`s that are holomophic and zero at infinity. -/
 structure CuspForm extends SlashInvariantForm ฮ“ k where
-  holo' : Mdifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (to_fun : โ„ โ†’ โ„‚)
+  holo' : MDifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (to_fun : โ„ โ†’ โ„‚)
   zero_at_infty' : โˆ€ A : SL(2, โ„ค), IsZeroAtImInfty (to_fun โˆฃ[k] A)
 #align cusp_form CuspForm
 
@@ -65,7 +65,7 @@ add_decl_doc CuspForm.toSlashInvariantForm
 `slash_invariant_form_class` by requiring that the functions be holomorphic and bounded
 at infinity. -/
 class ModularFormClass extends SlashInvariantFormClass F ฮ“ k where
-  holo : โˆ€ f : F, Mdifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (f : โ„ โ†’ โ„‚)
+  holo : โˆ€ f : F, MDifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (f : โ„ โ†’ โ„‚)
   bdd_at_infty : โˆ€ (f : F) (A : SL(2, โ„ค)), IsBoundedAtImInfty (f โˆฃ[k] A)
 #align modular_form_class ModularFormClass
 
@@ -73,7 +73,7 @@ class ModularFormClass extends SlashInvariantFormClass F ฮ“ k where
 `slash_invariant_form_class` by requiring that the functions be holomorphic and zero
 at infinity. -/
 class CuspFormClass extends SlashInvariantFormClass F ฮ“ k where
-  holo : โˆ€ f : F, Mdifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (f : โ„ โ†’ โ„‚)
+  holo : โˆ€ f : F, MDifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (f : โ„ โ†’ โ„‚)
   zero_at_infty : โˆ€ (f : F) (A : SL(2, โ„ค)), IsZeroAtImInfty (f โˆฃ[k] A)
 #align cusp_form_class CuspFormClass
 
Diff
@@ -4,12 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Chris Birkbeck
 
 ! This file was ported from Lean 3 source module number_theory.modular_forms.basic
-! leanprover-community/mathlib commit 59150e4a8ab64a88e35d5cfa0a17b762a68acfe9
+! leanprover-community/mathlib commit 57f9349f2fe19d2de7207e99b0341808d977cdcf
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty
-import Mathbin.Analysis.Complex.UpperHalfPlane.Topology
+import Mathbin.Analysis.Complex.UpperHalfPlane.Manifold
 import Mathbin.NumberTheory.ModularForms.SlashInvariantForms
 
 /-!
Diff
@@ -29,13 +29,10 @@ open scoped Topology Manifold UpperHalfPlane
 
 noncomputable section
 
--- mathport name: ยซexprโ†‘โ‚˜ ยป
 local prefix:1024 "โ†‘โ‚˜" => @coe _ (Matrix (Fin 2) (Fin 2) _) _
 
--- mathport name: ยซexprGL( , )โบยป
 local notation "GL(" n ", " R ")" "โบ" => Matrix.GLPos (Fin n) R
 
--- mathport name: ยซexprSL( , )ยป
 local notation "SL(" n ", " R ")" => Matrix.SpecialLinearGroup (Fin n) R
 
 section ModularForm
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Chris Birkbeck
 
 ! This file was ported from Lean 3 source module number_theory.modular_forms.basic
-! leanprover-community/mathlib commit ef74e2bd3a553d31fdb139188a251509b6c6b038
+! leanprover-community/mathlib commit 59150e4a8ab64a88e35d5cfa0a17b762a68acfe9
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -65,7 +65,7 @@ structure CuspForm extends SlashInvariantForm ฮ“ k where
 add_decl_doc CuspForm.toSlashInvariantForm
 
 /-- `modular_form_class F ฮ“ k` says that `F` is a type of bundled functions that extend
-`slash_invariant_forms_class` by requiring that the functions be holomorphic and bounded
+`slash_invariant_form_class` by requiring that the functions be holomorphic and bounded
 at infinity. -/
 class ModularFormClass extends SlashInvariantFormClass F ฮ“ k where
   holo : โˆ€ f : F, Mdifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (f : โ„ โ†’ โ„‚)
@@ -73,7 +73,7 @@ class ModularFormClass extends SlashInvariantFormClass F ฮ“ k where
 #align modular_form_class ModularFormClass
 
 /-- `cusp_form_class F ฮ“ k` says that `F` is a type of bundled functions that extend
-`slash_invariant_forms_class` by requiring that the functions be holomorphic and zero
+`slash_invariant_form_class` by requiring that the functions be holomorphic and zero
 at infinity. -/
 class CuspFormClass extends SlashInvariantFormClass F ฮ“ k where
   holo : โˆ€ f : F, Mdifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (f : โ„ โ†’ โ„‚)
Diff
@@ -25,7 +25,7 @@ modular form.
 
 open Complex UpperHalfPlane
 
-open Topology Manifold UpperHalfPlane
+open scoped Topology Manifold UpperHalfPlane
 
 noncomputable section
 
@@ -44,7 +44,7 @@ open ModularForm
 
 variable (F : Type _) (ฮ“ : Subgroup SL(2, โ„ค)) (k : โ„ค)
 
-open ModularForm
+open scoped ModularForm
 
 /-- These are `slash_invariant_form`'s that are holomophic and bounded at infinity. -/
 structure ModularForm extends SlashInvariantForm ฮ“ k where
Diff
@@ -33,7 +33,7 @@ noncomputable section
 local prefix:1024 "โ†‘โ‚˜" => @coe _ (Matrix (Fin 2) (Fin 2) _) _
 
 -- mathport name: ยซexprGL( , )โบยป
-local notation "GL(" n ", " R ")" "โบ" => Matrix.gLPos (Fin n) R
+local notation "GL(" n ", " R ")" "โบ" => Matrix.GLPos (Fin n) R
 
 -- mathport name: ยซexprSL( , )ยป
 local notation "SL(" n ", " R ")" => Matrix.SpecialLinearGroup (Fin n) R
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Chris Birkbeck
 
 ! This file was ported from Lean 3 source module number_theory.modular_forms.basic
-! leanprover-community/mathlib commit fe44cd36149e675eb5dec87acc7e8f1d6568e081
+! leanprover-community/mathlib commit ef74e2bd3a553d31fdb139188a251509b6c6b038
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -44,13 +44,12 @@ open ModularForm
 
 variable (F : Type _) (ฮ“ : Subgroup SL(2, โ„ค)) (k : โ„ค)
 
--- mathport name: ยซexpr โˆฃ[ , ]ยป
-local notation:73 f "โˆฃ[" k:0 "," A "]" => SlashAction.map โ„‚ k A f
+open ModularForm
 
 /-- These are `slash_invariant_form`'s that are holomophic and bounded at infinity. -/
 structure ModularForm extends SlashInvariantForm ฮ“ k where
   holo' : Mdifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (to_fun : โ„ โ†’ โ„‚)
-  bdd_at_infty' : โˆ€ A : SL(2, โ„ค), IsBoundedAtImInfty (to_funโˆฃ[k,A])
+  bdd_at_infty' : โˆ€ A : SL(2, โ„ค), IsBoundedAtImInfty (to_fun โˆฃ[k] A)
 #align modular_form ModularForm
 
 /-- The `slash_invariant_form` associated to a `modular_form`. -/
@@ -59,7 +58,7 @@ add_decl_doc ModularForm.toSlashInvariantForm
 /-- These are `slash_invariant_form`s that are holomophic and zero at infinity. -/
 structure CuspForm extends SlashInvariantForm ฮ“ k where
   holo' : Mdifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (to_fun : โ„ โ†’ โ„‚)
-  zero_at_infty' : โˆ€ A : SL(2, โ„ค), IsZeroAtImInfty (to_funโˆฃ[k,A])
+  zero_at_infty' : โˆ€ A : SL(2, โ„ค), IsZeroAtImInfty (to_fun โˆฃ[k] A)
 #align cusp_form CuspForm
 
 /-- The `slash_invariant_form` associated to a `cusp_form`. -/
@@ -70,7 +69,7 @@ add_decl_doc CuspForm.toSlashInvariantForm
 at infinity. -/
 class ModularFormClass extends SlashInvariantFormClass F ฮ“ k where
   holo : โˆ€ f : F, Mdifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (f : โ„ โ†’ โ„‚)
-  bdd_at_infty : โˆ€ (f : F) (A : SL(2, โ„ค)), IsBoundedAtImInfty (fโˆฃ[k,A])
+  bdd_at_infty : โˆ€ (f : F) (A : SL(2, โ„ค)), IsBoundedAtImInfty (f โˆฃ[k] A)
 #align modular_form_class ModularFormClass
 
 /-- `cusp_form_class F ฮ“ k` says that `F` is a type of bundled functions that extend
@@ -78,7 +77,7 @@ class ModularFormClass extends SlashInvariantFormClass F ฮ“ k where
 at infinity. -/
 class CuspFormClass extends SlashInvariantFormClass F ฮ“ k where
   holo : โˆ€ f : F, Mdifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (f : โ„ โ†’ โ„‚)
-  zero_at_infty : โˆ€ (f : F) (A : SL(2, โ„ค)), IsZeroAtImInfty (fโˆฃ[k,A])
+  zero_at_infty : โˆ€ (f : F) (A : SL(2, โ„ค)), IsZeroAtImInfty (f โˆฃ[k] A)
 #align cusp_form_class CuspFormClass
 
 instance (priority := 100) ModularFormClass.modularForm : ModularFormClass (ModularForm ฮ“ k) ฮ“ k
Diff
@@ -4,11 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Chris Birkbeck
 
 ! This file was ported from Lean 3 source module number_theory.modular_forms.basic
-! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
+! leanprover-community/mathlib commit fe44cd36149e675eb5dec87acc7e8f1d6568e081
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
-import Mathbin.Geometry.Manifold.Mfderiv
 import Mathbin.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty
 import Mathbin.Analysis.Complex.UpperHalfPlane.Topology
 import Mathbin.NumberTheory.ModularForms.SlashInvariantForms
@@ -30,14 +29,6 @@ open Topology Manifold UpperHalfPlane
 
 noncomputable section
 
-instance UpperHalfPlane.chartedSpace : ChartedSpace โ„‚ โ„ :=
-  UpperHalfPlane.openEmbedding_coe.singletonChartedSpace
-#align upper_half_plane.charted_space UpperHalfPlane.chartedSpace
-
-instance UpperHalfPlane.smoothManifoldWithCorners : SmoothManifoldWithCorners ๐“˜(โ„‚) โ„ :=
-  UpperHalfPlane.openEmbedding_coe.singleton_smoothManifoldWithCorners ๐“˜(โ„‚)
-#align upper_half_plane.smooth_manifold_with_corners UpperHalfPlane.smoothManifoldWithCorners
-
 -- mathport name: ยซexprโ†‘โ‚˜ ยป
 local prefix:1024 "โ†‘โ‚˜" => @coe _ (Matrix (Fin 2) (Fin 2) _) _
 

Changes in mathlib4

mathlib3
mathlib4
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -261,7 +261,7 @@ def mul {k_1 k_2 : โ„ค} {ฮ“ : Subgroup SL(2, โ„ค)} (f : ModularForm ฮ“ k_1) (g :
   toSlashInvariantForm := f.1.mul g.1
   holo' := f.holo'.mul g.holo'
   bdd_at_infty' A := by
-    -- porting note: was `by simpa using ...`
+    -- Porting note: was `by simpa using ...`
     -- `mul_slash_SL2` is no longer a `simp` and `simpa only [mul_slash_SL2] using ...` failed
     rw [SlashInvariantForm.coe_mul, mul_slash_SL2]
     exact (f.bdd_at_infty' A).mul (g.bdd_at_infty' A)
doc: fix typo (#10277)
Diff
@@ -40,7 +40,7 @@ variable (F : Type*) (ฮ“ : Subgroup SL(2, โ„ค)) (k : โ„ค)
 
 open scoped ModularForm
 
-/-- These are `SlashInvariantForm`'s that are holomophic and bounded at infinity. -/
+/-- These are `SlashInvariantForm`'s that are holomorphic and bounded at infinity. -/
 structure ModularForm extends SlashInvariantForm ฮ“ k where
   holo' : MDifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (toSlashInvariantForm : โ„ โ†’ โ„‚)
   bdd_at_infty' : โˆ€ A : SL(2, โ„ค), IsBoundedAtImInfty (toSlashInvariantForm โˆฃ[k] A)
@@ -49,7 +49,7 @@ structure ModularForm extends SlashInvariantForm ฮ“ k where
 /-- The `SlashInvariantForm` associated to a `ModularForm`. -/
 add_decl_doc ModularForm.toSlashInvariantForm
 
-/-- These are `SlashInvariantForm`s that are holomophic and zero at infinity. -/
+/-- These are `SlashInvariantForm`s that are holomorphic and zero at infinity. -/
 structure CuspForm extends SlashInvariantForm ฮ“ k where
   holo' : MDifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (toSlashInvariantForm : โ„ โ†’ โ„‚)
   zero_at_infty' : โˆ€ A : SL(2, โ„ค), IsZeroAtImInfty (toSlashInvariantForm โˆฃ[k] A)
refactor(Data/FunLike): use unbundled inheritance from FunLike (#8386)

The FunLike hierarchy is very big and gets scanned through each time we need a coercion (via the CoeFun instance). It looks like unbundled inheritance suits Lean 4 better here. The only class that still extends FunLike is EquivLike, since that has a custom coe_injective' field that is easier to implement. All other classes should take FunLike or EquivLike as a parameter.

Zulip thread

Important changes

Previously, morphism classes would be Type-valued and extend FunLike:

/-- `MyHomClass F A B` states that `F` is a type of `MyClass.op`-preserving morphisms.
You should extend this class when you extend `MyHom`. -/
class MyHomClass (F : Type*) (A B : outParam <| Type*) [MyClass A] [MyClass B]
  extends FunLike F A B :=
(map_op : โˆ€ (f : F) (x y : A), f (MyClass.op x y) = MyClass.op (f x) (f y))

After this PR, they should be Prop-valued and take FunLike as a parameter:

/-- `MyHomClass F A B` states that `F` is a type of `MyClass.op`-preserving morphisms.
You should extend this class when you extend `MyHom`. -/
class MyHomClass (F : Type*) (A B : outParam <| Type*) [MyClass A] [MyClass B]
  [FunLike F A B] : Prop :=
(map_op : โˆ€ (f : F) (x y : A), f (MyClass.op x y) = MyClass.op (f x) (f y))

(Note that A B stay marked as outParam even though they are not purely required to be so due to the FunLike parameter already filling them in. This is required to see through type synonyms, which is important in the category theory library. Also, I think keeping them as outParam is slightly faster.)

Similarly, MyEquivClass should take EquivLike as a parameter.

As a result, every mention of [MyHomClass F A B] should become [FunLike F A B] [MyHomClass F A B].

Remaining issues

Slower (failing) search

While overall this gives some great speedups, there are some cases that are noticeably slower. In particular, a failing application of a lemma such as map_mul is more expensive. This is due to suboptimal processing of arguments. For example:

variable [FunLike F M N] [Mul M] [Mul N] (f : F) (x : M) (y : M)

theorem map_mul [MulHomClass F M N] : f (x * y) = f x * f y

example [AddHomClass F A B] : f (x * y) = f x * f y := map_mul f _ _

Before this PR, applying map_mul f gives the goals [Mul ?M] [Mul ?N] [MulHomClass F ?M ?N]. Since M and N are out_params, [MulHomClass F ?M ?N] is synthesized first, supplies values for ?M and ?N and then the Mul M and Mul N instances can be found.

After this PR, the goals become [FunLike F ?M ?N] [Mul ?M] [Mul ?N] [MulHomClass F ?M ?N]. Now [FunLike F ?M ?N] is synthesized first, supplies values for ?M and ?N and then the Mul M and Mul N instances can be found, before trying MulHomClass F M N which fails. Since the Mul hierarchy is very big, this can be slow to fail, especially when there is no such Mul instance.

A long-term but harder to achieve solution would be to specify the order in which instance goals get solved. For example, we'd like to change the arguments to map_mul to look like [FunLike F M N] [Mul M] [Mul N] [highPriority <| MulHomClass F M N] because MulHomClass fails or succeeds much faster than the others.

As a consequence, the simpNF linter is much slower since by design it tries and fails to apply many map_ lemmas. The same issue occurs a few times in existing calls to simp [map_mul], where map_mul is tried "too soon" and fails. Thanks to the speedup of leanprover/lean4#2478 the impact is very limited, only in files that already were close to the timeout.

simp not firing sometimes

This affects map_smulโ‚›โ‚— and related definitions. For simp lemmas Lean apparently uses a slightly different mechanism to find instances, so that rw can find every argument to map_smulโ‚›โ‚— successfully but simp can't: leanprover/lean4#3701.

Missing instances due to unification failing

Especially in the category theory library, we might sometimes have a type A which is also accessible as a synonym (Bundled A hA).1. Instance synthesis doesn't always work if we have f : A โ†’* B but x * y : (Bundled A hA).1 or vice versa. This seems to be mostly fixed by keeping A B as outParams in MulHomClass F A B. (Presumably because Lean will do a definitional check A =?= (Bundled A hA).1 instead of using the syntax in the discrimination tree.)

Workaround for issues

The timeouts can be worked around for now by specifying which map_mul we mean, either as map_mul f for some explicit f, or as e.g. MonoidHomClass.map_mul.

map_smulโ‚›โ‚— not firing as simp lemma can be worked around by going back to the pre-FunLike situation and making LinearMap.map_smulโ‚›โ‚— a simp lemma instead of the generic map_smulโ‚›โ‚—. Writing simp [map_smulโ‚›โ‚— _] also works.

Co-authored-by: Matthew Ballard <matt@mrb.email> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Scott Morrison <scott@tqft.net> Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>

Diff
@@ -62,7 +62,7 @@ add_decl_doc CuspForm.toSlashInvariantForm
 `SlashInvariantFormClass` by requiring that the functions be holomorphic and bounded
 at infinity. -/
 class ModularFormClass (F : Type*) (ฮ“ : outParam <| Subgroup (SL(2, โ„ค))) (k : outParam โ„ค)
-    extends SlashInvariantFormClass F ฮ“ k where
+    [FunLike F โ„ โ„‚] extends SlashInvariantFormClass F ฮ“ k : Prop where
   holo : โˆ€ f : F, MDifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (f : โ„ โ†’ โ„‚)
   bdd_at_infty : โˆ€ (f : F) (A : SL(2, โ„ค)), IsBoundedAtImInfty (f โˆฃ[k] A)
 #align modular_form_class ModularFormClass
@@ -71,23 +71,28 @@ class ModularFormClass (F : Type*) (ฮ“ : outParam <| Subgroup (SL(2, โ„ค))) (k :
 `SlashInvariantFormClass` by requiring that the functions be holomorphic and zero
 at infinity. -/
 class CuspFormClass (F : Type*) (ฮ“ : outParam <| Subgroup (SL(2, โ„ค))) (k : outParam โ„ค)
-    extends SlashInvariantFormClass F ฮ“ k where
+    [FunLike F โ„ โ„‚] extends SlashInvariantFormClass F ฮ“ k : Prop where
   holo : โˆ€ f : F, MDifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (f : โ„ โ†’ โ„‚)
   zero_at_infty : โˆ€ (f : F) (A : SL(2, โ„ค)), IsZeroAtImInfty (f โˆฃ[k] A)
 #align cusp_form_class CuspFormClass
 
-instance (priority := 100) ModularFormClass.modularForm :
-    ModularFormClass (ModularForm ฮ“ k) ฮ“ k where
+instance (priority := 100) ModularForm.funLike :
+    FunLike (ModularForm ฮ“ k) โ„ โ„‚ where
   coe f := f.toFun
   coe_injective' f g h := by cases f; cases g; congr; exact DFunLike.ext' h
+
+instance (priority := 100) ModularFormClass.modularForm :
+    ModularFormClass (ModularForm ฮ“ k) ฮ“ k where
   slash_action_eq f := f.slash_action_eq'
   holo := ModularForm.holo'
   bdd_at_infty := ModularForm.bdd_at_infty'
 #align modular_form_class.modular_form ModularFormClass.modularForm
 
-instance (priority := 100) CuspFormClass.cuspForm : CuspFormClass (CuspForm ฮ“ k) ฮ“ k where
+instance (priority := 100) CuspForm.funLike : FunLike (CuspForm ฮ“ k) โ„ โ„‚ where
   coe f := f.toFun
   coe_injective' f g h := by cases f; cases g; congr; exact DFunLike.ext' h
+
+instance (priority := 100) CuspFormClass.cuspForm : CuspFormClass (CuspForm ฮ“ k) ฮ“ k where
   slash_action_eq f := f.slash_action_eq'
   holo := CuspForm.holo'
   zero_at_infty := CuspForm.zero_at_infty'
@@ -417,9 +422,7 @@ instance : Module โ„‚ (CuspForm ฮ“ k) :=
 instance : Inhabited (CuspForm ฮ“ k) :=
   โŸจ0โŸฉ
 
-instance (priority := 99) [CuspFormClass F ฮ“ k] : ModularFormClass F ฮ“ k where
-  coe := DFunLike.coe
-  coe_injective' := DFunLike.coe_injective'
+instance (priority := 99) [FunLike F โ„ โ„‚] [CuspFormClass F ฮ“ k] : ModularFormClass F ฮ“ k where
   slash_action_eq := SlashInvariantFormClass.slash_action_eq
   holo := CuspFormClass.holo
   bdd_at_infty _ _ := (CuspFormClass.zero_at_infty _ _).boundedAtFilter
chore(*): rename FunLike to DFunLike (#9785)

This prepares for the introduction of a non-dependent synonym of FunLike, which helps a lot with keeping #8386 readable.

This is entirely search-and-replace in 680197f combined with manual fixes in 4145626, e900597 and b8428f8. The commands that generated this change:

sed -i 's/\bFunLike\b/DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoFunLike\b/toDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/import Mathlib.Data.DFunLike/import Mathlib.Data.FunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bHom_FunLike\b/Hom_DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean     
sed -i 's/\binstFunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bfunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoo many metavariables to apply `fun_like.has_coe_to_fun`/too many metavariables to apply `DFunLike.hasCoeToFun`/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean

Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>

Diff
@@ -79,7 +79,7 @@ class CuspFormClass (F : Type*) (ฮ“ : outParam <| Subgroup (SL(2, โ„ค))) (k : ou
 instance (priority := 100) ModularFormClass.modularForm :
     ModularFormClass (ModularForm ฮ“ k) ฮ“ k where
   coe f := f.toFun
-  coe_injective' f g h := by cases f; cases g; congr; exact FunLike.ext' h
+  coe_injective' f g h := by cases f; cases g; congr; exact DFunLike.ext' h
   slash_action_eq f := f.slash_action_eq'
   holo := ModularForm.holo'
   bdd_at_infty := ModularForm.bdd_at_infty'
@@ -87,7 +87,7 @@ instance (priority := 100) ModularFormClass.modularForm :
 
 instance (priority := 100) CuspFormClass.cuspForm : CuspFormClass (CuspForm ฮ“ k) ฮ“ k where
   coe f := f.toFun
-  coe_injective' f g h := by cases f; cases g; congr; exact FunLike.ext' h
+  coe_injective' f g h := by cases f; cases g; congr; exact DFunLike.ext' h
   slash_action_eq f := f.slash_action_eq'
   holo := CuspForm.holo'
   zero_at_infty := CuspForm.zero_at_infty'
@@ -112,12 +112,12 @@ theorem CuspForm.toSlashInvariantForm_coe (f : CuspForm ฮ“ k) : โ‡‘f.1 = f := rf
 
 @[ext]
 theorem ModularForm.ext {f g : ModularForm ฮ“ k} (h : โˆ€ x, f x = g x) : f = g :=
-  FunLike.ext f g h
+  DFunLike.ext f g h
 #align modular_form.ext ModularForm.ext
 
 @[ext]
 theorem CuspForm.ext {f g : CuspForm ฮ“ k} (h : โˆ€ x, f x = g x) : f = g :=
-  FunLike.ext f g h
+  DFunLike.ext f g h
 #align cusp_form.ext CuspForm.ext
 
 /-- Copy of a `ModularForm` with a new `toFun` equal to the old one. Useful to fix
@@ -233,7 +233,7 @@ theorem sub_apply (f g : ModularForm ฮ“ k) (z : โ„) : (f - g) z = f z - g z :=
 #align modular_form.sub_apply ModularForm.sub_apply
 
 instance : AddCommGroup (ModularForm ฮ“ k) :=
-  FunLike.coe_injective.addCommGroup _ rfl coe_add coe_neg coe_sub coe_smul coe_smul
+  DFunLike.coe_injective.addCommGroup _ rfl coe_add coe_neg coe_sub coe_smul coe_smul
 
 /-- Additive coercion from `ModularForm` to `โ„ โ†’ โ„‚`. -/
 @[simps]
@@ -244,7 +244,7 @@ def coeHom : ModularForm ฮ“ k โ†’+ โ„ โ†’ โ„‚ where
 #align modular_form.coe_hom ModularForm.coeHom
 
 instance : Module โ„‚ (ModularForm ฮ“ k) :=
-  Function.Injective.module โ„‚ coeHom FunLike.coe_injective fun _ _ => rfl
+  Function.Injective.module โ„‚ coeHom DFunLike.coe_injective fun _ _ => rfl
 
 instance : Inhabited (ModularForm ฮ“ k) :=
   โŸจ0โŸฉ
@@ -401,7 +401,7 @@ theorem sub_apply (f g : CuspForm ฮ“ k) (z : โ„) : (f - g) z = f z - g z :=
 #align cusp_form.sub_apply CuspForm.sub_apply
 
 instance : AddCommGroup (CuspForm ฮ“ k) :=
-  FunLike.coe_injective.addCommGroup _ rfl coe_add coe_neg coe_sub coe_smul coe_smul
+  DFunLike.coe_injective.addCommGroup _ rfl coe_add coe_neg coe_sub coe_smul coe_smul
 
 /-- Additive coercion from `CuspForm` to `โ„ โ†’ โ„‚`. -/
 @[simps]
@@ -412,14 +412,14 @@ def coeHom : CuspForm ฮ“ k โ†’+ โ„ โ†’ โ„‚ where
 #align cusp_form.coe_hom CuspForm.coeHom
 
 instance : Module โ„‚ (CuspForm ฮ“ k) :=
-  Function.Injective.module โ„‚ coeHom FunLike.coe_injective fun _ _ => rfl
+  Function.Injective.module โ„‚ coeHom DFunLike.coe_injective fun _ _ => rfl
 
 instance : Inhabited (CuspForm ฮ“ k) :=
   โŸจ0โŸฉ
 
 instance (priority := 99) [CuspFormClass F ฮ“ k] : ModularFormClass F ฮ“ k where
-  coe := FunLike.coe
-  coe_injective' := FunLike.coe_injective'
+  coe := DFunLike.coe
+  coe_injective' := DFunLike.coe_injective'
   slash_action_eq := SlashInvariantFormClass.slash_action_eq
   holo := CuspFormClass.holo
   bdd_at_infty _ _ := (CuspFormClass.zero_at_infty _ _).boundedAtFilter
refactor(Geometry/Manifold/MFDeriv): split file (#9565)

With about 2200 lines, this is the largest file in Geometry/Manifolds.

Diff
@@ -4,9 +4,9 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Chris Birkbeck
 -/
 import Mathlib.Algebra.DirectSum.Algebra
-import Mathlib.Algebra.GradedMonoid
 import Mathlib.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty
 import Mathlib.Analysis.Complex.UpperHalfPlane.Manifold
+import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions
 import Mathlib.NumberTheory.ModularForms.SlashInvariantForms
 
 #align_import number_theory.modular_forms.basic from "leanprover-community/mathlib"@"57f9349f2fe19d2de7207e99b0341808d977cdcf"
feat(ModularForm): Graded Ring instance on spaces of modular forms (#9164)

This adds the graded ring instance to spaces of modular forms.

Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Chris Birkbeck <c.birkbeck@uea.ac.uk>

Diff
@@ -3,6 +3,8 @@ Copyright (c) 2022 Chris Birkbeck. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Chris Birkbeck
 -/
+import Mathlib.Algebra.DirectSum.Algebra
+import Mathlib.Algebra.GradedMonoid
 import Mathlib.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty
 import Mathlib.Analysis.Complex.UpperHalfPlane.Manifold
 import Mathlib.NumberTheory.ModularForms.SlashInvariantForms
@@ -12,7 +14,8 @@ import Mathlib.NumberTheory.ModularForms.SlashInvariantForms
 /-!
 # Modular forms
 
-This file defines modular forms and proves some basic properties about them.
+This file defines modular forms and proves some basic properties about them. Including constructing
+the graded ring of modular forms.
 
 We begin by defining modular forms and cusp forms as extension of `SlashInvariantForm`s then we
 define the space of modular forms, cusp forms and prove that the product of two modular forms is a
@@ -265,18 +268,43 @@ theorem mul_coe {k_1 k_2 : โ„ค} {ฮ“ : Subgroup SL(2, โ„ค)} (f : ModularForm ฮ“ k
   rfl
 #align modular_form.mul_coe ModularForm.mul_coe
 
-instance : One (ModularForm ฮ“ 0) :=
-  โŸจ { toSlashInvariantForm := 1
-      holo' := fun x => mdifferentiableAt_const ๐“˜(โ„‚, โ„‚) ๐“˜(โ„‚, โ„‚)
-      bdd_at_infty' := fun A => by
-        simpa only [SlashInvariantForm.one_coe_eq_one,
-          ModularForm.is_invariant_one] using atImInfty.const_boundedAtFilter (1 : โ„‚) }โŸฉ
+/-- The constant function with value `x : โ„‚` as a modular form of weight 0 and any level. -/
+@[simps! (config := .asFn) toFun toSlashInvariantForm]
+def const (x : โ„‚) : ModularForm ฮ“ 0 where
+  toSlashInvariantForm := .const x
+  holo' x := mdifferentiableAt_const ๐“˜(โ„‚, โ„‚) ๐“˜(โ„‚, โ„‚)
+  bdd_at_infty' A := by
+    simpa only [SlashInvariantForm.const_toFun,
+      ModularForm.is_invariant_const] using atImInfty.const_boundedAtFilter x
+
+instance : One (ModularForm ฮ“ 0) where
+  one := { const 1 with toSlashInvariantForm := 1 }
 
 @[simp]
-theorem one_coe_eq_one : ((1 : ModularForm ฮ“ 0) : โ„ โ†’ โ„‚) = 1 :=
+theorem one_coe_eq_one : โ‡‘(1 : ModularForm ฮ“ 0) = 1 :=
   rfl
 #align modular_form.one_coe_eq_one ModularForm.one_coe_eq_one
 
+instance (ฮ“ : Subgroup SL(2, โ„ค)) : NatCast (ModularForm ฮ“ 0) where
+  natCast n := const n
+
+@[simp, norm_cast]
+lemma coe_natCast (ฮ“ : Subgroup SL(2, โ„ค)) (n : โ„•) :
+    โ‡‘(n : ModularForm ฮ“ 0) = n := rfl
+
+lemma toSlashInvariantForm_natCast (ฮ“ : Subgroup SL(2, โ„ค)) (n : โ„•) :
+    (n : ModularForm ฮ“ 0).toSlashInvariantForm = n := rfl
+
+instance (ฮ“ : Subgroup SL(2, โ„ค)) : IntCast (ModularForm ฮ“ 0) where
+  intCast z := const z
+
+@[simp, norm_cast]
+lemma coe_intCast (ฮ“ : Subgroup SL(2, โ„ค)) (z : โ„ค) :
+    โ‡‘(z : ModularForm ฮ“ 0) = z := rfl
+
+lemma toSlashInvariantForm_intCast (ฮ“ : Subgroup SL(2, โ„ค)) (z : โ„ค) :
+    (z : ModularForm ฮ“ 0).toSlashInvariantForm = z := rfl
+
 end ModularForm
 
 namespace CuspForm
@@ -397,3 +425,55 @@ instance (priority := 99) [CuspFormClass F ฮ“ k] : ModularFormClass F ฮ“ k where
   bdd_at_infty _ _ := (CuspFormClass.zero_at_infty _ _).boundedAtFilter
 
 end CuspForm
+
+namespace ModularForm
+
+section GradedRing
+
+/-- Cast for modular forms, which is useful for avoiding `Heq`s. -/
+def mcast {a b : โ„ค} {ฮ“ : Subgroup SL(2, โ„ค)} (h : a = b) (f : ModularForm ฮ“ a) : ModularForm ฮ“ b
+    where
+  toFun := (f : โ„ โ†’ โ„‚)
+  slash_action_eq' A := h โ–ธ f.slash_action_eq' A
+  holo' := f.holo'
+  bdd_at_infty' A := h โ–ธ f.bdd_at_infty' A
+
+@[ext]
+theorem gradedMonoid_eq_of_cast {ฮ“ : Subgroup SL(2, โ„ค)} {a b : GradedMonoid (ModularForm ฮ“)}
+    (h : a.fst = b.fst) (h2 : mcast h a.snd = b.snd) : a = b := by
+  obtain โŸจi, aโŸฉ := a
+  obtain โŸจj, bโŸฉ := b
+  cases h
+  exact congr_arg _ h2
+
+instance (ฮ“ : Subgroup SL(2, โ„ค)) : GradedMonoid.GOne (ModularForm ฮ“) where
+  one := 1
+
+instance (ฮ“ : Subgroup SL(2, โ„ค)) : GradedMonoid.GMul (ModularForm ฮ“) where
+  mul f g := f.mul g
+
+instance instGCommRing (ฮ“ : Subgroup SL(2, โ„ค)) : DirectSum.GCommRing (ModularForm ฮ“) where
+  one_mul a := gradedMonoid_eq_of_cast (zero_add _) (ext fun _ => one_mul _)
+  mul_one a := gradedMonoid_eq_of_cast (add_zero _) (ext fun _ => mul_one _)
+  mul_assoc a b c := gradedMonoid_eq_of_cast (add_assoc _ _ _) (ext fun _ => mul_assoc _ _ _)
+  mul_zero {i j} f := ext fun _ => mul_zero _
+  zero_mul {i j} f := ext fun _ => zero_mul _
+  mul_add {i j} f g h := ext fun _ => mul_add _ _ _
+  add_mul {i j} f g h := ext fun _ => add_mul _ _ _
+  mul_comm a b := gradedMonoid_eq_of_cast (add_comm _ _) (ext fun _ => mul_comm _ _)
+  natCast := Nat.cast
+  natCast_zero := ext fun _ => Nat.cast_zero
+  natCast_succ n := ext fun _ => Nat.cast_succ _
+  intCast := Int.cast
+  intCast_ofNat n := ext fun _ => AddGroupWithOne.intCast_ofNat _
+  intCast_negSucc_ofNat n := ext fun _ => AddGroupWithOne.intCast_negSucc _
+
+instance instGAlgebra (ฮ“ : Subgroup SL(2, โ„ค)) : DirectSum.GAlgebra โ„‚ (ModularForm ฮ“) where
+  toFun := { toFun := const, map_zero' := rfl, map_add' := fun _ _ => rfl }
+  map_one := rfl
+  map_mul _x _y := rfl
+  commutes _c _x := gradedMonoid_eq_of_cast (add_comm _ _) (ext fun _ => mul_comm _ _)
+  smul_def _x _x := gradedMonoid_eq_of_cast (zero_add _).symm (ext fun _ => rfl)
+
+open scoped DirectSum in
+example (ฮ“ : Subgroup SL(2, โ„ค)) : Algebra โ„‚ (โจ i, ModularForm ฮ“ i) := inferInstance
chore: tidy various files (#7132)
Diff
@@ -14,7 +14,7 @@ import Mathlib.NumberTheory.ModularForms.SlashInvariantForms
 
 This file defines modular forms and proves some basic properties about them.
 
-We begin by defining modular forms and cusp forms as extension of `slash_invariant_forms` then we
+We begin by defining modular forms and cusp forms as extension of `SlashInvariantForm`s then we
 define the space of modular forms, cusp forms and prove that the product of two modular forms is a
 modular form.
 -/
@@ -37,26 +37,26 @@ variable (F : Type*) (ฮ“ : Subgroup SL(2, โ„ค)) (k : โ„ค)
 
 open scoped ModularForm
 
-/-- These are `slash_invariant_form`'s that are holomophic and bounded at infinity. -/
+/-- These are `SlashInvariantForm`'s that are holomophic and bounded at infinity. -/
 structure ModularForm extends SlashInvariantForm ฮ“ k where
   holo' : MDifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (toSlashInvariantForm : โ„ โ†’ โ„‚)
   bdd_at_infty' : โˆ€ A : SL(2, โ„ค), IsBoundedAtImInfty (toSlashInvariantForm โˆฃ[k] A)
 #align modular_form ModularForm
 
-/-- The `slash_invariant_form` associated to a `modular_form`. -/
+/-- The `SlashInvariantForm` associated to a `ModularForm`. -/
 add_decl_doc ModularForm.toSlashInvariantForm
 
-/-- These are `slash_invariant_form`s that are holomophic and zero at infinity. -/
+/-- These are `SlashInvariantForm`s that are holomophic and zero at infinity. -/
 structure CuspForm extends SlashInvariantForm ฮ“ k where
   holo' : MDifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (toSlashInvariantForm : โ„ โ†’ โ„‚)
   zero_at_infty' : โˆ€ A : SL(2, โ„ค), IsZeroAtImInfty (toSlashInvariantForm โˆฃ[k] A)
 #align cusp_form CuspForm
 
-/-- The `slash_invariant_form` associated to a `cusp_form`. -/
+/-- The `SlashInvariantForm` associated to a `CuspForm`. -/
 add_decl_doc CuspForm.toSlashInvariantForm
 
-/-- `modular_form_class F ฮ“ k` says that `F` is a type of bundled functions that extend
-`slash_invariant_form_class` by requiring that the functions be holomorphic and bounded
+/-- `ModularFormClass F ฮ“ k` says that `F` is a type of bundled functions that extend
+`SlashInvariantFormClass` by requiring that the functions be holomorphic and bounded
 at infinity. -/
 class ModularFormClass (F : Type*) (ฮ“ : outParam <| Subgroup (SL(2, โ„ค))) (k : outParam โ„ค)
     extends SlashInvariantFormClass F ฮ“ k where
@@ -64,8 +64,8 @@ class ModularFormClass (F : Type*) (ฮ“ : outParam <| Subgroup (SL(2, โ„ค))) (k :
   bdd_at_infty : โˆ€ (f : F) (A : SL(2, โ„ค)), IsBoundedAtImInfty (f โˆฃ[k] A)
 #align modular_form_class ModularFormClass
 
-/-- `cusp_form_class F ฮ“ k` says that `F` is a type of bundled functions that extend
-`slash_invariant_form_class` by requiring that the functions be holomorphic and zero
+/-- `CuspFormClass F ฮ“ k` says that `F` is a type of bundled functions that extend
+`SlashInvariantFormClass` by requiring that the functions be holomorphic and zero
 at infinity. -/
 class CuspFormClass (F : Type*) (ฮ“ : outParam <| Subgroup (SL(2, โ„ค))) (k : outParam โ„ค)
     extends SlashInvariantFormClass F ฮ“ k where
@@ -117,7 +117,7 @@ theorem CuspForm.ext {f g : CuspForm ฮ“ k} (h : โˆ€ x, f x = g x) : f = g :=
   FunLike.ext f g h
 #align cusp_form.ext CuspForm.ext
 
-/-- Copy of a `modular_form` with a new `to_fun` equal to the old one. Useful to fix
+/-- Copy of a `ModularForm` with a new `toFun` equal to the old one. Useful to fix
 definitional equalities. -/
 protected def ModularForm.copy (f : ModularForm ฮ“ k) (f' : โ„ โ†’ โ„‚) (h : f' = โ‡‘f) :
     ModularForm ฮ“ k where
@@ -126,7 +126,7 @@ protected def ModularForm.copy (f : ModularForm ฮ“ k) (f' : โ„ โ†’ โ„‚) (h : f'
   bdd_at_infty' A := h.symm โ–ธ f.bdd_at_infty' A
 #align modular_form.copy ModularForm.copy
 
-/-- Copy of a `cusp_form` with a new `to_fun` equal to the old one. Useful to fix
+/-- Copy of a `CuspForm` with a new `toFun` equal to the old one. Useful to fix
 definitional equalities. -/
 protected def CuspForm.copy (f : CuspForm ฮ“ k) (f' : โ„ โ†’ โ„‚) (h : f' = โ‡‘f) : CuspForm ฮ“ k where
   toSlashInvariantForm := f.1.copy f' h
@@ -159,11 +159,11 @@ theorem add_apply (f g : ModularForm ฮ“ k) (z : โ„) : (f + g) z = f z + g z :=
   rfl
 #align modular_form.add_apply ModularForm.add_apply
 
-instance hasZero : Zero (ModularForm ฮ“ k) :=
+instance instZero : Zero (ModularForm ฮ“ k) :=
   โŸจ { toSlashInvariantForm := 0
       holo' := fun _ => mdifferentiableAt_const ๐“˜(โ„‚, โ„‚) ๐“˜(โ„‚, โ„‚)
       bdd_at_infty' := fun A => by simpa using zero_form_isBoundedAtImInfty } โŸฉ
-#align modular_form.has_zero ModularForm.hasZero
+#align modular_form.has_zero ModularForm.instZero
 
 @[simp]
 theorem coe_zero : โ‡‘(0 : ModularForm ฮ“ k) = (0 : โ„ โ†’ โ„‚) :=
@@ -179,12 +179,12 @@ section
 
 variable {ฮฑ : Type*} [SMul ฮฑ โ„‚] [IsScalarTower ฮฑ โ„‚ โ„‚]
 
-instance hasSmul : SMul ฮฑ (ModularForm ฮ“ k) :=
+instance instSMul : SMul ฮฑ (ModularForm ฮ“ k) :=
   โŸจfun c f =>
     { toSlashInvariantForm := c โ€ข f.1
       holo' := by simpa using f.holo'.const_smul (c โ€ข (1 : โ„‚))
       bdd_at_infty' := fun A => by simpa using (f.bdd_at_infty' A).const_smul_left (c โ€ข (1 : โ„‚)) }โŸฉ
-#align modular_form.has_smul ModularForm.hasSmul
+#align modular_form.has_smul ModularForm.instSMul
 
 @[simp]
 theorem coe_smul (f : ModularForm ฮ“ k) (n : ฮฑ) : โ‡‘(n โ€ข f) = n โ€ข โ‡‘f :=
@@ -198,12 +198,12 @@ theorem smul_apply (f : ModularForm ฮ“ k) (n : ฮฑ) (z : โ„) : (n โ€ข f) z = n 
 
 end
 
-instance hasNeg : Neg (ModularForm ฮ“ k) :=
+instance instNeg : Neg (ModularForm ฮ“ k) :=
   โŸจfun f =>
     { toSlashInvariantForm := -f.1
       holo' := f.holo'.neg
       bdd_at_infty' := fun A => by simpa using (f.bdd_at_infty' A).neg }โŸฉ
-#align modular_form.has_neg ModularForm.hasNeg
+#align modular_form.has_neg ModularForm.instNeg
 
 @[simp]
 theorem coe_neg (f : ModularForm ฮ“ k) : โ‡‘(-f) = -f :=
@@ -215,9 +215,9 @@ theorem neg_apply (f : ModularForm ฮ“ k) (z : โ„) : (-f) z = -f z :=
   rfl
 #align modular_form.neg_apply ModularForm.neg_apply
 
-instance hasSub : Sub (ModularForm ฮ“ k) :=
+instance instSub : Sub (ModularForm ฮ“ k) :=
   โŸจfun f g => f + -gโŸฉ
-#align modular_form.has_sub ModularForm.hasSub
+#align modular_form.has_sub ModularForm.instSub
 
 @[simp]
 theorem coe_sub (f g : ModularForm ฮ“ k) : โ‡‘(f - g) = f - g :=
@@ -232,7 +232,7 @@ theorem sub_apply (f g : ModularForm ฮ“ k) (z : โ„) : (f - g) z = f z - g z :=
 instance : AddCommGroup (ModularForm ฮ“ k) :=
   FunLike.coe_injective.addCommGroup _ rfl coe_add coe_neg coe_sub coe_smul coe_smul
 
-/-- Additive coercion from `modular_form` to `โ„ โ†’ โ„‚`. -/
+/-- Additive coercion from `ModularForm` to `โ„ โ†’ โ„‚`. -/
 @[simps]
 def coeHom : ModularForm ฮ“ k โ†’+ โ„ โ†’ โ„‚ where
   toFun f := f
@@ -302,11 +302,11 @@ theorem add_apply (f g : CuspForm ฮ“ k) (z : โ„) : (f + g) z = f z + g z :=
   rfl
 #align cusp_form.add_apply CuspForm.add_apply
 
-instance hasZero : Zero (CuspForm ฮ“ k) :=
+instance instZero : Zero (CuspForm ฮ“ k) :=
   โŸจ { toSlashInvariantForm := 0
       holo' := fun _ => mdifferentiableAt_const ๐“˜(โ„‚, โ„‚) ๐“˜(โ„‚, โ„‚)
       zero_at_infty' := by simpa using Filter.zero_zeroAtFilter _ } โŸฉ
-#align cusp_form.has_zero CuspForm.hasZero
+#align cusp_form.has_zero CuspForm.instZero
 
 @[simp]
 theorem coe_zero : โ‡‘(0 : CuspForm ฮ“ k) = (0 : โ„ โ†’ โ„‚) :=
@@ -322,12 +322,12 @@ section
 
 variable {ฮฑ : Type*} [SMul ฮฑ โ„‚] [IsScalarTower ฮฑ โ„‚ โ„‚]
 
-instance hasSmul : SMul ฮฑ (CuspForm ฮ“ k) :=
+instance instSMul : SMul ฮฑ (CuspForm ฮ“ k) :=
   โŸจfun c f =>
     { toSlashInvariantForm := c โ€ข f.1
       holo' := by simpa using f.holo'.const_smul (c โ€ข (1 : โ„‚))
       zero_at_infty' := fun A => by simpa using (f.zero_at_infty' A).smul (c โ€ข (1 : โ„‚)) }โŸฉ
-#align cusp_form.has_smul CuspForm.hasSmul
+#align cusp_form.has_smul CuspForm.instSMul
 
 @[simp]
 theorem coe_smul (f : CuspForm ฮ“ k) (n : ฮฑ) : โ‡‘(n โ€ข f) = n โ€ข โ‡‘f :=
@@ -341,12 +341,12 @@ theorem smul_apply (f : CuspForm ฮ“ k) (n : ฮฑ) {z : โ„} : (n โ€ข f) z = n โ€ข
 
 end
 
-instance hasNeg : Neg (CuspForm ฮ“ k) :=
+instance instNeg : Neg (CuspForm ฮ“ k) :=
   โŸจfun f =>
     { toSlashInvariantForm := -f.1
       holo' := f.holo'.neg
       zero_at_infty' := fun A => by simpa using (f.zero_at_infty' A).neg }โŸฉ
-#align cusp_form.has_neg CuspForm.hasNeg
+#align cusp_form.has_neg CuspForm.instNeg
 
 @[simp]
 theorem coe_neg (f : CuspForm ฮ“ k) : โ‡‘(-f) = -f :=
@@ -358,9 +358,9 @@ theorem neg_apply (f : CuspForm ฮ“ k) (z : โ„) : (-f) z = -f z :=
   rfl
 #align cusp_form.neg_apply CuspForm.neg_apply
 
-instance hasSub : Sub (CuspForm ฮ“ k) :=
+instance instSub : Sub (CuspForm ฮ“ k) :=
   โŸจfun f g => f + -gโŸฉ
-#align cusp_form.has_sub CuspForm.hasSub
+#align cusp_form.has_sub CuspForm.instSub
 
 @[simp]
 theorem coe_sub (f g : CuspForm ฮ“ k) : โ‡‘(f - g) = f - g :=
@@ -375,7 +375,7 @@ theorem sub_apply (f g : CuspForm ฮ“ k) (z : โ„) : (f - g) z = f z - g z :=
 instance : AddCommGroup (CuspForm ฮ“ k) :=
   FunLike.coe_injective.addCommGroup _ rfl coe_add coe_neg coe_sub coe_smul coe_smul
 
-/-- Additive coercion from `cusp_form` to `โ„ โ†’ โ„‚`. -/
+/-- Additive coercion from `CuspForm` to `โ„ โ†’ โ„‚`. -/
 @[simps]
 def coeHom : CuspForm ฮ“ k โ†’+ โ„ โ†’ โ„‚ where
   toFun f := f
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -33,7 +33,7 @@ section ModularForm
 
 open ModularForm
 
-variable (F : Type _) (ฮ“ : Subgroup SL(2, โ„ค)) (k : โ„ค)
+variable (F : Type*) (ฮ“ : Subgroup SL(2, โ„ค)) (k : โ„ค)
 
 open scoped ModularForm
 
@@ -58,7 +58,7 @@ add_decl_doc CuspForm.toSlashInvariantForm
 /-- `modular_form_class F ฮ“ k` says that `F` is a type of bundled functions that extend
 `slash_invariant_form_class` by requiring that the functions be holomorphic and bounded
 at infinity. -/
-class ModularFormClass (F : Type _) (ฮ“ : outParam <| Subgroup (SL(2, โ„ค))) (k : outParam โ„ค)
+class ModularFormClass (F : Type*) (ฮ“ : outParam <| Subgroup (SL(2, โ„ค))) (k : outParam โ„ค)
     extends SlashInvariantFormClass F ฮ“ k where
   holo : โˆ€ f : F, MDifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (f : โ„ โ†’ โ„‚)
   bdd_at_infty : โˆ€ (f : F) (A : SL(2, โ„ค)), IsBoundedAtImInfty (f โˆฃ[k] A)
@@ -67,7 +67,7 @@ class ModularFormClass (F : Type _) (ฮ“ : outParam <| Subgroup (SL(2, โ„ค))) (k
 /-- `cusp_form_class F ฮ“ k` says that `F` is a type of bundled functions that extend
 `slash_invariant_form_class` by requiring that the functions be holomorphic and zero
 at infinity. -/
-class CuspFormClass (F : Type _) (ฮ“ : outParam <| Subgroup (SL(2, โ„ค))) (k : outParam โ„ค)
+class CuspFormClass (F : Type*) (ฮ“ : outParam <| Subgroup (SL(2, โ„ค))) (k : outParam โ„ค)
     extends SlashInvariantFormClass F ฮ“ k where
   holo : โˆ€ f : F, MDifferentiable ๐“˜(โ„‚) ๐“˜(โ„‚) (f : โ„ โ†’ โ„‚)
   zero_at_infty : โˆ€ (f : F) (A : SL(2, โ„ค)), IsZeroAtImInfty (f โˆฃ[k] A)
@@ -140,7 +140,7 @@ namespace ModularForm
 
 open SlashInvariantForm
 
-variable {F : Type _} {ฮ“ : Subgroup SL(2, โ„ค)} {k : โ„ค}
+variable {F : Type*} {ฮ“ : Subgroup SL(2, โ„ค)} {k : โ„ค}
 
 instance add : Add (ModularForm ฮ“ k) :=
   โŸจfun f g =>
@@ -177,7 +177,7 @@ theorem zero_apply (z : โ„) : (0 : ModularForm ฮ“ k) z = 0 :=
 
 section
 
-variable {ฮฑ : Type _} [SMul ฮฑ โ„‚] [IsScalarTower ฮฑ โ„‚ โ„‚]
+variable {ฮฑ : Type*} [SMul ฮฑ โ„‚] [IsScalarTower ฮฑ โ„‚ โ„‚]
 
 instance hasSmul : SMul ฮฑ (ModularForm ฮ“ k) :=
   โŸจfun c f =>
@@ -283,7 +283,7 @@ namespace CuspForm
 
 open ModularForm
 
-variable {F : Type _} {ฮ“ : Subgroup SL(2, โ„ค)} {k : โ„ค}
+variable {F : Type*} {ฮ“ : Subgroup SL(2, โ„ค)} {k : โ„ค}
 
 instance hasAdd : Add (CuspForm ฮ“ k) :=
   โŸจfun f g =>
@@ -320,7 +320,7 @@ theorem zero_apply (z : โ„) : (0 : CuspForm ฮ“ k) z = 0 :=
 
 section
 
-variable {ฮฑ : Type _} [SMul ฮฑ โ„‚] [IsScalarTower ฮฑ โ„‚ โ„‚]
+variable {ฮฑ : Type*} [SMul ฮฑ โ„‚] [IsScalarTower ฮฑ โ„‚ โ„‚]
 
 instance hasSmul : SMul ฮฑ (CuspForm ฮ“ k) :=
   โŸจfun c f =>
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2022 Chris Birkbeck. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Chris Birkbeck
-
-! This file was ported from Lean 3 source module number_theory.modular_forms.basic
-! leanprover-community/mathlib commit 57f9349f2fe19d2de7207e99b0341808d977cdcf
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty
 import Mathlib.Analysis.Complex.UpperHalfPlane.Manifold
 import Mathlib.NumberTheory.ModularForms.SlashInvariantForms
 
+#align_import number_theory.modular_forms.basic from "leanprover-community/mathlib"@"57f9349f2fe19d2de7207e99b0341808d977cdcf"
+
 /-!
 # Modular forms
 
feat: port NumberTheory.ModularForms.Basic (#5662)

Co-authored-by: int-y1 <jason_yuen2007@hotmail.com>

Dependencies 12 + 913

914 files ported (98.7%)
405506 lines ported (98.6%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file