0

Given function $f(\vec x) \in \mathbb R, \vec x \in \mathbb R^n $, We know that for all unit direction $\hat u$:

$$ \partial_{\hat u} f = \hat u \cdot \nabla f $$

Consider function $f$:

$$ f(\left<x,y,z\right>) = z - \min(\lvert x \rvert, \lvert y \rvert)\times\frac{\lvert y \rvert}{y} $$ At the origin, along direction $\hat u=\left<\frac{1}{\sqrt 3}, \frac{1}{\sqrt 3}, \frac{1}{\sqrt 3} \right>$: $$ \partial_{\hat u} f(\vec 0) = \lim_{t \to 0} \frac{f(t \hat u) - f(\vec 0)}{t} = \lim_{t \to 0} \frac{\left(\frac{1}{\sqrt 3} - \min\left(\frac{1}{\sqrt 3},\frac{1}{\sqrt 3}\right)\times 1\right) - 0}{t} = \lim_{t \to 0} \frac{0 - 0}{t} = 0\\ \hat u \cdot \nabla f(\vec 0) = \hat u \cdot \left<f_x,f_y,f_z \right> = \left<\frac{1}{\sqrt 3}, \frac{1}{\sqrt 3}, \frac{1}{\sqrt 3} \right> \cdot \left<0,0,1\right> = \frac{1}{\sqrt 3}\\ \partial_{\hat u} f(\vec 0) \ne \hat u \cdot \nabla f(\vec 0) $$

So there must be other requirements for:

$$ \partial_{\hat u} f = \hat u \cdot \nabla f $$

From the graph of the function $f$, we can see that even the directional derivative is defined for all direction at the origin, the tangent surface at the origin is not a plane.

f

Here are my questions:

  1. does $\nabla f(\vec 0)$ exist ?
  2. what's the requirement for $\partial_{\hat u} f = \hat u \cdot \nabla f$

Edit: Proof that $f$ is not differentiable at the origin

For $f$ to be differentiable, there is a linear transformation $T$ such that: $$ \lim_{\lVert \mathbf h\rVert \to 0} \frac{f(\mathbf a+\mathbf h)-f(\mathbf a)-T_a(\mathbf h)}{\lVert \mathbf h\rVert} = \mathbf 0. $$ Since $\mathbf h$ can approach to $\mathbf 0$ follow any trajectory, assume $\mathbf h$ is following direction $\hat u$, $\mathbf h = t \hat u$ and $\lVert \hat u \rVert = 1$, then we have: $$ \lim_{t \to 0} \frac{f(\mathbf a+t \hat u)-f(\mathbf a)-T_a(t \hat u)}{t} = 0\\ \lim_{t \to 0}\frac{f(\mathbf a+t \hat u)-f(\mathbf a)}{t} = \lim_{t \to 0}\frac{T_a(t \hat u)}{t}\\ $$ To the left we have: $$ \lim_{t \to 0}\frac{f(\mathbf a+t \hat u)-f(\mathbf a)}{t} = \partial_{\hat u} f(a) $$ To the right, since $T$ is linear, we have: $$ \lim_{t \to 0}\frac{T_a(t \hat u)}{t} = \lim_{t \to 0}\frac{t T_a(\hat u)}{t} = T_a(\hat u) $$ So $$ \partial_{\hat u} f(a) = T_a(\hat u) $$ $T$ is linear and I have already proofed that $\partial_{\hat u} f(0)$ is not linear (above in the question). So $f$ is not differentiable at the origin.

What have surprised me is that I thought linearity of $\partial_{\hat u} f$ is a property of differentiable function, but in reality, it is a requirement. Although, technically there is no difference between property and requirement, they are both $\Rightarrow$ in math world.

2 Answers2

0

You are taking a derivative where your function doesn't have one. $f(x) = |x|$ does not have a derivative at 0. However it is convex and has the subdifferential $[-1,1]$ at $0$.

Edit: Your partial derivative wrt $x$ is not smooth. Consider $|y|>0$, then the function $g(x) = \max(|x|,|y|)\frac{|y|}{y}$ does not have a derivative at $x=0$. So even if your function has partial derivatives at $(0,0,0)$, the partial derivative wrt $x$ is not continuous.

lightxbulb
  • 2,047
  • My $f$ is already carefully chosen that the derivative exist for all directions. you can try derivative it using limitation. – Zang MingJie Jan 18 '19 at 12:02
  • @Zang MingJie It is discontinuous along $x=0$ and also along $y=0$. Verify that the left and right derivatives there do not match. – lightxbulb Jan 18 '19 at 12:15
  • @ZangMingJie having a partial derivative in all directions does not necessarily make your function differentiable. – Randall Jan 18 '19 at 12:18
  • @lightxbulb $f \vert_{x=0} = z - \min(0, \lvert y \rvert)\times \frac{\lvert y \rvert}{y} = z$ can you explain why it is discontinuous. – Zang MingJie Jan 18 '19 at 12:33
  • @Randall this maybe the answer I need, I want to know exactly the requirements for a function be differentiable. Any why my $f$ is not differentiable. – Zang MingJie Jan 18 '19 at 12:35
  • @Zang MingJie The above is not I think, but let $|y|>0$ be fixed (for example $1$). Consider the function $g(x) = \min(|x|, |y|)\frac{|y|}{y}$. Then the left derivative at $0$ is $-1$, but the right is $1$. Note that functions such as $|•|$ and $\min, \max$ are generally not smooth. – lightxbulb Jan 18 '19 at 12:44
  • @lightxbulb I'm analysing $f$ around the origin, I don't care what does $f$ do at $y=1$. BTW, math is all about formula, please try to express your opinion using formula to avoid misunderstanding. – Zang MingJie Jan 18 '19 at 12:47
  • @Zang MingJie Are your partial derivatives smooth? They are not, hence my point above. – lightxbulb Jan 18 '19 at 13:03
0

In order to ensure that $\partial_{\hat u} f = \hat u \cdot \nabla f$ at a given point $\mathbf a \in \mathbb R^n,$ you can simply require that the function $f$ is differentiable at $\mathbf a.$

There may be weaker conditions that ensure that $\partial_{\hat u} f = \hat u \cdot \nabla f$, but I do not know what they are. Differentiability seems to be the one usually used.

Of course you must also define what it means for a function over $\mathbb R^n$ to be differentiable at $\mathbf a.$ Here is a typical definition:

A function $f: A \to \mathbb{R}^n$, $A \subseteq \mathbb{R}^m$ is differentiable at a point $\mathbf a \in \mathbb R^n,$ if there is a linear transformation $T$ such that $$ \lim_{\lVert \mathbf h\rVert \to 0} \frac{f(\mathbf a+\mathbf h)-f(\mathbf a)-T(\mathbf h)}{\lVert \mathbf h\rVert} = \mathbf 0. $$

A good definition of the gradient $\nabla f$, in turn, would require that $f$ be differentiable at every point where $\nabla f$ is defined.

Your function does not have such a derivative at $\mathbf 0.$

There is more that can be said about this, but that is the fundamental issue.

David K
  • 98,388
  • Thanks, I have written a proof that $f$ is not differentiable at the origin in my question. And for linearity of partial derivative, I have an already answered question here https://math.stackexchange.com/questions/3079820 – Zang MingJie Jan 19 '19 at 21:35