In the lecture notes, in order to prove that TSS=ESS+RSS.
My instructor writes that:
$$TSS = \sum_t^n (y_t -\bar{y})^2= \sum_t^n y_t^2 -n\bar{y}^2$$
I don’t understand the second equality. Instead, I would write
$$ = \sum_t^n y_t^2 - 2\sum_t^n y_t\bar{y} + n\bar{y}^2$$. But the instructor’s expression is different. How does he get it?