hcju/stacksqa huggingface dataset:
Choose a K-flat complex $K^\bullet$ representing $K$, and a K-injective complex $I^\bullet$ representing $L$, and choose any complex $M^\bullet$ representing $M$. Choose a quasi-isomorphism $\text{Tot}(K^\bullet \otimes_R I^\bullet) \to J^\bullet$ where $J^\bullet$ is K-injective. Then we use the map $$ \text{Tot}\left( K^\bullet \otimes_R \Hom^\bullet(M^\bullet, I^\bullet) \right) \to \Hom^\bullet(M^\bullet, \text{Tot}(K^\bullet \otimes_R I^\bullet)) \to \Hom^\bullet(M^\bullet, J^\bullet) $$ where the first map is the map from Lemma \ref{lemma-diagonal-better}.
This is a special case of Lemma \ref{lemma-internal-hom-diagonal-better} but we will also prove it directly. Choose a K-flat complex $K^\bullet$ representing $K$ and any complex $L^\bullet$ representing $L$. Choose a quasi-isomorphism $\text{Tot}(K^\bullet \otimes_R L^\bullet) \to J^\bullet$ where $J^\bullet$ is K-injective. Then we use the map $$ K^\bullet \to \Hom^\bullet(L^\bullet, \text{Tot}(K^\bullet \otimes_R L^\bullet)) \to \Hom^\bullet(L^\bullet, J^\bullet) $$ where the first map is the map from Lemma \ref{lemma-diagonal}.
It is clear that (1) implies (2), see Lemmas \ref{lemma-pseudo-coherent} and \ref{lemma-tor-amplitude}. Assume (2) holds and that $K^\bullet$ has tor-amplitude in $[a, b]$. In particular, $H^i(K^\bullet) = 0$ for $i > b$. Choose a complex $F^\bullet$ of finite free $R$-modules with $F^i = 0$ for $i > b$ and a quasi-isomorphism $F^\bullet \to K^\bullet$ (Lemma \ref{lemma-pseudo-coherent}). Set $E^\bullet = \tau_{\geq a}F^\bullet$. Note that $E^i$ is finite free except $E^a$ which is a finitely presented $R$-module. By Lemma \ref{lemma-last-one-flat} $E^a$ is flat. Hence by Algebra, Lemma \ref{algebra-lemma-finite-projective} we see that $E^a$ is finite projective.
Assume (2). Then the complex $E^\bullet$ with $E^{-i} = F_i$ is quasi-isomorphic to $M[0]$. Hence $M$ is perfect. Conversely, assume (1). By Lemmas \ref{lemma-perfect} and \ref{lemma-n-pseudo-module} we can find resolution $E^\bullet \to M$ with $E^{-i}$ a finite free $R$-module. By Lemma \ref{lemma-last-one-flat} we see that $F_d = \Coker(E^{d - 1} \to E^d)$ is flat for some $d$ sufficiently large. By Algebra, Lemma \ref{algebra-lemma-finite-projective} we see that $F_d$ is finite projective. Hence $$ 0 \to F_d \to E^{-d+1} \to \ldots \to E^0 \to M \to 0 $$ is the desired resolution.
By Lemma \ref{lemma-perfect-module} the assumption implies that $M$ has a finite resolution $F_\bullet$ by finite projective $R$-modules. As $A \to B$ is flat the complex $F_\bullet \otimes_A B$ is a finite length resolution of $M \otimes_A B$ by finite projective modules over $B$. Hence $M \otimes_A B$ is perfect.
By Algebra, Lemma \ref{algebra-lemma-finite-gl-dim-finite-dim-regular} the assumption on $R$ means that $R$ has finite global dimension. Hence every module has finite tor dimension, see Lemma \ref{lemma-finite-gl-dim-tor-dimension}. On the other hand, as $R$ is Noetherian, a module is pseudo-coherent if and only if it is finite, see Lemma \ref{lemma-Noetherian-pseudo-coherent}. This proves part (1). \medskip\noindent Let $K^\bullet$ be a complex of $R$-modules. If $K^\bullet$ is perfect, then it is in $D^b(R)$ and it is quasi-isomorphic to a finite complex of finite projective $R$-modules so certainly each $H^i(K^\bullet)$ is a finite $R$-module (as $R$ is Noetherian). Conversely, suppose that $K^\bullet$ is in $D^b(R)$ and each $H^i(K^\bullet)$ is a finite $R$-module. Then by (1) each $H^i(K^\bullet)$ is a perfect $R$-module, whence $K^\bullet$ is perfect by Lemma \ref{lemma-cohomology-perfect}
We can represent $K$ by a complex $K^\bullet$ of finite projective $A$-modules. By Lemma \ref{lemma-RHom-out-of-projective} the object $K^\vee$ is represented by the complex $E^\bullet = \Hom^\bullet(K^\bullet, A)$. Note that $E^n = \Hom_A(K^{-n}, A)$ and the differentials of $E^\bullet$ are the transpose of the differentials of $K^\bullet$ up to sign. Observe that $E^\bullet$ is the left dual of $K^\bullet$ in the symmetric monoidal category of complexes of $R$-modules, see Lemma \ref{lemma-left-dual-complex}. There is a canonical map $$ K^\bullet = \text{Tot}(\Hom^\bullet(A, A) \otimes_A K^\bullet) \longrightarrow \Hom^\bullet(\Hom^\bullet(K^\bullet, A), A) $$ which up to sign uses the evaluation map in each degree, see Lemma \ref{lemma-evaluate-and-more}. (For sign rules see Section \ref{section-sign-rules}.) Thus this map defines a canonical isomorphism $(K^\vee)^\vee \cong K$ as the double dual of a finite projective module is itself. \medskip\noindent The second equality follows from the first by Lemma \ref{lemma-internal-hom} and Derived Categories, Lemma \ref{derived-lemma-morphisms-from-projective-complex} as well as the definition of Ext groups, see Derived Categories, Section \ref{derived-section-ext}. Let $L^\bullet$ be a complex of $A$-modules representing $L$. By Section \ref{section-sign-rules} item (\ref{item-compatible}) there is a canonical isomorphism $$ \text{Tot}(L^\bullet \otimes_A E^\bullet) \longrightarrow \Hom^\bullet(K^\bullet, L^\bullet) $$ of complexes of $A$-modules. This proves the first displayed equality and the proof is complete.
By Lemma \ref{lemma-dual-perfect-complex} we have $R\lim E \otimes^\mathbf{L}_A K_n^\vee = R\lim R\Hom_A(K_n, E)$ which fits into the distinguished triangle $$ R\lim R\Hom_A(K_n, E) \to \prod R\Hom_A(K_n, E) \to \prod R\Hom_A(K_n, E) $$ Because $K$ similarly fits into the distinguished triangle $\bigoplus K_n \to \bigoplus K_n \to K$ it suffices to show that $\prod R\Hom_A(K_n, E) = R\Hom_A(\bigoplus K_n, E)$. This is a formal consequence of (\ref{equation-internal-hom}) and the fact that derived tensor product commutes with direct sums.
We will use the results of Algebra, Lemmas \ref{algebra-lemma-module-map-property-in-colimit} and \ref{algebra-lemma-colimit-category-fp-modules} without further mention. These lemmas in particular say that the category of finitely presented $R$-modules is the colimit of the categories of finitely presented $R_i$-modules. Since finite projective modules can be characterized as summands of finite free modules (Algebra, Lemma \ref{algebra-lemma-finite-projective}) we see that the same is true for the category of finite projective modules. This proves (1) by our definition of perfect objects of $D(R)$. \medskip\noindent To prove (2) we may represent $K_0$ by a bounded complex $K_0^\bullet$ of finite projective $R_0$-modules. We may represent $L_0$ by a K-flat complex $L_0^\bullet$ (Lemma \ref{lemma-K-flat-resolution}). Then we have $$ \Hom_{D(R)}(K_0 \otimes_{R_0}^\mathbf{L} R, L_0 \otimes_{R_0}^\mathbf{L} R) = \Hom_{K(R)}(K_0^\bullet \otimes_{R_0} R, L_0^\bullet \otimes_{R_0} R) $$ by Derived Categories, Lemma \ref{derived-lemma-morphisms-from-projective-complex}. Similarly for the $\Hom$ with $R$ replaced by $R_i$. Since in the right hand side only a finite number of terms are involved, since $$ \Hom_R(K_0^p \otimes_{R_0} R, L_0^q \otimes_{R_0} R) = \colim_{i \geq 0} \Hom_{R_i}(K_0^p \otimes_{R_0} R_i, L_0^q \otimes_{R_0} R_i) $$ by the lemmas cited at the beginning of the proof, and since filtered colimits are exact (Algebra, Lemma \ref{algebra-lemma-directed-colimit-exact}) we conclude that (2) holds as well.
By assumption (5) we can represent $K$ by a bounded above complex  $K^\bullet$ whose terms are in $\mathcal{P}$. Then $K \otimes_R^\mathbf{L} R/I$ is represented by $K^\bullet/IK^\bullet$. Since $E^\bullet$ is a bounded above complex of projective $R/I$-modules by (4),  we can choose a quasi-isomorphism $\delta : E^\bullet \to K^\bullet/IK^\bullet$ (Derived Categories, Lemma \ref{derived-lemma-morphisms-from-projective-complex}). Let $C^\bullet$ be cone on $\delta$ (Derived Categories, Definition \ref{derived-definition-cone}). The module $C^i$ is the direct sum $K^i/IK^i \oplus E^{i + 1}$ hence is of the form $P/IP$ for some $P \in \mathcal{P}$ as (2) says in particular that $\mathcal{P}$ is preserved under taking sums. Since $C^\bullet$ is acyclic, we can apply Lemma \ref{lemma-lift-acyclic-complex} and find a acyclic lift $A^\bullet$ of $C^\bullet$. The complex $A^\bullet$ is bounded above and has terms in $\mathcal{P}$. In $$ \xymatrix{ K^\bullet \ar@{..>}[r] \ar[d] & A^\bullet \ar[d] \\ K^\bullet/IK^\bullet \ar[r] & C^\bullet \ar[r] & E^\bullet[1] } $$ we can find the dotted arrow making the diagram commute by Derived Categories, Lemma \ref{derived-lemma-morphisms-lift-projective}. We will show below that it follows from (1), (2), (3) that $K^i \to A^i$ is the inclusion of a direct summand for every $i$. By property (2) we see that $P^i = \Coker(K^i \to A^i)$ is in $\mathcal{P}$. Thus we can take $P^\bullet = \Coker(K^\bullet \to A^\bullet)[-1]$ to conclude. \medskip\noindent To finish the proof we have to show the following: Let $f : P_1 \to P_2$, $P_1, P_2 \in \mathcal{P}$ and $P_1/IP_1 \to P_2/IP_2$ is split injective with cokernel of the form $P_3/IP_3$ for some $P_3 \in \mathcal{P}$, then $f$ is split injective. Write $E_i = P_i/IP_i$. Then $E_2 = E_1 \oplus E_3$. Since $P_2$ is projective we can choose a map $g : P_2 \to P_3$ lifting the map $E_2 \to E_3$. By condition (3) the map $g$ is surjective, hence split as $P_3$ is projective. Set $P_1' = \Ker(g)$ and choose a splitting $P_2 = P'_1 \oplus P_3$. Then $P'_1 \in \mathcal{P}$ by (2). We do not know that $g \circ f = 0$, but we can consider the map $$ P_1 \xrightarrow{f} P_2 \xrightarrow{projection} P'_1 $$ The composition modulo $I$ is an isomorphism. Since $P'_1$ is projective we can split $P_1 = T \oplus P'_1$. If $T = 0$, then we are done, because then $P_2 \to P'_1$ is a splitting of $f$. We see that $T \in \mathcal{P}$ by (2). Calculating modulo $I$ we see that $T/IT = 0$. Since $0 \in \mathcal{P}$ (as the summand of any $P$ in $\mathcal{P}$) we see the map $0 \to T$ is surjective and we conclude that $T = 0$ as desired.
We apply Lemma \ref{lemma-lift-complex} using the class $\mathcal{P}$ of all projective $R$-modules. Properties (1) and (2) of the lemma are immediate. Property (3) follows from Nakayama's lemma (Algebra, Lemma \ref{algebra-lemma-NAK}). Property (4) follows from the fact that we can lift projective $R/I$-modules to projective $R$-modules, see Algebra, Lemma \ref{algebra-lemma-lift-projective-module}. To see that (5) holds it suffices to show that $K$ is in $D^{-}(R)$. We are given that $K \otimes_R^\mathbf{L} R/I$ is in $D^{-}(R/I)$ (because $E^\bullet$ is bounded above). We will show by induction on $n$ that $K \otimes_R^\mathbf{L} R/I^n$ is in $D^{-}(R/I^n)$. This will finish the proof because $I$ being nilpotent exactly means that $I^n = 0$ for some $n$. We may represent $K$ by a K-flat complex $K^\bullet$ with flat terms (Lemma \ref{lemma-K-flat-resolution}). Then derived tensor products are represented by usual tensor products. Thus we consider the exact sequence $$ 0 \to K^\bullet \otimes_R I^n/I^{n + 1} \to K^\bullet \otimes_R R/I^{n + 1} \to K^\bullet \otimes_R R/I^n \to 0 $$ Thus the cohomology of $K \otimes_R^\mathbf{L} R/I^{n + 1}$ sits in a long exact sequence with the cohomology of $K \otimes_R^\mathbf{L} R/I^n$ and the cohomology of $$ K \otimes_R^\mathbf{L} I^n/I^{n + 1} = K \otimes_R^\mathbf{L} R/I \otimes_{R/I}^\mathbf{L} I^n/I^{n + 1} $$ The first cohomologies vanish above a certain degree by induction assumption and the second cohomologies vanish above a certain degree because $K^\bullet \otimes_R^\mathbf{L} R/I$ is bounded above and $I^n/I^{n + 1}$ is in degree $0$.
We apply Lemma \ref{lemma-lift-complex} using the class $\mathcal{P}$ of all finite stably free $R$-modules. Property (1) of the lemma is immediate. Property (2) follows from Lemma \ref{lemma-exact-category-stably-free}. Property (3) follows from Nakayama's lemma (Algebra, Lemma \ref{algebra-lemma-NAK}). Property (4) follows from the fact that we can lift finite stably free $R/I$-modules to finite stably free $R$-modules, see Lemma \ref{lemma-lift-stably-free}. Part (5) holds because a pseudo-coherent complex can be represented by a bounded above complex of finite free $R$-modules. The final assertion of the lemma follows from Lemma \ref{lemma-isomorphic-finite-projective-lifts}.
Observe that $K \otimes_R^\mathbf{L} \kappa$ is pseudo-coherent as an object of $D(\kappa)$, see Lemma \ref{lemma-pull-pseudo-coherent}. Hence the cohomology spaces are finite dimensional and vanish above some cutoff. Every object of $D(\kappa)$ is isomorphic in $D(\kappa)$ to a complex $E^\bullet$ with zero differentials. In particular $E^i \cong \kappa^{\oplus d_i}$ is finite free. Applying Lemma \ref{lemma-lift-complex-stably-frees} we obtain the existence. \medskip\noindent If we have two complexes $F^\bullet$ and $G^\bullet$ with $F^i$ and $G^i$ free of rank $d_i$ representing $K$. Then we may choose a map of complexes $\beta : F^\bullet \to G^\bullet$ representing the isomorphism $F^\bullet \cong K \cong G^\bullet$, see Derived Categories, Lemma \ref{derived-lemma-morphisms-from-projective-complex}. The induced map of complexes $\beta \otimes 1 : F^\bullet \otimes_R^\mathbf{L} \kappa \to G^\bullet \otimes_R^\mathbf{L} \kappa$ must be an isomorphism of complexes as the differentials in $F^\bullet \otimes_R^\mathbf{L} \kappa$ and $G^\bullet \otimes_R^\mathbf{L} \kappa$ are zero. Thus $\beta^i : F^i \to G^i$ is a map of finite free $R$-modules whose reduction modulo $\mathfrak m$ is an isomorphism. Hence $\beta^i$ is an isomorphism and we win.
Observe that $K \otimes_R^\mathbf{L} \kappa(\mathfrak p)$ is perfect as an object of $D(\kappa(\mathfrak p))$, see Lemma \ref{lemma-pull-perfect}. Hence only a finite number of $d_i$ are nonzero and they are all finite. Applying Lemma \ref{lemma-lift-pseudo-coherent-from-residue-field} we get a complex representing $K$ having the desired shape over the local ring $R_\mathfrak p$. We have $R_\mathfrak p = \colim R_f$ for $f \in R$, $f \not \in \mathfrak p$ (Algebra, Lemma \ref{algebra-lemma-localization-colimit}). We conclude by Lemma \ref{lemma-colimit-perfect-complexes}. Some details omitted.
If we have an isomorphism of the type described over the localization $R_\mathfrak p$, then using that $R_\mathfrak p = \colim R_f$ (Algebra, Lemma \ref{algebra-lemma-localization-colimit}) we can descend the isomorphism to an isomorphism over $R_f$ for some $f$. Thus we may assume $R$ is local and $\mathfrak p$ is the maximal ideal. In this case the result follows from the uniqueness of a ``minimal'' complex representing a perfect object, see Lemma \ref{lemma-lift-pseudo-coherent-from-residue-field}, and the fact that any complex is a direct sum of a trivial complex and a minimal one (Algebra, Lemma \ref{algebra-lemma-add-trivial-complex}).
We apply Lemma \ref{lemma-lift-complex} using the class $\mathcal{P}$ of all finite projective $R$-modules. Properties (1) and (2) of the lemma are immediate. Property (3) follows from Nakayama's lemma (Algebra, Lemma \ref{algebra-lemma-NAK}). Property (4) follows from the fact that we can lift finite projective $R/I$-modules to finite projective $R$-modules, see Lemma \ref{lemma-lift-finite-projective-module}. Property (5) holds because a pseudo-coherent complex can be represented by a bounded above complex of finite free $R$-modules. Thus Lemma \ref{lemma-lift-complex} applies and we find $P^\bullet$ as desired. The final assertion of the lemma follows from Lemma \ref{lemma-isomorphic-finite-projective-lifts}.
The assumption that $L$ has projective-amplitude in $[a, b]$ means we can represent $L$ by a complex $L^\bullet$ of projective $R$-modules with $L^i = 0$ for $i \not \in [a, b]$, see Definition \ref{definition-projective-dimension}. If $L$ is perfect of tor-amplitude in $[a, b]$, then we can represent $L$ by a complex $L^\bullet$ of finite projective $R$-modules with $L^i = 0$ for $i \not \in [a, b]$, see Lemma \ref{lemma-perfect}. If $H^i(K) = 0$ for $i \geq a$, then $K$ is quasi-isomorphic to $\tau_{\leq a - 1}K$. Hence we can represent $K$ by a complex $K^\bullet$ of $R$-modules with $K^i = 0$ for $i \geq a$. Then we obtain $$ \Hom_{D(R)}(L, K) = \Hom_{K(R)}(L^\bullet, K^\bullet) = 0 $$ by Derived Categories, Lemma \ref{derived-lemma-morphisms-from-projective-complex}. This proves (1). Under the hypotheses of (2) we see that $\Hom_{D(R)}(L, K[1]) = 0$ by (1), hence the distinguished triangle is split by Derived Categories, Lemma \ref{derived-lemma-split}. The uniqueness of (3) follows from (1).
In this proof all tensor products are over $R$ and we write $\kappa = \kappa(\mathfrak p)$. We may assume that $K^\bullet$ is a bounded above complex of finite free $R$-modules. Let us inspect what is happening in degree $i$: $$ \ldots \to K^{i - 1} \xrightarrow{d^{i - 1}} K^i \xrightarrow{d^i} K^{i + 1} \to \ldots $$ Let $0 \subset V \subset W \subset K^i \otimes \kappa$ be defined by the formulas $$ V = \Im\left( K^{i - 1} \otimes \kappa \to K^i \otimes \kappa \right) \quad\text{and}\quad W = \Ker\left( K^i \otimes \kappa \to K^{i + 1} \otimes \kappa \right) $$ Set $\dim(V) = r$, $\dim(W/V) = s$, and $\dim(K^i \otimes \kappa/W) = t$. We can pick $x_1, \ldots, x_r \in K^{i - 1}$ which map by $d^{i - 1}$ to a basis of $V$. By our assumption we can pick $y_1, \ldots, y_s \in \Ker(d^i)$ mapping to a basis of $W/V$. Finally, choose $z_1, \ldots, z_t \in K^i$ mapping to a basis of $K^i \otimes \kappa/W$. Then we see that the elements $d^i(z_1), \ldots, d^i(z_t) \in K^{i + 1}$ are linearly independent in $K^{i + 1} \otimes_R \kappa$. By Algebra, Lemma \ref{algebra-lemma-cokernel-flat} we may after replacing $R$ by $R_f$ for some $f \in R$, $f \not \in \mathfrak p$ assume that \begin{enumerate} \item $d^i(x_a), y_b, z_c$ is an $R$-basis of $K^i$, \item $d^i(z_1), \ldots, d^i(z_t)$ are $R$-linearly independent in $K^{i + 1}$, and \item the quotient $E^{i + 1} = K^{i + 1}/\sum Rd^i(z_c)$ is finite projective. \end{enumerate} Since $d^i$ annihilates $d^{i - 1}(x_a)$ and $y_b$, we deduce from condition (2) that $E^{i + 1} = \Coker(d^i : K^i \to K^{i + 1})$. Thus we see that $$ \tau_{\geq i + 1}K^\bullet = (\ldots \to 0 \to E^{i + 1} \to K^{i + 2} \to \ldots) $$ is a bounded complex of finite projective modules sitting in degrees $[i + 1, b]$ for some $b$. Thus $\tau_{\geq i + 1}K^\bullet$ is perfect of amplitude $[i + 1, b]$. Since $\tau_{\leq i}K^\bullet$ has no cohomology in degrees $> i$, we may apply Lemma \ref{lemma-splitting-unique} to the distinguished triangle $$ \tau_{\leq i}K^\bullet \to K^\bullet \to \tau_{\geq i + 1}K^\bullet \to (\tau_{\leq i}K^\bullet)[1] $$ (Derived Categories, Remark \ref{derived-remark-truncation-distinguished-triangle}) to conclude.
We get (1) from Lemma \ref{lemma-better-cut-complex-in-two} as well as a splitting $K^\bullet \otimes_R R_f = \tau_{\leq i}K^\bullet \otimes_R R_f \oplus \tau_{\geq i + 1}K^\bullet \otimes_R R_f$ in $D(R_f)$. Applying Lemma \ref{lemma-better-cut-complex-in-two} once more to $\tau_{\leq i}K^\bullet \otimes_R R_f$ we obtain (after suitably choosing $f$) a splitting $\tau_{\leq i}K^\bullet \otimes_R R_f = \tau_{\leq i - 1}K^\bullet \otimes_R R_f \oplus H^i(K^\bullet)_f$ in $D(R_f)$ as well as the conclusion that $H^i(K)_f$ is a flat perfect module, i.e., finite projective.
This is an often used special case of Lemma \ref{lemma-better-cut-complex-in-two}. A direct proof is as follows. We may assume that $K^\bullet$ is a bounded above complex of finite free $R$-modules. Let us inspect what is happening in degree $i$: $$ \ldots \to K^{i - 2} \to R^{\oplus l} \to R^{\oplus m} \to R^{\oplus n} \to K^{i + 2} \to \ldots $$ Let $A$ be the $m \times l$ matrix corresponding to $K^{i - 1} \to K^i$ and let $B$ be the $n \times m$ matrix corresponding to $K^i \to K^{i + 1}$. The assumption is that $A \bmod \mathfrak p$ has rank $r$ and that $B \bmod \mathfrak p$ has rank $m - r$. In other words, there is some $r \times r$ minor $a$ of $A$ which is not in $\mathfrak p$ and there is some $(m - r) \times (m - r)$-minor $b$ of $B$ which is not in $\mathfrak p$. Set $f = ab$. Then after inverting $f$ we can find direct sum decompositions $K^{i - 1} = R^{\oplus l - r} \oplus R^{\oplus r}$, $K^i = R^{\oplus r} \oplus R^{\oplus m - r}$, $K^{i + 1} = R^{\oplus m - r} \oplus R^{\oplus n - m + r}$ such that the module map $K^{i - 1} \to K^i$ kills of $R^{\oplus l - r}$ and induces an isomorphism of $R^{\oplus r}$ onto the corresponding summand of $K^i$ and such that the module map $K^i \to K^{i + 1}$ kills of $R^{\oplus r}$ and induces an isomorphism of $R^{\oplus m - r}$ onto the corresponding summand of $K^{i + 1}$. Thus $K^\bullet$ becomes quasi-isomorphic to $$ \ldots \to K^{i - 2} \to R^{\oplus l - r} \to 0 \to R^{\oplus n - m + r} \to K^{i + 2} \to \ldots $$ and everything is clear.
Consider the distinguished triangle $$ \tau_{\leq a}K \to K \to \tau_{\geq a + 1}K \to (\tau_{\leq a}K)[1] $$ in $D(R)$, see Derived Categories, Remark \ref{derived-remark-truncation-distinguished-triangle}. Observe that $\Ext^{-a}_R(\tau_{\leq a}K, M) = \Hom_R(H^a(K), M)$ and $\Ext^{-a - 1}_R(\tau_{\leq a}K, M) = 0$, see Derived Categories, Lemma \ref{derived-lemma-negative-exts}. Thus the long exact sequence of $\Ext$ gives an exact sequence $$ 0 \to \Ext^{-a}_R(\tau_{\geq a + 1}K, M) \to \Ext^{-a}_R(K, M) \to \Hom_R(H^a(K), M) $$ functorial in the $R$-module $M$. Now if $I$ is an injective $R$-module, then $\Ext^{-a}_R(\tau_{\geq a + 1}K, I) = 0$ for example by Derived Categories, Lemma \ref{derived-lemma-compute-ext-resolutions}. Since every module injects into an injective module, we conclude that $\Ext^{-a}_R(\tau_{\geq a + 1}K, M) = 0$ for every $R$-module $M$. By Lemma \ref{lemma-projective-amplitude} we conclude that $\tau_{\geq a + 1}K$ has projective-amplitude in $[a + 1, b]$ for some $b$ (this is where we use that $K$ is bounded above). We obtain the splitting by Lemma \ref{lemma-splitting-unique}.
By Lemma \ref{lemma-split-using-ext-injective} we have a direct sum decomposition $K \cong \tau_{\leq a}K \oplus \tau_{\geq a + 1}K$ and $\tau_{\geq a + 1}K$ has projective-amplitude in $[a + 1, b]$ for some $b$. Clearly, we must have $H^a(K) = 0$ and we conclude that $\tau_{\leq a}K = \tau_{\leq a - 1}K$ in $D(R)$.
After decreasing $a$ we may assume that also $H^i(K^\bullet) = 0$ for $i < a$. By Lemma \ref{lemma-cut-complex-in-two} after replacing $R$ by $R_f$ for some $f \in R$, $f \not \in \mathfrak p$ we can write $K^\bullet = \tau_{\leq a - 1}K^\bullet \oplus \tau_{\geq a}K^\bullet$ in $D(R)$ with $\tau_{\geq a}K^\bullet$ perfect. Since $H^i(K^\bullet) = 0$ for $i < a$ we see that $\tau_{\leq a - 1}K^\bullet = 0$ in $D(R)$. Hence $K^\bullet$ is perfect. Then we can conclude using Lemma \ref{lemma-lift-perfect-from-residue-field}.
We omit the proof of the implications (1) $\Rightarrow$ (2) $\Rightarrow$ (3). Assume (3). Let $i \in \mathbf{Z}$ with $i \not \in [a, b]$. By Lemma \ref{lemma-cut-complex-in-two} we see that the assumption implies that $H^i(K^\bullet)_{\mathfrak m} = 0$ for all maximal ideals of $R$. Hence $H^i(K^\bullet) = 0$, see Algebra, Lemma \ref{algebra-lemma-characterize-zero-local}. Moreover, Lemma \ref{lemma-cut-complex-in-two} now also implies that for every maximal ideal $\mathfrak m$ there exists an element $f \in R$, $f \not \in \mathfrak m$ such that $K^\bullet \otimes_R R_f$ is perfect with tor amplitude in $[a, b]$. Hence we conclude by appealing to Lemmas \ref{lemma-glue-perfect} and \ref{lemma-glue-tor-amplitude}.