Let $K$ be an algebraically closed field, and $\mathbb A^n$ the affine-$n$ variety over it. Suppose that $k$ is an arbitrary subfield of $K$. There are definitions on page 217 of Humphreys' Linear Algebraic Groups:
A subvariety $X$ of $\mathbb A^n$ is $k$-closed if $X$ is the set of zeros of some collection of polynomials having coefficients in $k$.
and
$X$ is defined over $k$ if $\mathscr I(X)$ (the ideal in $K[X]$ vanishing on $X$) is generated by $k$-polynomials.
Humphreys says that these two notions coincide when $k$ is perfect. But if I let $K = \mathbb C$, the field of complex numbers, and $k =\mathbb R$, the field of real numbers, and set $X = \{i, -i \}$, then $X$ is the zero set of $f(x) = x^2 +1$ whose coefficients are in $k$. So, $X$ is $k$-closed. But $\mathscr I(X)$ generated by $x-i$ and $x+i$. Apparently, this ideal could not be generated by polynomials with coefficients in $\mathbb R$. So, $X$ is not defined over $k$. But $k =\mathbb R$ is perfect.
Where am I wrong?
Thanks to everyone.