[proofplan]
We subtract the two functions and reduce the nonlinear comparison to a linear parabolic inequality with a bounded zeroth-order coefficient. The local Lipschitz hypothesis gives a bounded coefficient on the compact range of $u$ and $v$. An exponential weight then makes the zeroth-order coefficient strictly positive, so a positive maximum inside the parabolic cylinder contradicts the elementary maximum principle argument at that maximum. Applying this on every truncated cylinder $[0,S] \times \overline{\Omega}$ with $S<T$ and passing to the limit gives the result up to time $T$.
[/proofplan]
[step:Reduce the nonlinear inequality to a linear inequality for the difference]
Define
\begin{align*}
w: [0,T] \times \overline{\Omega} \to \mathbb{R}
\end{align*}
by $w(t,x) := u(t,x) - v(t,x)$. Since $u,v \in C^{1,2}((0,T) \times \Omega) \cap C([0,T] \times \overline{\Omega})$, we have
\begin{align*}
w \in C^{1,2}((0,T) \times \Omega) \cap C([0,T] \times \overline{\Omega}).
\end{align*}
The assumed differential inequality gives, for every $(t,x) \in (0,T) \times \Omega$,
\begin{align*}
\partial_t w(t,x) - \Delta w(t,x) \leq f(u(t,x)) - f(v(t,x)).
\end{align*}
Because $[0,T] \times \overline{\Omega}$ is compact and $u,v$ are continuous, there exists $R>0$ such that
\begin{align*}
u([0,T] \times \overline{\Omega}) \cup v([0,T] \times \overline{\Omega}) \subset [-R,R].
\end{align*}
Since $f$ is locally Lipschitz, there exists $L \geq 0$ such that
\begin{align*}
|f(a)-f(b)| \leq L |a-b| \quad \text{for all } a,b \in [-R,R].
\end{align*}
Define
\begin{align*}
c: (0,T) \times \Omega \to \mathbb{R}
\end{align*}
as follows: if $u(t,x) \neq v(t,x)$, set
\begin{align*}
c(t,x) := \dfrac{f(u(t,x))-f(v(t,x))}{u(t,x)-v(t,x)}.
\end{align*}
If $u(t,x)=v(t,x)$, set
\begin{align*}
c(t,x) := 0.
\end{align*}
Then $|c(t,x)| \leq L$ for every $(t,x) \in (0,T) \times \Omega$, and
\begin{align*}
f(u(t,x)) - f(v(t,x)) = c(t,x)w(t,x)
\end{align*}
for every $(t,x) \in (0,T) \times \Omega$. Hence
\begin{align*}
\partial_t w(t,x) - \Delta w(t,x) - c(t,x)w(t,x) \leq 0
\end{align*}
for every $(t,x) \in (0,T) \times \Omega$.
[guided]
The only nonlinear term is $f(u)-f(v)$, so the purpose of this step is to rewrite that term as a bounded coefficient times $u-v$. Define the difference map
\begin{align*}
w: [0,T] \times \overline{\Omega} \to \mathbb{R}
\end{align*}
by $w(t,x) := u(t,x)-v(t,x)$. The regularity assumptions on $u$ and $v$ imply
\begin{align*}
w \in C^{1,2}((0,T) \times \Omega) \cap C([0,T] \times \overline{\Omega}).
\end{align*}
Subtracting the differential expressions in the hypothesis gives, pointwise on $(0,T) \times \Omega$,
\begin{align*}
\partial_t w(t,x) - \Delta w(t,x) \leq f(u(t,x)) - f(v(t,x)).
\end{align*}
Now we use local Lipschitz continuity of $f$ only on the values actually taken by $u$ and $v$. Since $[0,T] \times \overline{\Omega}$ is compact and $u,v$ are continuous, their ranges are compact subsets of $\mathbb{R}$. Therefore there exists $R>0$ such that both ranges lie in $[-R,R]$:
\begin{align*}
u([0,T] \times \overline{\Omega}) \cup v([0,T] \times \overline{\Omega}) \subset [-R,R].
\end{align*}
The function $f$ is locally Lipschitz, so on this compact interval there is a Lipschitz constant $L \geq 0$ satisfying
\begin{align*}
|f(a)-f(b)| \leq L|a-b| \quad \text{for all } a,b \in [-R,R].
\end{align*}
We now define the coefficient that linearizes the reaction term:
\begin{align*}
c: (0,T) \times \Omega \to \mathbb{R}
\end{align*}
as follows: if $u(t,x) \neq v(t,x)$, set
\begin{align*}
c(t,x) := \dfrac{f(u(t,x))-f(v(t,x))}{u(t,x)-v(t,x)}.
\end{align*}
If $u(t,x)=v(t,x)$, set
\begin{align*}
c(t,x) := 0.
\end{align*}
When $u(t,x) \neq v(t,x)$, the Lipschitz bound gives $|c(t,x)| \leq L$. When $u(t,x)=v(t,x)$, the definition gives $c(t,x)=0$, so the same bound holds. Also, if $u(t,x)=v(t,x)$ then both sides of
\begin{align*}
f(u(t,x))-f(v(t,x)) = c(t,x)w(t,x)
\end{align*}
are zero, while if $u(t,x) \neq v(t,x)$ this identity follows from the definition of $c$. Thus the nonlinear inequality becomes the linear inequality
\begin{align*}
\partial_t w(t,x) - \Delta w(t,x) - c(t,x)w(t,x) \leq 0
\end{align*}
for every $(t,x) \in (0,T) \times \Omega$, with the important additional fact that $c$ is bounded.
[/guided]
[/step]
[step:Record the nonpositive parabolic boundary values for the difference]
For every $(t,x) \in (0,T) \times \partial\Omega$, the boundary hypothesis gives $w(t,x) \leq 0$. For every $x \in \Omega$, the initial hypothesis gives $w(0,x) \leq 0$. If $x \in \partial\Omega$, then continuity of $w$ on $[0,T] \times \overline{\Omega}$ and the lateral boundary inequality imply
\begin{align*}
w(0,x) = \lim_{t \downarrow 0} w(t,x) \leq 0.
\end{align*}
Therefore
\begin{align*}
w(0,x) \leq 0 \quad \text{for every } x \in \overline{\Omega},
\end{align*}
and
\begin{align*}
w(t,x) \leq 0 \quad \text{for every } (t,x) \in (0,T) \times \partial\Omega.
\end{align*}
[/step]
[step:Apply an exponential weight to make the zeroth-order term positive]
Choose $\lambda := L+1$. Define
\begin{align*}
z: [0,T] \times \overline{\Omega} \to \mathbb{R}
\end{align*}
by $z(t,x) := e^{-\lambda t}w(t,x)$. Then
\begin{align*}
z \in C^{1,2}((0,T) \times \Omega) \cap C([0,T] \times \overline{\Omega}).
\end{align*}
Since $w(t,x)=e^{\lambda t}z(t,x)$, direct differentiation gives
\begin{align*}
\partial_t z(t,x) - \Delta z(t,x) + (\lambda-c(t,x))z(t,x) = e^{-\lambda t}\bigl(\partial_t w(t,x)-\Delta w(t,x)-c(t,x)w(t,x)\bigr).
\end{align*}
Hence, for every $(t,x) \in (0,T) \times \Omega$,
\begin{align*}
\partial_t z(t,x) - \Delta z(t,x) + (\lambda-c(t,x))z(t,x) \leq 0.
\end{align*}
Moreover, because $|c(t,x)| \leq L$, we have
\begin{align*}
\lambda - c(t,x) \geq 1
\end{align*}
for every $(t,x) \in (0,T) \times \Omega$. Since $e^{-\lambda t}>0$, the parabolic boundary inequalities for $w$ imply the same inequalities for $z$:
\begin{align*}
z(0,x) \leq 0 \quad \text{for every } x \in \overline{\Omega},
\end{align*}
and
\begin{align*}
z(t,x) \leq 0 \quad \text{for every } (t,x) \in (0,T) \times \partial\Omega.
\end{align*}
[/step]
[step:Rule out a positive maximum on each truncated cylinder]
Fix $S \in (0,T)$. We prove that $z \leq 0$ on $[0,S] \times \overline{\Omega}$. Suppose instead that
\begin{align*}
M := \max_{[0,S] \times \overline{\Omega}} z > 0.
\end{align*}
Since $z \leq 0$ on $\{0\} \times \overline{\Omega}$ and on $(0,S] \times \partial\Omega$, a point $(t_0,x_0)$ attaining this positive maximum satisfies
\begin{align*}
t_0 \in (0,S] \quad \text{and} \quad x_0 \in \Omega.
\end{align*}
At the spatial maximum point $x_0$ of the function $x \mapsto z(t_0,x)$, every coordinate second derivative satisfies $\partial_{x_i x_i} z(t_0,x_0) \leq 0$: this follows by applying the one-variable second-derivative maximum condition to the map $s \mapsto z(t_0,x_0+s e_i)$ for sufficiently small $s$, where $e_i \in \mathbb{R}^n$ is the $i$-th standard basis vector. Summing over $i \in \{1,\dots,n\}$ gives
\begin{align*}
\Delta z(t_0,x_0) \leq 0.
\end{align*}
At the time maximum point $t_0$ of the function $t \mapsto z(t,x_0)$ on $[0,S]$, we have
\begin{align*}
\partial_t z(t_0,x_0) \geq 0.
\end{align*}
If $t_0<S$, then the one-variable function $t \mapsto z(t,x_0)$ has an interior maximum at $t_0$, so its derivative there is zero. If $t_0=S$, it follows from the left-sided inequality
\begin{align*}
\frac{z(S,x_0)-z(S-h,x_0)}{h} \geq 0
\end{align*}
for all sufficiently small $h>0$, together with differentiability in $t$ at $S$.
Evaluating the differential inequality for $z$ at $(t_0,x_0)$ gives
\begin{align*}
0 \geq \partial_t z(t_0,x_0)-\Delta z(t_0,x_0)+(\lambda-c(t_0,x_0))z(t_0,x_0).
\end{align*}
The three terms on the right satisfy
\begin{align*}
\partial_t z(t_0,x_0) \geq 0, \quad -\Delta z(t_0,x_0) \geq 0, \quad (\lambda-c(t_0,x_0))z(t_0,x_0) \geq z(t_0,x_0)>0.
\end{align*}
Thus the right-hand side is strictly positive, contradicting the displayed inequality. Therefore $z \leq 0$ on $[0,S] \times \overline{\Omega}$.
[guided]
We want to show that $z$ cannot become positive. Fix a time $S \in (0,T)$ and work on the compact cylinder $[0,S] \times \overline{\Omega}$. Because $z$ is continuous there, it attains a maximum. Suppose that this maximum is positive:
\begin{align*}
M := \max_{[0,S] \times \overline{\Omega}} z > 0.
\end{align*}
Let $(t_0,x_0) \in [0,S] \times \overline{\Omega}$ be a point where $z(t_0,x_0)=M$.
The maximum point cannot lie on the initial face, because $z(0,x) \leq 0$ for every $x \in \overline{\Omega}$. It also cannot lie on the lateral boundary, because $z(t,x) \leq 0$ for every $(t,x) \in (0,S] \times \partial\Omega$. Since the maximum is positive, we must have
\begin{align*}
t_0 \in (0,S] \quad \text{and} \quad x_0 \in \Omega.
\end{align*}
Now we use the elementary calculus information available at a maximum. First, $x_0$ is an interior maximum point of the spatial function $x \mapsto z(t_0,x)$. Since $z$ is twice continuously differentiable in the spatial variables on $(0,T) \times \Omega$, we may restrict to each coordinate line through $x_0$. For each $i \in \{1,\dots,n\}$, let $e_i \in \mathbb{R}^n$ be the $i$-th standard basis vector. For sufficiently small $s \in \mathbb{R}$, the point $x_0+s e_i$ lies in $\Omega$, and the one-variable function $s \mapsto z(t_0,x_0+s e_i)$ has a maximum at $s=0$. Therefore its second derivative at $0$ is nonpositive, so $\partial_{x_i x_i}z(t_0,x_0) \leq 0$. Summing these inequalities over $i$ gives
\begin{align*}
\Delta z(t_0,x_0) \leq 0.
\end{align*}
Equivalently, $-\Delta z(t_0,x_0) \geq 0$.
Second, $t_0$ is a maximum point of the one-variable function $t \mapsto z(t,x_0)$ on $[0,S]$. If $t_0<S$, then this one-variable function has an interior maximum at $t_0$, so its derivative there is zero and $\partial_t z(t_0,x_0)=0$. If $t_0=S$, then for every sufficiently small $h>0$,
\begin{align*}
z(S,x_0)-z(S-h,x_0) \geq 0.
\end{align*}
Dividing by $h>0$ and using differentiability in $t$ at $S$ gives
\begin{align*}
\partial_t z(S,x_0) \geq 0.
\end{align*}
In both cases,
\begin{align*}
\partial_t z(t_0,x_0) \geq 0.
\end{align*}
We now evaluate the differential inequality
\begin{align*}
\partial_t z(t,x)-\Delta z(t,x)+(\lambda-c(t,x))z(t,x) \leq 0
\end{align*}
at the point $(t_0,x_0)$. This is legitimate because $(t_0,x_0) \in (0,T) \times \Omega$. We obtain
\begin{align*}
0 \geq \partial_t z(t_0,x_0)-\Delta z(t_0,x_0)+(\lambda-c(t_0,x_0))z(t_0,x_0).
\end{align*}
But each contribution on the right is nonnegative, and the zeroth-order contribution is strictly positive. Indeed,
\begin{align*}
\partial_t z(t_0,x_0) \geq 0,
\end{align*}
\begin{align*}
-\Delta z(t_0,x_0) \geq 0,
\end{align*}
and, since $\lambda-c(t_0,x_0) \geq 1$ and $z(t_0,x_0)=M>0$,
\begin{align*}
(\lambda-c(t_0,x_0))z(t_0,x_0) \geq z(t_0,x_0)>0.
\end{align*}
Therefore the right-hand side is strictly positive, contradicting the fact that it is at most zero. Hence no positive maximum exists on $[0,S] \times \overline{\Omega}$, and so
\begin{align*}
z(t,x) \leq 0 \quad \text{for every } (t,x) \in [0,S] \times \overline{\Omega}.
\end{align*}
[/guided]
[/step]
[step:Pass from truncated cylinders to the full time interval]
The previous step shows that for every $S \in (0,T)$,
\begin{align*}
z(t,x) \leq 0 \quad \text{for every } (t,x) \in [0,S] \times \overline{\Omega}.
\end{align*}
Thus $z(t,x) \leq 0$ for every $(t,x) \in [0,T) \times \overline{\Omega}$. Since $z$ is continuous on $[0,T] \times \overline{\Omega}$, taking $t \uparrow T$ gives
\begin{align*}
z(T,x) \leq 0 \quad \text{for every } x \in \overline{\Omega}.
\end{align*}
Therefore $z \leq 0$ on $[0,T] \times \overline{\Omega}$. Since $w(t,x)=e^{\lambda t}z(t,x)$ and $e^{\lambda t}>0$, it follows that
\begin{align*}
w(t,x) \leq 0 \quad \text{for every } (t,x) \in [0,T] \times \overline{\Omega}.
\end{align*}
By the definition $w=u-v$, this is exactly
\begin{align*}
u(t,x) \leq v(t,x) \quad \text{for every } (t,x) \in [0,T] \times \overline{\Omega}.
\end{align*}
This proves the [comparison principle](/theorems/4870).
[/step]