[proofplan]
We convert the local boundedness data into an [open cover](/page/Open%20Cover) of $K$: each point has an open neighbourhood on which $f$ is bounded. Compactness reduces this open cover to finitely many such neighbourhoods. The maximum of the finitely many local bounds is then a single global bound for $f$ on all of $K$. We handle the empty space separately, since then boundedness is immediate.
[/proofplan]
custom_env
admin
[step:Handle the empty compact space]
If $K=\varnothing$, then the inequality
\begin{align*}
|f(y)|\le 0
\end{align*}
holds for every $y\in K$ vacuously. Hence $f$ is bounded on $K$ with bound $M=0$.
For the rest of the proof, assume $K\ne\varnothing$.
[/step]
custom_env
admin
[step:Build an open cover from the local boundedness hypothesis]For each $x\in K$, local boundedness provides an [open set](/page/Open%20Set) $U_x\in\tau$ with $x\in U_x$ and a constant $M_x\ge 0$ such that
\begin{align*}
|f(y)|\le M_x
\end{align*}
for every $y\in U_x$.
The family
\begin{align*}
\mathcal U:=\{U_x:x\in K\}
\end{align*}
is an open cover of $K$: each $U_x$ is open in $(K,\tau)$, and every point $x\in K$ belongs to its corresponding set $U_x$.[/step]
custom_env
admin
[guided]We begin by spelling out exactly what local boundedness gives. For each point $x\in K$, there is an open set $U_x\in\tau$ containing $x$ and a real constant $M_x\ge 0$ such that
\begin{align*}
|f(y)|\le M_x
\end{align*}
for every $y\in U_x$.
The point of introducing the notation $U_x$ is that these neighbourhoods are precisely the objects compactness can act on. Define
\begin{align*}
\mathcal U:=\{U_x:x\in K\}.
\end{align*}
Every member of $\mathcal U$ is open in the topology $\tau$ by construction. Also, if $z\in K$, then $z\in U_z$, so $z$ lies in at least one member of $\mathcal U$. Therefore
\begin{align*}
K\subset \bigcup_{x\in K}U_x.
\end{align*}
The reverse inclusion is automatic because every $U_x$ is a subset of the ambient space $K$. Hence $\mathcal U$ is an open cover of $K$.[/guided]
custom_env
admin
[step:Extract finitely many locally bounded neighbourhoods by compactness]
Since $(K,\tau)$ is compact and $\mathcal U$ is an open cover of $K$, there exist points $x_1,\dots,x_n\in K$, with $n\in\mathbb N$, such that
\begin{align*}
K=\bigcup_{i=1}^{n}U_{x_i}.
\end{align*}
For each $i\in\{1,\dots,n\}$, the associated constant $M_{x_i}\ge 0$ satisfies
\begin{align*}
|f(y)|\le M_{x_i}
\end{align*}
for every $y\in U_{x_i}$.
[/step]
custom_env
admin
[step:Take the maximum of the finitely many local bounds]
Define the finite global candidate bound $M\in[0,\infty)$ by
\begin{align*}
M:=\max\{M_{x_i}:1\le i\le n\}.
\end{align*}
This maximum exists because the set $\{M_{x_i}:1\le i\le n\}$ is a nonempty finite subset of $\mathbb R$. By definition of maximum,
\begin{align*}
M_{x_i}\le M
\end{align*}
for every $i\in\{1,\dots,n\}$.
[/step]
custom_env
admin
[step:Use the finite cover to prove the global bound]
Let $y\in K$ be arbitrary. Since
\begin{align*}
K=\bigcup_{i=1}^{n}U_{x_i},
\end{align*}
there exists $i\in\{1,\dots,n\}$ such that $y\in U_{x_i}$. The local bound on $U_{x_i}$ gives
\begin{align*}
|f(y)|\le M_{x_i}.
\end{align*}
Since $M_{x_i}\le M$, we obtain
\begin{align*}
|f(y)|\le M.
\end{align*}
Because $y\in K$ was arbitrary, this inequality holds for every $y\in K$. Therefore $f$ is bounded on $K$.
[/step]