Artificial intelligent assistant

Prove that if P is idempotent a $I- \lambda P$ is invertible Let $P\in K^{nxn},P^2=P$ and $\lambda \in K,\lambda \ne 1$. I need to prove that $I- \lambda P$ is invertible. I'm quite confused with this problem, because I know that if $P^2=P$ and $P\ne I$, then the determinant of P should be $0$, but we have that $(I- \lambda P)^2=I- \lambda P$ , so $I-\lambda P$ should also be idempotent. That would mean that if $\lambda \ne 0$, the determinant of $I- \lambda P$ should be zero, but something does not seem right for me, what am I doing wrong? How can I find the inverse of $I- \lambda P$ ? The book says that $(I- \lambda P)^{-1}=I+\frac{\lambda}{1-\lambda}P$ Thanks, any help will be appreciated.

Let's assume that $\exists\lambda\
eq 1,\, I-\lambda P$ non inversible. This means that $\exists x\in\mathbb{K}^n,\, x\
eq 0\land x=\lambda Px$. And this leads immediately by multiplying by $P$ to the left to $Px=\lambda Px$ i.e $(1-\lambda)Px=0$ and because $\lambda\
eq 1$ we have $Px=0$ and therefore $x=\lambda Px=0$ a contradiction and we have proven $\forall \lambda\
eq 1,\, I-\lambda P$ inversible. This answers the question.

Now if we want to find the inverse denote for $\lambda\lt 1$

$$ Q = \sum_{n=1}^{\infty} (\lambda P)^n = (\sum_{n=1}^{\infty} \lambda^n) P \\\ =\lambda(1-\lambda)^{-1}P $$

Now for $\lambda\
eq 1$ let's compute keeping in mind $P^2=P$

$$(I-\lambda P)(I+Q)=(I-\lambda P)(I+{\lambda\over 1-\lambda}P)=I$$

And the inverse is the one given in the book

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy fef09071c4956cef1ba3a11723c58955