TITLE: Homotopy composition Hatcher exercise
QUESTION [9 upvotes]: Show that composition of paths satisfies the following cancellation property: if $f_0 \cdot g_0 \simeq f_1 \cdot g_1 $ and $g_0 \simeq g_1$, then $f_0 \simeq f_1$. 
So I have two homotopies. 
So say $g_0,g_1: X \rightarrow Y$ and $f_0,f_1:Y \rightarrow Z$.
Then we know that $G:X \times I \rightarrow Z$ s.t. $G(x,0)=f_0 \cdot g_0(x)$ and $G(x,1)=f_1 \cdot g_1 (x)$. Also, $H:X \times I \rightarrow Y$ s.t. $H(x,0)=g_0(x)$ and $H(x,1)=g_1(x)$. 
I was wondering how do you construct the homotopy for f? or is there a simplier way. 
I would think you construct a homotopy, but can't see how to.

REPLY [3 votes]: Composition of two paths $f\cdot g$ implies that these maps are defined on same domain (which is unit interval $I=[0, 1]$) and range, in other words: $f, g:I\rightarrow X$. As I understood, in your question you defined $f$ and $g$ on different domain and range which is incorrect.
There are few ways to solve the original problem, I will show two:

In the Hatcher's book author defined inverse path $\overline{f}$ and proved that $f\cdot\overline{f}$ is homotopic to a constant path. Using that we can solve the problem:
$$f_0 \simeq f_0\cdot\underset{\text{constant path}}{\left(g_0\cdot\overline{g_0}\right)} \simeq \left(f_0\cdot g_0\right)\cdot\overline{g_0} \simeq \left(f_1\cdot g_1\right)\cdot\overline{g_0} \simeq f_1\cdot (g_1\cdot\overline{g_0}) \simeq f_1\cdot (g_0\cdot\overline{g_0}) \simeq f_1.$$
Another approach is to define homotopy between $f_0$ and $f_1$ directly. The fact that $g_0\simeq g_1$ implies $g_0(0) = g_1(0)\Rightarrow f_0(1) = f_1(1)$. It is clear that $f_0(0) = f_1(0)$. If $F:I\times I\rightarrow X$ is assosiated map of homotopy between $f_0\cdot g_0$ and $f_1\cdot g_1$ then the function
$$G(s, t) = F\left(\frac s 2, t\right)$$
is assosiated map of homotopy between $f_0$ and $f_1$. Basically we ignore the second part of homotopy between $f_0\cdot g_0$ and $f_1\cdot g_1$ which is responsible for the homotopy between $g_0$ and $g_1$.