How can I prove pythegore's theorem?
Where $y'$ is the transpose of $y $
And the $\hat{y}$ matrix is the matrix of the estimated values of $y$.
So far, I have:
$y'\hat{y} = y'y$
$ \implies (X\beta + \epsilon)' (X (X' X)^{-1} X' y) = (X\beta + \epsilon)' (y)$
$\implies \beta' X' X (X' X)^{-1} X' y + \epsilon ' X (X' X)^{-1} X' y = \beta' X' Y + \epsilon ' y$
$\implies \beta' X' Y + \epsilon ' X (X' X)^{-1} X' y = \beta' X' y + \epsilon' y$
but $\beta' X' Y$ is a $1 \times p$ times $p \times n$ times $n \times 1$ matrix i.e. a $1\times 1$ matrix i.e. a scalar, so I can simply subtract it from both sides, yielding
$\epsilon ' X (X' X)^{-1} X' y = \epsilon' y$
$\implies X (X' X)^{-1} X' =I$
i.e. the Hat matrix $H =I$ for ANY $n \times n$ identity matrix, which is obviously a nonsensical result.
Is this a better, more sound way of disproving this?