# Hartshorne III 9.5 confused about base extension.

Hartshorne III Proposition 9.5 states:

Let $f:X\to Y$ be a flat morphism of schemes of finite type over a field $k$. For any point $x\in X$ let $y=f(x)$. Then $$\dim_x(X_y)=\dim_x X-\dim_y Y$$ where for any scheme $X$, by $\dim_x X$ we mean the dimension of the local ring at $\mathcal{O}_{x,X}$.

The proof involves several statements about base change which I am unable to understand. First, making the base change $Y'\to Y$ where $Y'=\text{Spec } \mathcal{O}_{y,Y}$ we get $X'=X\times_Y Y'$ and $f':X'\to Y'$. We lift $x$ to $X'$ and Hartshorne states "the three numbers in question are the same." I do not understand at all why they would be the same, and unfortunately I don't understand base change very well either intuitively or from a technical perspective, so I don't really know how I would go about seeing this.

Later on, a base extension is made to $Y_{\text{red}}$ and again "nothing changes" according to Hartshorne. Also it is mentioned that the fibre $X_y$ does not change under base extension.

Can someone help me understand these statements and why they should be so clear (but aren't)?

For example, if $U\subset Y$ is an open set containing $y$, we can "base extend along $U \to Y$ and get $X_U = X \times_Y U$", but what we really mean is we are restricting the morphism to $f^{-1}(U)$ (this is what $X_U$ is). Of course, this does not change the fiber $X_y$ or the numbers in question, since $U$ is an open neighborhood of $y$ (so we still have a safe 'window' around $y$ to look at dimensions in, and in any case the fiber $X_y$ is ultimately obtained by "restricting to just $y$" -- it doesn't matter if we decide to first pass to a neighborhood of $y$.)
What Hartshorne has done is to first restrict the morphism to Spec of the local ring of $y$. This is like passing to an arbitrarily small neighborhood of $y$, just like in the example above.