Idempotent elements of a ring

Let $e,f$ be idempotent elements of a ring $R$. Prove that if either $ef=fe$ or $fe=0$ then $e+f-ef$ is a idempotent element and $Re+Rf=R(e+f-ef)$.

We have $(e+f-ef)(e+f-ef)=ee+ef-eef+fe+ff-fef-efe-eff+efef$

If $ef=0$ then $(e+f-ef)(e+f-ef)=e+f+ef$??? Is $e+f-ef$ a idempotent element?

• I strongly suspect that it's supposed to read "or $fe=0$." I gave a counterexample for the "$ef=0$" version below, but it looks like the $fe=0$ works. – rschwieb Nov 25 '13 at 15:19
• That is an error on typing of the book that I read. – chuyenvien94 Nov 25 '13 at 15:29

Note: the OP has since corrected the typo, making the first example somewhat obsolete.

The claim that "$ef=0$ implies $e+f-ef$ is idempotent" is not true.

Let $e=\begin{bmatrix}0&1\\0&1\end{bmatrix}$ and $f=\begin{bmatrix}1&0\\0&0\end{bmatrix}$. Then $ef=0$ but $fe\neq 0$.

Then this computation furnishes a counterexample: $(e+f-ef)^2=(e+f)^2=e+ef+fe+f=e+f+fe\neq e+f=e+f-ef$.

On the other hand, if $fe=0$, then you will find that $(e+f-ef)^2$ can be cancelled down to $e+f-fe$.

I'll compute $(e+f-ef)^2$ without assumptions so that you can check your work.

$$(e+f-ef)^2=e+fe+f-fef-efe-ef+efef$$

Apply either of "$fe=0$" or "$ef=fe$" and you should see that this cancels down to $e+f-ef$.