1 Introduction

In this paper, we focus on the characterisation of Sobolev functions in metric spaces using integrated differential quotients. Our principal motivation is the paper [5], in which the authors prove the following characterisation of Sobolev functions on open subsets of \({\mathbb {R}}^N\).

Theorem 1.1

(Bourgain, Brezis, Mironescu ’01) Suppose that \(\varOmega \subset {\mathbb {R}}^N\) is a smooth bounded domain. Assume that \(f \in L^p(\varOmega )\), where \(p \in (1,\infty )\). Let \(\rho _n\) be a sequence of nonnegative radial mollifiers such that \(\int _{{\mathbb {R}}^N} \rho _n \, \text {d}x = 1\) and for every \(\delta > 0\) we have \(\lim _{n \rightarrow \infty } \int _\delta ^\infty \rho _n(r)\, r^{N-1} \, \text {d}r = 0\). Then,

  1. (1)

    \(u \in W^{1,p}(\varOmega )\) if and only if

    $$\begin{aligned} \liminf _{n \rightarrow \infty } \int _\varOmega \int _\varOmega \frac{|f(x) - f(y)|^p}{|x-y|^p} \, \rho _n(x-y) \, \text {d}x \, \text {d}y < \infty . \end{aligned}$$
  2. (2)

    When \(u \in W^{1,p}(\varOmega )\), then

    $$\begin{aligned} \lim _{n \rightarrow \infty } \int _\varOmega \int _\varOmega \frac{|f(x) - f(y)|^p}{|x-y|^p} \, \rho _n(x-y) \, \text {d}x \, \text {d}y = K_{p,N} \Vert \nabla f \Vert ^p_{L^p(\varOmega )}. \end{aligned}$$
    (1.1)

A similar result holds for \(p = 1\) with the space \(BV(\varOmega )\) in place of \(W^{1,1}(\varOmega )\), see [9]. Moreover, the authors of [5] (see also [22]) prove a precompactness result under an additional assumption that \(\rho \) is nonincreasing as a function of r; this result (or a similar result proved in [3, Theorem 6.11]) is a standard argument in approximations of local problems via nonlocal ones, see for instance [3, 11].

A few authors, for instance [10] and [19], considered extensions of the first part of Theorem 1.1 to the setting of measure metric spaces (see also [4] in the case of Carnot groups). Let X be a metric space equipped with a doubling measure which satisfies the (1, p)-Poincaré inequality. Consider the following metric analogue of the left-hand side of the equality in Theorem 1.1:

We will call \(Q_{r,p}\) the BBM difference quotient. It corresponds to taking the mollifiers \(\rho _n\) equal to characteristic functions of balls rescaled by the measure of these balls (see the discussion in Sect. 4.1). Then, we ask if a following analogue of Theorem 1.1 holds: there exists a constant \(C_{p,X}\) such that for any \(f \in W^{1,p}(X,d,\nu )\), we have

for a gradient \(\nabla f\) understood in an appropriate sense. In such generality, there is no hope of an exact analogue of the second part of Theorem 1.1, see Example 4.4. However, there are some results concerning the first part of Theorem 1.1, concerning the upper and lower limits of \(Q_{r,p}\) and their relationship with the Sobolev structure.

Theorem 1.2

([19, Theorem 3.1]) Let \((X,d,\nu )\) be a metric space equipped with a doubling measure which satisfies the (1, 1)-Poincaré inequality. Suppose that \(f \in L^1(X,\nu )\). Then

$$\begin{aligned} f \in BV(X,d,\nu ) \Leftrightarrow \liminf _{r \rightarrow 0} \frac{1}{r} \int _X \int _{B(x,r)} \frac{|f(y) - f(x)|}{\sqrt{\nu (B(x,r))} \sqrt{\nu (B(y,r))}} \, \text {d}\nu (y) \, \text {d}\nu (x) < \infty . \end{aligned}$$

In particular, since \(\nu \) is doubling, we have

see the discussion in [20].

The proof given in [19] with minor modifications can also be used to provide a characterisation of the Sobolev space \(W^{1,p}(X,d,\nu )\) via the lower limit of \(Q_{r,p}\). A similar characterisation for \(p > 1\), which also arises from taking a particular kernel \(\rho _n\) in Theorem 1.1 and involves the limit of fractional Sobolev norms, was proved in [10].

In this paper, we concentrate on the metric analogues of the second part of Theorem 1.1, namely on the existence and exact value of the constant \(C_{p,X}\). We focus on the case \(p > 1\) in order to be able to use the equivalence of different definitions of Sobolev spaces and the density of Lipschitz functions in the Sobolev norm. We consider measure metric spaces that locally look like Euclidean spaces; to be more precise, we consider spaces such that their tangents (in the Gromov–Hausdorff sense) for \(\nu \)-a.e. \(x \in X\) are Euclidean spaces with a fixed dimension N. This class contains for instance Riemannian manifolds, weighted Euclidean spaces for continuous weights bounded from below and (as was shown in [6]) RCD(KN) spaces. In the absence of scaling and Taylor formula that are available to us in the Euclidean case, we will use a blow-up technique and a version of the Rademacher theorem in their place.

The structure of the paper is as follows. In Sect. 2, we recall the necessary notions, such as the (equivalent) definitions of Sobolev spaces on a metric measure space, Gromov–Hausdorff convergence and the Rademacher theorem. In Sect. 3, we start by proving a pointwise result (valid \(\nu \)-a.e.) in the spirit of Theorem 1.1 for Lipschitz functions and then prove the main result of the paper, Theorem 3.5:

Theorem 3.5

Suppose that \((X,d,\nu )\) is a complete, separable, doubling metric measure space which supports a (1, p)-Poincaré inequality. Suppose additionally that X has Euclidean tangents of dimension N for \(\nu \)-a.e. \(x \in X\). Let \(f \in W^{1,p}(X,d,\nu )\), where \(p \in (1,\infty )\). Then

(1.2)

where \(\text{ Ch}_p(f)\) is the Cheeger energy of f defined in (2.1) and \(C_{p,N}\) is the constant defined in (3.9).

In particular, the constant \(C_{p,X}\) does not depend on the space X itself, only on the dimension of the tangent space, so we denote it by \(C_{p,N}\). Finally, in Sect. 4, we comment on the relationship of results from Sect. 3 with existing literature and discuss some extensions of the framework under which they are valid; in particular, we prove an analogue of Theorem 3.5 when the tangent is the Heisenberg group and use it to construct Example 4.4 showing that if the tangent space varies from point to point, then equation (1.2) may no longer be true.

2 Preliminaries

2.1 Sobolev Spaces on a Metric Space

Let \((X,d,\nu )\) be a metric measure space. In the whole paper, we will work under the standard assumptions that the measure \(\nu \) is doubling and the space supports a (1, p)-Poincaré inequality. We say that the measure \(\nu \) is doubling, if there exists a constant \(c_D\) such that for all \(x \in X\) and all \(r > 0\), we have

$$\begin{aligned} 0< \nu (B(x,2r)) \le c_D \, \nu (B(x,r)) < \infty . \end{aligned}$$

Given \(f: X \rightarrow {\mathbb {R}}\), we define its slope (also called the local Lipschitz constant of f) by the formula:

$$\begin{aligned} \text{ Lip }(f)(x) = \limsup _{y \rightarrow x} \frac{|f(y) - f(x)|}{\text {d}(x,y)}. \end{aligned}$$

We say that the metric measure space \((X,d,\nu )\) supports a (1, p)-Poincaré inequality, if there exist constants \(c_P\) and \(\varLambda \) such that for all \(f \in \text{ Lip }(X)\) and \(r > 0\), we have

In this paper, we will work in the setting in which the several known notions of Sobolev spaces defined on a metric space are equivalent; for completeness, we present an “H type” definition via approximation by Lipschitz functions.

Definition 2.1

Let \(p \in (1,\infty )\). We say that \(g \in L^p(X,\nu )\) is a p-relaxed slope of \(f \in L^p(X,\nu )\), if there exist \({\widetilde{g}} \in L^p(X,\nu )\) and Lipschitz functions \(f_n \in L^p(X,\nu ) \cap \text{ Lip }(X)\) such that

  1. (1)

    \(f_n \rightarrow f\) in \(L^p(X,\nu )\) and \(Lip(f_n) \rightharpoonup {\widetilde{g}}\) weakly in \(L^p(X,\nu )\);

  2. (2)

    \({\widetilde{g}} \le g\) \(\nu \)-a.e. in X.

We say that g is the minimal p-relaxed slope of f if its norm in \(L^p(X,\nu )\) is minimal among p-relaxed slopes. We will denote the minimal p-relaxed slope by \(|\nabla f|_{*,p}\).

The definition of minimal p-relaxed slope is well-posed thanks to Mazur’s lemma and uniform convexity of \(L^p(X,\nu )\), see the discussion after [1, Definition 4.2]. Using the minimal p-relaxed slope, for \(p \in (1,\infty )\) define the Cheeger energy as

$$\begin{aligned} \text{ Ch}_p(f) = \int _X |\nabla f|_{*,p}^p \, \text {d}\nu . \end{aligned}$$
(2.1)

Definition 2.2

Fix \(p \in (1,\infty )\). Let \(f \in L^p(X,\nu )\). We say that \(f \in W^{1,p}(X,d,\nu )\), the Sobolev space of functions with a p-relaxed slope, if there exists a p-relaxed slope of f. The space \(W^{1,p}(X,d,\nu )\) is endowed with the norm:

$$\begin{aligned} \Vert f \Vert _{W^{1,p}(X,d,\nu )} = \bigg ( { \Vert f \Vert _{L^p(X,\nu )}^p} + \text{ Ch}_p(f) \bigg )^{1/p}. \end{aligned}$$

Under the assumptions that \(\nu \) is doubling and the space supports a (1, p)-Poincaré inequality, the space \(W^{1,p}(X,d,\nu )\) is reflexive and bounded Lipschitz functions with bounded support form a dense subset (see [2, Corollary 7.5, Proposition 7.6]). The space \(W^{1,p}(X,d,\nu )\) can equivalently be defined in a few other ways: instead of the p-relaxed slope \(|\nabla f|_{*,p}\), we may use the Cheeger’s gradient \(|\nabla f|_{C,p}\), the p-upper gradient \(|\nabla |_{S,p}\) or the minimal p-weak upper gradient \(|\nabla |_{w,p}\); for these equivalent definitions (all the above gradients agree \(\nu \)-a.e. in X) and the proof of the equivalence see [1].

In the proofs in Sect. 3, we are going to use one more equivalence of Sobolev spaces—with the Hajlasz–Sobolev space \(M^{1,p}(X)\) (see Lemma 2.3). While the norms in \(W^{1,p}(X,d,\nu )\) and \(M^{1,p}(X)\) do not necessarily agree, classical arguments using maximal functions (for instance, combine [17, Theorem 4.5] and [16, Theorem 1.0.1]) imply the following Lemma concerning the equivalence of these spaces.

Lemma 2.3

Let \(p \in (1,\infty )\). Suppose that \((X,d,\nu )\) is a doubling metric measure space which supports a (1, p)-Poincaré inequality. Then, for any \(f \in W^{1,p}(X,d,\nu )\), there exists \(g \in L^p(X,\nu )\) such that

$$\begin{aligned} |f(x) - f(y)| \le \text {d}(x,y) \, (g(x) + g(y)) \end{aligned}$$

for \(\nu \)-a.e. \(x,y \in X\) (in other words, f is in the Hajlasz–Sobolev space \(M^{1,p}(X))\). Moreover, we can choose g such that \(\Vert g \Vert _{L^p(X,\nu )}^p \le C \cdot \text{ Ch}_p(f)\).

2.2 Tangents of a Metric Space

Let us recall the definition of pointed measured Gromov–Hausdorff convergence of metric spaces (first introduced in [12]; there are many equivalent ways to define it in the literature, we use a variant from [8]).

Definition 2.4

A map \(\phi : (X_1, x_1, d_1) \rightarrow (X_2, x_2, d_2)\) between two metric spaces with a distinguished point is called an \(\varepsilon \)-isometry if

$$\begin{aligned} |d_2(\phi (x), \phi (y)) - d_1(x,y)| \le \varepsilon \end{aligned}$$
(2.2)

for all \(x,y \in B(x, \varepsilon ^{-1})\) and we have

$$\begin{aligned} B_{d_2}(y,r-\varepsilon ) \subset N_\varepsilon (\phi (B_{d_1}(x,r))) \end{aligned}$$
(2.3)

for all \(r \in [\varepsilon ^{-1},\varepsilon ]\). Here, \(N_\varepsilon (E)\) denotes the open \(\varepsilon \)-neighbourhood of a set \(E \subset X_2\).

In particular, we do not necessarily have that \(\phi (x_1) = x_2\), but the properties of an \(\varepsilon \)-isometry imply that \(d_2(\phi (x_1),x_2) \le 2\varepsilon \).

Definition 2.5

A sequence of pointed metric spaces \((X_n, x_n, d_n)\) converges in pointed Gromov–Hausdorff sense to (Xxd) if there exists a sequence \(\varepsilon _n \rightarrow 0\) such that there exist \(\varepsilon _n\)-isometries \(\phi _n: X_n \rightarrow X\) and \(\psi _n: X \rightarrow X_n\).

Moreover, we say that \((X_n, x_n, d_n, \nu _n)\) converges in measured pointed Gromov–Hausdorff sense to \((X,x,d,\nu )\), if additionally \((\phi _n)_{\#} \nu _n \rightharpoonup \nu \) weakly as measures on X.

Definition 2.6

Let \((X,x,d,\nu )\) be a pointed metric measure space. A tangent cone at x is a pointed metric space \((X_\infty , x_\infty , d_\infty , \nu _\infty )\), which is a measured pointed Gromov–Hausdorff limit of some sequence \((X,x,r_n^{-1}d, \nu _{r_n})\), where \(r_n \rightarrow 0\) and

$$\begin{aligned} \nu _r = \frac{1}{\nu (B(x,r))} \nu . \end{aligned}$$

In the literature, the renormalised limit measure \(\nu _\infty \) is sometimes omitted in the definition of tangent cones; here, we follow [7] and include it, since we want to use a version of Rademacher’s theorem.

On complete metric spaces equipped with a doubling measure tangent cones exist for all \(x \in X\), see [7], but they are not necessarily unique. A key assumption we will use is that for \(\nu \)-a.e. \(x \in X\) the tangent cones are unique and are Euclidean spaces of fixed dimension N. In this case, we will drop the sequence \(r_n\) and simply index the blow-ups of the space X by \(r \in (0, \infty )\).

2.3 Rademacher Theorem

The core of the proofs in the next Section is a version of the Rademacher theorem for metric measure spaces which satisfy the doubling property and the (1, p)-Poincaré inequality. To this end, we introduce the following notation. Set \(\phi _r: X \rightarrow X_\infty \) to be the Gromov–Hausdorff approximation. Given a function \(f \in \text{ Lip }(X)\), we denote

$$\begin{aligned} f_{r,x}(y) = \frac{f(y) - f(x)}{r}. \end{aligned}$$

We have \(f_{r,x}(y) \in \text{ Lip }(X)\); moreover, if L is the Lipschitz constant of f, then the Lipschitz constant of \(f_{r,x}\) is at most \(\frac{L}{r}\) and \(|f_{r,x}|\) is bounded by L on the ball B(xr). If we rescale the metric d to \(r^{-1}d\), then \(f_{r,x}\) has Lipschitz constant at most L, is locally bounded and is bounded by L on the ball with radius one; hence, it admits a convergent subsequence (still denoted by \(f_{r,x}\)) such that \(f_{r,x}\) converge locally uniformly to a function \(f_{0,x} \in \text{ Lip }(X_\infty )\) (modulo the identification of X as a subset of \(X_\infty \) via \(\phi _r\)), namely on B(xr) we have

$$\begin{aligned} \Vert f_{0,x}(\phi _r(\cdot )) - f_{r,x}(\cdot ) \Vert _\infty \le \alpha (r), \end{aligned}$$
(2.4)

where \(\alpha (r) \rightarrow 0\) as \(r \rightarrow 0\). Moreover, the Lipschitz constant of \(f_{0,x}\) is at most L and it is bounded by L on the ball \(B(x_\infty , 1)\).

Now, we recall the concept of generalised linear functions as introduced in [7]. Denote by \(g_f\) the minimal upper gradient of a function \(f \in W^{1,p}(X,d,\nu )\).

Definition 2.7

Let \(p \in (1,\infty )\). A Lipschitz function \(l \in \text{ Lip }(X)\) is generalised linear if:

  1. (1)

    \(l \equiv 0\) or range \(l = (-\infty ,\infty )\);

  2. (2)

    l is p-harmonic, in the sense that for any \(V \subset \subset X\) we have

    $$\begin{aligned} \int _V |g_l|^p \le \int _V |g_{l+f}|^p \end{aligned}$$

    for all functions \(f \in W^{1,p}(X,d,\nu )\) with support in V;

  3. (3)

    \(g_l \equiv c\) for some \(c \in {\mathbb {R}}\).

If X is the Euclidean space, then generalised linear functions are affine, see [7, Theorem 8.11].

Theorem 2.8

( [7, Theorem 10.2]) Suppose that \((X,x,d,\nu )\) is a pointed metric measure space. Suppose that \(\nu \) is doubling and satisfies the (1, p)-Poincaré inequality for some \(p \in (1,\infty )\). Let \(f \in \text{ Lip }(X)\) Then, for \(\nu \)-a.e. \(x \in X\) the function f is infinitesimally generalised linear, i.e. for all \(p' > p\) any \(f_{0,x}\) as above is a generalised linear function. Moreover, we have \(\text{ Lip } f_{0,x} = \text{ Lip }(f)(x)\).

3 Bourgain–Brezis–Mironescu Approach

In this Section, we deal with metric measure spaces \((X,d,\nu )\) which have Euclidean tangents \(\nu \)-a.e., i.e.

$$\begin{aligned} (X, x, r^{-1}d, \nu _r) \rightarrow (X_\infty , x_\infty , d_\infty , \nu _\infty ) = ({\mathbb {R}}^N, 0, \Vert \cdot \Vert , c_N {\mathcal {L}}^N) \end{aligned}$$

in the measured Gromov–Hausdorff sense, where constant \(c_N = \frac{1}{{\mathcal {L}}^N(B(0,1))}\), so that the measure of the unit ball equals one (this is a consequence of the definition of \(\nu _r\)). This is the case for instance for Riemannian manifolds and (as shown in [6]) RCD(KN) spaces. Another important class of examples is weighted Euclidean spaces.

Example 3.1

Let \((X,x,d,\nu ) = ({\mathbb {R}}^N,x,\Vert \cdot \Vert , w\, {\mathcal {L}}^N)\), where \(w \in L^1_{loc}({\mathbb {R}}^N)\) is continuous \({\mathcal {L}}^N\)-a.e. and \({\mathcal {L}}^N\)-a.e. we have \(w \ge c > 0\). Choose \(x \in X\) which satisfies these conditions and define \(\phi _r: ({\mathbb {R}}^N,x,r^{-1} \Vert \cdot \Vert ) \rightarrow ({\mathbb {R}}^N,0,\Vert \cdot \Vert )\) by the formula \(\phi _r(y) = \frac{y-x}{r}\) and notice that it is an isometry (with an inverse which is also an isometry) which maps x to 0, so the spaces \(({\mathbb {R}}^N,x,r^{-1} \Vert \cdot \Vert )\) converge in the Gromov–Hausdorff sense to \(({\mathbb {R}}^N,0,\Vert \cdot \Vert )\). Moreover, a quick calculation shows that

Hence, \(({\mathbb {R}}^N,0,\Vert \cdot \Vert , c_N {\mathcal {L}}^N)\) satisfies all the conditions given in Definition 2.6 for any subsequence \(r_n \rightarrow 0\), so \((X,x,d,\nu )\) has Euclidean tangents \(\nu \)-a.e.

The goal of this Section is to prove Theorem 3.5, which is an equivalent of Theorem 1.1 in the metric setting.The outline of the proof is in a way similar to the proof of Theorem 1.1 shown in [5]: first, we prove a pointwise result for a dense subset of the Sobolev space which contains functions which are regular enough, and then integrate this result over the whole space and prove that the limiting process is well defined. Here, we further break this reasoning into separate results in order to underline the moment when we use the assumption that the tangent spaces are Euclidean.

Lemma 3.2

Suppose that \((X,d,\nu )\) is a doubling metric measure space, which satisfies the (1, p)-Poincaré inequality for some \(p \in (1,\infty )\). Let \(x \in X\) be a point such that the implication in the Rademacher theorem (Theorem 2.8) holds. Then, in the notation introduced in Sect. 2.2, we have

$$\begin{aligned} \lim _{r \rightarrow 0} \, \bigg (\int _{B(x,r)} |f_{r,x}(y)|^p \, d\nu _r(y) - \int _{B(x_\infty ,1)} |f_{0,x}(z)|^p \, d(\phi _r)_{\#}\nu _r(z) \bigg ) = 0. \end{aligned}$$
(3.1)

This result will later play a role as an estimate on the remainder, when we will approximate the rescaled nonlocal gradients \(f_{x,r}\) by the linear part \(f_{0,x}\). Compared to the situation, when \(X = {\mathbb {R}}^N\), the main difference is that there are two sources of error here – one which is of the same type as the Taylor remainder and one that comes from the fact that the domain changes in the approximation; it reflects the difference in the shapes of balls B(xr) and the ball \(B(x_\infty ,1)\).

Proof

Fix such \(x \in X\) such that the Rademacher theorem holds (the set of such points is of full measure). Take the functions \(f_{r,x}\), which by Arzela-Ascoli theorem converge locally uniformly (on a subsequence still denoted by r) to a function \(f_{0,x}\). As discussed in Sect. 2.2, on B(xr) we have

$$\begin{aligned} \Vert f_{0,x}(\phi _r(\cdot )) - f_{r,x}(\cdot ) \Vert _\infty \le \alpha (r), \end{aligned}$$

where \(\alpha (r) \rightarrow 0\) as \(r \rightarrow 0\). Now, write the left integral in (3.1) as follows:

$$\begin{aligned} \int _{B(x,r)} |f_{r,x}(y)|^p \, \text {d}\nu _r(y)= & {} \int _{B(x,r)} |f_{0,x}(\phi _r(y))|^p \, \text {d}\nu _r(y) \nonumber \\&+ \int _{B(x,r)} \bigg ( |f_{r,x}(y)|^p - |f_{0,x}(\phi _r(y))|^p \bigg ) \, \text {d}\nu _r(y).\nonumber \\ \end{aligned}$$
(3.2)

We start by estimating the second summand on the right-hand side. By the Lagrange mean value theorem for \(\phi (t) = t^p\), we have that for any \(y \in B(x,r)\)

$$\begin{aligned} \bigg | |f_{r,x}(y)|^p - |f_{0,x}(\phi _r(y))|^p \bigg | = p \, \tau ^{p-1} \, { \bigg | |f_{r,x}(y)| - |f_{0,x}(\phi _r(y))| \bigg |} \end{aligned}$$

for some \(\tau \) between \(|f_{r,x}(y)|\) and \(|f_{0,x}(\phi _r(y))|\). But by definition of \(f_{r,x}\), we have that \(|f_{r,x}|\) is bounded by \(\text{ Lip }(f)(x)\) on the ball B(xr); since \(f_{0,x}\) is the uniform limit of \(f_{r,x}\) as \(r \rightarrow 0\) on B(xr), it satisfies the same bound. Hence, taking (2.4) into account, we have that

$$\begin{aligned} p \, \tau ^{p-1} \, \bigg | |f_{r,x}(y)| - |f_{0,x}(\phi _r(y))| \bigg | \le p \, \tau ^{p-1} \, |f_{r,x}(y) - f_{0,x}(\phi _r(y))| \le p \, |\text{ Lip }(f)(x)|^{p-1} \, \alpha (r) \end{aligned}$$

for all \(y \in B(x,r)\). Coming back to (3.2), we have

so

$$\begin{aligned} \lim _{r \rightarrow 0} \int _{B(x,r)} \bigg ( |f_{r,x}(y)|^p - |f_{0,x}(\phi _r(y))|^p \bigg ) \, \text {d}\nu _r(y) = 0. \end{aligned}$$
(3.3)

To finish the proof, we need to show that the expression

$$\begin{aligned} \int _{B(x,r)} |f_{0,x}(\phi _r(y))|^p \, \text {d}\nu _r(y) - \int _{B(x_\infty ,1)} |f_{0,x}(z)|^p \, \text {d}(\phi _r)_{\#}\nu _r(z) \end{aligned}$$

goes to zero as \(r \rightarrow 0\). Notice that

$$\begin{aligned} \int _{B(x,r)} |f_{0,x}(\phi _r(y))|^p \, \text {d}\nu _r(y)= & {} \int _{\phi _r(B(x,r))} |f_{0,x}|^p \, \text {d}(\phi _r)_{\#} \nu _r \nonumber \\= & {} \int _{B(x_\infty ,1)} |f_{0,x}|^p \, \text {d}(\phi _r)_{\#} \nu _r\nonumber \\&+ \int _{\phi _r(B(x,r)) \backslash B(x_\infty ,1)} |f_{0,x}|^p \, \text {d}(\phi _r)_{\#} \nu _r\nonumber \\&- \int _{B(x_\infty ,1) \backslash \phi _r(B(x,r))} |f_{0,x}|^p \, \text {d}(\phi _r)_{\#} \nu _r, \end{aligned}$$
(3.4)

so we have to prove that the second and third summands on the right-hand side of (3.4) disappear in the limit \(r \rightarrow 0\).

For the second summand, recall that \(\phi _r\) are \(\varepsilon _r\)-isometries. For any \(x,y \in X\), we have

$$\begin{aligned} \bigg | d_\infty (\phi _r(x), \phi _r(y)) - r^{-1} \text {d}(x,y) \bigg | \le \varepsilon _r, \end{aligned}$$
(3.5)

so for \(y \in B(x,r)\), we have

$$\begin{aligned} d_\infty (\phi _r(y), x_\infty ) \le r^{-1} \text {d}(x,y) + \varepsilon _r + d_\infty (\phi _r(x), x_\infty ) \le 1 + 3 \varepsilon _r. \end{aligned}$$

In other words, \(\phi _r(B(x,r)) \backslash B(x_\infty ,1) \subset \overline{B(x_\infty ,1 + 3\varepsilon _r)} \backslash B(x_\infty ,1)\). Since \(\varepsilon _r \rightarrow 0\) as \(r \rightarrow 0\), fix \(\rho _k\) small enough that \(\varepsilon _{r} < \frac{1}{k}\) for all \(r \in (0,\rho _k]\). On the ball \(\overline{B(x_\infty ,4)}\), which contains all the sets \(\overline{B(x_\infty ,1 + 3\varepsilon _r)} \backslash B(x_\infty ,1)\) for \(r \in (0, \rho _k)\), the function \(|f_{0,x}|\) is uniformly bounded by some M, so

$$\begin{aligned}&\limsup _{r \rightarrow 0} \, \bigg | \int _{\phi _r(B(x,r)) \backslash B(x_\infty ,1)} |f_{0,x}|^p \, d(\phi _r)_{\#} \nu _r \bigg | \\&\quad \le \limsup _{r \rightarrow 0} \, M^p \, \bigg | \int _{\overline{B(x_\infty ,1+3\varepsilon _r)} \backslash B(x_\infty ,1)} d(\phi _r)_{\#} \nu _r \bigg | \\&\quad \le \limsup _{r \rightarrow 0} \, M^p \, \bigg | \int _{B(x_\infty ,1+\frac{3}{k}) \backslash B(x_\infty ,1)} d(\phi _r)_{\#} \nu _r \bigg | \\&\quad = M^p \, \nu _\infty (B(x_\infty ,1+\frac{3}{k}) \backslash B(x_\infty ,1)). \end{aligned}$$

Recall that doubling measures (and \(\nu _\infty \) is doubling as a limit of a uniformly doubling sequence) gives zero measure to boundaries of balls. In particular, we see that \(\nu _\infty (\partial B(x_\infty ,1)) = 0\). Since k was arbitrary, the right-hand side can be made arbitrarily small, and we see that

$$\begin{aligned} \lim _{r \rightarrow 0} \, \bigg (\int _{\phi _r(B(x,r)) \backslash B(x_\infty ,1)} |f_{0,x}|^p \, d(\phi _r)_{\#} \nu _r\bigg ) = 0. \end{aligned}$$
(3.6)

We estimate the third summand in the right-hand side of (3.4) as follows. For any \(x \in X\) and \(y \notin B(x,r)\), by (3.5), we have

$$\begin{aligned} d_\infty (\phi _r(y),x_\infty ) \ge r^{-1} \text {d}(x,y) - \varepsilon _r - d_\infty (\phi _r(x),x_\infty ) \Vert \ge 1 - 3 \varepsilon _r. \end{aligned}$$

Again, fix \(\rho _k\) small enough that \(\varepsilon _{r} < \frac{1}{k}\) for all \(r \in (0,\rho _k]\); then the inequality above means that \(\phi _r(X) \backslash \phi _r(B(x,r)) \subset X_\infty \backslash B(x_\infty ,1-3\varepsilon _r) \subset X_\infty \backslash B(x_\infty ,1-\frac{3}{k})\). By definition of a pushforward measure, \((\phi _r)_{\#} \nu _r\) is supported on the image of \(\phi _r\), so

$$\begin{aligned}&\limsup _{r \rightarrow 0} \, \bigg | \int _{B(x_\infty ,1) \backslash \phi _r(B(x,r))} |f_{0,x}|^p \, d(\phi _r)_{\#} \nu _r \bigg | \\&\quad \le \limsup _{r \rightarrow 0} \, M^p \, \bigg | \int _{B(x_\infty ,1) \backslash \phi _r(B(x,r))} d(\phi _r)_{\#} \nu _r \bigg | \\&\quad = \limsup _{r \rightarrow 0} M^p \bigg |\int _{B(x_\infty ,1) \cap (\phi _r(X) \backslash \phi _r(B(x,r)))} d(\phi _r)_{\#} \nu _r \bigg |\\&\quad \le \limsup _{r \rightarrow 0} \, M^p \, \bigg |\int _{B(x_\infty ,1) \backslash B(x_\infty ,1-\frac{3}{k})} d(\phi _r)_{\#} \nu _r \bigg | \\&\quad = M^p \, \nu _\infty (B(x_\infty ,1) \backslash B(x_\infty ,1-\frac{3}{k})). \end{aligned}$$

Since k was arbitrary, the right-hand side can be made arbitrarily small and we see that

$$\begin{aligned} \lim _{r \rightarrow 0} \, \bigg (\int _{B(x_\infty ,1) \backslash \phi _r(B(x,r))} |f_{0,x}|^p \, d(\phi _r)_{\#} \nu _r\bigg ) = 0. \end{aligned}$$
(3.7)

When we plug in equations (3.6) and (3.7) to (3.4), we obtain that

$$\begin{aligned} \lim _{r \rightarrow 0} \bigg ( \int _{B(x,r)} |f_{0,x}(\phi _r(y))|^p \, \text {d}\nu _r(y) - \int _{B(x_\infty ,1)} |f_{0,x}(z)|^p \, d(\phi _r)_{\#}\nu _r(z) \bigg ) = 0, \end{aligned}$$

which together with (3.3) give the statement of the Lemma. \(\square \)

Proposition 3.3

Suppose that \((X,d,\nu )\) is a doubling metric measure space, which satisfies the (1, p)-Poincaré inequality for some \(p \in (1,\infty )\). Let \(f \in \text{ Lip }(X)\) and suppose that \(x \in X\) is a differentiability point of f, i.e. the statement of the Rademacher theorem (Theorem 2.8) holds for x. Suppose additionally that the tangent cone at x is a Euclidean space of dimension N. Then,

(3.8)

where

(3.9)

Here, v is any unit vector in \({\mathbb {R}}^N\).

The constant \(C_{p,N}\) is not the same as the constant \(K_{p,N}\) in the statement of Theorem 1.1, but they are closely related, see Sect. 4.1.

Proof

In the notation introduced in Sect. 2.2, notice that \(|f(x) - f(y)| = r|f_{r,x}(y)|\). Using Lemma 3.2 in the third equality and the fact that the measures \((\phi _r)_{\#} \nu _r\) converge weakly to \(\nu _\infty \) (by the definition of measured Gromov–Hausdorff convergence) in the last equality, we obtain

(3.10)

Now, we need to estimate this last expression using the fact that for \(\nu \)-a.e. \(x \in X\) the tangent space is the Euclidean space \(({\mathbb {R}}^N, 0, \Vert \cdot \Vert , c_N {\mathcal {L}}^N)\).

Recall that \(f_{0,x}\) is a generalised linear function with Lipschitz constant \(\text{ Lip }(f)(x)\). Since the tangent space \(X_\infty \) is Euclidean, by [7, Theorem 8.11] \(f_{0,x}\) is affine; since \(f_{0,x}\) is the locally uniform limit of \(f_{r,x}\), it has value 0 at zero. This means that \(f_{0,x}\) is of the form:

$$\begin{aligned} f_{0,x}(z) = \text{ Lip }(f)(x) \, z \cdot v, \end{aligned}$$

where v is a vector of length one. Since \((X_\infty , x_\infty , d_\infty , \nu _\infty ) = ({\mathbb {R}}^N, 0, \Vert \cdot \Vert , c_N {\mathcal {L}}^N)\), we have

$$\begin{aligned} \int _{B(x_\infty ,1)} |f_{0,x}(z)|^p \, \text {d}\nu _\infty (z)= & {} \int _{B(0,1)} |f_{0,x}(z)|^p \, c_N \, \text {d}{\mathcal {L}}^N(z) \nonumber \\= & {} \bigg (\int _{B(0,1)} |z \cdot v|^p \, c_N \, \text {d}{\mathcal {L}}^N(z) \bigg ) \, |\text{ Lip }(f)(x)|^p\nonumber \\= & {} C_{p,N} \, |\text{ Lip }(f)(x)|^p, \end{aligned}$$
(3.11)

where \(C_{p,N}\) is the constant introduced in (3.9); note that it only depends on p and the dimension of the tangent space. \(\square \)

This approach, using a blow-up technique and the Rademacher theorem instead of the Taylor formula used in the original proof in [5], gives a new proof even in the context of Euclidean spaces. Notice that the constant \(C_{p,N}\) does not depend on the metric space itself—it depends only on the dimension of the tangent space N.

Moreover, a significant part of the proof did not depend on the structure of the tangent space; it plays a role only via the characterisation of generalised linear functions. In the general case, when the unique tangent cone to \((X,d,\nu )\) is an arbitrary metric space \((X_\infty , x_\infty , d_\infty , \nu _\infty )\), the calculation in equation (3.10) remains the same. What remains to be shown is that the value of the integral

$$\begin{aligned} \int _{B_\infty (x_\infty ,1)} |f_{0,x}(z)|^p \, \text {d}\nu _\infty (z) \end{aligned}$$

appearing in equation (3.10) is the same for every generalised linear function \(f_{0,x}\) with prescribed (constant) value of the minimal upper gradient. In other words, one needs to show that the constant \(C_{p,X}\) is well defined. Therefore, this approach allows for some extensions in terms of the structure of the tangent space, such as the case when the tangent space is the Heisenberg group \({\mathbb {H}}^1\), see Sect. 4.2.

Now, we use the pointwise result proved above to prove the desired result for Sobolev spaces for \(p > 1\). The first step is to prove a uniform estimate on the integral of the nonlocal gradient for Sobolev functions. From now on, denote \(\varDelta _r = \{ (x,y) \in X \times X: \, \text {d}(x,y) < r \}\).

Lemma 3.4

Let \(p \in (1,\infty )\). Suppose that \((X,d,\nu )\) is a doubling metric measure space which supports a (1, p)-Poincaré inequality. For any \(f \in W^{1,p}(X,d,\nu )\), we have

(3.12)

Proof

Take \(g \in L^p(X,\nu )\) given by Lemma 2.3 and calculate

Here, the constant in the last line comes from Lemma 2.3 and the doubling property. \(\square \)

Now, we integrate the pointwise result (Proposition 3.3) and use the density of Lipschitz functions to prove an analogue of Theorem 1.1 for Sobolev spaces \(W^{1,p}(X,d,\nu )\) for \(p > 1\) in the general setting.

Theorem 3.5

Suppose that \((X,d,\nu )\) is a complete, separable, doubling metric measure space which supports a (1, p)-Poincaré inequality. Suppose additionally that X has Euclidean tangents of dimension N for \(\nu \)-a.e. \(x \in X\). Let \(f \in W^{1,p}(X,d,\nu )\), where \(p \in (1,\infty )\). Then

(3.13)

Proof

Define an auxiliary function \(\overline{f_r} \in L^p(X \times X, \nu \otimes \nu )\) by the formula

$$\begin{aligned} {\overline{f}}_r(x,y) = \frac{|f(x) - f(y)|}{r} \, \chi _{B(x,r)}(y) \, |B(x,r)|^{-1/p}. \end{aligned}$$

The fact that \(\overline{f_r} \in L^p(X \times X, \nu \otimes \nu )\) follows from Lemma 3.4. Using this function, we can rephrase equation (3.12) as \(\Vert {\overline{f}}_r\Vert _{L^p(X \times X, \nu \otimes \nu )}^p \le C \cdot \text{ Ch}_p(f)\) and equation (3.13) as follows:

$$\begin{aligned} \lim _{r \rightarrow 0} \Vert {\overline{f}}_r \Vert _{L^p(X \times X, \nu \otimes \nu )}^p = C_{p,N} \cdot \text{ Ch}_p(f). \end{aligned}$$

Now, take any \(f, g \in W^{1,p}(X,d,\nu )\). We estimate

$$\begin{aligned}&\bigg | \Vert {\overline{f}}_r \Vert _{L^p(X \times X, \nu \otimes \nu )} - \Vert {\overline{g}}_r \Vert _{L^p(X \times X, \nu \otimes \nu )} \bigg |\\&\quad \le 2^{p-1} \Vert \overline{(f-g)}_r \Vert _{L^p(X \times X, \nu \otimes \nu )} \le C \cdot (\text{ Ch}_p(f - g))^{1/p}. \end{aligned}$$

By the above equation, taking into account the density of Lipschitz functions with bounded support in \(W^{1,p}(X,d,\nu )\), it suffices to establish equation (3.13) for \(\text{ Lip}_{bs}(X)\).

Take any \(f \in \text{ Lip}_{bs}(X)\) with Lipschitz constant L. First, suppose that \(d(x, \text{ supp } f) \le r\); then, we get

On the other hand, if \(d(x, \text{ supp } f) > r\), then clearly

Let us rewrite the above considerations as follows. Denote

$$\begin{aligned} h(x) = \left\{ \begin{array}{ll} L^p &{} \text{ if } d(x, \text{ supp } f) \le 1; \\ 0 &{} \text{ if } \text {d}(x, \text{ supp } f) > 1. \end{array} \right. \end{aligned}$$

Then, \(h \in L^p(X,\nu )\). Given any \(r \in (0,1)\), for \(\nu \)-a.e. \(x \in X\) we have

(3.14)

Now, we use Proposition 3.3; since the set of points in the statement of Theorem 2.8 (Rademacher theorem) is of full measure, for \(\nu -\)a.e. \(x \in X\) we obtain equality (3.8). By the estimate (3.14), we may integrate equality (3.8) over X and use the dominated convergence theorem to take the limit \(r \rightarrow 0\); we get that (3.13) is satisfied for f. We extend this result to \(W^{1,p}(X,d,\nu )\) by density of Lipschitz functions with bounded support. \(\square \)

4 Comments and Extensions

4.1 Comparison with Taking Averages on Balls

The constant \(K_{p,N}\) in Theorem 1.1 and the constant \(C_{p,N}\) in Theorem 3.5 are not equal, but they are closely related; in the case when \(X = {\mathbb {R}}^N\), the two results are related as follows: if we make the right choice of the approximating kernel \(\rho _r\) in Theorem 1.1, namely

$$\begin{aligned} \rho _r(x) = \bigg (r^N \, \int _{B(0,1)} |z|^p \, \text {d}{\mathcal {L}}^N(z) \bigg )^{-1} \frac{|x|^p}{r^p} \, \chi _{B(0,r)}(x), \end{aligned}$$

we get Theorem 3.5. Such \(\rho _r\) satisfies the assumptions of Theorem 1.1, since it is nonnegative, radial, has support in the ball B(0, r) and the normalisation constant is chosen so that \(\int _{\mathbb {{\mathbb {R}}^N}} \rho _r \, \text {d}{\mathcal {L}}^N = 1\). If we use such \(\rho _r\) in Theorem 1.1, we obtain

so

Hence, we have

Finally, let us see that it agrees with the value given in Proposition 3.3. We use the spherical version of the Fubini theorem with \(u(x) = \chi _{B(0,1)}(x) \, |x|^p\):

hence, the constant \(C_{p,N}\) is consistent with the constant \(K_{p,N}\) for a special choice of the approximating sequence.

4.2 Spaces with Heisenberg Group as a Tangent

A closer look at the structure of the proof of Theorem 3.5 reveals that the assumption that X has Euclidean tangents \(\nu \)-a.e. comes into play only via the structure of generalised linear functions on the tangent space \(X_\infty \). Therefore, in principle, it should be possible to generalise Theorem 3.5 to the case when the tangent space at \(\nu \)-a.e. point is fixed, but not Euclidean. In this Section, we take a closer look at the classical results of Cheeger ( [7]) to present such an argument for a simple case: the Heisenberg group \({\mathbb {H}}^1\). We also discuss the main difficulties with such an argument for an arbitrary tangent space.

Recall that the Heisenberg group \({\mathbb {H}}^1\) is the space \({\mathbb {R}}^3\) equipped with a Lie group structure with multiplication

$$\begin{aligned} (x_1, x_2, x_3) \cdot (y_1, y_2, y_3) = (x_1 + y_1, x_2 + y_2, x_3 + y_3 + 2(x_1 y_2 - x_2 y_1)) \end{aligned}$$

and equipped with the Carnot-Carathéodory distance (arising from a family of left invariant vector fields). By the left invariance of the distance, it is enough to compute the distance from 0 to any given point (denoted by \(d_0\)); then, the distance \(d_{{\mathbb {H}}^1}\) is related to \(d_0\) by left invariance, namely \(d_{{\mathbb {H}}^1}(x,y) = d_0(y^{-1}x)\). As proved in [13, Corollary 3.2], \(d_0\) is given by the formula:

$$\begin{aligned} d_{0}\bigg ((x_1, x_2, x_3)\bigg )= & {} \frac{x_3}{\sqrt{x_1^2 + x_2^2}} \sin \bigg (\pi H^{-1}(\frac{x_3}{x_1^2 + x_2^2})\bigg ) + \sqrt{x_1^2 + x_2^2} \, \cos \bigg (\pi H^{-1}(\frac{x_3}{x_1^2 + x_2^2})\bigg ),\nonumber \\ \end{aligned}$$
(4.1)

where \(H: (-1,1) \rightarrow {\mathbb {R}}\) is defined by the formula:

$$\begin{aligned} H(s) = \frac{2\pi }{1 - \cos (2\pi s)} \bigg ( s - \frac{\sin (2 \pi s)}{2\pi } \bigg ). \end{aligned}$$

The function H is a real analytic diffeomorphism of \((-1,1)\) onto \({\mathbb {R}}\) with \(H(0) = 0\).

We begin the argument by recalling [7, Theorem 8.10].

Theorem 4.1

Assume that Z is complete, noncompact, equipped with a doubling measure \(\mu \) which satisfies the (1, p)-Poincaré inequality. Let \(l \in \text{ Lip }(Z)\) be a generalised linear function on Z. Then, for any \(z_0 \in Z\), there exists a geodesic \(\gamma : (-\infty ,\infty ) \rightarrow Z\) with \(\gamma (0) = z_0\) such that \(\gamma \) is an integral curve for the upper gradient \(g_l = \text{ Lip }(l)\).

Next, we set \(b_{\gamma ,s}(z) = \text {d}(z,\gamma (s)) - |s|\), and define the Busemann functions \(b_\gamma ^\pm (z)\) by the formula \(b_\gamma ^\pm (z) = \lim _{s \rightarrow \pm \infty } b_{\gamma ,s}(z)\). The limit is well defined since the \(b_{\gamma ,s}\) is decreasing in |s| and bounded from below on compact subsets of Z. Now, we recall [7, Theorem 8.11].

Theorem 4.2

Under the assumptions of Theorem 4.1, for any geodesic \(\gamma \) as given by that Theorem, we have

$$\begin{aligned} l(z_0) - \text{ Lip }(l) \cdot b_{\gamma }^+(z) \le l(z) \le l(z_0) + \text{ Lip }(l) \cdot b_\gamma ^-(z). \end{aligned}$$
(4.2)

Our goal is to analyse the Busemann functions to show that on the Heisenberg group \({\mathbb {H}}^1\) these inequalities are in fact equalities (as in the Euclidean case), which will give a structure result on the generalised linear functions. In the case interesting to us, when \(Z = {\mathbb {H}}^1\), unbounded geodesics are horizontal lines (which is not true in general even for Carnot groups), see [14, Proposition 5.6]. Let \(\gamma \) be given by Theorem 4.1; then, since it is a horizontal line, it is of the form \(\gamma (s) = (as, bs, 0)\), where \(a^2 + b^2 = 1\). Since by equation (4.1) the distance \(d_{{\mathbb {H}}^1}\) is invariant with respect to rotations in the horizontal plane, without loss of generality we may assume that \((a,b)=(1,0)\). Then, given \(z = (z_1, z_2, z_3)\), we have

$$\begin{aligned} b_{\gamma ,s}(z)= & {} d_{{\mathbb {H}}^1}(z,\gamma (s)) - |s| = d_0(0,(-\gamma (s)) \cdot z) - |s| = d_0((z_1 - s, z_2, z_3 - 2 z_2 s)) - |s|\\= & {} \frac{(z_3 - 2 z_2 s)}{\sqrt{(z_1 - s)^2 + z_2^2}} \sin \bigg (\pi H^{-1}(\frac{z_3 - 2 z_2 s}{(z_1 - s)^2 + z_2^2})\bigg ) \\&+ \sqrt{(z_1 - s)^2 + z_2^2} \, \cos \bigg (\pi H^{-1}(\frac{z_3 - 2 z_2 s}{(z_1 - s)^2 + z_2^2})\bigg ) - |s|. \end{aligned}$$

We will compute the limit of \(b_{\gamma ,s}\) as \(s \rightarrow + \infty \); the other calculation is similar. Recall that \(H'(0) \ne 0\) and \(H(0) = 0\), so on the first part we have

$$\begin{aligned}&\lim _{s \rightarrow \infty } \frac{(z_3 - 2 z_2 s)}{\sqrt{(z_1 - s)^2 + z_2^2}} \sin \bigg (\pi H^{-1}(\frac{z_3 - 2 z_2 s}{(z_1 - s)^2 + z_2^2})\bigg )\\&\quad = \lim _{s \rightarrow \infty } (- 2 z_2) \sin \bigg (\pi H^{-1}(\frac{z_3 - 2 z_2 s}{(z_1 - s)^2 + z_2^2})\bigg ) = 0. \end{aligned}$$

On the second part, we have

$$\begin{aligned}&\lim _{s \rightarrow \infty } \bigg ( \sqrt{(z_1 - s)^2 + z_2^2} \, \cos \bigg (\pi H^{-1}(\frac{z_3 - 2 z_2 s}{(z_1 - s)^2 + z_2^2})\bigg ) - s \bigg ) \\&\quad = \lim _{s \rightarrow \infty } \frac{((z_1 - s)^2 + z_2^2) \cos ^2(\pi H^{-1}(\frac{z_3 - 2 z_2 s}{(z_1 - s)^2 + z_2^2})) - s^2}{\sqrt{(z_1 - s)^2 + z_2^2} \, \cos (\pi H^{-1}(\frac{z_3 - 2 z_2 s}{(z_1 - s)^2 + z_2^2})) + s} \\&\quad = \lim _{s \rightarrow \infty } \frac{1}{2s} \bigg (((z_1 - s)^2 + z_2^2) \cos ^2(\pi H^{-1}(\frac{z_3 - 2 z_2 s}{(z_1 - s)^2 + z_2^2})) - s^2 \bigg ) \\&\quad = \lim _{s \rightarrow \infty } \frac{1}{2s} \bigg ((s^2 - 2 z_1 s) \cos ^2(\pi H^{-1}(\frac{z_3 - 2 z_2 s}{(z_1 - s)^2 + z_2^2})) - s^2 \bigg ) \\&\quad = \lim _{s \rightarrow \infty } \bigg (\frac{1}{2} s (\cos ^2(\pi H^{-1}(\frac{z_3 - 2 z_2 s}{(z_1 - s)^2 + z_2^2})) - 1) \\&\qquad - z_1 \cos ^2(\pi H^{-1}(\frac{z_3 - 2 z_2 s}{(z_1 - s)^2 + z_2^2})) \bigg ) = - z_1. \end{aligned}$$

Hence, we have that \(b_{\gamma }^+((z_1, z_2, z_3)) = - z_1\); similarly, we have \(b_\gamma ^-((z_1, z_2, z_3)) = z_1\). In particular, \(b_\gamma ^+ = - b_\gamma ^-\), so we have equalities in equation (4.2). Assuming additionally that \(l((0,0,0)) = 0\), we have that the function l is of the form \(l((z_1, z_2, z_3)) = \text{ Lip }(l) z_1\). In general, for any horizontal line (asbs, 0), we obtain that for \(v=(a,b,0)\) we have \(l(z) = \text{ Lip }(l) (z \cdot v)\), where \(\cdot \) denotes the usual scalar product in \({\mathbb {R}}^3\).

Now, we investigate the proof of Theorem 3.5. The only place where the assumption that the tangent is the Euclidean space comes into play is in the proof of Proposition 3.3. In this proof, the computation in equation (3.10) stays the same, and the only difference is in its final step. We modify the proof for the Euclidean tangent as follows. By the considerations above \(f_{0,x}\) (in the notation of Proposition 3.3) is of the form

$$\begin{aligned} f_{0,x}(z) = \text{ Lip }(f)(x) \, z \cdot v, \end{aligned}$$

where \(v = (a,b,0)\) with \(a^2 + b^2 = 1\). Denote \(c_{{\mathbb {H}}^1} = ({\mathcal {L}}^3(B_{{\mathbb {H}}^1}(0,1)))^{-1}\). Since \((X_\infty ,x_\infty ,d_\infty ,\nu _\infty ) = ({\mathbb {H}}^1,0,d_{{\mathbb {H}}^1}, c_{{\mathbb {H}}^1} {\mathcal {L}}^3)\), we make a similar calculation as in equation (3.11) and get

$$\begin{aligned} \int _{B(x_\infty ,1)} |f_{0,x}(z)|^p \, \text {d}\nu _\infty (z)= & {} \int _{B_{{\mathbb {H}}^1}(0,1)} |f_{0,x}(z)|^p \, c_{{\mathbb {H}}^1} \, \text {d}{\mathcal {L}}^3(z) \\= & {} \bigg (\int _{B_{{\mathbb {H}}^1}(0,1)} |z \cdot v|^p \, c_{{\mathbb {H}}^1} \, \text {d}{\mathcal {L}}^3(z) \bigg ) \, |\text{ Lip }(f)(x)|^p \\= & {} C_{p,{\mathbb {H}}^1} \, |\text{ Lip }(f)(x)|^p, \end{aligned}$$

where

Here, v is any unit horizontal vector. Note that this does not depend on the choice of v due to the invariance of the distance \(d_{{\mathbb {H}}^1}(0,x)\) with respect to horizontal rotations - it is a constant that again only depends on p and the choice of the tangent space. Therefore, we proved that

Corollary 4.3

Suppose that \((X,d,\nu )\) is a complete, separable, doubling metric measure space which supports a (1, p)-Poincaré inequality. Suppose additionally that the tangent space to X for \(\nu \)-a.e. \(x \in X\) is the Heisenberg group \({\mathbb {H}}^1\). Let \(f \in W^{1,p}(X,d,\nu )\), where \(p \in (1,\infty )\). Then

Since the formula (4.1) for the distance holds also in higher Heisenberg groups \({\mathbb {H}}^N\) (as proved in [13]), the same proof works also in that case; however, for simplicity we presented the proof for \({\mathbb {H}}^1\).

In light of the results in [18], it is natural to consider the case when the tangent is an arbitrary Carnot group \({\mathbb {G}}\) equipped with a sub-Finsler distance. However, the situation in this case is much more complicated. Recall that in the proof of Theorem 3.5 the only place where the assumption that the tangent is the Euclidean space comes into play is in the second half of the proof of Proposition 3.3, when we show that the integral

$$\begin{aligned} \int _{B_\infty (x_\infty ,1)} |f_{0,x}(z)|^p \, \text {d}\nu _\infty (z) \end{aligned}$$

on the right-hand side of equation (3.10) is the same for every generalised linear function with prescribed upper gradient. Therefore, one needs to show the precise form of all generalised linear functions and justify the invariance of the integral. However, even assuming that they have the same form as for the Heisenberg group, i.e. that up to a multiplicative constant all of them have the form \(z \cdot v\), where v is a unit horizontal vector, it is not clear that the value of the integral does not depend on the choice of v. This holds for instance when the distance is invariant with respect to horizontal rotations. In fact, this type of assumption was used in [4] to obtain a Bourgain–Brezis–Mironescu type result on Carnot groups. However, even for the standard Carnot-Carathéodory distance, this property is only known for some special choices of the Carnot group \({\mathbb {G}}\) (for instance, for the Heisenberg groups \({\mathbb {H}}^N\) it follows from formula (4.1)).

4.3 Spaces with Tangent Changing from Point to Point

In this subsection, we want to illustrate that the assumption that the tangent space is fixed is crucial in order for Theorem 3.5 to hold. If we allow for different tangent spaces for different points and use Proposition 3.3, we may end up with different constants in the pointwise estimate for Lipschitz functions and there would be no global constant satisfying the statement of Theorem 3.5. With these considerations in mind, we will construct an example of this phenomenon using the space constructed in [15, Remark 6.19(a)] by glueing together the Euclidean space \({\mathbb {R}}^4\) and the Heisenberg group.

Suppose that A is a closed subset of a metric space Y such that an isometric copy of A lies inside a metric space Z, i.e. there exists an isometric embedding \(i: A \rightarrow Z\). We understand this embedding to be fixed and consider A to be a closed subset of both Y and Z. We define the space \(Y \cup _A Z\) to be the disjoint union of Y and Z with points in the two copies of A identified. This space is endowed with a natural metric which extends the original metrics in Y and Z; given \(x_1,x_2 \in Y \cup _A Z\), we set

$$\begin{aligned} { d(x_1,x_2) = \left\{ \begin{array}{lll} d_Y(x_1,x_2) &{} \text{ if } x_1,x_2 \in Y; \\ d_Z(x_1,x_2) &{} \text{ if } x_1,x_2 \in Z; \\ \inf _{a \in A} (d_Y(x_1,a) + d_Z(a,x_2)) &{} \text{ if } x_1 \in Y \text{ and } x_2 \in Z. \end{array} \right. } \end{aligned}$$

Example 4.4

Let \(X = {\mathbb {R}}^4 \cup _A {\mathbb {H}}^1\), where A is an unbounded geodesic (any line in \({\mathbb {R}}^4\) and a horizontal line in \({\mathbb {H}}^1)\). As shown in [15, Remark 6.19(a)], this space is doubling (even 4-regular) and admits a (1, p)-Poincaré inequality for all \(p > 3\).

Now, we take two functions with supports away from A. Namely, we set \(f \in C_c^\infty ({\mathbb {R}}^4 \backslash A)\) and \(g \in C_c^\infty ({\mathbb {H}}^1 \backslash A)\). We extend them by zero to the whole space X. Then, since the support of f lies entirely in \({\mathbb {R}}^4\), by Theorem 3.5 we have

and since the support of g lies entirely in \({\mathbb {H}}^1\), by Corollary 4.3 we have

In particular, there is no single constant \(C_{p,X}\) such that the statement of Theorem 3.5 holds, since there exists \(p > 3\) such that \(C_{p,4} \ne C_{p,{\mathbb {H}}^1}\); for instance, for \(p = 4\), taking \(v = e_1\) in the definition of \(C_{4,4}\) we have

while the constant \(C_{4,{\mathbb {H}}^1}\) (which we can compute numerically from the explicit parametrisation of the unit ball in \({\mathbb {H}}^1\) given in [21]) has value \(C_{4,{\mathbb {H}}^1} \approx 0.106\). Hence, for \(p=4\) the space is doubling and satisfies a (1, p)-Poincaré inequality, but since it has different tangents at different points, an analogue of Theorem 3.5 does not hold in this setting.