Self homeomorphism of the cube Let $I^n$ be the $n$-cube $[0,1]^n$. Also define two subsets of $\partial I^n$:

*

*$A=\{(x_1,\ldots,x_n)\mid x_1=0\}$

*$B=\partial I^n\setminus \{(x_1,\ldots,x_n)\mid x_1=1\}$
So $A$ is the "bottom face" and $B$ is every face but the "top face".
It's well-known in algebraic topology that there's a homeomorphism $F:I^n\rightarrow I^n$ with $F(A)=B$. Can this $F$ be defined by an explicit formula?
I've been able to make some progress in the $n=2$ case, involving exponential maps defined on closed subsets of the square, but I haven't been able to glue them together coherently yet. Wondering if there's some insight I'm missing to give a nice formula that generalizes to all $n$.
(I've been focused on $F^{-1}$ because it's easier for me to draw those pictures. I'd be happy with a formula for either direction.)
 A: Let's consider $A'=\{x_1=1\}$, the top face, in place of $A$
(we can then turn over the cube to swap $A$ and $A'$). So I'll define
an auto-homeomorphism $G:I^n\to I^n$ swapping $A'$ and $B$.
Let $P$ be the point $(2,1/2,\ldots,1/2)$. Then $P$
is outside $I^n$ and any ray from $P$ meeting the cube meets both $A'$ and $B$
in exactly one point. Suppose it meets $A'$ at $Q$ and $B$ at $R$. Then it meets
$I^n$ in the segment between $Q$ and $R$ (possibly $Q=R$).
Now define $G$ by reversing each segment $QR$. (Then in addition $G\circ G$
is the identity).
With some patience (which I lack) you can write down an explicit formula for $G$.
A: One way that is conceptually simple, and that could be turned into an explicit formula with enough effort, is:

*

*Define $g\colon I^n \to U$, where $U$ is the closed ball whose boundary sphere circumscribes $I^n$, by dilating along each radius of the ball so that the boundary of the cube ends up on the boundary sphere.

*Let $\mathcal S$ denote the collection of great semicircles running from the south pole of $\partial U$ to the north pole.

*$g(\partial A)$ intersects every semicircle in $\mathcal S$ exactly once, as does $g(\partial B)$, and never at the north or south poles.

*Find a homoemorphism $h$ from $U$ to itself that, when restricted to any semicircle in $\mathcal S$, pushes the points on that semicircle upwards so that the intersection with $g(\partial A)$ is mapped to its intersection with $g(\partial B)$.

*Then a map $F$ with the property you want is $g^{-1}\circ h \circ g$.

