This lemma is a generalization of More on Algebra, Lemma \ref{more-algebra-lemma-blowup-module}; we urge the reader to read that proof first. Choose a surjection $S^{\oplus n} \to M$, which is possible by (1). Choose a finite submodule $K \subset \Ker(S^{\oplus n} \to M)$ such that $S^{\oplus n}/K \to M$ becomes an isomorphism after inverting $f$. This is possible by (4). Set $M_1 = S^{\oplus n}/K$ and suppose we can prove the lemma for $M_1$. Say $I \subset R$ is the corresponding ideal. Then for $a \in I$ the map $$ M_1' = (M_1 \otimes_R R')/a\text{-power torsion} \longrightarrow M' = (M \otimes_R R')/a\text{-power torsion} $$ is surjective. It is also an isomorphism after inverting $a$ in $R'$ as $R'_a = R_f$, see Algebra, Lemma \ref{algebra-lemma-blowup-in-principal}. But $a$ is a nonzerodivisor on $M'_1$, whence the displayed map is an isomorphism. Thus it suffices to prove the lemma in case $M$ is a finitely presented $S$-module. \medskip\noindent Assume $M$ is a finitely presented $S$-module satisfying (3). Then $J = \text{Fit}_r(M) \subset S$ is a finitely generated ideal. By Lemma \ref{lemma-fibres-irreducible-flat-projective-nonnoetherian} we can write $S$ as a direct summand of a free $R$-module: $\bigoplus_{\alpha \in A} R = S \oplus C$. For any element $h \in S$ writing $h = \sum a_\alpha$ in the decomposition above, we say that the $a_\alpha$ are the coefficients of $h$. Let $I' \subset R$ be the ideal of coefficients of elements of $J$. Multiplication by an element of $S$ defines an $R$-linear map $S \to S$, hence $I'$ is generated by the coefficients of the generators of $J$, i.e., $I'$ is a finitely generated ideal. We claim that $I = fI'$ works. \medskip\noindent We first check that $V(f) = V(I)$. The inclusion $V(f) \subset V(I)$ is clear. Conversely, if $f \not \in \mathfrak p$, then $\mathfrak q =  \mathfrak p S$ is not an element of $V(J)$ by property (5) and More on Algebra, Lemma \ref{more-algebra-lemma-fitting-ideal-generate-locally}. Hence there is an element of $J$ which does not map to zero in $S \otimes_R \kappa(\mathfrak p)$. Thus there exists an element of $I'$ which is not contained in $\mathfrak p$, so $\mathfrak p \not \in V(fI') = V(I)$. \medskip\noindent Let $a \in I$ and set $R' = R[\frac{I}{a}]$. We may write $a = fa'$ for some $a' \in I'$. By Algebra, Lemmas \ref{algebra-lemma-affine-blowup} and \ref{algebra-lemma-blowup-add-principal} we see that $I' R' = a'R'$ and $a'$ is a nonzerodivisor in $R'$. Set $S' = S \otimes_S R'$. Every element $g$ of $JS' = \text{Fit}_r(M \otimes_S S')$ can be written as $g = \sum_\alpha c_\alpha$ for some $c_\alpha \in I'R'$. Since $I'R' = a'R'$ we can write $c_\alpha = a'c'_\alpha$ for some $c'_\alpha \in R'$ and $g = (\sum c'_\alpha)a' = g' a'$ in $S'$. Moreover, there is an $g_0 \in J$ such that $a' = c_\alpha$ for some $\alpha$. For this element we have $g_0 = g'_0 a'$ in $S'$ where $g'_0$ is a unit in $S'$. Let $\mathfrak p' \subset R'$ be a prime ideal and $\mathfrak q' = \mathfrak p'S'$. By the above we see that $JS'_{\mathfrak q'}$ is the principal ideal generated by the nonzerodivisor $a'$. It follows from More on Algebra, Lemma \ref{more-algebra-lemma-principal-fitting-ideal} that $M'_{\mathfrak q'}$ can be generated by $r$ elements. Since $M'$ is finite, there exist $m_1, \ldots, m_r \in M'$ and $g \in S'$, $g \not \in \mathfrak q'$ such that the corresponding map $(S')^{\oplus r} \to M'$ becomes surjective after inverting $g$. \medskip\noindent Finally, consider the ideal $J' = \text{Fit}_{k - 1}(M')$. Note that $J'S'_g$ is generated by the coefficients of relations between $m_1, \ldots, m_r$ (compatibility of Fitting ideal with base change). Thus it suffices to show that $J' = 0$, see More on Algebra, Lemma \ref{more-algebra-lemma-fitting-ideal-finite-locally-free}. Since $R'_a = R_f$ (Algebra, Lemma \ref{algebra-lemma-blowup-in-principal}) and $M'_a = M_f$ we see from (5) that $J'_a$ maps to zero in $S_{\mathfrak q''}$ for any prime $\mathfrak q'' \subset S'$ of the form $\mathfrak q'' = \mathfrak p''S'$ where $\mathfrak p'' \subset R'_a$. Since $S'_a \subset \prod_{\mathfrak q''\text{ as above}} S'_{\mathfrak q''}$ (as $(S'_a)_{\mathfrak p''} \subset S'_{\mathfrak q''}$ by Lemma \ref{lemma-base-change-universally-flat}) we see that $J'R'_a = 0$. Since $a$ is a nonzerodivisor in $R'$ we conclude that $J' = 0$ and we win.