Smooth functions on a nonopen set I am reading the Loring Tu, Introduction to manifolds where you can find this excersise:

Using a partition of unity, show that a function $f:S\rightarrow \mathbb{R}^m$ is $C^{\infty}$ on $S\subset \mathbb{R}^n$ if and only if there exist an open set $U$ in $\mathbb{R}^n$ containing $S$ and a $C^\infty$ function $F:U\rightarrow \mathbb{R}^m$ such that $f=F|_S$

I was trying to prove the $\Rightarrow$ part of this using the $C^\infty$ extension of a function (Proposition 13.2) and taking a bump function with support in U and that is identically 1 in S. My question is: why shouldn't I take this approach and instead use a partition of unity?
 A: There seems to be missing some asumptions in here. I will then add my own assumptions and proove this result: I will work in the case $S\subset \mathbb{R}^n$ is a compact embedded submanifold of $\mathbb{R}^n$ without boundary.
Let $NS = \{ (x,v) \in S\times \mathbb{R}^n,~ v\in T_xS^{\perp}\}$ the normal bundle of $S$. Let $g : NS \to \mathbb{R}^n$ be the function $g(x,v) = x +v$. Its tangent bundle $T(NS)$ is canonically isomorphic to $TS \oplus TS^{\perp} = T\mathbb{R}^n$, and we can consider $\mathrm{d}_{x,0}g$ as the identity map of $\mathbb{R}^n$. Thus, $g$ is a local diffeomorphism at $(x,0)$ and thus is a local diffeomorphism on the zero section $S\times\{0\} \subset NS$. Because of the compactness of $S$, there exists a positive number $\varepsilon >0$ such that
\begin{align}
g : \{(x,v) \in NS ~|~ \|v\| < \varepsilon\} & \longrightarrow \mathbb{R}^n \\
(x,v)&\longmapsto x+v
\end{align}
is an embedding.
We denote by $U$ the image of $g$ of this embedding. This is a tubular neighbourhood of $S$ which can be parametrized by $S\times B\left(0,\varepsilon \right)$ where $B(0,\varepsilon)$ is the ball of radius $\varepsilon$ in $\mathbb{R}^{n-\dim S}$. If $p\in U$, we write $g^{-1}(p) = (x_p,v_p)$, and $ p \mapsto x_p$ and $p \mapsto v_p$ are smooth functions.
Let $\varphi : \mathbb{R} \to [0,1]$ be a smooth function such that:

*

*$\varphi(0)=1$

*$|t| \geqslant \varepsilon^2 \Rightarrow \varphi(t) = 0$
Let $f : S \to \mathbb{R}^m$ be a smooth function. Then
\begin{align}
F : \mathbb{R}^n &\longrightarrow \mathbb{R}^m \\
 p & \longmapsto \left\{\begin{array}{lcl}
0 & \text{if} & p\notin U \\
\varphi\left(\|v_p\|^2\right)f\left(x_p\right) & \text{if} & p \in U
\end{array}\right.
\end{align}
is a smooth function such that $F|_S=f$.
In fact, the key is that if $S$ is a submanifold of $\mathbb{R}^n$, then there exists a tubular neighbourhood of $S$ in $\mathbb{R}^n$, and there exists a smooth function with compact support in this tubular neighbourhood which is constant (and equal to $1$) on $S$.
You can try to adapt this result (using partition of unity) in the case $S$ is an embedded non compact submanifold without boundary.
