Euler's proof for the infinitude of the primes I am trying to recast the proof of Euler for the infinitude of the primes in modern mathematical language, but am not sure how it is to be done. The statement is that:
$$\prod_{p\in P} \frac{1}{1-1/p}=\prod_{p\in P} \sum_{k\geq 0} \frac{1}{p^k}=\sum_n\frac{1}{n}$$
Here $P$ is the set of primes. What bothers me is the second equality above which is obtained by the distributive law, applied not neccessarily finitely many times. Is that justified?

It might be instructive to see the process of moving from a heuristic argument to a rigorous proof.
Probably the simplest thing to do when considering a heuristic argument involving infinite sums (or infinite products or improper integrals or other such things) is to consider its finite truncations. i.e. what can we do with the following?
$$\prod_{\substack{p \in P \\ p < B}} \frac{1}{1 - 1/p}$$
Well, we can repeat the first step easily:
$$\prod_{\substack{p \in P \\ p < B}} \frac{1}{1 - 1/p}
= \prod_{\substack{p \in P \\ p < B}} \sum_{k=0}^{+\infty} \frac{1}{p^k}$$
Because all summations involved are all absolutely convergent (I think that's the condition I want? my real analysis is rusty), we can distribute:
$$ \ldots = \sum_{n} \frac{1}{n} $$
where the summation is over only those integers whose prime factors are all less than $B$.
At this point, it is easy to make two very rough bounds:
$$ \sum_{n=1}^{B-1} \frac{1}{n} \leq \prod_{\substack{p \in P \\ p < B}} \frac{1}{1 - 1/p}
\leq \sum_{n=1}^{+\infty} \frac{1}{n} $$
And now, we can take the limit as $B \to +\infty$ and apply the squeeze theorem:
$$ \prod_{\substack{p \in P}} \frac{1}{1 - 1/p}
= \sum_{n=1}^{+\infty} \frac{1}{n} $$
