Solution (source code)

= Solution

Apply the <weak maximum principle for elliptic operators> to $q=|Dw|^2$. The <product rule> and the equation for the <harmonic function> give
$$
\Delta q=2\sum_{i,j}(D_{ij}w)^2+2\sum_iD_iw\,D_i\Delta w
=2|D^2w|^2\geq0.
$$
The function $q$ is twice differentiable inside and continuous on the closure, by the prescribed regularity. Hence $\sup_\Omega q\leq\sup_{\partial\Omega}q$. Conversely, each boundary value of $q$ is a limit of values at interior points, so the reverse inequality holds for the suprema. Taking square roots proves the <gradient maximum principle for harmonic functions>:
$$
\boxed{\sup_\Omega|Dw|=\sup_{\partial\Omega}|Dw|.}
$$
This argument controls the length of the entire <gradient>, without comparing its separate components.