# Let R be a ring. Prove that if $x^2=x$ for each $x \in R$, then R is a commutative ring. [duplicate]

Let R be a ring. Prove that if $x^2=x$ for each $x \in R$, then R is a commutative ring.

Ok, so I'm just looking for some confirmation that I'm doing this correctly.

If we suppose $x,y \in R$ Let's consider $(x+y)^2$,

Then $(x+y)^2 = x^2+xy+yx+y^2$ but $x^2=x$ and $y^2=y$

We can also see that for all $x \in R, x=-x$

So, $(x+y)^2= x+xy+yx+y$

Also, by our given $(x+y)^2=(x+y)$ so

$x+y =x+xy+yx+y$, Solving this algebraicly gives us $-yx=xy$ but since $(-yx)^2=(yx)$,

We have, $yx=xy$, Therefore R is commutative. Does that about wrap it up?

## marked as duplicate by Daniel FischerDec 5 '15 at 11:58

• Looks good to me. (I would make it a little clearer in the last step that you squared both sides of $-yx=xy$, took me a bit to figure out what you did.) – Mario Carneiro Apr 20 '15 at 19:02
• I'm wondering about that last step: $(-yx)^2 = (yx) \implies yx = xy$. How did you make that deduction? – Omnomnomnom Apr 20 '15 at 19:04
• @Omnomnomnom If $-yx=xy$, then $yx=(yx)^2=(-yx)^2=(xy)^2=xy$. – Mario Carneiro Apr 20 '15 at 19:05
• @MarioCarneiro thanks for that – Omnomnomnom Apr 20 '15 at 19:06
• You could also begin with $x=x^2=(-x)^2=-x$ to show that a minus sign does not matter in such a ring and then finish the proof at $xy+yx=0$. This gives the proof an easier structure, I think. – MooS Apr 20 '15 at 19:10

However, It would make the proof more readable if you could more thoroughly explain steps following the equality $-yx = xy$.
Alternatively, it might be easier to explicitly state that $x = -x$ for all $x \in R$, as MooS explains.