# If $\alpha\cdot \tilde{\alpha}\sim\beta\cdot \tilde{\beta}$ with $\tilde{\alpha}\sim\tilde{\beta}$, then $\alpha\sim\beta$? ($\sim=$homotopic)

Let $X$ be a topological space and $\alpha, \beta, \tilde{\alpha}, \tilde{\beta}:[0,1]\to X$ be paths on $X$ such that $\alpha(0)=\beta(0)$, $\alpha(1)=\tilde{\alpha}(0)=\tilde{\beta}(0)=\beta(1)$, and $\tilde{\alpha}(1)=\tilde{\beta}(1)$. Suppose that $\tilde{\alpha}$ and $\tilde{\beta}$ are homotopic and $\alpha\cdot \tilde{\alpha}$ and $\beta\cdot \tilde{\beta}$ are homotopic. Here I am considering that homotopy at which the endpoints of the paths remain fixed and the concatenation of the paths being given by $$\begin{array}{llll}\gamma\cdot \lambda:&[0,1]&\to&X\\ & t&\mapsto&\left\{\begin{array}{ll}\gamma(2t),&\text{ if }\,\, 0\leq t\leq \frac{1}{2},\\\lambda(2t-1),&\text{ if}\,\, \frac{1}{2}\leq t\leq 1.\end{array}\right.\end{array}$$

My question is: is this suffices to guarantee that $\alpha$ and $\beta$ are homotopic? (again with endpoints fixed)

In other words, I know that there is a homotopy $H:[0,1]\times[0,1]\to X$, $H(0,t)=\alpha\cdot \tilde{\alpha}(t)$, $H(1,t)=\beta\cdot \tilde{\beta}(t)$, $H(s,0)=p$, $H(s,1)=q$ and there is a homotopy $K:[0,1]\times [0,1]\to X$, $K(0,t)=\tilde{\alpha}(t)$, $K(1,t)=\tilde{\beta}(t)$, $K(s,0)=q$, $K(s,1)=r$. How to explicit, through these two homotopies (if possible) a homotopy $L:[0,1]\times [0,1]\to X$, with $L(0,t)=\alpha(t)$, $L(1,t)=\beta(t)$, $L(s,0)=p$ and $L(s,1)=q$??

Note that $$(\alpha\cdot\tilde{\alpha})\cdot\tilde{\alpha}^{-1}\sim(\beta\cdot\tilde{\beta})\cdot\tilde{\alpha}^{-1}\sim (\beta\cdot\tilde{\beta})\cdot\tilde{\beta}^{-1},$$ where $^{-1}$ means "reverse the path" (the first homotopy comes from $\alpha\cdot\tilde{\alpha}\sim\beta\cdot\tilde{\beta}$ and the second comes from $\tilde{\alpha}\sim\tilde{\beta}$ by just reversing the homotopy as well). Now concatenation is associative up to homotopy, the concatenation of a path with its inverse is homotopic to a constant path, and any path is homotopic to its concatenation with a constant path. Thus we get $$(\alpha\cdot\tilde{\alpha})\cdot\tilde{\alpha}^{-1}\sim \alpha\cdot(\tilde{\alpha}\cdot\tilde{\alpha}^{-1})\sim \alpha\cdot c\sim \alpha$$ where $c$ is the constant path at $\alpha(1)$. Similarly, $$(\beta\cdot\tilde{\beta})\cdot\tilde{\beta}^{-1}\sim\beta.$$ Putting this all together, we get $$\alpha\sim\beta.$$