Decomposition of ideal into intersection of prime ideals I'm trying to find the irreducible components of the algebraic set $X=V(I)$, where $I=(x^2-x-yz, y^2-y-xz, z^2-z-xy)$. My idea is to write the ideal $I$ as an intersection of prime ideals, although I don't really know where to start. 
Could anyone offer a hint on how to do this? Or is there a better way to solve the exercise?
Thanks!
 A: To see if the situation is simple or complicated, let us ask sage about the decomposition in primary ideals, where - citing sage...
An ideal $Q$ is called primary if it is a proper ideal of the ring $R$,
   and if whenever $ab \in Q$ and $a \not\in Q$, then $b^n \in Q$ for some $n
   \in \Bbb Z$.
In our case i will exchange the variables $y,z$ in the definition of the ideal from the OP, use the name $J$ for the new ideal in the polynomial ring $R$ in $x,y,z$ over the rationals:
$$
R = \Bbb Q[x,y,z]\ ,\qquad
J=(\ x^2-x-yz\ ,\ y^2-y-xz\ ,\ z^2-z+xy\ )
\ .
$$
We get in some quick lines:
sage: R.<x,y,z> = PolynomialRing(QQ)
sage: J = R*[ x^2 - x - y*z,    y^2 - y - x*z,    z^2 - z + x*y]

sage: J
Ideal (x^2 - y*z - x, y^2 - x*z - y, x*y + z^2 - z) 
of Multivariate Polynomial Ring in x, y, z over Rational Field

sage: for Q in J.primary_decomposition():
....:     print "Ideal generated by", Q.gens()
....:     
Ideal generated by [z, y - 1, x]
Ideal generated by [z, y, x - 1]
Ideal generated by [z, y, x]
Ideal generated by [x + y - z + 1, z^2 - 2*z + 1, y*z - y, y^2 - z + 1]
Ideal generated by [y - z - 1, x - z - 1, 2*z^2 + z + 1]

(Lines were slightly rearranged to fit in the web page.)
The first three components correspond to the points $(0,1,0)$, $(1,0,0)$, and $(0,0,0)$. The next ideal leads to the points satisfying $(z-1)^2=0$, and $y(z-1)=0$, and $y^2=z-1=x+y$. The (set of) $\Bbb C$-rational points for the above equations reduce to (the set containing) one point, $(0,0,0)$. The last ideal leads to two points. 
Let us now try to solve the given system of equations over a field of characteristic zero:
$$
\left\{
\begin{aligned}
0 &= x^2 -x-yz\ ,\\
0 &= y^2 -y-xz\ ,\\
0 &= z^2 -z+xy\ .
\end{aligned}
\right.
$$
Usually we want to eliminate $x,y$ from the above equations, obtain equations only in $z$, these equations in $z$ define an ideal in $\Bbb Q[z]$, which is principal, we only need its generator. Here it is:
sage: J.elimination_ideal( [x,y] ).gens()[0].factor()
z * (z - 1)^2 * (2*z^2 + z + 1)

We would of course want to know how to generate the above equation only in $z$ from the initial equations. No problem, we multiply the three generators of $J$ respectively with 
sage: for c in J.elimination_ideal( [x,y] ).gens()[0].lift(J):
....:     print latex(2*c)
....:     
2 y^{2} z - y z + z^{2} - y - z
2 y z^{2} + x z + z^{2} - x - z
-2 x y z + 4 z^{3} + x z + y z - 2 z^{2} + x + y - 2

and the three polynomials are, after slight rearranging in this page:
$$
\begin{aligned}
&2 y^{2} z - y z + z^{2} - y - z
\\
&2 y z^{2} + x z + z^{2} - x - z
\\
&-2 x y z + 4 z^{3} + x z + y z - 2 z^{2} + x + y - 2
\ .
\end{aligned}
$$
(I inserted a factor two in 2*c to get rid of denominators.)

With bare hands we can solve the system over a field as follows.
From the first two equations, we get after subtracting them: $(x-y)(x+y+z-1)=0$. So either $x=y$, or $x+y+z=1$. 


*

*In the first case, $x=y$, we have the equations $xz=x^2+x$ and $x^2=-z^2+z$ . From the first one we have either $x=0$, leading to $x=y=z=0$, or $z=x+1$, and so on.

*In the second case, we eliminate first $x$, then $y$... But for this i need pen and paper to get
sage: K = J + R*(x+y+z-1)
sage: K.elimination_ideal(x)
Ideal (z^2 - z, y^2 + y*z - y) 
of Multivariate Polynomial Ring in x, y, z over Rational Field


LATER EDIT: As the OP changed one sign, and thus the whole computations.
The good message is that same lines of code with a new ideal works as the above frugal comments. This time:
sage: R.<x,y,z> = PolynomialRing(QQbar)
sage: R.<x,y,z> = PolynomialRing(QQ)
sage: J = R.ideal( [ x^2 - x - y*z,    y^2 - y - x*z,    z^2 - z - x*y] )
sage: J.primary_decomposition()
[Ideal (z, y, x) 
 of Multivariate Polynomial Ring in x, y, z over Rational Field,
 Ideal (x + y + z - 1, y^2 + y*z + z^2 - y - z)
 of Multivariate Polynomial Ring in x, y, z over Rational Field]

The first ideal, $(x,y,z)$, corresponds to the point $(0,0,0)$, thus to a variety of dimension zero.
The second ideal is slightly more complicated. It has only two generators, so its dimension is one. Both ideals are prime.
sage: J0, J1 = J.primary_decomposition()
sage: J0.dimension(), J1.dimension()
(0, 1)
sage: J0.is_prime(), J1.is_prime()
(True, True)


Let us compute humanly.
We preserve the notations, $J$ is the given ideal, and 
$$
\begin{aligned}
J_0 &=(x,y,z)\ ,\\
J_1 &=(x+y+z-1,\ y^2+yz+z^2-y-z)\ .
\end{aligned}
$$
Let us show $J_0J_1\subseteq J$.
Note first that $y^2+yz+z^2-y-z\in J$ because of 
$$
y^2+yz+z^2-y-z
=
-z(x^2 - yz - x) - (x-1)(y^2 - xz - y) - (y-1)( -xy + z^2 - z)
\ .
$$
By symmetry, it remains to show $x(x+y+z-1)\in J$. Indeed:
$$
x(x+y+z-1)
=
-(z-1)(x^2 - yz - x) - x(y^2 - xz - y) - y( -xy + z^2 - z)
\ .
$$
sage: J1.gens()[1].lift(J)
[-z, -x + 1, -y + 1]
sage: ( x*(x+y+z-1) ).lift(J)
[-z + 1, -x, -y]

For the reverse inclusion, it is enough to show $x^2-x-yz\in J_0J_1$.
The corresponding representation can be extracted from:
sage: for gen in ( J0*J1 ).gens():
....:     print gen.factor()
....:     
z * (x + y + z - 1)
z * (y^2 + y*z + z^2 - y - z)
y * (x + y + z - 1)
y * (y^2 + y*z + z^2 - y - z)
x * (x + y + z - 1)
x * (y^2 + y*z + z^2 - y - z)

sage: ( x^2 - x - y*z ).lift( J0*J1 )
[-z, 1, -y - z, 1, 1, 1]

