hcju/stacksqa huggingface dataset:
We first prove (1) by induction on $j$. For the base case $j = 0$ there is nothing to prove as $Y'_0 \to X'_0$ is an isomorphism. Say the result holds for $j - 1$. We consider the distinguished triangle $$ Y'_j \to X'_j \to Y'_{j - 1} \to Y'_j[1] $$ The long exact sequence of Lemma \ref{lemma-representable-homological} gives an exact sequence $$ \Hom(X_i[i - j - 1], Y'_{j - 1}[-1]) \to \Hom(X_i[i - j - 1], Y'_j) \to \Hom(X_i[i - j - 1], X'_j) $$ From the induction hypothesis and (\ref{equation-P}) we conclude the outer groups are zero and we win. \medskip\noindent Proof of (2). For $n = 1$ the existence of morphisms has been established in Lemma \ref{lemma-postnikov-system-small-cases}. For $n > 1$ by induction, we may assume given the map of Postnikov systems of length $n - 1$. The problem is that we do not know whether the diagram $$ \xymatrix{ X_n \ar[r] \ar[d] & Y_{n - 1} \ar[d] \\ X'_n \ar[r] & Y'_{n - 1} } $$ is commutative. Denote $\alpha : X_n \to Y'_{n - 1}$ the difference. Then we do know that the composition of $\alpha$ with $Y'_{n - 1} \to X'_{n - 1}$ is zero (because of what it means to be a map of Postnikov systems of length $n - 1$). By the distinguished triangle $Y'_{n - 1} \to X'_{n - 1} \to Y'_{n - 2} \to Y'_{n - 1}[1]$, this means that $\alpha$ is the composition of $Y'_{n - 2}[-1] \to Y'_{n - 1}$ with a map $\alpha' : X_n \to Y'_{n - 2}[-1]$. Then (\ref{equation-P}) guarantees $\alpha'$ is zero by part (1) of the lemma. Thus $\alpha$ is zero. To finish the proof of existence, the commutativity guarantees we can choose the dotted arrow fitting into the diagram $$ \xymatrix{ Y_{n - 1}[-1] \ar[d] \ar[r] & Y_n \ar[r] \ar@{..>}[d] & X_n \ar[r] \ar[d] & Y_{n - 1} \ar[d] \\ Y'_{n - 1}[-1] \ar[r] & Y'_n \ar[r] & X'_n \ar[r] & Y'_{n - 1} } $$ by TR3.
Proof of (1). Look at the following diagram $$ \xymatrix{ Y_0 \ar[r] \ar[d] & Y_1[1] \ar[r] \ar[ld] & Y_2[2] \ar[r] \ar[lld] & \ldots \ar[r] & Y_n[n] \ar[lllld] \\ Y'_n[n] } $$ The arrows are the composition of the morphism $Y_n[n] \to Y'_n[n]$ and the morphism $Y_i[i] \to Y_n[n]$. The arrow $Y_0 \to Y'_n[n]$ is determined as it is the composition $Y_0 = X_0 \to X'_0 = Y'_0 \to Y'_n[n]$. Since we have the distinguished triangle $Y_0 \to Y_1[1] \to X_1[1]$ we see that $\Hom(X_1[1], Y'_n[n]) = 0$ guarantees that the second vertical arrow is unique. Since we have the distinguished triangle $Y_1[1] \to Y_2[2] \to X_2[2]$ we see that $\Hom(X_2[2], Y'_n[n]) = 0$ guarantees that the third vertical arrow is unique. And so on. \medskip\noindent Proof of (2). The composition $Y_n[n] \to Y'_n[n] \to X_n[n]$ is the same as the composition $Y_n[n] \to X_n[n] \to X'_n[n]$ and hence is unique. Then using the distinguished triangle $Y'_{n - 1}[n - 1] \to Y'_n[n] \to X'_n[n]$ we see that it suffices to show $\Hom(Y_n[n], Y'_{n - 1}[n - 1]) = 0$. Using the distinguished triangles $$ Y'_{n - i - 1}[n - i - 1] \to Y'_{n - i}[n - i] \to X'_{n - i}[n - i] $$ we get this vanishing from our assumption. Small details omitted. \medskip\noindent Proof of (3). Looking at the proof of Lemma \ref{lemma-maps-postnikov-systems-vanishing} and arguing by induction on $n$ it suffices to show that the dotted arrow in the morphism of triangles $$ \xymatrix{ Y_{n - 1}[-1] \ar[d] \ar[r] & Y_n \ar[r] \ar@{..>}[d] & X_n \ar[r] \ar[d] & Y_{n - 1} \ar[d] \\ Y'_{n - 1}[-1] \ar[r] & Y'_n \ar[r] & X'_n \ar[r] & Y'_{n - 1} } $$ is unique. By Lemma \ref{lemma-uniqueness-third-arrow} part (5) it suffices to show that $\Hom(Y_{n - 1}, X'_n) = 0$ and $\Hom(X_n, Y'_{n - 1}[-1]) = 0$. To prove the first vanishing we use the distinguished triangles $Y_{n - i - 1}[-i] \to Y_{n - i}[-(i - 1)] \to X_{n - i}[-(i - 1)]$ for $i > 0$ and induction on $i$ to see that the assumed vanishing of $\Hom(X_{n - i}[-i + 1], X'_n)$ is enough. For the second we similarly use the distinguished triangles $Y'_{n - i - 1}[-i - 1] \to Y'_{n - i}[-i] \to X'_{n - i}[-i]$ to see that the assumed vanishing of $\Hom(X_n, X'_{n - i}[-i])$ is enough as well.
We argue by induction on $n$. The cases $n = 0, 1, 2$ follow from Lemma \ref{lemma-postnikov-system-small-cases}. Assume $n > 2$. Suppose given a Postnikov system for the complex $X_{n - 1} \to X_{n - 2} \to \ldots \to X_0$. The only obstruction to extending this to a Postnikov system of length $n$ is that we have to find a morphism $X_n \to Y_{n - 1}$ such that the composition $X_n \to Y_{n - 1} \to X_{n - 1}$ is equal to the given map $X_n \to X_{n - 1}$. Considering the distinguished triangle $$ Y_{n - 1} \to X_{n - 1} \to Y_{n - 2} \to Y_{n - 1}[1] $$ and the associated long exact sequence coming from this and the functor $\Hom(X_n, -)$ (see Lemma \ref{lemma-representable-homological}) we find that it suffices to show that the composition $X_n \to X_{n - 1} \to Y_{n - 2}$ is zero. Since we know that $X_n \to X_{n - 1} \to X_{n - 2}$ is zero we can apply the distinguished triangle $$ Y_{n - 2} \to X_{n - 2} \to Y_{n - 3} \to Y_{n - 2}[1] $$ to see that it suffices if $\Hom(X_n, Y_{n - 3}[-1]) = 0$. Arguing exactly as in the proof of Lemma \ref{lemma-maps-postnikov-systems-vanishing} part (1) the reader easily sees this follows from the condition stated in the lemma. \medskip\noindent The statement on isomorphisms follows from the existence of a map between the Postnikov systems extending the identity on the complex proven in Lemma \ref{lemma-maps-postnikov-systems-vanishing} part (2) and Lemma \ref{lemma-third-isomorphism-triangle} to show all the maps are isomorphisms.
Assume $(A_i)$ is essentially constant with value $A$. Then $A = \lim A_i$ and there exists an $i$ and a morphism $A_i \to A$ such that (1) the composition $A \to A_i \to A$ is the identity on $A$ and (2) for all $j \geq i$ there exists a $j' \geq j$ such that $A_{j'} \to A_j$ factors as $A_{j'} \to A_i \to A \to A_j$. From (1) we conclude that for $j \geq i$ the maps $A \to A_j$ and $A_j \to A_i \to A$ compose to the identity on $A$. It follows that $A_j \to A$ has a kernel $Z_j$ and that the map $A \oplus Z_j \to A_j$ is an isomorphism, see Lemmas \ref{lemma-when-split} and \ref{lemma-split}. These direct sum decompositions clearly satisfy (a). From (2) we conclude that for all $j$ there is a $j' \geq j$ such that $Z_{j'} \to Z_j$ is zero, so (b) holds. Proof of the converse is omitted.
After renumbering we may assume that $A_n = A \oplus A'_n$ and $C_n = C \oplus C'_n$ for inverse systems $(A'_n)$ and $(C'_n)$ which are essentially zero, see Lemma \ref{lemma-essentially-constant}. In particular, the morphism $$ C \oplus C'_n \to (A \oplus A'_n)[1] $$ maps the summand $C$ into the summand $A[1]$ for all $n$ by a map $\delta : C \to A[1]$ which is independent of $n$. Choose a distinguished triangle $$ A \to B \to C \xrightarrow{\delta} A[1] $$ Next, choose a morphism of distingished triangles $$ (A_1 \to B_1 \to C_1 \to A_1[1]) \to (A \to B \to C \to A[1]) $$ which is possible by TR3. For any object $D$ of $\mathcal{D}$ this induces a commutative diagram $$ \xymatrix{ \ldots \ar[r] & \Hom_\mathcal{D}(C, D) \ar[r] \ar[d] & \Hom_\mathcal{D}(B, D) \ar[r] \ar[d] & \Hom_\mathcal{D}(A, D) \ar[r] \ar[d] & \ldots \\ \ldots \ar[r] & \colim \Hom_\mathcal{D}(C_n, D) \ar[r] & \colim \Hom_\mathcal{D}(B_n, D) \ar[r] & \colim \Hom_\mathcal{D}(A_n, D) \ar[r] & \ldots } $$ The left and right vertical arrows are isomorphisms and so are the ones to the left and right of those. Thus by the 5-lemma we conclude that the middle arrow is an isomorphism. It follows that $(B_n)$ is isomorphic to the constant inverse system with value $B$ by the discussion in Categories, Remark \ref{categories-remark-pro-category-copresheaves}. Since this is equivalent to $(B_n)$ being essentially constant with value $B$ by Categories, Remark \ref{categories-remark-pro-category} the proof is complete.
By Remark \ref{remark-truncation-distinguished-triangle} we obtain an inverse system of distinguished triangles $$ \tau_{\leq a}A_n \to A_n \to \tau_{\geq a + 1}A_n \to (\tau_{\leq a}A_n)[1] $$ Of course we have $\tau_{\leq a}A_n = H^a(A_n)[-a]$ in $D(\mathcal{A})$. Thus by assumption these form an essentially constant system. By induction on $b - a$ we find that the inverse system $\tau_{\geq a + 1}A_n$ is essentially constant, say with value $A'$. By Lemma \ref{lemma-essentially-constant-2-out-of-3} we find that $A_n$ is an essentially constant system. We omit the proof of the statement on cohomologies (hint: use the final part of Lemma \ref{lemma-essentially-constant-2-out-of-3}).
For any object $X$ of $\mathcal{D}$ consider the exact sequence $$ \colim \Hom(C_n, X) \to \colim \Hom(B_n, X) \to \colim \Hom(A_n, X) \to \colim \Hom(C_n[-1], X) \to $$ Exactness follows from Lemma \ref{lemma-representable-homological} combined with Algebra, Lemma \ref{algebra-lemma-directed-colimit-exact}. By assumption the first and last term are zero. Hence the map $\colim \Hom(B_n, X) \to \colim \Hom(A_n, X)$ is an isomorphism for all $X$. The lemma follows from this and Categories, Remark \ref{categories-remark-pro-category-copresheaves}.
We can inductively extend the maps $A_n \to B_n$ to an inverse system of distinguished triangles $A_n \to B_n \to C_n \to A_n[1]$ by axiom TR3. By Lemma \ref{lemma-pro-isomorphism} it suffices to prove that $C_n$ is pro-zero. By Lemma \ref{lemma-essentially-constant-cohomology} it suffices to show that $H^p(C_n)$ is pro-zero for each $p$. This follows from assumption (2) and the long exact sequences $$ H^p(A_n) \xrightarrow{\alpha_n} H^p(B_n) \xrightarrow{\beta_n} H^p(C_n) \xrightarrow{\delta_n} H^{p + 1}(A_n) \xrightarrow{\epsilon_n} H^{p + 1}(B_n) $$ Namely, for every $n$ we can find an $m > n$ such that $\Im(\beta_m)$ maps to zero in $H^p(C_n)$ because we may choose $m$ such that $H^p(B_m) \to H^p(B_n)$ factors through $\alpha_n : H^p(A_n) \to H^p(B_n)$. For a similar reason we may then choose $k > m$ such that $\Im(\delta_k)$ maps to zero in $H^{p + 1}(A_m)$. Then $H^p(C_k) \to H^p(C_n)$ is zero because $H^p(C_k) \to H^p(C_m)$ maps into $\Ker(\delta_m)$ and $H^p(C_m) \to H^p(C_n)$ annihilates $\Ker(\delta_m) = \Im(\beta_m)$.
Proof of TR1. By definition every triangle isomorphic to a distinguished one is distinguished. Also, any triangle $(A^\bullet, A^\bullet, 0, 1, 0, 0)$ is distinguished since $0 \to A^\bullet \to A^\bullet \to 0 \to 0$ is a termwise split sequence of complexes. Finally, given any morphism of complexes $f : K^\bullet \to L^\bullet$ the triangle $(K, L, C(f), f, i, -p)$ is distinguished by Lemma \ref{lemma-the-same-up-to-isomorphisms}. \medskip\noindent Proof of TR2. Let $(X, Y, Z, f, g, h)$ be a triangle. Assume $(Y, Z, X[1], g, h, -f[1])$ is distinguished. Then there exists a termwise split sequence of complexes $A^\bullet \to B^\bullet \to C^\bullet$ such that the associated triangle $(A^\bullet, B^\bullet, C^\bullet, \alpha, \beta, \delta)$ is isomorphic to $(Y, Z, X[1], g, h, -f[1])$. Rotating back we see that $(X, Y, Z, f, g, h)$ is isomorphic to $(C^\bullet[-1], A^\bullet, B^\bullet, -\delta[-1], \alpha, \beta)$. It follows from Lemma \ref{lemma-rotate-triangle} that the triangle $(C^\bullet[-1], A^\bullet, B^\bullet, \delta[-1], \alpha, \beta)$ is isomorphic to $(C^\bullet[-1], A^\bullet, C(\delta[-1])^\bullet, \delta[-1], i, p)$. Precomposing the previous isomorphism of triangles with $-1$ on $Y$ it follows that $(X, Y, Z, f, g, h)$ is isomorphic to $(C^\bullet[-1], A^\bullet, C(\delta[-1])^\bullet, \delta[-1], i, -p)$. Hence it is distinguished by Lemma \ref{lemma-the-same-up-to-isomorphisms}. On the other hand, suppose that $(X, Y, Z, f, g, h)$ is distinguished. By Lemma \ref{lemma-the-same-up-to-isomorphisms} this means that it is isomorphic to a triangle of the form $(K^\bullet, L^\bullet, C(f), f, i, -p)$ for some morphism of complexes $f$. Then the rotated triangle $(Y, Z, X[1], g, h, -f[1])$ is isomorphic to $(L^\bullet, C(f), K^\bullet[1], i, -p, -f[1])$ which is isomorphic to the triangle $(L^\bullet, C(f), K^\bullet[1], i, p, f[1])$. By Lemma \ref{lemma-rotate-cone} this triangle is distinguished. Hence $(Y, Z, X[1], g, h, -f[1])$ is distinguished as desired. \medskip\noindent Proof of TR3. Let $(X, Y, Z, f, g, h)$ and $(X', Y', Z', f', g', h')$ be distinguished triangles of $K(\mathcal{A})$ and let $a : X \to X'$ and $b : Y \to Y'$ be morphisms such that $f' \circ a = b \circ f$. By Lemma \ref{lemma-the-same-up-to-isomorphisms} we may assume that $(X, Y, Z, f, g, h) = (X, Y, C(f), f, i, -p)$ and $(X', Y', Z', f', g', h') = (X', Y', C(f'), f', i', -p')$. At this point we simply apply Lemma \ref{lemma-functorial-cone} to the commutative diagram given by $f, f', a, b$. \medskip\noindent Proof of TR4. At this point we know that $K(\mathcal{A})$ is a pre-triangulated category. Hence we can use Lemma \ref{lemma-easier-axiom-four}. Let $A^\bullet \to B^\bullet$ and $B^\bullet \to C^\bullet$ be composable morphisms of $K(\mathcal{A})$. By Lemma \ref{lemma-sequence-maps-split} we may assume that $A^\bullet \to B^\bullet$ and $B^\bullet \to C^\bullet$ are split injective morphisms. In this case the result follows from Lemma \ref{lemma-two-split-injections}.
Since $S$ is saturated it contains all isomorphisms (see remark following Categories, Definition \ref{categories-definition-saturated-multiplicative-system}). Hence (1) follows from Lemmas \ref{lemma-derived-inverts}, \ref{lemma-2-out-of-3-defined}, and \ref{lemma-derived-shift}. We get (2) from Lemmas \ref{lemma-derived-functor}, \ref{lemma-derived-shift}, and \ref{lemma-2-out-of-3-defined}. We get (3) from Lemma \ref{lemma-derived-inverts}. The fully faithfulness in (4) follows from (3) and the definitions. The fact that $S_\mathcal{E}^{-1}\mathcal{E} \to S^{-1}\mathcal{D}$ is exact follows from the fact that a triangle in $S_\mathcal{E}^{-1}\mathcal{E}$ is distinguished if and only if it is isomorphic to the image of a distinguished triangle in $\mathcal{E}$, see proof of Proposition \ref{proposition-construct-localization}. Part (5) follows from Lemma \ref{lemma-derived-inverts}. The factorization of $RF : \mathcal{E} \to \mathcal{D}'$ through an exact functor $S_\mathcal{E}^{-1}\mathcal{E} \to \mathcal{D}'$ follows from Lemma \ref{lemma-universal-property-localization}. Part (7) follows from Lemma \ref{lemma-direct-sum-defined}.
Assume every object of $\mathcal{A}$ injects into an object acyclic for $RF$. Let $\mathcal{I}$ be the set of objects acyclic for $RF$. Let $K^\bullet$ be a bounded below complex in $\mathcal{A}$. By Lemma \ref{lemma-subcategory-right-resolution} there exists a quasi-isomorphism $\alpha : K^\bullet \to I^\bullet$ with $I^\bullet$ bounded below and $I^n \in \mathcal{I}$. Hence in order to prove (1) it suffices to show that $F(I^\bullet) \to F((I')^\bullet)$ is a quasi-isomorphism when $s : I^\bullet \to (I')^\bullet$ is a quasi-isomorphism of bounded below complexes of objects from $\mathcal{I}$, see Lemma \ref{lemma-find-existence-computes}. Note that the cone $C(s)^\bullet$ is an acyclic bounded below complex all of whose terms are in $\mathcal{I}$. Hence it suffices to show: given an acyclic bounded below complex $I^\bullet$ all of whose terms are in $\mathcal{I}$ the complex $F(I^\bullet)$ is acyclic. \medskip\noindent Say $I^n = 0$ for $n < n_0$. Setting $J^n = \Im(d^n)$ we break $I^\bullet$ into short exact sequences $0 \to J^n \to I^{n + 1} \to J^{n + 1} \to 0$ for $n \geq n_0$. These sequences induce distinguished triangles $(J^n, I^{n + 1}, J^{n + 1})$ in $D^+(\mathcal{A})$ by Lemma \ref{lemma-derived-canonical-delta-functor}. For each $k \in \mathbf{Z}$ denote $H_k$ the assertion: For all $n \leq k$ the right derived functor $RF$ is defined at $J^n$ and $R^iF(J^n) = 0$ for $i \not = 0$. Then $H_k$ holds trivially for $k \leq n_0$. If $H_n$ holds, then, using Proposition \ref{proposition-derived-functor}, we see that $RF$ is defined at $J^{n + 1}$ and $(RF(J^n), RF(I^{n + 1}), RF(J^{n + 1}))$ is a distinguished triangle of $D^+(\mathcal{B})$. Thus the long exact cohomology sequence (\ref{equation-long-exact-cohomology-sequence-D}) associated to this triangle gives an exact sequence $$ 0 \to R^{-1}F(J^{n + 1}) \to R^0F(J^n) \to F(I^{n + 1}) \to R^0F(J^{n + 1}) \to 0 $$ and gives that $R^iF(J^{n + 1}) = 0$ for $i \not \in \{-1, 0\}$. By Lemma \ref{lemma-negative-vanishing} we see that $R^{-1}F(J^{n + 1}) = 0$. This proves that $H_{n + 1}$ is true hence $H_k$ holds for all $k$. We also conclude that $$ 0 \to R^0F(J^n) \to F(I^{n + 1}) \to R^0F(J^{n + 1}) \to 0 $$ is short exact for all $n$. This in turn proves that $F(I^\bullet)$ is exact. \medskip\noindent The proof in the case of $LF$ is dual.
If $E$ is a classical generator for $\mathcal{D}_c$, then $\mathcal{D}_c = \langle E \rangle$. It follows formally from the assumption that $\mathcal{D}$ is compactly generated and Lemma \ref{lemma-right-orthogonal} that $E$ is a generator for $\mathcal{D}$. \medskip\noindent The converse is more interesting. Assume that $E$ is a generator for $\mathcal{D}$. Let $X$ be a compact object of $\mathcal{D}$. Apply Lemma \ref{lemma-write-as-colimit} with $I = \{1\}$ and $E_1 = E$ to write $$ X = \text{hocolim} X_n $$ as in the lemma. Since $X$ is compact we find that $X \to \text{hocolim} X_n$ factors through $X_n$ for some $n$ (Lemma \ref{lemma-commutes-with-countable-sums}). Thus $X$ is a direct summand of $X_n$. By Lemma \ref{lemma-factor-through} we see that $X$ is an object of $\langle E \rangle$ and the lemma is proven.
For an object $Y$ of $\mathcal{D}'$ consider the contravariant functor $$ \mathcal{D} \to \textit{Ab},\quad W \mapsto \Hom_{\mathcal{D}'}(F(W), Y) $$ This is a cohomological functor as $F$ is exact and transforms direct sums into products as $F$ transforms direct sums into direct sums. Thus by Lemma \ref{lemma-brown} we find an object $X$ of $\mathcal{D}$ such that $\Hom_\mathcal{D}(W, X) = \Hom_{\mathcal{D}'}(F(W), Y)$. The existence of the adjoint follows from Categories, Lemma \ref{categories-lemma-adjoint-exists}. Exactness follows from Lemma \ref{lemma-adjoint-is-exact}.
Let $y' \in Y'$ be a point with image $y \in Y$. It suffices to show that the base change map induces an isomorphism on stalks at $y'$. As $f$ is proper it follows that $f'$ is proper, the fibres of $f$ and $f'$ are quasi-compact and $f$ and $f'$ are closed, see Topology, Theorem \ref{topology-theorem-characterize-proper}. Moreover $f'$ is separated by Topology, Lemma \ref{topology-lemma-base-change-separated}. Thus we can apply Lemma \ref{lemma-proper-base-change} twice to see that $$ (Rf'_*(g')^{-1}E)_{y'} = R\Gamma((f')^{-1}(y'), (g')^{-1}E|_{(f')^{-1}(y')}) $$ and $$ (Rf_*E)_y = R\Gamma(f^{-1}(y), E|_{f^{-1}(y)}) $$ The induced map of fibres $(f')^{-1}(y') \to f^{-1}(y)$ is a homeomorphism of topological spaces and the pull back of $E|_{f^{-1}(y)}$ is $(g')^{-1}E|_{(f')^{-1}(y')}$. The desired result follows.
Let $\mathcal{F}$ be a $\mathcal{H}$-torsor. Consider the free abelian sheaf $\mathbf{Z}[\mathcal{F}]$ on $\mathcal{F}$. It is the sheafification of the rule which associates to $U \subset X$ open the collection of finite formal sums $\sum n_i[s_i]$ with $n_i \in \mathbf{Z}$ and $s_i \in \mathcal{F}(U)$. There is a natural map $$ \sigma : \mathbf{Z}[\mathcal{F}] \longrightarrow \underline{\mathbf{Z}} $$ which to a local section $\sum n_i[s_i]$ associates $\sum n_i$. The kernel of $\sigma$ is generated by the local section of the form $[s] - [s']$. There is a canonical map $a : \Ker(\sigma) \to \mathcal{H}$ which maps $[s] - [s'] \mapsto h$ where $h$ is the local section of $\mathcal{H}$ such that $h \cdot s = s'$. Consider the pushout diagram $$ \xymatrix{ 0 \ar[r] & \Ker(\sigma) \ar[r] \ar[d]^a & \mathbf{Z}[\mathcal{F}] \ar[r] \ar[d] & \underline{\mathbf{Z}} \ar[r] \ar[d] & 0 \\ 0 \ar[r] & \mathcal{H} \ar[r] & \mathcal{E} \ar[r] & \underline{\mathbf{Z}} \ar[r] & 0 } $$ Here $\mathcal{E}$ is the extension obtained by pushout. From the long exact cohomology sequence associated to the lower short exact sequence we obtain an element $\xi = \xi_\mathcal{F} \in H^1(X, \mathcal{H})$ by applying the boundary operator to $1 \in H^0(X, \underline{\mathbf{Z}})$. \medskip\noindent Conversely, given $\xi \in H^1(X, \mathcal{H})$ we can associate to $\xi$ a torsor as follows. Choose an embedding $\mathcal{H} \to \mathcal{I}$ of $\mathcal{H}$ into an injective abelian sheaf $\mathcal{I}$. We set $\mathcal{Q} = \mathcal{I}/\mathcal{H}$ so that we have a short exact sequence $$ \xymatrix{ 0 \ar[r] & \mathcal{H} \ar[r] & \mathcal{I} \ar[r] & \mathcal{Q} \ar[r] & 0 } $$ The element $\xi$ is the image of a global section $q \in H^0(X, \mathcal{Q})$ because $H^1(X, \mathcal{I}) = 0$ (see Derived Categories, Lemma \ref{derived-lemma-higher-derived-functors}). Let $\mathcal{F} \subset \mathcal{I}$ be the subsheaf (of sets) of sections that map to $q$ in the sheaf $\mathcal{Q}$. It is easy to verify that $\mathcal{F}$ is a torsor. \medskip\noindent We omit the verification that the two constructions given above are mutually inverse.
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module. Consider the presheaf $\mathcal{L}^*$ defined by the rule $$ U \longmapsto \{s \in \mathcal{L}(U) \text{ such that } \mathcal{O}_U \xrightarrow{s \cdot -} \mathcal{L}_U \text{ is an isomorphism}\} $$ This presheaf satisfies the sheaf condition. Moreover, if $f \in \mathcal{O}_X^*(U)$ and $s \in \mathcal{L}^*(U)$, then clearly $fs \in \mathcal{L}^*(U)$. By the same token, if $s, s' \in \mathcal{L}^*(U)$ then there exists a unique $f \in \mathcal{O}_X^*(U)$ such that $fs = s'$. Moreover, the sheaf $\mathcal{L}^*$ has sections locally by Modules, Lemma \ref{modules-lemma-invertible-is-locally-free-rank-1}. In other words we see that $\mathcal{L}^*$ is a $\mathcal{O}_X^*$-torsor. Thus we get a map $$ \begin{matrix} \text{invertible sheaves on }(X, \mathcal{O}_X) \\ \text{ up to isomorphism} \end{matrix} \longrightarrow \begin{matrix} \mathcal{O}_X^*\text{-torsors} \\ \text{ up to isomorphism} \end{matrix} $$ We omit the verification that this is a homomorphism of abelian groups. By Lemma \ref{lemma-torsors-h1} the right hand side is canonically bijective to $H^1(X, \mathcal{O}_X^*)$. Thus we have to show this map is injective and surjective. \medskip\noindent Injective. If the torsor $\mathcal{L}^*$ is trivial, this means by Lemma \ref{lemma-trivial-torsor} that $\mathcal{L}^*$ has a global section. Hence this means exactly that $\mathcal{L} \cong \mathcal{O}_X$ is the neutral element in $\Pic(X)$. \medskip\noindent Surjective. Let $\mathcal{F}$ be an $\mathcal{O}_X^*$-torsor. Consider the presheaf of sets $$ \mathcal{L}_1 : U \longmapsto (\mathcal{F}(U) \times \mathcal{O}_X(U))/\mathcal{O}_X^*(U) $$ where the action of $f \in \mathcal{O}_X^*(U)$ on $(s, g)$ is $(fs, f^{-1}g)$. Then $\mathcal{L}_1$ is a presheaf of $\mathcal{O}_X$-modules by setting $(s, g) + (s', g') = (s, g + (s'/s)g')$ where $s'/s$ is the local section $f$ of $\mathcal{O}_X^*$ such that $fs = s'$, and $h(s, g) = (s, hg)$ for $h$ a local section of $\mathcal{O}_X$. We omit the verification that the sheafification $\mathcal{L} = \mathcal{L}_1^\#$ is an invertible $\mathcal{O}_X$-module whose associated $\mathcal{O}_X^*$-torsor $\mathcal{L}^*$ is isomorphic to $\mathcal{F}$.
Denote $j : U \to X$ the open immersion. Recall that the functor $j^{-1}$ of restriction to $U$ is a right adjoint to the functor $j_!$ of extension by $0$, see Sheaves, Lemma \ref{sheaves-lemma-j-shriek-modules}. Moreover, $j_!$ is exact. Hence (1) follows from Homology, Lemma \ref{homology-lemma-adjoint-preserve-injectives}. \medskip\noindent By definition $H^p(U, \mathcal{F}) = H^p(\Gamma(U, \mathcal{I}^\bullet))$ where $\mathcal{F} \to \mathcal{I}^\bullet$ is an injective resolution in $\textit{Mod}(\mathcal{O}_X)$. By the above we see that $\mathcal{F}|_U \to \mathcal{I}^\bullet|_U$ is an injective resolution in $\textit{Mod}(\mathcal{O}_U)$. Hence $H^p(U, \mathcal{F}|_U)$ is equal to $H^p(\Gamma(U, \mathcal{I}^\bullet|_U))$. Of course $\Gamma(U, \mathcal{F}) = \Gamma(U, \mathcal{F}|_U)$ for any sheaf $\mathcal{F}$ on $X$. Hence the equality in (2).
First proof. Apply Lemmas \ref{lemma-describe-higher-direct-images} and \ref{lemma-cohomology-of-open} to see the displayed equality. Second proof. Choose an injective resolution $\mathcal{F} \to \mathcal{I}^\bullet$ and use that $\mathcal{F}|_{f^{-1}(V)} \to \mathcal{I}^\bullet|_{f^{-1}(V)}$ is an injective resolution also.