TITLE: Proof that convex open sets in $\mathbb{R}^n$ are homeomorphic?
QUESTION [20 upvotes]: This is an exercise from Kelley's book. Could someone help to show me a proof? 
It seems very natural, and it is easy to prove by utilizing the arctan function in $\mathbb{R}^1$. 
Thanks a lot.

REPLY [3 votes]: Here is a fairly complete proof for the existence of a
diffeomorphism in the star-shaped case. This was gleaned
from old, incomplete answers (not on math stackexchange)
to this question.  Getting a diffeomorphism is only
slightly harder than getting a homeomorphism.
The idea is to push points outwards radially relative
to the star point so that the boundary reaches infinity
and all problems with non-smoothness of the original
boundary disappear.
First, if the region is unbounded, map it diffeomorphically
to a bounded region by pushing points in radially relative
to the star point using a nice dilation function. Almost
any $C^\infty$ diffeomorhism from $[0,\infty)$ to $[0,1)$
will do.  Make it equal to the identity map near $0$ to
avoid complications with differentiability at the star point.
After this, we may assume that the region is bounded.
One idea that doesn't quite work in any obvious way is to
use $r(x)$ = radius in direction $x$ (where $x$ is in the
unit circle) to push radially outwards using a suitable
modification of $r$, since $r$ may be discontinuous.
To avoid discontinuities, start instead with $d(x)$ = distance
from $x$ to the complement of the region, where $x$ is now in
the region.  It is an easy exercise that $d$ is continuous.
$d$ doesn't have the mapping properties that we need.  Adjust it
by averaging the inverse of it along rays from the star point:
    $$e(x) = \int_0^1 1/d(s + t*(x-s))dt,$$
where s is the star point.  The final mapping (if we only want
a homeomorphism) is:
    $$m(x) = e(x)*(x-s).$$
The main points to show for $m$ being a homeomorphism are:
$m$ is one to one because $\|m\|$ is strictly increasing on each ray
(because $1/d > 0$); the image of $m$ is the whole of $\mathbb R^n$
because $e(x)$ approaches $\infty$ as $x$ approaches the boundary
along each ray ($1/d$ certainly does, and a simple estimate shows
that integration preserves this); the inverse is continuous because
the map is proper (the dilation factor is bounded from below).
Minor modifications turn $m$ into a $C^\infty$ diffeomorphism.  The
above gives a continuous $d$ which is strictly positive and approaches
$0$ sufficiently rapidly at the boundary.  An easy partition of unity
argument gives a strictly positive $C^\infty$ $d$ that is smaller than
the continuous $d$ so it has the same boundary property. $e$ and $m$
are then obviously also $C^\infty$. The inverse of $m$ is $C^\infty$
for much the same reason that $m$ is one to one: the partial
derivative of $\|m\|$ along each ray is invertible because it is
$1/d > 0$.  The full derivative at $s$ is $Dm(s) = e(s)1_n$, where $1_n$
is the identity map on (the tangent space of) $\mathbb R^n$.  The full
derivative at points other than $s$ is best calculated in polar
coordinates $(r,\theta$) where $r = \|x-s\|$ and $\theta$ is in the
unit sphere:
$$m(r,\theta) = (r*e(r,\theta), \theta);$$
$$Dm(r,\theta) = \left( \begin {array} {ccc}
    1/d(r,\theta) & 0 \\ * & 1_{n-1} \end {array} \right).$$
These are obviously invertible everywhere, so the inverse of $m$ is
$C^\infty$.
By the Riemann mapping theorem, the diffeomorphism can be chosen to be
analytic in dimension $2$.  I don't know if this is true in any dimension.
There is no obvious way to adapt the above to give an analytic $m$ even
in dimension $2$.
The integration trick is from an answer by Robin Chapman in mathforum
in 2005. I couldn't find any better answer on the internet.  But this
answer says to use any smooth strictly positive function that vanishes
on the complement for $d$.  This has the following flaw: $1/d$ might not
approach $\infty$ at the boundary rapidly enough for its radial integrals
to also approach $\infty$.  For example, let the region be the unit disk
and $d(x) = (1-\|x\|^2)^\frac 1 2$.
This question is an exercise in many books.  I first saw it in Spivak's
Differential Geometry Volume 1 (exercise 25 p.322).  But later, Spivak
gives a proof for a much easier case (Lemma 11.17 p.592 is for when $r$ is
$C^\infty$; Lemma 11.18 p.593 shows that $r$ is always lower-semicontinuous
(Spivak says upper-smicontinuous, but this is backwards);
the preamble to Lemma 11.19 p.593 says that proving the general case is
"quite a feat", so Lemma 11.19 only proves an isomorphism of (De Rham)
cohomology). But the integration trick seems to make the feat small.
It is exercise 8 p.20 in Hirsch's Differential Topology.  This exercise
is starred, but has no hints.
Other answers give further references to textbooks.  Most books don't
prove it.  Some say that it is hard and others give it as an exercise.
It is exercise 7 p.86 in Brocker and Janich's Introduction to
Differential Topology.  This exercise gives a hint about using the
flow of a radial vector field.  It becomes clear that the integration
trick is a specialized version of this general method.