Following a question of mine on here, the answer says that if $a\in R$ (a commutative ring) is idempotent ($a^2=a$), then: $$R\simeq (a)\times (1-a)$$ I am trying to make sense of this by proving it.
Ideas: I have shown that $a$ and $1-a$ "split" $R$ into distinct parts, that is: $$xa=x(1-a)\Rightarrow x=0$$ This is proved by multiplying the equality by $a$ and $1-a$ to get $ax=0, x(1-a)=0$ from which we get $x=0$. So I then wanted to show that each $r\in R$ can be uniquely represented as: $$r=xa-y(1-a)$$ so that I could pair up each $r\in R$ with $\big(ax,y(1-a)\big)$ to get an isomorphism. But this doesn't work since $x=-y=r$ satisfies the equation, but does not account for all of $(a)\times (1-a)$...
Am I missing something obvious?
To answer your comment $x\mapsto (xa,(1-a)x)$ is surjective. Indeed let $(ya,(1-a)z)$ be the most general element in $(a)\times(1-a)$. Define :
$$x:=ya+(1-a)z $$
Then
$$xa=ya^2+(1-a)za=ya+(a-a^2)z=ya+(a-a)z=ya$$
$$x(1-a)=ya(1-a)+(1-a)(1-a)z=y(a-a^2)+(1-2a+a^2)z=y(a-a)+(1-a)z=(1-a)z$$
So $(xa,(1-a)x)=(ya,(1-a)z)$.