Regularity of the free boundary for the two-phase Bernoulli problem

We prove a regularity theorem for the free boundary of minimizers of the two-phase Bernoulli problem, completing the analysis started by Alt, Caffarelli and Friedman in the 80s. As a consequence, we also show regularity of minimizers of the multiphase spectral optimization problem for the principal eigenvalue of the Dirichlet Laplacian.


Introduction
We consider the two-phase functional J tp defined, for every open set D ⊂ R d and every function u : D → R, as where the constants λ + > 0 and λ − > 0 are given and fixed, and the two phases and Ω − u = {u < 0} are the positivity sets of the functions u + := max{u, 0} and u − := max{−u, 0}.
We say that a function u : D → R is a local minimizer of J tp in D if for all open sets Ω and functions v : D → R such that Ω ⊂ D and v = u on D \ Ω.
In this paper we aim to study the regularity of the free boundary ∂Ω + u ∪ ∂Ω − u ∩ D for local minimizers of J tp in D. Our main result is a full description of ∂Ω + u and ∂Ω − u around two-phase points: Γ tp := ∂Ω + u ∩ ∂Ω − u ∩ D. More precisely, we prove that, in a neighborhood of a two-phase point, the sets Ω + u and Ω − u are two C 1,η -regular domains touching along the closed set Γ tp . Theorem 1.1 (Regularity around two-phase points). Let u : D → R be a local minimizer of J tp in the open set D ⊂ R d . Then, for every two-phase point x 0 ∈ Γ tp ∩ D, there exists a radius r 0 > 0 (depending on x 0 ) such that ∂Ω ± u ∩B r 0 (x 0 ) are C 1,η graphs for some η > 0. Combining Theorem 1.1 with the known regularity theory for one-phase problem, one obtains the following result, which provides a full description of the free boundary of local minimizers of J tp .
with the following properties.
(i) The regular part Reg(∂Ω ± u ) is a relatively open subset of ∂Ω ± u ∩ D and is locally the graph of a C 1,η -regular function, for some η > 0. Moreover, the two-phase free boundary is regular, that is, The singular set Sing(∂Ω ± u ) is a closed subset of ∂Ω ± u ∩ D of Hausdorff dimension at most d − 5. Precisely, there is a critical dimension 1 d * ∈ [5,7] such that -if d < d * , then Sing(∂Ω ± u ) = ∅; As a second corollary of our analysis, by applying the same type of arguments as in [40] we obtain a complete regularity results for the following shape optimization problem, studied in [8,6,42], where the optimal sets have the same qualitative behavior as the sets Ω + u and Ω − u in Corollary 1.2, contrary to the classical optimal partition problem studied in [13,14,19,20,21] (which corresponds to the case of zero weights m i = 0, for every i). Corollary 1.3 (Regularity for a multiphase shape optimization problem). Let D be a C 1,γ -regular bounded open domain in R d , for some γ > 0 and d ≥ 2. Let n ≥ 2 and m i > 0, i = 1, . . . , n be given. Let (Ω 1 , . . . , Ω n ) be a solution of the following optimization problem: (SOP) where λ 1 (Ω i ) is the first eigenvalue for the Dirichlet Laplacian in Ω i . Then, the free boundary ∂Ω i of each of the sets Ω i , i = 1, . . . , n, can be decomposed as the disjoint union of a regular part Reg(∂Ω i ) and a (possibly empty) singular part Sing(∂Ω i ), where: (i) The regular part Reg(∂Ω i ) is a relatively open subset of ∂Ω i and is locally the graph of a C 1,η -regular function, for some η > 0. Moreover, both the contact set with the boundary of the box and the two-phase free boundaries are regular, that is, ∂Ω i ∩ ∂D ⊂ Reg(∂Ω i ) and ∂Ω i ∩ ∂Ω j ⊂ Reg(∂Ω i ) for every j ∈ {1, . . . , n} \ {i}. 1.1. Regularity of local minimizers of the Bernoulli functional. The study of the regularity of minimizers of J tp started in the seminal paper of Alt and Caffarelli [1], which 1 The critical dimension d * is the first dimension, for which there exists a one-homogeneous non-negative local minimizer of the one-phase functional with a singular free boundary. Currently, it is only known that 5 ≤ d * ≤ 7, [12,33,30].
was dedicated to the one-phase case, in which u is non-negative. In this case, it is sufficient to work with the one-phase functional J op (u, D) :=ˆD |∇u| 2 dx + λ 2 as the negative phase Ω − u is empty. In [1] it was proved that for a local minimizer u of J op , the free boundary ∂Ω + u ∩ D decomposes into a C 1,η -regular set Reg(∂Ω + u ) and a closed singular set Sing(∂Ω + u ) of zero H d−1 -Hausdorff measure. A precise estimate on the Hausdorff dimension of Sing(∂Ω + u ) was then given by Weiss in [43] as a consequence of his monotonicity formula and its rectifiability was established by Edelen-Engelstein in [31]. In fact, the results in Corollary 1.2 are an immediate consequence of Theorem 1.1 and the known regularity for the one-phase parts • the regularity of Reg(∂Ω ± u ) (Corollary 1.2 (i)) follows by Theorem 1.1 and [1, Theorem 8.1]; • the estimates on the dimension of the singular set Sing(∂Ω ± u ) (Corollary 1.2 (ii)) are again a consequence of Theorem 1.1 (which shows that singularities can appear only on the one-phase parts of the free boundary) and the results in [43,31].
The regularity of local minimizers with two-phases (that is, local minimizers of J tp which change sign) was first addressed by Alt, Caffarelli and Friedman in [2], where the authors consider free boundary functionals that weight also the zero level set of u: where λ + ≥ λ 0 ≥ 0 and λ − ≥ λ 0 ≥ 0. When D ⊂ R 2 is a planar domain, and under the additional assumptions λ + = λ − and λ 0 = λ + or λ − , they showed that the free boundaries ∂Ω + u ∩ D and ∂Ω − u ∩ D are C 1 -regular curves. The key observation here is that the condition forces the level set {u = 0} to have zero Lebesgue measure. Thus, the two boundaries ∂Ω + u ∩ D and ∂Ω − u ∩ D coincide and the solution u satisfies the transmission condition The free boundary regularity for local minimizers of J acf in the case (1.1) is already known in any dimension. Indeed, the regularity of the free boundary ∂Ω + u = ∂Ω − u , for functions which are harmonic (or solve an elliptic PDE) in Ω + u ∪ Ω − u and satisfy the transmission condition (1.2), is today well-understood, after the seminal work of Caffarelli [9,10,11] (see also the book [15]) and the more recent results of De Silva-Ferrari-Salsa [27,28,29], which are based on the techniques introduced by De Silva in [26] and which are central also in the present paper.
To the best of our knowledge, the only known regularity result for minimizers of (ACF) in the case when λ + > λ 0 and λ − > λ 0 , (1.3) is due to the second and third authors in [39], where it is proved that, in dimension d = 2, the free boundaries ∂Ω + u and ∂Ω − u are C 1,η regular. The proof relies on a novel epiperimetric type inequality which applies only in dimension two and it was recently extended (still in dimension two) to almost-minimizers by the same two authors and Trey in [40].
In this paper, we complete the analysis started by Alt, Caffarelli and Friedman in [2], by proving a regularity result for the free boundaries of the local minimizers of (ACF), in the case (1.3) and in any dimension d ≥ 2. Indeed, Theorem 1.1 and Corollary 1.2 apply directly to (ACF) as the local minimizers of (ACF), corresponding to the parameters λ 0 , λ + and λ − , are local minimizers of (TP) with parameters 1.2. One-phase, two-phase and branching points on the free boundary.
Let u : B 1 → R be a (local) minimizer of J tp in B 1 and let, as above, Ω ± u = {±u > 0}. Notice that, the zero level set {u = 0} might have positive Lebesgue measure in B 1 and also non-empty interior, contrary to what happens with the minimizers of (ACF) with λ + = λ 0 . This introduces a new element in the analysis of the free boundary, which can now switch from one-phase to two-phase at the so-called branching points, at which the zero level set looks like a cusp. Precisely, this means that the free boundary ∂Ω + u ∩ B 1 (the same holds for the negative phase ∂Ω − u ∩ B 1 ) can be decomposed into: op , then there is a ball B r (x 0 ) which does not contain points from the negative phase, B r (x 0 ) ∩ Ω − u = ∅. Thus, u is a minimizer of the one-phase functional J op in B r (x 0 ) and the regularity of ∂Ω + u ∩ B r (x 0 ) follows from the results in [1,43]. For what concerns the two-phase points, we can further divide them into interior and branching points: • we say that x 0 is an interior two-phase point, x 0 ∈ Γ int tp , if x 0 ∈ Γ tp and B r (x 0 ) ∩ {u = 0} = 0 for some r > 0 ; • conversely, we say that x 0 is a branching point, By definition, Γ int tp is an open subset of ∂Ω + u ∩ B 1 . In particular, u is a minimizer of the Alt-Caffarelli-Friedman functional (ACF) with λ + = λ 0 in a small ball B r (x 0 ) and the regularity of Γ int tp is a consequence of the results in [2,9,10,11,15,27,28,29]. In order to complete the study of the regularity of the free boundaries one has then to focus on the branching points. Note that by the previous discussion |∇u + | is a Hölder continuous function on Γ + op ∪ Γ int tp . By relying on the results of [26], to prove Theorem 1.1 one has to show that |∇u + | : ∂Ω + u ∩ B 1 → R is Hölder continuous across the branching points By following [39] and [40] this will be consequence of uniform "flatness" decay at the two-phase points x 0 ∈ Γ tp , which is the main result of our paper. 1.3. Flatness decay at the two-phase points. By the Weiss' monotonicity formula (see [43]), at every two-phase point x 0 ∈ Γ tp , the limits of blow-up sequences However, a priori the limiting profile might depend on the chosen sequence. As it is usual in this type of problems, uniqueness of the blow-up profile (and thus regularity of u) is a consequence of a uniform flatness (or excess) decay. Given u, its flatness in B r (x 0 ) with respect to H = H α,e is defined as In particular, we can assume that the flatness becomes small at a uniform scale in a neighborhood of any x 0 ∈ Γ tp . Precisely, for every ε > 0 and x 0 ∈ Γ tp , there is r > 0 and a neighborhood U of x 0 , such that Our aim is to prove that there is a universal threshold ε > 0 such that then it improves in the ball Br /2 (x 0 ), which means that there exists another two-plane solution H = Hα ,ẽ such that for some small, but universal, γ > 0. In order to prove (1.4), we argue by contradiction. That is, there is a sequence of minimizers u k and a sequence of two-plane solutions H k , such that where the infimum is taken over all H of the form (TpS). Now, the two key points of the argument are to show that the sequence v k := u k − H k ε k is (pre-)compact in a suitable topology and that any limit point v ∞ is a solution of a suitable "linearized" problem (that turns out to be a non-linear one); then the regularity theory for the limiting problem allows to obtain the desired contradiction. Let us briefly analyze these two main steps of the proof. The "linearized" problem. The nature of the limiting problem depends on the type of free boundary point one is considering. At branching points (the ones that we are most interested in), v ∞ turns out be the the solution of a two-membrane problem, (3.10). At interior two-phase points Γ int tp , we instead recover a transmission problem as in [27]. Note that in the first case, the "linearized" problem is actually non-linear. Similar phenomena have been already observed in a number of related situation: in this same context, a derivation of the limiting problem was done in [4], while for Bernoulli type problems a similar fact appears in studying regularity close to the boundary of the container, [18]. See also [32,38] for similar issues in studying the singular set of obstacle type problems. Heuristically linearizing to an "obstacle" type problem is due to the fact that there is a natural "ordering" between the negative and the positive phases of any possible competitor. Note instead if one linearizes the plain one phase problem, the natural linearized problem is the Neumann one, this was observed in [3] (in the parabolic case) and fully exploited in [26], see also [16,17] where other non-local type problems appear as linearization.
Compactness of the linearizing sequence v k . We follow the approach introduced by De Silva in [26], which is based on a partial Harnack type inequality, introduced in different context by Savin in [36,37]. This is a weaker form of the flatness decay estimate (1.4) that does not take into account the scaling of the functional (which means that it cannot be used to obtain the regularity of the free boundary in a direct way). The rough idea is that if u − H L ∞ (Br(x 0 )) falls below a certain (universal) threshold, then u is closer to H in the ball Br /2 (x 0 ), precisely: for some δ > 0. This estimate implies the compactness of the sequence v k by a classical (Ascoli-Arzelà type) argument. For local minimizers of the one-phase functional (OP) or the two-phase functional (ACF) with coefficients satisfying the condition (1.1), the functions H can be chosen in the respective class of blow-up limits. In fact, for the one-phase problem, it is sufficient to take H to be the (possibly translated and rotated) one-homogeneous global one-phase solution H(x) = λ + x + d (as in [26]); for the two-phase problem in the case (1.1), it is sufficient to take H in the class of two-plane solutions (TpS), precisely as in [27]. However, in our case, it turns out that the class of two-plane solutions is not large enough. The reason is that there exist solutions which are arbitrarily close to a two-plane solution of the form H λ + ,e d but which are not a smooth perturbation of it. For instance the function, is max{ε 1 , ε 2 }-close to the two-plane solution H λ + ,e d , but (1.5) fails for it. This is not just a technical difficulty. In fact, in order to get the compactness of the linearizing sequence, the partial improvement of flatness (1.5) is not needed just at one two-phase point x 0 , but in all the points in a neighborhood of x 0 . Now, since at a branching point, the behavior of the free boundary switches from two-phase (which roughly speaking corresponds to the case when the two free boundaries ∂Ω + u and ∂Ω − u coincide) to one-phase (in which the two free boundaries ∂Ω + u and ∂Ω − u are close to each other but separate, as on Figure 1 below), the class of reference functions H has to contain both the two-plane solutions (TpS) and the solutions of the form (1.6).

REGULARITY OF THE TWO-PHASE FREE BOUNDARIES 6
that one ends up with an "obstacle" type problem is due to the fact that there is a natural "ordering" between the negative and the positive phases of any possible competitor.
Compactness of the linearizing sequence v k . We follow the approach introduced by De Silva in [26], which is based on a partial Harnack type inequality, introduced in di↵erent context by Savin in [36,37]. This is a weaker form of the flatness decay estimate (1.4) that does not take into account the scaling of the functional (which means that it cannot be used to obtain the regularity of the free boundary in a direct way). The rough idea is that if ku Hk L 1 (Br(x 0 )) falls below a certain (universal) threshold, then u is closer to H in the ball Br /2 (x 0 ), precisely: ku for some > 0. This estimate implies the compactness of the sequence v k by a classical (Ascoli-Arzelà type) argument. For local minimizers of the one-phase functional (OP) or the two-phase functional (ACF) with coe cients satisfying the condition (1.1), the functions H can be chosen in the respective class of blow-up limits. In fact, for the one-phase problem, it is su cient to take H to be the (possibly translated and rotated) one-homogeneous global one-phase solution H(x) = + x + d (as in [26]); for the two-phase problem in the case (1.1), it is sucient to take H in the class of two-plane solutions (TpS), precisely as in [27]. However, in our case, it turns out that the class of two-plane solutions is not large enough. The reason is that there exist solutions which are arbitrarily close to a two-plane solution of the form H + ,e d but which are not a smooth perturbation of it. For instance the function, is max{" 1 , " 2 }-close to the two-plane solution H + ,e d , but (1.5) fails for it. This is not just a technical di culty. In fact, in order to get the compactness of the linearizing sequence, the partial improvement of flatness (1.5) is not needed just at one two-phase point x 0 , but in all the points in a neighborhood of x 0 . Now, since at a branching point, the behavior of the free boundary switches from two-phase (which roughly speaking corresponds to the case when the two free boundaries @⌦ + u and @⌦ u coincide) to one-phase (in which the two free boundaries @⌦ + u and @⌦ u are close to each other but separate, as on Figure 1 below), the class of reference functions H has to contain both the two-plane solutions (TpS) and the solutions of the form (1.6). Structure of the paper. This paper is organized as follows: in Section 2 we recall some basic properties of minimizers and we fix the notation; in Section 3 we establish the excess decay lemma; in Section 4 we prove our main results; in Appendices A and B we collect the proofs of some technical facts. Structure of the paper. This paper is organized as follows: in Section 2 we recall some basic properties of minimizers and we fix the notation; in Section 3 we establish the excess decay lemma; in Section 4 we prove our main results; in Appendices A and B we collect the proofs of some technical facts.
At the final stage of the preparation of this work, the authors have been informed that two other groups are working on similar problems, namely in [4] the authors aim to establish a result analogous to the ours via variational techniques, while in [24] the goal is to prove the same result for almost minimizers in the spirit of [25,22,23].

Basic properties of minimizers
In this section we recall (mostly without proof) some basic properties of local minimizers of J tp . In particular, in Section 2.1 we recall Lipschitz-regularity and non-degeneracy property of u; Section 2.2 is dedicated to the study of blow-up limits of u at two-phase points and in Section 2.3 we show that u satisfies an optimality condition in viscosity sense.
2.1. Regularity of minimizers. Let u be a local minimizer of J tp . Then, it is wellknown that u is locally Lipschitz continuous and non-degenerate.
Throughout this paper, we will assume that the weights in (TP) are ordered as follows: Notice that this is not restrictive as one can always replace u by −u in J tp .
Proposition 2.1 (Lipschitz regularity and non-degeneracy of local minimizers). Let D ⊂ R d be an open set, λ + ≥ λ − > 0, and u be a local minimizer of J tp . Then the following properties hold: Proof. The second claim was first proved in [2, Theorem 3.1] and depends only on the fact that each of the two phases Ω + u and Ω − u is optimal with respect to one-sided inwards perturbations (see for instance [8] and [41,Section 4]). The Lipschitz continuity of u is more involved and requires the use of the Alt-Caffarelli-Friedman monotonicity formula and the non-degeneracy of u + and u − . It was first proved in [2,Theorem 5.3], see also the recent paper [23] for quasi-minimizers.

2.2.
Blow-up sequences and blow-up limits. Let u be a local minimizer of J tp in the open set D ⊂ R d . For every x 0 ∈ ∂Ω u ∩ D and every0 < r < dist(x 0 , ∂D), we consider the function which is well-defined for |x| < 1 r dist(x 0 , ∂D) and vanishes at the origin. Give a sequence r k > 0 such that r k → 0, we say that the sequence of functions u x 0 ,r k is a blow-up sequence. Note that, for every R > 0, and k 1, the functions u x 0 ,r k are defined on the ball B R , vanish at zero and are uniformly Lipschitz in B R . Hence, there is a Lipschitz continuous function v : R d → R and a (no relabeled) subsequence of u x 0 ,r k such that u x 0 ,r k converges to v uniformly on every ball B R ⊂ R d . We say that v is a blow-up limit of u at x 0 . Notice that v might depend not only on x 0 and u but also on the (sub-)sequence r k . We will denote by BU(x 0 ) the collection of all possible blow-up limits of u at x 0 .
The following lemma classifies all the possible elements of BU(x 0 ) when x 0 ∈ Γ tp .The result is well-known and we only sketch the proof for the sake of completeness.
Lemma 2.2 (Classification of the blow-up limits). Let u be a local minimizer of J tp in the open set D ⊂ R d , and let v be a blow-up limit of u at the two-phase point where e ∈ S d−1 , and α, β are such that Proof. Let v be a blow-up limit of u at x 0 and let u x 0 ,r k be a blow-up sequence converging to v (locally uniformly in R d ). First, notice that the non-degeneracy of u, Proposition 2.1 (ii), implies that v is non trivial and changes sign: v On the other hand, by the Weiss monotonicity formula, [43], v is one-homogeneous, in polar coordinates: v(ρ, θ) = ρV (θ) In particular V is an eigenfunction of the spherical Laplacian ∆ S on the spherical sets Using the (2.2) and integrating by parts, we get that This means that V + − cV − is an eigenfunction of the spherical Laplacian on S d−1 , corresponding to the eigenvalue (d − 1). Since the (d − 1)-eigenspace contains only linear functions one easily deduce that v is of the form (TpS).
Conditions (2.2) can be obtained by a smooth variation of the free boundary {v = 0}. Indeed, if considering competitors of the form v t (x) = v(x + tξ(x)) for smooth compactly vector fields ξ, and taking the derivative of J tp (v t , B 1 ) at t → 0, we get that which by the arbitrariness of ξ is precisely the first part of (2.2). The second part of (2.2) is analogous and follows by considering competitors of the for vector fields with ξ · e ≤ 0 so that it moves negative phase only inwards, that is, Taking the derivative of the energy at t > 0, we get which gives β ≥ λ − . The estimate on α is analogous.
We record the following consequence of Lemma 2.2 which says that the "flatness" can be chosen uniformly small in a neighborhood of a two-phase point. Corollary 2.3. Let u be a local minimizer of J tp in the open set D ⊂ R d , and let x 0 be a two-phase point x 0 ∈ Γ tp . Then, for every ε > 0 there are r > 0 and ρ > 0, and a function H α,e of the form (TpS) such that: Proof. By Lemma 2.2, there exists r > 0 and H such that On the other hand, by the Lipschitz continuity of u Choosing ρ small enough (such that Lρ r ≤ ε /2), we get the claim.

2.3.
Optimality conditions at the free boundary. Let u : D → R be a local minimizer of J tp . In this section, we will show that u satisfies the following optimality conditions at two-phase free boundary points: We notice that if u was differentiable at x 0 ∈ Γ tp , that is, (i) We say that a function Q : D → R touches a function w : D → R from below (resp. from above) at a point for every x in a neighborhood of x 0 . We will say that Q touches w strictly from below (resp. above), if the above inequalities are strict for The optimality conditions on u are given in the next lemma. Before we give the precise statement, we recall that Lemma 2.5 (The local minimizers are viscosity solutions). Let u be a local minimizer of J tp in the open set D ⊂ R d . Then, u in harmonic in Ω + u ∪ Ω − u and satisfies the following optimality conditions on the free boundary ∂Ω u ∩ D.
(A) Suppose that Q is a comparison function that touches u from below at x 0 . being trivially true. Suppose now that x 0 ∈ Γ tp and that Q touches u from below at x 0 . Let u x 0 ,r k and Q x 0 ,r k be blow-up sequences of u and Q at x 0 . Then, up to extracting a subsequence, we can assume that u x 0 ,r k converges uniformly to a blow-up limit On the other hand, since Q + and Q − are differentiable at x 0 (respectively in Ω . Now since, H Q touches H u from below (and since α = 0 and β = 0), we have that e = e and Combined with (2.2), this gives (A.3). The proof of (B.3) is analogous.
In particular, if u : D → R is a continuous function such that the claims (A) and (B) hold for every comparison function Q, then we say that u satisfies the following overdetermined condition on the free boundary in viscosity sense: Thus, Lemma 2.5 can be restated as follows: If u is a local minimizer of J tp in D, then it satisfies (2.5) in viscosity sense. We conclude this section by recording the following straightforward consequence of definition of viscosity solution, where we consider what happens when a function is touching only one of the two phases (note that in the second item we are restricting the touching points only to the one-phase free boundaries) Lemma 2.6. Let u : D → R be a continuous function which satisfies (2.5).
(i) Assume that Q is a comparison function touching u + from above at (ii) Assume that Q is a comparison function touching u + from below at Proof. The claim (i) simply follows by, for instance, noticing that the assumption implies that Q ≥ u + ≥ 0 so that Q touching u from above and thus one can apply B.1 and the first part of B.3 in the definition of viscosity solution and that a symmetric argument holds for u − . Concerning claim (ii), we note that since x 0 ∈ Γ + op , u ≥ 0 in a neighborhood of x 0 . In particular, the function Q + is touching u from below at x 0 and thus the conclusion follows by (B.2) in the definition of viscosity solution.

Flatness decay
In this section we prove that, at two-phase points, the flatness decays from one scale to the next. Our main result is the following theorem, which applies to any viscosity solution of the two-phase problem.

2)
and The proof of Theorem 3.1 follows easily combining the two upcoming lemmas. In the first one we deal with the situation where the two-plane solution is, roughly, H λ + . Note that this is the situation where one might expect the presence of branching points and it is indeed in this setting that we will obtain the two membrane problem as "linearization". In the second lemma, we deal with the case when the closest half-plane solution has a gradient much larger than λ + . We will later show that in this case the origin is an interior two-phase point.
there exist e ∈ S d−1 andα ≥ λ + , for which In order to prove Lemma 3.2 and Lemma 3.3, we will argue by contradiction. Hence in the following we consider a sequence u k of minimizers such that We also set which we can assume to exists up to extracting a subsequence. It might be useful to keep in mind that = ∞ will correspond to Lemma 3.3 while 0 ≤ ≤ M < ∞ to Lemma 3.2.
In order to prove Lemma 3.3 and Lemma 3.2, we will first show that the sequence is compact in some suitable sense; we give the precise statement in Lemma 3.4 below and we postpone the proof to Section 3.1. We then establish in Lemma 3.5 the limiting problem solved by its limit v. Note that this problem depends on the value of which is distinguishing whether we are or not at branching points. Finally, in Section 3.3 we show how to deduce Lemma 3.3 and Lemma 3.2 from Lemma 3.4 and Lemma 3.5. For the remainder of the paper we will denote with and such that the sequences of closed graphs converge, up to a (non-relabeled) subsequence, in the Hausdorff distance to the closed graphs Γ ± = (x, v ± (x)) : x ∈ B ± 1 /2 . In particular, the following claims hold.
(ii) For every sequence In particular, {x d = 0} ∩ B1 /2 decomposes into a open jump set and its complementary contact set In particular for all x ∈ J , there exists two sequences x ± k ∈ Γ ± k,op such that x ± k → x. In the next lemma we determine the limiting problem solved by the function v defined as where v + and v − are as in Lemma 3.4.
Lemma 3.5 (The "linearized" problem). Let u k , ε k and α k be as in (3.4), v k be defined by (3.6) and as in (3.5). Let also v ± be as in Lemma 3.4: = ∞ : Then J = ∅ and v ± are viscosity solutions of the transmission problem: where α ∞ = lim k α k and β ∞ = lim k β k , which we can assume to exist up to extracting a further subsequence.
0 ≤ < ∞ : Then v is a viscosity solution of the two membrane problem: . (3.10) Remark 3.6. Here by viscosity solution of (3.9) and (3.10) we mean a function v as in (3.8) such that v ± are continuous in B ± 1 /2 , ∆v ± = 0 in B ± 1 /2 and such that the following holds.
-If we are in case (3.9), let p, q ∈ R and letP be a smooth function such that ∂ dP = 0. Suppose thatP is subharmonic (superharmonic) and that the function -If we are in case (3.10) then (1) if P ± is a smooth superharmonic function in B ± 1 /2 touching v ± strictly from above at x 0 ∈ B1 /2 ∩ {x d = 0}, then λ 2 ± ∂ d P ± ≥ 0; (2) if P ± is a smooth subharmonic function in B ± 1 /2 touching v ± strictly from below at x 0 ∈ J , then λ 2 ± ∂ d P ± ≤ 0; (3) if p, q ∈ R andP is a smooth subharmonic (superharmonic) function such that ∂ dP = 0 and such that the function

Compactness of the linearizing sequence. Proof of Lemma 3.4.
The key point in establishing a suitable compactness for v k is a "partial Harnack" inequality, in the spirit of [26,27]. As explained in the introduction, in dealing with branching points one needs to work separately on the positive and negative part. An additional difficulties arise also at pure two-phase points since we want also to deal with the case λ − = λ + . Let us briefly explain the ideas of the proof. If u is close in B 1 to a global solution of the form H α,e d with α > λ + , then we expect that in a small neighborhood B ρ of the origin the level set {u = 0} has zero Lebesgue measure and that all the free boundary points in B ρ are "interior" two-phase points (indeed, at the end, this will be a consequence of the C 1 regularity of u and of the free boundary). In this case one expects to be able to do the same argument as in [27]. This is true except for the following caveat, if one wants to deal with the case λ − = λ + then the sliding arguments used in [26,27] (see also [9,10]) does not yield the desired contradiction since the positive term might actually be zero. For this reason one has first to "increase" the slope of the trapping solution, so that the sliding argument would give the desired contradiction. Namely if u is trapped between two translation of a two-plane solution: in say B 1 and at the point P = (0, . . . , 0, 1 /2) u is closer to H α,e d (· + a) then to H α,e d (· + b), we can increase in a quantitative way the slope of the positive part of the lower two-plane solution in half ball, i.e.
see Lemma 3.7. The sliding argument of [26,27] then allows to translate this to a a (quantitative) increase of b, yielding the partial decay of flatness of the free boundary. This is the situation studied in Lemma 3.9. If instead u is close to H λ + ,e d then the free boundary can behave in several different ways. Indeed, in this case the origin can be either an interior two-phase point, a branching two-phase point but it might also happen that Since as explained in the introduction we have to deal with all the of the above situations we have to prove a decay in this situation is to improve separately the positive and the negative parts of u. More precisely if in B 1 for suitable a ± , b ± , one wants to find new constantsā ± ,b ± ∈ with and for which, in half the ball, Here one has to distinguishes the case in which, say, the lower function is looks like a two plane solution, i.e b + − b − 1, or not and to perform different comparisons according to the situation. This dealt in Lemma 3.8.
We start with the following simple lemma which allows to "increase" the slop of the comparison functions.
We now let w be the solution of the following problem By the Hopf Boundary Lemma, for a suitable constant τ = τ (d). Since, by the comparison principle, u ≤ w, this concludes the proof.
We next prove the two partial Harnack inequalities: We distinguish two cases: The proof of the partial Harnack inequality is based on comparison with suitable test functions. In order to build these "barriers", we will often use the following function ϕ. Let Q = (0, . . . , 0, 1 /5) and we let ϕ : B 1 → R be defined by: where the dimensional constant κ d is chosen in such a way that ϕ is continuous. It is immediate to check that ϕ has the following properties: Lemma 3.8 (Partial Boundary Harnack I). Given λ + ≥ λ − > 0 there exist constants ε =ε(d, λ ± ) > 0 andc =c(d, λ ± ) ∈ (0, 1) such that, for every function u : B 4 → R satisfying (a), (c) and (d) in Theorem 3.1, the following property holds true.
Let a ± , b ± ∈ − 1 /100, 1 /100 be such that Then, one can find new constantsā ± ,b ± ∈ − 1 /100, 1 /100 , with Proof. Let us show how to improve the positive part. More precisely we show how given a + , a − , b + , b − as in the statement we can findā + andb + . The proof forb − and bara − works in the same way and is left to the reader. We let P = (0, . . . , 0, 2) and we distinguish two cases: • Case 1. Improvement from above. Assume that, at the point P , u + is closer to λ + (2 + b + ) + than to the upper barrier λ + (2 + a + ) + . Precisely that In this case, we will show that u is below λ + (x +ā + ) + in a smaller ball centered at the origin forā + strictly smaller than a + . We start by setting ε := a + − b + ≤ε.
for a suitable dimensional constantc. Settinḡ and recalling that ε = (b + − a + ) allows to conclude the proof in this case.
• Case 2. Improvement from below. We now assume that, at the point P , u + is closer to λ + (2 + a + ) + than to λ + (2 + b + ) + . Hence, we have and we set again ε := a + − b + ≤ε. Arguing as in Case 1, by Lemma 3.7, there exists a dimensional constant τ such that We need now to distinguish two further sub-cases: τ is a small universal constant which we will choose at the end of the proof. In this case, for x ∈ B 1 , for a suitable universal constant c 1 . We now take ϕ as in (3.11) and we set, for t ∈ [0, 1], for a suitably small universal constant 0 < c 2 τ , chosen so that for all x ∈ B1 /100 (Q): This together with (3.15) implies that Furthermore u ≥ f 0 in B 1 thanks to (3.16).
As in Case 1 we lett the biggest t such that f t ≤ u in B 1 andx the first contact point, so that , as in Case 1,x is a free boundary point. Moreover, since ft changes sign in a neighborhood ofx: In the first case, by definition of viscosity solution and (ϕ.3), In the second case we have a contradiction as well, provided η τ , since (recall also that λ + ≥ λ−, (2.1)): τ and ε 1 (only depending on d and λ + ). Hence,t = 1, u ≥ f 1 which implies the desired conclusion by settinḡ a + = a + ,b + = b + +c 2 ε and by recalling that ε = (a + − b + ).
• Case 2.2: Assume instead that: where η = η(d) has been chosen according to Case 2.1. In this case we consider the family of functions f t (x) = λ + (1 + τ ε/2) Being ϕ ≤ 1, this is well defined since b + ≥ b − + η. Moreover u ≥ f 0 and, thanks, to (3.15) and by possibly choosing η smaller depending only on the dimension, We consider again the first touching timet and the first touching pointx. Note that this can not happen where u = 0. Moreover, by the very definition of ft,x ∈ ∂Ω + u \ ∂Ω − u . However, again by arguing as in Case 2.1, this is in contradiction with u being a viscosity solution. We now conclude as in the previous cases.
Since either the assumption of Case 1 or the one of Case 2 is always satisfied, this concludes the proof.
The next lemma deals with the case in which the origin is not a branching point.
then there are constantsā,b ∈ − 1 /100, 1 /100 with Proof. We consider the point P = (0, . . . , 0, 2) and we distinguish the two cases (note that one of the two is always satisfied): Since the argument in both cases is completely symmetric we only consider the second one. If we set ε = (a − b), by Lemma 3.7 and by arguing as in Lemma 3.8 we deduce the existence of a dimensional constant τ such that We let ϕ as in (3.11) and we set where c is a dimensional constant chosen such that where, again, Q = (0, . . . , 0, 1 /5). As in Lemma 3.8 we lett andx be the first contact time and the first contact point and we aim to show thatt = 1. For, we note that, by the same arguments as in Lemma 3.8, necessarilyx ∈ {u = 0}. We claim that impossible since ft is negative in a neighborhood ofx. By definition of viscosity solution this would imply where the implicit constants in O(ε) depends on λ ± , L and d and we exploited that, since This however implies: . where we have used (ϕ.3), the equality This is a contradiction providedε is chosen small enough. Hencet = 1 and , as in Lemma 3.8, this concludes the proof.
With Lemmas 3.8 and 3.9 at hand we can use the same arguments as in [26,27] to prove Lemma 3.4.
Proof of Lemma 3.4. We distinguish two cases: 0 ≤ < +∞ : By triangular inequality we have for k sufficiently large. In particular we can repeatedly apply Lemma 3.8 as in [26], see also [41,Lemma 7.14 and Lemma 7.15] for a detailed proof, to deduce that if we define the sequence (w k ) k by then the setsΓ ± k := (x, w ±,k (x)) : x ∈ Ω ± u k ∩ B1 /2 , converge, up to a not relabeled subsequence, in the Hausdorff distance to the closed graphs where w ∈ C 0,α for a suitable α. Since the original sequence v k satisfies that their graphs, converges to the graph of a limiting function v as we wanted, this in particular proves (i), (ii) and (iii).
and by noticing that −t + k ≤ −t − k . Finally to show the last claim it is enough to note that if = ∞ : In this case the conclusion follows exactly as in [27] by using Lemma 3.9 and noticing that its assumptions are satisfied since = ∞.

3.2.
The linearized problem: proof of Lemma 3.5. The following technical lemma is instrumental to the proof of Lemma 3.5. We defer its proof to Appendix A below. Lemma 3.10. Let u k , ε k and α k be as in the statement of Lemma 3.4, v k be defined by (3.6) and v ± be as in Lemma 3.4. Then: (1) Let P + a strictly subharmonic (superharmonic) function on B + 1 /2 touching v + strictly from below (above) at a point x 0 ∈ {x d = 0} ∩ B1 /2 . Then, there exists a sequence of points ∂Ω + u k x k → x 0 and a sequence of comparison functions Q k such that Q k touches from below (above) u + k at x k , and such that (2) Let P − be a strictly subharmonic (superharmonic) function on B − 1 /2 and touching v − strictly from below (above) at a point x 0 ∈ {x d = 0} ∩ B1 /2 . Then, there exists a sequence of points ∂Ω − u k x k → x 0 and a sequence of comparison functions Q k such that Q k touches from below (above) −u − k at x k , and such that (3) Let p, q ∈ R andP be a function on B1 /2 such that ∂ dP = 0. Suppose thatP is subharmonic (superharmonic) and that the function touches v strictly from below (above) at a point x 0 ∈ C. Then, there exists a sequence of points x k → x 0 and a sequence of comparison functions Q k such that Q k touches from below (above) the function u k at x k ∈ ∂Ω u k , and such that (3.21) In particular, if p > 0 and Q k touches u k from below then x k / ∈ ∂Ω − u k \ ∂Ω + u k , while if q < 0 and Q k touches u k from above then Proof of Lemma 3.5. We note that v ± k converge uniformly to v ± on every compact subset of {±x d > 0} ∩ B1 /2 . Since these functions are harmonic there, by elliptic estimates the convergence is smooth and in particular v ± are harmonic on the (open) half balls B ± 1 /2 . Hence we only have to check the boundary conditions on {x d = 0}. We distinguish two cases.
= ∞. In this case we first want to show that J = ∅. Assume not, since the set Next let P be the polynomial , for some constants A, B. We first choose A 1 large enough so that and then we choose B A so that 0)).
Now we can translate P first down and then up to find that there exists C such that P + C is touching v + from below at a point x 0 ∈ B ε ((y , 0)) ∩ {x d ≥ 0}. Since ∆P > 0, the touching point can not be in the interior of the (half) ball and thus x 0 ∈ B ε (y ) ⊂ J . By using Lemma 3.10, there exists a sequence of points ∂Ω + u k x k → x 0 and of functions Q k touching u + k from below at x k and such that ∇Q + k (x k ) = α k e d + α k ε k ∇P (x 0 ) + o(ε k ). Since x 0 ∈ J , by (3.7) in Lemma 3.10, x k ∈ ∂Ω + u k \ ∂Ω − u k . Hence, by (ii) in Lemma 2.6 This contradiction proves that J = ∅. We next prove the transmission condition in (3.9). Let us show that , the opposite inequality can then be proved by the very same argument. Suppose that there exist p and q with α 2 ∞ p > β 2 ∞ q and a strictly sub-harmonic functionP with ∂ dP = 0 such that P = px + d − qx − d +P touches v strictly from below at a point x 0 ∈ {x d = 0} ∩ B1 /2 (note that the last set coincide with C by the previous step). By Lemma 3.10 there exists a sequence of points ∂Ω u k x k → x 0 and a sequence of comparison functions Q k touching u k from below at x k and satisfying (3.21). In particular x k / ∈ ∂Ω − u k \ ∂Ω + u k . We claim that x k ∈ ∂Ω + u k ∩ ∂Ω − u k . Indeed, otherwise by (A.1) in Lemma 2.5, and, by arguing as above, this contradicts = +∞. Hence, by Lemma 2.5 (A.3) . Dividing by ε k and letting k → ∞, we obtain the desired contradiction.
. We focus on v − since the argument is symmetric. Let us assume that there exists q ∈ R with λ 2 − q < − and a strictly subharmonic functionP with ∂ dP = 0 such that function touches v − strictly from below at a point x 0 ∈ {x d = 0} ∩ B1 /2 . Let now x k and Q k be as in Lemma 3.10 (2). By the optimality conditions . Since < ∞, we have β k = λ − + O(ε k ) and so the above inequality leads to We now show that λ 2 ± ∂ d v ± = − on J and again we focus on v − . By the previous step it is enough to show that if there exists a strictly superharmonic polynomialP with ∂ dP = 0 such P = qx d +P touches v − strictly from above at a point x 0 ∈ J , then λ 2 − q ≤ − . Again, by Lemma 3.10, we find points x k → x 0 and functions Q k satisfying (3.20) and touching −u − k from below at x k . Since x 0 ∈ J , by (3.7) in Lemma 3.4, x k ∈ ∂Ω − u k \ ∂Ω + u k . Hence, by Lemma 2.5, , which by arguing as above implies that λ 2 − q ≤ − . It then remain to show the transmission condition in (3.10) at points in C. Again by symmetry of the arguments we will only show that Let us hence assume that there exist p and q with λ 2 + p > λ 2 − q and a strictly subharmonic polynomialP with ∂ dP = 0 such that touches v + and v − strictly from below at x 0 ∈ C. By Lemma 3.10, we find points x k → x 0 and functions Q k satisfying (3.21). In particular x k / ∈ ∂Ω − u k \ ∂Ω + u k . By the previous step we know that λ 2 − q ≥ − and thus λ 2 + p > − , since we are assuming λ 2 + p+ > λ 2 − q ≥ 0. We now distinguish two cases: 1) x k are one-phase points, namely x k ∈ ∂Ω + u k \ ∂Ω − u k . In this case , which implies that in contradiction with λ 2 + p > − . 2) x k are two-phase points, namely x k ∈ ∂Ω + u k ∩ ∂Ω − u k . Arguing as in Case 1, we have that, by Lemma 2.5, 3.3. Proof of Lemmas 3.2 and 3.3. We recall the following regularity results for the limiting problems.
Lemma 3.11 (Regularity for the transmission problem). There exists a universal constant The proof of this fact can be found in [27,Theorem 3.2]. A similar result holds for the linearized problem (3.10).
Lemma 3.12 (Regularity for the two-membrane problem). There exists a universal con- The proof of the above lemma reduces easily to the one of the thin obstacle problem, since we were not able to find the statement of this fact in the literature, we sketch its proof in Appendix B.
It is by now well known that the regularity theory fo the limiting problems and a classical compactness argument prove Lemmas 3.2 and 3.3. We sketch their arguments here: Proof of Lemma 3.2. We argue by contradiction and we assume that for fixed γ ∈ (0, 1/2) and M we can find a sequences of functions u k and numbers α k such that but for which (3.2) and (3.3) for any choice of ρ and C. Note that by the second assumption above < M λ + We let (v k ) k be the sequence of functions defined in (3.6) and we assume that they converge to a function v as in Lemma 3.4, note that v L ∞ (B1 /2 ) ≤ 1. By Lemma 3.5, v solves (3.10) and thus by Lemma 3.12 there exists v ∈ R d−1 , p, q ∈ R satisfying λ 2 + p = λ 2 − q ≥ − such that for all r ∈ (0, 1/4) Moreover there exists η > 0 such that for every open set D D there is a constant C(D , λ ± , d) > 0 such that, for every x 0 , y 0 ∈ Γ tp ∩ D , we have where H e(x 0 ),α(x 0 ) and H e(x 0 ),α(x 0 ) are the blow-ups at x 0 and y 0 respectively. In particular, Γ tp ∩ D is locally a closed subset of the graph of a C 1,η function.
Proof. We first notice that by Corollary 2.3 and the definition of BU(x 0 ), given ε 0 > 0 as in Theorem 3.1 we can find r 0 > 0 and ρ 0 such that (3.1) is satisfied by u y 0 ,r 0 for some H α,e ∈ BU(x 0 ) and for all y 0 ∈ B ρ 0 (x 0 ). We can thus repeatedly apply Theorem 3.1 together with standard arguments to infer that for all y 0 ∈ B ρ 0 (x 0 ) there exists a unique H e(y 0 ),α(y 0 ) such that where γ ∈ (0, 1 /2). A covering argument implies the validity of the above estimate for all x 0 ∈ Γ tp ∩ D . Next, for x 0 , y 0 ∈ Γ tp ∩ D set r := |x 0 − y 0 | 1−η and η := γ /(1 + γ), and recall that u is L-Lipschitz (with constant depending on D ) to get The conclusion now follows easily from this inequality.
To conclude we only need to prove that α ∈ C 0,η (∂Ω + ). Since α is η Hölder continuous on Γ tp by Lemma 4.1 and constant on Γ + op , we just need to show that if x 0 ∈ Γ tp is such that there is a sequence x k ∈ Γ + op converging to x 0 , then α(x 0 ) = λ + . To this end, let y k ∈ Γ tp be such that dist(x k , Γ tp ) = |x k − y k | .
Let us set and note that u k is a viscosity solution of the free boundary problem Since u k are uniformly Lipschitz they converge to a function u ∞ which is also a viscosity solution of the same problem, [26]. On the other hand, by (4.3), we have that which gives that α(x 0 ) = λ + .
Proof of Theorem 1.1. Let x 0 ∈ Γ tp = ∂Ω + u ∩ ∂Ω − u and letε be the constant in [26,Theorem 1.1]. Thanks to the classification of blow-ups at points of Γ tp , we can choose r 0 > 0, depending on x 0 , such that so that thanks to Lemma 4.2, we can apply [26, Theorem 1.1] to conclude that locally at x 0 ∈ Γ tp the free boundaries ∂Ω ± u are C 1,η graphs. By the arbitrariness of x 0 this concludes the proof.
Proof of Corollary 1.2. The proof of the corollary is straightforward. Indeed by Theorem 1.1 there exits an open neighborhood W of the two-phase free boundary Γ tp such that ∂Ω ± u ∩ W ⊂ Reg(∂Ω ± u ). Outside W , u ± are (local) minimizers of the one-phase problem and thus the desired decomposition and the stated properties follows by the results in [1,31,43].

4.2.
Proof of Corollary 1.3. In this section we prove the regularity of the solutions to the shape optimization problem (SOP). The proof is a consequence of Theorem 1.1 and the analysis in [40]. Indeed, the existence of an optimal (open) partition (Ω 1 , . . . , Ω n ) was proved in [8] and (in dimension two) in [6]. Moreover, in [8] and [42], it has been shown that each of the eigenfunctions u i on Ω i is Lipschitz continuous as a function defined on R d (extended as zero outside Ω i ). Furthermore, there are no triple points inside the box D and no two-phase points on the boundary ∂D, that is, The regularity of ∂Ω i can then be obtained as follows.
• By [40,Lemma 7.3], the function u = u i − u j is a almost of (OP) with λ 2 + = m i and λ 2 − = m j , in the sense that J tp (u, B r ) ≤ J tp (v, B r ) + Cr d+2 for all v = u on ∂B r , provided r is sufficiently small. • By the classification of the blow up limits in [40,Proposition 4.3] and the arguments in Section 2.3, u is a viscosity solution of • C ∞ regularity of the one-phase part ∂Ω i \ ∂D ∪ i =j ∂Ω j follows by techniques in [1], see [7]; • C 1,η -regularity of ∂Ω i in a neighborhood of ∂Ω i ∩ ∂D was proved in [35]; the main argument boils down to the regularity result from [18]; • C 1,η -regularity of ∂Ω i in a neighborhood of ∂Ω i ∩ ∂Ω j follows by using the same arguments 3 in the proof of Theorem 1.1, using Theorem 4.3 in place of Theorem 3.1.
This allows to almost verbatim repeat the proofs in Section 3, see for instance [26,27].
•Step 3 : We now prove item (iii). The proof goes exactly as above, more precisely we let P be as in the statement and we define P ± as P restricted to B ± 1 /2 . We let also T ± : B ± 1 /2 be the corresponding transformations as in Step 1(with T − defined in the obvious way on B − 1 /2 ). The key point is to note that T + (B + 1 /2 ) ∩ T − (B − 1 /2 ) = ∅. Hence, with obvious notation, the function 4 Q = Q + + Q − is a well defined comparison function. Arguing as in Step 2 gives the desired sequence.
Appendix B. Proof of Lemma 3.12 Give a solution v we define w It is straightforward to check it is a viscosity solution of .
Furthermore one can easily check that where w N solves the Neumann problem , and w S is a solution of the thin obstacle problem .
From the last two estimates and the definition of w it is easy to deduce the conclusion of the Lemma. 4 Note that if Q − is the d-th component of the inverse of T − then it is negative!