[proofplan]
We apply the [Snake Lemma](/theorems/1930) to the short exact sequence of chain complexes $0 \to C_\bullet(A) \xrightarrow{i_\bullet} C_\bullet(X) \xrightarrow{q_\bullet} C_\bullet(X,A) \to 0$. The inclusion $i: A \hookrightarrow X$ induces an injective chain map; the quotient $C_\bullet(X,A) = C_\bullet(X)/C_\bullet(A)$ inherits a differential making $q_\bullet$ a chain map. The Snake Lemma constructs connecting homomorphisms $\partial: H_n(X,A) \to H_{n-1}(A)$ and guarantees exactness of the resulting long sequence at every position. The construction of $\partial$ is identical to that in the [Long Exact Sequence for Relative Homology](/theorems/2239).
[/proofplan]
[step:Establish the short exact sequence of chain complexes]
The inclusion $i: A \hookrightarrow X$ induces injective chain maps $i_n: C_n(A) \hookrightarrow C_n(X)$ for each $n$. The relative chain group $C_n(X, A) = C_n(X)/i_n(C_n(A))$ inherits a boundary operator $\bar{d}_n$ from $d_n^X$, since $d_n^X$ maps $i_n(C_n(A))$ into $i_{n-1}(C_{n-1}(A))$. The resulting sequence
\begin{align*}
0 \to C_n(A) \xrightarrow{i_n} C_n(X) \xrightarrow{q_n} C_n(X, A) \to 0
\end{align*}
is a short exact sequence of chain complexes: $i_\bullet$ and $q_\bullet$ are chain maps, $i_n$ is injective, $q_n$ is surjective, and $\ker(q_n) = \operatorname{im}(i_n)$ for each $n$.
[/step]
[step:Apply the Snake Lemma to produce the long exact sequence]
By the [Snake Lemma](/theorems/1930), the short exact sequence of chain complexes from the previous step yields a long exact sequence in homology. For each $n$, the Snake Lemma produces a connecting homomorphism
\begin{align*}
\partial: H_n(X, A) \to H_{n-1}(A)
\end{align*}
and guarantees that the sequence
\begin{align*}
\cdots \to H_n(A) \xrightarrow{i_*} H_n(X) \xrightarrow{q_*} H_n(X, A) \xrightarrow{\partial} H_{n-1}(A) \xrightarrow{i_*} H_{n-1}(X) \to \cdots
\end{align*}
is exact at every position.
[guided]
The connecting homomorphism $\partial$ is constructed by the following diagram chase. Given a class $[c] \in H_n(X, A)$, choose a representative $\bar{c} \in C_n(X, A)$ with $\bar{d}_n(\bar{c}) = 0$. Since $q_n$ is surjective, lift $\bar{c}$ to some $c \in C_n(X)$ with $q_n(c) = \bar{c}$. The condition $\bar{d}_n(\bar{c}) = 0$ means $q_{n-1}(d_n^X(c)) = 0$, so $d_n^X(c) \in \ker(q_{n-1}) = \operatorname{im}(i_{n-1})$.
Since $i_{n-1}$ is injective, there is a unique $a \in C_{n-1}(A)$ with $i_{n-1}(a) = d_n^X(c)$. The element $a$ is a cycle: $i_{n-2}(d_{n-1}^A(a)) = d_{n-1}^X(i_{n-1}(a)) = d_{n-1}^X(d_n^X(c)) = 0$, and injectivity of $i_{n-2}$ gives $d_{n-1}^A(a) = 0$. We define $\partial([\bar{c}]) = [a] \in H_{n-1}(A)$.
The Snake Lemma verifies that this definition is independent of the choice of lift $c$ (changing $c$ by an element of $\ker(q_n) = \operatorname{im}(i_n)$ changes $a$ by a boundary in $C_{n-1}(A)$) and independent of the representative $\bar{c}$ (changing $\bar{c}$ by a boundary $\bar{d}_{n+1}(\bar{e})$ changes $a$ by a boundary as well). The exactness of the long sequence at each of the three positions $H_n(A)$, $H_n(X)$, and $H_n(X,A)$ is established by the Snake Lemma.
[/guided]
[/step]
[step:Verify exactness at $H_n(A)$: $\ker(i_*) = \operatorname{im}(\partial)$]
We verify exactness at $H_n(A)$ directly as a check on the Snake Lemma output.
**$\operatorname{im}(\partial) \subseteq \ker(i_*)$:** Let $[a] = \partial([\bar{c}])$ for some $[\bar{c}] \in H_{n+1}(X, A)$. By construction, $a \in C_n(A)$ satisfies $i_n(a) = d_{n+1}^X(c)$ for some lift $c \in C_{n+1}(X)$. Therefore $i_n(a) = d_{n+1}^X(c) \in B_n(X)$, so $i_*([a]) = [i_n(a)] = 0$ in $H_n(X)$.
**$\ker(i_*) \subseteq \operatorname{im}(\partial)$:** Let $[a] \in H_n(A)$ with $i_*([a]) = 0$. Then $i_n(a) = d_{n+1}^X(c)$ for some $c \in C_{n+1}(X)$. Set $\bar{c} = q_{n+1}(c) \in C_{n+1}(X, A)$. Then $\bar{d}_{n+1}(\bar{c}) = q_n(d_{n+1}^X(c)) = q_n(i_n(a)) = 0$ since $i_n(a) \in \ker(q_n)$. So $\bar{c}$ is a relative cycle, and the connecting homomorphism gives $\partial([\bar{c}]) = [a]$.
[/step]
[step:Conclude with the full long exact sequence]
Combining the construction of $\partial$ with the exactness verification at all three positions, we obtain the long exact sequence of the pair $(X, A)$:
\begin{align*}
\cdots \to H_{n+1}(X, A) \xrightarrow{\partial} H_n(A) \xrightarrow{i_*} H_n(X) \xrightarrow{q_*} H_n(X, A) \xrightarrow{\partial} H_{n-1}(A) \to \cdots
\end{align*}
The sequence terminates at the right with $\cdots \to H_0(A) \xrightarrow{i_*} H_0(X) \xrightarrow{q_*} H_0(X, A) \to 0$. The maps $i_*$ and $q_*$ are the functorial maps induced by the inclusion and quotient chain maps, and $\partial$ is the connecting homomorphism constructed above.
[/step]