everyone, this is my first time posting on this site, so if I am in violation of any standards, kindly let me know.
So I am attempting to prove that $\mu=E(X)$ is the choice of $a$ that minimizes $E([X-a]^{2})$
I have always accepted this fact without much thought, but I am hoping to show that using the properties of expectation, $a=\mu=E(X)$ is the value that minimizes mean squared error.
So we have our objective function as:
$E([X-a]^2)$
$=E([X-\mu+\mu -a]^{2}])$
$=E([(X-\mu)+(\mu-a)]^2)$
$=E([(X-\mu)^2+2(\mu-a)(X-\mu)+(\mu-a)^2])$
$=E(X-\mu)^2 + 2(\mu-a)E(X-\mu)+(\mu-a)^2$
$= E(X-\mu)^2 + 2(\mu-a)[E(X)-\mu]+(\mu-a)^2$
$= E(X-\mu)^2 + 2(\mu-a)[E(X)-E(X)]+(\mu-a)^2$
$= E(X-\mu)^2 + 2(\mu-a)[0]+(\mu-a)^2$
$= E(X-\mu)^2 +(\mu-a)^2$
And this function is now minimized at $a=\mu$, which is equal to $E(X)$
Therefore, mean squared error is minimized for $a=E(X)=\mu$
Were the adjustments I made correct with properties of expectations? Or am I making any incorrect assumptions?