real analysis – Definition of differentiability on closed sets


Let $Usubset mathbb{R}^{n}$ be an open set. A function $f: U to mathbb{R}^{m}$ is said to be differentiable at $a in U$ if there exists some linear map $Df(a):mathbb{R}^{n}to mathbb{R}^{m}$ such that:
$$lim_{hto 0}frac{||f(a+h)-f(a)-Df(a)(h)||}{||h||} = 0 $$
This is standard. However, during a course, my professor mentioned that we can define differentiability when $U$ is not assumed to be open as follows. If $U$ is not necessarily open, then $f$ is said to be differentiable at $a in U$ if there exists some open set $Vsubset mathbb{R}^{n}$ and a function $tilde{f}: V to mathbb{R}^{m}$ such that $a in V$, $tilde{f}$ is differentiable at $a$ and $tilde{f}bigg{|}_{Vcap U} equiv f$.

I understand this definition. But isn’t it possible that there are two different open sets $V_{1}$ and $V_{2}$ and functions $tilde{f}_{1},tilde{f}_{2}$ satisfying the above conditions? And if so, shouldn’t $tilde{f}_{1}bigg{|}_{V_{1}cap U} = tilde{f}bigg{|}_{V_{2}cap U} equiv f$? It does not seem to be the case since these functions seem not to have the same domain.