How to define affine/projective varieties over fields which are not algebraically closed? In general, you come across affine and projective varieties as defined over algebraically closed fields, such as in Hartshorne's Algebraic Geometry, who defines 


*

*an algebraic variety as an irreducible algebraic subset of $\mathbb{A}^n$, endowed with the induced topology.

*a projective variety as an irreducible algebraic subset of $\mathbb{P}^n$, endowed with the induced topology.


My questions:


*

*Where exactly do I need that the field is algebraically closed for this definition (or maybe for other definitions necessary for this one)?

*How would I need to alter these definitions in case of a non-algebraically closed field? 
(I was thinking that it has to do sth with the definition of an algebraic set based on this post Affine variety over a field which is not algebraically closed can be written as the zero set of a single polynomial , i.e I do not have whole set of polynomials such that my variety equals the vanishing locus over them, but only one polynomial?)


Thank you!
 A: The typical shift that happens when moving to fields which aren't algebraically closed (or more general rings) is that one redefines what $\Bbb A^n_R$ and $\Bbb P^n_R$ are for the the ring $R$. Instead of declaring that $\Bbb A^n_R$ is the set $R^n$ with a funny topology, one says that $\Bbb A^n_R = \operatorname{Spec} R[x_1,\cdots,x_n]$, and similarly, instead of regarding $\Bbb P^n_R$ as "lines through the origin in $R^{n+1}$", we think of it instead as lines through the origin in $\Bbb A^{n+1}_R = \operatorname{Spec} R[x_0,\cdots,x_n]$ (also known as $\operatorname{Proj} R[x_0,\cdots,x_n]$). Sometimes you'll also see people drop the "irreducible" adjective - the general formulation is that an affine (resp. projective) variety is a closed subscheme of $\Bbb A^n$ (resp. $\Bbb P^n$) satisfying some adjectives, which often vary from author to author.
This redefinition gives you many more points in $\Bbb A^n_K$ if $K$ is not an algebraically closed field - for any $K'$ a Galois extension of $K$, we get a point for every Galois orbit in $K'$. Having access to these points means the sorts of shenanigans you're attempting to pull off in the linked question don't work - every polynomial's zero set has the correct dimension, etc.
