Solution (source code)

= Solution

The <Hecke operators> organize <modular forms> simultaneously by their transformation law and their <Fourier coefficients>. Work with $\Gamma=SL_2(\mathbb Z)$, $M_k$ its space of weight-$k$ <modular forms>, and $S_k$ its <cusp form> subspace, with even $k\geq4$. Odd weights give <zero> spaces. The normalization below makes the first coefficient of $T_nf$ equal to the $n$th coefficient of $f$, which is the key link between operators and arithmetic.

For $A=\begin{pmatrix}a&b\\c&d\end{pmatrix}$ with positive determinant, the determinant-normalized <slash operator for modular forms> is
$$
(f|_kA)(\tau)=(\det A)^{k/2}(c\tau+d)^{-k}f(A\tau).
$$
The <automorphy factor> identity proves $(f|_kA)|_kB=f|_k(AB)$. Positive scalar <matrices> act trivially. Let $\mathcal A_n$ be the integral <matrices> of determinant $n>0$. Left multiplication by $\Gamma$ reduces their first column, by <Bezout identity>, to $(a,0)$ with $a>0$; the determinant then gives $d=n/a>0$. A row shear makes $0\leq b<d$. These are unique <determinant-n matrix representatives for Hecke operators>, so define
$$
T_nf=n^{k/2-1}\sum_{A\in\Gamma\backslash\mathcal A_n}f|_kA
=n^{k-1}\sum_{ad=n}d^{-k}\sum_{b=0}^{d-1}f\left(\frac{a\tau+b}{d}\right).
$$
Right multiplication by any element of $\Gamma$ permutes these left <cosets>. The <slash operator for modular forms> identity therefore proves that $T_nf$ has the same modular transformation law as $f$. Each summand is <holomorphic> on the <upper half-plane>. Its cusp behavior follows explicitly from the coefficient calculation below, so $T_n$ preserves both $M_k$ and $S_k$.

Insert $f=\sum_{r\geq0}a_rq^r$ in the sum. The finite sum over $b$ is <zero> unless $d\mid r$, in which case it is $d$. Writing $r=d\ell$ leaves the term $a_{d\ell}q^{a\ell}$ with multiplier $n^{k-1}d^{1-k}=a^{k-1}$. Thus the <Fourier coefficients of a composite-index Hecke operator> are
$$
\boxed{a_m(T_nf)=\sum_{a\mid\gcd(m,n)}a^{k-1}a_{mn/a^2}(f).}
$$
For $m=0$ use $\gcd(0,n)=n$. In particular the constant coefficient becomes $\sigma_{k-1}(n)a_0$, so <cusp forms> remain <cusp forms>, and
$$
a_1(T_nf)=a_n(f),\qquad
T_pf=p^{k-1}f(p\tau)+\frac1p\sum_{b=0}^{p-1}f\left(\frac{\tau+b}{p}\right)
$$
for a <prime number> $p$. The absence of negative powers proves cusp holomorphy. Notice that no primality assumption is needed in the composite-index formula.

The <Hecke multiplication relations> can be derived directly, rather than assumed from the <coset> description. On <Fourier series> define auxiliary maps $U_p(\sum a_mq^m)=\sum a_{pm}q^m$ and $V_pf(q)=f(q^p)$. They need not separately preserve $M_k$, but $U_pV_p=1$. With $c=p^{k-1}$, the coefficient formula gives
$$
T_{p^r}=\sum_{j=0}^r c^jV_p^jU_p^{r-j},\qquad T_p=U_p+cV_p.
$$
Multiplying on the left by $U_p+cV_p$, the term $j=0$ in the $U_p$ sum contributes $U_p^{r+1}$; the terms with $j\geq1$ become $c^jV_p^{j-1}U_p^{r-j}$. Together with the $cV_p$ sum this is exactly $T_{p^{r+1}}+cT_{p^{r-1}}$. Hence the <Hecke prime-power recurrence from q-shift operators> is
$$
T_pT_{p^r}=T_{p^{r+1}}+p^{k-1}T_{p^{r-1}}\quad(r\geq1),\qquad T_1=1.
$$
For coprime $m,n$, substituting the coefficient formula twice gives a sum over $a\mid\gcd(m,r)$ and $b\mid\gcd(n,r)$ with coefficient $(ab)^{k-1}a_{mnr/(ab)^2}(f)$. The divisors $a,b$ correspond uniquely to a divisor $ab\mid\gcd(mn,r)$, so $T_mT_n=T_{mn}$. The prime-power recurrence, by induction on the smaller exponent, gives
$$
T_{p^r}T_{p^s}=\sum_{j=0}^{\min(r,s)}p^{j(k-1)}T_{p^{r+s-2j}}.
$$
Combining the coprime and prime-power formulas proves
$$
\boxed{T_mT_n=\sum_{d\mid\gcd(m,n)}d^{k-1}T_{mn/d^2}.}
$$
In particular the <Hecke operators> commute, and the <modular Hecke algebra> is generated by the prime operators.

The analytic reason for simultaneous <diagonalization> is the <Petersson inner product>
$$
\langle f,g\rangle=\int_{\Gamma\backslash\mathbb H}f(\tau)\overline{g(\tau)}y^k\,d\mu,
\qquad d\mu=\frac{dx\,dy}{y^2},
$$
which is positive definite on $S_k$ and convergent because of exponential cusp decay. Here is the adjoint argument. For a <matrix> $A$, set $H_A=\Gamma\cap A^{-1}\Gamma A$. The left <cosets> in $\Gamma A\Gamma$ are represented by $A\gamma$ with $\gamma\in H_A\backslash\Gamma$. Unfolding this finite <coset> sum in the <Petersson inner product> gives
$$
\left\langle\sum_{\gamma\in H_A\backslash\Gamma}f|_kA\gamma,g\right\rangle
=\int_{H_A\backslash\mathbb H}(f|_kA)(\tau)\overline{g(\tau)}y^k\,d\mu.
$$
Under $z=A\tau$, <hyperbolic area> is unchanged and the determinant factors in the <slash operator for modular forms> give
$$
(f|_kA)(\tau)\overline{g(\tau)}y^k
=f(z)\overline{(g|_kA^{-1})(z)}(\operatorname{Im}z)^k.
$$
The integration group becomes $AH_AA^{-1}=\Gamma\cap A\Gamma A^{-1}$. Folding this finite cover back to $\Gamma\backslash\mathbb H$ identifies the adjoint with the correspondence for $A^{-1}$. For $A\in\mathcal A_n$, the <matrix> $\operatorname{adj}(A)=nA^{-1}$ is again integral with determinant $n$; scalar <matrices> act trivially, and adjugation permutes the <double cosets> making up $\mathcal A_n$. The real normalizing factor $n^{k/2-1}$ is unchanged. Thus this proves that <Hecke operators are self-adjoint for the Petersson inner product>:
$$
\langle T_nf,g\rangle=\langle f,T_ng\rangle.
$$
The <valence formula for the modular group> makes $S_k$ a <finite-dimensional vector space>. Commuting <self-adjoint operators> on a finite-dimensional <inner product space> have a common <orthogonal> <eigenbasis>: diagonalize one operator, use commutativity to preserve each of its <eigenspaces>, and repeat within those spaces. Therefore $S_k$ has a basis of <Hecke eigenforms>, with real <Hecke operator> <eigenvalues>.

If $f$ is a common <Hecke eigenform>, say $T_nf=\lambda_nf$, its first <Fourier coefficient> cannot vanish: $a_1=0$ would imply $a_n=a_1(T_nf)=\lambda_na_1=0$ for every $n$. Normalize $a_1=1$. Then \b[the <Hecke operator> <eigenvalue> $\lambda_n$ is precisely the <Fourier coefficient> $a_n$.] The <Hecke multiplication relations> become
$$
a_ma_n=\sum_{d\mid\gcd(m,n)}d^{k-1}a_{mn/d^2},\qquad
a_{p^{r+1}}=a_pa_{p^r}-p^{k-1}a_{p^{r-1}}.
$$
Consequently the coefficients are multiplicative at coprime indices, and their local generating function satisfies
$$
\sum_{r\geq0}a_{p^r}X^r=\frac1{1-a_pX+p^{k-1}X^2}.
$$
This gives the <Euler product of a Hecke eigenform>
$$
\boxed{L(f,s)=\prod_p\left(1-a_pp^{-s}+p^{k-1-2s}\right)^{-1}}
$$
in a half-plane of <absolute convergence>. The <Fourier coefficient bound for a cusp form> already supplies such a half-plane; Question 4 improves it to $\operatorname{Re}s>(k+1)/2$.

The <L-function of a cusp form> also has an analytic description independent of the <Hecke eigenform> condition. Termwise <Mellin transform> in an initial right half-plane gives
$$
\Lambda(f,s)=(2\pi)^{-s}\Gamma(s)L(f,s)=\int_0^\infty f(iy)y^{s-1}\,dy.
$$
At infinity the <cusp form> decays exponentially. Modular inversion gives $f(i/y)=(iy)^kf(iy)$, so at <zero> it is $O(y^{-k}e^{-2\pi/y})$. The integral therefore converges locally uniformly for every $s$, continuing $\Lambda$ to an <entire function>. Changing $y$ to $1/y$ proves
$$
\boxed{\Lambda(f,s)=i^k\Lambda(f,k-s).}
$$
For a normalized <Hecke eigenform>, the <Euler product of a Hecke eigenform> and this <functional equation> describe the same completed <L-function of a cusp form>.

There is also an integral arithmetic structure. One standard consequence of the level-one dimension formula and the <valence formula for the modular group> is the <integral triangular basis of level-one modular forms>: if $k=12m+s$ with $s\in\{0,4,6,8,10,14\}$, choose $F_s=1,E_4,E_6,E_4^2,E_4E_6,E_4^2E_6$ respectively. Then
$$
\Delta^jE_4^{3(m-j)}F_s,\qquad 0\leq j\leq m,
$$
form a basis of $M_k$, and the terms $1\leq j\leq m$ form a basis of $S_k$. Their first nonzero terms are $q^j$ with coefficient one and all coefficients are <integers>. Successive elimination of coefficients of $q,q^2,\ldots,q^m$ shows that these cusp basis elements generate exactly the lattice of rational <cusp forms> with integral <Fourier coefficients>. The composite-index coefficient formula preserves this lattice, so each $T_n$ has an integral <matrix> on it. Its <characteristic polynomial> is monic with integral coefficients. This proves that <Hecke eigenvalues are algebraic integers>; self-adjointness also makes every root of that <characteristic polynomial> real. The field generated by the <eigenvalues> is a finite totally real <number field>: a finite set of operators spans the finite-dimensional rational <modular Hecke algebra>, and every conjugate of each <eigenvalue> remains a root of its real-rooted <characteristic polynomial>.

Two basic examples connect the operator theory to familiar <modular forms>. The normalized <Eisenstein series> $E_k$ has coefficients proportional to $\sigma_{k-1}(n)$. At a <prime number> its coefficient formula uses
$$
\sigma_{k-1}(pm)+p^{k-1}\sigma_{k-1}(m/p)
=(1+p^{k-1})\sigma_{k-1}(m),
$$
where the second term is <zero> unless $p\mid m$. This follows by writing $m=p^ru$ with $p\nmid u$ and summing a finite <geometric series>. It proves $T_pE_k=(1+p^{k-1})E_k$, and the <Hecke multiplication relations> give $T_nE_k=\sigma_{k-1}(n)E_k$. Meanwhile $S_{12}=\mathbb C\Delta$ implies $T_n\Delta=\tau(n)\Delta$, because $a_1(\Delta)=1$. Thus the <Ramanujan tau function> is multiplicative and satisfies $\tau(p^{r+1})=\tau(p)\tau(p^r)-p^{11}\tau(p^{r-1})$. For example, $\tau(2)=-24$ gives $\tau(4)=(-24)^2-2^{11}=-1472$. This illustrates how <Hecke operators> turn analytic <Fourier coefficients> into a coherent arithmetic system.