Existence and almost uniqueness for $p$-harmonic Green functions on bounded domains in metric spaces

We study ($p$-harmonic) singular functions, defined by means of upper gradients, in bounded domains in metric measure spaces. It is shown that singular functions exist if and only if the complement of the domain has positive capacity, and that they satisfy very precise capacitary identities for superlevel sets. Suitably normalized singular functions are called Green functions. Uniqueness of Green functions is largely an open problem beyond unweighted $\mathbf{R}^n$, but we show that all Green functions (in a given domain and with the same singularity) are comparable. As a consequence, for $p$-harmonic functions with a given pole we obtain a similar comparison result near the pole. Various characterizations of singular functions are also given. Our results hold in complete metric spaces with a doubling measure supporting a $p$-Poincar\'e inequality, or under similar local assumptions.


Introduction
Let Ω ⊂ R n be a bounded domain, and let x 0 ∈ Ω. Then u is a p-harmonic Green function in Ω with singularity at x 0 if ∆ p u := div(|∇u| p−2 ∇u) = −δ x0 in Ω (1.1) with zero boundary values on ∂Ω (in Sobolev sense), where δ x0 is the Dirac measure at x 0 . Such a Green function is in particular p-harmonic in Ω \ {x 0 } and p-superharmonic in the whole domain Ω. If 1 < p ≤ n, it is also unbounded. In metric measure spaces, Holopainen-Shanmugalingam [32] gave a definition of singular functions, which behave similarly to the Green functions in R n . In this paper we introduce a simpler definition of singular functions, and then define Green functions as suitably normalized singular functions. See Section 12 for the definition from [32] and for a discussion on the relation between these different definitions.
In a metric measure space X = (X, d, µ) there is (a priori) no equation available for defining p-harmonic functions, and they are instead defined as local minimizers of the p-energy integral where g u is the minimal p-weak upper gradient of u, see Definition 2.1. This definition of p-harmonic functions is in, e.g., R n equivalent to the definition using the p-Laplace operator ∆ p u. There is actually some redundancy in this definition under very mild assumptions, see Theorem 1.6 and Remark 6.3. Singular functions are sometimes called Green functions in the literature, and vice versa. Moreover they can be normalized, or pseudonormalized, in different ways. For Green functions, we require the following precise normalization in terms of the variational capacity of superlevel sets.
In fact, it follows that Green functions u satisfy where Ω a = {x ∈ Ω : u(x) > a} and we interpret ∞ 1−p as 0, see Theorem 9.3. In unweighted R n , the study of singular and (p-harmonic) Green functions with p = 2 goes back to Serrin [41], [42]. On domains in weighted R n (with a p-admissible weight) the existence of singular functions follows from Heinonen-Kilpeläinen-Martio [28,Theorem 7.39]. (Instead of (S5) they showed that condition (b.2) in Theorem 7.2 holds, but in view of Theorem 7.2 this establishes the existence of singular functions in our sense.) The classical p-harmonic Green functions defined by (1.1) in unweighted Euclidean domains (and similarly for domains in weighted R n with a p-admissible weight) coincide with the Green functions given by Definition 1.2, see Remark 9.4. Uniqueness of Green functions in unweighted Euclidean domains was for p = 2 established by Kichenassamy-Veron [35] (see Section 9), but is not really known beyond that. In particular, it remains open in weighted R n . However, Holopainen [31,Theorem 3.22] proved uniqueness in regular relatively compact domains in n-dimensional Riemannian manifolds (equipped with their natural measures) when p = n. Moreover, in Balogh-Holopainen-Tyson [2], uniqueness was shown for global Qharmonic Green functions in Carnot groups of homogeneous dimension Q.
In this paper we show the existence of singular functions and also of Green functions satisfying the precise normalization (1.2), or equivalently (1.3), under the following standard assumptions on the metric measure space X; see Section 2 for the relevant definitions.
We make the following general assumptions in the theorems in the introduction: Let 1 < p < ∞ and assume that X is a complete metric space equipped with a doubling measure µ supporting a p-Poincaré inequality. Let Ω ⊂ X be a bounded domain and let x 0 ∈ Ω.
These assumptions are fulfilled in weighted R n equipped with a p-admissible measure, on Riemannian manifolds and Carnot-Carathéodory spaces equipped with their natural measures, and in many other situations, see Sections 2 and 13 for further details. Actually, the above assumptions on the space X can be relaxed to similar local assumptions. The same applies also to our other results, see Section 11 for details.
The following theorem summarizes some of our main results.
(a) There exists a Green function (or equivalently, in view of (b), a singular function) in Ω with singularity at x 0 if and only if C p (X \ Ω) > 0 (which is always true if X is unbounded ). (b) If u is a singular function in Ω with singularity at x 0 , then there is a unique α > 0 such that αu is a Green function. (c) If u and v are two Green functions in Ω with singularity at x 0 , then u ≃ v, (1.4) where the comparison constants depend only on p, the doubling constant and the constants in the Poincaré inequality. If moreover C p ({x 0 }) > 0, then u = v and it is a multiple of the capacitary potential for {x 0 } in Ω.
When C p ({x 0 }) = 0, Theorem 1.3 (c) gives almost uniqueness of Green functions, and in particular shows that all Green functions have the same growth behaviour near the singularity. As mentioned above, uniqueness of Green functions is not known even in weighted R n (when C p ({x 0 }) = 0). The next result shows that (1.4) is strong enough to make p-harmonic functions into singular ones, provided that C p ({x 0 }) = 0. Theorem 1.4. Assume that C p ({x 0 }) = 0. Let u be a singular function in Ω with singularity at x 0 , and let v : Ω → (0, ∞] be a function which is p-harmonic in Then v is a singular function in Ω with singularity at x 0 if and only if v ≃ u. Holopainen-Shanmugalingam [32] provided a construction of singular functions (according to their definition); see however Remark 12.2. We show in Proposition 12.3 that, under the assumptions used in [32], the definition therein is essentially equivalent to Definition 1.1, up to a normalization. Hence we also recover the existence of singular functions according to the definition in [32]. Nevertheless, Definition 1.1 seems to be both more general and more flexible, and hence better suited e.g. for studying the existence and uniqueness of singular and Green functions. In particular, the definition in [32] contains explicit superlevel set inequalities, whereas we show in Lemma 9.1 that a precise superlevel set identity is a consequence of the properties assumed in Definition 1.1. The absence of any a priori superlevel set requirements makes it easy to apply our results to general p-harmonic functions with poles, see Theorem 10.1.
From the superlevel set property we in turn obtain the following pointwise estimate for Green functions near their singularities. Theorem 1.5. If u is a Green function in Ω with singularity at x 0 , then for all r > 0 such that B 50λr ⊂ Ω and all x ∈ ∂B r , u(x) ≃ cap p (B r , Ω) 1/(1−p) , (1.5) where the comparison constants depend only on p, the doubling constant and the constants in the Poincaré inequality. Here λ is the dilation constant in the p-Poincaré inequality.
In weighted R n (with a p-admissible weight), (1.5)  We also establish various useful characterizations for singular functions. Theorems 1.4 and 1.6 contain some of these, but in Sections 7-9 we obtain several additional characterizations, which are either more technical to state or which only hold in one of the cases C p ({x 0 }) = 0 or C p ({x 0 }) > 0. Theorem 1.6. Assume that C p (X \ Ω) > 0 and let u : Ω → (0, ∞]. Then the following are equivalent : (a) u is a singular function in Ω with singularity at x 0 ; (b) u satisfies (S1), (S2) and (S5); (c) u(x 0 ) = lim x→x0 u(x) and u satisfies (S2) and (S5).
The outline of the paper is as follows. We begin in Section 2 by recalling the basic definitions related to the analysis on metric spaces. In Section 3 we establish sharp superlevel set formulas for capacitary potentials. Such a formula was obtained in weighted R n (with a p-admissible weight) in Heinonen-Kilpeläinen-Martio [28, p. 118]. Their argument depends on the Euler-Lagrange equation, which is not available in the metric space setting considered here. Nevertheless, we are able to obtain this formula with virtually no assumptions on the metric space nor on the sets involved, and at the same time the proof is considerably shorter than the one in [28, pp. 116-118]. See Section 3 for more details.
Section 4 contains a discussion about (super)harmonic functions in the metric setting, while in Section 5 we obtain, with the help of harmonic extensions and Perron solutions, some finer properties for these functions and, in particular, for capacitary potentials.
The actual study of singular and Green functions begins in Section 6, where we record some easy observations concerning singular functions. Sections 7 and 8 contain proofs for the existence and further properties of singular functions under the respective assumptions that C p ({x 0 }) = 0 or C p ({x 0 }) > 0. Then, in Section 9, we establish a sharp superlevel set property for superharmonic functions and show how this property yields the existence of Green functions. In Section 10 we study the growth behaviour of p-harmonic functions with poles. Local assumptions are discussed in Section 11, and in Section 12 we compare our definitions and results with those in Holopainen-Shanmugalingam [32].
By the theory of Cheeger [21], it is possible to use also a PDE approach to the study of singular and Green functions in metric spaces satisfying the standard assumptions. In Section 13 we show that in this setting the Cheeger-Green functions, based on Definition 1.2, actually satisfy an equation corresponding to (1.1) and hence the situation is analogous to that in (weighted) R n . Note, however, that Cheeger p-(super)harmonic functions, and thus also the corresponding singular and Green functions, differ in general from those defined by means of upper gradients. Acknowledgement. A.B. and J.B. were supported by the Swedish Research Council, grants 2016-03424 and 621-2014-3974, respectively. J.L. was supported by the Academy of Finland, grant 252108.

Preliminaries
We assume throughout the paper that 1 < p < ∞ and that X = (X, d, µ) is a metric space equipped with a metric d and a positive complete Borel measure µ such that 0 < µ(B) < ∞ for all balls B ⊂ X. The σ-algebra on which µ is defined is obtained by the completion of the Borel σ-algebra. It follows that X is separable. To avoid pathological situations we assume that X contains at least two points.
Next we are going to introduce the necessary background on Sobolev spaces and capacities in metric spaces. Proofs of most of the results mentioned in this section can be found in the monographs Björn-Björn [8] and Heinonen-Koskela-Shanmugalingam-Tyson [30].
A curve is a continuous mapping from an interval, and a rectifiable curve is a curve with finite length. We will only consider curves which are nonconstant, compact and rectifiable, and thus each curve can be parameterized by its arc length ds. A property is said to hold for p-almost every curve if it fails only for a curve family Γ with zero p-modulus, i.e. there exists 0 ≤ ρ ∈ L p (X) such that γ ρ ds = ∞ for every curve γ ∈ Γ.
We begin with the notion of p-weak upper gradients as defined by Koskela-MacManus [40], see also Heinonen-Koskela [29].
where we follow the convention that the left-hand side is ∞ whenever at least one of the terms therein is ±∞.
If f has an upper gradient in L p loc (X), then it has an a.e. unique minimal pweak upper gradient g f ∈ L p loc (X) in the sense that for every p-weak upper gradient g ∈ L p loc (X) of f we have g f ≤ g a.e. Following Shanmugalingam [43], we define a version of Sobolev spaces on the metric space X.
where the infimum is taken over all p-weak upper gradients of f . The Newtonian space on X is , is a Banach space and a lattice. In this paper we assume that functions in N 1,p (X) are defined everywhere, not just up to an equivalence class in the corresponding function space. This is needed for the definition of p-weak upper gradients to make sense. For a measurable set A ⊂ X, the Newtonian space N 1,p (A) is defined by considering (A, d| A , µ| A ) as a metric space in its own right. If f, h ∈ N 1,p loc (X), then Definition 2.3. The Sobolev capacity of an arbitrary set E ⊂ X is where the infimum is taken over all u ∈ N 1,p (X) such that u ≥ 1 on E. We say that a property holds quasieverywhere (q.e.) if the set of points for which it fails has Sobolev capacity zero.
The capacity is the correct gauge for distinguishing between two Newtonian functions. If u ∈ N 1,p (X), then u ∼ v if and only if u = v q.e. Moreover, if u, v ∈ N 1,p loc (X) and u = v a.e., then u = v q.e. Both the Sobolev and the variational capacity (defined below in Definition 3.1) are countably subadditive.
If A = X, we omit X in the notation and write N 1,p 0 (E). Whenever convenient, we regard functions in N 1,p 0 (E; A) as extended by zero to A \ E.
The measure µ is doubling if there is a constant C > 0 such that for all balls B(x, r) = {y ∈ X : d(x, y) < r}, we have µ(B(x, 2r)) ≤ Cµ(B(x, r)). (2.1) The space X (or the measure µ) supports a p-Poincaré inequality if there exist constants C > 0 and λ ≥ 1 such that for all balls B = B(x, r) ⊂ X, all integrable functions u on X, and all p-weak upper gradients g of u, where u B := B u dµ := B u dµ/µ(B) is the integral average and λB stands for the dilated ball B(x, λr). If X is complete and µ is a doubling measure supporting a p-Poincaré inequality, then functions in N 1,p (X) and those in N 1,p (Ω), for open Ω ⊂ X, are quasicontinuous. This will be important in Theorem 5.2, but affects also how we formulate various statements, such as the definition of the Sobolev capacity above.
If X = R n is equipped with dµ = w dx, then w ≥ 0 is a p-admissible weight in the sense of Heinonen-Kilpeläinen-Martio [28] if and only if µ is a doubling measure which supports a p-Poincaré inequality, see Corollary 20.9 in [28] (which is only in the second edition) and Proposition A.17 in [8]. In this case, N 1,p (R n ) and N 1,p (Ω) are the refined Sobolev spaces defined in [28, p. 96], and moreover our Sobolev and variational capacities coincide with those in [28]; see Björn-Björn [ Unless otherwise stated, we always allow the implicit comparison constants to depend on the standard parameters, such as p, the doubling constant and the constants in the Poincaré inequality.

Superlevel identities for capacitary potentials
where the infimum is taken over all u ∈ N 1,p (X) such that u ≥ 1 on E and u = 0 on X \ A. If no such function u exists then cap p (E, A) = ∞.
One can equivalently take the above infimum over all u ∈ N 1,p (X) such that u ≥ 1 q.e. on E and u = 0 q.e. on X \ A; we call such u admissible for the capacity cap p (E, A).
Since A is not required to be measurable we cannot take the integral in (3.1) over A, and it is also important that the minimal p-weak upper gradient of u is taken with respect to X. However, if A is open then the integral and the minimal p-weak upper gradient can equivalently be taken over A. Provided that cap p (E, A) < ∞, there is always a minimizer u, i.e. a capacitary potential, by Theorem 5.13 in Björn-Björn [10]; this fact holds with no assumptions on the space. If cap p (E, A) = ∞, there is no admissible function and hence there cannot be any capacitary potential. Note that if dist(E, X \ A) > 0, then cap p (E, A) < ∞. Since u is a minimizer, we have Under rather mild assumptions, capacitary potentials are unique up to sets of Sobolev capacity zero, see [10,Theorem 5.13]. For more about capacitary potentials, see also Lemmas 5.5 and 5.6 below and the comment preceding them. One of the crucial ingredients in our estimates for Green functions is the following capacity formula for superlevel sets of capacitary potentials. Theorem 3.3. Assume that E ⊂ A are bounded sets such that cap p (E, A) < ∞ and let u be a capacitary potential of (E, A). Let A a = {x ∈ A : u(x) > a} and A a = {x ∈ A : u(x) ≥ a}. Then We reduce the proof of Theorem 3.3 to the following special cases. Lemma 3.4. Assume that E ⊂ A are bounded sets such that cap p (E, A) < ∞ and let u be a capacitary potential of (E, A). Let A a = {x ∈ A : u(x) > a} and A a = {x ∈ A : u(x) ≥ a}. Then The first identity (3.3) was obtained for open A in weighted R n (with a padmissible weight) in Heinonen-Kilpeläinen-Martio [28, p. 118]. Their argument depends on the Euler-Lagrange equation, which is not available in the metric space setting considered here. Nevertheless, the weaker estimate was obtained for open A in metric spaces in Björn-MacManus-Shanmugalingam [19,Lemma 5.4] using a variational approach. Our proof is also based on the variational method, and still yields the exact identity in the metric space setting, with virtually no assumptions whatsoever on the metric space, but is at the same time shorter than the proofs in [28, pp. 116-118] and [19].
For open A in complete metric spaces equipped with a doubling measure supporting a p-Poincaré inequality, the identities (3.3) and (3.4) were recently obtained in Aikawa-Björn-Björn-Shanmugalingam [1] using similar ideas as here.
Proof of Lemma 3.4. The identities for a = 0 and a = 1 are rather immediate, so assume that 0 < a < 1.
Note that both u 1 = 1 and u 2 = 1 q.e. on E. It follows that for each t ∈ [0, 1], the function tu 1 + (1 − t)u 2 is admissible in the definition of cap p (E, A). Since for a.e. x ∈ X, either g u1 = 0 or g u2 = 0, we obtain (using also (3.2)) that with equality for t = a. Denote the above integrals by I, I 1 and I 2 , respectively. If u 1 were not a capacitary potential of (A a , A), then we could replace u 1 by a capacitary potential v of (A a , A) on the right-hand side above. This would yield a strictly smaller right-hand side when t = a, contradicting the fact that we have equality throughout with u 1 on the right-hand side when t = a. Hence u 1 is a capacitary potential of (A a , A) and I 1 = cap p (A a , A). Similarly, u 2 is a capacitary potential of (E ∩ A a , A a ) and Next, we rewrite (3.7) and the equality in it as In particular, t → t p I 1 + (1 − t) p I 2 attains its minimum for t = a. Differentiating with respect to t and letting t = a we thus obtain that a p−1 I 1 = (1 − a) p−1 I 2 .
Inserting this and t = a into (3.8) yields I = a p I 1 + a p−1 (1 − a)I 1 = a p−1 I 1 , proving (3.3) and (3.6). As u = 1 q.e. on E, we see that which together with (3.6) shows that (3.5) holds. The proof of (3.4) is similar to the proof of (3.5). It also follows that u 1 and u 2 are capacitary potentials of (A a , A) and (E ∩ A a , A a ), respectively.
Proof of Theorem 3.3. We prove the identity for cap p (A b , A a ); the other identities are shown similarly. By Lemma 3.4, u 1 = min{u/b, 1} is a capacitary potential of (A b , A). Since u > a if and only if u 1 > a/b, we get using first (3.6), with E replaced by A b , and then (3.3) that

p-harmonic and superharmonic functions
From now on, but for Sections 10-12, we assume that X is complete, µ is doubling and supports a p-Poincaré inequality, Ω ⊂ X is a nonempty open set, and x 0 ∈ Ω is a fixed point. We also write B r = B(x 0 , r) for r > 0. As always in this paper, Since X is complete and µ is doubling, X is also proper, i.e. bounded closed sets are compact. It moreover follows from the assumptions that X is quasiconvex (see e.g. [8,Theorem 4.32]), and thus connected and locally connected. These facts will be important to keep in mind. By Keith-Zhong [34, Theorem 1.0.1], X supports a q-Poincaré inequality for some q < p. This is assumed explicitly in some of the papers we refer to below.
In this section we recall the definitions of p-harmonic and superharmonic functions and present some of their important properties that will be needed later. For proofs of the facts not proven in this section, we refer to the monograph Björn-Björn [8]. The following definition of (super)minimizers is one of several equivalent versions in the literature, cf. Björn [4, Proposition 3.2 and Remark 3.3].
A p-harmonic function is a continuous minimizer (by which we mean real-valued continuous in this paper).
It was shown in Kinnunen-Shanmugalingam [38] that under our standing assumptions, a minimizer can be modified on a set of zero (Sobolev) capacity to obtain a p-harmonic function. For a superminimizer u, it was shown by Kinnunen-Martio [36] that its lsc-regularization is also a superminimizer and u * = u q.e.
The function H G f is called the p-harmonic extension of f . It is also the solution of the Dirichlet problem with boundary values f in the Sobolev sense. An important property, coming from the ellipticity of the theory, is the following comparison principle for f 1 , f 2 ∈ N 1,p (G), see Lemma 8.32 in [8].
As usual, by G ⋐ Ω we mean that G is a compact subset of Ω. By Theorem 6.1 in Björn [3] (or [8,Theorem 14.10]), this definition of superharmonicity is equivalent to the definition usually used in the Euclidean literature, e.g. in Heinonen-Kilpeläinen-Martio [28].
The strong minimum principle for superharmonic functions, which says that a superharmonic function which attains its minimum in a domain is constant therein, holds by Theorem 9.13 in [8]. The weak minimum principle says that if G is a nonempty bounded open set, and u ∈ C(G) is superharmonic in G, then min G u = min ∂G u. As X is connected and complete, the weak minimum principle follows from the strong one.
We will use the following extension property several times. It is a direct consequence of Theorems 6.2 and 6.3 in Björn [5] (or Theorems 12.2 and 12.3 in [8]).
then u has a unique superharmonic extension to Ω, given by u(x 0 ) := lim inf x→x0 u(x).
If u is in addition bounded from above or if u ∈ N 1,p (Ω\{x 0 }), then the extension is p-harmonic in Ω.
Also the following observation, containing a version of the Harnack inequality, will be useful for us. It shows in particular that the lim inf in Lemma 4.3 is actually a true limit. Note that C p ({x 0 }) > 0 is allowed here. Moreover, if 0 < τ ≤ 1 then there is a constant A > 0 which only depends on p, τ , the doubling constant of µ and the constants in the p-Poincaré inequality, such If C p ({x 0 }) = 0, then by Lemma 4.3 we actually do not need to require u to be superharmonic in Ω, only that u(x 0 ) = lim inf x→x0 u(x); the same is true for Proposition 4.5. But if C p ({x 0 }) > 0 then superharmonicity cannot be omitted in general, as seen by e.g. letting Ω = (−1, 1) ⊂ R, x 0 = 0 and u = χ (0,1) .
Proof. Let G be the component of Ω containing x 0 . Since 50λB ⊂ Ω, it follows from the Poincaré inequality that B ⊂ G, see e.g. Lemma 4.10 in Björn-Björn [11]. We start with the second part. Let which both exist and are finite as u is p-harmonic (and thus continuous) in Ω\ {x 0 }. Fix k > M . Then u k := min{u, k} is an lsc-regularized superminimizer in Ω. By the weak minimum principle for superharmonic functions and the continuity of u, We shall now use the weak Harnack inequalities from Theorems 8.4 and 8.10 in Björn-Björn [8] (or Kinnunen-Shanmugalingam [38] and Björn-Marola [18]). Together with the doubling property of the measure µ, they imply that where q > 0 is as in Theorem 8.10 in [8] and the constants A, C and C ′ depend only on p, τ , the doubling constant of µ and the constants in the p-Poincaré inequality. This proves (4.2).
To prove the first part of the proposition, let m(r) = min ∂Br u and M (r) = max ∂Br u for r < ρ. As above, we have m(r) = inf Br u, and so m( · ) is a nonincreasing function. Thus m 0 = lim r→0+ m(r) exists. If m 0 = ∞, then lim x→x0 u(x) = ∞ and we are done. Assume therefore that m 0 < ∞ and let ε > 0. Then there is r 1 > 0 such that m 0 − m(r 1 ) < ε. Thus v := u − m(r 1 ) satisfies the assumptions of the proposition with Ω replaced by B r1 . We can thus use (4.2) to obtain that for 0 < r < r 1 /50λ, Letting ε → 0+ shows that lim sup x→x0 u(x) = m 0 , and so lim x→x0 u(x) exists and equals u(x 0 ) by the lower semicontinuity of u.
The following characterization may be of independent interest. Proposition 4.5. Assume that C p ({x 0 }) = 0. Let u ≥ 0 be a function which is superharmonic in Ω and p-harmonic in Ω \ {x 0 }. Then the following are equivalent : is also a p-weak upper gradient of u within Ω, by Proposition 1.48 in [8]. Even though it may happen that g u does not belong to L p loc (Ω) it is still minimal in an obvious sense. Thus g u is not as defined in Section 2.6 in [8], but instead coincides with the minimal p-weak upper gradient G u of Section 5 in Kinnunen-Martio [37] and Section 2.8 in [8]. In this paper, we will denote it by g u even within Ω. This will, in particular, apply to singular and Green functions u.
The argument above, using Proposition 1.48 in [8], also shows that N 1,p (B r ) = N 1,p (B r \ {x 0 }) and thus (d) can equivalently be formulated using It is not known if being p-harmonic in a metric space (defined using upper gradients as here) is a sheaf property, see [8,Open problems 9.22 and 9.23]. This requires some care when proving (b) ⇒ (a) and (d) ⇒ (a) below.
Proof of Proposition 4.5. (a) ⇒ (c) and (a) ⇒ (d) These implications follow directly from the p-harmonicity.
In both cases, it follows from Lemma 4.3 that u is p-harmonic in Ω k . Hence u is p-harmonic in Ω, by Propositions 9.18 and 9.21 in [8].
(d) ⇒ (e) This is trivial. Remark 4.7. The distinction between the cases C p ({x 0 }) = 0 and C p ({x 0 }) > 0 will often be important in this paper. Hence we recall that (under our standing assumptions) Proposition 1.3 in Björn-Björn-Lehrbäck [13] shows that It is also shown in [13] that the power of decay of µ(B r ) alone cannot determine whether C p ({x 0 }) = 0. However, Proposition 5.3 in our forthcoming paper [14] shows that

Perron solutions and boundary behaviour
In addition to the general assumptions from the beginning of Section 4, we assume in this section that Ω is bounded and that C p (X \ Ω) > 0.
Perron solutions will be an important tool for us.
, let U f (Ω) be the collection of all superharmonic functions u in Ω that are bounded from below and satisfy lim inf The upper Perron solution of f is defined by The lower Perron solution is defined similarly using subharmonic functions or by P Ω f = −P Ω f . If P Ω f = P Ω f , then we denote the common value by P Ω f . Moreover, if P Ω f is real-valued, then f is said to be resolutive (with respect to Ω).
We will often write P f instead of P Ω f , and similarly for P f , P f as well as for Hf . An immediate consequence of Definition 5.1 is that It follows from Theorem 7.2 in Kinnunen-Martio [36] (or Theorem 9.39 in [8]) that P f ≤ P f . In each component of Ω, P f is either p-harmonic or identically ±∞, by Theorem 4.1 in Björn-Björn-Shanmugalingam [16]. (This and all the facts below can also be found in Chapter 10 in [8].) We will need several results from [16, Sections 5 and 6], which we summarize as follows. (Part (a) follows from [16, Theorem 5.1] after multiplying f by a suitable Lipschitz cutoff function.) then u = P f .
. We will need the following so-called Kellogg property, see Theorem 3.9 in Björn-Björn-Shanmugalingam [15]. (The definition of regular points is different in [15], but by [16,Theorem 6.1] it is equivalent to our definition.) We will also use that regularity is a local property of the boundary, i.e. that x 0 ∈ ∂Ω is regular with respect to Ω if and only if it is regular with respect to Ω ∩ B for every (or some) ball B ∋ x 0 , see Theorem 6.1 in Björn-Björn [6] (or [8,Theorem 11.1]). Moreover, if G ⊂ Ω and x 0 ∈ ∂Ω ∩ ∂G is regular with respect to Ω, then it is also regular with respect to G, see [6,Corollary 4.4] (or [8,Corollary 11.3]).
Another important tool in this paper is capacitary potentials, which we studied in Section 3 in very general situations. Under our standing assumptions we can say considerably more. In particular, capacitary potentials are unique up to sets of capacity zero, by Theorem 5.13 in Björn-Björn [10]. In fact, it is easy to see that any capacitary potential is a solution to the K χE ,0 (Ω)-obstacle problem, as defined in [8,Section 7], and vice versa. Thus, provided that there is a capacitary potential of (E, Ω), Theorem 8.27 in [8] shows that there is a unique lsc-regularized capacitary potential u, i.e. such that u * = u in Ω and u ≡ 0 on X \ Ω. Then u also coincides with the "capacitary potential" as defined in [8,Definition 11.15], and is therefore superharmonic in Ω, by [8,Proposition 9.4]. We shall sometimes call u| Ω a capacitary potential as well. Recall that a capacitary potential of (E, Ω) exists if and only if cap p (E, Ω) < ∞.
Proof. If u is an lsc-regularized capacitary potential of (E, Ω), then it satisfies (c) and (d) by assumption, (a) by the above, and (b) by Theorem 8.28 in [8]. Moreover, it is straightforward to see that within G, u is the lsc-regularized solution of the K 0,u (G)-obstacle problem, i.e. u = H G u in G. Hence, (5.1) and the last statement follow from [8,Theorem 11.11 (j)] together with the Kellogg property (Theorem 5.4).
If, in addition, u = 1 q.e. on E then u ∈ K χE ,0 (Ω) and must therefore be a capacitary potential of (E, Ω). If it is also superharmonic in Ω, then it is lsc-regularized. (a) u is bounded and p-harmonic in G := Ω \ K; Proof. Let u be the lsc-regularized capacitary potential of (K, Ω) and set Thenũ = u q.e. in Ω andũ ∈ N 1,p 0 (Ω). Thus by (4.1) and Theorem 5.2 (a). (In particular, χ K ∈ C(∂G) is resolutive with respect to G.) Hence (a) holds, and so does (c) by the Kellogg property (Theorem 5.4).
Since u is the lsc-regularization ofũ, it satisfies (b) and (d).
Conversely, if u is bounded and p-harmonic in G and satisfies (c) then u = P G χ K in G by Theorem 5.2 (c). Hence, if u also satisfies (b) and (d), then it is the lscregularized capacitary potential of (K, Ω), by the first part of the proof.
Lemma 5.7. Assume that K ⊂ Ω is compact and that u : For an open set V ⋐ Ω such that K ⊂ V , consider the following conditions: As u can be defined arbitrarily in K in (b.1 ′ ) and (b. As u is p-harmonic in Ω\K and u ∈ N 1,p 0 (Ω\V ; X \V ), it follows from the definition that H G u = u in G. Since u is bounded on ∂V and vanishes on ∂Ω, there is α > 0 such that u ≤ αv on ∂G, where v is the lsc-regularized capacitary potential for V in Ω. By the comparison principle (4.1), u ≤ αv also in G and, in particular, u is bounded therein. Now, (5.3) follows from (5.1), applied to v, while (5.2) follows from (5.3) and the Kellogg property (Theorem 5.4).
(b.2 ′ ) ⇒ (b.1 ′ ) Let η ≥ 0 be a Lipschitz function on X such that η = 1 on ∂V and η = 0 in a neighbourhood of K ∪ (X \ Ω). As u is p-harmonic in Ω \ K and ∂V ⋐ Ω \ K, the function u| ∂G = ηu| ∂G is continuous. Since (5.2) or (5.3) holds, Theorem 5.2 (c) shows that u = P G (ηu). It follows from the Leibniz rule (see [8,Theorem 2.15]) that ηu ∈ N 1,p (X). Hence Theorem 5.2 (a) implies that u = H G (ηu) in G, which in particular implies that u ∈ N 1,p 0 (Ω \ V ; X \ V ). Note that in the generality of Section 3, capacitary potentials are unique up to sets of capacity zero under rather mild conditions, by Theorem 5.13 in [10]. Nevertheless, it is far from clear if we can then always pick a canonical representative in a suitable way. In particular, even if A is open it is not at all clear if u * = u q.e., i.e. whether there always exists an lsc-regularized capacitary potential. Under our standing assumptions in this section it is true that u * = u q.e., but this is a consequence of the rather deep interior regularity theory for superminimizers.

Singular functions
In addition to the general assumptions from the beginning of Section 4, we assume in this section that Ω is a bounded domain.
Recall properties (S1)-(S5) in Definition 1.1 of singular functions, and that a domain is a nonempty open connected set. In this paper we are interested in singular functions on bounded domains only. For simplicity, we will often just say that u is a singular function, when we implicitly mean within Ω and with singularity x 0 .
Note that a singular function must be nonconstant in Ω, as it is positive and (S4) holds. Our first observation, Proposition 6.1, shows that C p (X \ Ω) > 0 is a necessary condition for the existence of singular functions. (We will later show that it is also sufficient.) Under this condition, the theory of singular functions on bounded domains splits naturally into two cases depending on whether C p ({x 0 }) = 0 or C p ({x 0 }) > 0, which we will consider in Sections 7 and 8, respectively. But first we deduce some results covering both cases simultaneously. Proposition 6.1. If C p (X \ Ω) = 0, then there is no singular function in Ω (or more generally no positive superharmonic function in Ω satisfying (S4)).
Proof. It follows directly that X must bounded. Let u > 0 be a superharmonic function in Ω. By Theorem 6.3 in Björn [5] (or Theorem 12.3 in [8]), u has a superharmonic extension to all of X, and by Corollary 9.14 in [8] this extension must be constant. Hence u does not satisfy (S4) and is, in particular, not a singular function.
Proposition 6.2. If C p (X \Ω) > 0 then there is no positive p-harmonic function in Ω which satisfies (S5). In particular, a singular function in Ω is never p-harmonic in all of Ω.
Proof. Assume that u is a positive p-harmonic function in Ω satisfying (S5). In particular, u ∈ N 1,p loc (Ω). Extend u as 0 on X \ Ω. Since u ∈ N 1,p loc (Ω) and (S5) holds, we see that u ∈ N 1,p (X) and hence u ∈ N 1,p 0 (Ω). But then u = Hu = H0 ≡ 0 in Ω, which is a contradiction as u is positive, i.e. no such function exists.
Finally, if there exists a singular function in Ω, then Proposition 6.1 implies that C p (X \ Ω) > 0, and thus the singular function cannot be p-harmonic in Ω by the first part of the lemma. Remark 6.3. There is actually some redundancy in the definition of singular functions. As we shall see, by Theorem 8.5 below, if C p (X \ Ω) > 0 then it is enough to assume that u satisfies (S1), (S2) and (S5). However, in the somewhat pathological case C p (X \ Ω) = 0, this is not enough as it would not prevent a constant function from being a singular function. To cover also this case it is enough to additionally assume (S4) or to assume that u is nonconstant, or that u is not p-harmonic in Ω.
Even though (S3) is thus redundant, we have included it in the definition as it seems such a natural requirement for u. Also, for unbounded domains it seems that one may need to require at least these five properties to obtain a coherent theory of singular functions, but we postpone such a study to a future paper.
That (S1) cannot be dropped even if (S3) is replaced by the stronger requirement follows by considering the function (Note that if (S1) holds, then (S3) ⇔ (S3 ′ ), but without assuming (S1), assuming (S3 ′ ) might be more natural.) However, if C p ({x 0 }) = 0 then it follows from Theorem 7.2 below that (S1) can be replaced by e.g. u(x 0 ) = ∞, and thus Proposition 4.4 shows that, in this case, (S1) can be dropped provided that (S3) is kept.
To see that (S2) cannot be dropped we instead let u be the lsc-regularized capacitary potential of (B 1 , B 2 ) in R n . That (S5) cannot be dropped follows from Example 7.3 below.
Note that (b) is just an equivalent way of writing (S5), when Ω is bounded, but not when Ω is unbounded. We therefore prefer to have the formulation (S5) in the definition.

Proof. (a) This follows from Proposition 4.4. (b) As Ω is bounded, (b) is equivalent to (S5).
(c) Let u k = min{u, k} which is a bounded superharmonic function, and thus a superminimizer, and in particular u k ∈ N 1,p loc (Ω). From (b) it then follows that u k ∈ N 1,p 0 (Ω).

Characterizations when C p ({x 0 }) = 0
In addition to the general assumptions from the beginning of Section 4, we assume in Sections 7-9 that Ω is a bounded domain such that C p (X \ Ω) > 0. In particular, C p (∂Ω) > 0 by [8,Lemma 4.5].
As already mentioned, the theory of singular functions (on bounded domains) splits naturally into the two cases C p ({x 0 }) = 0 and C p ({x 0 }) > 0. We postpone the study of the latter case to Section 8 and concentrate on the case C p ({x 0 }) = 0 in this section.
Note first that, when C p ({x 0 }) = 0, it follows from the extension Lemma 4.3 that the requirement of superharmonicity in the definition of singular functions can be replaced by the condition that u(x 0 ) = lim inf x→x0 u(x). In fact, by the following result, this also forces u(x 0 ) = ∞.
That we only assume (S1), (S2) and (S5) will play a role in the proof of Theorem 7.2.
Proof. We already know from Proposition 4.4 that u(x 0 ) = lim x→x0 u(x). If u(x 0 ) were finite, then u would be bounded in Ω, and thus u| Ω\{x0} would have a pharmonic extension to Ω by Lemma 4.3. But this contradicts Proposition 6.2.
Singular functions can be characterized in many ways. Our aim is to have as simple and flexible criteria as possible. Note that u is assumed to be positive, and that condition (a.3) can always be guaranteed by redefining u at x 0 .  We postpone the case j = 4, but otherwise, regardless of the values of j, k ∈ {1, 2, 3}, we have shown that (a.1), (b.1) and (b.2) are satisfied. Thus (S1) and (S2) are satisfied. As (7.1) holds and C p (∂Ω) > 0, we obtain (S4). Extending u by 0 on X \ Ω and letting r → 0 in (b.1) yields (S5). By Lemma 7.1, u(x 0 ) = ∞ = sup Ω u and (S3) holds, which concludes the proof that u is a singular function.
We are now prepared to prove the existence of singular functions at points having zero capacity. Proof. Let r 0 > 0 be so small that B r0 ⋐ Ω. For 0 < r ≤ r 0 , let u r be the lscregularized capacitary potential for B r in Ω. Then u r is superharmonic in Ω and p-harmonic in Ω \ B r , by Lemma 5.5.
Let M r = max ∂Br 0 u r > 0, which exists by the continuity of u r in Ω \ B r (while M r0 = 1 as C p (∂B r0 ) > 0). Also, M r > 0 by the strong minimum principle for superharmonic functions since C p (B r ) > 0. Let v r = u r /M r . Then max ∂Br 0 v r = 1. Thus we can use Harnack's convergence theorem (Proposition 5.1 in Shanmugalingam [44] or Theorem 9.37 in [8]) to find a subsequence {v rj } ∞ j=1 converging locally uniformly in Ω \ {x 0 } to a nonnegative p-harmonic function u. As C p ({x 0 }) = 0, Lemma 4.3 implies that u has a superharmonic extension to Ω given by u(x 0 ) := lim inf x→x0 u(x). Clearly u ≤ 1 on ∂B r0 , and from the local uniform convergence and the compactness of ∂B r0 we conclude that max ∂Br 0 u = 1. Thus u is positive in Ω by the strong minimum principle for superharmonic functions.
By definition and the comparison principle (4.1), for all 0 < r ≤ r 0 , and hence 0 ≤ u ≤ u r0 in G. Thus, by Lemma 5.5, 0 ≤ lim inf i.e. (7.1) holds. Since u is p-harmonic, and thus continuous, in Ω\{x 0 }, it is bounded in the compact set B r0 \ B r for every r > 0. As also 0 ≤ u ≤ 1 in G = Ω \ B r0 , we see that u is bounded in Ω \ B r for every r > 0.
We have thus shown that u is a positive p-harmonic function in Ω \ {x 0 }, which satisfies (a.1) and (b.2), and hence u is a singular function by Theorem 7.2.
Remark 7.5. In the above proof we constructed a singular function using capacitary potentials of balls. This is just for convenience, but there is nothing special about balls in this case. Indeed, if we let G 1 ⊃ G 2 ⊃ ... be open sets such that G 1 ⋐ Ω and ∞ k=1 G k = {x 0 }, then we can instead use the capacitary potentials for G k . It is an open question, even in weighted R n (with a p-admissible weight), whether all such constructions lead to the same singular function (upon proper normalization as in (1.2)).
We conclude this section with a simple nonintegrability result for singular functions. Part (c) is mainly interesting as contrasting Proposition 8.4 below, see also Theorem 8.6. In our forthcoming paper [14], we will give much more precise results on the L t integrability and nonintegrability of u and g u for singular and Green functions u, where t > 0. Proposition 7.6. Assume that C p ({x 0 }) = 0 and that u is a singular function in Ω with singularity at x 0 . Extend u by letting u = 0 on X \ Ω. Then the following are true: (a) u / ∈ N 1,p (B r ) is true for every r > 0; Proof. Parts (a) and (b) follow directly from Proposition 6.2 or Lemma 7.1, together with Proposition 4.5. Part (c) then follows directly from (a).

Characterizations when
Recall the standing assumptions from the beginning of Section 7.
We now turn to the case when the singularity point x 0 has positive capacity. As we shall see, singular functions are unique in this case, up to multiplication by positive constants. By Theorem 8.2 below, there is also an explicit representative for singular functions, namely the capacitary potential for {x 0 } in Ω. Applying this also to −u shows that when u(x 0 ) := lim x→x0 u(x) exists it must be real.
The following is an existence and uniqueness result (up to normalization) for singular functions when C p ({x 0 }) > 0. In particular, v is a singular function in Ω with singularity at x 0 .
Proof. Let u = bv. By definition, u is nonnegative and bounded. Lemma 5.5 shows that u is p-harmonic in Ω \ {x 0 } and superharmonic in Ω. As C p (∂Ω) > 0 and C p ({x 0 }) > 0, we conclude from Lemma 5.6 (c) that inf Ω u = 0 and u(x 0 ) = b = sup Ω u. In particular, u ≡ 0, and thus u > 0 in Ω by the strong minimum principle for superharmonic functions. Thus, u is a singular function. Conversely assume that u is a singular function. By Proposition 4.4 and Lemma 8.1, b := u(x 0 ) = lim x→x0 u(x) < ∞. Thus u is a bounded superharmonic function in some neighbourhood B r of x 0 , and in particular u ∈ N 1,p (B r/2 ). Together with (S5) this shows that u ∈ N 1,p 0 (Ω) and Lemma 5.5 implies that u = bv in Ω.
The following result shows that if we strengthen (b.1) in a suitable way, we do not even need to assume (a.1) or (a.2). Proposition 7.6 shows that the corresponding characterization is false when C p ({x 0 }) = 0. It also shows that condition (b.1) cannot be replaced by assuming that u ∈ N 1,p 0 (Ω) in Theorem 7.2, nor in Theorem 8.5 below.
Proof. If u is a singular function, then u is p-harmonic in Ω \ {x 0 } and u ∈ N 1,p 0 (Ω), by Theorem 8.2.
We conclude this section by summarizing which characterizations are true in both cases C p ({x 0 }) = 0 and C p ({x 0 }) > 0. Here (d) is added compared with Theorem 1.6. Recall that Ω is bounded and C p (X \ Ω) > 0 in this section. We can now also characterize whether C p ({x 0 }) is zero or not in terms of various properties of singular functions as follows.
Theorem 8.6. Assume that u is a singular function in Ω with singularity at x 0 , and extend u by letting u = 0 on X \ Ω. Then the following are equivalent :

Superlevel set estimates and Green functions
Recall the standing assumptions from the beginning of Section 7.
The following result about superlevel sets of superharmonic functions generalizes (and has been inspired by) Lemma 3.5 in Holopainen-Shanmugalingam [32]. This result holds even without assuming that Ω is connected, i.e. for nonempty open Ω with C p (X \ Ω) > 0. Recall that Lemma 9.1. Let E ⊂ Ω be relatively closed and let u > 0 be a superharmonic function in Ω which is p-harmonic in Ω \ E and such that min{u, k} ∈ N 1,p 0 (Ω) for all k > 0. Then there is a constant Λ > 0 such that where Ω b = {x ∈ Ω : u(x) ≥ b}, Ω a = {x ∈ Ω : u(x) > a} and we interpret ∞ 1−p as 0.
The set A = {x : u(x) = ∞} is a so-called polar set, and thus C p (A) = 0, by Proposition 2.2 in Kinnunen-Shanmugalingam [39] (or Corollary 9.51 in [8]). Hence C p -ess inf E u = ∞ if and only if C p (E) = 0, which in turn happens if and only if cap p (E, Ω) = 0, by Lemma 6.15 in [8], i.e. if and only if the lsc-regularized capacitary potential of (E, Ω) is identically zero. In this case it also follows from Lemma 9.1 that u must be unbounded as cap p (Ω b , Ω) = Λb 1−p > 0 for all b > 0.
Note that Λ = b p−1 cap p (Ω b , Ω) whenever b satisfies the assumptions above. In particular if b = 1 is allowed, then Λ = cap p (Ω 1 , Ω). Note also that even when E = {x 0 }, it is not necessary for u in Lemma 9.1 to be a singular function, see the double-pole function in Example 7.3.
Proof of Lemma 9.1. Note that since u is lower semicontinuous, Ω a is open. If C p -ess inf E u = 0, there is nothing to prove and we may let Λ = 1. (If E = ∅, we consider C p -ess inf E u and inf E u to be ∞, as usual.) As Ω ∞ is a polar set, we have C p (Ω ∞ ) = 0 and thus cap p (Ω ∞ , Ω a ) = cap p (Ω ∞ , Ω a ) = 0, i.e. the first formula holds when b = ∞. We assume therefore that b < ∞ and C p -ess inf E u > 0 in the rest of the proof.
Let k = C p -ess inf E u if C p -ess inf E u < ∞, and b < k < ∞ otherwise. Then C p (E \ Ω k ) = 0. As u is continuous in Ω \ E, we see that Ω k ∪ E must be relatively closed. By Lemma 5.5, u k /k is the lsc-regularized capacitary potential of (Ω k ∪E, Ω), and thus of (Ω k , Ω), since C p (E \ Ω k ) = 0. Hence, by Theorem 3.3, Upon letting Λ = k p−1 cap p (Ω k , Ω), this proves one identity in the statement of the lemma. The other three identities then follow from Theorem 3.3. To see that Λ > 0, we note that as u > 0, there is some b such that 0 < b < C p -ess inf E u and C p (Ω b ) > 0, and hence Λ = b p−1 cap p (Ω b , Ω) > 0, by Lemma 6.15 in [8].
In the proof above we used that Ω k ∪ E is relatively closed. Observe that it is not always true that Ω k itself is relatively closed, as seen by the following example.
Recall Definition 1.2 of Green functions. We can now relate singular and Green functions in the following way. Theorem 9.3. Let v be a singular function in Ω with singularity at x 0 , and let Then u := αv is a Green function in Ω with singularity at x 0 . Moreover, (1.3) holds for u, and α is the unique number such that u is a Green function.
Proof. Let u = αv and Ω b = {x ∈ Ω : u(x) ≥ b} for b ≥ 0. Clearly, u is a singular function in Ω with singularity at x 0 .
Hence (9.1) holds in both cases, and we conclude that Definition 1.2 is equivalent to the classical definition of Green functions in weighted R n . In Section 13 we show that the corresponding equivalence holds also in the metric setting for Cheeger-Green functions defined via the differential structures introduced by Cheeger [21].
Using the superlevel set estimates in Lemma 9.1 and the Harnack inequality in Proposition 4.4, we can now prove Theorem 1.5. If u(x 0 ) = M < ∞, then C p ({x 0 }) > 0, and thus by (9.2), On the other hand, if u(x 0 ) > M , then u = H Ω\Br u ≤ M in Ω \ B r , by the comparison principle (4.1), and thus Ω M ⊂ B r . As u is a Green function, it follows from (1.2) that Λ = 1 in Lemma 9.1, which thus gives Hence, in either case, m ≃ M ≃ cap p (B r , Ω) 1/(1−p) . Remark 9.5. As mentioned in the introduction, Theorem 1.5 was obtained in some specific cases on metric spaces by Danielli-Garofalo-Marola [22, Theorems 3.1, 3.3 and 5.2]. More precisely, they required that 1 < p < q, where q = sup Q and They however also implicitly assumed that q ∈ Q, see [22, eq. (2.2)], and that X is LLC, through their use (at the bottom of p. 354) of Lemma 5.3 in Björn-MacManus-Shanmugalingam [19]. (Here the LLC condition is the same as in [19] or Holopainen-Shanmugalingam [32].) As the constant C 2 in Theorem 3.1 in [22] depends on r, they did not obtain (1.5) when p = q ∈ Q. Note also that q is not the natural exponent for determining when C p ({x 0 }) > 0, see Björn-Björn-Lehrbäck [13, Proposition 1.3] and Remark 4.7.
When Ω ⊂ R n (unweighted) is a bounded domain, then two singular functions having singularity at x 0 ∈ Ω are multiples of each other. This follows from the results of Serrin [42] and Kichenassamy-Veron [35]. More precisely, if 1 < p ≤ n and u and v are such singular functions, then by Theorem 3 in Serrin [42] there are positive constants C 1 and C 2 such that −∆ p u = C 1 δ x0 and −∆ p v = C 2 δ x0 in Ω. Hence there is λ ∈ R such that −∆ p (λu) = C 2 δ x0 in Ω. Since λu = v = 0 on ∂Ω and the solutions of such equations are unique by Theorem 2.1 in [35], we conclude that v = λu in Ω. Theorem 2.1 in [35] is stated for regular Ω, but the uniqueness part does not require any regularity of Ω, since (2.8) therein follows directly from the corresponding identity, obtained using the Gauss-Green formula, in a ball containing Ω. It is this use of the Gauss-Green formula which makes the uniqueness argument only applicable in unweighted R n .
In our generality we have not been able to prove such uniqueness, but we can show that two singular functions with the same singularity are always comparable in Ω. This is based on part (c) of Theorem 1.3, which gives a stronger comparability result for Green functions. We collect here also the proofs of the other parts of that theorem.
Proof of Theorem 1.3. (b) This is a less refined form of Theorem 9.3.
(a) If C p (X \ Ω) = 0, then Proposition 6.1 shows that there is no singular function. On the other hand, if C p (X \ Ω) > 0 then the existence of a singular function follows from Theorems 7.4 and 8.2. In view of (b) this shows (a).
(c) Let r > 0 be so small that 50λB r ⊂ Ω. By Theorem 1.5, u ≃ v in B r . Let u = v = 0 on X \ Ω. As u is p-harmonic in Ω \ {x 0 } and u ∈ N 1,p loc (X \ {x 0 }), we see that, by definition, H Ω\Br u = u in Ω \ B r , and similarly for v. By the comparison principle in (4.1), The last part, for C p ({x 0 }) > 0, follows from (b) and Theorem 8.2.
The comparability result for singular functions, but with comparison constants also depending on u and v, now follows from Theorem 1.3 (b)-(c). When C p ({x 0 }) > 0, Theorem 8.2 allows us to say more, namely that singular functions are unique up to a multiplicative factor. However, regardless of the value of C p ({x 0 }), we have the following characterization of singular functions, which is a more general version of Theorem 1.4, valid also when C p ({x 0 }) > 0. Theorem 9.6. Let u be a singular function in Ω with singularity at x 0 , and let v : Then v is a singular function in Ω with singularity at x 0 if and only if v ≃ u, with comparison constants depending on u and v.
are p-harmonic in Ω \ {x 0 } and comparable to each other, but only the one with a = 1 is superharmonic and singular in Ω with singularity at x 0 .

p-harmonic functions with poles
Assume in this section that X is complete and that µ is doubling and supports a p-Poincaré inequality. We also fix x 0 ∈ X and write B r = B(x 0 , r) for r > 0.
We shall now apply our results to general p-harmonic functions with poles. Note that there is no relation between G and U in the theorem below. Then the following are true: there is a bounded domain Ω ∋ x 0 and a ≥ 0 such that u − a is a singular function in Ω with singularity at x 0 ; (c) there is r 0 > 0 such that if 0 < r < r 0 and x ∈ ∂B r , then

2)
where the comparison constants depend on G and u, but not on r; where the comparison constants depend on u and v.
Note that also the radius r 0 , for which (c) and (d) hold, depends on u (and v). This is easily seen by considering the function |x| (p−n)/(p−1) − c in R n , p < n, for various constants c ≥ 0.
However, Theorem 10.1 (c)-(d) shows that all p-harmonic functions with a given pole (i.e. such that (10.1) holds) have growth of the same order near the pole. For elliptic quasilinear equations (1.6) on unweighted R n , this is a classical result due to Serrin [42, Theorem 1]. On the contrary, results in Björn-Björn [7] show that the so-called quasiminimizers (rather than minimizers) of the p-energy integral g p u dµ can have singularities of arbitrary order, depending on the quasiminimizing constant. Quasiminimizers were introduced by Giaquinta and Giusti [25], [26] as a natural unification of elliptic equations with various ellipticity constants.
Proof. Let r ′ > 0 be such that B r ′ ⋐ U and C p (X \ B r ′ ) > 0, and let M (r) = max ∂Br u for 0 < r ≤ r ′ .
Let a = max{M (r ′ ), 0}, Ω = {x ∈ B r ′ : u(x) > a} andū = u − a. By the strong maximum principle for p-harmonic functions, Ω must be connected. It is easy to see thatū satisfies (a.2) and (b.1) in Theorem 7.2 (withū in place of u). Asū is p-harmonic in Ω \ {x 0 }, it follows from Theorem 8.5 thatū is a singular function in Ω, i.e. (b) holds. Thus (a) follows from Theorem 8.6. Let next r 0 > 0 be so small that B 50λr0 ⊂ Ω. By the strong minimum principle for superharmonic functions, inf Br 0 u > a ≥ 0 and thus with C > 0 depending on a and inf Br 0 u. Theorems 1.3 (b) and 1.5, applied toū, then yield u(x) ≃ū(x) ≃ cap p (B r , Ω) 1/(1−p) whenever x ∈ ∂B r and 0 < r < r 0 , (10.3) where the comparison constants depend on u, a and r 0 . This proves (c) for G = Ω. Also (d) follows directly from this, with the same choice of r 0 . Now consider a general open set G in (c). We may choose r ′ above so small that B r ′ ⊂ G. It follows that Ω ⊂ G. For 0 < r ≤ r 0 , let u r be the capacitary potential for B r in G, and set a r = max ∂Ω u r . Then 0 < a r ≤ a r0 < 1. Also let v r = u r − a r 1 − a r .
Then v r = 1 in B r and v r ≤ 0 on X \ Ω. Hence As cap p (B r , G) ≤ cap p (B r , Ω), we see that (10.2) follows from (10.3).

Local assumptions
In this section we investigate to which extent our results hold in more general metric measure spaces than those assuming our three standing assumptions: completeness, doubling measure and p-Poincaré inequality. We start by introducing the local assumptions. Similarly, the p-Poincaré inequality holds within a ball B 0 if there are constants C > 0 and λ ≥ 1 (depending on B 0 ) such that (2.2) holds for all balls B ⊂ B 0 , all integrable functions u on λB, and all p-weak upper gradients g of u within λB.
We also say that any of the above two properties is local if for every x 0 ∈ X there is r 0 (depending on x 0 ) such that the property holds within B(x 0 , r 0 ). If a property holds within every ball B(x 0 , r 0 ) then it is called semilocal.
Note that if µ is semilocally doubling and C is independent of x 0 and r 0 , then µ is doubling according to (2.1). The situation is similar for Poincaré inequalities.
The following result from Björn-Björn [11] makes it possible to generalize the results in this paper to spaces with local assumptions. Recall that a space is proper if every bounded closed subset is compact.
Theorem 11.2. (Proposition 1.2 and Theorem 1.3 in [11]) If X is proper and connected, and µ is locally doubling and supports a local p-Poincaré inequality, then µ is semilocally doubling and supports a semilocal p-Poincaré inequality.
Examples in [11] show that properness cannot be replaced by completeness, and connectedness cannot be dropped from Theorem 11.2. Moreover, if µ supports a semilocal Poincaré inequality, then X is connected.
So, for the rest of this section, we assume that X is proper and connected, and that µ is locally doubling and supports a local p-Poincaré inequality.
As in Keith-Zhong [34, Theorem 1.0.1], a better semilocal q-Poincaré inequality with some q < p holds also in this case, by Theorem 5.3 in [11].
In [11,Section 10], it was explained how the potential theory of p-harmonic functions, specifically the results in Chapters 7-14 in [8], hold under these assumptions, with the exception of the Liouville theorem. The same is true for the results in this paper, it is only the dependence of constants on the different associated parameters that needs to be carefully investigated. If X is bounded, then the semilocal assumptions are global and hence our standing assumptions are equivalent to the local assumptions above in this case.
If X is unbounded, we let (as before) Ω be a bounded domain and find a ball B 0 ⊃ Ω. Since X is unbounded, the condition C p (X \ Ω) > 0 is automatically satisfied. Let C PI , λ and C µ be the constants in the p-Poincaré inequality and the doubling condition within 2B 0 . The weak Harnack inequalities then hold for every ball B such that 50λB ⊂ Ω and with a constant depending only on p, C PI , λ and C µ , coming from 2B 0 as above. Thus all our estimates depend on these parameters instead of the constants in the global assumptions, which perhaps do not hold on X.

Holopainen-Shanmugalingam's definition
In this section we compare our results with the following definition of singular functions from Holopainen-Shanmugalingam [32]. (See below for the precise assumptions on X.) where Ω b = {x ∈ Ω : u(x) ≥ b} and Ω a = {x ∈ Ω : u(x) > a}.
The existence of such a function, when x 0 ∈ Ω ⊂ X and Ω is a relatively compact domain, was given in [32,Theorem 3.4] under the assumptions that X is connected, locally compact, noncompact and satisfies the so-called LLC property, and that µ is locally doubling and supports a local q-Poincaré inequality for some 1 ≤ q < p < ∞, cf. Remark 2.4 in [32]. These local assumptions are as defined in [32] and are stronger than those in Section 11. In fact, they coincide with those called semiuniformly local in Björn-Björn [11].
Remark 12.2. From the proof of [32,Theorem 3.4] it is not clear why the function called g on p. 322 therein satisfies (HS3) in the case when C p ({x 0 }) = 0. This can be justified, at least under the assumptions in this paper, in a similar way as we do in Lemma 5.7, using Perron solutions and the uniqueness result in Theorem 5.2 (c). These tools were however not available at that time.
In the definition of HS-singular functions above, the value u(x 0 ) can be rather arbitrary. In particular, u is not required to be superharmonic in Ω. However, in order for (HS5) to be satisfied, one must have 0 < u(x 0 ) ≤ cap p ({x 0 }, Ω) 1/(1−p) (which automatically holds if C p ({x 0 }) = 0). In view of (HS4) it is natural to let u(x 0 ) := lim x→x0 u(x), and we do so from now on.
We obtain the following relation to our Definitions 1.1 and 1.2.
Proposition 12.3. Assume that X is a proper connected metric space, and that µ is locally doubling and supports a local p-Poincaré inequality. Let Ω ⊂ X be a bounded domain such that C p (X \ Ω) > 0, and let x 0 ∈ Ω and u : X → [0, ∞].
(a) If u is an HS-singular function in Ω with singularity at x 0 , and u(x 0 ) = lim x→x0 u(x), then u| Ω is a singular function in Ω in the sense of Definition 1.1. (b) If u is a Green function in Ω with singularity at x 0 in the sense of Definition 1.2, then its zero extensionũ (given by lettingũ = 0 on X \ Ω) is an HS-singular function in Ω with singularity at x 0 . In particular there is an HS-singular function in Ω with singularity at x 0 .
Proof. By the discussion in Section 11 the results in this paper hold under these assumptions on X. Part (a) follows from Theorem 1.6, while part (b) follows from the definition of Green functions and Theorem 9.3 (which yields (HS4)). Finally, the existence follows from Theorem 1.3 (a).
Requiring the superlevel set estimates in (12.1) with those explicit constants, is a weaker type of normalization than in our definition of Green functions. However, it was natural in [32] as it used the best estimates available at the time.
We also remark that while proving the existence of HS-singular functions, Holopainen and Shanmugalingam [32, formula (8), p. 322] showed that estimate (1.5) holds, for x close enough to x 0 , for the HS-singular functions obtained by their construction. Here, we obtain it for all Green functions. Recall that in this generality, it is not known whether Green functions are unique when C p ({x 0 }) = 0.

Cheeger-Green functions
Recall the standing assumptions from the beginning of Section 4. In this section we also assume that Ω is bounded and that C p (X \ Ω) > 0. Theorem 4.38 in Cheeger [21] shows that, under our standing assumptions, the metric space X can be equipped with a coordinate structure in such a way that each Lipschitz function u in X has a vector-valued "gradient" Du, defined a.e. in X. Since Lipschitz functions are dense in N 1,p (X), this gradient can be extended uniquely to N 1,p (X), by Franchi-Haj lasz-Koskela [24,Theorem 10] or Keith [33]. Then |Du| ≃ g u a.e. in X for all u ∈ N 1,p (X), where the comparison constants are independent of u. Here and throughout this section | · | is an inner product norm on some R N , related to the Cheeger structure. Both | · | and the dimension N depend on x ∈ X, but there is a bound on N , which only depends on the doubling constant and the constants in the Poincaré inequality. By adding dummy coordinates, it can thus be assumed that Du(x) ∈ R N , with the same dimension N for all x.
In a general metric space X there is some freedom in choosing the Cheeger structure. In (weighted) R n we will however always make the natural choice Du = ∇u, where ∇u denotes the Sobolev gradient from Heinonen-Kilpeläinen-Martio [28]. In this case |Du| = g u , by Proposition A.13 in [8]. If the weight w on R n satisfies w 1/(1−p) ∈ L 1 loc (R n ) (in particular, if it is a Muckenhoupt A p weight) then the Sobolev gradient ∇u is also the distributional gradient.
Cheeger (super )minimizers and Cheeger p-harmonic functions are defined by replacing g u and g u+ϕ in Definition 4.1 with |Du| and |D(u + ϕ)|. Similarly, the Cheeger variational capacity of E ⊂ Ω, denoted Ch-cap p (E, Ω), and the related capacitary potentials are defined as in Section 3 but with g u replaced by |Du|. Then all the results we have obtained in the previous sections hold also for the corresponding Cheeger singular and Cheeger-Green functions, which are defined as in Definitions 1.1 and 1.2, with obvious modifications. See Appendix B.2 in [8] for more comments, details and references on Cheeger p-harmonic functions in general, and Danielli-Garofalo-Marola [22, Section 6] for some specific results for Cheeger singular and Cheeger-Green functions.
Due to the additional vector structure of the Cheeger gradient it is possible to make the following definition, which has no counterpart in the case of general scalar-valued upper gradients. where · is the inner product giving rise to the norm | · |, and Lip c (Ω) denotes the family of Lipschitz functions with compact support in Ω.
For solutions, one can equivalently replace ≥ by = in (13.1), which follows directly after testing also with −ϕ.
It can be shown that a function is a (super)solution if and only if it is a Cheeger (super)minimizer, the proof is the same as for Theorem 5.13 in Heinonen-Kilpeläinen-Martio [28]. In weighted R n with a p-admissible weight and the choice Du = ∇u, we have g u = |Du| = |∇u| a.e. which implies that (super)minimizers, Cheeger (super)minimizers and (super)solutions coincide, and are the same as in [28]. Similar identities hold also on Riemannian manifolds and Carnot-Carathéodory spaces equipped with their natural measures.
Next we show that the Cheeger-Green functions are exactly the weak solutions of the p-Laplace equation with the Dirac measure on the right-hand side and with zero boundary values, as in the case of R n considered in Remark 9.4. Theorem 13.3. Let u be a Cheeger-Green function in Ω with singularity at x 0 . Then Ω |Du| p−2 Du · Dϕ dµ = ϕ(x 0 ) for all ϕ ∈ Lip c (Ω), (13.3) that is, ∆ p u = −δ x0 in the weak sense.
Conversely, assume that v is an (extended real-valued ) continuous function in Ω such that |Dv| ∈ L p−1 (Ω), (S5) in Definition 1.1 is satisfied, and v is a solution of (13.3). Then v is a Cheeger-Green function.
Note that the assumption |Dv| ∈ L p−1 (Ω) in the second part of the statement is natural, since it guarantees that the integral in (13.3) is well-defined, and it moreover holds for all superharmonic functions, by Theorem 5.6 in Kinnunen-Martio [37] (or [8,Corollary 9.55]).
Next, consider the case when C p ({x 0 }) > 0. Then we know by Theorem 8.2 that u ∈ N 1,p 0 (Ω) and u is Cheeger p-harmonic in Ω \ {x 0 }. Let ν be the measure provided for u by Proposition 13.2. Since u is Cheeger p-harmonic in Ω \ {x 0 }, ν must be supported on {x 0 } and hence Ω ϕ dν = ϕ(x 0 )ν({x 0 }) for all ϕ ∈ N 1,p 0 (Ω). Testing (13.2) with ϕ = u then shows as in (13.5) and (13. Conversely, let v be as in the statement of the theorem. Then it is immediate that v is Cheeger p-harmonic in Ω \ {x 0 }. Hence v is a Cheeger singular function by Theorem 8.5 with (a.2) and (b.1). The normalization (9.1) for v is now obtained exactly as in Remark 9.4, with ∇u replaced by Dv, and thus v is a Cheeger-Green function.