Homotopy Question Help? Let $X$ be a topological space and suppose $X_1$ and $X_2$ are spaces obtained by attaching an n-cell to $X$ via homotopic attaching maps. Show that $X_1$ and $X_2$ are homotopy equivalent.
Proof:
So, my idea is to use the fact that if two spaces are homeomorphic to deformation retracts of a single larger space then they are homotopy equivalent to one another. So, I would need to either show that both $X_1$ and $X_2$ are deformation retracts of some space, or homeomorphic to some deformation retracts of this larger space.
Since n-cells are homeomorphic to the balls $\mathbb{B}^n$, ( with $\mathbb{B}^n$ we are denoting the closed n-ball here) the idea would be to consider the larger adjunction space $X\bigcup_{\phi}\mathbb{B}^n\times I$, where the attaching map $\phi:\mathbb{B}^n\times \{0\}\rightarrow X$ would be given by $\phi(x,0)=f(x)$, where $f:\mathbb{B}^n\rightarrow X$ would be some continuous map. 
On the other hand we know that $X_1$ is the space obtained from $X$ by attaching an $n$-cell, so it is homeomorphic to an adjunction space, more specifically: $X\bigcup_{f_1}\mathbb{B}^n$, where $f_1:\partial\mathbb{B}^n\rightarrow X,$ is the corresponding attaching map. Similarly, $X_2$ is homeomorphic to the adjunction space $X\bigcup_{f_2}\mathbb{B}^n$, where $f_2:\partial\mathbb{B}^n\rightarrow X,$ is the corresponding attaching map.
So, I guess, now to conclude the proof, it would suffice to show that $X\bigcup_{f_1}\mathbb{B}^n$ and $X\bigcup_{f_2}\mathbb{B}^n$ are deformation retracts of $Z_f:=X\bigcup_{\phi}\left(\mathbb{B}^n\times I\right).$
So, we need to define a homotopy: $H:Z_f\times I\rightarrow Z_f.$ Before we do that, let $q:X\amalg\left(\mathbb{B}^n\times I\right)\rightarrow Z_f,$ be the quotient map between the given disjoint union of those spaces and $Z_f.$
Now, let us define the homotopy as follows: $$H(q(b,s),t)=q(b,s(1-t)),\hspace{3mm} H(q(x),t)=q(x),$$ where $(b,s)\in \mathbb{B}^n\times I$, and $x\in X.$
Now, $H(q(b,s),0)=q(b,s)$ and $H(q(x),0)=q(x),$ also $H(q(b,s),1)=q(b,0)\in\mathbb{B}^n\times\{0\}$ and $H(q(x),1)=q(x)\in X.$ So, i believe this shows that they are deformation retractions, but i think i am missing something  here??
Am I on the right track, and how should i proceed?
Thanks
 A: This should be a comment, but it got too long.
Let $B$ be the ball you want to attach and $S=\partial B$. In your situation, you have a map $\phi:S\times I\to X$ giving an homotopy from $\phi_0$ to $\phi_1$, and you want to compare $X_0=X\cup_{\phi_0}B$ and $X_1=X\cup_{\phi_1}B$.
If we define $\bar\phi:(x,t)\in S\times I\mapsto (\phi(x,t), t)\in X\times I$, we can consider the adjunction space $(X\times I)\cup_{\bar\phi}(B\times I)$, which contains copies of both $X_0$ and $X_1$ on each «end». Can you us this space to construct homopies?
A: I copy the answer from a tex written by me:
Let $(X, A)$ be a relative CW complex and let $f, g : A \to Y$ be maps homotopic equivalent, where $Y$ is a topological space. Then:
$$ X \cup_f Y \approx X \cup_g Y \qquad rel Y $$
where by ``$rel Y$'' we mean that the homotopy is constantly the identity on $A$.
proof Let $F : A \times I \to Y$ be a homotopy from $f$ to $g$. Let us consider the space $Z := (X \times I) \cup_F Y$. $Z$ contains $X \cup_f Y$ and $X \cup_g Y$ as subspaces. The strong deformation retraction of $X \times I$ onto $X \times \{0\} \cup A \times I$ gives rise to a retraction from $(X \times I) \cup_F Y$ to $(X \times \{0\} \cup A \times I) \cup_F Y = (X \times \{0\}) \cup_F Y \sim X \cup_f Y$. The same is true between $(X \times I) \cup_F Y$ and $X \cup_g Y$. Those homotopies are constantly the identity on $Y$.
Corollary Consider a relative CW complex $(X, A)$, where $X$ is obtained from $A$ by attaching $n$--cells. Then the homotopy class of $X rel A$ depends only on the homotopy classes of the attaching maps of $(X, A)$.
proof If the attaching maps $f_{\alpha}, g_{\alpha} : S_{\alpha}^{n-1} \to X_{0}$ are homotopic equivalent, then the maps which they induce: $f, g : \bigsqcup_{\alpha} S_{\alpha}^{n-1} \to X_{0}$ are homotopic equivalent too. Hence, using the notations of the preceding theorem, we put $X_{1} := \bigsqcup_{\alpha} D_{\alpha}^{n}$, $A := \bigsqcup_{\alpha} S_{\alpha}^{n-1}$.
NOTE: by a relative CW complex $(X, A)$ I (and Spanier) mean simply a topological space $X$ obtained by attaching cells to $A$ in increasing dimension
This should be an exercise in spanier algebraic topology, but I can't find it anymore..
