Solution.
We first state Harnack's inequality: Let u be a non-negative harmonic function on the open disk D(z0,R). Then for z∈D(z0,R),
0≤u(z)≤(R−∣z−z0∣R)2u(z0).
Let δ=21d(K,Ωc)>0, since K and Ωc are disjoint closed sets. Since K is totally bounded, this implies that we can cover K with finitely many balls B(z1,δ),…,B(zn,δ). By construction, the corresponding closed balls B(zj,δ)⊆Ω also. Set E=⋃j=1nB(zj,δ)⊆Ω. Since E is a finite union of compact balls, E is itself compact and has finitely many connected components (it has at most N, one for each ball). Hence, we may connect all the components together with finitely many curves to form a new set F, since Ω is connected, hence path connected. Because F is a union of a compact set E and finitely many compact curves, F is also compact, and by construction, E is connected. Since K⊆F, if we find an upper bound M for F, this gives us an upper bound on K. Thus, by replacing K with F, we may assume without loss of generality that K is a connected, compact set in Ω.
With δ as before, compactness implies that we can cover K with finitely many balls B(z1,3δ),…,B(zN,3δ) such that B(zj,δ)⊆Ω as well. By Harnack's inequality, for z∈B(zj,32δ), we have
0≤u(z)≤(δ−∣z−z0∣δ)2u(zj)≤(δ−32δδ)2u(zj)=9u(zj)(1)
for any u∈U. Notice that these balls have the following property: if B(zj,3δ)∩B(zk,3δ)=∅, then zk∈B(zj,32δ). Indeed, given w∈B(zj,3δ)∩B(zk,3δ), we have
∣zj−zk∣≤∣zj−w∣+∣w−zk∣<3δ+3δ=32δ.
Now let z∈K and let γ be a curve in K connecting z and z0. Then γ traverses through the B(zj,3δ) in some order. Let A={wj}j⊆{z1,…,zN} be the sequence of the centers of these balls, which is finite since γ is compact and these balls cover γ. For notation, let ∣A∣=M.
Notice that B(wj,3δ)∩B(wj+1,3δ)=∅ for all 1≤j<M. Indeed, because j<M, there exists t0 so that ∣γ(t0)−wj∣=3δ, i.e., a time when γ leaves B(wj,3δ) and enters B(wj+1,3δ). Since B(wj+1,3δ), there exists an open neighborhood γ(t0)∈U⊆B(wj+1,3δ). Since γ(t0) is a boundary point of B(wj,3δ), this means that U∩B(wj,3δ)=∅, and so B(wj,3δ)∩B(wj+1,3δ)=∅, as claimed.
Next, we need to remove duplicates from A. We do this as follows: let m be the first index so that wm=wk for some 1≤k<m, and remove wk+1,…,wm from A. Notice that
B(wk,3δ)∩B(wm+1,3δ)=B(wm,3δ)∩B(wm+1,3δ)=∅,
so the property we described before still holds with wk+1,…,wm removed. Renumber A so that wk+ℓ=wm+ℓ for ℓ≥1.
By induction, we may repeat this process, and this must terminate after finitely many steps since A is finite. When this occurs, A has no more duplicates, which implies that ∣A∣=M≤N. To complete the proof, observe that wj+1∈B(wj,32δ) by construction, and so by (1),
0≤u(wj+1)≤9u(wj).
By construction, wM=z and w1=z0, and by induction, we conclude that
u(z)=u(wM)≤9Mu(w1)=9Mu(z0)≤9N.
Since z∈K was chosen arbitrarily, we see that
u∈Usupz∈Ksupu(z)≤9N,
which completes the proof.