Here is the question:
Exercise 6.8.3. Let $X_1, X_2, \dots, X_n$ be iid and let $\mu = \mathbb{E}(X_i)$. Suppose that variance is finite. Show that $\overline{X}_n \xrightarrow{\text{qm}} \mu$.
Here is the given answer:
Let $Y_i = X_i - \mu$. It has variance $\sigma_Y = \sigma$ and mean $\mu_Y = 0$. We have:
$$ \begin{align} & \mathbb{E}[(\overline{X}_n - \mu)^2] = \\ & = \mathbb{E}\left[\left(\frac{1}{n} \sum_{i=1}^n (X_i - \mu) \right)^2\right] \\ & = \frac{1}{n^2} \mathbb{E} \left[ \left(\sum_{i=1}^n Y_i \right)^2 \right] \\ & = \frac{1}{n^2} \left( \sum_{i=1}^n \mathbb{E}[Y_i^2] - \sum_{i=1}^n \sum_{j=1, j \neq i}^n \mathbb{E}[Y_i Y_j] \right) \\ & = \frac{1}{n} \left( (\sigma_Y^2 + \mu_Y^2) - (n-1) \mu_Y^2 \right) \\ & = \frac{\sigma}{n} \end{align} $$ Therefore, $\lim _{n \rightarrow \infty} \mathbb{E}[(\overline{X}_n - \mu)^2] = \lim _{n \rightarrow \infty} \sigma / n = 0$, and so $\overline{X}_n \xrightarrow{\text{qm}} \mu$.
Unfortunately I follow until about step 3. For one thing, I am not sure how the $ \frac{1}{n}\ $ turned into $ \frac{1}{n^2}\ $ . Furthermore, I do not see how the double summations from i=1 to n and j=1, j $\neq$ i come in.
If anyone could explain the concept used or even just point a resource to learn it, I would appreciate that. The book is Wasserman's All of Statistics.
Use the facts that (1) for a random variable $X$ and a constant $c$, $$ \operatorname{Var}(cX)=c^2\operatorname{Var}(X), $$ and (2) when $X_1,\dots,X_n$ are independent (or at least uncorrelated, i.e., $\operatorname{Cov}(X_i,X_j)=0$ for $i\ne j$), \begin{align} \operatorname{Var}\!\left(\sum_{i=1}^n X_i\right)&=\sum_{i=1}^n\sum_{j=1}^n\operatorname{Cov}(X_i,X_j) \\ &=\sum_{i=1}^n\sum_{j=i}\operatorname{Cov}(X_i,X_j)+\sum_{i=1}^n\sum_{j\ne i}\operatorname{Cov}(X_i,X_j) \\ &=\sum_{i=1}^n\operatorname{Var}(X_i)+0 \end{align} because $\operatorname{Cov}(X_i,X_i)=\operatorname{Var}(X_i)$.