I'm trying to proof the following problem from Lee's Book:
Suppose $M$ is a smooth manifold and $S\subseteq M$ is a smooth submanifold.
Show that $S$ is embedded if and only if every $f\in C^\infty(S)$ has a smooth extension to a neighborhood of $S$ in M.
I've shown that $S$ embedded $\Longrightarrow$ Every $f\in C^\infty(S)$ has a smooth extension to a neighborhood of $S$ in M.
But the converse it's being hard to see. The book gives us a hint, but I have no ideia how this can be helpful. The hint is:
If $S$ is not embedded, let $p\in S$ be a point that is not in the domain of any slice chart. Let $U$ be a neighborhood of $p$ in $S$ that is embedded, and consider a function $f\in C^\infty(S)$ that is supported in $U$ and equal to $1$ at $p$.
Maybe a contradiction argument be necessary, but I can't realise this.
How can I prove this? Any kind of help will be useful.
In the situation described, we have an injective immersion $h:T\to M$ from a smooth manifold $T$, with $S=h(T)$. Suppose $h$ is not en embedding, which means it is not open when $S\subset M$ is equiped with the subspace topology. Hence there exists some point $q\in T$ with a neighborhood $V$ in $T$ such that $h(V)$ is not a neighborhood of $p=h(q)$ in $S$ as subspace of $M$. Now pick a smooth function $g:T\to\mathbb R$ supported in $V$ with $g(q)=1$. The $f$ in the hint should be $f=g\circ h^{-1}$, which is surely smooth in $S$ as immersed manifold. Let $F:M\to\mathbb R$ be a smooth extension of $f$. Then $F$ is continuous, and the set $\{F>0\}$ is open in $M$. Thus $W=\{F>0\}\cap S$ is an open set of $S$ as subspace of $M$ and
1) $p\in W$, because $F(p)=g\circ h^{-1}(p)=g(q)=1$, and
2) $W\subset h(V)$, because if $x\notin h(V)$ then $y=h^{-1}(x)\notin V$ and $0=g(y)=f(x)=F(x)$.
We conclude that $h(V)$ is a ndhd of $p$ in the subspace topology of $S$ against the initial assumption.