Let $M$ be a $C^r$ sub-manifold of $\mathbb{R}^n$ and let $f:M \to \mathbb{R}$ be a $C^r$ function.
Prove there exists an open neighborhood $U$ of $M$ in $\mathbb{R}^n$ and a $C^r$ function $g:U \to \mathbb{R}$ such that $g|M = f$.
Does any one know how to prove this?
Also, why is it that we can take $U = \mathbb{R}^n$ when $M$ is a closed subset of $\mathbb{R}^n$? Why can't we take $U = \mathbb{R}^n$ in general?
I'm new to the study of manifolds. Hoping to bone up before attempting a real analysis course.
Here is my attempt at a reasonably understandable solution/proof. I'd be surprised if it was correct but can someone at least tell me if I have the intuition right?
For a $C^r$ manifold $M \subset \mathbb{R}^n$, $f: M \to \mathbb{R}$ is $C^r$ (smooth) if it is smooth at all $x \in M$.
$\Rightarrow$ The derivatives $D^rf(x)$ exist for all $r \in \mathbb{N}$ (this is the definition of a $C^r$ function).
$\Rightarrow$ There is an open neighborhood, $U$, around each $x \in M$.
$\Rightarrow$ And since $f$ is $C^r$, $f$ is smooth for some open $x \in U$
$\Rightarrow$ The existence of $D^rf(x)$ is determined by the restriction of $f$ to any open neighborhood of $x$.
$\Rightarrow$ Their exists a $C^r$ function, $g: U \to \mathbb{R}$, such that $g|U = f$
$\Rightarrow$ When $M$ is open, it suffices to take $M=U$.
For $r \geq 2$, let $\nu$ be a tubular neighborhood of $M$, with $g$ a $C^r$ bundle metric on $\nu$ so that the unit disk bundle with respect to the metric is in contained in $\nu$. Now just define $h: \nu \to \Bbb R$ as $h(x,v)=\phi(g(v,v))f(x)$ where $\phi:\Bbb R^{\geq 0} \to \Bbb R$ is a smooth cutoff function with $\phi(0)=1$ and $\phi(t)=0$ for $t\geq 1$. Extend $h$ to $\Bbb R^n$ by letting it be zero outside of $\nu$.