Solution (source code)

= Solution

For a real locally integrable function, the definitions are distributional:
$$
\boxed{\begin{aligned}f\text{ subharmonic}&\iff\int_\Omega f\Delta\phi\geq0\quad(0\leq\phi\in C_c^\infty(\Omega)),\\
f\text{ superharmonic}&\iff\int_\Omega f\Delta\phi\leq0\quad(0\leq\phi\in C_c^\infty(\Omega)),\\
f\text{ harmonic}&\iff\int_\Omega f\Delta\phi=0\quad(\phi\in C_c^\infty(\Omega)).\end{aligned}}
$$
Thus the <Laplacian> is respectively a <positive distribution>, a negative distribution, or zero. A <superharmonic function> is the negative of a <subharmonic function>; being both is equivalent to being harmonic. For a $C^2$ function these conditions are $\Delta f\geq0$, $\Delta f\leq0$, and $\Delta f=0$ pointwise.

An $L^1_{\mathrm{loc}}$ equivalence class does not itself specify point values. For the maximum principle use the <canonical representative of a subharmonic distribution>
$$
\widetilde f(x)=\lim_{r\downarrow0}\frac1{|B_r|}\int_{B_r(x)}f.
$$
These normalized integrals are ball averages. To justify this construction, first mollify $f$: its smooth local regularizations satisfy $\Delta f_\varepsilon\geq0$. For any smooth subharmonic function, the spherical mean $m_x(r)$ obeys
$$
m_x'(r)=\frac1{|\mathbb S^{n-1}|r^{n-1}}\int_{B_r(x)}\Delta f\geq0.
$$
This follows by differentiating the spherical integral and applying the <divergence theorem>. Its ball mean also increases with radius: its derivative is $n/r$ times the spherical mean minus the ball mean. Local $L^1$ convergence of the regularizations passes the monotonicity of the ball means to $f$. The decreasing-radius limit therefore exists, possibly as minus infinity at an exceptional point, and equals $f$ almost everywhere by the <Lebesgue differentiation theorem>. It is <upper semicontinuous> as the local infimum of continuous ball averages and satisfies
$$
\widetilde f(x)\leq\frac1{|B_r|}\int_{B_r(x)}\widetilde f.
$$
For a <superharmonic function> use the corresponding <lower semicontinuous> representative and reverse the inequality.

For a distributionally <harmonic function>, the smooth regularizations are harmonic and have constant spherical means. A radial <mollifier> $\rho_\delta$ of integral one therefore reproduces them by averaging these means. At fixed interior radius $\delta$, pass to the local $L^1$ limit to obtain $f=f*\rho_\delta$ almost everywhere on a smaller region. The right side is smooth and has zero distributional Laplacian, giving the smooth harmonic representative. This proves the relevant <Weyl lemma>. Changing a value at a single point can spoil a pointwise maximum principle, so the representative convention is essential.