{'fraction_non_alphanumeric': 0.06649573131216364, 'fraction_numerical': 0.013552731678453693, 'mean_word_length': 3.8413586141044878, 'pattern_counts': {'":': 1, '<': 33, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Small-Size Relative (p,Epsilon)-Approximations for Well-Behaved Range Spaces

We present improved upper bounds for the size of relative (p,Epsilon)-approximation for range spaces with the following property: For any (finite) range space projected onto (that is, restricted to) a ground set of size n and for any parameter 1<= k<= n, the number of ranges of size at most k is only nearly-linear in n and polynomial in k. Such range spaces are called"well behaved". Our bound is an improvement over the bound O(\log{(1/p)/\eps^2 p) introduced by Li etal. for the general case (where this bound has been shown to be tight in the worst case), when p<<Epsilon. We also show that such small size relative (p,Epsilon)-approximations can be constructed in expected polynomial time. Our bound also has an interesting interpretation in the context of"p-nets": As observed by Har-Peled and Sharir, p-nets are special cases of relative (p,Epsilon)-approximations. Specifically, when Epsilon is a constant smaller than 1, their analysis implies that there are p-nets of size O(\log{(1/p)}/p) that are \emph{also} relative approximations. In this context our construction significantly improves this bound for well-behaved range spaces. Despite the progress in the theory of p-nets and the existence of improved bounds corresponding to the cases that we study, these bounds do not necessarily guarantee a bounded relative error. Lastly, we present several geometric scenarios of well-behaved range spaces, and show the resulting bound for each of these cases obtained as a consequence of our analysis. In particular, when Epsilon is a constant smaller than 1, our bound for points and axis-parallel boxes in two and three dimensions, as well as points and"fat"triangles in the plane, matches the optimal bound for p-nets.


Introduction
It was also observed in [13] that p-nets and ε-approximations are special cases of (ν, α)-samples. The first is a subset N ⊆ X with the property that any range τ ∈ R with |τ ∩ X| ≥ p|X| contains an element of N , and the latter is a subset Z ⊆ X with the property that any range τ ∈ R satisfies: |X(τ ) − Z(τ )| ≤ ε.
In this paper we present improved bounds on the size of relative (p, ε)-approximations under certain assumptions, and emphasize their implications to p-nets-see below.
Previous results. It has been shown in [29] that range spaces of finite VC dimension d always admit an absolute-error ε-approximation of size O(log (1/ε)/ε 2 ), where the constant of proportionality depends on d (see also [5,6,20,24]). In fact, a random sample of that size is an ε-approximation with constant probability. As noted in [13], the analysis in [17] (see also [28]) reduces this bound to O(1/ε 2 ), where, once again, a random sample of that size is an ε-approximation with a constant probability. In fact, as shown in [5,6,20], the size of the ε-approximation can be further improved to be slightly higher than O(1/ε 2−2/(d+1) ); see [13] for a more comprehensive review of these results.
Concerning relative (p, ε)-approximations, as noted in [13], any absolute error εp-approximation Z will approximate ranges of measure at least p to within relative error ε. Nevertheless, the bound in [29] for absolute-error approximations just mentioned yields a sample of size O(log (1/(εp))/ε 2 p 2 ) in this case, whereas the bound of Li et al. [17] is smaller by roughly a factor of 1/p (see the discussion above).
In addition to the observations made by Har-Peled and Sharir [13], their analysis also improves the bound on the size of relative (p, ε)-approximations for several special cases of geometric range spaces. Specifically, the bound obtained for point sets in the plane and halfplane ranges has been improved to O log 4/3 (1/(pε)) ε 4/3 p (this is an improvement if ε is sufficiently small with respect to p). In 3-space they reduced the bound to O log 3/2 (1/(pε)) ε 3/2 p , although this latter case is somewhat restricted, as this is the bound on the overall size of O(log (1/p)) subsets, and each halfspace range has one such subset that constitutes its relative approximation.
Our results. In this paper we derive improved bounds for range spaces with certain favorable properties, which we call "well-behaved". Our goal is to improve the dependency on p, which is somewhat different than the improvement obtained in [13]. That is, for any induced (finite) ranges space, the number of ranges of size k is only nearly-linear in the size of the space and polynomial in k, where k > 0 is an integer parameter. We first present our technique on abstract range spaces that satisfy these properties, in which case we show there exists a sample of size roughly O((log log (1/p) + log (1/ε))/ε 2 p) (see Corollary 2.5 for the exact bound), from which the relative approximation is derived. We also present an algorithm that constructs such a sample in expected polynomial running time. In fact, this sample consists of two subsets of the aforementioned overall size, on which we assign weights, in order to obtain a single weighted sample with the desired properties; see Section 2 for this derivation and the discussion below.
As observed by Har-Peled [12] relative approximations are interesting in the case where p = o(ε), since one can approximate ranges of measure larger than p with a sample that has only linear dependency on 1/p. Our bounds improve over the bound of Li et al. [17] for these cases. Nevertheless, our bounds also have an interesting interpretation when ε is some fixed constant in (0, 1). In this case, as mentioned earlier, the relative (p, ε)-approximation becomes a p-net. Thus when ε is a constant smaller than 1, a p-net of size O(log (1/p)/p) (with a constant of proportionality depending on the VC dimension d) always exists by applying the bound of Li et al. [17]. In this case, each range of measure at least p contains roughly log (1/p) points of the sample. Nevertheless, in some cases it might be wasteful to sample this number of points in order to guarantee a small relative error. There are several known constructions for small-size p-nets, see, e.g., [3,8,19,16,21,27,30] for several such improved bounds. However, we are not aware of any such small-size p-nets that are also relative approximations. Our bound guarantees such properties. For example, for primal range spaces of points and axis-parallel boxes in two and three dimensions this bound becomes O (log log (1/p) p instead of the standard bound O(log (1/p)/p). This bound matches the previously known (optimal) bound for p-nets [3,25].
We also note that the task of constructing a relative (p, ε)-approximation is much more difficult than just constructing p-nets. Indeed, in p-nets we aim to add sufficiently many objects (e.g., points) into the output sample so as to guarantee that each range of measure at least p is indeed stabbed, whereas in relative (p, ε)-approximations we also need to keep the set of the chosen objects under control in order to have a balance between the original measure and the approximate measure for each range τ .
In our analysis we initially replace the set of the input objects with a relative (p, ε)-approximation F of size O log (1/(pε)) ε 2 p . We then classify the objects of F as "heavy" (that is, objects that participate in many ranges) and "light" (otherwise). We show that the number of heavy objects is relatively small. For the light objects, we randomly and independently choose each of them into the new relative (p, ε)-approximation with some probability π (calibrated to produce a sample of a certain expected size). Since the original range space is well-behaved, we are able to show that each range τ (of any measure 0 < p ′ < 1) admits a small degree of dependency in the space of events "A τ : does the relative error for τ exceeds ε?". We then apply the asymmetric version of the Local Lemma of Lovász in order to conclude that with a positive probability there exists such a "good" sample for which the relative error of all such ranges does not exceed ε. In fact, we show that both conditions of having a good sample (in the above sense) and keeping its size close to its expectation (up to some constant factor) happen with a positive probability-this latter condition can be included into the Local Lemma, which extends to that case. See Section 2 for these details.
The manner in which we construct our relative approximation enforces a somewhat different form for the measure Z(τ ). This is due to two main ingredients of our analysis: (i) Contrary to the standard constructions of relative (p, ε)-approximations [17] (as well the the construction in [13]), absolute ε-approximations (e.g., [5]), and p-nets (e.g., [8,30]), where the size of the sample is fixed 2 , in our probabilistic model each object is chosen independently with a fixed probability π, and thus in the denominator of the measure we replace the size of the sample by its expectation. (ii) Our sample consists of two subsamples, where the first one H consists of a pre-determined subset of the input, which, due to its small size, is taken in its entirety into the output, and the second sample F 1 is obtained by choosing each input object randomly and independently with probability π . This results in a biased sample. Specifically, we obtain a weighted measure, in which we assign a unit weight to each object in F 1 , and a weight π to each object in H.
Lastly, we list several useful applications of well-behaved geometric range spaces, including primal range spaces of points and halfspace ranges in two and three dimensions, points and axis-parallel boxes in two and three dimensions (as well as points and "fat" triangles in the plane), and dual range spaces involving planar regions of nearly-linear union complexity.
We note that our technique is inspired by the machinery of Varadarajan [30] for constructing small-size p-nets for dual range spaces of "α-fat" triangles and points in the plane, where the idea for exploiting the (simpler version of the) Local Lemma of Lovász has initially been introduced, as well as classifying each object as "heavy" or "light". Nevertheless, the technique in [30] does not necessarily produce a relative approximation, but only guarantees that the sample is a p-net, which is the reason we had to generalize and enhance the ideas in [30] in order to be matched with the more intricate scenario arising in our problem. 2 In the sampling model in [17] the size of the sample is always bounded by O log (1/p) ε 2 p but the objects are chosen with repetitions.

Preliminaries
Well-behaved range-spaces. Let (U, R U ) be a range space of finite VC dimension. We say it is well behaved it it has the following property: Let (X, R) be any range space projected onto a finite subset X ⊆ U, where R = {{τ ∩ X} | τ ∈ R U }), and put n := |X|. Then, for any parameter 1 ≤ k ≤ n, the number of ranges in R of size ≤ k is at most O(nφ(n)k c ), where φ(·) is a slowly-growing function, and c > 0 is an absolute constant. In other words, for any induced (finite) range space (X, R) the number of ranges of size at most k is only nearly-linear in |X| and polynomial in k. Note that by definition any induced finite range space (X, R) as above is also well-behaved 3 .
In what follows we assume, without loss of generality, that 0 < p ≤ 1/8. Otherwise, if we also have ε ≥ 1/8, then the size of the relative approximation is a constant, and if 0 < ε < 1/8 is arbitrary (and p > 1/8) then an (absolute) (ε/8)-approximation always yields an error smaller than εp. In this case the size of the sample is only O(1/ε 2 ), as shown by Li et al. [17]. In addition, we assume p ≤ ε, otherwise, we output a sample of size O(log (1/p)/ε 2 p), as shown in [17].

The Construction
Let (X, R) be a well-behaved (finite) range space. We first replace the objects in X by a sample F ⊆ X that is a relative (p, ε)-approximation for (X, R); let T be the resulting collection of ranges projected onto F. By the discussion in Section 1, there exists such a sample of size D log (1/(pε)) ε 2 p , where D > 0 is a sufficiently large absolute constant. Moreover, a random sample of X of that size is a relative (p, ε)-approximation with constant probability. 4 The replacement of X with F implies that each range τ ∈ R satisfies: From now on, we focus on the construction of an improved relative (p, ε)-approximation for (F, T). This (standard) reduction involves no loss of generality, because, as is easily verified, a relative (p(1−ε), ε)approximation of a relative (p, ε)-approximation is a relative (p, 2ε + ε 2 )-approximation. Hence by scaling p and ε by the appropriate constant factors, it suffices to construct a relative (p, ε)-approximation for (F, T).
Our construction partitions τ ∩ F into two subsets, and represents the approximation for |τ ∩ F| as the sum of two appropriate sample measures-see below for details, and for the consolidation of the two samples into a common (weighted) set.
A range τ is said to lie at the ith layer S i of T, for i = 1, . . . , log (1/p), if it satisfies For the sake of completeness, the 0th layer S 0 consists of those ranges τ with |τ ∩F| |F| < p.

Consider a fixed layer
. Equation (1) and the bound on |F | then imply that each range In other words, all ranges τ ∈ S i have size at most 2∆ i (and at least ∆ i , if i ≥ 1), i = 0, . . . , log (1/p), and they appear now as ranges from the range space (X, R) projected onto (that is, restricted to) F. The assumption that the (original) range space (X, R) is well-behaved implies that the number of the distinct ranges in a fixed layer A classification of the objects. The discussion above implies that the number of containments between the objects in F and the ranges in layer Hence, the overall number of heavy objects, over all layers i = 0, . . . , log (1/p), is only O(1/p). Let H denote this subset, which, from now on, we just refer to as the heavy objects. Note that, by construction, each remaining object (an object in F \ H) is light in each layer i = 0, . . . , log (1/p). Put L := F \ H and refer to its elements as the light objects.
We next consider, for each range τ , the two subsets H ∩ τ , L ∩ τ of heavy and light objects, respectively, which τ stabs, and approximate each of their measures in turn. First, since the number of heavy objects is only O(1/p), we put all of them in the target relative (p, ε)-approximation. In the sequel we describe our approximation with respect to the light objects.

The Analysis for the Light Objects
We first observe that the analysis above regarding the size of |H| allows us to assume that |L| ≥ |F|/2. Indeed, this easily follows by choosing the constant A sufficiently large.
We now restrict the range space (F, T) to L. Our goal is now to approximate L(τ ). We keep associating these ranges with the same layers S i , as defined in (1). Note that a range τ at layer i may now satisfy |τ ∩ L| ≪ ∆ i . This can happen, for example, when the overall majority of objects in τ ∩ F are heavy and then |τ ∩ L| is considerably smaller than |τ ∩ F|. These differences, however, do not affect the final approximation for F (τ ), which is a key observation in our analysis; see Section 2.3 for this derivation.
We next sample each object in L independently with probability π : , and let F 1 be the resulting sample. Thus its expected size is . Note that, by assumption φ(·) is a sublinear function, and p ≤ ε, thus we always have π < 1, as is easily verified. The main ingredients of the analysis are shown in the following proposition: Proposition 2.1. With some positive probability, F 1 satisfies, for every layer S i and for every range τ of S i , i = 1, . . . , log (1/p), (where Exp(·) denotes expectation) 5 : 5 Note that due to our sampling model we replace |F1| by Exp{F1}, which is in fact π · |L|. and |τ ∩ L| When i = 0 we have for each τ ∈ S 0 (in which case |τ ∩ L| < p|F|): Proof. Fix a layer S i and a range τ ∈ S i , i ≥ 1. Let A τ be the event that F 1 does not satisfy (2) for τ . We consider separately the following two cases: |τ ∩ L| ≥ 2 i−1 p|F|, and |τ ∩ L| < 2 i−1 p|F|.
we have: Using Chernoff's bound (see, e.g., [1]) and the fact that |τ ∩ L| ≥ |F| · 2 i−1 p, we thus obtain: , we obtain where B > 0 is a constant that depends linearly on D, and can be made arbitrarily large by choosing D sufficiently large.
(ii) |τ ∩ L| < 2 i−1 p|F|: Here A τ is the event: We then have: Applying once again Chernoff's bound, we obtain: Since in this case |L ∩ τ | < 2 i−1 p · |F|, and, as stated above, |L| ≥ |F|/2, we obtain that the latter term is bounded by 2 exp −π · ε 2 · (2 i−1 p) · |F|/12 , on which we can derive the same bound as in case (i), using similar considerations. Hence in summary we obtain in both cases ( The case i = 0 (or rather τ ∈ S 0 ) follows by similar considerations as in case (ii) above when replacing Applying the Asymmetric Local Lemma of Lovász. We next apply the Local Lemma of Lovász (see, e.g., [1]), to show that This will imply that there exists a sample F 1 of L that approximates |τ ∩ L| as in (2), for all ranges τ . Specifically, we are going to apply the asymmetric version of the Local Lemma, stated below in the context of our problem.
We first observe that for a pair of ranges τ , τ ′ , the corresponding events A τ , A τ ′ are mutually independent if and only if there is no object in L that participates in both τ , τ ′ . Indeed, since we sample each object of L independently, the two corresponding events A τ , A τ ′ can affect each other only if there is an object in L that τ , τ ′ share. In what follows we denote a pair E, E ′ of mutually dependent events by E ∼ E ′ .
Let E i denote the collection of events A τ for all ranges τ at a fixed layer i, and let E denote the entire collection log (1/p) i=0 E i . In order to apply the asymmetric version of the Local Lemma we need to show there exists an assignment x : E → (0, 1), such that for each A τ ∈ E. The Local Lemma of Lovász then implies that (Once again, see [1] for further details.) In Lemma 2.2 we show that there exists such a valid assignment. This will complete the proof of the proposition.
We postpone the proof of Lemma 2.2 to Appendix A.1, but leave several remarks below.
Remarks: 1). We note that for each τ ∈ S j , the exponent 2 j−1 in the bound on Prob{A τ } "beats" the term ∆ c+2 j in the degree of dependency (see Appendix A.1). Nevertheless, when i > j, this exponent cannot beat ∆ i , which is the reason we set x(A τ ) = exp 2 i+1 Prob{A τ }. This also demonstrates the crucial property of classifying the ranges according to their layers, and then bounding the probability to fail to produce a relative (p, ε)-approximation in each of these layers, as we did in Proposition 2.1. In other words, just the information |τ ∩ L| ≥ p|F| or |τ ∩ L| < p|F| (which is the standard "cut-off" in relative approximations) is insufficient to produce a relative bounded error in the manner that we do. 2). We note that applying the simpler version of the Local Lemma of Lovász, in each fixed layer i, is almost immediate (a similar step has been taken in [30] for "fat" triangles in the plane and points). Indeed, each range has a degree-of-dependency δ that is at most O(φ(|F|)∆ i c+3 ). Following Inequality (3), we obtain δ · Prob{A τ } < 1/e, for a sufficiently large choice of D (and thus of B). In this case, the Local Lemma implies that, with a positive probability, all the complementary events A τ (for A τ in layer i) are satisfied. Nevertheless, this property is not guaranteed for the entire set of events over all layers, as the interaction among events from different layers may involve a higher degree of dependency. This is the main reason we had to resort to the asymmetric version of the Local Lemma, which, as our analysis shows, overcomes this difficulty, and eventually obtains a single sample for all layers.
Bounding the size of the sample. As noted above, the expected size of Nevertheless, we need to show that a sample of that actual size exists and that it satisfies the assertions in Proposition 2.1. In Appendix A.2 we show that Lemma 2.2 can be extended to include the event B that |F 1 | deviates from its expectation by some constant factor. This yields: Corollary 2.3. There exists a sample F 1 ⊆ L that satisfies the assertion of Proposition 2.1, whose size is

Deriving the Relative Approximation
We now combine the two samples F 1 and H that we have constructed in order to derive the relative approximation for each range τ . By construction, |τ ∩ F| = |τ ∩ L| + |τ ∩ H|. Combining the two cases in (2) for each range τ in S i , i = 1, . . . , log (1/p), and adding the term |τ ∩ H|/|L| for each side of the inequality, we have: Substituting Exp{F 1 } = π|L|, we obtain: Since L ⊆ F, the above inequality can be written as For i = 1, . . . , log (1/p), since |τ ∩F| |F| ≥ (2 i−1 p) (by definition), this implies that When i = 0, we have |τ ∩F| |F| < p, and then, using similar considerations as above, the case i = 0 of (2) implies: and we can replace the term εp by 2εp in order to be consistent with the previous form obtained for i = 1, . . . , log (1/p).
Note that the measure approximating |τ ∩F| |F| can be interpreted to be defined on a weighted sample, where each object of F 1 is assigned a unit weight, and each object of H is assigned a (fractional) weight π. Also, observe that the total expected weight of the sample satisfies Exp{|F 1 | + π|H|} = π|L| + π|H| = π|F| (matching the denominator in our measure), and so in our construction this weighted measure replaces the standard "uniform measure" Z(τ ) (defined in the introduction) resulting when the entire relative approximation is obtained as a uniform sample.
A polynomial-time algorithm. We note that classifying the objects as light or heavy can be done in time polynomial in |F| (we omit these straightforward details here). In order to apply the Local Lemma in a constructive manner, we resort to a recent result by Moser and Tardos [23]. In our scenario we apply the extended version of Lemma 2.2 (including the event B), discussed briefly above and proved in Appendix A.2.
The main property required in order to apply the randomized algorithm described in [23] is the fact that the objects in F 1 are chosen randomly and independently with probability π. That is, the set L induces a finite set of mutually and independent random variables. Then each event A τ ∈ E, as well as B, is determined by these variables. Omitting any further details, we obtain: Theorem 2.6. Given a well-behaved range space (X, R), one can construct in expected polynomial time, a (weighted) relative (p, ε)-approximation for (X, R), whose size is O((max{log log (1/p), log φ(|F|)} + log (1/ε))/ε 2 p).
Applications Using the bound in Theorem 2.4 we obtain several geometric settings that admit small-size relative (p, ε) approximations. We review these settings and their analysis in Appendix A.3, and conclude: Corollary 2.7. Any range space of points and axis-parallel rectangles in the plane admits a (weighted) relative (p, ε)-approximation of size O((log log (1/p) + log (1/ε))/ε 2 p), for any 0 < p < 1, 0 < ε < 1, which can be constructed in expected polynomial time. The same asymptotic bound holds for points and axis-parallel boxes in three dimensions, and points and α-fat triangles in the plane (where α > 0 is a constant). When ε is a constant these bounds match the optimal Θ(log log (1/p)/p) bound for p-nets.

Concluding Remarks.
This study raises several open problems and further improvements, some of which are under on-going research. First, it is very likely that the sampling scheme that we introduce can be applied over iterations, where at the kth iterations we are given a sample F k−1 , from which we extract the sets H k−1 , L k−1 of the corresponding heavy and light objects, and then sample each object from L k−1 with probabil- , obtaining F k ; we stop at iteration k if log (k+1) (1/p) < log φ(|F k−1 |). However, this process involves several technical difficulties since (i) the values of p, ε change over iterations, and (ii) the (weighted) measure becomes somewhat intricate, as it should consist of F k and all sets of heavy objects collected over all iterations. The author has several initial bounds obtained for this process, and she plans to finalize these details in the full version of this paper. This will tighten the current (probably, suboptimal) bounds stated in Corollaries 2.8 and 2.9.
Another interesting problem that we plan to study is whether the log (1/ε) factor in the enumerator of our bound can be removed. Li et al. [17] obtained such an improvement, where they reduced the previously known bound O(log (1/(pε))/ε 2 p) in [14,26] to O(log (1/p)/ε 2 p), which they showed to be optimal in the worst case. This improvement is derived by applying the chaining method of Kolmogorov. Roughly speaking, in this technique the standard union bound over a set of events (defined in some probability space) is replaced by a tighter bound when considering only a relatively small subset of events, each of which is "distinct" in some sense (such a subset is also called an "ε-packing" [12]). It is a challenging open problem to combine our machinery with the chaining method. Specifically, does an ε-packing exist in our scenario? If so, can one apply the Local Lemma of Lovász on the corresponding events?
Last but not least is the implications of our approach to the bounds on combinatorial discrepancy for well-behaved range spaces. In particular, even just the case of points and halfplane ranges is already challenging. Har-Peled and Sharir [13] showed that in such range spaces (P, H) the discrepancy χ(τ ∩ P ) of each range τ ∈ H is only O(|τ ∩ P | 1/4 log n), where n = |P |. This property eventually yields the improved bound for relative (p, ε)-approximations in this scenario; recall that the improvement in [13] is with respect to the dependency on ε. If the factor log n in χ(τ ∩ P ) can be reduced to o(log n) then this will yield an improvement in the parameter p as well. Nevertheless, we were unable to apply our technique on this setting so far, due to the differences in our probabilistic model and the one applied in [13].
Fix a range τ and a layer S i . We first observe that 0 < x(A τ ) < 1. The lower bound is trivial. For the upper bound, we obtain from (3) , which is smaller than 1 since B > 1 (and is chosen to be sufficiently large) and p ≤ 1/8 by our assumption.
We next consider all events A τ ′ with A τ ′ ∼ A τ , A τ ′ = A τ . Let i be the layer of the range τ , and let j be the layer of τ ′ . The corresponding product A τ ′ ∼Aτ ,A τ ′ =Aτ (1 − x(A τ ′ )) in the right-hand side of (4) can be spelled out for τ as We lower bound separately the sub-products involving layers S j with i ≤ j and layers S j with i > j.
By choosing B sufficiently large, we thus obtain: for a suitable constant 0 < B ′ < B that can be made arbitrarily large by choosing B sufficiently large. Having such a choice for B ′ , and recalling that p ≤ 1/8, we obtain that the latter expression is greater than , where κ > 0 is a large constant, whose choice depends on B ′ (and thus on B).
(ii) i > j: As in the previous case, τ has a degree-of-dependency at most α · φ(|F|)∆ i ∆ j c+2 with the layers of S j , and we have: Choosing B sufficiently large, we can assume that We can now use the inequality (1 − y) z ≥ e −2yz , for 0 < y ≤ 1/2. Proceeding as in the previous case, we have Applying an exponent stealing similar to the one above, we can cancel most of the other part of the expression, and end up with a lower bound of the form: where 0 < B ′′ < B is another constant sufficiently close to B. We can in fact assume that B ′′ = B ′ by replacing the larger of them by the smaller. Choosing B (and thus B ′ ) to be sufficiently large, and using, as above, the inequality p ≤ 1/8, we obtain that where κ > 0 can be chosen to be the same constant as in case (i).

Putting the bounds together:
We thus obtain, for a fixed range τ , For the first product we have For the latter product we have This implies that Given that κ is chosen to be sufficiently large we obtain as asserted. This completes the proof of the lemma.

A.2 Proof of Corollary 2.3
To this end, we strengthen (5) to include the event B : |F 1 | > (1 + γ) Exp{|F 1 }, where γ is a sufficiently large constant. 6 That is, we show that there exists an additional assignment x ′ : B → (0, 1), such that implying that all complementary events occur with a positive probability. By construction, for each each event A τ ∈ E, we have A τ ∼ B. We thus need to modify (4) as follows: 6 If fact, it is sufficient to show that Prob{B} is smaller than log (1/p) i=0 τ ∈S i (1 − Prob{Aτ }). However, in our analysis we include the event B into the local lemma in order to eventually be able to apply it in a constructive manner.
Indeed, we obtain using Chernoff's bound once again, the fact that Exp{|F 1 |} = π|L|, and |L| ≥ |F|/2: By (5) and the assignment of x(A τ ) in Lemma 2.2 we obtain: Using (3) and the fact that there are only O(|F|φ(|F|)∆ c i ) ranges in layer i, the latter term is lower bounded by for two absolute constants α, α ′ > 0. Applying once again "exponent stealing" similarly to the proof of Lemma 2.2, we obtain that this term is at least for a suitable constant 0 < B ′ < B that can be made arbitrarily large by choosing B sufficiently large.
Comparing the latter exponent with that of (10), we conclude that when γ is chosen to be sufficiently large. We now put x ′ (B) to be In other words, we set x ′ (B) to be the ratio between the upper bound on Prob{B} and the lower bound on Aτ ∈E (1 − x{A τ }). Due to this property we always have x ′ (B) · Aτ ∈E (1 − x{A τ }) > Prob{B}, and thus the second part of Inequality (9) is satisfied. We also note that when γ is chosen to be sufficiently large, we should have x ′ (B) < 1. In fact, x ′ (B) can be made arbitrarily small (by choosing γ sufficiently large), and then we have, say, x ′ (B) ≤ 1/2. This implies that we can modify Inequality (7) from the proof of Lemma 2.2 so that it now satisfies which shows the first part of (9).

A.3.1 Points and Axis-Parallel Boxes in Two and Three Dimensions
We begin with the two-dimensional case. It is well known that a set P of n points in the plane admits Θ(n 2 ) rectangular "empty" ranges (that is, these ranges do not contain any point of P in their interior); see, e.g., [3]. Thus we resort to the technique presented in [3,10] instead. We use the following property shown in [10] (and based on the analysis in [3]): Lemma A.1 (Ene et al. [10]). Given a set P of n points in the plane and a parameter k > 0, one can compute a set R k of O(k 2 n log n) axis-parallel rectangles (each of which is "anchored" either on its right side or its left side to a vertical line), such that for any axis-parallel rectangle r, if |r ∩ P | ≤ k, then there exists two rectangles r 1 , r 2 ∈ R k such that |(r 1 ∪ r 2 ) ∩ P | = |r ∩ P |.
Thus in this case c = 2 and φ(·) is the log(·) function, so the range space (P, R n ) is well-behaved. In order to bound the relative error for the original (non-anchored) rectangular ranges we proceed as follows.
Let τ be such a range realized by a rectangle r, let r 1 , r 2 be its two corresponding portions satisfying the property in Lemma A.1, and let τ 1 , τ 2 be {r 1 ∩ P }, {r 2 ∩ P }, respectively. We now replace P by the corresponding sample F, and, as before, denote by T the set of the resulting ranges, and then apply Theorem 2.4 in order to obtain: for i = 1, 2. By combining these inequalities for τ 1 , τ 2 , we obtain: This implies that F 1 ∪ H is a relative (p, 3ε)-approximation for (F, T) (in the above "weighted sense"), and |F 1 ∪ H| = O((log log (1/p) + log (1/ε))/ε 2 p).
When P is a set of points in three dimensions, one can obtain similar properties to those in Lemma A.1, derived from the analysis in [3]. In this case one can compute a set B k of O(k 2 n log 3 n) axis-parallel boxes such that for any axis-parallel box b, if |b ∩ P | ≤ k, then there exists eight boxes b 1 , . . . b 8 ∈ B k such that |(∪ 8 i=1 b i ) ∩ P | = |b ∩ P |. We omit the straightforward details in this version. Thus in this case c = 2 and φ(·) is the log 3 (·) function, so the range space (P, B n ) is well-behaved. As above, put τ i := {b i ∩ P }, i = 1, . . . , 8. Replacing P with F once again, applying Theorem 2.4, and then combining the resulting inequalities for τ i , i = 1, . . . , 8: and thus F 1 ∪ H is a relative (p, 9ε)-approximation for (F, T), and its size has the same asymptotic bound as in the two-dimensional case.
Points and α-fat triangles in the plane. When P is a set of n points in the plane and the ranges are α-fat triangles (that is, triangles for which each of their angles is at least α) the analysis in [10] implies: Lemma A.2 (Ene et al. [10]). Given a set P of n points in the plane, a parameter k, and a constant α > 0, one can compute, in polynomial time, a set T k of O(k 3 n log 2 n) regions, such that for any α-fat triangle ∆, if |∆ ∩ P | ≤ k, then there exists (at most) 9 regions in T k whose union has the same intersection with P as ∆ does.
Using similar arguments and notation as in the case for axis-parallel boxes (here we have c = 3 and φ(·) is the log 2 (·) function), we obtain: and thus is F 1 ∪ H is a relative (p, 10ε)-approximation for (F, T), and its size has the same asymptotic bound as in the previous cases.
We now appropriately scale the parameters ε, p, for each of the above three settings, in order to obtain Corollary 2.7.

A.3.2 Points and Halfspaces in Two and Three Dimensions
Let P be a set of n points, and let H denote all halfspace ranges. Using the random sampling theory of Clarkson and Shor [7], for any subset of m points of P , the number of halfspaces of size at most k, for any integer parameter 0 ≤ k ≤ m, is O(mk + m) in two dimensions and O(mk 2 + m) in three dimensions. It thus follows that in both cases (P, H) is a well-behaved range space, and we can thus apply Theorem 2.6 for these cases, thereby showing Corollary 2.8.

A.3.3 Planar Regions of Nearly-Linear Union Complexity and Points
Let R be a set of n (closed) connected planar regions, and let U(R) = R denote the union of R. The combinatorial complexity of U(R) is the number of vertices and edges of the arrangement A(R) that appear along ∂U(R). For r ≤ n, let u(r) denote the maximum complexity of the union of any subset of r regions in R, measured as above. We assume that u(r) is nearly linear, i.e., u(r) ≤ rϕ(r), where ϕ(·) is a (sublinear) slowly growing function.
We now consider the dual range space defined on R and all points in the plane. In fact, it is fairly standard to show that these ranges correspond to all faces in the arrangement A(R), where each range is the subset of regions covering a fixed face of A(R). Using a standard application of the Clarkson-Shor technique [7], for any subset of r regions of R, the number of such faces of size at most k, for any integer parameter k > 0, is O(k 2 u(r/k)), or O(krϕ(r/k)). Applying Theorem 2.6, we obtain: Corollary A.3. Let R be a set of n planar regions such that the union complexity of any r of them is u(r) = rϕ(r), where ϕ(·) is a (sublinear) slowly growing function. Then any dual range space on R and a set of points in the plane admits a (weighted) relative (p, ε)-approximation of size O max{log log (1/p), log ϕ(log (1/(εp))/ε 2 p)} + log (1/ε)) ε 2 p ,