Construction of the product of prevarieties I will try to be as precise as possible, since my last post was probably too vague to explain well my problem, that now may be solved. I'll follow these conventions, that should be coherent with those used in Gathmann's Algebraic Geometry:

*

*when talking about ringed spaces, I'm always referring to the category of ringed spaces of $k$-valued maps, for a field $k=\bar k$.

*an affine variety by definition is a ringed space, and so any ringed space isomorphic to an affine variety will be called again affine variety. Then a prevariety is a ringed space $X$ whose underlying space admits an open covering $\{X_i\}_{i\in I}$, such that $X$ restricted to $X_i$ is an affine variety for all $i\in I$. The morphisms of prevarieties (and so also of affine varieties) are those of ringed spaces;

*the products, where not specified otherwise, will be meant in the category of prevarieties. In particular the product of two affine varieties is again an affine variety, and we always choose to construct it using as projections the set-theoretical ones.

Given prevarieties $X$ and $Y$, with affine open covering $\{X_i\}_{i\in I}$ and $\{Y_j\}_{j\in J}$, we want to construct $X\times Y$. The aim is to get a prevariety gluing all the affine varieties $\{X_i\times Y_j\}_{i,j\in I\times J}$.
(According to the conditions in Construction 5.6)  such affine varieties will surely glue if the (set) identity between $U$ and $V$ is a ringed space morphism, where $U$, $V$ are the ringed spaces obtained restricting $X_{i_0}\times Y_{j_0}$, $X_{i_1}\times Y_{j_1}$ to the set $(X_{i_0}\cap X_{i_1})\times (Y_{j_0}\cap Y_{j_1})$, for fixed $i_0,i_1\in I$ and $j_0,j_1\in J$.
I thought this: if $Z_0$, $Z_1$ are affine varieties and $W_0\subset Z_0$, $W_1\subset Z_1$ are open subsets (so prevarieties), the restriction of $Z_0\times Z_1$ to the set $W_0\times W_1$ has the universal property of the product of prevarieties $W_0\times W_1$, with projections the set-theoretical ones. Hence $U$ and $V$ have  both the universal property of $(X_{i_0}\cap X_{i_1})\times (Y_{j_0}\cap Y_{j_1})$, with the same (set-theoretical) projections, so  the identity is the unique morphism commuting with them. (The ringed space structures on $X_{i_0}\cap X_{i_1}$ obtained by restricting $X_{i_0}$ and $X_{i_1}$ are equal, since they both come from $X$, so $X_{i_0}\cap X_{i_1}$ is a well-defined prevariety, and the same holds for $Y_{j_0}\cap Y_{j_1}$). Does it make sense to you now? Thanks
 A: Yes, your argumentation seems correct to me.

I looked at some old notes of mine where I was trying to figure out the same thing:
how products of prevarieties work, with the same conventions as in the question.
I have added below an overview of what I ended up doing, as it may be helpful for comparison.


Proposition.
Let $X$ and $Y$ be two prevarieties.

*

*There is a unique way of making the set $X × Y$ together with the canonical projects from $π_X \colon X × Y \to X$ and $π_Y \colon X × Y \to Y$ into the product of $X$ and $Y$ in the category of prevarieties.


*Let $X' ⊆ X$ and $Y' ⊆ Y$ be subprevarieties.
For the products $X' × Y'$ and $X × Y$ as described above, $X' × Y'$ is a subprevariety of $X × Y$.


*If $U ⊆ X$ and $V ⊆ Y$ are affine open subsets, then $U × V$ is an affine open subset in $X × Y$.


*The Zariski topology on $X × Y$ is finer than the product topology.

My argumentation went as follows (with most details omitted):

*

*Step 1. Given affine $X$ and $Y$, we know how to construct the product of $X × Y$ in the category of affine varieties. We also note that the Zariski topology on $X × Y$ is finer than the product topology.

We hence understand products of affine varieties in the category of affine varieties.

*

*Step 2. Given affine varieties $X$ and $Y$, the above product $X × Y$ is already their product in the category of prevarieties.
(To understand morphisms $Z \to X × Y$ for a prevariety $Z$ we can use an affine open covering of $Z$.)

We hence understand the product of affine varieties in the category of prevarieties.

*

*Step 3. Suppose that $X$ and $Y$ are two prevarieties with product $X × Y$.
Let $X' ⊆ X$ and $Y' ⊆ Y$ be two subprevarieties.
We endow the set $X' × Y'$ with the subspace topology of $X × Y$ and the restriction of the structure sheaf of $X × Y$.
We then check that $X' × Y'$ together with $π_{X'}$ and $π_{Y'}$ satisfies the universal property of the product.

We hence understand products of subprevarieties of affine varieties.
We have also shown (2).

*

*Step 4. For the uniqueness in (1): if there were two ways, then there would exist an isomorphism $φ$ between them that satisfies $π_X ∘ φ = π_X$ and $π_Y ∘ φ = π_Y$ (because categorical products are unique up to isomorphism).
But then $φ = \mathrm{id}$ on a set-theoretic level, whence both structures must be the same.

From now on let $X$ and $Y$ be arbitrary prevarieties.

*

*Step 5. Consider the coverings $X = \bigcup \mathcal{U}$ and $Y = \bigcup \mathcal{V}$ by all affine open subsets.
Then, $\{ U × V \mid U ∈ \mathcal{U}, V ∈ \mathcal{V} \}$ is a cover of $X × Y$, and we have on each $U × V$ the structure of an affine variety.
To glue these structures together, we need to check that for all $U, U' ∈ \mathcal{U}$ and $V, V ∈ \mathcal{U}$:

*

*the set $(U ∩ U') × (V ∩ V')$ is open in both $U × V$ and $U' × V'$,

*$U × V$ and $U' × V'$ induce the same subspace topology on $(U ∩ U') × (V ∩ V')$,

*the restrictions of the structure sheaves of $U × V$ and $U' × V$ to $(U ∩ U') × (V ∩ V')$ must be the same.

Set $U'' ≔ U ∩ U'$ and $V'' ≔ V ∩ V'$, open prevarieties in $X$ and $Y$.
The set $U'' × V''$ is open in the product topology of $U × V$ and thus also in the Zariski topology; similarly for $U' × V'$.
As seen in step 3, restricting the structure of $U × V$ to $U'' × V''$ gives us the categorical product of the prevarieties $U''$ and $V''$ as described in (1). But the same also holds for $U' × V'$.
By the uniqueness from step 4, both structures on $U'' × V''$ must agree.
We have thus made the set $X × Y$ into a prevariety.
We also have (3) by construction.

*

*Step 6. We check that $π_X$ and $π_Y$ are morphisms of prevarieties.
This can be concluded from the fact that $π_U$ and $π_V$ are morphisms for all $U ∈ \mathcal{U}$, $V ∈ \mathcal{V}$.


*Step 7. In needs to be shown that $X × Y$ together with $π_X$ and $π_Y$ satisfies the universal property of the product:
given morphisms $φ \colon Z \to X$ and $ψ \colon Z \to Y$ we need to show that $⟨φ, ψ⟩ \colon Z \to X × Y$ is again a morphism.
This can be checked on affine open subsets.
We have thus shown (1).

*

*Step 8. We conclude (4) from the affine case (where it holds by step 1) with the help of affine open covers.

A: Comment: "@hm2020 what you say in fact is very hard to comprehend for me; but I don't understand why this convention on ringed spaces causes much confusion. It is not so crucial for the question, that is basically if the set-theoretical identity between U and V is a morphism of prevarieties."
Answer: If you speak the language of Hartshorne, Ch I you you will find that he defines (indirectly) the structure sheaf $\mathcal{O}_X$ for any affine algebraic variety $X:=Z(I) \subseteq \mathbb{A}^n_k$ with $k$ an algebraically closed field.
This is done in CH.I.3.  He defined for any open set $U \subseteq X$ the $k$-algebra $\mathcal{O}_X(U)$ of regular functions $f:U \rightarrow k$. This is what I spoke of in another thread - there is the sheaf $Map(U,k)$ of all maps from $U$ to $k$ and the $k$-algebra $\mathcal{O}_X(U)$ is a sub $k$-algebra of $Map(U,k)$.
This definition is local, hence HH.Ch.I defines a sheaf of $k$-algebras $\mathcal{O}_X$ on $X$. You may define the stalk of this sheaf at a point $p\in X$. The stalk $\mathcal{O}_{X,p}$ is a local ring with maximal ideal $\mathfrak{m}_p$. Any morphism $f: X \rightarrow Y$ of algebraic varieties $X,Y$ will induce a map
$$f^{\#}_p: \mathcal{O}_{Y,f(p)} \rightarrow \mathcal{O}_{X,p}$$
at the stalks, and this map will be local: $f^{\#}_p(\mathfrak{m}_{f(p)}) \subseteq \mathfrak{m}_p$. If the book you are reading is speaking of the notion "algebraic variety" in the classical sense, it has to speak of such "locally ringed spaces" and "maps of locally ringed spaces". Can you comment on this?
Comment: "Gathmann proves that if (X,OX) is an affine variety, the stalk OX,x is a local ring; now I don't remember he proves that a morphism of affine varieties induces a local homomorphism on the stalk. Anyway these facts are not part of the definitions for him; I imagine that it is not necessary to require them in the setting of affine varieties over an algebraically closed field"
Answer: Again Im not familiar with Gathmans book but the following holds: If $Y$ is an affine algebraic variety and if $X$ is any variety there is a 1-1 correspondence of sets
$$(1). Hom_{Var/k}(X,Y) \cong Hom_{k-alg}(A(Y), \mathcal{O}_X(X))$$
where $A(Y)$ is the coordinate ring of $Y$ and $\mathcal{O}_X(X)$ is the ring of gloal sections of the structure sheaf of $X$. If $X$ is an affine varitey one gets the 1-1 correspondence
$$(2). Hom_{Var/k}(X,Y) \cong Hom_{k-alg}(A(Y), A(X)).$$
A map of affine algebraic varieties is uniquely determined by the corresponding map or coordinate rings.
In the case of affine schemes one needs to use maps of locally ringed spaces for $(1)$ to hold and I believe one also needs this for it to hold in the case of classical algebraic varieties. This is implicit in the proof of $(1)$ in  HH.Prop.I.3.5 and Thm.I.3.2.  Hence I do not think one can avoid speaking of this notion.
@Jerry Scott - The fact that a map of affine schemes/affine algebraic varieties is uniquely determined by the corresponding ring map is essential for the "theory of schemes" to work. Else one is studying the ""category of ringed topological spaces"". This study has nothing to do with algebra and algebraic geometry - This is an independent field and has no implications for algebra/algebraic geometry/arithmetic geometry.
