Let $\mathcal{A}$ be an abelian category. I was told in class that if we have the morphisms
$\alpha: P \longrightarrow A$
$\beta: P \longrightarrow B$
$f: B \longrightarrow S$
$g: A \longrightarrow S$
Then we have $g \circ \alpha = f \circ \beta$ (i.e. we have a commutative square, but I don't know how to draw this) if and only if the composition $P \longrightarrow A \oplus B \longrightarrow S$ is zero.
Let's note $i_A: A \longrightarrow A \oplus B$ and $i_B: B \longrightarrow A \oplus B$ the canonical injections (or whatever are their names in a general abelian category) and $\pi_A: A \oplus B \longrightarrow A$ and $\pi_B: A \oplus B \longrightarrow B$ the canonical projections.
We hence have a unique morphish $\theta: P \longrightarrow A \oplus B$ such that $\alpha = \pi_A \circ \theta$ and $\beta = \pi_B \circ \theta$, and we have a unique morphism $\psi: A \oplus B \longrightarrow S$ such that $g = \psi \circ i_A$ and $f = \psi \circ i_B$. So I assume that when we say that the composition $P \longrightarrow A \oplus B \longrightarrow S$ is zero, it means that $\psi \circ \theta = 0$.
We have proven in class that in an abelian category, $i_A \circ \pi_A + i_B \circ \pi_B = 1_{A \oplus B}$ (it is easy to see in a category of modules). So, we have the following equivalent equations:
$\psi \circ \theta = 0$
$\psi \circ (i_A \circ \pi_A + i_B \circ \pi_B) \circ \theta = 0$
$\psi \circ (i_A \circ \pi_A) \circ \theta + \psi \circ (i_B \circ \pi_B) \circ \theta = 0$
$(\psi \circ i_A) \circ (\pi_A \circ \theta) + (\psi \circ i_B) \circ (\pi_B \circ \theta) = 0$
$g \circ \alpha + f \circ \beta = 0$
$g \circ \alpha = - f \circ \beta$
Why do I have a minus? What is wrong with my argument?
Thanks in advance!
You are quite correct; the statement you are trying to prove does indeed have a sign error.
If you start with an commuting square, one of the four functions needs to have a sign flip when you form that three-term sequence. This sign flip is rolled into a standard construction (the "total complex" construction) and can be easy to gloss over if you aren't doing explicit calculations; your source could have easily simply forgot to state this.
Alternatively, the intent may have been that you were given an anti-commuting square: that is, $g \circ \alpha + f \circ \beta = 0$.