[proofplan]
The proof uses the Hecke relations for [Fourier coefficients of a normalized Hecke eigenform](/theorems/4251). These relations first give multiplicativity away from common prime factors, so absolute convergence allows the Dirichlet series to factor into local prime-[power series](/page/Power%20Series). For each prime $p$, the same Hecke relation gives a second-order recurrence for the coefficients $a_{p^r}$, and this recurrence identifies the local generating function with the reciprocal of $1-a_pX+p^{k-1}X^2$. Substituting $X=p^{-s}$ and multiplying the local identities gives the Euler product.
[/proofplan]
[step:Extract multiplicativity and the prime-power recurrence from the Hecke relations]
Let $\mathbb{N}=\{1,2,3,\dots\}$ denote the set of positive integers. We use the standard Hecke relation for Fourier coefficients of normalized Hecke eigenforms: for all $m,n \in \mathbb{N}$,
\begin{align*}
a_m a_n=\sum_{d \mid \gcd(m,n)} d^{k-1} a_{mn/d^2}.
\end{align*}
This external Hecke relation is the only input about Hecke operators used in the proof.
If $\gcd(m,n)=1$, the only positive divisor of $\gcd(m,n)$ is $1$, and therefore
\begin{align*}
a_m a_n=a_{mn}.
\end{align*}
Thus the coefficient sequence $(a_n)_{n \geq 1}$ is multiplicative.
Now fix a prime number $p$ and an integer $r \geq 1$. Applying the Hecke relation with $m=p$ and $n=p^r$ gives
\begin{align*}
a_p a_{p^r}
&=\sum_{d \mid p} d^{k-1} a_{p^{r+1}/d^2} \\
&=a_{p^{r+1}}+p^{k-1}a_{p^{r-1}}.
\end{align*}
Rearranging yields the recurrence
\begin{align*}
a_{p^{r+1}}=a_p a_{p^r}-p^{k-1}a_{p^{r-1}}
\end{align*}
for every $r \geq 1$.
[guided]
Let $\mathbb{N}=\{1,2,3,\dots\}$ denote the set of positive integers. The Hecke relation is the algebraic input. Since $f$ is a normalized Hecke eigenform, its Fourier coefficients satisfy, for all positive integers $m$ and $n$,
\begin{align*}
a_m a_n=\sum_{d \mid \gcd(m,n)} d^{k-1} a_{mn/d^2}.
\end{align*}
This external Hecke relation is the only input about Hecke operators used in the proof.
First suppose $\gcd(m,n)=1$. Then the set of positive divisors of $\gcd(m,n)$ is the singleton $\{1\}$. The Hecke relation reduces to
\begin{align*}
a_m a_n=1^{k-1}a_{mn}=a_{mn}.
\end{align*}
This is exactly multiplicativity of the coefficient sequence.
Next fix a prime number $p$ and an integer $r \geq 1$. We apply the same Hecke relation with $m=p$ and $n=p^r$. Since $\gcd(p,p^r)=p$, its positive divisors are $1$ and $p$. Hence
\begin{align*}
a_p a_{p^r}
&=\sum_{d \mid p} d^{k-1} a_{p^{r+1}/d^2} \\
&=1^{k-1}a_{p^{r+1}}+p^{k-1}a_{p^{r+1}/p^2} \\
&=a_{p^{r+1}}+p^{k-1}a_{p^{r-1}}.
\end{align*}
Solving this identity for $a_{p^{r+1}}$ gives
\begin{align*}
a_{p^{r+1}}=a_p a_{p^r}-p^{k-1}a_{p^{r-1}}.
\end{align*}
This recurrence is the local relation that will determine the Euler factor at $p$.
[/guided]
[/step]
[step:Factor the absolutely convergent Dirichlet series into prime-power series]
Fix $s \in \mathbb{C}$ such that
\begin{align*}
\sum_{n=1}^{\infty} |a_n n^{-s}|<\infty.
\end{align*}
Let $\mathcal{P}$ denote the set of prime numbers. For a finite subset $P \subset \mathcal{P}$, define
\begin{align*}
N(P)=\{n \in \mathbb{N}: \text{every prime divisor of } n \text{ lies in } P\}.
\end{align*}
By unique factorization and multiplicativity of $(a_n)_{n \geq 1}$,
\begin{align*}
\prod_{p \in P}\left(\sum_{r=0}^{\infty} a_{p^r}p^{-rs}\right)
=
\sum_{n \in N(P)} a_n n^{-s}.
\end{align*}
The series on the right is absolutely convergent because it is a subseries of the absolutely convergent series defining $L(f,s)$.
As $P$ increases through finite subsets of $\mathcal{P}$, the sets $N(P)$ increase to all of $\mathbb{N}$. Absolute convergence gives
\begin{align*}
\lim_{P}\sum_{n \in N(P)} a_n n^{-s}
=
\sum_{n=1}^{\infty}a_n n^{-s}
=
L(f,s),
\end{align*}
where the limit is over the directed set of finite subsets of $\mathcal{P}$ ordered by inclusion. Therefore
\begin{align*}
L(f,s)=\prod_{p}\left(\sum_{r=0}^{\infty}a_{p^r}p^{-rs}\right).
\end{align*}
[guided]
We now justify the passage from a Dirichlet series to an Euler product. Fix a complex number $s$ in the region of absolute convergence, so
\begin{align*}
\sum_{n=1}^{\infty} |a_n n^{-s}|<\infty.
\end{align*}
Let $\mathcal{P}$ be the set of prime numbers. For a finite subset $P \subset \mathcal{P}$, define
\begin{align*}
N(P)=\{n \in \mathbb{N}: \text{every prime divisor of } n \text{ lies in } P\}.
\end{align*}
Thus $N(P)$ consists exactly of those positive integers whose prime factorization uses only primes from $P$.
For such a finite set $P$, each $n \in N(P)$ has a unique expression
\begin{align*}
n=\prod_{p \in P} p^{r_p},
\end{align*}
where each $r_p$ is a nonnegative integer and all but finitely many exponents are already accounted for because $P$ is finite. Since the coefficients are multiplicative, repeated use of $a_{mn}=a_m a_n$ for coprime $m$ and $n$ gives
\begin{align*}
a_n=\prod_{p \in P} a_{p^{r_p}}.
\end{align*}
Also,
\begin{align*}
n^{-s}=\prod_{p \in P} p^{-r_p s}.
\end{align*}
Multiplying the finitely many local series therefore gives
\begin{align*}
\prod_{p \in P}\left(\sum_{r=0}^{\infty} a_{p^r}p^{-rs}\right)
=
\sum_{(r_p)_{p \in P}} \prod_{p \in P} a_{p^{r_p}}p^{-r_p s}
=
\sum_{n \in N(P)} a_n n^{-s}.
\end{align*}
The rearrangement is legitimate because the final series is a subseries of the absolutely convergent series
\begin{align*}
\sum_{n=1}^{\infty}|a_n n^{-s}|.
\end{align*}
Finally, as the finite set $P$ grows through all finite subsets of $\mathcal{P}$, the sets $N(P)$ exhaust $\mathbb{N}$. Absolute convergence permits passage to the limit over these finite partial Euler products:
\begin{align*}
\lim_{P}\sum_{n \in N(P)} a_n n^{-s}
=
\sum_{n=1}^{\infty}a_n n^{-s}
=
L(f,s).
\end{align*}
Hence
\begin{align*}
L(f,s)=\prod_p\left(\sum_{r=0}^{\infty}a_{p^r}p^{-rs}\right).
\end{align*}
[/guided]
[/step]
[step:Compute each local prime-power generating function]
Fix a prime number $p$. Define the formal power series $A_p(X) \in \mathbb{C}[[X]]$ by
\begin{align*}
A_p(X)=\sum_{r=0}^{\infty}a_{p^r}X^r.
\end{align*}
The identity below is interpreted in the formal power series ring $\mathbb{C}[[X]]$. Since $a_1=1$, we have $a_{p^0}=a_1=1$. Multiplying by $1-a_pX+p^{k-1}X^2$ gives
\begin{align*}
(1-a_pX+p^{k-1}X^2)\sum_{r=0}^{\infty}a_{p^r}X^r
&=a_1+(a_p-a_pa_1)X \\
&\quad+\sum_{r=2}^{\infty}\left(a_{p^r}-a_p a_{p^{r-1}}+p^{k-1}a_{p^{r-2}}\right)X^r.
\end{align*}
The coefficient of $X$ is zero because $a_1=1$. For $r \geq 2$, the recurrence from the first step gives
\begin{align*}
a_{p^r}-a_p a_{p^{r-1}}+p^{k-1}a_{p^{r-2}}=0.
\end{align*}
Therefore
\begin{align*}
(1-a_pX+p^{k-1}X^2)\sum_{r=0}^{\infty}a_{p^r}X^r=1,
\end{align*}
and hence
\begin{align*}
\sum_{r=0}^{\infty}a_{p^r}X^r=\left(1-a_pX+p^{k-1}X^2\right)^{-1}.
\end{align*}
[guided]
We now compute the local factor at a fixed prime $p$. Introduce the prime-power formal power series $A_p(X) \in \mathbb{C}[[X]]$ by
\begin{align*}
A_p(X)=\sum_{r=0}^{\infty}a_{p^r}X^r.
\end{align*}
We work in the formal power series ring $\mathbb{C}[[X]]$, so no convergence in $X$ is being asserted at this stage. Since $f$ is normalized, $a_1=1$, and because $p^0=1$, this says
\begin{align*}
a_{p^0}=1.
\end{align*}
The recurrence from the Hecke relation has the same shape as the denominator we want. Therefore we multiply $A_p(X)$ by $1-a_pX+p^{k-1}X^2$ and compare coefficients:
\begin{align*}
(1-a_pX+p^{k-1}X^2)A_p(X)
&=\left(\sum_{r=0}^{\infty}a_{p^r}X^r\right)
-a_pX\left(\sum_{r=0}^{\infty}a_{p^r}X^r\right)
+p^{k-1}X^2\left(\sum_{r=0}^{\infty}a_{p^r}X^r\right) \\
&=a_1+(a_p-a_pa_1)X \\
&\quad+\sum_{r=2}^{\infty}\left(a_{p^r}-a_p a_{p^{r-1}}+p^{k-1}a_{p^{r-2}}\right)X^r.
\end{align*}
The constant term is $a_1=1$. The coefficient of $X$ is
\begin{align*}
a_p-a_pa_1=a_p-a_p=0.
\end{align*}
For every $r \geq 2$, the recurrence with $r-1$ in place of $r$ says
\begin{align*}
a_{p^r}=a_p a_{p^{r-1}}-p^{k-1}a_{p^{r-2}}.
\end{align*}
Equivalently,
\begin{align*}
a_{p^r}-a_p a_{p^{r-1}}+p^{k-1}a_{p^{r-2}}=0.
\end{align*}
Thus every coefficient except the constant term vanishes, and we obtain
\begin{align*}
(1-a_pX+p^{k-1}X^2)A_p(X)=1.
\end{align*}
Solving for $A_p(X)$ gives the local identity
\begin{align*}
\sum_{r=0}^{\infty}a_{p^r}X^r=\left(1-a_pX+p^{k-1}X^2\right)^{-1}.
\end{align*}
[/guided]
[/step]
[step:Substitute $X=p^{-s}$ and assemble the Euler product]
For the fixed $s$ in the absolute convergence region and each prime $p$, the prime-power series converges absolutely because
\begin{align*}
\sum_{r=0}^{\infty}|a_{p^r}p^{-rs}|
\end{align*}
is a subseries of $\sum_{n=1}^{\infty}|a_n n^{-s}|$. Therefore the formal identity from the previous step may be evaluated at $X=p^{-s}$. This gives, for every prime $p$,
\begin{align*}
\sum_{r=0}^{\infty}a_{p^r}p^{-rs}
=
\left(1-a_p p^{-s}+p^{k-1}p^{-2s}\right)^{-1}
=
\left(1-a_p p^{-s}+p^{k-1-2s}\right)^{-1}.
\end{align*}
Combining this identity with the prime-power factorization of $L(f,s)$ yields
\begin{align*}
L(f,s)
&=\prod_p\left(\sum_{r=0}^{\infty}a_{p^r}p^{-rs}\right) \\
&=\prod_p\left(1-a_p p^{-s}+p^{k-1-2s}\right)^{-1}.
\end{align*}
This is the desired Euler product throughout the half-plane of absolute convergence.
[/step]