Let
- $d\in\mathbb N$;
- $k\in\{1,\ldots,d\}$;
- $M$ be a $k$-dimensional embedded $C^1$-submanifold of $\mathbb R^d$ with boundary;
- $\nu_{\partial M}$ denote the unit outer normal field on $\partial M$;
- $x_0\in M$;
- $T_{x_0}M$ denote the tangent space of $M$ at $x_0$;
- $f:M\to\mathbb R$ be $C^1$-differentiable at $x_0$;
- $T_{x_0}(f)$ denote the pushforward of $f$ at $x_0$.
Assuming $x_0$ is a local minimum of $f$, how can we show that $$\frac{\partial f}{\partial\nu_{\partial M}}(x_0)\le0?\tag1$$
EDIT: I guess, I was asking for too less and we can, more generally, show the following: If $v\in T_{x_0}M$, then $$\begin{cases}T_{x_0}(f)v\ge0&\text{, if }v\text{ is inward pointing};\\T_{x_0}(f)v\le0&\text{, if }v\text{ is outward pointing};\\T_{x_0}(f)v=0&\text{, if }v\text{ is inward pointing}.\end{cases}\tag2$$ Am I right? Can we show this?
I think $(2)$ should be relatively easy to obtain, but I need some help to justify a few subtleties.
Assume first that $v$ is inward pointing. Then there is (the crucial thing is the form of the interval $I$ on which $\gamma$ is defined; why does $v$ being inward pointing imply that we can choose $I$ to be of the form $[0,\varepsilon)$?) a $\varepsilon>0$ and a $C^1$-curve $\gamma:[0,\varepsilon)\to M$ with $\gamma(0)=x_0$ and $\gamma'(0)=v$. Since $x_0$ is a local minimum of $f$, we see that $0$ is a local minimum of $f\circ\gamma$. Now, if we were able to apply Lemma 1 below (a possible problem being that $[0,\varepsilon)$ is clearly convex, but $\gamma$ is not chosen (but might can be) to be differentiable on a larger open set containing $[0,\varepsilon)$), then we could immediatelly conclude that $$T_x(f)v=(f\circ\gamma)'(0)\ge0.\tag3$$
Analogously, if $v$ is outward pointing, the same should apply but with $[0,\varepsilon)$ replaced by $(-\varepsilon,0]$ (again, I would like to know why we can choose $I$ to be of this particular form whenever $v$ is outward pointing, but $(4)$ would now clearly yield $(f\circ\gamma)'(0)\le0$.
Most probably (but I don't know how we need to argue for that) we can take $I=(-\varepsilon,\varepsilon)$ whenever $v\in T_{x_0}\partial M$. If that would be the case, then (since $I$ is open), we would clearly obtain $(f\circ\gamma)'(0)=0$.
Lemma 1: Let $\Omega\subseteq\mathbb R^d$ be open, $U\subseteq\Omega$ be convex, $x_\ast\in U$ and $g:\Omega\to\mathbb R$ be Fréchet differentiable at $x_\ast$. If $x_\ast$ is a local minimum of $\left.g\right|_U$, then $${\rm D}g(x_\ast)(x-x_\ast)\ge0.\tag4$$