[proofplan]
We exploit uniform continuity of $f$ on a compact neighbourhood of $K$ to control the oscillation $|f(x-y) - f(x)|$ uniformly over $x \in K$. Given $\sigma > 0$, we choose $\delta > 0$ from uniform continuity, and for $\varepsilon < \delta$ the mollifier support $B(0,\varepsilon)$ is small enough that $|f(x-y) - f(x)| < \sigma$ for all $x \in K$ and $y \in B(0,\varepsilon)$. The unit-mass property of $\eta_\varepsilon$ then yields $\sup_{x \in K} |f_\varepsilon(x) - f(x)| < \sigma$.
[/proofplan]
[step:Construct a compact neighbourhood $V$ of $K$ inside $U$]
Since $K$ is a compact subset of the [open set](/page/Open%20Set) $U$, the distance $\operatorname{dist}(K, \partial U) > 0$ is strictly positive. Define
\begin{align*}
\delta_0 := \tfrac{1}{2}\operatorname{dist}(K, \partial U) > 0
\end{align*}
(if $U = \mathbb{R}^n$, set $\delta_0 := 1$). Let $V := \{z \in \mathbb{R}^n : \operatorname{dist}(z, K) \leq \delta_0\}$. Then $V$ is closed and bounded in $\mathbb{R}^n$, hence compact, and $V \subset U$. For any $\varepsilon < \delta_0$, the inclusion $K \subset U_\varepsilon$ holds, so $f_\varepsilon(x)$ is well-defined for all $x \in K$.
[/step]
[step:Extract uniform continuity of $f$ on $V$]
Since $f$ is [continuous](/page/Continuity) on $U$ and $V \subset U$ is [compact](/page/Compact%20Space), the restriction $f|_V$ is [uniformly continuous](/page/Uniform%20Continuity). Let $\sigma > 0$ be given. By uniform continuity, there exists $\delta \in (0, \delta_0)$ such that for all $z_1, z_2 \in V$:
\begin{align*}
|z_1 - z_2| < \delta \implies |f(z_1) - f(z_2)| < \sigma.
\end{align*}
[/step]
[step:Bound $|f_\varepsilon(x) - f(x)|$ uniformly over $K$ using the unit-mass property]
Let $0 < \varepsilon < \delta$. Fix an arbitrary $x \in K$. Using the unit-mass property $\int_{B(0,\varepsilon)} \eta_\varepsilon(y) \, d\mathcal{L}^n(y) = 1$ and the definition of $f_\varepsilon$:
\begin{align*}
f_\varepsilon(x) - f(x) &= \int_{B(0,\varepsilon)} \eta_\varepsilon(y) f(x - y) \, d\mathcal{L}^n(y) - f(x) \int_{B(0,\varepsilon)} \eta_\varepsilon(y) \, d\mathcal{L}^n(y) \\
&= \int_{B(0,\varepsilon)} \eta_\varepsilon(y) \bigl[f(x - y) - f(x)\bigr] \, d\mathcal{L}^n(y).
\end{align*}
Taking the absolute value and using $\eta_\varepsilon \geq 0$:
\begin{align*}
|f_\varepsilon(x) - f(x)| \leq \int_{B(0,\varepsilon)} \eta_\varepsilon(y) \, |f(x - y) - f(x)| \, d\mathcal{L}^n(y).
\end{align*}
We verify the hypotheses for the uniform continuity bound. For $y \in B(0,\varepsilon)$: (i) $x \in K \subset V$; (ii) $\operatorname{dist}(x - y, K) \leq |y| < \varepsilon < \delta_0$, so $x - y \in V$; (iii) $|(x - y) - x| = |y| < \varepsilon < \delta$. Therefore $|f(x - y) - f(x)| < \sigma$, and substituting:
\begin{align*}
|f_\varepsilon(x) - f(x)| < \sigma \int_{B(0,\varepsilon)} \eta_\varepsilon(y) \, d\mathcal{L}^n(y) = \sigma.
\end{align*}
Since $x \in K$ was arbitrary, $\sup_{x \in K} |f_\varepsilon(x) - f(x)| < \sigma$.
[guided]
The strategy is to show that for $\varepsilon$ small enough, every point $x - y$ appearing in the convolution integral lies in $V$ and is close to $x$, so the uniform continuity estimate applies uniformly in $x$.
Why do we need the intermediate set $V$? Because the convolution $f_\varepsilon(x) = \int \eta_\varepsilon(y) f(x - y) \, d\mathcal{L}^n(y)$ evaluates $f$ at points $x - y$ with $|y| < \varepsilon$. These points lie within distance $\varepsilon$ of $K$, but $K$ itself might touch $\partial U$ arbitrarily. The set $V$ is chosen so that all such evaluation points remain inside $U$ and inside a single compact set on which uniform continuity holds.
Using $\int_{B(0,\varepsilon)} \eta_\varepsilon(y) \, d\mathcal{L}^n(y) = 1$ to represent $f(x) = f(x) \cdot 1$:
\begin{align*}
f_\varepsilon(x) - f(x) = \int_{B(0,\varepsilon)} \eta_\varepsilon(y) \bigl[f(x - y) - f(x)\bigr] \, d\mathcal{L}^n(y).
\end{align*}
Taking absolute values (using $\eta_\varepsilon \geq 0$):
\begin{align*}
|f_\varepsilon(x) - f(x)| \leq \int_{B(0,\varepsilon)} \eta_\varepsilon(y) \, |f(x - y) - f(x)| \, d\mathcal{L}^n(y).
\end{align*}
Now we check the three conditions to apply uniform continuity. For $y \in B(0,\varepsilon)$ with $\varepsilon < \delta < \delta_0$:
- $x \in K \subset V$, so $x \in V$.
- $\operatorname{dist}(x - y, K) \leq |y| < \varepsilon < \delta_0$, so $x - y \in V$ by definition of $V$.
- $|(x - y) - x| = |y| < \varepsilon < \delta$.
All three conditions hold, so $|f(x - y) - f(x)| < \sigma$, and
\begin{align*}
|f_\varepsilon(x) - f(x)| < \sigma \int_{B(0,\varepsilon)} \eta_\varepsilon(y) \, d\mathcal{L}^n(y) = \sigma \cdot 1 = \sigma.
\end{align*}
The bound $\sigma$ does not depend on $x \in K$, so $\sup_{x \in K} |f_\varepsilon(x) - f(x)| < \sigma$. Since $\sigma > 0$ was arbitrary, $\|f_\varepsilon - f\|_{L^\infty(K)} \to 0$ as $\varepsilon \to 0$, which is precisely uniform convergence on $K$.
[/guided]
[/step]