1 Introduction and main results

In this paper we study two-phase free boundary problems governed by the p(x)-Laplacian with non-zero right hand side, continuing with our work in [22, 23], where we dealt with the one-phase version of these problems. Our purpose is to investigate the regularity of the free boundary. More precisely, we denote by

$$\begin{aligned} \Delta _{p(x)}u:=\text{ div } (|\nabla u|^{p(x)-2}\nabla u), \end{aligned}$$

with p a function such that \(1<p(x)<+\infty .\) Then, one of the two-phase problems we consider here is the following:

$$\begin{aligned} \left\{ \begin{array}{ll} \Delta _{p(x)} u = f, &{} \quad \hbox {in }\Omega ^+(u)\cup \Omega ^-(u), \\ (u_\nu ^+)^{p(x)}-(u_\nu ^-)^{p(x)}= g, &{} \quad \hbox {on }F(u):= \partial \Omega ^+(u) \cap \Omega , \end{array} \right. \end{aligned}$$
(1.1)

where \(\Omega \subset {\mathbb {R}}^n\) is a bounded domain and

$$\begin{aligned} \Omega ^+(u):= \{x \in \Omega : u(x)>0\}, \qquad \quad \Omega ^-(u):=\{x \in \Omega : u(x)\le 0\}^{\circ }, \end{aligned}$$

while \(u_\nu ^+\) and \(u_\nu ^-\) denote the normal derivatives in the inward direction to \(\Omega ^+(u)\) and \(\Omega ^-(u)\) respectively. F(u) is called the free boundary. Also, \(f\in L^{\infty }(\Omega )\) is continuous in \(\Omega ^+(u) \cup \Omega ^-(u)\), \(p\in C^1(\Omega )\) is a Lipschitz continuous function, and \(g\in C^{0, {\bar{\gamma }}}(\Omega ),\) \(g>0.\)

This problem comes out naturally from limits of singular perturbation problems with forcing term as in [32, 33], where solutions to (1.1), arising in the study of flame propagation with nonlocal and electromagnetic effects, are analyzed. On the other hand, nonnegative solutions to (1.1) appear in [36] where an optimal design problem is studied. Problem (1.1) is also obtained by minimizing the following functional

$$\begin{aligned} {J}(v)=\int _{\Omega }\left( \frac{|\nabla v|^{p(x)}}{p(x)}+q(x)(\lambda _+\chi _{\{v>0\}}+\lambda _-\chi _{\{v\le 0\}})+f(x)v\right) dx, \end{aligned}$$
(1.2)

where \(\lambda _+>\lambda _-\ge 0\) are given numbers and q is a strictly positive given function. For nonnegative minimizers we refer to [35] for the general energy (1.2), and to the seminal paper by Alt and Caffarelli [2] for the case \(p(x)\equiv 2\) and \(f\equiv 0.\)

In case of minimizers without sign restriction of the general energy (1.2)—problem originally treated in [3] with \(p(x)\equiv 2\) and \(f\equiv 0\)—the two-phase problem (1.1) is obtained with free boundary condition given by

$$\begin{aligned} (u_\nu ^+)^{p(x)}-(u_\nu ^-)^{p(x)}=q(x)p(x)\frac{(\lambda _+-\lambda _-)}{p(x)-1}, \end{aligned}$$
(1.3)

under suitable assumptions, see Appendix A.

In the present paper we will study a general two-phase free boundary problem of the type

$$\begin{aligned} \left\{ \begin{array}{ll} \Delta _{p(x)} u = f, &{} \quad \hbox {in }\Omega ^+(u)\cup \Omega ^-(u), \\ u_\nu ^+=G(u_\nu ^-,x), &{} \quad \hbox {on }F(u):= \partial \Omega ^+(u) \cap \Omega , \end{array} \right. \end{aligned}$$
(1.4)

which includes, in particular, problem (1.1).

We are interested in the regularity of the free boundary for viscosity solutions of problem (1.4).

In this paper, we are following the strategy developed in [13, 14]—inspired by [12]—for two-phase problems with non-zero right hand side, respectively in a linear and a fully nonlinear uniformly elliptic setting. The same technique was applied to the p-Laplace operator (\(p(x)\equiv p\) in (1.1)) for the one-phase case, with \(p\ge 2\), in [37] and to the p(x)-Laplace operator in one-phase in [22, 23].

Let us mention that the two-phase problem (1.4), in the linear homogeneous case, governed by the Laplacian, i.e., when \(p(x)\equiv 2\) and \(f\equiv 0\), was settled in the classical works by Caffarelli [6, 7]. These results have been widely generalized to different classes of homogeneous elliptic problems. See for example [9, 25, 26] for linear operators, [5, 19,20,21, 43, 44] for fully nonlinear operators and [38, 39] for the p-Laplacian. The general strategy followed by these papers, however, seems not so suitable when a non-zero right hand side is present, as it is our case.

We also point out that, in the one-phase case, problem (1.4) with non-zero right hand side was dealt with in [34]. There, the \(C^{1,\alpha }\) regularity of the free boundary near flat free boundary points was obtained, for weak (variational) solutions, following the approach in [2]. However, it is not clear how to adapt these techniques to the two-phase case.

We here apply the tools introduced in [12], and then extended in [13, 14], and we prove that flat free boundaries of two-phase viscosity solutions of (1.4) are \(C^{1,\gamma }.\)

Our assumptions on the function p(x) will be

$$\begin{aligned} p\in C^1(\Omega ),\qquad 1<p_{\min }\le p(x)\le p_{\max }<\infty ,\qquad \nabla p \in L^{\infty }(\Omega ), \end{aligned}$$
(1.5)

for some positive constants \(p_{\min }\) and \(p_{\max }\), and our assumptions on f will be

$$\begin{aligned} f\in L^{\infty }(\Omega ),\qquad f\text { is continuous in }\Omega ^+(u)\cup \Omega ^-(u). \end{aligned}$$
(1.6)

Our results also hold in case f is merely bounded measurable, but we assume (1.6) to avoid technicalities.

In order to simplify the presentation, we prefer to start our research by focusing our attention on a particular case of problem (1.4), which is

$$\begin{aligned} \left\{ \begin{array}{ll} \Delta _{p(x)} u = f, &{} \quad \hbox {in }\Omega ^+(u)\cup \Omega ^-(u), \\ (u_\nu ^+)^2-(u_\nu ^-)^2=1, &{} \quad \hbox {on }F(u):= \partial \Omega ^+(u) \cap \Omega , \end{array} \right. \end{aligned}$$
(1.7)

and then deal with the general case (1.4).

In fact, let \(x_0\in F(u)\). Without loss of generality we assume that \(x_0=0\). Also, for notational convenience we set \(p_0=p(0)\).

Let us denote \(U_\beta \) the one-dimensional function,

$$\begin{aligned} U_\beta (t) = \alpha t^+ - \beta t^-, \quad \beta \ge 0, \quad \alpha = \sqrt{1 +\beta ^2}, \end{aligned}$$

where

$$\begin{aligned} t^+ = \max \{t,0\}, \quad t^-= -\min \{t,0\}. \end{aligned}$$

Then \(U_\beta (x)= U_\beta (x_n)\) is the so-called two-plane solution to (1.7) when \(f \equiv 0\) and \(p(x)\equiv p_0\).

Let us state our main results for problem (1.7) (for notation and the precise definition of viscosity solution to (1.7) we refer to Sect. 2).

Theorem 1.1

Let u be a viscosity solution to (1.7) in \(B_1\). Let \(0<{\hat{\beta }}<L\). Assume \(f\in L^\infty (B_1)\) is continuous in \(B_1^{+}(u)\cup B_1^{-}(u)\) and p satisfies (1.5) in \(B_1\). There exists a universal constant \({{\bar{\varepsilon }}}>0\) such that, if

$$\begin{aligned} \Vert u - U_{\beta }\Vert _{L^{\infty }(B_{1})} \le {{\bar{\varepsilon }}}\quad \text {for some }\, 0 <{\hat{\beta }}\le \beta \le L, \end{aligned}$$
(1.8)

and

$$\begin{aligned} \Vert \nabla p\Vert _{L^\infty (B_1)} \le {{\bar{\varepsilon }}}, \qquad \Vert f\Vert _{L^\infty (B_1)} \le {{\bar{\varepsilon }}}, \end{aligned}$$

then F(u) is \(C^{1,\gamma }\) in \(B_{1/2}\). Here \(\gamma \) is universal and the \(C^{1,\gamma }\) norm of F(u) is bounded by a universal constant.

Theorem 1.1 is obtained as a consequence of the following result, which is a two-phase counterpart of our Theorem 1.1 in [22] in the one-phase setting:

Theorem 1.2

(Flatness implies \(C^{1,\gamma }\)) Let u be a viscosity solution to (1.7) in \(B_1\). Let \(0<{\hat{\beta }}<L\). Assume \(f\in L^\infty (B_1)\) is continuous in \(B_1^{+}(u)\cup B_1^{-}(u)\) and p satisfies (1.5) in \(B_1\). There exists a universal constant \({{\bar{\varepsilon }}}>0\) such that, if

$$\begin{aligned} U_{\beta }(x_n-{{\bar{\varepsilon }}}) \le u(x) \le U_\beta (x_n+ {{\bar{\varepsilon }}}) \ \text {in} \ B_1\quad \text {for some }\,0 <{\hat{\beta }}\le \beta \le L, \end{aligned}$$

and

$$\begin{aligned} \Vert \nabla p\Vert _{L^\infty (B_1)} \le {{\bar{\varepsilon }}}, \qquad \Vert f\Vert _{L^\infty (B_1)} \le {{\bar{\varepsilon }}}, \end{aligned}$$

then F(u) is \(C^{1,\gamma }\) in \(B_{1/2}\). Here \(\gamma \) is universal and the \(C^{1,\gamma }\) norm of F(u) is bounded by a universal constant.

In the context of problem (1.7), a constant is called universal if it depends only on n, \(p_{\min }\), \(p_{\max }\), \({\hat{\beta }}\) and L.

The proof of Theorem 1.2 is based on an improvement of flatness, obtained via a compactness argument which linearizes the problem into a limiting one. The key tool is a geometric Harnack inequality that localizes the free boundary well, and allows the rigorous passage to the limit.

We want to emphasize that our smoothness assumptions on the solution and on the data are the same as the ones in our Theorem 1.1 in [22] for the one-phase problem. In particular, in order to obtain these results we don’t need to assume that the solution is Lipschitz continuous.

These previous remarks also apply to our results for problem (1.4) (see Theorems 1.3 and  1.4 below).

When dealing with the general problem (1.4), we assume the following basic hypotheses on the function G:

$$\begin{aligned} G(\eta ,x):[0,\infty )\times \Omega \rightarrow (0,\infty ) \end{aligned}$$

and, for \(0<{\hat{\beta }}<L\),

  1. (H1)

    \(G(\eta ,\cdot )\in C^{0,{{\bar{\gamma }}}}(\Omega )\) uniformly in \(\eta \in [\frac{{\hat{\beta }}}{2},4L]\); \(G(\cdot ,x)\in C^{1,{{\bar{\gamma }}}}([\frac{{\hat{\beta }}}{2},4\,L])\) for every \(x\in \Omega \) and \(G\in L^\infty ((\frac{{\hat{\beta }}}{2},4\,L)\times \Omega )\).

  2. (H2)

    \(G'(\cdot , x)>0\) in \([\frac{{\hat{\beta }}}{2},4L]\) for \(x\in \Omega \) and, for some \(\gamma _0\) constant, \(G\ge \gamma _0>0\) in \([\frac{{\hat{\beta }}}{2},4L]\times \Omega \).

These assumptions are complemented with the additional structural conditions (H3) and (H4) that are introduced and discussed in detail in Sect. 7.

We present some interesting examples of functions satisfying (H1)–(H4) in Remarks 7.7 to 7.12.

Let \(x_0\in F(u)\). Without loss of generality we assume that \(x_0=0\). Also, for notational convenience we set \(p_0=p(0)\) and

$$\begin{aligned} G_0(\beta )=G(\beta ,0). \end{aligned}$$

Let \(U_\beta \) be the two-plane solution to (1.4) when \(p(x)\equiv p_0\), \(f \equiv 0 \) and \(G=G_0\), i.e.,

$$\begin{aligned} U_\beta (x) = \alpha x_n^+ - \beta x_n^-, \quad \beta \ge 0, \quad \alpha =G_0(\beta ). \end{aligned}$$

Then our main results for the general problem (1.4) are the following (for the precise definition of viscosity solution to (1.4) we refer to Sect. 7):

Theorem 1.3

Let u be a viscosity solution to (1.4) in \(B_1\). Let \(0<{\hat{\beta }}<L\). Assume \(f\in L^\infty (B_1)\) is continuous in \(B_1^{+}(u)\cup B_1^{-}(u)\), p satisfies (1.5) and G satisfies assumptions (H1)–(H4) in \(B_1\). There exists a universal constant \({{\bar{\varepsilon }}}>0\) such that, if

$$\begin{aligned} \Vert u - U_{\beta }\Vert _{L^{\infty }(B_{1})} \le {{\bar{\varepsilon }}}\quad \text {for some }\, 0 <{\hat{\beta }}\le \beta \le L, \end{aligned}$$

and

$$\begin{aligned}{} & {} \Vert \nabla p\Vert _{L^\infty (B_1)} \le {{\bar{\varepsilon }}}, \qquad \Vert f\Vert _{L^\infty (B_1)} \le {{\bar{\varepsilon }}},\\{} & {} {[}G(\eta ,\cdot )]_{C^{0,{{\bar{\gamma }}}}(B_1)} \le {{\bar{\varepsilon }}}, \quad \text {for all }\, 0<\frac{{\hat{\beta }}}{2} \le \eta \le 4L, \end{aligned}$$

then F(u) is \(C^{1,\gamma }\) in \(B_{1/2}\). Here \(\gamma \) is universal and the \(C^{1,\gamma }\) norm of F(u) is bounded by a universal constant.

We obtain Theorem 1.3 as a consequence of the following result, which is the two-phase counterpart of our Theorem 1.1 in [22] in the one-phase setting:

Theorem 1.4

(Flatness implies \(C^{1,\gamma }\)) Let u be a viscosity solution to (1.4) in \(B_1\). Let \(0<{\hat{\beta }}<L\). Assume \(f\in L^\infty (B_1)\) is continuous in \(B_1^{+}(u)\cup B_1^{-}(u)\), p satisfies (1.5) and G satisfies assumptions (H1)–(H4) in \(B_1\). There exists a universal constant \({{\bar{\varepsilon }}}>0\) such that, if

$$\begin{aligned} U_{\beta }(x_n-{{\bar{\varepsilon }}}) \le u(x) \le U_\beta (x_n+ {{\bar{\varepsilon }}}) \ \text {in} \ B_1\quad \text {for some }\, 0 <{\hat{\beta }}\le \beta \le L, \end{aligned}$$

and

$$\begin{aligned}{} & {} \Vert \nabla p\Vert _{L^\infty (B_1)} \le {{\bar{\varepsilon }}}, \qquad \Vert f\Vert _{L^\infty (B_1)} \le {{\bar{\varepsilon }}},\nonumber \\{} & {} {[}G(\eta ,\cdot )]_{C^{0,{{\bar{\gamma }}}}(B_1)} \le {{\bar{\varepsilon }}}, \quad \text {for all }\, 0<\frac{{\hat{\beta }}}{2} \le \eta \le 4L, \end{aligned}$$
(1.9)

then F(u) is \(C^{1,\gamma }\) in \(B_{1/2}\). Here \(\gamma \) is universal and the \(C^{1,\gamma }\) norm of F(u) is bounded by a universal constant.

In the context of problem (1.4), a constant depending only on n, \(p_{\min }\), \(p_{\max }\), \({{\hat{\beta }}}\), L, \([G(\eta ,\cdot )]_{C^{0,{{\bar{\gamma }}}}}\), \(\Vert G(\cdot , x)\Vert _{C^{1,{{\bar{\gamma }}}}}\), \(\Vert G\Vert _{L^\infty }\), \(\gamma _0\) and the constants C and \(\delta \) in assumptions (H3)–(H4) is called universal.

Let us mention that in the case of the p(x)-Laplacian some constants may depend on \(\Vert u\Vert _{L^\infty }\) (as those derived from Harnack inequality). Under the assumptions of Theorems 1.1 and 1.2, \(\Vert u \Vert _{L^\infty }\) can be bounded by a constant that depends only on L and under those of Theorems 1.3 and 1.4, \(\Vert u \Vert _{L^\infty }\) can be bounded by a constant that depends only on L and \(\Vert G\Vert _{L^\infty }\).

We would like to stress, at this point, that no regularity results were known up to the moment on free boundary problems for the p(x)-Laplacian in the two-phase setting. Moreover, after the contributions of [13, 14] for inhomogeneous uniformly elliptic two-phase problems, our regularity results are the first ones for two-phase problems for singular/degenerate operators with non-zero right hand side.

We point out that, as was already the case in [22, 23] for the treatment of the one-phase version of problem (1.4), carrying out, for the inhomogeneous p(x)-Laplace operator, the strategy devised in [13, 14] for two-phase problems for inhomogeneous uniformly elliptic operators, presented challenging difficulties due to the type of nonlinear behavior of the p(x)-Laplacian. In fact, the p(x)-Laplacian is a nonlinear operator that appears naturally in divergence form from minimization problems, i.e., in the form \({\textrm{div}}A(x,\nabla u)=f(x)\), with

$$\begin{aligned} \lambda |\eta |^{p(x)-2}|\xi |^2\le \sum _{i,j=1}^n\frac{\partial A_i}{\partial \eta _j}(x,\eta )\xi _i\xi _j\le \Lambda |\eta |^{p(x)-2}|\xi |^2, \quad \xi \in {\mathbb {R}}^n, \end{aligned}$$
(1.10)

where \(0<\lambda \le \Lambda \). This operator is singular in the regions where \(1<p(x)<2\) and degenerate in the ones where \(p(x)>2\). Its treatment is particularly delicate in the presence of a non-zero right hand side since, in this case, the factor \(|\eta |^{p(x)-2}\) in (1.10) can not be neglected.

One of the key differences between our situation and the one in [13, 14] is that in these later works, given u a viscosity solution to the free boundary problem, the functions \(v=u-\alpha x_n\) and \(v=u-\beta x_n\) are solutions in \(\Omega ^+(u)\cup \Omega ^-(u)\) to the same equation as u which, of course, is still uniformly elliptic. This fact is repeatedly used throughout the proofs. In contrast, in the problems under study in the present paper, such functions v are viscosity solutions in \({\mathcal {D}}:=\Omega ^+(u)\cup \Omega ^-(u)\) to an inhomogeneous equation with nonstandard growth of general type of the form

$$\begin{aligned} {\textrm{div}}A(x,\nabla v)=f(x)\quad \text { in }{\mathcal {D}}, \end{aligned}$$
(1.11)

where \(A:{\mathcal {D}}\times {\mathbb {R}}^n\rightarrow {\mathbb {R}}^n\) satisfies the following structure conditions:

For some positive constants \(C_1,C_2,C_3, C_4\), and for every \(x\in {\mathcal {D}}\) and \(\xi \in {\mathbb {R}}^n\),

$$\begin{aligned} |A(x,\xi )|\le C_1 |\xi |^{p(x)-1} +C_2 \end{aligned}$$
(1.12)

and

$$\begin{aligned} \langle A(x,\xi ),\xi \rangle \ge C_3|\xi |^{p(x)}-C_4, \end{aligned}$$
(1.13)

where p(x) verifies (1.5). We stress that the treatment of an equation of singular/degenerate type satisfying (1.11), (1.12) and (1.13) is highly nontrivial, in particular when—as in our case—the right hand side in (1.11) is not zero. Moreover, the presence of the non-zero constants \(C_2\) and \(C_4\) in (1.12) and (1.13)—which in the case of the structure conditions for the p(x)-Laplacian are zero—makes the treatment of this equation much more delicate than that of the p(x)-Laplacian itself.

Let us remark at this point that the main arguments in the approach in [13, 14] are based on Harnack inequality for the operator under consideration. Hence a key tool for the proof of our results is a Harnack inequality for an auxiliary inhomogeneous operator with nonstandard growth (see Theorem 4.3), originally proven in [22] and modified here to allow the treatment of the two-phase problems (1.7) and (1.4).

Unlike Harnack inequality for the inhomogeneous uniformly elliptic operators dealt with in [13, 14], where nonnegative solutions satisfy the inequality of standard form

$$\begin{aligned} \sup _{{B_r}}v\le C\big (\inf _{B_r}v+ {||f||_{L^{\infty }(B_{r})}}\big ), \end{aligned}$$

the corresponding inequality we are forced to use here (i.e., Theorem 4.3) requires a very delicate handling and highly non-trivial computations, that can be found at different stages of our work (see, for instance, Lemma 4.5, Theorem 4.1 and Lemma 7.4).

Another invaluable tool for the proof of our main theorems is a result concerning the existence of barrier functions for the inhomogeneous p(x)-Laplacian operator (see Theorem 4.4), which was originally proven in [22] and that is carefully revisited here to allow the treatment of the two-phase problems (1.7) and (1.4). The present proof requires very accurate computations which are reflected in the nontrivial choice of the growth in the bounds appearing in (4.4) and (4.6). This choice is then reflected in the growth order required both for the exponent p(x) and the right hand side f in all the results in the paper, and it eventually leads to the proper choice of the universal constant \({\bar{\varepsilon }}\) appearing in the statement of our main theorems. This barrier result is novel and of possible interest in other contexts, even in the case of the p-Laplacian (i.e., when p(x) is a constant).

The difficulties present in the treatment of two-phase free boundary problems for the inhomogeneous nonstandard growth equation \(\Delta _{p(x)} u = f\) also appear in the proof of Theorems 1.3 and 1.4, where we deal with a general free boundary condition of the type

$$\begin{aligned} u_\nu ^+=G(u_\nu ^-,x). \end{aligned}$$
(1.14)

In fact, once more the arguments used in [13, 14] to deal with \(u-\alpha x_n\) do not apply here. We successfully study a general free boundary condition of the type (1.14), by carefully choosing a different set of assumptions on the function G. This choice allows, in particular, the treatment of problem (1.1), that arises in different applications such as the study of limits of singular perturbation problems and the study of minimizers of (1.2). Moreover, our assumptions allow the inclusion of some interesting free boundary conditions, that we discuss in detail in Sect. 7 (see Remarks  7.7 to 7.12).

We would like to point out that the p(x)-Laplacian is a prototype operator with nonstandard growth. Partial differential equations with nonstandard growth have been receiving a lot of attention due to their wide range of applications. Among them we mention the modeling of non-Newtonian fluids, for instance, electrorheological [42] or thermorheological fluids [4]. Other applications include nonlinear elasticity [45], image reconstruction [1, 10] and the modeling of electric conductors [46], to cite a few.

Let us finally refer the reader to the surveys [15, 24] for additional references on elliptic two-phase free boundary problems.

The paper is organized as follows. In Sects. 2 to 6 we deal with problem (1.7). Namely, in Sect. 2 we provide basic definitions and notation. Section 3 is devoted to the linearized problem. In Sect. 4 we obtain the necessary Harnack inequality which rigorously allows the linearization of the problem. Section 5 provides the proof of the improvement of flatness lemma. Then the main results for problem (1.7), i.e., Theorems 1.1 and  1.2, are proved in Sect. 6. In Sect. 7, we deal with a more general free boundary condition, i.e. with problem (1.4), and we prove the main results for this problem, Theorems 1.3 and  1.4. We also present examples of functions G satisfying assumptions (H1)–(H4) (Remarks 7.7 to 7.12). For the sake of completeness, in Appendix A, we briefly discuss how free boundary problem (1.1) appears in two-phase minimization problems and, in Appendix B, we introduce the Sobolev spaces with variable exponent, which are the appropriate spaces to work with weak solutions of the p(x)-Laplacian.

1.1 Assumptions

Throughout the paper we let \(\Omega \subset {\mathbb {R}}^n\) be a bounded domain.

Assumptions on p(x). We assume that the function p(x) verifies

$$\begin{aligned} p\in C^1(\Omega ),\qquad 1<p_{\min }\le p(x)\le p_{\max }<\infty ,\qquad \nabla p \in L^{\infty }(\Omega ), \end{aligned}$$
(1.15)

for some positive constants \(p_{\min }\) and \(p_{\max }\).

Assumptions on f. We assume that function f verifies

$$\begin{aligned} f\in L^{\infty }(\Omega ),\qquad f\text { is continuous in }\Omega ^+(u)\cup \Omega ^-(u). \end{aligned}$$
(1.16)

Our results also hold in case f is merely bounded measurable, but we assume (1.16) to avoid technicalities.

Assumptions on G. When dealing with the general problem (1.4), we assume that the function G,

$$\begin{aligned} G(\eta ,x):[0,\infty )\times \Omega \rightarrow (0,\infty ), \end{aligned}$$

satisfies conditions (H1)–(H4) that are discussed in detail in Sect. 7.

2 Basic definitions, notation and preliminaries

In this section, we provide notation, basic definitions and some preliminaries that will be relevant for our work.

Notation. For any continuous function \(u:\Omega \subset {\mathbb {R}}^n\rightarrow {\mathbb {R}}\) we denote

$$\begin{aligned} \Omega ^+(u):= \{x \in \Omega : u(x)>0\},\quad \Omega ^-(u):=\{x \in \Omega : u(x)\le 0\}^{\circ } \end{aligned}$$

and

$$\begin{aligned} F(u):= \partial \Omega ^+(u) \cap \Omega . \end{aligned}$$

We refer to the set F(u) as the free boundary of u, while \(\Omega ^+(u)\) is its positive phase (or side) and \(\Omega ^-(u)\) is the nonpositive phase.

From now on, \(U_\beta \) denotes the one-dimensional function,

$$\begin{aligned} U_\beta (t) = \alpha t^+ - \beta t^-, \quad \beta \ge 0, \quad \alpha = \sqrt{1 +\beta ^2}, \end{aligned}$$

where

$$\begin{aligned} t^+ = \max \{t,0\}, \quad t^-= -\min \{t,0\}. \end{aligned}$$

Then \(U_\beta (x)\equiv U_\beta (x_n)\) is the so-called two-plane solution to (1.7) when \(f \equiv 0\) and \(p(x)\equiv p_0\) with \(p_0\) constant. Here, as usual, \(x_n\) denotes \( x\cdot e_n\). Of course, we may replace direction \(e_n\) with a different direction as well.

We begin with some remarks on the p(x)-Laplacian. In particular, we recall the relationship between the different notions of solutions to \(\Delta _{p(x)}u=f\) we are using, namely, weak and viscosity solutions. Then we give the definition of viscosity solution to problem (1.7) and we deduce some consequences. We here refer to the usual definition of C-viscosity sub/supersolution and solution of an elliptic PDE, see e.g., [11].

We start by observing that direct calculations show that, for \(C^2\) functions u such that \(\nabla u(x)\not =0\) in some open set,

$$\begin{aligned} \begin{aligned} \Delta _{p(x)}u&=\text{ div } (|\nabla u|^{p(x)-2}\nabla u)\\&=|\nabla u(x)|^{p(x)-2}\left( \Delta u+(p(x)-2)\Delta _\infty ^Nu +\langle \nabla p(x),\nabla u(x)\rangle \log |\nabla u(x)| \right) , \end{aligned} \end{aligned}$$
(2.1)

where

$$\begin{aligned} \Delta _\infty ^Nu:=\Big \langle D^2 u(x)\frac{\nabla u(x)}{|\nabla u(x)|},\,\frac{\nabla u(x)}{|\nabla u(x)|}\Big \rangle \end{aligned}$$

denotes the normalized \(\infty \)-Laplace operator.

We also deduce that

$$\begin{aligned} \begin{aligned}&|\nabla u(x)|^{p(x)-2}\left( {\mathcal {M}}_{\lambda _0,\Lambda _0}^-(D^2u(x))+\langle \nabla p(x),\nabla u(x)\rangle \log |\nabla u(x)| \right) \\&\quad \le \Delta _{p(x)}u\le |\nabla u(x)|^{p(x)-2}\left( {\mathcal {M}}_{\lambda _0,\Lambda _0}^+(D^2u(x))+\langle \nabla p(x),\nabla u(x)\rangle \log |\nabla u(x)| \right) , \end{aligned} \end{aligned}$$
(2.2)

where \(\lambda _0:=\min \{1,p_{\min }-1\}\) and \(\Lambda _0:=\max \{1,p_{\max }-1\}.\) As usual, if \(0<\lambda \le \Lambda \) are numbers, and \(e_i\) is the \(i-\)th eigenvalue of the \(n\times n\) symmetric matrix M,  then \({\mathcal {M}}_{\lambda ,\Lambda }^+\) and \({\mathcal {M}}_{\lambda ,\Lambda }^-\) denote the extremal Pucci operators and are defined (see [8]) as

$$\begin{aligned} \begin{aligned} {\mathcal {M}}_{\lambda ,\Lambda }^+(M)&=\lambda \sum _{e_i<0}e_i+\Lambda \sum _{e_i>0}e_i,\\ {\mathcal {M}}_{\lambda ,\Lambda }^-(M)&=\Lambda \sum _{e_i<0}e_i+\lambda \sum _{e_i>0}e_i. \end{aligned} \end{aligned}$$

First we need (see Appendix B for the definition of Sobolev spaces with variable exponent)

Definition 2.1

Assume that \(1<p_{\min }\le p(x)\le p_{\max }<\infty \) with p(x) Lipschitz continuous in \(\Omega \) and \(f\in L^{\infty }(\Omega )\).

We say that \(u\in W^{1,p(\cdot )}(\Omega )\) is a weak supersolution of

$$\begin{aligned} \Delta _{p(x)}u=f,\quad \text{ in }\,\, \Omega , \end{aligned}$$
(2.3)

if for every \(\varphi \in C_0^{\infty }(\Omega )\), \(\varphi \ge 0\), there holds that

$$\begin{aligned} -\int _{\Omega } |\nabla u(x)|^{p(x)-2}\nabla u \cdot \nabla \varphi \, dx \le \int _{\Omega } \varphi \, f(x)\, dx. \end{aligned}$$

Analogously, we say that \(u\in W^{1,p(\cdot )}(\Omega )\) is a weak subsolution of (2.3), if for every \(\varphi \in C_0^{\infty }(\Omega ),\) \(\varphi \ge 0\), there holds that

$$\begin{aligned} -\int _{\Omega } |\nabla u(x)|^{p(x)-2}\nabla u \cdot \nabla \varphi \, dx \ge \int _{\Omega } \varphi \, f(x)\, dx. \end{aligned}$$

Finally, \(u\in W^{1,p(\cdot )}(\Omega )\) is a weak solution to (2.3) if it is both a weak sub- and supersolution.

We recall the following result we proved in [22] (see [22, Theorem 3.2])

Theorem 2.2

Let p and f be as in Definition 2.1. Assume moreover that \(f\in C(\Omega )\) and \(p\in C^1(\Omega )\).

Let \(u\in W^{1,p(\cdot )}(\Omega )\cap C(\Omega )\) be a weak solution to \(\Delta _{p(x)}u=f\) in \(\Omega \). Then u is a viscosity solution to \(\Delta _{p(x)}u=f\) in \(\Omega \).

Remark 2.3

We point out that the equivalence between weak and viscosity solutions to the p(x)-Laplacian with right hand side \(f\equiv 0\) was proved in [30]. On the other hand, this equivalence, in case \(p(x)\equiv p\) and \(f\not \equiv 0\) was dealt with in [28, 40]. See also [29] for the case \(p(x)\equiv p\) and \(f\equiv 0\).

Next we recall the following standard notion.

Definition 2.4

Given \(u, v \in C(\Omega )\), we say that v touches u by below (resp. above) at \(x_0 \in \Omega \) if \(u(x_0)= v(x_0),\) and

$$\begin{aligned} u(x) \ge v(x) \quad (\text {resp. }u(x) \le v(x)) \quad \text {in a neighborhood }O \text { of }x_0. \end{aligned}$$

If this inequality is strict in \(O \setminus \{x_0\}\), we say that v touches u strictly by below (resp. above).

Now we give the definition of viscosity solution to the problem (1.7).

Definition 2.5

Let u be a continuous function in \(\Omega \). We say that u is a viscosity solution to (1.7) in \(\Omega \), if the following conditions are satisfied:

  1. (i)

    \( \Delta _{p(x)} u = f\) in \(\Omega ^+(u) \cup \Omega ^-(u)\) in the weak sense of Definition 2.1.

  2. (ii)

    Let \(x_0 \in F(u)\) and \(v \in C^2(\overline{B^+(v)}) \cap C^2(\overline{B^-(v)})\) (\(B=B_\delta (x_0)\)) with \(F(v) \in C^2\). If v touches u by below (resp. above) at \(x_0 \in F(v)\), then

    $$\begin{aligned} (v_\nu ^+(x_0))^{2} - (v_\nu ^-(x_0))^{2} \le 1\quad (\text {resp. } \ge 1). \end{aligned}$$

Next theorem follows as a consequence of our Theorem 2.2.

Theorem 2.6

Let u be a viscosity solution to (1.7) in \(\Omega \). Then the following conditions are satisfied:

  1. (i)

    \( \Delta _{p(x)} u = f\) in \(\Omega ^+(u) \cup \Omega ^-(u)\) in the viscosity sense, that is:

    1. (ia)

      for every \(v\in C^2(\Omega ^+(u)\cup \Omega ^-(u)),\) if v touches u from above at \(x_0\in \Omega ^+(u)\cup \Omega ^-(u)\) and \(\nabla v(x_0)\not =0,\) then \(\Delta _{p(x_0)}v(x_0)\ge f(x_0),\) that is, u is a viscosity subsolution;

    2. (ib)

      for every \(v\in C^2(\Omega ^+(u)\cup \Omega ^-(u)),\) if v touches u from below at \(x_0\in \Omega ^+(u)\cup \Omega ^-(u)\) and \(\nabla v(x_0)\not =0,\) then \(\Delta _{p(x_0)}v(x_0)\le f(x_0),\) that is, u is a viscosity supersolution.

  2. (ii)

    Let \(x_0 \in F(u)\) and \(v \in C^2(\overline{B^+(v)}) \cap C^2(\overline{B^-(v)})\) (\(B=B_\delta (x_0)\)) with \(F(v) \in C^2\). If v touches u by below (resp. above) at \(x_0 \in F(v)\), then

    $$\begin{aligned} (v_\nu ^+(x_0))^{2} - (v_\nu ^-(x_0))^{2} \le 1\quad (\text {resp.} \ge 1). \end{aligned}$$

It is convenient to introduce also the notion of comparison sub/supersolutions we are going to deal with.

Definition 2.7

We say that \(v \in C(\Omega )\) is a (strict) comparison subsolution (resp. supersolution) to (1.7) in \(\Omega \), if \(v \in C^2(\overline{\Omega ^+(v) }) \cap C^2(\overline{\Omega ^-(v) }),\) \(\nabla v\not =0\) in \(\overline{\Omega ^+(v)}\cup \overline{\Omega ^-(v) }\) and the following conditions are satisfied:

  1. (i)

    \( \Delta _{p(x)} v > f \) (resp. \( < f \)) in \(\Omega ^+(v) \cup \Omega ^-(v)\) (see Remark 2.8).

  2. (ii)

    If \(x_0 \in F(v)\), then

    $$\begin{aligned} (v_\nu ^+(x_0))^{2} - (v_\nu ^-(x_0))^{2} >1\quad (\text {resp. } (v_\nu ^+(x_0))^{2} - (v_\nu ^-(x_0))^{2} <1). \end{aligned}$$

Remark 2.8

Let v be as in Definition 2.7. Since \(v \in C^2(\Omega ^+(v)\cup {\Omega ^-(v) })\) and \(\nabla v\not =0\) in \(\Omega ^+(v)\cup {\Omega ^-(v) }\) then \( \Delta _{p(x)} v > f \) (resp. \(<f\)) in \(\Omega ^+(v)\cup {\Omega ^-(v) }\) is understood pointwise, in the sense of (2.1).

Remark 2.9

Notice that by the implicit function theorem, according to our definition, the free boundary of a comparison sub/supersolution is \(C^2\).

Remark 2.10

Any (strict) comparison subsolution v (resp. supersolution) cannot touch a viscosity solution u by below (resp. by above) at a point \(x_0 \in F(v) \) (resp. F(u)).

Notation. From now on \(B_{\rho }(x_0)\subset {{\mathbb {R}}}^n\) will denote the open ball of radius \(\rho \) centered at \(x_0\), and \(B_{\rho }=B_{\rho }(0)\). A positive constant depending only on the dimension n, \(p_{\min }\), \(p_{\max }\), and on \({\hat{\beta }}\) and L (given in Theorems 1.1 and 1.2) will be called universal.

We will use c, \(c_i\) to denote small universal constants and C, \(C_i\) to denote large universal constants.

3 The linearized problem

Theorem 1.2 follows from the regularity properties of viscosity solutions to the following transmission problem

$$\begin{aligned} {\left\{ \begin{array}{ll} {\mathcal {L}}_{p_0}{\tilde{u}}=0 &{} \quad \text {in }B_\rho \cap \{x_n\not =0\}, \\ a ({{\tilde{u}}}_n)^+ - b ({{\tilde{u}}}_n)^-=0 &{} \quad \text {on }B_\rho \cap \{x_n =0\}, \end{array}\right. } \end{aligned}$$
(3.1)

where \(({{\tilde{u}}}_n)^{+}\) (resp. \(({{\tilde{u}}}_n)^-\)) denotes the derivative in the \(e_n\) direction of \({{\tilde{u}}}\) restricted to \(\{x_n >0\}\) (resp. \(\{x_n <0\}\)) and \(a>0,\) \(b\ge 0\) are constants.

Here \(p_0\) is a constant such that \(1<p_{\min }\le p_0\le p_{\max }<\infty \), and

$$\begin{aligned} {{\mathcal {L}}}_{p_0} {\tilde{u}}:= \Delta {\tilde{u}} +(p_0-2) {\partial }_{nn} {\tilde{u}}. \end{aligned}$$

Definition 3.1

We say that \({{\tilde{u}}} \in C(B_\rho )\) is a viscosity solution to (3.1) if:

  1. (i)

    \( {\mathcal {L}}_{p_0}{\tilde{u}} =0\,\, \text { in } B_\rho \cap \{x_n\not =0\}\), in the viscosity sense.

  2. (ii)

    Let \(\phi \) be a function of the form

    $$\begin{aligned} \phi (x) = A+ px_n^+- qx_n^-+B Q(x-y) \end{aligned}$$

    with

    $$\begin{aligned} Q(x) = \frac{1}{2} [\gamma x_n^2 - |x'|^2], \quad y=(y',0), \quad A \in {\mathbb {R}}, B>0 \end{aligned}$$

    and

    $$\begin{aligned} a p- b q>0. \end{aligned}$$

    Then \(\phi \) cannot touch \({\tilde{u}}\) strictly by below at a point \(x_0= (x_0', 0) \in B_{\rho }\).

Analogously, if

$$\begin{aligned} a p- bq<0 \end{aligned}$$

then \(\phi \) cannot touch \({\tilde{u}}\) strictly by above at \(x_0= (x_0', 0) \in B_{\rho }\).

Here \(\gamma \) is a fixed constant such that

$$\begin{aligned} \gamma >{\tilde{\gamma }}(n,p_{\min },p_{\max } ):=\max \left\{ \frac{\Lambda _0}{2\lambda _0}(n-1)-\frac{1}{2}, 1\right\} , \end{aligned}$$

where \(\lambda _0\) and \(\Lambda _0\) are as in (2.2).

Remark 3.2

The motivation of the choice of this particular \(\gamma \) in Definition 3.1 will be clear in the proof of Lemma 5.1.

We will use the following regularity result for viscosity solutions to the linearized problem (3.1). Here constants depending only on n, \(p_{\min }\) and \(p_{\max }\) are called universal.

Theorem 3.3

Let \({{\tilde{u}}}\) be a viscosity solution to (3.1) in \(B_{1/2}\) such that \(\Vert {{\tilde{u}}}\Vert _\infty \le 1\). Then \({{\tilde{u}}}\in C^{2}(\overline{B_{1/4}}\cap \{x_n\ge 0\}) \cap C^{2}(\overline{B_{1/4}}\cap \{x_n\le 0\})\) with a universal bound on the \(C^{2}\) norm. In particular, there exists a universal constant \({{\tilde{C}}}\) such that

$$\begin{aligned} |{{\tilde{u}}}(x) - {{\tilde{u}}}(0) -(\nabla _{x'}{{\tilde{u}}}(0)\cdot x' + {{\tilde{p}}}x_n^+ - {{\tilde{q}}}x_n^-)| \le {{\tilde{C}}} r^{2}, \quad \text {in }B_r \end{aligned}$$
(3.2)

for all \(r \le 1/4\) and with

$$\begin{aligned} a {{\tilde{p}}} - b {{\tilde{q}}}=0. \end{aligned}$$

Proof

The result was proven in Theorem 3.2 in [13] in the case of the Laplace operator (with \(\gamma =n-1\) in Definition 3.1). This proof also applies to the present case. \(\square \)

4 Harnack inequality

In this section we prove our main tool, a Harnack-type inequality for “flat" solutions to free boundary problem (1.7). This result will allow the rigorous linearization of our problem in Sect. 5.

We recall that, unless otherwise stated, our assumptions on p and f will be resp. (1.5) and (1.6), in the corresponding regions.

Theorem 4.1

(Harnack inequality) There exists a universal constant \(\bar{\varepsilon }\), such that if u is a solution of (1.7) that satisfies at some point \(x_0 \in B_2\)

$$\begin{aligned} U_\beta (x_n+ a_0) \le u(x) \le U_\beta (x_n+ b_0) \quad \text {in }B_r(x_0) \subset B_2, \end{aligned}$$
(4.1)

for some \(0<{{\hat{\beta }}} \le \beta \le L\), with

$$\begin{aligned} \begin{aligned} \Vert f\Vert _{L^\infty (B_2)}&\le \varepsilon ^2\min \{ 1, \beta ^{p_{\max }-1}\},\\ \Vert \nabla p\Vert _{L^\infty (B_2)}&\le \varepsilon ^{1+\theta }\min \{ 1, \beta ^{p_{\max }-1}\}, \quad 0<\theta \le 1, \end{aligned} \end{aligned}$$
(4.2)

and

$$\begin{aligned} b_0 - a_0 \le \varepsilon r, \end{aligned}$$

for some \(\varepsilon \le {{\bar{\varepsilon }}},\) then

$$\begin{aligned} U_{\beta }(x_n+ a_1) \le u(x) \le U_\beta (x_n+ b_1) \quad \text {in } B_{r/40}(x_0), \end{aligned}$$

with

$$\begin{aligned} a_0 \le a_1 \le b_1 \le b_0, \quad b_1 - a_1\le (1-c)\varepsilon r, \end{aligned}$$

and \(0<c<1\) universal.

Let

$$\begin{aligned} {{\tilde{u}}}_\varepsilon (x) = {\left\{ \begin{array}{ll} \dfrac{u(x) -\alpha x_n }{\alpha \varepsilon } &{}\quad \text {in }B_2^+(u) \cup F(u) \\ \ \\ \dfrac{u(x) -\beta x_n }{\beta \varepsilon } &{}\quad \text {in }B_2^-(u). \end{array}\right. } \end{aligned}$$

From a standard iterative argument (see [13]), we obtain the following corollary.

Corollary 4.2

Let u be as in Theorem 4.1 satisfying (4.1) for \(r=1\). Then, in \(B_1(x_0)\), \(\tilde{u}_\varepsilon \) has a Hölder modulus of continuity at \(x_0\), outside the ball of radius \(\varepsilon /{{\bar{\varepsilon }}},\) i.e. for all \(x \in B_1(x_0)\) with \(|x-x_0| \ge \varepsilon /{{\bar{\varepsilon }}}\)

$$\begin{aligned} |{{\tilde{u}}}_\varepsilon (x) - {{\tilde{u}}}_\varepsilon (x_0)| \le C |x-x_0|^{{\widehat{\gamma }}}. \end{aligned}$$

Here \({{\bar{\varepsilon }}}\) is as in Theorem 4.1, and C and \(0<{{\widehat{\gamma }}}<1\) are universal.

We will need the following Harnack inequality for an auxiliary inhomogeneous operator with nonstandard growth. This result will be repeatedly used along our work.

Theorem 4.3

Assume that \(1<p_{\min }\le p(x)\le p_{\max }<\infty \) with p(x) Lipschitz continuous in \(\Omega \) and \(\Vert \nabla p\Vert _{L^{\infty }}\le {L_0}\), for some \({L_0}>0\). Let \(x_0\in \Omega \) and \(0<R\le 1\) such that \(\overline{B_{4R}(x_0)}\subset \Omega \). Let \(v\in W^{1,p(\cdot )}(\Omega )\cap L^{\infty }(\Omega )\) be a nonnegative solution to

$$\begin{aligned} \text{ div } (|\nabla v+e|^{p(x)-2}(\nabla v+e)) =f \quad \text{ in } \Omega , \end{aligned}$$

where \(f\in L^{\infty }(\Omega )\) with \(||f||_{L^{\infty }(\Omega )}\le 1\) and \(e\in {\mathbb {R}}^n\) with \(|e|\le {\tilde{\sigma }}\). Then, there exists C such that

$$\begin{aligned} \sup _{{B_R}(x_0)}v\le C\Big [\inf _{B_R(x_0)}v+ R\Big ({||f||_{L^{\infty }(B_{4R}(x_0))}}^{\frac{1}{p_{\max }-1}}+C\Big )\Big ]. \end{aligned}$$
(4.3)

The constant C depends only on n, \(p_{\min }\), \(p_{\max }\), \(||v||_{L^{\infty }(B_{4R}(x_0))}\), \({\tilde{\sigma }}\) and \({L_0}\).

Proof

The proof was done in Lemma 4.1 in [22] under the assumption that \(|e|=1\). We can redo the computations in [22], with a careful tracking of the dependence on |e| in the constants, and this eventually leads us to the stated result. \(\square \)

We will also need the following theorem concerning the existence of barrier functions for the inhomogeneous p(x)-Laplacian operator. This result will be frequently employed throughout the paper.

Theorem 4.4

Let \(x_0\in B_1\) and \(0<{\bar{r}}_1<{\bar{r}}_2\le 1\). Assume that \(1<p_{\min }\le p(x)\le p_{\max }<\infty \). Let \(c_0, c_1, c_2, \mu _0\) be positive constants and let and \(c_3\in {\mathbb {R}}\). Let \(0<\mu \le \mu _0\). Assume moreover that

$$\begin{aligned} \Vert \nabla p\Vert _{L^{\infty }}\le \varepsilon ^{1+\theta }\min \{ 1, \mu ^{p_{\max }-1}\} \quad \text { for some }0<\theta \le 1. \end{aligned}$$
(4.4)

There exist positive constants \(\gamma \ge 1\), \({\bar{c}}\), \(\varepsilon _0\) and \(\varepsilon _1\) such that the functions

$$\begin{aligned} w(x)= & {} c_1|x-x_0|^{-\gamma }-c_2,\\ v(x)= & {} \mu \left[ q(x)+\frac{c_0}{2}\varepsilon (w(x)-1)\right] ,\quad q(x)=x_n+c_3 \end{aligned}$$

satisfy, for \({\bar{r}}_1\le |x-x_0|\le {\bar{r}}_2\),

$$\begin{aligned}{} & {} \Delta _{p(x)}w\ge {\bar{c}}, \quad \text {for }\, 0<\varepsilon \le \varepsilon _0,\end{aligned}$$
(4.5)
$$\begin{aligned}{} & {} \frac{\mu }{2}\le |\nabla v|\le 2\mu , \qquad \Delta _{p(x)}v > \varepsilon ^2\min \{ 1, \mu ^{p_{\max }-1}\}, \quad \text {for }\, 0<\varepsilon \le \varepsilon _1. \end{aligned}$$
(4.6)

Here \(\gamma =\gamma (n,p_{\min }, p_{\max })\), \({\bar{c}}={\bar{c}}(p_{\min }, p_{\max }, c_1)\), \(\varepsilon _0=\varepsilon _0(n,p_{\min }, p_{\max }, {\bar{r}}_1, c_1,\mu _0)\), \(\varepsilon _1=\varepsilon _1(n,p_{\min }, p_{\max }, {\bar{r}}_1, c_0, c_1, \theta , \mu _0)\).

Proof

The proof was done in Lemma 4.2 in [22] under the assumption that \(\mu =1\).

In order to get the result for any \(0<\mu \le \mu _0\), we need a careful revision of the computations in [22]. In fact, we first proceed as in (4.30) in [22] and obtain, using (4.4),

$$\begin{aligned} \Delta _{p(x)}w \ge 2{\bar{c}}-\varepsilon \min \{ 1, \mu ^{p_{\max }-1}\} C_4, \quad \text {for }{\bar{r}}_1\le |x|\le {\bar{r}}_2, \end{aligned}$$

with \({\bar{c}}={\bar{c}}(p_{\min }, p_{\max }, c_1)\) and \(C_4=C_4(n,p_{\min },p_{\max }, {\bar{r}}_1, c_1)\). Then, (4.5) follows.

We now denote

$$\begin{aligned} v(x)=\mu {\bar{v}}(x)\quad \text { with }\quad {\bar{v}}(x)=q(x)+\frac{c_0}{2}\varepsilon (w(x)-1). \end{aligned}$$

Hence (4.23) in [22] gives, for \({\bar{r}}_1\le |x|\le {\bar{r}}_2\),

$$\begin{aligned} \frac{1}{2}\le |\nabla {\bar{v}}|\le 2, \quad \text {for }\, \varepsilon \le {\bar{\varepsilon }}_1, \end{aligned}$$
(4.7)

if \(\varepsilon \le {\bar{\varepsilon }}_1={\bar{\varepsilon }}_1(n,p_{\min },p_{\max }, {\bar{r}}_1, c_0, c_1)\). So the first assertion in (4.6) follows.

Also (4.25) in [22] shows that, for \({\bar{r}}_1\le |x|\le {\bar{r}}_2\),

$$\begin{aligned} |\nabla {\bar{v}}|^{p(x)-1}\big |\log |\nabla {\bar{v}}| \big |\le C_3(p_{\min },p_{\max }), \qquad \text {if }\,\varepsilon \le {\bar{\varepsilon }}_1. \end{aligned}$$
(4.8)

Thus, using (4.4), (4.7) and (4.8) we get, for \({\bar{r}}_1\le |x|\le {\bar{r}}_2\),

$$\begin{aligned}&\Big ||\nabla v|^{p(x)-2}\langle \nabla p(x),\nabla v\rangle \log |\nabla v| \Big |\nonumber \\&\quad \le |\nabla v|^{p(x)-1}\big |\log |\nabla v| \big |\Vert \nabla p\Vert _{L^{\infty }}\nonumber \\&\quad ={\mu }^{p(x)-1}|\nabla {\bar{v}}|^{p(x)-1}\big |\log |\mu \nabla {\bar{v}}| \big |\Vert \nabla p\Vert _{L^{\infty }}\nonumber \\&\quad \le {\mu }^{p(x)-1} \big ({\bar{C}}|\log \mu | +C_3 \big )\Vert \nabla p\Vert _{L^{\infty }}\nonumber \\&\quad \le {\mu }^{p(x)-1} \big ({\bar{C}}|\log \mu | +C_3 \big ) \min \{ 1, \mu ^{p_{\max }-1}\}\varepsilon ^{1+\theta }\le {\mu }^{p(x)-1} {\bar{C}}_3 \varepsilon ^{1+\theta } \end{aligned}$$
(4.9)

if \(\varepsilon \le {\bar{\varepsilon }}_1\), where \({\bar{C}}={\bar{C}}(p_{\min }, p_{\max })\) and \({\bar{C}}_3={\bar{C}}_3(p_{\min }, p_{\max }, \mu _0)\). On the other hand, using (4.22) in [22], (4.7) and (4.9), we obtain, for \({\bar{r}}_1\le |x|\le {\bar{r}}_2\),

$$\begin{aligned} \begin{aligned} \Delta _{p(x)}v&=|\nabla v|^{p(x)-2}\Big (\Delta v+(p(x)-2)\Big \langle D^2v\frac{\nabla v}{|\nabla v|},\frac{\nabla v}{|\nabla v|}\Big \rangle +\langle \nabla p(x),\nabla v\rangle \log |\nabla v|\Big )\\&\ge |\nabla v|^{p(x)-2}\Big (\Delta v+(p(x)-2)\Big \langle D^2v\frac{\nabla v}{|\nabla v|},\frac{\nabla v}{|\nabla v|}\Big \rangle \Big )-\big ||\nabla v|^{p(x)-2}\langle \nabla p(x),\nabla v\rangle \log |\nabla v| \big |\\&\ge {\mu }^{p(x)-1}\left( |\nabla {\bar{v}}|^{p(x)-2}\Big (\Delta {\bar{v}}+(p(x)-2)\Big \langle D^2{\bar{v}}\frac{\nabla {\bar{v}}}{|\nabla {\bar{v}}|}, \frac{\nabla {\bar{v}}}{|\nabla {\bar{v}}|}\Big \rangle \Big ) - {\bar{C}}_3\varepsilon ^{1+\theta }\right) \\&\ge {\mu }^{p(x)-1}\left( \frac{c_0c_1\varepsilon }{2}|\nabla {\bar{v}}|^{p(x)-2} |x|^{-\gamma -2}- {\bar{C}}_3\varepsilon ^{1+\theta }\right) \ge {\mu }^{p(x)-1}\left( \varepsilon C_5 |x|^{-\gamma -2}- {\bar{C}}_3\varepsilon ^{1+\theta }\right) \\&\ge {\mu }^{p(x)-1}\left( \varepsilon C_5 -\varepsilon ^{1+\theta } {\bar{C}}_3\right) ={\mu }^{p(x)-1}\varepsilon \left( C_5-\varepsilon ^{\theta } {\bar{C}}_3\right) , \end{aligned} \end{aligned}$$

if \(\varepsilon \le {\bar{\varepsilon }}_1\), where we have used that \({\bar{r}}_2\le 1\) and \(C_5=C_5(p_{\min }, p_{\max }, c_0, c_1)\). We conclude that, for \({\bar{r}}_1\le |x|\le {\bar{r}}_2\),

$$\begin{aligned} \Delta _{p(x)}v \ge {\mu }^{p(x)-1}\varepsilon \left( C_5-\varepsilon ^{\theta } {\bar{C}}_3\right) \ge {\mu }^{p(x)-1}\varepsilon \frac{C_5}{2}> \varepsilon ^2\min \{ 1, \mu ^{p_{\max }-1}\}, \end{aligned}$$

if moreover \(\varepsilon \le {\tilde{\varepsilon }}_1= {\tilde{\varepsilon }}_1(p_{\min }, p_{\max }, c_0, c_1, \theta , \mu _0)\). That is, the second assertion in (4.6) follows. \(\square \)

The main tool in the proof of the Harnack inequality is the following lemma.

Lemma 4.5

There exists a universal constant \({{\bar{\varepsilon }}}>0\) such that if u is a solution of (1.7) and satisfies

$$\begin{aligned} U_\beta (x_n+\sigma )\le u(x)\le U_\beta (x_n+\sigma +\varepsilon ),\quad x\in B_1, \ \ |\sigma |<\frac{1}{20}, \end{aligned}$$
(4.10)

for some \(0 < \beta \le L\), with

$$\begin{aligned} \begin{aligned} \Vert f\Vert _{L^\infty (B_1)}&\le \varepsilon ^2\min \{ 1, \beta ^{p_{\max }-1}\},\\ \Vert \nabla p\Vert _{L^\infty (B_1)}&\le \varepsilon ^{1+\theta }\min \{ 1, \beta ^{p_{\max }-1}\}, \quad 0<\theta \le 1, \end{aligned} \end{aligned}$$
(4.11)

and in \({{\bar{x}}}=\frac{1}{10}e_n,\)

$$\begin{aligned} u({{\bar{x}}})\ge U_\beta \left( {{\bar{x}}}_n+\sigma +\frac{\varepsilon }{2}\right) , \end{aligned}$$

for some \(\varepsilon \le {\bar{\varepsilon }}\), then

$$\begin{aligned} u(x) \ge U_\beta (x_n+\sigma +c{\varepsilon }) \quad \text {in } {\overline{B}}_{\frac{1}{2}}, \end{aligned}$$
(4.12)

for some universal \(0<c<1.\) Analogously, if

$$\begin{aligned} u({{\bar{x}}})\le U_\beta \left( {{\bar{x}}}_n+\sigma +\frac{\varepsilon }{2}\right) , \end{aligned}$$

then

$$\begin{aligned} u(x) \le U_\beta (x_n+\sigma +(1-c){\varepsilon }) \quad \text {in } {\overline{B}}_{\frac{1}{2}}. \end{aligned}$$
(4.13)

Proof

We prove the first statement. For notational simplicity we drop the sub-index \(\beta \) from \(U_\beta \).

From (4.10) we have that \(u(x)\ge U(x_n+\sigma )\) in \(B_1\).

We also notice that \(B_{1/20}({\bar{x}})\subset B_1^+(u).\) Then,

$$\begin{aligned} \Delta _{p(x)}u=f\quad \text { in } B_{1/20}({\bar{x}}). \end{aligned}$$
(4.14)

Thus, by Theorem 1.1 in [18], \(u\in C^{1,{{\widetilde{\gamma }}}}\) in \({\overline{B}}_{1/40}({\bar{x}}),\) where \({{\widetilde{\gamma }}}={{\widetilde{\gamma }}} (p_{\min },p_{\max },n,L)\in (0,1)\) and \(||u||_{C^{1,{{\widetilde{\gamma }}}}({\overline{B}}_{1/40}({\bar{x}}))}\le C,\) with \(C=C (p_{\min },p_{\max },n,L)\ge 1.\) Here we have used (4.11) and also that (4.10) implies that \(||u||_{L^{\infty }(B_1)}\le 2\alpha \le 2\sqrt{1+L^2}\).

We will consider two cases:

Case (i). Suppose \(|\nabla u({\bar{x}})|<\frac{\alpha }{4}\). We choose \(r_1>0\), \(r_1=r_1(p_{\min },p_{\max },n,L)\le 1/40\) such that \(|\nabla u(x)|\le \frac{\alpha }{2}\) in \(B_{{r_1}}({\bar{x}}).\) In addition, there exists a constant \(0<r_2=r_2(r_1)=r_2(p_{\min },p_{\max },n,L)<r_1\) such that \((x-r_2e_n)\in B_{r_1}({\bar{x}}),\) for every \(x\in B_{r_1/2}({\bar{x}})\). We denote \(q(x)=\alpha (x_n+ \sigma )\) and we observe that \({\tilde{v}}=u-q\ge 0\) in \(B_{\frac{1}{20}}({\bar{x}})\) and satisfies

$$\begin{aligned} {\textrm{div}} (|\nabla {\tilde{v}}+\alpha e_n|^{p(x)-2}(\nabla {\tilde{v}}+\alpha e_n)) =f \quad \text{ in } B_{\frac{1}{20}}({\bar{x}}). \end{aligned}$$
(4.15)

We now apply Theorem 4.3 to the function \({\tilde{v}}=u-q\) in \(B_{4r_3}({\bar{x}})\), where \(r_3=\min \{\frac{r_1}{4},\frac{r_2}{8}\}.\) In particular we obtain from (4.3) that

$$\begin{aligned} \begin{aligned} u(x)-q(x)&\ge C^{-1}(u({\bar{x}})-q({\bar{x}}))- r_3\ge \frac{\alpha \varepsilon }{2C}- r_3, \end{aligned} \end{aligned}$$

for \(x\in B_{r_3}({\bar{x}})\). Here \(C=C(n,p_{\min }, p_{\max },L)\) is a universal constant because \(\Vert f\Vert _{L^\infty (B_1)} \le \varepsilon ^2\min \{ 1, \beta ^{p_{\max }-1}\}\) and \(\Vert \nabla p\Vert _{L^\infty (B_1)}\le \varepsilon ^{1+\theta }\min \{ 1, \beta ^{p_{\max }-1}\}\) see (4.11), and \(||{\tilde{v}}||_{L^{\infty }(B_1)}\le 3\sqrt{1+L^2}\).

On the other hand, for all \(x\in B_{r_3}({\bar{x}})\) we obtain

$$\begin{aligned} \begin{aligned} \frac{\alpha \varepsilon }{2C}- r_3&\le u(x)-q(x)=u((x-r_2e_n)+r_2e_n)-q((x-r_2e_n)+r_2e_n)\\&=u((x-r_2e_n)+r_2e_n)-q(x-r_2e_n)-\alpha r_2\\&\le u(x-r_2e_n)-q(x-r_2e_n)+\frac{\alpha r_2}{2}-\alpha r_2. \end{aligned} \end{aligned}$$

As a consequence, denoting \(c_0=C^{-1}\) and \({\bar{x}}_0:={\bar{x}}-r_2e_n\), and using that \(\alpha \ge 1\), we get for all \(x\in B_{r_3}({\bar{x}}_0)\)

$$\begin{aligned} \begin{aligned}&\alpha \frac{c_0}{2}\varepsilon =\frac{\alpha \varepsilon }{2C} \le \frac{\alpha \varepsilon }{2C}- r_3+\frac{r_2}{2}\le \frac{\alpha \varepsilon }{2C}- r_3 -\frac{\alpha r_2}{2}+\alpha r_2\le u(x)-q(x). \end{aligned} \end{aligned}$$
(4.16)

Let us define the function \(w:{\bar{A}}\rightarrow {\mathbb {R}},\) \(A:=B_{\frac{4}{5}}({\bar{x}}_0){\setminus } {\bar{B}}_{r_3}({\bar{x}}_0)\) as

$$\begin{aligned} w(x)=c\left( |x-{\bar{x}}_0|^{-\gamma }-\left( \frac{4}{5}\right) ^{-\gamma }\right) , \end{aligned}$$

for \(\gamma =\gamma (n,p_{\min }, p_{\max })\ge 1\) given in Theorem 4.4. We choose \(c=c(n,p_{\min }, p_{\max }, L)\) positive in such a way that

$$\begin{aligned} w=\left\{ \begin{array}{ll} 0,&{}\quad \text{ on }\quad \partial B_{\frac{4}{5}}({\bar{x}}_0)\\ 1,&{}\quad \text{ on }\quad \partial B_{r_3}({\bar{x}}_0) \end{array} \right. \end{aligned}$$

and we extend w to 1 in \(B_{r_3}({\bar{x}}_0)\).

Now set \(\psi =1-w\) and, for \(t \ge 0,\)

$$\begin{aligned} v_t(x)= U(x_n +\sigma - \frac{\varepsilon }{2} c_0 \psi (x)+t\varepsilon ), \quad x \in {{\overline{B}}}_{\frac{4}{5}}({\bar{x}}_0). \end{aligned}$$
(4.17)

Then,

$$\begin{aligned} v_0(x)=U\left( x_n +\sigma - \frac{\varepsilon }{2} c_0 \psi (x)\right) \le U(x_n+\sigma ) \le u(x) \quad x \in {{\overline{B}}}_{\frac{4}{5}}({\bar{x}}_0). \end{aligned}$$

Let \({{\bar{t}}}\) be the largest \(t \ge 0\) such that

$$\begin{aligned} v_{t}(x) \le u(x) \quad \text {in } {{\overline{B}}}_{\frac{4}{5}}({\bar{x}}_0). \end{aligned}$$

We want to show that \({{\bar{t}}} \ge \frac{c_0}{2}.\) Then we get the desired statement. Indeed,

$$\begin{aligned} u(x) \ge v_{{{\bar{t}}}}(x) = U(x_n +\sigma - \frac{\varepsilon }{2} c_0 \psi + {{\bar{t}}} \varepsilon ) \ge U(x_n +\sigma + c\varepsilon ) \quad \text {in }B_{1/2} \subset \subset B_{\frac{4}{5}}({\bar{x}}_0) \end{aligned}$$

with \(0<c=c(n,p_{\min }, p_{\max },L)<1\). In the last inequality we used that there holds \(\Vert \psi \Vert _{L^\infty (B_{1/2})}=c_1(n,p_{\min }, p_{\max }, L) <1.\)

Suppose \({{\bar{t}}} < \frac{c_0}{2}\). Then at some \({{\tilde{x}}} \in B_{\frac{4}{5}}({\bar{x}}_0)\) we have

$$\begin{aligned} v_{{{\bar{t}}}}({{\tilde{x}}}) = u({{\tilde{x}}}). \end{aligned}$$

We show that such touching point can only occur on \({\overline{B}}_{r_3}({\bar{x}}_0).\) Indeed, since \(w\equiv 0\) on \(\partial B_{\frac{4}{5}}({\bar{x}}_0)\), from the definition of \(v_t\) we get that for \({{\bar{t}}} < \frac{c_0}{2}\)

$$\begin{aligned} v_{{{\bar{t}}}}(x) =U(x_n +\sigma -\frac{\varepsilon }{2} c_0\psi (x) + {{\bar{t}}} \varepsilon ) < U(x_n+\sigma ) \le u(x)\quad \text {on }\partial B_{\frac{4}{5}}({\bar{x}}_0). \end{aligned}$$

We now show that \({{\tilde{x}}}\) cannot belong to the annulus A.

Indeed, from Theorem 4.4 it follows that in \(A^+(v_{{{\bar{t}}}})\)

$$\begin{aligned} \Delta _{p(x)}v_{{{\bar{t}}}} > \varepsilon ^2\min \{ 1, \alpha ^{p_{\max }-1}\} \ge \varepsilon ^2\min \{ 1, \beta ^{p_{\max }-1}\} \ge \Vert f\Vert _\infty \end{aligned}$$

for \(\varepsilon _1=\varepsilon _1(n,p_{\min }, p_{\max }, L)\). An analogous computation holds in \(A^-(v_{{{\bar{t}}}}).\)

Finally,

$$\begin{aligned} (v_{{{\bar{t}}}}^+)_\nu ^2 - (v_{{{\bar{t}}}}^-)_\nu ^2 = 1 + \varepsilon ^2 \frac{c_0^2}{4} |\nabla \psi |^2 - 2\varepsilon \frac{c_0}{2} \psi _n \quad \text {on }F(v_{{{\bar{t}}}}) \cap A. \end{aligned}$$

Thus,

$$\begin{aligned} (v_{{{\bar{t}}}}^+)_\nu ^2 - (v_{{{\bar{t}}}}^-)_\nu ^2 > 1 \quad \text {on }F(v_{{{\bar{t}}}}) \cap A, \end{aligned}$$

since

$$\begin{aligned} -{\tilde{c}}_1\le \psi _n \le -{\tilde{c}}_2 <0 \quad \text {on } F(v_{{{\bar{t}}}}) \cap A, \end{aligned}$$
(4.18)

with \({\tilde{c}}_1\) and \({\tilde{c}}_2\) universal constants. This can be verified from the formula for \(\psi \), for \(\varepsilon \le \varepsilon _2\), with \(\varepsilon _2\) universal (see, for instance, Lemma 5.1 in [22]).

Thus, \(v_{{{\bar{t}}}}\) is a strict subsolution to (1.7) in A which lies below u. Hence, by the definition of viscosity solution, \({{\tilde{x}}}\) cannot belong to A.

Therefore, \({{\tilde{x}}} \in {\overline{B}}_{r_3}({\bar{x}}_0)\) and

$$\begin{aligned} u({{\tilde{x}}})=v_{{{\bar{t}}}}({{\tilde{x}}}) = U({{\tilde{x}}}_n+\sigma + {{\bar{t}}} \varepsilon ) \le U({{\tilde{x}}}_n+\sigma ) + \alpha {{\bar{t}}} \varepsilon < U({{\tilde{x}}}_n+\sigma ) + \alpha \frac{c_0}{2} \varepsilon . \end{aligned}$$

This contradicts (4.16).

Case (ii). Now suppose \(|\nabla u({\bar{x}})|\ge \frac{\alpha }{4}.\) By exploiting the \(C^{1,{{\widetilde{\gamma }}}}\) regularity of u in \({\overline{B}}_{\frac{1}{40}}({\bar{x}})\), we know that u is Lipschitz continuous in \({\overline{B}}_{\frac{1}{40}}({\bar{x}})\), as well as there exists a constant \(0<r_0=r_0(n, p_{\min },p_{\max },L)\), with \(8r_0\le \frac{1}{40}\), and \(C=C(n,p_{\min },p_{\max },L)>1\) such that

$$\begin{aligned} \frac{1}{8}\le |\nabla u|\le C \quad \text { in } B_{8r_0}({\bar{x}}). \end{aligned}$$

In addition, since (4.14) holds, it follows by Proposition 3.4 in [22], that \(u\in W^{2,n}(B_{4r_0}({\bar{x}}))\) and it is a solution to the linear uniformly elliptic equation

$$\begin{aligned} {\mathcal {L}}h=f \quad \text { in } B_{4r_0}({\bar{x}}), \end{aligned}$$

where

$$\begin{aligned} {\mathcal {L}}h&=\text{ Tr }(A(x)D^2h(x))+\langle b,\nabla h(x)\rangle ,\\ A(x)&:=|\nabla u|^{p(x)-2}\left( I+(p(x)-2)\frac{\nabla u(x)}{|\nabla u(x)|}\otimes \frac{\nabla u(x)}{|\nabla u(x)|}\right) , \end{aligned}$$

and

$$\begin{aligned} b(x):=|\nabla u|^{p(x)-2}\log |\nabla u(x)|\nabla p(x). \end{aligned}$$

Hence \(A\in C^{0,{{\widetilde{\gamma }}}}({\overline{B}}_{4r_0}({\bar{x}}))\), \(b\in C({\overline{B}}_{4r_0}({\bar{x}}))\) and \({\mathcal {L}}\) has universal ellipticity constants (depending only on \(n, p_{\min },p_{\max }, L\)). Moreover, \(||b||_{L^{\infty }(B_{4r_0}({\bar{x}}))}\le C\varepsilon ^{1+\theta }\), C universal, because \( ||\nabla p||_{L^{\infty }(B_1)}\le \varepsilon ^{1+\theta }\min \{ 1, \beta ^{p_{\max }-1}\}\) (see (4.11)).

In this way, denoting again \(q(x)=\alpha (x_n+ \sigma )\), we conclude that \(u-q\ge 0\) in \(B_{4r_0}({\bar{x}})\) and satisfies

$$\begin{aligned} \begin{aligned} \text{ Tr }(A(x)D^2h(x))+\langle b,\nabla h(x)\rangle =f-\alpha \langle b,e_n\rangle \quad \text { in } B_{4r_0}({\bar{x}}). \end{aligned} \end{aligned}$$

Then, applying Harnack’s inequality (see, for instance, [27, Chap. 9]) and recalling again (4.11), we obtain

$$\begin{aligned} \begin{aligned} u(x)-q(x)&\ge C_1(u({\bar{x}})-q({\bar{x}}))-C_2(||f||_{L^\infty (B_{4r_0}({\bar{x}}))}+||b||_{L^\infty (B_{4r_0}({\bar{x}}))})\\&\ge C_1 \alpha \frac{\varepsilon }{2}-C_2(\varepsilon ^2 +C\varepsilon ^{1+\theta })\ge \alpha \frac{c_0}{2}\varepsilon , \end{aligned} \end{aligned}$$
(4.19)

for every \(x\in B_{r_0}({\bar{x}})\), for \(0<\varepsilon \le \varepsilon _3\). Here \(\varepsilon _3\), \(C_1\), \(C_2\) and \(c_0\) are positive universal constants. At this point, we can repeat the same argument of Case (i) around the point \({\bar{x}}\), considering the annulus \(B_{\frac{4}{5}}({\bar{x}})\setminus {\bar{B}}_{r_0}({\bar{x}})\). This completes the proof. \(\square \)

We can now prove our Theorem 4.1.

Proof of Theorem 4.1

Assume without loss of generality that \(x_0=0, r=1.\) First observe that assumption (4.1) gives that

$$\begin{aligned} U_\beta (x_n+ a_0) \le u(x) \le U_\beta (x_n + a_0+\varepsilon ) \quad \text {in }B_1, \end{aligned}$$
(4.20)

since \(b_0\le a_0+\varepsilon \). We distinguish three cases.

Case 1. \(a_0 \le - 1/20.\) In this case it follows from (4.20) that \(B_{1/25} \subset \{u<0\}\) if \(\varepsilon <1/100\) and

$$\begin{aligned} 0 \le {u(x) - \beta (x_n+a_0)} \le \beta \varepsilon \quad \text {in } B_{1/25}. \end{aligned}$$

Then, denoting \({\hat{u}}=u-\beta a_0\), we have

$$\begin{aligned} \Delta _{p(x)}u = \Delta _{p(x)}{\hat{u}}=f\quad \text { in } B_{1/25}. \end{aligned}$$

Recalling (4.20) and (4.2) and observing that \(||{\hat{u}}||_{L^{\infty }(B_1)}\le 2\beta \le 2L\), we obtain from the application of Theorem 1.1 in [18] to \({\hat{u}}\), that \(u\in C^{1,{{\widetilde{\gamma }}}}\) in \({\overline{B}}_{1/40},\) where \({{\widetilde{\gamma }}}={{\widetilde{\gamma }}} (p_{\min },p_{\max }, L, n)\in (0,1)\) and \(||\nabla u||_{C^{0,{{\widetilde{\gamma }}}}({\overline{B}}_{1/40})}\le C\), with \(C=C (p_{\min },p_{\max },n, L)\ge 1.\)

We denote \(q(x)=\beta ( x_n +a_0)\) and we now distinguish two cases: \(u(0)-q(0)\ge \frac{\beta \varepsilon }{2}\) or \(u(0)-q(0)\le \frac{\beta \varepsilon }{2}\).

Assume that

$$\begin{aligned} u(0)-q(0)\ge \frac{\beta \varepsilon }{2}, \end{aligned}$$

(the other case is treated similarly). We will proceed as in the proof of Lemma 4.5.

If \(|\nabla u(0)|<\frac{{{\hat{\beta }}}}{4}\), we argue as in Case (i) of Lemma 4.5. In fact, we choose \(r_1>0\), \(r_1=r_1(p_{\min },p_{\max },n, {{\hat{\beta }}}, L)\le 1/40\) such that \(|\nabla u(x)|\le \frac{{{\hat{\beta }}}}{2}\) in \(B_{{r_1}}.\) In addition, there exists a constant \(0<r_2=r_2(r_1)=r_2(p_{\min },p_{\max },n,{{\hat{\beta }}},L)<r_1\) such that \((x-r_2e_n)\in B_{r_1},\) for every \(x\in B_{r_1/2}\). We observe that \({\tilde{v}}=u-q\ge 0\) in \(B_{1/25}\) and satisfies

$$\begin{aligned} \text{ div } (|\nabla {\tilde{v}}+\beta e_n|^{p(x)-2}(\nabla {\tilde{v}}+\beta e_n)) =f \quad \text{ in } B_{\frac{1}{25}}. \end{aligned}$$
(4.21)

We now apply Theorem 4.3 to the function \({\tilde{v}}=u-q\) in \(B_{4r_3}\), where \(r_3=\min \{\frac{r_1}{4},\frac{r_2}{8}, \frac{{{\hat{\beta }}}}{2}{r_2}\}.\) In particular we obtain from (4.3) that

$$\begin{aligned} \begin{aligned} u(x)-q(x)&\ge C^{-1}(u(0)-q(0))- r_3\ge \frac{\varepsilon \beta }{2C}- r_3, \end{aligned} \end{aligned}$$

for \(x\in B_{r_3}\). Here \(C=C(n,p_{\min }, p_{\max }, L)\) is a universal constant because we have \(||f||_{L^{\infty }(B_1)}\le \varepsilon ^2\min \{ 1, \beta ^{p_{\max }-1}\}\) and \(\Vert \nabla p\Vert _{L^\infty (B_1)}\le \varepsilon ^{1+\theta }\min \{ 1, \beta ^{p_{\max }-1}\}\), see (4.2), and \(||{\tilde{v}}||_{L^{\infty }(B_1)}\le L\).

On the other hand, for all \(x\in B_{r_3}\) we obtain

$$\begin{aligned} \begin{aligned} \frac{\beta \varepsilon }{2C}- r_3&\le u(x)-q(x)=u((x-r_2e_n)+r_2e_n)-q((x-r_2e_n)+r_2e_n)\\&=u((x-r_2e_n)+r_2e_n)-q(x-r_2e_n)-\beta r_2\\&\le u(x-r_2e_n)-q(x-r_2e_n)+\frac{{{\hat{\beta }}}}{2}{r_2}-\beta r_2. \end{aligned} \end{aligned}$$

As a consequence, denoting \(c_0=C^{-1}\) and \({\bar{x}}_0:=-r_2e_n\), we get for all \(x\in B_{r_3}({\bar{x}}_0)\)

$$\begin{aligned} \begin{aligned}&\beta \frac{c_0}{2}\varepsilon =\frac{\beta \varepsilon }{2C}\le \frac{\beta \varepsilon }{2C}- r_3+\frac{{{\hat{\beta }}}}{2}{r_2}\le \frac{\beta \varepsilon }{2C}- r_3- \frac{{{\hat{\beta }}}}{2}{r_2}+\beta r_2\le u(x)-q(x). \end{aligned} \end{aligned}$$

We now choose \(r_4> r_3\) universal (making \(r_3\) and \(r_2\) small, if necessary) such that we have

$$\begin{aligned} B_{1/40}\subset \subset B_{r_4}({\bar{x}}_0)\subset \subset B_{1/25}. \end{aligned}$$

We now let

$$\begin{aligned} A:= B_{r_4}({\bar{x}}_0)\setminus \overline{B_{r_3}({\bar{x}}_0)}, \end{aligned}$$

and define w in A as in Lemma 4.5. Then, arguing as in that proof, we obtain

$$\begin{aligned} u(x)\ge U_{\beta }(x_n+ a_0+c\varepsilon ) \quad \text { in } B_{1/40}, \end{aligned}$$
(4.22)

with \(0<c<1\), if \(\varepsilon \le {\bar{\varepsilon }}\), \({\bar{\varepsilon }}\) and c universal.

If \(|\nabla u(0)|\ge \frac{{{\hat{\beta }}}}{4}\), we proceed as in Case (ii) of Lemma 4.5 and we consider, for \(\varepsilon \le \varepsilon _3\), \(\varepsilon _3\) universal, the barrier w in

$$\begin{aligned} A:= B_{1/25}\setminus \overline{B_{r_0}}, \end{aligned}$$

with \(r_0>0\) universal and small. We thus obtain again (4.22).

Case 2. \(a_0 \ge 1/20.\) In this case it follows from (4.20) that \(B_{1/25} \subset \{u>0\}\) and

$$\begin{aligned} 0 \le {u(x) - \alpha (x_n+a_0)} \le \alpha \varepsilon \quad \text {in } B_{1/25}. \end{aligned}$$

Then, denoting \(q(x)=\alpha (x_n+a_0)\), we obtain the result by applying similar arguments as those in Case 1. We here use that \(1\le \alpha \le \sqrt{1+L^2}\).

Case 3. \(|a_0| < 1/20.\) Recall that (4.2) and (4.20) hold. We now distinguish two cases: \( u({{\bar{x}}}) \ge U_{\beta }({{\bar{x}}}_n+a_0 + \frac{\varepsilon }{2})\) or \(u({{\bar{x}}}) \le U_{\beta }({{\bar{x}}}_n + a_0+ \frac{\varepsilon }{2})\), where \({{\bar{x}}}=\frac{1}{10}e_n\).

Assume that

$$\begin{aligned} u({{\bar{x}}}) \ge U_{\beta }\left( {{\bar{x}}}_n+a_0 + \frac{\varepsilon }{2}\right) , \quad {{\bar{x}}}=\frac{1}{10}e_n \end{aligned}$$

(the other case is treated similarly). Then, by Lemma 4.5, if \(\varepsilon \le {\bar{\varepsilon }}\),

$$\begin{aligned} u(x) \ge U_\beta (x_n+a_0+c{\varepsilon }) \quad \text {in } {\overline{B}}_{\frac{1}{2}}, \end{aligned}$$

for some universal \(0<c<1\), which gives the desired improvement. \(\square \)

5 Improvement of flatness

In this section we prove our key “improvement of flatness" lemma for problem (1.7).

We assume that our solution u is trapped between two translations of a two-plane solution \(U_\beta \) with \(\beta > 0.\) We show that when we restrict to smaller balls, u is trapped between closer translations of another two-plane solution (in a different system of coordinates).

Lemma 5.1

(Improvement of flatness) Let u be a solution of (1.7) that satisfies

$$\begin{aligned} U_\beta (x_n -\varepsilon ) \le u(x) \le U_\beta (x_n + \varepsilon ) \quad \text {in }B_1,\quad 0\in F(u), \end{aligned}$$
(5.1)

for some

$$\begin{aligned} 0<{{\hat{\beta }}} \le \beta \le L, \end{aligned}$$
(5.2)

with

$$\begin{aligned}{} & {} \begin{aligned}&\Vert f\Vert _{L^\infty (B_1)} \le \varepsilon ^2\min \{ 1, \beta ^{p_{\max }-1}\},\\&\Vert \nabla p\Vert _{L^\infty (B_1)}\le \varepsilon ^{1+\theta }\min \{ 1, \beta ^{p_{\max }-1}\}, \qquad \frac{1}{2} <\theta \le 1, \end{aligned}\end{aligned}$$
(5.3)
$$\begin{aligned}{} & {} \Vert p-p_0\Vert _{L^\infty (B_1)}\le \varepsilon . \end{aligned}$$
(5.4)

If \(0<r \le r_0\) for \(r_0\) universal, and \(0<\varepsilon \le \varepsilon _0\) for some \(\varepsilon _0\) depending on r, then

$$\begin{aligned} U_{\beta '}\left( x \cdot \nu _1 -r\frac{\varepsilon }{2}\right) \le u(x) \le U_{\beta '}\left( x \cdot \nu _1 +r\frac{\varepsilon }{2}\right) \quad \text {in }B_r, \end{aligned}$$
(5.5)

with \(|\nu _1|=1,\) \( |\nu _1 - e_n| \le {{\tilde{C}}}\varepsilon \), and \(|\beta -\beta '| \le {{\tilde{C}}}\beta \varepsilon \) for a universal constant \({{\tilde{C}}}.\)

Proof

We divide the proof of this lemma into three steps.

Step 1—Compactness. Fix \(r \le r_0\) with \(r_0\) universal (the precise \(r_0\) will be given in Step 3). Assume by contradiction that we can find a sequence \(\varepsilon _k \rightarrow 0\) and a sequence \(u_k\) of solutions to (1.7) in \(B_1\) with right hand side \(f_k\) and exponent \(p_k\) satisfying (5.3) and (5.4) with \(\varepsilon =\varepsilon _k\) and \(\beta =\beta _k\), such that \(u_k\) satisfies (5.1), i.e.,

$$\begin{aligned} U_{\beta _k}(x_n -\varepsilon _k) \le u_k(x) \le U_{\beta _k}(x_n + \varepsilon _k) \quad \text {for }x \in B_1, 0 \in F(u_k), \end{aligned}$$
(5.6)

with \({{\hat{\beta }}} \le \beta _k \le L\), but \(u_k\) does not satisfy the conclusion (5.5) of the lemma.

Set (\(\alpha _k^2=1+\beta _k^2\)),

$$\begin{aligned} {\tilde{u}}_{k}(x)= {\left\{ \begin{array}{ll} \dfrac{u_k(x) - \alpha _k x_n}{\alpha _k \varepsilon _k}, \quad x \in B_1^+(u_k) \cup F(u_k) \\ \ \\ \dfrac{u_k(x) - \beta _k x_n}{\beta _k\varepsilon _k}, \quad x \in B_1^-(u_k).\end{array}\right. } \end{aligned}$$

Then (5.6) gives

$$\begin{aligned} -1 \le {\tilde{u}}_{k}(x) \le 1 \quad \text {for }x \in B_1. \end{aligned}$$

From Corollary 4.2, it follows that the function \({{\tilde{u}}}_{k}\) satisfies

$$\begin{aligned} |{{\tilde{u}}}_{k}(x) - \tilde{u}_{k} (y)| \le C |x-y|^{{\widehat{\gamma }}}, \end{aligned}$$
(5.7)

for \(C, {{\widehat{\gamma }}}\) universal and

$$\begin{aligned} |x-y| \ge \varepsilon _k/{{\bar{\varepsilon }}}, \quad x,y \in B_{1/2}. \end{aligned}$$

From (5.6) it clearly follows that \(F(u_k)\) converges to \(B_1 \cap \{x_n=0\}\) in the Hausdorff distance. This fact and (5.7) together with Ascoli-Arzela give that as \(\varepsilon _k \rightarrow 0\) the graphs of the \({\tilde{u}}_{k}\) converge (up to a subsequence) in the Hausdorff distance to the graph of a Hölder continuous function \({\tilde{u}}\) over \(B_{1/2}\). Also, up to a subsequence

$$\begin{aligned} \beta _k \rightarrow {{\tilde{\beta }}} \ge {{\hat{\beta }}}>0 \end{aligned}$$

and hence

$$\begin{aligned} \alpha _k \rightarrow {{\tilde{\alpha }}} = \sqrt{1+{{\tilde{\beta }}}^2}. \end{aligned}$$

Step 2—Limiting Solution. We now show that \({{\tilde{u}}}\) solves the following linearized problem (transmission problem)

$$\begin{aligned} {\left\{ \begin{array}{ll} {\mathcal {L}}_{p_0}{\tilde{u}}=0 &{} \quad \text {in }B_{1/2}\cap \{x_n\not =0\}, \\ a ({{\tilde{u}}}_n)^+ - b ({{\tilde{u}}}_n)^-=0 &{} \quad \text {on }B_{1/2} \cap \{x_n =0\}, \end{array}\right. } \end{aligned}$$
(5.8)

in the sense of Definition 3.1, with \(a={{{\tilde{\alpha }}}}^2>0,\) \(b={{{\tilde{\beta }}}}^2>0\), where \(p_0\) is a constant such that \(1<p_{\min }\le p_0\le p_{\max }<\infty \), and

$$\begin{aligned} {{\mathcal {L}}}_{p_0} {\tilde{u}}:= \Delta {\tilde{u}} +(p_0-2) {\partial }_{nn} {\tilde{u}}. \end{aligned}$$

(i) Let us show that \({\mathcal {L}}_{p_0}{\tilde{u}}\le 0\) in \(B_{1/2}\cap \{x_n\not =0\}\), in the viscosity sense (the other inequality follows analogously).

In fact, let P(x) be a quadratic polynomial touching \({{\tilde{u}}}\) at \({\bar{x}}\in B_{1/2} \cap \{x_n \not = 0\}\) strictly from below. We need to show that \({{\mathcal {L}}}_{p_0}P\le 0\).

We first assume that \({\bar{x}}\in B_{1/2} \cap \{x_n > 0\}\).

Since \({\tilde{u}}_{k}\rightarrow {{\tilde{u}}}\) in the sense specified above, for k large there exist points \(x_k\in B_{1/2}^+(u_k) \), \(x_k\rightarrow {\bar{x}}\) and constants \(c_k\rightarrow 0\) such that

$$\begin{aligned} {\tilde{u}}_{k}(x_k)=P(x_k)+c_k \end{aligned}$$
(5.9)

and

$$\begin{aligned} {\tilde{u}}_{k}\ge P+c_k\quad \text { in a neighborhood of } x_k. \end{aligned}$$
(5.10)

From the definition of \({\tilde{u}}_{k}\), (5.9) and (5.10) read

$$\begin{aligned} u_k(x_k)=Q_k(x_k) \end{aligned}$$

and

$$\begin{aligned} {u}_{k}(x)\ge Q_k(x)\quad \text { in a neighborhood of } x_k, \end{aligned}$$

where

$$\begin{aligned} Q_k(x)=\alpha _k\varepsilon _k(P(x)+c_k)+\alpha _kx_n. \end{aligned}$$

For notational simplicity we will drop the sub-index k from \(Q_k\).

We first notice that

$$\begin{aligned} \nabla Q=\alpha _k\varepsilon _k \nabla P+\alpha _k e_n, \end{aligned}$$

thus,

$$\begin{aligned} \nabla Q(x_k) \ne 0,\quad \text {for }k\text { large}. \end{aligned}$$

Since Q touches \(u_k\) from below at \(x_k\), and \(\nabla Q(x_k) \ne 0\), we now define \(\sigma _k=\min \{ 1, \beta _k^{p_{\max }-1}\}\) and we get

$$\begin{aligned} \begin{aligned} \sigma _k\varepsilon _k^2&\ge f_k(x_k)\ge \Delta _{p_k(x_k)}Q(x_k)\\&=|\nabla Q(x_k)|^{p_k(x_k)-2}\Delta Q + |\nabla Q(x_k)|^{p_k(x_k)-4}(p_k(x_k)-2)\sum _{i,j=1}^n{Q}_{x_i}(x_k){Q}_{x_j}(x_k){Q}_{x_ix_j}\\&\quad +|\nabla Q(x_k)|^{p_k(x_k)-2}\langle \nabla p_k(x_k),\nabla Q(x_k)\rangle \log |\nabla Q(x_k)|\\&=\alpha _k\varepsilon _k|\nabla Q(x_k)|^{p_k(x_k)-2}\Delta P\\&\quad + \alpha _k\varepsilon _k|\nabla Q(x_k)|^{p_k(x_k)-4}(p_k(x_k)-2)\sum _{i,j=1}^n{Q}_{x_i}(x_k){Q}_{x_j}(x_k){P}_{x_ix_j}\\&\quad +|\nabla Q(x_k)|^{p_k(x_k)-2}\langle \nabla p_k(x_k),\nabla Q(x_k)\rangle \log |\nabla Q(x_k)|. \end{aligned} \end{aligned}$$

Using that \(|\nabla p_k(x_k)|\le \varepsilon _k^{1+\theta }\sigma _k\), we obtain

$$\begin{aligned} \begin{aligned} \begin{aligned} \sigma _k\varepsilon _k&\ge \alpha _k|\nabla Q(x_k)|^{p_k(x_k)-2}\Delta P \\&\quad + \alpha _k|\nabla Q(x_k)|^{p_k(x_k)-4}(p_k(x_k)-2) \sum _{i,j=1}^n{Q}_{x_i}(x_k){Q}_{x_j}(x_k){P}_{x_ix_j}\\&\quad -|\nabla Q(x_k)|^{p_k(x_k)-1}|\log |\nabla Q(x_k)||\sigma _k\varepsilon _k^\theta . \end{aligned} \end{aligned} \end{aligned}$$

Now, passing to the limit \(k\rightarrow \infty \) and recalling that

$$\begin{aligned} \begin{aligned}&\frac{\nabla Q(x_k)}{\alpha _k}\rightarrow e_n,\qquad p_k(x_k)\rightarrow p_0, \qquad \varepsilon _k\rightarrow 0,\\&\alpha _k\rightarrow {\tilde{\alpha }}>0, \qquad \sigma _k\rightarrow \min \{ 1, {\tilde{\beta }}^{p_{\max }-1}\}, \end{aligned} \end{aligned}$$

we conclude that \({{\mathcal {L}}}_{p_0}P\le 0\) as desired.

In case \({\bar{x}}\in B_{1/2} \cap \{x_n < 0\}\), we next proceed in a similar way with points \(x_k\in B_{1/2}^-(u_k) \), \(x_k\rightarrow {\bar{x}}\). We get instead

$$\begin{aligned} \begin{aligned} \sigma _k\varepsilon _k&\ge \beta _k|\nabla Q(x_k)|^{p_k(x_k)-2}\Delta P\\&\quad + \beta _k|\nabla Q(x_k)|^{p_k(x_k)-4}(p_k(x_k)-2)\sum _{i,j=1}^n{Q}_{x_i}(x_k){Q}_{x_j}(x_k){P}_{x_ix_j}\\&\quad -|\nabla Q(x_k)|^{p_k(x_k)-1}|\log |\nabla Q(x_k)||\sigma _k\varepsilon _k^\theta , \end{aligned} \end{aligned}$$

and

$$\begin{aligned} \begin{aligned}&\frac{\nabla Q(x_k)}{\beta _k}\rightarrow e_n,\qquad p_k(x_k)\rightarrow p_0, \qquad \varepsilon _k\rightarrow 0,\\&\beta _k\rightarrow {\tilde{\beta }}>0, \qquad \sigma _k\rightarrow \min \{ 1, {\tilde{\beta }}^{p_{\max }-1}\}. \end{aligned} \end{aligned}$$

Thus we obtain again \({{\mathcal {L}}}_{p_0}P\le 0\).

(ii) Next, we prove that \({{\tilde{u}}}\) satisfies the boundary condition in (5.8) in the viscosity sense of Definition 3.1. Let \({{\tilde{\phi }}}\) be a function of the form (\(\gamma \) a specific constant to be made precise later)

$$\begin{aligned} {{\tilde{\phi }}}(x) = A+ px_n^+- qx_n^- + B Q^\gamma (x-y) \end{aligned}$$

with

$$\begin{aligned} Q^\gamma (x) = \frac{1}{2} [\gamma x_n^2 - |x'|^2], \quad y=(y',0), \quad A \in {\mathbb {R}}, B >0, \end{aligned}$$

and

$$\begin{aligned} a p- b q>0. \end{aligned}$$

Then we must show that \({{\tilde{\phi }}}\) cannot touch \({{\tilde{u}}}\) strictly by below at a point of the form \(x_0= (x_0', 0)\in B_{1/2}.\)

The analogous statement by above follows with a similar argument.

Suppose that such a \({{\tilde{\phi }}}\) exists and let \(x_0\) be the touching point. Let

$$\begin{aligned} \Gamma ^\gamma (x) = \frac{1}{2\gamma } [(|x'|^2 + |x_n-1|^2)^{-\gamma } - 1], \end{aligned}$$

where \(\gamma \) is sufficiently large (to be made precise later), and let

$$\begin{aligned} \Gamma _{k}^\gamma (x)= \frac{1}{B\varepsilon _k}\Gamma ^\gamma (B\varepsilon _k(x-y)+ A B \varepsilon _k^2 e_n). \end{aligned}$$

Now, call

$$\begin{aligned} \phi _k(x)= a_k \Gamma ^{\gamma +}_k(x) - b_k \Gamma ^{\gamma -}_k(x) + \alpha _k (d_k^+(x))^2\varepsilon _k^{3/2} +\beta _k(d_k^-(x))^2\varepsilon _k^{3/2} \end{aligned}$$

where

$$\begin{aligned} a_k=\alpha _k(1+\varepsilon _k p), \quad b_k=\beta _k(1+\varepsilon _k q), \end{aligned}$$

and \(d_k(x)\) is the signed distance from x to \(\partial B_{\frac{1}{B\varepsilon _k}}(y+e_n(\frac{1}{B\varepsilon _k}-A\varepsilon _k)).\)

Finally, let

$$\begin{aligned} {\tilde{\phi }}_{k}(x)= {\left\{ \begin{array}{ll}\dfrac{\phi _k(x) - \alpha _k x_n}{\alpha _k \varepsilon _k}, \quad x \in B_1^+(\phi _k) \cup F(\phi _k) \\ \ \\ \dfrac{\phi _k(x) - \beta _k x_n}{\beta _k\varepsilon _k}, \quad x \in B_1^-(\phi _k).\end{array}\right. } \end{aligned}$$

By Taylor’s theorem,

$$\begin{aligned} \Gamma ^\gamma (x)= x_n + Q^{\gamma }(x) + O(|x|^3) \quad x \in B_1, \end{aligned}$$

thus it is easy to verify that

$$\begin{aligned} \Gamma _k^\gamma (x)= A\varepsilon _k + x_n + B\varepsilon _kQ^{\gamma }(x-y) + O(\varepsilon _k^2) \quad x \in B_1, \end{aligned}$$

with the constant in \(O(\varepsilon _k^2)\) depending on AB,  and |y| (later this constant will depend also on pq).

It follows that in \( B_1^+(\phi _k) \cup F(\phi _k) \) (\(Q^{\gamma , y}(x)=Q^\gamma (x-y)\))

$$\begin{aligned} {\tilde{\phi }}_{k}(x)= A+BQ^{\gamma , y} + p x_n + A\varepsilon _k p + Bp\varepsilon _kQ^{\gamma , y} + \varepsilon _k^{1/2}d_k^2+ O(\varepsilon _k) \end{aligned}$$

and analogously in \( B_1^-(\phi _k)\)

$$\begin{aligned} {\tilde{\phi }}_{k}(x)= A+BQ^{\gamma ,y} + q x_n + A\varepsilon _k p + Bq\varepsilon _kQ^{\gamma ,y} + \varepsilon _k^{1/2}d^2_k + O(\varepsilon _k). \end{aligned}$$

Hence, \({{\tilde{\phi }}}_k\) converges uniformly to \({{\tilde{\phi }}}\) on \(B_{1/2}\). Since \({{\tilde{u}}}_k\) converges uniformly to \({{\tilde{u}}}\) and \({{\tilde{\phi }}}\) touches \({{\tilde{u}}}\) strictly by below at \(x_0\), we conclude that there exist a sequence of constants \(c_k \rightarrow 0\) and of points \(x_k \rightarrow x_0\) such that the function

$$\begin{aligned} \psi _k(x) = \phi _k(x+\varepsilon _k c_k e_n) \end{aligned}$$

touches \(u_k\) by below at \(x_k\). We thus get a contradiction if we prove that \(\psi _k\) is a strict subsolution to our free boundary problem. That is, we will see that

$$\begin{aligned} \left\{ \begin{array}{ll} \Delta _{p_k(x)} \psi _k> \varepsilon _k^2\min \{ 1, \beta _k^{p_{\max }-1}\} \ge \Vert f_k\Vert _{\infty }, &{} \quad \hbox {in }B_{1/2}^+(\psi _k) \cup B_{1/2}^-(\psi _k),\\ \\ (\psi _k^+)_\nu ^2 - (\psi _k^-)^2_\nu >1, &{} \quad \hbox {on }F(\psi _k).\\ \end{array}\right. \end{aligned}$$

In fact, let us denote \({\bar{x}}=x+\varepsilon _k c_k e_n\). Let \(\lambda _0:=\min \{1,p_{\min }-1\}\) and \(\Lambda _0:=\max \{1,p_{\max }-1\}\) be the constants defined in (2.2).

For k large enough, say, in the positive phase of \(\psi _k\) (dropping the dependence on \(\lambda _0,\Lambda _0\) of the Pucci operator that appears in (2.2)), we have

$$\begin{aligned} {\mathcal {M}}^-(D^2 \psi _k(x)) \ge a_k {\mathcal {M}}^-(D^2 \Gamma _k^\gamma ({{\bar{x}}})) + \alpha _k \varepsilon _k^{3/2} {\mathcal {M}}^-(D^2 d_k^2({{\bar{x}}})). \end{aligned}$$

Proceeding as in Lemma 4.3 in [14], we see that for \(\gamma \) large enough, depending only on \(n,\lambda _0,\Lambda _0\), there holds that \( {\mathcal {M}}^-(D^2 \Gamma _k^\gamma ({{\bar{x}}}))>0\), for \(x\in B_{1/2}\) and large k.

More precisely, we choose

$$\begin{aligned} \gamma >{\tilde{\gamma }}(n,p_{\min },p_{\max } ):=\max \left\{ \frac{\Lambda _0}{2\lambda _0}(n-1)-\frac{1}{2}, 1\right\} . \end{aligned}$$

Moreover, in the appropriate system of coordinates,

$$\begin{aligned} D^2 d_k^2 ({{\bar{x}}}) = diag\{-d_k({{\bar{x}}}) \kappa _1({{\bar{x}}}),\ldots , -d_k({{\bar{x}}}) \kappa _{n-1}({{\bar{x}}}), 1\}, \end{aligned}$$

where the \(\kappa _i({{\bar{x}}})\) denote the curvature of the surface parallel to \(\partial B_{\frac{1}{B\varepsilon _k}}(y+ e_n (\frac{1}{B\varepsilon _k}-A\varepsilon _k))\) which passes through \({{\bar{x}}}.\) Thus,

$$\begin{aligned} \kappa _i ({{\bar{x}}}) =\frac{B \varepsilon _k}{1-B \varepsilon _kd_k({{\bar{x}}})}. \end{aligned}$$

For k large enough we conclude that \( {\mathcal {M}}^-(D^2 d_k^2({{\bar{x}}}))> \lambda _0/2\) and hence,

$$\begin{aligned} {\mathcal {M}}^-(D^2 \psi _k(x)) \ge \alpha _k \varepsilon _k^{3/2} \frac{\lambda _0}{2}. \end{aligned}$$
(5.11)

Direct computations show that, for large k,

$$\begin{aligned} \alpha _k c_1\le |\nabla \psi _k|\le \alpha _k c_2\qquad \text {in } B_{1/2}^+(\psi _k), \end{aligned}$$

for positive universal constants \(c_1,c_2\). Using that \(1\le \alpha _k\le \sqrt{1+L^2}\), we obtain, for k large,

$$\begin{aligned} {\bar{c}}_1\le |\nabla \psi _k|\le {\bar{c}}_2\qquad \text {in } B_{1/2}^+(\psi _k), \end{aligned}$$
(5.12)

for positive universal constants \({\bar{c}}_1,{\bar{c}}_2\).

Then, recalling (2.2), for large k we get

$$\begin{aligned} \begin{aligned}&\Delta _{p_k(x)}\psi _k\\&\quad \ge |\nabla \psi _k(x)|^{p_k(x)-2}\left( {\mathcal {M}}^-(D^2\psi _k(x))+\langle \nabla p_k(x),\nabla \psi _k(x)\rangle \log |\nabla \psi _k(x)| \right) \\&\quad \ge |\nabla \psi _k(x)|^{p_k(x)-2}{\mathcal {M}}^-(D^2\psi _k(x))-|\nabla \psi _k(x)|^{p_k(x)-1}|\log |\nabla \psi _k(x)|||\nabla p_k(x)|\\&\quad \ge {\tilde{c}}_1 \alpha _k \varepsilon _k^{3/2} \frac{\lambda _0}{2}-{\tilde{c}}_2 \varepsilon _k^{1+\theta }\min \{ 1, \beta _k^{p_{\max }-1}\}\\&\quad > \varepsilon _k^2\min \{ 1, \beta _k^{p_{\max }-1}\} \ge \Vert f_k\Vert _{\infty } \qquad \text {in } B_{1/2}^+(\psi _k), \end{aligned} \end{aligned}$$

as desired. Here \({\tilde{c}}_1,{\tilde{c}}_2\) are positive universal constants and we have used (5.11), (5.12) and (5.3), with \(\theta >\frac{1}{2}\).

In the negative phase, using that \(0<{\hat{\beta \le }} \beta _k\le L\), we get

$$\begin{aligned}{} & {} {\mathcal {M}}^-(D^2 \psi _k(x)) \ge \beta _k \varepsilon _k^{3/2} \frac{\lambda _0}{2}\nonumber \\{} & {} {\hat{c}}_1\le |\nabla \psi _k|\le {\hat{c}}_2\qquad \text {in } B_{1/2}^-(\psi _k), \end{aligned}$$
(5.13)

for positive universal constants \({\hat{c}}_1,{\hat{c}}_2\) and we obtain again, for large k,

$$\begin{aligned} \Delta _{p_k(x)}\psi _k> \varepsilon _k^2\min \{ 1, \beta _k^{p_{\max }-1}\} \ge \Vert f_k\Vert _{\infty }\qquad \text {in } B_{1/2}^-(\psi _k). \end{aligned}$$

Finally, since on the zero level set \(|\nabla \Gamma _k^\gamma |=1\) and \(|\nabla d^2_k|=0,\) the free boundary condition reduces to show that

$$\begin{aligned} a_k^2-b_k^2>1. \end{aligned}$$

Recalling the definition of \(a_k,b_k\) we need to check that

$$\begin{aligned} (\alpha _k^2p^2-\beta _k^2q^2)\varepsilon _k+2(\alpha _k^2p-\beta _k^2q)>0. \end{aligned}$$

This inequality holds for k large since

$$\begin{aligned} {\tilde{\alpha }}^2p-{\tilde{\beta }}^2q=a p -b q>0. \end{aligned}$$

Thus \({{\tilde{u}}}\) is a solution to the linearized problem.

Step 3—Contradiction. We proceed as in the proof of Lemma 5.1 in [13], using the regularity estimates for the solution of the transmission problem from Theorem 3.3. In fact, according to estimate (3.2), since \({{\tilde{u}}}(0)=0\), we obtain that

$$\begin{aligned} |{{\tilde{u}}}(x) - (x' \cdot \nu ' + {{\tilde{p}}}x_n^+ -{{\tilde{q}}}x_n^-)| \le C r^{2}, \quad x\in B_r, \end{aligned}$$

for all \(r \le 1/4\) and with

$$\begin{aligned} {{\tilde{\alpha }}} ^2 {{\tilde{p}}} -{{\tilde{\beta }}}^2 {{\tilde{q}}}=0, \quad |\nu '| = |\nabla _{x'} {{\tilde{u}}} (0)| \le C. \end{aligned}$$

Thus, since \({{\tilde{u}}}_k\) converges uniformly to \({{\tilde{u}}}\) (by slightly enlarging C) we get, for large k, that

$$\begin{aligned} |{{\tilde{u}}}_k - (x' \cdot \nu ' + {{\tilde{p}}}x_n^+ -{{\tilde{q}}}x_n^-)| \le C r^{2}, \quad x\in B_r. \end{aligned}$$
(5.14)

Now, set

$$\begin{aligned} \beta '_k = \beta _k(1+\varepsilon _k {{\tilde{q}}}), \quad \nu _k = \frac{1}{\sqrt{1+ \varepsilon _k^2 |\nu '|^2}}(e_n + \varepsilon _k (\nu ', 0)). \end{aligned}$$

Then,

$$\begin{aligned} \alpha '_k = \sqrt{1+{\beta '_k}^2} = \alpha _k(1+\varepsilon _k {{\tilde{p}}}) + o(\varepsilon _k), \quad \nu _k =e_n + \varepsilon _k (\nu ', 0) + \varepsilon _k^2 \tau , \quad |\tau |\le C, \end{aligned}$$

where to obtain the first equality we used that \({{\tilde{\alpha }}} ^2 {{\tilde{p}}} -{{\tilde{\beta }}}^2 {{\tilde{q}}}=0\) and hence

$$\begin{aligned} \frac{\beta _k^2}{\alpha _k^2} {{\tilde{q}}}= {{\tilde{p}}} + o(1). \end{aligned}$$

With these choices we can now show that (for k large and \(r \le r_0\))

$$\begin{aligned} {\widetilde{U}}_{\beta '_k}(x\cdot \nu _k -\varepsilon _k\frac{r}{2}) \le {{\tilde{u}}}_k(x) \le {\widetilde{U}}_{\beta '_k}(x\cdot \nu _k +\varepsilon _k\frac{r}{2}), \quad \text {in }B_r \end{aligned}$$

where again we are using the notation

$$\begin{aligned} {\widetilde{U}}_{\beta '_k}(x)= {\left\{ \begin{array}{ll}\dfrac{ U_{\beta '_k}(x) - \alpha _k x_n}{\alpha _k \varepsilon _k}, \quad x \in B_1^+(U_{\beta '_k}) \cup F( U_{\beta '_k}) \\ \ \\ \dfrac{ U_{\beta '_k}(x) - \beta _k x_n}{\beta _k\varepsilon _k}, \quad x \in B_1^-( U_{\beta '_k}).\end{array}\right. } \end{aligned}$$

This will clearly imply that

$$\begin{aligned} U_{\beta '_k}\left( x\cdot \nu _k -\varepsilon _k\frac{r}{2}\right) \le u_k(x) \le U_{\beta '_k}\left( x\cdot \nu _k +\varepsilon _k\frac{r}{2}\right) , \quad \text {in }B_r, \end{aligned}$$

for large k, and hence lead to a contradiction.

In view of (5.14) we need to show that in \(B_r\)

$$\begin{aligned} {\widetilde{U}}_{\beta '_k}\left( x\cdot \nu _k -\varepsilon _k\frac{r}{2}\right) \le (x' \cdot \nu ' + {{\tilde{p}}}x_n^+ -{{\tilde{q}}}x_n^-) - Cr^{2} \end{aligned}$$

and

$$\begin{aligned} {\widetilde{U}}_{\beta '_k}\left( x\cdot \nu _k +\varepsilon _k\frac{r}{2}\right) \ge (x' \cdot \nu ' + {{\tilde{p}}}x_n^+ -{{\tilde{q}}}x_n^-) + Cr^{2}. \end{aligned}$$

Let us show the second inequality (the other case can be argued similarly). In fact, in the set where

$$\begin{aligned} x\cdot \nu _k +\varepsilon _k\frac{r}{2} <0 \end{aligned}$$
(5.15)

by definition we have that

$$\begin{aligned} {\widetilde{U}}_{\beta '_k}\left( x\cdot \nu _k +\varepsilon _k\frac{r}{2}\right) = \frac{1}{\beta _k \varepsilon _k}\left( \beta '_k(x\cdot \nu _k +\varepsilon _k\frac{r}{2} \right) - \beta _k x_n) \end{aligned}$$

which from the formula for \(\beta _k', \nu _k\) gives

$$\begin{aligned} {\widetilde{U}}_{\beta '_k}\left( x\cdot \nu _k +\varepsilon _k\frac{r}{2}\right) \ge x' \cdot \nu ' + {{\tilde{q}}}x_n +\frac{r}{2} - C_0 \varepsilon _k. \end{aligned}$$

Using (5.15) we then obtain

$$\begin{aligned} {\widetilde{U}}_{\beta '_k}\left( x\cdot \nu _k +\varepsilon _k\frac{r}{2}\right) \ge x' \cdot \nu ' + {{\tilde{p}}} x_n^+ - {{\tilde{q}}}x_n^- +\frac{r}{2} - C_1 \varepsilon _k. \end{aligned}$$

Thus to obtain the desired bound it suffices to fix \(r_0 \le 1/(4C)\) and take k large enough. \(\square \)

6 Proof of the main theorems for problem (1.7)

In this section we prove our main results for problem (1.7) i.e., Theorems 1.1 and  1.2.

Proof of Theorem 1.2

For notational simplicity we assume that u satisfies our hypotheses in the ball \(B_2\) and \(0 \in F(u)\). We denote \(p_0=p(0)\).

Let us fix \({{\bar{r}}} >0\) to be a universal constant such that

$$\begin{aligned} {{\bar{r}}} \le \min \{r_0, 1/2^{p_{\max }+1}\}, \end{aligned}$$

with \(r_0\) the universal constant in the improvement of flatness Lemma 5.1, when \(\beta \) in (5.1) satisfies

$$\begin{aligned} 0<\frac{{{\hat{\beta }}}}{2}\le \beta \le 2L \end{aligned}$$
(6.1)

instead of (5.2).

Also, let us fix a universal constant \({{\tilde{\varepsilon }}}>0\) such that

$$\begin{aligned} {{\tilde{\varepsilon }}} \le \min \left\{ \varepsilon _0({{\bar{r}}}),\, \frac{1}{2{{\tilde{C}}}}, \, \min \{1,({{\hat{\beta }}}/2)^{p_{\max }-1}\},\, \frac{\text{ log }(2)}{6{{\tilde{C}}}}\right\} \end{aligned}$$

with \(\varepsilon _0, {{\tilde{C}}}\) the constants in Lemma 5.1 when (6.1) holds.

Now, let

$$\begin{aligned} {{\bar{\varepsilon }}} = {{\tilde{\varepsilon }}}^3. \end{aligned}$$

In view of our choice of \({{\tilde{\varepsilon }}}\), we obtain that u satisfies the assumptions of Lemma 5.1,

$$\begin{aligned} U_\beta (x_n -{{\tilde{\varepsilon }}}) \le u(x) \le U_\beta (x_n + {{\tilde{\varepsilon }}}) \quad \text {in }B_1,\quad 0\in F(u), \end{aligned}$$

with (6.1) and

$$\begin{aligned}{} & {} \Vert f\Vert _{L^\infty (B_1)} \le {{\tilde{\varepsilon }}}^3 \le {{\tilde{\varepsilon }}}^2\min \{ 1, {\beta }^{p_{\max }-1}\},\\{} & {} \Vert \nabla p\Vert _{L^\infty (B_1)}\le {{\tilde{\varepsilon }}}^3\le {{\tilde{\varepsilon }}}^{1+\theta }\min \{ 1, \beta ^{p_{\max }-1}\}, \qquad \frac{1}{2} <\theta \le 1,\\{} & {} \Vert p-p_0\Vert _{L^\infty (B_1)}\le {\tilde{\varepsilon }}^3\le {{\tilde{\varepsilon }}}. \end{aligned}$$

Thus we can conclude that (\(\beta _1=\beta '\))

$$\begin{aligned} U_{\beta _1}(x \cdot \nu _1 -{{\bar{r}}}\frac{{{\tilde{\varepsilon }}}}{2}) \le u(x) \le U_{\beta _1}\left( x \cdot \nu _1 +{{\bar{r}}}\frac{{{\tilde{\varepsilon }}} }{2}\right) \quad \text {in } B_{{{\bar{r}}}}, \end{aligned}$$
(6.2)

with \(|\nu _1|=1,\) \( |\nu _1 - e_n| \le {{\tilde{C}}}{{\tilde{\varepsilon }}}\), and \(|\beta -\beta _1| \le {{\tilde{C}}}\beta {{\tilde{\varepsilon }}}\). In particular, by our choice of \({{\tilde{\varepsilon }}}\) we have

$$\begin{aligned} 0<\frac{{{\hat{\beta }}}}{2}\le \frac{\beta }{2}\le \beta _1\le 2\beta \le 2L. \end{aligned}$$

We can therefore rescale and iterate the argument above. Precisely, set (\(k=0,1,2....\))

$$\begin{aligned} \rho _k = {{\bar{r}}}^k, \quad \varepsilon _k = 2^{-k}{{\tilde{\varepsilon }}} \end{aligned}$$

and

$$\begin{aligned} p_k(x)=p(\rho _k x), \quad u_k(x) = \frac{1}{\rho _k} u(\rho _k x), \quad f_k(x) = \rho _k f(\rho _k x). \end{aligned}$$

Notice that each \(u_k\) is a viscosity solution to (1.7) with right hand side \(f_k\) and exponent \(p_k\) in \(B_1\).

Also, let \(\beta _k\) be the constants generated at each k-iteration, which satisfy (\(\beta _0=\beta \))

$$\begin{aligned} |\beta _k-\beta _{k+1}| \le {{\tilde{C}}} \beta _k \varepsilon _k. \end{aligned}$$

It follows that

$$\begin{aligned} \frac{\beta _k}{2}\le \left( 1-\frac{{{\tilde{C}}}{{\tilde{\varepsilon }}}}{2^k}\right) \beta _k\le \beta _{k+1}\le \left( 1+\frac{{{\tilde{C}}}{{\tilde{\varepsilon }}}}{2^k}\right) \beta _k\le 2\beta _k \end{aligned}$$

and then,

$$\begin{aligned} \beta _0\prod _{j=0}^{k-1} \left( 1-\frac{{{\tilde{C}}}{{\tilde{\varepsilon }}}}{2^j}\right) \le \beta _k\le \beta _0 \prod _{j=0}^{k-1} \left( 1+\frac{{{\tilde{C}}}{{\tilde{\varepsilon }}}}{2^j}\right) . \end{aligned}$$

Thus,

$$\begin{aligned}{} & {} \text{ log }(\beta _0) -6{{\tilde{C}}}{{\tilde{\varepsilon }}} \le \text{ log }(\beta _k)\le \text{ log }(\beta _0) +2{{\tilde{C}}}{{\tilde{\varepsilon }}},\\{} & {} e^{-6{{\tilde{C}}}{{\tilde{\varepsilon }}}}\beta _0 \le \beta _k\le e^{2{{\tilde{C}}}{{\tilde{\varepsilon }}}}\beta _0, \end{aligned}$$

and from our choice of \({{\tilde{\varepsilon }}}\),

$$\begin{aligned} 0<\frac{{{\hat{\beta }}}}{2}\le \beta _k\le 2L. \end{aligned}$$

Then we obtain by induction that each \(u_k\), \(k\ge 0\), satisfies

$$\begin{aligned} U_{\beta _k}(x \cdot \nu _k -\varepsilon _k) \le u_k(x) \le U_{\beta _k}(x \cdot \nu _k +\varepsilon _k ) \quad \text {in }B_1,\quad 0\in F(u), \end{aligned}$$
(6.3)

with \(|\nu _k|=1,\) \( |\nu _k - \nu _{k+1}| \le {{\tilde{C}}} \varepsilon _k\) (\(\nu _0=e_n\)),

$$\begin{aligned} \begin{aligned}&\Vert f_k\Vert _{L^\infty (B_1)} \le \varepsilon _k^2\min \{ 1, {\beta _k}^{p_{\max }-1}\},\\&\Vert \nabla p_k\Vert _{L^\infty (B_1)}\le \varepsilon _k^{1+\theta }\min \{ 1, \beta _k^{p_{\max }-1}\}, \qquad \frac{1}{2} <\theta \le 1,\\&\Vert p_k-p_0\Vert _{L^\infty (B_1)}\le \varepsilon _k. \end{aligned} \end{aligned}$$

This leads to the desired conclusion. \(\square \)

We now deduce

Proof of Theorem 1.1

Assumption (1.8) implies that

$$\begin{aligned} U_{\beta }(x_n-C{{\bar{\varepsilon }}}) \le u(x) \le U_\beta (x_n+ C{{\bar{\varepsilon }}}) \ \text {in} \ B_1, \end{aligned}$$

with C a universal constant.

Then, we can apply Theorem 1.2 and obtain the result in the statement. \(\square \)

Remark 6.1

In most of our results there appears a constant \(\theta \), with \(0<\theta \le 1\) or \(\frac{1}{2}<\theta \le 1\). Notice that in the proof of Theorem 1.2 we can choose \(\theta =1\). Then, all the constants in the previous results can be chosen independent of \(\theta \).

7 More general free boundary condition

In this section we analyze free boundary problem (1.4) and we prove our main results for this problem, i.e., Theorems 1.3 and  1.4.

In fact, we study

$$\begin{aligned} \left\{ \begin{array}{ll} \Delta _{p(x)} u = f, &{} \quad \hbox {in }\Omega ^+(u) \cup \Omega ^-(u),\\ u_\nu ^+=G(u^-_\nu ,x), &{} \quad \hbox {on }F(u):= \partial \Omega ^+(u) \cap \Omega , \end{array} \right. \end{aligned}$$
(7.1)

where \(f\in L^\infty (\Omega )\) is continuous in \(\Omega ^+(u) \cup \Omega ^-(u)\) and p satisfies (1.5).

We recall that, when dealing with the general problem (7.1), we assume the following basic hypotheses on the function G:

$$\begin{aligned} G(\eta ,x):[0,\infty )\times \Omega \rightarrow (0,\infty ) \end{aligned}$$

and, for \(0<{\hat{\beta }}<L\),

  1. (H1)

    \(G(\eta ,\cdot )\in C^{0,{{\bar{\gamma }}}}(\Omega )\) uniformly in \(\eta \in [\frac{{\hat{\beta }}}{2},4L]\); \(G(\cdot ,x)\in C^{1,{{\bar{\gamma }}}}([\frac{{\hat{\beta }}}{2},4\,L])\) for every \(x\in \Omega \) and \(G\in L^\infty ((\frac{{\hat{\beta }}}{2},4\,L)\times \Omega )\).

  2. (H2)

    \(G'(\cdot , x)>0\) in \([\frac{{\hat{\beta }}}{2},4L]\) for \(x\in \Omega \) and, for some \(\gamma _0\) constant, \(G\ge \gamma _0>0\) in \([\frac{{\hat{\beta }}}{2},4L]\times \Omega \).

These assumptions are complemented with the following structural conditions:

  1. (H3)

    There exists \(C>0\) such that \(0\le G'' (\cdot , x)\le C\) in \([\frac{{\hat{\beta }}}{2},4L]\) for \(x\in \Omega \).

  2. (H4)

    There exists \(\delta >0\) such that

    $$\begin{aligned} G(\eta , x)\ge \eta \frac{\partial G}{\partial \eta }(\eta , x) +\delta , \quad \text{ for } \text{ all }\,\, \frac{{\hat{\beta }}}{2}\le \eta \le 4L\,\, \text{ and }\,\, x\in \Omega . \end{aligned}$$

We present some interesting examples of functions satisfying (H1)–(H4) at the end of this section (see Remarks 7.7 to 7.12).

We will now deal with problem (7.1). Let \(x_0\in F(u)\). Without loss of generality we assume that \(x_0=0\). Also, for notational convenience we set \(p_0=p(0)\) and

$$\begin{aligned} G_0(\beta )=G(\beta ,0). \end{aligned}$$

Let \(U_\beta \) be the two-plane solution to (7.1) when \(p(x)\equiv p_0\), \(f \equiv 0 \) and \(G=G_0\), i.e.,

$$\begin{aligned} U_\beta (x) = \alpha x_n^+ - \beta x_n^-, \quad \beta \ge 0, \quad \alpha =G_0(\beta ). \end{aligned}$$

The following definitions parallel those in Sect. 2.

Definition 7.1

Let u be a continuous function in \(\Omega \). We say that u is a viscosity solution to (7.1) in \(\Omega \), if the following conditions are satisfied:

  1. (i)

    \(\Delta _{p(x)} u = f\) in \(\Omega ^+(u) \cup \Omega ^-(u)\) in the weak sense of Definition 2.1.

  2. (ii)

    Let \(x_0 \in F(u)\) and \(v \in C^2(\overline{B^+(v)}) \cap C^2(\overline{B^-(v)})\) (\(B=B_\delta (x_0)\)) with \(F(v) \in C^2\). If v touches u by below (resp. above) at \(x_0 \in F(v)\), then

    $$\begin{aligned} v_\nu ^+(x_0) \le G(v_\nu ^-(x_0), x_0) \quad (\text {resp. }\ge ). \end{aligned}$$

Next theorem follows as a consequence of our Theorem 2.2.

Theorem 7.2

Let u be a viscosity solution to (7.1) in \(\Omega \). Then the following conditions are satisfied:

  1. (i)

    \(\Delta _{p(x)} u = f\) in \(\Omega ^+(u) \cup \Omega ^-(u)\) in the viscosity sense.

  2. (ii)

    Let \(x_0 \in F(u)\) and \(v \in C^2(\overline{B^+(v)}) \cap C^2(\overline{B^-(v)})\) (\(B=B_\delta (x_0)\)) with \(F(v) \in C^2\). If v touches u by below (resp. above) at \(x_0 \in F(v)\), then

    $$\begin{aligned} v_\nu ^+(x_0) \le G(v_\nu ^-(x_0), x_0) \quad (\text {resp. } \ge ). \end{aligned}$$

We will also need

Definition 7.3

We say that \(v \in C(\Omega )\) is a (strict) comparison subsolution (resp. supersolution) to (7.1) in \(\Omega \), if \(v\in C^2(\overline{\Omega ^+(v)}) \cap C^2(\overline{\Omega ^-(v)})\), \(\nabla v\not =0\) in \(\overline{\Omega ^+(v)}\cup \overline{\Omega ^-(v)}\) and the following conditions are satisfied:

  1. (i)

    \(\Delta _{p(x)}v> f \) (resp. \(< f \)) in \(\Omega ^+(v) \cup \Omega ^-(v)\) (see Remark 2.8).

  2. (ii)

    If \(x_0 \in F(v)\), then

    $$\begin{aligned} v_\nu ^+(x_0)>G(v_\nu ^-(x_0),x_0) \quad (\text {resp. } v_\nu ^+(x_0)<G(v_\nu ^-(x_0),x_0)). \end{aligned}$$

Observe that the assertions in Remarks 2.9 and 2.10 also apply to free boundary problem (7.1).

From here after, most of the statements and proofs parallel those in the previous sections. Thus, we will only point out the main differences.

In the present section a constant depending only on n, \(p_{\min }\), \(p_{\max }\), on \({{\hat{\beta }}}\) and L (given in Theorems 1.3 and 1.4), on \([G(\eta ,\cdot )]_{C^{0,{{\bar{\gamma }}}}}\), \(\Vert G(\cdot , x)\Vert _{C^{1,{{\bar{\gamma }}}}}\), \(\Vert G\Vert _{L^\infty }\), \(\gamma _0\) and the constants C and \(\delta \) in assumptions (H3)–(H4) will be called universal.

The linearized problem corresponding to free boundary problem (7.1) will be again (3.1) (with \(a={\tilde{\alpha }}={\tilde{G}}_0({\tilde{\beta }})>0\) and \(b={{\tilde{\beta }}} {\tilde{G}}^{\prime }_0( {{\tilde{\beta }}})\ge 0\)), so we will apply again the results in Sect. 3.

As in the case of free boundary problem (1.7), also in the present case we proceed by obtaining an improvement of flatness lemma, that holds when the solution is trapped between parallel two-plane solutions \(U_\beta \) at \(\varepsilon \) distance, with \(\beta >0,\) which requires first the proof of Harnack inequality.

As in Sect. 4, Harnack inequality follows from the following basic lemma

Lemma 7.4

There exists a universal constant \({{\bar{\varepsilon }}}>0\) such that if u is a solution of (7.1) and satisfies

$$\begin{aligned} U_\beta (x_n+\sigma )\le u(x)\le U_\beta (x_n+\sigma +\varepsilon ),\quad x\in B_1, \ \ |\sigma |<\frac{1}{20}, \end{aligned}$$
(7.2)

for some \(0 < {\hat{\beta }}\le \beta \le L\), with

$$\begin{aligned}{} & {} \Vert f\Vert _{L^\infty (B_1)} \le \varepsilon ^2\min \{ 1, \beta ^{p_{\max }-1}, G_0(\beta )^{p_{\max }-1}\},\\{} & {} \Vert \nabla p\Vert _{L^\infty (B_1)}\le \varepsilon ^{1+\theta }\min \{ 1, \beta ^{p_{\max }-1}, G_0(\beta )^{p_{\max }-1}\},\quad 0<\theta \le 1,\nonumber \end{aligned}$$
(7.3)
$$\begin{aligned}{} & {} \Vert G(\eta ,x) - G_0(\eta )\Vert _{L^\infty (B_1)}\le \varepsilon ^2, \quad \text { for all } {\hat{\beta }}\le \eta \le 2L, \end{aligned}$$
(7.4)

and in \({{\bar{x}}}=\frac{1}{10}e_n,\)

$$\begin{aligned} u({{\bar{x}}})\ge U_\beta \left( {{\bar{x}}}_n+\sigma +\frac{\varepsilon }{2}\right) , \end{aligned}$$

for some \(\varepsilon \le {\bar{\varepsilon }}\), then

$$\begin{aligned} u(x) \ge U_\beta (x_n+\sigma +c{\varepsilon }) \quad \text {in } {\overline{B}}_{\frac{1}{2}}, \end{aligned}$$
(7.5)

for some universal \(0<c<1.\) Analogously, if

$$\begin{aligned} u({{\bar{x}}})\le U_\beta \left( {{\bar{x}}}_n+\sigma +\frac{\varepsilon }{2}\right) , \end{aligned}$$

then

$$\begin{aligned} u(x) \le U_\beta (x_n+\sigma +(1-c){\varepsilon }) \quad \text {in } {\overline{B}}_{\frac{1}{2}}. \end{aligned}$$
(7.6)

Proof

We argue as in the proof of Lemma 4.5 and we only point out the main differences. We prove the first statement and for notational simplicity we drop the sub-index \(\beta \) from \(U_\beta \).

From (7.2) we have that \(u(x)\ge U(x_n+\sigma )\) in \(B_1\) and that \(B_{1/20}({\bar{x}})\subset B_1^+(u).\) Then,

$$\begin{aligned} \Delta _{p(x)}u=f\quad \text { in } B_{1/20}({\bar{x}}). \end{aligned}$$

Thus, \(u\in C^{1,{{\widetilde{\gamma }}}}\) in \({\overline{B}}_{1/40}({\bar{x}}),\) where \({{\widetilde{\gamma }}}\in (0,1)\) and \(||u||_{C^{1,{{\widetilde{\gamma }}}}({\overline{B}}_{1/40}({\bar{x}}))}\le C,\) with \(C\ge 1\). Here \({{\widetilde{\gamma }}}\) and C are universal constants depending only on \(p_{\min },p_{\max },n,L\) and \(G_0(L)\). We have used (7.3) and also that (7.2) implies that \(||u||_{L^{\infty }(B_1)}\le 2\max \{L, G_0(L)\}\).

We consider two cases:

Case (i). Suppose \(|\nabla u({\bar{x}})|<\frac{\alpha }{4}\). As in Lemma 4.5 we denote \(q(x)=\alpha (x_n+ \sigma )\) and obtain for all \(x\in B_{r_3}({\bar{x}}_0)\)

$$\begin{aligned} \alpha \frac{c_0}{2}\varepsilon \le u(x)-q(x), \end{aligned}$$

with \({\bar{x}}_0:={\bar{x}}-r_2e_n\). The constants \(c_0, r_2, r_3\) are universal, chosen as in Lemma 4.5 and depending only on \(p_{\min },p_{\max },n,L, G_0(L)\) and \(\gamma _0\). In the present case we use that \(\alpha =G_0(\beta )\ge \gamma _0>0\) and we ask that \(r_3\) satisfies, in addition, that \(r_3\le \frac{\gamma _0}{2}r_2\).

For \(t\ge 0\) we define \(v_t\) as in (4.17) and consider \({\bar{t}}\) the largest \(t \ge 0\) such that

$$\begin{aligned} v_{t}(x) \le u(x) \quad \text {in } {{\overline{B}}}_{\frac{4}{5}}({\bar{x}}_0). \end{aligned}$$

We want to show that \({{\bar{t}}} \ge \frac{c_0}{2}.\) Then, arguing as in Lemma 4.5, we will get (7.5) for a universal constant \(0<c<1\) depending only on \(p_{\min },p_{\max },n,L, G_0(L)\) and \(\gamma _0\).

If we assume \({{\bar{t}}} < \frac{c_0}{2}\), we will get a contradiction exactly as in Lemma 4.5, if we show that \(v_{{\bar{t}}}\) is a strict subsolution to (7.1) in A. In fact, recalling (7.3), we obtain from Theorem 4.4 that in \(A^+(v_{{{\bar{t}}}})\)

$$\begin{aligned} \Delta _{p(x)}v_{{{\bar{t}}}} > \varepsilon ^2\min \{ 1, \alpha ^{p_{\max }-1}\}= \varepsilon ^2\min \{ 1, G_0(\beta )^{p_{\max }-1}\} \ge \Vert f\Vert _\infty \end{aligned}$$

and in \(A^-(v_{{{\bar{t}}}})\)

$$\begin{aligned} \Delta _{p(x)}v_{{{\bar{t}}}} > \varepsilon ^2\min \{ 1, \beta ^{p_{\max }-1}\} \ge \Vert f\Vert _\infty \end{aligned}$$

for \(\varepsilon _1=\varepsilon _1(n,p_{\min }, p_{\max }, L, G_0(L), \gamma _0)\). Also, as in Lemma 4.5 (see (4.18)),

$$\begin{aligned} -{\tilde{c}}_1\le \psi _n \le -{\tilde{c}}_2 <0 \quad \text {on } F(v_{{{\bar{t}}}}) \cap A, \end{aligned}$$

with \({\tilde{c}}_1\) and \({\tilde{c}}_2\) universal constants, for \(\varepsilon \le \varepsilon _2\), with \(\varepsilon _2\) universal. Then we have

$$\begin{aligned} k \equiv |e_n-\varepsilon \frac{c_0}{2}\nabla \psi |=\left( 1-\varepsilon c_0 \psi _n+\varepsilon ^2\frac{c_0^2}{4}|\nabla \psi |^2\right) ^{1/2} = 1+ {{\tilde{k}}} \varepsilon , \end{aligned}$$

where \(0<c_1\le {\tilde{k}}\le c_2\), with \(c_1,c_2\) universal constants and moreover,

$$\begin{aligned} 1< k \le 2, \end{aligned}$$
(7.7)

if \(\varepsilon \le \varepsilon _3\) universal. We will show that, on \(F(v_{{{\bar{t}}}}) \cap A,\) using (7.4), we can write,

$$\begin{aligned} (v_{{\bar{t}}}^{+})_{\nu }-G((v_{{\bar{t}}}^{-})_{\nu },x)>0, \end{aligned}$$

as long as \(\varepsilon \le \varepsilon _4\) universal. In fact, recalling (7.4) and (7.7), we get

$$\begin{aligned} \begin{aligned} (v_{{{\bar{t}}}}^+)_\nu -G((v_{{{\bar{t}}}}^-)_\nu , x)&=G_0(\beta )k-G(\beta k, x)\\&\ge (1+\varepsilon {\tilde{k}})G_0(\beta )-G_0(\beta k)-\varepsilon ^2. \end{aligned} \end{aligned}$$
(7.8)

Hence, there exists \(\xi \in (\beta ,\beta k)\) such that (7.8) gives

$$\begin{aligned} \begin{aligned}&(v_{{{\bar{t}}}}^+)_\nu -G((v_{{{\bar{t}}}}^-)_\nu , x)\\&\quad \ge G_0'(\xi )\beta (1-k)+\varepsilon {\tilde{k}}G_0(\beta )-\varepsilon ^2=-\varepsilon {\tilde{k}}\beta G_0'(\xi )+\varepsilon {\tilde{k}}G_0(\beta )-\varepsilon ^2\\&\quad =\varepsilon \left( {\tilde{k}}(G_0(\beta )-\beta G_0'(\xi ))-\varepsilon \right) . \end{aligned} \end{aligned}$$
(7.9)

Since we have assumed (H3), now, using that \(G_0'\) is increasing in \([{\hat{\beta }}, 2L]\), from (7.9) we obtain, for some \({\tilde{\eta }} \in (\beta ,\beta k)\),

$$\begin{aligned} \begin{aligned}&(v_{{{\bar{t}}}}^+)_\nu -G((v_{{{\bar{t}}}}^-)_\nu , x)\ge \varepsilon \left( {\tilde{k}}(G_0(\beta )-\beta G_0'(\beta k))-\varepsilon \right) \\&\quad =\varepsilon \left( {\tilde{k}}\left( G_0(\beta )-(\beta G_0'(\beta )+G_0''({\tilde{\eta }})\varepsilon \beta ^2 {\tilde{k}})\right) -\varepsilon \right) . \end{aligned} \end{aligned}$$

Next, keeping in mind that \(0\le G_0''\le C\) in \([{\hat{\beta }}, 2\,L]\), we deduce

$$\begin{aligned} \begin{aligned}&(v_{{{\bar{t}}}}^+)_\nu -G((v_{{{\bar{t}}}}^-)_\nu , x)\ge \varepsilon \left( {\tilde{k}}\left( G_0(\beta )-\beta G_0'(\beta )-C\varepsilon \beta ^2 {\tilde{k}}\right) -\varepsilon \right) . \end{aligned} \end{aligned}$$
(7.10)

Hence, since we have assumed (H4), there holds

$$\begin{aligned} \begin{aligned}&G_0(\beta )\ge \beta G_0'(\beta )+\delta \end{aligned} \end{aligned}$$
(7.11)

for some \(\delta >0\), since \(0<{\hat{\beta }}\le \beta \le L\). Then, from (7.10) and (7.11) we conclude that

$$\begin{aligned} (v_{{{\bar{t}}}}^+)_\nu -G((v_{{{\bar{t}}}}^-)_\nu , x)\ge \varepsilon \left( {\tilde{k}}\left( \delta -C\varepsilon \beta ^2 {\tilde{k}}\right) -\varepsilon \right) >0, \end{aligned}$$

if \(\varepsilon \le \varepsilon _0\) universal.

Thus, \(v_{{{\bar{t}}}}\) is a strict subsolution to (7.1) in A as desired.

Case (ii). Now suppose \(|\nabla u({\bar{x}})|\ge \frac{\alpha }{4}.\) By exploiting the \(C^{1,{{\widetilde{\gamma }}}}\) regularity of u in \({\overline{B}}_{\frac{1}{40}}({\bar{x}})\), we know that u is Lipschitz continuous in \({\overline{B}}_{\frac{1}{40}}({\bar{x}})\), as well as there exists a constant \(0<r_0\), with \(8r_0\le \frac{1}{40}\), and \(C>1\), \(r_0\) and C depending only on \(n, p_{\min },p_{\max },L, G_0(L)\) and \(\gamma _0\) such that

$$\begin{aligned} \frac{\gamma _0}{8}\le |\nabla u|\le C \quad \text { in } B_{8r_0}({\bar{x}}). \end{aligned}$$

We now use (7.3) and combine the argument in Case (ii) of Lemma 4.5 with the ones above. This completes the proof. \(\square \)

With Lemma 7.4 at hand, Harnack inequality and its corollary follow as in Sect. 4.

Corollary 7.5

There exists a universal constant \(\bar{\varepsilon }\), such that if u is a solution of (7.1) that satisfies at some point \(x_0 \in B_2\)

$$\begin{aligned} U_\beta (x_n+ a_0) \le u(x) \le U_\beta (x_n+ b_0) \quad \text {in }B_1(x_0) \subset B_2, \end{aligned}$$

for some \(0<{{\hat{\beta }}} \le \beta \le L\), with

$$\begin{aligned} b_0 - a_0 \le \varepsilon , \end{aligned}$$

and let (7.3)–(7.4) in \(B_2\) hold, for \(\varepsilon \le {{\bar{\varepsilon }}}\), then (\(\alpha =G_0(\beta )\))

$$\begin{aligned} {{\tilde{u}}}_\varepsilon (x) = {\left\{ \begin{array}{ll} \dfrac{u(x) -\alpha x_n }{\alpha \varepsilon } &{}\quad \text {in }B_2^+(u) \cup F(u) \\ \ \\ \dfrac{u(x) -\beta x_n }{\beta \varepsilon } &{}\quad \text {in }B_2^-(u), \end{array}\right. } \end{aligned}$$

has, in \(B_1(x_0),\) a Hölder modulus of continuity at \(x_0\), outside the ball of radius \(\varepsilon /{{\bar{\varepsilon }}}\). That is, for all \(x \in B_1(x_0)\), with \(|x-x_0| \ge \varepsilon /{{\bar{\varepsilon }}}\),

$$\begin{aligned} |{{\tilde{u}}}_\varepsilon (x) - {{\tilde{u}}}_\varepsilon (x_0)| \le C |x-x_0|^{{\widehat{\gamma }}}. \end{aligned}$$

Here C and \(0<{{\widehat{\gamma }}}<1\) are universal.

We now extend the basic induction step towards \(C^{1,\gamma }\) regularity at 0. We argue as in the proof of Lemma 5.1.

Lemma 7.6

(Improvement of flatness) Let u be a solution of (7.1) that satisfies

$$\begin{aligned} U_\beta (x_n -\varepsilon ) \le u(x) \le U_\beta (x_n + \varepsilon ) \quad \text {in }B_1,\quad 0\in F(u), \end{aligned}$$
(7.12)

for some

$$\begin{aligned} 0<{{\hat{\beta }}} \le \beta \le L, \end{aligned}$$
(7.13)

with

$$\begin{aligned}{} & {} \Vert f\Vert _{L^\infty (B_1)} \le \varepsilon ^2\min \{ 1, \beta ^{p_{\max }-1}, G_0(\beta )^{p_{\max }-1}\},\\{} & {} \Vert \nabla p\Vert _{L^\infty (B_1)}\le \varepsilon ^{1+\theta }\min \{ 1, \beta ^{p_{\max }-1}, G_0(\beta )^{p_{\max }-1}\},\quad \frac{1}{2}<\theta \le 1,\\{} & {} \Vert p-p_0\Vert _{L^\infty (B_1)}\le \varepsilon \end{aligned}$$

and

$$\begin{aligned} \Vert G(\eta ,x) - G_0(\eta )\Vert _{L^\infty (B_1)}\le \varepsilon ^2, \quad \text { for all } {\hat{\beta }}\le \eta \le 2L. \end{aligned}$$

If \(0<r \le r_0\) for \(r_0\) universal, and \(0<\varepsilon \le \varepsilon _0\) for some \(\varepsilon _0\) depending on r, then

$$\begin{aligned} U_{\beta ^{\prime }}\left( x \cdot \nu _1 -r\frac{\varepsilon }{2}\right) \le u(x) \le U_{\beta ^{\prime }}\left( x \cdot \nu _1 +r\frac{\varepsilon }{2}\right) \quad \text {in }B_r, \end{aligned}$$
(7.14)

with \(|\nu _1|=1,\) \(|\nu _1 - e_n| \le {{\tilde{C}}}\varepsilon \), and \(|\beta -\beta ^{\prime }| \le {{\tilde{C}}}\beta \varepsilon \) for a universal constant \({{\tilde{C}}}.\)

Proof

We divide the proof into three steps.

Step 1—Compactness. Fix \(r \le r_0\) with \(r_0\) universal (the precise \(r_0\) will be given in Step 3). Assume by contradiction that we can find a sequence \(\varepsilon _k \rightarrow 0\) and a sequence \(u_k\) of solutions to (7.1) in \(B_1\) with right hand side \(f_k\), exponent \(p_k\) and free boundary condition given by \(G_k\), with \(\alpha _k=G_k(\beta _k,0)\), that satisfies

$$\begin{aligned}{} & {} \begin{aligned}&\Vert f_k\Vert _{L^\infty (B_1)} \le \varepsilon _k^2\min \{ 1, \beta _k^{p_{\max }-1}, \alpha _k^{p_{\max }-1}\},\\&\Vert \nabla p_k\Vert _{L^\infty (B_1)}\le \varepsilon _k^{1+\theta }\min \{ 1, \beta _k^{p_{\max }-1}, \alpha _k^{p_{\max }-1}\}, \quad \frac{1}{2}<\theta \le 1\\&\Vert p_k-p_0\Vert _{L^\infty (B_1)}\le \varepsilon _k, \end{aligned} \end{aligned}$$
(7.15)
$$\begin{aligned}{} & {} \Vert G_k(\eta ,\cdot ) - G_k(\eta ,0)\Vert _{L^\infty (B_1)}\le \varepsilon _k^2, \quad \text{ for } \text{ all }\,\, {\hat{\beta }} \le \eta \le 2L,\\{} & {} U_{\beta _k}(x_n -\varepsilon _k) \le u_k(x) \le U_{\beta _k}(x_n + \varepsilon _k) \quad \text {for }x \in B_1, 0 \in F(u_k),\nonumber \end{aligned}$$
(7.16)

with \({\hat{\beta \le \beta _k}} \le L \), but such that \(u_k\) does not satisfy the conclusion (7.14).

Let us define the normalized functions

$$\begin{aligned} {\tilde{u}}_{k}(x)= {\left\{ \begin{array}{ll} \dfrac{u_k(x) - \alpha _k x_n}{\alpha _k \varepsilon _k}, &{}\quad x \in B_1^+(u_k) \cup F(u_k) \\ \ \\ \dfrac{u_k(x) - \beta _k x_n}{\beta _k\varepsilon _k},&{}\quad x \in B_1^-(u_k),\end{array}\right. } \end{aligned}$$

that are given by the same formula as in Lemma 5.1. Up to a subsequence, \(G_k(\cdot ,0)\) converges, locally uniformly, to some \(C^1\)-function \({{\tilde{G}}}_0\), while

$$\begin{aligned} \beta _k \rightarrow {{\tilde{\beta }}} \ge {{\hat{\beta }}}>0 \end{aligned}$$

and hence

$$\begin{aligned} \alpha _k \rightarrow {{\tilde{\alpha }}} ={{\tilde{G}}}_0({\tilde{\beta }})>0. \end{aligned}$$

Moreover, by Corollary 7.5 the graphs of \({\tilde{u}}_k\) converge in the Hausdorff distance to a Hölder continuous function \({{\tilde{u}}}\) over \(B_{1/2}.\)

Step 2—Limiting Solution. We now show that \({{\tilde{u}}}\) solves the linearized problem (transmission problem)

$$\begin{aligned} {\left\{ \begin{array}{ll} {\mathcal {L}}_{p_0}{\tilde{u}}=0 &{} \quad \text {in }B_{1/2}\cap \{x_n\not =0\}, \\ a ({{\tilde{u}}}_n)^+ - b ({{\tilde{u}}}_n)^-=0 &{} \quad \text {on }B_{1/2} \cap \{x_n =0\}, \end{array}\right. } \end{aligned}$$
(7.17)

in the sense of Definition 3.1, with

$$\begin{aligned} a={{{\tilde{\alpha }}}}>0,\quad b={\tilde{\beta }}{{\tilde{G}}}_0^{\prime }({{\tilde{\beta }}})\ge 0, \end{aligned}$$
(7.18)

where \(p_0\) is a constant such that \(1<p_{\min }\le p_0\le p_{\max }<\infty \), and

$$\begin{aligned} {{\mathcal {L}}}_{p_0} {\tilde{u}}:= \Delta {\tilde{u}} +(p_0-2) {\partial }_{nn} {\tilde{u}}. \end{aligned}$$

In fact, the proof that \({\mathcal {L}}_{p_0}{\tilde{u}}=0\) in \(B_{1/2}\cap \{x_n\not =0\}\) follows exactly as in Lemma 5.1. We need to define, in the present case, \(\sigma _k=\min \{ 1, \beta _k^{p_{\max }-1}, \alpha _k^{p_{\max }-1}\}\) and observe that \(\sigma _k\rightarrow \min \{ 1, {\tilde{\beta }}^{p_{\max }-1}, {\tilde{\alpha }}^{p_{\max }-1}\}\).

Next, we prove that \({{\tilde{u}}}\) satisfies the transmission condition in problem (7.17)–(7.18) in the viscosity sense.

Again we argue by contradiction. Let be \(\gamma \) a specific constant that will be chosen as in Lemma 5.1 and let \({{\tilde{\phi }}}\) be a function of the form

$$\begin{aligned} {{\tilde{\phi }}}(x) = A+ px_n^+- qx_n^- + B Q^\gamma (x-y), \end{aligned}$$

with

$$\begin{aligned} Q^\gamma (x) = \frac{1}{2} [\gamma x_n^2 - |x^{\prime }|^2], \quad y=(y^{\prime },0), \quad A\in {\mathbb {R}}, B >0 \end{aligned}$$

and

$$\begin{aligned} {\tilde{\alpha }} p- {{\tilde{\beta }}} {{\tilde{G}}}_0^{\prime }({\tilde{\beta }}) q>0, \end{aligned}$$

and assume that \({{\tilde{\phi }}}\) touches \({\tilde{u}}\) strictly from below at a point \(x_0= (x_0^{\prime }, 0) \in B_{1/2}\).

As in Lemma 5.1, let

$$\begin{aligned} \phi _k(x)= a_k \Gamma ^{\gamma +}_k(x) - b_k \Gamma ^{\gamma -}_k(x) + \alpha _k (d_k^+(x))^2\varepsilon _k^{3/2} +\beta _k(d_k^-(x))^2\varepsilon _k^{3/2} \end{aligned}$$

where, we recall,

$$\begin{aligned} a_k=\alpha _k(1+\varepsilon _k p), \quad b_k=\beta _k(1+\varepsilon _k q) \end{aligned}$$

and \(d_k(x)\) is the signed distance from x to \(\partial B_{\frac{1}{B\varepsilon _k}}(y+e_n(\frac{1}{B\varepsilon _k}-A\varepsilon _k)).\) Moreover,

$$\begin{aligned} \psi _k(x)=\phi _k(x+\varepsilon _k c_ke_n) \end{aligned}$$

touches \(u_k\) from below at \(x_k,\) with \(c_k \rightarrow 0, x_k \rightarrow x_0.\)

We get a contradiction if we prove that \(\psi _k\) is a strict subsolution to our free boundary problem. That is,

$$\begin{aligned} \left\{ \begin{array}{ll} \Delta _{p_k(x)} \psi _k> f_k&{} \quad \hbox {in } B_{\frac{1}{2}}^+(\psi _k) \cup B_{\frac{1}{2}}^-(\psi _k), \\ (\psi _k^+)_\nu - G_k((\psi _k^-)_\nu ,x) >0 &{} \quad \hbox {on }F(\psi _k). \end{array} \right. \end{aligned}$$

In fact, if we proceed as in the proof of Lemma 5.1, we get

$$\begin{aligned} \Delta _{p_k(x)} \psi _k > \varepsilon _k^2\min \{ 1, \beta _k^{p_{\max }-1}, \alpha _k^{p_{\max }-1}\}\ge \Vert f_k\Vert _{\infty }, \quad \hbox {in}\,\, B_{1/2}^+(\psi _k) \cup B_{1/2}^-(\psi _k). \end{aligned}$$

Here we use (7.15) and that \({\hat{\beta }}\le \beta _k\le L\) and \(\gamma _0\le \alpha _k=G_k(\beta _k,0)\le C\), where C is universal, to get (5.12) and (5.13).

Finally, since on the zero level set \(|\nabla \Gamma _k^\gamma |=1\) and \(|\nabla d^2_k|=0\) the free boundary condition reduces to showing that

$$\begin{aligned} a_k-G_k(b_k,x) >0. \end{aligned}$$

Using the definition of \(a_k, b_k\), we need to check that

$$\begin{aligned} \alpha _k(1+\varepsilon _kp) -G_k(\beta _k(1+\varepsilon _k q),x) >0. \end{aligned}$$

From (7.16), it suffices to see that

$$\begin{aligned} \alpha _k(1+\varepsilon _kp) -G_k(\beta _k(1+\varepsilon _k q),0) -\varepsilon _k^2 >0. \end{aligned}$$

This inequality holds for k large in view of the fact that

$$\begin{aligned} {{\tilde{\alpha }}} p -{{\tilde{\beta }}} {{\tilde{G}}}^{\prime }_0({{\tilde{\beta }}}) q >0. \end{aligned}$$

Thus \({{\tilde{u}}}\) is a viscosity solution to the linearized problem.

Step 3—Contradiction. As in Lemma 5.1, since \({{\tilde{u}}}(0)=0\) we obtain that

$$\begin{aligned} |{{\tilde{u}}} - (x^{\prime }\cdot \nu ^{\prime }+ px_n^+ -qx_n^-)| \le C r^{2}, \quad x\in B_r, \end{aligned}$$

for all \(r\le \frac{1}{4}\) and with

$$\begin{aligned} {{\tilde{\alpha }}} p -{{\tilde{\beta }}} {{\tilde{G}}}_0^{\prime }({\tilde{\beta }}) q=0, \quad |\nu ^{\prime }| = |\nabla _{x^{\prime }} {{\tilde{u}}} (0)| \le C. \end{aligned}$$

Thus, since \({{\tilde{u}}}_k\) converges uniformly to \({{\tilde{u}}}\) (by slightly enlarging C) we get that

$$\begin{aligned} |{{\tilde{u}}}_k - (x^{\prime }\cdot \nu ^{\prime }+ px_n^+ -qx_n^-)| \le C r^{2}, \quad x\in B_r. \end{aligned}$$

Now, set

$$\begin{aligned} \beta ^{\prime }_k = \beta _k(1+\varepsilon _k q), \quad \nu _k = \frac{1}{\sqrt{1+ \varepsilon _k^2 |\nu ^{\prime }|^2}}(e_n + \varepsilon _k (\nu ^{\prime }, 0)). \end{aligned}$$

Then,

$$\begin{aligned} \alpha ^{\prime }_k&= G_k(\beta _k(1+\varepsilon _k q),0) =G_k(\beta _k,0)+\beta _k G_k^{\prime }(\beta _k,0)\varepsilon _k q + o(\varepsilon _k)\\&=\alpha _k(1+\beta _k\frac{G_k^{\prime }(\beta _k,0)}{\alpha _k}q\varepsilon _k)+ o(\varepsilon _k) =\alpha _k(1+\varepsilon _kp)+ o(\varepsilon _k), \end{aligned}$$

since from the identity \({{\tilde{\alpha }}} p -{\tilde{\beta }}{{\tilde{G}}}_0^{\prime }({\tilde{\beta }})q=0\) we derive that

$$\begin{aligned} \beta _k\frac{G_k^{\prime }(\beta _k,0)}{\alpha _k}q = p + o(1). \end{aligned}$$

Moreover,

$$\begin{aligned} \nu _k =e_n + \varepsilon _k (\nu ^{\prime }, 0) + \varepsilon _k^2 \tau , \quad |\tau |\le C. \end{aligned}$$

With these choices, it follows as in Lemma 5.1 that (for k large and \(r \le r_0\))

$$\begin{aligned} {\widetilde{U}}_{\beta ^{\prime }_k}(x\cdot \nu _k -\varepsilon _k\frac{r}{2}) \le {{\tilde{u}}}_k(x) \le {\widetilde{U}}_{\beta ^{\prime }_k}(x\cdot \nu _k +\varepsilon _k\frac{r}{2}), \quad \text {in }B_r \end{aligned}$$

which leads to a contradiction. \(\square \)

We are now in position to prove the main results for our problem (7.1). We will prove Theorem 1.4, which will then imply Theorem 1.3. A similar argument as that in Remark 6.1 also applies here.

Proof of Theorem 1.4

For notational simplicity we assume that u satisfies our hypotheses in the ball \(B_2\) and \(0 \in F(u)\). We denote \(p_0=p(0)\).

Let us fix \({{\bar{r}}} >0\) to be a universal constant such that

$$\begin{aligned} {{\bar{r}}} \le \min \left\{ r_0, 1/2^{p_{\max }+1}, (1/4)^{\frac{1}{{\bar{\gamma }}}}\right\} , \end{aligned}$$

where \({\bar{\gamma }}\) is as in (1.9), and \(r_0\) is the universal constant in the improvement of flatness Lemma 7.6, when \(\beta \) in (7.12) satisfies

$$\begin{aligned} 0<\frac{{{\hat{\beta }}}}{2}\le \beta \le 2L \end{aligned}$$
(7.19)

instead of (7.13).

Also, let us fix a universal constant \({{\tilde{\varepsilon }}}>0\) such that

$$\begin{aligned} {{\tilde{\varepsilon }}} \le \min \left\{ \varepsilon _0({{\bar{r}}}),\, \frac{1}{2{{\tilde{C}}}}, \, \min \big \{1,({{\hat{\beta }}}/2)^{p_{\max }-1}, G_0({\hat{\beta }}/2)^{p_{\max }-1}\big \},\, \frac{\text{ log }(2)}{6{{\tilde{C}}}}\right\} \end{aligned}$$

with \(\varepsilon _0, {{\tilde{C}}}\) the constants in Lemma 7.6 when (7.19) holds.

Now, let

$$\begin{aligned} {{\bar{\varepsilon }}} = {{\tilde{\varepsilon }}}^3. \end{aligned}$$

In view of our choice of \({{\tilde{\varepsilon }}}\), we obtain that u satisfies the assumptions of Lemma 7.6,

$$\begin{aligned} U_\beta (x_n -{{\tilde{\varepsilon }}}) \le u(x) \le U_\beta (x_n + {{\tilde{\varepsilon }}}) \quad \text {in }B_1, \quad 0\in F(u), \end{aligned}$$

with (7.19) and

$$\begin{aligned}{} & {} \Vert f\Vert _{L^\infty (B_1)} \le {{\tilde{\varepsilon }}}^3 \le {{\tilde{\varepsilon }}}^2\min \{ 1, {\beta }^{p_{\max }-1}, G_0(\beta )^{p_{\max }-1}\},\\{} & {} \Vert \nabla p\Vert _{L^\infty (B_1)}\le {{\tilde{\varepsilon }}}^3\le {{\tilde{\varepsilon }}}^{1+\theta }\min \{ 1, \beta ^{p_{\max }-1}, G_0(\beta )^{p_{\max }-1}\}, \qquad \frac{1}{2} <\theta \le 1,\\{} & {} \Vert p-p_0\Vert _{L^\infty (B_1)}\le {\tilde{\varepsilon }}^3\le {{\tilde{\varepsilon }}} \end{aligned}$$

and

$$\begin{aligned} \Vert G(\eta ,x) - G_0(\eta )\Vert _{L^\infty (B_1)}\le {\tilde{\varepsilon }}^3\le {\tilde{\varepsilon }}^2, \quad \text { for all } \frac{{\hat{\beta }}}{2}\le \eta \le 4L. \end{aligned}$$

Thus we can conclude that (\(\beta _1=\beta '\))

$$\begin{aligned} U_{\beta _1}\left( x \cdot \nu _1 -{{\bar{r}}}\frac{{{\tilde{\varepsilon }}}}{2}\right) \le u(x) \le U_{\beta _1}\left( x \cdot \nu _1 +{{\bar{r}}}\frac{{{\tilde{\varepsilon }}} }{2}\right) \quad \text {in } B_{{{\bar{r}}}}, \end{aligned}$$

with \(|\nu _1|=1,\) \( |\nu _1 - e_n| \le {{\tilde{C}}}{{\tilde{\varepsilon }}}\), and \(|\beta -\beta _1| \le {{\tilde{C}}}\beta {{\tilde{\varepsilon }}}\). In particular, by our choice of \({{\tilde{\varepsilon }}}\) we have

$$\begin{aligned} 0<\frac{{{\hat{\beta }}}}{2}\le \frac{\beta }{2}\le \beta _1\le 2\beta \le 2L. \end{aligned}$$

We can therefore rescale and iterate the argument above. Precisely, set (\(k=0,1,2....\))

$$\begin{aligned} \rho _k = {{\bar{r}}}^k, \quad \varepsilon _k = 2^{-k}{{\tilde{\varepsilon }}} \end{aligned}$$

and

$$\begin{aligned} p_k(x)= & {} p(\rho _k x), \quad u_k(x) = \frac{1}{\rho _k} u(\rho _k x),\\ f_k(x)= & {} \rho _k f(\rho _k x),\quad G_k(\eta , x) = G(\eta , \rho _k x). \end{aligned}$$

Notice that each \(u_k\) is a viscosity solution to (7.1) in \(B_1\), with right hand side \(f_k\), exponent \(p_k\) and free boundary condition given by \(G_k\). Moreover, the functions \(G_k\) satisfy (H1)–(H4) in \(B_1\), with the same constants as G.

Also, let \(\beta _k\) be the constants generated at each k-iteration, that satisfy (\(\beta _0=\beta \))

$$\begin{aligned} |\beta _k-\beta _{k+1}| \le {{\tilde{C}}} \beta _k \varepsilon _k. \end{aligned}$$

As in Theorem 1.2, it follows that

$$\begin{aligned} \frac{\beta _k}{2}\le \beta _{k+1}\le 2\beta _k \end{aligned}$$

and

$$\begin{aligned} 0<\frac{{{\hat{\beta }}}}{2}\le \beta _k\le 2L. \end{aligned}$$

Then we obtain by induction that each \(u_k\), \(k\ge 0\), satisfies

$$\begin{aligned} U_{\beta _k}(x \cdot \nu _k -\varepsilon _k) \le u_k(x) \le U_{\beta _k}(x \cdot \nu _k +\varepsilon _k ) \quad \text {in }B_1,\quad 0\in F(u), \end{aligned}$$
(7.20)

with \(|\nu _k|=1\), \( |\nu _k - \nu _{k+1}| \le {{\tilde{C}}} \varepsilon _k\) (\(\nu _0=e_n\)),

$$\begin{aligned} \begin{aligned}&\Vert f_k\Vert _{L^\infty (B_1)} \le \varepsilon _k^2\min \{ 1, {\beta _k}^{p_{\max }-1}, G_0(\beta _k)^{p_{\max }-1}\},\\&\Vert \nabla p_k\Vert _{L^\infty (B_1)}\le \varepsilon _k^{1+\theta }\min \{ 1, \beta _k^{p_{\max }-1}, G_0(\beta _k)^{p_{\max }-1}\}, \qquad \frac{1}{2} <\theta \le 1,\\&\Vert p_k-p_0\Vert _{L^\infty (B_1)}\le \varepsilon _k \end{aligned} \end{aligned}$$

and

$$\begin{aligned} \Vert G_k(\eta ,x) - G_0(\eta )\Vert _{L^\infty (B_1)}\le \varepsilon _k^2, \quad \text { for all } \frac{{\hat{\beta }}}{2}\le \eta \le 4L. \end{aligned}$$

This leads to the desired conclusion.\(\square \)

Remark 7.7

Let us present a family of functions G satisfying (H1)–(H4).

In fact, given \(p\in (1,+\infty )\), we define \(G(\eta ,x):[0,\infty )\times \ {\mathbb {R}}^n\rightarrow (0,\infty )\),

$$\begin{aligned} G(\eta ,x)=G(\eta ,0)=G_0(\eta ), \end{aligned}$$
(7.21)

where

$$\begin{aligned} G_0(\beta )=(1+\beta ^p)^{\frac{1}{p}}. \end{aligned}$$
(7.22)

Then, for \(\beta \in (0,+\infty )\),

$$\begin{aligned} G_0'(\beta )=\frac{\beta ^{p-1}}{(1+\beta ^p)^{\frac{p-1}{p}}}<1,\quad G_0''(\beta )=(p-1)\frac{\beta ^{p-2}}{(1+\beta ^p)^{2-\frac{1}{p}}}. \end{aligned}$$

Let \(0<{\hat{\beta }}<L\). Clearly, (H1)–(H2) are satisfied.

Moreover, there exists \(C({\hat{\beta }}, L, p)> 0\) such that

$$\begin{aligned} 0< G_0''(\beta )\le C({\hat{\beta }}, L, p),\quad \text{ for }\,\, 0<\frac{{\hat{\beta }}}{2}\le \beta \le 4L. \end{aligned}$$

Hence (H3) holds.

Now, since \(G_0'(\beta )<1\), then \(G_0(\beta )-G_0'(\beta )\beta \ge (1+\beta ^p)^{\frac{1}{p}}-\beta \). Thus, in order to see that (H4) holds, it is sufficient to prove that there exists \(\delta >0\) such that for every \(\beta \in [\frac{{\hat{\beta }}}{2},4L]\)

$$\begin{aligned} (1+\beta ^p)^{\frac{1}{p}}\ge \beta +\delta . \end{aligned}$$

Therefore, choosing \(\delta \) such that

$$\begin{aligned} 0<\delta \le \min _{[\frac{{\hat{\beta }}}{2},4L]}\left( (1+\beta ^p)^{\frac{1}{p}}- \beta \right) , \end{aligned}$$

we obtain that (H4) is satisfied.

The same result holds for

$$\begin{aligned} G_0(\beta )=({\bar{\gamma }}_0+\beta ^p)^{\frac{1}{p}}, \ \,\,\text{ with }\,\, {\bar{\gamma }}_0>0. \end{aligned}$$
(7.23)

Moreover, if in (7.23) we have \(1<p_{\min }\le p\le p_{\max }<\infty \) and \(0<g_0\le {\bar{\gamma }}_0\le g_1\), then the constants \(\gamma _0\), C and \(\delta \) in (H2), (H3) and (H4) can be chosen depending only on \({\hat{\beta }}, L, p_{\min }, p_{\max }, g_0,g_1\).

Remark 7.8

Notice that when \(p=2\) in (7.21) and (7.22), problem (7.1) becomes problem (1.7).

Remark 7.9

Let us now show that our Theorems 1.3 and 1.4 apply to problem (1.1). In fact, let us consider the function giving the free boundary condition in problem (1.1). That is,

$$\begin{aligned} G(\eta , x)=(g(x)+\eta ^{p(x)})^{\frac{1}{p(x)}}. \end{aligned}$$

Assume that \(g\in C^{0, {\bar{\gamma }}}(B_1),\) with \(0< g_0\le g(x)\le g_1 \) for some constants \(g_0, g_1\), and p satisfies (1.5) in \(B_1\). Then, \(G(\eta ,x):[0,\infty )\times B_1\rightarrow (0,\infty )\).

Let \(0<{\hat{\beta }}<L\). It is not difficult to see from Remark 7.7 that G satisfies (H1)–(H4) in \(B_1\) with constants \( \gamma _0, C, \delta ,\) depending only on \({\hat{\beta }}, L, p_{\min }, p_{\max }, g_0,g_1\).

In addition, let us show that if \(\Vert \nabla p\Vert _{L^\infty (B_1)}\le {\bar{\varepsilon }}\) and \([g]_{C^{0,{\bar{\gamma }}}(B_1)}\le {\bar{\varepsilon }},\) then

$$\begin{aligned} {[}G(\eta ,\cdot )]_{C^{0,{{\bar{\gamma }}}}(B_1)} \le C{{\bar{\varepsilon }}}, \quad \text {for all } 0<\frac{{\hat{\beta }}}{2}\le \eta \le 4L, \end{aligned}$$

with C depending only on \({\hat{\beta }}, L, p_{\min }, p_{\max }, g_0,g_1\). In fact, let us call

$$\begin{aligned} F(t,x,\eta )=(t+\eta ^{p(x)})^{\frac{1}{p(x)}}, \end{aligned}$$

for \(x\in B_1\), \(g_0\le t\le g_1\) and \(0<\frac{{\hat{\beta }}}{2}\le \eta \le 4L\). Then we can write

$$\begin{aligned} G(\eta ,x)=F(g(x),x,\eta ). \end{aligned}$$

In fact, there holds that \(|\frac{\partial F}{\partial t}(t,x,\eta )|\le C_1,\) and \(|\frac{\partial F}{\partial x_i}(t,x,\eta )|\le C_2\Vert \nabla p\Vert _{L^\infty (B_1)},\) where \(C_1\) and \(C_2\) depend only on \({\hat{\beta }}, L, p_{\min }, p_{\max }, g_0,g_1.\) As a consequence

$$\begin{aligned} \begin{aligned} |G(\eta , x)-G(\eta ,{\bar{x}})|&\le C_1[g]_{C^{0,{\bar{\gamma }}}(B_1)}|x-{\bar{x}}|^{{{\bar{\gamma }}}}+C_2\Vert \nabla p\Vert _{L^\infty (B_1)}|x-{\bar{x}}|\\&\le C_3{\bar{\varepsilon }}|x-{\bar{x}}|^{{{\bar{\gamma }}}}, \end{aligned} \end{aligned}$$

where \(C_3\) depends only on \({\hat{\beta }}, L, p_{\min }, p_{\max }, g_0,g_1.\)

Remark 7.10

We will introduce another family of functions that satisfy assumptions (H1)–(H4). In fact, let ab and q be positive numbers, \(q\ge 1\).

We define \(G(\eta ,x):[0,\infty )\times \ {\mathbb {R}}^n\rightarrow (0,\infty )\),

$$\begin{aligned} G(\eta ,x)=G(\eta ,0)=G_0(\eta ), \end{aligned}$$
(7.24)

where

$$\begin{aligned} G_0(\eta )=a\eta ^q+b. \end{aligned}$$
(7.25)

Let \(0<{\hat{\beta }}<L\). Clearly (H1)–(H3) hold.

We want to show that (H4) holds for some \(\delta >0\). In fact, we will prove that

$$\begin{aligned} G_0(\eta )\ge \eta G_0'(\eta ) +\delta , \quad 0\le \eta \le 4L. \end{aligned}$$
(7.26)

Inequality (7.26) is equivalent to

$$\begin{aligned} a\eta ^q+b\ge aq\eta ^{q}+\delta , \quad 0\le \eta \le 4L. \end{aligned}$$
(7.27)

If \(q=1\), we take \(0<\delta <b\) and (H4) holds.

If \(q>1\) and the given L satisfies

$$\begin{aligned} L<\frac{1}{4}\left( \frac{b}{a(q-1)}\right) ^{1/q}, \end{aligned}$$

we see that (7.27) holds for a constant \(\delta >0\) small enough and therefore, (H4) holds.

Remark 7.11

We can define G satisfying (H1)–(H4), replacing the constants ab and q in (7.24) and (7.25) by suitable smooth functions defined in \(\Omega \), with arguments similar to the ones in Remark 7.9.

Remark 7.12

Let \(G_1\) and \(G_2\) be functions satisfying (H1)–(H4). Let \(a_1, a_2\in C^{0,{\bar{\gamma }}}(\Omega )\) be such that there exist constants \({\bar{c}},c\) with \(0<{\bar{c}}\le a_1,a_2\le c\) for every \(x\in \Omega \). Then,

$$\begin{aligned} G(\eta , x):=a_1(x)G_1(\eta ,x)+a_2(x)G_2(\eta ,x) \end{aligned}$$

satisfies (H1)–(H4) as well.