[proofplan]
We verify the [basis criterion](/theorems/3308) directly. First we show that every distinguished set $D_X(f)$ is Zariski open by identifying it with the complement of the [closed set](/page/Closed%20Set) $V_X((f))$. Then, given a Zariski open subset $U\subset X$ and a point $p\in U$, we write the closed complement $X\setminus U$ as the relative vanishing locus of an ideal $I\trianglelefteq k[X]$. Since $p$ is not in that vanishing locus, some function $f\in I$ does not vanish at $p$, and the distinguished open $D_X(f)$ contains $p$ while remaining inside $U$. Finally, we check that finite intersections of distinguished opens are again distinguished opens by the identity $D_X(f)\cap D_X(g)=D_X(fg)$.
[/proofplan]
[step:Show each distinguished open is Zariski open]
Let $f\in k[X]$, and let $(f)\trianglelefteq k[X]$ denote the principal ideal generated by $f$. By the definition of the Zariski topology on the affine variety $X$, the relative vanishing locus
\begin{align*}
V_X((f)):=\{p\in X: h(p)=0 \text{ for every } h\in (f)\}
\end{align*}
is Zariski closed in $X$.
We prove that
\begin{align*}
D_X(f)=X\setminus V_X((f)).
\end{align*}
If $p\in D_X(f)$, then $f(p)\ne 0$. Since $f\in (f)$, the point $p$ does not vanish on every element of $(f)$, so $p\notin V_X((f))$.
Conversely, suppose $p\in X\setminus V_X((f))$. Then there exists $h\in (f)$ such that $h(p)\ne 0$. Since $h\in (f)$, there exists $a\in k[X]$ such that $h=af$. Evaluating at $p$ gives
\begin{align*}
h(p)=a(p)f(p).
\end{align*}
Because $k$ is a field and $h(p)\ne 0$, we must have $f(p)\ne 0$. Hence $p\in D_X(f)$.
Thus $D_X(f)=X\setminus V_X((f))$. Since $V_X((f))$ is Zariski closed in $X$, the distinguished open $D_X(f)$ is Zariski open in $X$.
[/step]
[step:Find a distinguished open neighbourhood inside an arbitrary open set]
Let $U\subset X$ be Zariski open, and let $p\in U$. Since $X\setminus U$ is Zariski closed in $X$, by the definition of the Zariski topology on an affine variety there exists an ideal $I\trianglelefteq k[X]$ such that
\begin{align*}
X\setminus U=V_X(I),
\end{align*}
where
\begin{align*}
V_X(I):=\{q\in X: h(q)=0 \text{ for every } h\in I\}.
\end{align*}
Because $p\in U$, we have $p\notin V_X(I)$. By the definition of $V_X(I)$, there exists $f\in I$ such that $f(p)\ne 0$. Therefore $p\in D_X(f)$.
We claim that $D_X(f)\subset U$. Let $q\in D_X(f)$. Then $f(q)\ne 0$. Since $f\in I$, the point $q$ cannot satisfy $h(q)=0$ for every $h\in I$. Hence $q\notin V_X(I)=X\setminus U$, so $q\in U$. Thus
\begin{align*}
p\in D_X(f)\subset U.
\end{align*}
[guided]
We need to prove that the distinguished opens are small enough to refine every [open set](/page/Open%20Set). Fix a Zariski open subset $U\subset X$ and a point $p\in U$. The complement $X\setminus U$ is Zariski closed in $X$, so by the definition of the Zariski topology on the affine variety $X$, there is an ideal $I\trianglelefteq k[X]$ whose relative vanishing locus is exactly this complement:
\begin{align*}
X\setminus U=V_X(I).
\end{align*}
Here the notation means
\begin{align*}
V_X(I):=\{q\in X: h(q)=0 \text{ for every } h\in I\}.
\end{align*}
Since $p\in U$, the point $p$ is not in the complement $X\setminus U$. Therefore
\begin{align*}
p\notin V_X(I).
\end{align*}
Unpacking the definition of $V_X(I)$, this means it is not true that every element of $I$ vanishes at $p$. Hence there exists some $f\in I$ such that
\begin{align*}
f(p)\ne 0.
\end{align*}
By the definition
\begin{align*}
D_X(f):=\{q\in X: f(q)\ne 0\},
\end{align*}
this gives $p\in D_X(f)$.
It remains to check that this distinguished open does not leave $U$. Let $q\in D_X(f)$. Then $f(q)\ne 0$. Because $f\in I$, the point $q$ cannot be a common zero of all functions in $I$. Therefore
\begin{align*}
q\notin V_X(I).
\end{align*}
Since $V_X(I)=X\setminus U$, this implies $q\in U$. Thus every $q\in D_X(f)$ belongs to $U$, and so
\begin{align*}
D_X(f)\subset U.
\end{align*}
Combining this with $p\in D_X(f)$ gives the required distinguished open neighbourhood
\begin{align*}
p\in D_X(f)\subset U.
\end{align*}
[/guided]
[/step]
[step:Check that finite intersections remain distinguished]
Let $f,g\in k[X]$. For every $p\in X$, we have
\begin{align*}
p\in D_X(f)\cap D_X(g)
\end{align*}
if and only if $f(p)\ne 0$ and $g(p)\ne 0$. Since $k$ is a field, this is equivalent to
\begin{align*}
f(p)g(p)\ne 0.
\end{align*}
The product in the coordinate ring is evaluated pointwise, so
\begin{align*}
(fg)(p)=f(p)g(p).
\end{align*}
Therefore
\begin{align*}
p\in D_X(f)\cap D_X(g)
\end{align*}
if and only if
\begin{align*}
p\in D_X(fg).
\end{align*}
Hence
\begin{align*}
D_X(f)\cap D_X(g)=D_X(fg).
\end{align*}
[/step]
[step:Conclude that the distinguished opens form a basis]
The first step shows that each set $D_X(f)$ is Zariski open in $X$. The neighbourhood refinement step shows that for every Zariski open subset $U\subset X$ and every point $p\in U$, there exists $f\in k[X]$ such that
\begin{align*}
p\in D_X(f)\subset U.
\end{align*}
Thus every Zariski open subset of $X$ is the union of distinguished open subsets contained in it. The intersection step shows that intersections of two distinguished opens are again distinguished opens. Therefore the collection
\begin{align*}
\{D_X(f): f\in k[X]\}
\end{align*}
is a basis for the Zariski topology on $X$.
[/step]