I am trying to reproduce the equality of $R^2 = r_{y, \hat{y}}^2$ from this site. The author uses the equation $cov(\hat{y}, e) = 0$, which is what I am trying to explain.
Notation:
$X$ invertible matrix of explanatory variables
$y$ explained variable
Linear Model: $y = X\beta + e$, assuming $\mathbb{E}[e] = 0$
$\hat{\beta} = (X'X)^{-1}X'y$ (least squares estimator)
$\hat{y} = X\hat{\beta}$
$\hat{y}'e = 0: \hat{y}'e = \hat{\beta}'X'e = \hat{\beta}'X'(y - X\beta) = \hat{\beta}'(X'y - X'X\beta = 0) \Rightarrow \hat{y}'e = 0$
Furthermore: $\mathbb{E}[\hat{\beta}] = \beta$ (without proof)
I found this solution here in the forum, however I wanted to present my own and ask if my argument is correct.
$$ \begin{align*} cov(\hat{y}, e) &= \mathbb{E}[(\hat{y} - \mathbb{E}[\hat{y}])'(e - \mathbb{E}[e])] \quad(\mathbb{E}[e] = 0,\text{per assumption}) \\ cov(\hat{y}, e) &= \mathbb{E}[(\hat{y} - \mathbb{E}[\hat{y}])'e] = \mathbb{E}[\hat{y}'e - \mathbb{E}[\hat{y}]'e] = \mathbb{E}[0 - \mathbb{E}[\hat{y}]'e] \\ \mathbb{E}[0 - \mathbb{E}[\hat{y}]'e] &= \mathbb{E}[\mathbb{E}[X\hat{\beta}]'e] = \mathbb{E}[\beta'X'e] = 0 \end{align*} $$
Please let me know if there is an error in my argument.