# I am getting very confused by the definition of a minimal prime ideal

I am trying to prove that in an affine scheme $$\operatorname{Spec}A$$ that an irreducible component can be written as the vanishing locus $$V(\mathfrak p)$$ for a minimal prime ideal $$\mathfrak p$$, but I am getting very confused.

So if $$I$$ is a minimal prime ideal over an ideal $$J$$ then it is the smallest prime ideal such that $$J\subset I$$, i.e. if $$\mathfrak p$$ is a prime ideal containing $$J$$ then $$I\subset \mathfrak p$$.

It is easy to see that every irreducible closed subset of $$\operatorname{Spec}A$$ corresponds to $$V(I)$$ with $$I$$ prime, but isn't every prime minimal over itself? So what does this even mean? Because it seems to imply to me that every prime ideal corresponds to an irreducible component of $$\operatorname{Spec}A$$, but this can be true because something like $$A=\mathbb C[x]$$ has infinitely many primes, but in this case $$\operatorname{Spec}A$$ is a Noetherian scheme so has finitely many irreducible components.

Wikipedia says that a prime ideal is minimal when it is minimal over the zero ideal, but then if $$I$$ is prime doesn't this mean that $$I\subset \mathfrak p$$ for every prime ideal of $$A$$ so $$V(I)=\operatorname{Spec}A$$?

I suspect I am messing something up here...

i.e. if $$\mathfrak p$$ is a prime ideal containing $$J$$ then $$I⊂\mathfrak p$$.
That is not correct. $$I$$ being a minimal prime over $$J$$ means that there is no prime $$\mathfrak q$$ with $$J \subset \mathfrak q \subsetneq I.$$ But it doesn't mean that $$I$$ is a minimum in the set $$V(I)$$ of all prime ideals which contain $$I$$.
Because it seems to imply to me that every prime ideal corresponds to an irreducible component of $$\operatorname{Spec}A$$
You always have $$V(0) = \operatorname{Spec} A$$. So the minimal prime ideals over $$0$$ correspond to the irreducible components of $$\operatorname{Spec} A$$. Since every prime ideal contains $$0$$, this means the irreducible components correspond to the minimal primes of $$A$$.
Here is an example. If you take $$A = \mathbb C[x,y] / (xy)$$, then the minimal primes of $$A$$ are $$(x)$$ and $$(y)$$.