scieee AI-readable full text Open interactive document viewer

Density of continuous functions in Sobolev spaces with applications to capacity

Eriksson-Bique, Sylvester,Poggi-Corradini, Pietro

Full text

This is a self-archived version of an original article. This version may differ from the original in pagination and typographic details. Author(s): Title: Year: Version: Copyright: Rights: Rights url: Please cite the original version: CC BY 3.0 https://creativecommons.org/licenses/by/3.0/ Density of continuous functions in Sobolev spaces with applications to capacity © 2024 the Authors Published version Eriksson-Bique, Sylvester; Poggi-Corradini, Pietro Eriksson-Bique, S., & Poggi-Corradini, P. (2024). Density of continuous functions in Sobolev spaces with applications to capacity. Transactions of the American Mathematical Society : Series B, 11, 901-944. https://doi.org/10.1090/btran/188 2024 TRANSACTIONS OF THE AMERICAN MATHEMATICAL SOCIETY, SERIES B Volume 11, Pages 901–944 (July 12, 2024) https://doi.org/10.1090/btran/188 DENSITY OF CONTINUOUS FUNCTIONS IN SOBOLEV SPACES WITH APPLICATIONS TO CAPACITY SYLVESTER ERIKSSON-BIQUE AND PIETRO POGGI-CORRADINI Abstract. We show that capacity can be computed with locally Lipschitz functions in locally complete and separable metric spaces. Further, we show that if (X, d, μ) is a locally complete and separable metric measure space, then continuous functions are dense in the Newtonian space N1,p(X). Here the measure μis Borel and is finite and positive on all metric balls. In particular, we don’t assume properness of X, doubling of μor any Poincar´e inequalities. These resolve, partially or fully, questions posed by a number of authors, including J. Heinonen, A. Bj¨orn and J. Bj¨orn. In contrast to much of the past work, our results apply to locally complete spaces Xand dispenses with the frequently used regularity assumptions: doubling, properness, Poincar´e inequality, Loewner property or quasiconvexity. 1. Introduction Solutions to variational problems on metric measure spaces (X,d,μ), such as pharmonic functions, may fail to be continuous or Lipschitz in a fully general setting. However, a useful tool is to approximate such minimizers by continuous or Lipschitz functions. In many works, see for instance [6,12,22,25], one places assumptions such as the doubling property, the Poincar´e inequality, or properness, to prove density of Lipschitz functions. Doubling and Poincar´e inequalities are natural in certain settings, such as Ap-weighted spaces [20], Carnot groups [26], boundaries of certain hyperbolic groups [9] and manifolds with Ricci bounds [13, 36]. However, there are many important settings where these assumptions are overly restrictive, and we name just a handful of such: studying generalized notions of scalar curvature and intrinsic limits of manifolds with scalar curvature bounds [19, 35], studying integral currents in metric spaces [2], metric manifolds and uniformization of metric surfaces [4,28,29], the study of analysis on fractals [10], Sobolev spaces on infinite dimensional spaces such as the Wasserstein space [34], spaces equipped with more general weights [3], or complete and rectifiable spaces [5]. In all these cases, Sobolev spaces, and associated differential structures, still play a crucial role. Our contribution in this paper is to remove the assumptions of doubling and Poincar´e and to replace these with a much weaker local completeness assumption, and to still prove three fundamental properties: the density of continuous functions in the Sobolev space, equivalence of different notions of capacity and the property that the Sobolev capacity is a Choquet capacity. This clarifies substantially Received by the editors May 29, 2023, and, in revised form, November 13, 2023, and December 19, 2023. 2020 Mathematics Subject Classification. Primary 30L15, 31C15. The first author was partially supported by Finnish Academy Grants n. 345005 and n. 356861. The second author was partially supported by NSF DMS n. 2154032. c 2024 by the author(s) under Creative Commons Attribution 3.0 License (CC BY 3.0) 901 902 S. ERIKSSON-BIQUE AND P. POGGI-CORRADINI the methods and dependence on assumptions. Further, it requires the use of new approximation and extension methods. The variational problems we consider are classical in metric measure spaces, and arise from the definition of an upper gradient. A Borel function g:X→[0,∞]is said to be an upper gradient for a function u:X→[−∞,∞] if for all rectifiable curves γ:[0,1] →X,wehave (1.1) |u(γ(0)) −u(γ(1))|≤gds, where we interpret |∞ − ∞| =∞. Next, if 1 ≤p<∞, consider the condenser p-capacity problem (1.2) Capp(E,F):=inf u|E=0 u|F=1 gpdμ, where Eand Fare disjoint closed sets in X,andwhereuis taken to be a function on Xand gis an upper gradient for u. Heinonen and Koskela asked in [21, Remark 2.13], if the infimum in this definition could be taken over functions uthat are continuous or locally Lipschitz. In general, we may consider a collection Wof pairs (u, g), where uis a function on Xand gis an upper gradient for u, and define CapW p(E,F):=inf u|E=0,u|F=1 (u,g)∈Wgpdμ. By varying W, we obtain different versions of capacity considered in the literature. We focus on three variants which have appeared in the literature: (i) W= lip corresponds to all pairs (u, g)whereuis locally Lipschitz, (ii) W=contisthe collection of all pairs (u, g)whereuis continuous, and (iii) W= (lip,lip)isthe collection of all pairs (u, g)whereuand gare locally Lipschitz. It is trivial that restricting the collections to (lip,lip),lip or cont produces a capacity, which is larger than the unrestricted capacity in (1.2). The problem, which bears a close affinity to approximation, is to show that these restricted capacities are still equal to the unrestricted capacity. Throughout, we will assume that μis a Borel measure on X, which is positive and finite on all balls, that is 0 <μ(B)<∞for each B=B(x, r), with x∈Xand r>0. Our first main result is the following. Theorem 1.1. Let (X,d,μ)be a locally complete and separable metric measure space and let E,F ⊂Xbe two closed, nonempty disjoint sets with d(E,F)>0. Then, for p∈[1,∞), (1.3) Capp(E,F)=Cap cont p(E,F)=Cap lip p(E,F)=Cap (lip,lip) p(E,F). Remark 1.2.If Γ(E,F) is the family of rectifiable curves connecting Eto F,then one has the equality between modulus and capacity Capp(E,F)=Mod p(E,F). Whenever (u, g) is admissible for the capacity, gis admissible for the modulus. Conversely, if gis admissible for the modulus, then there exists a uwhich is admissible for the capacity so that gis an upper gradient of u. Indeed, such a u is obtained by “integrating” g. See Section 2.1 for the definition of modulus, and [21, Proposition 2.17] for a proof of this claim. Consequently, we obtain a stronger version of [21, Proposition 2.17], which states that Modp(E,F)=Mod c p(E,F), DENSITY OF CONTINUOUS FUNCTIONS AND CAPACITY 903 where Modc p(E,F) is the modulus computed with only continuous admissible functions. Specifically, our proof shows that Modp(E,F)=Mod c p(E,F) whenever X,E,F satisfy the assumptions of Theorem 1.1 and p∈[1,∞). With the more restrictive assumptions that the space Xis proper and geodesic, this equality was known [23, Proposition 7]. The strongest previous result on this problem is due to Keith [23, Proposition 7]. He showed (1.3) under the assumption that Xis proper and geodesic (i.e., each pair of points x, y ∈Xcan be connected by a rectifiable curve γwith Len(γ)=d(x, y)). Our result weakens properness to local completeness and separability and removes any geodesic assumption. The capacity problem gives rise to the definition of a Sobolev space. The Sobolev spaces which we consider are those introduced by Cheeger in [12]. However, we take the perspective of precise representatives which were studied and introduced by Shanmugalingam in [32]. The space of these functions is denoted N1,p(X) with p∈[1,∞), and consists of all functions u∈Lp(X) that have an upper gradient g∈Lp(X). For p>1, the space N1,p(X)isequivalenttovariantsdefinedusing plans, see [1]. The (semi)norm on this space is denoted · N1,p(X)which equals the usual Sobolev norm in the case of Euclidean spaces equipped with Lebesgue measure. These notions will be precisely defined in Section 2. Our second main result shows the density of continuous functions in the Sobolev space and that all Sobolev functions are quasicontinuous. We say that a function f:X→R∪{∞,−∞} is quasicontinuous if for every >0 there exists an open set Owith Capp(O)<and so that f|X\Ois continuous. Recall that the notion of having zero capacity is a finer notion than having zero measure. Indeed, a set of capacity zero must be of measure zero. However, a set of capacity zero will usually be of smaller Hausdorff dimension. Theorem 1.3. Let (X,d,μ)be a locally complete and separable metric measure space. Then C(X)∩N1,p(X)is dense in N1,p(X)for p∈[1,∞), and every function f∈N1,p(X)is quasicontinuous. Note that if Ω is a domain in a locally complete space, then Ω is itself locally complete. Thus, Theorem 1.3 directly applies to domains. This strengthens the main result in [7, Theorem 1.1] in two ways: first, one does not need to switch representatives of f, and second, the assumptions are much weaker. A similar conclusion is contained in [32, Theorem 4.1], under the additional hypothesis that Xis complete and measure doubling, while also satisfying a Poincar´e inequality. On the other hand, by just assuming completeness and separability and measure doubling, it was shown in [1] that Lipschitz functions are dense when p>1. In [18], this result was slightly extended to complete and separable metric spaces with finite Hausdorff dimension, and for all p∈[1,∞). These three results prove density of Lipschitz functions, but with more restrictive assumptions - all of them require the space to have finite Hausdorff dimension. In contrast, our theorem removes any assumption on the dimension of X, but a price for this is paid in the weaker conclusion: the density of continuous functions. Thus, Theorem 1.3 substantially answers a question from [7] on whether continuous functions are dense in Sobolev spaces without any further assumptions. 904 S. ERIKSSON-BIQUE AND P. POGGI-CORRADINI Remark 1.4.We note that Theorem 1.3 and Theorem 1.1 are related, but neither is implied directly by the other. In particular, we cannot prove Theorem 1.1 directly by approximation, since aprioriCauchy sequences of Sobolev functions only converge almost everywhere, and the sets E,F in Theorem 1.1 may have measure zero. Further, it is worth noting that it is an interesting open problem to determine if Lipschitz functions are also dense in the Sobolev space for any complete and separable metric space equipped with a Radon measure, which is finite on balls. Next, consider the capacity of a set E⊂Xdefined as Capp(E):=inf{up N1,p(X):u|E≥1}. We first establish a crucial technical result, which allows us to strengthen the results on Sobolev spaces from [7]. Namely, we prove the outer regularity of Capp(E)in locally complete spaces. Theorem 1.5. Suppose that (X,d, μ)is locally complete and separable metric measure space. Let E⊂Xbe any set. Then Capp(E) = inf E⊂OCapp(O), where the infimum is taken over open subsets of Xcontaining E. This improves on prior work by removing the assumption of properness and density used in [7, Corollary 1.3]. The proof involves both Theorem 1.3 and an observation in Proposition 2.10 on lower semicontinuity involving certain “good” functions. (These are used to handle the case when Capp(E) = 0; see Proposition 3.2.) As a corollary, we show that Sobolev Capacity is a Choquet capacity, under very weak assumptions. See Section 5.1 for a definition of a Choquet capacity. Corollary 1.6. If (X,d,μ)is a locally complete and separable metric measure space and p∈(1,∞), then the map E→ Capp(E),forE⊂X, is a Choquet capacity. Remark 1.7.In much of the literature, see, e.g., [20,24], a neighborhood capacity is defined: Capp(E):=inf{up N1,p(X):u|O≥1 for an open set Owith E⊂O}. An advantage of this definition is that it is automatically outer regular and a Choquet capacity without further assumptions, see [24]. Using Theorem 1.5 it is easy to show that Capp(E)=Capp(E) for locally complete and separable metric measure spaces. This gives another way of proving Corollary 1.6. Much of the literature is split on which definition, Cap or Capp,theyemploy. Theorem 1.5 shows that very generally the two coincide, and one can use either definition and obtain an equivalent theory. In conclusion, we discuss the ways in which we improve on prior work, such as [7], and how we execute this technically. First, Theorem 1.3 rests on a new approximation inspired by the authors’ prior work in [16,17]. This approximation is built by solving an extension problem. Let K⊂Xbe compact such that f|Kis continuous. Proposition 3.7 describes how, and under which assumptions, we are able to extend f|Kto a continuous function ˜ f∈N1,p(X). See equation (3.9) for the precise formulation of this extension. This construction ought to be thought DENSITY OF CONTINUOUS FUNCTIONS AND CAPACITY 905 of as a discretized and adapted version of the more familiar construction used in Proposition 2.10, see in particular Proposition 2.15. The discretization is our main new contribution and yields continuity without assuming the existence of curves. It plays a crucial role in allowing us to dispense with the geodesic assumption employed in [23], and the quasiconvexity assumption employed in [21]. This approach to approximating Sobolev functions by discretizations is novel. Indeed, prior methods fell short from being able to handle the case of complete and separable metric spaces. A second technical contribution of this paper concerns removing the properness assumption in [7]. This is somewhat subtle, and involves the inner-regularity of the measure μ, i.e., for any bounded Borel set A⊂Xand >0thereisacompact set K⊂Awith μ(A\K)<. The main argument here is in Proposition 2.10, where a slight modification of the notion of “good function” allows for the usual arguments in [7, Section 3] to go through. Indeed, this yields Proposition 3.2 and the more general capacity results. A refinement of this notion, “a good sequence of functions”, plays a role in the proof of Theorem 1.3. In Section 2, we set the notation and prove some useful lemmas about good functions, discrete paths and almost upper gradients. The results in that section are new and have been written in a way that they may be useful in future work. In Section 3, we establish our main results in the complete setting. In Section 4, we extend these results to the locally complete setting using partition of units and localization. Finally, in Section 5, we discuss the Choquet property and the equivalence of different definitions of capacity. 2. Notation and preliminaries 2.1. Modulus and Sobolev spaces. Throughout the paper Xwill be a separable metric space and μany Borel measure on Xwhich is finite and positive on each ball, that is μ(B(x, r)) ∈(0,∞)foreachballB(x, r)⊂X. Such measures are Radon when Xis (locally) complete and separable, see [8, Theorem 7.1.7, Definition 7.1.1]. (In the reference, the claim is stated only for complete metric spaces. However, by an extension of the measure to the completion, following [31], we obtain the claim for locally complete spaces.). In particular, the measures μin this paper are inner and outer regular. By convention, we denote open balls by B(x, r)={y∈X:d(x, y)<r}.The value ris called the radius of the ball (which may be nonunique), and any ball of radius ris referred to as an r-ball. The distance between two sets A, B ⊂X is defined as d(A, B) = infa∈A,b∈Bd(a, b). For a single point x∈X, we adopt the convention d(x, A)=d({x},A). The characteristic function of a set A⊂Xis denoted 1A. Generally, we will assume that either Xis complete or locally complete. In the latter case, we will also consider its completion ˆ X.IfXis locally complete, then Xis an open subset in ˆ X. The spaces of Lp-integrable functions with respect to μ for p∈[1,∞) will be denoted by Lp(X). The Lp-norm of a function fis denoted fLp(X). The space of continuous functions on Xis denoted C(X). We do not need a topology on this space, and thus consider it only as a set. To discuss Newtonian spaces and capacities we next recall some classical terminology. These are covered in more detail in [22], as well as [7,32]. 906 S. ERIKSSON-BIQUE AND P. POGGI-CORRADINI Acurveγis a continuous map γ:[0,1] →X(or, in specific instances, any continuous map γ:I→X,whereI=[a, b]⊂Ris a bounded interval). The length of a rectifiable curve is denoted Len(γ). The speed of an absolutely continuous curve, which exists for a.e. t∈[0,1], is defined as (2.1) |γ(t)|= lim h→0 d(γ(t+h),γ(t)) h. Every rectifiable curve has a unique constant-speed parametrization, where |γ(t)|= Len(γ) for a.e. t∈[0,1] [22, Sec. 5.1]. If ˜γ:[0,1] →Xis the constant-speed parametrization of γ, we define the path integral with respect to γas: (2.2) γ gds:=1 0 g(˜γ(t))|˜γ(t)|dt =Len(γ)1 0 g(˜γ(t)) dt when gis any Borel function for which the right-hand side is defined. We will mostly only consider rectifiable curves and, unless otherwise specified, allow constant curves. We write γ⊂Afor a subset A⊂Xif γ([0,1]) ⊂A.Ifx∈X is any point, we write γ:Axto denote that γ(0) ∈Aand γ(1) = x, i.e., γ connects Ato x. The diameter of a curve is denoted diam(γ):= diam(Image(γ)) = sups,t∈[0,1] d(γ(s),γ(t)). Let Γ be a collection of rectifiable curves. A nonnegative Borel function ρ:X→ [0,∞] is called admissible for Γ, denoted ρ∈Adm(Γ), if γρds≥1foreachγ∈Γ. Here, γgdsis the path integral defined in (2.2). Modulus is defined by Modp(Γ) = inf ρ∈Adm(Γ) ρp Lp(X). A property is said to hold for p-a.e. curve γif it holds for each rectifiable γ∈ Γfor some collection Γ with Modp(Γ) = 0. Given two sets E,F ⊂Xwe will denote by Γ(E,F) the family of all rectifiable curves γin Xwith γ(0) ∈Eand γ(1) ∈F. Recall that a nonnegative Borel function g:X→[0,∞] is called an upper gradient for f:X→[−∞,∞], if for every rectifiable γ:[0,1] →X,wehave (2.3) |f(γ(1)) −f(γ(0))|≤γ gds. Here, the left-hand side is interpreted to be infinity if the expression gives |∞ − ∞| or |−∞−(−∞)|. The collection of upper gradients for fis denoted by D(f). We define the Newtonian space N1,p(X) as the collection of all functions f∈ Lp(X) that admit an upper gradient g∈Lp(X). A seminorm on N1,p(X)isgiven by fN1,p(X)=fp Lp(X)+inf g∈D(f)gp Lp(X)1/p . Then, if we identify f∼gfor f,g ∈N1,p(X) whenever f−gN1,p(X)=0, we obtain a Banach space; see [32]. Thus, while formally N1,p(X) consists of equivalence classes of functions, we will always consider pointwise representatives for a given class. A function gis a (p-)weak upper gradient, if inequality (1.1) holds for p-a.e. rectifiable curve γ:[0,1] →X. A function f∈Lp(X) always admits a minimal p-weak upper gradient gffor which gfLp(X)=inf g∈D(f)gLp(X). See [22, Theorem 6.3.20] for further details. The following is a classical statement following from the Vitali–Carath´eodory theorem. DENSITY OF CONTINUOUS FUNCTIONS AND CAPACITY 907 Lemma 2.1. If g∈Lp(X)is any p-weak upper gradient for f, then for any >0, there exists a lower semicontinuous g≥gso that gis an upper gradient for fand Xgp dμ ≤Xgpdμ +. Proof. Let g∈Lp(X) be a weak upper gradient. If Γ is the family of rectifiable curves so that inequality (1.1) does not hold, then Modp(Γ) = 0. Hence, by [22, Lemma 5.2.8], for any >0, there is an hso that Xhpdμ ≤/2andγhds =∞ for each γ∈Γ. Applying [22, Vitali-Carath´eodory theorem, p. 108] to max(g,h) we obtain a function gsuch that g≥max(g,h), with Xgp dμ ≤Xgpdμ +. Finally, we verify that inequality (1.1) holds for gand for every rectifiable path γ. Indeed, if γ∈Γ, then (1.1) follows from ∞=γhds ≤γgds. While, for γ∈ Γ, inequality (1.1) is satisfied since it holds for gand g≤g. If E⊂X,denotebyΓ Ethe set of nonconstant rectifiable curves that intersect E.AsetEis called p-exceptional if Modp(ΓE)=0. We will need a version of [32, Lemma 4.3], see also [22, Lemma 6.3.14] and [12, Proposition 2.22.] which we state next. Lemma 2.2. Suppose that f∈N1,p(X)has g∈Lp(X)as upper gradient, and suppose f|A=cfor some c∈R, and for some Borel set A⊂X.Then,the function gA=g1X\Ais a p-weak upper gradient for f. In particular, the minimal p-weak upper gradient gfsatisfies gf(x)=0for μ-almost every x∈A. Proposition 2.3 is useful when extending Sobolev functions. It differs from Lemma 2.2 in a crucial way, that we do not need to assume that a given function ˜ fis aprioria Sobolev function. Our starting point is a Sobolev function f and its upper gradient g. Another function ˜ fagrees with fon a set K,andwe aprioriknow that gis also an upper gradient for ˜ fin X\K. Here, we say that gis an upper gradient for fin a set A, if inequality (1.1) holds for every curve γ with γ⊂A.When˜ fis continuous this information can be patched together to conclude that gis an upper gradient for ˜ fin all of X. As a consequence, this shows that ˜ fis Sobolev. The proposition has a proof which is quite similar in spirit to [32, Lemma 4.3]. However, given the differences in the statements and some details of the arguments, we provide a complete proof. Proposition 2.3. Let f∈N1,p(X)and let g∈Lp(X)be an upper gradient for f. Let ˜ f∈Lp(X)be a continuous function so that f|K=˜ f|Kfor some closed set K. If gis an upper gradient for ˜ fin X\K,thengis also an upper gradient for ˜ fin all of X.Inparticular,˜ f∈N1,p(X). Proof. Let γ:[0,1] →Xbe any nonconstant rectifiable curve. The upper gradient inequality (1.1) is invariant under reparametrizations. Hence, for convenience, we will assume that γhas the constant-speed parametrization. There are essentially three cases to consider, when verifying inequality (1.1) for ˜ fin place of f.Since (1.1)isclearwhenγgds=∞, we can assume that γgds<∞. (1) Assume γ(0),γ(1) ∈K.Since gis an upper gradient for fand f|K=˜ f|K the inequality (1.1) for γand ˜ fis identical to that for f. (2) Assume γ(0) ∈Kbut γ(1) ∈ K(or the reverse). The reverse case of γ(1) ∈Kand γ(0) ∈ Kis symmetrical and can be reduced to this by considering the curve ˜γ(t)=γ(1 −t). Thus take γ(0) ∈Kand γ(1) ∈ K. 908 S. ERIKSSON-BIQUE AND P. POGGI-CORRADINI Let t=supγ−1(K). We have t<1sinceKis closed. Consider γ1=γ|[0,t] (which may be constant) and γ2, =γ|[t+,1] for ∈[0,1−t). By case (1), we have γ1gds ≥|˜ f(γ1(0)) −˜ f(γ1(t))|. For 0 <<1−t,wehavethatγ2, ⊂X\Kand since gis an upper gradient for ˜ fin X\Kwe have (2.4) |˜ f(γ2,(t+)) −˜ f(γ2,(1))|≤γ2, gds. Thus, we get |˜ f(γ(0)) −˜ f(γ(1))| ≤|˜ f(γ(0)) −˜ f(γ(t))|+|˜ f(γ(t)) −˜ f(γ(1))| ≤γ1 gds+ lim →0|˜ f(γ2,(t+)) −˜ f(γ2,(1))|(by item (1) and continuity) ≤γ1 gds+ lim →0γ2, gds(by (2.4)) =γ gds. In the second to last line, we rewrite the integrals using g(γ(t)) multiplied by the characteristic function of [0,t]∪[t+, 1], and then we conclude using monotone convergence. (3) Assume γ(0),γ(1) ∈ K.If γ⊂X\K, then the claim follows since ˜g is an upper gradient for ˜ fin X\K. Otherwise there is some t∈[0,1] so that γ(t)∈K. Now, apply the second case to γ|[0,t]and to γ|[t,1] together with the triangle inequality to get inequality (1.1).  Let N1,p b(X)⊂N1,p(X) consist of those functions f∈N1,p(X) with bounded support which are bounded in X. More precisely, N1,p b(X) consists of those f∈ N1,p(X) for which there are constants M,R > 0andapointx0∈X,sothat f|X\B(x0,R)= 0 almost everywhere and f(x)∈[−M,M] for almost every x∈X. An important first step will be to reduce the approximation to such functions. This result is very standard, and can be found in many references, see, e.g., [33, Lemma 2.14]. We provide a proof for the sake of completeness. Lemma 2.4. N1,p b(X)is dense in N1,p(X). Proof. Fix x0∈Xand consider M>0. Let ψM(x) = max(min(2 −d(x0,x)/M, 1), 0), which can be seen to be 1/M -Lipschitz. Define fM=ψM(x) min(max(f,−M),M). We have |fM|≤min(|f|,M), and limM→∞ fM=fpointwise and in Lp(X). Further, using the Leibniz rule for Sobolev functions (see [22, Proposition 6.3.28]) one can show that gfM≤|f| M+gfis an upper gradient for fM.So,fM∈N1,p(X). Also fM−f=0onthesetAM=B(x0,M)∩{|f|≤M}. By Lemma 2.2, the function fM−fhas a weak upper gradient gfM−f≤1X\AM(2gf+|f| R). So gfM−f→0in Lpby dominated convergence, since μ(X\M∈NAM)=0. Thus lim M→∞ fM−fp N1,p(X)= lim M→∞ f−fMp Lp(X)+gf−fMp Lp(X)=0. DENSITY OF CONTINUOUS FUNCTIONS AND CAPACITY 915 hi(t)=g(γi(t)) converge uniformly to the function g(γ(t)), since gis continuous, we get γ gds≤1 0 g(γ(t))Ldt = lim i→∞ 1 0 g(γi(t))Ldt ≤lim inf i→∞ 1 0 g(γi(t)) Len(Pi)dt = lim inf i→∞ γi gds ≤lim inf i→∞ Pi g+L . Since >0 was arbitrary, the claim follows.  We will need the following compactness statement for discrete paths. Lemma 2.14. If {Pi}i∈Nis a sequence of paths in a complete metric space X satisfying (1) limi→∞ Mesh(Pi)=0; (2) Len(Pi)≤Sfor some S∈(0,∞)and all i∈N;and (3) for any τ>0there is a compact set Kτ⊂Xthat maxp∈Pid(p, Kτ)≤τ for all i∈N, then a subsequence of Piconverges to a curve γ:[0,1] →Xin the sense of (2.9). Proof. For each i∈Nlet γi:[0,1] →∞(N) be the curve linearly interpolating Pi. Lemma 2.12 states that we have Len(γi)≤Sand that the curves γiare parametrized by constant speed. First, we show that a subsequence of (γi)i∈N converges uniformly to some curve γ:[0,1] →∞(N). Fix t∈[0,1]. Let At={γi(t):i∈N}. The claim follows from Lemma 2.5, if we show that Atis precompact. Since ∞(N) is complete, it suffices to show that Atis totally bounded. Fix τ>0andchooseN∈Nso that Mesh(Pi)≤τ/8 for all i≥Nand a compact set Kτ/8as in the statement. Then, for i≥N,wehave d(γi(t),K τ/8)≤Mesh(Pi)+max p∈Pi d(p, Kτ/8)≤τ/4. Set K=Kτ/8∪N j=1 γjwhich is compact. Since Kis compact, it can be covered by a finite collection Bof balls of radius τ/2. Every point γi(t)∈Athas d(γi(t),K)≤ τ/4, and thus by inflating each ball in Bby two we can cover Atby finitely many balls of radius τ. Therefore, Atis totally bounded and precompact as desired. Thus, a subsequence γikconverges uniformly to some curve γ:[0,1] →∞(N). Further, for any t∈[0,1] we have d(γ(t),X) = limk→∞ d(γik(t),X)≤ limk→∞ Mesh(Pi) = 0 by Lemma 2.12. Thus, the image of γis contained in X and the claim follows.  Discrete paths can be used to conveniently define functions which have given upper gradients, in the spirit of Proposition 2.10. 916 S. ERIKSSON-BIQUE AND P. POGGI-CORRADINI Proposition 2.15. Suppose Xis a metric space. Let δ, M > 0and let E⊂Xbe a nonempty subset. Let g:X→[0,∞)be a continuous function and h:E→Ra bounded function. Define f(y):=mininf Ph(p0)+P g,M, where the infimum is taken over all discrete paths P=(p0,...,p n)with p0∈ E,pn=yand Mesh(P)≤δ. Then, fis locally Lipschitz, and gis an upper gradient of f. Moreover, if his constant and less than or equal to M,thenf≡hon E. Proof. Fix y∈Xand assume that d(x, y)≤δ.LetP=(p0,...,p n)beadiscrete path with p0∈E,pn=yand Mesh(P)≤δ.Letpn+1 =xand set P=(p0,...,p k), where k=inf{j≥0:pj=x}.Thus,Pis a discrete path with p0∈E,pk=x, and Mesh(P)≤δ.Inparticular, f(x)≤h(p0)+P g≤h(p0)+P g+g(y)d(x, y). Taking the infimum over Pand comparing with Mwe get (2.11) f(x)≤f(y)+g(y)d(x, y). By switching the role of xand y, we find that (2.12) |f(y)−f(x)|≤max(g(x),g(y))d(x, y), whenever d(x, y)≤δ.Sincegis continuous, it is also locally bounded. Hence, (2.12) implies that fis locally Lipschitz. Next, we want to show that gis an upper gradient for f.Letγ:[0,1] →Xbe a curve with constant speed and length L. Fix a partition s0=0<s 1<···<s k=1. Then, k  j=1 g(γ(sj−1))L|sj−sj−1|= k  j=1 g(γ(sj−1)) length γ|[sj,sj−1] ≥ k  j=1 g(γ(sj−1))d(γ(sj−1),γ(sj)) ≥ k  j=1 (f(γ(sj)) −f(γ(sj−1))) (by (2.11)) =f(γ(sk)) −f(γ(s0)). Taking the limit as the mesh goes to zero, we find that f(γ(1)) −f(γ(0)) ≤γ gds. Running γin reverse, substituting swith 1 −s, we find by a similar argument that |f(γ(1)) −f(γ(0))|≤γ gds. This shows that gis an upper gradient for f. DENSITY OF CONTINUOUS FUNCTIONS AND CAPACITY 917 Finally, assume that his constant and less than or equal to M. Then, for y∈E, we may choose the constant discrete path P=(y), and get that f(y)≤h(y)=h. Conversely, for any nonconstant discrete path P=(p0,...,p n) with p0∈E,pn=y, and Mesh(P)≤δ,wehave h(p0)+P g≥h(p0)=h. Taking the infimum over such paths, and then the minimum with M, we find that f(y)≥h. Therefore, f(y)=h. 2.4. Good sequences of functions. For sequences of discrete paths it becomes often convenient to construct a “good sequence of functions”, which approximate a given function. Definition 2.16. We say that a sequence of continuous functions (gi)i∈N,gi:X→ [0,∞)isagood sequence of functions if it satisfies the following properties. (1) Increasing: gi(x)≤gj(x)foreachi≤jand all x∈X. (2) Positivity: For any bounded set V⊂X,thereexistsanηV>0sothat gi(x)≥ηVfor every i∈Nand every x∈V. (3) “Goodness”: For any bounded set V⊂X,anyδ, L > 0, and any sequence (Pi)i∈Nof discrete paths Pi⊂Vwith limi→∞ Mesh(Pi) = 0, and such that (a) Pigi≤Land (b) diam(Pi)≥δ, there is a subsequence converging to a curve γin the sense of (2.9). Proposition 2.17. Let (X, d, μ)be a complete separable metric measure space, where μis a Borel measure that is positive and finite on r-balls with 0<r<∞. Assume p∈[1,∞)and let gbe given a lower semicontinuous function. For every >0, there exists a good sequence of bounded Lipschitz continuous functions (˜gi)i∈N converging pointwise to a function ˜gthat is a lower semicontinuous good function, and so that for every bounded set A⊂X,thereexistssomeηA>0so that (2.13) ˜g(x)≥g(x)+ηAfor all x∈A, and (2.14) X ˜gpdμ ≤X gpdμ +. Moreover, if K⊂Xis a compact set on which g|Kis bounded, then we can choose ˜gso that ˜g|Kis bounded. Proof. Let x0∈Xbe arbitrary, and let ∈(0,1). For simplicity, if Kis provided, scale the metric so that K⊂B(x0,1). Let ψi(x)=max(0,min(i+1−d(x0,x),1)) so that ψi|B(x0,i)=1andψi|X\B(x0,i+1) = 0. One directly observes that ψiis Lipschitz for every i∈N. Define Eito be an increasing sequence of compact sets so that μ(B(x0,i + 1) \Ei)≤p2−4pi.IfthesetKis provided as in the ‘Moreover part’ of the statement, then we choose Eiso that K⊂Eifor each i. These sets Eican be constructed since μis Radon. By lower semicontinuity, we may choose an increasing sequence of Lipschitz continuous bounded functions giconverging to g. The standard construction is to let gi(x):=inf{g(y)+id(x, y):y∈X},see [22, Proposition 4.2.2]. 918 S. ERIKSSON-BIQUE AND P. POGGI-CORRADINI We modify these functions as follows: (2.15) ˜gi(x):=gi(x)+ i  n=1 nmin(1,d(x, En)) +  8n(μ(B(x0,n+1))+1)ψn(x). Note that ˜giis Lipschitz continuous and bounded as well. Also, define ˜g(x):=g(x)+ ∞  n=1 nmin(1,d(x, En)) +  8n(μ(B(x0,n+1))+1)ψn(x). Then, it holds that limi→∞ ˜gi(x)=˜g(x)andg(x)≤˜g(x) for every x∈X.Ifthe set Kwas provided in the ‘Moreover part’ of the proposition, then for every x∈K, we have d(x, En)=0andψn(x)=1,so˜g≤g+is bounded on K. We begin by verifying inequality (2.14). By Minkowski’s inequality, ˜gLp(X)≤gLp(X) + ∞  n=1 nmin(1,d(·,E n))ψnLp(X) +     8n(μ(B(x0,n+1))+1)ψn   Lp(X) . Note that min(1,d(·,E n))ψn≤1B(x0,n+1)\Enand ψn≤1B(x0,n+1). Therefore, ˜gLp(X)≤gLp(X)+ ∞  n=1 (n2−4n+8 −n)≤gLp(X)+. Raising both sides to the power p, applying the mean value theorem to the function x→ xp, and using 0 <<1, we get that ˜gLp(X)≤gp Lp(X)+p gLp(X)+1 p−1. Finally, replacing with p−1(gLp(X)+1)−(p−1), yields the desired estimate (2.14). Also, let ηi:=8−i(μ(B(x0,i+1))+1) −1,then˜gi|B(x0,i)≥gi|B(x0,i)+ηifor every i∈N. Further, we get that for any bounded set A⊂Xthere is some iso that A⊂B(x0,i)andsothat˜g|A≥g|A+ηi. To show goodness for the sequence ˜gi.LetL, δ > 0 and let Abe a bounded set and consider any sequence (Pi)i∈N⊂Aof discrete paths Piwith limi→∞ Mesh(Pi)= 0, such that (1) Pi˜gi≤L, (2) diam(Pi)≥δ. By passing to a subsequence, we can assume Mesh(Pi)≤1 i.SincePi⊂A,by (2.13), we have ˜gi|Pi≥ηAfor some ηA>0. Let L=L ηA.Then Len(Pi)1 L=Pi ηA L≤Pi 1 L˜gi|A≤1. Thus, Len(Pi)≤L. By Lemma 2.14 it suffices to prove that for every τ∈(0,1) there is a compact set Kτfor which d(Pi,K τ)≤τfor all i∈N. Without loss of generality, assume τ∈(0,δ/2). DENSITY OF CONTINUOUS FUNCTIONS AND CAPACITY 919 Since Pi⊂Afor all i∈Nand since Ais bounded, there is some Tso that Pi⊂B(x0,T) for all i∈N.ChooseN=24max(L, 1)/τ2+T+1. LetKτ= EN∪N i=1 Pi.ThenKτis compact, and it suffices to show that supp∈Pid(p, Kτ)≤ τ.Thisisclearfori=1,...,N,thusconsideri>N. Suppose for the sake of contradiction that there is a point pi k∈Pifor some k=0,...,n(i) with d(pi k,K τ)>τ.Notethatdiam(Pi)≥δ>2τand Mesh(Pi)≤ 1/i ≤τ/8. Consider the maximal interval [k0,k 1] containing kand so that the corresponding subpath (pi l)k1 l=k0stays in B(pi k,τ/2). In particular, for 0 ≤k0≤l≤ k1≤n(i), we have d(pi l,K τ)≥τ/2. Furthermore, by maximality of the interval [k0,k 1], the path must exit the ball. Hence, pi l∈ B(pi k,τ/2), for either l=k0−1 or l=k1+1,and (2.16) k1−1  l=k0 d(pi l,p i l+1)≥τ/2−1/i ≥τ/4. Now, take any index l∈{k0,...,k 1}and let i≥N.Sinced(pi l,K τ)≥τ/2and EN⊂Kτ,wehave d(pi l,E N)≥d(pi l,K τ)≥τ/2. Further, since pi l⊂B(x0,T)⊂B(x0,N)wehave Nmin(1,d(pi l,E N))ψN(pi l)≥Nτ/2. Therefore, we get ˜gi(pi l)≥Nτ/2 and thus by inequality (2.16) L≥ n(i)−1  l=0 ˜gi(pi l)d(pi l,p i l+1)≥(τ/4)(Nτ/2) >L. This is a contradiction, and thus, d(p, Kτ)≤τfor each p∈Piand all i∈N. Finally, we formulate a result analogous to Lemma 2.13 and Lemma 2.9, in the case of good sequences for functions. Lemma 2.18. Suppose that {gi}i∈Nis a good sequence of functions converging to g, and that Piis a sequence of discrete paths converging to a curve γ,then γ gds ≤lim inf i→∞ Pi gi. Proof. By Lemma 2.13, for any lfixed, we have γ glds ≤lim inf i→∞ Pi gl. Since {gi}i∈Nis an increasing sequence of functions, we get γ glds ≤lim inf i→∞ Pi gi. Sending l→∞yields the claim.  920 S. ERIKSSON-BIQUE AND P. POGGI-CORRADINI 2.5. Continuous “almost” upper gradients. We will approximate an upper gradient by continuous functions. Recall that a minimal p-weak upper gradient gfof a function f∈N1,p(X)isapriori,onlyinLp(X). Lemma 2.1 shows that, by introducing a small error >0, we can find a lower semicontinuous function g∈Lp(X) which is an actual upper gradient. We would like to replace gwith a continuous function. However, the upper gradient inequality (1.1) is only preserved if we approximate gfrom above by a function h. Further, it is impossible to approximate every Lp(X)-function from above by a continuous, let alone bounded, function. Fortunately, lower semicontinuous functions can be approximated from below by a sequence of continuous bounded functions. This does not preserve (1.1). However, it will preserve being an “almost upper gradient” in the following sense. Definition 2.19. Let Vbe a closed set with μ(V)<∞and let C⊂Vbe a closed subset of X. A function his a (δ, Δ)-discrete upper gradient for fon (C, V )iffor every discrete path P=(p0,...,p n)withMesh(P)≤δ,P⊂V,p0,p n∈Cand diam({p0,...,p n})>Δwehave |f(pn)−f(p0)|≤P h. Here, it is necessary to localize the condition to apply only to curves with large enough diameter, which lie within a bounded set V, and which connect points in a closet set C. The first two of these are used to ensure compactness of the relevant families of curves. The final one is a bit more subtle, and is related to the fact that a Sobolev function may not be continuous, and Cshould be thought of as a closed set such that f|Cis continuous. In fact, the following lemma illustrates well the role of each of these assumptions. Lemma 2.20. Assume that C, V ⊂Xare closed bounded sets with C⊂V.Let M>0and f:X→[0,M]be a measurable function which is continuous on C. Let g:X→[0,∞]be a lower semicontinuous upper gradient for f. Suppose that η>0and (gi)i∈Nis a good sequence of functions, which converges pointwise to a lower semicontinuous function ˜gwith ˜g|V>g|V+η, as constructed in Proposition 2.17. Then, for every Δ>0there exists an N∈Nso that giis a (1/i, Δ)-discrete upper gradient for fon (C, V )for every i≥N. Proof. Arguing by contradiction, there exists Δ >0 and an infinite subset I⊂N so that for every i∈Ithere exists a path Pi=(pi 0,...,p i n(i))withMesh(Pi)≤1 i, diam(Pi)≥Δ, Pi⊂V,pi 0,p i n(i)∈Cand (2.17) |f(pi n(i))−f(pi 0)|>Pi gi. Since |f|≤M,wegetPigi≤2Mfor each i∈I. By Definition 2.16(3), there exists an infinite subset J⊂I,sothat(Pi)i∈Jconverges to a curve γ. In particular, γ(1) is a limit of the sequence (pi n(i))i∈J, and thus γ(1) ∈C. Similarly, γ(0) is a limit of the sequence (pi 0)i∈J, hence γ(0) ∈C.Further,γ⊂V, since Vis closed, and diam(γ)≥Δ since diam(Pi)≥Δ for all i∈N. By sending i∈Jto infinity in inequality (2.17), using Lemma 2.18 and the fact that f|Cis continuous, we get (2.18) |f(γ(1)) −f(γ(0))|≥γ ˜gds. DENSITY OF CONTINUOUS FUNCTIONS AND CAPACITY 921 However, ˜g|V>g|V+η, which contradicts the upper gradient inequality. Therefore the claim has been proved.  3. The case when Xis complete In this section, we will prove versions of our main theorems when Xis a metric measure space that is complete and separable. We show that: •capacity is outer regular for sets Ewith Capp(E)=0; •different versions of the capacity are equal, namely Capp=Cap c p= Caplip p=Cap (lip,lip) punder some weak hypothesis; •C(X)∩N1,p(X)isdenseinN1,p(X); •every function f∈N1,p(X) is quasicontinuous; and •Cappis outer regular, and thus a Choquet capacity. In the subsections that follow, we address each one of these claims in turn. 3.1. Null capacity sets. We will employ the following lemma for capacity. A set Eis said to be p-exceptional,ifMod p(ΓE)=0,whereΓ Eis the collection of all rectifiable curves γfor which γ∩E=∅. Lemma 3.1 ([22, Proposition 7.2.8.]).Suppose that (X,d,μ)is a separable metric measure space, then a set E⊂Xsatisfies Capp(E)=0if and only if Eis pexceptional and μ(E)=0. Lemma 3.1 is crucial when one wants to show that capacity is outer regular. The first step is to analyze sets with zero capacity. The proof of Proposition 3.2 follows closely that of [22, Proposition 7.2.12]—except for the novel use of a good function. Proposition 3.2. Suppose that (X, d, μ)is a complete separable metric measure space and let E⊂Xsatisfy Capp(E)=0. For any >0,wehaveanopensetO s.t. E⊂Oand Capp(O)<. Proof. Capacity is easily seen to be subadditive and so it suffices to consider the case when Eis bounded. Thus, assume that E⊂B(x0,R)forsomeballB(x0,R) with x0∈X,R > 0. Choose an open set V⊂B(x0,R)sothatE⊂Vand μ(V\E)≤2−p−1. By Lemma 3.1, the set Eis p-exceptional. Thus, Modp(ΓE)=0 and since Γ(E,X\V)⊂ΓEwe have Modp(Γ(E,X\V)) = 0. Let gbe an admissible function for Γ(E,X \V) with Xgpdμ ≤2−p−3. Lemma 2.8 provides a good function that is lower semicontinuous and admissible for Γ(E,X \V), with g≥g and Xgp dμ ≤2−p−2. Define u(x):=min(1,infγ:X\V→xγgds). By Proposition 2.10, uis lower semicontinuous, u|E=1,u|X\V=0,anduhas upper gradient g.Thus,U={u>1 2} will be an open set containing Eand U⊂V.TakeO=U. Then, ˜u=2u∈N1,p(X) and ˜u|O≥1. Therefore, from ˜u≤2·1V\Ewe get Capp(O)≤X |2u|pdμ +X (2g)pdμ ≤ and the claim follows.  922 S. ERIKSSON-BIQUE AND P. POGGI-CORRADINI 3.2. Different versions of capacity. We now state and prove a version of Theorem 1.1, when the space Xis assumed to be complete, rather than merely locally complete. We will use Theorem 3.3 later, in Section 5, to prove the more general statement formulated in Theorem 1.1. Theorem 3.3. Let (X, d, μ)be a complete, bounded and separable metric measure space equipped with a Radon measure which is positive and finite on all balls. Let E,F ⊂Xbe two nonempty closed disjoint sets with d(E,F)>0,andletp∈[1,∞). Then Capp(E,F)=Cap c p(E,F)=Cap lip p(E,F)=Cap (lip,lip) p(E,F). Corollary 3.4. Let E,F ⊂Xbe two nonempty closed disjoint sets with d(E,F)> 0,andletp∈[1,∞).Ifu∈N1,p(X)is nonnegative with u|E=0,u|F=1and gis an upper gradient for uin Lp(X), then there exists a sequence of functions ui∈N1,p(X), which are locally Lipschitz, and which have locally Lipschitz upper gradients hi∈Lp(X),withhi→gin Lp(X). Note that hineed not be the minimal p-weak upper gradient of ui. Proof of Corollary 3.4.The proof is the same as the one for Theorem 3.3, and is obtained by setting hi=(ai)−1giat the end of the proof.  Proof of Theorem 3.3.An infimum over a smaller set yields a larger value than an infimum over a larger set, and thus Capp(E,F)≤Capc p(E,F)≤Caplip p(E,F)≤Cap(lip,lip) p(E,F). Therefore, it suffices to prove Cap(lip,lip) p(E,F)≤Capp(E,F). If Capp(E,F)=∞, this is immediate. Thus, let us assume that Capp(E,F)<∞and let >0be arbitrary. By definition of capacity, there exists u:X→[−∞,∞] with u|E=0 and u|F=1andanLp-upper gradient g:X→[0,∞]foruwith gpdμ ≤ Capp(E,F)+. By replacing uwith max(min(u, 1),0) we can assume that u: X→[0,1]. Further, since μ(X)<∞,wegetu∈Lp(X) and, moreover, that u∈N1,p(X). We have γgds ≥1 for each rectifiable γconnecting Eto F.ByProposition 2.17, there exists a g∈Lp(X) which is lower semicontinuous with g>gand Xgpdμ ≤Xgpdμ +, and a good sequence of bounded and Lipschitz continuous nonnegative functions {gi}i∈Nthat satisfy gigand gi≥0. Let (3.1) ui(x):=mininf P gi:P=(p0,...,p n),p 0∈E,pn=x, Mesh(P)≤i−1,1. Note that ui:X→[0,1], since we are taking a minimum with 1. Further, u|E=0 since for x∈Ewe can use a constant path P=(p0). By Proposition 2.15, the function giis an upper gradient for ui. We show first that the function uiis Mi-Lipschitz with Mi= max{i, supx∈Xgi(x)}.NotethatMi<∞since giis bounded. To see the Lipschitz property, observe that if x, y ∈Xand d(x, y)≥1 i, then since 0 ≤ui≤1, |ui(x)−ui(y)|≤1≤Mid(x, y). DENSITY OF CONTINUOUS FUNCTIONS AND CAPACITY 923 On the other hand, if x, y ∈Xand d(x, y)<1 i, then any discrete path P= (p0,...,p n) with p0∈E,pn=x, Mesh(P)≤i−1, can be expanded to P= (p0,...,p n,y)withMesh(P)≤i−1.ItmaybethatPis not simple, as we require for paths. This occurs only if for some i∈[0,n]wehavepi=y,andthenwe truncate Pat such index. This gives ui(y)≤Pgi≤Pgi+d(x, y)gi(x). Infimizing over Pyields ui(y)≤ ui(x)+Mid(x, y). By symmetry, we get |u(x)−u(y)|≤Mid(x, y), which completes the proof of the Lipschitz bound. Let ai=inf x∈Fui(x). We show next that limi→∞ ai=1. Sincegi≤gjis an increasing sequence of functions, the limit limi→∞ aiexists. We obtain our claim via contradiction: Suppose that limi→∞ ai<1. Then there would exist some δ>0 so that ai<1−δfor every i∈N. By definition, for every i, there exists a discrete path Pi=(pi 0,...,p i n) with Pigi<1−δand with pi 0∈E,pi n∈Fand Mesh(Pi)<i −1. By the final condition, diam(Pi)≥d(E,F)foreachi. Since giis a good sequence of functions, and since Xis bounded, there exists a subsequence ikso that Pik→γfor some curve γ:[0,1] →X.SinceEand Fare closed, we conclude that γ(0) ∈E,γ(1) ∈F. By Lemma 2.13, we have, for each i∈N, γ gids ≤lim inf k→∞ Pik gi<1−δ. Sending i→∞, and with monotone convergence, we get γgds < 1−δ,whichis a contradiction to the fact that γgds ≥γgds≥1. Thus, our initial assumption was false, and limi→∞ ai=1. Choose now iso large that Xgp dμ ap i ≤X gpdμ +2. Then ˜ui= min(ui ai,1) is a Lipschitz function with the upper gradient (ai)−1gi. Further, ˜ui|E=0,˜ui|F=1,and X ((ai)−1gi)pdμ ≤X gpdμ +2. Thus, Caplip p(E,F)≤Capp(E,F)+2, and the claim follows since >0 is arbitrary.  The proof of the statement shows in fact slightly more. For future reference, we statethisasatheorem. Theorem 3.5. Let (X,d, μ)be complete separable metric measure space with μ(X)<∞.LetE,F ⊂Xbe two nonempty closed disjoint sets with d(E,F)>0, and let p∈[1,∞). Then, for any >0, and for any “admissible” function g∈Lp(X), i.e., so that γgds ≥1for every γ∈Γ(E,F), there exists a locally Lipschitz function gthat is also admissible, meaning that γgds ≥1for every γ∈Γ(E,F), and such that g−gLp(X)≤. 924 S. ERIKSSON-BIQUE AND P. POGGI-CORRADINI 3.3. Continuous functions are dense in Sobolev spaces. Next, we prove the density of continuous functions in Newton–Sobolev spaces, in the case when the space Xis complete. Later, in Section 4, we will use Theorem 3.6 to extend the result to the case when Xis locally complete, which will thus give a proof for Theorem 1.1. Theorem 3.6. Let (X, d, μ)be complete and separable metric measure space. Then C(X)∩N1,p(X)is dense (in norm) in N1,p(X)for p∈[1,∞). Given a function f∈N1,p(X)and>0, we want to find a continuous Newton– Sobolev function ˜ fon Xsuch that f−˜ fN1,p(X)≤. The idea of the proof is to consider an appropriately large compact set K⊂X(see equation (3.2)), where f|Kis continuous, and then to find an extension ˜ fwhich is continuous everywhere, and which has controlled minimal p-weak upper gradient g˜ f. That is, our proof will be based on the following extension result of Whitney type. Proposition 3.7. Let (X, d, μ)be complete and separable metric measure space. Let f∈N1,p(X)and let g∗∈Lp(X)be an upper gradient. Suppose that f|X\B(x0,R)=0for some x0∈X,andR>0. Suppose there is a compact set K⊂B(x0,R)with f|Kcontinuous and g∗|Kbounded. Then, for every >0, there exists a function ˜ fwith: (1) supx∈X|˜ f(x)|≤supx∈K|f(x)|; (2) ˜ f|K=f|Kand ˜ f|X\B(x0,R)=f|X\B(x0,R)=0; (3) ˜ f∈N1,p(X)∩C(X);and (4) X\Kgp ˜ fdμ ≤X\Kgp ∗dμ +. We delay the proof of this extension result, briefly, in order to show how the density result follows from it. Proof of Theorem 3.6.First, recall that by Lemma 2.4 the space of bounded Newton–Sobolev functions with bounded support N1,p b(X)isdenseinN1,p(X). Next, we show that C(X)∩N1,p b(X)isdenseinN1,p b(X). If f∈N1,p b(X), then there is a constant M<∞such that |f|≤Meverywhere in Xand there is a ball B(x0,R)sothatf|X\B(x0,R)=0. Letg∈Lp(X) be any upper gradient of f. Since f=0inX\B(x0,R), we can assume by modifying g∗that g∗|X\B(x0,R)=0. Indeed, this modification leaves (1.1) invariant. Let >0 be fixed, by using Lusin’s theorem and the absolute continuity of integrals, choose a compact set K⊂B(x0,R)sothatf|Kis continuous, g∗|Kis bounded and so that (3.2) X\K 2p+3gpdμ +μ(B(x0,R)\K)2p+1Mp≤. This is possible, since μis Radon, g∗∈Lp(X), and g∗=0inX\B(x0,R). By Proposition 3.7 there exists a function ˜ f∈N1,p(X)∩C(X) with ˜ f|K=f|K and X\K gp ˜ fdμ ≤X\K gp ∗dμ +2−p−3≤2−p−2, where the last inequality follows by (3.2). Furthermore, ˜ f|X\B(x0,R)=0and|˜ f|≤ Meverywhere. DENSITY OF CONTINUOUS FUNCTIONS AND CAPACITY 931 Suppose for the moment that this is true. Then, we can show that gis an upper gradient for ˜ fin X\K. Indeed, let x∈X\Kand fix n≥1sothat 2−n≤d(x, K). Again, let inbe the sequence constructed in Lemma 3.9. Take any r<min(2−n−3,1/in+2)/2. Then, for every y∈B(x, r)wehaved(y,K)> 2−n−1and, by Lemma 3.9, properties (2)(c) and (3)(c), we have D(y)≥2rand G(y)≤gin(y)≤C(in), where C(il) is the supremum of the bounded function gilfor l∈N. Thus inequality (3.14) implies that ˜ f|B(x,r)is C(in)-Lipschitz. Using this local Lipschitz property and compactness, if γ:[0,1] →X\Kis any rectifiable curve then ˜ f◦γis Lipschitz, and d(γ,K)>2−n−1for some n. Therefore, by Lemma 3.9, property (3)(c) again, we have G◦γ≤gin◦γand that |˜ f(γ(t)) −˜ f(γ(s))|≤max{gin(γ(t)),g in(γ(t))}d(γ(s),γ(t)) for any s, t ∈[0,1] with d(γ(s),γ(t)) ≤min{D(γ(s)),D(γ(t))}. Following similar arguments as in [32, Lemma 4.7], this together with the continuity of ginand Lemma 3.9, property (2)(c) yields |˜ f(γ(0)) −˜ f(γ(1))|≤1 0 |(˜ f◦γ)|dt ≤γ ginds. Since gin≤g,thengis an upper gradient for ˜ fin X\K. Next, we prove inequality (3.14). Fix x, y ∈X\Kwith d(x, y)≤ min{D(x),D(y)}. By property (2)(b) of Lemma 3.9 we have min{D(x),D(y)}≤1. Recall that, by (3.5), R>1. If xor yis in X\B(x0,2R), then d(x, y)≤1and both x, y ∈ B(x0,R). Thus, by Property 2, ˜ f(x)= ˜ f(y) = 0 and inequality (3.14) is immediate. We are left to consider the case when x, y ∈B(x0,2R) and equation (3.9) gives the values of the function ˜ fat xand y. By symmetry, it suffices to show that ˜ f(x)≤˜ f(y)+G(y)d(x, y). If ˜ f(y)=M, the claim follows by the definition of ˜ f.Otherwise,wehave˜ f(y) = infPΦ(P), where P=(p0,...,p n) runs through all (y,D)-admissible paths. Let Pbe any (y,D) admissible path. If x∈P,then by truncating P,weobtainan(x, D) admissible subpath, and ˜ f(x)≤Φ(P)by definition. If x∈ P, the augmented path P=(p0,...,p n,x)is(x, D) admissible, since d(pn,x)=d(y,x)≤min{D(x),D(y)}≤D(pn). Thus, ˜ f(x)≤Φ(P)=P(d(p0,p 1)) + f(p0)+ n−1  k=0 G(pk)d(pk,p k+1)+G(y)d(x, y) =Φ(P)+G(y)d(x, y). Infimizing over all discrete (y,D)-admissible paths Pnow yields ˜ f(x)≤˜ f(y)+ G(y)d(x, y), and thus the claim.  Next, we prove continuity of ˜ fon all of X. Lemma 3.14. The function ˜ f:X−→ Ris continuous. Proof. By Lemma 3.13, the function ˜ f|X\Kis continuous. Also, ˜ f|K=f|Kis continuous by assumption. Recall that Kis closed. Thus to prove the lemma, it suffices to prove sequential continuity at points of ∂K, with the sequence approaching from X\K.Fixx∈∂K and a sequence xi→xwith xi∈ Kfor each i∈N.Since ∂K ⊂B(x0,R), we may assume that xi∈B(x0,R) for all iby passing to the tail of the sequence. Since the first jump is free, for every i∈N, the path P=(x, xi) 932 S. ERIKSSON-BIQUE AND P. POGGI-CORRADINI is an (xi,D)-admissible path. Thus, by property (3)(d) of Lemma 3.9, we have ˜ f(xi)≤f(x)+P(d(x, xi)) + g(x)d(x, xi). By property (4)(b) of Lemma 3.9 and the fact that g|Kis bounded by Lemma 3.8, we have lim supi→∞ ˜ f(xi)≤f(x). So, it suffices to show that lim infi→∞ ˜ f(xi)≥ f(x). Indeed, by passing to a subsequence, it suffices to assume that the limit limi→∞ ˜ f(xi) exists and then to show that (3.15) lim i→∞ ˜ f(xi)≥f(x). In the following, we will analyze several subcases depending on the values of ˜ f and the constructed paths. Eliminating each subcase will reduce the problem to a simpler situation. In the following, WLOG is short for “Without loss of generality”. Reduction 1 (WLOG ˜ f(xi)<Mfor infinitely many i).If for all but finitely many iwe have ˜ f(xi)=M, the claim (3.15) follows from the definition of M. Thus, we may pass to a subsequence, where ˜ f(xi)<Mfor every i∈N.By definition of ˜ fin (3.9), we may find discrete paths Pi=(pi 0,...,p i n(i))which are (xi,D)-admissible and for which (3.16) lim i→∞ ˜ f(xi) = lim i→∞ Φ(Pi) = lim i→∞ ⎧ ⎨ ⎩ P(d(pi 0,p i 1)) + f(pi 0)+ n(i)−1  k=0 G(pi k)d(pi k,p i k+1)⎫ ⎬ ⎭ , and Φ(Pi)<M. Note that n(i)>0, because xi∈B(x0,R)\K, and hence is not in C. Reduction 2 (WLOG the points pi 0do not converge to x).If limi→∞ pi 0=x,then we get that limi→∞ Φ(Pi)≥limi→∞ f(pi 0)=f(x), as desired, because pi 0and xare in Cand f|Cis continuous. Thus, by passing to some subsequence we are left to consider the case that limi→∞ d(pi 0,x)=Δfor some Δ>0. By further passing to a subsequence we can ensure Δ/2≤d(pi 0,x)≤2Δ, so that diam(Pi)≥Δ/2for each i∈N. By passing to another subsequence, since limi→∞ pi n(i)= limi→∞ xi=x, we can assume that (3.17) d(pi n(i),x)≤min{Δ/2,i −1 3}≤diam(Pi)for all i∈N. This allows us to compare the values of f(x)and f(pi 0)by considering the augmented discrete path P i=(pi 0,...,p i n(i),x). At this point we may picture the path Pias the path corresponding to the point Tin Figure 1.ThepathP iis obtained by augmenting Piwithajumptox.Hence, P iis no longer admissible. Reduction 3 (WLOG the first jump d(pi 0,p i 1)islessthani−1 3).If not, by Lemma 3.9(4)(a),P(d(pi 0,p i 1)) ≥2M. However, this contradicts the fact that Φ(Pi)<M. Therefore, we must thus have d(pi 0,p i 1)≤1 i3for all i∈N. Recall that Lemma 3.9(2)(a)–(b) gives D(x)≤i−1 3, for all x∈X. Thus, since Piis (xi,D)-admissible, and d(pi n(i),x)≤i−1 3, we get Mesh(P i)≤i−1 3. DENSITY OF CONTINUOUS FUNCTIONS AND CAPACITY 933 Reduction 4 (WLOG eventually the diameter diam(P i)islessthan2 −3).If diam(P i)≥2−3, for infinitely many i∈N, we may pass to a subsequence where this property holds. Then, since gi3is (1/i3,2−3)-discretely admissible for fwith respect to (C, V ), we can apply the admissibility condition to the path Pand we get |f(x)−f(pi 0)| ≤gi3(pi n(i))d(pi n(i),x)+ n(i)−1  k=0 gi3(pi k)d(pi k,p i k+1) ≤gi3(pi n(i))d(pi n(i),x)+ n(i)−1  k=0 G(pi k)d(pi k,p i k+1)(by Lemma 3.9(3)(a)). (3.18) Thus, Φ(Pi)=P(d(pi 0,p i 1))+f(pi 0)+ n(i)−1  k=0 G(pi k)d(pi k,p i k+1)≥f(x)−gi3(pi n(i))d(pi n(i),x), and by sending i→∞along such a subsequence and noting that gi3is continuous and bounded, we get that limi→∞ Φ(Pi)≥f(x). Therefore, in this case, limi→∞ ˜ f(xi)≥f(x)using equation (3.16). Thus, by the last reduction and by (3.17), we can assume that Δ 2≤diam(P i)≤2−3. In particular, if we let L∈Zbe such that 2−L≤Δ<21−L,thenL≥3. Since pi n(i)is converging to x, by passing to the tail, we can assume d(pi n(i),x)≤ min{Δ/2,i −1 L+1}. Let li∈Nbe such that 3≤li≤Land 2−li−1≤diam(P i)≤2−li.Bythe pigeonhole principle, we can pass to a subsequence with li=lfor all i∈N. Given l∈N, which controls the size of the diameter, we now want to control the mesh size of the path P i. Reduction 5 (WLOG for all but finitely many indices i,wehaved(pi 0,p i 1)≤i−1 l+1). Here inis the bound for the mesh size defined in Lemma 3.9. If not, then d(pi 0,p i 1)≥ i−1 l+1 for infinitely many i∈N. For such indices i, we have P(d(pi 0,p i 1)) ≥ω(21−l) by property (4)(b) of Lemma 3.9.Thus, Φ(Pi)≥P(d(pi 0,p i 1)) + f(pi 0) ≥ω(21−l)+f(pi 0) ≥ω(diam(P i)) + f(pi 0)(since 21−l≥diam(P i)) ≥ω(d(x, pi 0)) + f(pi 0)(since x, pi 0∈P i) ≥f(x). Letting i→∞along the given subsequence gives the claim. Therefore, we can assume by passing to the tail that d(pi 0,p i 1)≤i−1 l+1 for all i∈N. 934 S. ERIKSSON-BIQUE AND P. POGGI-CORRADINI End of proof of Lemma 3.14.By the reductions described above, after passing to a subsequence, (3.19) d(pi 0,p i 1)≤i−1 l+1 and d(pi n(i),x)≤i−1 L+1 ≤i−1 l+1. For k=1,...,n(i)−1, we have d(pi k,K)≤diam(P i)≤2−l.SincePiis (x, D)- admissible, by property (2)(c) of Lemma 3.9, (3.20) d(pi k,p i k+1)≤D(pi k)≤1 il+1 . Combining (3.19) and (3.20), we get Mesh(P i)≤1/il+1 and diam(P i)≥2−l−1. Finally, since gil+1 is (i−1 l+1,2−l−1)-discretely admissible for ffor (C, V )weget inequality (3.18) with il+1 replacing i3. Therefore, Φ(Pi)=P(d(pi 0,p i 1))+f(pi 0)+ n(i)−1  k=0 G(pi k)d(pi k,p i k+1)≥f(x)−gil+1 (pi n(i))d(pi n(i),x), and the claim follows from equation (3.16) by sending i→∞and noting that gil+1 is continuous.  Next, we quickly get the Sobolev property. Lemma 3.15. The function ˜ f∈N1,p(X)and gis its upper gradient. Proof. Recall that f∈N1,p(X), gis an upper gradient for f,f|K=˜ f|Kby Property 2, ˜ f∈C(X) by Lemma 3.14, and gis an upper gradient for ˜ fin X\K by Lemma 3.13. Thus, Proposition 2.3 applied to f,g, ˜ fand Kshows that gis an upper gradient for ˜ fand that consequently ˜ f∈N1,p(X).  This establishes Property 3. Property 4. X\K gp ˜ fdμ ≤X\K gp ∗dμ +.(3.21) By Lemma 3.15, ˜ f∈N1,p(X) with upper gradient g. Recall that g˜ fis the minimal p-weak upper gradient and is smaller than any other upper gradient, i.e., g˜ f≤g (a.e.). By construction, g∗≤g. Thus, the fourth property follows from Lemma 3.8 and the fact that g∈Lp(X): X\K gp ˜ fdμ ≤X\K gpdμ =X gpdμ −K gpdμ ≤X gp ∗+2−4−K gp ∗dμ =X\K gp ∗+2−4.  3.4. Newton–Sobolev functions are quasicontinuous. Proposition 3.16. If Xis complete and separable and f∈N1,p(X),thenfis quasicontinuous. We follow the arguments in [7] and [32], but without relying on the hypothesis of properness and density of continuous functions in N1,p(X). Hence, we only provide asketch. DENSITY OF CONTINUOUS FUNCTIONS AND CAPACITY 935 Sketch of the proof of Proposition 3.16.By Theorem 3.6, there is a sequence fi∈ N1,p(X)∩C(X), for i∈N, with fi−fN1,p(X)≤2−i. Next, we apply the argument from the proof of [32, Theorem 3.7] to show that ficonverges capacity almost everywhere to f∈N1,p(X). Fix0>0, and let E0,n ={x∈X:|fn−f|≥0/n}.Wehave X |fn−f|pdμ ≤2−np, and thus μ(E0,n)≤np2−np−p 0.LetEN=n≥NE,N . By a union bound, we get that for any >0, there exists an N,sothatμ(EN)≤. The sequence of functions fn(x) converges uniformly to ffor any x∈X\EN, and thus for a.e. x∈X,since >0 is arbitrary. By considering un=|fn−f|n−1 0as a test function, we get Capp(E0,n)≤ np2−np−p 0. At the expense of possibly increasing N,wegetCap p(EN)≤.Since >0 is arbitrary, limN→∞ Capp(EN) = 0. Further, ficonverges pointwise to f outside the set E=∩∞ n=1En, which has capacity zero. Since the convergence is uniform, fis continuous in X\EN, for every N.Therefore, fis quasicontinuous, since limN→∞ Capp(EN)=0.  4. Localization and when Xis locally complete The previous section was focused entirely on complete spaces. In the final sections, we improve these statements to a locally complete setting. Specifically, we prove Theorem 1.3: Concluding that N1,p(X)∩C(X)isdenseinN1,p(X)andthat each function f∈N1,p(X) is quasicontinuous. These theorems will all be reduced to the complete setting by taking completions. This makes Xinto an open set in its completion, and we are left to consider domains Ω in complete spaces. Then, in each case, we consider the set of points Xδ⊂X, whose distance to the boundary in the completion is at least δ, and construct partitions of unity subordinate to such sets. Each Xδis complete, and the proofs mainly involve checking that we can “patch” together the information from each Xδto their union, which is X. For technical reasons, we prove these theorems in a slightly different order from those in the complete setting. 4.1. Preliminaries on taking a completion. First, we address some measure theoretic issues in taking a completion. Let Xbe locally complete, and let ˆ Xbe its completion. The completion is separable, if Xis separable. Further Xis an open subset of ˆ X.Ifμis a Radon measure on X, then we can define a Radon measure ˆμon ˆ Xas follows. If E⊂Xis Borel, then E∩Xis also Borel and we can define ˆμ(E)=μ(E∩X). (In fact, by a different argument E∩Xis Borel in Xwhenever Eis Borel even when Xis not Borel measurable in ˆ X, see [31, Proof of Lemma 1]). Since μis finite on balls, so is ˆμand therefore ˆμis a Radon measure. (See discussion at the beginning of Section 2.) Since we will be dealing with concepts relative to Xand ˆ Xwe need some care in our notation. For capacity, we will indicate the space Ywith respect to which it is computed in the superscript, as in CapY p(E), for E⊂Y.Weremarkthat if E⊂X⊂Yand the measures on the spaces relate by restriction μX=μY|X (where Xis measurable in Y), then CapX p(E)≤CapY p(E). Here, we use the fact 936 S. ERIKSSON-BIQUE AND P. POGGI-CORRADINI that in this same setting if u∈N1,p(Y), then u|X∈N1,p(X), as readily follows from the definition. 4.2. Quasicontinuity. Proof of quasicontinuity in Theorem 1.3.Fix f∈N1,p(X). Let ˆ Xbe the completion of Xand ˆμbe the extension of μto ˆ X. We have that Xis also an open set in ˆ Xsince Xis locally complete. Let δ>0 be arbitrary. Define Xδ={x:d(x, ˆ X\X)≥δ}. Then, Xδis a closed subset of ˆ X. Choose ψδ(x)=min{1,2 δd(x, ˆ X\Xδ/2)}.Thenψδ|Xδ≥1, ψδis 2/δ-Lipschitz and ψδ|ˆ X\Xδ/2=0. Let fδ=fψδ.Wehavefδ|X∈N1,p(X)andfδ|ˆ X\Xδ/2=0∈N1,p(ˆ X\Xδ/2). Then, fδ∈N1,p(ˆ X)sinceN1,p(X) has the sheaf property: If A, B ⊂ˆ Xare open sets and f|A∈N1,p(A),f|B∈N1,p(B), then f|A∪B∈N1,p(A∪B).1 Then, by Proposition 3.16 we have that fδis quasicontinuous in ˆ X. Therefore, for any δ>0 there is an open subset Eδso that fδ|ˆ X\Eδis continuous and Cap ˆ X p(Eδ)< δ.Fix>0 and let E=∪∞ i=1E2−i∩X. We have CapX p(E)≤Cap ˆ X p(E)≤.Now,f2−i|X\Eis continuous for every i∈N. Therefore f|X2−i\E=f2−i|X2−i\Eis continuous on for any i∈N.From this we get f|X\Eis continuous.  4.3. Density of continuous functions. Here and in what follows, the support supp(f) of a function f:X→Ris the smallest closed set Cso that f|X\C vanishes identically. In the proof of the density of continuous functions we will apply a partition of unity argument We will need a standard construction for a partition of unity subordinate to a cover. Let Xi={x:d(ˆ X\X,x)≥2−i}and Ωi={x:d(ˆ X\X,x)>2−i}.In the following, the distance of a point to an empty set is defined as ∞. Also, we say that a sum of functions ∞ i=1 fi(x)islocally finite if for every x∈Xthere exists a neighborhood, where only finitely many terms are nonzero. Lemma 4.1. Let ˆ Xbe the completion of Xand let Xibe defined as above. For each n∈N,Thereexist4n-Lipschitz functions ψn:ˆ X→[0,1], so that (1) supp(ψ0)⊂X1and supp(ψn)⊂Xn+1 \Xn−1for n≥1; (2) the functions are a partition of unity: ∞ n=0 ψn(x)=1for x∈X;and (3) the previous sum is locally finite in X, that is for every x∈Xthere exists aδ>0so that there are at most three n∈Nso that ψn(y)=0for y∈B(x, δ). Proof. Let ψ0(x)=min{1,2d(x, ˆ X\X1)}. Recursively, for n≥1, define (4.1) ψn(x)=1− n−1  k=0 ψkmin{1,2n+1d(x, ˆ X\Xn+1)}. First, ψ0is 2-Lipschitz, and by induction one can show that ψnis Lipschitz with constant (1 + ···+4 n−1)+2 n+1 ≤4n.Wehaveψ0|X0= 1. By induction, we get 1This can be seen by the following argument: If gA,g B∈Lp(A) are upper gradients for f|A and f|B,theng=gA1A+gB1B∈Lp(A∪B) is an upper gradient of f|A∪B. Indeed, the upper gradient inequality (1.1) can be verified for any rectifiable curve γin A∪Bby dividing it into finitely many parts contained in either Aor B. DENSITY OF CONTINUOUS FUNCTIONS AND CAPACITY 937 that n−1 k=0 ψk|Xn−1= 1. Therefore, (b) holds. Moreover, this gives (a), since the first factor in (4.1) vanishes on Xn−1and the second factor vanishes outside Xn+1. Finally, we prove (c). If x∈X,thenx∈Xn\Xn−1for some n≥0, where X−1=∅to simplify the argument. We have for δ=2 −(n−1) that B(x, δ)⊂Xn+1. Thus, for y∈B(x, δ), due to (a), ψk(y)= 0 can only occur for k=n−1,n,n+1.  We also need a fairly simple version of the sheaf property for Sobolev functions. Lemma 4.2. Let p∈[1,∞)and let Xbe any metric measure space equipped with a Radon measure μ, finite on balls. If Ai⊂Xis any increasing sequence of open sets, and H:A:=∞ i=1 Ai→[−∞,∞]is a function so that H|Ai∈N1,p(Ai)with supi∈NHN1,p(Ai)<∞,fori≥1,thenH∈N1,p(A). Further, HN1,p(A)= limi→∞ HN1,p(Ai). Proof. The Lp-version of the claim follows from monotone convergence, and we get H∈Lp(A)andHLp(A)= limi→∞ HLp(Ai) Let gi:X→[0,∞] be the zero-extension of the minimal p-weak upper gradient of H|Ai.Bylocalityofp-weak upper gradients, see [22, Proposition 6.3.22], gi|Aj= gjalmost everywhere on Ajfor all j<i. Thus, there exist a function g:A→[0,∞] with g∈Lp(A)andg|Ai=gialmost everywhere on Ai.Thus,g|Aiis a p-weak upper gradient for H|Aifor all i∈N. Fix >0. By Lemma 2.1, for every i, we can find a lower semicontinuous gi, :Ai→[0,∞] which is an upper gradient for H|Aiwith gi, ≥g|Aiand gi, − g|AiLp(Ai)≤2−i.Extendgi, by zero, and define ˜g=sup igi,.Wehave,onthe set A, |˜g−g|≤ ∞  i=1 |gi, −g|1Ai. Then ˜g∈Lp(A), and, by monotone convergence, ˜gLp(A)≤+ lim i→∞ giLp(Ai). By construction, ˜g|Ai≥gi, and thus ˜g|Aiis an upper gradient for H|Ai.Every rectifiable curve in i∈NAiis contained in Aifor some i∈N. This argument verifies (1.1) and ˜gis an upper gradient for H.Thus,H∈N1,p(A). Further, HN1,p(A)≤(Hp Lp(A)+˜gp Lp(A))1 p≤lim i→∞((+giLp(Ai))p+Hp Lp(Ai))1 p. Since >0 is arbitrary the claim follows.  Proof of density in Theorem 1.3.Let f∈N1,p(X) be any function. Fix >0. Let ψnbe the partition of unity functions from Lemma 4.1. We also define ˆ ψn= ψn+ψn+1 +ψn−1for n≥1and ˆ ψ0=ψ0+ψ1. For every x∈Ωwehavefinitely many nso that ˆ ψn(x)= 0. Further, whenever ψn(x)=0,wehave ˆ ψn(x)=1. There are also constants Lnso that ˆ ψnare Ln-Lipschitz. Indeed, with some care, we could show that Ln4n, but we will not need this. As in the proof of the quasicontinuity in Theorem 3.6 we set fn=fˆ ψn∈ N1,p(ˆ X). By Theorem 3.6, there is a continuous u n∈N1,p(ˆ X)∩C(ˆ X)sothat fn−u nN1,p(ˆ X)≤2−4−n(1 + Ln)−1. Also, let un=ˆ ψng n. Then, by using the Leibniz rule (see [22, Proposition 6.3.28]), we get un−fnN1,p(ˆ X)=ˆ ψn(un−fn)N1,p(ˆ X)≤2(1 + Ln)un−fnN1,p(ˆ X)≤2−2−n. 938 S. ERIKSSON-BIQUE AND P. POGGI-CORRADINI Let u=∞ n=1 un. Since the sum is a locally finite sum of continuous functions by property (c) of Lemma 4.1, then u∈C(X) and the sum is well defined. We show that u∈N1,p(X). Fix an i∈N.Wehavethatf|Ωi=n+1 i=0 fi|Ωiand that u|Ωi=n+1 i=0 ui|Ωi.Thus, f−uN1,p(Ωi)≤ ∞  n=1 fn−unN1,p(Ωi)≤/2 and u|Ωi∈N1,p(Ωi) with a uniformly bounded norm independent of i. By Lemma 4.2, u∈N1,p(X). Further, gN1,p(X)= limi→∞ gN1,p(Ωi).Finally, by applying this argument to the difference f−g,weobtainf−gN1,p(X)≤. Since gis continuous, the claim follows.  5. Choquet capacities and equivalence of definitions In the final section, we study the capacity E→Capp(E) and condenser capacity Capp(E,F), and prove that they satisfy certain regularity properties. Specifically, we prove the following three theorems. (1) Theorem 1.5: Concluding that E→Capp(E) is outer regular. (2) Corollary 1.6: Concluding that E→Capp(E) is a Choquet capacity for p>1. (3) Theorem 1.1: Concluding that different definitions of Capp(E,F)coincide. In particular, capacity can be computed with locally Lipschitz functions with locally Lipschitz upper gradients. 5.1. Choquet capacity and outer regularity. We start by defining a Choquet capacity. Denote by P(X) the collection of all subsets of X, i.e., its power set. Definition 5.1. A functional I:P(X)→[0,∞] is called a Choquet capacity, if it satisfies the following three properties. (1) Increasing:IfA⊂B⊂X,thenI(A)≤I(B). (2) Continuity from below:If(An)n∈Nis an increasing sequence of subsets of X,then lim n→∞ I(An)=I n∈N An. (3) Continuity from above:If(Kn)n∈Nis a decreasing sequence of compact subsets of X,then lim n→∞ I(Kn)=I n∈N Kn. A reader interested in Choquet capacities may consult any of the following [14, 15]. A condensed treatise is available in [11]. An earlier result showing that a variant of Capp, see Remark 1.7, is Choquet is presented in [24]. One of the main motivations for introducing Choquet capacities is the “Capacitability theorem” of Choquet, which states that any analytic subset A⊂Xsatisfies: I(A)= supK⊂AI(K), where the supremum is taken over compact subsets of A. For I=Cap p, the increasing property is immediate from the definition. The continuity from below holds without further assumptions, when p>1. The continuity from above is reduced to the functional being outer regular. Recall that the DENSITY OF CONTINUOUS FUNCTIONS AND CAPACITY 939 functional Iis outer regular, if for every compact set K⊂X,andany>0, there exists an open set Osuch that K⊂Oand I(O)≤I(K)+. In other words, the main object is to establish outer regularity, and then collect all the pieces together to prove that Cappis a Choquet capacity. We first prove the outer regularity of the capacity, which was stated in Theorem 1.5. This is a repetition of the argument in [7, Proof of Corollary 1.3], with the only change being that Proposition 3.16 is used instead of [7, Theorem 1.1]. For the reader’s convenience, we sketch the idea here. Sketch of proof of Theorem 1.5.Let u∈N1,p(X) be any nonnegative function with u|E≥1. Fix >0. Then, uis quasicontinuous by Theorem 1.3, and there is an open set Vwith Capp(V)< pso that u|X\Vis continuous. Choose a nonnegative function vso that vN1,p(X)≤and v|V≥1. By continuity in X\V, there is an open set OEwith E\V⊂OEso that u|OE∩X\V≥1−. Consider the function u=u 1−+v.Thenu|OE∪V≥1. The set OE∪Vis open, and thus, inf E⊂OCapp(O)≤up N1,p(X)≤1 (1 −)uN1,p(X)+p . Taking an infimum over u∈N1,p(X) with u|E≥1 and letting →0 yields the claim.  Next, we prove that Cappis a Choquet capacity. This was stated in Section 1 as Corollary 1.6. Proof of Corollary 1.6.We verify the three properties of a Choquet capacity from Definition 5.1. (1) Increasing: If A⊂B⊂X,thenCap p(A)≤Capp(B), since every function u∈N1,p(X) with u|B= 1 also satisfies u|A=1. (2) Continuity from below: We follow the proof of [24], which is presented with a slightly different definition of capacity. Let Anbe any increasing sequence of sets. By the increasing property, the property of continuity from below is automatic if limn→∞ Capp(An)=∞. Thus, we may assume that limn→∞ Capp(An)<∞. Choose any sequence un∈N1,p(X)sothatun|An=1and lim n→∞ unp N1,p(X)= lim n→∞ Capp(An). The functions unand their minimal p-weak upper gradients gunare uniformly bounded in Lp(X). Therefore, by Mazur’s Lemma, we may choose convex combinations ˜unof {uk}∞ k=nand corresponding convex combinations ˜gnof {gk}∞ k=nso that ˜unand ˜gnare Cauchy in Lp(X)andsothat˜gn is an upper gradient for ˜un. Choose a subsequence (nk)∞ k=1, with nk≥k, so that (5.1) ∞  k=1 |˜unk+1 −˜unk|+|˜gnk+1 −˜gnk|∈Lp(X). Next, define ˜ul=sup k≥l˜unland ˜gl=sup k≥l˜unl. It follows from (5.1) that ˜ul,˜gl∈Lp(X), and that as l→∞they converge in Lp(X). A fairly direct calculation using the definition (1.1) shows that ˜glis a p-weak upper gradient for ˜ul,and˜ul∈N1,p(X). 940 S. ERIKSSON-BIQUE AND P. POGGI-CORRADINI Note that ˜ulp N1,p(X)≤˜ulp Lp(X)+˜glp Lp(X). Then, by construction and the Lp(X) convergence, we get lim l→∞ ˜ulp Lp(X)+˜glp Lp(X)≤lim n→∞ unp N1,p(X)= lim n→∞ Capp(An). Now, ˜ul|Ak≥1 for every k≥l.Thus˜ul|kAk≥1. In particular, Capp k Ak≤˜ulp Lp(X)+˜glp Lp(X). Sending l→∞gives Capp k Ak≤lim n→∞ Capp(An). The opposite inequality follows from the increasing property. This completes the proof of continuity from below. (3) Continuity from above: Let (Kn)n∈Nbe any decreasing sequence of compact sets and let K=nKn. From the capacity being increasing, we get Capp(K)≤limn→∞ Capp(Kn). We next establish this inequality in the opposite direction. If Capp(K)=∞,thenCap p(K) = limn→∞ Capp(Kn). Thus, consider the case of Capp(K)<∞. By Theorem 1.5, for every >0, there exists an open set Owith K⊂Oand Capp(O)≤Capp(K)+.For nsufficiently large Kn⊂O, and thus by the increasing property, we get Capp(K)≤lim n→∞ Capp(Kn)≤Capp(K)+. Since >0 is arbitrary, the claim follows.  5.2. Different definitions of capacity agree. Proof of Theorem 1.1.Let E,F =∅be two closed, disjoint nonempty subsets in X with d(E,F)>0. It is straightforward to show that Capp(E,F)≤Capc p(E,F)≤Caplip p(E,F)≤Cap(lip,lip) p(E,F). Thus, it suffices to prove Cap(lip,lip) p(E,F)≤Capp(E,F). If Capp(E,F)=∞,this is obvious. Thus, assume Capp(E,F)<∞.Let>0 be arbitrary. We can choose a function u∈N1,p(X) which is nonnegative, with u|E=0andu|F=1,andwith an upper gradient gsuch that gp dμ ≤Capp(E,F)+. Let ˆ Xbe the completion of X.Fixx0∈X.Extenduand gbyzerotofunctions in Lp(ˆ X). Let Xj={x∈X∩B(x0,j):d(x, ˆ X\X)≥2−j}.Letψjbe the partition of unity constructed in Lemma 4.1. Recall that ∞ n=0 ψn(x)=1,each ψnis Ln-Lipschitz for some Ln<∞, and that supp(ψn)⊂Xn+1 \Xn−1for n≥1 and supp(ψ0)⊂X0. Let Ej=E∩Xj,F j=F∩Xj.Letj0∈Nbe so that Ej,F j=∅for all j≥j0. The space Xjis complete and bounded, and so we can apply Theorem 3.3 and Corollary 3.4 to the functions u|Xjand (g)|Xj. We obtain that for every j≥j0 there exist Lispchitz functions uj∈N1,p(Xj) with locally Lipschitz upper gradients