# Matrix Identity Related to the Gauss-Markov Theorem [duplicate]

While reading some lecture notes I have come across the following:

Consider the linear model $Y=X\beta+\varepsilon$, $\mathrm{Var}(\varepsilon)=\sigma^2 I$ (all the usual Gauss-Markov assumptions apply). Let $\tilde{\beta}$ be an unbiased linear estimator of $\beta$ with $X\tilde{\beta}=AY$, and let $P=X(X^TX)^{-1}X^T$. First note that $AP=P$ ...

However, I can't see why $AP=P$; I've tried writing $A=P+K\implies AP=P^2+KP \implies AP=P+KP$, but I'm not sure why $KP=0$.

• I found the duplicate by searching our site on regression idempotent and sorting by votes. Knowing to call it "idempotent" obviously was helpful! BTW, the meanings of "$A$" and "$K$" in your post are not evident from what you have written. If you attempt to relate them to $X$ itself, the derivation should be easy.
– whuber
Sep 29, 2016 at 21:41
• @whuber Could you clarify how the post you linked answers my question? I can't see an answer to my question anywhere there. Just for emphasis, $\tilde{\beta}$ is not necessarily an OLS estimator, so the matrix $A$ is simply a matrix that satisfies $X\tilde{\beta}=AY$. Sep 29, 2016 at 22:25
• Although notation is slightly different, this proof shows what you want: en.wikipedia.org/wiki/Gauss%E2%80%93Markov_theorem#Proof. The first part in particular.
– KOE
Sep 30, 2016 at 0:56