Can the real line be embedded in a space $X$ such that all the nonempty open subsets of $X$ are homeomorphic?

Proposition. Any topological space $X$ can be embedded in a topological space $Y$ with the property that every nonempty open subspace of $Y$ is homeomorphic to $Y.$ Moreover, if $X$ is a
$\text T_1$-space, it is possible to take $Y$ a $\text T_1$-space as well.

Proof. Let $\kappa$ be an infinite cardinal which is greater than or equal to the number of nonhomeomorphic open subspaces of $X,$ and let $\lambda=\kappa^+.$ (E.g., if $X=\mathbb R,$ take $\kappa=\aleph_0$ and $\lambda=\aleph_1.$)

Let $I$ be an index set with $|I|=\lambda.$ Choose disjoint topological spaces $U_i\ (i\in I)$ so that each $U_i$ is homeomorphic to some nonempty open subspace of $X$ and, for each nonempty open subspace $U$ of $X,$ $|\{i\in I:U_i\text{ is homeomorphic to }U\}|=\lambda.$

Let $Y=\bigcup_{i\in I}U_i$ have the following topology: A nonempty set $W\subseteq Y$ is open just in case $W\cap U_i$ is open in $U_i$ for all $i\in I,$ and $|\{i\in I:U_i\not\subseteq W\}|\le\kappa.$


A metrizable example can be constructed as follows. In the plane consider the subset $$\Xi:=\big\{(x,\tfrac{2k+1}{2^n}):k,n\in\mathbb Z,\;x\in\mathbb R\setminus \tfrac1{2^n}\mathbb Z\big\}.$$

It is clear that $\Xi$ contain (countably many) topological copies of the real line.

There are at least two ways of proving that any non-empty open subset of $\Xi$ is homeomorphic to $\Xi$. One is more geometric and is due to Volodymyr Mykhaylyuk (from Chernivtsi). He observed that for any open set $U\subset \Xi$ and any connected component $C$ of $U$ the interval $C$ has a base of clopen neighborhoods homeomorphic to the strip $\Xi\cap(\mathbb R\times(-\sqrt{2},\sqrt{2}))$ in $\Xi$. Then $U$ can be decomposed into countably many pairwise homeomorphic clopen sets and the same can be done with the space $\Xi$.

Another way is more global. Just to prove a characterization theorem for the space $\Xi$:

Theorem. A topological space $X$ is homeomorphic to the space $\Xi$ if and only if

1) $X$ is a metrizable space;

2) for any point $x\in X$ the connected component $C_x$ containing $x$ is homeomorphic to the real line;

3) the family $\mathcal C=\{C_x\}_{x\in X}$ of connected components of $X$ is countable;

4) for any point $x\in X$ and a neighborhood $O_x\subset X$ of $x$ there exists a non-empty set $V=\bigcup\{C\in \mathcal C:C\cap V\ne\emptyset\}$ in $O_x\setminus C_x$ such that $V$ is clopen in $X\setminus C_x$, $C_x\cup V$ is a neighborhood of $x$.

The proof of this characterization uses the back-and-forth argument: We enumerate the connected components and at the $n$-th step construct clopen neighborhoods of $n$-th intervals and establish the combinatorial correspondence between these neighborhoods. I will write down the details in a preprint (with many authors with whom I discussed this problem being on a Summer School in Carpathian mountains).

The characterization theorem implies the following corollary:

Corollary. Let $(C_n)_{n\in\omega}$ be a family of parwise disjoint curves in $\mathbb R^d$ such that each $C_n$ is homeomorphic to $\mathbb R$, is closed and nowhere dense in the union $X:=\bigcup_{n\in\omega}C_n$ and $\sum_{n=1}^\infty lenth(C_n)<\infty$. Then the space $X$ is homeomorphic to $\Xi$.


Another example of a $T_1$-space containing the real line and having all non-empty open sets homeomorphic can be constructed using some standard facts of Infinite-Dimensional Topology.

Namely it is known that each closed locally compact subset $Z$ of the Hilbert space $\ell_2$ is a $Z$-set in $\ell_2$, which implies that the complement $\ell_2\setminus Z$ is homeomorphic to $\ell_2$, being a contractible $\ell_2$-manifold.

Then the Hilbert space $\ell_2$ endowed with the topology $\tau$ consisting of all complements to closed locally compact sets has the required property: it contains a topological copy of the real line and has all non-empty open sets homeomorphic.