Example 22.19.6 (Differential graded category of complexes). Let $\mathcal{B}$ be an additive category. We will construct a differential graded category $\text{Comp}^{dg}(\mathcal{B})$ over $R = \mathbf{Z}$ whose associated category of complexes is $\text{Comp}(\mathcal{B})$ and whose associated homotopy category is $K(\mathcal{B})$. As objects of $\text{Comp}^{dg}(\mathcal{B})$ we take complexes of $\mathcal{B}$. Given complexes $A^\bullet$ and $B^\bullet$ of $\mathcal{B}$, we sometimes also denote $A^\bullet$ and $B^\bullet$ the corresponding graded objects of $\mathcal{B}$ (i.e., forget about the differential). Using this abuse of notation, we set

$\mathop{\mathrm{Hom}}\nolimits _{\text{Comp}^{dg}(\mathcal{B})}(A^\bullet , B^\bullet ) = \mathop{\mathrm{Hom}}\nolimits _{\text{Gr}^{gr}(\mathcal{B})}(A^\bullet , B^\bullet )$

as a graded $\mathbf{Z}$-module where the right hand side is defined in Example 22.18.5. In other words, the $n$th graded piece is the abelian group of homogeneous morphism of degree $n$ of graded objects

$\mathop{\mathrm{Hom}}\nolimits ^ n(A^\bullet , B^\bullet ) = \mathop{\mathrm{Hom}}\nolimits _{\text{Gr}(\mathcal{B})}(A^\bullet , B^\bullet [n]) = \prod \nolimits _{p + q = n} \mathop{\mathrm{Hom}}\nolimits _\mathcal {B}(A^{-q}, B^ p)$

(observe reversal of indices and observe we have a direct product and not a direct sum). For an element $f \in \mathop{\mathrm{Hom}}\nolimits ^ n(A^\bullet , B^\bullet )$ of degree $n$ we set

$\text{d}(f) = \text{d}_ B \circ f - (-1)^ n f \circ \text{d}_ A$

To make sense of this we think of $\text{d}_ B$ and $\text{d}_ A$ as maps of graded objects of $\mathcal{B}$ homogeneous of degree $1$ and we use composition in the category $\text{Gr}^{gr}(\mathcal{B})$ on the right hand side. In terms of components, if $f = (f_{p, q})$ with $f_{p, q} : A^{-q} \to B^ p$ we have

22.19.6.1
$$\label{dga-equation-differential-hom-complex} \text{d}(f_{p, q}) = \text{d}_ B \circ f_{p, q} + (-1)^{p + q + 1} f_{p, q} \circ \text{d}_ A$$

Note that the first term of this expression is in $\mathop{\mathrm{Hom}}\nolimits _\mathcal {B}(A^{-q}, B^{p + 1})$ and the second term is in $\mathop{\mathrm{Hom}}\nolimits _\mathcal {B}(A^{-q - 1}, B^ p)$. In other words, given $p + q = n + 1$ we have

$\text{d}(f)_{p, q} = \text{d}_ B \circ f_{p - 1, q} - (-1)^ n f_{p, q - 1} \circ \text{d}_ A$

with obvious notation. The reader checks1 that

1. $\text{d}$ has square zero,

2. an element $f$ in $\mathop{\mathrm{Hom}}\nolimits ^ n(A^\bullet , B^\bullet )$ has $\text{d}(f) = 0$ if and only if the morphism $f : A^\bullet \to B^\bullet [n]$ of graded objects of $\mathcal{B}$ is actually a map of complexes,

3. in particular, the category of complexes of $\text{Comp}^{dg}(\mathcal{B})$ is equal to $\text{Comp}(\mathcal{B})$,

4. the morphism of complexes defined by $f$ as in (2) is homotopy equivalent to zero if and only if $f = \text{d}(g)$ for some $g \in \mathop{\mathrm{Hom}}\nolimits ^{n - 1}(A^\bullet , B^\bullet )$.

5. in particular, we obtain a canonical isomorphism

$\mathop{\mathrm{Hom}}\nolimits _{K(\mathcal{B})}(A^\bullet , B^\bullet ) \longrightarrow H^0(\mathop{\mathrm{Hom}}\nolimits _{\text{Comp}^{dg}(\mathcal{B})}(A^\bullet , B^\bullet ))$

and the homotopy category of $\text{Comp}^{dg}(\mathcal{B})$ is equal to $K(\mathcal{B})$.

Given complexes $A^\bullet$, $B^\bullet$, $C^\bullet$ we define composition

$\mathop{\mathrm{Hom}}\nolimits ^ m(B^\bullet , C^\bullet ) \times \mathop{\mathrm{Hom}}\nolimits ^ n(A^\bullet , B^\bullet ) \longrightarrow \mathop{\mathrm{Hom}}\nolimits ^{n + m}(A^\bullet , C^\bullet )$

by composition $(g, f) \mapsto g \circ f$ in the graded category $\text{Gr}^{gr}(\mathcal{B})$, see Example 22.18.5. This defines a map of differential graded modules as in Definition 22.19.1 because

\begin{align*} \text{d}(g \circ f) & = \text{d}_ C \circ g \circ f - (-1)^{n + m} g \circ f \circ \text{d}_ A \\ & = \left(\text{d}_ C \circ g - (-1)^ m g \circ \text{d}_ B\right) \circ f + (-1)^ m g \circ \left(\text{d}_ B \circ f - (-1)^ n f \circ \text{d}_ A\right) \\ & = \text{d}(g) \circ f + (-1)^ m g \circ \text{d}(f) \end{align*}

as desired.

[1] What may be useful here is to think of the double complex $H^{\bullet , \bullet }$ with terms $H^{p, q} = \mathop{\mathrm{Hom}}\nolimits _\mathcal {B}(A^{-q}, B^ p)$ and differentials $d_1$ of degree $(1, 0)$ given by $\text{d}_ B$ and $d_2$ of degree $(0, 1)$ given by the contragredient of $d_ A$. Up to sign and up to replacing the direct sum by a direct product, the differential graded $\mathbf{Z}$-module $\mathop{\mathrm{Hom}}\nolimits _{\text{Comp}^{dg}(\mathcal{B})}(A^\bullet , B^\bullet )$ is the total complex associated to $H^{\bullet , \bullet }$, see Homology, Definition 12.22.3. To get the sign correct, change $d_2^{p, q} : H^{p, q} \to H^{p, q + 1}$ by $(-1)^{q + 1}$ (after this change we still have a double complex).

Comment #286 by arp on

1. Maybe it would be nice to say that is a totalization of (the obvious) double complex.

2. In the section "The reader checks...", for 2) to 4) it could be nice to have the statements for $\text{Hom}^n(A^\bullet, B^\bullet)$ in general, i.e. in terms of map $A^{\bullet} \rightarrow B^{\bullet}[n]$; and perhaps to mention earlier that you can think of $\text{Hom}^n(A^\bullet, B^\bullet)$ in these terms.

3. Typo: In the description of composition, $(g \circ f)_{p, r}$ should be defined as $g_{p, q} \circ f_{-q, r}$ where $q$ is such that $p + q = m$ and $-q+r = n$ (i.e. the sign of $q$ should be changed in two places).

Comment #299 by on

What really confused me for a long time is your point 1. There is an obvious double complex (I agree with that), but if you take the associated double complex, then

1. you get direct sums instead of products in the definition of the degree n part, and
2. the signs do not work out!

For a while I tried to come up with a better explanation for the signs but I failed. But perhaps as a byproduct of that it is now not as readable as it should have been. I will try to improve and then you can criticize.

Comment #300 by arp on

Hmm, not sure if this helps, but the way I thought about it is:

1. In general you can totalize a double complex with sums or products. In this case it makes sense to use products for $\text{Hom}$ if you want an adjunction formula (say for complexes of modules over a ring): which should be an isomorphism of complexes.

2. For the signs on the differential in $\text{Hom}$, the ones you are using make it so that the interpretation of $\text{Hom}^{n}(A^{\bullet},B^{\bullet})$ I mentioned in the first comment works out, i.e. so that being a cycle corresponds to being a morphism of complexes $A^{\bullet} \rightarrow B^{\bullet}[n]$. To make this pop out of the totalization construction you can artificially modify the vertical differential in the double complex for $\text{Hom}$ by a sign, but maybe there's a natural convention that makes it come out.

Comment #301 by on

OK, thanks. I'll try to put those suggestions in today.

Comment #304 by on

Dear arp, I've now fixed all of the errors/typos you've pointed out in the last 48 hours. See here and here. Thanks!

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).