First take
\(A=\varnothing\text{.}\) We construct the approximation inductively over the skeleta, starting with
\(n=0\text{.}\) Since
\(Y_0\hookrightarrow Y\) is surjective on path components, for each point
\(x\in X_0\) we can choose a point
\(g_0(x)\in Y_0\) and a path from
\(f(x)\) to
\(g_0(x)\text{.}\) As
\(X_0\) is discrete, these choices define a continuous map
\(g_0\colon X_0\to Y_0\) and a homotopy
\(H_0\colon X_0\times I\to Y\) from
\(f|_{X_0}\) to
\(g_0\text{.}\) This starts the induction.
Now let
\(n\geq1\text{.}\) Suppose that a map
\(g_{n-1}\colon X_{n-1}\to Y_{n-1}\) has been constructed, together with a homotopy
\(H_{n-1}\) from
\(f|_{X_{n-1}}\) to
\(g_{n-1}\) viewed as a map into
\(Y\text{.}\) We check the hypotheses of HELP (
Theorem 8.6):
-
The pair
\((X_n,X_{n-1})\) is a relative CW complex whose relative cells are precisely the
\(n\)-cells of
\(X\text{,}\) so they have dimension
\(\leq n\text{.}\)
-
The map
\(e=\iota_n\colon Y_n\hookrightarrow Y\) is an
\(n\)-equivalence by
Corollary 9.3.
-
The given map is \(f|_{X_n}\colon X_n\to Y\text{.}\) The boundary lift is \(g_{n-1}\colon X_{n-1}\to Y_{n-1}\hookrightarrow Y_n\text{,}\) and the boundary homotopy is \(H_{n-1}\text{.}\) By induction their endpoints satisfy
\begin{equation*}
H_{n-1}(-,0)=f|_{X_{n-1}},\qquad
H_{n-1}(-,1)=\iota_n\circ g_{n-1}.
\end{equation*}
Thus all the hypotheses hold, and HELP gives the dashed maps in
Thus
\(g_n\) lands in
\(Y_n\text{,}\) extends
\(g_{n-1}\text{,}\) and
\(H_n\) extends
\(H_{n-1}\text{.}\) Taking unions gives a cellular map
\(f'\) and a homotopy
\(f\simeq f'\text{;}\) the weak topology gives continuity, also for the homotopy since
\(I\) is a finite CW complex.
For the relative version, at stage
\(n\) apply HELP to
\((X_n,X_{n-1}\cup(A\cap X_n))\text{.}\) Its relative cells are exactly the
\(n\)-cells of
\(X\) not in
\(A\text{,}\) so the same dimension bound holds. On
\(A\cap X_n\) prescribe
\(f\) and the constant homotopy; this map lands in
\(Y_n\) because
\(f|_A\) is cellular. The prescribed data agree on the intersection by induction. Thus every stage fixes
\(A\cap X_n\text{,}\) and the assembled homotopy fixes all of
\(A\text{.}\)