Why does zero derivative imply a function is locally constant?

Recall that an open connected set is $\Bbb R^n$ is polygonally connected. The generalized mean value theorem says that if $f:\Omega\subseteq \Bbb R^n\to\Bbb R^m$ is differentiable in the open set $\Omega$ then for each ${\bf a,b}\in\Omega$ such that $\mathscr L({\bf a},{\bf b})\subseteq \Omega$ and any $\bf w\in\Bbb R^m$ there exists a $\bf z$ in the line joining $\bf a$ and $\bf b$ such that $${\bf w}\cdot (f({\bf b})-f({\bf a}))={\bf w} \cdot {\rm D}f({\bf z})({{\bf b}}-{\bf a})$$

Since the derivative vanishes, this says that the dot product of $f({\bf b})-f({\bf a})$ with every vector in $\Bbb R^m$ is zero, so we must have $f({\bf b})=f({\bf a})$ for each ${\bf b},{\bf a}\in\Omega$.


I think it is worth adding a proof of both claims. First, let's show that

Every open connected set $\Omega$ in the Euclidean space is polygonally connected.

P Fix a point $x\in \Omega$, and let $S$ denote the set of points that can be joined by a polygonal path to $x$. Note $S$ is nonempty, for $x\in S$. Let $T=\Omega\smallsetminus S$. Then $S\cup T=\Omega, S\cap T=\varnothing$. We will show both $S$ and $T$ are open, which will force $T=\varnothing$; as desired.

Let $a\in S$, and join $a$ to $x$ by a polygonal path. Since $\Omega$ is open, there exists a ball $B(a)$ such that $B(a)\subseteq \Omega$. But if $a'\in B(a)$; we can join $a$ to $a'$ and subsequently $a'$ to $x$ by a polygonal path, since $B(a)$ is convex. Thus $B(a)\subseteq S$, and $S$ is open.

Now let $b\in T$. Since $\Omega$ is open, there is a ball $B(b)\subseteq \Omega$. If we could join a point $b'\in B(b)$ to $x$, then we would join $b$ to $x$, since $B(b)$ is convex. Since this cannot be possible, we have $B(b)\subseteq T$, and $T$ is open.

But then, since $\Omega$ is connected and $S\neq \varnothing$, we must have $T=\varnothing$. Since $x$ was arbitrary, this proves the claim. $\blacktriangle$


The proof of the generalized MVT is a consequence of the usual unidimensional mean value theorem. Pick ${\bf x},{\bf y}$ and let ${\bf u}={\bf y}-{\bf x}$. Pick $\bf w$ and define $$F(t)={\bf w}\cdot f({\bf x}+t{\bf u})$$

so that for $t\in(-\delta,1+\delta)$ with $\delta >0$ small enough we have ${\bf x}+t{\bf u}\in \Omega$. Apply the mean value theorem to $F$, whose derivative is $$F'(t)={\bf w}\cdot {\rm D}f({\bf x}+t{\bf u})({\bf u})$$


A cute direct proof (styled after path connectedness ones) is to pick a random point $x$ and consider the set $U$ on which $f$ takes the value $f(x)$ and the set $V$ on which it does not take this value. These sets are non empty if the hypothesis fails. Clearly $V$ is open, so we are done if $U$ is open.

Letting $U'$ be a small convex region around any $y\in U$, we note that any other point is connected to $y$ by a line, that the function restricted to that line is differentiable with derivative zero, and so if we consider a $g(x')-f(y)-\Delta x'$ type function on that line which vanishes at either end, then it achieves its maximum/minimum at some point and clearly its derivative vanishes there. Then we see $\Delta$ is zero and so $g$ took the same value at either end. (This is a compressed proof/reminder of MVT and Rolle.)