Bump function: $K\subset U$, $f\equiv 1$ on $K$, $supp(f)=cl(U)$ Let $V\subset\subset U\subset\subset\mathbb{R}^n$  be an open sets and $K=cl(V)$. How to prove that there is  a function $f:\mathbb{R}^n\to\mathbb{R}$ of class $\mathcal{C}^{\infty}(\mathbb{R}^n)$ such that $$0\le f(x)\le 1\;,\;\forall x\in \mathbb{R}^n$$ $$f(x)=1\;,\;\forall x\in K$$ $$supp(f)=cl(U)$$ $$0<f(x)<1\;,\;\forall x\in U-K$$
Any hint would be appreciated.
 A: Hint/set up: Let $\varphi \colon \mathbb{R}^n \to \mathbb{R}$ be the standard mollifier, which is defined by 
$$\varphi(x) =\begin{cases}0 & |x|\ge 1,\\ Ce^{-\frac{1}{1-|x|^2}} & |x|<1,\end{cases}$$ where $C$ is a constant such that $\|\varphi\|_{L^1(\mathbb{R}^n)} = 1$. Let $\{\varphi_{\epsilon}\}$ be the associated family of mollifiers defined by $\varphi_{\epsilon}(x) := \epsilon^{-n}\varphi(x/\epsilon)$. By construction, $\varphi_{\epsilon}$ satisfies the following properties:


*

*$\varphi_{\epsilon} \in C^{\infty}(\mathbb{R}^n)$

*$\varphi_{\epsilon} \ge 0$

*$ \text{supp}(\varphi_{\epsilon}) = \overline{B(0,\epsilon)}$

*$\int_{\mathbb{R}^n}\varphi_{\epsilon}(x)\, dx = 1$.


Now set $0 < d = \text{dist}(\partial V,U)$ and let $K_{d/2} : = \{x \in U : \text{dist}(x,K) < \frac d2\}$. Then, if $\chi$ is the characteristic function of $K_{d/2}$, $$f := \varphi_{d/2} * \chi$$ should do the trick. I won't take from you the pleasure of checking all the details!

In case you are not familiar with mollifiers or the smoothening property of the convolution I'd recommend reading the Wikipedia page on mollifiers. If you have access to it, Analysis by Lieb and Loss does a great job covering the material you seem to be interested in.
