Characterizations of Sobolev Functions that vanish on a part of the boundary

Let $\Omega$ be a bounded domain in R n with a Sobolev extension property around the complement of a closed part D of its boundary. We prove that a function u $\in$ W 1,p ($\Omega$) vanishes on D in the sense of an interior trace if and only if it can be approximated within W 1,p ($\Omega$) by smooth functions with support away from D. We also review several other equivalent characterizations, so to draw a rather complete picture of these Sobolev functions vanishing on a part of the boundary.


Introduction
In this note we study first-order Sobolev spaces on a bounded domain Ω ⊆ R n , n ≥ 2, encapsulating a Dirichlet boundary condition on a closed part D of the boundary ∂Ω. These function spaces appear quite naturally in the variational treatment of elliptic and parabolic divergence-form problems if the solution should satisfy a Dirichlet condition only on one part of the boundary, whereas on the complementary part other restrictions are imposed. For a comprehensive treatment and specific, physically relevant examples of such mixed boundary value problems the reader can refer to [10].
In these applications the underlying domain typically is too rough as to admit a trace operator for the whole Sobolev space W 1,p (Ω), defined as the collection of all u ∈ L p (Ω) such that in the sense of distributions ∇u ∈ L p (Ω) n . On the other hand, classical regularity results for solutions of mixed boundary value problems such as Hölder continuity are still available, see the recent developments in [4] and references therein. This motivates to investigate in which sense the Dirichlet boundary condition 'u = 0 on D' can be understood if only u ∈ W 1,p (Ω) holds.
Particularly with regard to mixed boundary value problems, the weakest meaningful definition of a closed subspace of W 1,p (Ω), 1 < p < ∞, incorporating the Dirichlet boundary condition on D is given by approximation: The space W 1,p D (Ω) is defined as the closure in W 1,p (Ω) of the set of test functions C ∞ D (Ω) := {u| Ω : u ∈ C ∞ 0 (R n ), supp(u) ∩ D = ∅} with support away from the closed set D. More generally, this definition makes sense if only Ω is open and D ⊆ Ω is closed. Just recently, the structure of the spaces W 1,p D (Ω) has been studied with the objective of obtaining intrinsic characterizations that only use the given Sobolev function u ∈ W 1,p (Ω) in order to decide whether or not u ∈ W 1,p D (Ω) holds. On the whole space Ω = R n this problem is perfectly understood due to the Havin-Bagby-Theorem [1,Thm. 9.1.3], making use of the notion of p-capacity of sets E ⊆ R n , where 1 < p < ∞ and G 1 ∈ L 1 (R n ) is the first-order Bessel kernel defined as the inverse Fourier transform of ξ → (1 + |ξ| 2 ) −1/2 . Proposition 1.1 (The Havin-Bagby-Theorem). Let 1 < p < ∞, let E ⊆ R n be closed, and let v ∈ W 1,p (R n ). Then v ∈ W 1,p E (R n ) if and only if for C 1,p -almost every x ∈ E, As for domains, it was observed for instance in [2] and [3] that under suitable geometric assumptions every u ∈ W 1,p D (Ω) can be extended to a function v not only in W 1,p (R n ) but in W 1,p D (R n ). Consequently, the Havin-Bagby-Theorem can also be used to describe W 1,p D (Ω). While this characterization is 'intrinsic' [2] in that it does not depend on the particular choice of the extension, it is certainly not canonical as it is given in terms of a Sobolev function different from u somehow to be chosen yet. For a Sobolev function defined only on Ω the natural substitute for (1) is to require lim r→0 1 |B(x, r)| B(x,r)∩Ω |u| dy = 0 (for C 1,p -almost every x ∈ D) (2) and the purpose of this note is to prove that under the following geometric assumption this interior trace condition indeed provides a new, canonical characterization of W 1,p D (Ω). Assumption 1.2. The W 1,p -extension property holds around ∂Ω \ D, that is, every x ∈ ∂Ω \ D has an open neighborhood U x such that U x ∩ Ω is connected and admits a bounded extension operator E x : W 1,p (U x ∩ Ω) → W 1,p (R n ).
By an extension operator we always mean a linear operator that does not modify functions on the smaller domain. Assumption 1.2 allows us to construct a bounded extension operator E : W 1,p D (Ω) → W 1,p D (R n ) via a localization argument [3, Thm. 6.9], thereby making the Havin-Bagby-Theorem applicable as discussed above. As for mixed boundary value problems, this geometric assumption is rather common since it seems to be indispensable for treating most non-Dirichlet boundary conditions on ∂Ω \ D. Let us mention that it covers the more specific case of a bounded domain Ω exhibiting Lipschitz coordinate charts around ∂Ω \ D. For a further discussion the reader can refer to [3,Sec. 6.4].
Somewhat hidden at first sight, one of the most important features of Assumption 1.2 is that it guarantees a certain regularity of Ω near the common frontier of D with the complementary boundary part by requiring the W 1,p -extension property around the closure of ∂Ω \ D. In fact, if the W 1,p -extension property only holds around ∂Ω \ D, then (2) is neither necessary nor sufficient for u ∈ W 1,p (Ω) to be a member of W 1,p D (Ω), see Section 6 for explicit counterexamples. Assumption 1.2 is void if pure Dirichlet conditions D = ∂Ω are imposed and in this case the conclusion that (2) characterizes W 1,p D (Ω) = W 1,p 0 (Ω) is due to Swanson and Ziemer [12]. We shall review their proof in Section 4, not only for convenience but also since our approach requires all details of theirs. The integrals in (2) can be replaced by true averages if Ω satisfies the lower density condition However, we stress that this need not be the case, neither in the context of mixed boundary value problems nor within the setup of this note. Note also that (2) -in contrast to (1) -uses the absolute value of u. This modification is necessary since our geometric assumptions do not rule out that the boundary part D is contained in the interior of the closure of Ω. In particular, we may think of a rectangle R : Let us close by remarking that in the context of mixed boundary value problems the Dirichlet part D typically is not just closed but satisfies for some l ∈ (0, n] an additional density assumption with respect to the l-dimensional Hausdorff measure H l on R n , which is usually referred to as l-Ahlfors regularity. In this case the capacities entering in (1) and (2) can often be replaced with coarser and easier to handle Hausdorff measures. Moreover, for such geometric configurations there is yet another intrinsic characterization of W 1,p D (Ω) of a rather different nature: It relies on Hardy's inequality, that is, integration against the weight x → dist D (x) −p , which is singular at the Dirichlet part [3,Thm. 3.2 & 3.4]. Here, dist D denotes the Euclidean distance function to the closed set D.

The main result
Besides the alluded interior trace result, we also see this note as good opportunity to concisely list the so-far known equivalent conditions for a function in W 1,p (Ω) to vanish on D in the weakest possible sense. This is being done in our following main theorem.
Theorem 2.1. Let Ω ⊆ R n be a bounded domain, let D be a closed subset of its boundary, and let 1 < p < ∞. Under Assumption 1.2 the following are equivalent for any given u ∈ W 1,p (Ω). (iii) There exists a Sobolev extension v ∈ W 1,p (R n ) of u that satisfies for C 1,palmost every x ∈ D, If in addition D is l-Ahlfors regular and n − p < l < n, then these conditions are also equivalent to the following.
(iv) There exists a Sobolev extension v ∈ W 1,p (R n ) of u that satisfies for H lalmost every x ∈ D, (v) The function u satisfies the Hardy-type condition If even n − p < l ≤ n − 1, then the conditions above are also equivalent to the following.
(vi) For H l -almost every x ∈ D it holds Remark 2.2. If the Hardy-type condition in (v) holds true for every u ∈ W 1,p D (Ω), then every such u also satisfies Hardy's inequality Indeed, this is a consequence of the closed graph theorem applied to the multiplication operator with symbol dist D (x) −p . Remark 2.3. Even though the restriction l ≤ n − 1 in (vi) compared to l < n in (iv) is of no harm for applications to mixed boundary value problems (where all too often l = n − 1), the question whether it is needed as part of our main result remains open. It will become clear in Section 5 that the answer in the affirmative would require a rather different argument.
Since first-order Sobolev spaces are invariant under truncation, |u| ∈ W 1,p (Ω) holds for every u ∈ W 1,p (Ω). The equivalence of (i) and (ii) in Theorem 2.1 implies the following worth mentioning corollary.

Corollary 2.4. Presume the setup of Theorem 2.1 and let
. In Section 5 we shall give complete proofs of the new implications in Theorem 2.1 and provide solid references for the already known ones. In the preliminary Section 3 we collect some classical continuity properties of Sobolev functions and in Section 4 we shall review Swanson and Ziemer's argument for W 1,p 0 (Ω) in order to set the stage for the general case.

Continuity properties of Sobolev functions
A locally integrable function f : R n → C possesses a Lebesgue point at x ∈ R n if there exists a number l = l(x) such that Here and throughout, averages are materialized by a dashed integral. We say that f is approximately continuous at x ∈ R n if there exists a measurable set E x of full Lebesgue density at x, that is Lebesgue points and points of approximate continuity are related via the following lemma from classical measure theory [7, Ch. 3, Sec. 1.4].
Next, let us recall that p-capacities and Lebesgue points for Sobolev functions v ∈ W 1,p (R n ), 1 < p < ∞, are intrinsically tied to each other by the fact that the limit of averages is finite for C 1,p -almost every x ∈ R n . The so-defined function v reproduces v within its Lebesgue class and is called precise representative of v. For convenience we set v(x) = 0 if the limit above does not exist. The Lebesgue Differentiation Theorem for Sobolev functions asserts that for C 1,p -almost every x ∈ R n we have In particular, C 1,p -almost every point x ∈ R n is a Lebesgue point for v with l(x) = v(x) and hence v is approximately continuous C 1,p -almost everywhere. Often we shall not distinguish between v and v and simply speak of approximate continuity of v. The reader can refer to [14,Sec. 3] for proofs of these facts and further background.
As a second continuity principle for Sobolev functions we need the following result [14,Thm. 2.1.4]. When speaking of properties that hold on almost all lines parallel to the x k -axis, where 1 ≤ k ≤ n, we think of the supporting line as being identified with its base point in R n−1 and use the (n − 1)-dimensional Lebesgue measure.
if and only if u has a representativeũ that is absolutely continuous on every compact interval contained in U of almost all lines that are parallel to the coordinate axes and whose classical partial derivatives belong to L p (U ).
We also require basic knowledge on functions of bounded variation in several variables and refer to [14,Ch. 5] or [5,Ch. 5] for further reading. The space BV(U ) of functions of bounded variation on an open set U ⊆ R n consists of all integrable functions v on U whose distributional partial derivatives are totally finite Radon measures on U . The next result, found for example in [14,Thm. 5.3.5] or [5,Sec. 5.10.2], provides the link with the classical one-dimensional notion of bounded variation. There, we define the essential variation of a scalar-valued function g on a closed interval [a, b] by where the supremum is taken over all finite partitions of [a, b] induced only by points a < t 0 < t 1 < · · · < t k < b at which g is approximately continuous.
The following extension result for functions of bounded variation is due to Swanson and Ziemer [12,Thm. 2.1]. By the zero extension of a function v defined on a set U ⊆ R n we mean the trivial continuation of v to the whole space by 0.
We close by stating two related results that will prove to be useful in the further course. Their proofs can be found in the textbooks [6, Thm. 4.5.9(29)] and [13, Thm. 13.8], respectively.

A review of Swanson and Ziemer's argument
In this section we review Swanson and Ziemer's [12] proof of '(ii) =⇒ (i)' in the case of pure Dirichlet conditions. Along the way we shall reveal a useful addendum to their result that is recorded as the second part of the following proposition. Let us stress that here the restriction to bounded open sets is only for the sake of simplicity, compare with [12]. for C 1,p -almost every x ∈ ∂U , then u ∈ W 1,p 0 (U ). If u has this property only for H l -almost every x ∈ ∂U and if n − p < l ≤ n − 1, then its zero extension u * is at least contained in W 1,p (R n ) and satisfies The following comparison principle asserts that the assumption in the second part of the proposition is indeed the weaker one. For a proof the reader can refer to [1,Sec. 5] for the case p ≤ n and [1, Prop. 2.6.1] for the case p > n.
Proof of Proposition 4.1. The argument is in six consecutive steps. As Lebesgue points and points of approximate continuity are local properties, we can associate with u a precise representative u as in Section 3. Then we define a representative u * of the zero extension u * ∈ L p (R n ) by u * ( Step 1: u * is approximately continuous H n−1 -almost everywhere. Recall from Section 3 that u is approximately continuous at C 1,p -almost every x ∈ U , hence at H n−1 -almost every x ∈ U due to Lemma 4.2. Again by this lemma and since every set of vanishing H l -measure has vanishing H n−1 -measure provided l ≤ n − 1, we obtain under both conditions of the proposition that for H n−1 -almost every x ∈ ∂U it holds Step 2: u * if of bounded variation on R n . We simply have to combine Proposition 3.4 with the first step and recall that u * vanishes outside of a bounded set.
Step 3: u * is continuous on almost all lines parallel to the coordinate axes. This is a direct consequence of the first two steps and Proposition 3.5.
Step 4: u * is of bounded variation on every compact interval of almost all lines parallel to the coordinate axes. Combining Step 2 with Proposition 3.3, we obtain that the essential variation of u * is bounded along every compact interval of almost all lines parallel to the coordinate axes. In view of Step 3 we may additionally assume that the restriction of u * to the respective lines is continuous and thus approximately continuous at every point. Hence, the definition of the essential variation collapses to the one of the standard one-dimensional variation and the claim follows.
Step 5: u * is absolutely continuous on every compact interval of almost all lines parallel to the coordinate axes. Due to Proposition 3.6 and the outcome of Steps 3 and 4 we only have to show that on almost all lines parallel to the coordinate axes the restriction of u * maps sets of one-dimensional Lebesgue measure zero into sets of one-dimensional Lebesgue measure zero.
To this end let λ be a line parallel to the x k -axis passing through the point x = (x ′ , x k ), where we adopt notation from Proposition 3.3. Owing to Steps 3 and 4 we may assume that u * (x ′ , ·) is continuous and of bounded variation. Proposition 3.2 provides yet another representativeũ of u ∈ W 1,p (U ) that is absolutely continuous on every compact interval contained in U of almost all lines parallel to the x k -axis. We may assume that this applies to λ and in view of Fubini's theorem we may as well assume that u(x ′ , ·) andũ(x ′ , ·) coincide almost everywhere on λ ∩ U with respect to the one-dimensional Lebesgue measure. By continuity they have to agree everywhere on λ ∩ U , showing that we may additionally assume that u * (x ′ , ·) is absolutely continuous on every compact interval contained in λ ∩ U .
Let now E ⊆ λ be a set of vanishing one-dimensional Lebesgue measure. Being the zero extension of u, the function u * maps E ∩ c U onto {0}, so that it remains to investigate what happens to the set E ∩ U . To this end, let I be an open subinterval of λ ∩ U and let J ⊆ I be a compact interval. Then Proposition 3.6 guarantees that u * (E ∩ J) has vanishing one-dimensional Lebesgue measure. In virtue of the regularity of the Lebesgue measure this property first carries over to u * (E ∩ I) and then to u * (E ∩ U ).
Step 6: Conclusion of the proof. Due to Step 5 the classical partial derivatives of u * exist almost everywhere on almost all lines parallel to the coordinate axes. Since the restriction of u * to U is a representative for u ∈ W 1,p (U ), Proposition 3.2 yields that the classical partial derivatives of u * evaluated at points inside U define p-integrable functions on U . Since u * vanishes on the open set c U , so do its classical partial derivatives. It remains to investigate the critical case, that is, the behavior at the boundary of U .
To this end, let λ be one of the lines parallel to the coordinate axes on which u * has the differentiability properties above. Let x ∈ λ ∩ ∂U be such that the classical partial derivative of u * in the direction of λ exists at x.
By a topological case distinction, either there exists an open one-dimensional neighborhood I ⊆ λ of x such that I ∩ c U = {x} or x can be approximated by a sequence of points (x j ) j∈N ⊆ λ ∩ c U that are all distinct from x. In the second case the classical partial derivative of u * at x in the direction of λ vanishes since u * (x) = u * (x j ) = 0 for all j. The first case looks rather odd but anyway it can occur at most countably often on λ since I is open and x is the only point in I with this property. Thus, without even investigating this first case, we can conclude that the classical partial derivative of u * in direction of λ vanishes at almost every point of λ ∩ ∂U with respect to the one-dimensional Lebesgue measure.
Taking into account Fubini's theorem, we can conclude that the classical partial derivatives of u * are p-integrable over R n . Consequently, Proposition 3.2 yields that u * is contained in W 1,p (R n ) and this already concludes the proof of the second statement of the proposition. In the first case we may now apply the Havin-Bagby-Theorem to u * ∈ W 1,p (R n ) and obtain u * ∈ W 1,p c U (R n ) from the assumption on u and the fact that u * vanishes on c U . This precisely means u ∈ W 1,p 0 (U ).

Proof of the main result
The proof of Theorem 2.1 will be achieved through the eight implications below.
(iii) =⇒ (i). If u ∈ W 1,p (Ω) has a Sobolev extension v ∈ W 1,p (R n ) that satisfies lim r→0 1 |B(x, r)| B(x,r) v dy = 0 for C 1,p -almost every x ∈ D, then v ∈ W 1,p D (R n ) thanks to the Havin-Bagby-Theorem. By definition, this means that v is contained in the W 1,p (R n )-closure of C ∞ D (R n ). Restricting to Ω, we find that v| Ω is contained in the W 1,p (Ω)-closure of C ∞ D (Ω) and due to v| Ω = u the conclusion u ∈ W 1,p D (Ω) follows. (ii) =⇒ (i). This is of course the most interesting implication. A part of the argument was inspired by [11,Sec. VIII.1]. Let us set some notation for a localization argument first. For x ∈ ∂Ω \ D we let U x be as in Assumption 1.2 and pick a finite subcovering U x1 , . . . , U xN of the compact set ∂Ω \ D. Then there exists ε > 0 such that U x1 , . . . , U xN together with form an open covering of Ω. Thus, on Ω there is a C ∞ -partition of unity η 0 , . . . , η N with the properties 0 ≤ η j ≤ 1 and supp(η j ) ⊆ U j . Here and in the following we abbreviate U xj by U j . Now assume that u ∈ W 1,p (Ω) satisfies (ii). We split u = N j=0 u j , where the functions u j := η j u are all contained in W 1,p (Ω). We shall prove that each summand is in fact contained in W 1,p D (Ω).
Step 1: The case j = 0. By assumption on u we have for C 1,p -almost every x ∈ D the limits Step 2: Preliminaries for the case j ≥ 1. Consider a summand u j with j ≥ 1. Assumption 1.2 allows us to construct an extension v j ∈ W 1,p (R n ) that coincides with u j on the domain U j ∩ Ω. We can further assume that v j is supported in U j and agrees with u j almost everywhere on Ω since otherwise we would replace v j by the extension χv j , where χ ∈ C ∞ 0 (U j ) is identically 1 on the support of η j . Since W 1,p (R n ) is invariant under truncation, we also have w := |v j | in this space. Let now x ∈ D be such that the limits holds. Here, w denotes the precise representative of w. By assumption and the Lebesgue Differentiation Theorem from Section 3 the three conditions can simultaneously be matched for C 1,p -almost every x ∈ D. For the moment our task is to demonstrate w(x) = 0. In doing so, only the case x ∈ U j is of interest since w = |v j | has support in U j .
Step 3: Proof of w(x) = 0. Lemma 3.1 provides a measurable set E x with lim r→0 |B(x, r) ∩ E x | |B(x, r)| = 1 (5) and the property that the restriction w| Ex is continuous at x. In order to simplify notation, we shall abbreviate E x = E and B(x, r) = B(r) in the following. For r > 0 we may write Here, the left-hand term tends to w(x) in the limit r → 0 by assumption on x and so does the first term on the right-hand side thanks to (5) and the continuity of w| E at x. Hence, the conclusion Since w = |v j | = |u j | almost everywhere on Ω, we can also decompose Again we investigate the behavior in the limit r → 0: The left-hand term tends to w(x) as before. From the pointwise bound |u j | ≤ |u| and (4) we deduce that the first term on the right-hand side vanishes. For the third term we obtain the same conclusion, this time using (6) and that w is a nonnegative function. Altogether, we have found If B(r) ∩ c Ω ∩ E is a Lebesgue nullset for some r > 0, then w(x) = 0 holds and we can stop here. Otherwise, we use the identity w dy with µ given by So, taking into account (7) and the continuity of w| E at x we finally arrive at and in order to deduce w(x) = 0 it remains to make sure that the limit inferior is different from 1. Thanks to the maximal Lebesgue density of E at x, see (5), and as x is contained in the open set U j , we can simplify In order to handle the middle term, we recall the following fundamental property of Sobolev extension domains [9, Thm. 2].
Lemma 5.1. If a domain V ⊆ R n admits a bounded Sobolev extension operator E : W 1,p (V ) → W 1,p (R n ) for some p ∈ [1, ∞), then V is n-Ahlfors regular.
Owing to Assumption 1.2, this lemma in particular applies to V = U j ∩ Ω. Hence, there is a constant c > 0 such that for all y ∈ U j ∩ Ω and all r < 1 it holds Since x ∈ D ∩ U j lies on the boundary of U j ∩ Ω, we can find for any 0 < r < 1 a point y ∈ U j ∩ Ω such that B(y, r/2) ⊆ B(r) ⊆ B(y, 2r). Thus, In particular, going back to (8)  Step 4: Conclusion of the case j ≥ 1. So far we have shown that the precise representative w of w = |v j | vanishes for C 1,p -almost every x ∈ D. In particular, lim r→0 1 |B(x, r)| B(x,r) v j dy = 0 holds for C 1,p -almost every x ∈ D.
Since v j is a Sobolev extension of u j , the implication '(iii) =⇒ (i)' proved before yields u j ∈ W 1,p D (Ω) as desired.
(i) =⇒ (ii). Let u ∈ W 1,p D (Ω). In view of the implication '(i) =⇒ (iii)' we have a Sobolev extension v ∈ W 1,p (R n ) whose precise representative v vanishes C 1,palmost everywhere on D at our disposal. The Lebesgue Differentiation Theorem for Sobolev functions discussed in Section 3 yields (iii) ⇐⇒ (iv). The implication '(iii) =⇒ (iv)' is a direct consequence of the comparison principle stated in Lemma 4.2. It does not require D to be l-Ahlfors regular.
As for the reverse implication, it has been shown in [2,Cor. 4.5] holds for H l -almost every x ∈ D and if D is l-Ahlfors regular with parameter l ∈ (n − p, n), then the same convergence already holds for C 1,p -almost every x ∈ D.
In fact, this is a rather direct consequence of the deep extension/restriction-theory for Besov spaces on Ahlfors-regular sets developed by Jonsson and Wallin [11]. (ii) =⇒ (vi). This implication follows once again from the comparison principle.
(vi) =⇒ (iii). This will be obtained by re-running the proof of '(ii) =⇒ (i)'. First, we split u = N j=0 u j as before. Concerning u 0 , our assumption (vi) and the support property of η 0 imply now only for H l -almost every x ∈ ∂Ω. The second part of Proposition 4.1 yields that the zero extension u * 0 is a Sobolev extension of u 0 ∈ W 1,p (Ω) with the property required in (iv) and we deduce u 0 ∈ W 1,p D (Ω) from the equivalence with (i). Turning to u j in the case j ≥ 1, the difference with the proof of '(ii) =⇒ (i)' is that the exceptional set designed in Step 2 is only of vanishing H l -measure. However, then we can apply Step 3 verbatim to obtain that the extension v j ∈ W 1,p (R n ) satisfies lim r→0 1 |B(x, r)| B(x,r) v j dy = 0 for H l -almost every x ∈ D. Hence, v j has again the property required in (iv) and we conclude u j ∈ W 1,p D (Ω) as before.

Counterexamples
We compare with Figure 1. Here, we write A + B = {a + b : a ∈ A, b ∈ B} for the sum of two sets A, B ⊆ R 2 , so that for example H k j has horizontal side length 2 −j + 2a j and vertical side length 2a j . We shall always choose 0 < a j , b j < 2 −j−1 in order to arrange the overlap of the horizontal and vertical rectangles as displayed schematically in Figure 1. Note that the Dirichlet part D := [0, 1]×{0} is a closed, 1-Ahlfors regular subset of ∂Ω and that Ω exhibits Lipschitz coordinate charts around every boundary point x ∈ ∂Ω \ D. Example 6.1. We let 1 < p < ∞ and construct Ω using the sequences a j = 2 −j−2 and b j = 2 −(1+p)j . We claim that the constant function u = 1 is contained in u ∈ W 1,p D (Ω) although the condition in part (ii) of Theorem 2.1 fails at every boundary point x ∈ D.
To see the second claim, let x ∈ D and 0 < r < 1. If j ∈ N satisfies 2 −j+1 ≤ r/2, then B(x, r) ∩ Ω contains a rectangle of horizontal side length r/2 and vertical side length a j = 2 −j−2 . Thus, showing that the condition in part (ii) of Theorem 2.1 fails. On the other hand, if y 2 > 2 −j − 2 −j−2 2 j+3 y 2 − 5 else is continuous, piecewise affine, and its support is disjoint from D. Lebesgue's theorem guarantees u j → u in L p (Ω) and since by construction ∇u j is supported in the set 2 j k=0 V k j and satisfies the pointwise bound |∇u j | ≤ 2 j+3 , we also obtain that is, ∇u j → ∇u in L p (Ω). In order to conclude u ∈ W 1,p D (Ω) it suffices to convolve the approximants u j by smooth kernels with sufficiently small support. Example 6.2. We let 4 < p < ∞ and construct Ω using a j = b j = 4 −j−1 . We claim that this time the constant function u = 1 is not contained in W 1,p D (Ω) although the condition in part (ii) of Theorem 2.1 holds at every boundary point x ∈ D.
In order to see the second claim, let x ∈ D and 0 < r < 1. For each j ∈ N it follows from the dyadic structure of the skeleton for Ω that B(x, r) intersects at most ⌊2r/2 −j + 3⌋ of the vertical rectangles V k j , each of which has measure |V k j | ≤ 2 −3j . As for the horizontal rectangles, we simply observe that 2 j −1 k=0 H k j ∩ B(x, r) is contained in a rectangle with side lengths 2r and 2 −2j−1 . In conclusion, 1 |B(x, r)| B(x,r) |u| dy ≤ 1 πr 2 j∈N 2 −j ≤r ⌊r2 j+1 + 3⌋2 −3j + r2 −2j r, taking care of the condition in part (ii) of Theorem 2.1.
Next, we shall prove that despite its rather irregular structure the domain Ω still admits the Poincaré inequality v L ∞ (Ω) ∇v L p (Ω) (v ∈ W 1,p D (Ω)).
Finally, let y ∈ Ω. There exist j ′ ∈ N and 0 ≤ k ≤ 2 j ′ such that y ∈ V k j ′ or y ∈ H k j ′ . In the first case we consider the chain of rectangles R j := V k j , j ≥ j ′ , which have the property that y ∈ R j ′ and R j ∩ R j+1 = ∅ for all j ≥ j ′ . In the second case we add R j ′ −1 := H k j ′ to the chain. Now, v ∈ C ∞ D (Ω) implies that v = 0 holds everywhere on R j for j sufficiently large. Hence, (11) and another telescoping sum yield |v(y)| ≤ 32C ∇v L p (Ω) ∞ j=0 2 j(4/p−1) and the geometric series converges due to our assumption p > 4. This proves (9).