# Definition of scheme defined over a ring A

In the context of classical algebraic geometry we have the following definition.

A variety (say affine over an algebraic closed field $k$) $X\subset\mathbb{A}^n_k$ is said to be defined over a ring $A\subset k$ if we can find polinomials $f_1,...,f_k\in A[x]$ such that $X=V(f_1,...,f_k)$. In this case the specific set of polynomials can be thought as the chosen $A$-structure for $X$ and now if we want to reduce $X$ mod a prime ideal $P\subset A$ we just take $$\bar{X}=V(\bar{f}_1,...,\bar{f}_k)\subset \mathbb{A}^n_{\overline{k(P)}}$$ And this reduction depends in general of the choose of $A$-structure.

I want to understand how this concepts translate to the lenguage of schemes.

A first approach for this would be to define an $A$-structure of an scheme $X$ to be a morphism $X\rightarrow \text{Spec}(A)$, and a reduction mod $P$ to be the fiber of this morphism at $P$. The problem with this definition is that, as $\mathbb{Z}$ is a final object, every scheme $X$ would come with a unique $\mathbb{Z}$ structure and of course this is not a property we would want. Also, if we take the variety $\text{Spec} \ \mathbb{C}[x,y]/(f(x,y))$, then the reduction mod $p$ would be $\text{Spec} \ \mathbb{C}[x,y]/(f(x,y))\otimes_\mathbb{Z} \mathbb{Z}/p\mathbb{Z}$ and this do not coincide with the definition in the classical context (I guess).

So, what is the usual definition for this concept?

Note that $A\subset k$, so there is a map $\operatorname{Spec} k\rightarrow\operatorname{Spec}A$.
Now let $X$ be a $k$-scheme. Then a $A$-structure on $X$ is not a map $X\rightarrow\operatorname{Spec}A$, but another scheme $\mathfrak{X}\rightarrow A$ such that $\mathfrak{X}\times_{\operatorname{Spec} A}\operatorname{Spec} k\simeq X$. From this, you can easily see that $\mathfrak{X}$ is not unique.
Finally, the reduction at a prime $\mathfrak{p}\subset A$ is as you said the fiber product $\mathfrak{X}\otimes_A A/\mathfrak{p}$.
Example : let $X=\mathbb{A}_{\mathbb{C}}^1\setminus\{0\}=\operatorname{Spec}\mathbb{C}[x,y]/(xy-1)$. An obvious $\mathbb{Z}$-structure would be $\operatorname{Spec}\mathbb{Z}[x,y]/(xy-1)$. But you can also take $\mathbb{Z}[u,v]/(u^2+v^2-1)$ where $x=u+iv$ and $y=u-iv$. Now these are really different schemes : for example the second one has a non-reduced reduction mod $2$.