# The Stacks Project

## Tag 01FP

### 20.26. Čech cohomology of complexes

In general for sheaves of abelian groups ${\mathcal F}$ and ${\mathcal G}$ on $X$ there is a cup product map $$H^i(X, {\mathcal F}) \times H^j(X, {\mathcal G}) \longrightarrow H^{i + j}(X, {\mathcal F} \otimes_{\mathbf Z} {\mathcal G}).$$ In this section we define it using Čech cocycles by an explicit formula for the cup product. If you are worried about the fact that cohomology may not equal Čech cohomology, then you can use hypercoverings and still use the cocycle notation. This also has the advantage that it works to define the cup product for hypercohomology on any topos (insert future reference here).

Let ${\mathcal F}^\bullet$ be a bounded below complex of presheaves of abelian groups on $X$. We can often compute $H^n(X, {\mathcal F}^\bullet)$ using Čech cocycles. Namely, let ${\mathcal U} : X = \bigcup_{i \in I} U_i$ be an open covering of $X$. Since the Čech complex $\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})$ (Definition 20.10.1) is functorial in the presheaf $\mathcal{F}$ we obtain a double complex $\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F}^\bullet)$. The associated total complex to $\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)$ is the complex with degree $n$ term $$\text{Tot}^n(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) = \bigoplus\nolimits_{p + q = n} \prod\nolimits_{i_0\ldots i_p} {\mathcal F}^q(U_{i_0\ldots i_p})$$ see Homology, Definition 12.22.3. A typical element in $\text{Tot}^n$ will be denoted $\alpha = \{\alpha_{i_0\ldots i_p}\}$ where $\alpha_{i_0 \ldots i_p} \in \mathcal{F}^q(U_{i_0\ldots i_p})$. In other words the $\mathcal{F}$-degree of $\alpha_{i_0\ldots i_p}$ is $q = n - p$. This notation requires us to be aware of the degree $\alpha$ lives in at all times. We indicate this situation by the formula $\deg_{\mathcal F}(\alpha_{i_0\ldots i_p}) = q$. According to our conventions in Homology, Definition 12.22.3 the differential of an element $\alpha$ of degree $n$ is given by $$d(\alpha)_{i_0\ldots i_{p + 1}} = \sum\nolimits_{j = 0}^{p + 1} (-1)^j \alpha_{i_0 \ldots \hat i_j \ldots i_{p + 1}} + (-1)^{p + 1}d_{{\mathcal F}}(\alpha_{i_0 \ldots i_{p + 1}})$$ where $d_\mathcal{F}$ denotes the differential on the complex $\mathcal{F}^\bullet$. The expression $\alpha_{i_0 \ldots \hat i_j \ldots i_{p + 1}}$ means the restriction of $\alpha_{i_0 \ldots \hat i_j \ldots i_{p + 1}} \in {\mathcal F}(U_{i_0\ldots\hat i_j\ldots i_{p + 1}})$ to $U_{i_0 \ldots i_{p + 1}}$.

The construction of $\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet))$ is functorial in ${\mathcal F}^\bullet$. As well there is a functorial transformation $$\tag{20.26.0.1} \Gamma(X, {\mathcal F}^\bullet) \longrightarrow \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet))$$ of complexes defined by the following rule: The section $s\in \Gamma(X, {\mathcal F}^n)$ is mapped to the element $\alpha = \{\alpha_{i_0\ldots i_p}\}$ with $\alpha_{i_0} = s|_{U_{i_0}}$ and $\alpha_{i_0\ldots i_p} = 0$ for $p>0$.

Refinements. Let ${\mathcal V} = \{ V_j \}_{j\in J}$ be a refinement of ${\mathcal U}$. This means there is a map $t: J \to I$ such that $V_j \subset U_{t(j)}$ for all $j\in J$. This gives rise to a functorial transformation $$\tag{20.26.0.2} T_t : \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) \longrightarrow \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal V}, {\mathcal F}^\bullet)).$$ defined by the rule $$T_t(\alpha)_{j_0\ldots j_p} = \alpha_{t(j_0)\ldots t(j_p)}|_{V_{j_0\ldots j_p}}.$$ Given two maps $t, t' : J \to I$ as above the maps $T_t$ and $T_{t'}$ constructed above are homotopic. The homotopy is given by $$h(\alpha)_{j_0\ldots j_p} = \sum\nolimits_{a = 0}^{p} (-1)^a \alpha_{t(j_0)\ldots t(j_a) t'(j_a) \ldots t'(j_p)}$$ for an element $\alpha$ of degree $n$. This works because of the following computation, again with $\alpha$ an element of degree $n$ (so $d(\alpha)$ has degree $n + 1$ and $h(\alpha)$ has degree $n - 1$): \begin{align*} ( d(h(\alpha)) + h(d(\alpha)) )_{j_0\ldots j_p} = & \sum\nolimits_{k = 0}^p (-1)^k h(\alpha)_{j_0 \ldots \hat j_k \ldots j_p} + \\ & (-1)^p d_{\mathcal F}(h(\alpha)_{j_0 \ldots j_p}) + \\ & \sum\nolimits_{a = 0}^p (-1)^a d(\alpha)_{t(j_0) \ldots t(j_a) t'(j_a) \ldots t'(j_p)} \\ = & \sum\nolimits_{k = 0}^p \sum\nolimits_{a = 0}^{k - 1} (-1)^{k + a} \alpha_{t(j_0)\ldots t(j_a)t'(j_a)\ldots \hat{t'(j_k)}\ldots t'(j_p)} + \\ & \sum\nolimits_{k = 0}^p \sum\nolimits_{a = k + 1}^p (-1)^{k + a - 1} \alpha_{t(j_0)\ldots \hat{t(j_k)}\ldots t(j_a)t'(j_a)\ldots t'(j_p)} + \\ & \sum\nolimits_{a = 0}^p (-1)^{p + a} d_{\mathcal F}(\alpha_{t(j_0)\ldots t(j_a) t'(j_a) \ldots t'(j_p)}) + \\ & \sum\nolimits_{a = 0}^p \sum\nolimits_{k = 0}^a (-1)^{a + k} \alpha_{t(j_0)\ldots\hat{t(j_k)}\ldots t(j_a)t'(j_a)\ldots t'(j_p)} + \\ & \sum\nolimits_{a = 0}^p \sum\nolimits_{k = a}^p (-1)^{a + k + 1} \alpha_{t(j_0) \ldots t(j_a) t'(j_a) \ldots \hat{t'(j_k)} \ldots t'(j_p)} + \\ & \sum\nolimits_{a = 0}^p (-1)^{a + p + 1} d_{\mathcal F}(\alpha_{t(j_0)\ldots t(j_a) t'(j_a) \ldots t'(j_p)}) \\ = & \alpha_{t'(j_0)\ldots t'(j_p)} + (-1)^{2p + 1}\alpha_{t(j_0)\ldots t(j_p)} \\ = & T_{t'}(\alpha)_{j_0\ldots j_p} - T_t(\alpha)_{j_0\ldots j_p} \end{align*} We leave it to the reader to verify the cancellations. (Note that the terms having both $k$ and $a$ in the 1st, 2nd and 4th, 5th summands cancel, except the ones where $a = k$ which only occur in the 4th and 5th and these cancel against each other except for the two desired terms.) It follows that the induced map $$H^n(T_t) : H^n( \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) ) \to H^n( \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal V}, {\mathcal F}^\bullet)) )$$ is independent of the choice of $t$. We define Čech hypercohomology as the limit of the Čech cohomology groups over all refinements via the maps $H^\bullet(T_t)$.

In the limit (over all open coverings of $X$) the following lemma provides a map of Čech hypercohomology into cohomology, which is often an isomorphism and is always an isomorphism if we use hypercoverings.

Lemma 20.26.1. Let $(X, \mathcal{O}_X)$ be a ringed space. Let $\mathcal{U} : X = \bigcup_{i \in I} U_i$ be an open covering. For a bounded below complex $\mathcal{F}^\bullet$ of $\mathcal{O}_X$-modules there is a canonical map $$\text{Tot}(\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F}^\bullet)) \longrightarrow R\Gamma(X, \mathcal{F}^\bullet)$$ functorial in $\mathcal{F}^\bullet$ and compatible with (20.26.0.1) and (20.26.0.2). There is a spectral sequence $(E_r, d_r)_{r \geq 0}$ with $$E_2^{p, q} = H^p(\text{Tot}(\check{\mathcal{C}}^\bullet(\mathcal{U}, \underline{H}^q(\mathcal{F}^\bullet)))$$ converging to $H^{p + q}(X, \mathcal{F}^\bullet)$.

Proof. Let ${\mathcal I}^\bullet$ be a bounded below complex of injectives. The map (20.26.0.1) for $\mathcal{I}^\bullet$ is a map $\Gamma(X, {\mathcal I}^\bullet) \to \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal I}^\bullet))$. This is a quasi-isomorphism of complexes of abelian groups as follows from Homology, Lemma 12.22.7 applied to the double complex $\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal I}^\bullet)$ using Lemma 20.12.1. Suppose ${\mathcal F}^\bullet \to {\mathcal I}^\bullet$ is a quasi-isomorphism of ${\mathcal F}^\bullet$ into a bounded below complex of injectives. Since $R\Gamma(X, {\mathcal F}^\bullet)$ is represented by the complex $\Gamma(X, {\mathcal I}^\bullet)$ we obtain the map of the lemma using $$\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) \longrightarrow \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal I}^\bullet)).$$ We omit the verification of functoriality and compatibilities. To construct the spectral sequence of the lemma, choose a Cartan-Eilenberg resolution $\mathcal{F}^\bullet \to \mathcal{I}^{\bullet, \bullet}$, see Derived Categories, Lemma 13.21.2. In this case $\mathcal{F}^\bullet \to \text{Tot}(\mathcal{I}^{\bullet, \bullet})$ is an injective resolution and hence $$\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, \text{Tot}({\mathcal I}^{\bullet, \bullet})))$$ computes $R\Gamma(X, \mathcal{F}^\bullet)$ as we've seen above. By Homology, Remark 12.22.8 we can view this as the total complex associated to the triple complex $\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal I}^{\bullet, \bullet})$ hence, using the same remark we can view it as the total complex associate to the double complex $A^{\bullet, \bullet}$ with terms $$A^{n, m} = \bigoplus\nolimits_{p + q = n} \check{\mathcal{C}}^p({\mathcal U}, \mathcal{I}^{q, m})$$ Since $\mathcal{I}^{q, \bullet}$ is an injective resolution of $\mathcal{F}^q$ we can apply the first spectral sequence associated to $A^{\bullet, \bullet}$ (Homology, Lemma 12.22.4) to get a spectral sequence with $$E_1^{n, m} = \bigoplus\nolimits_{p + q = n} \check{\mathcal{C}}^p(\mathcal{U}, \underline{H}^m(\mathcal{F}^q))$$ which is the $n$th term of the complex $\text{Tot}(\check{\mathcal{C}}^\bullet(\mathcal{U}, \underline{H}^m(\mathcal{F}^\bullet))$. Hence we obtain $E_2$ terms as described in the lemma. Convergence by Homology, Lemma 12.22.6. $\square$

Let $X$ be a topological space, let $\mathcal{U} : X = \bigcup_{i \in I} U_i$ be an open covering, and let $\mathcal{F}^\bullet$ be a bounded below complex of presheaves of abelian groups. Consider the map $\tau : \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) \to \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet))$ defined by $$\tau(\alpha)_{i_0 \ldots i_p} = (-1)^{p(p + 1)/2} \alpha_{i_p \ldots i_0}.$$ Then we have for an element $\alpha$ of degree $n$ that \begin{align*} & d(\tau(\alpha))_{i_0 \ldots i_{p + 1}} \\ & = \sum\nolimits_{j = 0}^{p + 1} (-1)^j \tau(\alpha)_{i_0 \ldots \hat i_j \ldots i_{p + 1}} + (-1)^{p + 1} d_{\mathcal F}(\tau(\alpha)_{i_0 \ldots i_{p + 1}}) \\ & = \sum\nolimits_{j = 0}^{p + 1} (-1)^{j + \frac{p(p + 1)}{2}} \alpha_{i_{p + 1} \ldots \hat i_j \ldots i_0} + (-1)^{p + 1 + \frac{(p + 1)(p + 2)}{2}} d_{\mathcal F}(\alpha_{i_{p + 1} \ldots i_0}) \end{align*} On the other hand we have \begin{align*} & \tau(d(\alpha))_{i_0\ldots i_{p + 1}} \\ & = (-1)^{\frac{(p + 1)(p + 2)}{2}} d(\alpha)_{i_{p + 1} \ldots i_0} \\ & = (-1)^{\frac{(p + 1)(p + 2)}{2}} \left( \sum\nolimits_{j = 0}^{p + 1} (-1)^j \alpha_{i_{p + 1}\ldots \hat i_{p + 1 - j} \ldots i_0} + (-1)^{p + 1} d_{\mathcal F}(\alpha_{i_{p + 1}\ldots i_0}) \right) \end{align*} Thus we conclude that $d(\tau(\alpha)) = \tau(d(\alpha))$ because $p(p + 1)/2 \equiv (p + 1)(p + 2)/2 + p + 1 \bmod 2$. In other words $\tau$ is an endomorphism of the complex $\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet))$. Note that the diagram $$\begin{matrix} \Gamma(X, {\mathcal F}^\bullet) & \longrightarrow & \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) \\ \downarrow \text{id} & & \downarrow \tau \\ \Gamma(X, {\mathcal F}^\bullet) & \longrightarrow & \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) \end{matrix}$$ commutes. In addition $\tau$ is clearly compatible with refinements. This suggests that $\tau$ acts as the identity on Čech cohomology (i.e., in the limit – provided Čech hypercohomology agrees with hypercohomology, which is always the case if we use hypercoverings). We claim that $\tau$ actually is homotopic to the identity on the total Čech complex $\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet))$. To prove this, we use as homotopy $$h(\alpha)_{i_0 \ldots i_p} = \sum\nolimits_{a = 0}^p \epsilon_p(a) \alpha_{i_0 \ldots i_a i_p \ldots i_a} \quad\text{with}\quad \epsilon_p(a) = (-1)^{\frac{(p - a)(p - a - 1)}{2} + p}$$ for $\alpha$ of degree $n$. As usual we omit writing $|_{U_{i_0 \ldots i_p}}$. This works because of the following computation, again with $\alpha$ an element of degree $n$: \begin{align*} (d(h(\alpha)) + h(d(\alpha)))_{i_0 \ldots i_p} = & \sum\nolimits_{k = 0}^p (-1)^k h(\alpha)_{i_0 \ldots \hat i_k \ldots i_p} + \\ & (-1)^p d_{\mathcal F}(h(\alpha)_{i_0 \ldots i_p}) + \\ & \sum\nolimits_{a = 0}^p \epsilon_p(a) d(\alpha)_{i_0 \ldots i_a i_p \ldots i_a} \\ = & \sum\nolimits_{k = 0}^p \sum\nolimits_{a = 0}^{k - 1} (-1)^k \epsilon_{p - 1}(a) \alpha_{i_0 \ldots i_a i_p \ldots \hat{i_k} \ldots i_a} + \\ & \sum\nolimits_{k = 0}^p \sum\nolimits_{a = k + 1}^p (-1)^k \epsilon_{p - 1}(a - 1) \alpha_{i_0 \ldots \hat{i_k} \ldots i_a i_p \ldots i_a} + \\ & \sum\nolimits_{a = 0}^p (-1)^p \epsilon_p(a) d_{\mathcal F}(\alpha_{i_0 \ldots i_a i_p \ldots i_a}) + \\ & \sum\nolimits_{a = 0}^p \sum\nolimits_{k = 0}^a \epsilon_p(a) (-1)^k \alpha_{i_0 \ldots \hat{i_k} \ldots i_a i_p \ldots i_a} + \\ & \sum\nolimits_{a = 0}^p \sum\nolimits_{k = a}^p \epsilon_p(a) (-1)^{p + a + 1 - k} \alpha_{i_0 \ldots i_a i_p \ldots \hat{i_k} \ldots i_a} + \\ & \sum\nolimits_{a = 0}^p \epsilon_p(a) (-1)^{p + 1} d_{\mathcal F}(\alpha_{i_0 \ldots i_a i_p \ldots i_a}) \\ = & \epsilon_p(0) \alpha_{i_p \ldots i_0} + \epsilon_p(p) (-1)^{p + 1} \alpha_{i_0 \ldots i_p} \\ = & (-1)^{\frac{p(p + 1)}{2}}\alpha_{i_p \ldots i_0} - \alpha_{i_0 \ldots i_p} \end{align*} The cancellations follow because $$(-1)^k \epsilon_{p - 1}(a) + \epsilon_p(a)(-1)^{p + a + 1 - k} = 0 \quad\text{and}\quad (-1)^k\epsilon_{p - 1}(a - 1) + \epsilon_p(a) (-1)^k = 0$$ We leave it to the reader to verify the cancellations.

Suppose we have two bounded below complexes complexes of abelian sheaves ${\mathcal F}^\bullet$ and ${\mathcal G}^\bullet$. We define the complex $\text{Tot}({\mathcal F}^\bullet\otimes_{\mathbf Z} {\mathcal G}^\bullet)$ to be to complex with terms $\bigoplus_{p + q = n} {\mathcal F}^p \otimes {\mathcal G}^q$ and differential according to the rule $$\tag{20.26.1.1} d(\alpha \otimes \beta) = d(\alpha)\otimes \beta + (-1)^{\deg(\alpha)} \alpha \otimes d(\beta)$$ when $\alpha$ and $\beta$ are homogeneous, see Homology, Definition 12.22.3.

Suppose that $M^\bullet$ and $N^\bullet$ are two bounded below complexes of abelian groups. Then if $m$, resp. $n$ is a cocycle for $M^\bullet$, resp. $N^\bullet$, it is immediate that $m \otimes n$ is a cocycle for $\text{Tot}(M^\bullet\otimes N^\bullet)$. Hence a cup product $$H^i(M^\bullet) \times H^j(N^\bullet) \longrightarrow H^{i + j}(Tot(M^\bullet\otimes N^\bullet)).$$ This is discussed also in More on Algebra, Section 15.59.

So the construction of the cup product in hypercohomology of complexes rests on a construction of a map of complexes $$\tag{20.26.1.2} \text{Tot}\left( \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) \otimes_{\mathbf Z} \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal G}^\bullet)) \right) \longrightarrow \text{Tot}( \check{\mathcal{C}}^\bullet({\mathcal U}, \text{Tot}({\mathcal F}^\bullet\otimes {\mathcal G}^\bullet) ))$$ This map is denoted $\cup$ and is given by the rule $$(\alpha \cup \beta)_{i_0 \ldots i_p} = \sum\nolimits_{r = 0}^p \epsilon(n, m, p, r) \alpha_{i_0 \ldots i_r} \otimes \beta_{i_r \ldots i_p}.$$ where $\alpha$ has degree $n$ and $\beta$ has degree $m$ and with $$\epsilon(n, m, p, r) = (-1)^{(p + r)n + rp + r}.$$ Note that $\epsilon(n, m, p, n) = 1$. Hence if $\mathcal{F}^\bullet = \mathcal{F}[0]$ is the complex consisting in a single abelian sheaf $\mathcal{F}$ placed in degree $0$, then there no signs in the formula for $\cup$ (as in that case $\alpha_{i_0 \ldots i_r} = 0$ unless $r = n$). For an explanation of why there has to be a sign and how to compute it see [SGA4, Exposee XVII] by Deligne. To check (20.26.1.2) is a map of complexes we have to show that $$d(\alpha \cup \beta) = d(\alpha) \cup \beta + (-1)^{\deg(\alpha)} \alpha \cup d(\beta)$$ by the definition of the differential on $\text{Tot}( \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) \otimes_{\mathbf Z} \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal G}^\bullet)) )$ as given in Homology, Definition 12.22.3. We compute first \begin{align*} d(\alpha \cup \beta)_{i_0 \ldots i_{p + 1}} = & \sum\nolimits_{j = 0}^{p + 1} (-1)^j (\alpha \cup \beta)_{i_0 \ldots \hat i_j \ldots i_{p + 1}} + (-1)^{p + 1} d_{{\mathcal F} \otimes {\mathcal G}} ((\alpha \cup \beta)_{i_0 \ldots i_{p + 1}}) \\ = & \sum\nolimits_{j = 0}^{p + 1} \sum\nolimits_{r = 0}^{j - 1} (-1)^j \epsilon(n, m, p, r) \alpha_{i_0 \ldots i_r} \otimes \beta_{i_r \ldots \hat i_j \ldots i_{p + 1}} + \\ & \sum\nolimits_{j = 0}^{p + 1} \sum\nolimits_{r = j + 1}^{p + 1} (-1)^j \epsilon(n, m, p, r - 1) \alpha_{i_0 \ldots \hat i_j \ldots i_r} \otimes \beta_{i_r \ldots i_{p + 1}} + \\ & \sum\nolimits_{r = 0}^{p + 1} (-1)^{p + 1} \epsilon(n, m, p + 1, r) d_{{\mathcal F} \otimes {\mathcal G}} (\alpha_{i_0 \ldots i_r} \otimes \beta_{i_r \ldots i_{p + 1}}) \end{align*} and note that the summands in the last term equal $$(-1)^{p + 1} \epsilon(n, m, p + 1, r) \left( d_{\mathcal F}(\alpha_{i_0 \ldots i_r}) \otimes \beta_{i_r \ldots i_{p + 1}} + (-1)^{n - r} \alpha_{i_0 \ldots i_r} \otimes d_{\mathcal G}(\beta_{i_r \ldots i_{p + 1}}) \right).$$ because $\deg_\mathcal{F}(\alpha_{i_0 \ldots i_r}) = n - r$. On the other hand \begin{align*} (d(\alpha) \cup \beta)_{i_0\ldots i_{p + 1}} = & \sum\nolimits_{r = 0}^{p + 1} \epsilon(n + 1, m, p + 1, r) d(\alpha)_{i_0\ldots i_r} \otimes \beta_{i_r\ldots i_{p + 1}} \\ = & \sum\nolimits_{r = 0}^{p + 1} \sum\nolimits_{j = 0}^{r} \epsilon(n + 1, m, p + 1, r) (-1)^j \alpha_{i_0\ldots\hat{i_j}\ldots i_r} \otimes \beta_{i_r\ldots i_{p + 1}} + \\ & \sum\nolimits_{r = 0}^{p + 1} \epsilon(n + 1, m, p + 1, r) (-1)^r d_{\mathcal F}(\alpha_{i_0 \ldots i_r}) \otimes \beta_{i_r\ldots i_{p + 1}} \end{align*} and \begin{align*} (\alpha \cup d(\beta))_{i_0\ldots i_{p + 1}} = & \sum\nolimits_{r = 0}^{p + 1} \epsilon(n, m + 1, p + 1, r) \alpha_{i_0 \ldots i_r} \otimes d(\beta)_{i_r \ldots i_{p + 1}} \\ = & \sum\nolimits_{r = 0}^{p + 1} \sum\nolimits_{j = r}^{p + 1} \epsilon(n, m + 1, p + 1, r) (-1)^{j - r} \alpha_{i_0 \ldots i_r} \otimes \beta_{i_r \ldots \hat{i_j}\ldots i_{p + 1}} + \\ & \sum\nolimits_{r = 0}^{p + 1} \epsilon(n, m + 1, p + 1, r) (-1)^{p + 1 - r} \alpha_{i_0 \ldots i_r} \otimes d_{\mathcal G}(\beta_{i_r \ldots i_{p + 1}}) \end{align*} The desired equality holds if we have \begin{align*} (-1)^{p + 1} \epsilon(n, m, p + 1, r) & = \epsilon(n + 1, m, p + 1, r) (-1)^r \\ (-1)^{p + 1} \epsilon(n, m, p + 1, r) (-1)^{n - r} & = (-1)^n \epsilon(n, m + 1, p + 1, r) (-1)^{p + 1 - r} \\ \epsilon(n + 1, m, p + 1, r) (-1)^r & = (-1)^{1 + n} \epsilon(n, m + 1, p + 1, r - 1) \\ (-1)^j \epsilon(n, m, p, r) & = (-1)^n \epsilon(n, m + 1, p + 1, r) (-1)^{j - r} \\ (-1)^j \epsilon(n, m, p, r - 1) & = \epsilon(n + 1, m, p + 1, r) (-1)^j \end{align*} (The third equality is necessary to get the terms with $r = j$ from $d(\alpha) \cup \beta$ and $(-1)^n \alpha \cup d(\beta)$ to cancel each other.) We leave the verifications to the reader. (Alternatively, check the script signs.gp in the scripts subdirectory of the Stacks project.)

Associativity of the cup product. Suppose that ${\mathcal F}^\bullet$, ${\mathcal G}^\bullet$ and ${\mathcal H}^\bullet$ are bounded below complexes of abelian groups on $X$. The obvious map (without the intervention of signs) is an isomorphism of complexes $$\text{Tot}( \text{Tot}({\mathcal F}^\bullet \otimes_{\mathbf Z} {\mathcal G}^\bullet) \otimes_{\mathbf Z} {\mathcal H}^\bullet ) \longrightarrow \text{Tot}( {\mathcal F}^\bullet \otimes_{\mathbf Z} \text{Tot}({\mathcal G}^\bullet \otimes_{\mathbf Z} {\mathcal H}^\bullet) ).$$ Another way to say this is that the triple complex ${\mathcal F}^\bullet \otimes_{\mathbf Z} {\mathcal G}^\bullet \otimes_{\mathbf Z} {\mathcal H}^\bullet$ gives rise to a well defined total complex with differential satisfying $$d(\alpha \otimes \beta \otimes \gamma) = d(\alpha) \otimes \beta \otimes \gamma + (-1)^{\deg(\alpha)} \alpha \otimes d(\beta) \otimes \gamma + (-1)^{\deg(\alpha) + \deg(\beta)} \alpha \otimes \beta \otimes d(\gamma)$$ for homogeneous elements. Using this map it is easy to verify that $$(\alpha \cup \beta) \cup \gamma = \alpha \cup ( \beta \cup \gamma)$$ namely, if $\alpha$ has degree $a$, $\beta$ has degree $b$ and $\gamma$ has degree $c$, then \begin{align*} ((\alpha \cup \beta) \cup \gamma)_{i_0 \ldots i_p} = & \sum\nolimits_{r = 0}^p \epsilon(a + b, c, p, r) (\alpha \cup \beta)_{i_0 \ldots i_r} \otimes \gamma_{i_r \ldots i_p} \\ = & \sum\nolimits_{r = 0}^p \sum\nolimits_{s = 0}^r \epsilon(a + b, c, p, r) \epsilon(a, b, r, s) \alpha_{i_0 \ldots i_s} \otimes \beta_{i_s \ldots i_r} \otimes \gamma_{i_r \ldots i_p} \end{align*} and \begin{align*} (\alpha \cup (\beta \cup \gamma)_{i_0\ldots i_p} = & \sum\nolimits_{s = 0}^p \epsilon(a, b + c, p, s) \alpha_{i_0 \ldots i_s} \otimes (\beta \cup \gamma)_{i_s \ldots i_p} \\ = & \sum\nolimits_{s = 0}^p \sum\nolimits_{r = s}^p \epsilon(a, b + c, p, s) \epsilon(b, c, p - s, r - s) \alpha_{i_0 \ldots i_s} \otimes \beta_{i_s \ldots i_r} \otimes \gamma_{i_r \ldots i_p} \end{align*} and a trivial mod $2$ calculation shows the signs match up. (Alternatively, check the script signs.gp in the scripts subdirectory of the Stacks project.)

Finally, we indicate why the cup product preserves a graded commutative structure, at least on a cohomological level. For this we use the operator $\tau$ introduced above. Let ${\mathcal F}^\bullet$ be a bounded below complexes of abelian groups, and assume we are given a graded commutative multiplication $$\wedge^\bullet : \text{Tot}({\mathcal F}^\bullet\otimes {\mathcal F}^\bullet) \longrightarrow {\mathcal F}^\bullet.$$ This means the following: For $s$ a local section of ${\mathcal F}^a$, and $t$ a local section of ${\mathcal F}^b$ we have $s \wedge t$ a local section of ${\mathcal F}^{a + b}$. Graded commutative means we have $s \wedge t = (-1)^{ab} t \wedge s$. Since $\wedge$ is a map of complexes we have $d(s\wedge t) = d(s) \wedge t + (-1)^a s \wedge t$. The composition $$\text{Tot}( \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) \otimes \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) ) \to \text{Tot}( \check{\mathcal{C}}^\bullet({\mathcal U}, \text{Tot}({\mathcal F}^\bullet\otimes_{\mathbf Z}{\mathcal F}^\bullet)) ) \to \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet))$$ induces a cup product on cohomology $$H^n( \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) ) \times H^m( \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) ) \longrightarrow H^{n + m}( \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) )$$ and so in the limit also a product on Čech cohomology and therefore (using hypercoverings if needed) a product in cohomology of ${\mathcal F}^\bullet$. We claim this product (on cohomology) is graded commutative as well. To prove this we first consider an element $\alpha$ of degree $n$ in $\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet))$ and an element $\beta$ of degree $m$ in $\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet))$ and we compute \begin{align*} \wedge^\bullet(\alpha \cup \beta)_{i_0 \ldots i_p} = & \sum\nolimits_{r = 0}^p \epsilon(n, m, p, r) \alpha_{i_0 \ldots i_r} \wedge \beta_{i_r \ldots i_p} \\ = & \sum\nolimits_{r = 0}^p \epsilon(n, m, p, r) (-1)^{\deg(\alpha_{i_0 \ldots i_r})\deg(\beta_{i_r \ldots i_p})} \beta_{i_r \ldots i_p} \wedge \alpha_{i_0 \ldots i_r} \end{align*} because $\wedge$ is graded commutative. On the other hand we have \begin{align*} \tau(\wedge^\bullet(\tau(\beta) \cup \tau(\alpha)))_{i_0 \ldots i_p} = & \chi(p) \sum\nolimits_{r = 0}^p \epsilon(m, n, p, r) \tau(\beta)_{i_p \ldots i_{p - r}} \wedge \tau(\alpha)_{i_{p - r} \ldots i_0} \\ = & \chi(p) \sum\nolimits_{r = 0}^p \epsilon(m, n, p, r) \chi(r) \chi(p - r) \beta_{i_{p - r} \ldots i_p} \wedge \alpha_{i_0 \ldots i_{p - r}} \\ = & \chi(p) \sum\nolimits_{r = 0}^p \epsilon(m, n, p, p - r) \chi(r) \chi(p - r) \beta_{i_r \ldots i_p} \wedge \alpha_{i_0 \ldots i_r} \end{align*} where $\chi(t) = (-1)^{\frac{t(t + 1)}{2}}$. Since we proved earlier that $\tau$ acts as the identity on cohomology we have to verify that $$\epsilon(n, m, p, r) (-1)^{(n - r)(m - (p - r))} = (-1)^{nm} \chi(p)\epsilon(m, n, p, p - r) \chi(r) \chi(p - r)$$ A trivial mod $2$ calculation shows these signs match up. (Alternatively, check the script signs.gp in the scripts subdirectory of the Stacks project.)

Finally, we study the compatibility of cup product with boundary maps. Suppose that $$0 \to {\mathcal F}_1^\bullet \to {\mathcal F}_2^\bullet \to {\mathcal F}_3^\bullet \to 0 \quad\text{and}\quad 0 \leftarrow {\mathcal G}_1^\bullet \leftarrow {\mathcal G}_2^\bullet \leftarrow {\mathcal G}_3^\bullet \leftarrow 0$$ are short exact sequences of bounded below complexes of abelian sheaves on $X$. Let ${\mathcal H}^\bullet$ be another bounded below complex of abelian sheaves, and suppose we have maps of complexes $$\gamma_i : \text{Tot}({\mathcal F}_i^\bullet \otimes_{\mathbf Z} {\mathcal G}_i^\bullet) \longrightarrow {\mathcal H}^\bullet$$ which are compatible with the maps between the complexes, namely such that the diagrams $$\xymatrix{ \text{Tot}({\mathcal F}_1^\bullet \otimes_{\mathbf Z} {\mathcal G}_1^\bullet) \ar[d]_{\gamma_1} & \text{Tot}({\mathcal F}_1^\bullet \otimes_{\mathbf Z} {\mathcal G}_2^\bullet) \ar[l] \ar[d] \\ \mathcal{H}^\bullet & \text{Tot}({\mathcal F}_2^\bullet \otimes_{\mathbf Z} {\mathcal G}_2^\bullet) \ar[l]_-{\gamma_2} }$$ and $$\xymatrix{ \text{Tot}({\mathcal F}_2^\bullet \otimes_{\mathbf Z} {\mathcal G}_2^\bullet) \ar[d]_{\gamma_2} & \text{Tot}({\mathcal F}_2^\bullet \otimes_{\mathbf Z} {\mathcal G}_3^\bullet) \ar[l] \ar[d] \\ \mathcal{H}^\bullet & \text{Tot}({\mathcal F}_3^\bullet \otimes_{\mathbf Z} {\mathcal G}_3^\bullet) \ar[l]_-{\gamma_3} }$$ are commutative.

Lemma 20.26.2. In the situation above, assume Čech cohomology agrees with cohomology for the sheaves $\mathcal{F}_i^p$ and $\mathcal{G}_j^q$. Let $a_3 \in H^n(X, \mathcal{F}_3^\bullet)$ and $b_1 \in H^m(X, \mathcal{G}_1^\bullet)$. Then we have $$\gamma_1( \partial a_3 \cup b_1) = (-1)^{n + 1} \gamma_3( a_3 \cup \partial b_1)$$ in $H^{n + m}(X, \mathcal{H}^\bullet)$ where $\partial$ indicates the boundary map on cohomology associated to the short exact sequences of complexes above.

Proof. We will use the following conventions and notation. We think of ${\mathcal F}_1^p$ as a subsheaf of ${\mathcal F}_2^p$ and we think of ${\mathcal G}_3^q$ as a subsheaf of ${\mathcal G}_2^q$. Hence if $s$ is a local section of ${\mathcal F}_1^p$ we use $s$ to denote the corresponding section of ${\mathcal F}_2^p$ as well. Similarly for local sections of ${\mathcal G}_3^q$. Furthermore, if $s$ is a local section of ${\mathcal F}_2^p$ then we denote $\bar s$ its image in ${\mathcal F}_3^p$. Similarly for the map ${\mathcal G}_2^q \to {\mathcal G}^q_1$. In particular if $s$ is a local section of ${\mathcal F}_2^p$ and $\bar s = 0$ then $s$ is a local section of ${\mathcal F}_1^p$. The commutativity of the diagrams above implies, for local sections $s$ of ${\mathcal F}_2^p$ and $t$ of ${\mathcal G}_3^q$ that $\gamma_2(s \otimes t) = \gamma_3(\bar s \otimes t)$ as sections of ${\mathcal H}^{p + q}$.

Let ${\mathcal U} : X = \bigcup_{i \in I} U_i$ be an open covering of $X$. Suppose that $\alpha_3$, resp. $\beta_1$ is a degree $n$, resp. $m$ cocycle of $\text{Tot}( \check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}_3^\bullet))$, resp. $\text{Tot}( \check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal G}_1^\bullet))$ representing $a_3$, resp. $b_1$. After refining $\mathcal{U}$ if necessary, we can find cochains $\alpha_2$, resp. $\beta_2$ of degree $n$, resp. $m$ in $\text{Tot}( \check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}_2^\bullet))$, resp. $\text{Tot}( \check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal G}_2^\bullet))$ mapping to $\alpha_3$, resp. $\beta_1$. Then we see that $$\overline{d(\alpha_2)} = d(\bar \alpha_2) = 0 \quad\text{and}\quad \overline{d(\beta_2)} = d(\bar \beta_2) = 0.$$ This means that $\alpha_1 = d(\alpha_2)$ is a degree $n + 1$ cocycle in $\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}_1^\bullet))$ representing $\partial a_3$. Similarly, $\beta_3 = d(\beta_2)$ is a degree $m + 1$ cocycle in $\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal G}_3^\bullet))$ representing $\partial b_1$. Thus we may compute \begin{align*} d(\gamma_2(\alpha_2 \cup \beta_2)) & = \gamma_2(d(\alpha_2 \cup \beta_2)) \\ & = \gamma_2(d(\alpha_2) \cup \beta_2 + (-1)^n \alpha_2 \cup d(\beta_2) ) \\ & = \gamma_2( \alpha_1 \cup \beta_2) + (-1)^n \gamma_2( \alpha_2 \cup \beta_3) \\ & = \gamma_1(\alpha_1 \cup \beta_1) + (-1)^n \gamma_3(\alpha_3 \cup \beta_3) \end{align*} So this even tells us that the sign is $(-1)^{n + 1}$ as indicated in the lemma1. $\square$

Lemma 20.26.3. Let $X$ be a topological space. Let $\mathcal{O}' \to \mathcal{O}$ be a surjection of sheaves of rings whose kernel $\mathcal{I} \subset \mathcal{O}'$ has square zero. Then $M = H^1(X, \mathcal{I})$ is a $R = H^0(X, \mathcal{O})$-module and the boundary map $\partial : R \to M$ associated to the short exact sequence $$0 \to \mathcal{I} \to \mathcal{O}' \to \mathcal{O} \to 0$$ is a derivation (Algebra, Definition 10.130.1).

Proof. The map $\mathcal{O}' \to \mathop{\mathcal{H}\!\mathit{om}}\nolimits(\mathcal{I}, \mathcal{I})$ factors through $\mathcal{O}$ as $\mathcal{I} \cdot \mathcal{I} = 0$ by assumption. Hence $\mathcal{I}$ is a sheaf of $\mathcal{O}$-modules and this defines the $R$-module structure on $M$. The boundary map is additive hence it suffices to prove the Leibniz rule. Let $f \in R$. Choose an open covering $\mathcal{U} : X = \bigcup U_i$ such that there exist $f_i \in \mathcal{O}'(U_i)$ lifting $f|_{U_i} \in \mathcal{O}(U_i)$. Observe that $f_i - f_j$ is an element of $\mathcal{I}(U_i \cap U_j)$. Then $\partial(f)$ corresponds to the Čech cohomology class of the $1$-cocycle $\alpha$ with $\alpha_{i_0i_1} = f_{i_0} - f_{i_1}$. (Observe that by Lemma 20.12.3 the first Čech cohomology group with respect to $\mathcal{U}$ is a submodule of $M$.) Next, let $g \in R$ be a second element and assume (after possibly refining the open covering) that $g_i \in \mathcal{O}'(U_i)$ lifts $g|_{U_i} \in \mathcal{O}(U_i)$. Then we see that $\partial(g)$ is given by the cocycle $\beta$ with $\beta_{i_0i_1} = g_{i_0} - g_{i_1}$. Since $f_ig_i \in \mathcal{O}'(U_i)$ lifts $fg|_{U_i}$ we see that $\partial(fg)$ is given by the cocycle $\gamma$ with $$\gamma_{i_0i_1} = f_{i_0}g_{i_0} - f_{i_1}g_{i_1} = (f_{i_0} - f_{i_1})g_{i_0} + f_{i_1}(g_{i_0} - g_{i_1}) = \alpha_{i_0i_1}g + f\beta_{i_0i_1}$$ by our definition of the $\mathcal{O}$-module structure on $\mathcal{I}$. This proves the Leibniz rule and the proof is complete. $\square$

1. The sign depends on the convention for the signs in the long exact sequence in cohomology associated to a triangle in $D(X)$. The conventions in the Stacks project are (a) distinguished triangles correspond to termwise split exact sequences and (b) the boundary maps in the long exact sequence are given by the maps in the snake lemma without the intervention of signs. See Derived Categories, Section 13.10.

The code snippet corresponding to this tag is a part of the file cohomology.tex and is located in lines 4607–5587 (see updates for more information).

\section{{\v C}ech cohomology of complexes}
\label{section-cech-cohomology-of-complexes}

\noindent
In general for sheaves of abelian groups
${\mathcal F}$ and ${\mathcal G}$ on $X$ there is a cup product map
$$H^i(X, {\mathcal F}) \times H^j(X, {\mathcal G}) \longrightarrow H^{i + j}(X, {\mathcal F} \otimes_{\mathbf Z} {\mathcal G}).$$
In this section we define it using {\v C}ech cocycles by an explicit formula
for the cup product. If you are worried about the fact that cohomology may not
equal {\v C}ech cohomology, then you can use hypercoverings and still
use the cocycle notation. This also has the advantage that
it works to define the cup product for hypercohomology on any topos (insert
future reference here).

\medskip\noindent
Let ${\mathcal F}^\bullet$ be a bounded below complex of presheaves of abelian
groups on $X$. We can often compute $H^n(X, {\mathcal F}^\bullet)$
using {\v C}ech cocycles. Namely, let
${\mathcal U} : X = \bigcup_{i \in I} U_i$
be an open covering of $X$. Since the {\v C}ech complex
$\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})$
(Definition \ref{definition-cech-complex})
is functorial in the presheaf $\mathcal{F}$ we obtain a double complex
$\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F}^\bullet)$.
The associated total complex to
$\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)$
is the complex with degree $n$ term
$$\text{Tot}^n(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) = \bigoplus\nolimits_{p + q = n} \prod\nolimits_{i_0\ldots i_p} {\mathcal F}^q(U_{i_0\ldots i_p})$$
see
Homology, Definition \ref{homology-definition-associated-simple-complex}.
A typical element in $\text{Tot}^n$ will be denoted
$\alpha = \{\alpha_{i_0\ldots i_p}\}$ where
$\alpha_{i_0 \ldots i_p} \in \mathcal{F}^q(U_{i_0\ldots i_p})$.
In other words the $\mathcal{F}$-degree of $\alpha_{i_0\ldots i_p}$ is
$q = n - p$. This notation requires us to be aware of the degree $\alpha$
lives in at all times. We indicate this situation by the formula
$\deg_{\mathcal F}(\alpha_{i_0\ldots i_p}) = q$.
According to our conventions in
Homology, Definition \ref{homology-definition-associated-simple-complex}
the differential of an element $\alpha$ of degree $n$ is given by
$$d(\alpha)_{i_0\ldots i_{p + 1}} = \sum\nolimits_{j = 0}^{p + 1} (-1)^j \alpha_{i_0 \ldots \hat i_j \ldots i_{p + 1}} + (-1)^{p + 1}d_{{\mathcal F}}(\alpha_{i_0 \ldots i_{p + 1}})$$
where $d_\mathcal{F}$ denotes the differential on the complex
$\mathcal{F}^\bullet$.
The expression $\alpha_{i_0 \ldots \hat i_j \ldots i_{p + 1}}$ means the
restriction of $\alpha_{i_0 \ldots \hat i_j \ldots i_{p + 1}} \in {\mathcal F}(U_{i_0\ldots\hat i_j\ldots i_{p + 1}})$ to
$U_{i_0 \ldots i_{p + 1}}$.

\medskip\noindent
The construction of
$\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet))$
is functorial in ${\mathcal F}^\bullet$. As well there is a functorial
transformation

\label{equation-global-sections-to-cech}
\Gamma(X, {\mathcal F}^\bullet)
\longrightarrow
\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet))

of complexes defined by the following rule: The section
$s\in \Gamma(X, {\mathcal F}^n)$
is mapped to the element $\alpha = \{\alpha_{i_0\ldots i_p}\}$
with $\alpha_{i_0} = s|_{U_{i_0}}$ and $\alpha_{i_0\ldots i_p} = 0$
for $p>0$.

\medskip\noindent
Refinements. Let ${\mathcal V} = \{ V_j \}_{j\in J}$ be a
refinement of ${\mathcal U}$. This means there is a map $t: J \to I$
such that $V_j \subset U_{t(j)}$ for all $j\in J$. This gives
rise to a functorial transformation

\label{equation-transformation}
T_t :
\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet))
\longrightarrow
\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal V}, {\mathcal F}^\bullet)).

defined by the rule
$$T_t(\alpha)_{j_0\ldots j_p} = \alpha_{t(j_0)\ldots t(j_p)}|_{V_{j_0\ldots j_p}}.$$
Given two maps $t, t' : J \to I$ as above the maps
$T_t$ and $T_{t'}$ constructed above are homotopic.
The homotopy is given by
$$h(\alpha)_{j_0\ldots j_p} = \sum\nolimits_{a = 0}^{p} (-1)^a \alpha_{t(j_0)\ldots t(j_a) t'(j_a) \ldots t'(j_p)}$$
for an element $\alpha$ of degree $n$. This works
because of the following computation, again with
$\alpha$ an element of degree $n$ (so $d(\alpha)$
has degree $n + 1$ and $h(\alpha)$ has degree $n - 1$):
\begin{align*}
(
d(h(\alpha)) + h(d(\alpha))
)_{j_0\ldots j_p}
= &
\sum\nolimits_{k = 0}^p
(-1)^k
h(\alpha)_{j_0 \ldots \hat j_k \ldots j_p}
+ \\
&
(-1)^p
d_{\mathcal F}(h(\alpha)_{j_0 \ldots j_p})
+ \\
&
\sum\nolimits_{a = 0}^p
(-1)^a
d(\alpha)_{t(j_0) \ldots t(j_a) t'(j_a) \ldots t'(j_p)}
\\
= &
\sum\nolimits_{k = 0}^p
\sum\nolimits_{a = 0}^{k - 1}
(-1)^{k + a}
\alpha_{t(j_0)\ldots t(j_a)t'(j_a)\ldots \hat{t'(j_k)}\ldots t'(j_p)}
+ \\
&
\sum\nolimits_{k = 0}^p
\sum\nolimits_{a = k + 1}^p
(-1)^{k + a - 1}
\alpha_{t(j_0)\ldots \hat{t(j_k)}\ldots t(j_a)t'(j_a)\ldots t'(j_p)}
+ \\
&
\sum\nolimits_{a = 0}^p
(-1)^{p + a}
d_{\mathcal F}(\alpha_{t(j_0)\ldots t(j_a) t'(j_a) \ldots t'(j_p)})
+ \\
&
\sum\nolimits_{a = 0}^p
\sum\nolimits_{k = 0}^a
(-1)^{a + k}
\alpha_{t(j_0)\ldots\hat{t(j_k)}\ldots t(j_a)t'(j_a)\ldots t'(j_p)}
+ \\
&
\sum\nolimits_{a = 0}^p
\sum\nolimits_{k = a}^p
(-1)^{a + k + 1}
\alpha_{t(j_0) \ldots t(j_a) t'(j_a) \ldots \hat{t'(j_k)} \ldots t'(j_p)}
+ \\
&
\sum\nolimits_{a = 0}^p
(-1)^{a + p + 1}
d_{\mathcal F}(\alpha_{t(j_0)\ldots t(j_a) t'(j_a) \ldots t'(j_p)})
\\
= &
\alpha_{t'(j_0)\ldots t'(j_p)} +
(-1)^{2p + 1}\alpha_{t(j_0)\ldots t(j_p)}
\\
= &
T_{t'}(\alpha)_{j_0\ldots j_p} - T_t(\alpha)_{j_0\ldots j_p}
\end{align*}
We leave it to the reader to verify the cancellations. (Note that the
terms having both $k$ and $a$ in the 1st, 2nd and 4th, 5th summands
cancel, except the ones where $a = k$ which only occur in the 4th and 5th
and these cancel against each other except for the two desired terms.)
It follows that the induced map
$$H^n(T_t) : H^n( \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) ) \to H^n( \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal V}, {\mathcal F}^\bullet)) )$$
is independent of the choice of $t$. We define
{\it {\v C}ech hypercohomology} as the limit of the
{\v C}ech cohomology groups
over all refinements via the maps $H^\bullet(T_t)$.

\medskip\noindent
In the limit (over all open coverings of $X$) the following lemma provides
a map of {\v C}ech hypercohomology into cohomology, which is often an
isomorphism and is always an isomorphism if we use hypercoverings.

\begin{lemma}
\label{lemma-cech-complex-complex}
Let $(X, \mathcal{O}_X)$ be a ringed space.
Let $\mathcal{U} : X = \bigcup_{i \in I} U_i$ be
an open covering. For a bounded below complex $\mathcal{F}^\bullet$
of $\mathcal{O}_X$-modules there is a canonical map
$$\text{Tot}(\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F}^\bullet)) \longrightarrow R\Gamma(X, \mathcal{F}^\bullet)$$
functorial in $\mathcal{F}^\bullet$ and compatible with
(\ref{equation-global-sections-to-cech}) and (\ref{equation-transformation}).
There is a spectral sequence $(E_r, d_r)_{r \geq 0}$ with
$$E_2^{p, q} = H^p(\text{Tot}(\check{\mathcal{C}}^\bullet(\mathcal{U}, \underline{H}^q(\mathcal{F}^\bullet)))$$
converging to $H^{p + q}(X, \mathcal{F}^\bullet)$.
\end{lemma}

\begin{proof}
Let ${\mathcal I}^\bullet$ be a bounded below complex of injectives.
The map (\ref{equation-global-sections-to-cech}) for
$\mathcal{I}^\bullet$ is a map
$\Gamma(X, {\mathcal I}^\bullet) \to \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal I}^\bullet))$.
This is a quasi-isomorphism of complexes of abelian groups
as follows from
Homology, Lemma \ref{homology-lemma-double-complex-gives-resolution}
applied to the double complex
$\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal I}^\bullet)$ using
Lemma \ref{lemma-injective-trivial-cech}.
Suppose ${\mathcal F}^\bullet \to {\mathcal I}^\bullet$ is a quasi-isomorphism
of ${\mathcal F}^\bullet$ into a bounded below complex of injectives.
Since $R\Gamma(X, {\mathcal F}^\bullet)$ is represented by the complex
$\Gamma(X, {\mathcal I}^\bullet)$ we obtain the map of the lemma
using
$$\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) \longrightarrow \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal I}^\bullet)).$$
We omit the verification of functoriality and compatibilities.
To construct the spectral sequence of the lemma, choose a Cartan-Eilenberg
resolution $\mathcal{F}^\bullet \to \mathcal{I}^{\bullet, \bullet}$, see
Derived Categories, Lemma \ref{derived-lemma-cartan-eilenberg}. In this
case $\mathcal{F}^\bullet \to \text{Tot}(\mathcal{I}^{\bullet, \bullet})$
is an injective resolution and hence
$$\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, \text{Tot}({\mathcal I}^{\bullet, \bullet})))$$
computes $R\Gamma(X, \mathcal{F}^\bullet)$ as we've seen above.
By Homology, Remark \ref{homology-remark-triple-complex}
we can view this as the total complex associated to the
triple complex
$\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal I}^{\bullet, \bullet})$
hence, using the same remark we can view it as the total complex
associate to the double complex $A^{\bullet, \bullet}$ with terms
$$A^{n, m} = \bigoplus\nolimits_{p + q = n} \check{\mathcal{C}}^p({\mathcal U}, \mathcal{I}^{q, m})$$
Since $\mathcal{I}^{q, \bullet}$ is an injective resolution of
$\mathcal{F}^q$ we can apply the first spectral sequence associated to
$A^{\bullet, \bullet}$
(Homology, Lemma \ref{homology-lemma-ss-double-complex})
to get a spectral sequence with
$$E_1^{n, m} = \bigoplus\nolimits_{p + q = n} \check{\mathcal{C}}^p(\mathcal{U}, \underline{H}^m(\mathcal{F}^q))$$
which is the $n$th term of the complex
$\text{Tot}(\check{\mathcal{C}}^\bullet(\mathcal{U}, \underline{H}^m(\mathcal{F}^\bullet))$. Hence we obtain
$E_2$ terms as described in the lemma. Convergence by
\end{proof}

\noindent
Let $X$ be a topological space, let $\mathcal{U} : X = \bigcup_{i \in I} U_i$
be an open covering, and let $\mathcal{F}^\bullet$ be a bounded below
complex of presheaves of abelian groups. Consider the map
$\tau : \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) \to \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet))$
defined by
$$\tau(\alpha)_{i_0 \ldots i_p} = (-1)^{p(p + 1)/2} \alpha_{i_p \ldots i_0}.$$
Then we have for an element $\alpha$ of degree $n$ that
\begin{align*}
& d(\tau(\alpha))_{i_0 \ldots i_{p + 1}} \\
& =
\sum\nolimits_{j = 0}^{p + 1}
(-1)^j
\tau(\alpha)_{i_0 \ldots \hat i_j \ldots i_{p + 1}}
+
(-1)^{p + 1}
d_{\mathcal F}(\tau(\alpha)_{i_0 \ldots i_{p + 1}})
\\
& =
\sum\nolimits_{j = 0}^{p + 1}
(-1)^{j + \frac{p(p + 1)}{2}}
\alpha_{i_{p + 1} \ldots \hat i_j \ldots i_0}
+
(-1)^{p + 1 + \frac{(p + 1)(p + 2)}{2}}
d_{\mathcal F}(\alpha_{i_{p + 1} \ldots i_0})
\end{align*}
On the other hand we have
\begin{align*}
& \tau(d(\alpha))_{i_0\ldots i_{p + 1}} \\
& =
(-1)^{\frac{(p + 1)(p + 2)}{2}} d(\alpha)_{i_{p + 1} \ldots i_0}
\\
& =
(-1)^{\frac{(p + 1)(p + 2)}{2}}
\left(
\sum\nolimits_{j = 0}^{p + 1}
(-1)^j
\alpha_{i_{p + 1}\ldots \hat i_{p + 1 - j} \ldots i_0}
+
(-1)^{p + 1}
d_{\mathcal F}(\alpha_{i_{p + 1}\ldots i_0})
\right)
\end{align*}
Thus we conclude that $d(\tau(\alpha)) = \tau(d(\alpha))$
because $p(p + 1)/2 \equiv (p + 1)(p + 2)/2 + p + 1 \bmod 2$. In other words
$\tau$ is an endomorphism of the complex
$\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet))$.
Note that the diagram
$$\begin{matrix} \Gamma(X, {\mathcal F}^\bullet) & \longrightarrow & \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) \\ \downarrow \text{id} & & \downarrow \tau \\ \Gamma(X, {\mathcal F}^\bullet) & \longrightarrow & \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) \end{matrix}$$
commutes. In addition $\tau$ is clearly compatible with refinements.
This suggests that $\tau$ acts as the identity on {\v C}ech cohomology
(i.e., in the limit -- provided {\v C}ech hypercohomology agrees with
hypercohomology, which is always the case if we use hypercoverings).
We claim that $\tau$ actually is homotopic to the identity on the
total {\v C}ech complex
$\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet))$.
To prove this, we use as homotopy
$$h(\alpha)_{i_0 \ldots i_p} = \sum\nolimits_{a = 0}^p \epsilon_p(a) \alpha_{i_0 \ldots i_a i_p \ldots i_a} \quad\text{with}\quad \epsilon_p(a) = (-1)^{\frac{(p - a)(p - a - 1)}{2} + p}$$
for $\alpha$ of degree $n$. As usual we omit writing
$|_{U_{i_0 \ldots i_p}}$. This works
because of the following computation, again with
$\alpha$ an element of degree $n$:
\begin{align*}
(d(h(\alpha)) + h(d(\alpha)))_{i_0 \ldots i_p}
= &
\sum\nolimits_{k = 0}^p
(-1)^k
h(\alpha)_{i_0 \ldots \hat i_k \ldots i_p}
+ \\
&
(-1)^p
d_{\mathcal F}(h(\alpha)_{i_0 \ldots i_p})
+ \\
&
\sum\nolimits_{a = 0}^p
\epsilon_p(a)
d(\alpha)_{i_0 \ldots i_a i_p \ldots i_a}
\\
= &
\sum\nolimits_{k = 0}^p
\sum\nolimits_{a = 0}^{k - 1}
(-1)^k \epsilon_{p - 1}(a)
\alpha_{i_0 \ldots i_a i_p \ldots \hat{i_k} \ldots i_a}
+ \\
&
\sum\nolimits_{k = 0}^p
\sum\nolimits_{a = k + 1}^p
(-1)^k \epsilon_{p - 1}(a - 1)
\alpha_{i_0 \ldots \hat{i_k} \ldots i_a i_p \ldots i_a}
+ \\
&
\sum\nolimits_{a = 0}^p
(-1)^p \epsilon_p(a)
d_{\mathcal F}(\alpha_{i_0 \ldots i_a i_p \ldots i_a})
+ \\
&
\sum\nolimits_{a = 0}^p
\sum\nolimits_{k = 0}^a
\epsilon_p(a) (-1)^k
\alpha_{i_0 \ldots \hat{i_k} \ldots i_a i_p \ldots i_a}
+ \\
&
\sum\nolimits_{a = 0}^p
\sum\nolimits_{k = a}^p
\epsilon_p(a) (-1)^{p + a + 1 - k}
\alpha_{i_0 \ldots i_a i_p \ldots \hat{i_k} \ldots i_a}
+ \\
&
\sum\nolimits_{a = 0}^p
\epsilon_p(a) (-1)^{p + 1}
d_{\mathcal F}(\alpha_{i_0 \ldots i_a i_p \ldots i_a})
\\
= &
\epsilon_p(0) \alpha_{i_p \ldots i_0} +
\epsilon_p(p) (-1)^{p + 1} \alpha_{i_0 \ldots i_p} \\
= &
(-1)^{\frac{p(p + 1)}{2}}\alpha_{i_p \ldots i_0}
- \alpha_{i_0 \ldots i_p}
\end{align*}
$$(-1)^k \epsilon_{p - 1}(a) + \epsilon_p(a)(-1)^{p + a + 1 - k} = 0 \quad\text{and}\quad (-1)^k\epsilon_{p - 1}(a - 1) + \epsilon_p(a) (-1)^k = 0$$
We leave it to the reader to verify the cancellations.

\medskip\noindent
Suppose we have two bounded below complexes complexes of abelian sheaves
${\mathcal F}^\bullet$ and ${\mathcal G}^\bullet$. We define the complex
$\text{Tot}({\mathcal F}^\bullet\otimes_{\mathbf Z} {\mathcal G}^\bullet)$
to be to complex with terms
$\bigoplus_{p + q = n} {\mathcal F}^p \otimes {\mathcal G}^q$
and differential according to the rule

\label{equation-differential-tensor-product-complexes}
d(\alpha \otimes \beta) =
d(\alpha)\otimes \beta + (-1)^{\deg(\alpha)} \alpha \otimes d(\beta)

when $\alpha$ and $\beta$ are homogeneous, see
Homology, Definition \ref{homology-definition-associated-simple-complex}.

\medskip\noindent
Suppose that $M^\bullet$ and $N^\bullet$ are two bounded below
complexes of abelian groups. Then if $m$, resp.\ $n$
is a cocycle for $M^\bullet$, resp.\ $N^\bullet$, it is immediate
that $m \otimes n$ is a cocycle for $\text{Tot}(M^\bullet\otimes N^\bullet)$.
Hence a cup product
$$H^i(M^\bullet) \times H^j(N^\bullet) \longrightarrow H^{i + j}(Tot(M^\bullet\otimes N^\bullet)).$$
This is discussed also in
More on Algebra, Section \ref{more-algebra-section-products-tor}.

\medskip\noindent
So the construction of the cup product in hypercohomology
of complexes rests on a construction of a map of complexes

\label{equation-needs-signs}
\text{Tot}\left(
\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet))
\otimes_{\mathbf Z}
\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal G}^\bullet))
\right)
\longrightarrow
\text{Tot}(
\check{\mathcal{C}}^\bullet({\mathcal U},
\text{Tot}({\mathcal F}^\bullet\otimes {\mathcal G}^\bullet)
))

This map is denoted $\cup$ and is given by the rule
$$(\alpha \cup \beta)_{i_0 \ldots i_p} = \sum\nolimits_{r = 0}^p \epsilon(n, m, p, r) \alpha_{i_0 \ldots i_r} \otimes \beta_{i_r \ldots i_p}.$$
where $\alpha$ has degree $n$ and $\beta$ has degree $m$
and with
$$\epsilon(n, m, p, r) = (-1)^{(p + r)n + rp + r}.$$
Note that $\epsilon(n, m, p, n) = 1$. Hence if
$\mathcal{F}^\bullet = \mathcal{F}[0]$ is the complex
consisting in a single abelian sheaf $\mathcal{F}$ placed in degree $0$,
then there no signs in the formula for $\cup$ (as in that case
$\alpha_{i_0 \ldots i_r} = 0$ unless $r = n$).
For an explanation of why there has to be a sign and how to
compute it see \cite[Exposee XVII]{SGA4} by Deligne.
To check (\ref{equation-needs-signs})
is a map of complexes we have to show that
$$d(\alpha \cup \beta) = d(\alpha) \cup \beta + (-1)^{\deg(\alpha)} \alpha \cup d(\beta)$$
by the definition of the differential on
$\text{Tot}( \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) \otimes_{\mathbf Z} \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal G}^\bullet)) )$
as given in
Homology, Definition \ref{homology-definition-associated-simple-complex}.
We compute first
\begin{align*}
d(\alpha \cup \beta)_{i_0 \ldots i_{p + 1}}
= &
\sum\nolimits_{j = 0}^{p + 1}
(-1)^j
(\alpha \cup \beta)_{i_0 \ldots \hat i_j \ldots i_{p + 1}}
+
(-1)^{p + 1}
d_{{\mathcal F} \otimes {\mathcal G}}
((\alpha \cup \beta)_{i_0 \ldots i_{p + 1}})
\\
= &
\sum\nolimits_{j = 0}^{p + 1}
\sum\nolimits_{r = 0}^{j - 1}
(-1)^j \epsilon(n, m, p, r)
\alpha_{i_0 \ldots i_r} \otimes \beta_{i_r \ldots \hat i_j \ldots i_{p + 1}}
+ \\
&
\sum\nolimits_{j = 0}^{p + 1}
\sum\nolimits_{r = j + 1}^{p + 1}
(-1)^j \epsilon(n, m, p, r - 1)
\alpha_{i_0 \ldots \hat i_j \ldots i_r} \otimes \beta_{i_r \ldots i_{p + 1}}
+ \\
&
\sum\nolimits_{r = 0}^{p + 1}
(-1)^{p + 1} \epsilon(n, m, p + 1, r)
d_{{\mathcal F} \otimes {\mathcal G}}
(\alpha_{i_0 \ldots i_r} \otimes \beta_{i_r \ldots i_{p + 1}})
\end{align*}
and note that the summands in the last term equal
$$(-1)^{p + 1} \epsilon(n, m, p + 1, r) \left( d_{\mathcal F}(\alpha_{i_0 \ldots i_r}) \otimes \beta_{i_r \ldots i_{p + 1}} + (-1)^{n - r} \alpha_{i_0 \ldots i_r} \otimes d_{\mathcal G}(\beta_{i_r \ldots i_{p + 1}}) \right).$$
because $\deg_\mathcal{F}(\alpha_{i_0 \ldots i_r}) = n - r$.
On the other hand
\begin{align*}
(d(\alpha) \cup \beta)_{i_0\ldots i_{p + 1}}
= &
\sum\nolimits_{r = 0}^{p + 1}
\epsilon(n + 1, m, p + 1, r)
d(\alpha)_{i_0\ldots i_r} \otimes \beta_{i_r\ldots i_{p + 1}}
\\
= &
\sum\nolimits_{r = 0}^{p + 1}
\sum\nolimits_{j = 0}^{r}
\epsilon(n + 1, m, p + 1, r) (-1)^j
\alpha_{i_0\ldots\hat{i_j}\ldots i_r} \otimes \beta_{i_r\ldots i_{p + 1}}
+ \\
&
\sum\nolimits_{r = 0}^{p + 1}
\epsilon(n + 1, m, p + 1, r) (-1)^r
d_{\mathcal F}(\alpha_{i_0 \ldots i_r}) \otimes \beta_{i_r\ldots i_{p + 1}}
\end{align*}
and
\begin{align*}
(\alpha \cup d(\beta))_{i_0\ldots i_{p + 1}}
= &
\sum\nolimits_{r = 0}^{p + 1}
\epsilon(n, m + 1, p + 1, r)
\alpha_{i_0 \ldots i_r} \otimes d(\beta)_{i_r \ldots i_{p + 1}}
\\
= &
\sum\nolimits_{r = 0}^{p + 1}
\sum\nolimits_{j = r}^{p + 1}
\epsilon(n, m + 1, p + 1, r) (-1)^{j - r}
\alpha_{i_0 \ldots i_r} \otimes \beta_{i_r \ldots \hat{i_j}\ldots i_{p + 1}}
+ \\
&
\sum\nolimits_{r = 0}^{p + 1}
\epsilon(n, m + 1, p + 1, r) (-1)^{p + 1 - r}
\alpha_{i_0 \ldots i_r} \otimes d_{\mathcal G}(\beta_{i_r \ldots i_{p + 1}})
\end{align*}
The desired equality holds if we have
\begin{align*}
(-1)^{p + 1} \epsilon(n, m, p + 1, r)
& =
\epsilon(n + 1, m, p + 1, r) (-1)^r \\
(-1)^{p + 1} \epsilon(n, m, p + 1, r) (-1)^{n - r}
& =
(-1)^n \epsilon(n, m + 1, p + 1, r) (-1)^{p + 1 - r} \\
\epsilon(n + 1, m, p + 1, r) (-1)^r
& =
(-1)^{1 + n} \epsilon(n, m + 1, p + 1, r - 1) \\
(-1)^j \epsilon(n, m, p, r)
& =
(-1)^n \epsilon(n, m + 1, p + 1, r) (-1)^{j - r} \\
(-1)^j \epsilon(n, m, p, r - 1)
& =
\epsilon(n + 1, m, p + 1, r) (-1)^j
\end{align*}
(The third equality is necessary to get the terms with $r = j$
from $d(\alpha) \cup \beta$ and $(-1)^n \alpha \cup d(\beta)$
to cancel each other.) We leave the verifications to the reader.
(Alternatively, check the script signs.gp in the scripts subdirectory
of the Stacks project.)

\medskip\noindent
Associativity of the cup product. Suppose that ${\mathcal F}^\bullet$,
${\mathcal G}^\bullet$ and ${\mathcal H}^\bullet$ are bounded below
complexes of abelian groups on $X$. The obvious map
(without the intervention of signs) is an isomorphism
of complexes
$$\text{Tot}( \text{Tot}({\mathcal F}^\bullet \otimes_{\mathbf Z} {\mathcal G}^\bullet) \otimes_{\mathbf Z} {\mathcal H}^\bullet ) \longrightarrow \text{Tot}( {\mathcal F}^\bullet \otimes_{\mathbf Z} \text{Tot}({\mathcal G}^\bullet \otimes_{\mathbf Z} {\mathcal H}^\bullet) ).$$
Another way to say this is that the triple complex
${\mathcal F}^\bullet \otimes_{\mathbf Z} {\mathcal G}^\bullet \otimes_{\mathbf Z} {\mathcal H}^\bullet$ gives rise to a well defined
total complex with differential satisfying
$$d(\alpha \otimes \beta \otimes \gamma) = d(\alpha) \otimes \beta \otimes \gamma + (-1)^{\deg(\alpha)} \alpha \otimes d(\beta) \otimes \gamma + (-1)^{\deg(\alpha) + \deg(\beta)} \alpha \otimes \beta \otimes d(\gamma)$$
for homogeneous elements. Using this map it is easy to verify that
$$(\alpha \cup \beta) \cup \gamma = \alpha \cup ( \beta \cup \gamma)$$
namely, if $\alpha$ has degree $a$, $\beta$ has degree $b$ and
$\gamma$ has degree $c$, then
\begin{align*}
((\alpha \cup \beta) \cup \gamma)_{i_0 \ldots i_p}
= &
\sum\nolimits_{r = 0}^p
\epsilon(a + b, c, p, r)
(\alpha \cup \beta)_{i_0 \ldots i_r} \otimes \gamma_{i_r \ldots i_p}
\\
= &
\sum\nolimits_{r = 0}^p
\sum\nolimits_{s = 0}^r
\epsilon(a + b, c, p, r) \epsilon(a, b, r, s)
\alpha_{i_0 \ldots i_s} \otimes
\beta_{i_s \ldots i_r} \otimes
\gamma_{i_r \ldots i_p}
\end{align*}
and
\begin{align*}
(\alpha \cup (\beta \cup \gamma)_{i_0\ldots i_p}
= &
\sum\nolimits_{s = 0}^p
\epsilon(a, b + c, p, s)
\alpha_{i_0 \ldots i_s} \otimes (\beta \cup \gamma)_{i_s \ldots i_p}
\\
= &
\sum\nolimits_{s = 0}^p
\sum\nolimits_{r = s}^p
\epsilon(a, b + c, p, s) \epsilon(b, c, p - s, r - s)
\alpha_{i_0 \ldots i_s} \otimes \beta_{i_s \ldots i_r} \otimes
\gamma_{i_r \ldots i_p}
\end{align*}
and a trivial mod $2$ calculation shows the signs match up.
(Alternatively, check the script signs.gp in the scripts subdirectory
of the Stacks project.)

\medskip\noindent
Finally, we indicate why the cup product preserves a graded commutative
structure, at least on a cohomological level. For this we use the operator
$\tau$ introduced above. Let ${\mathcal F}^\bullet$ be a bounded below
complexes of abelian groups, and assume we are given a graded commutative
multiplication
$$\wedge^\bullet : \text{Tot}({\mathcal F}^\bullet\otimes {\mathcal F}^\bullet) \longrightarrow {\mathcal F}^\bullet.$$
This means the following: For $s$ a local section of
${\mathcal F}^a$, and $t$ a local section of ${\mathcal F}^b$
we have $s \wedge t$ a local section of ${\mathcal F}^{a + b}$.
$s \wedge t = (-1)^{ab} t \wedge s$. Since $\wedge$ is a map
of complexes we have
$d(s\wedge t) = d(s) \wedge t + (-1)^a s \wedge t$.
The composition
$$\text{Tot}( \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) \otimes \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) ) \to \text{Tot}( \check{\mathcal{C}}^\bullet({\mathcal U}, \text{Tot}({\mathcal F}^\bullet\otimes_{\mathbf Z}{\mathcal F}^\bullet)) ) \to \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet))$$
induces a cup product on cohomology
$$H^n( \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) ) \times H^m( \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) ) \longrightarrow H^{n + m}( \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) )$$
and so in the limit also a product on {\v C}ech cohomology
and therefore (using hypercoverings if needed) a product
in cohomology of ${\mathcal F}^\bullet$. We claim this product
(on cohomology) is graded commutative as well. To prove this
we first consider an element $\alpha$ of degree $n$ in
$\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet))$
and an element $\beta$ of degree $m$ in
$\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet))$
and we compute
\begin{align*}
\wedge^\bullet(\alpha \cup \beta)_{i_0 \ldots i_p}
= &
\sum\nolimits_{r = 0}^p
\epsilon(n, m, p, r)
\alpha_{i_0 \ldots i_r} \wedge \beta_{i_r \ldots i_p} \\
= &
\sum\nolimits_{r = 0}^p
\epsilon(n, m, p, r)
(-1)^{\deg(\alpha_{i_0 \ldots i_r})\deg(\beta_{i_r \ldots i_p})}
\beta_{i_r \ldots i_p} \wedge \alpha_{i_0 \ldots i_r}
\end{align*}
because $\wedge$ is graded commutative. On the other hand we have
\begin{align*}
\tau(\wedge^\bullet(\tau(\beta) \cup \tau(\alpha)))_{i_0 \ldots i_p}
= &
\chi(p)
\sum\nolimits_{r = 0}^p
\epsilon(m, n, p, r)
\tau(\beta)_{i_p \ldots i_{p - r}} \wedge \tau(\alpha)_{i_{p - r} \ldots i_0}
\\
= &
\chi(p)
\sum\nolimits_{r = 0}^p
\epsilon(m, n, p, r) \chi(r) \chi(p - r)
\beta_{i_{p - r} \ldots i_p} \wedge \alpha_{i_0 \ldots i_{p - r}}
\\
= &
\chi(p)
\sum\nolimits_{r = 0}^p
\epsilon(m, n, p, p - r) \chi(r) \chi(p - r)
\beta_{i_r \ldots i_p} \wedge \alpha_{i_0 \ldots i_r}
\end{align*}
where $\chi(t) = (-1)^{\frac{t(t + 1)}{2}}$. Since we proved earlier that
$\tau$ acts as the identity on cohomology we have to verify that
$$\epsilon(n, m, p, r) (-1)^{(n - r)(m - (p - r))} = (-1)^{nm} \chi(p)\epsilon(m, n, p, p - r) \chi(r) \chi(p - r)$$
A trivial mod $2$ calculation shows these signs match up.
(Alternatively, check the script signs.gp in the scripts subdirectory
of the Stacks project.)

\medskip\noindent
Finally, we study the compatibility of cup product with boundary maps.
Suppose that
$$0 \to {\mathcal F}_1^\bullet \to {\mathcal F}_2^\bullet \to {\mathcal F}_3^\bullet \to 0 \quad\text{and}\quad 0 \leftarrow {\mathcal G}_1^\bullet \leftarrow {\mathcal G}_2^\bullet \leftarrow {\mathcal G}_3^\bullet \leftarrow 0$$
are short exact sequences of bounded below complexes of abelian
sheaves on $X$. Let ${\mathcal H}^\bullet$ be another bounded below
complex of abelian sheaves, and suppose we have maps of complexes
$$\gamma_i : \text{Tot}({\mathcal F}_i^\bullet \otimes_{\mathbf Z} {\mathcal G}_i^\bullet) \longrightarrow {\mathcal H}^\bullet$$
which are compatible with the maps between the complexes, namely such that
the diagrams
$$\xymatrix{ \text{Tot}({\mathcal F}_1^\bullet \otimes_{\mathbf Z} {\mathcal G}_1^\bullet) \ar[d]_{\gamma_1} & \text{Tot}({\mathcal F}_1^\bullet \otimes_{\mathbf Z} {\mathcal G}_2^\bullet) \ar[l] \ar[d] \\ \mathcal{H}^\bullet & \text{Tot}({\mathcal F}_2^\bullet \otimes_{\mathbf Z} {\mathcal G}_2^\bullet) \ar[l]_-{\gamma_2} }$$
and
$$\xymatrix{ \text{Tot}({\mathcal F}_2^\bullet \otimes_{\mathbf Z} {\mathcal G}_2^\bullet) \ar[d]_{\gamma_2} & \text{Tot}({\mathcal F}_2^\bullet \otimes_{\mathbf Z} {\mathcal G}_3^\bullet) \ar[l] \ar[d] \\ \mathcal{H}^\bullet & \text{Tot}({\mathcal F}_3^\bullet \otimes_{\mathbf Z} {\mathcal G}_3^\bullet) \ar[l]_-{\gamma_3} }$$
are commutative.

\begin{lemma}
\label{lemma-compute-sign-cup-product-boundaries}
In the situation above, assume {\v C}ech cohomology agrees with cohomology
for the sheaves $\mathcal{F}_i^p$ and $\mathcal{G}_j^q$.
Let $a_3 \in H^n(X, \mathcal{F}_3^\bullet)$ and
$b_1 \in H^m(X, \mathcal{G}_1^\bullet)$. Then we have
$$\gamma_1( \partial a_3 \cup b_1) = (-1)^{n + 1} \gamma_3( a_3 \cup \partial b_1)$$
in $H^{n + m}(X, \mathcal{H}^\bullet)$ where $\partial$ indicates the
boundary map on cohomology associated to the short exact sequences of
complexes above.
\end{lemma}

\begin{proof}
We will use the following conventions and notation. We think of
${\mathcal F}_1^p$ as a subsheaf of ${\mathcal F}_2^p$ and we think of
${\mathcal G}_3^q$ as a subsheaf of ${\mathcal G}_2^q$. Hence if $s$ is
a local section of ${\mathcal F}_1^p$ we use $s$ to denote
the corresponding section of ${\mathcal F}_2^p$ as well. Similarly
for local sections of ${\mathcal G}_3^q$. Furthermore,
if $s$ is a local section of ${\mathcal F}_2^p$ then we denote
$\bar s$ its image in ${\mathcal F}_3^p$. Similarly for the
map ${\mathcal G}_2^q \to {\mathcal G}^q_1$. In particular if
$s$ is a local section of ${\mathcal F}_2^p$ and $\bar s = 0$
then $s$ is a local section of ${\mathcal F}_1^p$. The commutativity
of the diagrams above implies, for local sections $s$ of
${\mathcal F}_2^p$ and $t$ of ${\mathcal G}_3^q$ that
$\gamma_2(s \otimes t) = \gamma_3(\bar s \otimes t)$ as sections of
${\mathcal H}^{p + q}$.

\medskip\noindent
Let ${\mathcal U} : X = \bigcup_{i \in I} U_i$
be an open covering of $X$. Suppose that $\alpha_3$,
resp.\ $\beta_1$ is a degree $n$, resp.\ $m$ cocycle of
$\text{Tot}( \check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}_3^\bullet))$,
resp.\ $\text{Tot}( \check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal G}_1^\bullet))$
representing $a_3$, resp.\ $b_1$. After refining $\mathcal{U}$ if necessary,
we can find cochains $\alpha_2$, resp.\ $\beta_2$ of
degree $n$, resp.\ $m$ in
$\text{Tot}( \check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}_2^\bullet))$,
resp.\ $\text{Tot}( \check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal G}_2^\bullet))$
mapping to $\alpha_3$, resp.\ $\beta_1$.
Then we see that
$$\overline{d(\alpha_2)} = d(\bar \alpha_2) = 0 \quad\text{and}\quad \overline{d(\beta_2)} = d(\bar \beta_2) = 0.$$
This means that $\alpha_1 = d(\alpha_2)$ is a degree $n + 1$ cocycle in
$\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}_1^\bullet))$
representing $\partial a_3$. Similarly, $\beta_3 = d(\beta_2)$ is
a degree $m + 1$ cocycle in
$\text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal G}_3^\bullet))$
representing $\partial b_1$.
Thus we may compute
\begin{align*}
d(\gamma_2(\alpha_2 \cup \beta_2))
& =
\gamma_2(d(\alpha_2 \cup \beta_2))
\\
& =
\gamma_2(d(\alpha_2) \cup \beta_2 + (-1)^n \alpha_2 \cup d(\beta_2) )
\\
& =
\gamma_2( \alpha_1 \cup \beta_2)  + (-1)^n \gamma_2( \alpha_2 \cup \beta_3)
\\
& =
\gamma_1(\alpha_1 \cup \beta_1) + (-1)^n \gamma_3(\alpha_3 \cup \beta_3)
\end{align*}
So this even tells us that the sign is $(-1)^{n + 1}$ as indicated
in the lemma\footnote{The sign depends on the convention for the
signs in the long exact sequence in cohomology associated to a triangle
in $D(X)$. The conventions in the Stacks project are (a) distinguished
triangles correspond to termwise split exact sequences and (b) the boundary
maps in the long exact sequence are given by the maps in the snake lemma
without the intervention of signs. See
Derived Categories, Section \ref{derived-section-homotopy-triangulated}.}.
\end{proof}

\begin{lemma}
\label{lemma-boundary-derivation-over-cup-product}
Let $X$ be a topological space. Let $\mathcal{O}' \to \mathcal{O}$ be a
surjection of sheaves of rings whose kernel $\mathcal{I} \subset \mathcal{O}'$
has square zero. Then $M = H^1(X, \mathcal{I})$ is a
$R = H^0(X, \mathcal{O})$-module and the boundary map
$\partial : R \to M$ associated to the short exact sequence
$$0 \to \mathcal{I} \to \mathcal{O}' \to \mathcal{O} \to 0$$
is a derivation (Algebra, Definition \ref{algebra-definition-derivation}).
\end{lemma}

\begin{proof}
The map $\mathcal{O}' \to \SheafHom(\mathcal{I}, \mathcal{I})$
factors through $\mathcal{O}$ as $\mathcal{I} \cdot \mathcal{I} = 0$
by assumption. Hence $\mathcal{I}$ is a sheaf of $\mathcal{O}$-modules
and this defines the $R$-module structure on $M$.
The boundary map is additive hence it suffices to prove
the Leibniz rule. Let $f \in R$. Choose an open covering
$\mathcal{U} : X = \bigcup U_i$ such that there exist
$f_i \in \mathcal{O}'(U_i)$ lifting $f|_{U_i} \in \mathcal{O}(U_i)$.
Observe that $f_i - f_j$ is an element of $\mathcal{I}(U_i \cap U_j)$.
Then $\partial(f)$ corresponds to the {\v C}ech cohomology class of
the $1$-cocycle $\alpha$ with $\alpha_{i_0i_1} = f_{i_0} - f_{i_1}$.
(Observe that by Lemma \ref{lemma-cech-h1} the first {\v C}ech cohomology
group with respect to $\mathcal{U}$ is a submodule of $M$.)
Next, let $g \in R$ be a second element and assume (after possibly
refining the open covering) that $g_i \in \mathcal{O}'(U_i)$ lifts
$g|_{U_i} \in \mathcal{O}(U_i)$. Then we see that
$\partial(g)$ is given by the cocycle $\beta$ with
$\beta_{i_0i_1} = g_{i_0} - g_{i_1}$. Since $f_ig_i \in \mathcal{O}'(U_i)$
lifts $fg|_{U_i}$ we see that
$\partial(fg)$ is given by the cocycle $\gamma$ with
$$\gamma_{i_0i_1} = f_{i_0}g_{i_0} - f_{i_1}g_{i_1} = (f_{i_0} - f_{i_1})g_{i_0} + f_{i_1}(g_{i_0} - g_{i_1}) = \alpha_{i_0i_1}g + f\beta_{i_0i_1}$$
by our definition of the $\mathcal{O}$-module structure on $\mathcal{I}$.
This proves the Leibniz rule and the proof is complete.
\end{proof}

Comment #2299 by shom on November 11, 2016 a 9:38 pm UTC
• Minor-Typo: In Lemma 20.26.1 the term

$$E_2^{p, q} = H^p(\text{Tot}(\check{\mathcal{C}}^\bullet(\mathcal{U}, \underline{H}^q(\mathcal{F}^\bullet))$$ has some parentheses missing from the right.

• In the proof of the same Lemma the penultimate line reads "Hence we obtain $E_2$ terms as described in the lemma." It appears to me that this doesn't follow from the $E_{1}$ terms (written before it) by applying the cited reference. However, I think the problem lies in the definition of the double complex $A^{\bullet \bullet}$. I think instead of using the description $$A^{n, m} = \bigoplus\nolimits_{p + q = n} \check{\mathcal{C}}^p({\mathcal U}, \mathcal{I}^{q, m})$$

the one that works is $$A^{n, m} = \bigoplus\nolimits_{p + q = m} \check{\mathcal{C}}^n({\mathcal U}, \mathcal{I}^{p, q}).$$ Then the $E^2$ term (but a different $E^1$ from what is written) follows from the reference.

Comment #2325 by Johan (site) on December 12, 2016 a 1:01 am UTC

Thanks for the comment about the missing parenthesis which I have fixed here. On the other hand, I carefully checked the spectral sequence construction and I think that it is correct as stated. The notation $\underline{H}^q(\mathcal{F}^\bullet)$ may be part of the problem. It is supposed to stand for the complex of presheaves of $\mathcal{O}_X$-modules whose degree $i$ term is $\underline{H}^q(\mathcal{F}^i)$ where for a $\mathcal{O}_X$-module $\mathcal{F}$ we have $\underline{H}^q(\mathcal{F})(U) = H^q(U, \mathcal{F})$. Does this help?

## Add a comment on tag 01FP

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 lower-right corner).