Does path-connected imply simple path-connected?

Let $X$ be a path-connected topological space, i.e., for any two points $a,b\in X$ there is a continuous map $\gamma\colon[0,1]\to X$ such that $\gamma(0)=a$ and $\gamma(1)=b$. Note that beyond continuity little is required about $\gamma$.

Is it always possible to make $\gamma$ a simple (=injective) curve? (Of course we consider only the case $a\ne b$).
If the answer depends on $X$, what are some mild sufficient conditions on $X$?

If $X$ is sufficiently nice, e.g., an open subset of $\Bbb R^n$, the answer is “yes”; more generally, what one would call “locally simplepath-connected” suffices (the set of points reachable from $a\in X$ by a simple curve is both open and closed).
Also, for arbitrary $X$ it is clear that a single instance of self-crossing can be short-cut. But for infinitely many possible short-cuts the situation may become somewhat hairy, I’m afraid.

EDIT: To avoid Mike Miller‘s counterexample (indiscrete topology on $X$ with $|X|<|\Bbb R|$), let’s at least assume that $X$ is Hausdorff. At any rate, $|X|\ge|\Bbb R|$ is a necessary condition – I am still looking for “as mild as possible” sufficient conditions …

Solutions Collecting From Web of "Does path-connected imply simple path-connected?"

Following the hint given by mathcounterexamples.net, let me post a community-wiki translation (and rewording and elaboration) of a comment by JLT on a webblog by Pierre Bernard:

Theorem. Every path-connected Hausdorff space is simplepath-connected.

Before proving this theorem, we need some lemmas.

Lemma 1. Let $Y$ be a perfect (=no isolated points) compact metric space. Then there exists a diffuse probability measure on $Y$.

Proof.
It is known that such $Y$ contains a subspace homeomorphic to the Cantor set $C$. Moreover, the Lebesgue measure on $[0,1]$, transported to $C$ via the map $\sum a_k2^{-k}\mapsto \sum a_k3^{-k}$ (where $0.a_1a_2\ldots$ is the binary representation of $x\in[0,1)$) is a diffuse probability measure on $C$ and thus provides us with a diffuse probability measure on $Y$. $_\square$

Lemma 2. Let $Y$ be a perfect compact subset of a metric space.
Then there exists a diffuse probability measure on $Y$ with support $Y$.

Proof.
For each $n$, $Y$ can be covered by a finite number $N(n)$ of open balls $B(x_{n,i},\frac1n)$, $1\le i\le N(n)$, of radius $\frac1n$. Let $Y_{n,i}=Y\cap\overline{B(x_{n,i},\frac1n)}$. The $Y_{n,i}$ are perfect compact metric spaces, hence by lemma 1 there exists a diffuse probability measure $\mu_{n,i}$ on $Y_{n,i}$. Then
$$\mu(A):=\sum_{n=1}^\infty\sum_{i=1}^{N(n)}\frac1{2^nN(n)}\mu_{n,i}(A\cap Y_{n,i}) $$
is a diffuse probability measure on $Y$. Its support intersects each $Y_{n,i}$ hence contains all of $Y$. On the other hand, the support is contained in the union of all $Y_{n,i}$, which is contained in $Y$. $_\square$

Recall that any open set $U\subseteq(0,1)$ can be written as disjoint union of countably many open intervals, $U=\bigsqcup_{i\in N}(a_i,b_i)$ with $N\subseteq\Bbb N$.

Definition. Let $f\colon [0,1]\to X$ be a curve. Let $U=\bigsqcup_{i\in N}(a_i,b_i)\subset [0,1]$ an open set. We say that $U$ is $f$-shortcutable if $f(a_i)=f(b_i)$ for all $i\in N$.

Lemma 3. Let $f\colon [0,1]\to X$ be a curve with $X$ Hausdorff. Let ${(a_i,b_i)}_{i\in I}$ be a chain (with respect to $\subseteq$) of $f$-shortcutable intervals. Then $\bigcup_{i\in I}U_i$ is $f$-shortcutable.

Proof.
We have $\bigcup_{i\in I}U_i=(a,b)$ with $a=\inf a_i$, $b=\sup b_i$.
Assume $f(a)\ne f(b)$ and let $V_a, V_b\subset X$ be open neighbourhoods separating $f(a)$ and $f(b)$. Then for some $\let\epsilon\varepsilon\epsilon>0$, $[a,a+\epsilon)\subseteq f^{-1}(V_a)$ and $(b-\epsilon,b]\subseteq f^{-1}(V_b)$.
Find $i,j\in I$ with $a_i\in [a,a+\epsilon)$, $b_j\in(b-\epsilon,b]$. Per chain property, $a_j\le a_i$ or $b_i\ge b_j$. In the first case $f(a_j)=f(b_j)\in V_a\cap V_b$, in the second case $f(b_i)=f(a_i)\in V_a\cap V_b$, contradiction. Hence $f(a)=f(b)$ and $(a,b)$ is $f$-shortcutable. $_\square$

Lemma 4.
Let $f\colon [0,1]\to X$ be a curve with $X$ Hausdorff.
Let $\{U_i\}_{i\in I}$ be a chain (with respect to $\subseteq$) of $f$-shortcutable open subsets of $(0,1)$. Then $\bigcup_{i\in I}U_i$ is $f$-shortcutable.

Proof. The connected components of the union are open intervals.
Consider one such component $(a,b)$ and a point $c\in(a,b)$. For $i\in I$ let $V_i$ be the component of $U_i$ containing $c$, or $V_i=\emptyset$ if $c\notin U_i$. Then the $V_i$ are a chain of $f$-shortcutable intervals.
By lemma 3, their union is an $f$-shortcutable interval $(a’,b’)\subseteq (a,b)$. If $a’> a$, then $a_i\in U_i$ for some $i$ and by openness $[a’,a’+\epsilon)\subseteq U_i$ for this $i$. As $a’+\frac\epsilon2\in V_j$ for some $j$, we conclude that $[a’,a’+\epsilon)\cup V_j\subseteq U_k$ for some $k\in\{i,j\}$, which implies $a’\in(a’,b’)$, contradiction. We conclude $a’=a$. Similarly, $b’=b$. $_\square$

We are now finally ready to prove the theorem.

Proof of Theorem. Let $X$ be a Hausdorff space and $f\colon [0,1]\to X$ a path with $f(0)\ne f(1)$.
The set of $f$-shortcutable open subsets of $(0,1)$ is non-empty (contains $\emptyset$) and is inductively ordered according to lemma 4. By Zorn’s lemma, there exists a maximal $f$-shortcutable $U_M$. As above write it as disjoint union of open intervals $$U_M=\bigsqcup_{i\in N}(a_i,b_i)$$ and then define
$$ x\sim y\iff x=y\lor\exists i\in N\colon \{x,y\}\subset [a_i,b_i].$$
This is an equivalence relation, where transitivity follows from maximality of $U_M$: Assume $x\sim y$ and $y\sim z$, say $\{x,y\}\in[a_i,b_i]$ and $\{y,z\}\in[a_j,b_j]$. If $i\ne j$ then from $(a_i,b_i)\cap (a_j,b_j)=\emptyset$ we conclude $y\in\{a_i,b_i\}\cap\{a_j,b_j\}$ (and specifically $y\notin U_M$); but then $f(a_i)=f(b_i)=f(a_j)=f(b_j)$ so that $U_M\cup\{y\}=U_M\cup(\min\{a_i,a_j\},\max\{b_i,b_j\})$ is $f$-shortcutable, contradicting maximality. Hence $i=j$ and clearly $x\sim z$.

The equivalence classes of $\sim$ are closed: In fact the class of $x$ is either $\{x\}$ alone, or a single interval $[a_i,b_i]$ or possibly the union of two adjacent closed intervals $[a_i,x]\cup [x,b_j]$ (though this possibility actually does not occur per maximality of $U_M$).
Let $J=[0,1]/{\sim}$. Being a quotient of the compact Hausdorff space $[0,1]$ by an equivalence with closed equivalence classes, the space $J$ is also compact Hausdorff.
We can define a map $g\colon J\to X$ by letting $g([t]):=f(\inf [t])=f(\sup[t])$. This $g$ is injective and continuous. The theorem follows if we can show that $J\approx [0,1]$.
Let $Y_0=[0,1]\setminus U_M$. Then $Y_0$ is compact and has no isolated points except possibly $0$ and/or $1$. Let $Y$ be $Y_0$ minus its (at most two) isolated points (in other words, $Y=\overline{(0,1)\setminus U_M}$).
By lemma 2 there exists a diffuse probability measure $\mu$ on $[0,1]$ with support $Y$.
Consider $h\colon[0,1]\to [0,1]$, $x\mapsto \mu([0,x])$. This is a map with $h(0)=0$ and $h(1)=1$; it is continuous because $\mu$ is diffuse. Moreover, for $x<y$
$$\begin{align}h(x)=h(y)&\iff \mu(\left]x,y\right[)=0 \\
&\iff\left]x,y\right[\cap\operatorname{supp}(\mu)=\emptyset\\
&\iff \left]x,y\right[\cap Y=\emptyset\\
&\iff \left]x,y\right[\cap Y_0=\emptyset\\
&\iff \left]x,y\right[\subseteq U_M\\
&\iff x\sim y \end{align}$$
Consequently, $h$ factors over $J$, thus showing $J\approx [0,1]$. $_\square$


Remark: The part where the homeomorphism $J\approx [0,1]$ is shown allows an alternative proof not involving the measure-theoretic lemmas 1 and 2 (which are not required for the proof of the theorem anywhere else):
We can define an order on $J$ by letting $[x]<[y]\iff x<y$, which is well-defined because the equivalence classes are in fact non-overlapping closed intervals. The topology of the quotient space $J$ is the order topology induced by this order because that is the case for $[0,1]$.
Also, $J$ is separable because $[0,1]$ is.
$J$ is complete: If $A\subset J$ is non-empty and bounded from above by $[x]\in J$, then it has a least upper bound; indeed, the preimage of $A$ in $[0,1]$ has a least upper bound $y\le x$ and then $[y]$ is a least upper bound for $A$. The same goes for lower bounds. The order is also dense as for $[x]<[y]$ we find $[x]<[z]<[y]$ with $z=\frac{\sup [x]+\inf[y]}2$, again because the equivalence classes are closed intervals.
In particular, $J$ does not consist only of the endpoints $[0]$ and $[1]$ so that $J\setminus\{[0],[1]\}$ is a nonempty, separable, complete, dense, endless total order and hence isomorphic to $\Bbb R$. Add back the two endpoints and we arrive at $[0,1]$ as desired.


Remark:
Invoking Zorn’s lemma means invoking the Axiom of Choice.
As many prefer to avoid that axiom (if they have the choice), we can try to find a maximal shortcutable set more constructively:

We still assume $X$ Hausdorff.
Let $U$ be $f$-shortcutable and assume $U$ is not maximal.
Each $f$-shortcutable proper superset of $U$ has a component $(a,b)$ that is not a component of $U$. In other words,
the set
$$ A=\{\,(a,b):0\le a<b\le 1, f(a)=f(b), \{a,b\}\subsetneq [0,1]\setminus U\,\}$$
is non-empty. Let $n\in\Bbb N$ be minimal with
$$ A_n=\{\,(a,b)\in A:b-a\ge\tfrac 1n\,\}\ne\emptyset$$
and then let $\alpha =\inf\{\,a:(a,b)\in A_n\,\}$.

Claim. There exists $b$ with $(\alpha,b)\in A_n$.

Proof. Otherwise we find a strictly decreasing sequence $(a_k)$ with $a_k\to a$ together with a sequence $(b_k)$ such that $(a_k,b_k)\in A_n$. Then $(b_k)$ has an accumulation point $b\in [a+\frac1n,1]$.
Assume $f(a)\ne f(b)$ and as $X$ is Hausdorff let $V_a,V_b\subset X$ be open neighbourhoods separating $f(a)$ and $f(b)$. Then $f^{-1}(V_b)$ contains infinitely many $b_k$ and $f^{-1}(V_a)$ contains almost all $a_k$, hence for some $k$ we have $a_k\in f^{-1}(V_a)$, $b_k\in f^{-1}(V_b)$ and so $f(a_k)=f(b_k)\in V_a\cap V_b$, contradiction.
We conclude that
$f(b)=f(a)$. Clearly, $b-a\ge\frac 1n$. We have $a\notin U$, $b\notin U$ because all $a_k,b_k$ are $\notin U$. Finally, there are infinitely many $a_k\notin U$ between $a$ and $b$, and the claim follows. $_\square$

So we let $\beta=\sup\{\,b:(\alpha,b)\in A_n\,\}$. By continuity, $f(\beta)=f(\alpha)$ and ultimately we define $S(U)=U\cup (\alpha,\beta)\supsetneq U$. (For the sake of completeness, define $S(U)=U$ if $U$ is maximal).
For each ordinal $\nu$, we define an $f$-shortcutable set $U_\nu$ such that $\nu'<\nu$ implies $U_{\nu’}\subseteq U_\nu$. We do this by the recursion $U_\nu=S(\bigcup_{\nu'<\nu}U_{\nu’})$. (Regarding the union, see lemma 4).
There must exist an ordinal $\nu$ with $U_\nu=U_{\nu+1}$, and this is a maximal $f$-shortcutable set as desired.