Let $f\colon X \rightarrow Z$ and $g\colon Y \rightarrow Z$ be two morphisms in a stable infinity category $\mathcal{C}$. How does one show that the $\infty$-categorical fiber product $X \times\_Z Y$ can be canonically identified with the fiber of the map $f - g \colon X \oplus Y \rightarrow Z$? 


I am sure that the question is quite basic (for instance, something quite similar is used implicitly in the proof of Proposition 1.1.3.4 of Lurie's "Higher algebra"), but I would nevertheless appreciate an explanation. The type of answer I am *not* looking for is "this is trivial consequence of the definitions" because I believe that there is something to check: $X \times\_Z Y$ makes sense in any $\infty$-category that has fiber products, whereas the other description uses the stability assumption.


While we are at it, let me ask a related bonus question: with $f$ and $g$ as above, suppose that we also have maps $a\colon F \rightarrow X$ and $b\colon F \rightarrow Y$ that make the evident diagram commute and such that $\mathrm{fib}(a) \simeq \mathrm{fib}(g)$ via the induced map (a five lemma type of setting where one of the vertical maps is an isomorphism). Do these conditions imply that the map $F \rightarrow X \times\_Z Y$ is an isomorphism?



Describing fiber products in stable $\infty$-categories
In fact what you need is that your ∞-category is *additive* (i.e. that it has direct sums and that the canonical commutative monoid structure on the mapping spaces is group-like). All stable categories are additive, so I'll just prove it in this case.


**Step 1**: The pullback $X\times\_Z Y$ is equivalent to the pullback $(X\times Y)\times\_{Z\times Z}Z$. This fact is true in every ∞-category with finite limits


I'm sure there are many ways of proving this. One way of doing it (thanks to Omar Antolín-Camarena for the idea) is to consider the diagram


$$\require{AMScd}
\begin{CD}
Y @>>> Z @<<< Z\\
@VVV @VVV @VVV\\
\ast @>>> \ast @<<< Z\\
@AAA @AAA @AAA\\
X @>>> Z @<<< Z 
\end{CD}\,,$$


where $\ast$ is the terminal object. Taking the limit first in the horizontal direction and the in the vertical direction we obtain $X\times\_Z Y$, while taking the limits in the opposite order we obtain $(X\times Y)\times\_{Z\times Z}Z$. Since both methods compute the limit of the whole diagram, the two objects must be equivalent.


**Step 2**: The diagonal $Z\to Z\oplus Z$ is the fiber of the "difference" map $Z\oplus Z\xrightarrow{(1\_Z,-1\_Z)} Z$


This is where we use the additivity hypothesis. Recall that one way of phrasing that the ∞-category is additive is that the shear map
$$Z\oplus Z\xrightarrow{\left(\substack{1\, 1\\ 0\, 1}\right)} Z\oplus Z$$
is an equivalence. Then there is an equivalence of sequences
$$\require{AMScd}
\begin{CD}
Z @>{\left(\substack{0\\1}\right)}>> Z\oplus Z @>{(1\,0)}>> Z\\
@| @V{\left(\substack{1\,1\\0\,1}\right)}VV @|\\
Z @>{\left(\substack{1\\1}\right)}>> Z\oplus Z @>{(1\,-1)}>> Z
\end{CD}$$
Since the top one is a fiber sequence, so is the bottom one.


**Step 3** Profit!


Let us consider the following diagram
$$\require{AMScd}
\begin{CD}
X\times\_Z Y @>>> Z @>>> 0\\
@VVV @V{\left(\substack{1\\1}\right)}VV @VVV\\
X\oplus Y @>{(f\,g)}>> Z\oplus Z @>{(1\,-1)}>> Z
\end{CD}$$
Since the left and right squares are cartesian (by step 1 and 2), so is the big one, which was the thesis.




---


*Bonus question:* In every $\infty$-category with finite limits, if you have a square of pointed objects
$$\require{AMScd}
\begin{CD}
F @>{a}>> X\\
@V{b}VV @V{f}VV\\
Y @>{g}>> Z
\end{CD}
$$
there is a canonical equivalence between the fiber of the map $F\to X\times\_Z Y$ and the fiber of the induced map $\mathrm{fib}(a)→\mathrm{fib}(g)$. This can be proven as before, by considering the diagram
$$\require{AMScd}
\begin{CD}
\ast @>>> X @<<{a}< F\\
@VVV @V{f}VV @V{b}VV\\
\ast @>>> Z @<<{g}< Y\\
@AAA @A{g}AA @AA{1\_Y}A\\
\ast @>>> Y @<{1\_Y}<< Y
\end{CD}\,,$$
and taking the limit in the two directions (you can find more details in the first section of [this paper](https://arxiv.org/abs/1410.7271)). Incidentally this object is called the *total fiber* of the square.


Since in a stable ∞-category a map is an equivalence iff the fiber is trivial, this gives an affermative answer to your query.


