Proof that the spectrum of a ring is Kolmogorov Let $A$ be a commutative ring and consider its spectrum $\operatorname{Spec}A$ equipped with the Zariski topology.
Wikipedia claims that $\operatorname{Spec}A$ satisfies the separation axiom $\mathbf{T_0}$ (Kolmogorov).
I am attempting to prove this claim.
Let $\mathfrak{p}$, $\mathfrak{q}\in\operatorname{Spec}A$ be distinct prime ideals of $A$.
I know that maximal ideals are closed in $\operatorname{Spec}A$;
if $\mathfrak{p}$ is maximal, we can construct an open neighbourhood $N$ of $\mathfrak{q}$ that does not contain $\mathfrak{p}$ by setting $N:=\operatorname{Spec}A\setminus\{\mathfrak{p}\}$.
Now assume that both ideals are not maximal.
How can we construct a neighbourhood that contains exactly one of the ideals?
 A: First of all, I would like to recall the construction of the Zariski topology:
Closed sets in $\operatorname{Spec}A$ are given by
$
 Z(\mathfrak{a}):=\{\mathfrak{p}\in\operatorname{Spec}A\mid\mathfrak{a}\subseteq\mathfrak{p}\}
$
for ideals $\mathfrak{a}\subseteq A$.
This is basically the only fact we need to prove the separation property.
Assume that $\mathfrak{p}$, $\mathfrak{q}\in\operatorname{Spec}A$ are distinct prime ideals of $A$ that are both not maximal.
We have to be careful because it could be that one ideal contains the other;
however, it cannot be that both $\mathfrak{p}\subset\mathfrak{q}$ and $\mathfrak{q}\subset\mathfrak{p}$.
Without loss of generality we can assume $\mathfrak{p}\not\subset\mathfrak{q}$.
But then by definition $\mathfrak{q}\notin Z(\mathfrak{p})$ and hence $Z(\mathfrak{p})$ is a closed set that contains $\mathfrak{p}$ but not $\mathfrak{q}$.
Now we can construct the desired neighbourhood $N:=\operatorname{Spec}A\setminus Z(\mathfrak{p})$;
by construction $\mathfrak{q}\in N$ and $\mathfrak{p}\notin N$.
