Relative Homotopy is Equivalence Relation

Theorem
Let $X$ and $Y$ be topological spaces.

Let $K \subseteq X$ be a (possibly empty) subset of $X$.

Let $\mathcal C \left({X, Y}\right)$ be the set of all continuous mappings from $X$ to $Y$.

Define a relation $\sim$ on $\mathcal C \left({X, Y}\right)$ by $f \sim g$ if $f$ and $g$ are homotopic relative to $K$.

Then $\sim$ is an equivalence relation.

Proof
We examine each condition for equivalence.

Reflexivity
For any function $f: X \to Y$, define $H: X \times \left[{0 \,.\,.\, 1}\right] \to Y$ by $H \left({x, t}\right) := f \left({x}\right)$.

This yields a homotopy between $f$ and itself.

Also, trivially, if $x \in K$ and $t \in \left[{0 \,.\,.\, 1}\right]$, then:


 * $f \left({x}\right) = H \left({x, t}\right)$

so that $H$ is a homotopy relative to $K$.

Thus $\sim$ is a reflexive relation.

Symmetry
Given a $K$-relative homotopy:


 * $H: X \times \left[{0 \,.\,.\, 1}\right] \to Y$

from $f \left({x}\right) = H \left({x, 0}\right)$ to $g \left({x}\right) = H \left({x, 1}\right)$, the function:


 * $G \left({x, t}\right) = H \left({x, 1 - t}\right)$

is a $K$-relative homotopy from $g$ to $f$.

Thus $\sim$ is a symmetric relation.

Transitivity
Suppose that $f \sim g$ and $g \sim h$.

Let $F, G: X \times \left[{0 \,.\,.\, 1}\right] \to Y$ be $K$-relative homotopies between $f$ and $g$, $g$ and $h$, respectively.

Define $H: X \times \left[{0 \,.\,.\, 1}\right] \to Y$ by:


 * $H \left({x, t}\right) := \begin{cases}

F \left({x, 2t}\right) & \text{if } 0 \le t \le \dfrac 1 2\\ G \left({x, 2t - 1}\right) & \text{if } \dfrac 1 2 \le t \le 1 \end{cases}$

By Continuous Mapping on Finite Union of Closed Sets, $H$ is a $K$-relative homotopy between $f$ and $h$.

Thus $\sim$ is a transitive relation.

Having verified all three conditions, it follows that $\sim$ is an equivalence relation.