1 Introduction

The space of functions of bounded mean oscillation (BMO) was introduced by John and Nirenberg in [27]. In that article, they also discussed a larger BMO-type space called the John–Nirenberg space, denoted by \(JN_p\) with \(1<p<\infty \). The John–Nirenberg space contains BMO, and BMO is obtained as the limit of \(JN_p\) as \(p \rightarrow \infty \). The John–Nirenberg lemma in [27] states that a logarithmic blowup is the worst possible for a BMO function. Moreover, another version of the John–Nirenberg lemma in [27] implies that \(JN_{p}\) is a subset of weak \(L^{p}\). This inclusion is strict, as shown by a one-dimensional example in [1]. It is also known that \(L^p\) is a proper subset of \(JN_p\); see [8].

In [26], John discussed BMO using medians instead of integral averages. He also proved the analogous John–Nirenberg inequality for the median-type BMO in a Euclidean space. Later, Strömberg proved the inequality for a larger class of medians and also gave a proof in a metric measure space with a doubling measure [35, 36]. In particular, this implies that the ordinary BMO and the median-type BMO are equivalent. While BMO has been studied extensively, the John–Nirenberg space is not equally well understood. However, some results related to John–Nirenberg inequalities and interpolation of operators can be found in [6, 12,13,14, 34].

Our main results are John–Nirenberg inequalities for the median-type John–Nirenberg space. We carry out the analysis in a metric measure space with a doubling measure, but the main results are new even in the Euclidean setting. The main novelty is that we consider medians instead of integral averages throughout. One of the advantages of using medians is that we do not need to assume that the function is locally integrable. Thus, the definition via medians applies to any measurable function. There exist different definitions of John–Nirenberg spaces in metric measure spaces; see [1, 2, 32]. The difference is whether the balls in the definition are required to be pairwise disjoint or allowed to overlap. Definitions with disjoint balls can be found in [2, 32] and with overlap in [1]. We adopt the definition in [2, 32] which leads to a more general theory.

The proof of the local John–Nirenberg inequality with medians (Theorem 4.4) in Sect. 4 is based on a Calderón–Zygmund decomposition (Lemma 4.2) and a good-\(\lambda \) inequality (Lemma 4.3) for medians. This is inspired by [1, 2], where the authors examine integral-type John–Nirenberg spaces in metric measure spaces with a doubling measure. A challenge in proving results for the median-type John–Nirenberg space is that medians lack subadditive properties and monotonicity on sets compared to integral averages. Our Theorem 4.4 implies a related John–Nirenberg inequality in [30, Theorem 1.3] where a discrete summability condition is considered; see also [2, 10, 31]. A simple one-dimensional example shows that our result is more general than [30, Theorem 1.3]. In particular, our approach does not depend on the discrete summability condition and rearrangements.

In Sect. 5, we prove a John–Nirenberg inequality with medians up to the boundary (Theorem 5.3) in Boman sets by applying the local John–Nirenberg inequality together with chaining arguments. Boman sets are closely related to the Boman chain condition, introduced in the unpublished paper [4]. The connection is discussed in [32]. In particular, the two are equivalent in a geodesic space with a doubling measure. The Boman chain condition characterizes John domains in many metric measure spaces, including Euclidean spaces; see [5]. The corresponding results for the integral-type John–Nirenberg space can be found in [23, 32]. We apply the arguments in [7, 23, 32] for medians. As a corollary of the global John–Nirenberg inequality, we show that the integral- and median-type John–Nirenberg spaces coincide in every open set under the assumption that balls are Boman sets with uniform parameters (Corollary 5.4). This means that the median-type John–Nirenberg condition is possibly the weakest for a function to be in \(JN_p\). The uniform Boman condition on balls holds, for example, in geodesic spaces [16].

2 Preliminaries

Let \((X,d,\mu )\) be a metric measure space with a metric d and a doubling measure \(\mu \). A Borel regular measure is said to be doubling if

$$\begin{aligned} 0< \mu (2B) \le c_\mu \mu (B) < \infty \end{aligned}$$

for every ball \(B = B(x,r) = \{ y\in X: d(x,y) < r \}\), where \(c_\mu >1\) is the doubling constant. We use the notation \(\lambda B = B(x,\lambda r)\), \(\lambda >0\), for the \(\lambda \)-dilate of B. From the doubling property of the measure, it can be deduced that if \(y \in B(x,R) \subset X\) and \(0<r\le R <\infty \), then

$$\begin{aligned} \frac{\mu (B(x,R))}{\mu (B(y,r))} \le c_\mu ^2 \left( \frac{R}{r} \right) ^D, \end{aligned}$$

where \(D = \log _2 c_\mu \) is the doubling dimension of the space \((X,d,\mu )\). The proof can be found in [3, p. 6]. We denote the integral average of a function \(f \in L^1(A)\) in a set \(A \subset X\) by

A basic tool in metric measure spaces is the 5-covering theorem. It is also sometimes referred to as the basic covering theorem or Vitali’s covering theorem. Although, one must be careful since there is another covering theorem named after Vitali [22, pp. 3–4]. One can check [22, pp. 2–3] for a proof.

Lemma 2.1

Let \(\mathcal {F}\) be a collection of balls of uniformly bounded radii in X. Then there exists a countable disjointed subcollection \(\mathcal {G}\) such that

$$\begin{aligned} \bigcup _{B \in \mathcal {F}} B \subset \bigcup _{B \in \mathcal {G}} 5B . \end{aligned}$$

The Lebesgue differentiation theorem states that the integral average of a function f over a ball B(xr) approaches f(x) when the radius r tends to zero. Two different proofs can be found in [22, pp. 4–6, 12–13].

Lemma 2.2

If \(f \in L_{\text { loc}}^1(X)\), then it holds that

for \(\mu \)-almost every \(x \in X\).

We follow the definition in [2, 32] for the integral-type John–Nirenberg space \(JN_{p,q}\) in metric measure spaces.

Definition 2.3

Let \(\Omega \subset X\) be an open set, \(1<p<\infty \) and \(0<q<p\). We say that a function \(f \in L_{\text {loc}}^q(\Omega )\) belongs to the John–Nirenberg space \(JN_{p,q}(\Omega )\) if

where the supremum is taken over countable collections of pairwise disjoint balls \(B_i \subset \Omega \).

If \(q=1\), we write \(JN_p\) instead of \(JN_{p,1}\). We omit \(\Omega \) from the norms if the considered set is clear from the context.

Next, we present medians and discuss their properties. Medians have been studied and used in different problems of analysis; see for example [9, 11, 15, 17,18,19,20,21, 24,25,26, 28,29,30, 33, 35,36,37].

Definition 2.4

Let \(A \subset X\) be a set of finite and positive measure, \(0<s\le 1\) and \(f:X \rightarrow [-\infty , \infty ]\) be a measurable function. If a value \(M_f^s(A)\) satisfies

$$\begin{aligned} \mu (\{x \in A: f(x) > M_f^s(A)\}) \le s \mu (A) \end{aligned}$$

and

$$\begin{aligned} \mu (\{x \in A: f(x) < M_f^s(A)\}) \le (1-s) \mu (A), \end{aligned}$$

then we call \(M_f^s(A)\) an s-median of the function f over a set A.

Note that a \(\tfrac{1}{2}\)-median is a standard median value of f over A. An s-median of a function is not always unique. For example, consider \(f = \chi _{[1/2, 1]}\) on the interval [0, 1]. Then any value between 0 and 1 is a \(\tfrac{1}{2}\)-median of f. Thus, we define the maximal s-median \(m_f^s(A)\) which is unique [33].

Definition 2.5

Let \(0<s \le 1\) and \(A \subset X\) be such that \(0<\mu (A)<\infty \). The maximal s-median of a measurable function \(f:X \rightarrow [-\infty , \infty ]\) over a set A is defined as

$$\begin{aligned} m_f^s(A) = \inf \{a \in \mathbb {R} : \mu (\{x \in A: f(x) > a\}) < s \mu (A) \} . \end{aligned}$$

It can be shown that the maximal s-median of a function is indeed an s-median [33]. In the next lemma, we list the basic properties of the maximal s-median. Most of these properties are listed without proofs in [20, 21]. The proofs of properties (i), (ii), (v), (vii), (viii) and (ix) can be found in [33, Proposition 1.1] in the Euclidean setting. The proofs of these properties are practically same in metric measure spaces, and thus are omitted here. We give proofs for the remaining properties.

Lemma 2.6

Let \(A \subset X\) such that \(0< \mu (A) < \infty \), \(f,g:X \rightarrow [-\infty , \infty ]\) be measurable functions and \(0<s\le 1\). Then the maximal s-median has the following properties:

  1. (i)

    If \(s \le s'\), then \(m_f^{s'}(A) \le m_f^s(A)\).

  2. (ii)

    \(m_f^s(A) \le m_g^s(A)\) whenever \(f\le g\) \(\mu \)-almost everywhere in A.

  3. (iii)

    If \(A \subset A'\) and \(\mu (A') \le c\mu (A)\) with some \(c \ge 1\), then \(m_f^s(A) \le m_f^{s/c}(A')\).

  4. (iv)

    \(m_{\varphi \circ f}^s(A) = \varphi (m_f^s(A))\) for an increasing continuous function \(\varphi : f[A] \rightarrow [-\infty , \infty ]\).

  5. (v)

    \(m_f^s(A) + c = m_{f+c}^s(A)\) for \(c \in \mathbb {R}\).

  6. (vi)

    \(m_{cf}^s(A) = c \, m_f^s(A)\) for \(c > 0\).

  7. (vii)

    \(|m_{f}^s(A)| \le m_{|f|}^{\min \{s,1-s\}}(A)\).

  8. (viii)

    \(m_{f+g}^s(A) \le m_f^{t_1}(A) + m_g^{t_2}(A)\) whenever \(t_1 + t_2 \le s\).

  9. (ix)

    For \(f \in L^p(A)\) and \(p>0\),

  10. (x)

    If \(A_i\) are pairwise disjoint for every \(i \in \mathbb {N}\), then

    $$\begin{aligned} \inf _{i} m_f^s(A_i) \le m_f^s\big (\bigcup _{i=1}^\infty A_i\big ) \le \sup _{i} m_f^s(A_i) . \end{aligned}$$

Proof

(iii) If \(a > m_f^{s/c}(A')\), then we have

$$\begin{aligned} \mu (\{x \in A: f(x)> a\}) \le \mu (\{x \in A': f(x) > a\}) < \frac{s}{c} \mu (A') \le s \mu (A) , \end{aligned}$$

from which the claim follows.

(iv) It holds that

$$\begin{aligned} \varphi (m_f^s(A))&= \inf \{\varphi (a) \in \mathbb {R} : \mu (\{x \in A: f(x)> a\})< s \mu (A) \} \\&= \inf \{\varphi (a) \in \mathbb {R} : \mu (\{x \in A: \varphi (f(x)) > \varphi (a)\}) < s \mu (A) \} \\&= m_{\varphi \circ f}^s(A) . \end{aligned}$$

(vi) Apply property (iv) for \(\varphi (x) = cx\).

(x) For \(a > \sup _i m_f^s(A_i)\), we have

$$\begin{aligned} \mu \big (\big \{x \in \bigcup _{i=1}^\infty A_i: f(x)> a \big \}\big )&= \sum _{i=1}^\infty \mu (\{x \in A_i: f(x) > a\}) \\&< \sum _{i=1}^\infty s \mu (A_i) = s \mu \big (\bigcup _{i=1}^\infty A_i\big ). \end{aligned}$$

It follows that \(m_f^{s}\big (\bigcup _{i=1}^\infty A_i\big ) \le a\). Since this holds for every \(a > \sup _i m_f^s(A_i)\), we have

$$\begin{aligned} m_f^{s}\big (\bigcup _{i=1}^\infty A_i\big ) \le \sup _i m_f^s(A_i). \end{aligned}$$

To prove the other inequality, assume that \(a< \inf _i m_f^s(A_i)\). We then get

$$\begin{aligned} \mu \big (\big \{x \in \bigcup _{i=1}^\infty A_i: f(x)< a \big \}\big )&= \sum _{i=1}^\infty \mu (\{x \in A_i: f(x)< a\}) \\&< \sum _{i=1}^\infty (1-s) \mu (A_i) = (1-s) \mu \big (\bigcup _{i=1}^\infty A_i\big ). \end{aligned}$$

This implies that \(a \le m_f^{s}\big (\bigcup _{i=1}^\infty A_i\big )\) for every \(a< \inf _i m_f^s(A_i)\). Hence, we obtain

$$\begin{aligned} \inf _i m_f^s(A_i) \le m_f^{s}\big (\bigcup _{i=1}^\infty A_i\big ). \end{aligned}$$

\(\square \)

Remark

Assume that \(0<s\le 1/2\). Then property (vii) assumes a slightly simpler form

$$\begin{aligned} |m_{f}^s(A)| \le m_{|f|}^{\min \{s,1-s\}}(A) = m_{|f|}^s(A) , \end{aligned}$$

since

$$\begin{aligned} m_{|f|}^{1-s}(A) \le m_{|f|}^s(A) \end{aligned}$$

for \(0<s\le 1/2\).

Suppose that \(f \in L_{\text {loc}}^1(X)\) and \(0<s\le 1/2\). Using the Lebesgue differentiation theorem (Lemma 2.2) together with properties (v), (vii) and (ix) of the maximal s-medians, we obtain the following version of the Lebesgue differentiation theorem:

as \(r \rightarrow 0\). However, there is a more general version of the Lebesgue differentiation theorem for medians [33], where we need to assume only that f is a measurable function.

The proof of Lemma 2.7 can be found in [33, Theorem 2.1] where the lemma is proven in the Euclidean setting. The proof is almost identical in metric measure spaces with a doubling measure, and thus is omitted here.

Lemma 2.7

Let \(f:X \rightarrow [-\infty , \infty ]\) be a measurable function which is finite almost everywhere in X and \(0<s\le 1\). Then it holds that

$$\begin{aligned} \lim _{r \rightarrow 0} m_f^s(B(x,r)) = f(x) \end{aligned}$$

for \(\mu \)-almost every \(x \in X\).

We give a definition for the median-type BMO which coincides with the classical BMO [26, 35, 36].

Definition 2.8

We say that a measurable function f belongs to BMO\(_{0,s}(X)\) if

$$\begin{aligned} \Vert f\Vert _{\text {BMO}_{0,s}(X)} = \sup _{B \subset X} \inf _{c} m_{|f-c|}^s(B) < \infty . \end{aligned}$$

3 Definition and Properties of \(JN_{p,0,s}\)

In this section, we give a definition of the median-type John–Nirenberg space in metric measure spaces. Moreover, we examine the basic properties of the space.

Definition 3.1

Let \(\Omega \subset X\) be an open set, \(1<p<\infty \) and \(0<s \le 1/2\). We say that a measurable function f belongs to the median-type John–Nirenberg space \(JN_{p,0,s}(\Omega )\) if

$$\begin{aligned} \Vert f\Vert _{JN_{p,0,s}(\Omega )}^p = \sup \sum _{i=1}^{\infty } \mu (B_i) \left( \inf _{c_i \in \mathbb {R}} m_{|f-c_i|}^s (B_i) \right) ^p < \infty , \end{aligned}$$

where the supremum is taken over all countable collections of pairwise disjoint balls \(B_i \subset \Omega \).

The zero in the notation \(JN_{p,0,s}\) means that we do not need to assume any local integrability but only measurability. The range \(0<s \le 1/2\) is necessary since \(\Vert f\Vert _{JN_{p,0,s}} = 0\) for \(s>1/2\) and a two-valued function f.

The next lemma shows that the constants \(c_i\) in the definition of \(JN_{p,0,s}\) can be replaced by the maximal t-medians where \(s\le t \le \tfrac{1}{2}\).

Lemma 3.2

Let f be a measurable function. It holds that

$$\begin{aligned} \Vert f\Vert _{JN_{p,0,s}(\Omega )}^p \le \sup \sum _{i=1}^{\infty } \mu (B_i) \left( m_{|f-m_f^t(B_i)|}^s (B_i) \right) ^p \le 2^p \Vert f\Vert _{JN_{p,0,s}(\Omega )}^p , \end{aligned}$$

whenever \(0<s\le t \le 1/2\).

Proof

It is clear that the first inequality holds. The other inequality follows from

$$\begin{aligned} m_{|f-m_{f}^t(B_i)|}^s(B_i)&\le m_{|f-c_i| + |m_{f}^t(B_i)-c_i|}^s(B_i) \\&= m_{|f-c_i|}^s(B_i) + |m_{f}^t(B_i)-c_i| \\&= m_{|f-c_i|}^s(B_i) + |m_{f-c_i}^t(B_i)| \\&\le m_{|f-c_i|}^s(B_i) + m_{|f-c_i|}^t(B_i) \\&\le 2 m_{|f-c_i|}^s(B_i). \end{aligned}$$

By taking the infimum over the constants \(c_i\), we observe that

$$\begin{aligned} m_{|f-m_{f}^t(B_i)|}^s(B_i) \le 2 \inf _{c_i} m_{|f-c_i|}^s(B_i) . \end{aligned}$$

Therefore, the second inequality is attained as well. \(\square \)

Next, we list some basic properties of \(JN_{p,0,s}\) spaces.

Lemma 3.3

Let f and g be measurable functions. Then the following properties hold true:

  1. (i)

    \(\Vert f+g\Vert _{JN_{p,0,s}} \le \ \Vert f\Vert _{JN_{p,0,t_1}} + \Vert g\Vert _{JN_{p,0,t_2}}\) whenever \(t_1 + t_2 \le s\).

  2. (ii)

    \(\Vert |f|\Vert _{JN_{p,0,s}} \le \Vert f\Vert _{JN_{p,0,s}}\).

  3. (iii)

    If \(2t_1 + 2t_2 \le s\), then

    $$\begin{aligned} \Vert \max \{f,g\}\Vert _{JN_{p,0,s}}&\le \Vert f\Vert _{JN_{p,0,t_1}} + \Vert g\Vert _{JN_{p,0,t_2}} , \\ \Vert \min \{f,g\}\Vert _{JN_{p,0,s}}&\le \Vert f\Vert _{JN_{p,0,t_1}} + \Vert g\Vert _{JN_{p,0,t_2}} . \end{aligned}$$

Proof

(i) Using property (viii) of Lemma 2.6 and Minkowski’s inequality, we estimate

$$\begin{aligned}&\left[ \sum _{i=1}^{\infty } \mu (B_i) \left( \inf _{c_i} m_{|f+g-c_i|}^s (B_i) \right) ^p \right] ^\frac{1}{p} \\&\le \left[ \sum _{i=1}^{\infty } \mu (B_i) \left( m_{|f+g - c_i^f - c_i^g|}^s (B_i) \right) ^p \right] ^\frac{1}{p} \\&\le \left[ \sum _{i=1}^{\infty } \mu (B_i) \left( m_{|f- c_i^f|}^{t_1} (B_i) + m_{|g - c_i^g|}^{t_2} (B_i) \right) ^p \right] ^\frac{1}{p} \\&= \left[ \int _{\Omega } \left( \sum _{i=1}^{\infty } \chi _{ B_i}(x) \, m_{|f- c_i^f|}^{t_1} (B_i) + \sum _{i=1}^{\infty } \chi _{ B_i}(x) \, m_{|g - c_i^g|}^{t_2} (B_i) \right) ^p \, d \mu (x) \right] ^\frac{1}{p} \\&\le \left[ \int _{\Omega } \left( \sum _{i=1}^{\infty } \chi _{ B_i}(x) \, m_{|f- c_i^f|}^{t_1} (B_i) \right) ^p \, d \mu (x) \right] ^\frac{1}{p} + \left[ \int _{\Omega } \left( \sum _{i=1}^{\infty } \chi _{B_i}(x) \, m_{|g - c_i^g|}^{t_2} (B_i) \right) ^p \, d \mu (x) \right] ^\frac{1}{p} \\&= \left[ \sum _{i=1}^{\infty } \mu (B_i) \left( m_{|f- c_i^f|}^{t_1} (B_i) \right) ^p \right] ^\frac{1}{p} + \left[ \sum _{i=1}^{\infty } \mu (B_i) \left( m_{|g - c_i^g|}^{t_2} (B_i) \right) ^p \right] ^\frac{1}{p} \end{aligned}$$

for any \(c_i^f, c_i^g \in \mathbb {R}\). Thus, we can take the infimum over the constants \(c_i^f\) and \(c_i^g\) to get

$$\begin{aligned} \Vert f+g\Vert _{JN_{p,0,s}} \le \ \Vert f\Vert _{JN_{p,0,t_1}} + \Vert g\Vert _{JN_{p,0,t_2}} , \end{aligned}$$

where \(t_1 + t_2 \le s\).

(ii) The triangle inequality together with Lemma 2.6 (ii) implies

$$\begin{aligned} \sum _{i=1}^{\infty } \mu (B_i) \left( \inf _{c_i} m_{||f|-c_i|}^s (B_i) \right) ^p&\le \sum _{i=1}^{\infty } \mu (B_i) \left( \inf _{c_i} m_{||f|-|c_i||}^s (B_i) \right) ^p \\&\le \sum _{i=1}^{\infty } \mu (B_i) \left( \inf _{c_i} m_{|f-c_i|}^s (B_i) \right) ^p . \end{aligned}$$

Therefore, we obtain the claim

$$\begin{aligned} \Vert |f|\Vert _{JN_{p,0,s}} \le \Vert f\Vert _{JN_{p,0,s}} . \end{aligned}$$

(iii) Note that \(\max \{f,g\} = \tfrac{1}{2}(f+g+|f-g|)\) and \(\min \{f,g\} = \tfrac{1}{2}(f+g-|f-g|)\). Then using (i) and (ii), we get

$$\begin{aligned} \Vert \max \{f,g\}\Vert _{JN_{p,0,s}}&\le \frac{1}{2} \left( \Vert f+g\Vert _{JN_{p,0,t_1 + t_2}} + \Vert |f-g|\Vert _{JN_{p,0,t_1 + t_2}} \right) \\&\le \frac{1}{2} \left( \Vert f\Vert _{JN_{p,0,t_1}} + \Vert g\Vert _{JN_{p,0,t_2}} + \Vert f-g\Vert _{JN_{p,0,t_1 + t_2}} \right) \\&\le \frac{1}{2} \left( \Vert f\Vert _{JN_{p,0,t_1}} + \Vert g\Vert _{JN_{p,0,t_2}} + \Vert f\Vert _{JN_{p,0,t_1}} + \Vert g\Vert _{JN_{p,0,t_2}} \right) \\&= \Vert f\Vert _{JN_{p,0,t_1}} + \Vert g\Vert _{JN_{p,0,t_2}} , \end{aligned}$$

where \(2t_1 + 2t_2 \le s\). The claim for \(\min \{f,g\}\) follows similarly. \(\square \)

The next proposition tells that the space \(L^p\) is contained in \(JN_{p,q}\) which in turn is a subset of \(JN_{p,0,s}\). The first inclusion is strict in the Euclidean setting, that is, there exists a function in \(JN_p \setminus L^p\) [8]. The second one holds in the other direction in many situations; see Corollary 5.4.

Proposition 3.4

Let \(1< p< \infty \), \(0< q < p\) and \(0 < s \le 1/2\). It holds that \(L^p(\Omega ) \subset JN_{p,q}(\Omega ) \subset JN_{p,0,s}(\Omega )\), particularly

$$\begin{aligned} s^\frac{1}{q} \Vert f\Vert _{JN_{p,0,s}(\Omega )} \le \Vert f\Vert _{JN_{p,q}(\Omega )} \le \Vert f\Vert _{L^p(\Omega )} . \end{aligned}$$

Proof

The first inequality follows straightforwardly from property (ix) of Lemma 2.6. The second one is obtained by a simple use of Hölder’s inequality:

By taking the supremum over all collections of pairwise disjoint balls \(B_i \subset \Omega \), we get

$$\begin{aligned} \Vert f\Vert _{JN_{p,q}(\Omega )} \le \Vert f\Vert _{L^p(\Omega )} . \end{aligned}$$

\(\square \)

Remark

If \(f \in \text {BMO}_{0,s}(\Omega )\) with \(\mu (\Omega ) < \infty \), then it holds that \(f \in JN_{p,0,s}(\Omega )\). More precisely, we have

$$\begin{aligned} \Vert f\Vert _{JN_{p,0,s}(\Omega )} \le \mu (\Omega )^\frac{1}{p} \Vert f\Vert _{\text {BMO}_{0,s}(\Omega )} . \end{aligned}$$

The previous inequality follows from the estimates

$$\begin{aligned} \sum _{i=1}^{\infty } \mu (B_i) \left( \inf _{c_i} m_{|f-c_i|}^s (B_i) \right) ^p \le \sum _{i=1}^\infty \mu \left( B_i\right) \Vert f\Vert _{\text {BMO}_{0,s}}^p \le \mu (\Omega ) \Vert f\Vert _{\text {BMO}_{0,s}}^p . \end{aligned}$$

The median-type John–Nirenberg space \(JN_{p,0,s}\) is a generalization of BMO in the sense that a function is in BMO if and only if the \(JN_{p,0,s}\) norm of the function is uniformly bounded as p tends to infinity.

Proposition 3.5

If \(\Omega \subset X\) has finite measure, then it holds that

$$\begin{aligned} \lim _{p \rightarrow \infty } \Vert f\Vert _{JN_{p,0,s}(\Omega )} = \Vert f\Vert _{\text { BMO}_{0,s}(\Omega )} . \end{aligned}$$

Proof

Let \(\{ B_i \}_i\) be a collection of pairwise disjoint balls contained in \(\Omega \). Remind that if \(\mu (A) < \infty \), then \(\Vert g\Vert _{L^p(A)} \rightarrow \Vert g\Vert _{L^\infty (A)}\) as \(p \rightarrow \infty \). By using this, it follows that

$$\begin{aligned} \left( \sum _{i=1}^{\infty } \mu \left( B_i\right) \left( \inf _{c_i} m_{|f-c_i|}^s (B_i) \right) ^p \right) ^{\frac{1}{p}}&= \left( \int _{\Omega } \left( \sum _{i=1}^{\infty } \chi _{ B_i}(x) \inf _{c_i} m_{|f-c_i|}^s (B_i) \right) ^p \, d \mu (x) \right) ^{\frac{1}{p}} \\&\rightarrow \sup _{x \in \Omega } \sum _{i=1}^{\infty } \chi _{ B_i}(x) \inf _{c_i} m_{|f-c_i|}^s (B_i) \\&= \sup _{i} \inf _{c_i} m_{|f-c_i|}^s (B_i) \end{aligned}$$

as \(p \rightarrow \infty \). Hence, we have

$$\begin{aligned} \sup _{\{ B_i \}} \lim _{p \rightarrow \infty } \left( \sum _{i=1}^{\infty } \mu \left( B_i\right) \left( \inf _{c_i} m_{|f-c_i|}^s (B_i) \right) ^p \right) ^{\frac{1}{p}}&= \sup _{\{ B_i \}} \sup _{i} \inf _{c_i} m_{|f-c_i|}^s (B_i) \\&= \sup _{B \subset \Omega } \inf _{c} m_{|f-c|}^s (B) \\&= \Vert f\Vert _{\text {BMO}_{0,s}} . \end{aligned}$$

We can interchange the order of taking the supremum and the limit since

$$\begin{aligned} \left( \int _{\Omega } \left( \sum _{j=1}^{\infty } \chi _{ B_j}(x) \inf _{c_j} m_{|f-c_j|}^s (B_j) \right) ^p \, d \mu (x) \right) ^{\frac{1}{p}} \end{aligned}$$

is an increasing function of p which can be seen by Hölder’s inequality. Thus, we conclude that

$$\begin{aligned} \lim _{p \rightarrow \infty } \Vert f\Vert _{JN_{p,0,s}} = \Vert f\Vert _{\text {BMO}_{0,s}} . \end{aligned}$$

\(\square \)

4 John–Nirenberg Lemma for \(JN_{p,0,s}\)

We need two lemmas to prove the John–Nirenberg inequality for \(JN_{p,0,s}\) which implies that \(JN_{p,0,s}\) is contained in \(L^{p,\infty }\), that is, weak \(L^p\). The first lemma is a Calderón–Zygmund decomposition and the second one is a good-\(\lambda \) inequality.

Throughout the argument let \(\eta > 0\) and \(B_0 = B(x_{B_0},r_{B_0}) \subset X\) be fixed. We denote \(\widehat{B}_0 = (1+\eta ) B_0\),

$$\begin{aligned} \mathcal {B} = \{B(x_B,r_B) : x_B \in B_0, r_B \le \eta r_{B_0} \} \end{aligned}$$

and

$$\begin{aligned} \alpha = 5^D c_\mu ^2 \left( 1 + \frac{1}{\eta } \right) ^D , \end{aligned}$$
(4.1)

where \(c_\mu \) is the doubling constant and \(D = \log _2 c_\mu \) is the doubling dimension. We define a maximal function

$$\begin{aligned} M_{\mathcal {B}}f(x) = \sup _{\begin{array}{c} B \ni x \\ B \in \mathcal {B} \end{array}} m_{|f|}^{t}(B) \end{aligned}$$

with the understanding that \(M_\mathcal {B} f(x) = 0\) if there is no ball \(B \in \mathcal {B}\) such that \(x \in B\). In particular, \(M_\mathcal {B} f(x) = 0\) for every \(x \in X \setminus \widehat{B}_0\). By the Lebesgue differentiation theorem for medians (Lemma 2.7), we have \(|f(x)| \le M_{\mathcal {B}}f(x)\) for \(\mu \)-almost every \(x \in B_0\). Moreover, denote

$$\begin{aligned} E_\lambda = E_\lambda ^f = \{ x \in \widehat{B}_0 : M_{\mathcal {B}}f(x) > \lambda \} . \end{aligned}$$

Lemma 4.1

If \(B \in \mathcal {B}\) such that \(m_{f}^{t}(B) > m_{f}^{t/\alpha }(\widehat{B}_0)\), then it holds that \( r_B \le \frac{\eta }{5} r_{B_0}\).

Proof

By the assumption, we have

$$\begin{aligned} t \mu (B) \le \mu \{ x \in B: f \ge m_{f}^{t}(B) \} \le \mu \{ x \in \widehat{B}_0: f > m_{f}^{t/ \alpha }(\widehat{B}_0) \} \le \frac{t}{\alpha } \mu (\widehat{B}_0) . \end{aligned}$$

Therefore, it holds that

$$\begin{aligned} \alpha \le \frac{\mu (\widehat{B}_0)}{\mu (B)} \le c_\mu ^2 \left( \frac{r_{\widehat{B}_0}}{r_B} \right) ^D = c_\mu ^2 (1+\eta )^D \left( \frac{r_{B_0}}{r_B} \right) ^D , \end{aligned}$$

which implies \( r_B \le \frac{\eta }{5} r_{B_0} \) by recalling (4.1).

The following lemma is a Calderón–Zygmund decomposition for medians in metric measure spaces with a doubling measure.

Lemma 4.2

Let \(f\ge 0\) be a measurable function defined on \(\widehat{B}_0\). Assume that \(E_\lambda \ne \emptyset \) and

$$\begin{aligned} m_{f}^{t/\alpha }(\widehat{B}_0) \le \lambda \end{aligned}$$

holds for some \(0<t\le 1\), where \(\alpha \) is given in (4.1). Then there exist countably many pairwise disjoint balls \(B_i \in \mathcal {B} \) such that

  1. (i)

    \( \bigcup _i B_i \subset E_\lambda \subset \bigcup _i 5B_i \),

  2. (ii)

    \(r_{B_i} \le \frac{\eta }{5} r_{B_0}\),

  3. (iii)

    \( m_{f}^{t}(B_i) > \lambda \),

  4. (iv)

    \(m_{f}^{t}(\sigma B_i) \le \lambda \) whenever \( \sigma \ge 2\) and \(\sigma B_i \in \mathcal {B}\).

The collection of balls \(\{B_i\}_i\) is called the Calderón–Zygmund balls \(B_{i,\lambda }\) at level \(\lambda \). Furthermore, if \(m_{f}^{t/\alpha }(\widehat{B}_0) \le \lambda ' \le \lambda \), then it is possible to choose Calderón–Zygmund balls \( B_{j,\lambda '} \) at level \(\lambda '\) in a manner that for each \(B_{i,\lambda }\) we can find \(B_{j, \lambda '}\) such that \( B_{i,\lambda } \subset 5 B_{j,\lambda '} . \)

Proof

For every \(x \in E_\lambda \), denote

$$\begin{aligned} r_x(\lambda ) = \sup \{ r_B : B \in \mathcal {B}, x \in B, m_{f}^{t}(B) > \lambda \} . \end{aligned}$$

By the assumption, the set over which the supremum is taken is non-empty. Moreover, Lemma 4.1 implies that \(r_x(\lambda ) \le \frac{\eta }{5} r_{B_0}\). For every \(x \in E_\lambda \), we can find a ball \(B_{x, \lambda } \in \mathcal {B}\) with \(x \in B_{x, \lambda }\) such that

$$\begin{aligned} \frac{r_x(\lambda )}{2} < r_{B_{x, \lambda }} \le r_x(\lambda ) \quad \text {and} \quad m_{f}^{t}(B_{x, \lambda }) > \lambda . \end{aligned}$$

We then have \(m_{f}^{t}(\sigma B_{x, \lambda }) \le \lambda \) whenever \( \sigma \ge 2\) and \(\sigma B_{x, \lambda } \in \mathcal {B}\). By applying the 5-covering theorem, we obtain a countable collection of pairwise disjoint balls \(\{B_i\}_i\) such that

$$\begin{aligned} \bigcup _i B_i \subset E_\lambda \subset \bigcup _i 5B_i. \end{aligned}$$

Hence, the obtained balls \(B_i\) are the Calderón–Zygmund balls at level \(\lambda \) and we denote them by \(B_{i,\lambda }\).

We have constructed the Calderón–Zygmund decomposition at level \(\lambda \) and now focus on \(\lambda '\). Note that \(E_{\lambda } \subset E_{\lambda '}\) and \(r_x(\lambda ) \le r_x(\lambda ')\) for every \(x \in E_{\lambda }\). Thus, for every \(x \in E_{\lambda }\), we can choose a ball \(B_{x, \lambda '} \in \mathcal {B}\) with \(x \in B_{x, \lambda '}\) such that \(B_{x, \lambda } \subset B_{x, \lambda '}\),

$$\begin{aligned} \frac{r_x(\lambda ')}{2} < r_{B_{x, \lambda '}} \le r_x(\lambda ') \quad \text {and} \quad m_{f}^{t}(B_{x, \lambda '}) > \lambda ' . \end{aligned}$$

Whereas, for every \(x \in E_{\lambda '} \setminus E_{\lambda }\), we choose the ball \(B_{x, \lambda '}\) in the similar way expect we do not have \(B_{x, \lambda } \subset B_{x, \lambda '}\).

We then apply the 5-covering theorem to the balls \(B_{x, \lambda '}\) to obtain the Calderón–Zygmund balls \(B_{j,\lambda '}\) at level \(\lambda '\). Moreover, the 5-covering theorem states that for every ball \(B_{x, \lambda '}\) there is an enlarged ball \(5 B_{j,\lambda '}\) such that \( B_{x, \lambda '} \subset 5 B_{j,\lambda '} . \) Since \(B_{x, \lambda } \subset B_{x, \lambda '}\) for every \(x \in E_{\lambda }\), it holds that for each \(B_{i, \lambda }\) there is \(B_{j, \lambda '}\) such that \( B_{i, \lambda } \subset 5 B_{j,\lambda '} . \) \(\square \)

We move on to a good-\(\lambda \) inequality which is crucial for the proof of the John–Nirenberg inequality. In the proof of the good-\(\lambda \) type inequality for the integral-type \(JN_p\) in [1], all Calderón–Zygmund balls can be treated in the same way. However, in the case of medians, we need to divide Calderón–Zygmund balls into two collections which must be considered separately. This is due to the fact that medians lack the monotonicity on sets that integrals have.

Lemma 4.3

Let \(0< t \le 1/2\), \(K > 1\) and \(f \in JN_{p,0,s}(\widehat{B}_0)\) for some \(0<s \le \frac{t}{2K^p c_\mu ^3}\). Assume that \(E_{K\lambda } \ne \emptyset \) and

$$\begin{aligned} m_{|f|}^{t/\alpha }(\widehat{B}_0) \le \lambda , \end{aligned}$$

where \(\alpha \) is given in (4.1). Consider collections of Calderón–Zygmund balls \(\{B_{i,\lambda }\}_i\) and \(\{B_{j,K\lambda }\}_j\) for the function |f| such that each \(B_{j,K\lambda }\) is contained in some \(5B_{i,\lambda }\). Then it follows that

$$\begin{aligned} \sum _{j=1}^\infty \mu (B_{j,K\lambda }) \le \frac{2^p c_\mu ^3}{(K-1)^p} \frac{\Vert f\Vert _{JN_{p,0,s}(\widehat{B}_0)}^p}{\lambda ^p} + \frac{1}{2K^p} \sum _{i=1}^\infty \mu (B_{i,\lambda }) . \end{aligned}$$

Proof

Denote

$$\begin{aligned} J_i = \left\{ j \in \mathbb {N}: B_{j,K\lambda } \subset 5B_{i,\lambda }, j \notin \bigcup _{k=1}^{i-1} J_k \right\} \end{aligned}$$

for every \(i \in \mathbb {N}\), and

$$\begin{aligned} I = \big \{ i\in \mathbb {N}: \mu (B_{i,\lambda }) \le 2 K^{p} \mu \big ( \bigcup _{j \in J_i} B_{j,K \lambda }\big ) \big \} . \end{aligned}$$

Particularly, the set \(J_i\) contains those indexes \(j \notin \bigcup _{k=1}^{i-1} J_k\) for which \(B_{j,K\lambda }\) is contained in \(5B_{i,\lambda }\). Since every \(B_{j,K\lambda }\) is contained in some \(5B_{i,\lambda }\), we get the partition

$$\begin{aligned} \bigcup _{j=1}^\infty B_{j,K\lambda } = \bigcup _{i=1}^\infty \bigcup _{j \in J_i} B_{j,K\lambda } . \end{aligned}$$

Using properties (ii), (v), (vii) of Lemma 2.6 and (iii), (iv) of Lemma 4.2 in this order, we obtain

$$\begin{aligned} m_{|f-m_{f}^{t}(5B_{i,\lambda })| }^{t}(B_{j,K\lambda })&\ge m_{|f| - |m_{f}^{t}(5B_{i,\lambda })| }^{t}(B_{j,K\lambda }) \\&= m_{|f| }^{t}(B_{j,K\lambda }) - |m_{f}^{t}(5B_{i,\lambda })| \\&\ge m_{|f| }^{t}(B_{j,K\lambda }) - m_{|f|}^{t}(5B_{i,\lambda }) \\&\ge K\lambda - \lambda = (K-1)\lambda . \end{aligned}$$

Since \(B_{j,K\lambda }\) are pairwise disjoint, property (x) of Lemma 2.6 implies that

$$\begin{aligned} m_{|f-m_{f}^{t}(5B_{i,\lambda })| }^{t}\big (\bigcup _{j \in J_i} B_{j,K\lambda }\big ) \ge (K-1)\lambda \end{aligned}$$

for every \(i \in \mathbb {N}\). For \(i \in I\), it holds that

$$\begin{aligned} \mu (5B_{i,\lambda }) \le c_\mu ^3 \mu (B_{i,\lambda }) \le 2 K^p c_\mu ^3 \mu \big ( \bigcup _{j \in J_i} B_{j,K\lambda }\big ) . \end{aligned}$$

Hence, by property (iii) of Lemma 2.6, we have

$$\begin{aligned} (K-1)\lambda \le m_{|f-m_{f}^{t}(5B_{i,\lambda })| }^{t}\big (\bigcup _{j \in J_i} B_{j,K\lambda }\big ) \le m_{|f-m_{f}^{t}(5B_{i,\lambda })| }^{t/\beta }(5B_{i,\lambda }) \end{aligned}$$

for every \(i \in I\), where \(\beta = 2 K^p c_\mu ^3\).

Denote

$$\begin{aligned} M_\mathcal {B}^\# f(x) = \sup _{\begin{array}{c} B \ni x \\ B \in \mathcal {B} \end{array}} m_{|f-m_{f}^{t}(B)| }^{t/\beta }(B) . \end{aligned}$$

Then for \(i \in I\), we have \(M_\mathcal {B}^\# f(x) \ge m_{|f-m_{f}^{t}(5B_{i,\lambda })| }^{t/\beta }(5B_{i,\lambda }) > (K-1)\lambda \) for every \(x \in 5B_{i,\lambda }\). Thus, we get

$$\begin{aligned} \mu \Big (\bigcup _{i\in I} \bigcup _{j \in J_i} B_{j,K\lambda }\Big ) \le \mu \Big (\bigcup _{i\in I} 5B_{i,\lambda }\Big ) \le \mu (\{ x \in \widehat{B}_0 : M_\mathcal {B}^\# f(x) > (K-1)\lambda \}) . \end{aligned}$$

For every \(x \in \{ x \in \widehat{B}_0 : M_\mathcal {B}^\# f(x) > (K-1)\lambda \}\), there exists \(B_x \in \mathcal {B}\) such that \(x \in B_x\) and \(m_{|f-m_{f}^{t}(B_x)| }^{t/\beta }(B_x) > (K-1)\lambda \). Applying the 5-covering theorem, we get a countable collection of pairwise disjoint balls \(B_k\) such that

$$\begin{aligned} \{ x \in \widehat{B}_0 : M_\mathcal {B}^\# f(x) > (K-1)\lambda \} \subset \bigcup _{k=1}^\infty 5 B_k . \end{aligned}$$

We then have

$$\begin{aligned} \mu (\{ x \in \widehat{B}_0 : M_\mathcal {B}^\# f(x) > (&K-1)\lambda \}) \le \sum _{k=1}^\infty \mu (5 B_k) \le c_\mu ^3 \sum _{k=1}^\infty \mu ( B_k) \\&\le c_\mu ^3 \frac{1}{(K-1)^p \lambda ^p} \sum _{k=1}^\infty \mu ( B_k) \left( m_{|f-m_{f}^{t}(B_k)| }^{t/\beta }(B_k) \right) ^p \\&\le \frac{2^p c_\mu ^3}{(K-1)^p} \frac{\Vert f\Vert _{JN_{p,0,s}(\widehat{B}_0)}^p}{\lambda ^p} , \end{aligned}$$

whenever \(s \le \frac{t}{\beta } = \frac{t}{2K^p c_\mu ^3}\).

On the other hand, for \(i \notin I\) we have

$$\begin{aligned} \sum _{j \in J_i} \mu (B_{j,K\lambda }) \le \frac{1}{2K^p} \mu (B_{i,\lambda }), \end{aligned}$$

and thus summing over \(i \notin I\) we get

$$\begin{aligned} \sum _{i\notin I} \sum _{j \in J_i} \mu (B_{j,K\lambda }) \le \frac{1}{2K^p} \sum _{i\notin I} \mu (B_{i,\lambda }) . \end{aligned}$$

By combining the cases \(i\in I\) and \(i \notin I\), we conclude that

$$\begin{aligned} \sum _{j=1}^\infty \mu (B_{j,K\lambda })&= \sum _{i\in I} \sum _{j \in J_i} \mu (B_{j,K\lambda }) + \sum _{i\notin I} \sum _{j \in J_i} \mu (B_{j,K\lambda }) \\&\le \frac{2^p c_\mu ^3}{(K-1)^p} \frac{\Vert f\Vert _{JN_{p,0,s}(\widehat{B}_0)}^p}{\lambda ^p} + \frac{1}{2K^p} \sum _{i=1}^\infty \mu (B_{i,\lambda }) . \end{aligned}$$

\(\square \)

We now state our main result which is the John–Nirenberg inequality for \(JN_{p,0,s}\). It implies that \(JN_{p,0,s}(\widehat{B})\) is contained in \(L^{p,\infty }(B)\) for all balls \(B \subset X\).

Theorem 4.4

Let \(0 < s \le s_0 = \min \{\tfrac{1}{2\alpha }, \tfrac{1}{8 c_\mu ^3}\} \) and \(s \le r \le \frac{1}{2}\), where \(\alpha \) is given in (4.1). If \(f \in JN_{p,0,s}(\widehat{B}_0)\), then for every \(\lambda > 0\) it holds that

$$\begin{aligned} \mu (\{ x \in B_0: |f(x)-m_f^{r}(B_0)| > \lambda \}) \le c \frac{\Vert f\Vert _{JN_{p,0,s}(\widehat{B}_0)}^p}{\lambda ^p} , \end{aligned}$$

where the constant c depends on p and the doubling constant \(c_\mu \), that is,

$$\begin{aligned} c = \frac{2^{p+3} c_\mu ^6}{(2^\frac{1}{p} -1)^p} . \end{aligned}$$

Proof

Let \(t = \frac{1}{2}\). We can assume that \(E_\lambda = E_\lambda ^{|f-m_f^{r}(B_0)|} \ne \emptyset \), since otherwise the claim is clear. In addition, we can assume that \(\lambda > \lambda _0 = m_{|f-m_f^{r}(B_0)|}^{t/\alpha }(\widehat{B}_0)\), since otherwise if \(0 < \lambda \le \lambda _0\), then by the trivial estimate and Lemma 3.2 we have

$$\begin{aligned} \mu (\{ x \in B_0: |f(x)-m_f^{r}(B_0)| > \lambda \})&\le \mu (\widehat{B}_0) \frac{\left( m_{|f-m_f^{r}(B_0)|}^{t/\alpha }(\widehat{B}_0) \right) ^p}{\lambda ^p} \\&\le 2^p \frac{\Vert f\Vert _{JN_{p,0,s}}^p}{\lambda ^p} , \end{aligned}$$

whenever \(s \le \frac{t}{\alpha } = \frac{1}{2\alpha }\) and \(s \le r \le \frac{1}{2}\). Thus, the conditions in Lemma 4.2 and Lemma 4.3 hold for the function \(|f-m_f^{r}(B_0)|\).

Let \(K = 2^{1/p}\) and \(N \in \mathbb {N}\) such that

$$\begin{aligned} K^N \lambda _0 < \lambda \le K^{N+1} \lambda _0 . \end{aligned}$$

Consider \(N+1\) families of Calderón–Zygmund balls at levels \(\lambda _0, K \lambda _0, \dots , K^N \lambda _0\). Note that for every \(n=0,1,\dots ,N-1,\) each \(B_{i,K^{n+1}\lambda }\) is contained in some \(5B_{j,K^n\lambda }\). It follows that

$$\begin{aligned} \mu (\{ x \in B_0: |f(x)-m_f^{r}(B_0)|> \lambda \})&\le \mu (\{ x \in B_0: |f(x)-m_f^{r}(B_0)| > K^N \lambda _0 \}) \\&\le \sum _{j=1}^\infty \mu (5B_{j,K^N \lambda _0}) \le c_\mu ^3 \sum _{j=1}^\infty \mu (B_{j,K^N \lambda _0}) . \end{aligned}$$

We claim that

$$\begin{aligned} \sum _{i=1}^\infty \mu (B_{i,K^n \lambda _0}) \le c_1 \frac{\Vert f\Vert _{JN_{p,0,s}}^p}{(K^n \lambda _0)^p} \end{aligned}$$

for every \(n=0,1,\dots ,N\), where

$$\begin{aligned} c_1 = \frac{2^{p+1} c_\mu ^3 K^p}{(K-1)^p} . \end{aligned}$$

We prove the claim by induction. First, note that the claim holds for \(n=0\) since

$$\begin{aligned} \sum _{i=1}^\infty \mu (B_{i, \lambda _0}) \le \mu (\widehat{B}_0) = \mu (\widehat{B}_0) \frac{ \left( m_{|f-m_f^{r}(B_0)|}^{t/\alpha }(\widehat{B}_0) \right) ^p}{\lambda _0^p} \le 2^p \frac{ \Vert f\Vert _{JN_{p,0,s}}^p}{\lambda _0^p}. \end{aligned}$$

Assume then that the claim holds for \(k \in \{0,1,\dots ,N-1\}\), that is,

$$\begin{aligned} \sum _{i=1}^\infty \mu (B_{i,K^k\lambda _0}) \le c_1 \frac{\Vert f\Vert _{JN_{p,0,s}}^p}{(K^{k} \lambda _0)^p} . \end{aligned}$$

We show that this implies the claim for \(k+1\). By using Lemma 4.3 for \(K^k \lambda _0\), we observe that

$$\begin{aligned} \sum _{j=1}^\infty \mu (B_{j,K^{k+1}\lambda _0})&\le \frac{2^p c_\mu ^3}{(K-1)^p} \frac{\Vert f\Vert _{JN_{p,0,s}}^p}{(K^k\lambda _0)^p} + \frac{1}{2K^p} \sum _{i=1}^\infty \mu (B_{i,K^k \lambda _0}) \\&\le \frac{2^p c_\mu ^3}{(K-1)^p} \frac{\Vert f\Vert _{JN_{p,0,s}}^p}{(K^k\lambda _0)^p} + \frac{c_1}{2K^p} \frac{\Vert f\Vert _{JN_{p,0,s}}^p}{(K^{k} \lambda _0)^p} \\&= \bigg ( \frac{2^p c_\mu ^3 K^p}{(K-1)^p} + \frac{c_1}{2} \bigg ) \frac{\Vert f\Vert _{JN_{p,0,s}}^p}{(K^{k+1} \lambda _0)^p} \\&= c_1 \frac{\Vert f\Vert _{JN_{p,0,s}}^p}{(K^{k+1} \lambda _0)^p} . \end{aligned}$$

Therefore, the claim holds for \(k+1\).

Hence, we conclude that

$$\begin{aligned} \mu (\{ x \in B_0: |f(x)-m_f^{r}(B_0)| > \lambda \})&\le c_\mu ^3 c_1 \frac{\Vert f\Vert _{JN_{p,0,s}}^p}{(K^N \lambda _0)^p} \\&= c_\mu ^3 c_1 K^p \frac{\Vert f\Vert _{JN_{p,0,s}}^p}{(K^{N+1}\lambda _0)^p} \\&\le c \frac{\Vert f\Vert _{JN_{p,0,s}}^p}{\lambda ^p} , \end{aligned}$$

where

$$\begin{aligned} c = c_\mu ^3 c_1 K^p = \frac{2^{p+1} c_\mu ^6 K^{2p}}{(K-1)^p} = \frac{2^{p+3} c_\mu ^6}{(2^\frac{1}{p} -1)^p} , \end{aligned}$$

since \(K = 2^{1/p}\). \(\square \)

5 Global John–Nirenberg Inequality for \(JN_{p,0,s}\) in Boman Sets

We give a proof for the global John–Nirenberg inequality for \(JN_{p,0,s}\) in Boman sets. For more detailed discussion about Boman sets, see [32] and references therein.

Definition 5.1

A set \(\Delta \subset X\) is called Boman if there are constants \(C_2> C_1 > 1\), \(C_3 > 1\), \(\rho >1\) and \(M \in \mathbb {N}\) and a collection of pairwise disjoint balls \(\mathcal {F}\) such that

  1. (i)

    \(\Delta = \bigcup _{B \in \mathcal {F}} C_1 B = \bigcup _{B \in \mathcal {F}} C_2 B\).

  2. (ii)

    If \(B \in \mathcal {F}\), there are at most M balls \(V \in \mathcal {F}\) with \(C_2 V \cap C_2 B \ne \emptyset \).

  3. (iii)

    There is a central ball \(B_*\in \mathcal {F}\) such that for each \(B \in \mathcal {F}\) there exists a finite collection of balls \(\mathcal {C}(B) = \{B_i\}_{i=1}^{k_B} \subset \mathcal {F}\) with \(B_1 = B_*\) and \(B_{k_B} = B\).

  4. (iv)

    In \(\mathcal {C}(B)\), for each pair of balls \(B_i\) and \(B_{i-1}\) corresponding to consecutive indices there exists a ball \(D_i \subset C_1 B_i \cap C_1 B_{i-1}\) such that \(\mu (D_i) \ge C_3 (\mu (B_i) + \mu (B_{i-1}) )\).

  5. (v)

    If \(V \in \mathcal {C}(B)\), then \(B \subset \rho V\).

Parameters \(C_1,C_2,C_3,\rho \) and M in the results below are the same as in Definition 5.1. The proof of the following lemma can be found in [32] for integral averages. The proof is identical for medians, and thus is omitted here.

Lemma 5.2

Let \(\Delta \subset X\) be a Boman set, \(1< p < \infty \) and \(0 < s \le 1/2\). Then

$$\begin{aligned} \sum _{B \in \mathcal {F}} \Vert m_f^{s}(C_1 B) - m_f^{s}(C_1 B_*) \Vert _{L^{p,\infty }(C_1 B)}^p \le C_0 \sum _{V \in \mathcal {F}} \Vert f - m_f^{s}(C_1 V) \Vert _{L^{p,\infty }(C_1 V)}^p , \end{aligned}$$

where the constant \(C_0\) depends on p, the doubling constant \(c_\mu \), \(C_1,C_2,C_3,\rho \) and M.

For the next theorem, the global John–Nirenberg lemma, we fix the parameter \(\eta \) from Sect. 4 such that \(1 + \eta = \frac{C_2}{C_1}\). The proof follows that of [32].

Theorem 5.3

Let \(\Delta \subset X\) be a Boman set and \(0 < s \le s_0\), where \(s_0\) is given in Theorem 4.4. If \(f \in JN_{p,0,s}(\Delta )\), then there exists \(a \in \mathbb {R}\) such that for every \(\lambda > 0\) it holds that

$$\begin{aligned} \mu (\{ x \in \Delta : |f(x)-a| > \lambda \}) \le C \frac{\Vert f\Vert _{JN_{p,0,s}(\Delta )}^p}{\lambda ^p} , \end{aligned}$$

where C depends on p, the doubling constant \(c_\mu \), \(C_1,C_2,C_3,\rho \) and M.

Proof

Let \(s \le r \le \frac{1}{2}\), \(\mathcal {F}\) be the collection of balls in the definition of the Boman set \(\Delta \) and \(B_*\) be the central ball. We have

$$\begin{aligned} \mu (\{ x \in \Delta : |f - m_f^{r}&(C_1 B_*)|> \lambda \}) \le \sum _{B \in \mathcal {F}} \mu (\{ x \in C_1 B: |f-m_f^{r}(C_1 B_*)|> \lambda \}) \\&\le \sum _{B \in \mathcal {F}} \mu (\{ x \in C_1 B: |f-m_f^{r}(C_1 B)|> \lambda /2 \}) \\&\qquad + \sum _{B \in \mathcal {F}} \mu (\{ x \in C_1 B: |m_f^{r}(C_1 B) - m_f^{r}(C_1 B_*)| > \lambda /2 \}) \\&= I_1 + I_2 . \end{aligned}$$

By applying Theorem 4.4, we get

$$\begin{aligned} I_1 \le 2^p c \sum _{B \in \mathcal {F}} \frac{\Vert f\Vert _{JN_{p,0,s}(C_2 B)}^p}{\lambda ^p} . \end{aligned}$$

To estimate the second term, we use the definition of weak \(L^p\) norm, Lemma 5.2 and Theorem 4.4 to obtain

$$\begin{aligned} \left( \frac{\lambda }{2} \right) ^p I_2&\le \sum _{B \in \mathcal {F}} \Vert m_f^{r}(C_1 B) - m_f^{r}(C_1 B_*) \Vert _{L^{p,\infty }(C_1 B)}^p \\&\le C_0 \sum _{B \in \mathcal {F}} \Vert f - m_f^{r}(C_1 B) \Vert _{L^{p,\infty }(C_1 B)}^p \\&= C_0 \sum _{B \in \mathcal {F}} \sup _{\gamma>0} \gamma ^p \mu (\{ x \in C_1 B: |f-m_f^{r}(C_1 B)| > \gamma \}) \\&\le C_0 \sum _{B \in \mathcal {F}} c \Vert f\Vert _{JN_{p,0,s}(C_2 B)}^p . \end{aligned}$$

Therefore, it holds that

$$\begin{aligned} I_1 + I_2 \le \frac{\widetilde{C}}{\lambda ^p} \sum _{B \in \mathcal {F}} \Vert f\Vert _{JN_{p,0,s}(C_2 B)}^p , \end{aligned}$$

where \(\widetilde{C} = 2^p c (C_0 + 1)\). By property (ii) of Lemma 5.1, the collection \(\{C_2 B\}_{B \in \mathcal {F}}\) consists of balls that intersect at most M balls of the same collection. Thus, it can be decomposed into at most M collections of pairwise disjoint balls \(\mathcal {D}_i, i=1,\dots , M\) such that \(\{C_2 B\}_{B \in \mathcal {F}} = \bigcup _{i=1}^M \mathcal {D}_i\). This implies that

$$\begin{aligned} \mu (\{ x \in \Delta : |f - m_f^{r}(C_1 B_*)| > \lambda \})&\le \frac{\widetilde{C}}{\lambda ^p} \sum _{B \in \mathcal {F}} \Vert f\Vert _{JN_{p,0,s}(C_2 B)}^p \\&= \frac{\widetilde{C}}{\lambda ^p} \sum _{i=1}^M \sum _{B \in \mathcal {D}_i} \Vert f\Vert _{JN_{p,0,s}(C_2 B)}^p \\&\le \frac{C}{\lambda ^p} \Vert f\Vert _{JN_{p,0,s}(\Delta )}^p , \end{aligned}$$

where \(C = \widetilde{C} M\). This concludes the proof. \(\square \)

If all balls are Boman sets with uniform parameters, then the median-type John–Nirenberg space coincides with the integral-type John–Nirenberg space in every open set. For example, geodesic spaces satisfy the uniform Boman condition on balls [16].

Corollary 5.4

Let \(1<p<\infty \), \(0< q < p\) and \(0 < s \le s_0\), where \(s_0\) is given in Theorem 4.4. Assume that all balls in X are Boman sets with uniform parameters \(C_1,C_2,C_3,\rho \) and M. Then for every open set \(\Omega \subset X\) it holds that

$$\begin{aligned} s^\frac{1}{q} \Vert f\Vert _{JN_{p,0,s}(\Omega )} \le \Vert f\Vert _{JN_{p,q}(\Omega )} \le \left( \frac{Cp}{p-q} \right) ^\frac{1}{q} \Vert f\Vert _{JN_{p,0,s}(\Omega )}, \end{aligned}$$

where C is the constant from Theorem 5.3.

Proof

Let \(\{B_i\}_i\) be a countable collection of pairwise disjoint balls contained in \(\Omega \). The first inequality is stated and proven in Proposition 3.4. For the second inequality, since by the assumption the balls \(B_i\) are Boman sets, we may apply Theorem 5.3 on \(B_i\). This together with Cavalieri’s principle implies

$$\begin{aligned} \int _{B_i} |f-a|^q \, d \mu&= q \int _0^\infty \lambda ^{q-1} \mu (\{ x \in B_i: |f-a| > \lambda \}) \, d \lambda \\&\le q \int _{\mu (B_i)^{-\frac{1}{p}} \Vert f\Vert _{JN_{p,0,s}(B_i)}}^\infty C \lambda ^{q-p-1} \Vert f\Vert _{JN_{p,0,s}(B_i)}^p \, d \lambda \\&\qquad + q \int _0^{\mu (B_i)^{-\frac{1}{p}} \Vert f\Vert _{JN_{p,0,s}(B_i)}} \lambda ^{q-1} \mu (B_i) \, d \lambda \\&= \frac{Cq}{p-q} \mu (B_i)^{1-\frac{q}{p}} \Vert f\Vert _{JN_{p,0,s}(B_i)}^q + \mu (B_i)^{1-\frac{q}{p}} \Vert f\Vert _{JN_{p,0,s}(B_i)}^q \\&\le \frac{Cp}{p-q} \mu (B_i)^{1-\frac{q}{p}} \Vert f\Vert _{JN_{p,0,s}(B_i)}^q , \end{aligned}$$

where C is the constant from Theorem 5.3. We then estimate

Thus, we conclude that

$$\begin{aligned} \Vert f\Vert _{JN_{p,q}(\Omega )} \le \left( \frac{Cp}{p-q} \right) ^\frac{1}{q} \Vert f\Vert _{JN_{p,0,s}(\Omega )}. \end{aligned}$$