[proofplan]
The monotonicity formula identifies the derivative of $\mathcal W$ with the integral of the squared norm of a symmetric $2$-tensor against a smooth positive measure. Since $J$ is nondegenerate, its interior is nonempty, so constancy of $\mathcal W$ gives zero derivative at all interior times of $J$ and forces the nonnegative integrand to vanish everywhere by continuity and positivity of the measure. Conversely, if the tensor vanishes on $M \times J$, then the derivative of $\mathcal W$ is zero on the interior of $J$, hence $\mathcal W$ is constant on the whole interval by continuity at any endpoints.
[/proofplan]
[step:Define the soliton defect tensor and the weighted measure]
Let $n = \dim M$. For each $t \in [0,T]$, let $A(t) \in \Gamma(S^2T^*M)$ be the symmetric $2$-tensor field defined pointwise by
\begin{align*}
A(t)(p)=\operatorname{Ric}_{g(t)}(p)+\operatorname{Hess}_{g(t)} f(t)(p)-\frac{1}{2\tau(t)}g(t)(p)
\end{align*}
for every $p \in M$, where $\operatorname{Hess}_{g(t)} f(t)$ denotes the Hessian of $f(t): M \to \mathbb{R}$ with respect to the Riemannian metric $g(t)$.
Also define the smooth positive measure $\mu_t$ on $M$ by
\begin{align*}
d\mu_t
=
(4\pi\tau(t))^{-n/2}e^{-f(\cdot,t)}\, d\operatorname{vol}_{g(t)}.
\end{align*}
Since $M$ is closed, $g(t)$ is smooth, $f$ is smooth, and $\tau(t)>0$, the measure $\mu_t$ has a strictly positive smooth density with respect to the Riemannian volume measure of $g(t)$.
[/step]
[step:Use constancy of $\mathcal W$ to force the soliton defect to vanish]
Assume first that $\mathcal W[g(t),f(t),\tau(t)]$ is constant on $J$. Let $t \in J^\circ$, where $J^\circ$ denotes the interior of $J$ relative to $\mathbb{R}$. Then
\begin{align*}
\frac{d}{dt}\mathcal W[g(t),f(t),\tau(t)] = 0.
\end{align*}
By Perelman's $\mathcal W$-entropy monotonicity formula in the theorem setting,
\begin{align*}
0
=
2\tau(t)\int_M |A(t)|_{g(t)}^2\, d\mu_t.
\end{align*}
Because $\tau(t)>0$, this gives
\begin{align*}
\int_M |A(t)|_{g(t)}^2\, d\mu_t=0.
\end{align*}
The function
\begin{align*}
p \mapsto |A(t)(p)|_{g(t)}^2
\end{align*}
is continuous and nonnegative on $M$, and $\mu_t$ has strictly positive smooth density. Hence this function must vanish at every point of $M$. Therefore $A(t)=0$ on $M$ for every $t \in J^\circ$.
Since $A$ is a smooth time-dependent section of $S^2T^*M$ and $J$ is nondegenerate, every endpoint of $J$ contained in $[0,T]$ is a [limit point](/page/Limit%20Point) of $J^\circ$. Hence the identity $A(t)=0$ on $M$ for all $t \in J^\circ$ extends by continuity to such endpoints. Thus, for every $t \in J$ and every $p \in M$,
\begin{align*}
\operatorname{Ric}_{g(t)}(p)+\operatorname{Hess}_{g(t)} f(t)(p)
=
\frac{1}{2\tau(t)}g(t)(p).
\end{align*}
[guided]
Assume that $\mathcal W[g(t),f(t),\tau(t)]$ is constant on $J$. The point of the monotonicity formula is that it does not merely say $\mathcal W$ is nondecreasing; it identifies its derivative as an integral of a square. For every interior time $t \in J^\circ$, constancy gives
\begin{align*}
\frac{d}{dt}\mathcal W[g(t),f(t),\tau(t)] = 0.
\end{align*}
Perelman's $\mathcal W$-entropy monotonicity formula in the theorem setting applies by the hypotheses of the theorem and gives
\begin{align*}
0
=
2\tau(t)\int_M
\left|
\operatorname{Ric}_{g(t)}
+
\operatorname{Hess}_{g(t)} f(t)
-
\frac{1}{2\tau(t)}g(t)
\right|_{g(t)}^2
\, d\mu_t.
\end{align*}
Using the definition of $A(t)$, this is
\begin{align*}
0
=
2\tau(t)\int_M |A(t)|_{g(t)}^2\, d\mu_t.
\end{align*}
Since $\tau(t)>0$, division by $2\tau(t)$ is valid and yields
\begin{align*}
\int_M |A(t)|_{g(t)}^2\, d\mu_t=0.
\end{align*}
Now we use the positivity built into the weighted measure. The function
\begin{align*}
p \mapsto |A(t)(p)|_{g(t)}^2
\end{align*}
is continuous because $g$, $f$, and $\tau$ are smooth, and it is nonnegative because it is a squared norm. The measure $\mu_t$ is given by
\begin{align*}
d\mu_t
=
(4\pi\tau(t))^{-n/2}e^{-f(\cdot,t)}\, d\operatorname{vol}_{g(t)},
\end{align*}
and this density is strictly positive at every point of $M$. If the continuous nonnegative function $|A(t)|_{g(t)}^2$ were positive at some point $p \in M$, then by continuity it would be positive on some open neighbourhood of $p$, and that neighbourhood would have positive $\mu_t$-measure. The integral would then be strictly positive, contradicting the identity above. Hence
\begin{align*}
|A(t)(p)|_{g(t)}^2=0
\end{align*}
for every $p \in M$. Since $g(t)$ is a Riemannian metric, the squared norm of a tensor is zero exactly when the tensor itself is zero. Thus $A(t)=0$ on $M$ for every $t \in J^\circ$.
Finally, the tensor $A$ is a smooth time-dependent section of $S^2T^*M$, so it depends continuously on $t$. Because $J$ is nondegenerate, if $s \in J$ is an endpoint of $J$, then there is a sequence $(t_k)_{k=1}^{\infty}$ in $J^\circ$ with $t_k \to s$. Passing to the limit in $A(t_k)=0$ gives $A(s)=0$ on $M$. Consequently, for every $t \in J$ and every $p \in M$,
\begin{align*}
\operatorname{Ric}_{g(t)}(p)+\operatorname{Hess}_{g(t)} f(t)(p)
=
\frac{1}{2\tau(t)}g(t)(p).
\end{align*}
[/guided]
[/step]
[step:Use the soliton equation to make the entropy derivative vanish]
Conversely, assume that for every $t \in J$ and every point of $M$,
\begin{align*}
\operatorname{Ric}_{g(t)}+\operatorname{Hess}_{g(t)} f(t)=\frac{1}{2\tau(t)}g(t).
\end{align*}
Equivalently, $A(t)=0$ on $M$ for every $t \in J$. Therefore, for every $t \in J^\circ$, Perelman's $\mathcal W$-entropy monotonicity formula in the theorem setting gives
\begin{align*}
\frac{d}{dt}\mathcal W[g(t),f(t),\tau(t)]
=
2\tau(t)\int_M |A(t)|_{g(t)}^2\, d\mu_t
=
0.
\end{align*}
Define the real-valued function $F: J \to \mathbb{R}$ by
\begin{align*}
F(t)=\mathcal W[g(t),f(t),\tau(t)].
\end{align*}
The function $F$ is smooth on $J$, and $F'(t)=0$ for every $t \in J^\circ$. If $a,b \in J^\circ$ with $a<b$, then the [Mean Value Theorem](/theorems/632) applied to $F|_{[a,b]}$ gives a point $c \in (a,b)$ such that
\begin{align*}
F(b)-F(a)=F'(c)(b-a)=0.
\end{align*}
Thus $F$ is constant on $J^\circ$. Since $F$ is continuous on $J$, the same constant value extends to every endpoint of $J$ contained in $[0,T]$. Hence $F$ is constant on $J$. This proves the converse implication and completes the equivalence.
[/step]