# The sheaf of smooth functions is soft

A sheaf $\mathcal{F}$ over some topological space $X$ is called soft if any section over any closed subset can be extended to a global section (i.e. over $X$). How to understand that the sheaf of smooth functions over $\mathbb{R}^n$ is soft?
So, we have an arbitrary closed subset $S\subset \mathbb{R}^n$, $U$ - an open subset containing $S$ and a smooth function $f: U\rightarrow \mathbb{R}$. We are to build a smooth function $\bar{f}: \mathbb{R}^n \rightarrow \mathbb{R}$ such that $\bar{f}|_V=f|_V$ for some open $V$ (such that $S\subset V\subset U$).
The only useful fact I know is that every closed subset of $\mathbb{R}^n$ is $f^{-1}(0)$ for some smooth function $f:\mathbb{R}^n\rightarrow \mathbb{R}$. It seems that we need only a trick and nothing serious...

-

For each $s\in S$ pick $0<r_s<1$ such that $B(s,r_s)\subseteq U$. Then the $B(s,\frac12r_s)$ are an open cover for $S$. For $m\in\mathbb N$ the set $S\cap \overline{B(0,m+1)}\setminus B(0,m-1)$ is compact, which allows us to pick a subcover $B\{(s_i,\frac12r_{s_i})\}_{i=1}^\infty$ such that both this subcover and also $B\{(s_i,r_{s_i})\}_{i=1}^\infty$ are locally finite. With the usual $e^{-1/t}$ construction build a smooth function $\phi\colon \mathbb R\to[0,1]$ with $\phi(t)=0$ for $t\le \frac14$ and $\phi(t)=1$ for $t\ge \frac12$. Now let $$\tag1\Phi(x)=1-\prod_{i=1}^\infty \phi\left(\frac{\langle x-s_i,x-s_i\rangle}{r_{s_i}^2}\right).$$ For each $x\in\mathbb R^n$, there is an open neighbourhood where almost all factors in $(1)$ are constant $1$, hence on each such neighbourhood the product is in fact finite and $\Phi$ is smooth. By construction $\Phi$ is one in the open neighbourhood $$V=\bigcup_{i\in\mathbb N}B(s_i,\frac12r_{s_i})$$ of $S$ and the support of $\Phi$ is $$\operatorname{supp}\Phi=\overline{\bigcup_{i\in\mathbb N}B(s_i,\frac1{\sqrt 2}r_{s_i})}\subsetneq\bigcup_{i\in\mathbb N}B(s_i,r_{s_i})$$ (where inequality follows from local finiteness) and hence a proper subset of $U$. Now define $\overline f\colon \mathbb R^n\to \mathbb R$ by $$\overline{f}(x)=\begin{cases}\Phi(x)f(x)&\text{if }x\in U\\0&\text{otherwise.}\end{cases}$$ Clearly $\overline f|_V=f|_V$ and as $\overline f$ is smooth both in $U$ and in the complement of $\operatorname{supp}\Phi$ and these two sets cover $\mathbb R^n$, we have found the desired global section.
Looks nice, thank you! So, could you explain why $g$ is smooth? – user74574 Oct 27 '13 at 11:20
@Nikita You are right, I had to rewrite completely - one needs a function that is one in a neighbourhood of $S$ and zero in a neighbourhood of $X-U$. – Hagen von Eitzen Oct 27 '13 at 15:48
Isn't $C^\infty$ fine? Then one can just use fine$\implies$soft, no? – Exterior Aug 3 '15 at 9:51