hcju/stacksqa huggingface dataset:
By Lemma \ref{lemma-pull-perfect} we see that (1) implies (2). It is immediate that (2) $\Rightarrow$ (3). Since every prime $\mathfrak p$ is contained in a maximal ideal $\mathfrak m$, we can apply Lemma \ref{lemma-pull-perfect} to the map $R_\mathfrak m \to R_\mathfrak p$ to see that (3) implies (2). Applying Lemma \ref{lemma-pull-perfect} to the residue maps $R_\mathfrak p \to \kappa(\mathfrak p)$ and $R_\mathfrak m \to \kappa(\mathfrak m)$ we see that (2) implies (4) and (3) implies (5). \medskip\noindent Assume $R$ is local with maximal ideal $\mathfrak m$ and residue field $\kappa$. We will show that if $H^i(K^\bullet \otimes^\mathbf{L} \kappa) = 0$ for $i < a$ for some $a$, then $K$ is perfect. This will show that (4) implies (2) and (5) implies (3) whence the first part of the lemma. First we apply Lemma \ref{lemma-cut-complex-in-two} with $i = a - 1$ to see that $K^\bullet = \tau_{\leq a - 1}K^\bullet \oplus \tau_{\geq a}K^\bullet$ in $D(R)$ with $\tau_{\geq a}K^\bullet$ perfect of tor-amplitude contained in $[a, \infty]$. To finish we need to show that $\tau_{\leq a - 1}K$ is zero, i.e., that its cohomology groups are zero. If not let $i$ be the largest index such that $M = H^i(\tau_{\leq a - 1}K)$ is not zero. Then $M$ is a finite $R$-module because $\tau_{\leq a - 1}K^\bullet$ is pseudo-coherent (Lemmas \ref{lemma-finite-cohomology} and \ref{lemma-summands-pseudo-coherent}). Thus by Nakayama's lemma (Algebra, Lemma \ref{algebra-lemma-NAK}) we find that $M \otimes_R \kappa$ is nonzero. This implies that $$ H^i((\tau_{\leq a - 1}K^\bullet) \otimes_R^\mathbf{L} \kappa) = H^i(K^\bullet \otimes_R^\mathbf{L} \kappa) $$ is nonzero which is a contradiction. \medskip\noindent Assume the equivalent conditions (2) -- (5) hold and that $K^\bullet$ is bounded below. Say $H^i(K^\bullet) = 0$ for $i < a$. Pick a maximal ideal $\mathfrak m$ of $R$. It suffices to show there exists an $f \in R$, $f \not \in \mathfrak m$ such that $K^\bullet \otimes_R^\mathbf{L} R_f$ is perfect (Lemma \ref{lemma-glue-perfect} and Algebra, Lemma \ref{algebra-lemma-quasi-compact}). This follows from Lemma \ref{lemma-lift-bounded-pseudo-coherent-to-perfect}.
From the final statement of Lemma \ref{lemma-perfect} we see that (2) implies (1).  If (1) holds, then $K$ can be represented by a complex of projective modules $P^i$ with $P^i = 0$ for $i \not \in [a, b]$. Since projective modules are flat (as summands of free modules), we see that $K$ has tor-amplitude in $[a, b]$, see Lemma \ref{lemma-tor-amplitude}. Thus by Lemma \ref{lemma-perfect} we see that (2) holds. \medskip\noindent In conditions (3), (4), (5) the assumed vanishing of ext groups $\Ext^i_R(K, M)$ for $M$ of finite presentation is equivalent to the vanishing for all $R$-modules $M$ by Lemma \ref{lemma-pseudo-coherence-colimit-ext} and Algebra, Lemma \ref{algebra-lemma-module-colimit-fp}. Thus the equivalence of (1), (3), (4), and (5) follows from Lemma \ref{lemma-projective-amplitude}.
We may assume that $K^\bullet$ is a bounded above complex of finite free $B$-modules. In particular, $K^\bullet$ is flat as a complex of $A$-modules and $K^\bullet \otimes_A M = K^\bullet \otimes_A^{\mathbf{L}} M$ for any $A$-module $M$. For every prime $\mathfrak p$ of $A$ the complex $$ K^\bullet \otimes_A \kappa(\mathfrak p) $$ is a bounded above complex of finite free modules over $B \otimes_A \kappa(\mathfrak p)$ with vanishing $H^i$ except for $i \in [a, b]$. As $B \otimes_A \kappa(\mathfrak p)$ has global dimension $d$ we see from Lemma \ref{lemma-finite-gl-dim-tor-dimension} that $K^\bullet \otimes_A \kappa(\mathfrak p)$ has tor amplitude in $[a - d, b]$. Let $\mathfrak q$ be a prime of $B$ lying over $\mathfrak p$. Since $K^\bullet \otimes_A \kappa(\mathfrak p)$ is a bounded above complex of free $B \otimes_A \kappa(\mathfrak p)$-modules we see that \begin{align*} K^\bullet \otimes_B^{\mathbf{L}} \kappa(\mathfrak q) & = K^\bullet \otimes_B \kappa(\mathfrak q) \\ & = (K^\bullet \otimes_A \kappa(\mathfrak p)) \otimes_{B \otimes_A \kappa(\mathfrak p)} \kappa(\mathfrak q) \\ & = (K^\bullet \otimes_A \kappa(\mathfrak p)) \otimes^{\mathbf{L}}_{B \otimes_A \kappa(\mathfrak p)} \kappa(\mathfrak q) \end{align*} Hence the arguments above imply that $H^i(K^\bullet \otimes_B^{\mathbf{L}} \kappa(\mathfrak q)) = 0$ for $i \not \in [a - d, b]$. We conclude by Lemma \ref{lemma-check-perfect-pointwise}.
By (3) we may assume that $K^\bullet$ is a bounded above complex of finite free $B$-modules. We compute \begin{align*} K^\bullet \otimes_B^{\mathbf{L}} \kappa(\mathfrak m_B) & = K^\bullet \otimes_B \kappa(\mathfrak m_B) \\ & = (K^\bullet \otimes_A \kappa(\mathfrak m_A)) \otimes_{B/\mathfrak m_A B} \kappa(\mathfrak m_B) \\ & = (K^\bullet \otimes_A \kappa(\mathfrak m_A)) \otimes^{\mathbf{L}}_{B/\mathfrak m_A B} \kappa(\mathfrak m_B) \end{align*} The first equality because $K^\bullet$ is a bounded above complex of flat $B$-modules. The second equality follows from basic  properties of the tensor product. The third equality holds because $K^\bullet \otimes_A \kappa(\mathfrak m_A) = K^\bullet/ \mathfrak m_A K^\bullet$ is a bounded above complex of flat $B/\mathfrak m_A B$-modules. Since $K^\bullet$ is a bounded above complex of flat $A$-modules by (1), the cohomology modules $H^i$ of the complex $K^\bullet \otimes_A \kappa(\mathfrak m_A)$ are nonzero only for $i \in [a, b]$ by assumption (4). Thus the spectral sequence of Example \ref{example-cohomology-complex-tensored} and the fact that $B/\mathfrak m_AB$ has finite global dimension $d$ (by (2) and Algebra, Proposition \ref{algebra-proposition-regular-finite-gl-dim}) shows that $H^j(K^\bullet \otimes_B^{\mathbf{L}} \kappa(\mathfrak m_B))$ is zero for $j \not \in [a - d, b]$. This finishes the proof by Lemma \ref{lemma-check-perfect-pointwise}.
To see what the statement means, please look at Derived Categories, Definitions \ref{derived-definition-saturated} and \ref{derived-definition-generators}. It was shown in Lemmas \ref{lemma-two-out-of-three-perfect} and \ref{lemma-summands-perfect} that $D_{perf}(R) \subset D(R)$ is a strictly full, saturated, triangulated subcategory of $D(R)$. Of course $R \in D_{perf}(R)$. \medskip\noindent Recall that $\langle R \rangle = \bigcup \langle R \rangle_n$. To finish the proof we will show that if $M \in D_{perf}(R)$ is represented by $$ \ldots \to 0 \to M^a \to M^{a + 1} \to \ldots \to M^b \to 0 \to \ldots $$ with $M^i$ finite projective, then $M \in \langle R \rangle_{b - a + 1}$. The proof is by induction on $b - a$. By definition $\langle R \rangle_1$ contains any finite projective $R$-module placed in any degree; this deals with the base case $b - a = 0$ of the induction. In general, we consider the distinguished triangle $$ M_b[-b] \to M^\bullet \to \sigma_{\leq b - 1}M^\bullet \to M_b[-b + 1] $$ By induction the truncated complex $\sigma_{\leq b - 1}M^\bullet$ is in $\langle R \rangle_{b - a}$ and $M_b[-b]$ is in $\langle R \rangle_1$. Hence $M^\bullet \in \langle R \rangle_{b - a + 1}$ by definition.
Consider the short exact sequence of complexes $$ 0 \to \bigoplus L_n^\bullet \to \bigoplus L_n^\bullet \to L^\bullet \to 0 $$ where the first map is given by $1 - t_n$ in degree $n$ where $t_n : L_n^\bullet \to L_{n + 1}^\bullet$ is the transition map. By Derived Categories, Lemma \ref{derived-lemma-derived-canonical-delta-functor} this is a distinguished triangle in $D(R)$. Apply the homological functor $\Hom_{D(R)}(K, -)$, see Derived Categories, Lemma \ref{derived-lemma-representable-homological}. Thus a long exact cohomology sequence $$ \xymatrix{ & \ldots \ar[r] & \Hom_{D(R)}(K, \colim L^\bullet_n[-1]) \ar[lld] \\ \Hom_{D(R)}(K, \bigoplus L^\bullet_n) \ar[r] & \Hom_{D(R)}(K, \bigoplus L^\bullet_n) \ar[r] & \Hom_{D(R)}(K, \colim L^\bullet_n) \ar[lld] \\ \Hom_{D(R)}(K, \bigoplus L^\bullet_n[1]) \ar[r] & \ldots } $$ Since we have assumed that $\Hom_{D(R)}(K, \bigoplus L^\bullet_n)$ is equal to $\bigoplus \Hom_{D(R)}(K, L^\bullet_n)$ we see that the first map on every row of the diagram is injective (by the explicit description of this map as the sum of the maps induced by $1 - t_n$). Hence we conclude that $\Hom_{D(R)}(K, \colim L^\bullet_n)$ is the cokernel of the first map of the middle row in the diagram above which is what we had to show.
Choose a finite complex $\overline{P}^\bullet$ of finite projective $R/I$-modules representing $K \otimes_R^\mathbf{L} R/I$, see Definition \ref{definition-perfect}. By Lemma \ref{lemma-lift-complex-projectives} there exists a complex $P^\bullet$ of projective $R$-modules representing $K$ such that $\overline{P}^\bullet = P^\bullet/IP^\bullet$. It follows from Nakayama's lemma (Algebra, Lemma \ref{algebra-lemma-NAK}) that $P^\bullet$ is a finite complex of finite projective $R$-modules.
If $n = 1$, then $K$ is a direct summand in $D(R)$ of a bounded complex $P^\bullet$ whose terms are finite free $R$-modules and whose differentials are zero. Thus it suffices to show any morphism $f : P^\bullet \to K_1$ in $D(R)$ with $H^i(f) = 0$ for all $i$ is zero. Since $P^\bullet$ is a finite direct sum $P^\bullet = \bigoplus R[m_j]$ it suffices to show any morphism $g : R[m] \to K_1$ with $H^{-m}(g) = 0$ in $D(R)$ is zero. This follows from the fact that $\Hom_{D(R)}(R[-m], K) = H^m(K)$. \medskip\noindent For $n > 1$ we proceed by induction on $n$. Namely, we know that $K$ is a summand in $D(R)$ of an object $P$ which sits in a distinguished triangle $$ P' \xrightarrow{i} P \xrightarrow{p} P'' \to P'[1] $$ with $P' \in \langle R \rangle_1$ and $P'' \in \langle R \rangle_{n - 1}$. As above we may replace $K$ by $P$ and assume that we have $$ P \xrightarrow{f_1} K_1 \xrightarrow{f_2} K_2 \xrightarrow{f_3} \ldots \xrightarrow{f_n} K_n $$ in $D(R)$ with $f_j$ zero on cohomology. By the case $n = 1$ the composition $f_1 \circ i$ is zero. Hence by Derived Categories, Lemma \ref{derived-lemma-representable-homological} we can find a morphism $h : P'' \to K_1$ such that $f_1 = h \circ p$. Observe that $f_2 \circ h$ is zero on cohomology. Hence by induction we find that $f_n \circ \ldots \circ f_2 \circ h = 0$ which implies $f_n \circ \ldots \circ f_1 =  f_n \circ \ldots \circ f_2 \circ h \circ p = 0$ as desired.
Assume $D_{perf}(R) = \langle R \rangle_n$ for some $n \geq 1$. For any finite $R$-module $M$ we can choose a complex $$ P = ( P^{-n - 1} \xrightarrow{d^{-n - 1}} P^{-n} \xrightarrow{d^{-n}} P^{-n + 1} \xrightarrow{d^1} \ldots \xrightarrow{d^{-1}} P^0) $$ of finite free $R$-modules with $H^i(P) = 0$ for $i = -n, \ldots, - 1$ and $M \cong \Coker(d^{-1})$. Note that $P$ is in $D_{perf}(R)$. For any $R$-module $N$ we can compute $\Ext^n_R(M, N)$ the finite free resolution $P$ of $M$, see Algebra, Section \ref{algebra-section-ext} and compare with Derived Categories, Section \ref{derived-section-ext}. In particular, the sequence above defines an element $$ \xi \in \Ext^n_R(\Coker(d^{-1}), \Coker(d^{-n - 1})) = \Ext^n_R(M, \Coker(d^{-n - 1})) $$ and for any element $\overline{\xi}$ in $\Ext^n_R(M, N)$ there is a $R$-module map $\varphi : \Coker(d^{-n - 1}) \to N$ such that $\varphi$ maps $\xi$ to $\overline{\xi}$. For $j = 1, \ldots, n - 1$ consider the complexes $$ K_j = (\Coker(d^{-n - 1}) \to P^{-n + 1} \to \ldots \to P^{-j}) $$ with $\Coker(d^{-n - 1})$ in degree $-n$ and $P^t$ in degree $t$. We also set $K_n = \Coker(d^{-n - 1})[n]$. Then we have maps $$ P \to K_1 \to K_2 \to \ldots \to K_n $$ which induce vanishing maps on cohomology. By Lemma \ref{lemma-ghost-lemma} since $P \in D_{perf}(R) = \langle R \rangle_n$ we find that the composition of this maps is zero in $D(R)$. Since $\Hom_{D(R)}(P, K_n) = \Hom_{K(R)}(P, K_n)$ by Derived Categories, Lemma \ref{derived-lemma-morphisms-from-projective-complex} we conclude $\xi = 0$. Hence $\Ext^n_R(M, N) = 0$ for all $R$-modules $N$, see discussion above. It follows that $M$ has projective dimension $\leq n - 1$ by Algebra, Lemma \ref{algebra-lemma-projective-dimension-ext}. Since this holds for all finite $R$-modules $M$ we conclude that $R$ has finite global dimension, see Algebra, Lemma \ref{algebra-lemma-finite-gl-dim}. We finally conclude by Algebra, Lemma \ref{algebra-lemma-finite-gl-dim-finite-dim-regular}.
Let $K^\bullet$ be a bounded above complex representing $K$, say $K^i = 0$ for $i \geq n + 1$. After replacing $K^\bullet$ by $\tau_{\geq k + 1}K^\bullet$ we may assume $K^i = 0$ for $i \leq k$. Then we may use the distinguished triangle $$ K^n[-n] \to K^\bullet \to \sigma_{\leq n - 1}K^\bullet $$ to see it suffices to prove the lemma for $K^n[-n]$ and $\sigma_{\leq n - 1}K^\bullet$. By induction on $n$, we conclude that it suffices to prove the lemma in case $K$ is represented by the complex $M[-m]$ for some $R$-module $M$ and some $m \geq k + 1$. Since $R$ has global dimension $d$ by Algebra, Lemma \ref{algebra-lemma-finite-gl-dim-finite-dim-regular} we see that $M$ has a projective resolution $0 \to P_d \to \ldots \to P_0 \to M \to 0$. Then the complex $P^\bullet$ having $P_i$ in degree $m - i$ is a bounded complex of projectives representing $M[-m]$. On the other hand, we can choose a complex $L^\bullet$ representing $L$ with $L^i = 0$ for $i \geq k - d  + 1$. Hence any map of complexes $P^\bullet \to L^\bullet$ is zero. This implies the lemma by Derived Categories, Lemma \ref{derived-lemma-morphisms-from-projective-complex}.
The vanishing of cohomology shows that we have a distinguished triangle $$ \tau_{\leq k - d + 1}K \to K \to \tau_{\geq k + 1}K \to (\tau_{\leq k - d + 1}K)[1] $$ By Derived Categories, Lemma \ref{derived-lemma-split} it suffices to show that the third arrow is zero. Thus it suffices to show that $\Hom_{D(R)}(\tau_{\geq k + 1}K, (\tau_{\leq k - d + 1}K)[1]) = 0$ which follows from Lemma \ref{lemma-ext-regular}.
If $\alpha : R[x_1, \ldots, x_n] \to A$ and $\beta : R[y_1, \ldots, y_m] \to A$ are presentations. Choose $f_j \in R[x_1, \ldots, x_n]$ with $\alpha(f_j) = \beta(y_j)$ and $g_i \in R[y_1, \ldots, y_m]$ with $\beta(g_i) = \alpha(x_i)$. Then we get a commutative diagram $$ \xymatrix{ R[x_1, \ldots, x_n, y_1, \ldots, y_m] \ar[d]^{x_i \mapsto g_i} \ar[rr]_-{y_j \mapsto f_j} & & R[x_1, \ldots, x_n] \ar[d] \\ R[y_1, \ldots, y_m] \ar[rr] & & A } $$ Hence the equivalence of (1) and (2) follows by applying Algebra, Lemmas \ref{algebra-lemma-finitely-presented-over-subring} and \ref{algebra-lemma-finite-finitely-presented-extension}. The equivalence of (2) and (3) follows by choosing a presentation $A' = R[x_1, \ldots, x_n]/(f_1, \ldots, f_m)$ and using Algebra, Lemma \ref{algebra-lemma-finite-finitely-presented-extension} to show that $M$ is finitely presented as $A'$-module if and only if $M$ is finitely presented as a $R[x_1, \ldots, x_n]$-module.
Choose a surjection $R[x_1, \ldots, x_n] \to A$. Choose $y_1, \ldots, y_m \in B$ which generate $B$ over $A$. As $A \to B$ is finite each $y_i$ satisfies a monic equation with coefficients in $A$. Hence we can find monic polynomials $P_j(T) \in R[x_1, \ldots, x_n][T]$ such that $P_j(y_j) = 0$ in $B$. Then we get a commutative diagram $$ \xymatrix{ R[x_1, \ldots, x_n] \ar[d] \ar[r] & R[x_1, \ldots, x_n, y_1, \ldots, y_m]/(P_j(y_j)) \ar[d] \\ A \ar[r] & B } $$ Since the top arrow is a finite and finitely presented ring map we conclude by Algebra, Lemma \ref{algebra-lemma-finite-finitely-presented-extension} and the definition.
The implication (2) $\Rightarrow$ (1) is in Lemma \ref{lemma-localize-relative-finite-presentation}. Assume (1). Write $1 = \sum f_ig_i$ in $A$. Choose a surjection $R[x_1, \ldots, x_n, y_1, \ldots, y_r, z_1, \ldots, z_r] \to A$. such that $y_i$ maps to $f_i$ and $z_i$ maps to $g_i$. Then we see that there exists a surjection $$ P = R[x_1, \ldots, x_n, y_1, \ldots, y_r, z_1, \ldots, z_r]/(\sum y_iz_i - 1) \longrightarrow A. $$ By Lemma \ref{lemma-relatively-finitely-presented} we see that $M_{f_i}$ is a finitely presented $A_{f_i}$-module, hence by Algebra, Lemma \ref{algebra-lemma-cover} we see that $M$ is a finitely presented $A$-module. Hence $M$ is a finite $P$-module (with $P$ as above). Choose a surjection $P^{\oplus t} \to M$. We have to show that the kernel $K$ of this map is a finite $P$-module. Since $P_{y_i}$ surjects onto $A_{f_i}$ we see by Lemma \ref{lemma-relatively-finitely-presented} and Algebra, Lemma \ref{algebra-lemma-extension} that the localization $K_{y_i}$ is a finitely generated $P_{y_i}$-module. Choose elements $k_{i, j} \in K$, $i = 1, \ldots, r$, $j = 1, \ldots, s_i$ such that the images of $k_{i, j}$ in $K_{y_i}$ generate. Set $K' \subset K$ equal to the $P$-module generated by the elements $k_{i, j}$. Then $K/K'$ is a module whose localization at $y_i$ is zero for all $i$. Since $(y_1, \ldots, y_r) = P$ we see that $K/K' = 0$ as desired.
Choose a K-flat resolution $P^\bullet \to K^\bullet$ over $R$ such that $P^n$ is a flat $R$-module for all $n$, see Lemma \ref{lemma-K-flat-resolution}. Then $P^\bullet \otimes_R R[x]$ is a K-flat complex of $R[x]$-modules whose terms are flat $R[x]$-modules, see Lemma \ref{lemma-base-change-K-flat} and Algebra, Lemma \ref{algebra-lemma-flat-base-change}. In particular $x : P^n \otimes_R R[x] \to P^n \otimes_R R[x]$ is injective with cokernel isomorphic to $P^n$. Thus $$ P^\bullet \otimes_R R[x] \xrightarrow{x} P^\bullet \otimes_R R[x] $$ is a double complex of $R[x]$-modules whose associated total complex is quasi-isomorphic to $P^\bullet$ and hence $K^\bullet$. Moreover, this associated total complex is a K-flat complex of $R[x]$-modules for example by Lemma \ref{lemma-tensor-product-K-flat} or by Lemma \ref{lemma-K-flat-two-out-of-three}. Hence \begin{align*} K^\bullet \otimes_{R[x]}^{\mathbf{L}} R & \cong \text{Tot}(P^\bullet \otimes_R R[x] \xrightarrow{x} P^\bullet \otimes_R R[x]) \otimes_{R[x]} R = \text{Tot}(P^\bullet \xrightarrow{0} P^\bullet) \\ & = P^\bullet \oplus P^\bullet[1] \cong K^\bullet \oplus K^\bullet[1] \end{align*} as desired.
This is a special case of Lemma \ref{lemma-finite-push-pseudo-coherent}. We also prove it in another way as follows. \medskip\noindent Note that $0 \to R[x] \to R[x] \to R \to 0$ is exact. Hence $R$ is pseudo-coherent as an $R[x]$-module. Thus one implication of the lemma follows from Lemma \ref{lemma-finite-push-pseudo-coherent}. To prove the other implication, assume that $K^\bullet$ is $m$-pseudo-coherent as a complex of $R[x]$-modules. By Lemma \ref{lemma-pull-pseudo-coherent} we see that $K^\bullet \otimes^{\mathbf{L}}_{R[x]} R$ is $m$-pseudo-coherent as a complex of $R$-modules. By Lemma \ref{lemma-pull-push} we see that $K^\bullet \oplus K^\bullet[1]$ is $m$-pseudo-coherent as a complex of $R$-modules. Finally, we conclude that $K^\bullet$ is $m$-pseudo-coherent as a complex of $R$-modules from Lemma \ref{lemma-summands-pseudo-coherent}.
If $\alpha : R[x_1, \ldots, x_n] \to A$ and $\beta : R[y_1, \ldots, y_m] \to A$ are presentations. Choose $f_j \in R[x_1, \ldots, x_n]$ with $\alpha(f_j) = \beta(y_j)$ and $g_i \in R[y_1, \ldots, y_m]$ with $\beta(g_i) = \alpha(x_i)$. Then we get a commutative diagram $$ \xymatrix{ R[x_1, \ldots, x_n, y_1, \ldots, y_m] \ar[d]^{x_i \mapsto g_i} \ar[rr]_-{y_j \mapsto f_j} & & R[x_1, \ldots, x_n] \ar[d] \\ R[y_1, \ldots, y_m] \ar[rr] & & A } $$ After a change of coordinates the ring homomorphism $R[x_1, \ldots, x_n, y_1, \ldots, y_m] \to R[x_1, \ldots, x_n]$ is isomorphic to the ring homomorphism which maps each $y_i$ to zero. Similarly for the left vertical map in the diagram. Hence, by induction on the number of variables this lemma follows from Lemma \ref{lemma-add-variable-pseudo-coherent}. The pseudo-coherent case follows from this and Lemma \ref{lemma-pseudo-coherent}.
Choose a surjection $R[x_1, \ldots, x_n] \to A$. Choose $y_1, \ldots, y_m \in B$ which generate $B$ over $A$. As $A \to B$ is finite each $y_i$ satisfies a monic equation with coefficients in $A$. Hence we can find monic polynomials $P_j(T) \in R[x_1, \ldots, x_n][T]$ such that $P_j(y_j) = 0$ in $B$. Then we get a commutative diagram $$ \xymatrix{ & R[x_1, \ldots, x_n, y_1, \ldots, y_m] \ar[d] \\ R[x_1, \ldots, x_n] \ar[d] \ar[r] & R[x_1, \ldots, x_n, y_1, \ldots, y_m]/(P_j(y_j)) \ar[d] \\ A \ar[r] & B } $$ The top horizontal arrow and the top right vertical arrow satisfy the assumptions of Lemma \ref{lemma-finite-push-pseudo-coherent}. Hence $K^\bullet$ is $m$-pseudo-coherent (resp.\ pseudo-coherent) as a complex of $R[x_1, \ldots, x_n]$-modules if and only if $K^\bullet$ is $m$-pseudo-coherent (resp.\ pseudo-coherent) as a complex of $R[x_1, \ldots, x_n, y_1, \ldots, y_m]$-modules.
First we show that $K^\bullet$ is $m$-pseudo-coherent relative to $R$. Namely, suppose $R_f[x_1, \ldots, x_n] \to A$ is surjective. Write $R_f = R[x_0]/(fx_0 - 1)$. Then $R[x_0, x_1, \ldots, x_n] \to A$ is surjective, and $R_f[x_1, \ldots, x_n]$ is pseudo-coherent as an $R[x_0, \ldots, x_n]$-module. Hence by Lemma \ref{lemma-finite-push-pseudo-coherent} we see that $K^\bullet$ is $m$-pseudo-coherent as a complex of $R[x_0, x_1, \ldots, x_n]$-modules. \medskip\noindent Choose an element $g' \in R[x_0, x_1, \ldots, x_n]$ which maps to $g \in A$. By Lemma \ref{lemma-pull-pseudo-coherent} we see that \begin{align*} K^\bullet \otimes_{R[x_0, x_1, \ldots, x_n]}^{\mathbf{L}} R[x_0, x_1, \ldots, x_n, \frac{1}{g'}] & = K^\bullet \otimes_{R[x_0, x_1, \ldots, x_n]} R[x_0, x_1, \ldots, x_n, \frac{1}{g'}] \\ & = K^\bullet \otimes_A A_f \end{align*} is $m$-pseudo-coherent as a complex of $R[x_0, x_1, \ldots, x_n, \frac{1}{g'}]$-modules. write $$ R[x_0, x_1, \ldots, x_n, \frac{1}{g'}] = R[x_0, \ldots, x_n, x_{n + 1}]/(x_{n + 1}g' - 1). $$ As $R[x_0, x_1, \ldots, x_n, \frac{1}{g'}]$ is pseudo-coherent as a $R[x_0, \ldots, x_n, x_{n + 1}]$-module we conclude (see Lemma \ref{lemma-finite-push-pseudo-coherent}) that $K^\bullet \otimes_A A_g$ is $m$-pseudo-coherent as a complex of $R[x_0, \ldots, x_n, x_{n + 1}]$-modules as desired.
Choose a surjection $R[x_1, \ldots, x_n] \to A$. Note that $$ K^\bullet \otimes_A^{\mathbf{L}} A' = K^\bullet \otimes_R^{\mathbf{L}} R' = K^\bullet \otimes_{R[x_1, \ldots, x_n]}^{\mathbf{L}} R'[x_1, \ldots, x_n] $$ by Lemma \ref{lemma-base-change-comparison} applied twice. Hence we win by Lemma \ref{lemma-pull-pseudo-coherent}.
Choose a surjection $A[y_1, \ldots, y_m] \to B$. Choose a surjection $R[x_1, \ldots, x_n] \to A$. Combined we get a surjection $R[x_1, \ldots, x_n, y_1, \ldots y_m] \to B$. Choose a resolution $E^\bullet \to B$ of $B$ by a complex of finite free $A[y_1, \ldots, y_n]$-modules (which is possible by our assumption on the ring map $A \to B$). We may assume that $K^\bullet$ is a bounded above complex of flat $A$-modules. Then \begin{align*} K^\bullet \otimes_A^{\mathbf{L}} B & = \text{Tot}(K^\bullet \otimes_A B[0]) \\ & = \text{Tot}(K^\bullet \otimes_A A[y_1, \ldots, y_m] \otimes_{A[y_1, \ldots, y_m]} B[0]) \\ & \cong \text{Tot}\left( (K^\bullet \otimes_A A[y_1, \ldots, y_m]) \otimes_{A[y_1, \ldots, y_m]} E^\bullet \right) \\ & = \text{Tot}(K^\bullet \otimes_A E^\bullet) \end{align*} in $D(A[y_1, \ldots, y_m])$. The quasi-isomorphism $\cong$ comes from an application of Lemma \ref{lemma-derived-tor-quasi-isomorphism}. Thus we have to show that $\text{Tot}(K^\bullet \otimes_A E^\bullet)$ is $m$-pseudo-coherent as a complex of $R[x_1, \ldots, x_n, y_1, \ldots y_m]$-modules. Note that $\text{Tot}(K^\bullet \otimes_A E^\bullet)$ has a filtration by subcomplexes with successive quotients the complexes $K^\bullet \otimes_A E^i[-i]$. Note that for $i \ll 0$ the complexes $K^\bullet \otimes_A E^i[-i]$ have zero cohomology in degrees $\leq m$ and hence are $m$-pseudo-coherent (over any ring). Hence, applying Lemma \ref{lemma-cone-relatively-pseudo-coherent} and induction, it suffices to show that $K^\bullet \otimes_A E^i[-i]$ is pseudo-coherent relative to $R$ for all $i$. Note that $E^i = 0$ for $i > 0$. Since also $E^i$ is finite free this reduces to proving that $K^\bullet \otimes_A A[y_1, \ldots, y_m]$ is $m$-pseudo-coherent relative to $R$ which follows from Lemma \ref{lemma-base-change-relative-pseudo-coherent} for instance.