## 37.32 Theorem of the cube

The following lemma tells us that the diagonal of the Picard functor is representable by locally closed immersions under the assumptions made in the lemma.

Lemma 37.32.1. Let $f : X \to S$ be a flat, proper morphism of finite presentation. Let $\mathcal{E}$ be a finite locally free $\mathcal{O}_ X$-module. For a morphism $g : T \to S$ consider the base change diagram

$\xymatrix{ X_ T \ar[d]_ p \ar[r]_ q & X \ar[d]^ f \\ T \ar[r]^ g & S }$

Assume $\mathcal{O}_ T \to p_*\mathcal{O}_{X_ T}$ is an isomorphism for all $g : T \to S$. Then there exists an immersion $j : Z \to S$ of finite presentation such that a morphism $g : T \to S$ factors through $Z$ if and only if there exists a finite locally free $\mathcal{O}_ T$-module $\mathcal{N}$ with $p^*\mathcal{N} \cong q^*\mathcal{E}$.

Proof. Observe that the fibres $X_ s$ of $f$ are connected by our assumption that $H^0(X_ s, \mathcal{O}_{X_ s}) = \kappa (s)$. Thus the rank of $\mathcal{E}$ is constant on the fibres. Since $f$ is open (Morphisms, Lemma 29.25.10) and closed we conclude that there is a decomposition $S = \coprod S_ r$ of $S$ into open and closed subschemes such that $\mathcal{E}$ has constant rank $r$ on the inverse image of $S_ r$. Thus we may assume $\mathcal{E}$ has constant rank $r$. We will denote $\mathcal{E}^\vee = \mathop{\mathcal{H}\! \mathit{om}}\nolimits (\mathcal{E}, \mathcal{O}_ X)$ the dual rank $r$ module.

By cohomology and base change (more precisely by Derived Categories of Schemes, Lemma 36.30.4) we see that $E = Rf_*\mathcal{E}$ is a perfect object of the derived category of $S$ and that its formation commutes with arbitrary change of base. Similarly for $E' = Rf_*\mathcal{E}^\vee$. Since there is never any cohomology in degrees $< 0$, we see that $E$ and $E'$ have (locally) tor-amplitude in $[0, b]$ for some $b$. Observe that for any $g : T \to S$ we have $p_*(q^*\mathcal{E}) = H^0(Lg^*E)$ and $p_*(q^*\mathcal{E}^\vee ) = H^0(Lg^*E')$. Let $j : Z \to S$ and $j' : Z' \to S$ be immersions of finite presentation constructed in Derived Categories of Schemes, Lemma 36.31.4 for $E$ and $E'$ with $a = 0$ and $r = r$; these are roughly speaking characterized by the property that $H^0(Lj^*E)$ and $H^0((j')^*E')$ are finite locally free modules compatible with pullback.

Let $g : T \to S$ be a morphism. If there exists an $\mathcal{N}$ as in the lemma, then, using the projection formula Cohomology, Lemma 20.51.2, we see that the modules

$p_*(q^*\mathcal{L}) \cong p_*(p^*\mathcal{N}) \cong \mathcal{N} \otimes _{\mathcal{O}_ T} p_*\mathcal{O}_{X_ T} \cong \mathcal{N}\quad \text{and similarly }\quad p_*(q^*\mathcal{E}^\vee ) \cong \mathcal{N}^\vee$

are finite locally free modules of rank $r$ and remain so after any further base change $T' \to T$. Hence in this case $T \to S$ factors through $j$ and through $j'$. Thus we may replace $S$ by $Z \times _ S Z'$ and assume that $f_*\mathcal{E}$ and $f_*\mathcal{E}^\vee$ are finite locally free $\mathcal{O}_ S$-modules of rank $r$ whose formation commutes with arbitrary change of base (small detail omitted).

In this sitation if $g : T \to S$ be a morphism and there exists an $\mathcal{N}$ as in the lemma, then the map (cup product in degree $0$)

$p_*(q^*\mathcal{E}) \otimes _{\mathcal{O}_ T} p_*(q^*\mathcal{E}^\vee ) \longrightarrow \mathcal{O}_ T$

is a perfect pairing. Conversely, if this cup product map is a perfect pairing, then we see that locally on $T$ we may choose a basis of sections $\sigma _1, \ldots , \sigma _ r$ in $p_*(q^*\mathcal{E})$ and $\tau _1, \ldots , \tau _ r$ in $p_*(q^*\mathcal{E}^\vee )$ whose products satisfy $\sigma _ i \tau _ j = \delta _{ij}$. Thinking of $\sigma _ i$ as a section of $q^*\mathcal{E}$ on $X_ T$ and $\tau _ j$ as a section of $q^*\mathcal{E}^\vee$ on $X_ T$, we conclude that

$\sigma _1, \ldots , \sigma _ r : \mathcal{O}_{X_ T}^{\oplus r} \longrightarrow q^*\mathcal{E}$

is an isomorphism with inverse given by

$\tau _1, \ldots , \tau _ r : q^*\mathcal{E} \longrightarrow \mathcal{O}_{X_ T}^{\oplus r}$

In other words, we see that $p^*p_*q^*\mathcal{E} \cong q^*\mathcal{E}$. But the condition that the cupproduct is nondegenerate picks out a retrocompact open subscheme (namely, the locus where a suitable determinant is nonzero) and the proof is complete. $\square$

The lemma above in particular tells us, that if a vector bundle is trivial on fibres for a proper flat family of proper spaces, then it is the pull back of a vector bundle. Let's spell this out a bit.

Lemma 37.32.2. Let $f : X \to S$ be a flat, proper morphism of finite presentation such that $f_*\mathcal{O}_ X = \mathcal{O}_ S$ and this remains true after arbitrary base change. Let $\mathcal{E}$ be a finite locally free $\mathcal{O}_ X$-module. Assume

1. $\mathcal{E}|_{X_ s}$ is isomorphic to $\mathcal{O}_{X_ s}^{\oplus r_ s}$ for all $s \in S$, and

2. $S$ is reduced.

Then $\mathcal{E} = f^*\mathcal{N}$ for some finite locally free $\mathcal{O}_ S$-module $\mathcal{N}$.

Proof. Namely, in this case the locally closed immersion $j : Z \to S$ of Lemma 37.32.1 is bijective and hence a closed immersion. But since $S$ is reduced, $j$ is an isomorphism. $\square$

Lemma 37.32.3. Let $f : X \to S$ be a proper flat morphism of finite presentation. Let $\mathcal{L}$ be an invertible $\mathcal{O}_ X$-module. Assume

1. $S$ is the spectrum of a valuation ring,

2. $\mathcal{L}$ is trivial on the generic fibre $X_\eta$ of $f$,

3. the closed fibre $X_0$ of $f$ is integral,

4. $H^0(X_\eta , \mathcal{O}_{X_\eta })$ is equal to the function field of $S$.

Then $\mathcal{L}$ is trivial.

Proof. Write $S = \mathop{\mathrm{Spec}}(A)$. We will first prove the lemma when $A$ is a discrete valuation ring (as this is the case most often used in practice). Let $\pi \in A$ be a uniformizer. Take a trivializing section $s \in \Gamma (X_\eta , \mathcal{L}_\eta )$. After replacing $s$ by $\pi ^ n s$ if necessary we can assume that $s \in \Gamma (X, \mathcal{L})$. If $s|_{X_0} = 0$, then we see that $s$ is divisible by $\pi$ (because $X_0$ is the scheme theoretic fibre and $X$ is flat over $A$). Thus we may assume that $s|_{X_0}$ is nonzero. Then the zero locus $Z(s)$ of $s$ is contained in $X_0$ but does not contain the generic point of $X_0$ (because $X_0$ is integral). This means that the $Z(s)$ has codimension $\geq 2$ in $X$ which contradicts Divisors, Lemma 31.15.3 unless $Z(s) = \emptyset$ as desired.

Proof in the general case. Since the valuation ring $A$ is coherent (Algebra, Example 10.90.2) we see that $H^0(X, \mathcal{L})$ is a coherent $A$-module, see Derived Categories of Schemes, Lemma 36.33.1. Equivalently, $H^0(X, \mathcal{L})$ is a finitely presented $A$-module (Algebra, Lemma 10.90.4). Since $H^0(X, \mathcal{L})$ is torsion free (by flatness of $X$ over $A$), we see from More on Algebra, Lemma 15.124.3 that $H^0(X, \mathcal{L}) = A^{\oplus n}$ for some $n$. By flat base change (Cohomology of Schemes, Lemma 30.5.2) we have

$K = H^0(X_\eta , \mathcal{O}_{X_\eta }) \cong H^0(X_\eta , \mathcal{L}_\eta ) = H^0(X, \mathcal{L}) \otimes _ A K$

where $K$ is the fraction field of $A$. Thus $n = 1$. Pick a generator $s \in H^0(X, \mathcal{L})$. Let $\mathfrak m \subset A$ be the maximal ideal. Then $\kappa = A/\mathfrak m = \mathop{\mathrm{colim}}\nolimits A/\pi$ where this is a filtered colimit over nonzero $\pi \in \mathfrak m$ (here we use that $A$ is a valuation ring). Thus $X_0 = \mathop{\mathrm{lim}}\nolimits X \times _ S \mathop{\mathrm{Spec}}(A/\pi )$. If $s|_{X_0}$ is zero, then for some $\pi$ we see that $s$ restricts to zero on $X \times _ S \mathop{\mathrm{Spec}}(A/\pi )$, see Limits, Lemma 32.4.7. But if this happens, then $\pi ^{-1} s$ is a global section of $\mathcal{L}$ which contradicts the fact that $s$ is a generator of $H^0(X, \mathcal{L})$. Thus $s|_{X_0}$ is not zero. Let $Z(s) \subset X$ be the zero scheme of $s$. Since $s|_{X_0}$ is not zero and since $X_0$ is integral, we see that $Z(s)_0 \subset X_0$ is an effective Cartier divisor. Since $f$ is proper and $S$ is local, every point of $Z(s)$ specializes to a point of $Z(s)_0$. Thus by Divisors, Lemma 31.18.9 part (3) we see that $Z(s)$ is a relative effective Cartier divisor, in particular $Z(s) \to S$ is flat. Hence if $Z(s)$ were nonemtpy, then $Z(s)_\eta$ would be nonempty which contradicts the fact that $s|_{X_\eta }$ is a trivialization of $\mathcal{L}_\eta$. Thus $Z(s) = \emptyset$ as desired. $\square$

Lemma 37.32.4. Let $f : X \to S$ and $\mathcal{E}$ be as in Lemma 37.32.1 and in addition assume $\mathcal{E}$ is an invertible $\mathcal{O}_ X$-module. If moreover the geometric fibres of $f$ are integral, then $Z$ is closed in $S$.

Proof. Since $j : Z \to S$ is of finite presentation, it suffices to show: for any morphism $g : \mathop{\mathrm{Spec}}(A) \to S$ where $A$ is a valuation ring with fraction field $K$ such that $g(\mathop{\mathrm{Spec}}(K)) \in j(Z)$ we have $g(\mathop{\mathrm{Spec}}(A)) \subset j(Z)$. See Morphisms, Lemma 29.6.5. This follows from Lemma 37.32.3 and the characterization of $j : Z \to S$ in Lemma 37.32.1. $\square$

Lemma 37.32.5. Consider a commutative diagram of schemes

$\xymatrix{ X' \ar[rr] \ar[dr]_{f'} & & X \ar[dl]^ f \\ & S }$

with $f' : X' \to S$ and $f : X \to S$ satisfying the hypotheses of Lemma 37.32.1. Let $\mathcal{L}$ be an invertible $\mathcal{O}_ X$-module and let $\mathcal{L}'$ be the pullback to $X'$. Let $Z \subset S$, resp. $Z' \subset S$ be the locally closed subscheme constructed in Lemma 37.32.1 for $(f, \mathcal{L})$, resp. $(f', \mathcal{L}')$ so that $Z \subset Z'$. If $s \in Z$ and

$H^1(X_ s, \mathcal{O}) \longrightarrow H^1(X'_ s, \mathcal{O})$

is injective, then $Z \cap U = Z' \cap U$ for some open neighbourhood $U$ of $s$.

Proof. We may replace $S$ by $Z'$. After shrinking $S$ to an affine open neighbourhood of $s$ we may assume that $\mathcal{L}' = \mathcal{O}_{X'}$. Let $E = Rf_*\mathcal{L}$ and $E' = Rf'_*\mathcal{L}' = Rf'_*\mathcal{O}_{X'}$. These are perfect complexes whose formation commutes with arbitrary change of base (Derived Categories of Schemes, Lemma 36.30.4). In particular we see that

$E \otimes _{\mathcal{O}_ S}^\mathbf {L} \kappa (s) = R\Gamma (X_ s, \mathcal{L}_ s) = R\Gamma (X_ s, \mathcal{O}_{X_ s})$

The second equality because $s \in Z$. Set $h_ i = \dim _{\kappa (s)} H^ i(X_ s, \mathcal{O}_{X_ s})$. After shrinking $S$ we can represent $E$ by a complex

$\mathcal{O}_ S \to \mathcal{O}_ S^{\oplus h_1} \to \mathcal{O}_ S^{\oplus h_2} \to \ldots$

see More on Algebra, Lemma 15.75.6 (strictly speaking this also uses Derived Categories of Schemes, Lemmas 36.3.5 and 36.10.7). Similarly, we may assume $E'$ is represented by a complex

$\mathcal{O}_ S \to \mathcal{O}_ S^{\oplus h'_1} \to \mathcal{O}_ S^{\oplus h'_2} \to \ldots$

where $h'_ i = \dim _{\kappa (s)} H^ i(X'_ s, \mathcal{O}_{X'_ s})$. By functoriality of cohomology we have a map

$E \longrightarrow E'$

in $D(\mathcal{O}_ S)$ whose formation commutes with change of base. Since the complex representing $E$ is a finite complex of finite free modules and since $S$ is affine, we can choose a map of complexes

$\xymatrix{ \mathcal{O}_ S \ar[r]_ d \ar[d]_ a & \mathcal{O}_ S^{\oplus h_1} \ar[r] \ar[d]_ b & \mathcal{O}_ S^{\oplus h_2} \ar[r] \ar[d]_ c & \ldots \\ \mathcal{O}_ S \ar[r]^{d'} & \mathcal{O}_ S^{\oplus h'_1} \ar[r] & \mathcal{O}_ S^{\oplus h'_2} \ar[r] & \ldots }$

representing the given map $E \to E'$. Since $s \in Z$ we see that the trivializing section of $\mathcal{L}_ s$ pulls back to a trivializing section of $\mathcal{L}'_ s = \mathcal{O}_{X'_ s}$. Thus $a \otimes \kappa (s)$ is an isomorphism, hence after shrinking $S$ we see that $a$ is an isomorphism. Finally, we use the hypothesis that $H^1(X_ s, \mathcal{O}) \to H^1(X'_ s, \mathcal{O})$ is injective, to see that there exists a $h_1 \times h_1$ minor of the matrix defining $b$ which maps to a nonzero element in $\kappa (s)$. Hence after shrinking $S$ we may assume that $b$ is injective. However, since $\mathcal{L}' = \mathcal{O}_{X'}$ we see that $d' = 0$. It follows that $d = 0$. In this way we see that the trivializing section of $\mathcal{L}_ s$ lifts to a section of $\mathcal{L}$ over $X$. A straightforward topological argument (omitted) shows that this means that $\mathcal{L}$ is trivial after possibly shrinking $S$ a bit further. $\square$

Lemma 37.32.6. Consider $n$ commutative diagrams of schemes

$\xymatrix{ X_ i \ar[rr] \ar[dr]_{f_ i} & & X \ar[dl]^ f \\ & S }$

with $f_ i : X_ i \to S$ and $f : X \to S$ satisfying the hypotheses of Lemma 37.32.1. Let $\mathcal{L}$ be an invertible $\mathcal{O}_ X$-module and let $\mathcal{L}_ i$ be the pullback to $X_ i$. Let $Z \subset S$, resp. $Z_ i \subset S$ be the locally closed subscheme constructed in Lemma 37.32.1 for $(f, \mathcal{L})$, resp. $(f_ i, \mathcal{L}_ i)$ so that $Z \subset \bigcap _{i = 1, \ldots , n} Z_ i$. If $s \in Z$ and

$H^1(X_ s, \mathcal{O}) \longrightarrow \bigoplus \nolimits _{i = 1, \ldots , n} H^1(X_{i, s}, \mathcal{O})$

is injective, then $Z \cap U = (\bigcap _{i = 1, \ldots , n} Z_ i) \cap U$ (scheme theoretic intersection) for some open neighbourhood $U$ of $s$.

Proof. This lemma is a variant of Lemma 37.32.5 and we strongly urge the reader to read that proof first; this proof is basically a copy of that proof with minor modifications. It follows from the description of (scheme valued) points of $Z$ and the $Z_ i$ that $Z \subset \bigcap _{i = 1, \ldots , n} Z_ i$ where we take the scheme theoretic intersection. Thus we may replace $S$ by the scheme theoretic intersection $\bigcap _{i = 1, \ldots , n} Z_ i$. After shrinking $S$ to an affine open neighbourhood of $s$ we may assume that $\mathcal{L}_ i = \mathcal{O}_{X_ i}$ for $i = 1, \ldots , n$. Let $E = Rf_*\mathcal{L}$ and $E_ i = Rf_{i, *}\mathcal{L}_ i = Rf_{i, *}\mathcal{O}_{X_ i}$. These are perfect complexes whose formation commutes with arbitrary change of base (Derived Categories of Schemes, Lemma 36.30.4). In particular we see that

$E \otimes _{\mathcal{O}_ S}^\mathbf {L} \kappa (s) = R\Gamma (X_ s, \mathcal{L}_ s) = R\Gamma (X_ s, \mathcal{O}_{X_ s})$

The second equality because $s \in Z$. Set $h_ j = \dim _{\kappa (s)} H^ j(X_ s, \mathcal{O}_{X_ s})$. After shrinking $S$ we can represent $E$ by a complex

$\mathcal{O}_ S \to \mathcal{O}_ S^{\oplus h_1} \to \mathcal{O}_ S^{\oplus h_2} \to \ldots$

see More on Algebra, Lemma 15.75.6 (strictly speaking this also uses Derived Categories of Schemes, Lemmas 36.3.5 and 36.10.7). Similarly, we may assume $E_ i$ is represented by a complex

$\mathcal{O}_ S \to \mathcal{O}_ S^{\oplus h_{i, 1}} \to \mathcal{O}_ S^{\oplus h_{i, 2}} \to \ldots$

where $h_{i, j} = \dim _{\kappa (s)} H^ j(X_{i, s}, \mathcal{O}_{X_{i, s}})$. By functoriality of cohomology we have a map

$E \longrightarrow E_ i$

in $D(\mathcal{O}_ S)$ whose formation commutes with change of base. Since the complex representing $E$ is a finite complex of finite free modules and since $S$ is affine, we can choose a map of complexes

$\xymatrix{ \mathcal{O}_ S \ar[r]_ d \ar[d]_{a_ i} & \mathcal{O}_ S^{\oplus h_1} \ar[r] \ar[d]_{b_ i} & \mathcal{O}_ S^{\oplus h_2} \ar[r] \ar[d]_{c_ i} & \ldots \\ \mathcal{O}_ S \ar[r]^{d_ i} & \mathcal{O}_ S^{\oplus h_{i, 1}} \ar[r] & \mathcal{O}_ S^{\oplus h_{i, 2}} \ar[r] & \ldots }$

representing the given map $E \to E_ i$. Since $s \in Z$ we see that the trivializing section of $\mathcal{L}_ s$ pulls back to a trivializing section of $\mathcal{L}_{i, s} = \mathcal{O}_{X_{i, s}}$. Thus $a_ i \otimes \kappa (s)$ is an isomorphism, hence after shrinking $S$ we see that $a_ i$ is an isomorphism. Finally, we use the hypothesis that $H^1(X_ s, \mathcal{O}) \to \bigoplus _{i = 1, \ldots , n} H^1(X_{i, s}, \mathcal{O})$ is injective, to see that there exists a $h_1 \times h_1$ minor of the matrix defining $\oplus b_ i$ which maps to a nonzero element in $\kappa (s)$. Hence after shrinking $S$ we may assume that $(b_1, \ldots , b_ n) : \mathcal{O}_ S^{h_1} \to \bigoplus _{i = 1, \ldots , n} \mathcal{O}_ S^{h_{i, 1}}$ is injective. However, since $\mathcal{L}_ i = \mathcal{O}_{X_ i}$ we see that $d_ i = 0$ for $i = 1, \ldots n$. It follows that $d = 0$ because $(b_1, \ldots , b_ n) \circ d = (\oplus d_ i) \circ (a_1, \ldots , a_ n)$. In this way we see that the trivializing section of $\mathcal{L}_ s$ lifts to a section of $\mathcal{L}$ over $X$. A straightforward topological argument (omitted) shows that this means that $\mathcal{L}$ is trivial after possibly shrinking $S$ a bit further. $\square$

Lemma 37.32.7. Let $f : X \to S$ and $g : Y \to S$ be morphisms of schemes satisfying the hypotheses of Lemma 37.32.1. Let $\sigma : S \to X$ and $\tau : S \to Y$ be sections of $f$ and $g$. Let $s \in S$. Let $\mathcal{L}$ be an invertible sheaf on $X \times _ S Y$. If $(1 \times \tau )^*\mathcal{L}$ on $X$, $(\sigma \times 1)^*\mathcal{L}$ on $Y$, and $\mathcal{L}|_{(X \times _ S Y)_ s}$ are trivial, then there is an open neighbourhood $U$ of $s$ such that $\mathcal{L}$ is trivial over $(X \times _ S Y)_ U$.

Proof. By Künneth (Varieties, Lemma 33.29.1) the map

$H^1(X_ s \times _{\mathop{\mathrm{Spec}}(\kappa (s))} Y_ s, \mathcal{O}) \to H^1(X_ s, \mathcal{O}) \oplus H^1(Y_ s, \mathcal{O})$

is injective. Thus we may apply Lemma 37.32.6 to the two morphisms

$1 \times \tau : X \to X \times _ S Y \quad \text{and}\quad \sigma \times 1 : Y \to X \times _ S Y$

to conclude. $\square$

Theorem 37.32.8 (Theorem of the cube). Let $S$ be a scheme. Let $X$, $Y$, and $Z$ be schemes over $S$. Let $x : S \to X$ and $y : S \to Y$ be sections of the structure morphisms. Let $\mathcal{L}$ be an invertible module on $X \times _ S Y \times _ S Z$. If

1. $X \to S$ and $Y \to S$ are flat, proper morphisms of finite presentation with geometrically integral fibres,

2. the pullbacks of $\mathcal{L}$ by $x \times \text{id}_ Y \times \text{id}_ Z$ and $\text{id}_ X \times y \times \text{id}_ Z$ are trivial over $Y \times _ S Z$ and $X \times _ S Z$,

3. there is a point $z \in Z$ such that $\mathcal{L}$ restricted to $X \times _ S Y \times _ S z$ is trivial, and

4. $Z$ is connected,

then $\mathcal{L}$ is trivial.

An often used special case is the following. Let $k$ be a field. Let $X, Y, Z$ be varieties with $k$-rational points $x, y, z$. Let $\mathcal{L}$ be an invertible module on $X \times Y \times Z$. If

1. $\mathcal{L}$ is trivial over $x \times Y \times Z$, $X \times y \times Z$, and $X \times Y \times z$, and

2. $X$ and $Y$ are geometrically integral and proper over $k$,

then $\mathcal{L}$ is trivial.

Proof. Observe that the morphism $X \times _ S Y \to S$ is a flat, proper morphism of finite presentation whose geometrically integral fibres (see Varieties, Lemmas 33.9.2, 33.8.4, and 33.6.7 for the statement about the fibres). By Derived Categories of Schemes, Lemma 36.32.6 we see that the pushforward of the structure sheaf by $X \to S$, $Y \to S$, or $X \times _ S Y \to S$ is the structure sheaf of $S$ and the same remains true after any base change. Thus we may apply Lemma 37.32.1 to the morphism

$p : X \times _ S Y \times _ S Z \longrightarrow Z$

and the invertible module $\mathcal{L}$ to get a “universal” locally closed subscheme $Z' \subset Z$ such that $\mathcal{L}|_{X \times _ S Y \times _ S Z'}$ is the pullback of an invertible module $\mathcal{N}$ on $Z'$. The existence of $z$ shows that $Z'$ is nonempty. By Lemma 37.32.4 we see that $Z' \subset Z$ is a closed subscheme. Let $z' \in Z'$ be a point. Observe that we may write $p$ as the product morphism

$(X \times _ S Z) \times _ Z (Y \times _ S Z) \longrightarrow Z$

Hence we may apply Lemma 37.32.7 to the morphism $p$, the point $z'$, and the sections $\sigma : Z \to X \times _ S Z$ and $\tau : Z \to Y \times _ S Z$ given by $x$ and $y$. We conclude that $Z'$ is open. Hence $Z' = Z$ and $\mathcal{L} = p^*\mathcal{N}$ for some invertible module $\mathcal{N}$ on $Z$. Pulling back via $x \times y \times \text{id}_ Z : Z \to X \times _ S Y \times _ S Z$ we obtain on the one hand $\mathcal{N}$ and on the other hand we obtain the trivial invertible module by assumption (2). Thus $\mathcal{N} = \mathcal{O}_ Z$ and the proof is complete. $\square$

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