Let \(E\Subset \Omega \) .
Let \(u\in N^{1,p}_c(\Omega )\)  be such that \(u(x)\ge 1\) , for every \(x\in E\) , and let \(g\in \mathcal {D}^p(u)\) .
Fix \(L>1\) 
satisfying \(c<(3L)^{-1}\)  and recall that \(B_i^*=LB_i\) , \(i\in \mathbb {N}\) .
For every \(i\in \mathbb {N}\)  we choose a Lipschitz function \(\varphi _i\)  satisfying the
following properties: \(\varphi _i(x)=1\)  for every \(x\in B_i\) , \(\varphi _i\)  is \(K/r_i\) -Lipschitz, for some \(K\ge 1\) ,
and \(0\le \varphi _i(x)\le {\mbox{\Large $\chi $}}\)\(\scriptstyle B_i^*\) (x)\(, for every \) xX\(.For instance, we can take\)\(\varphi _i(x)=\max \left\lbrace 0,1-\frac{d(x,B_i)}{d(B_i,X\setminus B_i^*)}\right\rbrace , \qquad x\in X,\)\(in which case we can choose \) K=(L-1)-1\(.Then, for every \) iN\(, \) ui=uiN1,pc()\(,and the product rule (see~\cite [Lemma~2.15]{BjornBjorn2011})implies that the function\)\(g_{i}(x)=(g(x)+Kr_i^{-1}|u(x)|) {\mbox{\Large $\chi $}}\)\(\scriptstyle B_i^*\) (x),   xX,
\(belongs to \) 
Dp(ui)\(.Hence \) ui\( is a capacity test functionfor \) EBi\( and\)\(\operatorname{cap}_{p,\beta }(E\cap B_i,\Omega )\le \int _\Omega g_{i}(x)^p\,d(x,\Omega ^c)^{\beta } \,d\mu (x).\)\(Since \) ri-1C d(x,c)-1\(, for every \) xBi*\(,{\begin{@align*}{1}{-1}&\biggl (\int _\Omega g_{i}(x)^p\,d(x,\Omega ^c)^{\beta }\,d\mu (x)\biggr )^\frac{q}{p}\\&\qquad \le C \biggl (\int _{B_i^*}g(x)^p\,d(x,\Omega ^c)^{\beta }\,d\mu (x)\biggr )^\frac{q}{p}+C\biggl (\int _{B_i^*}|u(x)|^p d(x,\Omega ^c)^{-p+\beta }\,d\mu (x)\biggr )^\frac{q}{p}.\end{@align*}}Since \) qp\(, we can write{\begin{@align*}{1}{-1}&\sum _{i=1}^{\infty } \operatorname{cap}_{p,\beta }(E\cap B_i,\Omega )^{\frac{q}{p}}\le \sum _{i=1}^{\infty } \biggl (\int _\Omega g_{i}(x)^p\,d(x,\Omega ^c)^{\beta }\,d\mu (x)\biggr )^\frac{q}{p}\\&\qquad \le C\sum _{i=1}^{\infty } \biggl (\int _{B_i^*}g(x)^p\,d(x,\Omega ^c)^{\beta }\,d\mu (x)\biggr )^\frac{q}{p}+C\sum _{i=1}^{\infty } \biggl (\int _{B_i^*}|u(x)|^p d(x,\Omega ^c)^{-p+\beta }\,d\mu (x)\biggr )^\frac{q}{p} \\&\qquad \le C\Biggl (\sum _{i=1}^{\infty }\int _{B_i^*}g(x)^p\,d(x,\Omega ^c)^{\beta }\,d\mu (x)\Biggr )^\frac{q}{p}+C\sum _{i=1}^{\infty }\mu (B_i^*)^{\frac{q}{p}\frac{q-p}{q}}\int _{B_i^*}\frac{|u(x)|^q}{d(x,\Omega ^c)^{\frac{q}{p}(p-\beta )}}\,d\mu (x).\end{@align*}}For the first term on the right-hand side, due to the finite overlap of the balls \) Bi*\(, we get\)\(\Biggl (\sum _{i=1}^{\infty }\int _{B_i^*}g(x)^p\,d(x,\Omega ^c)^{\beta }\,d\mu (x)\Biggr )^\frac{q}{p}\le C\biggl (\int _{\Omega }g(x)^p\,d(x,\Omega ^c)^{\beta }\,d\mu (x)\biggr )^\frac{q}{p}.\)\(To estimate the second term, we notice from Lemma~\ref {whitney} that \) Bi*B(x,d(x,c))\(, for every \) xBi*\(. This inclusion together with the finite overlap of the balls \) Bi*\( andinequality~(\ref {eq:(p,q)-weightedhardy}) gives{\begin{@align*}{1}{-1}&\sum _{i=1}^{\infty }\mu (B_i^*)^{\frac{q-p}{p}}\int _{B_i^*}\frac{|u(x)|^q}{d(x,\Omega ^c)^{\frac{q}{p}(p-\beta )}}\,d\mu (x)\\&\qquad \le C\sum _{i=1}^{\infty }\int _{B_i^*} \frac{|u(x)|^{q}}{d(x,\Omega ^c)^{\frac{q}{p}(p-\beta )}}\mu (B(x,d(x,\Omega ^c)))^{\frac{q-p}{p}}\,d\mu (x)\\&\qquad \le C\int _{\Omega }\frac{|u(x)|^q}{d(x,\Omega ^c)^{\frac{q}{p}(p-\beta )}}\mu (B(x,d(x,\Omega ^c)))^{\frac{q-p}{p}}\,d\mu (x)\\&\qquad \le C\biggl (\int _{\Omega }g(x)^p\,d(x,\Omega ^c)^{\beta }\,d\mu (x)\biggr )^\frac{q}{p}.\end{@align*}}After collecting the estimates above, and taking the infimum first over all \) gDp(u)\(and then over all functions \) u\( as above, the claim follows.\)
For \(q\le \frac{Qp}{Q-p}\)  and sufficiently small parameters \(c\) , there is also a
partial converse of Theorem REF . In addition
to the quasiadditivity property in part REF ,
the next result contains the weak quasiadditivity property
in part REF .
Theorem 5.2 
Let \(1<p\le q\le \frac{Qp}{Q-p}\)  and
assume that \(X\)  supports a \((1,s)\) -Poincaré inequality for some \(1<s<p\)  with a dilation constant \(\lambda \) .
Let \(\Omega \subsetneq X\)  be an open set and let \(\mathcal {W}_c(\Omega )=\lbrace B_i:i\in \mathbb {N}\rbrace \)  be a
Whitney cover of \(\Omega \)  with \(0<c<\frac{1}{45\lambda +8}\) .
Then the following conditions are equivalent:

 The \((q,p,\beta )\) -Hardy–Sobolev inequality (REF ) holds in \(\Omega \) .

 There exist constants \(C_1\)  and \(C_2\)  such that
\(\sum _{i=1}^\infty \operatorname{cap}_{p,\beta }(E\cap B_i,\Omega )^{\frac{q}{p}}\le C_1 \operatorname{cap}_{p,\beta }(E,\Omega )^{\frac{q}{p}},\) 
for every set \(E\Subset \Omega \) ,
and the capacity lower bound (REF ) holds with the constant \(C_2\) 
for every ball \(B_i\in \mathcal {W}_c(\Omega )\) .

 There exist constants \(C_1\)  and \(C_2\)  such that
\(\sum _{i\in I} \operatorname{cap}_{p,\beta }( B_{i},\Omega )^{\frac{q}{p}}\le C_1 \operatorname{cap}_{p,\beta }\Biggl (\bigcup _{i\in I} B_{i},\Omega \Biggr )^{\frac{q}{p}},\) 
whenever \(I\subset \mathbb {N}\)  is a finite set,
and the capacity lower bound (REF ) holds with the constant \(C_2\) 
for every ball \(B_i\in \mathcal {W}_c(\Omega )\) .


The implication from REF  to REF  follows from
Lemma REF  and
Theorem REF .
The implication from REF  to REF 
follows
by considering \(E=\bigcup _{i\in I} B_{i}\) .
Assume now that condition REF  holds with a constant \(C_1\) .
To show that REF  holds,
by Theorem REF  it suffices
to prove that there exists a constant \(C\)  such that
\(\int _E \frac{\mu (B(x,d(x,\Omega ^c)))^\frac{q-p}{p}}{d(x,\Omega ^c)^{\frac{q}{p}(p-\beta )}}\,d\mu (x)\le C\operatorname{cap}_{p,\beta }(E,\Omega )^{\frac{q}{p}},\) 
for every set \(E\Subset \Omega \) .
To this end, fix \(E\Subset \Omega \) ,
let \(u\in N^{1,p}_c(\Omega )\)  be such that \(u(x)\ge 1\)  for every \(x\in E\) , and let
\(g\in \mathcal {D}^p(u)\) .
By considering \(\vert u\vert \)  instead of \(u\) , we may assume that \(u\ge 0\)  in \(X\) ;
observe that \(\vert u\vert \in N^{1,p}_c(\Omega )\)  and
\(g\in \mathcal {D}^p(\vert u\vert )\) .
Partition \(\mathcal {W}_c(\Omega )=\lbrace B_i : i\in \mathbb {N}\rbrace \)  into two subfamilies:
\(\mathcal {W}^1 = \lbrace B_i\in \mathcal {W}_c(\Omega ) : u_{B_i} < \tfrac{1}{2}\rbrace \) 
and \(\mathcal {W}^2 = \mathcal {W}_c(\Omega )\setminus \mathcal {W}^1\) .
Observe that \(\mathcal {W}^2\)  is necessarily finite since \(u\in N^{1,p}_c(\Omega )\) .
The left-hand side of (REF ) can be estimated from above by
\(\Bigg (\sum _{B\in \mathcal {W}^1} + \sum _{B\in \mathcal {W}^2}\Bigg )\int _{E\cap B}\frac{\mu (B(x,d(x,\Omega ^c)))^\frac{q-p}{p}}{d(x,\Omega ^c)^{\frac{q}{p}(p-\beta )}}\,d\mu (x).\) 
To estimate the first sum, we
observe that, for every \(B_i\in \mathcal {W}^1\)  and every \(x\in E\cap B_i\) ,
\(\tfrac{1}{2} = 1-\tfrac{1}{2} < u(x) - u_{B_i} = \vert u(x)- u_{B_i}\vert .\) 
By the definition and the properties of Whitney balls, see Lemma REF , if \(B_i\in \mathcal {W}_c(\Omega )\)  and \(x\in B_i\) , then
\(B_i\subset B(x, d(x, \Omega ^c))\quad \text{ and }\quad (1/c-1)r_i\le d(x, \Omega ^c)\le (1/c+1)r_i.\) 
Consequently,
\(\mu (B_i)\le \mu (B(x,d(x,\Omega ^c)))\quad \text{ and }\quad \mu (B(x,d(x,\Omega ^c)))\le C \mu (B_i)\) 
for every \(x\in B_i\) .
Since \(X\)  supports a \((1,s)\) -Poincaré inequality for \(1<s<p\)  with the dilation constant \(\lambda \) , then \(X\)  supports a \((1,p)\) -Poincaré inequality with the same dilation constant \(\lambda \) , and hence the \((q,p)\) -Poincaré inequality with the dilation constant \(2\lambda \) ; see [1]}.
The observations above lead to the estimates
\(\sum _{B\in \mathcal {W}^1} \int _{E\cap B} \frac{\mu (B(x,d(x,\Omega ^c)))^{\frac{q-p}{p}}}{d(x,\Omega ^c)^{\frac{q}{p}(p-\beta )}}\,d\mu (x)&\le C \sum _{B_i\in \mathcal {W}^1} \frac{\big (\mu (B_i)r_i^\beta \big )^{\frac{q}{p}}}{r_i^{q}} \mathop {\mathchoice{\displaystyle }{\hspace{0.0pt}}{0}{.}22\hrule width 0.6}\hspace{0.0pt}\) 
Bi u(x)- uBiq d(x)
 C BiW1 ((Bi)ri)qpriq riq (2Bi g(x)p  d(x))q p
 C (BW12B g(x)p  d(x, c) d(x))q p
 C ( g(x)p  d(x, c) d(x))q p.

The last inequality follows from the finite overlap of dilated Whitney balls \(2\lambda B\)  which is guaranteed by the relation between \(c\)  and \(\lambda \)  in the formulation of the theorem.
To estimate the second sum in (REF ),
let \(B_i=B(x_i,r_i)\in \mathcal {W}^2\)  and \(x\in B_i\) . Recall that \(r_i=c d(x_i,\Omega ^c)\) ,
where \(c<\tfrac{1}{45\lambda +8}<\tfrac{1}{20}\) .
Choose a number \(t\)  such that
\(\frac{18c}{1-2c}<t<\frac{6}{15\lambda +2}\) ; then, in particular, \(0<t<1\) .
Let \(\mathcal {W}_{t/18}(\Omega )=\lbrace B(x^{\prime }_j,r^{\prime }_j) : j\in \mathbb {N}\rbrace \)  be a Whitney cover of \(\Omega \) ,
\(\lbrace \varphi _j\rbrace \)  be a partition of unity related to \(\mathcal {W}_{t/18}(\Omega )\) ,
and \(u_t\)  be the the discrete convolution of \(u\ge 0 \)  at scale \(t\)  as
in (REF ). Then \(x\in B(x^{\prime }_j,r^{\prime }_j)\)  for some \(j\in \mathbb {N}\) 
and the choice of \(t\)  guarantees that \(r_i\le r^{\prime }_j\) , since by property (3) of Lemma REF  we have
\((1/c-1)r_i\le d(x,\Omega ^c)\le (18/t+1)r^{\prime }_j,\) 
which implies
\(r_i\le \frac{18/t+1}{1/c-1}r^{\prime }_j\le r^{\prime }_j.\) 
Similarly, we obtain that \(r_j^{\prime }\le Cr_i\) , for some \(C>0\) , since
\((18/t-1)r^{\prime }_j\le d(x,\Omega ^c)\le (1/c+1)r_i.\) 
By the definition of the discrete convolution \(u_t\) , properties of functions \(\varphi _j\) ,
the inclusion
\(B(x_i,r_i)\subset B(x^{\prime }_j,3r^{\prime }_j)\)  (from \(r_i\le r^{\prime }_j\) ),
and the doubling condition for measure \(\mu \) , we obtain
\(\begin{split}u_t(x) & \ge \varphi _j(x)\mathop {\mathchoice{\displaystyle }{\hspace{0.0pt}}{0}{.}22\hrule width 0.6}\hspace{0.0pt}\end{split}{\textstyle }\hspace{0.0pt}\hrule width 0.6\) 
B(x'j,3r'j) u(y) d(y)
CB(x'j,3r'j) u(y) d(y)
 C B(xi,ri) u(y) d(y) C uBi C2,


where \(C\)  depends on \(\lambda \) , \(c\) , and the doubling constant of the measure \(\mu \) .
Since \(u\in N^{1,p}_c(\Omega )\) , we have that \(u\in L^p(X;d\mu )\) , and hence \(u_t\in L^p(X;d\mu )\) ;
see the comment before Lemma REF . Furthermore, by Lemma REF  the set \(\mathcal {D}^p(u_t)\)  is nonempty, and
as the sum in (REF ) has only finitely many non-zero terms for \(u\in N^{1,p}_c(\Omega )\) , the support of \(u_t\) 
is bounded and has a positive distance to \(\Omega ^c\) . Thus we conclude that \(u_t\in N^{1,p}_c(\Omega )\) .
By (REF ) there exists \(C_2>0\)  such that \(C_2u_t\ge 1\)  in \(\bigcup _{B\in \mathcal {W}^2} B\) .
Hence, \(C_2 u_t\)  is a capacity test function for
\(\operatorname{cap}_{p,\beta }\bigl (\bigcup _{B\in \mathcal {W}^2} B,\Omega \bigr )\) . Since \(t<6/(15\lambda +2)\) , we can choose
\(0<\kappa < 1/5\)  such that \(t<6\kappa /(3\lambda +2\kappa )\) , and, by
Lemma REF , there is a constant \(C_3\)  such that
\(C_3({{\mathcal {M}}}_{\Omega ,\kappa }g^s)^{1/s}\in \mathcal {D}^p(u_t)\) .
Let \(B_i=B(x_i,r_i)\in \mathcal {W}^2\) .
By inequalities (REF ) and (REF ), it follows that
\(\int _{E\cap B_i} \frac{\mu (B(x,d(x,\Omega ^c)))^{\frac{q-p}{p}}}{d(x,\Omega ^c)^{\frac{q}{p}(p-\beta )}}\,d\mu (x)& \le C\mu (B_i)^{\frac{q}{p}-1} \int _{E\cap B_i}d(x,\Omega ^c)^{\frac{q}{p}(\beta -p)}\,d\mu (x)\\& \le C\big (\mu (B_i)r_i^{\beta -p}\big )^{q/p}\le C\operatorname{cap}_{p,\beta }(B_i,\Omega )^{q/p}.\) 

Since \(\mathcal {W}^2\)  is finite, we obtain
from the assumed condition REF 
that
\(\sum _{B\in \mathcal {W}^2}\int _{E\cap B} \frac{\mu (B(x,d(x,\Omega ^c)))^\frac{q-p}{p}}{d(x,\Omega ^c)^{\frac{q}{p}(p-\beta )}}\,d\mu (x)&\le C \sum _{B\in \mathcal {W}^2} \operatorname{cap}_{p,\beta }(B,\Omega )^{\frac{q}{p}}\\&\le C \operatorname{cap}_{p,\beta }\Biggl (\bigcup _{B\in \mathcal {W}^2} B,\Omega \Biggr )^{\frac{q}{p}}\\&\le C \biggl (\int _{\Omega } ({{\mathcal {M}}}_{\Omega ,\kappa } g^s(x))^{p/s}\,d(x, \Omega ^c)^\beta \,d\mu (x)\biggr )^{\frac{q}{p}}\\&\le C \biggl (\int _{\Omega } g(x)^p\,d(x, \Omega ^c)^\beta \,d\mu \biggr )^{\frac{q}{p}},\) 

where the last inequality is valid since \(s<p\) , and thus the maximal operator \({{\mathcal {M}}}_{\Omega ,\kappa }\)  is bounded on \(L^{p/s}(\Omega ,w_{\beta }\,d\mu )\)  by Lemma REF .
By combining the estimates for \(\mathcal {W}^1\)  and \(\mathcal {W}^2\) 
we obtain
\(\begin{split}\int _E \frac{\mu (B(x,d(x,\Omega ^c)))^\frac{q-p}{p}}{d(x,\Omega ^c)^{\frac{q}{p}(p-\beta )}}\,d\mu (x)& \le \sum _{B\in \mathcal {W}} \int _{E\cap B}\frac{\mu (B(x,d(x,\Omega ^c)))^\frac{q-p}{p}}{d(x,\Omega ^c)^{\frac{q}{p}(p-\beta )}}\,d\mu (x)\\&\le C\biggl (\int _{\Omega }g(x)^p\,d(x, \Omega ^c)^\beta \,d\mu \biggr )^{\frac{q}{p}}.\end{split}\) 
The desired estimate (REF ) follows
by taking infimum over all \(g\in \mathcal {D}^p(u)\)  and then over all functions
\(u\)  as above.
Theorem REF  gives the
following implication for the validity
of \((q,p,\beta )\) -Hardy–Sobolev inequalities for different values of
the parameter \(q\) . Observe that this is not completely obvious from the
statement of the Hardy–Sobolev inequality.
Remark 5.3 
Let \(1<p\le q<p^*=\frac{Qp}{Q-p}\)  and \(\beta \in \mathbb {R}\) , and
assume that \(X\)  supports a \((1,s)\) -Poincaré inequality for some \(1<s<p\) .
If a \((q,p,\beta )\) -Hardy–Sobolev inequality holds in an open set \(\Omega \subsetneq X\) ,
then also \((q^{\prime },p,\beta )\) -Hardy–Sobolev inequalities hold in \(\Omega \)  for every \(q\le q^{\prime } \le p^*\) .
This follows from Theorem REF  and the fact that if \(q\le q^{\prime }\) , then
\(\Biggl (\sum _{i=1}^\infty \operatorname{cap}_{p,\beta }(E\cap B_i,\Omega )^{\frac{q^{\prime }}{p}}\Biggr )^{\frac{p}{q^{\prime }}}\le \Biggl (\sum _{i=1}^\infty \operatorname{cap}_{p,\beta }(E\cap B_i,\Omega )^{\frac{q}{p}}\Biggr )^{\frac{p}{q}}\) 
whenever \(E\subset \Omega \)  and
\(\mathcal {W}_c(\Omega )=\lbrace B_i:i\in \mathbb {N}\rbrace \)  is a
Whitney cover of \(\Omega \) .

Special cases and examples
The main results of the paper are obtained under the assumption that the measure \(\mu \)  is doubling. In particular,
\(\mu \)  satisfies for some \(Q>0\)  the inequality
\(\frac{\mu (B(y,r))}{\mu (B(x,R))}\ge C\Bigl (\frac{r}{R}\Bigr )^Q,\) 
whenever \(0<r\le R<\operatorname{diam}X\)  and \(y\in B(x,R)\) .
If \(X\)  is connected
(this is guaranteed in our setting by the Poincaré inequalities), then there exists
also a constant \(Q_u\)  satisfying \(0<Q_u\le Q\)  and such that
\(\frac{\mu (B(y,r))}{\mu (B(x,R))}\le C\Bigl (\frac{r}{R}\Bigr )^{Q_u},\) 
whenever \(0<r\le R<\operatorname{diam}X\)  and \(y\in B(x,R)\) ; see e.g. [1]}.
If there are uniform upper and lower bounds for the measures of
the balls, that is,
\(C^{-1} r^Q\le \mu (B(x,r))\le C r^Q\) 
for every \(x\in X\)  and all \(0<r<\operatorname{diam}(X)\) , the measure \(\mu \)  is said
to be Ahlfors \(Q\) -regular.
The above exponent \(Q>0\)  plays the same role as \(n\)  does in \(\mathbb {R}^n\) .
In the \(Q\) -regular case
the \((q,p,\beta )\) -Hardy–Sobolev inequality (REF ) can be written in a simpler form
\(\biggl (\int _{\Omega } |u(x)|^q d(x,\Omega ^c)^{\frac{q}{p}(Q-p+\beta )-Q} \,d\mu (x)\biggr )^{\frac{1}{q}}\le C\biggl (\int _{\Omega } g(x)^p \,d(x,\Omega ^c)^{\beta }\,d\mu \biggr )^{\frac{1}{p}},\) 
and Theorem REF  implies the following characterization.
In \(X=\mathbb {R}^n\)  (equipped with the usual Euclidean distance and the Lebesgue measure),
the corresponding result in terms of Whitney cubes has been considered in [3]}
in the unweighted case \(\beta =0\) ,
but the weighted result is new even in \(\mathbb {R}^n\) .
Since \(N^{1,p}(\mathbb {R}^n)=W^{1,p}(\mathbb {R}^n)\)  and \(\mathbb {R}^n\)  supports \((1,s)\) -Poincaré inequalities for every \(s\ge 1\)  with \(\lambda =1\) ,
Theorem REF  follows from Corollary REF .
Corollary 6.1 
Let \(X\)  be a metric space equipped with an Ahlfors \(Q\) -regular measure \(\mu \)  and let \(1<p\le q\le \frac{Qp}{Q-p}\) .
Assume that \(X\)  supports a \((1,s)\) -Poincaré inequality for some \(1<s<p\)  with a dilation constant \(\lambda \) . Let \(\mathcal {W}_c(\Omega )=\lbrace B_i:i\in \mathbb {N}\rbrace \) , \(B_i=(x_i,r_i)\) , be a
Whitney cover of an open set \(\Omega \subsetneq X\) ,
with \(0<c<\frac{1}{45\lambda +8}\) .
Then the following conditions are equivalent:

 Hardy–Sobolev inequality (REF ) holds in \(\Omega \) .

 There exist constants \(C_1\)  and \(C_2\)  such that
\(\sum _{i=1}^\infty \operatorname{cap}_{p,\beta }(E\cap B_i,\Omega )^{\frac{q}{p}}\le C_1 \operatorname{cap}_{p,\beta }(E,\Omega )^{\frac{q}{p}},\) 
for every set \(E\Subset \Omega \) , and \(\operatorname{cap}_{p,\beta }(B_i,\Omega ) \ge C_2 r_i^{Q+\beta -p}\)  for every \(i\in \mathbb {N}\) .

 There exist constants \(C_1\)  and \(C_2\)  such that
\(\sum _{i\in I} \operatorname{cap}_{p,\beta }( B_{i},\Omega )^{\frac{q}{p}}\le C_1 \operatorname{cap}_{p,\beta }\Biggl (\bigcup _{i\in I} B_{i},\Omega \Biggr )^{\frac{q}{p}},\) 
whenever \(I\subset \mathbb {N}\)  is a finite set, and \(\operatorname{cap}_{p,\beta }(B_i,\Omega ) \ge C_2 r_i^{Q+\beta -p}\)  for every \(i\in \mathbb {N}\) .


When \(1<p<Q\)  and \(\beta =0\) ,
the capacity lower bound
\(\operatorname{cap}_{p}(B,\Omega )\ge C r^{Q-p}\) 
holds for all Whitney balls
\(B=B(x,r)\in \mathcal {W}_c(\Omega )\) , at least if
\(X\)  is unbounded or \(\operatorname{diam}(\Omega ) < \frac{1}{4}\operatorname{diam}(X)\) ;
see [4]}
and [5]} for details.
Here \(\operatorname{cap}_{p}(B,\Omega )= \operatorname{cap}_{p,0}(B,\Omega )\) .
(More generally, the capacity lower bound (REF )
holds in the unweighted case \(\beta =0\)  if \(1<p<Q_u\) , by the same references.)
Consequently, in certain cases,
for instance if \(X\)  is an unbounded \(Q\) -regular space
and \(1<p<Q\) , \(\beta =0\) , there is no need to assume the capacity lower bound in conditions REF  and REF  in Corollary REF . This also shows that
the weighted capacity lower bound (REF ), for every Whitney ball, is not alone sufficient for the
\((q,p,\beta )\) -Hardy–Sobolev inequality in Theorem REF .
For instance, consider \(X=\mathbb {R}^n\)  equipped with the usual Euclidean distance and the Lebesgue measure.
Then \(Q=n\) , and
for every \(1<p<n\)  and \(p\le q < \frac{np}{n-p}\) 
there are open sets where the \((q,p,0)\) -Hardy–Sobolev inequality does not hold.
When \(1<p=q<n\) , one such an example is given by the complement of any (non-empty) Ahlfors \((n-p)\) -regular set,
by [6]};
see also [7]} for counterexamples in more general cases.
On the other hand, even if the capacity lower bound (REF )
is not always needed,
it is not possible to remove this part
from conditions REF  and REF  in Theorem REF .
This is illustrated by the next example.
Example 6.2 Consider \(X=\mathbb {R}^n\) , equipped with the usual Euclidean distance and the Lebesgue measure.
Then \(N^{1,p}(\mathbb {R}^n)=W^{1,p}(\mathbb {R}^n)\) , and \(\vert \nabla u\vert \in \mathcal {D}_p(u)\)  if
\(u\in W^{1,p}(\mathbb {R}^n)\) ; see e.g. [1]}.
Let \(1<p<\infty \)  and \(\beta \ge 0\) ,
and choose \(\Omega =B(0,1)\subset \mathbb {R}^n\) . For every \(j\in \mathbb {N}\) , let
\(u_j\)  be a Lipschitz continuous function in \(\mathbb {R}^n\) ,
satisfying the following properties:
\(u_j=1\)  in \(B(0,1-2^{-j})\) ,
\(u_j=0\)  in \(\mathbb {R}^n\setminus B(0,1-2^{-j-1})\) ,
and \(\vert \nabla u\vert \le 2^{j+1}\)  almost everywhere in
\(A_j=B(0,1-2^{-j-1})\setminus B(0,1-2^{-j})\) .
Then we have for every \(j\in \mathbb {N}\)  that
\(u_j\in W_0^{1,p}(\Omega )\) 
has a compact support in \(\Omega \)  and
\(\int _{\Omega } \vert \nabla u_j(x)\vert ^p \,d(x,\Omega ^c)^{\beta }\,d\mu \le \mu (A_j)2^{(j+1)p}2^{-j\beta } \le C 2^{-j(1-p+\beta )}.\) 
If \(\beta >p-1\) , then \(2^{-j(1-p+\beta )}\rightarrow 0\)  as \(j\rightarrow \infty \) .
Let \(\mathcal {W}_c(\Omega )=\lbrace B_i:i\in \mathbb {N}\rbrace \)  be a
Whitney cover of \(\Omega \) .
When \(i\in \mathbb {N}\)  is fixed,
the functions \(u_j\)  are test functions
for the capacity \(\operatorname{cap}_{p,\beta }(B_i,\Omega )\)  for all sufficiently large \(j\) .
Thus the above computation shows that if \(\beta > p-1\) ,
then \(\operatorname{cap}_{p,\beta }(B_i,\Omega )=0\)  for all Whitney balls \(B_i\in \mathcal {W}_c(\Omega )\) ,
and so the capacity lower bound (REF ) does not hold in this case.
Lemma REF  (or a direct computation for the functions \(u_j\) )
implies that neither does the \((q,p,\beta )\) -Hardy–Sobolev inequality hold when \(\beta >p-1\) .
Nevertheless, the quasiadditivity property
\(\sum _{i\in \mathbb {N}} \operatorname{cap}_{p,\beta }(E\cap B_i,\Omega )^{\frac{q}{p}} \le C \operatorname{cap}_{p,\beta }(E,\Omega )^{\frac{q}{p}}\) 
holds trivially
for every set \(E\Subset \Omega \) , since all the terms on the left-hand side are zero.
This shows that
in addition to the quasiadditivity property, also
the capacity lower bound is really needed in assertions
REF  and REF 
of Theorem REF 
and in the corresponding assertions of Corollary REF .

