TITLE: is this exact sequence a special case of the Snake lemma?
QUESTION [7 upvotes]: I encountered the following exact sequence a while ago, and wondered if it was a special case of the Snake lemma. It looks like it would be, but I don't quite see how...
The context is that $A,B$ are operators on a Hilbert space $H$ (but it holds in greater generality): 
$$\DeclareMathOperator{\Im}{Im}
0 \rightarrow \ker(B) \rightarrow \ker(AB) \xrightarrow{B} \ker(A) \rightarrow H/\Im(B) \xrightarrow{A} H/\Im(AB) \rightarrow H/\Im(A) \rightarrow 0$$

REPLY [4 votes]: In general, let $\alpha: L \rightarrow M$ and $\beta: M \rightarrow N$ be morphisms in an abelian category. Then
$\begin{matrix}
&L
&\stackrel{\alpha}{\longrightarrow}
&M
&\stackrel{}{\longrightarrow}
&\operatorname{coker} \alpha
&\to0\\
&\downarrow\rlap{\beta \alpha}
&
&\downarrow\rlap{\beta}
&
&\downarrow\rlap{}
\\
0\to&N
&\stackrel{\text{id}}{\longrightarrow}
&N
&\stackrel{}{\longrightarrow}
&0
\end{matrix}$
yields an exact sequence
$$\ker \beta \alpha \rightarrow \ker \beta \rightarrow \operatorname{coker} \alpha \rightarrow \operatorname{coker} \beta\alpha \rightarrow \operatorname{coker} \beta \rightarrow 0$$
and
$\begin{matrix}
&0
&\stackrel{}{\longrightarrow}
&L
&\stackrel{\text{id}}{\longrightarrow}
&L
&\to0\\
&\downarrow\rlap{}
&
&\downarrow\rlap{\alpha}
&
&\downarrow\rlap{\beta \alpha}
\\
0\to& \ker \beta
&\stackrel{}{\longrightarrow}
&M
&\stackrel{\beta}{\longrightarrow}
&N
\end{matrix}$
yields an exact sequence
$$0 \rightarrow \ker \alpha \rightarrow \ker \beta \alpha \rightarrow \ker \beta \rightarrow \operatorname{coker} \alpha \rightarrow \operatorname{coker} \beta\alpha \, .$$
It is not hard to check that the two sequences can be combined to give
$$0 \rightarrow \ker \alpha \rightarrow \ker \beta \alpha \rightarrow \ker \beta \rightarrow \operatorname{coker} \alpha \rightarrow \operatorname{coker} \beta\alpha \rightarrow \operatorname{coker} \beta \rightarrow 0 \, .$$