I am currently studying linear transformations in order to refresh my knowledge of linear algebra. One statement in my textbook (by David Poole) is:
When considering linear transformations from $\mathbb{R}^2$ to $\mathbb{R}^2$, the matrix of a projection can never be invertible.
I know that a projection matrix satisfies the equation $P^2 = P$. Taking determinant of both sides gives
$$\text{det}(P)^2 = \text{det}(P)$$
which is always true when $P$ is singular. However take $\color{blue} {P = I_2}$, then the equality is true and the projection matrix is invertible. What mistake do I make in my reasoning?