1 Introduction

In most analysis textbooks differentiability is only treated for functions on open domains and, if needed, e.g., for the divergence theorem, an ad hoc generalization for functions on compact sets is given. We propose instead to define differentiability on arbitrary sets as the usual affine-linear approximability—the price one has to pay is then the definite article: Instead of the derivative there can be many. We will only consider compact domains in order to have a natural norm on our space. The results are easily extended to \(\sigma \)-compact (and, in particular, closed) sets.

An \(\mathbb {R}^n\)-valued function f on a compact set \(K\subseteq \mathbb {R}^d\) is said to belong \(C^1(K,\mathbb {R}^n)\) if there exits a continuous function df on K with values in the linear maps from \(\mathbb {R}^d\) to \(\mathbb {R}^n\) such that, for all \(x \in K\),

$$\begin{aligned} \lim _{\begin{array}{c} y \rightarrow x\\ y \in K \end{array}} \frac{f(y)-f(x) - df(x) ( y-x )}{|y-x|} =0, \end{aligned}$$
(1)

where \(|\cdot |\) is the euclidean norm. For \(n=1\) we often identify \(\mathbb {R}^d\) with its dual and write \(\langle \cdot , \cdot \rangle \) for the evaluation which is then the scalar product. Questions about \(C^1(K,\mathbb {R}^n)\) easily reduce to the case \(C^1(K)=C^1(K,\mathbb {R})\).

Of course, equality (1) means that df is a continuous (Fréchet) derivative of f on K. As in the case of open domains, every \(f\in C^1(K)\) is continuous and we have the chain rule: For all (continuous) derivatives df of f on K and dg of g on f(K) the map \(x \mapsto dg(f(x))\circ df(x)\) is a (continuous) derivative of \(g\circ f\) on K.

In general, a derivative need not be unique. For this reason, a good tool to study \(C^1(K)\) is the jet space

$$\begin{aligned} \mathcal {J}^1(K)= \{ (f,df): df \text { is a continuous derivative of }f\text { on }K \} \end{aligned}$$

endowed with the norm

$$\begin{aligned} \Vert (f,df)\Vert _{\mathcal {J}^1(K)} = \Vert f\Vert _K + \Vert df \Vert _K, \end{aligned}$$

where \(\Vert \cdot \Vert _K\) is the uniform norm on K and \(|df(x)|=\sup \{|df(x)(v)|:|v|\le 1\}\). For the projection \(\pi (f,df)=f\) we have \(C^1(K)=\pi (\mathcal {J}^1(K))\), and we equip \(C^1(K)\) with the quotient norm, i.e.,

$$\begin{aligned} \Vert f \Vert _{C^1(K)} = \Vert f\Vert _K + \inf \{ \Vert df\Vert _K: df \text { is a continuous derivative of }f\text { on }K \}. \end{aligned}$$

It seems that the space \(C^1(K)\) did not get much attention in the literature. This is in sharp contrast to the “restriction space” \(C^1(\mathbb {R}^{d} | K)=\{f|_K: f\in C^1(\mathbb {R}^d)\}\). Obviously, the inclusion \(C^1(\mathbb {R}^{d} | K)\subseteq C^1(K)\) holds but it is well-known that, in general, it is strict. Simple examples are domains with inward directed cusps like

$$\begin{aligned} K=\{(x,y) \in [-1,1]^2 : |y| \ge e^{-1/x} \text { for } x > 0 \}. \end{aligned}$$

The function \(f(x,y)=e^{-1/(2x)}\) for \(x,y>0\) and \(f(x,y)=0\) elsewhere, is in \(C^1(K)\) but it is not the restriction of a \(C^1\)-function on \(\mathbb {R}^2\) because is is not Lipschitz continuous near the origin.

In a famous paper from 1934 [1], Whitney proved that \(C^1(\mathbb {R}^{d} | K)= \pi (\mathscr {E}^1(K))\) where \(\mathscr {E}^1(K)\) is the space of jets (fdf) for which the limit (1) is uniform in \(x \in K\). Moreover, \(\mathscr {E}^1(K)\) endowed with the norm

$$\begin{aligned} \Vert (f,df)\Vert _{\mathscr {E}^1(K)} = \Vert (f,df)\Vert _{\mathcal {J}^1(K)}+ \sup \left\{ \frac{|f(y)-f(x)|}{|y-x|}: x,y\in K, y \ne x\right\} \end{aligned}$$

is a Banach space. Thus, \(C^1(\mathbb {R}^{d} | K)\) equipped with the quotient norm \(\Vert \cdot \Vert _{C^1(\mathbb {R}^{d} | K)}\) inherited from \(\Vert \cdot \Vert _{\mathscr {E}^1(K)}\) is also a Banach space.

Since their introduction, Whitney jets (also of higher orders) have been widely studied, in particular in the context of extension operators [2,3,4,5]. Generalizations of them have been defined in various contexts such as Baire functions [6], holomorphic functions [7], Sobolev spaces [8, 9], so-called \(C^{m,\omega }(\mathbb {R}^d)\) spaces [10] or (generalized) Hölder spaces [11].

In this paper, we prove that \(\mathscr {E}^1(K)\) is always a dense subset of \(\mathcal {J}^1(K)\). The density of \(C^1(\mathbb {R}^{d} | K)\) in \(C^1(K)\) is then an immediate consequence. Together with a characterization of the completeness of \((C^1(K),\Vert \cdot \Vert _{C^1(K)})\), this leads to a simple geometric criterion for the equality \(C^1(K)=C^1(\mathbb {R}^{d} | K)\) as Banach spaces. In the one-dimensional case, we also give a characterization of the mere algebraic equality.

If the compact set K is topologically regular, i.e., the closure of its interior, another common way to define differentiability is the space

$$\begin{aligned} {C}^1_{{{\,\mathrm{int}\,}}}(K)= \{ f \in C(K): f|_{\mathring{K}} \in C^1(\mathring{K}) \text { and } df \text { extend continuously to } K \}, \end{aligned}$$

see for instance [12, 13]. For \(f\in {C}^1_{{{\,\mathrm{int}\,}}}(K)\) we will denote the unique continuous extension to K of the derivative again by df.

In this topologically regular situation, the derivative of a continuously differentiable function on K is uniquely determined by the function, which means that the projection \(\pi \) is injective on \(\mathcal {J}^1(K)\) and therefore \(C^1(K)\) and \(\mathcal {J}^1(K)\) as well as \(C^1(\mathbb {R}^{d} | K)\) and \(\mathscr {E}^1(K)\), respectively, can be identified.

Equipped with the norm \(\Vert f\Vert _K + \Vert df\Vert _K\), it is clear that \({C}^1_{{{\,\mathrm{int}\,}}}(K)\) is always a Banach space which contains \(C^1(K)\). Despite this nice aspect we will see by an example of Sauter [14] that \({C}^1_{{{\,\mathrm{int}\,}}}(K)\) has a dramatic drawback: Compositions of \(C^1_{{{\,\mathrm{int}\,}}}(K)\)-functions need not be differentiable.

We will present some results about equalities between \(C^1_{{{\,\mathrm{int}\,}}}(K)\), \(C^1(\mathbb {R}^{d} | K)\) and \(C^1(K)\) which are related to the so-called “Whitney conjecture” ([9, 15]).

The paper is organized as follows. In Sect. 2, we start with some more or less standard facts about rectifiable paths and integration along them to establish the fundamental theorem of calculus for \(C^1(K)\)-functions, and we present the above mentioned example of Sauter of \(C^1_{{{\,\mathrm{int}\,}}}\)-functions where this result fails. In Sect. 3 we characterize the completeness of \(C^1(K)\) by a simple geometric condition, and in Sect. 4, we prove the density of \(C^1(\mathbb {R}^{d} | K)\), which relies on very deep results of Smirnov [16]. In Sect. 5, we compare the spaces \(C^1(\mathbb {R}^{d} | K)\), \(C^1(K)\) and \(C^1_{{{\,\mathrm{int}\,}}}(K)\) and finally, we complement this with specific results for compact subsets of \(\mathbb {R}\).

2 Path Integrals

A function \(f\in C^1(K)\) need not be Lipschitz continuous because segments with endpoints in K, to which one would like to apply the mean value theorem, need not be contained in K. Instead of segments one then has to consider rectifiable paths in K, i.e., continuous functions \(\gamma :[a,b]\rightarrow K\) such that the length

$$\begin{aligned} L(\gamma ) = \sup \left\{ \sum _{j=1}^{n} |\gamma (t_j)-\gamma (t_{j-1})|: a=t_0< \cdots < t_n =b \right\} \end{aligned}$$

is finite. The function \(\ell (t)=L(\gamma |_{[a,t]})\) is then continuous: Given \(\varepsilon >0\) and a partition such that the length of the corresponding polygon is bigger than \(L(\gamma )-\varepsilon \), every interval [rs] lying between two consecutive points of the partition satisfies \(\ell (s)-\ell (r)=L(\gamma _{[r,s]})\le |\gamma (s)-\gamma (r)|+\varepsilon \). For the minimal length of the subintervals of the partition one then easily gets the required continuity estimate.

Proposition 2.1

(Mean value inequality) Let \(f \in C^1(K)\) and \(x, y \in K\). If df is a derivative of f on K and if x and y are joined by a rectifiable path \(\gamma : [a,b] \rightarrow K\), then

$$\begin{aligned} |f(y)-f(x)| \le L(\gamma ) \sup \{ |d f(z)|: z \in \gamma ([a,b]) \}. \end{aligned}$$
(2)

Proof

We essentially repeat Hörmander’s proof [17, theorem 1.1.1]. For each \(c>\sup \{ |d f(z)|: z \in \gamma ([a,b]) \}\) the set \( T=\{t\in [a,b]: |f(\gamma (t))-f(x)|\le c\ell (t)\} \) is non-empty and closed because of the continuity of \(f\circ \gamma \) and \(\ell \), hence is has a largest element \(t\in [a,b]\). If t were different from b, the differentiability of f at \(z=\gamma (t)\) gives a neighbourhood U of z such that

$$\begin{aligned} |f(z)-f(w)|\le |f(z)-f(w)-df(z)(z-w)|+|df(z)(z-w)| \le c|z-w| \end{aligned}$$

for all \(w\in U\). By the continuity of \(\gamma \) we find \(s>t\) with \(\gamma (s)\in U\) so that

$$\begin{aligned} |f(\gamma (s))-f(x)| \le |f(\gamma (s))-f(\gamma (t))|+ c\ell (t) \le c|\gamma (s)-\gamma (t)|+c\ell (t)\le c\ell (s), \end{aligned}$$

contradicting the maximality of t. \(\square \)

The mean value inequality does not use the continuity of a derivative and has the usual consequences. For example, if \(df=0\) is a derivative of f and K is rectifiably pathwise connected (a certainly self-explaining notion) then f is constant.

Our next aim is to show that a continuous derivative integrates back to the function along rectifiable paths. We first recall the relevant notions. If \(F:K\rightarrow \mathbb {R}^d\) is continuous and \(\gamma \) is a rectifiable path in K we define the path integral \(\int _\gamma F\) as the limit of Riemann-Stieltjes sums

$$\begin{aligned} \sum _{j=1}^n \langle F(\gamma (\tau _j)), \gamma (t_j)-\gamma (t_{j-1})\rangle \end{aligned}$$

where \(a=t_0<\ldots <t_n=b\) are partitions with \(\max \{t_j-t_{j-1}:1\le j\le n\}\rightarrow 0\) and \(t_{j-1 }\le \tau _j\le t_j\). The existence of the limit is seen from an appropriate Cauchy condition (or by using the better known one-dimensional case where rectifiable paths are usually called functions of bounded variation). If \(\gamma \) is even absolutely continuous, i.e., there is a Lebesgue integrable \(\dot{\gamma }:[a,b]\rightarrow \mathbb {R}^d\) with \(\gamma (\beta )-\gamma (\alpha )=\int _\alpha ^\beta \dot{\gamma }(t)dt\) for all \(\alpha \le \beta \), one gets from the uniform continuity of \(F\circ \gamma \) the familiar representation

$$\begin{aligned} \int _\gamma F=\int _a^b \langle F(\gamma (t)),\dot{\gamma }(t)\rangle dt. \end{aligned}$$

If \(\gamma \) is even continuously differentiable and \(F=df\) for a function \(f\in C^1(K)\), the integrand in the last formula is the derivative of \(f\circ \gamma \) (by the chain rule) and the fundamental theorem of calculus gives \(\int _\gamma df= f(\gamma (b))-f(\gamma (a))\). Since continuous differentiability of \(\gamma \) is a not a realistic assumption in our considerations (interesting phenomena typically occur for quite rough compact sets K), we need a more general version:

Theorem 2.2

(Fundamental theorem of calculus) For each \(f \in C^1(K)\) with a continuous derivative df and each rectifiable \(\gamma : [a,b] \rightarrow K\) we have

$$\begin{aligned} \int _\gamma df = f(\gamma (b))-f(\gamma (a)). \end{aligned}$$
(3)

Proof

Given a partition \(a=t_0<\ldots <t_n=b\) and a fixed \(j\in \{1,\ldots ,n\}\) we set \(z=\gamma (t_j)\) and apply the mean value inequality to the function

$$\begin{aligned} g(x)=f(x)-f(z)-\langle df(z),x-z\rangle \end{aligned}$$

on \(\gamma ([t_{j-1},t_j])\). Since \(dg(x)=df(x) -df(z)\) is a derivative of g, we obtain

$$\begin{aligned}&\left| f(\gamma (t_j)) - f(\gamma (t_{j-1}))-\langle df(\gamma (t_j)),\gamma (t_j)-\gamma (t_{j-1})\rangle \right| \\&\quad = |g(\gamma (t_{j-1}))-g(z)| \le L(\gamma |_{[t_{j-1},t_j]}) \\&\qquad \sup \{|df(\gamma (t))-df(\gamma (t_{j-1})|: t\in [t_{j-1},t_j]\}. \end{aligned}$$

The uniform continuity of \(df\circ \gamma \) yields that this supremum is small whenever the partition is fine enough. The theorem then follows by writing \(f(\gamma (b))-f(\gamma (a))\) as a telescoping sum and inserting these estimates together with the obvious additivity of the length. \(\square \)

Below, we will need a slightly more general version of the fundamental theorem: The formula \(\int _\gamma df= f\circ \gamma |_a^b\) holds if f and df are continuous on K and df(x) is a derivative of f at x for all but finitely many \(x\in \gamma ([a,b])\).

Indeed, if only the endpoints \(\gamma (a)\) and \(\gamma (b)\) are exceptional, this follows from a simple limiting argument, the general case is then obtained by decomposing the integral \(\int _\gamma df\) into a sum.

In the proof of Proposition 3.4, we will have to find a rectifiable path by using the Arzelá-Ascoli theorem. It is then essential to have a “tame” parametrization which we explain briefly; more details can be found, e.g., in [18]. Given a continuous \(\gamma :[a,b]\rightarrow \mathbb {R}^d\) with length \(L=L(\gamma )\) and length function \(\ell (t)=L(\gamma |_{[a,t]})\), the function \(\alpha (s)=\inf \{t\in [a,b]: \ell (t)\ge s\}\) is again increasing but not necessarily continuous, it jumps over the intervals where \(\ell \) is constant. Nevertheless, \(\tilde{\gamma }=\gamma \circ \alpha : [0,L]\rightarrow \mathbb {R}^d\) is a continuous path with \(\tilde{\gamma }([0,L])=\gamma ([a,b])\) such that all path integrals along \(\gamma \) and \(\tilde{\gamma }\) coincide and such that \(L(\tilde{\gamma }|_{[0,t]})=t\) for all \(t\in [0,L]\); in particular, \(\tilde{\gamma }\) is Lipschitz with constant 1. This path \(\tilde{\gamma }\) is called the parametrization of \(\gamma \) by arclength.

If \(\{\gamma _i:i\in I\}\) is a family of curves with equal length, it then follows that \(\{\tilde{\gamma }_i:i\in I\}\) is equicontinuous. Moreover, Rademacher’s theorem implies that \(\tilde{\gamma }\) is almost everywhere differentiable and absolutely continuous.

We have seen that the behaviour of functions \(f\in C^1(K)\) concerning compositions and the fundamental theorem together with its consequences is essentially as in the case of open domains. We will now present Sauter’s example [14] showing that this not the case for \(f\in C^1_{{{\,\mathrm{int}\,}}}(K)\).

Let C be the ternary Cantor set and U its complement in (0, 1). The open set \(\Omega \) is constructed from \(U \times (0,1)\) by removing disjoints closed balls \((B_{j})_{j \in \mathbb {N}}\) that accumulate precisely at \(C \times [0,1]\) and such that the sum of their diameters is \(<1/4\). This implies that there exist horizontal lines that do not intersect any of the balls and are thus contained in \(K=\overline{\Omega }\).

If f is the Cantor function on [0, 1], we consider the function F defined on K by \(F(x,y)=f(x)\). We have \(F \in C^1_{{{\,\mathrm{int}\,}}}(K)\) because it is continuous and \(dF=0\) on \(\Omega =\mathring{K}\), as f is locally constant on U. If now \(\gamma :[0,1]\rightarrow K\) is the obvious left-to-right arclength parametrization of one of the horizontal lines crossing K, we have

$$\begin{aligned} \int _{\gamma } dF = 0 \text { while } F(\gamma (1))-F(\gamma (0))=f(1)-f(0)=1. \end{aligned}$$

This proves \(F \notin C^1(K)\). This example shows that the fundamental theorem does not hold for \(C^1_{{{\,\mathrm{int}\,}}}\) and also reveals the catastrophe that compositions (namely \(F \circ \gamma \)) of \(C^1_{{{\,\mathrm{int}\,}}}\)-functions need not be \(C^1_{{{\,\mathrm{int}\,}}}\).

3 Completeness

We study here the completeness of \((C^1(K),\Vert \cdot \Vert _{C^1(K)})\) and \((\mathcal {J}^1(K),\Vert \cdot \Vert _{\mathcal {J}^1(K)})\). We show that, if K has infinitely many connected components, then these spaces are not complete. In contrast, if K has finitely many connected components, the completeness of both spaces is characterized by a pointwise geometric condition whose uniform version goes back to Whitney in [15]. It is interesting to note that this characterization is conjectured in [19] in the context of complex differentiability.

First we consider the case of compact sets with infinitely many connected components. This is similar to [20, Theorem 2.3].

Proposition 3.1

If K is a compact set with infinitely many connected components, then \((C^1(K),\Vert \cdot \Vert _{C^1(K)})\) is incomplete.

Proof

We can partition \(S_0=K\) into two non-empty, disjoint sets \(S_1\) and \(K_1\), both closed and open subsets of K, such that \(S_1\) has infinitely many connected components. Iterating this procedure we obtain a sequence \((K_j)_{j \in \mathbb {N}}\) of pairwise disjoint non-empty closed and open subsets of K.

We fix \(x_j \in K_j\) and, by compactness and passing to a subsequence, we can assume that \(x_{j}\) converges in K. The limit \(x_0\) cannot belong to any \(K_{j}\) because they are open and pairwise disjoint.

We consider the functions \(f_n:K\rightarrow \mathbb {R}\) defined by \(f_n(x)=|x_j-x_0|\) for \(x\in K_j\) with \(1\le j\le n\) and \(f_n(x)=0\), else. These functions are locally constant and hence \(f_n \in C^1(K)\). It is easy to check that \((f_n)_{n \in \mathbb {N}}\) is a Cauchy sequence in \((C^1(K),\Vert \cdot \Vert _{C^1(K)})\). The only possible limit is the function \(f(x)=|x_j-x_0|\) for all \(x\in K_j\) and \(j\in \mathbb {N}\) and \(f(x)=0\) otherwise. But, for all \(j \in \mathbb {N}\), we have

$$\begin{aligned} \frac{|f(x_{j})-f(x_0)|}{|x_{j}-x_0|}=1, \end{aligned}$$

and since \(df_n=0\) this shows that f cannot be the limit in \(C^1(K)\). \(\square \)

A set \(K \subseteq \mathbb {R}^d\) is called Whitney regular if there exists \(C>0\) such that any two points \(x,y \in K\) can be joined by a rectifiable path in K of length bounded by \(C |x-y|\); sometimes this condition is called quasiconvexity, e.g., in the book [21].

We say that K is pointwise Whitney regular if, for every \(x \in K\), there are a neighbourhood \(V_x\) of x and \(C_x>0\) such that any \(y \in V_x\) is joined to x by a rectifiable path in K of length bounded by \(C_x |x-y|\).

The inward cusp mentioned in the introduction distinguishes these two notions. If K is geodesically bounded (i.e., any two points can be joined by a curve of length bounded by a fixed constant) one can take \(V_x=K\) in the definition so that the crucial difference is then the non-uniformity of the constants \(C_x\).

Proposition 3.2

If K is a pointwise Whitney regular compact set, then the space \((\mathcal {J}^1(K),\Vert \cdot \Vert _{\mathcal {J}^1(K)})\) is complete.

Proof

For a Cauchy sequence \(((f_j,df_j))_{j \in \mathbb {N}}\) in \(\mathcal {J}^1(K)\) we get from the completeness of C(K) uniform limits f and df and we only have to show that df is a derivative of f.

Given \(x \in K\) and a path \(\gamma \) from x to y of length \(L(\gamma ) \le C_x |x-y|\), the formula in the fundamental theorem of calculus immediately extends from \(f_j\) and \(df_j\) to the limits and thus gives

$$\begin{aligned} f(y)-f(x)-\langle df(x),y-x \rangle = \int _\gamma (df-df(x)). \end{aligned}$$

The continuity of df and the bound on \(L(\gamma )\) then easily imply the desired differentiability. \(\square \)

To obtain the converse of this simple result we first apply the uniform boundedness principle to show that the completeness of \((C^1(K),\Vert \cdot \Vert _{C^1(K)})\) is equivalent to some bounds for the difference quotient of a function \(f \in C^1(K)\). This is the same as in the case of complex differentiability [20, 22].

Proposition 3.3

The following assertions are equivalent:

  1. (a)

    The space \((\mathcal {J}^1(K),\Vert \cdot \Vert _{\mathcal {J}^1(K)})\) is a Banach space.

  2. (b)

    The space \((C^1(K),\Vert \cdot \Vert _{C^1(K)})\) is a Banach space.

  3. (c)

    For every \(x \in K\), there exists \(C_x>0\) such that for all \(f \in C^1(K)\) and \(y\in K{\setminus } \{x\}\)

    $$\begin{aligned} \frac{|f(y)-f(x)|}{|y-x|} \le C_x \Vert f \Vert _{C^1(K)}. \end{aligned}$$
    (4)

Proof

That (a) implies (b) is a standard fact from Banach space theory. Let us show that the second assertion implies the third. For fixed \(x \in K\) and each \(y \in K{\setminus }\{x\}\) we define a linear and continuous functional on \(C^1(K)\) by

$$\begin{aligned} \Phi _y(f)=\frac{f(y)-f(x)}{|y-x|}. \end{aligned}$$

For fixed \(f \in C^1(K)\), we get a bound for \(\sup _{y \in K {\setminus } \{x\}} |\Phi _y(f)|\) because of the differentiability at x.

The Banach-Steinhaus theorem thus gives

$$\begin{aligned} C_x=\sup \{|\Phi _y(f)|: \Vert f\Vert _{C^1(K)} \le 1, y\in K{\setminus }\{x\} \} <\infty . \end{aligned}$$

Now we assume that inequality (4) holds and show that \((\mathcal {J}^1(K),\Vert \cdot \Vert _{\mathcal {J}^1(K)})\) is complete. For a Cauchy sequence \(((f_j,df_j))_{j \in \mathbb {N}}\) in \(\mathcal {J}^1(K)\) we have uniform limits f and df. In particular, for all \(\varepsilon >0\), \(x \in K\), and \(p<q\) big enough, we have

$$\begin{aligned} \Vert f_p - f_q \Vert _{C^1(K)} \le \Vert (f_p,df_p) - (f_q,df_q) \Vert _{\mathcal {J}^1(K)}< \frac{\varepsilon }{4 C_x} \quad \text {and} \quad \Vert df_p - df \Vert _K < \frac{\varepsilon }{4}. \end{aligned}$$

Now, there exists \(\delta >0\) such that, for all \(y \in B(x,\delta ) {\setminus } \{x \}\),

$$\begin{aligned} B=\frac{|f_p(y)-f_p(x)-\langle df_p(x), y-x \rangle |}{|y-x|} < \frac{\varepsilon }{4}. \end{aligned}$$

Finally, for all such y, if q is large enough,

$$\begin{aligned} A = \frac{|(f(y)-f_q(y))-(f(x)-f_q(x))|}{|y-x|} < \frac{\varepsilon }{4}, \end{aligned}$$

and an application of inequality (4) to \(f_p-f_q\) then yields

$$\begin{aligned}&\frac{|f(y)-f(x)-\langle df(x),y-x \rangle |}{|x-y|} \\&\quad \le A + \frac{|(f_p(y)-f_q(y))-(f_p(x)-f_q(x))|}{|y-x|} + B + |df_p(x)-df(x) | < \varepsilon , \end{aligned}$$

which shows that df is a derivative of f on K. \(\square \)

Next we show that, for connected sets K, inequality (4) implies pointwise regularity. This is a simple adaptation of a result in [17, theorem 2.3.9]; we repeat the proof for the sake of completeness.

Proposition 3.4

Let K be a compact connected set. If, for any \(x \in K\), there exists \(C_x>0\) such that for all \(f \in C^1(K)\) and \(y\in K{\setminus } \{x\}\) we have

$$\begin{aligned} \frac{|f(y)-f(x)|}{|y-x|} \le C_x \Vert f \Vert _{C^1(K)}, \end{aligned}$$
(5)

then K is pointwise Whitney regular.

Proof

For any \(\varepsilon >0\),

$$\begin{aligned} K_{\varepsilon } = \{x \in \mathbb {R}^d \, : \, \inf _{y \in K } |x-y| < \varepsilon \} \end{aligned}$$

is an open connected neighbourhood of K. Let us fix \(x \in K\) and define the function \(d_\varepsilon \) on \(K_{2\varepsilon }\) by

$$\begin{aligned} d_\varepsilon (y) = \inf \{L(\gamma ): \gamma \text { rectifiable path from }x\text { to }y\text { in }K_{2\varepsilon } \}. \end{aligned}$$

Then, for fixed \(y_0 \in K\), we set \(u_\varepsilon (y) = \min \{d_\varepsilon (y), d_\varepsilon (y_0) \}\). If y and \(y'\) are close enough in \(K_{2\varepsilon }\), we have

$$\begin{aligned} |u_\varepsilon (y) - u_\varepsilon (y')| \le |y-y'|, \end{aligned}$$
(6)

as any rectifiable path from x to y can be prolonged by the segment between y and \(y'\) to a rectifiable path from x to \(y'\).

If \(\phi \) is a positive smooth function with support in \(B(0,\varepsilon )\) and integral 1, the convolution \(u_\varepsilon *\phi \), defined in \(K_\varepsilon \), is a smooth function for which \(|d(u_\varepsilon *\phi )| \le 1\) on K, because of inequality (6). Then, from (5), we have

$$\begin{aligned} |(u_\varepsilon *\phi )(x)-(u_\varepsilon *\phi )(y_0)| \le C_x (d_\varepsilon (y_0) + 1) |x-y_0| \end{aligned}$$

which gives us, passing to the limit \({{\,\mathrm{supp}\,}}(\phi ) \rightarrow \{0 \}\),

$$\begin{aligned} d_\varepsilon (y_0) \le C_x (d_\varepsilon (y_0) + 1) |x-y_0|. \end{aligned}$$

For \(y_0 \in B(x,\frac{1}{2 C_x})\cap K\), this implies \(d_\varepsilon (y_0) \le 1\) and thus \(d_\varepsilon (y_0)\le 2C_x|x-y_0|\). Hence, there exists a rectifiable path from x to \(y_0\) in \(K_{2\varepsilon }\) of length bounded by \(2 C_x |x-y_0| + \varepsilon \). Using the parametrization by arc length gives an equicontinuous family of paths and the conclusion follows from the Arzelá -Ascoli theorem.

\(\square \)

Remark 3.5

If the constant \(C_x\) in previous proposition is uniform with respect to \(x \in K\), then inequality (6) is equivalent to the Whitney regularity of K, as stated in Hörmander’s book.

Collecting all the results of this section, we have the following characterization of the completeness of \((C^1(K),\Vert \cdot \Vert _{C^1(K)} )\).

Theorem 3.6

\((C^1(K),\Vert \cdot \Vert _{C^1(K)} )\) is complete if and only if K has finitely many components which are pointwise Whitney regular.

Remark 3.7

In this pointwise Whitney regular situation, the jet space \(\mathcal {J}^1(K)\) can be described as a space of continuous “circulation free vector fields” F on K, i.e., vector fields F for which \(\int _\gamma F=0\) for all closed rectifiable paths \(\gamma \) in K. More precisely, if \((f,df) \in \mathcal {J}^1(K)\), the fundamental theorem of calculus implies that df is circulation free, and if F is circulation free and continuous we can define, for some fixed \(x_0 \in K\), for all \(x \in K\)

$$\begin{aligned} f(x) = \int _\gamma F, \end{aligned}$$

where \(\gamma \) is a path in K from \(x_0\) to x. This definition makes sense as F is circulation free and F is a continuous derivative of f on K, by a similar argument as in the proof of Proposition 3.2.

4 Density of Restrictions

In this section we will show that the space \(C^1(\mathbb {R}^{d} | K)\) of restrictions of continuously differentiable functions on \(\mathbb {R}^d\) to K is always dense in \(C^1(K)\). As \(\mathscr {D}(\mathbb {R}^d)\), the space of \(C^\infty \)-functions with compact support, is dense in \(C^1 (\mathbb {R}^d)\), this is the same as the density of test functions restricted to K in \(C^1(K)\) and again, it is advantageous to consider this question on the level of jets, that is, we will show that

$$\begin{aligned} i: \mathscr {D}(\mathbb {R}^d) \rightarrow \mathcal {J}^1(K), \, \varphi \mapsto (\varphi |_{K} , d\varphi |_{K}) \end{aligned}$$

has dense range.

For general K, the standard approximation procedures like convolution with smooth bump functions do not apply easily, and we will use the Hahn–Banach theorem instead.

A continuous linear functional \(\Phi \) on \(\mathcal {J}^1(K)\subseteq C(K)^{d+1}\) is, by the Hahn–Banach and Riesz’s representation theorem, given by signed measures \(\mu , \mu _1,\ldots , \mu _d\) on K via

$$\begin{aligned} \Phi (f,df) = \int f d\mu + \sum _{j=1}^{d} \int d_j f d\mu _j, \end{aligned}$$

where \(d_jf\) are the components of df. If \(\Phi \) vanishes on the image of i we have, for all \(\varphi \in \mathscr {D}(\mathbb {R}^d)\),

$$\begin{aligned} \int \varphi d\mu + \sum _{j=1}^{d} \int \partial _j \varphi d\mu _j =0. \end{aligned}$$

For the distributional derivatives of the measures this means that

$$\begin{aligned} \mu = \sum _{j=1}^{d} \partial _j \mu _j = {{\,\mathrm{div}\,}}(T) \end{aligned}$$

where \(T = (\mu _1,\ldots , \mu _d)\) is a vector field of measures or a charge.

Fortunately, such charges were thoroughly investigated by Smirnov in [16]. Roughly speaking, he proved a kind of Choquet representation of charges in terms of very simple ones induced by Lipschitz paths in K. If \(\gamma : [a,b] \rightarrow K\) is Lipschitz with a.e. derivative \(\dot{\gamma }=(\dot{\gamma }_1,\ldots ,\dot{\gamma }_d)\) and \(F=(F_1,\ldots ,F_d)\) is a continuous vector field, we have, as noted in Sect. 2,

$$\begin{aligned} \int _\gamma F = \int _a^b \langle F(\gamma (t)), \dot{\gamma }(t)\rangle dt = \sum _{j=1}^{d} \int _a^b F_j (\gamma (t)) \dot{\gamma }_j(t) dt. \end{aligned}$$

In order to see this as the action \(\langle T,F\rangle =\sum \limits _{j=1}^d \int F_jd\mu _j\) of a charge \(T=(\mu _1,\ldots ,\mu _d)\), we denote by \(\mu _j\) the image (or push-forward) under \(\gamma \) of the measure with density \(\dot{\gamma }_j\) on [ab] so that \(\int F_j(\gamma (t))\dot{\gamma }_j(t)dt=\int F_jd\mu _j\). For the charge \(T_\gamma =(\mu _1,\ldots ,\mu _d)\) we then have

$$\begin{aligned} \langle T_\gamma ,F\rangle = \int _\gamma F. \end{aligned}$$

The fundamental theorem of calculus for \(\varphi \in \mathscr {D}(\mathbb {R}^d)\) with derivative \(d\varphi \) then gives

$$\begin{aligned} {{\,\mathrm{div}\,}}(T_\gamma ) (\varphi ) = - \int _\gamma d\varphi = \varphi (\gamma (a))-\varphi (\gamma (b)) = (\delta _{\gamma (a)}-\delta _{\gamma (b)})(\varphi ), \text { that is} \end{aligned}$$
$$\begin{aligned} {{\,\mathrm{div}\,}}(T_\gamma )= \delta _{b(\gamma )}-\delta _{e(\gamma )} \end{aligned}$$

where \(b(\gamma )\) and \(e(\gamma )\) denote the beginning and the end of \(\gamma \) (the change of signs comes from the minus sign in the definition of distributional derivatives).

To formulate Smirnov’s results we write \(\Gamma \) for the set of all Lipschitz paths in \(\mathbb {R}^d\). Moreover, for a charge T we denote by

$$\begin{aligned} \Vert T\Vert (E) = \sup \left\{ \sum _{j \in \mathbb {N}} |T(E_j)|: (E_j)_{j\in \mathbb {N}} \text { is a partition of }E \right\} \end{aligned}$$

the corresponding variation measure.

Given a set \(\mathcal {S}\) of charges, a charge T is said to decompose into elements of \(\mathcal {S}\) if there is a finite, positive measure on \(\nu \) on \(\mathcal {S}\) (endowed with the Borel \(\sigma \)-algebra with respect to the weak topology induced by the evaluation \(\langle (\mu _1,\ldots ,\mu _d), (\varphi _1,\ldots ,\varphi _d) \rangle = \sum _{j=1}^d \int \varphi _j \, d\mu _j, \, \varphi _j \in \mathscr {D}(\mathbb {R}^d)\)) such that

$$\begin{aligned} T = \int _\mathcal {S} R \ d\nu (R) \text { and } \Vert T\Vert = \int _\mathcal {S} \Vert R \Vert d\nu (R), \end{aligned}$$

where these integrals are meant in the weak sense, i.e., \(\langle T, \varphi \rangle = \int _\mathcal {S} \langle R, \varphi \rangle \, d\nu (R)\) for all \(\varphi \in (\mathscr {D}(\mathbb {R}^d))^d\). By density and the continuity of charges with respect to the uniform norm, this extends to all \(\varphi \in (C_c (\mathbb {R}^d))^d\), where \(C_c (\mathbb {R}^d)\) is the space of continuous functions with compact support.

We can now state a consequence of Smirnov’s results (theorem C of [16] is somewhat more precise than we need).

Theorem 4.1

Every charge T with compact support such that \({{\,\mathrm{div}\,}}(T)\) is a signed measure can be decomposed into elements of \(\Gamma \), i.e., there is a positive finite measure \(\nu \) on \(\Gamma \) such that

$$\begin{aligned} T=\int _\Gamma T_\gamma d\nu (\gamma ) \text { and } \Vert T\Vert =\int _\Gamma \Vert T_\gamma \Vert d\nu (\gamma ). \end{aligned}$$

The decomposition of the corresponding variation measures has the important consequence that the supports of \(\nu \)-almost all \(T_\gamma \) are contained in the support of T (where the supports are meant as the supports of signed measures which coincide with the supports of the corresponding distributions). After removing a set of \(\nu \)-measure 0 we can thus assume that all paths involved in the decomposition of T have values in the support of T. Using the definition of the distributional derivative we also obtain a decomposition of the divergences:

$$\begin{aligned} {{\,\mathrm{div}\,}}(T)=\int _\Gamma {{\,\mathrm{div}\,}}(T_\gamma ) d\nu (\gamma )= \int _\Gamma \delta _{b(\gamma )} -\delta _{e(\gamma )} d\nu (\gamma ). \end{aligned}$$

We are now prepared to state and prove the main result of this section.

Theorem 4.2

For each compact set K, the space \(C^1(\mathbb {R}^d|K)\) is dense in \(C^1(K)\).

Proof

We will show that \(i:\mathscr {D}(\mathbb {R}^d)\rightarrow \mathcal {J}^1(K)\), \(\varphi \mapsto (\varphi |_K,d\varphi |_K)\) has dense range, the conclusion then follows by projecting onto the first components.

Let us consider \(\Phi \in (C(K)^{d+1})'\) such that \(\Phi \) vanishes on the range of i. By the Hahn-Banach theorem it is enough to show that \(\Phi |_{\mathcal {J}^1(K)}=0\).

As explained at the beginning of this section we get signed measures \(\mu \) and \(\mu _j\) on K with

$$\begin{aligned} \Phi ((f,f_1,\cdots ,f_d))=\int f d\mu + \int f_1 d\mu _1 + \cdots + \int f_d d\mu _d \end{aligned}$$

for all \( (f,f_1,\cdots ,f_d) \in C(K)^{d+1}\), and \(T=(\mu _1 , \cdots , \mu _d)\) satisfies \({{\,\mathrm{div}\,}}(T) =\mu \). We can thus apply theorem 4.1 and get a measure \(\nu \) and \(\mathcal {S} \subseteq \Gamma \) such that all paths in \(\mathcal {S}\) have values in K and

$$\begin{aligned} T = \int _{\mathcal {S}} T_\gamma d\nu (\gamma ). \end{aligned}$$

For \( (f,df)=(f,d_1 f,\ldots ,d_d f) \in \mathcal {J}^1(K)\) we extend all components to \(C_c(\mathbb {R}^d)\) by Tietze’s theorem and obtain from the fundamental theorem of calculus for \(C^1(K)\)-functions

$$\begin{aligned}&\int d_1 f d\mu _1 + \cdots + \int d_df d\mu _d = \langle T,df\rangle = \int _\mathcal {S} \langle T_\gamma ,df\rangle d\nu (\gamma ) \\&\quad = \int _\mathcal {S} \delta _{e(\gamma )}(f)-\delta _{b(\gamma )}(f) d\nu (\gamma ) = - {{\,\mathrm{div}\,}}(T) (f) =-\int f d\mu , \end{aligned}$$

which means that \(\Phi |_{\mathcal {J}^1(K)}=0\). \(\square \)

The use of the Hahn-Banach theorem has the disadvantage of not giving any concrete approximations. Let us therefore very briefly mention two situations where approximations can be described explicitly.

A natural idea is to glue the local approximations given by the definition of differentiability together with a partition of unity. We decompose \(\mathbb {R}^d\) into d-dimensional squares \(Q_j\), choose points \(x_j \in K \cap Q_j\) and a partition of unity \((\varphi _j)_j\) subordinated to slightly bigger squares with a fixed number of overlaps and bounds on the derivatives \(|\partial _k \varphi _j| \le C \text {vol}(Q_j)^{-1}\) as, e.g., in [17, Thm. 1.4.6]. Then one expects

$$\begin{aligned} h(x)= \sum _j \varphi _{j}(x) \left( f(x_j)+\langle df(x_j),x-x_j \rangle \right) \end{aligned}$$

to be an approximation in \(C^1(K)\) of a given f.

However, to estimate \(\Vert df-dh\Vert _K\) by using theorem 2.2 requires enough curves in K with uniform bounds on the length, i.e., that K is Whitney regular.

An even simpler approximation works for compact sets which are (locally) starlike or, in the terminology of Feinstein, Lande and O’Farrell [23] “locally radially self-absorbing”. In the simplest case, we have \(K \subseteq r \overset{\circ }{K}\) for every \(r>1\). Then given \(f \in C^1(K)\) one gets an approximation \(h(x)=f(\frac{1}{r}x)\) on \(r \overset{\circ }{K}\) for r close to 1 which one can multiply with a cut-off function which is 1 near K to get an approximation by functions in \(C^1(\mathbb {R}^d)\). This “blow up trick” can be localized with the aid of a partition of unity.

5 Comparison

In this section, we compare the spaces \(C^1(\mathbb {R}^{d} | K)\), \(C^1(K)\) and \(C^1_{{{\,\mathrm{int}\,}}}(K)\).

Theorem 5.1

\(C^1(K)=C^1(\mathbb {R}^{d} | K)\) with equivalent norms if and only if K has only finitely many components which are all Whitney regular.

Proof

Assuming the stated isomorphism of normed spaces we get that \(C^1(K)\) is complete and Proposition 3.1 implies that K has only finitely many components. Moreover, the equivalence of norms implies \(\frac{|f(y)-f(x)|}{|y-x|} \le C \Vert f\Vert _{C^1(K)}\) for some constant so that Remark 3.5 implies that each component is Whitney regular.

For the other implication we first note that the global Whitney condition for each of the finitely many components implies, by the mean value inequality, the equivalence of the norms \(\Vert \cdot \Vert _{C^1(\mathbb {R}^{d} | K)}\) and \(\Vert \cdot \Vert _{C^1(K)}\) on \(C^1(\mathbb {R}^{d} | K)\). This is thus a complete and hence closed subspace of \(C^1(K)\) and, on the other hand, it is dense by Theorem 4.2. \(\square \)

If we assume a priori the completeness of \(C^1(K)\), i.e., K has finitely many components which are pointwise Whitney regular, then the algebraic equality \(C^1(K)=C^1(\mathbb {R}^{d} | K)\) already implies the equivalence of norms by the open mapping theorem. However, in the next chapter we will see that \(K=\{0\}\cup \{2^{-n}: n\in \mathbb {N}\}\) satisfies \(C^1(K)=C^1(\mathbb {R}|K)\) although \(C^1(K)\) is incomplete. This means that the algebraic equality, in general, does not imply the equivalence of norms. Except for the one-dimensional case, we do not know a characterization of the algebraic equality \(C^1(K)=C^1(\mathbb {R}^{d} | K)\). Nevertheless, we would like to remark that this property has very poor stability properties. The example of the inward directed cusp mentioned in the introduction is the union of two convex sets whose intersection is an interval (sadly, the two halves of a broken heart behave better than the intact heart). More surprising is perhaps the following example showing that the property \(C^1(K)=C^1(\mathbb {R}^{d} | K)\) is not stable with respect to cartesian products.

Example 5.2

For \(M=\{0\}\cup \{2^{-n}: n\in \mathbb {N}\}\) and \(K=M\times [0,1]\) we have \(C^1(K)\ne C^1(\mathbb {R}^{2} | K)\).

Proof

We construct a function \(f\in C^1(K)\) which is equal to 0 everywhere except for some tiny bumps on the segments \(S_n=\{2^{-n}\}\times [0,1]\). More precisely, we fix \(\varphi \in C^\infty (\mathbb {R})\) with support in \([-1,1]\) which is bounded in absolute value by 1, and satisfies \(\varphi (0)=1\). For \((x,y)\in S_n\) we then set \(f(x,y)= n^{-3} \varphi ( n^2(y-1/n))\). It is easy to check that f is differentiable on K (the only non-obvious point is (0, 0) where the derivative is 0), and that one can choose a continuous derivative (because the second partial derivatives on \(S_n\) are bounded by c/n where c is a bound for the derivative of \(\varphi \)). Hence \(f\in C^1(K)\) but \(f\notin C^1(\mathbb {R}^{2} | K)\) because f is not Lipschitz continuous as \(f(2^{-n},1/n) - f(2^{-n+1},1/n))= n^{-3}\) which is much bigger than the distance between the arguments. \(\square \)

Let us consider now a topologically regular compact set \(K \subseteq \mathbb {R}^d\). We can formulate the main theorem of [15] in this context as follows.

Theorem 5.3

Let K be a topologically regular compact set. If \(\mathring{K}\) is Whitney regular, then \(C^1_{{{\,\mathrm{int}\,}}}(K)=C^1(\mathbb {R}^{d} | K)\).

In 5.5 we prove that the reverse implication doesn’t hold. This should be compared with a theorem of [9] about Sobolev regularity: For an open, connected, and finitely connected set \(\Omega \subseteq \mathbb {R}^2\) every element of \(W^k_\infty (\Omega )=\{f\in C^{k-1}(\Omega ): \partial ^\alpha f \in L_\infty (\Omega ) \) for all \(|\alpha |=k\}\) is the restriction of a function in \(W^k_\infty (\mathbb {R}^2)\) if and only if \(\Omega \) is Whitney regular. As a preparation, we establish the following proposition.

Proposition 5.4

Let K be a topologically regular compact set and assume that, for all \(x \in \partial K\), there exist \(C_x >0\) and a neighbourhood \(V_x\) of x in K such that each \(y \in V_x\) can be joined from x by a rectifiable path in \(\mathring{K}\cup \{x,y\}\) of length bounded by \(C_x |x-y|\). Then \(C^1_{{{\,\mathrm{int}\,}}}(K)=C^1(K)\).

Proof

Let us take \(f \in C^1_{{{\,\mathrm{int}\,}}}(K)\). In order to prove that \(f \in C^1(K)\), we just have to show the differentiability at \(x \in \partial K\). For all \(y \in V_x\) we get from the remark after the fundamental Theorem 2.2

$$\begin{aligned} f(y)-f(x)-\langle df(x),y-x \rangle = \int _\gamma (df-df(x)), \end{aligned}$$

where \(\gamma \) is as stated in the assumptions. This is enough to get the differentiability at x, as we did previously in Proposition 3.2. \(\square \)

We now construct a topologically regular compact connected set whose interior is not Whitney regular, but where equality \(C^1_{{{\,\mathrm{int}\,}}}(K)=C^1(\mathbb {R}^{d} | K)\) holds.

Example 5.5

Let \(\Omega \) be the open unit disk in \(\mathbb {R}^2\) from which we remove, as in Sauter’s example, sufficiently tiny disjoints balls which accumulate precisely at \(S=\{0\} \times [-\frac{1}{2},\frac{1}{2}]\). Then \(K=\overline{\Omega }\) is connected, topologically regular and Whitney regular (by the same argument as explained below). In particular, from Theorem 5.1, we know that \(C^1(\mathbb {R}^2 | K)= C^1(K)\).

Of course, \(\mathring{K}\) is not Whitney regular, because S is not contained in \(\mathring{K}\), but the assumptions of proposition 5.4 are satisfied and hence \(C^1(K)=C^1_{{{\,\mathrm{int}\,}}}(K)\): Indeed, a boundary point x of K is either a boundary point of the unit disc or of one of the tiny removed discs in which cases the condition is clear, or x is on the segment S. If then y is a point of \(\mathring{K}\) not lying on the \(\{0\}\times [-1,1]\), we consider the line from y to x (which meets S only at the endpoint) and, whenever this line intersects one of the removed discs, we replace this intersection by a path through \(\mathring{K}\) which is parallel to the boundary of the little disc. The total length increase of this new path is by a factor \(\pi \). Finally, if \(z\in K\) is arbitrary, we can use the preceding argument to connect z by a very short path to some y as considered before which we then connect to x.

To give a partial converse of Whitney’s Theorem 5.3 we state the following consequence of 3.6.

Proposition 5.6

Let K be a topologically regular compact set. If \(C^1_{{{\,\mathrm{int}\,}}}(K)=C^1(K)\) (in particular, if \(C^1_{{{\,\mathrm{int}\,}}}(K)=C^1(\mathbb {R}^{d} | K)\) holds), then K has only finitely many connected components which are all pointwise Whitney regular.

Proof

If \(C^1_{{{\,\mathrm{int}\,}}}(K)=C^1(K)\), then \((C^1(K),\Vert \cdot \Vert _{C^1(K)})\) is complete and hence theorem 3.6 implies the stated properties of K. \(\square \)

6 The One-dimensional Case

In this last section we completely characterize the equality between the three spaces of \(C^1\)-functions for compact subsets of \(\mathbb {R}\). Of course, all three spaces coincide for topologically regular compact sets with only finitely many components, and otherwise \(C^1(K)\) is incomplete by Proposition 3.1 and thus different from \(C^1_{{{\,\mathrm{int}\,}}}(K)\). The remaining question of when \(C^1(K)={C}^1(\mathbb {R}| K)\) holds algebraically (the equality as Banach spaces with equivalent norms is characterized in theorem 5.1) will depend on the behaviour of the bounded connected components of \(\mathbb {R}{\setminus } K\) which we call gaps of K. These are thus maximal bounded open intervals G in the complement, and we denote their length by \(\ell (G)\).

The simple idea is that small gaps are dangerous for the Lipschitz continuity on K which is a necessary condition for \(C^1\)-extendability. In fact, we will show that \(C^1(K)\ne {C}^1(\mathbb {R}| K)\) whenever there are \(\xi \in K\) and nearby gaps of K of length much smaller than the distance of the gap to \(\xi \). To be precise, we define, for positive \(\varepsilon \),

$$\begin{aligned} \sigma _\varepsilon (\xi )=\sup \left\{ \frac{\sup \{|y-\xi |: y\in G\}}{\ell (G)}: G\subseteq (\xi -\varepsilon ,\xi +\varepsilon ) \text { is a gap of }K\right\} , \end{aligned}$$

where \(\sup \emptyset =0\). Of course, these \([0,\infty ]\)-valued functions are increasing with respect to \(\varepsilon \) and thus we can define the gap-structure function

$$\begin{aligned} \sigma (\xi )=\lim _{\varepsilon \rightarrow 0} \sigma _\varepsilon (\xi ). \end{aligned}$$

Theorem 6.1

For a compact set \(K \subseteq \mathbb {R}\) we have \(C^1(K)={C}^1(\mathbb {R}| K)\) if and only if \(\sigma (\xi ) < \infty \) for all \(\xi \in K\).

Before giving the proof let us discuss some examples. The Cantor set K satisfies \(\sigma (\xi )=\infty \) for all \(\xi \in K\) so that \(C^1(K)\ne C^1(\mathbb {R}|K)\).

Other simple examples are sets of the form \(K=\{0\}\cup \{x_n:n\in \mathbb {N}\}\) for decreasing sequences \(x_n\rightarrow 0\). Then \(\sigma (x_n)=0\) for all \(n\in \mathbb {N}\) and only the behaviour of \(\sigma (0)\) depends on the sequence. Since the gaps of K are \((x_{n+1},x_n)\) we get \(\sigma (0)=\limsup \frac{x_n}{x_n-x_{n+1}}\). This is finite for fast sequences like \(x_n=a^{-n}\) with \(a>1\) but infinite for slower sequences like \(x_n=n^{-p}\) for \(p>0\).

This class of examples can be easily modified to topologically regular sets of the form \(K=\{0\}\cup \bigcup _{n\in \mathbb {N}} [x_n,x_n+r_n]\). For \(r_n=e^{-2n}\) we get \(\sigma (0)<\infty \), e.g., for \(x_n=e^{-n}\) and \(\sigma (0)=\infty \) for \(x_n=1/n\).

Proof

We will use Whitney’s [1] characterization that \(f\in {C}^1(\mathbb {R}| K)\) if and only if, for all non-isolated \(\xi \in K\),

$$\begin{aligned} \lim _{x,y\rightarrow \xi } \frac{f(x)-f(y)}{x-y} =f'(\xi ). \end{aligned}$$

Let us first assume \(\sigma (\xi )=\infty \) for some \(\xi \in K\). There is thus a sequence of gaps \(G_n=(a_n,b_n)\subseteq (\xi -1/n,\xi + 1/n)\) with \(\sup \{|y-\xi |: y\in G_n\}/|a_n-b_n| >2n\). Passing to a subsequence, we may assume that all these gaps are on the same side of \(\xi \), say \(\xi< a_n <b_n\), so that \(b_n-\xi > 2n (b_n-a_n)\).

Moreover, again by passing to a subsequence and using \(\sigma _\varepsilon (\xi )=\infty \) for \(\varepsilon =(b_n-a_n)/2\), we can reach \(b_{n+1}<a_n\) and that the midpoints \(y_n=(a_n+b_n)/2\) of the gaps satisfy

$$\begin{aligned} \frac{y_n-y_{n+1}}{b_n-a_n} \ge n. \end{aligned}$$

We now define \(f: K\rightarrow \mathbb {R}\) by \(f(x)=(y_n-\xi )/n\) for \(x\in K\cap (y_n,y_{n-1})\) (with \(y_0=\infty \)) and \(f(x)=0\) for \(x\le \xi \). Since the jumps of f are outside K it is clear that f is differentiable at all points \(x\in K{\setminus } \{\xi \}\) with \(f'(x)=0\). To show the differentiability at \(\xi \) with \(f'(\xi )=0\) we calculate for \(x\in K\cap (y_n,y_{n-1})\)

$$\begin{aligned} \left| \frac{f(x)-f(\xi )}{x-\xi }\right| = \left| \frac{(y_n-\xi )/n}{x-\xi }\right| \le \left| \frac{(y_n-\xi )/n}{y_n-\xi }\right| \le \frac{1}{n}. \end{aligned}$$

Thus, \(f\in C^1(K)\) but \(f\notin {C}^1(\mathbb {R}| K)\) because

$$\begin{aligned} \frac{f(b_n)-f(a_n)}{b_n-a_n}=\frac{(y_n-\xi )/n -(y_{n+1}-\xi )/(n+1)}{b_n-a_n} \ge \frac{(y_n -y_{n+1})/n}{b_n-a_n} \ge 1. \end{aligned}$$

Let us now assume \(\sigma (\xi )<\infty \) for all \(\xi \in K\). To prove that every \(f\in C^1(K)\) belongs to \({C}^1(\mathbb {R}| K)\), we first show that we can assume \(f'=0\). Indeed, we extend \(f':K\rightarrow \mathbb {R}\) to a continuous function \(\varphi :\mathbb {R}\rightarrow \mathbb {R}\) and consider \(g(x)=f(x)-\int _0^x \varphi (t) dt\). Then \(g\in C^1(K)\) satisfies \(g'=0\) and \(g\in {C}^1(\mathbb {R}| K)\) implies \(f\in {C}^1(\mathbb {R}| K)\).

Let us thus fix \(f\in C^1(K)\) with \(f'=0\). We have to show Whitney’s condition stated above at any non-isolated point \(\xi \) which, for notational convenience, we may assume to be \(\xi =0\). We fix \(c>\max \{\sigma (0),1\}\) and \(\varepsilon \in (0,1)\). There is thus \(\delta >0\) such that, because of the differentiability at \(\xi =0\) with \(f'(0)=0\), we have

$$\begin{aligned} \left| \frac{f(x)-f(0)}{x-0}\right| <\frac{\varepsilon }{2c} \end{aligned}$$
(7)

for all \(x\in K\) with \(|x|<\delta \) and, because of \(\sigma _\delta (\xi )<c\) for small enough \(\delta \),

$$\begin{aligned} \sup \{ |y|: y\in G\} \le c \ell (G) \end{aligned}$$

for all gaps \(G\subseteq (-\delta ,\delta )\). For \(x,y\in K\cap (-\delta ,\delta )\) we will show

$$\begin{aligned} \left| \frac{f(x)-f(y)}{x-y}\right| \le \varepsilon . \end{aligned}$$

If xy are in the same component of K this quotient is 0 because f is locally constant. Moreover, if xy are on different sides of 0, the quotient is bounded by \(\varepsilon \) because of (7) and \(c\ge 1\). It remains to consider the case \(0<x<y\). Then there is a gap G between x and y and, since f is locally constant, we may decrease y so that \(y\in \partial K\) without changing f(y) which thus increases the difference quotient we have to estimate. This implies that y is the endpoint of gap \(G=(a,y)\) with \(a\ge x\) which implies

$$\begin{aligned} |y-x|\ge |y-a| =\ell (G) \ge y/c \ge x/c. \end{aligned}$$

Therefore,

$$\begin{aligned} \left| \frac{f(x)-f(y)}{x-y}\right|&\le \left| \frac{f(x)-f(0)}{x-y}\right| +\left| \frac{f(y)-f(0)}{x-y}\right| \\&\le c\left| \frac{f(x)-f(0)}{x-0}\right| +c\left| \frac{f(y)-f(0)}{y-0}\right| \le \varepsilon . \end{aligned}$$

\(\square \)