# Mean-value inequality with several variables

Let $$f(\mathbf{x})$$ be a real-valued and continuously differentiable function on an open subset $$U$$ of $$\mathbb{R}^d$$ such that $$| \partial_{x_i} f(\mathbf{x}) | \leqslant M$$ for all $$\mathbf{x} \in U$$ and all $$i=1$$, $$\dots$$, $$d$$ for some finite constant $$M$$. If $$\mathbf{x}$$ and $$\mathbf{x}'$$ are points in $$U$$ and such that the segment joining them is included in $$U$$, we have

$$|f(\mathbf{x}) - f(\mathbf{x}')| \leqslant M \, \| \mathbf{x} - \mathbf{x}' \|.$$

So if $$U$$ is convex the inequality holds for all couples of points $$\mathbf{x}$$ and $$\mathbf{x}'$$ in $$U$$. I believe that the "for all $$\mathbf{x}$$, $$\mathbf{x}'$$" result holds as well if $$U$$ is arcwise connected yet could not find a reference for such a result. Is this true, and if yes, what reference can be cited for this? If no, what other condition on $$U$$ weaker than convexity could be used?

It is not true. Let $$n=2$$ and $$U = (B_2 \setminus B_{1/2}) \setminus \Gamma$$ where $$\Gamma = \{(x,0) \text{ s.t. } x>0\}$$ which is an annulus minus the positive $$x$$-axis. Then let $$u:U \to (0,2\pi)$$ be given in polar coordinates by $$u(x,y) = \theta(x,y)$$ with $$\theta$$ being the angle in the range $$(0,2\pi)$$ the point $$(x,y)$$ makes with the positive $$x$$-axis when measured anticlockwise from the positive $$x$$-axis (i.e. the principle angle). Then $$\vert u(1+h,0)-u(1-h,0) \vert \to 2\pi \qquad \text{as }h\to 0,$$ but $$\| (1+h,0)-(1-h,0)\|=2h \to 0 \qquad \text{as }h\to 0.$$
As for other conditions you could impose on $$U$$ to make this work, without further context it is hard to give you a very good answer (For example, I could let $$\mathscr F$$ be the collection of open sets for which the inequality holds then say that the condition you seek is $$U \in \mathscr F$$, but this is obviously not very helpful).
At least an assumption on $$U$$ that prevents my counter-example above is the following: let $$U$$ be path-connected and define the metric
$$d(x, y) = \inf \{ \ell (\gamma) \text{ s.t. } \gamma \in C^1([0,1];U), \gamma(0)=x, \gamma (1)=y\}$$ where $$\ell (\gamma)$$ denotes the arc-length of $$\gamma$$. Suppose that there exists $$C>0$$ such $$d(x,y) \leqslant C\|x-y \| \qquad \text{for all } x,y\in U.$$ Then $$U$$ will satisfy your inequality which can be seen by first applying the mean-value inequality for arc-length then using the assumption.