# is this function regular?

I am learning nonsmooth analysis for discontinuous dynamical systems. An important concept in this field is the regularity of functions.

A function $$f$$ is regular at $$x$$ if its right directional derivative $$f^{'}(x,v)$$ is equal to its generalized directional derivative $$f^{o}(x,v)$$ at $$x$$ in any direction $$v$$.

The right directional derivative $$f^{'}$$ at $$x$$ in the direction $$v$$ is defined as $$f^{'}(x;v)=\lim_{h\rightarrow 0^+}\frac{f(x+hv)-f(x)}{h}$$ when this limit exists. The generalized directinal derivative $$f^{o}$$ at $$x$$ in the direction $$v$$ is defined as \begin{align} f^{o}(:,v)&=\limsup_{\begin{array}{}y\rightarrow x\\h\rightarrow0^+\end{array}}\frac{f(y+hv)-f(y)}{h}\\ &=\lim_{\begin{array}{}\delta\rightarrow0^+\\ \epsilon\rightarrow0^+\end{array}}\sup_{\begin{array}{}y\in\mathcal{B}(x,\delta)\\ h\in[0,\epsilon)\end{array}}\frac{f(y+hv)-f(y)}{h} \end{align}

The definition of regular is not straightforward for beginners. Let's use an example to study it.

Define $$f_1(x)=\begin{cases}x^2,&|x|<1,\\1,& otherwise \end{cases}$$ Then is function $$f_1$$ regular at $$x=\pm 1$$ or not?

Here is my calculation. \begin{align} f_1(1;v)^{'}&=\lim_{h\rightarrow 0^+}\frac{f_1(1+hv)-f_1(1)}{h}\\ &=\begin{cases}0,&v>0,\\2v,&v<0.\end{cases} \end{align} and \begin{align} f_1^{o}(1,v)&=\limsup_{\begin{array}{}y\rightarrow x\\h\rightarrow0^+\end{array}}\frac{f_1(y+hv)-f_1(y)}{h}\\ &=\limsup_{h\rightarrow 0^+}\frac{f_1(1+kh+hv)-f_1(1+kh)}{h}\\ &=\begin{cases} 2v,&v>0,\\ 0,&v<0. \end{cases} \end{align} Thus $$f_1(x)$$ is not regular at $$x=1$$. (Please point out errors if the result is incorrect).

More calculation steps:

Define $$g(x)=\begin{cases}2x,&|x|<1.\\0,&x>1.\end{cases}$$, then by L'Hopital's Rule, one can obtain \begin{align} f^{o}(1;v)&=\limsup_{h\rightarrow 0^+}\frac{f(1+hv+hk)-f(1+hk)}{h}\\ &=\limsup_{h\rightarrow 0^+}g(1+hv+kv)(v+k)-g(1+hk)k\\ &=\begin{cases} \sup&\begin{cases} 0,&k>0,\\ \begin{cases}-2k,&v+k>0\\2v,&v+k<0\end{cases},&k<0, \end{cases},v>0,\\ \sup&\begin{cases} 2v,&k<0,\\ \begin{cases}0,&2v+2k>0\\2(v+k),&v+k<0\end{cases},&k>0, \end{cases},v<0, \end{cases}\\ &=\begin{cases}2v,&v>0,\\0,&v<0\end{cases} \end{align}

I find a similar piecewise function is claimed to be regular in published papers. The analysis can be analogized as if $$v>0$$, then \begin{align} f_1^{o}(1,v)&=\limsup_{\begin{array}{} y\rightarrow 1\\t\rightarrow 0^{+} \end{array}}\frac{f_1(y+hv)-f_1(y)}{h}\\ &\leq \limsup_{\begin{array}{} y^{'}\rightarrow 1\\t\rightarrow 0^{+} \end{array}}\frac{f_1(1)-f_1(y^{'}-hv)}{h}\\ &=-\lim_{h\rightarrow 0^+}\frac{f_1(1)-f_1(1)}{h}\\ &=0. \end{align} And if $$v<0$$, then \begin{align} f_1^{o}(1,v)&=\limsup_{\begin{array}{} y\rightarrow 1\\t\rightarrow 0^{+} \end{array}}\frac{f_1(y+hv)-f_1(y)}{h}\\ &=\limsup_{\begin{array}{} y\rightarrow 1\\t\rightarrow 0^{+} \end{array}}\frac{f_1(y+hv)-f_1(1)}{h}\\ &=2v \end{align}

The original version in the paper are the piecewise potential function and regularity analysis.

Obviously, there is something wrong. Can anyone point it out? Thank you.