Abstract. We explain how different definitions of Hecke operators relate to each other.
Let $ k $ be a field, and let $ E $ be a $ k $-variety. The following are equivalent:
$ E $ is an abelian variety of dimension 1 over $ k $;
$ E $ is a smooth, projective curve of genus one with a choice of origin;
we refer to such $ E $ as being elliptic.
We call a discrete additive subgroup $ L $ of $ k $ a lattice. There exists an additive isomorphism of $ L $ with $ \mathbb{Z}^n $; we call $ n $ the rank of our lattice.
Assume $ L $ is a complex lattice of rank 2, which we write
\[L = \left< w_1, w_2 \right> = \left< a_1 w_1 + a_2 w_2 \mid a_i \in \mathbb{Z} \right>\]with $ w_2 / w_1 \in \mathcal{H} $ and $ \mathcal{H} $ the upper-half plane. The quotient $ \mathbb{C}/L $ is an abelian variety of dimension 1 over $ \mathbb{C} $; hence, an elliptic curve. Every complex elliptic curve arises in this manner, and there is a bijection between isomorphism classes of elliptic curves and lattices up to homothety. (This is not true for higher dimensional complex abelian varieties.) In the sequel, we let $ \mathcal{L} $ denote the free abelian group generated by complex lattices of rank 2 (i.e. elliptic curves).
Elements of the modular group $ \gamma \in \text{SL}_2(\mathbb{Z}) $ act on $ \mathcal{H} $ by fractional linear transformations; meaning for $ z \in \mathcal{H} $ and
\[\gamma = \begin{bmatrix} a & b \\ c & d \end{bmatrix}, \text{ we put } \gamma(z) = \frac{az + b}{cz + d}.\]A holomorphic function $ f \colon \mathcal{H} \to \mathbb{C} $ is called a modular form of weight $ k $ if, for any $ \gamma \in \text{SL}_2(\mathbb{Z}) $,
\[f(\gamma(z)) = (cz+d)^k f(z),\]and $ f(z) $ remains bounded as $ \text{im}(z) $ approaches infinity. Equivalently, we define modular forms as homogeneous functions $ F \colon \mathcal{L} \to \mathbb{C} $ of degree $ -k $; meaning, for $ \lambda \in \mathbb{C}^{\times} $,
\[F(\lambda w_1, \lambda w_2) = \lambda^{-k} F(w_1, w_2).\]Indeed, given a modular form $ f $ of weight $ k $, we put
\[F(a, b) = b^{-k} f(a/b),\]and given a homogeneous function $ F $ of weight $ -k $, we put
\[f(z) = F(z, 1).\]This correspondence is bijective, and we denote our spaces of modular forms by $ f \in M_k $ and $ F \in M_k^{\mathcal{L}} $; put $ M_* = \bigoplus M_k $ and $ M_*^{\mathcal{L}} = \bigoplus M_k^{\mathcal{L}} $. We define the Hecke algebra on these spaces as follows.
($ \mathcal{H} $ point de vue) Put $ \Gamma = \text{SL}_2(\mathbb{Z}) $. Define $ H_k $ to be the free abelian group with basis elements double cosets $ \Gamma \alpha \Gamma $ where $ \alpha \in M_2^+(\mathbb{Z}) $, the plus meaning positive determinant. Take coset decompositions
\[x = \Gamma \alpha \Gamma = \coprod_{i=1}^A \Gamma \alpha_i, \qquad y = \Gamma \beta \Gamma = \coprod_{j=1}^B \Gamma \beta_j,\]and $ z = \Gamma \xi \Gamma $, then set
\[x \cdot y = \sum_{z \subseteq \Gamma \alpha \Gamma \beta \Gamma} m(x \cdot y, z) z\](summing over all cosets $ z $ contained in $ \Gamma \alpha \Gamma \beta \Gamma $), where
\[m(x \cdot y, z) = \text{Card}\{ (i, j) \mid \Gamma \alpha_i \beta_j = \Gamma \zeta \};\]this product is independent of our coset representatives, and it is associative and commutative; we extend it $ \mathbb{Z} $-linearly to define multiplication on $ H $. (Observe multiplication here is a type of convolution.) We call $ H $ the Hecke algebra.
$ H $ can be considered a subalgebra of $ \text{End}(M_*) $, and hence $ M $ a left $ H $-module, by the action on $ f \in M_k $
\[\Gamma \alpha \Gamma \cdot f(z) = \det(\alpha)^{k-1} \sum_{i=1}^A j(\alpha_i, z)^{-k} f(\alpha_i(z)),\]We define the $ n $-th Hecke operator as the coset
\[T_n = \Gamma \begin{bmatrix} n & 0 \\ 0 & 1 \end{bmatrix} \Gamma\]$ H $ is generated by the $ T_n $. (This is the simplest matrix of determinant $ n $.)
(Measure point de vue) Let
\[\varphi \colon \text{SL}_2(\mathbb{Z}) \backslash \text{M}_2^+(\mathbb{Z}) / \text{SL}_2(\mathbb{Z}) \to \mathbb{Z}\]be a continuous function with compact support; assuming the left hand side is equipped with the discrete topology, this reduces to saying $ \varphi $ is supported on finitely many cosets. Write $ H^{\mathcal{M}} $ for the set of all such $ \varphi $. Let multiplication on $ H^{\mathcal{M}} $ be the convolution
\[(\varphi_1 \ast \varphi_2)(x) = \int_{\text{SL}_2(\mathbb{Z}) \backslash \text{M}_2^+(\mathbb{Z}) / \text{SL}_2(\mathbb{Z})} \varphi_1(y) \varphi_2(y^{-1} x) dy,\]where every $ y $ is a point mass of volume 1. We call $ H^{\mathcal{M}} $ the Hecke algebra.
Each $ \varphi \in H^{\mathcal{M}} $ acts on $ f \in M_k $ by
\[\varphi \cdot f = \int_{\text{SL}_2(\mathbb{Z}) \backslash M_2^+(\mathbb{Z})} \det(g)^{k-1} j(g, z)^{-k} f(g(z)) \varphi(g) dg\](with the same measure). In particular, the $ n $-th Hecke opeartor $ T_n^{\mathcal{M}} $ is the characteristic function on the coset of $ T_n $ above.
(Lattice point de vue) We define the $ n $-th Hecke operator $ T_n^{\mathcal{L}} \in \text{End}(M_k^{\mathcal{L}}) $ by
\[T_n^{\mathcal{L}} F(L) = n^{k-1} \sum_{[L : L'] = n} F(L');\]note that again the action depends on the weight $ -k $ of $ F $. We call the subalgebra $ H^{\mathcal{L}} $ of $ \text{End} (M^{\mathcal{L}}_{\ast}) $ generated by the $ T_n^{\mathcal{L}} $ the Hecke algebra.
Theorem 1. $ T_n f(z) = T_n^{\mathcal{M}} = T_n^{\mathcal{L}} F(z, 1) $.
The first equality follows by definition. Put $ L = \left< z, 1 \right> $. Any index $ n $ sublattice $ L' $ of $ L $ is given by a $ \mathbb{Z} $-linear transformation $ M \colon L \to L' $ with $ \det M = n $. Since \(\text{SL}_2(\mathbb{Z})\) is the kernel of the determinant, we have a bijection between isomorphism classes of index $ n $ sublattices and \(M_n^+(\mathbb{Z})/\text{SL}_2(\mathbb{Z})\). Writing $ \Gamma T_n \Gamma = \coprod_{i=1}^N \Gamma t_i $, it then follows immediately that
\[T_n f(z) = n^{k-1} \sum_{i=1}^N f(t_i(z)) = n^{k-1} \sum_{[L : L'] = n} F(L) = T_n^{\mathcal{L}} F(L).\]Q.E.D.
Let $ G $ be a t.d. (totally disconnected) topological group, meaning every neighborhood of 1 contains a compact open subgroup; let $ K $ be any compact open subgroup of $ G $. Denote by $ H(G, K) $ be the algebra of compactly suppoerted characters $ \varphi \colon K \backslash G / K \to \mathbb{C} $, where the product is a with the convolution with respect to a Haar measure. We call $ H(G, K) $ the Hecke algebra of $ G $ with respect to $ K $.
In §1, we considered "$ H^{\mathcal{M}} = H(M_2^+(\mathbb{Z}), \text{SL}_2(\mathbb{Z})) $", the quotation marks being because $ M_2^+(\mathbb{Z}) $ is not a group.