Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 1c67b65

Browse files
committed
chore(number_theory/modular_forms/slash_invariant_forms): deduplicate scalar actions (#17765)
This will also avoid needing the same three actions downstream.
1 parent ca95e36 commit 1c67b65

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

src/number_theory/modular_forms/slash_invariant_forms.lean

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -113,28 +113,20 @@ instance has_zero : has_zero (slash_invariant_form Γ k) :=
113113

114114
@[simp] lemma coe_zero : ⇑(0 : slash_invariant_form Γ k) = (0 : ℍ → ℂ) := rfl
115115

116-
instance has_csmul : has_smul ℂ (slash_invariant_form Γ k) :=
117-
⟨ λ c f, {to_fun := c • f,
118-
slash_action_eq' := by {intro γ, convert slash_action.smul_action k γ ⇑f c,
119-
exact (f.slash_action_eq' γ).symm}}⟩
116+
section
117+
variables {α : Type*} [has_smul α ℂ] [is_scalar_tower α ℂ ℂ]
120118

121-
@[simp] lemma coe_csmul (f : slash_invariant_form Γ k) (n : ℂ) : ⇑(n • f) = n • f := rfl
122-
@[simp] lemma csmul_apply (f : slash_invariant_form Γ k) (n : ℂ) (z : ℍ) :
123-
(n • f) z = n • (f z) := rfl
124-
125-
instance has_nsmul : has_smul ℕ (slash_invariant_form Γ k) :=
126-
⟨ λ c f, ((c : ℂ) • f).copy (c • f) (nsmul_eq_smul_cast _ _ _)⟩
119+
instance has_smul : has_smul α (slash_invariant_form Γ k) :=
120+
⟨ λ c f,
121+
{ to_fun := c • f,
122+
slash_action_eq' := λ γ, by rw [←smul_one_smul ℂ c ⇑f, slash_action.smul_action k γ ⇑f,
123+
slash_action_eqn] }⟩
127124

128-
@[simp] lemma coe_nsmul (f : slash_invariant_form Γ k) (n : ) : ⇑(n • f) = n • f := rfl
129-
@[simp] lemma nsmul_apply (f : slash_invariant_form Γ k) (n : ) (z : ℍ) :
125+
@[simp] lemma coe_smul (f : slash_invariant_form Γ k) (n : α) : ⇑(n • f) = n • f := rfl
126+
@[simp] lemma smul_apply (f : slash_invariant_form Γ k) (n : α) (z : ℍ) :
130127
(n • f) z = n • (f z) := rfl
131128

132-
instance has_zsmul : has_smul ℤ (slash_invariant_form Γ k) :=
133-
⟨ λ c f, ((c : ℂ) • f).copy (c • f) (zsmul_eq_smul_cast _ _ _)⟩
134-
135-
@[simp] lemma coe_zsmul (f : slash_invariant_form Γ k) (n : ℤ) : ⇑(n • f) = n • f := rfl
136-
@[simp] lemma zsmul_apply (f : slash_invariant_form Γ k) (n : ℤ) (z : ℍ) :
137-
(n • f) z = n • (f z) := rfl
129+
end
138130

139131
instance has_neg : has_neg (slash_invariant_form Γ k) :=
140132
⟨ λ f,
@@ -151,7 +143,7 @@ instance has_sub : has_sub (slash_invariant_form Γ k) := ⟨ λ f g, f + -g ⟩
151143
@[simp] lemma sub_apply (f g : slash_invariant_form Γ k) (z : ℍ) : (f - g) z = f z - g z := rfl
152144

153145
instance : add_comm_group (slash_invariant_form Γ k) :=
154-
fun_like.coe_injective.add_comm_group _ rfl coe_add coe_neg coe_sub coe_nsmul coe_zsmul
146+
fun_like.coe_injective.add_comm_group _ rfl coe_add coe_neg coe_sub coe_smul coe_smul
155147

156148
/--Additive coercion from `slash_invariant_form` to `ℍ → ℂ`.-/
157149
def coe_hom : slash_invariant_form Γ k →+ (ℍ → ℂ) :=

0 commit comments

Comments
 (0)