hcju/stacksqa huggingface dataset:
Consider pairs $(\xi , Z)$ where $Z \subset X$ is an integral closed subscheme of dimension $d$ and $\xi$ is its generic point. Then the finite $\mathcal{O}_{X, \xi}$-module $\mathcal{F}_\xi$ has support contained in $\{\xi\}$ hence the length $m_Z = \text{length}_{\mathcal{O}_{X, \xi}}(\mathcal{F}_\xi)$ is finite (Algebra, Lemma \ref{algebra-lemma-support-point}) and zero unless $Z = Z_i$ for some $i$. Thus the expression of the lemma can be written as $$ E(\mathcal{F}) = \chi(X, \mathcal{F} \otimes \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes \mathcal{L}_r^{\otimes n_r}) - \sum\nolimits m_Z\ \chi(Z, \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes \mathcal{L}_r^{\otimes n_r}|_Z) $$ where the sum is over integral closed subschemes $Z \subset X$ of dimension $d$. The assignment $\mathcal{F} \mapsto E(\mathcal{F})$ is additive in short exact sequences $0 \to \mathcal{F} \to \mathcal{F}' \to \mathcal{F}'' \to 0$ of coherent $\mathcal{O}_X$-modules whose support has dimension $\leq d$. This follows from additivity of Euler characteristics (Lemma \ref{lemma-euler-characteristic-additive}) and additivity of lengths (Algebra, Lemma \ref{algebra-lemma-length-additive}). Let us apply Cohomology of Schemes, Lemma \ref{coherent-lemma-coherent-filter} to find a filtration $$ 0 = \mathcal{F}_0 \subset \mathcal{F}_1 \subset \ldots \subset \mathcal{F}_m = \mathcal{F} $$ by coherent subsheaves such that for each $j = 1, \ldots, m$ there exists an integral closed subscheme $V_j \subset X$ and a sheaf of ideals $\mathcal{I}_j \subset \mathcal{O}_{V_j}$ such that $$ \mathcal{F}_j/\mathcal{F}_{j - 1} \cong (V_j \to X)_* \mathcal{I}_j $$ By the additivity we remarked upon above it suffices to prove the result for each of the subquotients $\mathcal{F}_j/\mathcal{F}_{j - 1}$. Thus it suffices to prove the result when $\mathcal{F} = (V \to X)_*\mathcal{I}$ where $V \subset X$ is an integral closed subscheme of dimension $\leq d$. If $\dim(V) < d$ and more generally for $\mathcal{F}$ whose support has dimension $< d$, then the first term in $E(\mathcal{F})$ has total degree $< d$ by Lemma \ref{lemma-numerical-polynomial-from-euler} and the second term is zero. If $\dim(V) = d$, then we can use the short exact sequence $$ 0 \to (V \to X)_*\mathcal{I} \to (V \to X)_*\mathcal{O}_V \to (V \to X)_*(\mathcal{O}_V/\mathcal{I}) \to 0 $$ The result holds for the middle sheaf because the only $Z$ occurring in the sum is $Z = V$ with $m_Z = 1$ and because $$ H^i(X, ((V \to X)_*\mathcal{O}_V) \otimes   \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes \mathcal{L}_r^{\otimes n_r}) = H^i(V,  \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes \mathcal{L}_r^{\otimes n_r}|_V) $$ by the projection formula (Cohomology, Section \ref{cohomology-section-projection-formula}) and Cohomology of Schemes, Lemma \ref{coherent-lemma-relative-affine-cohomology}; so in this case we actually have $E(\mathcal{F}) = 0$. The result holds for the sheaf on the right because its support has dimension $< d$. Thus the result holds for the sheaf on the left and the lemma is proved.
This is true because by Lemma \ref{lemma-numerical-polynomial-from-euler} the function $$ (n_1, \ldots, n_{i - 1}, n_i', n_i'', n_{i + 1}, \ldots, n_d) \mapsto \chi(Z, \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes (\mathcal{L}_i')^{\otimes n_i'} \otimes (\mathcal{L}_i'')^{\otimes n_i''} \otimes \ldots \otimes \mathcal{L}_d^{\otimes n_d}|_Z) $$ is a numerical polynomial of total degree at most $d$ in $d + 1$ variables.
The left hand side is computed using the coefficient of $n_1 \ldots n_d$ in the function $$ \chi(Y, \mathcal{O}_Z \otimes f^*\mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes f^*\mathcal{L}_d^{\otimes n_d}) = \sum (-1)^i \chi(X, R^if_*\mathcal{O}_Z \otimes \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes \mathcal{L}_d^{\otimes n_d}) $$ The equality follows from Lemma \ref{lemma-euler-characteristic-morphism} and the projection formula (Cohomology, Lemma \ref{cohomology-lemma-projection-formula}). If $f(Z)$ has dimension $< d$, then the right hand side is a polynomial of total degree $< d$ by Lemma \ref{lemma-numerical-polynomial-from-euler} and the result is true. Assume $\dim(f(Z)) = d$. Let $\xi \in f(Z)$ be the generic point. By dimension theory (see Lemmas \ref{lemma-dimension-locally-algebraic} and \ref{lemma-dimension-fibres-locally-algebraic}) the generic point of $Z$ is the unique point of $Z$ mapping to $\xi$. Then $f : Z \to f(Z)$ is finite over a nonempty open of $f(Z)$, see Morphisms, Lemma \ref{morphisms-lemma-generically-finite}. Thus $\deg(f : Z \to f(Z))$ is defined and in fact it is equal to the length of the stalk of $f_*\mathcal{O}_Z$ at $\xi$ over $\mathcal{O}_{X, \xi}$. Moreover, the stalk of $R^if_*\mathcal{O}_X$ at $\xi$ is zero for $i > 0$ because we just saw that $f|_Z$ is finite in a neighbourhood of $\xi$ (so that Cohomology of Schemes, Lemma \ref{coherent-lemma-finite-pushforward-coherent} gives the vanishing). Thus the terms $\chi(X, R^if_*\mathcal{O}_Z \otimes \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes \mathcal{L}_d^{\otimes n_d})$ with $i > 0$ have total degree $< d$ and $$ \chi(X, f_*\mathcal{O}_Z \otimes \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes \mathcal{L}_d^{\otimes n_d}) = \deg(f : Z \to f(Z)) \chi(f(Z), \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes \mathcal{L}_d^{\otimes n_d}|_{f(Z)}) $$ modulo a polynomial of total degree $< d$ by Lemma \ref{lemma-numerical-polynomial-leading-term}. The desired result follows.
We will prove this by induction on $d$. The case $d = 0$ follows from Lemma \ref{lemma-chi-tensor-finite}. Assume $d > 0$. By Lemma \ref{lemma-intersection-number-in-terms-of-components} we may assume that $Z$ is an integral closed subscheme. In fact, we may replace $X$ by $Z$ and $\mathcal{L}_i$ by $\mathcal{L}_i|_Z$ to reduce to the case $Z = X$ is a proper variety of dimension $d$. By Lemma \ref{lemma-intersection-number-additive} we may replace $\mathcal{L}_1$ by a positive tensor power. Thus we may assume there exists a nonzero section $s \in \Gamma(X, \mathcal{L}_1)$ such that $X_s$ is affine (here we use the definition of ample invertible sheaf, see Properties, Definition \ref{properties-definition-ample}). Observe that $X$ is not affine because proper and affine implies finite (Morphisms, Lemma \ref{morphisms-lemma-finite-proper}) which contradicts $d > 0$. It follows that $s$ has a nonempty vanishing scheme $Z(s) \subset X$. Since $X$ is a variety, $s$ is a regular section of $\mathcal{L}_1$, so $Z(s)$ is an effective Cartier divisor, thus $Z(s)$ has codimension $1$ in $X$, and hence $Z(s)$ has dimension $d - 1$ (here we use material from Divisors, Sections \ref{divisors-section-effective-Cartier-divisors} and \ref{divisors-section-Noetherian-effective-Cartier} and from dimension theory as in Lemma \ref{lemma-dimension-locally-algebraic}). By Lemma \ref{lemma-numerical-intersection-effective-Cartier-divisor} we have $$ (\mathcal{L}_1 \cdots \mathcal{L}_d \cdot X) = (\mathcal{L}_2 \cdots \mathcal{L}_d \cdot Z(s)) $$ By induction the right hand side is positive and the proof is complete.
Let $\mathcal{I} \subset \mathcal{O}_X$ be the quasi-coherent ideal sheaf of $Z$. Observe that via the inclusion $\mathcal{I} \otimes_{\mathcal{O}_X} \mathcal{L}^{\otimes n} \subset \mathcal{L}^{\otimes n}$ we have $V_n = \Gamma(X, \mathcal{I} \otimes_{\mathcal{O}_X} \mathcal{L}^{\otimes n})$. Choose $n_1$ such that for $n \geq n_1$ the sheaf $\mathcal{I} \otimes \mathcal{L}^{\otimes n}$ is globally generated, see Properties, Proposition \ref{properties-proposition-characterize-ample}. It follows that $V_n$ gererates $\mathcal{L}^{\otimes n}|_{X \setminus Z}$ for $n \geq n_1$. \medskip\noindent For $n \geq n_1$ denote $\psi_n : V_n \to \Gamma(X \setminus Z, \mathcal{L}^{\otimes n}|_{X \setminus Z})$ the restriction map. We get a canonical morphism $$ \varphi = \varphi_{\mathcal{L}^{\otimes n}|_{X \setminus Z}, \psi_n} : X \setminus Z \longrightarrow \mathbf{P}(V_n) $$ by Constructions, Example \ref{constructions-example-projective-space}. Choose $n_2$ such that for all $n \geq n_2$ the invertible sheaf $\mathcal{L}^{\otimes n}$ is very ample on $X$. We claim that $n_0 = n_1 + n_2$ works. \medskip\noindent Proof of the claim. Say $n \geq n_0$ and write $n = n_1 + n'$. For $x \in X \setminus Z$ we can choose $s_1 \in V_1$ not vanishing at $x$. Set $V' = \Gamma(X, \mathcal{L}^{\otimes n'})$. By our choice of $n$ and $n'$ we see that the corresponding morphism $\varphi' : X \to \mathbf{P}(V')$ is a closed immersion. Thus if we choose $s' \in \Gamma(X, \mathcal{L}^{\otimes n'})$ not vanishing at $x$, then $X_{s'} = (\varphi')^{-1}(D_+(s')$ (see Constructions, Lemma \ref{constructions-lemma-invertible-map-into-proj}) is affine and $X_{s'} \to D_+(s')$ is a closed immersion. Then $s = s_1 \otimes s' \in V_n$ does not vanish at $x$. If $D_+(s) \subset \mathbf{P}(V_n)$ denotes the corresponding open affine space of our projective space, then $\varphi^{-1}(D_+(s)) = X_s \subset X \setminus Z$ (see reference above). The open $X_s = X_{s'} \cap X_{s_1}$ is affine, see Properties, Lemma \ref{properties-lemma-affine-cap-s-open}. Consider the ring map $$ \text{Sym}(V)_{(s)} \longrightarrow \mathcal{O}_X(X_s) $$ defining the morphism $X_s \to D_+(s)$. Because $X_{s'} \to D_+(s')$ is a closed immersion, the images of the elements $$ \frac{s_1 \otimes t'}{s_1 \otimes s'} $$ where $t' \in V'$ generate the image of $\mathcal{O}_X(X_{s'}) \to \mathcal{O}_X(X_s)$. Since $X_s \to X_{s'}$ is an open immersion, this implies that $X_s \to D_+(s)$ is an immersion of affine schemes (see below). Thus $\varphi_n$ is an immersion by Morphisms, Lemma \ref{morphisms-lemma-check-immersion}. \medskip\noindent Let $a : A' \to A$ and $c : B \to A$ be ring maps such that $\Spec(a)$ is an immersion and $\Im(a) \subset \Im(c)$. Set $B' = A' \times_A B$ with projections $b : B' \to B$ and $c' : B' \to A'$. By assumption $c'$ is surjective and hence $\Spec(c')$ is a closed immersion. Whence $\Spec(c') \circ \Spec(a)$ is an immersion (Schemes, Lemma \ref{schemes-lemma-composition-immersion}). Then $\Spec(c)$ has to be an immersion because it factors the immersion $\Spec(c') \circ \Spec(a) = \Spec(b) \circ \Spec(c)$, see Morphisms, Lemma \ref{morphisms-lemma-immersion-permanence}.
Since $s$ is a regular section, so is $s^n \in \Gamma(X, \mathcal{L}^{\otimes n})$ for all $n > 1$. Moreover, the inclusion morphism $Z(s) \to Z(s^n)$ is a bijection on underlying topological spaces. Hence if $Z(s)$ is disconnected, so is $Z(s^n)$. Now consider the canonical short exact sequence $$ 0 \to \mathcal{L}^{\otimes -n} \xrightarrow{s^n} \mathcal{O}_X \to \mathcal{O}_{Z(s^n)} \to 0 $$ Consider the $k$-algebra $R_n = \Gamma(X, \mathcal{O}_{Z(s^n)})$. If $Z(s)$ is disconnected, i.e., $Z(s^n)$ is disconnected, then either $R_n$ is zero in case $Z(s^n) = \emptyset$ or $R_n$ contains a nontrivial idempotent in case $Z(s^n) = U \amalg V$ with $U, V \subset Z(s^n)$ open and nonempty (the reader may wish to consult Lemma \ref{lemma-proper-geometrically-reduced-global-sections}). Thus the map $\Gamma(X, \mathcal{O}_X) \to R_n$ cannot be an isomorphism. It follows that either $H^0(X, \mathcal{L}^{\otimes -n})$ or $H^1(X, \mathcal{L}^{\otimes -n})$ is nonzero for infinitely many positive $n$. This contradicts Lemma \ref{lemma-vanishin-h0-negative} or \ref{lemma-vanishin-h1-negative} and the proof is complete.
Let $\overline{k}$ be an algebraic closure of $k$. Let $Y$ be a connected component of $(X_{\overline{k}})_{red}$. Note that the canonical morphism $p : Y \to X$ is open (by Morphisms, Lemma \ref{morphisms-lemma-scheme-over-field-universally-open}) and closed (by Morphisms, Lemma \ref{morphisms-lemma-integral-universally-closed}). Hence $p(Y) = X$ as $X$ was assumed connected. In particular, as $X$ is reduced this implies $\mathcal{O}(X) \subset \mathcal{O}(Y)$. By Lemma \ref{lemma-galois-action-irreducible-components-locally-finite-type} we see that $Y$ has finitely many irreducible components. Thus Lemma \ref{lemma-units-general-algebraically-closed} applies to $Y$. This implies that if $\mathcal{O}(X)^*/k^*$ is not a finitely generated abelian group, then there exist elements $f \in \mathcal{O}(X)$, $f \not \in k$ which map to an element of $\overline{k}$ via the map $\mathcal{O}(X) \to \mathcal{O}(Y)$. In this case $f$ is algebraic over $k$, hence integral over $k$. Thus, if condition (1) holds, then this cannot happen. To finish the proof we show that conditions (2) and (3) imply (1). \medskip\noindent Let $k \subset k' \subset \Gamma(X, \mathcal{O}_X)$ be the integral closure of $k$ in $\Gamma(X, \mathcal{O}_X)$. By Lemma \ref{lemma-integral-closure-ground-field} we see that $k'$ is a field. If $e : \Spec(k) \to X$ is a $k$-rational point, then $e^\sharp : \Gamma(X, \mathcal{O}_X) \to k$ is a section to the inclusion map $k \to \Gamma(X, \mathcal{O}_X)$. In particular the restriction of $e^\sharp$ to $k'$ is a field map $k' \to k$ over $k$, which clearly shows that (2) implies (1). \medskip\noindent If the integral closure $k'$ of $k$ in $\Gamma(X, \mathcal{O}_X)$ is not trivial, then we see that $X$ is either not geometrically connected (if $k \subset k'$ is not purely inseparable) or that $X$ is not geometrically reduced (if $k \subset k'$ is nontrivial purely inseparable). Details omitted. Hence (3) implies (1).
Let $Z \subset X$ be the reduction of $X$. By Lemma \ref{lemma-dim-1-noetherian-reduced-separated-has-ample} the scheme $Z$ has an ample invertible sheaf. Thus by Lemma \ref{lemma-lift-line-bundle-from-reduction-dimension-1} there exists an invertible $\mathcal{O}_X$-module $\mathcal{L}$ on $X$ whose restriction to $Z$ is ample. Then $\mathcal{L}$ is ample by an application of Cohomology of Schemes, Lemma \ref{coherent-lemma-ample-on-reduction}.
We can replace $X$ by a quasi-compact open containing $x_1, \ldots, x_r$ hence we may assume that $X$ has finitely many irreducible components. By Lemma \ref{lemma-finite-set-codim-1-points-in-affine-per-component} we reduce to the case where $X$ is integral. This case is Lemma \ref{lemma-finite-set-codim-1-points-in-affine}.
This is true because the forgetful functor $V : A\textit{-Alg} \to \textit{Sets}$ and its adjoint $U : \textit{Sets} \to A\textit{-Alg}$ commute with filtered colimits. Moreover, the functor $B/A \mapsto \Omega_{B/A}$ does as well (Algebra, Lemma \ref{algebra-lemma-colimit-differentials}).
We will use the criterion of Cohomology on Sites, Lemma \ref{sites-cohomology-lemma-compute-by-cosimplicial-resolution} to prove this. Given an object $U = (Q, \beta)$ of $\mathcal{C}$ we have to show that $$ S_\bullet = \Mor_\mathcal{C}((Q, \beta), (P_\bullet, \epsilon)) $$ is homotopy equivalent to a singleton. Write $Q = A[E]$ for some set $E$ (this is possible by our choice of the category $\mathcal{C}$). We see that $$ S_\bullet = \Mor_{\textit{Sets}}((E, \beta|_E), (P_\bullet, \epsilon)) $$ Let $*$ be the constant simplicial set on a singleton. For $b \in B$ let $F_{b, \bullet}$ be the simplicial set defined by the cartesian diagram $$ \xymatrix{ F_{b, \bullet} \ar[r] \ar[d] & P_\bullet \ar[d]_\epsilon \\ {*} \ar[r]^b & B } $$ With this notation $S_\bullet = \prod_{e \in E} F_{\beta(e), \bullet}$. Since we assumed $\epsilon$ is a trivial Kan fibration we see that $F_{b, \bullet} \to *$ is a trivial Kan fibration (Simplicial, Lemma \ref{simplicial-lemma-trivial-kan-base-change}). Thus $S_\bullet \to *$ is a trivial Kan fibration (Simplicial, Lemma \ref{simplicial-lemma-product-trivial-kan}). Therefore $S_\bullet$ is homotopy equivalent to $*$ (Simplicial, Lemma \ref{simplicial-lemma-trivial-kan-homotopy}).
[First proof] We will apply Lemma \ref{lemma-identify-pi-shriek}. Since the terms $P_n$ are polynomial algebras we see the first assumption of that lemma is satisfied. The second assumption is proved as follows. By Simplicial, Lemma \ref{simplicial-lemma-standard-simplicial-homotopy} the map $\epsilon$ is a homotopy equivalence of underlying simplicial sets. By Simplicial, Lemma \ref{simplicial-lemma-homotopy-equivalence} this implies $\epsilon$ induces a quasi-isomorphism of associated complexes of abelian groups. By Simplicial, Lemma \ref{simplicial-lemma-qis-simplicial-abelian-groups} this implies that $\epsilon$ is a trivial Kan fibration of underlying simplicial sets.
For an object $\alpha : P \to B$ of the category $\mathcal{C}$ the module $\Omega_{P/A}$ is a free $P$-module. Thus $\Omega_{\mathcal{O}/A}$ is a flat $\mathcal{O}$-module. Hence $Li^*\Omega_{\mathcal{O}/A} = i^*\Omega_{\mathcal{O}/A}$ is the sheaf of $\underline{B}$-modules which associates to $\alpha : P \to A$ the $B$-module $\Omega_{P/A} \otimes_{P, \alpha} B$. By Lemma \ref{lemma-pi-shriek-standard} we see that the right hand side is computed by the value of this sheaf on the standard resolution which is our definition of the left hand side (Definition \ref{definition-cotangent-complex-ring-map}).
We will prove this by a direct calculation. We will use the identification of Lemma \ref{lemma-compute-cotangent-complex}. There is clearly a map from $\Omega_{\mathcal{O}/A} \otimes \underline{B}$ to the constant sheaf with value $\Omega_{B/A}$. Thus this map induces a map $$ H^0(L_{B/A}) = H^0(L\pi_!(\Omega_{\mathcal{O}/A} \otimes \underline{B})) = \pi_!(\Omega_{\mathcal{O}/A} \otimes \underline{B}) \to \Omega_{B/A} $$ By choosing an object $P \to B$ of $\mathcal{C}_{B/A}$ with $P \to B$ surjective we see that this map is surjective (by Algebra, Lemma \ref{algebra-lemma-differential-surjective}). To show that it is injective, suppose that $P \to B$ is an object of $\mathcal{C}_{B/A}$ and that $\xi \in \Omega_{P/A} \otimes_P B$ is an element which maps to zero in $\Omega_{B/A}$. We first choose factorization $P \to P' \to B$ such that $P' \to B$ is surjective and $P'$ is a polynomial algebra over $A$. We may replace $P$ by $P'$. If $B = P/I$, then the kernel $\Omega_{P/A} \otimes_P B \to \Omega_{B/A}$ is the image of $I/I^2$ (Algebra, Lemma \ref{algebra-lemma-differential-seq}). Say $\xi$ is the image of $f \in I$. Then we consider the two maps $a, b : P' = P[x] \to P$, the first of which maps $x$ to $0$ and the second of which maps $x$ to $f$ (in both cases $P[x] \to B$ maps $x$ to zero). We see that $\xi$ and $0$ are the image of $\text{d}x \otimes 1$ in $\Omega_{P'/A} \otimes_{P'} B$. Thus $\xi$ and $0$ have the same image in the colimit (see Cohomology on Sites, Example \ref{sites-cohomology-example-category-to-point}) $\pi_!(\Omega_{\mathcal{O}/A} \otimes \underline{B})$ as desired.
It suffices to verify the assumptions of Cohomology on Sites, Lemma \ref{sites-cohomology-lemma-O-homology-qis} hold for $\mathcal{O} \to \underline{B}$ on $\mathcal{C}_{B/A}$. We will use the results of Remark \ref{remark-resolution} without further mention. Choose a resolution $P_\bullet$ of $B$ over $A$ to get a suitable cosimplicial object $U_\bullet$ of $\mathcal{C}_{B/A}$. Since $P_\bullet \to B$ induces a quasi-isomorphism on associated complexes of abelian groups we see that $L\pi_!\mathcal{O} = B$. On the other hand $L\pi_!\underline{B}$ is computed by $\underline{B}(U_\bullet) = B$. This verifies the second assumption of Cohomology on Sites, Lemma \ref{sites-cohomology-lemma-O-homology-qis} and we are done with the proof.
We will use the observations of Remark \ref{remark-resolution} without further mention. Choose a resolution $\epsilon : P_\bullet \to C$ of $C$ over $B$ (for example the standard resolution). Since $B$ is a polynomial algebra over $A$ we see that $P_\bullet$ is also a resolution of $C$ over $A$. Hence $L_{C/A}$ is computed by $\Omega_{P_\bullet/A} \otimes_{P_\bullet, \epsilon} C$ and $L_{C/B}$ is computed by $\Omega_{P_\bullet/B} \otimes_{P_\bullet, \epsilon} C$. Since for each $n$ we have the short exact sequence $0 \to \Omega_{B/A} \otimes_B P_n \to \Omega_{P_n/A} \to \Omega_{P_n/B}$ (Algebra, Lemma \ref{algebra-lemma-ses-formally-smooth}) and since $L_{B/A} = \Omega_{B/A}[0]$ (Lemma \ref{lemma-cotangent-complex-polynomial-algebra}) we obtain the result.
We use the results of Remark \ref{remark-resolution} without further mention. We will apply Cohomology on Sites, Lemma \ref{sites-cohomology-lemma-get-it-now}. Let $P_\bullet \to B$ be a resolution. If we can show that $u(P_\bullet) = P_\bullet \otimes_A A' \to B'$ is a quasi-isomorphism, then we are done. The complex of $A$-modules $s(P_\bullet)$ associated to $P_\bullet$ (viewed as a simplicial $A$-module) is a free $A$-module resolution of $B$. Namely, $P_n$ is a free $A$-module and $s(P_\bullet) \to B$ is a quasi-isomorphism. Thus $B \otimes_A^\mathbf{L} A'$ is computed by $s(P_\bullet) \otimes_A A' = s(P_\bullet \otimes_A A')$. Therefore the assumption of the lemma signifies that $\epsilon' : P_\bullet \otimes_A A' \to B'$ is a quasi-isomorphism.
We will use the notation introduced in Equation (\ref{equation-double-square}). We have $$ L_{B/A} \otimes_B^\mathbf{L} B' = L\pi_!(\Omega_{\mathcal{O}/A} \otimes_\mathcal{O} \underline{B}) \otimes_B^\mathbf{L} B' = L\pi_!(Lh^*(\Omega_{\mathcal{O}/A} \otimes_\mathcal{O} \underline{B})) $$ the first equality by Lemma \ref{lemma-compute-cotangent-complex} and the second by Cohomology on Sites, Lemma \ref{sites-cohomology-lemma-change-of-rings}. Since $\Omega_{\mathcal{O}/A}$ is a flat $\mathcal{O}$-module, we see that $\Omega_{\mathcal{O}/A} \otimes_\mathcal{O} \underline{B}$ is a flat $\underline{B}$-module. Thus $Lh^*(\Omega_{\mathcal{O}/A} \otimes_\mathcal{O} \underline{B}) = \Omega_{\mathcal{O}/A} \otimes_\mathcal{O} \underline{B'}$ which is equal to $g^{-1}(\Omega_{\mathcal{O}'/A'} \otimes_{\mathcal{O}'} \underline{B'})$ by inspection. we conclude by Lemma \ref{lemma-flat-base-change} and the fact that $L_{B'/A'}$ is computed by $L\pi'_!(\Omega_{\mathcal{O}'/A'} \otimes_{\mathcal{O}'} \underline{B'})$.
Although this lemma can be deduced from the fundamental triangle we will give a direct and elementary proof of this now. Factor the ring map $A \to B \times C$ as $A \to A[x] \to B \times C$ where $x \mapsto (1, 0)$. By Lemma \ref{lemma-special-case-triangle} we have a distinguished triangle $$ L_{A[x]/A} \otimes_{A[x]}^\mathbf{L} (B \times C) \to L_{B \times C/A} \to L_{B \times C/A[x]} \to L_{A[x]/A} \otimes_{A[x]}^\mathbf{L} (B \times C)[1] $$ in $D(B \times C)$. Similarly we have the distinguished triangles $$ \begin{matrix} L_{A[x]/A} \otimes_{A[x]}^\mathbf{L} B \to L_{B/A} \to L_{B/A[x]} \to L_{A[x]/A} \otimes_{A[x]}^\mathbf{L} B[1] \\ L_{A[x]/A} \otimes_{A[x]}^\mathbf{L} C \to L_{C/A} \to L_{C/A[x]} \to L_{A[x]/A} \otimes_{A[x]}^\mathbf{L} C[1] \end{matrix} $$ Thus it suffices to prove the result for $B \times C$ over $A[x]$. Note that $A[x] \to A[x, x^{-1}]$ is flat, that $(B \times C) \otimes_{A[x]} A[x, x^{-1}] = B \otimes_{A[x]} A[x, x^{-1}]$, and that $C \otimes_{A[x]} A[x, x^{-1}] = 0$. Thus by base change (Lemma \ref{lemma-flat-base-change-cotangent-complex}) the map $L_{B \times C/A[x]} \to L_{B/A[x]} \oplus L_{C/A[x]}$ becomes an isomorphism after inverting $x$. In the same way one shows that the map becomes an isomorphism after inverting $x - 1$. This proves the lemma.
Recall that $g_i^{-1}$ is gotten by simply precomposing with $u_i$. Given an object $U = (P \to B, Q \to C)$ we have a split short exact sequence $$ 0 \to \Omega_{P/A} \otimes Q \to \Omega_{Q/A} \to \Omega_{Q/P} \to 0 $$ for example by Algebra, Lemma \ref{algebra-lemma-ses-formally-smooth}. Tensoring with $C$ over $Q$ we obtain a short exact sequence $$ 0 \to \Omega_{P/A} \otimes C \to \Omega_{Q/A} \otimes C \to \Omega_{Q/P} \otimes C \to 0 $$ We have $\Omega_{P/A} \otimes C = \Omega_{P/A} \otimes B \otimes C$ whence this is the value of $g_1^{-1}\Omega_1 \otimes_{\underline{B}} \underline{C}$ on $U$. The module $\Omega_{Q/A} \otimes C$ is the value of $g_2^{-1}\Omega_2$ on $U$. We have $\Omega_{Q/P} \otimes C = \Omega_{Q \otimes_P B/B} \otimes C$ by Algebra, Lemma \ref{algebra-lemma-differentials-base-change} hence this is the value of $g_3^{-1}\Omega_3$ on $U$. Thus the short exact sequence of the lemma comes from assigning to $U$ the last displayed short exact sequence.