Are two continuous maps from a closed n-disk having the same image and agreeing on the boundary necessarily homotopic rel boundary

general-topology

Let $X$ be a topological space, let $D^n$ be the usual closed $n$-disk with boundary $\partial D^n$. Let $f,g : D^n\rightarrow X$ be continuous maps.

Suppose $f|_{\partial D^n} = g|_{\partial D^n}$, and also $f(D^n) = g(D^n)$.

My question is: in this case, are $f,g$ necessarily homotopic rel boundary (i.e. homotopic via a homotopy constant on $\partial D^n$)?

My intuition suggests the answer would be yes, but I'm not sure how to go about showing this or how to find a counter-example.

If furthermore either of $f,g$ is a topological embedding (e.g. if injective and $X$ Hausdorff) then I think we can show it in this case, since the image will be contractible. (Proof: since $f,g$ agree on the boundary of $D^n$ we can "glue" them together to get a map $h : S^n \rightarrow X$, which has image in the contractible $image(f) = image(g)$ and therefore is null-homotopic, therefore extends to a map $H : D^{n+1} \rightarrow X$, giving the desired homotopy rel boundary from $f$ to $g$, which are restrictions of $H$ to opposite hemispheres of $S^n = \partial D^{n+1}$.)

However, I'm not sure about the general case.


Edit: see the below comments and answers. (My "intuition" was completely wrong!)

Best Answer

To expand on the answer given in the comment above:

As a counter-example, view $D^1 = [-1,1]$ as the unit interval, and define the maps $f : D^1 \rightarrow S^1 : t \mapsto e^{i\pi t}$ and $g : D^1 \rightarrow S^1 : s \mapsto e^{3i \pi s}$; then $f,g$ agree on the endpoints, and are both surjective (so have the same image), but we can show these are not homotopic rel endpoints.

(Similar counter-examples arise in higher dimensions by "wrapping" $D^n$ around $S^n$.)