Some definitions use here:

Definition.Let $\mathcal C$ be a category and $S\in \mathcal C$, then we can define the $S$-category to be morphisms $X\to S$ as objects, and morphisms between objects $X\to S$ and $Y\to S$ as $\mathcal C$-morphisms $f:X\to Y$ such that makes the diagram $X\to S$, $Y\to S$ and $X\to Y$ commutes (don't know how to make commutative diagram here).

Definition.Let $\mathcal C$ be a category and $S$ a fixed object in $\mathcal C$. For two morphisms $f:X\to S$ and $g:Y\to S$ in $\mathcal C$ we call a triple $(Z,p,q)$ afiber product of $f$ and $g$ (over $S$)if $Z\in \mathcal C$, $p:Z\to X,q:Z\to Y$, if for all $u:T\to X$ and $v:T\to Y$ such that $f\circ u=g\circ v$, there exsits unique morphism $w:T\to Z$ such that $p\circ w=u$ and $q\circ w=v$. We often denote $Z$ by $X\times_SY$. The $p,q$ are often calledprojection maps.

Definition.Let $\mathcal C$ be a category with fiber product exists, and $u:S'\to S$ a morphism in $\mathcal C$. If $X\to S$ is an $S$-object, $X\times_SS'$ is an $S'$-object via the second projection that is sometimes denoted by $u^*(X)$ or by $X_{(S')}$. It is called theinverse imageor thebase changeof $X$ by $u$. In this case, the morphism $f\times_S \textrm{Id}_{S'}$ is a morphism of $S'$-objects that is sometimes denoted by $u^*(f)$ or $f_{(S')}$ and called theinverse imageor thebase change of $f$ by $u$

**Definition.**Let $f:X\to S$ be a morphism of schemes and $s\in S$ be a point. Let $\textrm{Spec }\kappa(s)\to S$ be the canonical morphism. Then we call $X_s=X\otimes_S\kappa(s)$ the

fiber of $f$ in $s$and use $f^{-1}(s)$ to denote it.

This is Lemma 4.28 from *Algebraic Geometry: Part I: Schemes. With Examples and Exercises*.

Lemma.Let $S$ be a scheme, let $f:X\longrightarrow S$ and $g:Y\longrightarrow S$ be $S$-schemes and let $p:X\times_S Y\longrightarrow X$ and $q:X\times_S Y\longrightarrow Y$ be the two projections. Let $x\in X$ and $y\in Y$ be points and $\xi:\mathrm{Spec}\,\kappa(x)\longrightarrow X$ and $\psi:\mathrm{Spec}\,\kappa(y)\longrightarrow Y$ the canonical morphisms.(1) There exists a point $z\in X\times_S Y$ with $p(z)=x$ and $q(z)=y$ if and only if $f(x)=g(y)$.

(2) Assume that the condition (1) is satisfied and set $s:=f(x)=g(y)$. Then $$\zeta:=\xi\times_S\psi:Z:=\mathrm{Spec}\,(\kappa(x)\otimes_{\kappa(s)}\kappa(y))\longrightarrow X\times_SY$$ is a homeomorphism of $Z$ onto the subspace $$\zeta(Z)=p^{-1}(x)\cap q^{-1}(y).$$

Proof.This follows from the identity $Z=p^{-1}(x)\times_{(X\times_S Y)}q^{-1}(y)$. $\square$

The proof of the lemma, as you can see from the picture, is just one line, which I failed to comprehend. To be more specific, I don't even know what $p^{-1}(x)\times_{(X\times_SY)}q^{-1}(y)$ is. It seems like a fiber product over the fiber product $X\times_SY$ but then we need two morphisms going into $X\times_SY$ from $p^{-1}(x)$ and $q^{-1}(y)$ to define this and the only morphism I can think of is the inclusion, i.e. $p^{-1}(x)\to X\times_SY$ given by $\subseteq$. Hence why do we even take fiber products over the two by inclusion map? Also I failed to see why this implies the two claims as well.

Anyway, I tried to prove by myself and stuck at the first assertion. In particular, it is not hard to see $p(x)=x, q(z)=y$ implies $f(x)=g(y)$ as the square should commute. Conversely, I don't know why we can assume the inverse fiber is not empty. In other word, what if $p^{-1}(x)$ is empty set? Because if $p^{-1}(x)$ is empty then there cannot be any $z\in X\times_SY$ satisfy $p(z)=x$.

Then look at the second assertion, it sort of make sense, because $p^{-1}(x)\cap q^{-1}(y)$ should be the fiber product of $\{x\}\times_S\{y\}$ and those two points just correspond to $\def\Spec{\operatorname{Spec}}\xi:\Spec \kappa(x)\to X$ and $\psi:\Spec \kappa(y)\to Y$, right? However, I'm not sure how to make it precise.

To summary my questions:

- What is the expression $p^{-1}(x)\times_{(X\times_SY)}q^{-1}(y)$ even means and why is the identity proves the two assertions?
- How do we prove this identity?
- In the attempt of proving assertion 1 above, how do we make sure $p^{-1}(x)$ and $q^{-1}(y)$ are always not empty for $x\in X$ and $y\in Y$?