Suppose we have a dynamical system $\dot{x}=f(x)$ with an equillibrium $x_0$. It is known that $x_0$ is Lyapunov stable in this sense if there exists $V:\mathbb{R}^n\rightarrow\mathbb{R}$ such that $V(x_0)=0$ and $(\nabla V\cdot f)(x)\leq 0$ for $x\neq x_0$.

Now suppose $A\subset\mathbb{R}^n$ is a bounded invariant subset of our dynamical system, every trajectory initialized in $A$ stays in $A$. What I'm wondering is whether or not we can say that $A$ is Lyapunov stable in this sense (yes that article is using discrete time but I'm pretty sure the definitions carry over easily) if there exists a function $V$ with $V(a)=0$ for all $a\in A$ and $(\nabla V\cdot f)(x)\leq 0$ for all $x\not\in A$ (as before).

One problem with this that I imediately foresee is the geometrical nature of $A$; if $A$ is a fractal then the condition $V(a)=0$ might make it impossible for $\nabla V$ to exists. Is it possible to say anything if we put restrictions on $A$? Is there any literature related to this sort of generalization of Lyapunov functions?