Example 3-9 Euler's totient function $\varphi(n)$ is equal to the number of integers less than $n$ and coprime to $n$.
Assuming that $n$ is factored into the product of $p_{1}^{a_{1}}, p_{2}^{a_{2}}, \cdots, p_{k}^{a_{k}}$, i.e.,
$$
n=p_{1}^{a_{1}} p_{2}^{a_{2}} \cdots p_{k}^{a_{k}}
$$

Let $A_{i}$ be the set of all multiples of $P_{i}$ in $N=\{1,2, \cdots, n\}$, $i=1,2, \cdots, k^{\alpha}$
$$
\left|A_{i}\right|=\frac{n}{p_{i}}, \quad i=1,2, \cdots, k
$$

If $p_{i} \neq p_{j}, i, j=1,2, \cdots, k, A_{i} \cap A_{j}$ represents the set of all numbers in $N$ that are multiples of both $p_{i}$ and $p_{j}$, then
$$
\left|A_{i} \cap A_{j}\right|=\frac{n}{p_{i} p_{j}} \quad i, j=1,2, \cdots, k, j>i
$$

Similarly, we have
$$
\left|A_{i} \cap A_{j} \cap A_{k}\right|=\frac{n}{p_{i} p_{j} p_{k}}, \quad i, j, k=1,2, \cdots, k, k>j>i
$$

According to the definition,
$$
\begin{aligned}
\varphi(n)= & n-\left(\frac{n}{p_{1}}+\frac{n}{p_{2}}+\cdots+\frac{n}{p_{k}}\right)+\left(\frac{n}{p_{1} p_{2}}+\frac{n}{p_{1} p_{3}}+\cdots+\frac{n}{p_{k-1} p_{k}}\right)-\cdots \\
& \pm \frac{n}{p_{1} p_{2} \cdots p_{k}}=n\left(1-\frac{1}{p_{1}}\right)\left(1-\frac{1}{p_{2}}\right) \cdots\left(1-\frac{1}{p_{k}}\right)
\end{aligned}
$$