Let $\mathbf A$ be a dg-category. Denote by $\mathsf{C}\_{\mathrm{dg}}(\mathbf A)$ the dg-category of right $\mathbf A$-modules, and by $\mathsf{C}(\mathbf A) = Z^0(\mathsf{C}\_{\mathrm{dg}}(\mathbf A))$, its underlying category (which is endowed with the projective model category structure). Moreover, set $\mathsf{K}(\mathbf A) = H^0(\mathsf{C}\_{\mathrm{dg}}(\mathbf A))$, the homotopy category of modules, and let $\mathsf{D}(\mathbf A)$ be the derived category of $\mathbf A$, that is, the localisation of $\mathsf{K}(\mathbf A)$ (or, equivalently, of $\mathsf{C}(\mathbf A)$) along quasi-isomorphisms. Denote by $\delta \colon \mathsf{K}(\mathbf A) \to \mathsf{D}(\mathbf A)$ the localisation functor. The machinery of model categories tells us that, if $P \in \mathsf{C}(\mathbf A)$ is a cofibrant dg-module, then, for any dg-module $M$, the localisation functor induces an isomorphism
\begin{equation}
\mathsf{K}(\mathbf A)(P, M) \xrightarrow{\sim} \mathsf{D}(\mathbf A)(P,M).
\end{equation}


The question is: is the above result true if $P$ is a h-projective dg-module? By definition, $P$ is h-projective if, whenever $A$ is an acyclic dg-module, the hom-complex $\mathsf{C}\_{\mathrm{dg}}(\mathbf A)(P, A)$ is acyclic. Notice that a cofibrant dg-module is also h-projective.



Morphisms $P \to M$ in the derived category of a dg-category, if $P$ is h-projective
The answer is: yes, if $P$ is h-projective, then the map
\begin{equation}
\delta\_{P,M} \colon \mathsf{K}(\mathbf A)(P, M) \to \mathsf{D}(\mathbf A)(P,M)
\end{equation}
is an isomorphism, for any dg-module $M$.


The key argument in the proof is the following: assuming $P$ h-projective, then any quasi-isomorphism $u \colon X \to P$ has a right inverse in $\mathsf{K}(\mathbf A)$. In fact, consider the distinguished triangle in $\mathsf{K}(\mathbf A)$:
\begin{equation}
X \xrightarrow{u} P \xrightarrow{j} C(u) \to X[1].
\end{equation}
Since $u$ is quasi-isomorphism, the cone $C(u)$ is acyclic. $P$ is h-projective, so we have
\begin{equation}
\mathsf{K}(\mathbf A)(P, C(u)) = H^0(\mathsf{C}\_{\mathrm{dg}}(\mathbf A)(P, C(u))) = 0;
\end{equation}
in particular, $j=0$ in $\mathsf{K}(\mathbf A)$. Applying the cohomological functor $\mathsf{K}(\mathbf A)(P,-)$ to the above triangle, we immediately find $u' \colon P \to X$ such that $u u' = 1$.


Now, let us prove that $\delta\_{P,M} = \delta$ is injective. Let $f, g \colon P \to M$ such that $\delta(f) = \delta(g)$. This means that there exists $u \colon X \to P$ such that $fu=gu$ in $\mathsf{K}(\mathbf A)$. By the above remark, $u$ has a right inverse $u'$ in $\mathsf{K}(\mathbf A)$, and so $f=g$. Finally, let us prove that $\delta$ is surjective. Let $\overline{f} \in \mathsf{D}(\mathbf A)(P, M)$ We may write $\overline{f} = \delta(f)\delta(s)^{-1}$, with $s \colon X \to P$ being a quasi-isomorphism, and $f \colon X \to M$. The above remark gives us a right inverse $s' \colon P \to X$ of $s$. Hence, $\delta(s')$ is the (two-sided) inverse of $\delta(s)$, and we have
\begin{equation}
\overline{f} = \delta(f) \delta(s') = \delta(fs'),
\end{equation}
and we are done.


