[proofplan]
We first use the planar description of polynomial hulls: the hull of a compact planar set is obtained by filling in the bounded complementary components, so polynomial convexity is equivalent to connectedness of $\mathbb{C}\setminus K$. The analytic input is Vitushkin's localization theorem, stated in the precise form needed here: if $K\subset\mathbb{C}$ is compact and $f\in A(K)$, then $f$ can be uniformly approximated on $K$ by rational functions with poles in $\mathbb{C}\setminus K$. Once this independent rational approximation result supplies exterior-pole rational approximants, Runge's polynomial approximation theorem and polynomial convexity remove the poles, giving a polynomial within the prescribed tolerance.
[/proofplan]
[step:Identify polynomial convexity with connected complement in the plane]
Let $\widehat K$ denote the polynomial hull of $K$, defined by
\begin{align*}
\widehat K := \{z\in\mathbb C : |q(z)|\leq \sup_{w\in K}|q(w)| \text{ for every } q\in\mathbb C[z]\}.
\end{align*}
The hypothesis that $K$ is polynomially convex means $\widehat K=K$. By the planar polynomial convexity criterion, the polynomial hull of a compact set $K\subset\mathbb C$ is obtained from $K$ by adjoining all bounded connected components of $\mathbb C\setminus K$. Therefore $\widehat K=K$ holds if and only if $\mathbb C\setminus K$ has no bounded connected components, equivalently if and only if $\mathbb C\setminus K$ is connected. Hence the complement of $K$ is connected.
[/step]
[step:Approximate the algebra function by rational functions with exterior poles]
Because $f\in A(K)$, the function
\begin{align*}
f:K&\to\mathbb C
\end{align*}
is continuous on $K$ and holomorphic on the interior $K^\circ$. We invoke Vitushkin's localization theorem in its planar rational approximation form: for every compact set $E\subset\mathbb C$, every function $g:E\to\mathbb C$ that is continuous on $E$ and holomorphic on $E^\circ$, and every $\eta>0$, there exists a rational function $R$ whose poles lie in $\mathbb C\setminus E$ such that
\begin{align*}
\sup_{z\in E}|g(z)-R(z)|<\eta.
\end{align*}
This result is the independent analytic localization input; it is not the polynomial conclusion of Mergelyan's theorem, since it permits rational functions with exterior poles and imposes no connectedness condition on $\mathbb C\setminus E$.
Apply the theorem with $E:=K$, $g:=f$, and $\eta:=\varepsilon/2$. Its hypotheses are satisfied by the definition of $A(K)$, so there exists a rational function $r$ whose poles lie in $\mathbb C\setminus K$ and such that
\begin{align*}
\sup_{z\in K}|f(z)-r(z)|<\frac{\varepsilon}{2}.
\end{align*}
The supremum is finite because $f-r$ is continuous on the compact set $K$.
[guided]
We use exactly the hypotheses encoded in $f\in A(K)$. This notation means that $f:K\to\mathbb C$ is continuous on the compact set $K$ and holomorphic on $K^\circ$. The delicate point is that no holomorphic extension to a neighbourhood of $K$ is assumed; [boundary regularity](/theorems/99) is exactly what the localization theorem handles.
The independent analytic input is Vitushkin's localization theorem in the following form: if $E\subset\mathbb C$ is compact, $g:E\to\mathbb C$ is continuous on $E$ and holomorphic on $E^\circ$, and $\eta>0$, then there exists a rational function $R$ with all poles in $\mathbb C\setminus E$ such that
\begin{align*}
\sup_{z\in E}|g(z)-R(z)|<\eta.
\end{align*}
This is a rational approximation theorem, not the polynomial conclusion we are proving. It allows exterior poles and therefore must still be combined with Runge approximation and polynomial convexity to obtain polynomials.
Now set $E:=K$, $g:=f$, and $\eta:=\varepsilon/2$. The compactness of $E$ is the compactness of $K$, and the continuity and interior holomorphy hypotheses are exactly the assertion $f\in A(K)$. The theorem therefore supplies a rational function $r$ with all poles contained in $\mathbb C\setminus K$ and with the estimate
\begin{align*}
\sup_{z\in K}|f(z)-r(z)|<\frac{\varepsilon}{2}.
\end{align*}
The location of the poles matters: since no pole lies in $K$, the rational function $r$ is holomorphic on an open neighbourhood of $K$, and the displayed supremum is a supremum of a continuous function over a compact set.
[/guided]
[/step]
[step:Remove the exterior poles by Runge approximation]
The rational function $r$ is holomorphic on an open neighbourhood of $K$ because every pole of $r$ lies in $\mathbb C\setminus K$. Since $K$ is polynomially convex, Runge's polynomial approximation theorem applies to $r$ on $K$. Hence there exists a polynomial $p\in\mathbb C[z]$ such that
\begin{align*}
\sup_{z\in K}|r(z)-p(z)|<\frac{\varepsilon}{2}.
\end{align*}
[guided]
The previous step has reduced the problem to approximating a rational function $r$ on $K$. The function $r$ has no poles on $K$, so there is an [open set](/page/Open%20Set) $U\subset\mathbb C$ with $K\subset U$ on which $r:U\to\mathbb C$ is holomorphic.
Runge's polynomial approximation theorem applies on polynomially convex compact subsets of $\mathbb C$: if a function is holomorphic on a neighbourhood of such a compact set, then it can be uniformly approximated there by polynomials. The compact set is polynomially convex by hypothesis, and $r$ is holomorphic on a neighbourhood of $K$, so there exists $p\in\mathbb C[z]$ satisfying
\begin{align*}
\sup_{z\in K}|r(z)-p(z)|<\frac{\varepsilon}{2}.
\end{align*}
This is the step where polynomial convexity is used a second time: it ensures that the rational poles outside $K$ create no obstruction to polynomial approximation on $K$.
[/guided]
[/step]
[step:Combine the two uniform estimates]
For every $z\in K$, the triangle inequality in $\mathbb C$ gives
\begin{align*}
|f(z)-p(z)|\leq |f(z)-r(z)|+|r(z)-p(z)|.
\end{align*}
Taking suprema over $K$ and using the two estimates above yields
\begin{align*}
\sup_{z\in K}|f(z)-p(z)|
&\leq \sup_{z\in K}|f(z)-r(z)|+\sup_{z\in K}|r(z)-p(z)| \\
&< \frac{\varepsilon}{2}+\frac{\varepsilon}{2} \\
&=\varepsilon.
\end{align*}
Thus the polynomial $p\in\mathbb C[z]$ satisfies the required approximation inequality.
[/step]