I'm going through a proof of the following statement:
Let $\Omega \subset \mathbb{R}^n$ be a connected open set, $L$ be an uniformly elliptic operator in $\Omega$ with $c \equiv 0$ and $u \in C^2(\Omega) \cap C(\overline{\Omega})$. Then, if $Lu \geq 0$ in $\Omega$ and $u$ attains its maximum in $\Omega$, $u$ is constant in $\Omega$.
The proof starts as following:
Let $M := \displaystyle{\max_{x \in \overline{\Omega}} u(x)} $ and define $\Omega_M := \{x \in \Omega \ \vert \ u(x) =M \}$, $\Sigma := \Omega \setminus \Omega_M$. Suppose, by contradiction, that $\Sigma \neq \emptyset$. Choose $y \in \Sigma$ satisfying:
- $\mathrm{dist}(y, \Omega_M) < \mathrm{dist}(y, \partial \Omega)$
- after choosing $x_0 \in \Omega$ such that $u(x_0) = M$ and defining $r$ to be the radius of the largest open ball $B = B_r(y)$ such that $B \subset \Sigma$, then $r = \mathrm{dist}(y, x_0)$
It's far from clear to me why we can choose $y \in \Sigma$ satisfying both these conditions simultaneously. I think the continuity of $u$ along with the continuity of the distance functions involved will play an essential role, but I haven't been able to figure out how exactly... For the first part I tried getting a contradiction from assuming $\mathrm{dist}(y, \Omega_M) \geq \mathrm{dist}(y, \partial \Omega)$ for every $y \in \Sigma$ but that led me nowhere. I'd appreciate any help!
After thinking a lot more time about it, I think I figured it out (not completely, but satisfyingly enough). Since $\Omega$ is an open connected set in $\mathbb{R}^n$, it is also path-connected. So, let's take a fixed $z \in \Sigma$ and a path $\gamma: [0, 1] \to \Omega$ such that $\gamma(0) = z$, $\gamma(1) = x_0$. Let $\displaystyle{t_0 \doteq \inf \{t \in [0, 1] \ \vert \ \gamma(t) \in \Omega_M \}}$ be the first instant when $\gamma$ crosses $\Omega_M$ and define $p = \gamma(t_0)$. Since $\displaystyle{\inf_{t \in (0, t_0)} \|p - \gamma(t)\|} = 0$ and $\mathrm{dist}(\gamma([0, 1]), \partial \Omega) > 0$, there exists $s_0 \in (0, t_0)$ such that $\mathrm{dist}(p, \gamma(s_0)) < \mathrm{dist}(\gamma([0, 1]), \partial \Omega)$. By elementary properties of the infimum, we see that taking $y = \gamma(s_0)$, we have $$\mathrm{dist}(y, \Omega_M) \leq \mathrm{dist}(y, p) < \mathrm{dist}(\gamma([0, 1]), \partial \Omega) \leq \mathrm{dist}(y, \partial \Omega)$$
Finally, as seen here, $\mathrm{dist}(y, \partial \Omega) = \sup\{ r > 0 \ \vert \ B_r(y) \subset \Omega \} \doteq s$. Take $r = \mathrm{dist}(y, \Omega_M)$. Then $r \leq \mathrm{dist}(y, p) < \mathrm{dist}(y, \partial \Omega) = s$, so $B_r(y) \subset \Omega$ (since $r < s$) and $B_r(y) \subset \Sigma$ (otherwise there would exist $z \in \Omega_M$ such that $\mathrm{dist}(y, z) < r $, but this is impossible since $\mathrm{dist}(y, z) \geq \mathrm{dist}(y, \Omega_M) = r$ for every $z \in \Omega_M$). Since $\Omega_M$ is closed, $r = \mathrm{dist}(y, x_1)$ for some $x_1 \in \Omega_M$, so that $x_1 \in \Omega_M \cap \partial B_r(y) \neq \emptyset$.