On distance sets, box-counting and Ahlfors-regular sets

We obtain box-counting estimates for the pinned distance sets of (dense subsets of) planar discrete Ahlfors-regular sets of exponent $s>1$. As a corollary, we improve upon a recent result of Orponen, by showing that if $A$ is Ahlfors-regular of dimension $s>1$, then almost all pinned distance sets of $A$ have lower box-counting dimension $1$. We also show that if $A,B\subset\mathbb{R}^2$ have Hausdorff dimension $>1$ and $A$ is Ahlfors-regular, then the set of distances between $A$ and $B$ has modified lower box-counting dimension $1$, which taking $B=A$ improves Orponen's result in a different direction, by lowering packing dimension to modified lower box-counting dimension. The proofs involve ergodic-theoretic ideas, relying on the theory of CP-processes and projections.


Introduction and main results
In 1985, Falconer [4] (implicitly) conjectured that if A ⊂ R d , with d ≥ 2, is a Borel set of Hausdorff dimension at least d/2, then the set of distances dist(A, A) = {|x − y| : x, y ∈ A} has Hausdorff dimension 1. He also showed that the value d/2 would be sharp. The conjecture remains wide open in every dimension, but several deep advances have been obtained; we discuss in some detail what is known in the plane, and refer to [3] for some of the known results in higher dimensions. Throughout the paper, dim H , dim P , dim B , dim B , and dim MB denote, respectively Hausdorff, packing, has Hausdorff dimension 1. Although the method of Wolff does not appear to say anything about pinned distance sets, Peres and Schlag [20] employed the transversality method to prove that, under the stronger assumption dim H (A) > 3/2, for all x outside of a set of dimension at most 3 − dim H (A), the pinned distance set dist(x, A) has positive Lebesgue measure.
Very recently, Orponen [19] approached the problem from a different angle. Recall that a set A ⊂ R d is called (s,C)-Ahlfors regular, or s-Ahlfors regular with constant C, if there exists a measure µ supported on A, such that C −1 r s ≤ µ(B(x, r)) ≤ Cr s for all x ∈ Supp(µ) and all r ∈ (0, 1]. Orponen showed that if A ⊂ R 2 is (s,C)-Alhfors regular for some s ≥ 1 and any C > 1, then the packing dimension of dist(A, A) is 1. In fact, a small modification of his method shows that also the lower box-counting of dist(A, A) equals 1.
In this article, we improve upon Orponen's result in several directions: we obtain results on the existence of many large pinned distance sets, we weaken slightly the hypothesis of Ahlfors-regularity, we show that the modified lower box-counting dimension of the distance set is 1, and we are able to consider the set of distances between two different sets.
An inspection of the proof shows that we can take ε = (1 −t)/C for some effective C = C (s,C) > 0. The value of N 0 does not appear to be effective from the current proof. Theorem 1.1 fails rather dramatically for s = 1, as witnessed by the example described in [13,Eq. (2) and Figure 1]. Namely, given N 1, let This is a discrete 1-Ahlfors regular set at scale 2 −N , yet one can check that N(dist(x, A N ), 2 −N ) = O(2 N/2 ) for all x ∈ A N . In the proof of Theorem 1.1, the role of the assumption s > 1 is to ensure that the set of directions determined by pairs of points in A is dense "with high multiplicity", see §4.1 below. This obviously fails for each of the sets A N and, more generally, for many discrete 1-Ahlfors regular sets. We thank an anonymous referee for pointing out this "almost counter-example" to Theorem 1.1. We obtain several corollaries from Theorem 1.1 . Firstly, for sets of full Hausdorff dimension inside an Ahlfors-regular set, nearly all pinned distance sets have full lower box-counting dimension: Corollary 1.2. For every t ∈ (0, 1), s > 1, C > 0 there is ε = ε(s,C,t) > 0 such that the following holds. Let A be a bounded subset of a (s,C)-Ahlfors regular set in R 2 . Then In particular, this holds if A is itself (s,C)-Ahlfors regular.
In the above corollary, H s denotes s-dimensional Hausdorff measure. It is also easy to deduce a statement purely about box-counting dimensions: We underline that the Hausdorff dimension of sets satisfying the hypothesis of the above corollary may be arbitrarily small, or even zero.
Our second main result concerns the set of distances between two, possibly disjoint, sets A, B ⊂ R 2 . Although here we do not get a discretized result, we do get large modified lower box-counting dimension of the distance set (which we recall is smaller than both lower box dimension and packing dimension, and unlike the former is countably stable). Moreover, while for one of the sets we still need to assume Ahlfors-regularity, for the other we only require that the Hausdorff dimension strictly exceeds 1. In particular, if A is s-Ahlfors regular with s > 1, then its distance set has full modified lower box-counting dimension.
In fact, we are able to somewhat weaken the assumptions on A and B, see Theorem 5.1 below and the remark after the proof.
The proof of Theorem 1.4 also yields the following: Corollary 1.5. Let A, B ⊂ R 2 be two Borel sets such that dim H (A) > 1 and B is (s,C)-Ahlfors regular for some s > 1. Then In particular, this applies to A = B.
Compared with Corollary 1.2, we lower the size of the exceptional set (from zero measure to Hausdorff dimension 1), at the price of dealing with upper box-counting dimension instead of lower box-counting dimension.
For the proofs, we follow some of the ideas of Orponen [19], but there are substantial differences. A key step in his approach is a projection theorem for entropy in the Ahlfors regular case, see [19,Proposition 3.8], which is applied at all scales. It is unclear whether such a result continues to hold after removing even very small pieces of the initial regular set. Hence, in order to make the method robust under passing to large subsets (which is essential to the proof of Theorem 1.1), we needed a different device to handle the entropy of projections. This more flexible device is the theory of CP-processes and projections developed in [10], which we review in Section 2. Very roughly speaking, a CP-process is a measure-valued dynamical system which consists in zooming in dyadically towards a typical point of the measure. Thus, this paper is another example of an application of ergodic-theoretic ideas to problems that, a priori, have nothing to do with dynamics or ergodic theory.
As noted by Orponen already in [17], in the study of distance sets the spherical projections σ x (y) = (x − y)/|x − y| play a key role (the reason is that they arise when linearizing the distance function). An important fact in Orponen's approach is that spherical projections of sets of dimension at least 1 are dense. For the proof of Theorem 1.1 we require a discrete quantitative version of this (established in §4.1), while for Theorem 1.4 we rely instead on a recent result of Mattila and Orponen [16], see also [18].
The paper is organized as follows. In Section 2 we set up notation, recall different notions of dimensions, and review the parts of the theory of CP-processes that we will require. In Section 3 we discuss a notion of regularity weaker than Ahlfors-regularity. Theorem 1.1 and its corollaries are proved in Section 4, while Theorem 1.4 is proved in Section 5.

Notation
We use O(·) notation: A = O(B) means 0 ≤ A ≤ CB for some constant B; if C is allowed to depend on any parameters, this are denoted as subscripts; e.g. Given a metric space X, we denote the family of all Borel probability measures on X by P(X), and the family of all Radon measures on X by M(X). When X is compact, P(X) is endowed with the weak topology, which is metrizable. If f : X → Y and µ ∈ M(X), the push-down measure f µ is defined as f µ(A) = µ( f −1 A). We note this is sometimes denoted f # µ.
If µ ∈ M(X) and µ(A) > 0, then µ| A is the restriction of µ to A and, provided also µ(A) < ∞, we denote by µ A the restriction normalized to be a probability measure, that is We work in an ambient dimension d; this will always be 1 or 2 in this paper. We denote by D When d is clear from context, we simply write D k . If x ∈ R d , we denote the unique element of D (d) k containing x by D k (x). In addition to the Euclidean metric, on R d we consider the dyadic metric ρ defined as follows: ρ(x, y) = 2 − , where = max{k : D k (x) = D k (y)}.
Logarithms are always to base 2. We denote Shannon entropy of the probability measure µ with respect to the finite measurable partition F by H(µ, F), and the conditional entropy with respect to the finite measurable partition G by H(µ, F|G). That is, Here and below we follow the usual convention 0 · log(0) = 0. We denote by H k (µ) the normalized entropy H(µ, D k )/k, and note that if µ ∈ P([0, 1) d ), then 0 ≤ H k (µ) ≤ 1. The following are some standard properties of entropy that will get used in the sequel: 1. If |F| ≤ N, then H(µ, F) ≤ log N.
2. If F, G are finite partitions such that each element of F intersects at most N elements of G and vice versa, then |H(µ, F) − H(µ, G)| ≤ log N.

Notions of dimension
In this section we quickly review the notions of dimension of sets and measures we will require. For further background on dimensions of sets, see e.g. Falconer's textbook [5], while for dimensions of measures and their relationships, we refer to [6].
Recall that N(F, ε) is the number of ε-grid cubes that intersect a bounded set F ⊂ R d . The upper and lower box-counting dimensions of F are defined as These dimensions are not countably stable. After making them countably stable in the natural way, one gets modified lower box-counting dimension dim MB and packing dimension: always hold, while dim B and dim P are not comparable in general.
We move on to dimensions of measures. Let µ ∈ P(R d ). The lower and upper entropy dimensions are defined as We note that this is sometimes called the lower Hausdorff dimension. Finally, we recall that with strict inequalities possible, see [6, Theorem 1.3]. However, for measures of exact dimension s, there is an equality dim H (µ) = dim e (µ) = s.

Global sceneries, entropy and projections
In this section we recall some results from [9,19] (similar ideas go back to [10]). We write δ (ω) or δ ω to denote the point mass at ω (often ω will be a measure).
We denote the topological support of µ ∈ P([0, n , let T Q be the homothety that maps Q onto [0, 1) d , and define If x ∈ Supp ρ (µ), we also write µ x,n = µ D n (x) for short. That is, µ x,n is the normalized restriction of µ to D n (x), renormalized back to the unit cube.
The second equality in the last line follows from interchanging the order of sum and integration; it will be convenient to alternatively use either definition of µ [A,B] .
The following simple but important fact is proved in [9,Lemma 3.4]. It allows to recover the global entropy of a measure from local entropies.
In the above lemma, one should think that the value of q is fixed, and N tends to infinity (possibly along a subsequence).
The following is a variant of a result of Orponen [19], which in turn adapts ideas of Hochman [9].
The constants in the O notation are absolute.
, and adding up, and then averaging over j, we get On the other hand, by [19,Lemma 3.12], the almost linearity hypothesis on f ensures that i . (This was stated in [19] for i a multiple of q but the proof in general is identical.) Finally, as observed in [19,Remark 3.6], the linearity of Π v implies that Putting together (2.2), (2.3) and (2.4) yields the claim.
We will apply the above proposition to functions f of the form φ x (y) = 1 2 |x − y|. Let σ (x, y) = (x − y)/|x − y| ∈ S 1 ⊂ R 2 be the direction generated by x = y, and note that D f x (y) = σ (x, y). Hence, we have the following corollary of Proposition 2.2.

CP processes
Following [7], we consider CP processes on the tree ([0, 1) d , ρ) rather than on Euclidean cubes; the dyadic metric helps avoid technicalities with functions that would not be continuous on Euclidean space (due to dyadic hyperplanes) but are on the tree, notably entropy. We will denote the induced weak topology on P([0, 1) d ) by ρ, and the weak topology induced by this on P(P([0, 1) d )) by ρ. Slightly abusing notation, we will also denote by ρ the product topology ρ × ρ on P([0, 1) d ) × [0, 1) d , and by ρ the corresponding weak topology on P(P We note that all these topological spaces are compact and metrizable. To avoid any ambiguity, we will occasionally denote the topology under consideration with a subscript.
We let S :

Definition 2.4 (CP magnification operator). Let
We define the CP magnification operator M on Ξ by Note that M n (µ, x) = (µ x,n , S n x). We now define CP distributions (we refer to probability measures on "large" probability spaces such as Ξ as distributions). This definition goes back to [7]; see [10] and [12] for some variants and generalizations.
Note that adaptedness can be interpreted in the following way: in order to sample a pair (µ, x) from the distribution Q, we have to first sample a measure µ according to Q, and then sample a point x using the chosen distribution µ. From now on we will denote by Q both the CPD acting on Ξ and its measure component acting on P([0, 1) d ), since by adaptedness the latter determines the former.
An easy consequence of the Ergodic Theorem applied to CP distributions is that if P is a CPD which is ergodic under the action of M, then P-a.e. ν is exact dimensional, and has dimension dim P = H q (η) dP(η) for any q ∈ N (see e.g. [7, Equation (2.7)]). Let P = P µ dP(µ) be the ergodic decomposition of P (that is, each P µ is M-invariant and ergodic, and µ → P µ is a Borel mapping). By general properties of Markov processes, P µ is again a CPD for P-almost all µ, see e.g. [7, Remark before Proposition 5.2]. Hence, if P is a (non-necessarily ergodic) CPD, then P-a.e. ν is still exact-dimensional, but dim ν needs no longer be P-a.e. constant. Definition 2.6. If P is a CP distribution, we define its lower dimension dim * P as the P-essential infimum of dim ν.
We turn to the behavior of entropy under projections. For this, we recall some results from [10] on CP-processes and projections.
The following result is a consequence of [10,Theorem 8.2]. It will act as our projection theorem for entropy.
Theorem 2.7. Let P be a (not necessarily ergodic) CP-distribution. Write E q : . Then: exists for all v and E(v) is lower semicontinuous; 3. E(v) ≥ min(dim * P, 1) for almost all v; Proof. The first claim is immediate from (2.6). Let In the case P is ergodic, the latter claims are a particular case of [10,Theorem 8.2]. More precisely, in [10], the stated convergence is E q (v) → E(v), but by our observation, this immediately yields E q (v) → E(v). The general case follows by considering the ergodic decomposition of P (notice that an integral of lower semicontinuous functions is lower semicontinuous by Fatou's Lemma).

Global tangents
We want to be able to estimate the entropy of projections of a given measure µ ∈ P([0, 1) 2 ), but the tools we have at our disposal concern typical measures for a CP process. Following [8], we handle this by passing to suitable tangent objects.
Given µ ∈ P([0, 1) d ), the set of accumulation points of µ [0,N] in the ρ metric will be denoted T(µ). Unlike in [8], our tangent distributions are global, rather than local but, as the next lemma shows, they are still CP processes: for some subsequence (N j ). Then P is a CPD (in the sense that the adapted distribution with measure marginal P is a CPD).
In particular, if µ ∈ P([0, 1) d ), then any element of T(µ) is a CPD. [0,N j ] → P in the ρ topology. Since adaptedness is a closed property (it is tested on equalities of continuous functions), P is adapted.
Since we are using the dyadic metric and M is adapted, M is well defined and continuous at P-a.e. (µ, x) (notice that x ∈ Supp ρ (µ) for P-a.e. (µ, x) by adaptedness). Using standard properties of weak convergence (see e.g. [1, Theorem 2.7]) we conclude that

Ahlfors regularity and weak regularity
The following definition introduces a notion of regularity that, as we will see, extends the concept of Ahlfors-regularity in a suitable sense.
is said to be weakly s-regular if for every δ > 0 there is q ∈ N such that µ is s-rich at resolution (N, q, δ ) for all sufficiently large N (depending on q and δ ).
Note that if a measure is weakly s-regular then it is weakly t-regular for all t < s. In other words, weak s-regularity ensures a minimum level of local entropy at most places and scales, but allows for higher entropy as well.
A first useful feature of weak s-regularity is robustness under passing to subsets of positive measure: If µ is weakly s-regular and µ(A) > 0, then µ A is weakly s-regular.
Proof. This is essentially a consequence of the Lebesgue density theorem (which for the dyadic metric is an immediate consequence of the convergence of conditional expectation given the dyadic filtration). Fix δ > 0, and let q be such that µ is s-rich at resolution (N, q, δ ) for all sufficiently large N. Write for any Borel set B, provided N is large enough depending on δ and q only. By the density point theorem, for µ almost all x ∈ A, the sequences µ x,n A and µ x,n are ρ-asymptotic (i.e. ρ(µ x,n A , µ x,n ) → 0). In particular, if N is large enough (depending on δ ), we then have µ A (B) > 1 − δ , where Here we used that H q is continuous on (P([0, 1) d ), ρ). Recalling (3.1) we conclude that, always assuming N is large enough, This gives the claim.
Recall that µ ∈ P(R d ) is called (s,C)-Ahlfors regular if C −1 r s ≤ µ(B(x, r)) ≤ Cr s for all x ∈ Supp(µ) and all r ∈ (0, 1]. If this holds only for r ∈ [2 −N , 1], we say that µ is (s,C)-Ahlfors regular at scale 2 −N . We also say that a set A is (s,C)-Ahlfors regular if the restriction H s | A is a positive finite (s,C)-Ahlfors regular measure.
Given a discrete (s,C)-Ahlfors regular set at scale 2 −N contained in [0, 1] d , we can construct a measure µ in the following manner: We will see that s-Ahlfors regular measures are weakly s-regular. The following quantitative version of this will be crucial later.
Proof. Any constants implicit in the O notation are allowed to depend on d only. Since q < εN and it is enough to show that µ is s-rich at resolution (N − q, q, √ ε/C ). Write A = Supp(ν). We begin by noting that for any D ∈ D giving the claim. In particular, we see that H q (µ x,n ) ≤ s + O(logC/q) ≤ s + O(ε) for any x ∈ Supp(µ) and any n ∈ [N − q].
We know from Lemma 2.1, the assumption and (3.3) that a.e. η, we can rewrite as where the constant C was chosen so that the integrand is positive. The lemma now follows from Markov's inequality.
As an immediate consequence, we deduce that a class of measures, including s-Ahlfors regular measures, are indeed weakly s-regular.
Corollary 3.5. If µ is supported on an s-Ahlfors regular set and dim e µ = s, then µ is weakly s-regular. In particular, this is the case for ν A when ν is s-Ahlfors regular and ν(A) > 0.
Proof. Fix δ > 0 and take q large enough that log(C)/q < δ 2 . Since dim e µ = s, we know that H N (µ) > s − δ 2 for large enough N. If N is also large enough that N > δ −2 q, then the previous lemma says that µ is rich at resolution (N, q, O(δ )).
For the latter claim, note that ν A has exact dimension s (as a consequence of the density point theorem), so that dim e ν A = s.

Proof of Theorem 1.1, and consequences 4.1 Discrete conical density lemmas
In the proof of Theorem 1.1 we will require some discrete conical density results. These are similar to those in [21,Section 3].
Lemma 4.1. Given β > 0, there is a constant C = C(β ) > 0 such that the following holds. If A is k-discrete and for each a ∈ A there is a direction v such that Proof. We begin with a simplification. Choose a finite set {v j } with O β (1) elements such that for every v ∈ S 1 there exists v j with Hence, if A is as in the statement, for every a ∈ A we can pick j(a) such that Moreover, by passing to a further refinement with |A|/O β (1) elements, we can assume that the elements of A j are (2 −k )-separated. This shows that it is enough to prove the following statement: if v 0 is a fixed direction, and A ⊂ [0, 1] 2 is a (2 −k )-separated set such that where v ⊥ 0 is a unit vector perpendicular to v 0 . It follows from our assumptions on A that |Π(a) − Π(a )| sin(β /2) ≥ 2 −k for any distinct a, a ∈ A. In particular, Π| A is injective and its range has O β (2 k ) elements so |A| ≤ O β (2 k ), as claimed.
For sets which are dense in a discrete s-Ahlfors regular set, we obtain the following consequence.
Let E ⊂ B be the set of all points in B which are not well surrounded, and suppose |E| > 2 (1−κ)sN . Let E 1 be a maximal (2 −κ N )-separated subset of E. Since each ball of radius 2 −κ N contains O(C)2 (1−κ )sN points of A ⊃ E, it follows that |E 1 | > Ω(C)2 (κ −κ)sN . Note that (κ − κ)s > κ, and let C = C (β ) be the constant given by Lemma 4.1. Provided N is large enough that Ω(C)2 (κ −κ)sN > C 2 κN , it follows from Lemma 4.1 and the definitions that E 1 contains a well surrounded point. This contradiction proves the lemma.

Pinned distance sets in discrete regular sets
The core of the proof of Theorem 1.1 consists in showing the existence of one large pinned distance set. We state and prove the corresponding statement separately: Proposition 4.3. Given s > 1,C > 1,t ∈ (0, 1), there exist ε = ε(s,C,t) > 0 and N 0 = N 0 (s,C,t, ε) ∈ N such that the following holds: if N ≥ N 0 , and A ⊂ [0, 1] 2 is a subset of a discrete (s,C)-Ahlfors regular set at scale 2 −N , such that |A| ≥ 2 (s−ε)N , then there exists x ∈ A such that Before embarking on the proof of this proposition, we show how to deduce Theorem 1.1 from it.
The rest of this section is devoted to the proof of Proposition 4.3. Suppose the claim is false. Then we can find sequences By passing to a subsequence if needed, we may assume that µ j [0,N j ] converges to some P ∈ P(P([0, 1) 2 )) in the ρ topology. By Lemma 2.8, P is a CPD. We underline that P needs not be ergodic under M; if it was, the next lemma would hold automatically. It is only in this lemma that the hypothesis of Ahlfors-regularity gets used. Lemma 4.4. dim * P ≥ s Proof. Since P-a.e. measure is exact-dimensional, it is enough to show that dim e ν ≥ s for P-a.e. ν. In turn, by Borel-Cantelli this will follow if we can show that for every δ > 0, if q is sufficiently large (depending on δ ), then P{η : Since ε j → 0, we know that |A j | ≥ 2 (s−δ /2)N j for large enough j. Since B j , and hence A j , hits at most C points in each dyadic square of side length 2 −N j , a calculation shows that, if j is large enough, then Lemma 3.4 (together with Lemma 3.3(2) applied to B j ) can then be invoked to conclude that, given q is taken large enough in terms of δ , and then j is taken large enough in terms of q, the measure µ j is s-rich at resolution (N j , q, √ δ /C ) for some universal C > 0. Since H q is continuous on (P([0, 1) d ), ρ), the set {η : H q (η) ≥ s − √ δ /C } is compact, so we can pass to the limit to obtain our claim (4.1).
At this point we fix a small δ > 0. In the end, a contradiction will be obtained provided δ was taken sufficiently small.
Let E q , E be the functions given by Theorem 2.7. We fix v ∈ S 1 such that E(v) = 1 (this is possible because dim * P > 1). Pick q large enough that 1/q ≤ δ and (recalling the definition of E q ) We take j large enough that |A j | ≥ 2 (1−δ /2)sN j . We know from Lemma 4.2 that, again assuming j is large enough, there is a set E j with |E j | ≤ 2 (1−δ )sN j such that if x ∈ A j \ E j , then there is y ∈ A j with y ∈ X(x, 2 −q−1 , v) and |x − y| ≥ 2 −Kδ N j , with K > 0 depending only on s.
Write M j = (K +1)δ N j and note that if y ∈ X(x, 2 −q−1 , v) and |x−y| ≥ 2 −Kδ N j , then y ∈ X(x , 2 −q , v) for all x ∈ D M j (x), again provided j is large enough (the point is that the diameter of D M j (x) is very small compared to |x − y|). If D j,1 , . . . , D j,L j ∈ D (2) M j is an enumeration of the the squares containing some point of A j \ E j , the previous observations show that, if j is sufficiently large, then: Since P-a.e. measure is exact dimensional and has dimension > 1, P-a.e. measure gives no mass to lines, hence the function η → H q (Π v η) is continuous P-almost everywhere. Consequently, if j is large enough we deduce from (4.2) that On the other hand, note that for any η ∈ P([0, 1) 2 ), and any 1 ≤ M ≤ n, there is a decomposition Hence, if we denote ν j,k = (µ j ) D j,k , adding up over n = M j , M j+1 , . . . , N j yields where Q has total mass at most δ by (4.3).
It follows from (4.4) and (4.5) that for large enough j there exists a square D j,k with From now on we fix such a good square D j,k for each j, denote it simply by D j and forget about the other squares. We also denote ν j = ν j,k and y j = y j,k . Recall that this is the point in A j , whose existence we established earlier, such that y j ∈ X(x, 2 −q , v) for all x ∈ D j . Using again that M j /N j ≤ (K + 1)δ , we get We have arranged things so that the hypotheses of Corollary 2.3 are met. Since 1/q < δ , we conclude that, provided j is large enough that q/N j < δ , provided j is large enough (depending on δ ). This contradicts with if δ is small enough, yielding the result.

Proof of Corollaries 1.2 and 1.3
It is now easy to deduce Corollaries 1.2 and 1.3.
Proof of Corollary 1.2. Let A be as in the statement. Write A N for the collection of centers of squares in D N hitting A, so that in particular A is contained in the 2 −N -neighborhood of A N . By Lemma 3.3, the sets A N are contained in a (s,C )-discrete Ahlfors regular set at scale 2 −N , for some C = O(C). Let ε = ε(s,C ,t) > 0 be the value given by Theorem 1.1. By the theorem, if N is large enough, then there is a set Remark 4.5. In fact, dim H can be replaced by dim MB in the first part of the corollary above -the proof is identical. Moreover, a small variant of the proof shows that, under the same assumptions, Proof of Corollary 1.3. We give the proof for dim B , the proof for dim B is almost identical. As in the proof of Corollary 1.2, we let A N be the (2 −N )-discretization of A, so that A N is contained in the (2 −N )neighborhood of a (s,C )-discrete Ahlfors-regular set with C = O(C). Fix t ∈ (0, 1); it is enough to show that dim B (dist(A, A)) ≥ t. Let ε = ε(s,C ,t) > 0 be the number given by Theorem by the triangle inequality, so the claim follows.

Distances between two sets
Now we investigate the set of distances between two sets. The following result immediately implies Theorem 1.4. We begin the proof of Theorem 5.1, by showing that it is enough to prove the corresponding claim for lower box counting dimension. Proof. Let A, B be as in the statement of Theorem 5.1. Without loss of generality, A and B can be taken to be compact. Moreover, by Frostman's Lemma, we may further assume that dim H (A ∩ B(x, r)) > 1 for any open ball B(x, r) for which A ∩ B(x, r) = / 0 (more precisely, let ν be a measure supported on A such that ν(B(x, r)) ≤ C r s for some s > 1, and replace A by the support of µ). Finally, we may assume that Supp(µ) = B simply by replacing B by Supp(µ B ).
After these reductions, suppose dim MB (dist(A, B)) = t < 1, and partition dist(A, B) into countably many Borel sets D j , so that dim B (D j ) ≤ t for all j. By Baire's Theorem (and since we are assuming that A and B are compact), dist −1 (D j ) has nonempty interior in A × B for some j. Hence dist −1 (D j ) contains a set of the form A 0 × B 0 where, by our assumptions, dim H (A 0 ) > 1 and µ(B 0 ) > 0. This contradicts (5.1).
Recall that the direction determined by two different vectors x, y ∈ R 2 is denoted by σ (x, y). In the next Lemma we perform a further regularization of the set B; this step uses a recent result of Mattila and Orponen [16]. Lemma 5.3. In order to prove Theorem 5.1, it is enough to prove the following.
Let A, B, µ be as in the statement of the theorem, and further assume that A, B are compact and disjoint and that there exists a set Θ ⊂ S 1 of positive length such that for each v ∈ Θ, where ε(δ ) ↓ 0 as δ ↓ 0.
Proof. Suppose there exist A, B, µ as in Theorem 5.1 with dim B (dist(A, B)) < 1.
In light of Lemma 5.2, to derive a contradiction it is enough to show that, given δ > 0, we can find subsets A 0 , B 0 of A, B (depending on δ ), so that the pair (A 0 , B 0 ) satisfies the assumptions in the present lemma. We start by noticing that we can easily make A, B disjoint by taking appropriate subsets so we assume that they are already disjoint as given. By [16,Corollary 1.5], for µ-almost every y ∈ B, the set Θ y = {σ (x, y) : x ∈ A} has positive length. Notice that the set is Borel (we leave the routine verification to the reader). Thus, by Fubini, (γ × µ)(ϒ) > 0 (where γ is Lebesgue measure on S 1 ). Let (v 0 , y 0 ) be a (γ × µ)-density point of ϒ (for its existence, see e.g. [15,Corollary 2.14]). We can then find compact neighborhoods Θ 0 of v 0 and B 0 of y 0 , such that Applying Fubini once again, we conclude that for v in a set Θ of positive measure (contained in Θ 0 ), µ{y ∈ B 0 : v ∈ Θ y } > (1 − δ )µ(B 0 ).
Replacing B and µ by B 0 and µ B 0 concludes the proof.
Proof of Theorem 5.1. We will prove the claim of Lemma 5.3 with ε(δ ) = O(δ ). Hence, let A, B, µ, Θ and δ be as in that lemma. We also assume, as we may, that B ⊂ [0, 1) 2 .
Let t = dim B (dist(A, B)). Our goal is then to show that t > 1 − O(δ ). Recall that N(X, 2 −N ) stands for the number of cubes in D N hit by the set X. Let N j → ∞ be a sequence such that log N(dist (A, B) By passing to a subsequence if needed, we may assume that µ B [0,N j ] converges, in the ρ topology, to a distribution P which, as we have seen in Lemma 2.8, is a CPD. Moreover, using weak 1-regularity of µ, the same argument from Lemma 4.4 shows that dim * P ≥ 1.
Let E q and E be as in Theorem 2.7. By the last part of that theorem, we know that E(v) = 1 for almost all v. Thus, since Θ has positive measure, we can fix v such that E(v) = 1 and v ∈ Θ.
From this point on, the proof is similar to that of Proposition 4.3 but simpler as we do not need quantitative estimates. Since E q → E pointwise, we can fix q = q(P, δ ) such that E q (v) > 1 − δ 2 and 1/q < δ . Recalling the definition of E q , we see from Markov's inequality that Now since A and B are compact and disjoint, there exists k (depending on A, B, q) such that if x ∈ A, y ∈ B and σ (x, y) = v, then |σ (x, y ) − v| ≤ 2 −q if y ∈ D k (y). Next, let B 0 be the union of D k (y) over all y such that σ (x, y) = v for some x ∈ A. Note that µ(B 0 ) > 1 − δ by hypothesis. Let D 1 , . . . , D be the cubes in D k that make up B 0 , and pick y i ∈ D i , x i ∈ A such that σ (x i , y i ) = v (i.e. if there are many such pairs we select one; this can be done in a Borel manner although we do not require this). Arguing exactly as in the proof of Proposition 4.3, for each sufficiently large j we find a cube D i (with i depending on j) such that Hence, there is a value of i such that the above happens infinitely often. From now on we fix that value of i, and write M j → ∞ for the corresponding subsequence of N j .
Write φ x (y) = 1 2 |x − y|. It follows from (5.3) and Corollary 2.3 that if j is large enough, then Since φ x i µ D i is supported on 1 2 dist(A, B) and M j is a subsequence of N j , we conclude from (5.2) that which is what we wanted to show.
Remark 5.4. The proof of [16,Corollary 1.5] goes through under the assumption of positive 1-capacity rather than Hausdorff dimension > 1 (or finite I 1 energy for the corresponding statement for measures that occurs in the proof). Hence, the assumptions in Theorem 5.1 can be weakened to positive 1-capacity of A and I 1 (µ) < +∞ instead of dim H µ > 1 (we still need to assume that µ is weakly 1-regular). This gives many examples of (pairs of) sets of dimension 1 to which the results apply.
Proof of Corollary 1.5. Let A 0 = {x ∈ A : dim B (dist(x, B)) = 1}. The proof of Theorem 5.1 shows that A 0 is nonempty (we begin with a sequence N j → ∞ such that µ B [0,N j ] converges; the rest of the proof is identical). This implies that dim H (A \ A 0 ) ≤ 1, for otherwise there would be x ∈ A \ A 0 such that dim B (dist(x, B)) = 1.