1 Introduction

Harmonic functions and the related Dirichlet problem are one of the most classical and fundamental subjects of studies in mathematical analysis and theory of PDEs. One studies harmonic functions and their generalizations in various settings and contexts, for instance in the Euclidean domains, on manifolds, in the setting of trees, also in Banach spaces. Recent two decades have been the period of an intensive development of yet another area of mathematics, the analysis on metric measure spaces. Its studies bring new approaches and sheds new light also on the theory of harmonic functions. The results due to Cheeger [9], Hajłasz–Koskela [16], Heinonen–Koskela [25] and Shanmugalingam [46], to mention just few mathematicians contributing to the growth of the analysis on metric spaces, laid foundations for the first order Calculus and notions of gradient in metric spaces. See, for instance, a survey by Heinonen [24] for the panorama of the area and further references. Basing on the notion of the weak upper gradient one can study the minima of the Dirichlet energy obtaining counterparts of p-harmonic functions and mappings in the metric setting with the harmonic case corresponding to \(p=2\), see e.g. Shanmugalingam [47]. Related is an approach based on the Cheeger derivative and a metric counterpart of the tangent space, see [9].

In this work we present another approach to harmonicity on metric measure spaces based on functions which satisfy the mean value property for all balls centered at the points of the given open set and contained in this set. Harmonic functions of such kind were introduced by Gaczkowski and Górka [13]. Namely, in [13] the authors study locally integrable real-valued functions defined on an open subset \(\Omega \subset X\) of a metric measure space \((X, d, \mu )\) requiring that the mean value property for f holds at every \(x\in \Omega \) and for all balls \(B(x,r)\Subset \Omega \):

$$\begin{aligned} f(x)=\frac{1}{\mu (B(x,r))}\int _{B(x,r)} f(z) d\mu (z). \end{aligned}$$

In this work we call such functions strongly harmonic, see Definition 3.1. We continue investigations of their properties, as well as introduce the so-called weakly harmonic functions which are required to satisfy the mean value property only for at least one admissible radius at every point of an open set. Our definition is motivated by the classical and subtle investigations in the Euclidean setting due to e.g. Koebe, Volterra and Kellogg, Hansen and Nadirashvili, and Blaschke, Privaloff and Zaremba. We refer to Sect. 3 for a brief historical sketch of the studies on the size of the set of admissible radii sufficient to imply the harmonicity. Moreover, one of the main goals of our work is to provide a uniform approach to the mean-value harmonicity and extract the properties shared by functions with the mean-value property in various settings, as illlustrated by examples in Sect. 3.

In Preliminaries we introduce and recall some basic definitions of the metric analysis. In particular, we define continuity of a measure with respect to a metric, see Definition 2.1. Such a property has been important in the previous studies of harmonic functions, see [13] (also [15]). Moreover, we study some properties of a measure implying its continuity with respect to the given metric and notice that this condition gives us wide class of metric measure spaces. It turns out, for instance, that doubling measures in geodesic spaces have this property, see Proposition 2.1. Our studies involve various other types of measures, e.g. uniform measures and measures satisfying \(\delta \)-annular decay condition for some \(\delta \in (0,1]\). However, measures continuous with respect to a distance appear to be the most general among the aforementioned measures (see the discussion and the diagram following Proposition 2.1 in Preliminaries).

In Sect. 3 we bring on stage main characters of the paper, i.e. strongly and weakly harmonic functions, motivate their definitions and introduce some of their basic properties and natural relatives such as sub- and superharmonic functions. The latter two notions will play a vital role in the studies of the Dirichlet problem in Sect. 6. Furthermore, we study how to generate new sub- and superharmonic functions from the existing ones; we also mention the p-harmonic functions as defined via the minimization of the p-Dirichlet energy and address their relation to harmonic functions as studied in our work. Additionally, we provide a number of examples of strongly and weakly harmonic functions in various settings, including manifolds, trees and weighted \({\mathbb {R}}^n\).

The key geometric and regularity properties of harmonic functions are presented and studied in Sects. 4 and 5. We identify conditions implying continuity of strongly and weakly harmonic functions as well as we discuss various Harnack inequalities on balls and compact sets. This allows us to obtain important tools of the potential and geometric function theories, namely the weak and strong maximum principles, and the comparison principle. While for strongly harmonic functions such properties could be expected, the fact that they are also available in the setting of weakly harmonic functions might be surprising. Having established the aforementioned properties of harmonic functions, we show one of the main results of Sect. 4, namely the local Hölder continuity of strongly and weakly harmonic functions (i.e. Hölder continuity on compact subsets of an underlying domain), see Theorem 4.1. For strongly harmonic functions we prove this result for geodesic doubling measure spaces with the Hölder exponent depending on the doubling constant only, whereas for weakly harmonic functions we, additionally, require that a compact set K remains enough away from the boundary of the domain and the admissible radii for points in K are uniformly separated from zero and uniformly bounded from the above. The final topic studied in Sect. 4 is the Hölder and Lipschitz regularity of harmonic functions in spaces satisfying the so-called \(\delta \)-annular decay property for some \(\delta \in (0,1]\) with the Lipschitz case corresponding to \(\delta =1\), see e.g. Buckley [8]. Roughly speaking, such a property relates the measure of an annular ring to its thinness, cf. Definition 4.1. Moreover, it turns out that length doubling metric spaces have an annular decay property for some \(\delta \) while a space with measure continuous with respect to a distance possesses 1-annular decay property. In Theorem 4.2 we provide the Hölder and Lipschitz estimates on balls and compact sets. By imposing stronger assumptions on measure than in Theorem 4.1 we are able to obtain finer estimates on balls already in the Hölder case, while on compact subsets we not only show the Hölder regularity as in Theorem 4.1 but also provide estimates with explicit constants and exponent \(\delta \). In the Lipschitz case not covered by Theorem 4.1 we also have explicit constants, however our estimates depend additionally on a Lebesgue number of a choosen covering.

We continue studies of the regularity properties of harmonic functions in Sect. 5. There, we study uniform measures, i.e. such measures \(\mu \) that every ball B of radius \(r>0\) satisfies

$$\begin{aligned} \mu (B)=C\,r^Q,\quad \hbox {for given } C>0 \hbox { and } Q\ge 1. \end{aligned}$$

Uniform measures appear in geometric measure theory, for example in relation to the Marstrand theorem, in the studies of rectifiable measures and in the theory of incompressible flows in PDEs, see the discussion following Definition 5.1. Proposition 5.1 shows that in spaces with uniform measures strongly and weakly harmonic functions are locally Lipschitz. Moreover, we compute Lipschitz constants more accurately than in Theorem 4.2. In particular we avoid using a Lebesgue number of a covering. These observations allow us to complete the presentation in Sections 4 and 5 with differentiability results based on Cheeger’s work [9]. In Corollaries 5.1 and 5.2 we describe conditions on metric measure spaces implying that strongly and weakly harmonic functions have weak upper gradients. The (1, p)-Poincaré inequality plays a crucial role for such results to hold.

Section 6 is entirely devoted to studying the Dirichlet problem for harmonic functions. We address the following fundamental problems: whether there exists a function with given boundary data satisfying the mean value property inside the domain and whether it is unique, and if so how to construct such a function? In order to solve the first problem we take an approach based on the dynamical programming principle. The idea of this method originates from the stochastic games, especially tug-of-war games and related p-harmonious functions (see e.g. Manfredi et al. [37]), and is based on setting up an integral operator, iterating it and proving that such an iteration process converges to a function. We adapt method by Luiro, Parviainen and Saksman [36], recently developed for the Euclidean domains, in the metric setting. According to our best knowledge such an approach to the Dirichlet problem on metric spaces is new in the literature. In Theorem 6.1 we show that given a domain and a measurable boundary data one obtains a function which satisfies the mean value property with respect to exactly one radius at every point of the domain, provided that this point is enough far away from the boundary. Moreover, such a solution satisfies the boundary data condition. Furthermore, Theorem 6.2 extends the previous result to the setting of continuous boundary data. We also prove that if a Dirichlet problem has a continuous subharmonic solution, then it has the weakly harmonic solution with the same continuous boundary data, see Theorem 6.3.

In the final section of the paper we discuss another fundamental geometric properties of harmonic functions, namely the Liouville type theorems. In Theorem 7.1 we provide a fairly general condition for a measure which implies that a strongly(weakly) bounded harmonic function defined in the whole space must be constant. Furthermore, we discuss some sufficient conditions on measure to guarantee that the hypotheses of Theorem 7.1 is satisfied. In particular, this is the case if the measure of the space is finite or in the length spaces with a doubling measure. Our discussion is illustrated with examples. We, for instance, show that even in a simple case of \({\mathbb {R}}\) there exist non-Lebesgue measures for which bounded entire harmonic functions need not be constant.

2 Preliminaries

Let \((X, d, \mu )\) be a metric measure space equipped with a metric d and measure \(\mu \). A ball in space X is denoted by \(B:=B(x, r)\) for \(x\in X\) and a radius \(r>0\). In what follows we will assume that \(\mu \) is a Borel regular measure with \(0<\mu (B)<\infty \) for any ball \(B\subset X\). Moreover, we assume that X is proper, that is closed bounded subsets of X are compact. For the sake of convenience we also assume that X is connected.

We say that a measure \(\mu \) is doubling if there is a constant \(C_\mu >0\) such that for all balls \(B=B(x,r)=\{y \in X : d(x,y)<r\}\),

$$\begin{aligned} \mu (2B)\le C_\mu \mu (B), \end{aligned}$$

where \(2B(x,r)=B(x,2r)\). If \(\mu \) is doubling, then X is complete if and only if it is proper (i.e. every closed bounded set is compact), see Proposition 3.1 in Björn–Björn [4].

One of the consequences of doubling property of \(\mu \) is that there exist \(C, Q>0\) such that for all \(x\in X\), \(0<r\le R\) and \(y\in B(x,R)\),

$$\begin{aligned} \frac{\mu (B(y,r))}{\mu (B(x,R))} \ge \frac{1}{C} \left( \frac{r}{R}\right) ^Q. \end{aligned}$$
(1)

In fact, \(Q=\log _2 C_\mu \) and \(C=C_\mu ^2\) will do, see Lemma 3.3 in Björn–Björn [4], but there may exist a better, that is smaller, exponent Q. Moreover, we note that (1) implies that \(\mu \) is doubling, i.e. \(\mu \) is doubling if and only if there is an exponent Q such that (1) holds.

Furthermore, in what follows we will often appeal, without mentioning it explicitly, to the following property of doubling measures. If \((X, d, \mu )\) is a doubling metric measure space and \(\Omega \subset X\) is bounded with \(\mu (\Omega )>0\) (e.g. \(\Omega \) is a domain), then for any \(x\in \Omega \) and \(0<r<{{\mathrm{diam}}}\Omega \) it holds that

$$\begin{aligned} \frac{\mu (B(x,r))}{\mu (\Omega )} \ge \frac{1}{C} \left( \frac{r}{{{\mathrm{diam}}}\Omega }\right) ^{\log _2 C_\mu }. \end{aligned}$$

We say that X is Ahlfors Q-regular if there is a constant C such that

$$\begin{aligned} \frac{1}{C} r^{Q} \le \mu (B(x,r)) \le C r^{Q} \end{aligned}$$

for all balls \(B(x,r) \subset X\) with \(r < 2 {{\mathrm{diam}}}X\). If we only require the left hand side of the inequality to hold, then we say that X is lower Q-Ahlfors regular.

One of the important properties of the metric spaces considered in the paper is the following relation between the metric and the measure.

Recall that \(A \Delta B\) stands for a symmetric difference of sets \(A, B\subset X\) and is defined as follows:

$$\begin{aligned} A \Delta B:= (A{\setminus } B) \cup (B{\setminus } A). \end{aligned}$$

Definition 2.1

(cf. Definition 2.2 in [13]) Let \((X, d, \mu )\) be a metric measure space. We say that a measure \(\mu \)is continuous with respect to metric d if for all \(x\in X\) and all \(r>0\) it holds that

$$\begin{aligned} \lim _{\Omega \ni y\underset{d}{\rightarrow }x} \mu (B(x,r) \Delta B(y,r))=0. \end{aligned}$$

The measure \(\mu \) is called metrically continuous.

According to our best knowledge the above notion appeared for the first time in the literature in Górka [15].

The following lemma collects some basic facts about continuity of a measure with respect to the metric (see [13] for the proofs). In the presentation below we will appeal to these properties a number of times and, therefore, for the sake of convenience we present them here.

Lemma 2.1

Let \((X, d, \mu )\) be a metric space with a Borel regular measure \(\mu \). Then the following hold:

  1. 1.

    If \(\mu \) is continuous with respect to the metric d, then the map \(x\rightarrow \mu (B(x,r))\) is continuous in d.

  2. 2.

    If for every \(x\in X\) and every \(r>0\) it holds that \(\mu (\partial B(x,r))=0\), then \(\mu \) is continuous with respect to the metric d.

  3. 3.

    If for every \(x\in X\) the function \(r\rightarrow \mu (B(x,r))\) is continuous, then \(\mu \) is continuous with respect to the metric d.

Proof

For the proof of Property 1, see Corollary 2.1 in [13]. Property 2 is proved in Lemma 2.1 in [13], while Property 3 is proved in Theorem 2.1 in [13]. \(\square \)

Following [13], we recall that a metric space (Xd) has the segment property if for any \(x, y \in X\) there exists a continuous curve \(\gamma :[0, 1]\rightarrow X\) joining x and y and such that for all \(t\in [0,1]\) we have that

$$\begin{aligned} d(x,y)= d(x,\gamma (t))+ d(\gamma (t),y). \end{aligned}$$

Recall further, that a metric space (Xd) is geodesic if any two points \(x, y\in X\) can be joint by a curve \(\gamma \) whose length equals distance d(xy). For a large class of metric spaces we can easily show their bi-Lipschitz equivalence to geodesic spaces. Namely, let X be a Loewner Ahlfors regular space (see Definition 3.1 in Heinonen–Koskela [25]). Then X is quasiconvex, see Theorem 8.23 in Heinonen [23]. If X is additionally proper, then one can introduce a new metric in X by taking the infimum of lengths of all rectifiable curves joining two points, see Remark 9.11 and Chapter 8 in [23], also [25] for further discussion on Loewner spaces. According to Theorem 2.2 in [13], if \((X, d, \mu )\) is a doubling measure space with the segment property, then \(\mu \) is continuous with respect to metric d. In a consequence we get the following result.

Proposition 2.1

Let \((X, d, \mu )\) be a geodesic doubling metric measure space. Then \(\mu \) is continuous with respect to metric d.

Proof

By Theorem 2.2 in [13] it is enough to show that a geodesic space has the segment property. Indeed, let \(x,y \in X\) and let \(\gamma _{xy}\) be a curve such that \(d(x,y)=l(\gamma _{xy})\). Choose \(t\in [0,1]\) and denote \(z=\gamma (t)\). Then \(l(\gamma _{xy})=l(\gamma _{xz})+l(\gamma _{zy})\). Moreover, \(l(\gamma _{xz})=d(x,z)\) and \(l(\gamma _{zy})=d(z,y)\). Otherwise, suppose that \(l(\gamma _{xz})>d(x,z)\). Then, \(d(x,z)+d(z,y)<l(\gamma _{xz})+l(\gamma _{zy})=d(x,y)\), contradicting the triangle inequality. Therefore, we have that

$$\begin{aligned} d(x,z)+d(z,y)=l(\gamma _{xz})+l(\gamma _{zy})=l(\gamma _{xy})=d(x,y)\le d(x,z)+d(z,y). \end{aligned}$$

Hence, X has a segment property and the proof of the proposition is completed. \(\square \)

In the paper we investigate other types of measures, for instance uniform measures (Definition 5.1) and measures satisfying \(\delta \)-annular decay condition for some \(\delta \in (0,1]\) (Definition 4.1). As mentioned in the Introduction, it turns out that measures continuous with respect to a metric seem to be most general among the aforementioned measures. We present the following list of relations between measures studied below.

Denote by \((X, d, \mu )\) a metric measure space and the following properties:

  1. (1)

    X is geodesic and \(\mu \) is doubling,

  2. (1’)

    X is a length space and \(\mu \) is doubling,

  3. (2)

    X has the \(\delta \)-annular decay property for some \(\delta \in (0,1]\),

  4. (2’)

    X has the 1-annular decay property,

  5. (3)

    \(\mu \) is a uniform measure,

  6. (4)

    \(\mu \) is continuous with respect to d.

Then, the following inclusions hold:

We close the preliminary part of our presentation with recalling some basic definitions and facts about the first order Calculus on metric spaces. The presented results will be employed in Sect. 5 in the studies of differentiability properties of harmonic functions in metric spaces. For foundations of the analysis on metric spaces we refer e.g. to a book and a survey article by Heinonen [23, 24], see also Heinonen–Koskela [25] and Hajłasz–Koskela [16].

We say that a property holds for p-a.e. rectifiable curve, if it fails only for a curve family \(\Gamma \) with zero p-modulus, see e.g. Väisälä [51] and Section 2 in [25] for definitions and properties of the modulus of curve families in Euclidean and metric settings, respectively.

Definition 2.2

Let \((X, d, \mu )\) be a metric measure space and \(f:X\rightarrow [-\infty ,\infty ]\). We say that a nonnegative Borel function \(g_f\) on X is an upper gradient of f for all nonconstant rectifiable curves \(\gamma :[0,l(\gamma )]\rightarrow X\), parameterized by arc length ds, we have

$$\begin{aligned} |f(\gamma (0))-f(\gamma (l(\gamma )))|\le \int _\gamma g_f\, ds \end{aligned}$$
(2)

whenever both \(f(\gamma (0))\) and \(f(\gamma (l(\gamma )))\) are finite, and \(\int _\gamma g_f\, ds=\infty \) otherwise.

If \(g_f\) is a nonnegative measurable function on X and if (2) holds for p-a.e. nonconstant rectifiable curve, then \(g_f\) is called a p-weak upper gradient of f.

Upper gradients were introduced in [25], whereas p-weak upper gradients were first defined in Koskela–MacManus [30]. A relation between those two notions follows from a result in [30], where it is also shown that a p-weak upper gradient of f can be approximated by a sequence of upper gradients of f in \(L^p(X)\). Moreover, if f has an upper gradient in \(L^p(X)\), then it has a minimal p-weak upper gradient in \(L^p(X)\), see Corollary 3.7 in Shanmugalingam [47].

Let \(p\ge 1\). We say that X supports a (1, p)-Poincaré inequality if there exist constants \(C_{PI}>0\) and \(\lambda \ge 1\) such that for all balls \(B \subset X\) and all integrable functions f on X and all upper gradients \(g_f\) of f,

where

3 Harmonic functions

In this section we introduce and present some elementary properties of the two fundamental notions of our work, namely weakly harmonic and (strongly) harmonic functions for subsets of metric measure spaces, both based on the mean value property.

Our first definition corresponds to the most classical mean value property required to hold at every point of the underlying domain. Functions with such property will be called strongly harmonic. However, in what follows we will often drop term strongly and write, harmonic functions.

Definition 3.1

Let \(\Omega \subset X\) be an open set. A locally integrable function \(f:\Omega \rightarrow {\mathbb {R}}\) is called (strongly) harmonic in \(\Omega \) if the following inequality holds for all balls \(B(x,r)\Subset \Omega \) with \(x\in \Omega \) and \(r>0\):

$$\begin{aligned} f(x)=\frac{1}{\mu (B(x,r))}\int _{B(x,r)} f(z) d\mu (z). \end{aligned}$$

The set of all harmonic functions in \(\Omega \) will be denoted \(\mathcal {H}(\Omega , \mu )\) and \(\mathcal {H}(\Omega )\) in case the measure is fixed.

The studies of relations between the harmonicity and the mean value property in the Euclidean setting have long history. It was Gauss who, perhaps first, observed that harmonic functions posses the mean value property. The opposite question, whether one need to require mean value property to hold for all radii of balls centered at the given point has also been investigated by several mathematicians, to mention results due to Koebe, Volterra and Kellogg, Hansen and Nadirashvili, and Blaschke, Privaloff and Zaremba. We refer to Section 2 in Llorente [35] for an interesting historical account on the mean value property and harmonicity; also to Heath [20] for further studies on to what extent the restricted mean value property is sufficient for harmonicity in the Euclidean setting. In order to motivate Definition 3.2 below more thoroughly, let us just mention that Koebe, for instance, showed that in order for a continuous function in a domain \(\Omega \subset {\mathbb {R}}^n\) to be harmonic it is enough to satisfy the mean value property at every \(x\in \Omega \) with respect to some family of radii \(r^x\) with \(\inf r^x=0\). If we strengthen the assumption on function and require it to be continuous on the closure of a domain, then Volterra and Kellogg proved that one radius at every point is enough for the mean value property to imply the harmonicity. Hansen and Nadirashvili [17, 18] improved the previous results by substituting continuity of a function up to the boundary by its boundedness. Blaschke, Privaloff and Zaremba independently observed that an asymptotic mean value property is enough to imply the harmonicity. Their results facilitated the discovery of p-harmonious functions, see Manfredi–Parviainen–Rossi [37] for the definitions and relations between p-harmonious functions and stochastic tug-of-war games.

In order to provide examples of studies beyond the Euclidean framework, let us mention that the mean value property appears in the setting of differential geometry, e.g. in the studies of the so-called harmonic manifolds and related notions of horospheres and the Lichnerowicz Conjecture. Recall, that a complete Riemannian manifold M is called harmonic if harmonic functions on M satisfy the mean value property, see Willmore [53], Ranjan-Shah [44], also Todjihounde [50] for further definitions and references. Furthermore, see e.g. Picardello-Woess [42] and Zucca [56] for the studies of mean value property in the context of harmonic functions on trees.

Motivated by the above considerations and the literature, we introduce the following more general variant of harmonic functions on metric measure spaces.

Definition 3.2

Let \(\Omega \subset X\) be an open set. A locally integrable function \(f:\Omega \rightarrow {\mathbb {R}}\) is called weakly harmonic in \(\Omega \) if for every \(x\in \Omega \) there exists a non-empty set of positive radii \(r^x_\alpha \) for \(\alpha \in I\) such that the following inequality holds for all balls \(B(x, r^x_\alpha )\Subset \Omega \):

$$\begin{aligned} f(x)=\frac{1}{\mu (B(x, r^x_\alpha ))}\int _{B(x,r^x_\alpha )} f(z) d\mu (z). \end{aligned}$$

The set of all weakly harmonic functions in \(\Omega \) will be denoted \(w\mathcal {H}(\Omega , \mu )\) and \(w\mathcal {H}(\Omega )\) in case the measure is fixed.

A priori we allow set of indexes I to be any non-empty set, e.g. I can be uncountable. However, in what follows we will study weakly harmonic functions under minimal assumptions, namely that at every point there is at least one admissible radii and that I is at most countable.

We denote by

$$\begin{aligned} r^x_M:=\sup _{i\in \{1,2,\ldots \}} r^x_i \end{aligned}$$

and related \(r^{\Omega }_M:=\sup _{x\in \Omega } r^x_M\). However, in the presentation below we shall write \(r^{\Omega }_M:=r_M\), if \(\Omega \) is fixed or clear from the context. We further remark, that if \(\Omega \) is a bounded domain, then \(r_M\le {{\mathrm{diam}}}\Omega \).

In what follows also the minimal radius at the point will play a role. Namely, for any \(x\in \Omega \) we denote by

$$\begin{aligned} r^x_m:=\inf _{i\in \{1,2,\ldots \}} r^x_i \ge 0, \qquad r^{\Omega }_m:=\inf _{x\in \Omega } r^x_m. \end{aligned}$$

We will often require \(r^x_m>0\) or \(r_m>0\).

Similarly we define super- and subharmonic functions.

Definition 3.3

Let \(\Omega \subset X\) be an open set. A locally integrable function \(f:\Omega \rightarrow {\mathbb {R}}\) is called a subharmonic(superharmonic) in \(\Omega \) if the following inequality holds for all balls \(B(x,r)\Subset \Omega \) with \(x\in \Omega \) and \(r>0\):

$$\begin{aligned} f(x)\le (\ge )\frac{1}{\mu (B(x,r))}\int _{B(x,r)} f(z) d\mu (z) \end{aligned}$$

We denote \(\mathcal {S_{-}H}(\Omega , \mu )\) the set of all subharmonic functions in \(\Omega \) with respect to the measure \(\mu \) while the set of all superharmonic functions in \(\Omega \) will be denoted \(\mathcal {S^{+}H}(\Omega , \mu )\). For the sake of simplicity when the measure is fixed, we will often write \(\mathcal {S_{-}H}(\Omega )\) (\(\mathcal {S^{+}H}(\Omega )\)).

Similarly, we define weakly sub- and superharmonic functions, cf. Definition 3.2 and denote them by \(w\mathcal {S_{-}H}(\Omega , \mu )\) and \(w\mathcal {S^{+}H}(\Omega , \mu )\), respectively (also \(w\mathcal {S_{-}H}(\Omega )\) and \(w\mathcal {S^{+}H}(\Omega )\), respectively).

We present now further properties of harmonic functions.

Proposition 3.1

The following properties hold:

  1. 1.

    Let \(f\in \mathcal {H}(\Omega )\). If \(m\in {\mathbb {R}}\), then \(f-m\in \mathcal {H}(\Omega )\) and \((f-m)_+\in \mathcal {S^{+}H}(\Omega )\).

  2. 2.

    Let \(f\in \mathcal {S^{+}H}(\Omega )\). Let \(F: f(\Omega )\rightarrow {\mathbb {R}}\) be concave and increasing. Then \(F\circ f\) is superharmonic. Furthermore, if \(f\in \mathcal {H}(\Omega )\), then \(F\circ f\) is superharmonic for F merely concave.

  3. 3.

    Let \(f\in \mathcal {S_{-}H}(\Omega )\). Let \(F: f(\Omega )\rightarrow {\mathbb {R}}\) be convex and increasing. Then \(F\circ f\) is subharmonic. Furthermore, if \(f\in \mathcal {H}(\Omega )\), then \(F\circ f\) is subharmonic for F merely convex.

The analogous properties hold for weakly harmonic (sub-, and superharmonic) functions.

Proof

Denote \(B:=B(x,r)\Subset \Omega \) a ball centered at \(x\in \Omega \) with \(r>0\). In order to show Property 1 we note that

$$\begin{aligned} f(x)-m=\frac{1}{\mu (B)} \int _{B}f(z) d\mu - m \frac{1}{\mu (B)} \int _{B}1 d\mu =\frac{1}{\mu (B)} \int _{B}(f(z)-m) d\mu . \end{aligned}$$

Similarly, we show that

$$\begin{aligned}&\frac{1}{\mu (B)} \int _{B} (f(z)-m)_{+} d\mu =\frac{1}{\mu (B)} \int _{B\cap \{f>m\}}(f(z)-m) d\mu \\&\quad + \int _{B\cap \{f \le m\}} 0 d\mu \le (f(x)-m)_{+}. \end{aligned}$$

The Young inequality gives us Property 2.

$$\begin{aligned} F(f(x))\ge F\left( \frac{1}{\mu (B)} \int _{B}f(z) d\mu \right) \ge \frac{1}{\mu (B)} \int _{B}F(f(z)) d\mu . \end{aligned}$$
(3)

If \(f\in \mathcal {H}(\Omega )\), then the first inequality above becomes equality giving us the second part of Property 2.

The proof of Property 3 follows the same lines as the one for Property 2. In this case inequalities in (3) are reversed due to convexity of F.

For the proofs of Properties 1–3 for weakly sub/super/harmonic functions one proceeds as above restricting the discussion only to balls with admissible radii. \(\square \)

3.1 Examples of weakly and strongly harmonic functions, relations to p-subharmonic functions

We begin with an example showing that already in simple one-dimensional case of \({\mathbb {R}}\) with the weighted Lebesgue measure, weakly and strongly harmonic functions may differ.

Example 1

Let \((\mathbb {R}, |\cdot |, |x|dx)\) be a metric measure space equipped with the Euclidean distance and a measure \(\mu \) such that \(d\mu :=d\mu (x)=|x|dx\). Define a function \(f:{\mathbb {R}}\rightarrow {\mathbb {R}}\) as follows

$$\begin{aligned} f(x)= {\left\{ \begin{array}{ll} \frac{1}{x} \chi _{\mathbb {R}{\setminus } \{0\}},\quad &{}x\not =0,\\ 0,\quad &{}x=0. \end{array}\right. } \end{aligned}$$

Then f is weakly harmonic but not harmonic. Indeed, f is locally integrable and by letting \(y \ne 0\) and \(r<|y|\), we find that

Moreover, for any \(r>0\) we have

On the other hand, if we take \(y>0\) and \(r>y\), then

$$\begin{aligned} \mu (B(y,r))=\int _{y-r}^{y+r}|x|dx=r^2+y^2, \end{aligned}$$

and thus

Similar situation occurs in \({\mathbb {R}}^n\) for \(n>1\), as illustrated by the following example.

Example 2

Let \(X={\mathbb {R}}^n\) be equipped with the Euclidean distance and the Lebesgue measure. One considers a sequence of annuli \(B(0, k + 1) {\setminus } B(0, k)\) for \(k=0, 1,\ldots \) and related functions: \(u_k(x) = a_k\phi _n(x) + b_k\), where \(\phi _n\) stands for the fundamental harmonic solution in \({\mathbb {R}}^n\) and coefficients \(a_k, b_k\) are choosen properly, so that the resulting function \(u:{\mathbb {R}}^n{\setminus }\{0\}\rightarrow {\mathbb {R}}\), \(u\equiv u_k\) for \(k=0, 1, \ldots \) is continuous in \({\mathbb {R}}^n{\setminus }\{0\}\). Moreover, u turns out to be weakly-, but not strongly harmonic. Similar construction can be obtained in the unit disc in \({\mathbb {R}}^n\). (See the discussion following Example 2.1.3 in Llorente [35] and the references therein for the details of the aforementioned constructions.)

It turns out that already the Euclidean setting with the weighted Lebesgue measure leads to interesting results in the context of the mean-value property.

Example 3

Theorem 5 in Bose [7] asserts that for a \(C^2\)-regular weight w being a harmonic eigeinvalue, a \(C^2\) function u is strongly harmonic in a domain \(\Omega \subset {\mathbb {R}}^n\), for \(n\ge 2\) with respect to the weighted Lebesgue measure wdx if and only if u satisfies the following equation in \(\Omega \):

$$\begin{aligned} w\Delta u +2 \langle \nabla u, \nabla w \rangle =0. \end{aligned}$$

For further studies of the weighted mean-value we refer to e.g. Hansen–Netuka [19], Aikawa [2] and Kijowski [28].

The next two examples relate the mean-value harmonic functions to the studies in the context of manifolds (cf. the discussion above).

Example 4

The notion of the harmonic manifold grows from the studies of counterparts of the fundamental solution of the Laplace equation on manifold (H.S. Ruse, 1930). The Lichnerowicz conjecture, confirmed for dimensions 2-5, characterizes harmonic manifolds as either flat or rank-one symmetric, see [32], see also Nikolayevsky [41]. Recently, characterization of homogeneous harmonic manifolds has been obtained by Heber [21]. From our point of view the following result due to Willmore is interesting, see Theorem 3 in [53]:

A Riemannian manifold M is harmonic if and only if every solution to the Beltrami–Laplace operator has the mean-value property over any geodesic sphere.

Example 5

Let M be a complete Riemmanian manifold with the sectional curvature \(K_M\le k\) in geodesic ball B(xR) in M. Suppose further that R is less than the injectivity radius of M. Then, Theorem in Chapter II.6 (pg. 75) in Schoen–Yau [45], asserts that any smooth nonnegative function u on M with \(\Delta u\ge 0\) has the sub mean-value property on B(xR). Therefore, if M has the sectional curvature \(K_M\) bounded uniformly from above by k, then u is weakly sub-harmonic in M with admissible radii less the injectivity radius of M. More general, u is weakly sub-harmonic in those subdomains of M, where \(K_M\) is bounded from above.

Analogous observation for super weakly-harmonic functions holds if, instead of the bound on the sectional curvature, the lower bound is imposed on the Ricci curvature, see Theorem 10 in [40].

In the following example we discuss the mean-value harmonic functions in the context of Carnot–Carathéodory groups (CC groups, for short).

Example 6

In [1] we studied relations between the mean-value harmonicity in the setting of CC groups and, in particular, in Heisenberg groups. Theorem 4.2 in [1] shows that strongly harmonic functions in such groups are smooth. Moreover, functions in \(\mathcal {H}\) are also subelliptic harmonic, i.e. satisfy the \(\mathcal {L}\)-harmonic equation, see Theorem 4.3 in [1]. Hence, functions in \(\mathcal {H}\) are 2-harmonic in the sense of minimization of the 2-Dirichlet energy of the horizontal gradient. In fact, we provide examples showing that the opposite inclusion does not hold in general. Moreover, we identify a large class of subelliptic harmonic functions that are strongly harmonic. Namely, a subclass of the so-called spherical harmonic polynomials, see Observation 5.1 and Example 6 in [1].

An important setting, in which weakly and strongly harmonic function appear, is the one of the discrete metric spaces, such as graphs.

Example 7

Let T denote the homogeneous infinite tree of degree n such that each vertex has exactly the same number of neighbours \(n+1\). Then, it is fairly easy to see that a function satisfying the discrete Laplace equation defined as follows is also strongly harmonic (cf. Lemma 1 in [42]):

$$\begin{aligned} \Delta u(x):=u(x)-\frac{1}{n+1}\sum _{y\sim x}u(y), \end{aligned}$$

where the sum is taken with respect to all verticies adjacent to vertex x. In fact, the stronger result holds. Namely, suppose that \(u>0\) is weakly harmonic with exactly one admissible radius \(r^x\) at each vertex x of T. Then u is harmonic in the sense of the discrete laplasian provided that admissible radii satisfy the certain Lipschitz-type growth (see Theorem in [42]). Moreover this condition is also necessary.

Another definition of harmonic functions in the Euclidean setting comes from the minimization of the 2-Dirichlet energy and the fact that the related Euler-Lagrange equation is the Laplace equation. Such a variational approach allows to define the corresponding harmonic, or more general p-harmonic, functions also in the setting of metric measure spaces. The properties of p-harmonic functions and their potential theory have been intensively studied in last two decades by several authors, e.g. by Aikawa–Shanmugalingam [3], Björn–Björn [4], Björn–Björn–Shanmugalingam [5], Shanmugalingam [47, 48], Kinnunen–Shanmugalingam [29]. Let us point out some differences between such functions and harmonic functions studied here. First, recall that most of results for p-harmonic functions are obtained under assumptions that the underlying space is a complete doubling metric measure space supporting (1, p)-Poincaré inequality, whereas in our setting we allow various kinds of measures, see for instance Proposition 2.1 and the discussion following it. Moreover, we do not necessarily assume a Poincaré inequality to hold. The most important difference between the p-harmonic functions and harmonic functions as in Definition 3.1 is that p-harmonic functions barely ever satisfy the mean value property (see e.g. Zalcman [55] for more discussion on the mean value property for various differential operators). This property may fail even if \(p=2\) and \(X={\mathbb {R}}^n\), but the measure \(\mu \) is not the Lebesgue measure. Nevertheless, relations between the mean value property and p-harmonicity play important role in stochastic games, see e.g. [37].

Some counterparts of the sub mean-value property for \(L^p\)-norms are known to hold in the manifold setting, see e.g. Li–Schoen [33, Theorem 2.1] and in the metric setting, see [3, Formula (9)]. Below, we employ some potential theoretic results to relate p-subminimizers to weakly harmonic functions.

Example 8

Let \((X, d, \mu )\) be an unbounded doubling metric measure space satisfying the (1, p)-Poincaré inequality and let \(u\ge 0\) be a bounded continuous p-subminimizer in X in the sense of Definition 7.7 in [4]. We will now investigate when u is weakly subharmonic in \(X{\setminus }\{x\in X: u(x)=\sup _{X}u\}\).

We remark that already in \({\mathbb {R}}^n\) for \(n\ge 3\) equipped with the Lebesgue measure and the Euclidean distance, the Liouville theorem for subharmonic function may fail, see e.g. a counterexample in Remark (iv), pg. 132 in Protter–Weinberger [52]. Therefore, u need not be constant.

Set \(w:=\sup _X u-u\). Since u is bounded in X, it holds that \(\inf _X w=0\) and, thus, for all \(\epsilon >0, x_{\epsilon }\in X\) and a radius \(R_{\epsilon }>0\) such that \(\inf _{B(x_{\epsilon }, R_{\epsilon })}w<\epsilon \). Observe that \(w\ge 0\) is bounded p-superminimizer in X. Therefore, by the weak Harnack inequality, see Theorem 8.10 in [4], we may find \(q, C>0\) such that for all \(R\ge R_{\epsilon }\)

where q and C depend only on p, doubling constant and the constants in the (1, p)-Poincaré inequality. Indeed, the estimate follows from [4] in case \(B(x_{\epsilon }, R_{\epsilon })\subset B(y,R)\). Otherwise, one needs to increase R so that the corresponding inclusion holds. Then, by applying the Young inequality, we obtain

(4)

We claim that at every \(y\in \Omega :=X{\setminus }\{x\in X: u(x)=\sup _{X}u\}\) there exists \(R^y>0\) such that

(5)

and so u is weakly subharmonic in \(\Omega \). Suppose that (5) fails at a given \(y\in \Omega \). Then, for all R the opposite inequality holds at y contradicting (4), unless \(u(y)=\sup _{X} u\) which is ruled out by the definition of set \(\Omega \). Notice, that in order to ensure that a ball of radius \(R^y\), where (5) holds, is contained in \(\Omega \) we need, for instance, to assume that \(\sup _X u\) is not attained by u in X.

Similarly it holds that \(u\in w\mathcal {H}(\Omega ')\), for any \(\Omega '\subset \Omega \) where (5) can be verified for all \(y\in \Omega '\), see Corollary 7.11 and Proposition 7.16 in [4].

4 Harnack estimates, maximum principles, Hölder and Lipschitz continuity

In this section we show several geometric properties of strongly and weakly harmonic functions such as the Harnack inequalities on balls and compact sets, strong and weak maximum principles and comparison principles. One of the main results of this section is the Hölder continuity of harmonic functions as in Definition 3.1 for geodesic metric spaces with doubling measures, Theorem 4.1. Moreover, for spaces satisfying the \(\delta \)-annular decay condition, see Definition 4.1, we have more accurate estimates, cf. Theorem 4.2. We also discuss relations between measures continuous with respect to the distance and measures in Definition 4.1, see Remark 2 and Example 9.

First, we need to refine some results from Gaczkowski-Górka [13].

Proposition 4.1

(Continuity of harmonic functions) Let \((X,d, \mu )\) be a metric measure space with measure \(\mu \) continuous with respect to metric d. If \(f\in \mathcal {H}(\Omega , \mu )\), then f is continuous in \(\Omega \).

The same assertion holds for \(f\in w\mathcal {H}(\Omega , \mu )\) at points \(x\in \Omega \) with the following property: there exists a neighborhood U of x such that

$$\begin{aligned} \left\{ r^x_1, r^x_2,\ldots \right\} \cap \bigcap _{y \in U}\left\{ r^y_1, r^y_2,\ldots \right\} \not =\emptyset . \end{aligned}$$
(6)

In other words in Proposition 4.1 we require that all points y in every neighborhood U of a point x have at least one common radius with the set of admissible radii at x for a weakly harmonic function f. Then, f is continuous at all points \(x\in \Omega \) where such property holds.

We note that here we do not assume that \(\mu \) is doubling.

Proof

Suppose that \(x,y\in \Omega \) and fix \(r>0\). Then, we have

$$\begin{aligned} |f(x)-f(y)|&=\left| \frac{1}{\mu (B(x,r))}\int _{B(x,r)} f(z) d\mu (z)-\frac{1}{\mu (B(y, r))}\int _{B(y,r)} f(z) d\mu (z)\right| \nonumber \\&=\Bigg |\frac{1}{\mu (B(x,r))}\int _{B(x,r)} f(z) d\mu (z)-\frac{1}{\mu (B(x,r))}\int _{B(y,r)} f(z) d\mu (z) \nonumber \\&\quad -\frac{\mu (B(x,r))-\mu (B(y, r))}{\mu (B(x,r))\mu (B(y, r))}\int _{B(y,r)} f(z) d\mu (z)\Bigg |\nonumber \\&\le \frac{1}{\mu (B(x,r))} \int _{B(x,r) \vartriangle B(y,r)} |f(z)| d\mu (z) \nonumber \\&\quad + \frac{|\mu (B(x,r))-\mu (B(y, r))|}{\mu (B(x,r))\mu (B(y, r))}\Vert f\Vert _{L^1(B(y,r))}. \end{aligned}$$
(7)

Recall that, by definition, function \(f\in \mathcal {H}(\Omega , \mu )\) belongs to \(L^1_{loc}(\Omega )\). Let now \(y\rightarrow x\) in metric d. Then, by the continuity of \(\mu \) with respect to d we have that \(\mu (B(x,r) \vartriangle B(y,r))\rightarrow 0\). This assumption together with the absolute continuity of the Lebesgue integral with respect to the measure imply that \(f(y)\rightarrow f(x)\).

Let now \(f\in w\mathcal {H}(\Omega )\) and \(x \in \Omega \) satisfy the assumptions of proposition. Thus, for any sequence \(\{y_k\}_{k=1}^{\infty }\) converging to x for \(k\rightarrow \infty \) in metric d we have that for some \(i\in {\mathbb {N}}\) and all \(j, k\in {\mathbb {N}}\) it holds that \(r^x_i=r^{y_k}_j\). Denote such a radius by r. This gives us a radius common for points x and all \(y_k\) for which the mean value property for f holds. Then, estimate (7) holds for r and, as previously,

$$\begin{aligned} \lim _{y_k\underset{d}{\rightarrow }x} \mu (B(x,r) \vartriangle B(y_k,r))=0 \end{aligned}$$

completing the proof of the proposition. \(\square \)

The following observation is an immediate consequence of Proposition 4.1.

Corollary 4.1

Let \((X,d, \mu )\) be a metric measure space with measure \(\mu \) continuous with respect to metric d. If \(f\in \mathcal {H}(\Omega , \mu )\), then f is locally bounded in \(\Omega \). Furthermore, \(f\in w\mathcal {H}(\Omega , \mu )\) is locally bounded on sets \(E\subset \Omega \) such that every \(x\in E\) satisfies assumption (6) of Proposition 4.1.

Next, we show that the fundamental Harnack estimate holds for both weakly and strongly harmonic functions.

Lemma 4.1

(The Harnack inequality on balls, cf. Lemma 3.2 in [13]) Let X be a metric measure space with doubling measure \(\mu \) and let \(f\in \mathcal {H}(\Omega , \mu )\) be a nonnegative function on an open set \(\Omega \subset X\). Suppose that a ball \(B:=B(x,r)\subset \Omega \) is such that \(B(x, 6r)\Subset \Omega \). Then the following inequality holds

$$\begin{aligned} \sup _{B} f \le C_H\inf _{B} f, \end{aligned}$$
(8)

where \(C_H=C_{\mu }^3\) and \(C_{\mu }\) stands for a doubling constant of \(\mu \).

Moreover, let \(f\in w\mathcal {H}(\Omega , \mu )\) be a nonnegative function on a domain \(\Omega \subset X\). Suppose that a ball \(B:=B(x,r)\subset B(x, 2r^B_M)\Subset \Omega \) is such that

$$\begin{aligned} 0<r^{B}_m\le \sup _{y \in B} r^y_m< r<3r < \inf _{y\in B} r^y_M \le r^{B}_M. \end{aligned}$$

Then, the Harnack inequality (8) holds with constant

$$\begin{aligned} C_H=C_{\mu }^{\log _{2} \frac{5r^{B}_M}{3r^{B}_m}+1}. \end{aligned}$$

Proof

We follow the steps of reasoning in [13] and note that by assumptions on a strongly harmonic function f the following inequality holds for any \(y,z \in B\)

$$\begin{aligned} \int _{B(y, 3r)} f d\mu \ge \int _{B(z, r)} f d\mu . \end{aligned}$$

Hence, the harmonicity of f and the doubling property of \(\mu \) together with the fact that \(B(y, 3r)\subset B(z, 5r)\) imply

$$\begin{aligned} f(z)\le \frac{\mu (B(y, 3r))}{\mu (B(z, r))}f(y) \le \frac{\mu (B(z, 5r))}{\mu (B(z, r))} f(y) \le C_{\mu }^3 f(y). \end{aligned}$$
(9)

Similarly, if f is weakly harmonic, then the above approach gives us for \(y,z \in B\) that

$$\begin{aligned} \int _{B(y, 3r)} f d\mu \ge \int _{B(z, r)} f d\mu \ge \int _{B(z, r^z_{i_0})} f d\mu =f(z)\mu (B(z, r^z_{i_0})). \end{aligned}$$

In the last estimate we have also used the assumption that \(\sup _{y \in B} r^y_m < r\), and hence there exists an admissible radius at z such that \(r^z_{i_0}<r\). Moreover, it holds that

$$\begin{aligned} \int _{B(y, 3r)} f d\mu \le \int _{B(y, r^y_M)} f d\mu =f(y)\mu (B(y, r^y_M)), \end{aligned}$$

since by assumptions \(3r < \inf _{y\in B} r^y_M\). By the analogy to the case of \(f\in \mathcal {H}(\Omega )\), we obtain

$$\begin{aligned} f(z)\le & {} \frac{\mu (B(y, r^y_M))}{\mu (B(z, r^z_{i_0}))}f(y) \le \frac{\mu (B(z, 5/3r^y_M))}{\mu (B(z, r^{B}_m))} f(y) \le \frac{\mu (B(z, 5/3 r^{B}_M))}{\mu (B(z, r^{B}_m))} f(y) \nonumber \\\le & {} C_{\mu }^{\log _{2} \frac{5r^{B}_M}{3r^{B}_m}+1} f(y), \end{aligned}$$
(10)

since \(3r<r^y_M\) and, hence, \(d(y,z)+r^y_M\le 5/3 r^y_M\). Here, we also appealed to the doubling property of \(\mu \).

Since both (9) and (10) hold for any \(y, z \in B\) they hold for supremum and infimum as well resulting in the assertion of the lemma. \(\square \)

In order to show the Harnack estimate on compact sets for weakly harmonic functions we will need the following variant of Lemma 4.1.

Lemma 4.2

Let X be a metric measure space with doubling measure \(\mu \) and let \(f\in w\mathcal {H}(\Omega , \mu )\) be a nonnegative function on a domain \(\Omega \subset X\). Suppose that a ball \(B:=B(x,r)\subset B(x, 2r^B_M)\Subset \Omega \) is such that

$$\begin{aligned} 0<r^{\Omega }_m\le r \le r^{\Omega }_M<\infty . \end{aligned}$$

and both \(r^{\Omega }_m\) and \(3r^{\Omega }_M\) are admissible radii for all \(y\in B\). Then, the Harnack estimate (8) holds with constant

$$\begin{aligned} C_H=C_{\mu }^{\log _{2} \frac{5r^{\Omega }_M}{3r^{\Omega }_m}+1}. \end{aligned}$$

Proof

We follow the steps of Lemma 4.1 and, upon notation of the lemma, we arrive at the following estimates

$$\begin{aligned} \int _{B(y, 3r)} f d\mu&\ge \int _{B(z, r)} f d\mu \ge \int _{B(z, r^{\Omega }_m)} f d\mu =f(z)\mu (B(z, r^{\Omega }_m)), \\ \int _{B(y, 3r)} f d\mu&\le \int _{B(y, 3r^{\Omega }_M)} f d\mu =f(y)\mu (B(y, 3r^{\Omega }_M)). \end{aligned}$$

By combining these inequalities we obtain an analog of (10):

$$\begin{aligned} f(z)\le \frac{\mu (B(y, r^{\Omega }_M))}{\mu (B(z, r^{\Omega }_m))}f(y) \le C_{\mu }^{\log _{2} \frac{5r^{\Omega }_M}{3r^{\Omega }_m}+1} f(y), \end{aligned}$$

where the final constant arises from the doubling property of measure \(\mu \). From this the Harnack inequality follows immediately. \(\square \)

As an immediate consequence we obtain the Harnack estimate on compact sets.

Corollary 4.2

(The Harnack inequality on compact sets, cf. Theorem 3.4 in [13]) Let X be a geodesic metric measure space with doubling measure \(\mu \), \(\Omega \subset X\) be an open connected set and let \(f\in \mathcal {H}(\Omega , \mu )\) be a nonnegative function. Then, for every compact connected \(K\Subset \Omega \) the following inequality holds

$$\begin{aligned} \sup _{K} f \le C \inf _{K} f, \end{aligned}$$
(11)

where \(C>0\) is a constant whose value is independent of f, but depends among other parameters on \(C_{\mu }\), a doubling constant of \(\mu \).

Moreover, for \(f\in w\mathcal {H}(\Omega , \mu )\) estimate (11) holds provided that \(0<r^{\Omega }_m\le r^x \le r^{\Omega }_M<\infty \) for all \(x\in K\) and \({{\mathrm{dist}}}(K,\partial \Omega )>2r^K_M\) and both \(r^{\Omega }_m\) and \(3r^{\Omega }_M\) are admissible radii for all \(y\in K\). In such a case the Harnack constant \(C=C(C_{\mu }, r^\Omega _m, r^\Omega _M)\).

Remark 1

(1) In [13] the Harnack inequality is proved for connected sets which are not necessarily path-connected. Furthermore, here we estimate Harnack constants in terms of the doubling constants and admissible radii.

(2) Note that open set \(\Omega \) need not be bounded. Therefore, we assume that \(r^\Omega _M<\infty \) in order to ensure that the Harnack constant C in (11) is finite.

Proof of Corollary 4.2

The proof follows the standard reasoning and, therefore, we will present only a sketch of it. For every \(x\in K\) we find a ball \(B(x, r_x)\) such that \(B(x, 6r_x)\Subset \Omega \). The collection of such balls gives us a open cover of K, and by compactness of K we may choose a finite subcover consisting of N balls. Next, take points \(x, y\in K\) and connect them by a curve \(\gamma \). Indeed, since the space X is geodesic and \(\Omega \) , Lemma 4.38 in Björn–Björn [4] implies that any two points in K can be joint by a rectifiable curve. From the collection of previously chosen N balls we choose such that \(x\in B_1\) and \(y\in B_M\) and \(B_i\cap B_{i+1}\not =\emptyset \) for all \(i=1,\ldots , M\). Upon choosing points \(x_i\in B_i\cap B_{i+1}\) for \(i=1,\ldots , M\le N\) and applying Lemma 4.1 we have

$$\begin{aligned} f(x)\le C_{\mu }^2 f(x_1)\le \cdots \le C_{\mu }^{2(n-1)} f(x_{n-1}) \le C_{\mu }^{2N} f(y). \end{aligned}$$

This, together with continuity of f, Proposition 4.1 imply the assertion of the corollary with \(C:=C_{\mu }^{2N}\).

The reasoning for weakly harmonic functions is similar. We cover set K with open balls \(\mathcal {C}:=\{B(x, r^x)\}_{x\in K}\) such that we can apply a variant of the Harnack estimate on every \(B_x\) as in Lemma 4.2. Namely, we assume that \(r^x:=r^{\Omega }_m\) for all \(x\in K\). Moreover, we need to ensure at every \(x\in K\) that a ball \(B:=B(x, r^x)\) satisfies \(B(x,r^x)\subset B(x, 2r^B_M)\Subset \Omega \). This, follows from the condition that \({{\mathrm{dist}}}(K,\partial \Omega )>2r^K_M\). Using compactness of K we choose from the cover \(\mathcal {C}\) a finite cover of K by balls \(\{B_i\}\) for \(i=1,\ldots , n\) as in the case of strongly harmonic functions.

The remaining part of the chaining argument stays the same as in the case of strongly harmonic functions. Observe, that for all \(i=1, 2,\ldots , n\) it holds that \(r^{B_i}_M\le r^{\Omega }_M\) and \(r^{B_i}_m\ge r^K_m\). In a consequence we arrive at the following chain of estimates, cf. Lemmas 4.1 and 4.2:

$$\begin{aligned}&f(x)\le C_{\mu }^{\log _{2} \frac{5r^{\Omega }_M}{3r^{\Omega }_m}+1} f(x_1)\le \cdots \le C_{\mu }^{\log _{2} \frac{5^{n-1}}{3^{n-1}}\left( \frac{r^{\Omega }_M}{r^{\Omega }_m}\cdot \,\cdots \,\cdot \frac{r^{\Omega }_M}{r^{\Omega }_m}\right) +n} \\&\quad f(x_{n-1}) \le C_{\mu }^{ \log _{2}\left( \frac{5r^\Omega _M}{3r^\Omega _m}\right) ^n+n} f(y). \end{aligned}$$

Hence, in this case we obtain a constant \(C:=C_{\mu }^{n\left( \log _{2} \frac{5r^\Omega _M}{3r^\Omega _m}+1\right) }\). \(\square \)

The Harnack inequality implies, in the usual way, the strong and weak maximum principles as well as the comparison principle. The strong maximum principle for strongly harmonic functions is proved in Gaczkowski-Górka [13, Theorem 3.1] without assumption that \(\Omega \) is open and \(\mu \) is doubling. However, their approach is different than below and for this reason as well as for the sake of completeness we present a new proof based on the Harnack inequality.

It is perhaps surprising, but the following four results are valid also for weakly harmonic functions. In fact, in order for Proposition 4.2 and Corollaries 4.3 and 4.4 to hold for \(f\in w\mathcal {H}(\Omega )\), it is enough that at every point of a domain \(\Omega \) there exists one radius \(r^x\) for which the mean value property is satisfied for f.

Proposition 4.2

(The strong maximum principle) Let \(\Omega \subset X\) be open connected and \(\mu \) be a doubling measure on X. Moreover, let \(f\in \mathcal {H}(\Omega , \mu )\) and continuous in \(\Omega \). If f attains its maximum in \(\Omega \), then f is constant. Furthermore, the assertion holds for \(f\in w\mathcal {H}(\Omega , \mu )\) provided that f is continuous (cf. (6) in Proposition 4.1).

Proof

Denote \(M:=\sup _{\Omega } f\) and let \(\Omega '=\{x\in \Omega : f(x)=M\}\). By Proposition 4.1 harmonic functions in \(\mathcal {H}(\Omega , \mu )\) are continuous, and hence, \(\Omega '\) is relatively closed in \(\Omega \). We will show that \(\Omega '\) is an open subset of \(\Omega \). Let \(B\subset \Omega \) be a ball such that \(B\cap \Omega '\not = \emptyset \) and \(6B\Subset \Omega \). Denote \(g:=M-f\ge 0\) in \(\Omega \). Proposition 3.1(1) implies that \(g\in \mathcal {H}(\Omega , \mu )\). By the Harnack principle, Proposition 4.1 and by continuity of f we have that

$$\begin{aligned} 0\le \sup _B g \le C_{\mu }^3 \inf _{B} (M-f)=C_{\mu }^3(M-f(x'))=0 \end{aligned}$$

for some \(x'\in B\cap \Omega '\). Thus, in fact \(B\subset \Omega '\) and \(\Omega '\) is open. The connectedness of \(\Omega \) implies that \(\Omega '\) is the only open and relatively closed subset of \(\Omega \) and, hence, \(\Omega =\Omega '\). In a consequence, \(f\equiv M\) and the proof is completed in the case of strongly harmonic functions.

If \(f\in w\mathcal {H}(\Omega , \mu )\), then the above approach may fail. Indeed, in the previous reasoning we need to know that for a set \(\Omega '\), there is a ball \(B\subset \Omega \) such that \(B\cap \Omega '\not = \emptyset \) and \(3B\Subset \Omega \). For porous sets ensuring existence of a point \(x\in \Omega \) and a radii \(r^x_i\) for some \(i=1,2,\ldots \) may require \(r^x_m=0\) which, in turn, is prevented by assumptions of the Harnack inequality, cf. Corollary 4.2. Instead, we follow the approach of Theorem 3.1 in [13].

Let \(\Omega '\) be as in the previous part of the proof. Continuity assumption on \(f\in w\mathcal {H}(\Omega )\) imply that \(\Omega '\) is a relatively closed subset of \(\Omega \).

Moreover, let us choose any \(x_0\in \Omega '\) with \(B(x_0, r^{x_0}_i)\Subset \Omega \) for some admissible radius \(r^{x_0}_i\). By the harmonicity of f we have that

$$\begin{aligned} \frac{1}{\mu (B(x_0, r^{x_0}_i)}\int _{B(x_0, r^{x_0}_i)}(M-f(y))d\mu (y)=0. \end{aligned}$$

Since for all \(x\in \Omega \) it holds that \(f(x)\le M\), we obtain that \(f\equiv M\) in \(B(x_0, r^{x_0}_i)\). In a consequence \(\Omega '\) is open and, as in the case of strongly harmonic functions, we get that \(f\equiv M\) in \(\Omega \). \(\square \)

Recall that a metric space X is locally connected if every neighborhood of a point \(x \in X\) contains a connected neighborhood. Then, the Mazurkiewicz–Moore–Menger theorem stays that X is locally pathconnected provided that it is proper metric space, see Theorem 1, pg. 254, in Kuratowski [31]. In particular, every component of an open set is open and pathconnected, see Theorem 2, pg. 253, in [31].

A connected space need not be locally connected (see e.g. the topologist’s sine curve). Therefore, we present two variants of the weak maximum principle, related to different connectivity assumptions on the metric space.

Proposition 4.3

(Weak maximum principle) Let \(\Omega \) be an open bounded set in a locally connected space X, such that \(X {\setminus } \overline{\Omega }\not =\emptyset \) and \(f\in \mathcal {H}(\Omega , \mu )\cap C(\overline{\Omega })\). Then \( \sup _{\overline{\Omega }} f = \sup _{\partial \Omega } f\).

Proof

Since \(\overline{\Omega }\) is compact and f is continuous in \(\overline{\Omega }\), there exists \(x_0 \in \overline{\Omega }\) such that \(\sup _{\overline{\Omega }} f =f(x_0)\). It is enough to consider only the case that \(x_0 \in \Omega \). Let us denote by \(\Omega (x_0)\) the connected component of \(\Omega \) containing \(x_0\). Since X is locally connected, \(\Omega (x_0)\) is open and \(\partial \Omega (x_0) \subset \partial \Omega \). Hence, by the strong maximum principle we get that \(f \equiv f(x_0)\) on \(\overline{\Omega (x_0)}\). \(\square \)

The weak maximum principle follows immediately from Proposition 4.2 (cf. Theorem 3.2 in [13] proved under stronger assumptions than the one below).

Corollary 4.3

(Weak maximum principle) Let \(\Omega \) be a domain in X and \(f\in \mathcal {H}(\Omega , \mu )\cap C(\overline{\Omega })\). Then \(\inf _{\partial \Omega } f\le \inf _{\overline{\Omega }} f\) and \(\sup _{\overline{\Omega }} f\le \sup _{\partial \Omega } f\). Furthermore, the assertion holds also for \(f\in w\mathcal {H}(\Omega , \mu )\) provided that \(f\in C(\overline{\Omega })\), cf. (6) in Proposition 4.1.

Proof

we will show only the second inequality, the first one follows the same steps. Suppose opposite, that \(\sup _{\overline{\Omega }} f> \sup _{\partial \Omega } f\). Then the maximum of f is attained in \(\Omega \), giving by Proposition 4.2, that \(f\equiv \sup _{\overline{\Omega }} f\) contradicting the continuity assumption of f.

The proof of the corollary in the case of \(f\in w\mathcal {H}(\Omega , \mu )\) follows the above lines, since under our assumptions f is continuous in \(\Omega \). \(\square \)

Next we show the comparison principle for harmonic functions on domains. The result follows from Proposition 4.2 (cf. Theorem 3.2 in [13] proved under stronger assumptions on the domain).

Corollary 4.4

(Comparison principle) Let \((X, d, \mu )\) be a metric measure space and \(\Omega \subsetneq X\) be a domain. Let, further, \(f, g \in \mathcal {H}(\Omega , \mu )\cap C(\overline{\Omega })\) be such that \(f\ge g\) on \(\partial \Omega \). Then \(f\ge g\) in \(\Omega \).

Furthermore, the assertion holds also for \(f, g\in w\mathcal {H}(\Omega , \mu )\cap C(\overline{\Omega })\) provided that at every \(x\in \Omega \) the sets of admissible radii of functions f and g have at least one common radius.

Proof

Since both f and g are harmonic in \(\Omega \), then so is also \(f-g\). Since \(f\ge g\) on \(\partial \Omega \), then \(\inf _{\partial \Omega } (f-g)\ge 0\). By the Corollary 4.3 we obtain that

$$\begin{aligned} 0\le \inf _{\partial \Omega } (f-g) \le \inf _{\overline{\Omega }} (f-g)=\inf _{\overline{\Omega }} f +\inf _{\overline{\Omega }} (-g). \end{aligned}$$

From this, we obtain that \(\sup _{\overline{\Omega }} g\le \inf _{\overline{\Omega }} f\) and the comparison principle follows.

The proof of the corollary in the case of \(f\in w\mathcal {H}(\Omega , \mu )\) follows the above lines. Indeed, f and g are continuous in \(\Omega \) by assumptions and \(f-g\) is weakly harmonic in \(\Omega \), as sets of admissible radii of functions f and g have a common radius at every \(x\in \Omega \). \(\square \)

We are in a position to state and prove the main result of this section, local Hölder continuity of harmonic functions. The proof of this result relies on the Harnack estimate on balls and holds for strongly harmonic functions. The iteration method used below requires that for every ball of radius r one is able to apply the Harnack estimate on a ball with radius r / t for some \(t>4\). This, however, need not be satisfied for weakly harmonic functions in a domain \(\Omega \) unless \(r^{\Omega }_m=0\), which leads constant C in Lemma 4.1 to be unbounded.

Theorem 4.1

Let X be a geodesic metric space with doubling measure \(\mu \) and let \(f\in \mathcal {H}(\Omega , \mu )\) for a domain \(\Omega \subset X\). Then, f is locally Hölder continuous with the Hölder exponent depending only on the doubling constant \(C_{\mu }\).

Moreover, weakly harmonic function \(f\in w\mathcal {H}(\Omega , \mu )\) is locally Hölder continuous in a compact set K provided that \(r^K_m>0\), \(r^\Omega _M<\infty \) and \({{\mathrm{dist}}}(K,\partial \Omega )>5r^K_M\). In such a case the Hölder exponent depends on \(C_{\mu }, r^K_m\) and \(r^\Omega _M\).

Proof

Let \(B:=B(x,r)\Subset \Omega \) be a ball and \(f\in \mathcal {H}(\Omega , \mu )\). Denote

$$\begin{aligned} m(r)=\inf _{B} f,\qquad M(r)=\sup _{B} f. \end{aligned}$$

Then \(g:=f-m(r)\ge 0\) a.e. in B and by Proposition 3.1(1) function g is harmonic in \(\Omega \). Set \(t>4\). Then by the Harnack inequality on balls (Lemma 4.1) we have that

$$\begin{aligned}&M\left( \frac{r}{t}\right) -m(r)=\sup _{B(x, \frac{r}{t})}(f-m(r))\le C_{\mu }^2 \inf _{B(x, \frac{r}{t})}(f-m(r)) \nonumber \\&\quad =C_{\mu }^2\left( m\left( \frac{r}{t}\right) -m(r)\right) . \end{aligned}$$
(12)

From this we get

$$\begin{aligned} m(r)(C_{\mu }^2-1)&\le C_{\mu }^2\left( m\left( \frac{r}{t}\right) -M\left( \frac{r}{t}\right) \right) + (C_{\mu }^2-1) M(r)\nonumber \\ M\left( \frac{r}{t}\right) -m\left( \frac{r}{t}\right)&\le \frac{C_{\mu }^2-1}{C_{\mu }^2}\,(M(r)-m(r)). \end{aligned}$$
(13)

Let \(y\in B(x,r)\) be such that \(\frac{r}{t^{n+1}}\le d(x,y)<\frac{r}{t^n}\) for some \(n=0,1\ldots \). (Such bounds always hold for some \(n\in {\mathbb {N}}\) depending on y.) We iterate inequality (13) and obtain the following estimate:

$$\begin{aligned} |f(x)-f(y)|&\le M\left( \frac{r}{t^n}\right) -m\left( \frac{r}{t^n}\right) \le \left( \frac{C_{\mu }^2-1}{C_{\mu }^2}\right) ^n(M(r)-m(r)) \nonumber \\&\le \frac{C_{\mu }^2}{C_{\mu }^2-1} (\sup _{B} f-\inf _{B} f) \left( \frac{d(x,y)}{r}\right) ^{\alpha }. \end{aligned}$$
(14)

Indeed, set

$$\begin{aligned} \alpha :=\frac{\ln \left( \frac{C_{\mu }^2}{C_{\mu }^2-1}\right) }{\ln t}>0. \end{aligned}$$
(15)

Then

$$\begin{aligned} \left( \frac{C_{\mu }^2-1}{C_{\mu }^2}\right) ^n=t^{-\alpha n} \quad \hbox { and }\quad t^{-\alpha n}\le t^{\alpha } \left( \frac{d(x,y)}{r}\right) ^{\alpha }=\frac{C_{\mu }^2}{C_{\mu }^2-1}\left( \frac{d(x,y)}{r}\right) ^{\alpha }. \end{aligned}$$

From this, estimate (14) follows immediately.

Let now \(B:=B(x_0, r)\) and let \(x,y \in B\) for B such that \(4B\Subset \Omega \). We distinguish two cases.

Case 1:\(d(x,y)<r\). Then, by repeating the above discussion we obtain

$$\begin{aligned} |f(x)-f(y)| \le \frac{C_{\mu }^2}{C_{\mu }^2-1} (\sup _{4B} f-\inf _{4B} f) \left( \frac{d(x,y)}{r}\right) ^{\alpha }. \end{aligned}$$

Case 2:\(r\le d(x,y)< 2r\). Then,

$$\begin{aligned} |f(x)-f(y)| \le \sup _{B} f-\inf _{B} f \le (\sup _{4B} f-\inf _{4B} f) \left( \frac{d(x,y)}{r}\right) ^{\alpha }. \end{aligned}$$

Therefore, f is locally Hölder continuous with exponent \(\alpha \) as in (15).

If \(f\in w\mathcal {H}(\Omega , \mu )\), then the above reasoning can be repeated using second parts of Lemma 4.1 and Corollary 4.2. \(\square \)

We close this section with yet another Hölder and Lipschitz regularity result for harmonic functions. First, we need the following definition, cf. Section 1 in Buckley [8].

Definition 4.1

Let \((X, d, \mu )\) be a metric measure space with a doubling measure \(\mu \). We say that X satisfies the \(\delta \)-annular decay property with some \(\delta \in (0,1]\) if there exists \(A\ge 1\) such that for all \(x\in X\), \(r>0\) and \(\epsilon \in (0,1)\) it holds that

$$\begin{aligned} \mu \left( B(x,r){\setminus } B(x,r(1-\epsilon ))\right) \le A \epsilon ^\delta \mu (B(x,r)). \end{aligned}$$
(16)

If \(\delta =1\), then we say that X satisfies the strong annular decay property.

Spaces with annular decay property appear, for instance, in the context of the Hardy–Littlewood and fractional maximal operators, see Buckley [8] and Heikkinen–Lehrbäck–Nuutinen–Tuominen [22] respectively, parabolic De Giorgi classes, see Masson–Siljander [39].

Among examples of spaces with strong annular decay property let us mention geodesic metric spaces with uniform measures, \({\mathbb {R}}^n\) with the Lebesgue measure and Heisenberg groups \(\mathbb {H}^n\) equipped with a left-invariant Haar measures. Moreover, Corollary 2.2 in [8] stays that if\((X, d, \mu )\)is a length metric measure space with a doubling measure\(\mu \), thenXhas the\(\delta \)-annular decay property for some\(\delta \in (0,1]\)with\(\delta \)depending only on a doubling constant of\(\mu \). In fact, Theorem 2.1 in [8] asserts that it is enough for (Xd) to be the so-called \((\alpha , \beta )\)-chain space in order to conclude that X has the \(\delta \)-annular decay property. In such a case \(\delta \) depends additionally on \(\alpha \) and \(\beta \). We refer to the discussion in Section 2 in [8] for relations between \((\alpha , \beta )\)-chain spaces and the Boman chain condition and \(\mathcal {C}(\lambda , M)\)-condition of Hajłasz–Koskela [16].

Remark 2

Let us comment on relation between measures satisfying Definition 4.1 and measures continuous with respect to distance. Let \(x,y\in X\) and suppose that \(d(x,y)<r\) for some \(r>0\). If \((X, d, \mu )\) has \(\delta \)-annular decay property for some \(\delta \in (0,1]\), then

$$\begin{aligned}&\mu (B(x,r) \bigtriangleup B(y,r)) \le \mu (B(x,r+d(x,y)){\setminus } B(x,r-d(x,y))) \\&\quad \le A \left( \frac{2d(x,y)}{r+d(x,y)}\right) ^\delta \mu (B(x,r+d(x,y)). \end{aligned}$$

By letting \(d(x,y)\rightarrow 0\) we obtain that \(\mu (B(x,r) \bigtriangleup B(y,r))\rightarrow 0\) and, hence, \(\mu \) is continuous with respect to d.

The following example shows that the opposite relation need not hold, i.e. a measure continuous with respect to a metric may fail \(\delta \)-annular decay property for any \(\delta \in (0,1]\).

Example 9

Let \(X={\mathbb {R}}\) with the Euclidean metric and a measure \(d\mu (x)=e^{-|x|}dx\). It is easy to check that \(\mu \) is continuous with respect to d. Namely, for any ball \(B(x,r)=(x-r, x+r)\) one need to consider three cases: (1) \(x+r\le 0\), (2) \(x-r\ge 0\) and (3) \(-r<x<r\), depending on the position of B(xr) with respect to 0. In all cases one gets that for any fixed x, the function \(r\mapsto \mu (B(x,r))\) is continuous and hence, by Part (3) of Lemma 2.1 our claim holds true.

We will show that for large enough \(x, y>0\) and large enough radii \(r<x\), \(r<y\) condition (16) fails. By computations we get for any \(\epsilon \in (0,1)\) that

$$\begin{aligned}&\mu (B(x,r))=\int _{x-r}^{x+r}e^{-y}dy=e^{-x}(e^r-e^{-r}),\\&\quad \mu (B(x,r) \bigtriangleup B(y,r))=\int _{x-r}^{x+r}e^{-y}dy \\&\quad -\int _{x-r(1-\epsilon )}^{x+r(1-\epsilon )}e^{-y}dy=e^{-x}(e^r-e^{-r}-e^{r(1-\epsilon )} -e^{-r(1-\epsilon )}). \end{aligned}$$

Therefore, by letting \(\epsilon =1/r\), we obtain the following equality

$$\begin{aligned} \frac{\mu (B(x,r) \bigtriangleup B(y,r))}{\mu (B(x,r))}=1-\frac{\frac{1}{e}-e^{-2r+1}}{1-e^{-2r}}\rightarrow 1-\frac{1}{e}\quad \hbox { for }r\rightarrow \infty . \end{aligned}$$

Hence, for large enough xy and r we get that condition (16) may not be satisfied with any \(A>0\) and \(\delta \in (0,1]\).

In next theorem we show Hölder and Lipschitz estimates on balls and compact sets, thus extending Theorem 4.1. Previous assumptions on measure allow us to establish Hölder estimates for some constant and exponent, whose exact values are not determined. Here, the \(\delta \)-annular decay property satisfied by a measure enables us to obtain finer estimates on balls already in the Hölder case. Moreover, on compact subsets we obtain the Hölder regularity as in Theorem 4.1 but, additionally, provide estimates with explicit constants and exponent \(\delta \). Both for the Hölder case and the new Lipschitz one, we also have explicit constants, however a dependence on a Lebesgue number of a chosen covering comes into play. Such a dependence is removed in one of our next results, see Proposition 5.1.

Theorem 4.2

Let \((X, d, \mu )\) be a doubling metric measure space with a \(\delta \)-annular decay property for some \(\delta \in (0,1]\).

If \(\delta \in (0,1)\), then a locally bounded strongly harmonic function f in a domain \(\Omega \subset X\) is \(\delta \)-Hölder continuous on every ball \(B:=B(x_0, r)\subset \Omega \) centered at \(x_0\in \Omega \) such that \(3B\Subset \Omega \).

If \(\delta =1\), then f is locally L-Lipschitz continuous on every ball \(B\subset \Omega \) such that \(3B\Subset \Omega \).

In both cases we have that

$$\begin{aligned} |f(x)-f(y)|\le 4\cdot 9^\delta \Vert f\Vert _{L^{\infty }(B(x_0, 3r))}C_{\mu }^3A\, \left( \frac{d(x,y)}{r}\right) ^\delta \end{aligned}$$
(17)

for \(x,y \in B(x_0,\frac{r}{2})\). Here, \(C_{\mu }\) stands for a doubling constant of \(\mu \) and A is as in (16).

Let \(K\Subset \Omega \) and f be bounded in \(\Omega \). Furthermore, suppose that \(\eta \) is a Lebesgue number of any, but fixed, open cover of K. Then, we have the following estimates

$$\begin{aligned} |f(x)-f(y)|&\le 4\cdot 9^\delta \Vert f\Vert _{L^{\infty }(\Omega )}C_{\mu }^3A\, \left( \frac{2}{{{\mathrm{dist}}}(K, \partial \Omega )}\right) ^\delta \,d(x,y)^{\delta }\quad \hbox { for }d(x,y) \le \eta ,\\ |f(x)-f(y)|&\le 2\frac{\Vert f\Vert _{L^{\infty }(\Omega )}}{\eta ^{\delta }}\,\, d(x,y)^{\delta }\quad \hbox { for } d(x,y)> \eta . \end{aligned}$$

Remark 3

Suppose that X is additionally geodesic. Since geodesic space is, in particular, a length space, we retrieve from Corollary 2.2 in [8] the above Theorem 4.1 with some \(\delta \in (0,1]\).

Proof of Theorem 4.2

Let \(x\in \Omega \) and B(xr) be a ball such that \(B(x, 2r)\Subset \Omega \). Then, \({{\mathrm{dist}}}(B(x, r), X{\setminus } \Omega )> r\). Choose \(y\in B(x,r)\) with \(d(x,y)<r/2\). By the estimate similar to the one at (7) we get that

$$\begin{aligned} |f(x)-f(y)|&=\left| \frac{1}{\mu (B(x,r))}\int _{B(x,r)} f(z) d\mu (z)-\frac{1}{\mu (B(y, r+2d(x,y)))} \right. \nonumber \\&\quad \left. \int _{B(y,r+2d(x,y))} f(z) d\mu (z)\right| \nonumber \\&\le \frac{1}{\mu (B(x,r))}\Bigg |\int _{B(x,r)} f(z) d\mu (z)-\int _{B(y,r+2d(x,y))} f(z) d\mu (z)\Bigg | \nonumber \\&\quad + \left| \frac{\mu (B(y, r+2d(x,y)))-\mu (B(x,r))}{\mu (B(x,r))\mu (B(y, r+2d(x,y)))}\right| \Vert f\Vert _{L^1(B(y,r+2d(x,y)))}. \end{aligned}$$
(18)

Note that

$$\begin{aligned}&B(y, r+2d(x,y)){\setminus } B(x, r)\subset B(y, r+2d(x,y)){\setminus } B(y, r'), \\&\mu (B(y, r+2d(x,y)))-\mu (B(x,r))\le \mu (B(y, r+2d(x,y)))-\mu (B(y, r')), \end{aligned}$$

for any positive \(r'<r\). Observe further, that

$$\begin{aligned}&\left| \frac{\mu (B(y, r+2d(x,y)))-\mu (B(x,r))}{\mu (B(x,r))\mu (B(y, r+2d(x,y)))}\right| =\frac{1}{\mu (B(x,r))}-\frac{1}{\mu (B(y, r+2d(x,y)))} \\&\quad \le \frac{\mu (B(y, r+2d(x,y)))-\mu (B(y, r'))}{\mu (B(y, r')) \mu (B(y, r+2d(x,y)))}, \end{aligned}$$

as \(\mu (B(y, r'))\le \mu (B(x,r))\).

Assume that \(|f|\le M\) in B(x, 2r). The above discussion together with (18) imply that

$$\begin{aligned}&|f(x)-f(y)|\le \frac{1}{\mu (B(x,r))}\int _{B(y,r+2d(x,y)){\setminus } B(y, r')} |f(z)| d\mu (z) \nonumber \\&\quad + M\,\frac{\mu (B(y, r+2d(x,y)))-\mu (B(y, r'))}{\mu (B(y, r'))}. \end{aligned}$$
(19)

Set \(r'=r-d(x,y)\). We appeal to the \(\delta \)-annular decay property of X for \(\epsilon \) such that

$$\begin{aligned} (r+2d(x,y))(1-\epsilon )=r'=r-d(x,y). \end{aligned}$$

Since \(\epsilon =1-\frac{r-d(x,y)}{r+2d(x,y)}\le 3\frac{d(x, y)}{r}\) we set the latter expression to be \(\epsilon \). In a consequence estimate (19) takes the following form

$$\begin{aligned} |f(x)-f(y)|&\le \frac{M}{\mu (B(x,r))} A\left( \frac{3}{r}\right) ^\delta d(x,y)^\delta \mu (B(y,r+2d(x,y)))\\&\quad + \frac{M}{\mu (B(y, r-d(x,y)))} A\left( \frac{3}{r}\right) ^\delta d(x,y)^\delta \mu (B(y,r+2d(x,y)))\\&\le MA\left( \frac{3}{r}\right) ^\delta \, d(x,y)^\delta \\&\quad \times \left( \frac{\mu (B(y,r+2d(x,y)))}{\mu (B(x,r))}+\frac{\mu (B(y,r+2d(x,y)))}{\mu (B(y, r-d(x,y)))}\right) . \end{aligned}$$

Finally, we appeal to the doubling property of \(\mu \) and obtain

$$\begin{aligned} \frac{\mu (B(y,r+2d(x,y)))}{\mu (B(x,r))}&\le \frac{\mu (B(y,2r)}{\mu (B(x,r))}\le C_{\mu }^2\frac{\mu (B(y,\frac{r}{2})}{\mu (B(x,r))}\le C_{\mu }^2,\quad \hbox {and} \\ \frac{\mu (B(y,r+2d(x,y)))}{\mu (B(y, r-d(x,y)))}&\le C_{\mu }^3. \end{aligned}$$

As a result we have that

$$\begin{aligned} |f(x)-f(y)|\le 2\cdot 3^\delta \Vert f\Vert _{L^{\infty }(B(x, 2r))}C_{\mu }^3A\,\left( \frac{d(x,y)}{r}\right) ^\delta \end{aligned}$$
(20)

holds for all \(x,y\in B(x, r/2)\).

Suppose now, that \(x, y\in B(x_0, r/2)\) such that \(2B(x_0, r)\Subset \Omega \). Let us consider two cases.

Case 1:\(d(x,y)\ge \frac{1}{2}d(x,x_0)\). Then, the estimate (20) together with the triangle inequality imply that

$$\begin{aligned} |f(x)-f(y)|&\le |f(x)-f(x_0)|+ |f(y)-f(x_0)| \\&\le 2\cdot 3^\delta \Vert f\Vert _{L^{\infty }(B(x_0, 2r))}C_{\mu }^3A\,\left( \left( \frac{d(x,x_0)}{r}\right) ^\delta +\left( \frac{d(y,x_0)}{r}\right) ^\delta \right) \\&\le 2\cdot 3^\delta \Vert f\Vert _{L^{\infty }(B(x_0, 2r))}C_{\mu }^3A \\&\quad \left( \left( \frac{2d(x,y)}{r}\right) ^\delta +\left( \frac{d(x,x_0)+d(x,y)}{r}\right) ^\delta \right) \\&\le (2\cdot 3^\delta )^2\Vert f\Vert _{L^{\infty }(B(x_0, 2r))}C_{\mu }^3A\,\left( \frac{d(x,y)}{r}\right) ^\delta . \end{aligned}$$

Case 2:\(d(x,y)< \frac{1}{2}d(x,x_0)\le r/2\). Then, \(y\in B(x, r/2)\) and \(B(x, 2r)\subset B(x_0, 3r)\Subset \Omega \). Thus, from (20) we obtain

$$\begin{aligned} |f(x)-f(y)|\le 2\cdot 3^\delta \Vert f\Vert _{L^{\infty }(B(x, 2r))}C_{\mu }^3A\,\left( \frac{d(x,y)}{r}\right) ^\delta . \end{aligned}$$

We note that \(\Vert f\Vert _{L^{\infty }(B(x, 2r))}\le \Vert f\Vert _{L^{\infty }(B(x_0, 3r))}\) and combine inequalities obtained in both cases to obtain the assertion of Theorem 4.2 for balls.

Let K be a compact subset of \(\Omega \) and \(r=\hbox {dist}(K, \partial \Omega )\). Since K is compact, we can cover it by open balls B(xr / 2) centered at points \(x\in K\) and choose a finite subcover, denoted by \(B_i:=B(x_i, r/2)\) for \(i=1,2,\ldots , N\) for some N. Hence,

$$\begin{aligned} K\subset \bigcup _{i=1}^N B(x_i, r). \end{aligned}$$

Let us denote by \(\eta \) a Lebesgue number of covering \(\{B_i\}\). If \(x, y\in K\) are such that \(d(x,y) \le \eta \), then there exists \(i_0\in \{1,...,N\}\) such that \(x, y \in B_{i_0}\). This allows us to apply (17) and obtain the following inequality

$$\begin{aligned} |f(x)-f(y)|\le 4\cdot 9^\delta \Vert f\Vert _{L^{\infty }(\Omega )}C_{\mu }^3A\, \left( \frac{2}{\hbox {dist}(K, \partial \Omega )}\right) ^\delta \,d(x,y)^{\delta }. \end{aligned}$$

Otherwise, if \(d(x,y)> \eta \), then we get

$$\begin{aligned} |f(x)-f(y)|\le |f(x)|+|f(y)| \le 2\Vert f\Vert _{L^{\infty }(\Omega )} \frac{d(x,y)^{\delta }}{\eta ^{\delta }}. \end{aligned}$$

This completes the proof of the second part of Theorem 4.2 and the whole proof is, thus, completed. \(\square \)

5 The Lipschitz regularity and uniform measures: weak upper gradients of harmonic functions

In this section we study some differentiability properties of harmonic functions and our main result is Proposition 5.1. There, we show the Lipschitz regularity of strongly and weakly harmonic functions in the case of the uniform measure growth. Such measures play a fundamental role e.g. in the geometric measure theory, see the discussion and references below. Then, by using the celebrated Cheeger’s results on differentiability of Lipschitz functions, in Corollaries 5.1 and 5.2 we study the existence of weak upper gradient for strongly and weakly harmonic functions.

Definition 5.1

Let \((X, d, \mu )\) be a geodesic metric space equipped with a Borel regular measure \(\mu \). We call \(\mu \) a Q-uniform measure for some \(Q\ge 1\), if there exists a constant \(C>0\) such that for any \(x\in X\) and all \(r>0\)

$$\begin{aligned} \mu (B(x,r))=Cr^Q. \end{aligned}$$
(21)

Uniform measures play an important role in geometric measure theory. For instance, if \(X=R^n\), then Marstrand [38] proved that for a non-trivial Q-uniform measure it necessarily holds that \(Q\in \mathbb {N}\) (see also Chousionis–Tyson [10] for a discussion of Marstrand’s theorem and uniform measures in the setting of Heisenberg groups). One of results of the celebrated paper by Preiss [43] stays that for \(Q=1,2\) uniform measures are flat. Let us also mention that uniform measures have been employed to investigate relations between harmonic measures and non-tangentially accessible domains (NTA-domains), see Kenig–Preiss–Toro [27] and in the studies of rectifiable measures, see Tolsa [49]. Moreover, uniform measure appear in potential and stochastic analysis, see Bogdan–Stós–Sztonyk [6], in the theory of incompressible flows with vorticities, see Cieślak–Szumańska [11].

Proposition 5.1

Let \((X, d, \mu )\) be a geodesic metric space such with a Q-uniform measure \(\mu \). Then, any harmonic function \(f\in \mathcal {H}(\Omega , \mu )\) is locally L-Lipschitz on every compact \(K\subset \Omega \) for \(L=Q2^{Q+1}\frac{M}{{{\mathrm{dist}}}(K, X{\setminus } \Omega )}\) and \(M=\Vert f\Vert _{L^{\infty }(K)}\).

Furthermore, the assertion holds for \(f\in w\mathcal {H}(\Omega , \mu )\) on every compact \(K\subset \Omega \), provided that \(0<2r^K_m<{{\mathrm{dist}}}(K, X{\setminus } \Omega )\) and \(\bigcap _{x \in K}\{r^x_1, r^x_2,\ldots \}\not =\emptyset \), that is, all points in K have at least one common radius for which the mean value property holds for f. Moreover, in such a case we have \(L=Q2^{Q+1}\frac{M}{r^K_m}\).

Remark 4

It is easy to see that uniform measures satisfy 1-annular decay property, see Definition 4.1 and so for strongly harmonic functions Proposition 5.1 follows from the Theorem 4.2. However, below we are able to describe more accurately dependence of the Lipschitz constant on the parameters of the underlying space and the harmonic function. In particular, we avoid using a Lebesgue number of a covering. Moreover, the result below gives also the Lipschitz regularity for weakly harmonic functions.

Proof of Proposition 5.1

Let \(f\in \mathcal {H}(\Omega , \mu )\). Note that \(\mu \) is a doubling measure with a doubling constant \(C_\mu =2^{Q}\). Then, Proposition 2.1 implies that \(\mu \) is continuous with respect to metric d. In a consequence, we infer from Corollary 4.1 that f is locally bounded. Denote by M an upper bound of f on some compact set \(K\subset \Omega \). The estimate similar to (7) in Proposition 4.1 gives us that

$$\begin{aligned}&|f(x)-f(y)|\le \frac{1}{\mu (B(x,r))} \int _{B(x,r) \vartriangle B(y,r)} |f(z)| d\mu (z) \nonumber \\&\qquad + \frac{|\mu (B(x,r))-\mu (B(y, r))|}{\mu (B(x,r))\mu (B(y, r))}\left| \int _{B(y,r)}f(z)d\mu (z)\right| \nonumber \\&\quad \le 2M\frac{\mu (B(x,r) \vartriangle B(y,r))}{\mu (B(x,r))}. \end{aligned}$$
(22)

As in Theorem 7.2 we assume that \(r>d(x,y)\). Then, by (33) and (21)

$$\begin{aligned}&\mu (B(x,r) \bigtriangleup B(y,r)) \le \mu (B(x,r+d(x,y)){\setminus } B(x,r-d(x,y))) \\&\quad = C(r+d(x,y))^Q-C(r-d(x,y))^Q. \end{aligned}$$

Hence, by the mean value theorem applied to function \(s^Q\), we obtain that

$$\begin{aligned} \frac{\mu (B(x,r) \vartriangle B(y,r))}{\mu (B(x,r))}\le \left( 1+\frac{d(x,y)}{r}\right) ^Q-\left( 1-\frac{d(x,y)}{r}\right) ^Q=2Qs^{Q-1}\frac{d(x,y)}{r}, \end{aligned}$$

where \(s\le 1+\frac{d(x,y)}{r}<2\). Choose \(x,y\in K\) and let \(r:=\frac{1}{2}{{\mathrm{dist}}}(K, X{\setminus } \Omega )\). Thus, for all \(x, y\in K\) it holds

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

where \(L=Q2^{Q+1}\frac{M}{{{\mathrm{dist}}}(K, X{\setminus } \Omega )}\).

If \(f\in w\mathcal {H}(\Omega , \mu )\), then by assumptions for all \(x, y\in K\) we are able to find at least one radius, denoted by r, such that (22) and estimates following it hold for r. Then, in the final step we have that

$$\begin{aligned} \frac{d(x,y)}{r}\le \frac{d(x,y)}{r^K_m}, \end{aligned}$$

and so in this case \(L=Q2^{Q+1}\frac{M}{r^K_m}\), as desired. The proof is therefore completed. \(\square \)

One of the consequences of Proposition 5.1 is the differentiability of Lipschitz weakly and strongly harmonic functions on compact sets.

Let f be a locally Lipschitz function in \(\Omega \subset X\). We define a lower pointwise dilatation of f as follows

$$\begin{aligned} \mathrm{lip} f(x)=\liminf _{r\rightarrow 0} \sup _{y\in B(x, r)}\frac{|f(x)-f(y)|}{r}. \end{aligned}$$

Similarly, we define an upper pointwise dilatation of f by the formula:

$$\begin{aligned} \mathrm{Lip} f(x)=\limsup _{r\rightarrow 0} \sup _{y\in B(x, r)}\frac{|f(x)-f(y)|}{r}. \end{aligned}$$

We refer to the following result due to Cheeger, see also Preliminaries for a discussion on weak upper gradients and the Poincaré inequalities.

Theorem 5.1

(Theorem 6.1 in Cheeger [9]) Let \((X, d, \mu )\) be a complete doubling metric measure space supporting (1, p)-Poincaré inequality for \(p>1\). Let further f be a locally Lipschitz function in a domain \(\Omega \subset X\). Then the minimal p-weak upper gradient \(g_f\) of f exists and \(g_f=\mathrm{lip} f\) a.e. in \(\Omega \). Moreover, \(\mathrm{lip} f=\mathrm{Lip} f\) a.e. in \(\Omega \), and both \(\mathrm{lip} f\) and \(\mathrm{Lip} f\) are upper gradients of f.

One combines the above Cheeger’s theorem with Proposition 5.1 to obtain the following observation. (Recall that uniform measures are doubling.)

Corollary 5.1

Let \((X, d, \mu )\) be a complete geodesic metric space such with a Q-uniform measure \(\mu \) for some \(Q\ge 1\) and supporting (1, p)-Poincaré inequality for \(p>1\). Suppose that f is a strongly harmonic function in a compact set \(K\subset \Omega \). Then, the minimal p-weak upper gradient \(g_f\) of f exists and \(g_f=\mathrm{lip} f =\mathrm{Lip} f\) a.e. in K.

Furthermore, the assertion holds for a weakly harmonic function f in K provided that f satisfies the assumptions of the second part of Proposition 5.1.

Similarly, by combining the Cheeger’s theorem with Theorem 4.2 we arrive at the following result.

Corollary 5.2

Let \((X, d, \mu )\) be a complete doubling metric measure space with a 1-annular decay property supporting (1, p)-Poincaré inequality for \(p>1\). Suppose that f is a strongly harmonic function in a ball \(B \subset 2B \Subset \Omega \). Then, the minimal p-weak upper gradient \(g_f\) of f exists and \(g_f=\mathrm{lip} f =\mathrm{Lip} f\) a.e. in B.

6 The Dirichlet problem

We begin this section with an observation that in general, the Dirichlet boundary value problem need not have a solution even in the simplest one-dimensional case as the following example shows.

Example 10

Let \(f \in \mathcal {H}( \mathbb {R}, |\cdot |, |x| dx)\) and set \(g:=f|_{(0,1)}\). Then \(g\in \mathcal {H}((0, 1), |\cdot |, xdx)\) and by observing that \(x \in \mathcal {H}( (0, 1), |\cdot |, dx)\), we conclude by Proposition 7.1 that \(xg\in \mathcal {H}( (0, 1), |\cdot |, dx)\) and, thus, \(g(x) = \frac{A}{x} + B\) for some positive constants AB and, hence, \(f \equiv B\) by the continuity of f (see also Example 12 below).

Consider the Dirichlet problem of finding a harmonic function g in \(\mathcal {H}((0,1), |\cdot |, xdx)\) such that \(g(0)\not =g(1)\). Then, by the above reasoning there is no solution of such problem.

The purpose of this section is to study the following questions:

(1) When does a Dirichlet problem for a functions with the mean value property as in Definition 3.1have a solution and for what type of boundary data?

(2) How to construct a solution to the harmonic Dirichlet problem?

Although these questions are nowadays classical in the Euclidean setting, see e.g. Gilbarg–Trudinger [14], their metric counterparts have been intensively studied mainly in past two decades, see e.g. Section 10 in Björn–Björn [4] and references therein. However, results in [4] apply to harmonic functions defined as minimizers of the 2-Dirichlet energy, whereas we study the above two questions for harmonic functions defined via the mean value property.

We approach the solvability of the Dirichlet problem by employing the so-called Dynamical programming principle, generalized to the metric setting and based on studies conducted for p-harmonious functions in Euclidean domains by Luiro–Parviainen–Saksman [36] and Manfredi–Parviainen–Rossi [37]. Our results apply to some functions with the mean value property for measurable and continuous boundary data. For the further discussion and description of some challenges when applying the Dynamical programming principle in our case we refer to Remarks 1 and 2 in Liu–Schikorra [34].

First, we extend the dynamical programming principle as presented in [36] to the setting of metric spaces with Borel regular measures. Theorems 6.1 and 6.2 below extend Theorems 2.1 and 4.1 in [36] for measurable and continuous data, respectively. Moreover, Theorem 6.1 provides us with a function \(u_{\epsilon }\), the solution to the Dirichlet problem with measurable data, such that it satisfies the mean value property on balls with radii \(\epsilon \). In Theorem 6.2 we show that the similar property holds for solutions to the Dirichlet problem with continuous data at points with \(\epsilon \)-distance from the complement of the domain. Finally, we show that in metric measure spaces with the \(\delta \)-annular decay property the existence of subharmonic solution of the boundary value problem with continuous data implies existence of the weakly harmonic continuous function with the same continuous boundary data, see Theorem 6.3.

We follow the notation of Section 2.1 in [36] and for \(\epsilon >0\) define the \(\epsilon \)-boundary strip of a domain \(\Omega \subset X\):

$$\begin{aligned} \Gamma _\epsilon =\{x\in X{\setminus } \Omega : {{\mathrm{dist}}}(x, \Omega )\le \epsilon \}. \end{aligned}$$

In order to ensure that \(\Gamma _\epsilon \not =\emptyset \) we need to assume that \(\Omega \) is such that \(\Gamma _\epsilon \subset X\). This assumption will not weaken our results, as in fact we apply them only for balls \(B_\epsilon \) compactly contained in the underlying domain with radii \(\epsilon \) small enough so that \(B_\epsilon \cup \Gamma _\epsilon \) remains a subset of the domain.

Denote by \(\Omega _\epsilon :=\Omega \cup \Gamma _\epsilon \).

Theorem 6.1

Let \((X,d, \mu )\) be a metric measure spaces with a measure continuous with respect do d. Moreover, let \(F:\Gamma _\epsilon \rightarrow {\mathbb {R}}\) be a bounded Borel measurable function. Then, there exists a bounded Borel function \(u:\Omega _\epsilon \rightarrow {\mathbb {R}}\) solving the following Dirichlet problem with the boundary data F:

(23)

In fact, u is the uniform limit of a sequence \(\{u_i\}_{i=0}^{\infty }\) defined via the following iteration scheme:

$$\begin{aligned} u_0(x)= \left\{ \begin{array}{ll} \inf _{x\in \Gamma _\epsilon } F(x),&{}\quad x\in \Omega ,\\ F(x),&{}\quad x\in \Gamma _\epsilon , \end{array}\right. \end{aligned}$$

while for \(i=0,1,\ldots \) we define

(24)

Proof

First, notice that \(Tu_i\) is Borel bounded measurable function in \(\Omega _\epsilon \) for every \(i=0,1,\ldots \). In order to verify this observation, first notice that \(u_0\) is measurable. Next, we compute

The continuity of \(\mu \) with respect to d gives us that \(u_1(x)\) is continuous for \(x\in \Omega \), whereas for \(x\in \Omega _{\epsilon }{\setminus } \Omega \) the measurability of \(u_1\) follows the same argument as for \(u_0\). Indeed, by Lemma 2.1(1) we have that a function \(x\mapsto \mu (B(x,\epsilon ))\) is continuous in \(\Omega \). Similarly, a function is measurable as a quotient of two measurable functions. The measurability of \(u_{i+1}=Tu_i\) for \(i=1,2,\ldots \) follows the same steps by induction and we omit details.

We continue the proof following the reasoning for Theorem 2.1 in [36]. It is immediate to check that \(u_1\ge u_0\) in \(\Omega _\epsilon \). In order to give an idea about formulas describing functions \(u_i\) we compute also

$$\begin{aligned} u_2(x)&:=Tu_1(x) \\&= \left\{ \begin{array}{ll} &{}\inf _{\Gamma _\epsilon } F\left[ \frac{\mu (B(x,\epsilon )\cap \{y\in \Omega \,:\,{{\mathrm{dist}}}(y, \partial \Omega )\ge \epsilon \})}{\mu (B(x, \epsilon ))}\right. \\ &{}\left. \quad + \frac{1}{\mu (B(x, \epsilon ))}\int _{B(x,\epsilon )\cap \{y\in \Omega \,:\,{{\mathrm{dist}}}(y, \partial \Omega )< \epsilon \}}\frac{\mu (B(y, \epsilon )\cap \Omega )}{\mu (B(y, \epsilon ))}d\mu (y) \right] ,\quad x\in \Omega , \\ &{}F(x),\quad x\in \Gamma _\epsilon . \end{array}\right. \end{aligned}$$

This yields \(u_2=Tu_1\ge Tu_0=u_1\). The same reasoning allows us to conclude that \(u_{i}\le u_{i+1}\) in \(\Omega _\epsilon \) for all \(i=0,1,\ldots \). Definitions of \(u_0\) and operator T together with easy argument by induction imply that the sequence \(\{u_i\}_{i=0}^{\infty }\) is increasing and uniformly bounded from above by \(\sup _{\Gamma _\epsilon } F<\infty \). The latter property is a consequence of a simple induction applied with (24). Namely, since \(|u_0|\le \sup _{\Gamma _\epsilon } F\) in \(\Omega _{\epsilon }\), then so is \(u_1\). Then, by assuming that \(|u_i|\le \sup _{\Gamma _\epsilon } F\) in \(\Omega _{\epsilon }\) for some \(i>1\) we trivially obtain that for \(x\in \Omega \)

while otherwise, in \(\Omega _{\epsilon }{\setminus } \Omega \), the boundedness of \(u_{i+1}\) immediately follows from its definition.

Therefore, we are in a position to define the following bounded Borel measurable function \(u:\Omega _\epsilon \rightarrow {\mathbb {R}}\):

$$\begin{aligned} u(x)=\lim _{i\rightarrow \infty }u_i(x). \end{aligned}$$

Next, one shows that the convergence is uniform and the proof is by contradiction. This proof follows steps of the corresponding proof of Theorem 2.1 in [36] for \(\alpha =0\) and \(\beta =1\) and, therefore, will be omitted. Let us comment, that the uniform convergence implies that u satisfies (23) and, by construction, has the boundary data F. \(\square \)

In the next theorem we prove the solvability of the Dirichlet problem similar to (23) for continuous boundary data. Define

$$\begin{aligned} \Gamma _{\epsilon ,\epsilon }:=\{x\in X\,:\,{{\mathrm{dist}}}(x,\partial \Omega )\le \epsilon \},\quad \Omega _{\epsilon }:=\Omega \cup \Gamma _{\epsilon ,\epsilon } \quad \hbox {and}\quad \Gamma _{\epsilon }:=\Gamma _{\epsilon ,\epsilon }{\setminus } \Omega . \end{aligned}$$

Using the Tietze extension theorem applied to \(\partial \Omega \) and a continuous function \(g:\partial \Omega \rightarrow {\mathbb {R}}\) we obtain a continuous function \(F:\Gamma _{\epsilon ,\epsilon }\rightarrow {\mathbb {R}}\) such that \(F|_{\partial \Omega }=g\). Moreover,

$$\begin{aligned} \sup _{x\in \Gamma _{\epsilon ,\epsilon }}|F(x)|= \sup _{x\in \partial \Omega }|g(x)|<\infty . \end{aligned}$$

Let us remark, that if F is an extension of g for some \(\epsilon _1\), then F can be taken also for all \(\epsilon \le \epsilon _1\).

Theorem 6.2

(cf. Theorem 4.1 in [36]) Let \(\Omega \) be a path-connected domain in \((X, d, \mu )\) with \(\mu \) continuous with respect to d and let \(F:\Gamma _{\epsilon ,\epsilon }\rightarrow {\mathbb {R}}\) be a continuous function as above. Then, there exists a unique continuous \(u_\epsilon :\Omega _{\epsilon }\rightarrow {\mathbb {R}}\) which solves the following boundary value problem:

(25)

In particular, \(u_\epsilon |_{\partial \Omega }=g\).

Proof

Following the idea of the proof of Theorem 6.1 we define a function \(u_0:\Omega _\epsilon \rightarrow {\mathbb {R}}\) as

$$\begin{aligned} u_0(x):=c<\inf _{\Gamma _{\epsilon ,\epsilon }}F(x), \end{aligned}$$

Moreover, for bounded functions \(u:\Omega _\epsilon \rightarrow {\mathbb {R}}\) we let T be an operator defined as follows:

By convention, we will interpret that

$$\begin{aligned}&\left( 1-\frac{{{\mathrm{dist}}}(x,\Gamma _{\epsilon })}{\epsilon }\right) F(x)=0\quad \hbox {and} \quad \frac{{{\mathrm{dist}}}(x,\Gamma _{\epsilon })}{\epsilon }=1 \end{aligned}$$

for all \(x\in \Omega {\setminus }\Gamma _{\epsilon ,\epsilon }\).

By an iterative scheme we define \(u_{i+1}:=Tu_{i}\) for \(i=0,1,\ldots \) and show that \(\{u_i\}_{i=0}^{\infty }\) is a monotone increasing bounded sequence of continuous functions in \(\Omega _\epsilon \). Furthermore, as in Lemma 6.1, the sequence \(\{u_i\}_{i=0}^{\infty }\) is uniformly bounded from above by \(\sup _{\partial \Omega } g<\infty \) and the argument for this to hold follows again from definitions of \(u_0\), T and induction.

The natural modification of the proof of Theorem 6.1 allows us to conclude that function \(u_\epsilon :=\lim _{i\rightarrow \infty }u_i\) is continuous and satisfies (25).

In order to show the uniqueness, let us suppose that \(u^1\) and \(u^2\) solve (25) and \(u^1\not \equiv u^2\). Set

$$\begin{aligned} \Omega ':=\{x\in \Omega : u^1(x)-u^2(x)=\sup _{z\in \overline{\Omega }} (u^1(z)-u^2(z))=M>0\}. \end{aligned}$$

Furthermore, note that it is enough to consider \(\sup _{z\in \overline{\Omega }} (u^1(z)-u^2(z))\) instead of the supremum for absolute values of \(u^1-u^2\), as the case \(u^2-u^1\) follows by the symmetric argument. The definition of \(\Omega '\) immediately implies that \(\Omega '\) is non-empty. Moreover, let us notice that \(\Omega '\) contains a ball \(B(x, \epsilon )\). Indeed, let us consider two cases.

Case 1\(\Omega '{\setminus } \Gamma _{\epsilon ,\epsilon }\not =\emptyset \). Then for \(x\in \Omega '{\setminus } \Gamma _{\epsilon ,\epsilon }\) it holds that

(26)

Hence, \(u^1-u^2\equiv M\) in \(B(x, \epsilon )\). Choose a point \(z\in \partial \Omega \) and some point \(x'\in \Omega \) close enough to z. Since \(\Omega \) is path-connected, there exists a continuous curve \(\gamma \) joining x and \(x'\) in \(\Omega \). By the compactness of \(|\gamma |\) we may find a finite cover \(\mathcal {C}=\{B_i\}_{i=1}^{N}\) of \(\gamma \) by balls centered at points \(x_i\in \gamma \) with radii \(\epsilon /2\) such that \(x_1=x\) and \(x_N=x'\). Let \(B(x'', \epsilon )\) be a ball in \(\mathcal {C}\) with \(x''\in \gamma \) and \(x''\in B(x,\epsilon /2)\cap B(x_2,\epsilon /2)\). We apply reasoning at (26) to \(B(x'', \epsilon )\) using again the mean value property for \(u^1\) and \(u^2\) and obtain that \(u^1-u^2\equiv M\) in \(B(x'', \epsilon )\). We continue this procedure along \(\gamma \) till we reach first point \(x'''\in \gamma \), such that \(x'''\in \Omega {\setminus }\Gamma _{\epsilon ,\epsilon }\cap B(x_i, \epsilon )\) for some \(2\le i \le N-1\). Then by the definition of \(u_\epsilon \) in (25) we get

(27)

Thus, by repeating the last step at most once more, we have approached \(\partial \Omega \) obtaining a contradiction with the fact that \(u^1|_{\partial \Omega }=g=u^2|_{\partial \Omega }\). Namely, for \(z\in \partial \Omega \) it holds that \(u^1(z)-u^2(z)=0\), even though for points \(y\in U\cap \Omega \) for an arbitrarily small neighborhood U of z we have that \(u^1(y)-u^2(y)=M>0\), contradicting continuity of \(u^1\) and \(u^2\).

Case 2\(\Omega '{\setminus } \Gamma _{\epsilon ,\epsilon }=\emptyset \). Then, since \(\Omega '\) is non-empty, there exists \(x\in \Omega \cap \Gamma _{\epsilon ,\epsilon }\) and the above procedure simplifies. In fact we immediately reach the contradiction, since for \(z\in \partial \Omega \cap B(x,\epsilon )\) on one hand we have that \(u^1(z)-u^2(z)=0\), but on the other hand for points \(y\in U\cap \Omega \) for an arbitrarily small neighborhood U of z it holds that \(u^1(y)-u^2(y)=M>0\) by (27) applied for \(x''':=x\).

The proof of the uniqueness and the whole proof of the theorem are, therefore, completed. \(\square \)

The last result of this section shows that if we know that a Dirichlet problem has a continuous subharmonic solution, then the weakly harmonic solution exists and satisfies the same continuous boundary data.

Theorem 6.3

Let \((X,d,\mu )\) be a metric measure space satisfying the \(\delta \)-annular decay condition for some \(\delta \in (0,1]\). Let \(\Omega \) be a bounded domain in X and consider a continuous function \(g: \partial \Omega \rightarrow \mathbb {R}\). If there is a continuous weakly subharmonic function \(v \in wS_-\mathcal {H}(\Omega ) \cap C(\overline{\Omega })\) such that \(v|_{\partial \Omega }=g\), then there exists a weakly harmonic function \(u\in w\mathcal {H}(\Omega ) \cap C(\overline{\Omega })\) such that \(u|_{\partial \Omega } = g\).

Examples of continuous weakly subharmonic functions are presented in Examples 5 and 8.

Proof

Denote by \(C_b( \Omega )\) a space of bounded continuous functions on \(\Omega \). Let us define an operator \(T: C_b(\Omega ) \rightarrow C_b(\Omega )\) given by

where \(r_x \le \frac{1}{2}\text {dist}(x,\partial \Omega )\) is a given single admissible radius at x.

In order to see that T is well defined, let us consider any \(u \in C_b(\Omega )\) and denote \(M:=\Vert u\Vert _{L^\infty (\Omega )}\). The standard computations then imply that

$$\begin{aligned}&|Tu(x)-Tu(y)|\le \frac{1}{\mu (B(x,r_x))} \int _{B(x,r_x) \vartriangle B(y,r_y)} |u(z)| d\mu (z) \nonumber \\&\qquad + \frac{|\mu (B(x,r_x))-\mu (B(y, r_y))|}{\mu (B(x,r_x)) \mu (B(y, r_y))}\left| \int _{B(y,r_y)} u(z)d\mu (z)\right| \nonumber \\&\quad \le M\left( \frac{\mu (B(x,r_x) \vartriangle B(y,r_y))}{\mu (B(x,r_x))}+ \frac{\mu (B(x,r_x) \vartriangle B(y,r_x))}{\mu (B(x,r_x)) \mu (B(y, r_y))}\mu (B(y, r_y))\right) \nonumber \\&\quad \le 2M \frac{ \mu ( B(x,r_x) \bigtriangleup B(y,r_y) )}{ \mu (B(x,r_x))}. \end{aligned}$$
(28)

Moreover,

$$\begin{aligned} B(x, \min \{r_y - d(x,y), r_x \} ) \subset B(x,r_x) \cap B(y,r_y) \end{aligned}$$

for all x and y with d(xy) small enough, and

$$\begin{aligned} B(x,r_x) \cup B(y,r_y) \subset B(x,\max \left\{ r_x ,r_y \right\} + d(x,y)). \end{aligned}$$

Hence,

$$\begin{aligned}&B(x,r_x) \bigtriangleup B(y,r_y) \subset B(x,\max \left\{ r_x ,r_y \right\} + d(x,y)) {\setminus } B(x, \min \{r_y - d(x,y), r_x \} ).\nonumber \\ \end{aligned}$$
(29)

We combine (28) and (29), which hold for \(y \rightarrow x\) in d and get that the \(\delta \)-annular decay property of X implies \(Tu \in C( \Omega )\), cf. Definition 4.1. By basic properties of the mean value one also obtains that \(\Vert Tu\Vert _{\infty } \le M\).

We use operator T to construct the following sequence of functions:

  1. (1)

    \(u_0:=v\) ,

  2. (2)

    \(u_n := Tu_{n-1}\) for \(n=1,2,\ldots \).

We easily see that all \(u_n \in C_b(\Omega )\) and \(\Vert u_n \Vert _{L^\infty (\Omega )} \le \Vert v \Vert _{L^\infty (\Omega )}\).

Next, observe that every \(u_n\) is weakly subharmonic in \(\Omega \) with admissible radii \(r^x = r_x\). Indeed, \(u_0 = v\) is subharmonic, so by the definition

Moreover, note that if \(v \le w\), then \(Tv \le Tw\). Hence, by induction we get

The above reasoning shows also that sequence \(\{u_n\}_{n=0}^{\infty }\) is increasing at every \(x\in \Omega \).

We extend sequence \(\{u_n\}_{n=0}^{\infty }\) to \(\overline{\Omega }\) in such a way that \(u_n|_{\partial \Omega } = g\) for all \(n=0,1,\ldots \). Indeed, this is possible for \(u_0\) because v is continuous up to the boundary and \(v|_{\partial \Omega } = g\). In order to see that the same holds true for \(u_n\) for \(n\ge 1\) let us first consider any \(w \in C(\overline{\Omega })\) with \(w|_{\partial \Omega }=g\). Then for all \(x \in \partial \Omega \) and \(\epsilon > 0\) there exists \(\delta > 0\) such that

$$\begin{aligned} \left| w(y) - g(x) \right| < \epsilon , \end{aligned}$$

for \(y \in \Omega \cap B(x,\delta )\). Hence, for \(y \in B(x,\frac{\delta }{2}) \cap \Omega \) we have

In a consequence, \(Tw \in C(\overline{\Omega })\) and \(Tw|_{\partial \Omega } = g\). We apply this reasoning with \(w=u_n\) for \(n=0,1,\ldots \) and obtain that \(\{u_n\}_{n=1}^{\infty }\) is bounded increasing sequence of continuous functions on compact set, such that all \(u_n|_{\partial \Omega } = g\).

We are now in a position to define the following Borel function:

$$\begin{aligned} u(x):= \lim _{n \rightarrow \infty } u_n(x)\quad \hbox { for }x\in \Omega . \end{aligned}$$

One can show that \(\{u_n\}_{n=1}^{\infty }\) converges uniformly in \(\Omega \) and the reasoning is similar to the one in the proof of Theorem 2.1 in [36], cf. presentation in the proof of Theorem 6.1 above. Since \(u_n|_{ \partial \Omega } = g\) for all n, the sequence converges uniformly also in \(\overline{\Omega }\). Hence, \(u \in C(\overline{\Omega })\) and \(u|_{ \partial \Omega } = g\). By employing the monotone convergence theorem to the sequence

we get that \(u \in w\mathcal {H}( \Omega )\). \(\square \)

It is a work in progress to establish a viable method for proving the existence of the solutions to the Dirichlet problem via the Perron method or by the dynamical programming method (see e.g. Theorem 4.1 in [37]). Regarding the first approach, our efforts are focused on establishing a counterpart of the Poisson modification in the setting of strongly harmonic functions. Such modifications have several variants e.g. for superminimizers and superharmonic functions in the setting of Newtonian spaces, see e.g. Sections 8.7 and 10.9 in Björn–Björn [4]. Furthermore, one can also obtain a counterpart of the notion of a barrier function at a boundary point \(x_0\in \partial \Omega \) for the mean-value harmonicity, by studying continuous functions \(f:\Omega \rightarrow {\mathbb {R}}\) which satisfy: (1) \(f(x_0)=0\), (2) \(f(x)<0\) for every \(x\in \partial \Omega {\setminus } \{x_0\}\), (3) the sub mean-value property in \(\Omega \) with the constant \(C_f\le 1\) multiplying the mean-value integral. Functions \(-{{\mathrm{dist}}}(x, x_0)\) and \(-{{\mathrm{dist}}}^2(x, x_0)\) are examples of such barriers.

So far, we have established the equivalence between the solvability of the Dirichlet problem in the underlying domain and the solvability of Dirichlet problems in all balls contained in the domain.

Let \((X, d, \mu )\) be a metric space with metrically continuous measure such that all balls are connected. Suppose that \(\Omega \subset X\) is a domain and \(g:\partial \Omega \rightarrow {\mathbb {R}}\) is a continuous function. Moreover, let us assume that the harmonic Dirichlet problem is solvable on all balls \(B\subset \Omega \) for an arbitrary continuous boundary data.

Then, the Dirichlet problem has a solution in \(\Omega \) if and only if at every \(x \in \partial \Omega \) there exists a barrier function, and for every ball in \(\Omega \) there exists a solution of the Dirichlet problem with g.

We remark that the solvability of the Dirichlet problem on balls leads to interesting problems. For instance, in the Heisenberg setting, a ball in a Carnot–Carathéodory metric need not be a regular set for 2-harmonic functions, see Example 14.4 in [4].

7 The Liouville theorem

The Liouville theorem is a classical result in the theory of harmonic functions in \({\mathbb {R}}^n\). The purpose of this section is to establish similar results for strongly and weakly harmonic functions on metric measure spaces. It turns out that already on \({\mathbb {R}}\) we may choose such a measure, so that the Liouville theorem fails, cf. Example 11. However, below we establish a fairly general condition on a measure resulting in the Liouville theorem, see (31) and (32) in Theorem 7.1. Moreover, we discuss some sufficient conditions on a measure and a metric space to ensure that Theorem 7.1 holds, see Remark 6 and Theorem 7.2. For strongly harmonic functions a variant of the Liouville theorem follows from the Harnack inequality on balls, see Theorem 7.3.

Let us begin with the following simple observation.

Proposition 7.1

Suppose that \(f \in \mathcal {H}(\Omega , \mu )\) and let \(f > 0\) in \(\Omega \), then \(g \in \mathcal {H}(\Omega , f \mu )\) if and only if \( gf \in \mathcal {H}(\Omega , \mu )\).

Moreover, the assertion remains true for \(f, g\in w\mathcal {H}(\Omega , \mu )\) and \(f>0\) provided that f and g have the same sets of admissible radii \(r^x_i\) for \(i=1,2,\ldots \) at every point \(x\in \Omega \).

Proof

Let \(g \in \mathcal {H}(\Omega , f\mu )\). Define \(h=fg \) and by a straightforward computation we get

$$\begin{aligned} \frac{\int _{B(x,r)} h d \mu }{\mu ( B(x,r) )} =\frac{\int _{B(x,r)} gf d \mu }{\mu ( B(x,r) )} = \frac{g(x) {\int _{B(x,r)} f d \mu }}{ \mu ( B(x,r) )} = f(x)g(x) = h(x). \end{aligned}$$

Hence, we obtain that \(h \in \mathcal {H}(\Omega , \mu )\). In order to show the opposite implication, let us define \(g := \frac{h}{f}\), where \(h \in \mathcal {H}(\Omega , \mu )\). Thus,

$$\begin{aligned} \frac{\int _{B(x,r)} \frac{h}{f}f d \mu }{\int _{B(x,r)} f d \mu } = \frac{\int _{B(x,r)} h d \mu }{\int _{B(x,r)} f d \mu } = \frac{h(x)}{f(x)}. \end{aligned}$$

Let now \(f,g\in w\mathcal {H}(\Omega , \mu )\) and \(f>0\). Then, the above reasoning holds at every ball \(B=B(x, r^x_i)\) for all i, since sets of admissible radii are the same for both functions. \(\square \)

Before proving Liouville-type results, let us give an example illustrating that, in general, the Liouville property need not hold.

Example 11

There exists a measure \(\mu \) on \((\mathbb {R}, |\cdot |)\) and \(f \in \mathcal {H}(\mathbb {R}, \mu )\) which is bounded and nonconstant.

Let \(f(x)= 2 e^{x}\cosh x=1+e^{2x}\). Then \(f \in \mathcal {H}(\mathbb {R}, e^{-x} dx )\). Indeed, for every \(x \in \mathbb {R}\) and \(r>0\) we have

$$\begin{aligned} \int _{B(x,r)} f(t)e^{-t} dt\,=\, \int _{x-r}^{x+r} (1+e^{2t})e^{-t} dt. \end{aligned}$$

Thus,

$$\begin{aligned} \int _{x-r}^{x+r} e^{-t} dt = e^{-x}(e^r - e^{-r})\quad \hbox {and} \quad \int _{x-r}^{x+r} e^{2t} e^{-t} dt = e^{x}(e^r - e^{-r}). \end{aligned}$$
(30)

Hence, we obtain that

$$\begin{aligned} \frac{1}{\mu (B(x,r))} \int _{B(x,r)} f(t)\mu (t)\,=\,1+\frac{\int _{x-r}^{x+r} e^{2t} e^{-t} dt }{\int _{x-r}^{x+r} e^{-t} dt } = 1+e^{2x}=f(x). \end{aligned}$$

However, by virtue of Proposition 7.1 applied with \(f(x)= 2 e^{x}\cosh x\), measure \(\mu =e^{-x}\) we get that a entire nonconstant bounded harmonic function \(g:=\frac{1}{f}=\frac{1}{1 + e^{2x}} \in \mathcal {H}(\mathbb {R}, 2 \cosh x \, dx)\), since \(gf=1\in \mathcal {H}(\Omega ,\mu )\) by (30).

We turn now to the question of the structure and dimension of the space of harmonic functions on the whole space. Similar studies in the setting of manifolds have been studied by several authors, e.g. Colding–Minicozzi [12] for Riemannian manifolds, Theorem 1.4 in Hua–Kell–Xia [26] in the setting of RCD*(0, N).

Definition 3.1 implies that the space of harmonic functions \(\mathcal {H}(\Omega , \mu )\) is a linear space. In fact, if \(X={\mathbb {R}}\), then the following observation holds.

Example 12

Denote by \(\dim \mathcal {H}(\Omega , \mu )\) a dimension of \(\mathcal {H}(\Omega , \mu )\) as a linear space. Then \(\dim \mathcal {H} (\mathbb {R}, d, \mu ) \le 2\).

We first show the following claim: If \(f \in \mathcal {H} (\mathbb {R} , d, \mu ) \), then f is constant or strictly monotone. Let \(D= \{(x,y): x<y \}\) and consider a function \(g: D \rightarrow \mathbb {R}\) defined as follows \(g(x,y):= f(x) - f(y)\). Since f is continuous in D by Proposition 4.1, then so is g in \(D\times D\). Suppose that f is not strictly monotone. Then \(g(x,y)=0\) for some \((x,y)\in D\), then \(f(x) = f(y)\) and by the weak maximum principle in Corollary 4.3 we get that f is constant on the interval [xy].

Next, we take any \(b>y\). If f is not strictly monotone on [yb], then we split this interval into the intervals where f is monotone and apply the following reasoning on such intervals. Therefore, let us suppose that f is monotone increasing on [yb], then by the the strong maximum principle in Proposition 4.2 applied to [xb], we get that f is constant on [xb]. We obtain the same conclusion if f is monotone decreasing, since then we use the strong minimum principle (an immediate consequence of Proposition 4.2). The analogous reasoning gives us that f must be constant on any interval [ay] for \(a<x\). From this, we have that f is constant on any interval [ab] containing the set [xy] and the claim is proven.

Now, we are in position to prove the assertion of the example. Let \(f,g \in \mathcal {H} (\mathbb {R}, d, \mu )\) be such that fg are non-constant. Then, by the claim f and g are strictly monotone. Hence, there exists \(A \in \mathbb {R}\) such that \(f(1) - f(-1) = A( g(1) - g(-1))\). Thus,

$$\begin{aligned} f(-1) = A g(-1) + B, \qquad f(1) = A g(1) + B \end{aligned}$$

for some \(B \in \mathbb {R}\). Hence, by the maximum principle we get \(f(x) - Ag(x) - B = 0\) for \(x \in [-1,1]\). This implies that \(f(x) - Ag(x) - B = 0\) for \( x \in \mathbb {R}\) and the proof of the observation follows.

In fact \(\dim \mathcal {H}\) can be smaller then 2, since it holds that \(\dim \mathcal {H} (\mathbb {R}, |\cdot |, |x| dx)=1\).

Indeed, let \(f \in \mathcal {H}( \mathbb {R}, |\cdot |, |x| dx)\) and denote \(g:=f|_{ (0,+\infty )}\). Then \(g\in \mathcal {H}((0, + \infty ), |\cdot |, xdx)\). Since \( x \in \mathcal {H}( (0, + \infty ), |\cdot |, dx)\), then Proposition 7.1 implies that \(xg\in \mathcal {H}( (0, 1), |\cdot |, dx)\) and, therefore, \(g(x) = \frac{A}{x} + B\) for some positive constants AB. The continuity of f results in \(f \equiv B\).

Finally, note that the similar result for weakly harmonic functions fails since such functions do not have a natural structure of a linear space. In order to ensure such structure one would have to assume, for instance, that all functions in \(w\mathcal {H}(\Omega , \mu )\) have the same sets of admissible radii at every point of \(\Omega \).

The following result is related to a work of Yau [54] for Liouville theorems on complete Riemannian manifolds with the Ricci curvature bounded from below.

Theorem 7.1

Suppose that for every \(x, y \in X\) the following condition holds

$$\begin{aligned} \liminf _{ r \rightarrow \infty } \frac{ \mu ( B(x,r) \bigtriangleup B(y,r)) }{ \mu (B(x,r) )} = 0. \end{aligned}$$
(31)

Then, every bounded harmonic function in \(\mathcal {H}(X, \mu )\) is constant.

Moreover, the assertion holds true for a bounded \(f \in w\mathcal {H}(X, \mu )\) provided that at every \(x, y\in X\) there exist sequences \((r^x_n), (r^y_n)\) of admissible radii such that the following holds

$$\begin{aligned} \lim _{ n \rightarrow \infty } \frac{ \mu ( B(x,r^x_n) \bigtriangleup B(y,r^y_n)) }{ \mu (B(x,r^x_n) )} = 0. \end{aligned}$$
(32)

Before proving the theorem we present two observations regarding sufficient conditions for functions and for a space and a measure for (32) and (31) to hold, respectively.

Remark 5

Suppose that at every point \(x\in X\): (1) f has the same sets of admissible radii \(r^x_n\) for \(n=1,2,\ldots \), and (2) \(r^x_M=\sup _{n\in {\mathbb {N}}}r^x_n=\infty \). Then in assumption (32) one can consider, for instance, sequences \(r^x_n=r^y_n\) for \(n=1,2,\ldots \).

Remark 6

Let us provide an example of a measure which ensures that (31) holds. Suppose that \((X, d, \mu )\) is a length metric measure space with a doubling measure \(\mu \). For such spaces Corollary 2.2 in Buckley [8] stays that X satisfies a \(\delta \)-annular decay property for some \(\delta \in (0,1]\), cf. the discussion following Definition 4.1. Then \(\mu \) satisfies (31). Indeed, as in Remark 2 we have that for \(x,y\in X\) with \(d(x,y)<r\) it holds

$$\begin{aligned}&\frac{\mu (B(x,r) \bigtriangleup B(y,r))}{\mu (B(x,r))} \le A \left( \frac{2d(x,y)}{r+d(x,y)}\right) ^\delta \frac{\mu (B(x,r+d(x,y))}{\mu (B(x,r))} \\&\quad \le A C_{\mu }\left( \frac{2d(x,y)}{r+d(x,y)}\right) ^\delta , \end{aligned}$$

since \(r+d(x,y)<2r\) and the doubling condition can be applied. By letting \(r\rightarrow \infty \) we arrive at (31).

Proof of Theorem 7.1

Let \(f\in \mathcal {H}(X)\) be bounded and set \(M:= \Vert f\Vert _{L^{\infty }(X)}\). We follow the steps of the reasoning at (7), see the proof of Proposition 4.1 and cf. Lemma 4.3 in [13], and obtain

$$\begin{aligned}&|f(x)-f(y)| \le \frac{1}{\mu (B(x,r_1))} \int _{B(x,r_1) \vartriangle B(y,r_2)} |f(z)| d\mu (z) \\&\qquad + \frac{|\mu (B(x,r_1))-\mu (B(y, r_2))|}{\mu (B(x.r_1)) \mu (B(y, r_2))}\left| \int _{B(y,r_2)} f(z)d\mu (z)\right| \\&\quad \le M\left( \frac{\mu (B(x,r_1) \vartriangle B(y,r_2))}{\mu (B(x,r_1))}+ \frac{\mu (B(x,r_1) \vartriangle B(y,r_1))}{\mu (B(x,r_1)) \mu (B(y, r_2))}\mu (B(y, r_2))\right) \\&\quad \le 2M \frac{ \mu ( B(x,r_1) \bigtriangleup B(y,r_2) )}{ \mu (B(x,r_1))}. \end{aligned}$$

Now let \(r_1 = r_2 = r\). We take \(\liminf \) for \(r\rightarrow \infty \) and thus, by assumption (31), we get that \(f(x)=f(y)\) for every \(x, y \in X\). From this the proof for strongly harmonic functions follows.

Let now \(f\in w\mathcal {H}(X, \mu )\). Then we set \(r_1=r^x_n\) and \(r_2 = r^y_n\) for \(n=1,2,\ldots \) and appeal to (32) in order to complete the proof of the theorem for weakly harmonic functions. \(\square \)

Theorem 7.2

If \( \mu (X) < \infty \), then every bounded \(f \in \mathcal {H}(X)\) is constant. Moreover, if \(f\in w\mathcal {H}(X)\) is bounded and \(r^x_M = \infty \) for all \(x \in X\), then f is constant.

Proof

Observe that for \(x,y \in X\) and \(r > d(x,y)\) we have

$$\begin{aligned} B(x,r - d(x,y)) \subset B(x,r) \cap B(y,r) \subset B(x,r) \cup B(y,r) \subset B(x,r + d(x,y)). \end{aligned}$$

Hence,

$$\begin{aligned} B(x,r) \bigtriangleup B(y,r) \subset B(x,r+d(x,y)){\setminus } B(x,r-d(x,y)). \end{aligned}$$
(33)

Next, for \(n\ge 2\) we define \(r_n = (2n - 1) d(x,y)\) and \(\bar{r}_n = 2n d(x,y)\). Since

$$\begin{aligned} X = B(x,r_2) \cup \bigcup _{n =2}^\infty B(x, r_{n+1}){\setminus } B(x, r_n) \end{aligned}$$

and \( \mu (X) < \infty \), we have

$$\begin{aligned} \lim _{n \rightarrow \infty } \mu \left( B(x, r_{n+1}){\setminus } B(x, r_n)\right) = 0. \end{aligned}$$

In view of the above relations, we conclude

$$\begin{aligned} \frac{ \mu ( B(x,\bar{r}_n) \bigtriangleup B(y,\bar{r}_n) )}{ \mu (B(x,\bar{r}_n))} \le \frac{\mu \left( B(x, r_{n+1}){\setminus } B(x, r_n)\right) }{ \mu (B(x,\bar{r}_2))} \rightarrow 0, \quad \hbox { for } n\rightarrow \infty . \end{aligned}$$

Therefore, assumption (31) of Theorem 7.1 is satisfied and hence every bounded harmonic function in \(\mathcal {H}(X, \mu )\) is constant. The proof of the theorem for strongly harmonic functions is completed.

Now let \(f \in w\mathcal {H}(X)\) with \(r^x_M=\infty \) for all \(x \in X\). Therefore, at every \(x\in X\) we may choose monotone sequences of admissible radii \((r^x_n)\) and \((r^y_n)\), such that \(\displaystyle \lim _{n \rightarrow \infty } r^x_n = \lim _{n \rightarrow \infty } r^y_n = \infty \). Then,

$$\begin{aligned}&B(x, \min \{r^y_n - d(x,y), r^x_n \} ) \subset B(x,r^x_n) \cap B(y,r^y_n) \subset B(x,r^x_n) \cup B(y,r^y_n) \\&\quad \subset B(x,r^x_n + r^y_n + d(x,y)). \end{aligned}$$

Define two sequences

$$\begin{aligned} r_n = r^x_n + r^y_n + d(x,y), \qquad s_n = \min \{r^y_n - d(x,y), r^x_n \}\quad \hbox {for } n=1,2,\ldots . \end{aligned}$$

Hence,

$$\begin{aligned} B(x,r^x_n) \bigtriangleup B(y,r^y_n) \subset B(x,r_n) {\setminus } B(x, s_n )\quad \hbox { for all }n. \end{aligned}$$

Let us construct the following subsequences of \((r_n)\) and \((s_{n})\):

  1. (1)

    \(r_1':=r_{n_1}\), \(s_1':=s_{n_1}\), for some \(n_1\ge 1\),

  2. (2)

    for \(l=2,3,\ldots \) we set \(s_l':=s_{n_{k+1}}\), such that \(s_{n_{k+1}}> r_{n_k}\) and \(r_l':=r_{n_{k+1}}\).

Therefore, for \(i \ne j\) we have that

$$\begin{aligned} \left( B(x,r_{i}') {\setminus } B(x, s_i' ) \right) \cap \left( B(x,r_j') {\setminus } B(x, s_j' ) \right) = \emptyset . \end{aligned}$$

Hence, by additionally appealing to the finiteness of the measure \(\mu \) of X, we get

$$\begin{aligned} \frac{ \mu ( B(x,r^x_{n_k}) \bigtriangleup B(y,r^y_{n_k}) )}{ \mu (B(x,r^x_{n_k}))} \le \frac{\mu \left( B(x, r_n'){\setminus } B(x, s_n')\right) }{ \mu (B(x,r^x_1))} \rightarrow 0, \quad \hbox { for } n\rightarrow \infty . \end{aligned}$$

Thus, assumption (32) of Theorem 7.1 is satisfied implying that f is constant. The proof of the theorem is, therefore, completed. \(\square \)

The Liouville theorem can also be obtain from the Harnack inequality on balls, see Lemma 4.1. Below we assume that \(\mu \) is bounded, restricting the set of admissible measures, but on the other hand we require harmonic function to be bounded from below only. Namely, the following result holds.

Theorem 7.3

Let X be a geodesic metric measure space with doubling measure \(\mu \). Then, every bounded from below harmonic function in \(\mathcal {H}(X, \mu )\) is constant.

Proof

Let \(f\in \mathcal {H}(X, \mu )\) and define \(g=f-\inf _{X} f\ge 0\). By Proposition 3.1(1) we have that \(g\in \mathcal {H}(X, \mu )\). By the Harnack inequality, see Lemma 4.1, we have that for all \(x\in X\) and any ball \(B(x,r)\in X\)

$$\begin{aligned} g(x)\le \sup _{B(x,r)} g \le C_{\mu }^3 \inf _{B(x,r)} g \rightarrow 0,\quad \hbox { as } r\rightarrow \infty . \end{aligned}$$

Hence, \(g\equiv 0\) and, in turn, f is constant. \(\square \)

In the setting of weakly harmonic functions the same type of argument cannot be applied. Indeed, if \(r^B_M\rightarrow \infty \), then the Harnack constant \(C_H\) in Lemma 4.1 grows unbounded.