The CAPM-based model of asset returns
$$r_i = r_o \; + \;\beta_i (r_m \; – \; r_o)+\varepsilon_i$$
includes the covariance $\sigma_{im}$ of asset $i$ returns with the market $m$ which was derived in the previous section. An important question is, how do the risks arising from each $\beta_i$ sum together in a portfolio of several assets? The answer lies in the definition of covariance of returns on asset $i$ with returns on asset $j$ seen earlier
$$\sigma_{ij} = \mathbb{E} \bigl[ (r_i – \mu_i)(r_j – \mu_j) \bigr]$$
if asset $j$ is a portfolio comprised of single assets $k$, $l$ and $m$ we can say that,
$$\sigma_{ij} = \mathbb{E} \bigl[ (r_i – \mu_i)(r_k + r_l + r_m – \mu_k – \mu_l – \mu_m) \bigr]$$
meaning that
$$\sigma_{i(k+l+m)} = \mathbb{E} \bigl[ (r_i – \mu_i)(r_k + r_l + r_m – \mu_k – \mu_l – \mu_m) \bigr]$$
we can generalise this by adding in a non-random monetary instrument “cash” asset $M$ in place of random returns on asset $m$
$$\sigma_{i(k+l+m)} = \mathbb{E} \bigl[ (r_i – \mu_i)(r_k + r_l + M – \mu_k – \mu_l – M) \bigr]$$
and generalise further by adding weights for the random returns
\begin{align}\sigma_{i(k+l+m)} &= \mathbb{E} \bigl[ (r_i – \mu_i)(ar_k + br_l + M – a\mu_k – b\mu_l – M) \bigr]\\ \\
&= \mathbb{E} \bigl[ (r_i – \mu_i)a(r_k – \mu_k)+ (r_i – \mu_i)b(r_l – \mu_l )\bigr]\\ \\
&= a \mathbb{E} \bigl[ (r_i – \mu_i)(r_k – \mu_k)\bigr] + b\mathbb{E} \bigl[ (r_i – \mu_i)(r_l – \mu_l )\bigr]\\ \\
&= a \text{cov} (r_i, r_k) + b\text{cov} (r_i, r_l)
\end{align}
The covariance of $r_i$ with non-random asset $M$ is zero.
$$\text{cov} (r_i, M)=0$$
In conclusion, covariance is linear
$$\text{cov} (r_i, ar_k + br_l + M) = a \text{cov} (r_i, r_k) + b\text{cov} (r_i, r_l) + 0$$
We now want to know how the random error $\varepsilon_i$ of asset $i$ returns varies with the market returns $r_m$
\begin{align}\varepsilon_i &= r_i \; – \; r_o \; – \;\beta_i (r_m \; – \; r_o)\\ \\
\therefore \quad \text{cov} (\varepsilon_i, r_m)&= \text{cov} \bigl((r_i \; – \; r_o \; – \;\beta_i (r_m \; – \; r_o),r_m \bigr)\\ \\
&=\text{cov} (r_i, r_m)- 0\; – \beta_i\text{cov}(r_m,r_m) \; – 0\end{align}
by linearity as $\text{cov} (r_o, r_m)=0$. Recall that by definition
\begin{align}
\beta_i &= \dfrac{\text{cov}(r_i,r_m)}{\sigma_m^2}= \dfrac{\sigma_{im}}{\sigma_m^2} \tag{1}\\ \\
\text{cov} (r_m, r_m) &=\sigma_m^2 \quad \Rightarrow \text{variance!}\\ \\
\therefore \quad \text{cov} (\varepsilon_i, r_m)&=\text{cov} (r_i, r_m) – \text{cov}(r_i,r_m) = 0 \tag{2}
\end{align}
Given the above result, it is reasonable to assume,
$$\text{cov} (\varepsilon_i, \varepsilon_j)= 0, \qquad i\neq \tag{3}j$$meaning, the risk specific to asset $i$ is uncorrelated to the risk specific to a different asset $j$. Also as a useful reminder, under CAPM,
$$\mathbb{E}\Bigl[\varepsilon_i \Bigr]=0\tag{4}$$
Having explored the linear property of covariance and used that to determine the covariance of the random error $\varepsilon_i$ of asset $i$ returns with market $m$ returns based on the CAPM, we now explore the covariance of returns of a pair of assets. This is important because as determined in The Case for Diversification, it is the covariance contributions to risk that matter as the number of assets in a portfolio becomes large.
Covariance of Asset Returns Under CAPM
\begin{align}\sigma_{ij} = \text{cov}(r_i,r_j) &= \text{cov} \bigl(r_i,( r_o \; + \;\beta_j (r_m \; – \; r_o)+\varepsilon_j ) \bigr)\\ \\
&= \beta_j \text{cov} (r_i, r_m) \; + \; \text{cov} (r_i,\varepsilon_j) \\ \\
&= \beta_j \sigma_{im} + \text{cov} \bigl((r_o \; + \;\beta_i (r_m \; – \; r_o)+\varepsilon_i ), \varepsilon_j \bigr)
\end{align}
but from $1$,
\begin{align} \beta_i &= \dfrac{\sigma_{im}}{\sigma_m^2}\end{align}
Hence,
\begin{align}\sigma_{ij} = \text{cov}(r_i,r_j) &= \beta_j \beta_i \sigma_m^2 + \beta_j\text{cov}(\varepsilon_j, r_m) + \text{cov}(\varepsilon_j,\varepsilon_i)\\ \\
\sigma_{ij} &= \beta_j \beta_i \sigma_m^2 \qquad \text{for } i\neq j \tag{4}\\ \\
\sigma_{ij} &= \beta_i^2 \sigma_m^2 + \text{var} \tag{5}(\varepsilon_i) \qquad \text{for } i= j \; \Rightarrow \sigma_i^2
\end{align}
We can therefore conlcude that for an asset $i$, the variance of asset retruns
$$\sigma_i^2 = \beta_i^2 \sigma_m^2 + \text{var}(\varepsilon_i)\tag{6}$$
meaning there are two sources of risk. The two risk components above are the systematic and the specific risks respectively.
This can also be demonstrated at portfolio level,
\begin{align}
\sigma_q^2 &=\mathbf{w}^T \mathbf{V} \mathbf{w}
= \sum_{i=1}^n \sum_{j=1}^n w_i w_j \sigma_{ij}
\end{align}
from $(1)$ and CAPM result in $(4)$ above for $i\neq j$ and adding the extra variance term in $(6)$ for $i=j$
\begin{align}&=\sum_{i=1}^n \sum_{j=1}^n w_i w_j \beta_j \beta_i \sigma_m^2 + \sum_{i = 1}^{n}w_i^2 \text{var}( \varepsilon_i )\\ \\
&= \Biggl(\underbrace{\sum_{i=1}^n w_i \beta_i}_{\beta_q}\Biggr) \Biggl( \underbrace{\sum_{j=1}^n w_j\beta_j}_{\beta_q} \Biggr)\sigma_m^2 + \sum_{i = 1}^{n}w_i^2 \text{var}( \varepsilon_i)\\ \\
\sigma_q^2 &= \beta_q^2 \sigma_m^2 + \text{var}(\varepsilon_q) \tag{7}\end{align}
for portfolio $q$. As in The Case for Diversification, if we assume the specific risk, the variance of $\varepsilon_i$ is bounded by say $C$ for $i = 1, \cdots, n$, then for an equally weighted portfolio with $w_i = \frac{1}{n}$,
$$\sum_{i = 1}^{n}w_i^2 \text{var}( \varepsilon_i) \leqslant C \sum_{i = 1}^{n} \dfrac{1}{n^2} = \dfrac{C}{n} \rightarrow 0 \text{ as } n\rightarrow \infty $$
This means that the specific risk arising from each assets exposure reduces as the number of assets increase. This is the converse of what happens with the covariance contributions as shown in as shown in The Case for Diversification.