1 Introduction

On \({\mathbb {R}}^n\) let \(f^{\#}_{\varDelta }(x)\) and \(M^{\varDelta }f(x)\) denote the classical dyadic sharp function and dyadic maximal function respectively, that is,

$$\begin{aligned}&f^{\#}_{\varDelta }(x)=\sup _{x \in Q\in \varDelta }\frac{1}{|Q|}\int _{Q}|f(y)-f_Q|\,dy,\\&\quad M^{\varDelta }f(x)=\sup \limits _{x\in Q\in \varDelta } \frac{1}{|Q|}\int _Q |f(y)|\, dy, \end{aligned}$$

where here and subsequently, \(\varDelta \) denotes the collection of all dyadic cubes in \({\mathbb {R}}^n\) and

$$\begin{aligned} f_Q=\frac{1}{|Q|} \int _Q f(x)\,dx. \end{aligned}$$

Suppose that \(f\in L^{p_0}({\mathbb {R}}^n)\) for some \(p_0\). The well-known Fefferman–Stein inequality asserts that if \(1<p<\infty \), \(1\le p_0\le p\), and \(f^{\#}_{\varDelta }\in L^p({\mathbb {R}}^n)\), then \(M^{\varDelta }f\in L^p({\mathbb {R}}^n)\) and

$$\begin{aligned} \Vert M^{\varDelta }f\Vert _{L^p({\mathbb {R}}^n)}\le C_n(p) \Vert f^{\#}_{\varDelta }\Vert _{L^p({\mathbb {R}}^n)} \end{aligned}$$
(1.1)

(see [2, Sect. 3], [4, Chapter 4]). The inequality (1.1) implies that for every \(1<p<\infty \) one has

$$\begin{aligned} \Vert f\Vert _{L^p({\mathbb {R}}^n)}\le C_n(p)\Vert f^{\#}_{\varDelta }\Vert _{L^p({\mathbb {R}}^n)}. \end{aligned}$$

The estimate (1.1) is a consequence of the following good lambda distributional inequality

$$\begin{aligned} \left| \{x\in {\mathbb {R}}^n: M^{\varDelta }f(x)> \lambda , \, f^{\#}_{\varDelta }(x) \le c\lambda \}\right| \le a\left| \{x\in {\mathbb {R}}^n: M^{\varDelta }f(x)> b\lambda \}\right| , \end{aligned}$$
(1.2)

where \(\lambda >0\), \(c>0\), \(0<b<1\), \(a=2^nc/(1-b)\), and \(f\in L^1_{\mathrm{loc}}({\mathbb {R}}^n)\) (see [4]).

Let \(\varOmega \) be a domain in \({\mathbb {R}}^n\). Our goal is to define for \(f\in L^1_{\mathrm{loc}} (\varOmega )\) a localized version \(f^{\#}_{\mathrm{loc}}\) of the sharp function which will satisfy

$$\begin{aligned} \Vert f\Vert _{L^p(\varOmega )} \le C_p\Vert f^{\#}_{\mathrm{loc}}\Vert _{L^p(\varOmega )} \ \ \text {for}\ \ f\in L^p(\varOmega ). \end{aligned}$$
(1.3)

By localized we mean that the cubes which are taken in the definition of \(f^{\#}_{\mathrm{loc}}(x)\) are contained in a bounded set \({\mathcal {B}}_x\subset \varOmega \). So one possible definition can be taken as follows. Let \(\tau :\varOmega \rightarrow (0,\infty )\). For \(f\in L^1_{\mathrm{loc}}(\varOmega )\) we set

$$\begin{aligned} f^{\#}_{{\mathrm{loc}}, \, \tau }(x)=\sup _{x\in Q\subset \varOmega , \ \ell (Q)<\tau (x)} \frac{1}{|Q|}\int _{Q}|f(y)-f_Q|\,dy, \end{aligned}$$

where Q is any cube (not necessarily dyadic) and \(\ell (Q)\) denotes its side-length. Note that \(\tau \) cannot be taken arbitrarily. For example, if \(\varOmega =(0,\infty )\) and \(\tau \) is such that \(\lim _{x\rightarrow \infty } \tau (x)/x=0\), then taking \(f(x)=\chi _{(0,R)}(x)\) we have \(\Vert f\Vert _{L^p(\varOmega )}=R^{1\slash p}\) while \(\lim _{R\rightarrow \infty } R^{-1\slash p} \Vert f^{\#}_{{\mathrm{loc}},\, \tau }\Vert _{L^p(\varOmega )}= 0\). On the other hand, we shall show that for certain sets \(\varOmega \) in \({\mathbb {R}}^n\) if \(\tau (x)\) behaves like \(\frac{1}{2}\text { dist}(x,\partial \varOmega )\), then \( f^{\#}_{{\mathrm{loc}},\, \tau }\) satisfies (1.3). Moreover, the inequality (1.3) holds for \(p=1\), provided f is supported by a bounded set and \(|f|\log (2+|f|)\) is integrable. These will be obtained by proving modifications of the good lambda inequality (see Propositions 2.4, 3.7, and 4.5).

2 Localized sharp function on \({\mathbb {R}}^n{\setminus } \{0\}\)

Let \(\varOmega ={\mathbb {R}}^n{\setminus } \{0\}\). We define the localized sharp function on \(\varOmega \) as

$$\begin{aligned} f^{\#}_{\mathrm{loc},\,\varOmega }(x)=\sup _{x \in K \subset \left\{ y \in \varOmega :\,\frac{|x|}{4\sqrt{n}} \le |y| \le 4\sqrt{n}|x|\right\} }\frac{1}{|K|}\int _{K}|f(y)-f_{K}|\,dy, \end{aligned}$$

where the supremum is taken over all cubes K (not necessarily dyadic) contained in the set

$$\begin{aligned} \left\{ y \in \varOmega :\frac{|x|}{4\sqrt{n}} \le |y| \le 4\sqrt{n}|x|\right\} . \end{aligned}$$

We now turn to define the local dyadic maximal function associated with a Whitney decomposition of \(\varOmega \). For this purpose, put

$$\begin{aligned}&\rho (x,y)=\max (|x_1-y_1|,|x_2-y_2|,\ldots ,|x_n-y_n|). \end{aligned}$$

Set

$$\begin{aligned} {\mathcal {L}}= \left\{ Q\in \varDelta : \ell (Q)=\rho (0,Q)\right\} . \end{aligned}$$

The set \({\mathcal {L}}\) forms a Whitney covering of \(\varOmega \). For every integer k we define the k -th layer \(L_k\) of \({\mathcal {L}}\) as

$$\begin{aligned} L_k=\left\{ Q\in {\mathcal {L}}: \ell (Q)=2^{-k}\right\} . \end{aligned}$$

Clearly, \(Q\in L_k\) if and only if \(2^{-m}Q\in L_{k+m}\). Figure 1 shows three k-layers for \(n = 2\). Here and subsequently, \(\alpha Q=\{\alpha x: x\in Q\}\), \(\alpha >0\).

Fig. 1
figure 1

Cubes from three k-layers of \(\mathcal {L}\) for \(n=2\) which are contained in \((0,\infty )^n\)

For every positive integer m the partition \({\mathcal {L}}_m\) of \(\varOmega \) is obtained by dividing each cube Q from \({\mathcal {L}}\) into \(2^{nm}\) dyadic cubes each of side-length \(2^{-m}\ell (Q)\). Let

$$\begin{aligned} {\mathcal {D}}=\mathcal {L} \cup \bigcup _{m=1}^{\infty }\mathcal {L}_{m}. \end{aligned}$$

The local dyadic maximal function associated with the Whitney covering \({\mathcal {L}}\) of \(\varOmega \) is defined by

$$\begin{aligned} M_{\mathcal {D}}f(x)=\sup _{x \in K \in {\mathcal {D}}}\frac{1}{|K|}\int _{K}|f(y)|\,dy. \end{aligned}$$

Our goal of this section is to prove the following theorem.

Theorem 2.1

For every \(1 \le p<\infty \) there is a constant \(C>0\) such that for every locally integrable function f on \(\varOmega \) for which there exists \(0<p_0\le p\) such that \(M_{\mathcal {D}} f\in ~L^{p_0}(\varOmega )\) one has

$$\begin{aligned} \Vert M_{\mathcal {D}}f\Vert _{L^p(\varOmega )} \le C \Vert f^{\#}_{\mathrm{loc},\,\varOmega }\Vert _{L^p(\varOmega )}. \end{aligned}$$

Corollary 2.2

For every \(1<p<\infty \) there is a constant \(C_p>0\) such that

$$\begin{aligned} \Vert f\Vert _{L^{p}(\varOmega )} \le C_p \Vert f^{\#}_{\mathrm{loc},\,\varOmega }\Vert _{L^p(\varOmega )} \ \ \ \text {for} \ \ f\in L^p(\varOmega ). \end{aligned}$$

Corollary 2.3

There is a constant \(C>0\) such that if f is supported by a bounded set and \(|f|\log (2+|f|)\) is integrable, then

$$\begin{aligned} \Vert f\Vert _{L^{1}(\varOmega )} \le C \Vert f^{\#}_{\mathrm{loc},\,\varOmega }\Vert _{L^1(\varOmega )}. \end{aligned}$$

There is no loss of generality if we assume that all the functions under consideration take values in \({\mathbb {R}}\). Clearly, for almost every \(x\in \varOmega \) there is a unique cube \(Q\in {\mathcal {L}}\) such that \(x\in Q\). For such an x let

$$\begin{aligned} Sf(x)=|f|_Q, \ \ S'f(x) = f_Q. \end{aligned}$$
(2.1)

The proof of Theorem 2.1 is a consequence of the following modified version of the good lambda inequality, which is stated in the proposition below.

Proposition 2.4

(modified good lambda inequality) For every constant \(0<b<1\) there is a constant \(C>0\) such that for all \(c,\alpha >0\), and every locally integrable function f which satisfies \(\lim _{|x|\rightarrow \infty } Sf(x)=0\) we have

$$\begin{aligned}&\left| \{x \in \varOmega :M_{\mathcal {D}}f(x)>\alpha , \, f^{\#}_{\mathrm{loc},\,\varOmega }(x)<c\alpha \}\right| \\&\quad \le Cc\left| \{x \in \varOmega :M_{\mathcal {D}}f(x)>b\alpha \}\right| +\left| \{x \in \varOmega : {\mathbb {S}}f(x)>b\alpha \}\right| , \end{aligned}$$

where here and subsequently,

$$\begin{aligned} {\mathbb {S}}f(x)=2^{1-n}\cdot 3^{2n}\sum _{j=1}^\infty f^{\#}_{\mathrm{loc},\,\varOmega }(2^jx). \end{aligned}$$

Proof of Theorem 2.1

If we assume Proposition 2.4, the proof of the theorem is a slight modification of that in the classical case (see [2,3,4]). For the convenience of the reader, we provide details. We may assume that \( \Vert f^{\#}_{\mathrm{loc},\,\varOmega }\Vert _{L^p(\varOmega )}\) is finite. Then, by the Minkowski inequality,

$$\begin{aligned} \Vert {\mathbb {S}}f \Vert _{L^p(\varOmega )}\le 2^{1-n}\cdot 3^{2n}\sum _{j=1}^\infty 2^{-jn\slash p} \Vert f^{\#}_{\mathrm{loc},\,\varOmega }\Vert _{L^p(\varOmega )} = C_p\Vert f^{\#}_{\mathrm{loc},\,\varOmega }\Vert _{L^p(\varOmega )}. \end{aligned}$$
(2.2)

Since \(M_{\mathcal {D}} f\in L^{p_0}(\varOmega )\), \(\lim _{|x|\rightarrow \infty } Sf(x)=0\). Let

$$\begin{aligned} I_R&=p\int _{0}^{R}\alpha ^{p-1}\left| \{x \in \varOmega :M_{\mathcal {D}}f(x)>\alpha \}\right| \,d\alpha \\&= p\int _{0}^{R}\alpha ^{p-1}\left| \{x \in \varOmega :M_{\mathcal {D}}f(x)>\alpha , \, f^{\#}_{\mathrm{loc},\,\varOmega }(x)<c\alpha \}\right| \,d\alpha \\&\quad +p\int _{0}^{R}\alpha ^{p-1}\left| \{x \in \varOmega :M_{\mathcal {D}}f(x)>\alpha , \, f^{\#}_{\mathrm{loc},\,\varOmega }(x)\ge c\alpha \}\right| \,d\alpha . \end{aligned}$$

Applying Proposition 2.4, we obtain

$$\begin{aligned} I_R&\le Ccp\int _{0}^{R}\alpha ^{p-1}|\{x \in \varOmega :M_{\mathcal {D}}f(x)>b\alpha \}|\,d\alpha \\&\quad + p\int _{0}^{R}\alpha ^{p-1}|\{x \in \varOmega :{\mathbb {S}}f(x)>b\alpha \}|\,d\alpha \\&\quad +p\int _{0}^{R}\alpha ^{p-1}|\{x \in \varOmega :f^{\#}_{\mathrm{loc},\,\varOmega }(x) \ge c\alpha \}|\,d\alpha \\&\le Ccb^{-p} I_{bR}+p\int _{0}^{R}\alpha ^{p-1}|\{x \in \varOmega :{\mathbb {S}}f(x)>b\alpha \}|\,d\alpha \\&\quad +p\int _{0}^{R}\alpha ^{p-1}|\{x \in \varOmega :f^{\#}_{\mathrm{loc},\,\varOmega }(x)\ge c\alpha \}|\,d\alpha . \end{aligned}$$

Clearly, \(I_R<\infty \), since, by assumption, \(M_{\mathcal {D}}f\in L^{p_0}(\varOmega )\) and \(0<p_0\le p\). Moreover, \(I_{bR}\le I_b\) because \(0<b<1\). Taking c small enough such that \(Ccb^{-p}<1\) we obtain

$$\begin{aligned} I_R&\le C'p\int _{0}^{R}\alpha ^{p-1}|\{x \in \varOmega :{\mathbb {S}}f(x)>b\alpha \}|\,d\alpha \\&\quad +C'p\int _{0}^{R}\alpha ^{p-1}|\{x \in \varOmega :f^{\#}_{\mathrm{loc},\,\varOmega }(x) \ge c\alpha \}|\,d\alpha . \end{aligned}$$

Letting \(R\rightarrow \infty \), we conclude

$$\begin{aligned} \Vert M_{\mathcal {D}}f\Vert _{L^p(\varOmega )} \le C_1\Vert {\mathbb {S}}f\Vert _{L^p(\varOmega )}+C_2\Vert f^{\#}_{\mathrm{loc},\,\varOmega }\Vert _{L^p(\varOmega )}\le C_3 \Vert f^{\#}_{\mathrm{loc},\,\varOmega }\Vert _{L^p(\varOmega )}, \end{aligned}$$

where in the last inequality we have used (2.2). \(\square \)

The remaining part of the section is devoted to proving Proposition 2.4. The following two lemmas will play a crucial role in the proof.

Lemma 2.5

For every locally integrable function f and almost every \(x \in \varOmega \) one has

$$\begin{aligned} S'f(x) \le S'f(2x)+ 2^{-n}\cdot 3^{2n}f^{\#}_{\mathrm{loc},\,\varOmega }(2x). \end{aligned}$$

Proof

It suffices to prove the lemma for \(x=(x_1,x_2,\ldots ,x_n)\) such that \(x_j>0\) for every \(j=1,2,\ldots ,n\). Let \(Q_1\) be the unique dyadic cube from \({\mathcal {L}}\) which contains x. Let k be such that \(2^{-(k+1)}=\ell ( Q_1)\). Set \(Q_2=2Q_1\). Let

$$\begin{aligned} Q_0=\{x=(x_1,\ldots ,x_n)\in {\mathbb {R}}^n: \, 0\le x_j\le 1 \ \ \text {for all } j=1,2,\ldots ,n\}. \end{aligned}$$
(2.3)

Then there is the unique vector \(p=(p_1,p_2,\ldots ,p_n)\ne \mathbf 0 \), \(p_j\in \{0,1\}\), such that \(Q_1=2^{-k-1}Q_0+2^{-k-1} p\). Set \(K=3\cdot 2^{-k-1}Q_0+2^{-k-1} p\). Then

$$\begin{aligned} Q_1\cup Q_2\subset K\subset \left\{ y\in \varOmega : \frac{|2x|}{4\sqrt{n}}\le |y|\le 4\sqrt{n}|2x|\right\} . \end{aligned}$$

We shall call the set \(M=K{\setminus } (Q_1\cup Q_2)\) the complementary neighborhood of the pair of cubes \((Q_1,Q_2)\).

Let us remark that for \(n=1\) the complementary neighborhood of two intervals is the empty set. For \(n=2\) the complementary neighborhoods are presented in Fig. 2.

Fig. 2
figure 2

Complementary neighborhoods for \(n=2\)

We have

$$\begin{aligned}&\frac{|Q_1|}{|K|}=\frac{1}{3^n},\ \ \frac{|Q_2|}{|K|}=\frac{2^n}{3^n}, \ \ \frac{|M|}{|K|}=\frac{3^n-2^n-1}{3^n},\nonumber \\&\quad f_{K}=\frac{1}{3^n}f_{Q_1}+\frac{2^n}{3^n}f_{Q_2}+\frac{3^n-2^n-1}{3^n}f_{M}. \end{aligned}$$
(2.4)

We consider two cases.

Case 1 \(S'f(x)\ge f_M\). Then

$$\begin{aligned} f^{\#}_{\mathrm{loc},\,\varOmega }(2x)&\ge \frac{1}{|K|}\int _{K}|f(y)-f_{K}|\,dy \\&= \frac{1}{|K|}\int _{K}|f(y)-\left( \frac{1}{3^n}f_{Q_1} +\frac{2^n}{3^n}f_{Q_2}+\frac{3^n-2^n-1}{3^n}f_{M}\right) |\,dy \\&\ge \frac{1}{|K|}\int _{Q_1}\left| f(y)-\left( \frac{1}{3^n}f_{Q_1} +\frac{2^n}{3^n}f_{Q_2}+\frac{3^n-2^n-1}{3^n}f_{M}\right) \right| \,dy \\&\ge \frac{1}{|K|}\left| \int _{Q_1}f(y)-\left( \frac{1}{3^n}f_{Q_1} +\frac{2^n}{3^n}f_{Q_2}+\frac{3^n-2^n-1}{3^n}f_{M}\right) \,dy \right| \\&= \left| f_{Q_1}\frac{1}{3^n}-f_{Q_1}\frac{1}{3^{2n}}-f_{Q_2}\frac{2^n}{3^{2n}}-f_{M}\frac{3^n-1-2^n}{3^{2n}}\right| \\&\ge f_{Q_1}\frac{1}{3^n}-f_{Q_1}\frac{1}{3^{2n}}-f_{Q_2}\frac{2^n}{3^{2n}}-f_{M}\frac{3^n-1-2^n}{3^{2n}} \\ {}&= f_{Q_1}\frac{3^n-1}{3^{2n}}-f_{Q_2}\frac{2^n}{3^{2n}}-f_{M}\frac{3^n-1-2^n}{3^{2n}}. \end{aligned}$$

By the assumption \(-f_M\ge - S'f(x)= - f_{Q_1}\), hence

$$\begin{aligned}&f_{Q_1}\frac{3^n-1}{3^{2n}}-f_{Q_2}\frac{2^n}{3^{2n}}-f_{M}\frac{3^n-1-2^n}{3^{2n}} \ge f_{Q_1}\frac{3^n-1}{3^{2n}}-f_{Q_2}\frac{2^n}{3^{2n}}-f_{Q_1}\frac{3^n-1-2^n}{3^{2n}} \\&\quad =f_{Q_1}\frac{2^n}{3^{2n}}-f_{Q_2}\frac{2^n}{3^{2n}}=S'f(x)\frac{2^n}{3^{2n}}-S'f(2x)\frac{2^n}{3^{2n}}, \end{aligned}$$

which gives the lemma.

Case 2 \(S'f(x)\le f_M\). The proof in this case is similar to that in Case 1. The only difference is that we diminish the area of integration to \(Q_2\) instead of \(Q_1\). We omit the details. If \(n=1\), then \(M=\emptyset \). In this case we set \(f_M=0\) and proceed as in Case 1. \(\square \)

Remark 2.6

If we apply the lemma to the function \(-f\), we obtain the inequality

$$\begin{aligned} S'f(2x)\le S'f(x)+ 2^{-n}\cdot 3^{2n} f^{\#}_{\mathrm{loc},\,\varOmega }(2x). \end{aligned}$$

Lemma 2.7

For every locally integrable function f and almost every \(x \in \varOmega \) one has

$$\begin{aligned} Sf(x) \le S f(2x)+ 2^{1-n}\cdot 3^{2n} f^{\#}_{\mathrm{loc},\,\varOmega }(2x). \end{aligned}$$
(2.5)

Proof

Using Lemma 2.5 to |f| we get \( Sf(x) \le Sf(2x)+ 2^{-n}\cdot 3^{2n}|f|^{\#}_{\mathrm{loc},\,\varOmega }(2x)\). The inequality (2.5) holds because \(|f|^{\#}_{\mathrm{loc},\,\varOmega }(2x)\le 2 f^{\#}_{\mathrm{loc},\,\varOmega }(2x)\). \(\square \)

Iterating the inequality (2.5) we obtain the following corollary.

Corollary 2.8

Assume that a locally integrable function f on \(\varOmega \) satisfies

$$\begin{aligned} \lim _{|x|\rightarrow \infty }Sf(x)~=~0. \end{aligned}$$

Then

$$\begin{aligned} Sf(x)\le {\mathbb {S}}f(x) \ \ \ \text {for every } x\in \varOmega . \end{aligned}$$

Proof of Proposition 2.4

The proof of the proposition is a modification of that of the classical good lambda inequality (cf. [1, 4]). Let \(\{Q_j\}\) be the partition of the set \(\{x\in \varOmega : M_{\mathcal {D}}f(x)>b\alpha \}\) which consists of maximal dyadic cubes \(Q_j\) from \({\mathcal {D}}\) which satisfy \(|f|_{Q_j} >b\alpha \). Obviously, the cubes \(Q_j\) have disjoint interiors. Further,

$$\begin{aligned}&\left\{ x\in \varOmega :M_{\mathcal {D}}f(x)>\alpha ,\,f^{\#}_{\mathrm{loc},\,\varOmega }(x)<c\alpha \right\} \subset \left\{ x \in \varOmega :M_{\mathcal {D}}f(x)>b\alpha \right\} =\bigcup _j Q_j,\\&\left\{ x\in \varOmega :M_{\mathcal {D}}f(x)>\alpha ,\,f^{\#}_{\mathrm{loc},\,\varOmega }(x)<c\alpha \right\} = \bigcup _{j}\left\{ x \in Q_j:M_{\mathcal {D}}f(x)>\alpha , \, f^{\#}_{\mathrm{loc},\,\varOmega }(x)<c\alpha \right\} . \end{aligned}$$

Thus, it suffices to show that either

$$\begin{aligned} \left| \left\{ x \in Q_j:M_{\mathcal {D}}f(x)>\alpha ,\, f^{\#}_{\mathrm{loc},\,\varOmega }(x)<c\alpha \right\} \right| \le cC|Q_j| \end{aligned}$$
(2.6)

or

$$\begin{aligned} \left\{ x \in Q_j:M_{\mathcal {D}}f(x)>\alpha ,\, f^{\#}_{\mathrm{loc},\,\varOmega }(x)<c\alpha \right\} \subset \left\{ x \in \varOmega :{\mathbb {S}}f(x)>b\alpha \right\} . \end{aligned}$$
(2.7)

Assume that the set \(A_j=\{x\in Q_j :M_{\mathcal {D}}f(x)>\alpha ,\, f^{\#}_{\mathrm{loc},\,\varOmega }(x)<c\alpha \}\) is not empty, otherwise there is nothing to prove. Fix \(x_0\in A_j\). We consider two cases.

Case 1 \(Q_j\in {\mathcal {L}}\). Then \(b\alpha < |f|_{Q_j}=Sf(y)\le \mathbb Sf(y)\) for every \(y\in Q_j\), where in the last inequality we have used Corollary 2.8. Thus \(Q_j\subset \{x \in \varOmega :{\mathbb {S}}f(x)>b\alpha \}\) and (2.7) holds in this case.

Case 2 \(Q_j\in {\mathcal {L}}_m\) for \(m\ge 1\). In this case the proof follows the pattern from [4]. Indeed, first observe that for every \(Q\in \mathcal D\) such that \(Q_j\varsubsetneq Q\) one has \(|f|_Q\le b\alpha \). Thus, for every \(x\in Q_j\) such that \(M_{\mathcal {D}}f(x)>\alpha \) one has \(M_{\mathcal {D}} \{(f-f_{Q})\chi _{Q_j}\}(x)>(1-b)\alpha \). Let \({\widetilde{Q}}_j\) be the parent of \(Q_j\). Clearly, \({\widetilde{Q}}_j\in {\mathcal {D}}\) and

$$\begin{aligned} A_{j}= \{x \in Q_j:M_{\mathcal {D}}(f-f_{\widetilde{Q_j}})\chi _{Q_j}(x)>(1-b)\alpha , \, M_{\mathcal {D}}f(x)>\alpha , \, f^{\#}_{\mathrm{loc},\,\varOmega }(x)<c\alpha \}. \end{aligned}$$

Since \(M_{\mathcal {D}} \) satisfies the weak type (1,1) inequality with the constant \(C'=1\), we have

$$\begin{aligned} \begin{aligned} | A_j |&\le \frac{1}{(1-b)\alpha }\int _{Q_j}|f-f_{\widetilde{Q_j}}|\,dx \le \frac{1}{(1-b)\alpha }\int _{\widetilde{Q_j}}|f-f_{\widetilde{Q_j}}|\,dx \le \frac{|\widetilde{Q_j}|}{(1-b)\alpha }f^{\#}_{\mathrm{loc},\,\varOmega }(x_0) \\&\le \frac{|\widetilde{Q_j}|}{(1-b)\alpha }c\alpha = \frac{2^nc}{1-b}|Q_j|, \end{aligned} \end{aligned}$$

so (2.6) holds in this case with \(C=2^n(1-b)^{-1}\). \(\square \)

3 Localized sharp function for \((0,\infty )^n\)

In this section \({\widetilde{\varOmega }} =\{x=(x_1,\ldots ,x_n)\in {\mathbb {R}}^n: x_j>0, \, j=1,2,\ldots ,n\}\) denotes the generalized first quoter in \({\mathbb {R}}^n\). The distance of \(x\in {\widetilde{\varOmega }}\) from the boundary is given by \({\widetilde{\rho }}(x,\partial {\widetilde{\varOmega }})=\min \{x_j: j=1,2,\ldots , n\}\). We define the partition \({\widetilde{{\mathcal {L}}}}\) of \({\widetilde{\varOmega }}\):

$$\begin{aligned} {\widetilde{{\mathcal {L}}}}=\{ Q\in \varDelta : Q\subset {\widetilde{\varOmega }}\ \text { and } \ \ell ( Q)= {\widetilde{\rho }} (Q,\partial {\widetilde{\varOmega }})\}. \end{aligned}$$

Clearly,

$$\begin{aligned} {\widetilde{{\mathcal {L}}}}= \bigcup _{k\in {\mathbb {Z}}} {\widetilde{L}}_k, \ \ \text {where} \ \ {\widetilde{L}}_k=\{ Q\in {\widetilde{{\mathcal {L}}}}: \ell (Q)=2^{-k}\}. \end{aligned}$$
Fig. 3
figure 3

A part of the partition \({\widetilde{\mathcal {L}}}\) for \(n=2\) with the five layers \({\widetilde{L}}_{-1}\), \({\widetilde{L}}_0\),...,\({\widetilde{L}}_{3}\)

Similarly to the previous section, for every positive integer m the partition \({\widetilde{{\mathcal {L}}}}_m\) consists of dyadic cubes which are obtained by dividing each cube Q from \({\widetilde{{\mathcal {L}}}}\) into \(2^{mn}\) dyadic cubes each of the side-length \(2^{-m}\ell (Q)\) (Fig. 3). Set

$$\begin{aligned} {\widetilde{{\mathcal {D}}}}={\widetilde{\mathcal {L}}} \cup \bigcup _{m=1}^{\infty }{\widetilde{\mathcal {L}}}_{m}. \end{aligned}$$

Define the local maximal dyadic function \(M_{\widetilde{\mathcal {D}}}\) and localized sharp function \(f^{\#}_{\mathrm{loc},\,{\widetilde{\varOmega }}}\) associated with the Whitney covering \({\widetilde{{\mathcal {L}}}}\) of \({\widetilde{\varOmega }}\) as

$$\begin{aligned}&M_{\widetilde{\mathcal {D}}}f(x)=\sup _{x\in Q\in {\widetilde{\mathcal {D}}}} |f|_Q,\\&f^{\#}_{\mathrm{loc},\,{\widetilde{\varOmega }}}(x)=\sup _{x \in K \subset \{y \in {\widetilde{\varOmega }}: \frac{1}{4}{\widetilde{\rho }}(x,\partial {\widetilde{\varOmega }})\le {\widetilde{\rho }}(y,\partial {\widetilde{\varOmega }}) \le 4{\widetilde{\rho }}(x,\partial {\widetilde{\varOmega }})\}} \frac{1}{|K|}\int _{K}|f(y)-f_{K}|\,dy, \end{aligned}$$

where the supremum is taken over all cubes (not necessarily dyadic).

It turns out that the following theorem analogue to Theorem 2.1 holds.

Theorem 3.1

For every \(1 \le p<\infty \) there is a constant \(C>0\) such that for every locally integrable function f on \({\widetilde{\varOmega }}\) for which there exists \(0<p_0\le p\) such that \(M_{\widetilde{\mathcal {D}}} f\in ~L^{p_0}({\widetilde{\varOmega }})\) one has

$$\begin{aligned} \Vert M_{\widetilde{\mathcal {D}}}f\Vert _{L^p({\widetilde{\varOmega }})} \le C \Vert f^{\#}_{\mathrm{loc},\,{\widetilde{\varOmega }}}\Vert _{L^p(\widetilde{\varOmega })}. \end{aligned}$$

Corollary 3.2

For every \(1<p<\infty \) there is a constant \(C>0\) such that

$$\begin{aligned} \Vert f\Vert _{L^{p}({\widetilde{\varOmega }})} \le C \Vert f^{\#}_{\mathrm{loc},\,{\widetilde{\varOmega }}}\Vert _{L^{p}({\widetilde{\varOmega }})} \ \ \ \text {for} \ \ f\in L^p({\widetilde{\varOmega }}). \end{aligned}$$

The remaining part of this section is devoted to proving Theorem 3.1.

Similarly to the previous section [see (2.1)] we set

$$\begin{aligned} {\widetilde{S}}f(x)=|f|_Q \ \ \text {and}\ \ {\widetilde{S}}'f(x)=f_Q , \end{aligned}$$
(3.1)

where Q is the unique cube from \({\widetilde{\mathcal {L}}}\) which contains x (such a Q is well-defined for almost every x). Let k be such that \(Q\in {\widetilde{L}}_k\). Our goal is to define the successors \(x'\) and \(Q'\in {\widetilde{L}}_{k-1}\) of x and Q respectively in such a way that \(x'\in Q'\) and

$$\begin{aligned} {\widetilde{S}} f(x)\le {\widetilde{S}} f(x')+ 2^{1-n}3^{2n} f^{\#}_{\mathrm{loc},\,{\widetilde{\varOmega }}}(x'). \end{aligned}$$

To this end, observe that there is a unique vector \( q=(q_1,q_2,\ldots ,q_n)\), where \(q_j\) are non-negative integers such that at least one \(q_j\) equals 0, and \(Q=2^{-k}Q_0+2^{-k}( q+\mathbf 1 )\), where here and subsequently, \(\mathbf 1 =(1,1,\ldots ,1)\). Consider the coordinates \(x_j\) of x for which \(q_j=0\). There is no loss of generality if we assume these are the first m coordinates, \(m\in \{1,2,\ldots ,n\}\). So \( Q=2^{-k}Q_0+2^{-k}(1,1,\ldots ,1,1+q_{m+1},\ldots ,1+q_n)\), \(q_{m+1},\ldots ,q_n\ge 1\). Define

$$\begin{aligned} x'=F(x)=(2x_1,2x_2,\ldots ,2x_m, x_{m+1},\ldots ,x_n) \ \text { for }\ x\in Q. \end{aligned}$$
(3.2)

Then, for almost every x, the point \(x'\) belongs to the unique \(Q'\in L_{k-1}\) and

$$\begin{aligned}&Q'=2^{-k+1}Q_0+2^{-k+1}( q'+\mathbf 1 ),\\&q'=(0,\ldots ,0,q_{m+1}',\ldots ,q_n'), \ \ \ q_j'=\lfloor (q_j-1)\slash 2\rfloor , \ j={m+1},\ldots ,n. \end{aligned}$$

Lemma 3.3

For every \(f\in L^1_{\mathrm{loc}}({\widetilde{\varOmega }})\) and almost every \(x \in {\widetilde{\varOmega }}\) one has

$$\begin{aligned} {\widetilde{S}}'f(x)\le & {} {\widetilde{S}}' f(x')+ 2^{-n}\cdot 3^{2n}f^{\#}_{\mathrm{loc},\,{\widetilde{\varOmega }}}(x'), \end{aligned}$$
(3.3)
$$\begin{aligned} {\widetilde{S}}f(x)\le & {} {\widetilde{S}} f(x')+ 2^{1-n}\cdot 3^{2n}f^{\#}_{\mathrm{loc},\,{\widetilde{\varOmega }}}(x'), \end{aligned}$$
(3.4)
$$\begin{aligned} {\widetilde{S}}'f(x')\le & {} {\widetilde{S}}' f(x)+ 2^{-n}\cdot 3^{2n}f^{\#}_{\mathrm{loc},\,{\widetilde{\varOmega }}}(x). \end{aligned}$$
(3.5)

Proof

Define (non-dyadic) cube \(K''=[2^{-k},2^{-k+2}]^m\times I_{m+1}\times \cdots \times I_n\subset {\widetilde{\varOmega }}\), where

$$\begin{aligned} I_j=\left[ 2^{-k+1}q_{j}'+2^{-k+2}-3\cdot 2^{-k},2^{-k+1}q_j'+ 2^{-k+2}\right] . \end{aligned}$$

We have \(\ell (K'')=3\cdot 2^{-k}\), \(Q\cup F(Q) \cup Q' \subset K''\). Moreover, \(K''\) is taken into account if we compute \(f^{\#}_{\mathrm{loc},\,{\widetilde{\varOmega }}}(x')\) and \(f^{\#}_{\mathrm{loc},\,{\widetilde{\varOmega }}}(x)\). Set \(M=K''{\setminus } (Q\cup Q')\). We have [(cf. (2.4)]

$$\begin{aligned} \frac{|Q|}{|K''|}=\frac{1}{3^n},\ \ \frac{|Q'|}{|K''|}=\frac{2^n}{3^n}, \ \ \frac{|M|}{|K''|}=\frac{3^n-2^n-1}{3^n}, \end{aligned}$$
(3.6)

hence the proof of the lemma is the same as those of Lemmata 2.5 and 2.7. \(\square \)

Fig. 4
figure 4

Cubes which contain points \(x,F(x),F(F(x)),\ldots \) for \(n=2\)

Corollary 3.4

Assume that \(f \in L^1_{\mathrm{loc}}({\widetilde{\varOmega }})\) and \(\lim _{m\rightarrow \infty } {\widetilde{S}}f(F^{m}( x))=0\) for almost every \( x\in {\widetilde{\varOmega }}\), where \(F^m( x)=F(F^{m-1}( x))\) (Fig. 4). Then

$$\begin{aligned} {\widetilde{S}}f( x)\le {\widetilde{\mathbb {S}}}f(x), \end{aligned}$$

where

$$\begin{aligned} {\widetilde{\mathbb {S}}}f( x)=2^{1-n}\cdot 3^{2n}\sum _{k_1=0}^\infty \sum _{k_2=0}^\infty \cdots \sum _{k_n=0}^\infty \sum _{m=0}^\infty f^{\#}_{\mathrm{loc},\,{\widetilde{\varOmega }}}\left( 2^{k_1+m}x_1,2^{k_2+m}x_2,\ldots ,2^{k_n+m}x_n\right) . \end{aligned}$$

Proof

It suffices to apply Lemma 3.3 and note that

$$\begin{aligned} 2^{1-n}3^{2n}\sum \limits _{m=1}^\infty f^{\#}_{\mathrm{loc},\,{\widetilde{\varOmega }}}(F^m( x))\le ~{\widetilde{\mathbb {S}}}f( x). \end{aligned}$$

Remark 3.5

Let us note that \(\lim _{m\rightarrow \infty } {\widetilde{S}} f(F^m( x))=0\) for \(f\in L^p({\widetilde{\varOmega }})\). This is a consequence of the fact that \({\widetilde{\rho }}(F^m( x), \partial {\widetilde{\varOmega }}) \rightarrow \infty \) and \(\ell (Q^m)\rightarrow \infty \), where \(Q^m\) is the unique cube from \({\widetilde{{\mathcal {L}}}}\) such that \(F^m( x)\in Q^m\).

Lemma 3.6

For every \(1\le p<\infty \) there is a constant \(C>0\) such that for every \(f\in L^1_{\mathrm{loc}}({\widetilde{\varOmega }})\) one has

$$\begin{aligned} \Vert {\widetilde{\mathbb {S}}}f\Vert _{L^{p}({\widetilde{\varOmega }})}\le C\Vert f^{\#}_{\mathrm{loc},\,{\widetilde{\varOmega }}}\Vert _{L^{p}({\widetilde{\varOmega }})}. \end{aligned}$$

Proof

This follows from the Minkowski inequality and the summability of the series

$$\begin{aligned} \sum _{k_1=0}^{\infty }\sum _{k_2=0}^{\infty } \cdots \sum _{k_n=0}^{\infty }\sum _{m=0}^{\infty } 2^{-k_1/p-m/p}2^{-k_2/p-m/p}\cdot \ldots \cdot 2^{-k_n/p-m/p}. \end{aligned}$$

\(\square \)

Proposition 3.7

For every constant \(0<b<1\) there is a constant \(C>0\) such that for all \(c,\alpha >0\), and every \(f\in L^1_{\mathrm{loc}} ({\widetilde{\varOmega }})\) satisfying

$$\begin{aligned} \lim _{m\rightarrow \infty } {\widetilde{S}}f(F^m(x))=0 \end{aligned}$$

we have

$$\begin{aligned}&\left| \{x \in {\widetilde{\varOmega }} :M_{\widetilde{\mathcal {D}}}f(x)>\alpha , \,f^{\#}_{\mathrm{loc},\,{\widetilde{\varOmega }}}(x)<c\alpha \}\right| \\&\quad \le Cc\left| \{x \in {\widetilde{\varOmega }} :M_{\widetilde{\mathcal {D}}}f(x)>b\alpha \}\right| +\left| \{x \in {\widetilde{\varOmega }} : {\widetilde{{\mathbb {S}}}}f(x)>b\alpha \}\right| . \end{aligned}$$

Proof

The proof is identical to that of Proposition 2.4, and uses Corollary 3.4 instead of Corollary 2.8. \(\square \)

Proof of Theorem 3.1

The theorem follows from Lemma 3.6 and Proposition 3.7. Its proof is identical to that of Theorem 2.1. \(\square \)

4 Localized sharp function for cube

In this section we consider the cube \((0,2)^n\subset {\mathbb {R}}^n\) and its Whitney decomposition \({\widetilde{{\mathcal {L}}}}''\) which is defined in the following way. Let \({\widetilde{ {\mathcal {L}}}}'\) be the restriction of the decomposition \({\widetilde{{\mathcal {L}}}}\) defined in the previous section into the unit cube \((0,1]^n\). Let us denote by \({\widetilde{{\mathcal {L}}}}''\) the set of cubes which is obtained from \({\widetilde{ {\mathcal {L}}}}'\) under the action of the group G of transformation generated by the reflections with respect to planes \(x_j=1\). Let \({\widetilde{L_k}}\) be the set of cubes from \({\widetilde{{\mathcal {L}}}}'' \) of the side-length \(2^{-k}\). Clearly, \({\widetilde{{\mathcal {L}}}}''={\widetilde{L_1}}\cup {\widetilde{L_2}}\cup \cdots \) (Fig. 5).

Fig. 5
figure 5

Cubes from the set \({\widetilde{\mathcal {L}}}''\) for \(n=2\) (the picture presents cubes from the layers \({\widetilde{L}}_{1}\), \({\widetilde{L}}_{2}\),...,\({\widetilde{L}}_{5}\))

We define the partition \({\widetilde{{\mathcal {L}}}}''_1\) by dividing each cube K from \({\widetilde{\mathcal {L}}}''\) into \(2^n\) dyadic cubes each of the side-length \(2^{-1} \ell (K)\). Inductively, \({\widetilde{{\mathcal {L}}}}''_{m+1}\) is defined by dividing each cube K from \({\widetilde{{\mathcal {L}}}}''_{m}\) into \(2^n\) dyadic cubes of side-length \(2^{-1}\ell (K)\). Set

$$\begin{aligned} {\widetilde{\mathscr {D}}}={\widetilde{{\mathcal {L}}}}''\cup \bigcup _{m=1}^\infty {\widetilde{{\mathcal {L}}}}''_m, \ \ \ M_{\widetilde{\mathscr {D}}}f(x) = \sup _{x\in K\in {\widetilde{\mathscr {D}}}} \frac{1}{|K|}\int _{K} |f(x)|\, dx. \end{aligned}$$

The localized sharp function is defined by

$$\begin{aligned} f^{\#}_{{\mathrm{loc}},\,(0,2)^n}(x)=\sup _{x \in K \subset {\mathcal {B}}_x}\frac{1}{|K|}\int _{K}|f(y)-f_{K}|\,dy, \end{aligned}$$

where

$$\begin{aligned} {\mathcal {B}}_x={\left\{ y \in (0,2)^n: \frac{1}{4}\text { dist}\big (x,\partial [0,2]^n\big )\le \text { dist}\big (y,\partial [0,2]^n\big ) \le 4\text { dist}\big (x,\partial [0,2]^n\big )\right\} } \end{aligned}$$

and the supremum is taken over all cubes K not necessarily dyadic.

Our aim of this section is to prove the following theorem.

Theorem 4.1

For every \(1\le p<\infty \) there is a constant \(C_p>0\) such that if \(f\in L^1((0,2)^n)\), \(\int _{(0,2)^n} f(x)\, dx =0\) and \( M_{\widetilde{\mathscr {D}}} f\in L^1((0,2)^n)\), then

$$\begin{aligned} \Vert M_{\widetilde{\mathscr {D}}} f\Vert _{L^p((0,2)^n)}\le C_p\Vert f^{\#}_{{\mathrm{loc}},\,(0,2)^n}\Vert _{L^p((0,2)^n)}. \end{aligned}$$

The proof requires preparations.

For each \(K\in {\widetilde{{\mathcal {L}}}}''\) there is a unique \(\sigma \in G\) such that \(\sigma (K)\subset [0,1]^n\). Therefore in our considerations we shall deal with cubes contained in \([0,1]^n\) and then use the group action for other cubes.

From now on, let \(Q_1=\frac{1}{2}Q_0+\frac{1}{2}{} \mathbf 1 \).

For \(x\in (0,1]^n\) let F(x) be defined by (3.2). Clearly, for every \(R\in {\widetilde{{\mathcal {L}}}}'\cap {\widetilde{L_k}}\) with \(k\ge 2\) there is a unique \(K\in {\widetilde{{\mathcal {L}}}}'\cap {\widetilde{L_{k-1}}}\) such that \(F(R)\subset K\). For \(K\in {\widetilde{{\mathcal {L}}}}'\) we set

$$\begin{aligned} \text {Pre} (K)=\{ R\in {\widetilde{{\mathcal {L}}}}': F^j(R) \subset K \ \ \text { for a certain positive integer } j\}. \end{aligned}$$

Figure 6 shows examples of  \(\bigcup \text { Pre}(K)\) for \(n=2\). We have

$$\begin{aligned} \Big |\bigcup \text {Pre} (K)\Big |\le (2^{n}-1)|K|. \end{aligned}$$
(4.1)
Fig. 6
figure 6

Cubes K and \(\bigcup \text {Pre} (K)\) for \(n=2\)

Lemma 4.2

Let f be an integrable function on \((0,2)^n\). Assume that \(K\in {\widetilde{{\mathcal {L}}}}'\cap {\widetilde{L}}_m\). Then

$$\begin{aligned} \begin{aligned} \Big |\bigcup \text { Pre}(K)\Big | f_K&\le \sum _{R\in {\widetilde{{\mathcal {L}}}}'\cap {\widetilde{L}}_{m+1}\cap \text { Pre}(K)} |R|f_R +3^{2n} \sum _{R\in {\widetilde{{\mathcal {L}}}}'\cap {\widetilde{L}}_{m+1}\cap \text { Pre}(K)} |R|\inf _{y\in R} f^{\#}_{{\mathrm{loc}},\,(0,2)^n}(y)\\&\quad + \sum _{R\in {\widetilde{{\mathcal {L}}}}'\cap {\widetilde{L}}_{m+1}\cap \text { Pre}(K)} \Big |\bigcup \text { Pre}(R)\Big |f_R. \end{aligned} \end{aligned}$$

Proof

Set \(C_n=3^{2n}2^{-n}\). By the same arguments we used to prove (3.5), we get \(f_K\le f_R+C_n\inf _{y\in R} f^{\#}_{{\mathrm{loc}},\,(0,2)^n}(y)\) for \(R\in {\widetilde{L}}_{m+1}\) such that \(F(R)\subset K\). Hence,

$$\begin{aligned} \begin{aligned}&\Big |\bigcup \text { Pre}(K)\Big |f_K \\&\quad =\sum _{R\in {\widetilde{{\mathcal {L}}}}'\cap {\widetilde{L}}_{m+1}\cap \text { Pre}(K)} \Big (|R|f_K + \Big |\bigcup \text { Pre}(R)\big | f_K\Big )\\&\quad \le \sum _{R\in {\widetilde{{\mathcal {L}}}}'\cap {\widetilde{L}}_{m+1}\cap \text { Pre}(K)} \Big (|R|f_R +C_n|R|\inf _{y\in R} f^{\#}_{{\mathrm{loc}},\,(0,2)^n}(y)\Big ) \\&\qquad + \sum _{R\in {\widetilde{{\mathcal {L}}}}'\cap {\widetilde{L}}_{m+1}\cap \text { Pre}(K)} \Big ( C_n \Big |\bigcup \text { Pre}(R)\Big | \inf _{y\in R}f^{\#}_{{\mathrm{loc}},\,(0,2)^n}(y) \Big )\\&\qquad + \sum _{R\in {\widetilde{{\mathcal {L}}}}'\cap {\widetilde{L}}_{m+1}\cap \text { Pre}(K)} \Big |\bigcup \text { Pre}(R)\Big |f_R,\\ \end{aligned} \end{aligned}$$

which, by (4.1), finishes the proof. \(\square \)

Corollary 4.3

Assume that f is an integrable function on \((0,2)^n\). Then

$$\begin{aligned} f_{Q_1} \le \int _{(0,1]^n} f(y)\, dy + 3^{2n} \int _{(0,1]^n} f^{\#}_{{\mathrm{loc}},\,(0,2)^n}(y)\, dy. \end{aligned}$$
(4.2)

Proof

Observe that \(1=|Q_1|+\Big |\bigcup \text { Pre}(Q_1)\Big |\). Thus

$$\begin{aligned} f_{Q_1}=|Q_1|f_{Q_1}+\Big |\bigcup \text { Pre}(Q_1)\Big | f_{Q_1}. \end{aligned}$$

By iterating Lemma 4.2 we obtain that for every positive integer \(m \ge 2\) one has

$$\begin{aligned} f_{Q_1}&\le \sum _{j=1}^{m}\sum _{K \in {\widetilde{\mathcal {L}}}' \cap \widetilde{L}_j}|K|f_{K}+3^{2n}\sum _{j=2}^{m}\sum _{K \in {\widetilde{\mathcal {L}}}' \cap {\widetilde{L}}_j}|K| \inf _{y \in K}f^{\#}_{{\mathrm{loc}},\,(0,2)^n}(y)\\ {}&\quad + \sum _{K \in {\widetilde{\mathcal {L}}}' \cap \widetilde{L}_m} \Big |\bigcup \text { Pre}(K)\big |f_{K}. \end{aligned}$$

Letting \(m\rightarrow \infty \), we obtain the corollary, since the last summand tents to 0. \(\square \)

Corollary 4.4

There is a constant \(C'>0\) such that for every integrable function f on \((0,2)^n\) such that \(\int _{(0,2)^n}f(x)\, dx =0\) one has

$$\begin{aligned}&\sum _{\sigma \in G} f_{\sigma (Q_1)} \le C'\int _{(0,2)^n} f^{\#}_{{\mathrm{loc}},\,(0,2)^n}(y)\, dy, \end{aligned}$$
(4.3)
$$\begin{aligned}&\big | f_{\bigcup _{\sigma \in G}\sigma (Q_1)} \big |=2^{-n}\big | \sum _{\sigma \in G} f_{\sigma (Q_1)} \big | \le C'\int _{(0,2)^n} f^{\#}_{{\mathrm{loc}},\,(0,2)^n}(y)\, dy, \end{aligned}$$
(4.4)
$$\begin{aligned}&|f|_{\bigcup _{\sigma \in G}\sigma (Q_1)} \le C'\int _{(0,2)^n} f^{\#}_{{\mathrm{loc}},\,(0,2)^n}(y)\, dy, \end{aligned}$$
(4.5)
$$\begin{aligned}&|f|_{\sigma (Q_1)} \le C'\int _{(0,2)^n} f^{\#}_{{\mathrm{loc}},\,(0,2)^n}(y)\, dy. \end{aligned}$$
(4.6)

Proof

Clearly, \(\sum _{\sigma \in G} \int _{\sigma ((0,1]^n)} f\,dy=\int _{(0,2)^n}f\,dy=0\). Hence (4.3) follows from (4.2). The inequality (4.4) is a direct consequence of (4.3). Further we write

$$\begin{aligned} \int \limits _{\bigcup \sigma (Q_1)}|f|\,dy\le & {} \int \limits _{\bigcup \sigma (Q_1)}|f-f_{\bigcup \sigma (Q_1)}|\,dy+ |f_{\bigcup \sigma (Q_1)}|\\\le & {} \inf _{x \in \bigcup \sigma (Q_1)} f_{{\mathrm{loc}},\,(0,2)^n}^{\#} (x)+|f_{\bigcup \sigma (Q_1)}| \end{aligned}$$

and apply (4.4) to obtain (4.5) and then (4.6). \(\square \)

Assume that \(f\in L^1((0,2)^n)\). For \(x\in (0,1]^n\) we define the function \({\mathbf {S}} f(x)\) as follows

$$\begin{aligned} {\mathbf {S}} f(x)=|f|_{Q_1}+ 2^{1-n}3^{2n}\sum _{j=0}^{k-1} f^{\#}_{{\mathrm{loc}},\,(0,2)^n}(F^j(x)) \ \ \text {for} \ x\in K\in {\widetilde{L}}_k\cap {\widetilde{{\mathcal {L}}}}'. \end{aligned}$$

Proposition 4.5

For every constant \(0<b<1\) there is a constant \(C>0\) such that for all \(c,\alpha >0\), and every \(f \in L^1((0,2)^n)\) we have

$$\begin{aligned}&\left| \{x \in (0,1]^n :M_{\widetilde{\mathscr {D}}}f(x)>\alpha , f^{\#}_{{\mathrm{loc}},\,(0,2)^n}(x)<c\alpha \}\right| \\&\quad \le Cc\left| \{x \in (0,1]^n:M_{\widetilde{\mathscr {D}}}f(x)>b\alpha \}\right| +\left| \{x \in (0,1]^n : {\mathbf {S}}f(x) \ge b\alpha \}\right| . \end{aligned}$$

Proof

For \(x\in (0,1]^n\) let \({\widetilde{S}}f(x)\) be defined by (3.1). The same arguments we used to prove Lemma 3.3 give

$$\begin{aligned} {\widetilde{S}}f(x)\le {\widetilde{S}}(F(x))+2^{1-n}3^{2n}f^{\#}_{{\mathrm{loc}},\, (0,2)^n}(F(x)) \ \ \text { for} \ x\in (0,1]^n{\setminus } Q_1. \end{aligned}$$
(4.7)

Iteration of (4.7) leads to \({\widetilde{S}}f(x)\le {\mathbf {S}}f(x)\) for \(x\in (0,1]^n\). Now the proof is the same as that of Proposition 2.4. \(\square \)

Proof of Theorem 4.1

For \(f\in L^1_{{\mathrm{loc}},\,(0,2)^n}((0,2)^n)\) and \(\sigma \in G\) let \(f_\sigma (x)=f(\sigma (x))\). Since \(M_{\widetilde{\mathscr {D}}} f_\sigma = (M_{\widetilde{\mathscr {D}}} f)_\sigma \), \((f_\sigma )_{{\mathrm{loc}},\,(0,2)^n}^{\#}=(f_{{\mathrm{loc}},\,(0,2)^n}^{\#})_\sigma \), and \((0,2)^n=\bigcup _{\sigma \in G} \sigma ((0,1]^n)\), it suffices to prove that

$$\begin{aligned} \Vert M_{\widetilde{\mathscr {D}}}f\Vert _{L^p((0,1]^n)} \le C_p \Vert f^{\#}_{{\mathrm{loc}},\,(0,2)^n}\Vert _{L^p((0,2)^n)} \end{aligned}$$
(4.8)

for \(f\in L^1((0,2)^n)\), \(\int _{(0,2)^n} f=0\). Repeating the proof of Theorem 2.1 with the use of Proposition 4.5 we arrive at

$$\begin{aligned} \begin{aligned} \Vert M_{\widetilde{\mathscr {D}}}f\Vert _{L^p((0,1]^n)}&\le C\Vert {\mathbf {S}}f\Vert _{L^p((0,1]^n)} + C\Vert f^{\#}_{{\mathrm{loc}},\,(0,2)^n}\Vert _{L^p((0,1]^n)}\\&\le C' |f|_{Q_1} +C' \Vert f^{\#}_{{\mathrm{loc}},\,(0,2)^n}\Vert _{L^p((0,1]^n)}.\\ \end{aligned} \end{aligned}$$
(4.9)

Recall that the integral of f is zero. Hence, applying (4.6), we obtain the desired inequality (4.8). \(\square \)