Definition (homotopy)

Let $f, g: X \to Y$ be maps.

A homotopy from $f$ to $g$ is a map $H: X \times [0,1] \to Y$ such that $$ \begin{align*} H(x, 0) ={}& f(x), \\ H(x,1) ={}& g(x). \end{align*} $$

Say $f$ is homotopic to $g$ if such a map exists, written as $f\simeq g$ or $f \simeq_H g$ if we wish to specify the homotopy $H$.

For a subset $A\subseteq X$, say a homotopy $H$ is relative to $A$ if $$ \begin{align*} f(a) = H(a,t) = g(a) \qquad \text{for all $a\in A, t\in [0,1]$}. \end{align*} $$ We write $f\simeq g \rel A$.

"Homotopic relative to $A$" is an equivalence relation on the set of maps $X\to Y$. (Proof)

Homotopic maps are preserved by composition: if $f_0, f_1: X\to Y$ are homotopic and $g_0, g_1: Y\to Z$ are homotopic, then so are $g_0\circ f_0, g_1\circ f_1: X\to Z$. (Proof)