number_theory.modular_forms.slash_invariant_formsMathlib.NumberTheory.ModularForms.SlashInvariantForms

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)

(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)

(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)

(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)

(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
@@ -51,7 +51,7 @@ structure SlashInvariantForm where
 #print SlashInvariantFormClass /-
 /-- `slash_invariant_form_class F Γ k` asserts `F` is a type of bundled functions that are invariant
 under the `slash_action`. -/
-class SlashInvariantFormClass extends FunLike F ℍ fun _ => ℂ where
+class SlashInvariantFormClass extends DFunLike F ℍ fun _ => ℂ where
   slash_action_eq : ∀ (f : F) (γ : Γ), (f : ℍ → ℂ) ∣[k] γ = f
 #align slash_invariant_form_class SlashInvariantFormClass
 -/
@@ -71,7 +71,7 @@ instance (priority := 100) SlashInvariantFormClass.slashInvariantForm :
 variable {F Γ k}
 
 instance : CoeFun (SlashInvariantForm Γ k) fun _ => ℍ → ℂ :=
-  FunLike.hasCoeToFun
+  DFunLike.hasCoeToFun
 
 #print SlashInvariantForm.toFun_eq_coe /-
 @[simp]
@@ -83,7 +83,7 @@ theorem SlashInvariantForm.toFun_eq_coe {f : SlashInvariantForm Γ k} : f.toFun
 #print SlashInvariantForm.ext /-
 @[ext]
 theorem SlashInvariantForm.ext {f g : SlashInvariantForm Γ k} (h : ∀ x, f x = g x) : f = g :=
-  FunLike.ext f g h
+  DFunLike.ext f g h
 #align slash_invariant_form_ext SlashInvariantForm.ext
 -/
 
@@ -108,7 +108,7 @@ variable {F : Type _} {Γ : outParam <| Subgroup SL(2, ℤ)} {k : outParam ℤ}
 @[nolint dangerous_instance]
 instance (priority := 100) SlashInvariantFormClass.coeToFun [SlashInvariantFormClass F Γ k] :
     CoeFun F fun _ => ℍ → ℂ :=
-  FunLike.hasCoeToFun
+  DFunLike.hasCoeToFun
 #align slash_invariant_form.slash_invariant_form_class.coe_to_fun SlashInvariantForm.SlashInvariantFormClass.coeToFun
 
 #print SlashInvariantForm.slash_action_eqn /-
@@ -248,7 +248,7 @@ theorem sub_apply (f g : SlashInvariantForm Γ k) (z : ℍ) : (f - g) z = f z -
 -/
 
 instance : AddCommGroup (SlashInvariantForm Γ 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 SlashInvariantForm.coeHom /-
 /-- Additive coercion from `slash_invariant_form` to `ℍ → ℂ`.-/
@@ -262,7 +262,7 @@ def coeHom : SlashInvariantForm Γ k →+ ℍ → ℂ
 
 #print SlashInvariantForm.coeHom_injective /-
 theorem coeHom_injective : Function.Injective (@coeHom Γ k) :=
-  FunLike.coe_injective
+  DFunLike.coe_injective
 #align slash_invariant_form.coe_hom_injective SlashInvariantForm.coeHom_injective
 -/
 
Diff
@@ -105,13 +105,11 @@ open SlashInvariantForm
 
 variable {F : Type _} {Γ : outParam <| Subgroup SL(2, ℤ)} {k : outParam ℤ}
 
-#print SlashInvariantForm.SlashInvariantFormClass.coeToFun /-
 @[nolint dangerous_instance]
 instance (priority := 100) SlashInvariantFormClass.coeToFun [SlashInvariantFormClass F Γ k] :
     CoeFun F fun _ => ℍ → ℂ :=
   FunLike.hasCoeToFun
 #align slash_invariant_form.slash_invariant_form_class.coe_to_fun SlashInvariantForm.SlashInvariantFormClass.coeToFun
--/
 
 #print SlashInvariantForm.slash_action_eqn /-
 @[simp]
Diff
@@ -3,7 +3,7 @@ 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.NumberTheory.ModularForms.SlashActions
+import NumberTheory.ModularForms.SlashActions
 
 #align_import number_theory.modular_forms.slash_invariant_forms from "leanprover-community/mathlib"@"9240e8be927a0955b9a82c6c85ef499ee3a626b8"
 
Diff
@@ -2,14 +2,11 @@
 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.slash_invariant_forms
-! leanprover-community/mathlib commit 9240e8be927a0955b9a82c6c85ef499ee3a626b8
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.NumberTheory.ModularForms.SlashActions
 
+#align_import number_theory.modular_forms.slash_invariant_forms from "leanprover-community/mathlib"@"9240e8be927a0955b9a82c6c85ef499ee3a626b8"
+
 /-!
 # Slash invariant forms
 
Diff
@@ -76,18 +76,18 @@ variable {F Γ k}
 instance : CoeFun (SlashInvariantForm Γ k) fun _ => ℍ → ℂ :=
   FunLike.hasCoeToFun
 
-#print slashInvariantForm_toFun_eq_coe /-
+#print SlashInvariantForm.toFun_eq_coe /-
 @[simp]
-theorem slashInvariantForm_toFun_eq_coe {f : SlashInvariantForm Γ k} : f.toFun = (f : ℍ → ℂ) :=
+theorem SlashInvariantForm.toFun_eq_coe {f : SlashInvariantForm Γ k} : f.toFun = (f : ℍ → ℂ) :=
   rfl
-#align slash_invariant_form_to_fun_eq_coe slashInvariantForm_toFun_eq_coe
+#align slash_invariant_form_to_fun_eq_coe SlashInvariantForm.toFun_eq_coe
 -/
 
-#print slashInvariantForm_ext /-
+#print SlashInvariantForm.ext /-
 @[ext]
-theorem slashInvariantForm_ext {f g : SlashInvariantForm Γ k} (h : ∀ x, f x = g x) : f = g :=
+theorem SlashInvariantForm.ext {f g : SlashInvariantForm Γ k} (h : ∀ x, f x = g x) : f = g :=
   FunLike.ext f g h
-#align slash_invariant_form_ext slashInvariantForm_ext
+#align slash_invariant_form_ext SlashInvariantForm.ext
 -/
 
 #print SlashInvariantForm.copy /-
Diff
@@ -145,13 +145,13 @@ theorem SlashInvariantFormClass.coe_coe [SlashInvariantFormClass F Γ k] (f : F)
 #align slash_invariant_form.slash_invariant_form_class.coe_coe SlashInvariantForm.SlashInvariantFormClass.coe_coe
 -/
 
-#print SlashInvariantForm.hasAdd /-
-instance hasAdd : Add (SlashInvariantForm Γ k) :=
+#print SlashInvariantForm.instAdd /-
+instance instAdd : Add (SlashInvariantForm Γ k) :=
   ⟨fun f g =>
     { toFun := f + g
       slash_action_eq' := fun γ => by
         rw [SlashAction.add_slash, slash_action_eqn, slash_action_eqn] }⟩
-#align slash_invariant_form.has_add SlashInvariantForm.hasAdd
+#align slash_invariant_form.has_add SlashInvariantForm.instAdd
 -/
 
 #print SlashInvariantForm.coe_add /-
@@ -168,11 +168,11 @@ theorem add_apply (f g : SlashInvariantForm Γ k) (z : ℍ) : (f + g) z = f z +
 #align slash_invariant_form.add_apply SlashInvariantForm.add_apply
 -/
 
-#print SlashInvariantForm.hasZero /-
-instance hasZero : Zero (SlashInvariantForm Γ k) :=
+#print SlashInvariantForm.instZero /-
+instance instZero : Zero (SlashInvariantForm Γ k) :=
   ⟨{  toFun := 0
       slash_action_eq' := SlashAction.zero_slash _ }⟩
-#align slash_invariant_form.has_zero SlashInvariantForm.hasZero
+#align slash_invariant_form.has_zero SlashInvariantForm.instZero
 -/
 
 #print SlashInvariantForm.coe_zero /-
@@ -186,12 +186,12 @@ section
 
 variable {α : Type _} [SMul α ℂ] [IsScalarTower α ℂ ℂ]
 
-#print SlashInvariantForm.hasSmul /-
-instance hasSmul : SMul α (SlashInvariantForm Γ k) :=
+#print SlashInvariantForm.instSMul /-
+instance instSMul : SMul α (SlashInvariantForm Γ k) :=
   ⟨fun c f =>
     { toFun := c • f
       slash_action_eq' := fun γ => by rw [SlashAction.smul_slash_of_tower, slash_action_eqn] }⟩
-#align slash_invariant_form.has_smul SlashInvariantForm.hasSmul
+#align slash_invariant_form.has_smul SlashInvariantForm.instSMul
 -/
 
 #print SlashInvariantForm.coe_smul /-
@@ -210,12 +210,12 @@ theorem smul_apply (f : SlashInvariantForm Γ k) (n : α) (z : ℍ) : (n • f)
 
 end
 
-#print SlashInvariantForm.hasNeg /-
-instance hasNeg : Neg (SlashInvariantForm Γ k) :=
+#print SlashInvariantForm.instNeg /-
+instance instNeg : Neg (SlashInvariantForm Γ k) :=
   ⟨fun f =>
     { toFun := -f
       slash_action_eq' := fun γ => by rw [SlashAction.neg_slash, slash_action_eqn] }⟩
-#align slash_invariant_form.has_neg SlashInvariantForm.hasNeg
+#align slash_invariant_form.has_neg SlashInvariantForm.instNeg
 -/
 
 #print SlashInvariantForm.coe_neg /-
@@ -232,10 +232,10 @@ theorem neg_apply (f : SlashInvariantForm Γ k) (z : ℍ) : (-f) z = -f z :=
 #align slash_invariant_form.neg_apply SlashInvariantForm.neg_apply
 -/
 
-#print SlashInvariantForm.hasSub /-
-instance hasSub : Sub (SlashInvariantForm Γ k) :=
+#print SlashInvariantForm.instSub /-
+instance instSub : Sub (SlashInvariantForm Γ k) :=
   ⟨fun f g => f + -g⟩
-#align slash_invariant_form.has_sub SlashInvariantForm.hasSub
+#align slash_invariant_form.has_sub SlashInvariantForm.instSub
 -/
 
 #print SlashInvariantForm.coe_sub /-
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.slash_invariant_forms
-! leanprover-community/mathlib commit 738054fa93d43512da144ec45ce799d18fd44248
+! leanprover-community/mathlib commit 9240e8be927a0955b9a82c6c85ef499ee3a626b8
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -13,6 +13,9 @@ import Mathbin.NumberTheory.ModularForms.SlashActions
 /-!
 # Slash invariant forms
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file defines functions that are invariant under a `slash_action` which forms the basis for
 defining `modular_form` and `cusp_form`. We prove several instances for such spaces, in particular
 that they form a module.
Diff
@@ -40,20 +40,25 @@ open ModularForm
 
 variable (F : Type _) (Γ : outParam <| Subgroup SL(2, ℤ)) (k : outParam ℤ)
 
+#print SlashInvariantForm /-
 /-- Functions `ℍ → ℂ` that are invariant under the `slash_action`. -/
 structure SlashInvariantForm where
   toFun : ℍ → ℂ
   slash_action_eq' : ∀ γ : Γ, to_fun ∣[k] γ = to_fun
 #align slash_invariant_form SlashInvariantForm
+-/
 
+#print SlashInvariantFormClass /-
 /-- `slash_invariant_form_class F Γ k` asserts `F` is a type of bundled functions that are invariant
 under the `slash_action`. -/
 class SlashInvariantFormClass extends FunLike F ℍ fun _ => ℂ where
   slash_action_eq : ∀ (f : F) (γ : Γ), (f : ℍ → ℂ) ∣[k] γ = f
 #align slash_invariant_form_class SlashInvariantFormClass
+-/
 
 attribute [nolint dangerous_instance] SlashInvariantFormClass.toFunLike
 
+#print SlashInvariantFormClass.slashInvariantForm /-
 instance (priority := 100) SlashInvariantFormClass.slashInvariantForm :
     SlashInvariantFormClass (SlashInvariantForm Γ k) Γ k
     where
@@ -61,22 +66,28 @@ instance (priority := 100) SlashInvariantFormClass.slashInvariantForm :
   coe_injective' f g h := by cases f <;> cases g <;> congr
   slash_action_eq := SlashInvariantForm.slash_action_eq'
 #align slash_invariant_form_class.slash_invariant_form SlashInvariantFormClass.slashInvariantForm
+-/
 
 variable {F Γ k}
 
 instance : CoeFun (SlashInvariantForm Γ k) fun _ => ℍ → ℂ :=
   FunLike.hasCoeToFun
 
+#print slashInvariantForm_toFun_eq_coe /-
 @[simp]
 theorem slashInvariantForm_toFun_eq_coe {f : SlashInvariantForm Γ k} : f.toFun = (f : ℍ → ℂ) :=
   rfl
 #align slash_invariant_form_to_fun_eq_coe slashInvariantForm_toFun_eq_coe
+-/
 
+#print slashInvariantForm_ext /-
 @[ext]
 theorem slashInvariantForm_ext {f g : SlashInvariantForm Γ k} (h : ∀ x, f x = g x) : f = g :=
   FunLike.ext f g h
 #align slash_invariant_form_ext slashInvariantForm_ext
+-/
 
+#print SlashInvariantForm.copy /-
 /-- Copy of a `slash_invariant_form` with a new `to_fun` equal to the old one.
 Useful to fix definitional equalities. -/
 protected def SlashInvariantForm.copy (f : SlashInvariantForm Γ k) (f' : ℍ → ℂ) (h : f' = ⇑f) :
@@ -84,6 +95,7 @@ protected def SlashInvariantForm.copy (f : SlashInvariantForm Γ k) (f' : ℍ 
   toFun := f'
   slash_action_eq' := h.symm ▸ f.slash_action_eq'
 #align slash_invariant_form.copy SlashInvariantForm.copy
+-/
 
 end SlashInvariantForms
 
@@ -93,117 +105,154 @@ open SlashInvariantForm
 
 variable {F : Type _} {Γ : outParam <| Subgroup SL(2, ℤ)} {k : outParam ℤ}
 
+#print SlashInvariantForm.SlashInvariantFormClass.coeToFun /-
 @[nolint dangerous_instance]
 instance (priority := 100) SlashInvariantFormClass.coeToFun [SlashInvariantFormClass F Γ k] :
     CoeFun F fun _ => ℍ → ℂ :=
   FunLike.hasCoeToFun
 #align slash_invariant_form.slash_invariant_form_class.coe_to_fun SlashInvariantForm.SlashInvariantFormClass.coeToFun
+-/
 
+#print SlashInvariantForm.slash_action_eqn /-
 @[simp]
 theorem slash_action_eqn [SlashInvariantFormClass F Γ k] (f : F) (γ : Γ) : ⇑f ∣[k] γ = ⇑f :=
   SlashInvariantFormClass.slash_action_eq f γ
 #align slash_invariant_form.slash_action_eqn SlashInvariantForm.slash_action_eqn
+-/
 
+#print SlashInvariantForm.slash_action_eqn' /-
 theorem slash_action_eqn' (k : ℤ) (Γ : Subgroup SL(2, ℤ)) [SlashInvariantFormClass F Γ k] (f : F)
     (γ : Γ) (z : ℍ) : f (γ • z) = ((↑ₘ[ℤ] γ 1 0 : ℂ) * z + (↑ₘ[ℤ] γ 1 1 : ℂ)) ^ k * f z :=
   by
   rw [← ModularForm.slash_action_eq'_iff]
   simp
 #align slash_invariant_form.slash_action_eqn' SlashInvariantForm.slash_action_eqn'
+-/
 
 instance [SlashInvariantFormClass F Γ k] : CoeTC F (SlashInvariantForm Γ k) :=
   ⟨fun f =>
     { toFun := f
       slash_action_eq' := slash_action_eqn f }⟩
 
+#print SlashInvariantForm.SlashInvariantFormClass.coe_coe /-
 @[simp]
 theorem SlashInvariantFormClass.coe_coe [SlashInvariantFormClass F Γ k] (f : F) :
     ((f : SlashInvariantForm Γ k) : ℍ → ℂ) = f :=
   rfl
 #align slash_invariant_form.slash_invariant_form_class.coe_coe SlashInvariantForm.SlashInvariantFormClass.coe_coe
+-/
 
+#print SlashInvariantForm.hasAdd /-
 instance hasAdd : Add (SlashInvariantForm Γ k) :=
   ⟨fun f g =>
     { toFun := f + g
       slash_action_eq' := fun γ => by
         rw [SlashAction.add_slash, slash_action_eqn, slash_action_eqn] }⟩
 #align slash_invariant_form.has_add SlashInvariantForm.hasAdd
+-/
 
+#print SlashInvariantForm.coe_add /-
 @[simp]
 theorem coe_add (f g : SlashInvariantForm Γ k) : ⇑(f + g) = f + g :=
   rfl
 #align slash_invariant_form.coe_add SlashInvariantForm.coe_add
+-/
 
+#print SlashInvariantForm.add_apply /-
 @[simp]
 theorem add_apply (f g : SlashInvariantForm Γ k) (z : ℍ) : (f + g) z = f z + g z :=
   rfl
 #align slash_invariant_form.add_apply SlashInvariantForm.add_apply
+-/
 
+#print SlashInvariantForm.hasZero /-
 instance hasZero : Zero (SlashInvariantForm Γ k) :=
   ⟨{  toFun := 0
       slash_action_eq' := SlashAction.zero_slash _ }⟩
 #align slash_invariant_form.has_zero SlashInvariantForm.hasZero
+-/
 
+#print SlashInvariantForm.coe_zero /-
 @[simp]
 theorem coe_zero : ⇑(0 : SlashInvariantForm Γ k) = (0 : ℍ → ℂ) :=
   rfl
 #align slash_invariant_form.coe_zero SlashInvariantForm.coe_zero
+-/
 
 section
 
 variable {α : Type _} [SMul α ℂ] [IsScalarTower α ℂ ℂ]
 
+#print SlashInvariantForm.hasSmul /-
 instance hasSmul : SMul α (SlashInvariantForm Γ k) :=
   ⟨fun c f =>
     { toFun := c • f
       slash_action_eq' := fun γ => by rw [SlashAction.smul_slash_of_tower, slash_action_eqn] }⟩
 #align slash_invariant_form.has_smul SlashInvariantForm.hasSmul
+-/
 
+#print SlashInvariantForm.coe_smul /-
 @[simp]
 theorem coe_smul (f : SlashInvariantForm Γ k) (n : α) : ⇑(n • f) = n • f :=
   rfl
 #align slash_invariant_form.coe_smul SlashInvariantForm.coe_smul
+-/
 
+#print SlashInvariantForm.smul_apply /-
 @[simp]
 theorem smul_apply (f : SlashInvariantForm Γ k) (n : α) (z : ℍ) : (n • f) z = n • f z :=
   rfl
 #align slash_invariant_form.smul_apply SlashInvariantForm.smul_apply
+-/
 
 end
 
+#print SlashInvariantForm.hasNeg /-
 instance hasNeg : Neg (SlashInvariantForm Γ k) :=
   ⟨fun f =>
     { toFun := -f
       slash_action_eq' := fun γ => by rw [SlashAction.neg_slash, slash_action_eqn] }⟩
 #align slash_invariant_form.has_neg SlashInvariantForm.hasNeg
+-/
 
+#print SlashInvariantForm.coe_neg /-
 @[simp]
 theorem coe_neg (f : SlashInvariantForm Γ k) : ⇑(-f) = -f :=
   rfl
 #align slash_invariant_form.coe_neg SlashInvariantForm.coe_neg
+-/
 
+#print SlashInvariantForm.neg_apply /-
 @[simp]
 theorem neg_apply (f : SlashInvariantForm Γ k) (z : ℍ) : (-f) z = -f z :=
   rfl
 #align slash_invariant_form.neg_apply SlashInvariantForm.neg_apply
+-/
 
+#print SlashInvariantForm.hasSub /-
 instance hasSub : Sub (SlashInvariantForm Γ k) :=
   ⟨fun f g => f + -g⟩
 #align slash_invariant_form.has_sub SlashInvariantForm.hasSub
+-/
 
+#print SlashInvariantForm.coe_sub /-
 @[simp]
 theorem coe_sub (f g : SlashInvariantForm Γ k) : ⇑(f - g) = f - g :=
   rfl
 #align slash_invariant_form.coe_sub SlashInvariantForm.coe_sub
+-/
 
+#print SlashInvariantForm.sub_apply /-
 @[simp]
 theorem sub_apply (f g : SlashInvariantForm Γ k) (z : ℍ) : (f - g) z = f z - g z :=
   rfl
 #align slash_invariant_form.sub_apply SlashInvariantForm.sub_apply
+-/
 
 instance : AddCommGroup (SlashInvariantForm Γ k) :=
   FunLike.coe_injective.AddCommGroup _ rfl coe_add coe_neg coe_sub coe_smul coe_smul
 
+#print SlashInvariantForm.coeHom /-
 /-- Additive coercion from `slash_invariant_form` to `ℍ → ℂ`.-/
 def coeHom : SlashInvariantForm Γ k →+ ℍ → ℂ
     where
@@ -211,10 +260,13 @@ def coeHom : SlashInvariantForm Γ k →+ ℍ → ℂ
   map_zero' := rfl
   map_add' _ _ := rfl
 #align slash_invariant_form.coe_hom SlashInvariantForm.coeHom
+-/
 
+#print SlashInvariantForm.coeHom_injective /-
 theorem coeHom_injective : Function.Injective (@coeHom Γ k) :=
   FunLike.coe_injective
 #align slash_invariant_form.coe_hom_injective SlashInvariantForm.coeHom_injective
+-/
 
 instance : Module ℂ (SlashInvariantForm Γ k) :=
   coeHom_injective.Module ℂ coeHom fun _ _ => rfl
@@ -223,10 +275,12 @@ instance : One (SlashInvariantForm Γ 0) :=
   ⟨{  toFun := 1
       slash_action_eq' := fun A => ModularForm.is_invariant_one A }⟩
 
+#print SlashInvariantForm.one_coe_eq_one /-
 @[simp]
 theorem one_coe_eq_one : ((1 : SlashInvariantForm Γ 0) : ℍ → ℂ) = 1 :=
   rfl
 #align slash_invariant_form.one_coe_eq_one SlashInvariantForm.one_coe_eq_one
+-/
 
 instance : Inhabited (SlashInvariantForm Γ k) :=
   ⟨0⟩
Diff
@@ -25,17 +25,13 @@ open scoped UpperHalfPlane ModularForm
 
 noncomputable section
 
--- mathport name: «expr↑ₘ »
 local prefix:1024 "↑ₘ" => @coe _ (Matrix (Fin 2) (Fin 2) _) _
 
--- mathport name: «expr↑ₘ[ ]»
 -- like `↑ₘ`, but allows the user to specify the ring `R`. Useful to help Lean elaborate.
 local notation "↑ₘ[" R "]" => @coe _ (Matrix (Fin 2) (Fin 2) R) _
 
--- 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 SlashInvariantForms
Diff
@@ -21,7 +21,7 @@ that they form a module.
 
 open Complex UpperHalfPlane
 
-open UpperHalfPlane ModularForm
+open scoped UpperHalfPlane ModularForm
 
 noncomputable section
 
Diff
@@ -33,7 +33,7 @@ local prefix:1024 "↑ₘ" => @coe _ (Matrix (Fin 2) (Fin 2) _) _
 local notation "↑ₘ[" R "]" => @coe _ (Matrix (Fin 2) (Fin 2) R) _
 
 -- 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.slash_invariant_forms
-! leanprover-community/mathlib commit ef74e2bd3a553d31fdb139188a251509b6c6b038
+! leanprover-community/mathlib commit 738054fa93d43512da144ec45ce799d18fd44248
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -104,8 +104,7 @@ instance (priority := 100) SlashInvariantFormClass.coeToFun [SlashInvariantFormC
 #align slash_invariant_form.slash_invariant_form_class.coe_to_fun SlashInvariantForm.SlashInvariantFormClass.coeToFun
 
 @[simp]
-theorem slash_action_eqn [SlashInvariantFormClass F Γ k] (f : F) (γ : Γ) :
-    SlashAction.map ℂ k γ ⇑f = ⇑f :=
+theorem slash_action_eqn [SlashInvariantFormClass F Γ k] (f : F) (γ : Γ) : ⇑f ∣[k] γ = ⇑f :=
   SlashInvariantFormClass.slash_action_eq f γ
 #align slash_invariant_form.slash_action_eqn SlashInvariantForm.slash_action_eqn
 
@@ -130,7 +129,8 @@ theorem SlashInvariantFormClass.coe_coe [SlashInvariantFormClass F Γ k] (f : F)
 instance hasAdd : Add (SlashInvariantForm Γ k) :=
   ⟨fun f g =>
     { toFun := f + g
-      slash_action_eq' := fun γ => by convert SlashAction.add_action k γ (f : ℍ → ℂ) g <;> simp }⟩
+      slash_action_eq' := fun γ => by
+        rw [SlashAction.add_slash, slash_action_eqn, slash_action_eqn] }⟩
 #align slash_invariant_form.has_add SlashInvariantForm.hasAdd
 
 @[simp]
@@ -160,8 +160,7 @@ variable {α : Type _} [SMul α ℂ] [IsScalarTower α ℂ ℂ]
 instance hasSmul : SMul α (SlashInvariantForm Γ k) :=
   ⟨fun c f =>
     { toFun := c • f
-      slash_action_eq' := fun γ => by
-        rw [← smul_one_smul ℂ c ⇑f, SlashAction.smul_action k γ ⇑f, slash_action_eqn] }⟩
+      slash_action_eq' := fun γ => by rw [SlashAction.smul_slash_of_tower, slash_action_eqn] }⟩
 #align slash_invariant_form.has_smul SlashInvariantForm.hasSmul
 
 @[simp]
@@ -179,8 +178,7 @@ end
 instance hasNeg : Neg (SlashInvariantForm Γ k) :=
   ⟨fun f =>
     { toFun := -f
-      slash_action_eq' := fun γ => by
-        simpa [ModularForm.subgroup_slash, SlashAction.neg_slash] using f.slash_action_eq' γ }⟩
+      slash_action_eq' := fun γ => by rw [SlashAction.neg_slash, slash_action_eqn] }⟩
 #align slash_invariant_form.has_neg SlashInvariantForm.hasNeg
 
 @[simp]
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.slash_invariant_forms
-! leanprover-community/mathlib commit e65771194f9e923a70dfb49b6ca7be6e400d8b6f
+! leanprover-community/mathlib commit ef74e2bd3a553d31fdb139188a251509b6c6b038
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -21,7 +21,7 @@ that they form a module.
 
 open Complex UpperHalfPlane
 
-open UpperHalfPlane
+open UpperHalfPlane ModularForm
 
 noncomputable section
 
@@ -44,19 +44,16 @@ open ModularForm
 
 variable (F : Type _) (Γ : outParam <| Subgroup SL(2, ℤ)) (k : outParam ℤ)
 
--- mathport name: «expr ∣[ , ]»
-scoped[SlashInvariantForms] notation:73 f "∣[" k:0 "," A "]" => SlashAction.map ℂ k A f
-
 /-- Functions `ℍ → ℂ` that are invariant under the `slash_action`. -/
 structure SlashInvariantForm where
   toFun : ℍ → ℂ
-  slash_action_eq' : ∀ γ : Γ, to_fun∣[k,γ] = to_fun
+  slash_action_eq' : ∀ γ : Γ, to_fun ∣[k] γ = to_fun
 #align slash_invariant_form SlashInvariantForm
 
 /-- `slash_invariant_form_class F Γ k` asserts `F` is a type of bundled functions that are invariant
 under the `slash_action`. -/
 class SlashInvariantFormClass extends FunLike F ℍ fun _ => ℂ where
-  slash_action_eq : ∀ (f : F) (γ : Γ), (f : ℍ → ℂ)∣[k,γ] = f
+  slash_action_eq : ∀ (f : F) (γ : Γ), (f : ℍ → ℂ) ∣[k] γ = f
 #align slash_invariant_form_class SlashInvariantFormClass
 
 attribute [nolint dangerous_instance] SlashInvariantFormClass.toFunLike
@@ -183,7 +180,7 @@ instance hasNeg : Neg (SlashInvariantForm Γ k) :=
   ⟨fun f =>
     { toFun := -f
       slash_action_eq' := fun γ => by
-        simpa [ModularForm.subgroup_slash, ModularForm.neg_slash] using f.slash_action_eq' γ }⟩
+        simpa [ModularForm.subgroup_slash, SlashAction.neg_slash] using f.slash_action_eq' γ }⟩
 #align slash_invariant_form.has_neg SlashInvariantForm.hasNeg
 
 @[simp]
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.slash_invariant_forms
-! leanprover-community/mathlib commit 32d096dc3c4bb9df248d66874f0489eef1f70419
+! leanprover-community/mathlib commit e65771194f9e923a70dfb49b6ca7be6e400d8b6f
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -28,6 +28,10 @@ noncomputable section
 -- mathport name: «expr↑ₘ »
 local prefix:1024 "↑ₘ" => @coe _ (Matrix (Fin 2) (Fin 2) _) _
 
+-- mathport name: «expr↑ₘ[ ]»
+-- like `↑ₘ`, but allows the user to specify the ring `R`. Useful to help Lean elaborate.
+local notation "↑ₘ[" R "]" => @coe _ (Matrix (Fin 2) (Fin 2) R) _
+
 -- mathport name: «exprGL( , )⁺»
 local notation "GL(" n ", " R ")" "⁺" => Matrix.gLPos (Fin n) R
 
@@ -109,7 +113,7 @@ theorem slash_action_eqn [SlashInvariantFormClass F Γ k] (f : F) (γ : Γ) :
 #align slash_invariant_form.slash_action_eqn SlashInvariantForm.slash_action_eqn
 
 theorem slash_action_eqn' (k : ℤ) (Γ : Subgroup SL(2, ℤ)) [SlashInvariantFormClass F Γ k] (f : F)
-    (γ : Γ) (z : ℍ) : f (γ • z) = ((↑ₘγ 1 0 : ℂ) * z + (↑ₘγ 1 1 : ℂ)) ^ k * f z :=
+    (γ : Γ) (z : ℍ) : f (γ • z) = ((↑ₘ[ℤ] γ 1 0 : ℂ) * z + (↑ₘ[ℤ] γ 1 1 : ℂ)) ^ k * f z :=
   by
   rw [← ModularForm.slash_action_eq'_iff]
   simp

Changes in mathlib4

mathlib3
mathlib4
style: replace '.-/' by '. -/' (#11938)

Purely automatic replacement. If this is in any way controversial; I'm happy to just close this PR.

Diff
@@ -195,7 +195,7 @@ theorem sub_apply (f g : SlashInvariantForm Γ k) (z : ℍ) : (f - g) z = f z -
 instance : AddCommGroup (SlashInvariantForm Γ k) :=
   DFunLike.coe_injective.addCommGroup _ rfl coe_add coe_neg coe_sub coe_smul coe_smul
 
-/-- Additive coercion from `SlashInvariantForm` to `ℍ → ℂ`.-/
+/-- Additive coercion from `SlashInvariantForm` to `ℍ → ℂ`. -/
 def coeHom : SlashInvariantForm Γ k →+ ℍ → ℂ where
   toFun f := f
   map_zero' := rfl
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
@@ -46,22 +46,22 @@ structure SlashInvariantForm where
 
 /-- `SlashInvariantFormClass F Γ k` asserts `F` is a type of bundled functions that are invariant
 under the `SlashAction`. -/
-class SlashInvariantFormClass extends DFunLike F ℍ fun _ => ℂ where
+class SlashInvariantFormClass [FunLike F ℍ ℂ] : Prop where
   slash_action_eq : ∀ (f : F) (γ : Γ), (f : ℍ → ℂ) ∣[k] γ = f
 #align slash_invariant_form_class SlashInvariantFormClass
 
-instance (priority := 100) SlashInvariantFormClass.slashInvariantForm :
-    SlashInvariantFormClass (SlashInvariantForm Γ k) Γ k where
+instance (priority := 100) SlashInvariantForm.funLike :
+    FunLike (SlashInvariantForm Γ k) ℍ ℂ where
   coe := SlashInvariantForm.toFun
   coe_injective' f g h := by cases f; cases g; congr
+
+instance (priority := 100) SlashInvariantFormClass.slashInvariantForm :
+    SlashInvariantFormClass (SlashInvariantForm Γ k) Γ k where
   slash_action_eq := SlashInvariantForm.slash_action_eq'
 #align slash_invariant_form_class.slash_invariant_form SlashInvariantFormClass.slashInvariantForm
 
 variable {F Γ k}
 
-instance : CoeFun (SlashInvariantForm Γ k) fun _ => ℍ → ℂ :=
-  DFunLike.hasCoeToFun
-
 @[simp]
 theorem SlashInvariantForm.toFun_eq_coe {f : SlashInvariantForm Γ k} : f.toFun = (f : ℍ → ℂ) :=
   rfl
@@ -89,10 +89,11 @@ namespace SlashInvariantForm
 
 open SlashInvariantForm
 
-variable {F : Type*} {Γ : outParam <| Subgroup SL(2, ℤ)} {k : outParam ℤ}
+variable {F : Type*} {Γ : Subgroup SL(2, ℤ)} {k : ℤ} [FunLike F ℍ ℂ]
 
 -- @[simp] -- Porting note: simpNF says LHS simplifies to something more complex
-theorem slash_action_eqn [SlashInvariantFormClass F Γ k] (f : F) (γ : Γ) : ↑f ∣[k] γ = ⇑f :=
+theorem slash_action_eqn [SlashInvariantFormClass F Γ k] (f : F) (γ : Γ) :
+    ↑f ∣[k] γ = ⇑f :=
   SlashInvariantFormClass.slash_action_eq f γ
 #align slash_invariant_form.slash_action_eqn SlashInvariantForm.slash_action_eqn
 
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
@@ -46,7 +46,7 @@ structure SlashInvariantForm where
 
 /-- `SlashInvariantFormClass F Γ k` asserts `F` is a type of bundled functions that are invariant
 under the `SlashAction`. -/
-class SlashInvariantFormClass extends FunLike F ℍ fun _ => ℂ where
+class SlashInvariantFormClass extends DFunLike F ℍ fun _ => ℂ where
   slash_action_eq : ∀ (f : F) (γ : Γ), (f : ℍ → ℂ) ∣[k] γ = f
 #align slash_invariant_form_class SlashInvariantFormClass
 
@@ -60,7 +60,7 @@ instance (priority := 100) SlashInvariantFormClass.slashInvariantForm :
 variable {F Γ k}
 
 instance : CoeFun (SlashInvariantForm Γ k) fun _ => ℍ → ℂ :=
-  FunLike.hasCoeToFun
+  DFunLike.hasCoeToFun
 
 @[simp]
 theorem SlashInvariantForm.toFun_eq_coe {f : SlashInvariantForm Γ k} : f.toFun = (f : ℍ → ℂ) :=
@@ -72,7 +72,7 @@ theorem SlashInvariantForm.coe_mk (f : ℍ → ℂ) (hf : ∀ γ : Γ, f ∣[k]
 
 @[ext]
 theorem SlashInvariantForm.ext {f g : SlashInvariantForm Γ k} (h : ∀ x, f x = g x) : f = g :=
-  FunLike.ext f g h
+  DFunLike.ext f g h
 #align slash_invariant_form_ext SlashInvariantForm.ext
 
 /-- Copy of a `SlashInvariantForm` with a new `toFun` equal to the old one.
@@ -192,7 +192,7 @@ theorem sub_apply (f g : SlashInvariantForm Γ k) (z : ℍ) : (f - g) z = f z -
 #align slash_invariant_form.sub_apply SlashInvariantForm.sub_apply
 
 instance : AddCommGroup (SlashInvariantForm Γ 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 `SlashInvariantForm` to `ℍ → ℂ`.-/
 def coeHom : SlashInvariantForm Γ k →+ ℍ → ℂ where
@@ -202,7 +202,7 @@ def coeHom : SlashInvariantForm Γ k →+ ℍ → ℂ where
 #align slash_invariant_form.coe_hom SlashInvariantForm.coeHom
 
 theorem coeHom_injective : Function.Injective (@coeHom Γ k) :=
-  FunLike.coe_injective
+  DFunLike.coe_injective
 #align slash_invariant_form.coe_hom_injective SlashInvariantForm.coeHom_injective
 
 instance : Module ℂ (SlashInvariantForm Γ k) :=
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
@@ -208,9 +208,14 @@ theorem coeHom_injective : Function.Injective (@coeHom Γ k) :=
 instance : Module ℂ (SlashInvariantForm Γ k) :=
   coeHom_injective.module ℂ coeHom fun _ _ => rfl
 
-instance : One (SlashInvariantForm Γ 0) :=
-  ⟨{toFun := 1
-    slash_action_eq' := fun A => ModularForm.is_invariant_one A }⟩
+/-- The `SlashInvariantForm` corresponding to `Function.const _ x`. -/
+@[simps (config := .asFn)]
+def const (x : ℂ) : SlashInvariantForm Γ 0 where
+  toFun := Function.const _ x
+  slash_action_eq' A := ModularForm.is_invariant_const A x
+
+instance : One (SlashInvariantForm Γ 0) where
+  one := { const 1 with toFun := 1 }
 
 @[simp]
 theorem one_coe_eq_one : ((1 : SlashInvariantForm Γ 0) : ℍ → ℂ) = 1 :=
@@ -233,4 +238,16 @@ theorem coe_mul {k₁ k₂ : ℤ} {Γ : Subgroup SL(2, ℤ)} (f : SlashInvariant
     (g : SlashInvariantForm Γ k₂) : ⇑(f.mul g) = ⇑f * ⇑g :=
   rfl
 
+instance (Γ : Subgroup SL(2, ℤ)) : NatCast (SlashInvariantForm Γ 0) where
+  natCast n := const n
+
+@[simp, norm_cast]
+theorem coe_natCast (n : ℕ) : ⇑(n : SlashInvariantForm Γ 0) = n := rfl
+
+instance (Γ : Subgroup SL(2, ℤ)) : IntCast (SlashInvariantForm Γ 0) where
+  intCast z := const z
+
+@[simp, norm_cast]
+theorem coe_intCast (z : ℤ) : ⇑(z : SlashInvariantForm Γ 0) = z := rfl
+
 end SlashInvariantForm
chore: remove redundant coercion in SlashInvariantForms (#8376)

This coercion is redundant with one already available via a FunLike instance. It's not actually particularly significant by itself, but it is shows up in many typeclass search traces, and because it comes first, obscures more serious problems!

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -91,11 +91,6 @@ open SlashInvariantForm
 
 variable {F : Type*} {Γ : outParam <| Subgroup SL(2, ℤ)} {k : outParam ℤ}
 
-instance (priority := 100) SlashInvariantFormClass.coeToFun [SlashInvariantFormClass F Γ k] :
-    CoeFun F fun _ => ℍ → ℂ :=
-  FunLike.hasCoeToFun
-#align slash_invariant_form.slash_invariant_form_class.coe_to_fun SlashInvariantForm.SlashInvariantFormClass.coeToFun
-
 -- @[simp] -- Porting note: simpNF says LHS simplifies to something more complex
 theorem slash_action_eqn [SlashInvariantFormClass F Γ k] (f : F) (γ : Γ) : ↑f ∣[k] γ = ⇑f :=
   SlashInvariantFormClass.slash_action_eq 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
@@ -36,7 +36,7 @@ section SlashInvariantForms
 
 open ModularForm
 
-variable (F : Type _) (Γ : outParam <| Subgroup SL(2, ℤ)) (k : outParam ℤ)
+variable (F : Type*) (Γ : outParam <| Subgroup SL(2, ℤ)) (k : outParam ℤ)
 
 /-- Functions `ℍ → ℂ` that are invariant under the `SlashAction`. -/
 structure SlashInvariantForm where
@@ -89,7 +89,7 @@ namespace SlashInvariantForm
 
 open SlashInvariantForm
 
-variable {F : Type _} {Γ : outParam <| Subgroup SL(2, ℤ)} {k : outParam ℤ}
+variable {F : Type*} {Γ : outParam <| Subgroup SL(2, ℤ)} {k : outParam ℤ}
 
 instance (priority := 100) SlashInvariantFormClass.coeToFun [SlashInvariantFormClass F Γ k] :
     CoeFun F fun _ => ℍ → ℂ :=
@@ -146,7 +146,7 @@ theorem coe_zero : ⇑(0 : SlashInvariantForm Γ k) = (0 : ℍ → ℂ) :=
 
 section
 
-variable {α : Type _} [SMul α ℂ] [IsScalarTower α ℂ ℂ]
+variable {α : Type*} [SMul α ℂ] [IsScalarTower α ℂ ℂ]
 
 instance instSMul : SMul α (SlashInvariantForm Γ 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,14 +2,11 @@
 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.slash_invariant_forms
-! leanprover-community/mathlib commit 738054fa93d43512da144ec45ce799d18fd44248
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.NumberTheory.ModularForms.SlashActions
 
+#align_import number_theory.modular_forms.slash_invariant_forms from "leanprover-community/mathlib"@"738054fa93d43512da144ec45ce799d18fd44248"
+
 /-!
 # Slash invariant forms
 
feat: port NumberTheory.ModularForms.Basic (#5662)

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

Diff
@@ -66,14 +66,17 @@ instance : CoeFun (SlashInvariantForm Γ k) fun _ => ℍ → ℂ :=
   FunLike.hasCoeToFun
 
 @[simp]
-theorem slashInvariantForm_toFun_eq_coe {f : SlashInvariantForm Γ k} : f.toFun = (f : ℍ → ℂ) :=
+theorem SlashInvariantForm.toFun_eq_coe {f : SlashInvariantForm Γ k} : f.toFun = (f : ℍ → ℂ) :=
   rfl
-#align slash_invariant_form_to_fun_eq_coe slashInvariantForm_toFun_eq_coe
+#align slash_invariant_form_to_fun_eq_coe SlashInvariantForm.toFun_eq_coe
+
+@[simp]
+theorem SlashInvariantForm.coe_mk (f : ℍ → ℂ) (hf : ∀ γ : Γ, f ∣[k] γ = f) : ⇑(mk f hf) = f := rfl
 
 @[ext]
-theorem slashInvariantForm_ext {f g : SlashInvariantForm Γ k} (h : ∀ x, f x = g x) : f = g :=
+theorem SlashInvariantForm.ext {f g : SlashInvariantForm Γ k} (h : ∀ x, f x = g x) : f = g :=
   FunLike.ext f g h
-#align slash_invariant_form_ext slashInvariantForm_ext
+#align slash_invariant_form_ext SlashInvariantForm.ext
 
 /-- Copy of a `SlashInvariantForm` with a new `toFun` equal to the old one.
 Useful to fix definitional equalities. -/
@@ -225,4 +228,17 @@ theorem one_coe_eq_one : ((1 : SlashInvariantForm Γ 0) : ℍ → ℂ) = 1 :=
 instance : Inhabited (SlashInvariantForm Γ k) :=
   ⟨0⟩
 
+/-- The slash invariant form of weight `k₁ + k₂` given by the product of two modular forms of
+weights `k₁` and `k₂`. -/
+def mul {k₁ k₂ : ℤ} {Γ : Subgroup SL(2, ℤ)} (f : SlashInvariantForm Γ k₁)
+    (g : SlashInvariantForm Γ k₂) : SlashInvariantForm Γ (k₁ + k₂) where
+  toFun := f * g
+  slash_action_eq' A := by
+    simp_rw [ModularForm.mul_slash_subgroup, SlashInvariantFormClass.slash_action_eq]
+
+@[simp]
+theorem coe_mul {k₁ k₂ : ℤ} {Γ : Subgroup SL(2, ℤ)} (f : SlashInvariantForm Γ k₁)
+    (g : SlashInvariantForm Γ k₂) : ⇑(f.mul g) = ⇑f * ⇑g :=
+  rfl
+
 end SlashInvariantForm
chore: tidy various files (#5628)
Diff
@@ -117,12 +117,12 @@ theorem SlashInvariantFormClass.coe_coe [SlashInvariantFormClass F Γ k] (f : F)
   rfl
 #align slash_invariant_form.slash_invariant_form_class.coe_coe SlashInvariantForm.SlashInvariantFormClass.coe_coe
 
-instance hasAdd : Add (SlashInvariantForm Γ k) :=
+instance instAdd : Add (SlashInvariantForm Γ k) :=
   ⟨fun f g =>
     { toFun := f + g
       slash_action_eq' := fun γ => by
         rw [SlashAction.add_slash, slash_action_eqn, slash_action_eqn] }⟩
-#align slash_invariant_form.has_add SlashInvariantForm.hasAdd
+#align slash_invariant_form.has_add SlashInvariantForm.instAdd
 
 @[simp]
 theorem coe_add (f g : SlashInvariantForm Γ k) : ⇑(f + g) = f + g :=
@@ -134,10 +134,10 @@ theorem add_apply (f g : SlashInvariantForm Γ k) (z : ℍ) : (f + g) z = f z +
   rfl
 #align slash_invariant_form.add_apply SlashInvariantForm.add_apply
 
-instance hasZero : Zero (SlashInvariantForm Γ k) :=
+instance instZero : Zero (SlashInvariantForm Γ k) :=
   ⟨{toFun := 0
     slash_action_eq' := SlashAction.zero_slash _}⟩
-#align slash_invariant_form.has_zero SlashInvariantForm.hasZero
+#align slash_invariant_form.has_zero SlashInvariantForm.instZero
 
 @[simp]
 theorem coe_zero : ⇑(0 : SlashInvariantForm Γ k) = (0 : ℍ → ℂ) :=
@@ -148,11 +148,11 @@ section
 
 variable {α : Type _} [SMul α ℂ] [IsScalarTower α ℂ ℂ]
 
-instance hasSmul : SMul α (SlashInvariantForm Γ k) :=
+instance instSMul : SMul α (SlashInvariantForm Γ k) :=
   ⟨fun c f =>
     { toFun := c • ↑f
       slash_action_eq' := fun γ => by rw [SlashAction.smul_slash_of_tower, slash_action_eqn] }⟩
-#align slash_invariant_form.has_smul SlashInvariantForm.hasSmul
+#align slash_invariant_form.has_smul SlashInvariantForm.instSMul
 
 @[simp]
 theorem coe_smul (f : SlashInvariantForm Γ k) (n : α) : ⇑(n • f) = n • ⇑f :=
@@ -166,11 +166,11 @@ theorem smul_apply (f : SlashInvariantForm Γ k) (n : α) (z : ℍ) : (n • f)
 
 end
 
-instance hasNeg : Neg (SlashInvariantForm Γ k) :=
+instance instNeg : Neg (SlashInvariantForm Γ k) :=
   ⟨fun f =>
     { toFun := -f
       slash_action_eq' := fun γ => by rw [SlashAction.neg_slash, slash_action_eqn] }⟩
-#align slash_invariant_form.has_neg SlashInvariantForm.hasNeg
+#align slash_invariant_form.has_neg SlashInvariantForm.instNeg
 
 @[simp]
 theorem coe_neg (f : SlashInvariantForm Γ k) : ⇑(-f) = -f :=
@@ -182,9 +182,9 @@ theorem neg_apply (f : SlashInvariantForm Γ k) (z : ℍ) : (-f) z = -f z :=
   rfl
 #align slash_invariant_form.neg_apply SlashInvariantForm.neg_apply
 
-instance hasSub : Sub (SlashInvariantForm Γ k) :=
+instance instSub : Sub (SlashInvariantForm Γ k) :=
   ⟨fun f g => f + -g⟩
-#align slash_invariant_form.has_sub SlashInvariantForm.hasSub
+#align slash_invariant_form.has_sub SlashInvariantForm.instSub
 
 @[simp]
 theorem coe_sub (f g : SlashInvariantForm Γ k) : ⇑(f - g) = f - g :=
feat: port NumberTheory.ModularForms.SlashInvariantForms (#5543)

Dependencies 12 + 777

778 files ported (98.5%)
341397 lines ported (98.4%)
Show graph

The unported dependencies are

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