Suppose $f\colon X \to Y $ is a morphism of schemes. We can define a function on the topological space $Y$ by sending $y\in Y$ to the dimension of the fiber of $f$ over $y$.



> 
> When is this function upper semi-continuous?
> 
> 
> 


I have the following "concrete" application in mind. If an algebraic group $G$ acts on a scheme $X$, I'm pretty sure the stabilizer dimension is an upper semi-continuous function on $X$ (i.e. it can jump up on closed sub-schemes), but I don't know a proof. The stabilizers of points are the fibers of the map $\text{Stab}\to X$ in the following Cartesian square:
\begin{equation}
\require{AMScd}
\begin{CD}
\text{Stab} @>>> G \times X \\
@VVV @VV{\alpha}V \\
X @>{\Delta}>> X \times X.
\end{CD}
\end{equation}
where $\alpha\colon G\times X\to X\times X $ is given by $(g,x) \mapsto (g\cdot x,x)$, and $\Delta\colon X\to X\times X $ is the diagonal map $x\mapsto (x,x)$. It would be nice to have a condition satisfied by $\alpha\colon G\times X \to X\times X$ that would guarantee the upper semi-continuity of fiber dimension.



When is fiber dimension upper semi-continuous?
**Theorem** (EGA IV 13.1.3): Let $f \colon X \to Y$ be a morphism of schemes, locally of finite type. Then
$$x \mapsto \dim\_x(X\_{f(x)})$$
is upper semi-continuous.


**Corollary** (Chevalley's upper semi-continuous theorem, EGA IV 13.1.5): Let $f \colon X \to Y$ be proper, then:
$$y \mapsto \dim(X\_y)$$
is upper semi-continuous.


**Corollary** (SGA3, ??): Let $X/Y$ be a group scheme, locally of finite type. Then
$$y \mapsto \dim(X\_y)$$
is upper semi-continuous.


*Proof:* The dimension of a group scheme over a field is the same as the dimension at the identity. Thus the function
$$y \mapsto \dim(X\_y)$$
is the composition of the continuous function $y \to e(y)$ and the upper semi-continuous function $x \mapsto \dim\_x(X\_{f(x)})$.


Concerning your application: The fiber dimensions of the stabilizer group scheme Stab/*X* is upper semi-continuous, but the "diagonal" $G \times X \to X \times X$ does not always have this property (unless it is proper, i.e., "$G$ acts properly").


