[proofplan]
We first record absolute convergence of the Dirichlet series in the half-plane $\operatorname{Re}(s)>1$, using the bound $|\chi(n)| \leq 1$. For a finite set of primes, each Euler factor is expanded as a geometric series, and multiplying the finite local expansions gives a finite sum over integers whose prime factors lie in that finite set. The [Fundamental Theorem of Arithmetic](/theorems/730) then identifies these terms with exactly the Dirichlet coefficients $\chi(n)n^{-s}$. Finally, absolute convergence lets the finite prime products converge to the full Dirichlet series.
[/proofplan]
[step:Prove absolute convergence of the Dirichlet series in the half-plane $\operatorname{Re}(s)>1$]
Fix $s \in \mathbb{C}$ and define
\begin{align*}
\sigma := \operatorname{Re}(s).
\end{align*}
Assume $\sigma > 1$. Since $\chi$ is a Dirichlet character, $|\chi(n)| \leq 1$ for every $n \in \mathbb{N}$. Also, with the standard convention $n^{-s} := e^{-s\log n}$, we have $|n^{-s}| = n^{-\sigma}$. Hence
\begin{align*}
\sum_{n=1}^{\infty} \left|\chi(n)n^{-s}\right|
\leq
\sum_{n=1}^{\infty} n^{-\sigma}.
\end{align*}
The series on the right converges for $\sigma > 1$: grouping the integers dyadically gives
\begin{align*}
\sum_{n=1}^{\infty} n^{-\sigma}
&=
1+\sum_{j=0}^{\infty}\sum_{n=2^j+1}^{2^{j+1}} n^{-\sigma} \\
&\leq
1+\sum_{j=0}^{\infty} 2^j (2^j)^{-\sigma} \\
&=
1+\sum_{j=0}^{\infty} 2^{-j(\sigma-1)},
\end{align*}
and the last geometric series converges because $\sigma-1>0$. Therefore
\begin{align*}
\sum_{n=1}^{\infty} \left|\chi(n)n^{-s}\right| < \infty.
\end{align*}
[guided]
Fix $s \in \mathbb{C}$ and write
\begin{align*}
\sigma := \operatorname{Re}(s).
\end{align*}
We want to justify all rearrangements and limiting operations later, so the first task is absolute convergence. Since $\chi$ is a Dirichlet character, each value $\chi(n)$ is either $0$ or a root of unity, and therefore $|\chi(n)| \leq 1$ for every $n \in \mathbb{N}$. Also, by the definition $n^{-s}=e^{-s\log n}$,
\begin{align*}
|n^{-s}| = n^{-\operatorname{Re}(s)} = n^{-\sigma}.
\end{align*}
Thus
\begin{align*}
\sum_{n=1}^{\infty} \left|\chi(n)n^{-s}\right|
\leq
\sum_{n=1}^{\infty} n^{-\sigma}.
\end{align*}
It remains to verify convergence of the comparison series without appealing to an external result. Split the positive integers into dyadic blocks. For $2^j < n \leq 2^{j+1}$, we have $n^{-\sigma} \leq (2^j)^{-\sigma}$, and there are $2^j$ integers in this block. Therefore
\begin{align*}
\sum_{n=1}^{\infty} n^{-\sigma}
&=
1+\sum_{j=0}^{\infty}\sum_{n=2^j+1}^{2^{j+1}} n^{-\sigma} \\
&\leq
1+\sum_{j=0}^{\infty} 2^j (2^j)^{-\sigma} \\
&=
1+\sum_{j=0}^{\infty} 2^{-j(\sigma-1)}.
\end{align*}
Because $\sigma>1$, the ratio $2^{-(\sigma-1)}$ lies in $(0,1)$, so this geometric series converges. Hence
\begin{align*}
\sum_{n=1}^{\infty} \left|\chi(n)n^{-s}\right| < \infty.
\end{align*}
This absolute convergence is the analytic input that permits the finite Euler products to converge to the full series.
[/guided]
[/step]
[step:Expand each finite Euler product into a sum over prime powers]
Let $F$ be a finite set of primes. Define $\mathbb{N}_0 := \{0,1,2,\dots\}$ to be the set of non-negative integers. For each $p \in F$, define
\begin{align*}
z_p := \chi(p)p^{-s}.
\end{align*}
Since $|z_p| \leq p^{-\sigma}<1$, the geometric series identity gives
\begin{align*}
\left(1-\chi(p)p^{-s}\right)^{-1}
=
\sum_{k=0}^{\infty} \chi(p)^k p^{-ks}.
\end{align*}
Because $F$ is finite, multiplying these absolutely convergent series gives
\begin{align*}
\prod_{p \in F}\left(1-\chi(p)p^{-s}\right)^{-1}
=
\sum_{(k_p)_{p \in F} \in \mathbb{N}_0^F}
\prod_{p \in F}\chi(p)^{k_p}p^{-k_ps}.
\end{align*}
By complete multiplicativity of $\chi$,
\begin{align*}
\prod_{p \in F}\chi(p)^{k_p}
=
\chi\left(\prod_{p \in F}p^{k_p}\right),
\end{align*}
and by the laws of complex exponentiation for positive real bases,
\begin{align*}
\prod_{p \in F}p^{-k_ps}
=
\left(\prod_{p \in F}p^{k_p}\right)^{-s}.
\end{align*}
Therefore
\begin{align*}
\prod_{p \in F}\left(1-\chi(p)p^{-s}\right)^{-1}
=
\sum_{(k_p)_{p \in F} \in \mathbb{N}_0^F}
\chi\left(\prod_{p \in F}p^{k_p}\right)
\left(\prod_{p \in F}p^{k_p}\right)^{-s}.
\end{align*}
[guided]
Let $F$ be a finite set of primes. Define $\mathbb{N}_0 := \{0,1,2,\dots\}$ to be the set of non-negative integers. We first work with finitely many primes because finite products can be multiplied without any convergence issue across infinitely many factors. For each $p \in F$, define the complex number
\begin{align*}
z_p := \chi(p)p^{-s}.
\end{align*}
Since $|\chi(p)|\leq 1$ and $\sigma=\operatorname{Re}(s)>1$, we have
\begin{align*}
|z_p| = |\chi(p)|p^{-\sigma} \leq p^{-\sigma}<1.
\end{align*}
Thus the geometric series identity applies:
\begin{align*}
(1-z_p)^{-1}
=
\sum_{k=0}^{\infty} z_p^k.
\end{align*}
Substituting $z_p=\chi(p)p^{-s}$ gives
\begin{align*}
\left(1-\chi(p)p^{-s}\right)^{-1}
=
\sum_{k=0}^{\infty} \chi(p)^k p^{-ks}.
\end{align*}
Now multiply these expansions over $p \in F$. Since $F$ is finite and each local series is absolutely convergent, the product is the sum over all exponent choices $(k_p)_{p \in F}\in \mathbb{N}_0^F$:
\begin{align*}
\prod_{p \in F}\left(1-\chi(p)p^{-s}\right)^{-1}
=
\sum_{(k_p)_{p \in F} \in \mathbb{N}_0^F}
\prod_{p \in F}\chi(p)^{k_p}p^{-k_ps}.
\end{align*}
The arithmetic content now enters. Because $\chi$ is completely multiplicative,
\begin{align*}
\prod_{p \in F}\chi(p)^{k_p}
=
\chi\left(\prod_{p \in F}p^{k_p}\right).
\end{align*}
Also, since every $p$ is a positive real number and $p^{-s}=e^{-s\log p}$,
\begin{align*}
\prod_{p \in F}p^{-k_ps}
=
\exp\left(-s\sum_{p \in F} k_p\log p\right)
=
\left(\prod_{p \in F}p^{k_p}\right)^{-s}.
\end{align*}
Combining these two identities yields
\begin{align*}
\prod_{p \in F}\left(1-\chi(p)p^{-s}\right)^{-1}
=
\sum_{(k_p)_{p \in F} \in \mathbb{N}_0^F}
\chi\left(\prod_{p \in F}p^{k_p}\right)
\left(\prod_{p \in F}p^{k_p}\right)^{-s}.
\end{align*}
[/guided]
[/step]
[step:Identify the finite product with the Dirichlet series over integers supported on the chosen primes]
For a finite set $F$ of primes, define
\begin{align*}
S_F := \left\{ n \in \mathbb{N} : \text{every prime divisor of } n \text{ belongs to } F \right\}.
\end{align*}
By the Fundamental Theorem of Arithmetic (citing a result not yet in the wiki: Fundamental Theorem of Arithmetic), the map
\begin{align*}
\mathbb{N}_0^F &\to S_F \\
(k_p)_{p \in F} &\mapsto \prod_{p \in F}p^{k_p}
\end{align*}
is a bijection. Hence the preceding expansion becomes
\begin{align*}
\prod_{p \in F}\left(1-\chi(p)p^{-s}\right)^{-1}
=
\sum_{n \in S_F} \chi(n)n^{-s}.
\end{align*}
[guided]
Define the set of integers whose prime factors all lie in $F$ by
\begin{align*}
S_F := \left\{ n \in \mathbb{N} : \text{every prime divisor of } n \text{ belongs to } F \right\}.
\end{align*}
The finite product expansion from the previous step is indexed by exponent vectors $(k_p)_{p \in F}$. The reason this should match a Dirichlet series is that exponent vectors are the same data as prime factorizations.
More precisely, by the Fundamental Theorem of Arithmetic (citing a result not yet in the wiki: Fundamental Theorem of Arithmetic), every $n \in S_F$ has a unique representation
\begin{align*}
n = \prod_{p \in F} p^{k_p}
\end{align*}
with exponents $k_p \in \mathbb{N}_0$, where $k_p=0$ if $p$ does not divide $n$. Therefore the map
\begin{align*}
\mathbb{N}_0^F &\to S_F \\
(k_p)_{p \in F} &\mapsto \prod_{p \in F}p^{k_p}
\end{align*}
is bijective. Reindexing the sum from exponent vectors to integers in $S_F$ gives
\begin{align*}
\prod_{p \in F}\left(1-\chi(p)p^{-s}\right)^{-1}
=
\sum_{n \in S_F} \chi(n)n^{-s}.
\end{align*}
This is the finite [Euler product identity](/theorems/1694): a product over finitely many primes equals the Dirichlet series restricted to integers built only from those primes.
[/guided]
[/step]
[step:Pass from finite prime products to the infinite Euler product]
For $X \geq 2$, let
\begin{align*}
F_X := \{p \in \mathbb{N} : p \text{ is prime and } p \leq X\}.
\end{align*}
The preceding step gives
\begin{align*}
\prod_{p \leq X}\left(1-\chi(p)p^{-s}\right)^{-1}
=
\sum_{n \in S_{F_X}} \chi(n)n^{-s}.
\end{align*}
For each fixed $n \in \mathbb{N}$, there exists $X_n \geq 2$ such that $n \in S_{F_X}$ for all $X \geq X_n$, namely any $X_n$ at least as large as every prime divisor of $n$. Hence the partial sums over $S_{F_X}$ converge coefficientwise to the full series. Since
\begin{align*}
\sum_{n=1}^{\infty} |\chi(n)n^{-s}| < \infty,
\end{align*}
the tails of the absolutely convergent series tend to zero, and therefore
\begin{align*}
\lim_{X \to \infty}\sum_{n \in S_{F_X}} \chi(n)n^{-s}
=
\sum_{n=1}^{\infty}\chi(n)n^{-s}.
\end{align*}
Combining this with the finite product identity gives
\begin{align*}
\lim_{X \to \infty}
\prod_{p \leq X}\left(1-\chi(p)p^{-s}\right)^{-1}
=
L(s,\chi).
\end{align*}
Thus the infinite Euler product converges and equals $L(s,\chi)$.
[guided]
For $X \geq 2$, define the finite set of primes up to $X$ by
\begin{align*}
F_X := \{p \in \mathbb{N} : p \text{ is prime and } p \leq X\}.
\end{align*}
Applying the finite Euler product identity with $F=F_X$ gives
\begin{align*}
\prod_{p \leq X}\left(1-\chi(p)p^{-s}\right)^{-1}
=
\sum_{n \in S_{F_X}} \chi(n)n^{-s}.
\end{align*}
As $X$ grows, the set $S_{F_X}$ contains more integers. For any fixed $n \in \mathbb{N}$, all prime divisors of $n$ are bounded by some finite number. If $X_n$ is at least as large as every prime divisor of $n$, then $n \in S_{F_X}$ for every $X \geq X_n$. Thus every term $\chi(n)n^{-s}$ eventually appears in the finite Euler product expansion.
We now justify passing to the limit. From the first step,
\begin{align*}
\sum_{n=1}^{\infty} |\chi(n)n^{-s}| < \infty.
\end{align*}
Let $\varepsilon>0$. By absolute convergence, there exists $N \in \mathbb{N}$ such that
\begin{align*}
\sum_{n>N} |\chi(n)n^{-s}| < \varepsilon.
\end{align*}
Choose $X$ large enough that every integer $1\leq n\leq N$ lies in $S_{F_X}$; for instance, it is enough to take $X\geq N$. Then the difference between the full series and the restricted series is supported only on integers $n>N$, so
\begin{align*}
\left|
\sum_{n=1}^{\infty}\chi(n)n^{-s}
-
\sum_{n \in S_{F_X}}\chi(n)n^{-s}
\right|
\leq
\sum_{n>N}|\chi(n)n^{-s}|
<
\varepsilon.
\end{align*}
Therefore
\begin{align*}
\lim_{X \to \infty}\sum_{n \in S_{F_X}}\chi(n)n^{-s}
=
\sum_{n=1}^{\infty}\chi(n)n^{-s}.
\end{align*}
Using the finite product identity once more, we conclude
\begin{align*}
\lim_{X \to \infty}
\prod_{p \leq X}\left(1-\chi(p)p^{-s}\right)^{-1}
=
\sum_{n=1}^{\infty}\chi(n)n^{-s}
=
L(s,\chi).
\end{align*}
This is exactly the asserted Euler product formula.
[/guided]
[/step]