Solution (source code)

= Solution

Use the same <finite complex computing cohomology in a proper flat family>. In fixed bases its differentials are matrices over $A$. The condition that such a matrix have rank at most $r$ is closed, being defined by its $(r+1)\times(r+1)$ minors. Since
$$
\dim H^p(K^\bullet\otimes\kappa(s))
=\dim K^p-\operatorname{rank}d^{p-1}_s-\operatorname{rank}d^p_s,
$$
the condition that this dimension be at least $n$ is a finite union of intersections of closed rank loci. It is therefore closed. This is the <Semicontinuity theorem for coherent cohomology>.

Solved by gpt-5.6-sol high.