Lemma 7.5.3.D127F8356D96 Let $(X,d)$ be a metric space, let $F\subset X$ be compact, and let $f\colon F\to \mathbb R$ be continuous with $|f|\le a$. Then $f$ has a continuous extension $g\colon X\to \mathbb R$ with $|g|\le a$.
Lemma 7.5.3D127F8356D96
Proof. If $F=\varnothing $ or $a=0$, take $g=0$. Otherwise, for $L>0$ put
The infimum is finite, since $f\ge -a$, and as an infimum of functions that are Lipschitz with constant $L$ it is Lipschitz with constant $L$; hence $f_ L$ is continuous and $|f_ L|\le a$. We claim that $f_ L\to f$ uniformly on $F$ as $L\to \infty $. Taking $y=x$ shows $f_ L\le f$ on $F$. Given $\eta >0$, uniform continuity of $f$ on the compact set $F$ gives $r>0$ with $|f(y)-f(x)|<\eta $ for $x,y\in F$ with $d(x,y)<r$. Let $Lr>2a$ and $x\in F$. Points $y\in F$ with $d(x,y)\ge r$ give $f(y)+L\, d(x,y)\ge -a+Lr>a\ge f(x)$, and the other points give $f(y)+L\, d(x,y)>f(x)-\eta $. Hence the infimum is at least $f(x)-\eta $, and so is $f_ L(x)$, because $a\ge f(x)>f(x)-\eta $ and $-a\le f(x)$. This proves the claim. Consequently there is a continuous $g_1$ on $X$ with $|g_1|\le a$ and $|f-g_1|\le a/2$ on $F$. Applying the same construction to $f-g_1$ on $F$, we find a continuous $g_2$ with $|g_2|\le a/2$ and $|f-g_1-g_2|\le a/4$ on $F$, and inductively continuous $g_ k$ with $|g_ k|\le 2^{1-k}a$ and $|f-g_1-\cdots -g_ k|\le 2^{-k}a$ on $F$. The series $\sum _ kg_ k$ converges uniformly on $X$; its sum is continuous and equals $f$ on $F$, and clamping it to $[-a,a]$, that is, replacing it by $\max \{ -a,\min \{ a,\sum _ kg_ k\} \} $, does not change its values on $F$. $\square$
Comments
Corrections, questions, and mathematical discussion are welcome. Sign in with GitHub to comment. Comments are public.