For each $S$ we will prove the statement for all $p \geq 0$ concurrently. The functor $H_p$ is a sheaf for the fppf topology by Lemma \ref{lemma-free-at-generic-points}. Hence combining Descent, Lemma \ref{descent-lemma-descent-data-sheaves}, More on Morphisms, Lemma \ref{more-morphisms-lemma-separated-locally-quasi-finite-morphisms-fppf-descend} , and Descent, Lemma \ref{descent-lemma-descending-fppf-property-immersion} we see that the question is local for the \'etale topology on $S$. In particular, the question is Zariski local on $S$. \medskip\noindent For $s \in S$ denote $\xi_s$ the unique generic point of the fibre $X_s$. Note that for every $s \in S$ the restriction $\mathcal{F}_s$ of $\mathcal{F}$ is locally free of some rank $p(s) \geq 0$ in some neighbourhood of $\xi_s$. (As $X_s$ is irreducible and smooth this follows from generic flatness for $\mathcal{F}_s$ over $X_s$, see Algebra, Lemma \ref{algebra-lemma-generic-flatness-Noetherian} although this is overkill.) For future reference we note that $$ p(s) = \dim_{\kappa(\xi_s)}( \mathcal{F}_{\xi_s} \otimes_{\mathcal{O}_{X, \xi_s}} \kappa(\xi_s) ). $$ In particular $H_{p(s)}(s)$ is nonempty and $H_q(s)$ is empty if $q \not = p(s)$. \medskip\noindent Let $U \subset X$ be an open subscheme. As $f : X \to S$ is smooth, it is open. It is immediate from (\ref{equation-free-at-generic-points}) that the functor $H_p$ for the pair $(f|_U : U \to f(U), \mathcal{F}|_U)$ and the functor $H_p$ for the pair $(f|_{f^{-1}(f(U))}, \mathcal{F}|_{f^{-1}(f(U))})$ are the same. Hence to prove the existence of $S_p$ over $f(U)$ we may always replace $X$ by $U$. \medskip\noindent Pick $s \in S$. There exists an affine open neighbourhood $U$ of $\xi_s$ such that $\mathcal{F}|_U$ can be generated by at most $p(s)$ elements. By the arguments above we see that in order to prove the statement for $H_{p(s)}$ in an neighbourhood of $s$ we may assume that $\mathcal{F}$ is generated by $p(s)$ elements, i.e., that there exists a surjection $$ u : \mathcal{O}_X^{\oplus p(s)} \longrightarrow \mathcal{F} $$ In this case it is clear that $H_{p(s)}$ is equal to $F_{iso}$ (\ref{equation-iso}) for the map $u$ (this follows immediately from Lemma \ref{lemma-injectivity-map-source-flat-pure} but also from Lemma \ref{lemma-induction-step-fp} after shrinking a bit more so that both $S$ and $X$ are affine.) Thus we may apply Theorem \ref{theorem-flattening-map} to see that $H_{p(s)}$ is representable by a closed immersion in a neighbourhood of $s$. \medskip\noindent The result follows formally from the above. Namely, the arguments above show that locally on $S$ the function $s \mapsto p(s)$ is bounded. Hence we may use induction on $p = \max_{s \in S} p(s)$. The functor $H_p$ is representable by a closed immersion $S_p \to S$ by the above. Replace $S$ by $S \setminus S_p$ which drops the maximum by at least one and we win by induction hypothesis. \medskip\noindent Assume $\mathcal{F}$ is of finite presentation. Then $S_p \to S$ is locally of finite presentation by Lemma \ref{lemma-free-at-generic-points} part (2) combined with Limits, Remark \ref{limits-remark-limit-preserving}. Then we redo the induction argument in the paragraph to see that each $S_p$ is quasi-compact when $S$ is affine: first if $p = \max_{s \in S} p(s)$, then $S_p \subset S$ is closed (see above) hence quasi-compact. Then $U = S \setminus S_p$ is quasi-compact open in $S$ because $S_p \to S$ is a closed immersion of finite presentation (see discussion in Morphisms, Section \ref{morphisms-section-constructible} for example). Then $S_{p - 1} \to U$ is a closed immersion of finite presentation, and so $S_{p - 1}$ is quasi-compact and $U' = S \setminus (S_p \cup S_{p - 1})$ is quasi-compact. And so on.