Definition (ideal of subset of affine space)
Let $X \subseteq{}$$\mathbb{A}^n$ be a subset.
The ideal of $X$ is $$ \begin{align*} I(X) = \sb{f\in k[x_1, \ldots, x_n]}{f(p)\; \forall p\in X}. \end{align*} $$
Indeed $I(X)$ is an ideal of $k[x_1, \ldots, x_n]$.
$I$ is inclusion reversing: if $X \subseteq Y \subseteq \mathbb{A}^n$, then $I(Y) \subseteq I(X)$.
$I(X \cup Y) = I(X) \cap I(Y)$ for any $X,Y\subseteq \mathbb{A}^n$.